|
|
@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react' |
|
|
|
import { connect } from 'react-redux'; |
|
|
|
import moment from 'moment'; |
|
|
|
import { RouteRequest } from '@peace/utils'; |
|
|
|
import { RouteTable } from '$utils' |
|
|
|
import { Func } from '$utils' |
|
|
|
|
|
|
|
import { Tabs, Form, Input, Space, Button, Table, message } from 'antd'; |
|
|
|
const { Search } = Input; |
|
|
@ -14,7 +14,7 @@ import ResourceModal from '../components/resourceModal'; |
|
|
|
import { If } from 'react-if'; |
|
|
|
|
|
|
|
|
|
|
|
function ServiceView ({ loading, clientHeight, actions, dispatch, }) { |
|
|
|
function ServiceView({ loading, clientHeight, actions, dispatch, user }) { |
|
|
|
|
|
|
|
const { dataService, metadataManagement } = actions |
|
|
|
const [query, setQuery] = useState({ page: 0, limit: 10 }); |
|
|
@ -54,15 +54,19 @@ function ServiceView ({ loading, clientHeight, actions, dispatch, }) { |
|
|
|
dataIndex: 'handle', |
|
|
|
width: '250px', |
|
|
|
// ellipsis: true,
|
|
|
|
render: (text, record) => <div style={{ width: 200, display: 'flex', justifyContent: 'space-evenly' }}> |
|
|
|
render: (text, record) => { |
|
|
|
const isCurrentOrg = Func?.isOrgOrSuperAdmin(record?.resourceCatalog?.organization?.id) |
|
|
|
return <div style={{ width: 200, display: 'flex', justifyContent: 'space-evenly' }}> |
|
|
|
<a onClick={() => { |
|
|
|
setEditData(record) |
|
|
|
setEditModal(true) |
|
|
|
setViewDetails(true) |
|
|
|
}}>查看详情</a> |
|
|
|
<a onClick={() => { |
|
|
|
{!isCurrentOrg && <a onClick={() => { |
|
|
|
let result |
|
|
|
record?.resourceConsumptions?.map(v => { |
|
|
|
record?.resourceConsumptions |
|
|
|
?.filter(v => v.applyBy == user?.id) |
|
|
|
?.map(v => { |
|
|
|
if (result != '已有申请成功的资源' && result != '资源审批中') { |
|
|
|
if (v.token) { |
|
|
|
result = '已有申请成功的资源' |
|
|
@ -82,10 +86,11 @@ function ServiceView ({ loading, clientHeight, actions, dispatch, }) { |
|
|
|
setResourceModal(true) |
|
|
|
} |
|
|
|
}}>申请资源</a> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
</div > |
|
|
|
} |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
|