Commit 884921f8 authored by 皮倩雯's avatar 皮倩雯

修改数据字典界面UI

parent a42d0aca
Pipeline #32046 skipped with stages
...@@ -274,7 +274,7 @@ const AppDic = () => { ...@@ -274,7 +274,7 @@ const AppDic = () => {
}).then( }).then(
res => { res => {
if (res.code == 0) { if (res.code == 0) {
setAddVisible(false); setEditVisible(false);
getData(); getData();
notification.success({ notification.success({
message: '提交成功', message: '提交成功',
...@@ -317,11 +317,12 @@ const AppDic = () => { ...@@ -317,11 +317,12 @@ const AppDic = () => {
// .catch(err => { // .catch(err => {
// message.error(err); // message.error(err);
// }); // });
console.log(select)
DeleteKeyValue({ DeleteKeyValue({
key: select.Key, key: select.Key,
}).then( }).then(
res => { res => {
if (res.code == 0) { if (res.code === 0) {
getData(select.parentID); getData(select.parentID);
notification.success({ notification.success({
message: '删除成功', message: '删除成功',
......
...@@ -32,6 +32,7 @@ const WebDic = () => { ...@@ -32,6 +32,7 @@ const WebDic = () => {
const [searchData, setSearchData] = useState([]);// 搜索框表格数据 const [searchData, setSearchData] = useState([]);// 搜索框表格数据
const [first, setFirst] = useState(true); // 是否第一次加载 const [first, setFirst] = useState(true); // 是否第一次加载
const [select, setSelect] = useState({}); // 当前选中条目,可以是一级/二级,修改/删除时设置 const [select, setSelect] = useState({}); // 当前选中条目,可以是一级/二级,修改/删除时设置
const [twoSelectColor, setTwoSelectColor] = useState({});
const [selectColor, setSelectColor] = useState({}); // 当前选中一级条目颜色,修改/删除时设置 const [selectColor, setSelectColor] = useState({}); // 当前选中一级条目颜色,修改/删除时设置
const [selectID, setSelectID] = useState('-1'); // 当前选中一级条目的ID,添加二级条目时使用 const [selectID, setSelectID] = useState('-1'); // 当前选中一级条目的ID,添加二级条目时使用
const [addVisible, setAddVisible] = useState(false);//添加二级条目 const [addVisible, setAddVisible] = useState(false);//添加二级条目
...@@ -220,8 +221,13 @@ const WebDic = () => { ...@@ -220,8 +221,13 @@ const WebDic = () => {
} }
] ]
const setRowClassName = record => const setRowClassName = record => {
record.nodeID === selectColor.nodeID ? styles.clickRowStyle : ''; return record.nodeID === selectColor.nodeID ? styles.clickRowStyle : '';
}
const setRowClassName1 = record => {
return record.nodeID === twoSelectColor.nodeID ? styles.clickRowStyle : '';
}
// 获取搜索框的值 // 获取搜索框的值
const handleSearch = e => { const handleSearch = e => {
...@@ -601,16 +607,16 @@ const WebDic = () => { ...@@ -601,16 +607,16 @@ const WebDic = () => {
<Table <Table
size="small" size="small"
bordered bordered
width="99%"
columns={columns1} columns={columns1}
className={styles.tab} className={styles.tab}
dataSource={subData} dataSource={subData}
scroll={{ x: 'max-content', y: 'calc(100vh - 340px)' }} scroll={{ x: 'max-content', y: 'calc(100vh - 340px)' }}
rowClassName={setRowClassName} rowClassName={setRowClassName1}
onRow={record => ({ onRow={record => ({
onClick: () => { onClick: () => {
setSelect(record); setSelect(record);
setSelectColor(record); setTwoSelectColor(record);
setSelectID(record.nodeID); setSelectID(record.nodeID);
}, },
})} })}
...@@ -728,7 +734,7 @@ const WebDic = () => { ...@@ -728,7 +734,7 @@ const WebDic = () => {
))} ))}
<Form.Item> <Form.Item>
<Button type="dashed" onClick={() => add()} block icon={<PlusOutlined />} style={{ width: '353px', marginLeft: '61px' }}> <Button type="dashed" onClick={() => add()} block icon={<PlusOutlined />} style={{ width: '353px', marginLeft: '61px' }}>
新增表单 新增条目
</Button> </Button>
</Form.Item> </Form.Item>
</> </>
...@@ -820,7 +826,7 @@ const WebDic = () => { ...@@ -820,7 +826,7 @@ const WebDic = () => {
/> />
</Modal> </Modal>
<Modal <Modal
title={'查找条目'} title={'导入数据'}
visible={InPutVisible} visible={InPutVisible}
onOk={input1} onOk={input1}
onCancel={() => { onCancel={() => {
...@@ -829,7 +835,7 @@ const WebDic = () => { ...@@ -829,7 +835,7 @@ const WebDic = () => {
okText="确认" okText="确认"
cancelText="取消"> cancelText="取消">
<Upload {...props}> <Upload {...props}>
<UploadOutlined /><span style={{ verticalAlign: 'middle', marginLeft: '6px', marginRight: "40px", cursor: "pointer" }}><a style={{ color: 'rgba(0, 0, 0, 0.85)' }}>导入数据</a></span> <UploadOutlined /><span style={{ verticalAlign: 'middle', marginLeft: '6px', marginRight: "40px", cursor: "pointer" }}><a style={{ color: 'rgb(24 144 255)' }}>请选择将要导入的数据文件(仅支持Excel文件)</a></span>
</Upload> </Upload>
</Modal> </Modal>
</div> </div>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
.ant-table-body{ .ant-table-body{
max-height: calc(100vh - 338px) !important; max-height: calc(100vh - 338px) !important;
min-height:calc(100vh - 338px); min-height:calc(100vh - 338px);
margin-right: -6px;
} }
.ant-table-pagination.ant-pagination { .ant-table-pagination.ant-pagination {
margin: 10px 0 !important; margin: 10px 0 !important;
...@@ -37,5 +38,8 @@ ...@@ -37,5 +38,8 @@
margin-right: -7px; margin-right: -7px;
} }
} }
.ant-table-wrapper {
max-width: 98%;
}
} }
\ No newline at end of file
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