Commit b10d7767 by zhaochengxiang

增加参数

parent 4fbc2dd9
......@@ -18,8 +18,8 @@ export function* listUserElements(payload) {
return yield call(service.listUserElements, payload);
}
export function* listCustomElements() {
return yield call(service.listCustomElements);
export function* listCustomElements(payload) {
return yield call(service.listCustomElements, payload);
}
export function* listFilterElementIds(payload) {
......
......@@ -16,8 +16,8 @@ export function listUserElements(payload) {
return PostJSON("/dataassetmanager/elementApi/listSelectedRangeElements", payload);
}
export function listCustomElements() {
return GetJSON("/dataassetmanager/elementApi/listCustomElements");
export function listCustomElements(payload) {
return GetJSON("/dataassetmanager/elementApi/listCustomElements", payload);
}
export function listFilterElementIds(payload) {
......
......@@ -7,14 +7,17 @@ import update from 'immutability-helper';
import DragTag from './DragTag';
import PreviewTree from './PreviewTree';
import { dispatch, dispatchLatest } from '../../../../model';
import { AssetManageReference, AssetBrowseReference, ResourceBrowseReference } from '../../../../util/constant';
import { AssetManageReference, AssetBrowseReference, ResourceBrowseReference, ResourceManageReference } from '../../../../util/constant';
import { showMessage } from '../../../../util';
import { getAssetType, showMessage } from '../../../../util';
const resourceTypes = [
{ key: 'innerSource', name: '内部资源' },
{ key: 'outerSource', name: '外部资源' },
{ key: 'dataAsset', name: '资产' },
]
const assetTypes = [
{ key: 'dataAsset', name: '资产' }
]
const CustomDirectoryModal = (props) => {
......@@ -49,6 +52,9 @@ const CustomDirectoryModal = (props) => {
const getAllElementsThenGetCurrentDirectory = () => {
dispatch({
type: 'assetmanage.listCustomElements',
payload: {
dataAsset: getAssetType(reference)
},
callback: elements => {
setData(elements||[]);
setFilterData((elements||[]).filter(item => (item.name||'').indexOf(keyword)!==-1));
......@@ -81,11 +87,15 @@ const CustomDirectoryModal = (props) => {
let url = 'assetmanage.previewTreeByCustomElements';
let payload = {
data: checkedValues
data: checkedValues,
params: {
dataAsset: getAssetType(reference)
}
}
if (reference===AssetManageReference) {
if (reference===ResourceManageReference || reference===AssetManageReference) {
payload.params = {
...payload.params,
resourceTypes: (form.getFieldValue('resourceTypes')||[]).join(',')
};
}
......@@ -94,6 +104,7 @@ const CustomDirectoryModal = (props) => {
url = 'assetmanage.previewTreeByCustomElementsAndResourceType';
payload.params = {
...payload.params,
resourceType: (reference===ResourceBrowseReference)?'resource':'dataAsset',
}
}
......@@ -155,7 +166,10 @@ const CustomDirectoryModal = (props) => {
let payload = {
data: checkedValues,
params: row
params: {
...row,
dataAsset: getAssetType(reference)
}
}
if (action === 'edit') {
......@@ -164,10 +178,10 @@ const CustomDirectoryModal = (props) => {
let url = 'assetmanage.saveTreeByCustomElements';
if (reference===AssetManageReference) {
if (reference===ResourceManageReference || reference===AssetManageReference) {
payload.params = {
...payload.params,
resourceTypes: (row.resourceTypes||[]).join(',')
resourceTypes: (row.resourceTypes||[]).join(','),
}
}
......@@ -304,7 +318,7 @@ const CustomDirectoryModal = (props) => {
<Input />
</Form.Item>
{
reference===AssetManageReference && <Form.Item
(reference===ResourceManageReference) && <Form.Item
label='数据范围'
name='resourceTypes'
>
......@@ -317,6 +331,20 @@ const CustomDirectoryModal = (props) => {
</Select>
</Form.Item>
}
{
(reference===AssetManageReference) && <Form.Item
label='数据范围'
name='resourceTypes'
>
<Select mode="multiple" allowClear>
{
assetTypes.map((item,index) => {
return <Select.Option key={item.key}>{item.name}</Select.Option>
})
}
</Select>
</Form.Item>
}
<Form.Item
label='描述或原因'
name='desc'
......
......@@ -3,10 +3,11 @@ import { Button, Upload, Drawer, Table, Pagination, Divider, Form } from 'antd';
import { UploadOutlined, DownloadOutlined } from '@ant-design/icons';
import { dispatch } from '../../../../model';
import { showMessage, formatDate } from '../../../../util';
import { showMessage, formatDate, getAssetType } from '../../../../util';
import { AssetManageReference } from '../../../../util/constant';
const ImportAssetDrawer = (props) => {
const { onCancel, onSuccess, visible, nodeId } = props;
const { onCancel, onSuccess, visible, nodeId, reference = AssetManageReference } = props;
const [ fileList, setFileList ] = useState([]);
const [ confirmLoading, setConfirmLoading ] = useState(false);
......@@ -76,7 +77,7 @@ const ImportAssetDrawer = (props) => {
}, [visible])
const downloadTemplate = () => {
window.open("/api/dataassetmanager/dataAssetApi/getImportTemplate");
window.open(`/api/dataassetmanager/dataAssetApi/getImportTemplate?dataAsset=${getAssetType(reference)}`);
}
const getLogs = (p = 1, s = 20) => {
......@@ -84,6 +85,7 @@ const ImportAssetDrawer = (props) => {
dispatch({
type: 'assetmanage.importLogs',
payload: {
dataAsset: getAssetType(reference),
page: p,
pageSize: s
},
......@@ -134,7 +136,8 @@ const ImportAssetDrawer = (props) => {
dispatch({
type: 'assetmanage.getDirectoryById',
payload: {
dirId: nodeId
dirId: nodeId,
dataAsset: getAssetType(reference)
},
callback: data => {
console.log('path', data.path);
......
......@@ -3,10 +3,11 @@ import { Modal, Form, Upload, Button, Radio, Space } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
import { dispatch } from '../../../../model';
import { showNotifaction } from '../../../../util';
import { getAssetType, showNotifaction } from '../../../../util';
import { AssetManageReference } from '../../../../util/constant';
const ImportDirectory = (props) => {
const { visible, onCancel, dirId } = props;
const { visible, onCancel, dirId, reference = AssetManageReference } = props;
const [ uploading, setUploading ] = useState(false);
const [ fileList, setFileList ] = useState([]);
const [ form ] = Form.useForm();
......@@ -32,7 +33,8 @@ const ImportDirectory = (props) => {
dispatch({
type: 'assetmanage.getDirectoryById',
payload: {
dirId
dirId,
dataAsset: getAssetType(reference)
},
callback: data => {
setDir(data);
......@@ -55,7 +57,8 @@ const ImportDirectory = (props) => {
if (row.type === 'root') {
payload = {
params: {
ignoreRepeatPath
ignoreRepeatPath,
dataAsset: getAssetType(reference)
},
fileList: fileList,
};
......@@ -63,7 +66,8 @@ const ImportDirectory = (props) => {
payload = {
params: {
ignoreRepeatPath,
parentPath: dir.path
parentPath: dir.path,
dataAsset: getAssetType(reference)
},
fileList: fileList
};
......
......@@ -10,7 +10,7 @@ import { defaultPage, usePage } from '../../../util/hooks/page'
import Table from '../../../util/Component/Table'
import { dispatch } from '../../../model'
import { getAssetRange, getAssetType, getQueryParam, IsArr, isSzseEnv, showMessage, showNotifaction } from '../../../util'
import { ResourceManageReference } from '../../../util/constant'
import { AssetManageReference, ResourceManageReference } from '../../../util/constant'
import PermissionButton from '../../../util/Component/PermissionButton'
import PermissionMenuItem from '../../../util/Component/PermissionMenuItem'
import { FullScreenSvg, CancelFullScreenSvg } from '../AssetManage/Component/AssetSvg'
......@@ -85,6 +85,7 @@ const FC = (props) => {
})
const [importAssetParams, setImportAssetParams] = React.useState({
visible: false,
reference: undefined,
nodeId: undefined
})
const [changeCatalogParams, setChangeCatalogParams] = React.useState({
......@@ -631,6 +632,7 @@ const FC = (props) => {
const onImportClick = () => {
setImportAssetParams({
visible: true,
reference: ResourceManageReference,
nodeId: node?.nodeId
})
}
......@@ -641,11 +643,11 @@ const FC = (props) => {
title: '提示',
content: '是否导出选中目录下的所有资产?',
onOk: () => {
window.open(`/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?dirId=${node?.nodeId}&recursive=${args.params.catalogType === 'currentRecursive'}`);
window.open(`/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?dirId=${node?.nodeId}&recursive=${args.params.catalogType === 'currentRecursive'}&dataAsset=${getAssetRange(ResourceManageReference)}`);
}
})
} else {
window.open(`/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?dataAssetIds=${selectedRows.map(item => item.id).join(',')}`);
window.open(`/api/dataassetmanager/dataAssetApi/exportByDataAssetIds?dataAssetIds=${selectedRows.map(item => item.id).join(',')}&dataAsset=${getAssetRange(ResourceManageReference)}`);
}
}
......@@ -1258,6 +1260,7 @@ const FC = (props) => {
onCancel={() => {
setImportAssetParams({
visible: false,
reference: undefined,
nodeId: undefined
})
}}
......
......@@ -4,7 +4,7 @@ import { PlusOutlined, ReloadOutlined, ImportOutlined, ExportOutlined, SettingOu
import produce from 'immer'
import { dispatch } from '../../../model'
import { showMessage, highlightSearchContentByTerms, showNotifaction } from '../../../util'
import { showMessage, highlightSearchContentByTerms, showNotifaction, getAssetType } from '../../../util'
import Tree from '../../../util/Component/Tree'
import PermissionButton from '../../../util/Component/PermissionButton'
import UpdateNode from './update-node'
......@@ -12,6 +12,7 @@ import ImportNode from '../AssetManage/Component/ImportDirectory'
import CustomNode from '../AssetManage/Component/CustomDirectoryModal'
import './tree.less'
import { ResourceManageReference } from '../../../util/constant';
export const generateList = (data, list, path = null, rootNodeId = null) => {
for (const node of data??[]) {
......@@ -61,10 +62,12 @@ const FC = (props) => {
})
const [importNodeParam, setImportNodeParam] = useState({
visible: false,
reference: undefined,
dirId: undefined
})
const [customNodeParam, setCustomNodeParam] = useState({
visible: false,
reference: undefined
})
const [permissions, setPermissions] = useState()
......@@ -246,13 +249,15 @@ const FC = (props) => {
const onImportClick = () => {
setImportNodeParam({
visible: true,
reference: ResourceManageReference,
dirId: selectedKey
})
}
const onCustomClick = () => {
setCustomNodeParam({
visible: true
visible: true,
reference: ResourceManageReference,
})
}
......@@ -358,6 +363,7 @@ const FC = (props) => {
const onImportNodeCancel = (refresh = false, resetSelectedNode = false) => {
setImportNodeParam({
visible: false,
reference: undefined,
dirId: undefined
})
refresh && getTreeData(resetSelectedNode)
......@@ -365,7 +371,8 @@ const FC = (props) => {
const onCustomNodeCancel = (refresh = false) => {
setCustomNodeParam({
visible: false
visible: false,
reference: undefined,
})
if (refresh) {
......@@ -433,7 +440,7 @@ const FC = (props) => {
<Menu>
<Menu.Item>
<div style={{ textAlign: 'center' }} onClick={() => {
window.open('/api/dataassetmanager/directoryApi/export')
window.open(`/api/dataassetmanager/directoryApi/export?dataAsset=${getAssetType(ResourceManageReference)}`)
}}>
导出所有
</div>
......@@ -444,7 +451,8 @@ const FC = (props) => {
dispatch({
type: 'assetmanage.getDirectoryById',
payload: {
dirId: selectedKey
dirId: selectedKey,
dataAsset: getAssetType(ResourceManageReference)
},
callback: data => {
window.open(`/api/dataassetmanager/directoryApi/export?parentPath=${data.path}`);
......
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