Commit 1ac2f3f0 by zhaochengxiang

导入资产增加刷新

parent 0bc36754
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect, useContext } from 'react';
import { Button, Upload, Drawer, Table, Pagination, Divider, Form } from 'antd'; import { Button, Upload, Drawer, Table, Pagination, Divider, Form } from 'antd';
import { UploadOutlined, DownloadOutlined } from '@ant-design/icons'; import { UploadOutlined, DownloadOutlined } from '@ant-design/icons';
import { dispatch } from '../../../../model'; import { dispatch } from '../../../../model';
import { showMessage, formatDate } from '../../../../util'; import { showMessage, formatDate } from '../../../../util';
import { AppContext } from '../../../../App';
const ImportAssetDrawer = (props) => { const ImportAssetDrawer = (props) => {
const { onCancel, onSuccess, visible, nodeId } = props; const { onCancel, onSuccess, visible, nodeId } = props;
...@@ -16,6 +17,8 @@ const ImportAssetDrawer = (props) => { ...@@ -16,6 +17,8 @@ const ImportAssetDrawer = (props) => {
const { pageNum, pageSize } = pagination; const { pageNum, pageSize } = pagination;
const [ total, setTotal ] = useState(0); const [ total, setTotal ] = useState(0);
const app = useContext(AppContext);
const columns = [ const columns = [
{ {
title: '序号', title: '序号',
...@@ -137,10 +140,9 @@ const ImportAssetDrawer = (props) => { ...@@ -137,10 +140,9 @@ const ImportAssetDrawer = (props) => {
dirId: nodeId dirId: nodeId
}, },
callback: data => { callback: data => {
console.log('path', data.path);
dispatch({ dispatch({
type: 'assetmanage.assetImport', type: 'assetmanage.assetImport',
payload: { fileList: fileList, params: { parentPath: data?.path||'' } }, payload: { fileList: fileList, params: { parentPath: data?.path||'', env: `${app?.env?.domainId}` } },
callback: data => { callback: data => {
setConfirmLoading(false); setConfirmLoading(false);
setFileList([]); setFileList([]);
...@@ -192,6 +194,7 @@ const ImportAssetDrawer = (props) => { ...@@ -192,6 +194,7 @@ const ImportAssetDrawer = (props) => {
<Form.Item> <Form.Item>
<Button type='primary' onClick={handleOk} loading={confirmLoading}>确定导入</Button> <Button type='primary' onClick={handleOk} loading={confirmLoading}>确定导入</Button>
</Form.Item> </Form.Item>
<Button onClick={() => getLogs()} style={{ marginLeft: 'auto' }}>刷新日志</Button>
</Form> </Form>
</div> </div>
<Divider orientation="left">导入日志</Divider> <Divider orientation="left">导入日志</Divider>
......
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