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