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
Show 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 = () => {
...
@@ -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
>
...
...
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