Browse Source

字数限制

master
wenlele 1 year ago
parent
commit
2fcccf48ac
  1. 7
      api/app/lib/controllers/dataQuality/index.js
  2. 2
      web/client/src/sections/dataQuality/components/fileModal.js
  3. 4
      web/client/src/sections/dataQuality/components/groupModal.js
  4. 2
      web/client/src/sections/dataQuality/components/ruleModal.js
  5. 14
      web/client/src/sections/dataQuality/containers/documentLibrary.js
  6. 2
      web/client/src/sections/safetySpecification/components/fileModal.js

7
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

2
web/client/src/sections/dataQuality/components/fileModal.js

@ -78,7 +78,7 @@ function FileModal ({ loading, parent, user, actions, editData = {}, dispatch, c
/>
</Form.Item>
<Form.Item label="标签" name="tags" >
<Input allowClear placeholder='请输入标签' style={{ width: 300, marginRight: 16 }} />
<Input allowClear placeholder='请输入标签' maxLength={50} style={{ width: 300, marginRight: 16 }} />
</Form.Item>
<Form.Item
label='文件'

4
web/client/src/sections/dataQuality/components/groupModal.js

@ -45,8 +45,8 @@ function GroupModal ({ loading, parent, user, actions, dispatch, close, success,
}}
autoComplete="off"
>
<Form.Item label="名称" name="name" rules={[{ required: true, message: '请输入分组名称' }]}>
<Input allowClear placeholder='请输入分组名称' style={{ width: 300, }} />
<Form.Item label="名称" name="name" rules={[{ required: true, message: '请输入分组名称,最多50字', max: 50 },]}>
<Input allowClear placeholder='请输入分组名称' style={{ width: 300, }} />
</Form.Item>
</Form>
</Modal >

2
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 }}
>
<Form.Item label="名称" name="name" initialValue={editData?.name} rules={[{ required: true, message: '请输入分组名称' }]}>
<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: '请输入分组名称' }]}>

14
web/client/src/sections/dataQuality/containers/documentLibrary.js

@ -77,7 +77,13 @@ function Approve ({ loading, clientHeight, actions, dispatch, }) {
<Button type="primary" onClick={() => {
setFileModal(true)
}}>上传</Button>
<Button type="primary">下载</Button>
<Button type="primary" onClick={() => {
// let fileUrlList = fileData.filter(d => fileId.current.includes(d.id))?.map(s => s.path)
// console.log(fileUrlList);
}}>下载</Button>
<Popconfirm
title="是否删除文件夹或文件?当有创建的业务规则与标准文档关联时则不允许删除。"
@ -86,7 +92,7 @@ function Approve ({ loading, clientHeight, actions, dispatch, }) {
if (folderId.current?.length || fileId.current?.length) {
dispatch(dataQuality.postFolderFile({ folderId: folderId.current, fileId: fileId.current })).then(res => {
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 });

2
web/client/src/sections/safetySpecification/components/fileModal.js

@ -74,7 +74,7 @@ function FileModal ({ loading, parent, user, actions, editData = {}, dispatch, c
labelCol={{ span: 4 }} wrapperCol={{ span: 20 }}
>
<Form.Item label="标签" name="tags" >
<Input allowClear placeholder='请输入标签' style={{ width: 300, marginRight: 16 }} />
<Input allowClear placeholder='请输入标签' maxLength={50} style={{ width: 300, marginRight: 16 }} />
</Form.Item>
<Form.Item
label='文件'

Loading…
Cancel
Save