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
84757bdc
Commit
84757bdc
authored
Dec 28, 2021
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 去掉数据字典二级条目重名限制
parent
9f7c4781
Pipeline
#41442
passed with stages
in 15 minutes 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
58 deletions
+34
-58
WebDic.js
src/pages/dataCenter/dictionary1/WebDic.js
+34
-58
No files found.
src/pages/dataCenter/dictionary1/WebDic.js
View file @
84757bdc
...
...
@@ -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
>
...
...
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