Commit 84757bdc authored by 邓超's avatar 邓超

fix: 去掉数据字典二级条目重名限制

parent 9f7c4781
Pipeline #41442 passed with stages
in 15 minutes 42 seconds
...@@ -230,10 +230,7 @@ const WebDic = () => { ...@@ -230,10 +230,7 @@ const WebDic = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace( n = val.replace(new RegExp(searchWord, 'g'), `<span style='color:red'>${searchWord}</span>`);
new RegExp(searchWord, 'g'),
`<span style='color:red'>${searchWord}</span>`,
);
} else { } else {
n = val; n = val;
} }
...@@ -741,11 +738,7 @@ const WebDic = () => { ...@@ -741,11 +738,7 @@ const WebDic = () => {
enterButton enterButton
value={searchWord} value={searchWord}
/> />
<Button <Button style={{ marginRight: '40px' }} icon={<SyncOutlined />} onClick={handleReset}>
style={{ marginRight: '40px' }}
icon={<SyncOutlined />}
onClick={handleReset}
>
重置 重置
</Button> </Button>
</span> </span>
...@@ -777,10 +770,7 @@ const WebDic = () => { ...@@ -777,10 +770,7 @@ const WebDic = () => {
cursor: 'pointer', cursor: 'pointer',
}} }}
> >
<span <span style={{ color: 'rgba(0, 0, 0, 0.85)' }} onClick={() => submitInput()}>
style={{ color: 'rgba(0, 0, 0, 0.85)' }}
onClick={() => submitInput()}
>
导入数据 导入数据
</span> </span>
</span> </span>
...@@ -880,11 +870,7 @@ const WebDic = () => { ...@@ -880,11 +870,7 @@ const WebDic = () => {
cancelText="取消" cancelText="取消"
> >
<Form autoComplete="off" form={addForm} labelCol={{ span: 3 }}> <Form autoComplete="off" form={addForm} labelCol={{ span: 3 }}>
<Form.Item <Form.Item name="nodeName" label="名称" rules={[{ required: true, message: '不能为空' }]}>
name="nodeName"
label="名称"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入名称" style={{ width: '95%' }} /> <Input placeholder="请输入名称" style={{ width: '95%' }} />
</Form.Item> </Form.Item>
</Form> </Form>
...@@ -962,34 +948,34 @@ const WebDic = () => { ...@@ -962,34 +948,34 @@ const WebDic = () => {
fieldKey={[fieldKey, 'frist']} fieldKey={[fieldKey, 'frist']}
rules={[ rules={[
{ required: true, message: '不能为空' }, { required: true, message: '不能为空' },
{ // {
validator: (rule, value, callback) => { // validator: (rule, value, callback) => {
const nodeName = addForm.getFieldsValue() // const nodeName = addForm.getFieldsValue().nodeName1; // 第一项的nodeName
.nodeName1; // 第一项的nodeName // const nodeName1 = addForm.getFieldsValue();
const nodeName1 = addForm.getFieldsValue(); // console.log(nodeName);
let result = nodeName1.users; // let result = nodeName1.users;
let arr = []; // let arr = [];
// eslint-disable-next-line array-callback-return // // eslint-disable-next-line array-callback-return
result.map(item => { // result.map(item => {
if (item) { // if (item) {
let a = item.nodeName; // let a = item.nodeName;
if (a !== '') { // if (a !== '') {
arr.push(a); // arr.push(a);
} // }
} // }
}); // });
if (nodeName !== undefined) { // if (nodeName !== undefined) {
arr.unshift(nodeName); // arr.unshift(nodeName);
} // }
console.log(arr); // console.log(arr);
if (new Set(arr).size !== arr.length) { // if (new Set(arr).size !== arr.length) {
arr = [...new Set(arr)]; // arr = [...new Set(arr)];
console.log(arr); // console.log(arr);
callback('用户名重复'); // callback('用户名重复');
} // }
}, // },
}, // },
]} ]}
> >
<Input placeholder="请输入名称" /> <Input placeholder="请输入名称" />
...@@ -1044,11 +1030,7 @@ const WebDic = () => { ...@@ -1044,11 +1030,7 @@ const WebDic = () => {
cancelText="取消" cancelText="取消"
> >
<Form form={editForm} labelCol={{ span: 3 }}> <Form form={editForm} labelCol={{ span: 3 }}>
<Form.Item <Form.Item name="nodeName" label="名称" rules={[{ required: true, message: '不能为空' }]}>
name="nodeName"
label="名称"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入名称" style={{ width: '90%' }} /> <Input placeholder="请输入名称" style={{ width: '90%' }} />
</Form.Item> </Form.Item>
</Form> </Form>
...@@ -1066,11 +1048,7 @@ const WebDic = () => { ...@@ -1066,11 +1048,7 @@ const WebDic = () => {
cancelText="取消" cancelText="取消"
> >
<Form form={editForm} labelCol={{ span: 3 }}> <Form form={editForm} labelCol={{ span: 3 }}>
<Form.Item <Form.Item name="nodeName" label="名称" rules={[{ required: true, message: '不能为空' }]}>
name="nodeName"
label="名称"
rules={[{ required: true, message: '不能为空' }]}
>
<Input placeholder="请输入名称" style={{ width: '90%' }} /> <Input placeholder="请输入名称" style={{ width: '90%' }} />
</Form.Item> </Form.Item>
<Form.Item name="nodeValue" label="值"> <Form.Item name="nodeValue" label="值">
...@@ -1136,9 +1114,7 @@ const WebDic = () => { ...@@ -1136,9 +1114,7 @@ const WebDic = () => {
cursor: 'pointer', cursor: 'pointer',
}} }}
> >
<a style={{ color: 'rgb(24 144 255)' }}> <a style={{ color: 'rgb(24 144 255)' }}>请选择将要导入的数据文件(仅支持Excel文件)</a>
请选择将要导入的数据文件(仅支持Excel文件)
</a>
</span> </span>
</Upload> </Upload>
</Modal> </Modal>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment