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
8396b5af
Commit
8396b5af
authored
Nov 22, 2021
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户管理添加重复用户名验证
parent
f946510b
Pipeline
#38429
skipped with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
9 deletions
+61
-9
WebDic.js
src/pages/dataCenter/dictionary1/WebDic.js
+60
-8
AddUserModal.jsx
src/pages/userCenter/userManage/AddUserModal.jsx
+1
-1
No files found.
src/pages/dataCenter/dictionary1/WebDic.js
View file @
8396b5af
...
...
@@ -23,6 +23,7 @@ import { useHistory } from 'react-router-dom';
import
map
from
'@/pages/user/login/components/Login/map'
;
import
{
Link
}
from
'react-router-dom'
;
import
{
GetMetaData
}
from
'@/services/platform/gis'
;
import
DragTable
from
'@/components/DragTable/DragTable'
;
const
WebDic
=
()
=>
{
...
...
@@ -51,6 +52,9 @@ const WebDic = () => {
const
[
isloading
,
setIsloading
]
=
useState
(
false
)
const
history
=
useHistory
();
const
[
showSearchStyle
,
setShowSearchStyle
]
=
useState
(
false
);
// 是否显示模糊查询样式
const
[
orderTable
,
setOrderTable
]
=
useState
([]);
const
[
flowIDs
,
setFlowIDs
]
=
useState
(
''
);
const
[
fgg
,
setFgg
]
=
useState
(
0
);
const
[
InPutVisible
,
setInPutVisible
]
=
useState
(
false
);
...
...
@@ -294,7 +298,6 @@ const WebDic = () => {
}
else
{
n
=
val
;
}
console
.
log
(
n
)
return
<
div
dangerouslySetInnerHTML
=
{{
__html
:
n
}}
/>
;
};
...
...
@@ -314,6 +317,36 @@ const WebDic = () => {
useEffect
(()
=>
{
getData
(
null
);
//首次加载可以为空
},
[
flag
]);
const
setOd
=
e
=>
{
setOrderTable
(
e
)
setFgg
(
fgg
+
1
)
}
useEffect
(()
=>
{
setOrderTable
(()
=>
{
let
table
;
console
.
log
(
data
)
table
=
data
.
filter
(
item
=>
item
.
nodeID
!==
-
1
);
console
.
log
(
table
)
return
table
;
});
},
[
fgg
]);
// 根据orderTable值改变flowIDs
useEffect
(()
=>
{
let
ids
=
''
;
orderTable
.
forEach
((
item
,
index
)
=>
{
if
(
index
===
orderTable
.
length
-
1
)
{
ids
+=
`
${
item
.
nodeID
}
`
;
}
else
{
ids
+=
`
${
item
.
nodeID
}
,`
;
}
});
console
.
log
(
ids
)
setFlowIDs
(
ids
);
},
[
orderTable
]);
// 根据父节点nodeID(即parentID)获取子节点数据,一级条目parentID = -1
const
getData
=
value
=>
{
console
.
log
(
value
);
...
...
@@ -332,6 +365,8 @@ const WebDic = () => {
//是否首次加载
if
(
value
===
null
||
value
===
'-1'
)
{
setData
(
res
);
setOd
(
res
)
console
.
log
(
res
)
console
.
log
(
first
)
if
(
first
)
{
...
...
@@ -692,10 +727,23 @@ const WebDic = () => {
}
setLoading
(
false
)
setIsloading
(
false
)
});
}
// 拖拽回调函数
const
dragCallBack
=
data
=>
{
console
.
log
(
data
)
if
(
data
)
{
setData
(
data
);
}
};
const
dragCallBack1
=
data
=>
{
if
(
data
)
{
setSubData
(
data
);
}
};
return
(
<
div
className
=
{
styles
.
WebDic
}
>
<
Spin
spinning
=
{
loading
}
tip
=
"loading..."
>
...
...
@@ -727,13 +775,15 @@ const WebDic = () => {
<
Row
style
=
{{
background
:
'white'
}}
>
<
Col
span
=
{
8
}
className
=
{
styles
.
left
}
>
{
/* 一级条目 表格 */
}
<
Table
<
Drag
Table
size
=
"small"
key
=
''
rowKey
=
{
record
=>
record
.
nodeID
}
columns
=
{
columns
}
dataSource
=
{
data
}
dataSource
=
{
orderTable
}
// orderTable={orderTable}
scroll
=
{{
y
:
'calc(100vh - 370px)'
}}
bordered
dragCallBack
=
{
dragCallBack
}
className
=
{
styles
.
pab
}
title
=
{()
=>
{
return
<
div
>
...
...
@@ -752,7 +802,8 @@ const WebDic = () => {
<
/div
>
}}
rowClassName
=
{
setRowClassName
}
onRow
=
{
record
=>
({
onRow
=
{(
record
,
index
)
=>
({
index
,
onClick
:
()
=>
{
getData
(
record
.
nodeID
);
setSelect
(
record
);
...
...
@@ -766,11 +817,12 @@ const WebDic = () => {
<
Col
span
=
{
16
}
>
{
/* 二级条目 表格 */
}
<
Spin
spinning
=
{
isloading
}
tip
=
"loading..."
>
<
Table
<
Drag
Table
size
=
"small"
bordered
rowKey
=
{
record
=>
record
.
nodeID
}
columns
=
{
columns1
}
dragCallBack
=
{
dragCallBack1
}
className
=
{
styles
.
tab
}
dataSource
=
{
subData
}
scroll
=
{{
x
:
'max-content'
,
y
:
'calc(100vh - 340px)'
}}
...
...
src/pages/userCenter/userManage/AddUserModal.jsx
View file @
8396b5af
...
...
@@ -84,7 +84,7 @@ const AddUserModal = props => {
}
else
{
notification
.
error
({
message
:
'提交失败'
,
description
:
res
.
m
essage
,
description
:
res
.
m
sg
,
});
}
})
...
...
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