{
+ form.validateFields().then(v => {
+ console.log(v);
+ dispatch(resourceConsumption.postApprove({
+ id: editData?.id, ...v,
+ approveAt: moment().format('YYYY-MM-DD HH:mm:ss'),
+ approveBy: user?.id,
+ approveState: '已审批'
+ })).then(res => {
+ if (res.success) {
+ close()
+ success()
+ }
+ })
+ })
+ }}
+ onCancel={() => {
+ close()
+ }}
+ >
+
+
+ 同意
+ 不同意
+
+
+ {!approve || approve == 'false' ?
+
+
+ : ""}
+ {!approve || approve == 'true' ?
+
+
+
+
+ : ""}
+
+
+
+ >
+}
+function mapStateToProps (state) {
+ const { global, auth, resourceCatalog } = state;
+ return {
+ user: auth.user,
+ actions: global.actions,
+ clientHeight: global.clientHeight,
+ // resourceCatalog: resourceCatalog?.data || [],
+ // isRequesting: resourceCatalog.isRequesting
+ };
+}
+export default connect(mapStateToProps)(ApproveModal)
\ No newline at end of file
diff --git a/web/client/src/sections/resourceConsumption/containers/approve.js b/web/client/src/sections/resourceConsumption/containers/approve.js
index d4a16fd..e2bd3c2 100644
--- a/web/client/src/sections/resourceConsumption/containers/approve.js
+++ b/web/client/src/sections/resourceConsumption/containers/approve.js
@@ -1,7 +1,188 @@
import React, { useEffect, useState } from 'react'
+import { connect } from 'react-redux';
+import moment from 'moment';
+import ApproveModal from '../components/approveModal';
+
+
+import { Tabs, Form, Input, DatePicker, Button, Table } from 'antd';
+import { v1 } from 'uuid';
+
+
+function Approve ({ loading, clientHeight, actions, dispatch, }) {
+
+ const { resourceConsumption } = actions
+ const [tabsKey, setTabsKey] = useState("stay")
+ const [query, setQuery] = useState({ page: 0, limit: 10 });
+ const [proTableList, setProTableList] = useState({ rows: [], count: 0 });
+ const [formData, setFormData] = useState({})
+ const [approveModal, setApproveModal] = useState(false)
+ const [editData, setEditData] = useState({})
+ const [column, setColumn] = useState([])
+
+ useEffect(() => {
+ resourceData()
+ }, [])
+
+
+ let resourceData = (params) => {
+ let data = params || query
+ dispatch(resourceConsumption.getApproveList({ approveState: tabsKey == 'stay' ? "审批中" : '已审批', ...formData, ...data, })).then(res => {
+ if (res.success) {
+ setProTableList(res.payload.data)
+ }
+ })
+ }
-function Approve (props) {
- return <>数据消费审批>
-}
-export default Approve
\ No newline at end of file
+ const columns = [{
+ title: '资源名称',
+ dataIndex: 'resourceName',
+ }, {
+ title: '申请人',
+ dataIndex: 'applyBy',
+ render: (text, record) => record?.user?.name
+ }, {
+ title: '需求描述',
+ dataIndex: 'requirements',
+ }, {
+ title: '数据类型',
+ dataIndex: 'resourceType',
+ }, {
+ title: '令牌',
+ dataIndex: 'token',
+ render: (text, record) => text || '--'
+ }, {
+ title: '申请时间',
+ dataIndex: 'applyAt',
+ render: (text, record) => {
+ return moment(text).format('YYYY-MM-DD HH:mm:ss');
+ },
+ sorter: {
+ compare: (a, b) => moment(b?.applyAt).valueOf() - moment(a?.applyAt).valueOf(),
+ // multiple: 2,
+ },
+ }, {
+ title: '审批意见',
+ dataIndex: 'result',
+ render: (text, record) => record?.token ? "审批通过" : "审批不通过"
+ }, {
+ title: '意见内容',
+ dataIndex: 'approveRemarks',
+ render: (text, record) => text || '--'
+ }, {
+ title: '审批时间',
+ dataIndex: 'approveAt',
+ render: (text, record) => {
+ return moment(text).format('YYYY-MM-DD HH:mm:ss');
+ },
+ sorter: {
+ compare: (a, b) => moment(b?.approveAt).valueOf() - moment(a?.approveAt).valueOf(),
+ // multiple: 2,
+ },
+ }, {
+ title: '操作',
+ dataIndex: 'handle',
+ // ellipsis: true,
+ render: (text, record) =>