Commit 946cc452 by zhaochengxiang

浏览变更目录

parent 318b6f4c
import React,{ useState, useEffect, useRef, useContext, useMemo } from "react";
import { Button, Pagination, Space, Modal, Input, Table, Tooltip, Checkbox, Typography, Dropdown, Menu } from "antd";
import { Button, Pagination, Space, Modal, Input, Table, Tooltip, Checkbox, Typography, Dropdown, Menu, Divider } from "antd";
import classNames from 'classnames';
import { Resizable } from 'react-resizable';
import ResizeObserver from 'rc-resize-observer';
......@@ -137,13 +137,11 @@ const AssetTable = (props) => {
const [ importAssetVisible, setImportAssetVisible ] = useState(false);
const [ filterElementVisible, setFilterElementVisible ] = useState(false);
const [ assetEditVisible, setAssetEditVisible ] = useState(false);
const [ assetMountVisible, setAssetMountVisible ] = useState(false);
const [ assetDetailDrawerVisible, setAssetDetailDrawerVisible ] = useState(false);
// const [ currentAssetId, setCurrentAssetId ] = useState('');
const [ pagination, setPagination ] = useState( { pageNum: 1, pageSize: 20 } );
const { pageNum, pageSize } = pagination;
const [ keyword, setKeyword ] = useState('');
const [ batchCatalogChange, setBatchCatalogChange ] = useState(false);
const [ fullScreen, setFullScreen ] = useState(false);
const [ recursive, setRecursive ] = useState(true);
const [ fullSearch, setFullSearch ] = useState(false);
......@@ -152,6 +150,10 @@ const AssetTable = (props) => {
const [ assetDeleteModalVisible, setAssetDeleteModalVisible ] = useState(false);
const [ startFlowModalVisible, setStartFlowModalVisible ] = useState(false);
const [ users, setUsers ] = useState([]);
const [ assetMountParam, setAssetMountParam ] = useState({
visible: false,
ids: undefined
})
const [ modal, contextHolder ] = Modal.useModal();
const anchorId = getQueryParam(AnchorId, props?.location?.search);
......@@ -167,19 +169,28 @@ const AssetTable = (props) => {
const actionCol = {
title: '操作',
dataIndex: 'action',
width: 80,
width: 120,
fixed: 'right',
filter: false,
render: (_, record) => {
return (
<React.Fragment>
<Space size={5} split={<Divider type='vertical' style={{margin:0}} />}>
{
(reference===AssetManageReference||(reference===AssetBrowseReference&&record.hasPermission)) && <a onClick={(e) => {
e.stopPropagation();
handleItemClick('authorization', record);
}}>授权</a>
}
</React.Fragment>
{
(reference===AssetManageReference||(reference===AssetBrowseReference&&record.hasPermission)) && <a onClick={(e) => {
e.stopPropagation();
setAssetMountParam({
visible: true,
ids: [record.id]
});
}}>变更目录</a>
}
</Space>
)
}
}
......@@ -579,7 +590,10 @@ const AssetTable = (props) => {
}
const onAssetMountCancel = (refresh = false) => {
setAssetMountVisible(false);
setAssetMountParam({
visible: false,
ids: undefined
});
if (refresh) {
setCheckedKeys([]);
......@@ -700,8 +714,11 @@ const AssetTable = (props) => {
const onBatchCatalogChangeBtnClick = () => {
if ((checkedKeys||[]).length===0) return;
setBatchCatalogChange(true);
setAssetMountVisible(true);
setAssetMountParam({
visible: true,
ids: checkedKeys
});
}
const onAssetDeleteModalCancel = () => {
......@@ -1129,9 +1146,9 @@ const AssetTable = (props) => {
onSuccess={onImportAssetSuccess}
/>
<AssetMount
visible={ assetMountVisible }
visible={ assetMountParam.visible }
reference={reference}
ids={ batchCatalogChange?checkedKeys:[] }
ids={ assetMountParam.ids }
onCancel={ onAssetMountCancel }
{...props}
/>
......
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