Commit 24f9388f authored by 皮倩雯's avatar 皮倩雯

修改数据字典导入数据格式验证

parent 2be9ad2b
Pipeline #39988 skipped with stages
/* eslint-disable no-else-return */
/* eslint-disable no-undef */
/* eslint-disable no-shadow */
import React, { useState, useEffect } from 'react';
import {
......@@ -224,80 +226,6 @@ const WebDic = () => {
},
];
// const columns2 = [
// {
// title: () => <span className={styles.font}>名称</span>,
// dataIndex: 'nodeName',
// key: 'nodeName',
// },
// {
// title: () => <span className={styles.font}>值</span>,
// dataIndex: 'nodeValue',
// width: 400,
// key: 'nodeValue',
// render: record => {
// if (!record) {
// return '-';
// }
// return record;
// },
// },
// {
// title: () => <span className={styles.font}>操作</span>,
// key: 'action',
// width: 100,
// align: 'center',
// render: record => (
// <Space>
// <Tooltip title="编辑">
// <EditTwoTone
// onClick={() => {
// setSelect(record);
// if (record.parentID === '-1') {
// setSelectColor(record);
// }
// if (record.parentID === '-1' || record.parentID === null) {
// setEditVisible1(true);
// } else {
// setEditVisible(true);
// }
// editForm.setFieldsValue({
// nodeName: record.nodeName,
// nodeValue: record.nodeValue,
// });
// }}
// style={{ fontSize: '16px' }}
// />
// </Tooltip>
// <div onClick={e => e.stopPropagation()}>
// <Tooltip title="删除">
// <Popconfirm
// title="是否确认删除该数据,删除一级目录数据会将其二级目录子数据一起删除?"
// okText="确认"
// cancelText="取消"
// onConfirm={submitDelete}
// >
// <DeleteOutlined
// onClick={() => {
// setSelect(record);
// if (record.parentID === '-1') {
// setSelectColor(record);
// }
// }}
// style={{
// fontSize: '16px',
// margin: '0px 10px',
// color: '#e86060',
// }}
// />
// </Popconfirm>
// </Tooltip>
// </div>
// </Space>
// ),
// },
// ];
// 模糊查询匹配的样式
const searchStyle = val => {
let n;
......@@ -693,6 +621,7 @@ const WebDic = () => {
headers: {
authorization: 'authorization-text',
},
accept: 'application/vnd.ms-excel',
beforeUpload: file => {
console.log('filee', file);
setFiles(file.file);
......@@ -708,13 +637,12 @@ const WebDic = () => {
data = item.response.code;
mse = item.response.msg;
});
console.log(data);
if (data === 0) {
console.log(1);
message.success(`${info.file.name} 导入成功`);
notification.success({
message: '导入成功',
});
setFirst(true);
} else {
console.log(2);
notification.error({
message: '导入失败',
description: mse,
......@@ -783,15 +711,15 @@ const WebDic = () => {
// 拖拽回调函数
const dragCallBack = value => {
// console.log(value)
// console.log(orderTable)
console.log(data);
console.log(value);
if (value) {
setData(value);
}
};
const dragCallBack1 = e => {
// console.log(e)
// console.log(orderTable1)
console.log(e);
console.log(subData);
if (e) {
setSubData(e);
}
......
......@@ -740,7 +740,7 @@ const AddModal = props => {
forceRender
getContainer={false}
>
<Search
{/* <Search
style={{
width: 260,
marginRight: '20px',
......@@ -751,8 +751,8 @@ const AddModal = props => {
onChange={e => handleSearch(e)}
enterButton
value={searchWord}
/>
<Button
/> */}
{/* <Button
type="primary"
htmlType="submit"
// onClick={() => {
......@@ -762,7 +762,7 @@ const AddModal = props => {
// }}
>
重置
</Button>
</Button> */}
{visible && (
<div className={styles.listCard1}>
<div className={styles.cardItem1}>
......@@ -778,7 +778,7 @@ const AddModal = props => {
<Divider
orientation="left"
style={{
margin: '0 0 10px 0',
margin: '0 0 10px -10px',
color: '#15428b',
borderTopColor: '#99bbe8',
}}
......@@ -819,7 +819,7 @@ const AddModal = props => {
</div>
</div>
)}
<Pagination
{/* <Pagination
total={total}
showTotal={item => `共 ${item} 条`}
defaultPageSize={pageSize}
......@@ -829,7 +829,7 @@ const AddModal = props => {
style={{ marginBottom: '10px' }}
size="small"
showQuickJumper
/>
/> */}
</Modal>
);
}
......
......@@ -26,14 +26,6 @@ export const ExportDataDictionary = params =>
get(`${PUBLISH_SERVICE}/DataManger/ExportDataDictionary`, params, {
responseType: 'blob',
});
// 导入文件
export const ImportDataDictionary = params =>
post(`${PUBLISH_SERVICE}/DataManger/ImportDataDictionary`, params, {
headers: {
authorization: 'authorization-text',
},
name: 'file',
});
// 拖拽组件
export const DataDictionaryChangeOrder = params =>
post(`${PUBLISH_SERVICE}/DataManger/DataDictionaryChangeOrder`, params);
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