diff --git a/api/app/lib/controllers/dataQuality/index.js b/api/app/lib/controllers/dataQuality/index.js index 4a628b0..1f2e1de 100644 --- a/api/app/lib/controllers/dataQuality/index.js +++ b/api/app/lib/controllers/dataQuality/index.js @@ -73,7 +73,7 @@ function getStandardDocFolders (opts) { -// 标准文档目录新增失败 + function postStandardDocFolders (opts) { return async function (ctx, next) { @@ -157,6 +157,11 @@ function postBusinessRules (opts) { const { id, name, description, problemType, problemLevel, ruleBasis } = ctx.request.body; + let findOne = await models.BusinessRule.findOne({ where: { name: name } }) + if ((!id && findOne) || (id && findOne && findOne.id != id)) { + message = '业务规则名称重复' + throw '' + } if (id) { await models.BusinessRule.update({ name, description, problemType, problemLevel, ruleBasis diff --git a/web/client/assets/files/common/1687657483581_2.jpg b/web/client/assets/files/common/1687657483581_2.jpg new file mode 100644 index 0000000..3f96826 Binary files /dev/null and b/web/client/assets/files/common/1687657483581_2.jpg differ diff --git a/web/client/src/sections/dataQuality/components/fileModal.js b/web/client/src/sections/dataQuality/components/fileModal.js index 760a750..54356a6 100644 --- a/web/client/src/sections/dataQuality/components/fileModal.js +++ b/web/client/src/sections/dataQuality/components/fileModal.js @@ -78,7 +78,7 @@ function FileModal ({ loading, parent, user, actions, editData = {}, dispatch, c /> - + - - + + diff --git a/web/client/src/sections/dataQuality/components/ruleModal.js b/web/client/src/sections/dataQuality/components/ruleModal.js index 7b26e17..1e01922 100644 --- a/web/client/src/sections/dataQuality/components/ruleModal.js +++ b/web/client/src/sections/dataQuality/components/ruleModal.js @@ -52,7 +52,7 @@ function RuleModal ({ loading, parent, user, actions, dispatch, close, success, autoComplete="off" labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} > - + diff --git a/web/client/src/sections/dataQuality/containers/documentLibrary.js b/web/client/src/sections/dataQuality/containers/documentLibrary.js index ad44424..43e41b6 100644 --- a/web/client/src/sections/dataQuality/containers/documentLibrary.js +++ b/web/client/src/sections/dataQuality/containers/documentLibrary.js @@ -77,7 +77,13 @@ function Approve ({ loading, clientHeight, actions, dispatch, }) { - + { if (res.success) { - resourceData(parent,keywords) + resourceData(parent, keywords) setCheckAll(false) console.log(res); res.payload.data?.map(v => { @@ -239,7 +245,7 @@ function Approve ({ loading, clientHeight, actions, dispatch, }) { } success={ () => { - resourceData(parent,keywords) + resourceData(parent, keywords) } } /> : "" @@ -252,7 +258,7 @@ function Approve ({ loading, clientHeight, actions, dispatch, }) { setFileModal(false); }} success={() => { - resourceData(parent,keywords) + resourceData(parent, keywords) }} remove={url => { RouteRequest.delete(RouteTable.cleanUpUploadTrash, { url: url }); diff --git a/web/client/src/sections/safetySpecification/components/fileModal.js b/web/client/src/sections/safetySpecification/components/fileModal.js index e59e700..836e48e 100644 --- a/web/client/src/sections/safetySpecification/components/fileModal.js +++ b/web/client/src/sections/safetySpecification/components/fileModal.js @@ -10,7 +10,7 @@ import { Tabs, Form, Input, DatePicker, Button, Modal, Select, Tag } from 'antd' function FileModal ({ loading, parent, user, actions, editData = {}, dispatch, close, success, remove }) { - const { resourceRetrieval } = actions + const { safetySpecification } = actions const [tabsKey, setTabsKey] = useState("stay") const [query, setQuery] = useState({ page: 0, limit: 10 }); const [proTableList, setProTableList] = useState({ rows: [], count: 0 }); @@ -46,7 +46,7 @@ function FileModal ({ loading, parent, user, actions, editData = {}, dispatch, c onOk={e => { form.validateFields().then(v => { - dispatch(resourceRetrieval.postSpecifications({ + dispatch(safetySpecification.postSpecifications({ ...v, fileName: v?.files[0]?.name,path:v?.files[0]?.url, })).then(res => { @@ -74,7 +74,7 @@ function FileModal ({ loading, parent, user, actions, editData = {}, dispatch, c labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} > - + { let params = data || query - dispatch(resourceRetrieval.getSpecifications({ keyword: keyword, ...params, })).then(res => { + dispatch(safetySpecification.getSpecifications({ keyword: keyword, ...params, })).then(res => { if (res.success) { setFileData({ data: res.payload.data?.rows, count: res.payload.data?.count }) } }) } + return <> @@ -58,10 +60,16 @@ function SpecificationLibrary ({ loading, clientHeight, actions, dispatch, }) { - +