Commit 09121709 by zhaochengxiang

增加资源类型

parent 287b85de
......@@ -69,6 +69,10 @@ export function* listDataAssetsByPage(payload) {
return yield call(service.listDataAssetsByPage, payload);
}
export function* listDataResourcesByPage(payload) {
return yield call(service.listDataResourcesByPage, payload);
}
export function* listDataAssetsByPersonalCustomType(payload) {
return yield call(service.listDataAssetsByPersonalCustomType, payload);
}
......@@ -189,8 +193,8 @@ export function* getAttributesByMetadataModel(payload) {
return yield call(service.getAttributesByMetadataModel, payload);
}
export function* loadElementWithoutCustom() {
return yield call(service.loadElementWithoutCustom);
export function* loadElementWithoutCustom(payload) {
return yield call(service.loadElementWithoutCustom, payload);
}
export function* saveEleAndAttrRel(payload) {
......
......@@ -68,6 +68,10 @@ export function listDataAssetsByPage(payload) {
return GetJSON("/dataassetmanager/dataAssetApi/listDataAssetsByPage", payload);
}
export function listDataResourcesByPage(payload) {
return GetJSON("/dataassetmanager/resourceApi/listResourcesByPage", payload);
}
export function listDataAssetsByPersonalCustomType(payload) {
return GetJSON("/dataassetmanager/dataAssetApi/listDataAssetsByPersonalCustomType", payload);
}
......@@ -200,8 +204,8 @@ export function getAttributesByMetadataModel(payload) {
return GetJSON("/dataassetmanager/eleAndAttrApi/getModelAttributes", payload);
}
export function loadElementWithoutCustom() {
return GetJSON("/dataassetmanager/eleAndAttrApi/loadElementWithoutCustom");
export function loadElementWithoutCustom(payload) {
return GetJSON("/dataassetmanager/eleAndAttrApi/loadElementWithoutCustom", payload);
}
export function saveEleAndAttrRel(payload) {
......
......@@ -410,6 +410,10 @@ export function getDataModelerRole(user) {
return DataModelerRoleAdmin;
}
export function getAssetType(reference) {
return (reference===AssetManageReference || reference===AssetBrowseReference) ? 'dataAsset' : 'resource'
}
export function getAssetRange(menuName) {
if (menuName === ResourceManageReference || menuName === AssetManageReference) {
return 'dataAsset_dataAssetManage';
......
......@@ -6,7 +6,7 @@ import { AssetBrowseReference, AssetManageReference, ResourceBrowseReference, Re
import ImportElement from './ImportElement';
import AttributeRelationModal from "./AttributeRelationModal";
import FilterElementModal from './FilterElementModal';
import { showNotifaction, getAssetRange } from '../../../../util';
import { showNotifaction, getAssetRange, getAssetType } from '../../../../util';
import { MoreSvg } from './AssetSvg';
import Separate from './Separate';
import record from '../Assets/record.png';
......@@ -108,7 +108,7 @@ const AssetDirectory = (props) => {
}
const onExportElementBtnClick = () => {
window.open('/api/dataassetmanager/elementApi/export');
window.open(`/api/dataassetmanager/elementApi/export?dataAssetType=${getAssetType(reference)}`);
}
const onFilterElementClick = () => {
......@@ -322,6 +322,7 @@ const AssetDirectory = (props) => {
<ImportElement
visible={importElementVisible}
type={reference}
onCancel={onImportElementCancel}
/>
......
......@@ -2,6 +2,8 @@ import React, { useEffect, useState } from 'react';
import { Modal, Form, TreeSelect, Select, Space, Button, Row, Col, } from 'antd';
import { dispatch } from '../../../../model';
import { AssetManageReference, ResourceManageReference } from '../../../../util/constant';
import { getAssetType } from '../../../../util';
const MetaModelSelect = ({ value = {}, metaModelTreeData = [], onChange, ...restProps }) => {
const [ attributes, setAttributes ] = useState([]);
......@@ -99,7 +101,7 @@ const MetaModelSelect = ({ value = {}, metaModelTreeData = [], onChange, ...rest
}
const AttributeRelationModal = (props) => {
const { visible, onCancel } = props;
const { visible, onCancel, type = ResourceManageReference } = props;
const [ confirmLoading, setConfirmLoading ] = useState(false);
const [ metadataModelTreeData, setMetadataModelTreeData ] = useState([]);
......@@ -146,6 +148,9 @@ const AttributeRelationModal = (props) => {
const loadElementWithoutCustom = () => {
dispatch({
type: 'assetmanage.loadElementWithoutCustom',
payload: {
dataAssetType: getAssetType(type)
},
callback: data => {
setElements(data||[]);
getRelAttrByModel();
......
......@@ -3,10 +3,11 @@ import { Button, Upload, Modal } from 'antd';
import { DownloadOutlined, UploadOutlined } from '@ant-design/icons';
import { dispatchLatest } from '../../../../model';
import { showMessage } from '../../../../util';
import { getAssetType, showMessage } from '../../../../util';
import { AssetManageReference } from '../../../../util/constant';
const ImportElement = (props) => {
const { onCancel, visible } = props;
const { onCancel, visible, type = AssetManageReference } = props;
const [ fileList, setFileList ] = useState([]);
const [ confirmLoading, setConfirmLoading ] = useState(false);
......@@ -42,7 +43,12 @@ const ImportElement = (props) => {
setConfirmLoading(true);
dispatchLatest({
type: 'assetmanage.importElement',
payload: { fileList },
payload: {
params: {
dataAssetType: getAssetType(type)
},
fileList,
},
callback: data => {
setConfirmLoading(false);
reset();
......
......@@ -7,7 +7,7 @@ import { debounceTime, Subject } from 'rxjs'
import { defaultPage, usePage } from '../../../util/hooks/page'
import Table from '../../../util/Component/Table'
import { dispatch } from '../../../model'
import { getAssetRange, isSzseEnv } from '../../../util'
import { getAssetRange, getAssetType, isSzseEnv } from '../../../util'
import { ResourceManageReference } from '../../../util/constant'
import PermissionButton from '../../../util/Component/PermissionButton'
import PermissionMenuItem from '../../../util/Component/PermissionMenuItem'
......@@ -212,7 +212,8 @@ const FC = (props) => {
dispatch({
type: 'assetmanage.listFilterElementsGroupByType',
payload: {
range: 'dataAsset_dataAssetManage'
range: getAssetRange(ResourceManageReference),
dataAssetType: getAssetType(ResourceManageReference)
},
callback: data => {
setLoadingElements(false)
......@@ -227,13 +228,13 @@ const FC = (props) => {
const getAssets = () => {
setLoading(true)
dispatch({
type: 'assetmanage.listDataAssetsByPage',
type: 'assetmanage.listDataResourcesByPage',
payload: {
dirId: node?.nodeId,
pageNum: args.params.page,
pageSize: args.params.size,
keyword: args.params.keyword,
range: 'dataAsset_dataAssetManage',
range: getAssetRange(ResourceManageReference),
},
callback: data => {
setLoading(false)
......
......@@ -179,7 +179,7 @@ const FC = (props) => {
setLoading(true)
setSelectedKey(prevSelectedKey => {
dispatch({
type: 'assetmanage.queryAllDirectoryAsTree',
type: 'assetmanage.queryResourceDirectoryAsTree',
callback: data => {
setLoading(false)
setLoadedKeys([])
......
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