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
7b5fd0d3
Commit
7b5fd0d3
authored
Oct 23, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
复核
parent
b10d7767
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
152 additions
and
2 deletions
+152
-2
assetmanage.js
src/model/assetmanage.js
+4
-0
dataassetmanager.js
src/service/dataassetmanager.js
+4
-0
check-assets.jsx
src/view/Manage/AssetResourceManage/check-assets.jsx
+116
-0
table.jsx
src/view/Manage/AssetResourceManage/table.jsx
+28
-2
No files found.
src/model/assetmanage.js
View file @
7b5fd0d3
...
@@ -302,6 +302,10 @@ export function* deleteResources(payload) {
...
@@ -302,6 +302,10 @@ export function* deleteResources(payload) {
return
yield
call
(
service
.
deleteResources
,
payload
)
return
yield
call
(
service
.
deleteResources
,
payload
)
}
}
export
function
*
checkResources
(
payload
)
{
return
yield
call
(
service
.
checkResources
,
payload
)
}
export
function
*
getTasks
(
payload
)
{
export
function
*
getTasks
(
payload
)
{
return
yield
call
(
service
.
getTasks
,
payload
)
return
yield
call
(
service
.
getTasks
,
payload
)
}
}
...
...
src/service/dataassetmanager.js
View file @
7b5fd0d3
...
@@ -292,6 +292,10 @@ export function getPreviewRangeByDirId(payload) {
...
@@ -292,6 +292,10 @@ export function getPreviewRangeByDirId(payload) {
return
PostJSON
(
"/dataassetmanager/resourceApi/deleteResources"
,
payload
)
return
PostJSON
(
"/dataassetmanager/resourceApi/deleteResources"
,
payload
)
}
}
export
function
checkResources
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/resourceApi/check"
,
payload
)
}
export
function
getTasks
(
payload
)
{
export
function
getTasks
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/resource/taskApi/listTasksByPage"
,
payload
)
return
GetJSON
(
"/dataassetmanager/resource/taskApi/listTasksByPage"
,
payload
)
}
}
...
...
src/view/Manage/AssetResourceManage/check-assets.jsx
0 → 100644
View file @
7b5fd0d3
import
React
from
'react'
import
{
Modal
,
Button
,
Spin
,
Form
,
Radio
}
from
'antd'
import
{
dispatch
}
from
'../../../model'
const
FC
=
(
props
)
=>
{
const
{
items
,
visible
,
onCancel
}
=
props
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
basicRef
=
React
.
useRef
()
const
close
=
(
refresh
=
false
)
=>
{
setWaiting
(
false
)
onCancel
?.(
refresh
)
}
const
save
=
async
()
=>
{
try
{
const
rows
=
await
basicRef
.
current
?.
validate
()
setWaiting
(
true
)
dispatch
({
type
:
'assetmanage.checkResources'
,
payload
:
{
params
:
{
resourceIds
:
(
items
??[]).
filter
(
item
=>
(
item
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'check'
)
!==
-
1
).
map
(
item
=>
item
.
id
).
toString
(),
status
:
rows
.
status
},
},
callback
:
()
=>
{
setWaiting
(
false
)
onCancel
(
true
)
},
error
:
()
=>
{
setWaiting
(
false
)
}
})
}
catch
(
e
)
{
}
}
const
footer
=
React
.
useMemo
(()
=>
{
return
[
<
Button
key=
{
'cancel'
}
onClick=
{
()
=>
close
()
}
>
取消
</
Button
>,
<
Button
key=
{
'save'
}
type=
'primary'
onClick=
{
()
=>
save
()
}
>
确定
</
Button
>
]
},
[
close
,
save
])
return
(
<
Modal
visible=
{
visible
}
footer=
{
footer
}
width=
{
520
}
bodyStyle=
{
{
padding
:
'15px 15px 0px 15px'
,
overflowX
:
'auto'
,
maxHeight
:
'80vh'
}
}
title=
'复核确认'
centered
destroyOnClose
onCancel=
{
()
=>
{
close
()
}
}
>
<
Spin
spinning=
{
waiting
}
>
<
Basic
ref=
{
basicRef
}
items=
{
items
}
/>
</
Spin
>
</
Modal
>
)
}
export
default
FC
export
const
Basic
=
React
.
forwardRef
(
function
({
items
},
ref
)
{
const
[
form
]
=
Form
.
useForm
()
React
.
useImperativeHandle
(
ref
,
()
=>
({
validate
:
async
()
=>
{
return
await
form
.
validateFields
()
},
}),
[
form
])
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
return
`已选数据:
${(
items
??[]).
length
}
无需复核:
$
{
noNeedToBeCheckCount
}
待复核:
$
{
toBeCheckCount
}
`
}, [items])
const onValuesChange = (changedValues, allValues) => {
console.log('all values', allValues)
}
return (
<Form
form={form}
labelCol={{ span: 3 }}
wrapperCol={{ span: 21 }}
autoComplete="off"
onValuesChange={onValuesChange}
>
<Form.Item style={{ marginBottom: 5 }}>
<span>{checkInfo}</span>
</Form.Item>
<Form.Item
name='status'
rules={[{ required: true, message: '请选择复核方式!' }]}
>
<Radio.Group>
<Radio value="checked"> 验证通过 </Radio>
<Radio value="changeToNotAsset"> 转为非资产 </Radio>
</Radio.Group>
</Form.Item>
</Form>
)
})
\ No newline at end of file
src/view/Manage/AssetResourceManage/table.jsx
View file @
7b5fd0d3
...
@@ -27,6 +27,7 @@ import { AssetDirectorySubject } from '../AssetManage/Component/AssetDirectory'
...
@@ -27,6 +27,7 @@ import { AssetDirectorySubject } from '../AssetManage/Component/AssetDirectory'
import
{
AssetActionSubject
}
from
'../AssetManage/Component/AssetAction'
import
{
AssetActionSubject
}
from
'../AssetManage/Component/AssetAction'
import
TagCell
from
'../Model/Component/tag-help'
import
TagCell
from
'../Model/Component/tag-help'
import
DistributeTask
from
'./distribute-task'
import
DistributeTask
from
'./distribute-task'
import
CheckAssets
from
'./check-assets'
import
'../AssetManage/Component/AssetTable.less'
import
'../AssetManage/Component/AssetTable.less'
...
@@ -113,6 +114,10 @@ const FC = (props) => {
...
@@ -113,6 +114,10 @@ const FC = (props) => {
visible
:
false
,
visible
:
false
,
items
:
undefined
items
:
undefined
})
})
const
[
checkAssetsParams
,
setCheckAssetsParams
]
=
React
.
useState
({
visible
:
false
,
items
:
undefined
})
const
[
page
,
setPage
]
=
usePage
()
const
[
page
,
setPage
]
=
usePage
()
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
...
@@ -626,7 +631,10 @@ const FC = (props) => {
...
@@ -626,7 +631,10 @@ const FC = (props) => {
}
}
const
onCheckClick
=
()
=>
{
const
onCheckClick
=
()
=>
{
setCheckAssetsParams
({
visible
:
true
,
items
:
selectedRows
})
}
}
const
onImportClick
=
()
=>
{
const
onImportClick
=
()
=>
{
...
@@ -743,6 +751,13 @@ const FC = (props) => {
...
@@ -743,6 +751,13 @@ const FC = (props) => {
})
})
}
}
const onRightCheckClick = () => {
setCheckAssetsParams({
visible: true,
items: [rightRow]
})
}
const onRightChangeToUncombedClick = () => {
const onRightChangeToUncombedClick = () => {
modal.confirm({
modal.confirm({
title: '提示',
title: '提示',
...
@@ -871,7 +886,7 @@ const FC = (props) => {
...
@@ -871,7 +886,7 @@ const FC = (props) => {
} else if (key === '转分配') {
} else if (key === '转分配') {
} else if (key === '复核') {
} else if (key === '复核') {
onRightCheckClick()
} else if (key === '转为非资产') {
} else if (key === '转为非资产') {
onRightChangeToNotAssetClick()
onRightChangeToNotAssetClick()
} else if (key === '转为未梳理') {
} else if (key === '转为未梳理') {
...
@@ -1343,6 +1358,17 @@ const FC = (props) => {
...
@@ -1343,6 +1358,17 @@ const FC = (props) => {
refresh && getAssets()
refresh && getAssets()
}}
}}
/>
/>
<CheckAssets
{...checkAssetsParams}
onCancel={(refresh) => {
setCheckAssetsParams({
visible: false,
items: undefined
})
refresh && getAssets()
}}
/>
{contextHolder}
{contextHolder}
</div>
</div>
)
)
...
...
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