peng.peng
1 year ago
24 changed files with 810 additions and 5 deletions
@ -0,0 +1,29 @@ |
|||
'use strict'; |
|||
|
|||
import { basicAction } from '@peace/utils' |
|||
import { ApiTable } from '$utils' |
|||
|
|||
export function getApproveList (query = {}) { |
|||
return dispatch => basicAction({ |
|||
type: 'get', |
|||
query, |
|||
dispatch: dispatch, |
|||
actionType: 'GET_APPROVE_LIST', |
|||
url: `${ApiTable.approveList}`, |
|||
msg: { error: '获取资源消费列表失败' }, |
|||
reducer: { name: '' } |
|||
}); |
|||
} |
|||
|
|||
|
|||
export function postApprove (data = {}) { |
|||
return dispatch => basicAction({ |
|||
type: 'post', |
|||
data, |
|||
dispatch: dispatch, |
|||
actionType: 'POST_APPROVE', |
|||
url: `${ApiTable.approveList}`, |
|||
msg: { option: '资源审批' }, |
|||
reducer: { name: '' } |
|||
}); |
|||
} |
@ -0,0 +1,15 @@ |
|||
'use strict'; |
|||
|
|||
import { basicAction } from '@peace/utils' |
|||
import { ApiTable } from '$utils' |
|||
|
|||
// export function getMembers(orgId) {
|
|||
// return dispatch => basicAction({
|
|||
// type: 'get',
|
|||
// dispatch: dispatch,
|
|||
// actionType: 'GET_MEMBERS',
|
|||
// url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`,
|
|||
// msg: { error: '获取用户列表失败' },
|
|||
// reducer: { name: 'members' }
|
|||
// });
|
|||
// }
|
@ -0,0 +1,9 @@ |
|||
'use strict'; |
|||
|
|||
import * as example from './example' |
|||
import * as approve from './approve' |
|||
|
|||
export default { |
|||
...example, |
|||
...approve, |
|||
} |
@ -0,0 +1,94 @@ |
|||
import React, { useEffect, useState } from 'react' |
|||
import { connect } from 'react-redux'; |
|||
import moment from 'moment'; |
|||
import { v4 as uuidv4 } from 'uuid' |
|||
|
|||
import { Tabs, Form, Input, DatePicker, Button, Modal, Radio } from 'antd'; |
|||
|
|||
|
|||
function ApproveModal ({ loading, clientHeight, user, actions, dispatch, close, success, editData, }) { |
|||
|
|||
const { resourceConsumption } = actions |
|||
const [tabsKey, setTabsKey] = useState("stay") |
|||
const [query, setQuery] = useState({ page: 0, limit: 10 }); |
|||
const [proTableList, setProTableList] = useState({ rows: [], count: 0 }); |
|||
const [approve, setApprove] = useState() |
|||
|
|||
const [form] = Form.useForm(); |
|||
useEffect(() => { |
|||
|
|||
}, []) |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
return <> |
|||
<Modal title="数据消费审批" open={true} |
|||
onOk={e => { |
|||
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() |
|||
}} |
|||
> |
|||
<Form |
|||
style={{ marginLeft: 20 }} |
|||
form={form} |
|||
onValuesChange={v => { |
|||
console.log(v); |
|||
if (v.approve) { |
|||
setApprove(v.approve) |
|||
} |
|||
// setFormData(v)
|
|||
}} |
|||
autoComplete="off" |
|||
> |
|||
<Form.Item label="审批意见" name="approve" rules={[{ required: true, message: '请选择审批意见' }]} > |
|||
<Radio.Group> |
|||
<Radio value="true"> 同意 </Radio> |
|||
<Radio value="false"> 不同意 </Radio> |
|||
</Radio.Group> |
|||
</Form.Item> |
|||
{!approve || approve == 'false' ? |
|||
<Form.Item label="意见内容" name="approveRemarks" rules={[{ required: true, message: '请输入意见内容' }]}> |
|||
<Input allowClear placeholder='请填写意见内容' style={{ width: 300, marginRight: 16 }} /> |
|||
</Form.Item> : ""} |
|||
{!approve || approve == 'true' ? <div style={{ position: 'relative' }}> |
|||
<Form.Item label="访问令牌" name="token" rules={[{ required: true, message: '请生成令牌' }]}> |
|||
<Input allowClear placeholder='生成令牌' disabled={true} style={{ width: 300, marginRight: 16 }} /> |
|||
</Form.Item> |
|||
<Button type="primary" style={{ position: 'absolute', top: 0, right: 0 }} onClick={() => { |
|||
form.setFieldsValue({ token: uuidv4() }) |
|||
}}>生成</Button> |
|||
</div> : ""} |
|||
</Form> |
|||
</Modal > |
|||
|
|||
</> |
|||
} |
|||
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) |
@ -0,0 +1,98 @@ |
|||
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)
|
|||
// }
|
|||
// })
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
useEffect(() => { |
|||
|
|||
}, []) |
|||
|
|||
return <> |
|||
|
|||
{/* <Form |
|||
style={{ display: 'flex' }} |
|||
onFinish={v => { |
|||
|
|||
setFormData({ ...v, applyAt: v.applyAt ? moment(v.applyAt).format('YYYY-MM-DD HH:mm:ss') : "" }) |
|||
resourceData({ limit: 10, page: 0, ...v, applyAt: v.applyAt ? moment(v.applyAt).format('YYYY-MM-DD HH:mm:ss') : "" }) |
|||
setQuery({ limit: 10, page: 0 }); |
|||
console.log(v); |
|||
}} |
|||
autoComplete="off" |
|||
> |
|||
<Form.Item label="资源名称" name="resourceName" > |
|||
<Input allowClear placeholder='资源名称关键字' style={{ width: 200, marginRight: 16 }} /> |
|||
</Form.Item> |
|||
<Form.Item label="申请人" name="applyBy" > |
|||
<Input allowClear placeholder='申请人关键字' style={{ width: 140, marginRight: 16 }} /> |
|||
</Form.Item> |
|||
<Form.Item label="申请日期" name="applyAt" > |
|||
<DatePicker style={{ width: 140, marginRight: 16 }} /> |
|||
</Form.Item> |
|||
<Form.Item > |
|||
<Button type="primary" htmlType="submit"> 查询 </Button> |
|||
</Form.Item> |
|||
</Form> */} |
|||
|
|||
|
|||
{ |
|||
approveModal ? |
|||
<ApproveModal |
|||
editData={editData} |
|||
close={() => { |
|||
setApproveModal(false); |
|||
setEditData({}) |
|||
}} |
|||
success={() => { |
|||
resourceData({ limit: 10, page: 0 }) |
|||
setQuery({ limit: 10, page: 0 }); |
|||
}} |
|||
/> : "" |
|||
} |
|||
|
|||
</> |
|||
} |
|||
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)(Approve) |
@ -0,0 +1,7 @@ |
|||
'use strict'; |
|||
|
|||
import DocumentLibrary from './documentLibrary'; |
|||
import RuleLibrary from './ruleLibrary'; |
|||
import QualityMonitor from './qualityMonitor'; |
|||
|
|||
export { DocumentLibrary, RuleLibrary,QualityMonitor }; |
@ -0,0 +1,91 @@ |
|||
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, Select } from 'antd'; |
|||
import { v1 } from 'uuid'; |
|||
|
|||
|
|||
function MyApplication ({ loading, clientHeight, actions, dispatch, user }) { |
|||
|
|||
const { resourceConsumption } = actions |
|||
|
|||
const [query, setQuery] = useState({ page: 0, limit: 10 }); |
|||
const [proTableList, setProTableList] = useState({ rows: [], count: 0 }); |
|||
const [formData, setFormData] = useState({}) |
|||
|
|||
useEffect(() => { |
|||
resourceData() |
|||
}, []) |
|||
|
|||
|
|||
let resourceData = (params) => { |
|||
// let data = params || query
|
|||
// dispatch(resourceConsumption.getApproveList({ applyById: user?.id, ...formData, ...data, })).then(res => {
|
|||
// if (res.success) {
|
|||
// setProTableList(res.payload.data)
|
|||
// }
|
|||
// })
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
return <> |
|||
{/* <Form |
|||
style={{ display: 'flex' }} |
|||
onFinish={v => { |
|||
|
|||
setFormData({ ...v, applyAt: v.applyAt ? moment(v.applyAt).format('YYYY-MM-DD HH:mm:ss') : "" }) |
|||
resourceData({ limit: 10, page: 0, ...v, applyAt: v.applyAt ? moment(v.applyAt).format('YYYY-MM-DD HH:mm:ss') : "" }) |
|||
setQuery({ limit: 10, page: 0 }); |
|||
}} |
|||
autoComplete="off" |
|||
> |
|||
<Form.Item label="资源名称" name="resourceName" > |
|||
<Input allowClear placeholder='资源名称关键字' style={{ width: 200, marginRight: 16 }} /> |
|||
</Form.Item> |
|||
<Form.Item label="审批状态" name="state" > |
|||
<Select allowClear placeholder="全部" style={{ width: 130, marginRight: 16 }} |
|||
options={[ |
|||
{ |
|||
value: 1, |
|||
label: '审批通过', |
|||
}, |
|||
{ |
|||
value: 2, |
|||
label: '审批不通过', |
|||
}, |
|||
{ |
|||
value: 3, |
|||
label: '审批中', |
|||
}]} |
|||
/> |
|||
</Form.Item> |
|||
<Form.Item label="申请日期" name="applyAt" > |
|||
<DatePicker style={{ width: 140, marginRight: 16 }} /> |
|||
</Form.Item> |
|||
<Form.Item > |
|||
<Button type="primary" htmlType="submit"> 查询 </Button> |
|||
</Form.Item> |
|||
</Form> */} |
|||
|
|||
|
|||
|
|||
</> |
|||
} |
|||
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)(MyApplication) |
@ -0,0 +1,90 @@ |
|||
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, Select } from 'antd'; |
|||
import { v1 } from 'uuid'; |
|||
|
|||
|
|||
function MyApplication ({ loading, clientHeight, actions, dispatch, user }) { |
|||
|
|||
const { resourceConsumption } = actions |
|||
|
|||
const [query, setQuery] = useState({ page: 0, limit: 10 }); |
|||
const [proTableList, setProTableList] = useState({ rows: [], count: 0 }); |
|||
const [formData, setFormData] = useState({}) |
|||
|
|||
useEffect(() => { |
|||
resourceData() |
|||
}, []) |
|||
|
|||
|
|||
let resourceData = (params) => { |
|||
// let data = params || query
|
|||
// dispatch(resourceConsumption.getApproveList({ applyById: user?.id, ...formData, ...data, })).then(res => {
|
|||
// if (res.success) {
|
|||
// setProTableList(res.payload.data)
|
|||
// }
|
|||
// })
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
return <> |
|||
{/* <Form |
|||
style={{ display: 'flex' }} |
|||
onFinish={v => { |
|||
|
|||
setFormData({ ...v, applyAt: v.applyAt ? moment(v.applyAt).format('YYYY-MM-DD HH:mm:ss') : "" }) |
|||
resourceData({ limit: 10, page: 0, ...v, applyAt: v.applyAt ? moment(v.applyAt).format('YYYY-MM-DD HH:mm:ss') : "" }) |
|||
setQuery({ limit: 10, page: 0 }); |
|||
}} |
|||
autoComplete="off" |
|||
> |
|||
<Form.Item label="资源名称" name="resourceName" > |
|||
<Input allowClear placeholder='资源名称关键字' style={{ width: 200, marginRight: 16 }} /> |
|||
</Form.Item> |
|||
<Form.Item label="审批状态" name="state" > |
|||
<Select allowClear placeholder="全部" style={{ width: 130, marginRight: 16 }} |
|||
options={[ |
|||
{ |
|||
value: 1, |
|||
label: '审批通过', |
|||
}, |
|||
{ |
|||
value: 2, |
|||
label: '审批不通过', |
|||
}, |
|||
{ |
|||
value: 3, |
|||
label: '审批中', |
|||
}]} |
|||
/> |
|||
</Form.Item> |
|||
<Form.Item label="申请日期" name="applyAt" > |
|||
<DatePicker style={{ width: 140, marginRight: 16 }} /> |
|||
</Form.Item> |
|||
<Form.Item > |
|||
<Button type="primary" htmlType="submit"> 查询 </Button> |
|||
</Form.Item> |
|||
</Form> */} |
|||
|
|||
|
|||
|
|||
</> |
|||
} |
|||
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)(MyApplication) |
@ -0,0 +1,15 @@ |
|||
'use strict'; |
|||
|
|||
import reducers from './reducers'; |
|||
import routes from './routes'; |
|||
import actions from './actions'; |
|||
import { getNavItem } from './nav-item'; |
|||
|
|||
export default { |
|||
key: 'resourceConsumption', |
|||
name: '资源消费', |
|||
reducers: reducers, |
|||
routes: routes, |
|||
actions: actions, |
|||
getNavItem: getNavItem |
|||
}; |
@ -0,0 +1,21 @@ |
|||
import React from 'react'; |
|||
import { Link } from 'react-router-dom'; |
|||
import { Menu } from 'antd'; |
|||
import { CarryOutOutlined } from '@ant-design/icons'; |
|||
const SubMenu = Menu.SubMenu; |
|||
|
|||
export function getNavItem (user) { |
|||
return ( |
|||
<SubMenu key="dataQuality" icon={<CarryOutOutlined />} title='数据质量'> |
|||
<Menu.Item key="documentLibrary"> |
|||
<Link to="/dataQuality/documentLibrary">标准文档库</Link> |
|||
</Menu.Item> |
|||
<Menu.Item key="ruleLibrary"> |
|||
<Link to="/dataQuality/ruleLibrary">业务规则库</Link> |
|||
</Menu.Item> |
|||
<Menu.Item key="qualityMonitor"> |
|||
<Link to="/dataQuality/qualityMonitor">数据质量监控</Link> |
|||
</Menu.Item> |
|||
</ SubMenu > |
|||
); |
|||
} |
@ -0,0 +1,5 @@ |
|||
'use strict'; |
|||
|
|||
export default { |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
'use strict'; |
|||
import { DocumentLibrary, RuleLibrary, QualityMonitor } from './containers'; |
|||
export default [{ |
|||
type: 'inner', |
|||
route: { |
|||
path: '/dataQuality', |
|||
key: 'dataQuality', |
|||
breadcrumb: '数据质量', |
|||
// 不设置 component 则面包屑禁止跳转
|
|||
childRoutes: [{ |
|||
path: '/documentLibrary', |
|||
key: 'documentLibrary', |
|||
component: DocumentLibrary, |
|||
breadcrumb: '标准文档库' |
|||
}, { |
|||
path: '/ruleLibrary', |
|||
key: 'ruleLibrary', |
|||
component: RuleLibrary, |
|||
breadcrumb: '业务规则库' |
|||
}, { |
|||
path: '/qualityMonitor', |
|||
key: 'qualityMonitor', |
|||
component: QualityMonitor, |
|||
breadcrumb: '数据质量监控' |
|||
}] |
|||
} |
|||
}]; |
@ -0,0 +1,29 @@ |
|||
'use strict'; |
|||
|
|||
import { basicAction } from '@peace/utils' |
|||
import { ApiTable } from '$utils' |
|||
|
|||
export function getApproveList (query = {}) { |
|||
return dispatch => basicAction({ |
|||
type: 'get', |
|||
query, |
|||
dispatch: dispatch, |
|||
actionType: 'GET_APPROVE_LIST', |
|||
url: `${ApiTable.approveList}`, |
|||
msg: { error: '获取资源消费列表失败' }, |
|||
reducer: { name: '' } |
|||
}); |
|||
} |
|||
|
|||
|
|||
export function postApprove (data = {}) { |
|||
return dispatch => basicAction({ |
|||
type: 'post', |
|||
data, |
|||
dispatch: dispatch, |
|||
actionType: 'POST_APPROVE', |
|||
url: `${ApiTable.approveList}`, |
|||
msg: { option: '资源审批' }, |
|||
reducer: { name: '' } |
|||
}); |
|||
} |
@ -0,0 +1,15 @@ |
|||
'use strict'; |
|||
|
|||
import { basicAction } from '@peace/utils' |
|||
import { ApiTable } from '$utils' |
|||
|
|||
// export function getMembers(orgId) {
|
|||
// return dispatch => basicAction({
|
|||
// type: 'get',
|
|||
// dispatch: dispatch,
|
|||
// actionType: 'GET_MEMBERS',
|
|||
// url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`,
|
|||
// msg: { error: '获取用户列表失败' },
|
|||
// reducer: { name: 'members' }
|
|||
// });
|
|||
// }
|
@ -0,0 +1,9 @@ |
|||
'use strict'; |
|||
|
|||
import * as example from './example' |
|||
import * as approve from './approve' |
|||
|
|||
export default { |
|||
...example, |
|||
...approve, |
|||
} |
@ -0,0 +1,94 @@ |
|||
import React, { useEffect, useState } from 'react' |
|||
import { connect } from 'react-redux'; |
|||
import moment from 'moment'; |
|||
import { v4 as uuidv4 } from 'uuid' |
|||
|
|||
import { Tabs, Form, Input, DatePicker, Button, Modal, Radio } from 'antd'; |
|||
|
|||
|
|||
function ApproveModal ({ loading, clientHeight, user, actions, dispatch, close, success, editData, }) { |
|||
|
|||
const { resourceConsumption } = actions |
|||
const [tabsKey, setTabsKey] = useState("stay") |
|||
const [query, setQuery] = useState({ page: 0, limit: 10 }); |
|||
const [proTableList, setProTableList] = useState({ rows: [], count: 0 }); |
|||
const [approve, setApprove] = useState() |
|||
|
|||
const [form] = Form.useForm(); |
|||
useEffect(() => { |
|||
|
|||
}, []) |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
return <> |
|||
<Modal title="数据消费审批" open={true} |
|||
onOk={e => { |
|||
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() |
|||
}} |
|||
> |
|||
<Form |
|||
style={{ marginLeft: 20 }} |
|||
form={form} |
|||
onValuesChange={v => { |
|||
console.log(v); |
|||
if (v.approve) { |
|||
setApprove(v.approve) |
|||
} |
|||
// setFormData(v)
|
|||
}} |
|||
autoComplete="off" |
|||
> |
|||
<Form.Item label="审批意见" name="approve" rules={[{ required: true, message: '请选择审批意见' }]} > |
|||
<Radio.Group> |
|||
<Radio value="true"> 同意 </Radio> |
|||
<Radio value="false"> 不同意 </Radio> |
|||
</Radio.Group> |
|||
</Form.Item> |
|||
{!approve || approve == 'false' ? |
|||
<Form.Item label="意见内容" name="approveRemarks" rules={[{ required: true, message: '请输入意见内容' }]}> |
|||
<Input allowClear placeholder='请填写意见内容' style={{ width: 300, marginRight: 16 }} /> |
|||
</Form.Item> : ""} |
|||
{!approve || approve == 'true' ? <div style={{ position: 'relative' }}> |
|||
<Form.Item label="访问令牌" name="token" rules={[{ required: true, message: '请生成令牌' }]}> |
|||
<Input allowClear placeholder='生成令牌' disabled={true} style={{ width: 300, marginRight: 16 }} /> |
|||
</Form.Item> |
|||
<Button type="primary" style={{ position: 'absolute', top: 0, right: 0 }} onClick={() => { |
|||
form.setFieldsValue({ token: uuidv4() }) |
|||
}}>生成</Button> |
|||
</div> : ""} |
|||
</Form> |
|||
</Modal > |
|||
|
|||
</> |
|||
} |
|||
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) |
@ -0,0 +1,6 @@ |
|||
'use strict'; |
|||
|
|||
import SpecificationLibrary from './specificationLibrary'; |
|||
|
|||
|
|||
export { SpecificationLibrary}; |
@ -0,0 +1,98 @@ |
|||
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)
|
|||
// }
|
|||
// })
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
useEffect(() => { |
|||
|
|||
}, []) |
|||
|
|||
return <> |
|||
|
|||
{/* <Form |
|||
style={{ display: 'flex' }} |
|||
onFinish={v => { |
|||
|
|||
setFormData({ ...v, applyAt: v.applyAt ? moment(v.applyAt).format('YYYY-MM-DD HH:mm:ss') : "" }) |
|||
resourceData({ limit: 10, page: 0, ...v, applyAt: v.applyAt ? moment(v.applyAt).format('YYYY-MM-DD HH:mm:ss') : "" }) |
|||
setQuery({ limit: 10, page: 0 }); |
|||
console.log(v); |
|||
}} |
|||
autoComplete="off" |
|||
> |
|||
<Form.Item label="资源名称" name="resourceName" > |
|||
<Input allowClear placeholder='资源名称关键字' style={{ width: 200, marginRight: 16 }} /> |
|||
</Form.Item> |
|||
<Form.Item label="申请人" name="applyBy" > |
|||
<Input allowClear placeholder='申请人关键字' style={{ width: 140, marginRight: 16 }} /> |
|||
</Form.Item> |
|||
<Form.Item label="申请日期" name="applyAt" > |
|||
<DatePicker style={{ width: 140, marginRight: 16 }} /> |
|||
</Form.Item> |
|||
<Form.Item > |
|||
<Button type="primary" htmlType="submit"> 查询 </Button> |
|||
</Form.Item> |
|||
</Form> */} |
|||
|
|||
|
|||
{ |
|||
approveModal ? |
|||
<ApproveModal |
|||
editData={editData} |
|||
close={() => { |
|||
setApproveModal(false); |
|||
setEditData({}) |
|||
}} |
|||
success={() => { |
|||
resourceData({ limit: 10, page: 0 }) |
|||
setQuery({ limit: 10, page: 0 }); |
|||
}} |
|||
/> : "" |
|||
} |
|||
|
|||
</> |
|||
} |
|||
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)(Approve) |
@ -0,0 +1,15 @@ |
|||
'use strict'; |
|||
|
|||
import reducers from './reducers'; |
|||
import routes from './routes'; |
|||
import actions from './actions'; |
|||
import { getNavItem } from './nav-item'; |
|||
|
|||
export default { |
|||
key: 'resourceConsumption', |
|||
name: '资源消费', |
|||
reducers: reducers, |
|||
routes: routes, |
|||
actions: actions, |
|||
getNavItem: getNavItem |
|||
}; |
@ -0,0 +1,15 @@ |
|||
import React from 'react'; |
|||
import { Link } from 'react-router-dom'; |
|||
import { Menu } from 'antd'; |
|||
import { CarryOutOutlined } from '@ant-design/icons'; |
|||
const SubMenu = Menu.SubMenu; |
|||
|
|||
export function getNavItem (user) { |
|||
return ( |
|||
<SubMenu key="safetySpecification" icon={<CarryOutOutlined />} title='数据安全规范'> |
|||
<Menu.Item key="specificationLibrary"> |
|||
<Link to="/safetySpecification/specificationLibrary">数据安全规范库</Link> |
|||
</Menu.Item> |
|||
</ SubMenu > |
|||
); |
|||
} |
@ -0,0 +1,5 @@ |
|||
'use strict'; |
|||
|
|||
export default { |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
'use strict'; |
|||
import {SpecificationLibrary } from './containers'; |
|||
export default [{ |
|||
type: 'inner', |
|||
route: { |
|||
path: '/safetySpecification', |
|||
key: 'safetySpecification', |
|||
breadcrumb: '数据安全规范', |
|||
// 不设置 component 则面包屑禁止跳转
|
|||
childRoutes: [{ |
|||
path: '/specificationLibrary', |
|||
key: 'specificationLibrary', |
|||
component: SpecificationLibrary, |
|||
breadcrumb: '数据安全规范库' |
|||
}] |
|||
} |
|||
}]; |
Loading…
Reference in new issue