Commit 78771009 by zhaochengxiang

资产目录刷新

parent 38649f1c
......@@ -100,6 +100,9 @@ export function* existDataAsset(payload) {
export function* queryAllDirectoryAsTree() {
return yield call(service.queryAllDirectoryAsTree);
}
export function* refreshDirectoryTree() {
return yield call(service.refreshDirectoryTree);
}
export function* queryResourceDirectoryAsTree() {
return yield call(service.queryResourceDirectoryAsTree);
}
......
......@@ -136,6 +136,10 @@ export function queryAllDirectoryAsTree() {
return GetJSON("/dataassetmanager/directoryApi/queryAllDirectoryAsTree");
}
export function refreshDirectoryTree() {
return GetJSON("/dataassetmanager/directoryApi/refreshDirectoryTree");
}
export function queryResourceDirectoryAsTree() {
return PostJSON("/dataassetmanager/directoryApi/querySourceTypeAsTree");
}
......
......@@ -517,6 +517,13 @@ const AssetAction = (props) => {
(attributes||[]).map((attribute, index) => {
let sameAttributeElements = (elements||[]).filter(element => element.type===attribute);
let showFold = false;
(sameAttributeElements||[]).forEach(element => {
if (element.foldAble !== '否') {
showFold = true;
}
});
if (currentAction!=='add' && !fullScreen && attributesFoldMap[attribute]) {
sameAttributeElements = (sameAttributeElements||[]).filter(element => element.foldAble==='否');
}
......@@ -543,7 +550,7 @@ const AssetAction = (props) => {
<div className='title-text' style={{ fontWeight: 'bold' }}>{attribute||''}</div>
</div>
{
currentAction!=='add'&&!fullScreen && (
currentAction!=='add'&&!fullScreen && showFold && (
attributesFoldMap[attribute] ? <Button
type='text'
style={{ padding: 0 }}
......
......@@ -149,18 +149,15 @@ const AssetManageTree = (props) => {
})
}
const getAllDirectoryAsTree = (resetCurrentDirId=true, defaultSelectedId='') => {
const getAllDirectoryAsTree = (resetCurrentDirId=true, defaultSelectedId='', refresh = false) => {
setLoading(true);
if (resetCurrentDirId) {
onSelect && onSelect('', '');
}
let url = '';
if (reference === AssetManageReference || reference === AssetMountReference) {
url = 'assetmanage.queryAllDirectoryAsTree';
}
let url = refresh ? 'assetmanage.refreshDirectoryTree' : 'assetmanage.queryAllDirectoryAsTree';
dispatch({
type: url,
callback: data => {
......@@ -403,7 +400,7 @@ const AssetManageTree = (props) => {
}
const refreshTree = () => {
getAllDirectoryAsTree(false);
getAllDirectoryAsTree(false, '', true);
}
const importDir = () => {
......
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