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
29637665
Commit
29637665
authored
Oct 23, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资源转分配
parent
52d461d5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
139 additions
and
2 deletions
+139
-2
assetmanage.js
src/model/assetmanage.js
+4
-0
dataassetmanager.js
src/service/dataassetmanager.js
+4
-0
distribute-task.jsx
src/view/Manage/AssetResourceManage/distribute-task.jsx
+1
-1
redistribute-task.jsx
src/view/Manage/AssetResourceManage/redistribute-task.jsx
+106
-0
table.jsx
src/view/Manage/AssetResourceManage/table.jsx
+24
-1
No files found.
src/model/assetmanage.js
View file @
29637665
...
...
@@ -314,6 +314,10 @@ export function* distributeTask(payload) {
return
yield
call
(
service
.
distributeTask
,
payload
)
}
export
function
*
reDistributeTask
(
payload
)
{
return
yield
call
(
service
.
reDistributeTask
,
payload
)
}
export
function
*
getNoticeTypes
(
payload
)
{
return
yield
call
(
service
.
getNoticeTypes
,
payload
)
}
...
...
src/service/dataassetmanager.js
View file @
29637665
...
...
@@ -303,6 +303,10 @@ export function getPreviewRangeByDirId(payload) {
export
function
distributeTask
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/resource/taskApi/distributeTask"
,
payload
)
}
export
function
reDistributeTask
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/resource/taskApi/reDistributeTask"
,
payload
)
}
export
function
getNoticeTypes
()
{
return
GetJSON
(
"/dataassetmanager/resource/taskApi/listNoticeTypes"
)
...
...
src/view/Manage/AssetResourceManage/distribute-task.jsx
View file @
29637665
...
...
@@ -136,7 +136,7 @@ export const Basic = React.forwardRef(function ({ items }, ref) {
)
})
const
HandlersItem
=
({
value
,
onChange
})
=>
{
export
const
HandlersItem
=
({
value
,
onChange
})
=>
{
const
$keyword
=
React
.
useMemo
(()
=>
new
Subject
(),
[])
const
[
keyword
,
setKeyword
]
=
React
.
useState
()
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
...
...
src/view/Manage/AssetResourceManage/redistribute-task.jsx
0 → 100644
View file @
29637665
import
React
from
"react"
import
{
Modal
,
Button
,
Form
,
Select
,
Spin
}
from
"antd"
import
{
dispatch
}
from
'../../../model'
import
{
HandlersItem
}
from
"./distribute-task"
const
FC
=
(
props
)
=>
{
const
{
visible
,
items
,
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.reDistributeTask'
,
payload
:
{
params
:
{
resourceIds
:
(
items
??[]).
map
(
item
=>
item
.
id
).
toString
(),
},
data
:
rows
.
users
??[]
},
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=
'800px'
bodyStyle=
{
{
padding
:
'15px'
,
overflowX
:
'auto'
,
maxHeight
:
'80vh'
}
}
title=
'任务转分配'
centered
destroyOnClose
onCancel=
{
()
=>
{
close
()
}
}
>
<
Spin
spinning=
{
waiting
}
>
<
Basic
ref=
{
basicRef
}
/>
</
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
onValuesChange
=
(
changedValues
,
allValues
)
=>
{
console
.
log
(
'all values'
,
allValues
)
}
return
(
<
Form
form=
{
form
}
labelCol=
{
{
span
:
3
}
}
wrapperCol=
{
{
span
:
21
}
}
autoComplete=
"off"
onValuesChange=
{
onValuesChange
}
>
<
Form
.
Item
label=
'分配用户'
name=
'users'
rules=
{
[{
required
:
true
,
message
:
'请选择用户!'
}]
}
>
<
HandlersItem
/>
</
Form
.
Item
>
</
Form
>
)
})
\ No newline at end of file
src/view/Manage/AssetResourceManage/table.jsx
View file @
29637665
...
...
@@ -27,6 +27,7 @@ import { AssetDirectorySubject } from '../AssetManage/Component/AssetDirectory'
import
{
AssetActionSubject
}
from
'../AssetManage/Component/AssetAction'
import
TagCell
from
'../Model/Component/tag-help'
import
DistributeTask
from
'./distribute-task'
import
RedistributeTask
from
'./redistribute-task'
import
CheckAssets
from
'./check-assets'
import
'../AssetManage/Component/AssetTable.less'
...
...
@@ -116,6 +117,10 @@ const FC = (props) => {
visible
:
false
,
items
:
undefined
})
const
[
redistributeTaskParams
,
setRedistributeTaskParams
]
=
React
.
useState
({
visible
:
false
,
items
:
undefined
})
const
[
checkAssetsParams
,
setCheckAssetsParams
]
=
React
.
useState
({
visible
:
false
,
items
:
undefined
...
...
@@ -763,6 +768,13 @@ const FC = (props) => {
})
}
const onRightRedistributeTaskClick = () => {
setRedistributeTaskParams({
visible: true,
items: [rightRow]
})
}
const onRightCheckClick = () => {
setCheckAssetsParams({
visible: true,
...
...
@@ -896,7 +908,7 @@ const FC = (props) => {
} else if (key === '分配') {
onRightDistributeTaskClick()
} else if (key === '转分配') {
onRightRedistributeTaskClick()
} else if (key === '复核') {
onRightCheckClick()
} else if (key === '转为非资产') {
...
...
@@ -1370,6 +1382,17 @@ const FC = (props) => {
refresh && getAssets()
}}
/>
<RedistributeTask
{...redistributeTaskParams}
onCancel={(refresh) => {
setRedistributeTaskParams({
visible: false,
items: undefined
})
refresh && getAssets()
}}
/>
<CheckAssets
{...checkAssetsParams}
onCancel={(refresh) => {
...
...
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