Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
36f0dbbd
Commit
36f0dbbd
authored
May 23, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '取消数据字典二级限制'
parent
ac5339b0
Pipeline
#51021
passed with stages
in 7 minutes 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
138 additions
and
53 deletions
+138
-53
WebDic.jsx
src/pages/dataCenter/dictionary/WebDic.jsx
+138
-53
No files found.
src/pages/dataCenter/dictionary/WebDic.jsx
View file @
36f0dbbd
/* eslint-disable operator-assignment */
/* eslint-disable no-else-return */
/* eslint-disable no-undef */
/* eslint-disable no-shadow */
...
...
@@ -189,7 +190,7 @@ const WebDic = () => {
overflow
:
'hidden'
,
whiteSpace
:
'nowrap'
,
textOverflow
:
'ellipsis'
,
cursor
:
'
auto'
,
cursor
:
'auto'
,
},
}),
render
:
record
=>
(
...
...
@@ -210,7 +211,7 @@ const WebDic = () => {
overflow
:
'hidden'
,
whiteSpace
:
'nowrap'
,
textOverflow
:
'ellipsis'
,
cursor
:
'
auto'
,
cursor
:
'auto'
,
},
}),
render
:
record
=>
{
...
...
@@ -232,7 +233,7 @@ const WebDic = () => {
align
:
'center'
,
onCell
:
()
=>
({
style
:
{
cursor
:
'
auto'
,
cursor
:
'auto'
,
},
}),
render
:
record
=>
(
...
...
@@ -502,6 +503,7 @@ const WebDic = () => {
const
nodeName
=
addForm
.
getFieldsValue
().
nodeName1
;
const
nodeValue
=
addForm
.
getFieldsValue
().
nodeValue1
;
let
arr
=
[];
console
.
log
(
nodeName1
);
let
result
=
nodeName1
.
users
;
if
(
result
)
{
// eslint-disable-next-line array-callback-return
...
...
@@ -1068,38 +1070,78 @@ const WebDic = () => {
label=
"名称"
rules=
{
[
{
required
:
true
,
message
:
'不能为空'
},
{
validator
:
(
rule
,
value
)
=>
{
const
nodeName
=
addForm
.
getFieldsValue
().
nodeName1
;
// 第一项的nodeName
const
nodeName1
=
addForm
.
getFieldsValue
();
let
result
=
nodeName1
.
users
;
let
arr
=
[];
if
(
result
)
{
// eslint-disable-next-line array-callback-return
result
.
map
(
item
=>
{
if
(
item
)
{
let
a
=
item
.
nodeName
;
if
(
a
!==
''
)
{
arr
.
push
(
a
);
}
}
});
}
arr
.
unshift
(
nodeName
);
if
(
new
Set
(
arr
).
size
!==
arr
.
length
)
{
// eslint-disable-next-line prefer-promise-reject-errors
return
Promise
.
reject
(
'用户名重复'
);
}
return
Promise
.
resolve
();
},
},
//
{
// validator: (rule, value) =>
{
// const nodeName = addForm.getFieldsValue().nodeName1; // 第一项的nodeName
// const nodeValue = addForm.getFieldsValue().nodeValue1;
// let aa = 0;
// subData.map(i =>
{
// if (i.nodeName == nodeName && i.nodeValue == nodeValue)
{
// aa = aa + 1;
//
}
//
});
// if (aa != 0)
{
// // eslint-disable-next-line prefer-promise-reject-errors
// return Promise.reject('已存在相同名称与值的数据');
//
}
// return Promise.resolve();
//
},
//
},
//
{
// validator: (rule, value) =>
{
// const nodeName = addForm.getFieldsValue().nodeName1; // 第一项的nodeName
// const nodeName1 = addForm.getFieldsValue();
// let result = nodeName1.users;
// let arr = [];
// if (result)
{
// // eslint-disable-next-line array-callback-return
// result.map(item =>
{
// if (item)
{
// let a = item.nodeName;
// if (a !== '')
{
// arr.push(a);
//
}
//
}
//
});
//
}
// arr.unshift(nodeName);
// if (new Set(arr).size !== arr.length)
{
// // eslint-disable-next-line prefer-promise-reject-errors
// return Promise.reject('用户名重复');
//
}
// return Promise.resolve();
//
},
//
},
]
}
>
<
Input
placeholder=
"请输入名称"
/>
</
Form
.
Item
>
</
Col
>
<
Col
span=
{
11
}
>
<
Form
.
Item
name=
"nodeValue1"
label=
"值"
>
<
Form
.
Item
name=
"nodeValue1"
label=
"值"
rules=
{
[
{
required
:
true
,
message
:
'不能为空'
},
//
{
// validator: (rule, value) =>
{
// const nodeName = addForm.getFieldsValue().nodeName1; // 第一项的nodeName
// const nodeValue = addForm.getFieldsValue().nodeValue1;
// let aa = 0;
// subData.map(i =>
{
// if (i.nodeName == nodeName && i.nodeValue == nodeValue)
{
// aa = aa + 1;
//
}
//
});
// if (aa != 0)
{
// // eslint-disable-next-line prefer-promise-reject-errors
// return Promise.reject('已存在相同名称与值的数据');
//
}
// return Promise.resolve();
//
},
//
},
]
}
>
<
Input
placeholder=
"请输入值"
/>
</
Form
.
Item
>
</
Col
>
...
...
@@ -1118,30 +1160,51 @@ 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
);
}
if
(
new
Set
(
arr
).
size
!==
arr
.
length
)
{
arr
=
[...
new
Set
(
arr
)];
callback
(
'用户名重复'
);
}
},
},
//
{
// 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);
//
}
// if (new Set(arr).size !== arr.length)
{
// arr = [...new Set(arr)];
// callback('用户名重复');
//
}
//
},
//
},
//
{
// validator: (rule, value) =>
{
// const nodeName1 = addForm.getFieldsValue().nodeName; // 第一项的nodeName
// const nodeValue1 = addForm.getFieldsValue().nodeValue;
// const nodeNameAll = addForm.getFieldsValue();
// console.log(nodeName1);
// console.log(nodeValue1);
// console.log(nodeNameAll);
// let aa = 0;
// subData.map(i =>
{
// if (i.nodeName == nodeName1 && i.nodeValue == nodeValue1)
{
// aa = aa + 1;
//
}
//
});
// if (aa != 0)
{
// // eslint-disable-next-line prefer-promise-reject-errors
// return Promise.reject('已存在相同名称与值的数据');
//
}
// return Promise.resolve();
//
},
//
},
]
}
>
<
Input
placeholder=
"请输入名称"
/>
...
...
@@ -1153,6 +1216,28 @@ const WebDic = () => {
name=
{
[
name
,
'nodeValue'
]
}
label=
"值"
fieldKey=
{
[
fieldKey
,
'last'
]
}
rules=
{
[
{
required
:
true
,
message
:
'不能为空'
},
//
{
// validator: (rule, value) =>
{
// const nodeName1 = addForm.getFieldsValue().nodeName; // 第一项的nodeName
// const nodeValue1 = addForm.getFieldsValue().nodeValue;
// console.log(nodeName1);
// console.log(nodeValue1);
// let aa = 0;
// subData.map(i =>
{
// if (i.nodeName == nodeName1 && i.nodeValue == nodeValue1)
{
// aa = aa + 1;
//
}
//
});
// if (aa != 0)
{
// // eslint-disable-next-line prefer-promise-reject-errors
// return Promise.reject('已存在相同名称与值的数据');
//
}
// return Promise.resolve();
//
},
//
},
]
}
>
<
Input
placeholder=
"请输入值"
/>
</
Form
.
Item
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment