Commit 20ba0632 by zhaochengxiang

资产列表增加递归展示

parent f1396cb5
import React,{ useState, useEffect, useRef } from "react";
import { Button, Pagination, Space, Modal, Input, Table, Tooltip } from "antd";
import { Button, Pagination, Space, Modal, Input, Table, Tooltip, Checkbox } from "antd";
import classNames from 'classnames';
import SmoothScroll from 'smooth-scroll';
......@@ -33,6 +33,7 @@ const AssetTable = (props) => {
const [ keyword, setKeyword ] = useState('');
const [ batchCatalogChange, setBatchCatalogChange ] = useState(false);
const [ fullScreen, setFullScreen ] = useState(false);
const [ recursive, setRecursive ] = useState(true);
const [ modal, contextHolder ] = Modal.useModal();
const anchorId = getQueryParam(AnchorId, props.location.search);
......@@ -74,7 +75,7 @@ const AssetTable = (props) => {
getFilterElementsGroupThenGetDataAssets();
}
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [ keyword, pagination, elementsChanged, assetActionChanged ])
}, [ keyword, pagination, elementsChanged, assetActionChanged, recursive ])
useEffect(() => {
if (shouldScrollRef.current) {
......@@ -202,14 +203,21 @@ const AssetTable = (props) => {
const getDataAssets = (projectIndex = metadataIndexRef.current) => {
setLoading(true);
let params = {
dirId: nodeId,
pageNum,
pageSize,
keyword: keyword
};
if (reference !== AssetRecycleReference) {
params.recursive = recursive;
}
dispatchLatestHomepage({
type: (reference===AssetRecycleReference)?'assetmanage.listRecycleBinDataAssetsByPage':'assetmanage.listDataAssetsByPage',
payload: {
dirId: nodeId,
pageNum,
pageSize,
keyword: keyword
},
payload: params,
callback: data => {
const _assets = [];
......@@ -295,6 +303,10 @@ const AssetTable = (props) => {
setFilterElementVisible(true);
}
const onRecursiveChange = (e) => {
setRecursive(e.target.checked);
}
const exportAsset = () => {
if ((checkedKeys||[]).length === 0) {
showMessage('warn', '请先选择资产');
......@@ -348,7 +360,7 @@ const AssetTable = (props) => {
const onImportAssetSuccess = (tip = '') => {
getDataAssets();
if ((tip||'') !== '') {
showNotifaction('导入提示', tip, 5);
}
......@@ -427,6 +439,7 @@ const AssetTable = (props) => {
</React.Fragment>
}
<Button onClick={onFilterElementClick}>要素设置</Button>
<Checkbox onChange={onRecursiveChange} checked={recursive}>递归展示</Checkbox>
</Space>
<Space>
<Input
......
......@@ -179,7 +179,7 @@ const VersionCompare = (props) => {
</Select>
</Form.Item>
<Form.Item>
<Checkbox onChange={onOnlyShowChange} value={onlyShowChange}>仅显示差异</Checkbox>
<Checkbox onChange={onOnlyShowChange} checked={onlyShowChange}>仅显示差异</Checkbox>
</Form.Item>
</Form>
......
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