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 */ /* eslint-disable no-shadow */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { import {
...@@ -224,80 +226,6 @@ const WebDic = () => { ...@@ -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 => { const searchStyle = val => {
let n; let n;
...@@ -693,6 +621,7 @@ const WebDic = () => { ...@@ -693,6 +621,7 @@ const WebDic = () => {
headers: { headers: {
authorization: 'authorization-text', authorization: 'authorization-text',
}, },
accept: 'application/vnd.ms-excel',
beforeUpload: file => { beforeUpload: file => {
console.log('filee', file); console.log('filee', file);
setFiles(file.file); setFiles(file.file);
...@@ -708,13 +637,12 @@ const WebDic = () => { ...@@ -708,13 +637,12 @@ const WebDic = () => {
data = item.response.code; data = item.response.code;
mse = item.response.msg; mse = item.response.msg;
}); });
console.log(data);
if (data === 0) { if (data === 0) {
console.log(1); notification.success({
message.success(`${info.file.name} 导入成功`); message: '导入成功',
});
setFirst(true); setFirst(true);
} else { } else {
console.log(2);
notification.error({ notification.error({
message: '导入失败', message: '导入失败',
description: mse, description: mse,
...@@ -783,15 +711,15 @@ const WebDic = () => { ...@@ -783,15 +711,15 @@ const WebDic = () => {
// 拖拽回调函数 // 拖拽回调函数
const dragCallBack = value => { const dragCallBack = value => {
// console.log(value) console.log(data);
// console.log(orderTable) console.log(value);
if (value) { if (value) {
setData(value); setData(value);
} }
}; };
const dragCallBack1 = e => { const dragCallBack1 = e => {
// console.log(e) console.log(e);
// console.log(orderTable1) console.log(subData);
if (e) { if (e) {
setSubData(e); setSubData(e);
} }
......
...@@ -740,7 +740,7 @@ const AddModal = props => { ...@@ -740,7 +740,7 @@ const AddModal = props => {
forceRender forceRender
getContainer={false} getContainer={false}
> >
<Search {/* <Search
style={{ style={{
width: 260, width: 260,
marginRight: '20px', marginRight: '20px',
...@@ -751,8 +751,8 @@ const AddModal = props => { ...@@ -751,8 +751,8 @@ const AddModal = props => {
onChange={e => handleSearch(e)} onChange={e => handleSearch(e)}
enterButton enterButton
value={searchWord} value={searchWord}
/> /> */}
<Button {/* <Button
type="primary" type="primary"
htmlType="submit" htmlType="submit"
// onClick={() => { // onClick={() => {
...@@ -762,7 +762,7 @@ const AddModal = props => { ...@@ -762,7 +762,7 @@ const AddModal = props => {
// }} // }}
> >
重置 重置
</Button> </Button> */}
{visible && ( {visible && (
<div className={styles.listCard1}> <div className={styles.listCard1}>
<div className={styles.cardItem1}> <div className={styles.cardItem1}>
...@@ -778,7 +778,7 @@ const AddModal = props => { ...@@ -778,7 +778,7 @@ const AddModal = props => {
<Divider <Divider
orientation="left" orientation="left"
style={{ style={{
margin: '0 0 10px 0', margin: '0 0 10px -10px',
color: '#15428b', color: '#15428b',
borderTopColor: '#99bbe8', borderTopColor: '#99bbe8',
}} }}
...@@ -819,7 +819,7 @@ const AddModal = props => { ...@@ -819,7 +819,7 @@ const AddModal = props => {
</div> </div>
</div> </div>
)} )}
<Pagination {/* <Pagination
total={total} total={total}
showTotal={item => `共 ${item} 条`} showTotal={item => `共 ${item} 条`}
defaultPageSize={pageSize} defaultPageSize={pageSize}
...@@ -829,7 +829,7 @@ const AddModal = props => { ...@@ -829,7 +829,7 @@ const AddModal = props => {
style={{ marginBottom: '10px' }} style={{ marginBottom: '10px' }}
size="small" size="small"
showQuickJumper showQuickJumper
/> /> */}
</Modal> </Modal>
); );
} }
......
...@@ -26,14 +26,6 @@ export const ExportDataDictionary = params => ...@@ -26,14 +26,6 @@ export const ExportDataDictionary = params =>
get(`${PUBLISH_SERVICE}/DataManger/ExportDataDictionary`, params, { get(`${PUBLISH_SERVICE}/DataManger/ExportDataDictionary`, params, {
responseType: 'blob', responseType: 'blob',
}); });
// 导入文件
export const ImportDataDictionary = params =>
post(`${PUBLISH_SERVICE}/DataManger/ImportDataDictionary`, params, {
headers: {
authorization: 'authorization-text',
},
name: 'file',
});
// 拖拽组件 // 拖拽组件
export const DataDictionaryChangeOrder = params => export const DataDictionaryChangeOrder = params =>
post(`${PUBLISH_SERVICE}/DataManger/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