Commit 15477267 by zhaochengxiang

资产增加申请

parent 144a1fb5
import React from 'react'
import { Drawer } from 'antd'
import DataPortal from '../../../QianKun/DataPortal';
const FC = ({ visible, items, onCancel }) => {
const close = () => {
onCancel?.()
}
return (
<Drawer
title='申请'
placement="right"
closable={true}
width={'90%'}
onClose={close}
visible={visible}
destroyOnClose
>
<DataPortal requirementType='association-asset' items={items} />
</Drawer>
)
}
export default FC
\ No newline at end of file
......@@ -19,6 +19,7 @@ import { FullScreenSvg, CancelFullScreenSvg } from './AssetSvg';
import { AppContext } from "../../../../App";
import WorksheetModal from "./WorksheetModal";
import WorkbookDrawer from "./WorkbookDrawer";
import Apply from './Apply'
import "./AssetTable.less";
import 'react-contexify/dist/ReactContexify.css';
......@@ -154,6 +155,11 @@ const AssetTable = (props) => {
const [ reportTypes, setReportTypes ] = useState();
const [ report, setReport ] = useState();
const [ applyParams, setApplyParams ] = useState({
visible: false,
items: undefined
})
const [ modal, contextHolder ] = Modal.useModal();
const anchorId = getQueryParam(AnchorId, props.location.search);
const timestamp = getQueryParam(AnchorTimestamp, props.location.search);
......@@ -685,6 +691,15 @@ const AssetTable = (props) => {
}
}
const applyAsset = () => {
if ((checkedItems??[]).length > 0) {
setApplyParams({
visible: true,
items: checkedItems
})
}
}
const onFilterElementModalCancel = (refresh = false) => {
setFilterElementVisible(false);
refresh && getFilterElementsGroupThenGetDataAssets();
......@@ -872,6 +887,12 @@ const AssetTable = (props) => {
</React.Fragment>
)
}
<Menu.Item disabled={(checkedKeys||[]).length===0}>
<div className='text-center' onClick={applyAsset}>
申请
</div>
</Menu.Item>
</Menu>
);
......@@ -905,6 +926,12 @@ const AssetTable = (props) => {
</React.Fragment>
)
}
<Menu.Item disabled={(checkedKeys||[]).length===0}>
<div className='text-center' onClick={applyAsset}>
申请
</div>
</Menu.Item>
</Menu>
);
......@@ -1112,6 +1139,16 @@ const AssetTable = (props) => {
onCancel={onWorkbookDrawerCancel}
/>
<Apply
onCancel={() => {
setApplyParams({
visible: false,
items: undefined
})
}}
{...applyParams}
/>
<RcMenu id={MENU_ID}>
{
(contextMenuItem.resourceState==='notRelatedAsset') && <RcItem id="uncombed" onClick={handleItemClick}>
......
import { loadMicroApp, MicroApp } from 'qiankun'
import React, { useEffect, useRef, useState } from 'react'
import {useSelector} from "react-redux"
const App= (props)=> {
const containerRef = useRef(null)
const microApp = useRef()
const {requirementType, items} = props
const time = new Date().getTime()
const location = props.location;
useEffect(() => {
if (!!containerRef.current) {
microApp.current = loadMicroApp(
{ name: 'data-portal-demo', entry: `/data-portal-demo?time=${time}`, container: containerRef.current, props: { type: 3, requirementType, items }},
);
}
return () => {
microApp.current?.unmount();
}
}, [])
useEffect(() => {
function updateMicroApp() {
if (microApp.current?.update) {
setTimeout(() => {
microApp.current?.update?.({ requirementType, items })
},100)
} else {
setTimeout(() => {
updateMicroApp();
}, 100)
}
}
if (requirementType && items) {
updateMicroApp();
}
}, [requirementType, items])
return (
<div ref={containerRef} style={{ width: '100%', height: '100%' }} />
);
}
export default App
\ No newline at end of file
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