Commit d2abfe48 authored by 皮倩雯's avatar 皮倩雯

修改数据字典UI

parent 4c0477b6
Pipeline #31994 passed with stages
in 35 minutes 30 seconds
......@@ -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>
);
......
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