Commit 8396b5af authored by 皮倩雯's avatar 皮倩雯

用户管理添加重复用户名验证

parent f946510b
Pipeline #38429 skipped with stages
......@@ -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
<DragTable
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
<DragTable
size="small"
bordered
rowKey={record => record.nodeID}
columns={columns1}
dragCallBack={dragCallBack1}
className={styles.tab}
dataSource={subData}
scroll={{ x: 'max-content', y: 'calc(100vh - 340px)' }}
......
......@@ -84,7 +84,7 @@ const AddUserModal = props => {
} else {
notification.error({
message: '提交失败',
description: res.message,
description: res.msg,
});
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment