wenlele
1 year ago
20 changed files with 708 additions and 521 deletions
@ -0,0 +1,88 @@ |
|||
import React, { useEffect, useState } from 'react' |
|||
import { connect } from 'react-redux'; |
|||
import moment from 'moment'; |
|||
import { UploadLocal } from '$components'; |
|||
|
|||
|
|||
import { Tabs, Form, Input, DatePicker, Button, Modal, Select, Tag } from 'antd'; |
|||
|
|||
|
|||
function EditModal ({ loading, parent, user, actions, editData = {}, dispatch, close, success, viewDetails }) { |
|||
|
|||
const { dataService } = actions |
|||
const [lookFiold, setLookFiold] = useState([]); |
|||
const [interfaceName, setInterfaceName] = useState() |
|||
|
|||
useEffect(() => { |
|||
setInterfaceName(editData?.name); |
|||
dispatch(dataService.getLookField({ table: editData?.table, fields: editData?.fields })).then(res => { |
|||
if (res.success) { |
|||
setLookFiold(res.payload.data) |
|||
} |
|||
}) |
|||
}, []) |
|||
|
|||
|
|||
|
|||
|
|||
return <> |
|||
<Modal title={viewDetails ? '查看REST服务详情' : "编辑REST服务"} open={true} width={600} |
|||
onOk={e => { |
|||
if (viewDetails) { |
|||
close() |
|||
} else { |
|||
dispatch(dataService.postServiceManagement({ |
|||
id: editData.id, name: interfaceName, enabled: editData?.enabled |
|||
})).then(res => { |
|||
if (res.success) { |
|||
close() |
|||
success() |
|||
} |
|||
}) |
|||
} |
|||
}} |
|||
onCancel={() => { |
|||
close() |
|||
}} |
|||
> |
|||
<div style={{ display: 'flex' }}>接口名称: |
|||
<Input style={{ width: 180 }} value={interfaceName} disabled={viewDetails} onChange={e => { |
|||
setInterfaceName(e.target.value) |
|||
}} /></div> |
|||
<div style={{ display: 'flex', margin: '10px 0' }}>接口路由: |
|||
<Input style={{ width: 180 }} value={editData?.url} disabled={true} /> |
|||
</div> |
|||
<div style={{ margin: '10px 0 10px 0' }} >接口类型: |
|||
<Input style={{ width: 180 }} value={editData?.method} disabled={true} /> |
|||
</div> |
|||
<div style={{ display: 'flex' }}>返回值: |
|||
<div style={{ display: 'flex', width: 400, flexDirection: 'column', alignItems: 'center' }}> |
|||
<div style={{ display: 'flex' }}> |
|||
<div style={{ width: 120, border: '1px solid #dcc', textAlign: 'center' }}>名称</div> |
|||
<div style={{ width: 120, border: '1px solid #dcc', textAlign: 'center' }}>意义</div> |
|||
<div style={{ width: 120, border: '1px solid #dcc', textAlign: 'center' }}>说明</div> |
|||
</div> |
|||
{lookFiold?.metadataDatabases?.map((s, index) => { |
|||
return <div key={'lookFiold' + index} style={{ display: 'flex' }}> |
|||
<div style={{ width: 120, border: '1px solid #dcc', textAlign: 'center' }}>{s.code}</div> |
|||
<div style={{ width: 120, border: '1px solid #dcc', textAlign: 'center' }}>{s.name}</div> |
|||
<div style={{ width: 120, border: '1px solid #dcc', textAlign: 'center' }}>{s.description}</div> |
|||
</div> |
|||
})} |
|||
</div> |
|||
</div> |
|||
</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)(EditModal) |
@ -1,118 +0,0 @@ |
|||
import React, { useEffect, useState } from 'react' |
|||
import { connect } from 'react-redux'; |
|||
import moment from 'moment'; |
|||
import { UploadLocal } from '$components'; |
|||
|
|||
|
|||
import { Tabs, Form, Input, DatePicker, Button, Modal, Select, Tag } from 'antd'; |
|||
|
|||
|
|||
function FileModal ({ loading, parent, user, actions, editData = {}, dispatch, close, success,remove }) { |
|||
|
|||
const { dataQuality } = 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(); |
|||
const [editUrl, setEditUrl] = useState([]); |
|||
useEffect(() => { |
|||
|
|||
}, []) |
|||
|
|||
|
|||
|
|||
const vsjunct = (params) => { |
|||
if (params.length) { |
|||
let appendix = [] |
|||
for (let p of params) { |
|||
appendix.push({ |
|||
fName: p.name, |
|||
size: p.size, |
|||
fileSize: p.size, |
|||
storageUrl: p.storageUrl,//必须有storageUrl
|
|||
}) |
|||
} |
|||
setEditUrl(appendix) |
|||
} else { |
|||
setEditUrl([]) |
|||
} |
|||
} |
|||
|
|||
return <> |
|||
<Modal title="标准文档上传" open={true} width={600} |
|||
onOk={e => { |
|||
form.validateFields().then(v => { |
|||
dispatch(dataQuality.postStandardDocs({ |
|||
...v, |
|||
path: v?.files[0]?.url, docName: v?.files[0]?.name, |
|||
folder: parent || null, |
|||
})).then(res => { |
|||
if (res.success) { |
|||
close() |
|||
success() |
|||
} |
|||
}) |
|||
}) |
|||
}} |
|||
onCancel={() => { |
|||
if (form.getFieldValue('files') && form.getFieldValue('files').length) { |
|||
remove(form.getFieldValue('files')[0]?.url) |
|||
} |
|||
close() |
|||
}} |
|||
> |
|||
<Form |
|||
style={{ marginLeft: 20 }} |
|||
form={form} |
|||
onValuesChange={v => { |
|||
|
|||
}} |
|||
autoComplete="off" |
|||
labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} |
|||
> |
|||
<Form.Item label="标准类型" name="standardType" rules={[{ required: true, message: '请选择标准类型' }]}> |
|||
<Select style={{ width: 200, }} allowClear |
|||
options={[{ value: '国家标准', label: '国家标准', }, { value: '行业标准', label: '行业标准', }, { value: '地方标准', label: '地方标准', },]} |
|||
/> |
|||
</Form.Item> |
|||
<Form.Item label="标签" name="tags" > |
|||
<Input allowClear placeholder='请输入标签' maxLength={50} style={{ width: 300, marginRight: 16 }} /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
label='文件' |
|||
name='files' |
|||
key='files' |
|||
rules={[{ required: true, message: '文件不可为空' }]}> |
|||
<UploadLocal |
|||
// addNew={editData.add || !editData.record.files.length}
|
|||
isLocal={true} |
|||
maxFilesNum={1} |
|||
maxFileSize={40} |
|||
onChange={vsjunct} |
|||
fileTypes={["jpg", "png", "gif", "txt", "doc", "docx", "pdf", "xls", "xlsx", "zip", "rar"]} |
|||
value={editUrl} |
|||
// fileList={editData.record.files || []}
|
|||
/> |
|||
</Form.Item> |
|||
<Form.Item style={{ marginLeft: 42 }} key='tip'> |
|||
<Tag color="orange">文件大小不超过40MB,开放资源包含多个文件,建议将文件进行压缩,形成压缩包再上传</Tag> |
|||
<Tag color="orange">支持的文件格式:jpg,png,gif,txt,doc,docx,pdf,xsl,xlsx,zip,rar</Tag> |
|||
</Form.Item> |
|||
</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)(FileModal) |
@ -1,66 +0,0 @@ |
|||
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 GroupModal ({ loading, parent, user, actions, dispatch, close, success, }) { |
|||
|
|||
const { dataQuality } = actions |
|||
|
|||
const [form] = Form.useForm(); |
|||
useEffect(() => { |
|||
|
|||
}, []) |
|||
|
|||
|
|||
|
|||
|
|||
return <> |
|||
<Modal title="新建分组" open={true} |
|||
onOk={e => { |
|||
form.validateFields().then(v => { |
|||
dispatch(dataQuality.postStandardDocFolders({ |
|||
...v, |
|||
parent: parent || null, |
|||
})).then(res => { |
|||
if (res.success) { |
|||
close() |
|||
success() |
|||
} |
|||
}) |
|||
}) |
|||
}} |
|||
onCancel={() => { |
|||
close() |
|||
}} |
|||
> |
|||
<Form |
|||
style={{ marginLeft: 20 }} |
|||
form={form} |
|||
onValuesChange={v => { |
|||
|
|||
}} |
|||
autoComplete="off" |
|||
> |
|||
<Form.Item label="名称" name="name" rules={[{ required: true, message: '请输入分组名称,最多50字', max: 50 },]}> |
|||
<Input allowClear placeholder='请输入分组名称' style={{ width: 300, }} /> |
|||
</Form.Item> |
|||
</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)(GroupModal) |
@ -0,0 +1,79 @@ |
|||
import React, { useEffect, useState } from 'react'; |
|||
import { connect } from 'react-redux'; |
|||
import { Modal, Input, Form } from 'antd'; |
|||
const { TextArea } = Input; |
|||
const ResourceModal = (props) => { |
|||
const { actions, dispatch, success, close, editData, user } = props; |
|||
|
|||
const { dataService, metadataManagement } = actions |
|||
|
|||
const [form] = Form.useForm(); |
|||
useEffect(() => { |
|||
}, []); |
|||
const handleOk = () => { |
|||
form.validateFields().then(values => { |
|||
if (success) { |
|||
dispatch(metadataManagement.postMetadataResourceApplications({ |
|||
...values, |
|||
resourceType: '数据服务', |
|||
applyBy: user?.id, |
|||
approveState: '审批中', |
|||
restServiceId: editData?.id |
|||
})).then(res => { |
|||
if (res.success) { |
|||
success() |
|||
close() |
|||
} |
|||
}); |
|||
} |
|||
}) |
|||
} |
|||
const validatorNull = (rule, value, getFieldValue, validateFields, label) => { |
|||
if (!value || !value.trim().length) { |
|||
return Promise.reject(new Error(`${label}不可空字符串`)); |
|||
} |
|||
return Promise.resolve(); |
|||
} |
|||
return ( |
|||
<Modal title={'申请资源'} open={true} destroyOnClose |
|||
okText='确定' width={800} |
|||
onOk={() => handleOk(null)} |
|||
onCancel={()=>close()}> |
|||
<Form form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} initialValues={editData.record || {}}> |
|||
<Form.Item |
|||
label='资源名称' |
|||
name='resourceName' |
|||
rules={[{ required: true, message: '资源名称不可空' }]}> |
|||
<Input style={{ width: '90%' }} /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
label='申请人' |
|||
name='applyByName' |
|||
rules={[{ required: true, message: '申请人不可空' }]}> |
|||
<Input style={{ width: '90%' }} /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
label='需求描述' |
|||
name='requirements' |
|||
rules={[{ required: true, message: '' }, { max: 255, message: `需求描述不超过255个字符` }, |
|||
({ getFieldValue, validateFields }) => ({ |
|||
validator (_, value) { return validatorNull(_, value, getFieldValue, validateFields, '需求描述') } |
|||
})]}> |
|||
<TextArea rows={4} style={{ width: '90%' }} placeholder={`请输入需求描述`} /> |
|||
</Form.Item> |
|||
</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)(ResourceModal) |
@ -1,104 +0,0 @@ |
|||
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, Select, TreeSelect } from 'antd'; |
|||
const { TextArea } = Input; |
|||
const { Option, OptGroup } = Select; |
|||
function RuleModal ({ loading, parent, user, actions, dispatch, close, success, treeList, editData }) { |
|||
|
|||
const { dataQuality } = 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={editData?.id ? '编辑业务规则' : "新建业务规则"} open={true} |
|||
onOk={e => { |
|||
form.validateFields().then(v => { |
|||
// console.log(v);
|
|||
dispatch(dataQuality.postBusinessRules({ |
|||
...v, id: editData?.id |
|||
})).then(res => { |
|||
if (res.success) { |
|||
close() |
|||
success() |
|||
} |
|||
}) |
|||
}) |
|||
}} |
|||
onCancel={() => { |
|||
close() |
|||
}} |
|||
> |
|||
<Form |
|||
style={{ marginLeft: 20 }} |
|||
form={form} |
|||
onValuesChange={v => { |
|||
|
|||
}} |
|||
autoComplete="off" |
|||
labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} |
|||
> |
|||
<Form.Item label="名称" name="name" initialValue={editData?.name} rules={[{ required: true, message: '请输入分组名称,最多50字', max: 50}]}> |
|||
<Input allowClear placeholder='请输入分组名称' style={{ width: 300 }} /> |
|||
</Form.Item> |
|||
<Form.Item label="描述" name="description" initialValue={editData?.description} rules={[{ required: true, message: '请输入分组名称' }]}> |
|||
<TextArea allowClear autoSize={{ minRows: 2 }} placeholder='描述' style={{ width: 300, }} /> |
|||
</Form.Item> |
|||
<Form.Item label="问题类型" name="problemType" initialValue={editData?.problemType} rules={[{ required: true, message: '请输入分组名称' }]}> |
|||
<Select style={{ width: 300, }} placeholder='问题类型' |
|||
options={[{ value: '一致性', label: '一致性', }, { value: '准确性', label: '准确性', }, { value: '完整性', label: '完整性', }, { value: '有效性', label: '有效性', }, { value: '及时性', label: '及时性', }, { value: '规范性', label: '规范性', },]} |
|||
/> |
|||
</Form.Item> |
|||
<Form.Item label="问题级别" name="problemLevel" initialValue={editData?.problemLevel} rules={[{ required: true, message: '请输入分组名称' }]}> |
|||
<Select style={{ width: 300, }} placeholder='问题级别' |
|||
options={[{ value: '一般', label: '一般', }, { value: '重要', label: '重要', }, { value: '严重', label: '严重', },]} |
|||
/> |
|||
</Form.Item> |
|||
<Form.Item label="制定依据" name="ruleBasis" initialValue={editData?.ruleBasis} rules={[{ required: true, message: '请输入分组名称' }]}> |
|||
<TreeSelect |
|||
showSearch |
|||
style={{ |
|||
width: 300, |
|||
}} |
|||
// value={}
|
|||
dropdownStyle={{ |
|||
maxHeight: 300, |
|||
overflow: 'auto', |
|||
}} |
|||
placeholder="" |
|||
allowClear |
|||
treeDefaultExpandAll |
|||
// onChange={onChange}
|
|||
treeData={treeList || []} |
|||
/> |
|||
</Form.Item> |
|||
</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)(RuleModal) |
Loading…
Reference in new issue