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 = () => { ...@@ -44,7 +44,9 @@ const WebDic = () => {
const [searchWord, setSearchWord] = useState(''); // 关键字 const [searchWord, setSearchWord] = useState(''); // 关键字
const { Search } = Input; const { Search } = Input;
const [files, setFiles] = useState(''); 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 [InPutVisible, setInPutVisible] = useState(false);
const columns = [ const columns = [
...@@ -231,7 +233,7 @@ const WebDic = () => { ...@@ -231,7 +233,7 @@ const WebDic = () => {
}, [flag]); }, [flag]);
// 根据父节点nodeID(即parentID)获取子节点数据,一级条目parentID = -1 // 根据父节点nodeID(即parentID)获取子节点数据,一级条目parentID = -1
const getData = value => { const getData = value => {
setLoading(true); isLoadingShow(value, true)
GetDataDictionaryList({ nodeID: value }).then(resnew => { GetDataDictionaryList({ nodeID: value }).then(resnew => {
if (resnew.code === 0) { if (resnew.code === 0) {
if (resnew.data.length > 0) { if (resnew.data.length > 0) {
...@@ -256,12 +258,12 @@ const WebDic = () => { ...@@ -256,12 +258,12 @@ const WebDic = () => {
} else if (value) { } else if (value) {
setSubData(res);//设置二级条目,res为空[]时也要设置 setSubData(res);//设置二级条目,res为空[]时也要设置
} }
setLoading(false); isLoadingShow(value, false)
} else { } else {
setLoading(false); isLoadingShow(value, false)
} }
} else { } else {
setLoading(false); isLoadingShow(value, false)
notification.error({ notification.error({
message: '获取失败', message: '获取失败',
description: resnew.msg, description: resnew.msg,
...@@ -271,7 +273,14 @@ const WebDic = () => { ...@@ -271,7 +273,14 @@ const WebDic = () => {
}; };
const isLoadingShow = (value, data) => {
if (!value || value == -1) {
setLoading(data);
}
else {
setIsloading(data)
}
}
const onSearch = () => { const onSearch = () => {
setSearchVisible(true) setSearchVisible(true)
} }
...@@ -524,12 +533,12 @@ const WebDic = () => { ...@@ -524,12 +533,12 @@ const WebDic = () => {
} }
}, },
}; };
const input1 =()=>{ const input1 = () => {
setFlag(flag+1) setFlag(flag + 1)
setInPutVisible(false); setInPutVisible(false);
} }
const submitInput =()=>{ const submitInput = () => {
setInPutVisible(true); setInPutVisible(true);
} }
return ( return (
...@@ -543,9 +552,9 @@ const WebDic = () => { ...@@ -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> <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>
<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> </span>
</div> </div>
<Row style={{ background: 'white' }}> <Row style={{ background: 'white' }}>
...@@ -588,40 +597,42 @@ const WebDic = () => { ...@@ -588,40 +597,42 @@ const WebDic = () => {
</Col> </Col>
<Col span={16}> <Col span={16}>
{/* 二级条目 表格 */} {/* 二级条目 表格 */}
<Table <Spin spinning={isloading} tip="loading...">
size="small" <Table
bordered size="small"
width="99%" bordered
columns={columns1} width="99%"
className={styles.tab} columns={columns1}
dataSource={subData} className={styles.tab}
scroll={{ x: 'max-content', y: 'calc(100vh - 340px)' }} dataSource={subData}
rowClassName={setRowClassName} scroll={{ x: 'max-content', y: 'calc(100vh - 340px)' }}
onRow={record => ({ rowClassName={setRowClassName}
onClick: () => { onRow={record => ({
setSelect(record); onClick: () => {
setSelectColor(record); setSelect(record);
setSelectID(record.nodeID); setSelectColor(record);
}, setSelectID(record.nodeID);
})} },
title={() => { })}
return <div> title={() => {
<span>二级条目</span> return <div>
<Tooltip title="添加二级条目配置"> <span>二级条目</span>
<PlusSquareFilled <Tooltip title="添加二级条目配置">
onClick={() => setItem(2)} <PlusSquareFilled
style={{ onClick={() => setItem(2)}
color: '#1890FF', style={{
fontSize: '25px', color: '#1890FF',
verticalAlign: 'middle', fontSize: '25px',
float: 'right', verticalAlign: 'middle',
}} float: 'right',
/> }}
</Tooltip> />
</div> </Tooltip>
}} </div>
pagination={pagenation} }}
/> pagination={pagenation}
/>
</Spin>
</Col> </Col>
</Row> </Row>
</Spin> </Spin>
...@@ -809,17 +820,17 @@ const WebDic = () => { ...@@ -809,17 +820,17 @@ const WebDic = () => {
/> />
</Modal> </Modal>
<Modal <Modal
title={'查找条目'} title={'查找条目'}
visible={InPutVisible} visible={InPutVisible}
onOk={input1} onOk={input1}
onCancel={() => { onCancel={() => {
setInPutVisible(false) setInPutVisible(false)
}} }}
okText="确认" okText="确认"
cancelText="取消"> cancelText="取消">
<Upload {...props}> <Upload {...props}>
<DownloadOutlined /><span style={{ verticalAlign: 'middle', marginLeft: '6px', marginRight: "40px", cursor: "pointer" }}><a style={{ color: 'rgba(0, 0, 0, 0.85)' }}>导入数据</a></span> <DownloadOutlined /><span style={{ verticalAlign: 'middle', marginLeft: '6px', marginRight: "40px", cursor: "pointer" }}><a style={{ color: 'rgba(0, 0, 0, 0.85)' }}>导入数据</a></span>
</Upload> </Upload>
</Modal> </Modal>
</div> </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