Commit dc0bd3c1 by fanyongjun

Merge branch 'master' of ssh://132.232.112.242:7022/zcx/szse

parents 470c8348 afef2f2c
import React from "react";
import { message } from 'antd';
import { message, notification } from 'antd';
import { Redirect } from 'react-router-dom';
import { dispatchLatest, action } from '../model';
import { set_sess_state } from "../model/reducer";
......@@ -114,6 +114,15 @@ export const showMessage = function(action, content) {
}
}
export const showNotifaction = function(title, tip) {
notification.config({ prefixCls: "yy-notification" });
notification.open({
message: title||'提示',
description: <span dangerouslySetInnerHTML={{ __html: tip||''}} />,
duration: 0,
});
}
export function generateList(data,dataList){
if(data[0]===undefined)
return data
......
import React, { useState } from 'react';
import { Modal, Button, Upload } from 'antd';
import { Modal, Button, Upload, notification } from 'antd';
import { DownloadOutlined, UploadOutlined } from '@ant-design/icons';
import { dispatchLatest } from '../../../../model';
......@@ -27,7 +27,8 @@ const ImportModal = (props) => {
setFileList([file]);
return false;
}
},
fileList: fileList||[]
};
const handleOk = () => {
......@@ -41,9 +42,10 @@ const ImportModal = (props) => {
dispatchLatest({
type: 'dataassetelement.importElement',
payload: { fileList },
callback: () => {
callback: data => {
setConfirmLoading(false);
onCancel && onCancel(true);
reset();
onCancel && onCancel(true, data);
},
error: () => {
setConfirmLoading(false);
......@@ -51,6 +53,10 @@ const ImportModal = (props) => {
})
}
const reset = () => {
setFileList([]);
}
return (
<Modal
forceRender
......@@ -60,6 +66,7 @@ const ImportModal = (props) => {
onOk={handleOk}
onCancel={() => {
setConfirmLoading(false);
reset();
onCancel && onCancel();
}}
>
......
import React, { useState, useEffect } from 'react';
import { Button, Table, Pagination } from 'antd';
import { Button, Table, Pagination, notification } from 'antd';
import { dispatchLatest } from '../../../model';
import ImportModal from './Component/ImportModal';
import { showNotifaction } from '../../../util';
import './index.less';
const Element = (props) => {
......@@ -77,11 +78,15 @@ const Element = (props) => {
})
}
const onImportModalCancel = (refresh = false) => {
const onImportModalCancel = (refresh = false, tip = '') => {
setImportModalVisible(false);
if (refresh) {
setPagination({ pageNum: 1, pageSize: 20 });
}
if (tip && tip!== '') {
showNotifaction('导入提示', tip);
}
}
return (
......
......@@ -16,6 +16,12 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
const [ parameterCnNames, setParameterCnNames ] = useState(value.parameterCnNames||[]);
const [ parameterValues, setParameterValues ] = useState(value.parameterValues||[]);
useEffect(() => {
setName(value.name||'');
setParameterValues(value.parameterValues||[]);
setParameterCnNames(value.parameterCnNames||[]);
}, [ value ])
const onNameChange = (value) => {
setName(value);
......
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