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
80e9b264
Commit
80e9b264
authored
Aug 02, 2021
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加数据字典表单前端验证
parent
c216bc99
Pipeline
#32428
skipped with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
22 deletions
+50
-22
WebDic.js
src/pages/dataCenter/dictionary1/WebDic.js
+42
-19
WebDic.less
src/pages/dataCenter/dictionary1/WebDic.less
+8
-3
No files found.
src/pages/dataCenter/dictionary1/WebDic.js
View file @
80e9b264
...
...
@@ -45,7 +45,8 @@ const WebDic = () => {
const
[
searchWord
,
setSearchWord
]
=
useState
(
''
);
// 关键字
const
{
Search
}
=
Input
;
const
[
files
,
setFiles
]
=
useState
(
''
);
const
[
flag
,
setFlag
]
=
useState
(
0
)
const
[
flag
,
setFlag
]
=
useState
(
0
);
const
[
flag1
,
setFlag1
]
=
useState
(
0
);
//搜索框数据是否刷新
const
[
isloading
,
setIsloading
]
=
useState
(
false
)
const
[
InPutVisible
,
setInPutVisible
]
=
useState
(
false
);
...
...
@@ -234,9 +235,9 @@ const WebDic = () => {
if
(
record
.
parentID
===
'-1'
)
{
setSelectColor
(
record
);
}
if
(
record
.
parentID
===
'-1'
||
record
.
parentID
===
null
)
{
if
(
record
.
parentID
===
'-1'
||
record
.
parentID
===
null
)
{
setEditVisible1
(
true
);
}
else
{
}
else
{
setEditVisible
(
true
);
}
editForm
.
setFieldsValue
({
...
...
@@ -261,6 +262,7 @@ const WebDic = () => {
if
(
record
.
parentID
===
'-1'
)
{
setSelectColor
(
record
);
}
}
}
style
=
{{
...
...
@@ -348,6 +350,7 @@ const WebDic = () => {
}
const
onSearch
=
()
=>
{
setSearchVisible
(
true
)
setFlag1
(
1
)
}
//搜索
const
sumbitSearch
=
()
=>
{
...
...
@@ -362,14 +365,8 @@ const WebDic = () => {
}
})
}
const
sumbitSearch1
=
()
=>
{
SearchDataDictionaryList
({
key
:
searchWord
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
setSearchData
(
res
.
data
);
}
})
}
const
resetSearch
=
()
=>
{
setFlag1
(
0
)
setSearchVisible
(
false
);
setSearchWord
(
''
);
// 搜索框置空
setSearchData
([]);
...
...
@@ -426,13 +423,15 @@ const WebDic = () => {
const
nodeName1
=
addForm
.
getFieldsValue
()
const
nodeName
=
addForm
.
getFieldsValue
().
nodeName1
;
const
nodeValue
=
addForm
.
getFieldsValue
().
nodeValue1
;
console
.
log
(
nodeName1
);
console
.
log
(
nodeName
);
let
arr
=
[]
let
result
=
nodeName1
.
users
if
(
result
)
{
result
.
map
((
item
,
index
)
=>
{
if
(
item
===
undefined
)
{
if
(
item
===
undefined
)
{
}
else
{
}
else
{
arr
.
push
({
nodeName
:
item
.
nodeName
,
nodeValue
:
item
.
nodeValue
,
parentID
:
Number
(
value
)
})
}
...
...
@@ -502,9 +501,12 @@ const WebDic = () => {
notification
.
success
({
message
:
'提交成功'
,
});
sumbitSearch1
()
if
(
flag1
===
1
)
{
sumbitSearch
()
}
}
else
{
console
.
log
(
1
)
notification
.
error
({
message
:
'提交失败'
,
description
:
res
.
msg
,
...
...
@@ -532,9 +534,10 @@ const WebDic = () => {
notification
.
success
({
message
:
'提交成功'
,
});
sumbitSearch1
()
if
(
flag1
===
1
)
{
sumbitSearch
()
}
}
else
{
console
.
log
(
2
)
notification
.
error
({
message
:
'提交失败'
,
description
:
res
.
msg
,
...
...
@@ -554,7 +557,9 @@ const WebDic = () => {
nodeID
:
select
.
nodeID
,
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
sumbitSearch1
()
if
(
flag1
===
1
)
{
sumbitSearch
()
}
getData
(
select
.
parentID
===
'-1'
?
null
:
select
.
parentID
);
if
(
select
.
parentID
===
'-1'
)
{
setSubData
([]);
...
...
@@ -752,7 +757,11 @@ const WebDic = () => {
<
Form
.
Item
name
=
'nodeName1'
label
=
"名称"
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
rules
=
{
[
{
required
:
true
,
message
:
'不能为空'
},
]
}
>
<
Input
placeholder
=
"请输入名称"
/>
<
/Form.Item
>
...
...
@@ -775,7 +784,19 @@ const WebDic = () => {
name
=
{[
name
,
'nodeName'
]}
label
=
"名称"
fieldKey
=
{[
fieldKey
,
'frist'
]}
rules
=
{[{
required
:
true
,
message
:
'不能为空'
}]}
rules
=
{
[
{
required
:
true
,
message
:
'不能为空'
},
{
validator
:
(
rule
,
value
,
callback
)
=>
{
const
getNodeName
=
addForm
.
getFieldsValue
().
nodeName1
;
if
(
value
===
getNodeName
)
{
callback
(
'用户名重复'
);
}
}
}
]
}
>
<
Input
placeholder
=
"请输入名称"
/>
<
/Form.Item
>
...
...
@@ -830,6 +851,7 @@ const WebDic = () => {
<
/Form
>
<
/Modal
>
{
/*修改二级条目 */
}
<
Modal
title
=
{
'修改二级条目'
}
visible
=
{
editVisible
}
...
...
@@ -853,6 +875,7 @@ const WebDic = () => {
<
/Form.Item
>
<
/Form
>
<
/Modal
>
<
Modal
title
=
{
'查找条目'
}
visible
=
{
searchVisible
}
...
...
src/pages/dataCenter/dictionary1/WebDic.less
View file @
80e9b264
...
...
@@ -3,10 +3,15 @@
margin-bottom: 20px;
}
.ant-table-content{
max-height: calc(100vh - 26
8
px);
max-height: calc(100vh - 26
0
px);
border-right: white;
overflow: auto !important;
}
.divv{
.ant-modal-wrap {
z-index: 1001 !important;
}
}
.ant-table-tbody{
.clickRowStyle{
background: #cfe7fd;
...
...
@@ -22,8 +27,8 @@
}
}
.ant-table-body{
max-height: calc(100vh - 3
3
8px) !important;
min-height:calc(100vh - 3
3
8px);
max-height: calc(100vh - 3
2
8px) !important;
min-height:calc(100vh - 3
2
8px);
margin-right: -6px;
}
.ant-table-pagination.ant-pagination {
...
...
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