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
d2abfe48
Commit
d2abfe48
authored
Jul 23, 2021
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改数据字典UI
parent
4c0477b6
Pipeline
#31994
passed with stages
in 35 minutes 30 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
57 deletions
+68
-57
WebDic.js
src/pages/dataCenter/dictionary1/WebDic.js
+68
-57
No files found.
src/pages/dataCenter/dictionary1/WebDic.js
View file @
d2abfe48
...
...
@@ -44,7 +44,9 @@ const WebDic = () => {
const
[
searchWord
,
setSearchWord
]
=
useState
(
''
);
// 关键字
const
{
Search
}
=
Input
;
const
[
files
,
setFiles
]
=
useState
(
''
);
const
[
flag
,
setFlag
]
=
useState
(
0
)
const
[
flag
,
setFlag
]
=
useState
(
0
)
const
[
isloading
,
setIsloading
]
=
useState
(
false
)
const
[
InPutVisible
,
setInPutVisible
]
=
useState
(
false
);
const
columns
=
[
...
...
@@ -231,7 +233,7 @@ const WebDic = () => {
},
[
flag
]);
// 根据父节点nodeID(即parentID)获取子节点数据,一级条目parentID = -1
const
getData
=
value
=>
{
setLoading
(
true
);
isLoadingShow
(
value
,
true
)
GetDataDictionaryList
({
nodeID
:
value
}).
then
(
resnew
=>
{
if
(
resnew
.
code
===
0
)
{
if
(
resnew
.
data
.
length
>
0
)
{
...
...
@@ -256,12 +258,12 @@ const WebDic = () => {
}
else
if
(
value
)
{
setSubData
(
res
);
//设置二级条目,res为空[]时也要设置
}
setLoading
(
false
);
isLoadingShow
(
value
,
false
)
}
else
{
setLoading
(
false
);
isLoadingShow
(
value
,
false
)
}
}
else
{
setLoading
(
false
);
isLoadingShow
(
value
,
false
)
notification
.
error
({
message
:
'获取失败'
,
description
:
resnew
.
msg
,
...
...
@@ -271,7 +273,14 @@ const WebDic = () => {
};
const
isLoadingShow
=
(
value
,
data
)
=>
{
if
(
!
value
||
value
==
-
1
)
{
setLoading
(
data
);
}
else
{
setIsloading
(
data
)
}
}
const
onSearch
=
()
=>
{
setSearchVisible
(
true
)
}
...
...
@@ -524,12 +533,12 @@ const WebDic = () => {
}
},
};
const
input1
=
()
=>
{
setFlag
(
flag
+
1
)
const
input1
=
()
=>
{
setFlag
(
flag
+
1
)
setInPutVisible
(
false
);
}
const
submitInput
=
()
=>
{
const
submitInput
=
()
=>
{
setInPutVisible
(
true
);
}
return
(
...
...
@@ -543,9 +552,9 @@ const WebDic = () => {
<
UploadOutlined
/><
span
style
=
{{
verticalAlign
:
'middle'
,
marginLeft
:
'6px'
,
marginRight
:
"40px"
,
cursor
:
"pointer"
}}
><
a
style
=
{{
color
:
'rgba(0, 0, 0, 0.85)'
}}
onClick
=
{()
=>
submitOutPut
()}
href
=
"/PandaOMS/OMS/DataManger/ExportDataDictionary"
>
导出数据
<
/a></
span
>
<
/span
>
<
span
>
<
DownloadOutlined
/><
span
style
=
{{
verticalAlign
:
'middle'
,
marginLeft
:
'6px'
,
marginRight
:
"40px"
,
cursor
:
"pointer"
}}
><
span
style
=
{{
color
:
'rgba(0, 0, 0, 0.85)'
}}
onClick
=
{()
=>
submitInput
()}
>
导入数据
<
/span></
span
>
<
DownloadOutlined
/><
span
style
=
{{
verticalAlign
:
'middle'
,
marginLeft
:
'6px'
,
marginRight
:
"40px"
,
cursor
:
"pointer"
}}
><
span
style
=
{{
color
:
'rgba(0, 0, 0, 0.85)'
}}
onClick
=
{()
=>
submitInput
()}
>
导入数据
<
/span></
span
>
<
/span
>
<
/div
>
<
Row
style
=
{{
background
:
'white'
}}
>
...
...
@@ -588,40 +597,42 @@ const WebDic = () => {
<
/Col
>
<
Col
span
=
{
16
}
>
{
/* 二级条目 表格 */
}
<
Table
size
=
"small"
bordered
width
=
"99%"
columns
=
{
columns1
}
className
=
{
styles
.
tab
}
dataSource
=
{
subData
}
scroll
=
{{
x
:
'max-content'
,
y
:
'calc(100vh - 340px)'
}}
rowClassName
=
{
setRowClassName
}
onRow
=
{
record
=>
({
onClick
:
()
=>
{
setSelect
(
record
);
setSelectColor
(
record
);
setSelectID
(
record
.
nodeID
);
},
})}
title
=
{()
=>
{
return
<
div
>
<
span
>
二级条目
<
/span
>
<
Tooltip
title
=
"添加二级条目配置"
>
<
PlusSquareFilled
onClick
=
{()
=>
setItem
(
2
)}
style
=
{{
color
:
'#1890FF'
,
fontSize
:
'25px'
,
verticalAlign
:
'middle'
,
float
:
'right'
,
}}
/
>
<
/Tooltip
>
<
/div
>
}}
pagination
=
{
pagenation
}
/
>
<
Spin
spinning
=
{
isloading
}
tip
=
"loading..."
>
<
Table
size
=
"small"
bordered
width
=
"99%"
columns
=
{
columns1
}
className
=
{
styles
.
tab
}
dataSource
=
{
subData
}
scroll
=
{{
x
:
'max-content'
,
y
:
'calc(100vh - 340px)'
}}
rowClassName
=
{
setRowClassName
}
onRow
=
{
record
=>
({
onClick
:
()
=>
{
setSelect
(
record
);
setSelectColor
(
record
);
setSelectID
(
record
.
nodeID
);
},
})}
title
=
{()
=>
{
return
<
div
>
<
span
>
二级条目
<
/span
>
<
Tooltip
title
=
"添加二级条目配置"
>
<
PlusSquareFilled
onClick
=
{()
=>
setItem
(
2
)}
style
=
{{
color
:
'#1890FF'
,
fontSize
:
'25px'
,
verticalAlign
:
'middle'
,
float
:
'right'
,
}}
/
>
<
/Tooltip
>
<
/div
>
}}
pagination
=
{
pagenation
}
/
>
<
/Spin
>
<
/Col
>
<
/Row
>
<
/Spin
>
...
...
@@ -809,17 +820,17 @@ const WebDic = () => {
/
>
<
/Modal
>
<
Modal
title
=
{
'查找条目'
}
visible
=
{
InPutVisible
}
onOk
=
{
input1
}
onCancel
=
{()
=>
{
setInPutVisible
(
false
)
}}
okText
=
"确认"
cancelText
=
"取消"
>
title
=
{
'查找条目'
}
visible
=
{
InPutVisible
}
onOk
=
{
input1
}
onCancel
=
{()
=>
{
setInPutVisible
(
false
)
}}
okText
=
"确认"
cancelText
=
"取消"
>
<
Upload
{...
props
}
>
<
DownloadOutlined
/><
span
style
=
{{
verticalAlign
:
'middle'
,
marginLeft
:
'6px'
,
marginRight
:
"40px"
,
cursor
:
"pointer"
}}
><
a
style
=
{{
color
:
'rgba(0, 0, 0, 0.85)'
}}
>
导入数据
<
/a></
span
>
<
/Upload
>
<
DownloadOutlined
/><
span
style
=
{{
verticalAlign
:
'middle'
,
marginLeft
:
'6px'
,
marginRight
:
"40px"
,
cursor
:
"pointer"
}}
><
a
style
=
{{
color
:
'rgba(0, 0, 0, 0.85)'
}}
>
导入数据
<
/a></
span
>
<
/Upload
>
<
/Modal
>
<
/div
>
);
...
...
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