Commit 361facf3 by zhaochengxiang

资产授权

parent d28ae430
import { PostJSON, GetJSON, PostFile, Post, Delete } from "../util/axios" import { PostJSON, GetJSON, PostFile, Post } from "../util/axios"
export function importElement(payload) { export function importElement(payload) {
return PostFile("/dataassetmanager/elementApi/import", payload); return PostFile("/dataassetmanager/elementApi/import", payload);
......
import React,{ useState, useEffect, useRef } from "react"; import React,{ useState, useEffect, useRef, useContext } 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 } from "antd";
import classNames from 'classnames'; import classNames from 'classnames';
import { Resizable } from 'react-resizable'; import { Resizable } from 'react-resizable';
...@@ -16,6 +16,7 @@ import { showMessage, showNotifaction, getQueryParam, inputWidth, isSzseEnv } fr ...@@ -16,6 +16,7 @@ import { showMessage, showNotifaction, getQueryParam, inputWidth, isSzseEnv } fr
import { AnchorId, AnchorDirId, AnchorTimestamp, AssetBrowseReference, AssetManageReference, AssetRecycleReference, ResourceBrowseReference } from '../../../../util/constant'; import { AnchorId, AnchorDirId, AnchorTimestamp, AssetBrowseReference, AssetManageReference, AssetRecycleReference, ResourceBrowseReference } from '../../../../util/constant';
import { FullScreenSvg, CancelFullScreenSvg } from './AssetSvg'; import { FullScreenSvg, CancelFullScreenSvg } from './AssetSvg';
import AssetDeleteModal from './AssetDeleteModal'; import AssetDeleteModal from './AssetDeleteModal';
import { AppContext } from "../../../../App";
import "./AssetTable.less"; import "./AssetTable.less";
import 'react-contexify/dist/ReactContexify.css'; import 'react-contexify/dist/ReactContexify.css';
...@@ -158,6 +159,8 @@ const AssetTable = (props) => { ...@@ -158,6 +159,8 @@ const AssetTable = (props) => {
const metadataIndexRef = useRef(''); const metadataIndexRef = useRef('');
const remoteRelationRef = useRef(null); const remoteRelationRef = useRef(null);
const app = useContext(AppContext)
useEffect(() => { useEffect(() => {
if (TableWidth>0 && columns.length>0) { if (TableWidth>0 && columns.length>0) {
const currentWidth = (columns.reduce((preVal, col) => (col.width?col.width:0) + preVal, 0)) + 32.0; const currentWidth = (columns.reduce((preVal, col) => (col.width?col.width:0) + preVal, 0)) + 32.0;
...@@ -763,6 +766,11 @@ const AssetTable = (props) => { ...@@ -763,6 +766,11 @@ const AssetTable = (props) => {
}); });
} }
}); });
} else if (key === 'authorization') {
app?.setGlobalState && app?.setGlobalState({
message: 'data-govern-assets-admit',
data: contextMenuItem
})
} }
} }
...@@ -1013,16 +1021,19 @@ const AssetTable = (props) => { ...@@ -1013,16 +1021,19 @@ const AssetTable = (props) => {
onDeleteAll={onAssetDeleteModalDeleteAll} onDeleteAll={onAssetDeleteModalDeleteAll}
/> />
<RcMenu id={MENU_ID}> <RcMenu id={MENU_ID}>
{ {
(contextMenuItem.resourceState==='notRelatedAsset') && <RcItem id="uncombed" onClick={handleItemClick}> (contextMenuItem.resourceState==='notRelatedAsset') && <RcItem id="uncombed" onClick={handleItemClick}>
转为未梳理 转为未梳理
</RcItem> </RcItem>
} }
{ {
(contextMenuItem.resourceState==='uncombed') && <RcItem id="notRelatedAsset" onClick={handleItemClick}> (contextMenuItem.resourceState==='uncombed') && <RcItem id="notRelatedAsset" onClick={handleItemClick}>
转为非资产 转为非资产
</RcItem>
}
<RcItem id="authorization" onClick={handleItemClick}>
授权
</RcItem> </RcItem>
}
</RcMenu> </RcMenu>
{contextHolder} {contextHolder}
......
...@@ -2,7 +2,6 @@ import React, { useEffect, useMemo, useRef, useState } from 'react'; ...@@ -2,7 +2,6 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
import { Modal, Form, TreeSelect, Select, Space, Button, Row, Col, Tabs, Spin, Input } from 'antd'; import { Modal, Form, TreeSelect, Select, Space, Button, Row, Col, Tabs, Spin, Input } from 'antd';
import { dispatch } from '../../../../model'; import { dispatch } from '../../../../model';
import { draft } from '../../../../service/datamodeler';
import { showMessage } from '../../../../util'; import { showMessage } from '../../../../util';
const AddSourceModelName = '新增数据来源' const AddSourceModelName = '新增数据来源'
...@@ -233,7 +232,7 @@ const AttributeRelationWithSourceModel = (props) => { ...@@ -233,7 +232,7 @@ const AttributeRelationWithSourceModel = (props) => {
<Button type="primary" onClick={() => onOk()} loading={confirmLoading}>确定</Button> <Button type="primary" onClick={() => onOk()} loading={confirmLoading}>确定</Button>
</Space> </Space>
</div> </div>
<Form form={form} style={{ maxHeight: 500, overflow: 'auto' }} {...formItemLayout}> <Form form={form} style={{ maxHeight: 400, overflow: 'auto' }} {...formItemLayout}>
<Form.Item <Form.Item
label='来源模型名称' label='来源模型名称'
name='sourceModel' name='sourceModel'
...@@ -376,7 +375,7 @@ const AttributeRelationModal = (props) => { ...@@ -376,7 +375,7 @@ const AttributeRelationModal = (props) => {
</Space> </Space>
} }
> >
<Tabs tabPosition='left' activeKey={activeKey} onChange={onTabsChange} style={{ maxHeight: 500, overflow: 'auto' }}> <Tabs tabPosition='left' activeKey={activeKey} onChange={onTabsChange} style={{ maxHeight: 400, overflow: 'auto' }}>
{ {
tabData?.map((item, i) => { tabData?.map((item, i) => {
return <Tabs.TabPane tab={item} key={item}> return <Tabs.TabPane tab={item} key={item}>
......
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