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
9106c8d8
Commit
9106c8d8
authored
Oct 23, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
复核
parent
672c07c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
8 deletions
+65
-8
check-assets.jsx
src/view/Manage/AssetResourceManage/check-assets.jsx
+62
-8
table.jsx
src/view/Manage/AssetResourceManage/table.jsx
+3
-0
No files found.
src/view/Manage/AssetResourceManage/check-assets.jsx
View file @
9106c8d8
...
...
@@ -2,9 +2,11 @@ import React from 'react'
import
{
Modal
,
Button
,
Spin
,
Form
,
Radio
}
from
'antd'
import
{
dispatch
}
from
'../../../model'
import
{
checkMenuAdmit
}
from
'../../../util'
import
{
AnchorDirId
,
AnchorId
}
from
'../../../util/constant'
const
FC
=
(
props
)
=>
{
const
{
items
,
visible
,
onCancel
}
=
props
const
{
items
,
visible
,
onCancel
,
type
=
'single'
}
=
props
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
basicRef
=
React
.
useRef
()
...
...
@@ -62,7 +64,7 @@ const FC = (props) => {
onCancel=
{
()
=>
{
close
()
}
}
>
<
Spin
spinning=
{
waiting
}
>
<
Basic
ref=
{
basicRef
}
items=
{
items
}
/>
<
Basic
ref=
{
basicRef
}
items=
{
items
}
type=
{
type
}
/>
</
Spin
>
</
Modal
>
)
...
...
@@ -70,7 +72,8 @@ const FC = (props) => {
export
default
FC
export
const
Basic
=
React
.
forwardRef
(
function
({
items
},
ref
)
{
export
const
Basic
=
React
.
forwardRef
(
function
({
items
,
type
},
ref
)
{
const
[
relations
,
setRelations
]
=
React
.
useState
([])
const
[
form
]
=
Form
.
useForm
()
React
.
useImperativeHandle
(
ref
,
()
=>
({
...
...
@@ -79,6 +82,12 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
},
}),
[
form
])
React
.
useEffect
(()
=>
{
if
(
type
===
'single'
)
{
getRelations
()
}
},
[])
const
checkInfo
=
React
.
useMemo
(()
=>
{
const
toBeCheckCount
=
(
items
??[]).
filter
(
item
=>
(
item
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'check'
)
!==
-
1
).
length
const
noNeedToBeCheckCount
=
(
items
??[]).
filter
(
item
=>
(
item
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'check'
)
===
-
1
).
length
...
...
@@ -86,6 +95,34 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
return
`已选数据:
${(
items
??[]).
length
}
无需复核:
$
{
noNeedToBeCheckCount
}
待复核:
$
{
toBeCheckCount
}
`
}, [items])
const getRelations = () => {
if ((items??[]).length > 0) {
dispatch({
type: 'assetmanage.getResourceRelations',
payload: {
dataAssetId: items[0].id,
},
callback: data => {
setRelations(data??[])
}
})
}
}
const jumpToRelation = (relation) => {
const timestamp = new Date().getTime()
if (relation.resourceType==='innerSource'||relation.resourceType==='outerSource') {
if (checkMenuAdmit('asset-resource-browse')) {
window.open(`
/
center
-
home
/
menu
/
asset
-
resource
-
browse
?
$
{
AnchorId
}
=
$
{
relation
?.
dataAssetId
}
&
$
{
AnchorDirId
}
=
$
{
relation
?.
dirId
}
&
timestamp
=
$
{
timestamp
}
`)
}
} else if (relation.resourceType==='dataAsset') {
if (checkMenuAdmit('asset-browse')) {
window.open(`
/
center
-
home
/
menu
/
asset
-
browse
?
$
{
AnchorId
}
=
$
{
relation
?.
dataAssetId
}
&
$
{
AnchorDirId
}
=
$
{
relation
?.
dirId
}
&
timestamp
=
$
{
timestamp
}
`)
}
}
}
const onValuesChange = (changedValues, allValues) => {
console.log('all values', allValues)
}
...
...
@@ -93,23 +130,39 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
return (
<Form
form={form}
labelCol={{ span:
3
}}
wrapperCol={{ span: 2
1
}}
labelCol={{ span:
4
}}
wrapperCol={{ span: 2
0
}}
autoComplete="off"
onValuesChange={onValuesChange}
>
<Form.Item style={{ marginBottom: 5 }}>
<span>{checkInfo}</span>
</Form.Item>
{
type === 'multiple' && <Form.Item style={{ marginBottom: 5 }}>
<span>{checkInfo}</span>
</Form.Item>
}
<Form.Item
name='status'
rules={[{ required: true, message: '请选择复核方式!' }]}
style={{ marginBottom: 5 }}
>
<Radio.Group>
<Radio value="checked"> 验证通过 </Radio>
<Radio value="changeToNotAsset"> 转为非资产 </Radio>
</Radio.Group>
</Form.Item>
{
type === 'single' && <Form.Item label='关联资产' style={{ marginBottom: 5 }}>
<div className='flex' style={{ flexDirection: 'column', lineHeight: '32px' }}>
{
(relations??[]).map((item, index) => {
return (
<a key={index} onClick={() => {jumpToRelation(item)}}>{item.dataAssetName}</a>
);
})
}
</div>
</Form.Item>
}
</Form>
)
})
\ No newline at end of file
src/view/Manage/AssetResourceManage/table.jsx
View file @
9106c8d8
...
...
@@ -123,6 +123,7 @@ const FC = (props) => {
})
const
[
checkAssetsParams
,
setCheckAssetsParams
]
=
React
.
useState
({
visible
:
false
,
type
:
undefined
,
items
:
undefined
})
...
...
@@ -650,6 +651,7 @@ const FC = (props) => {
const
onCheckClick
=
()
=>
{
setCheckAssetsParams
({
visible
:
true
,
type
:
'multiple'
,
items
:
selectedRows
})
}
...
...
@@ -778,6 +780,7 @@ const FC = (props) => {
const onRightCheckClick = () => {
setCheckAssetsParams({
visible: true,
type: 'single',
items: [rightRow]
})
}
...
...
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