|
@ -8,9 +8,9 @@ import { Tabs, Form, Input, Space, Button, Table, Popconfirm, message } from 'an |
|
|
const { Search } = Input; |
|
|
const { Search } = Input; |
|
|
|
|
|
|
|
|
import EditModal from '../components/editModal'; |
|
|
import EditModal from '../components/editModal'; |
|
|
|
|
|
import ResourceModal from '../components/resourceModal'; |
|
|
|
|
|
|
|
|
|
|
|
function ServiceManagement({ loading, clientHeight, actions, dispatch, user }) { |
|
|
function ServiceManagement({ loading, clientHeight, actions, dispatch, }) { |
|
|
|
|
|
|
|
|
|
|
|
const { dataService } = actions |
|
|
const { dataService } = actions |
|
|
const [query, setQuery] = useState({ page: 0, limit: 10 }); |
|
|
const [query, setQuery] = useState({ page: 0, limit: 10 }); |
|
@ -19,6 +19,7 @@ function ServiceManagement({ loading, clientHeight, actions, dispatch, }) { |
|
|
const [keyword, setKeyword] = useState() |
|
|
const [keyword, setKeyword] = useState() |
|
|
const [tableList, setTableList] = useState({ rows: [], count: 0 }); |
|
|
const [tableList, setTableList] = useState({ rows: [], count: 0 }); |
|
|
const [viewDetails, setViewDetails] = useState(false) |
|
|
const [viewDetails, setViewDetails] = useState(false) |
|
|
|
|
|
const [resourceModal, setResourceModal] = useState(false) |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
resourceData() |
|
|
resourceData() |
|
|
|
|
|
|
|
@ -110,7 +111,30 @@ function ServiceManagement({ loading, clientHeight, actions, dispatch, }) { |
|
|
}) |
|
|
}) |
|
|
}}>启用</a> |
|
|
}}>启用</a> |
|
|
} |
|
|
} |
|
|
|
|
|
{!isCurrentOrg && <a onClick={() => { |
|
|
|
|
|
let result |
|
|
|
|
|
record?.resourceConsumptions |
|
|
|
|
|
?.filter(v => v.applyBy == user?.id) |
|
|
|
|
|
?.map(v => { |
|
|
|
|
|
if (result != '已有申请成功的资源' && result != '资源审批中') { |
|
|
|
|
|
if (v.token) { |
|
|
|
|
|
result = '已有申请成功的资源' |
|
|
|
|
|
} else if (v.approveState == '审批中') { |
|
|
|
|
|
result = '资源审批中' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
if (result) { |
|
|
|
|
|
message.warning({ |
|
|
|
|
|
duration: 1, |
|
|
|
|
|
content: result, |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
setEditData(record) |
|
|
|
|
|
setResourceModal(true) |
|
|
|
|
|
} |
|
|
|
|
|
}}>申请资源</a>} |
|
|
</div > |
|
|
</div > |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -173,7 +197,20 @@ function ServiceManagement({ loading, clientHeight, actions, dispatch, }) { |
|
|
} |
|
|
} |
|
|
/> : "" |
|
|
/> : "" |
|
|
} |
|
|
} |
|
|
|
|
|
{ |
|
|
|
|
|
resourceModal ? |
|
|
|
|
|
<ResourceModal |
|
|
|
|
|
editData={editData} |
|
|
|
|
|
close={() => { |
|
|
|
|
|
setResourceModal(false); |
|
|
|
|
|
setEditData({}) |
|
|
|
|
|
}} |
|
|
|
|
|
success={() => { |
|
|
|
|
|
resourceData({ limit: 10, page: 0, keyword }) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
/> : "" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
</> |
|
|
</> |
|
|
} |
|
|
} |
|
|