Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
15477267
Commit
15477267
authored
Aug 30, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产增加申请
parent
144a1fb5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
0 deletions
+117
-0
Apply.jsx
src/view/Manage/AssetManage/Component/Apply.jsx
+26
-0
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+37
-0
index.jsx
src/view/QianKun/DataPortal/index.jsx
+54
-0
No files found.
src/view/Manage/AssetManage/Component/Apply.jsx
0 → 100644
View file @
15477267
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
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
15477267
...
...
@@ -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
}
>
...
...
src/view/QianKun/DataPortal/index.jsx
0 → 100644
View file @
15477267
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment