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
247d23cb
Commit
247d23cb
authored
Oct 24, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动分配任务
parent
b4476607
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
198 additions
and
17 deletions
+198
-17
assetmanage.js
src/model/assetmanage.js
+8
-0
dataassetmanager.js
src/service/dataassetmanager.js
+8
-0
auto-distribute-task.jsx
src/view/Manage/AssetResourceManage/auto-distribute-task.jsx
+151
-0
table.jsx
src/view/Manage/AssetResourceManage/table.jsx
+31
-17
No files found.
src/model/assetmanage.js
View file @
247d23cb
...
...
@@ -322,6 +322,14 @@ export function* reDistributeTask(payload) {
return
yield
call
(
service
.
reDistributeTask
,
payload
)
}
export
function
*
autoDistributeTask
(
payload
)
{
return
yield
call
(
service
.
autoDistributeTask
,
payload
)
}
export
function
*
listAutoDistributeUserDepartments
(
payload
)
{
return
yield
call
(
service
.
listAutoDistributeUserDepartments
,
payload
)
}
export
function
*
getNoticeTypes
(
payload
)
{
return
yield
call
(
service
.
getNoticeTypes
,
payload
)
}
...
...
src/service/dataassetmanager.js
View file @
247d23cb
...
...
@@ -312,6 +312,14 @@ export function getPreviewRangeByDirId(payload) {
return
PostJSON
(
"/dataassetmanager/resource/taskApi/reDistributeTask"
,
payload
)
}
export
function
autoDistributeTask
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/resource/taskApi/autoDistributeTask"
,
payload
)
}
export
function
listAutoDistributeUserDepartments
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/resource/taskApi/listAutoDistributeUserDepartments"
,
payload
)
}
export
function
getNoticeTypes
()
{
return
GetJSON
(
"/dataassetmanager/resource/taskApi/listNoticeTypes"
)
}
...
...
src/view/Manage/AssetResourceManage/auto-distribute-task.jsx
0 → 100644
View file @
247d23cb
import
React
from
"react"
import
{
Modal
,
Button
,
Spin
,
Form
}
from
"antd"
import
{
getAssetRange
,
showMessage
}
from
"../../../util"
import
{
ResourceManageReference
}
from
"../../../util/constant"
import
{
dispatch
}
from
'../../../model'
const
FC
=
(
props
)
=>
{
const
{
args
,
node
,
visible
,
onCancel
}
=
props
const
[
waiting
,
setWaiting
]
=
React
.
useState
(
false
)
const
basicRef
=
React
.
useRef
()
const
close
=
(
refresh
=
false
)
=>
{
setWaiting
(
false
)
onCancel
?.(
refresh
)
}
const
save
=
async
()
=>
{
const
departments
=
basicRef
.
current
?.
departments
if
((
departments
??[]).
length
===
0
)
{
showMessage
(
'warn'
,
'没有所属部门'
)
return
}
let
[
recursive
,
dirId
]
=
[
true
,
node
?.
nodeId
]
if
(
args
.
params
.
catalogType
===
'current'
)
{
recursive
=
false
}
if
(
args
.
params
.
catalogType
===
'fullSearch'
)
{
dirId
=
''
}
setWaiting
(
true
)
dispatch
({
type
:
'assetmanage.autoDistributeTask'
,
payload
:
{
data
:
args
.
params
.
elementValueFilters
??[],
params
:
{
dirId
,
keyword
:
args
.
params
.
keyword
,
range
:
getAssetRange
(
ResourceManageReference
),
resourceStatus
:
args
.
params
.
resourceStatus
,
sortingStatus
:
args
.
params
.
sortingStatus
,
recursive
,
filterTodo
:
args
.
params
.
onlyPending
,
departments
:
(
departments
??[]).
toString
()
}
},
callback
:
()
=>
{
setWaiting
(
false
)
onCancel
(
true
)
},
error
:
()
=>
{
setWaiting
(
false
)
}
})
}
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
}
node=
{
node
}
args=
{
args
}
/>
</
Spin
>
</
Modal
>
)
}
export
default
FC
export
const
Basic
=
React
.
forwardRef
(
function
({
node
,
args
},
ref
)
{
const
[
departments
,
setDepartments
]
=
React
.
useState
()
const
[
form
]
=
Form
.
useForm
()
React
.
useImperativeHandle
(
ref
,
()
=>
({
departments
}),
[
departments
])
React
.
useEffect
(()
=>
{
if
(
node
&&
args
)
{
getDepartments
()
}
},
[
node
,
args
])
const
getDepartments
=
()
=>
{
let
[
recursive
,
dirId
]
=
[
true
,
node
?.
nodeId
]
if
(
args
.
params
.
catalogType
===
'current'
)
{
recursive
=
false
}
if
(
args
.
params
.
catalogType
===
'fullSearch'
)
{
dirId
=
''
}
dispatch
({
type
:
'assetmanage.listAutoDistributeUserDepartments'
,
payload
:
{
data
:
args
.
params
.
elementValueFilters
??[],
params
:
{
dirId
,
keyword
:
args
.
params
.
keyword
,
range
:
getAssetRange
(
ResourceManageReference
),
resourceStatus
:
args
.
params
.
resourceStatus
,
sortingStatus
:
args
.
params
.
sortingStatus
,
recursive
,
filterTodo
:
args
.
params
.
onlyPending
,
}
},
callback
:
(
data
)
=>
{
setDepartments
(
data
)
},
error
:
()
=>
{
}
})
}
return
(
<
Form
form=
{
form
}
labelCol=
{
{
span
:
3
}
}
wrapperCol=
{
{
span
:
21
}
}
autoComplete=
"off"
>
<
Form
.
Item
label=
'所属部门'
extra=
"发起流程后,自动将筛选结果中未梳理状态的资源,分配到部门资产管理员进行梳理"
>
<
span
>
{
(
departments
??[]).
toString
()
}
</
span
>
</
Form
.
Item
>
</
Form
>
)
})
\ No newline at end of file
src/view/Manage/AssetResourceManage/table.jsx
View file @
247d23cb
...
...
@@ -28,6 +28,7 @@ import { AssetActionSubject } from '../AssetManage/Component/AssetAction'
import
TagCell
from
'../Model/Component/tag-help'
import
DistributeTask
from
'./distribute-task'
import
RedistributeTask
from
'./redistribute-task'
import
AutoDistributeTask
from
'./auto-distribute-task'
import
CheckAssets
from
'./check-assets'
import
'../AssetManage/Component/AssetTable.less'
...
...
@@ -122,6 +123,11 @@ const FC = (props) => {
visible
:
false
,
items
:
undefined
})
const
[
autoDistributeTaskParams
,
setAutoDistributeTaskParams
]
=
React
.
useState
({
visible
:
false
,
node
:
undefined
,
args
:
undefined
})
const
[
checkAssetsParams
,
setCheckAssetsParams
]
=
React
.
useState
({
visible
:
false
,
type
:
undefined
,
...
...
@@ -232,8 +238,8 @@ const FC = (props) => {
}
},
[
data
])
const
[
addAble
,
addAsAssetAble
,
distributeAble
,
autoDistributeAble
,
batchEditAble
,
checkAble
,
importAble
,
exportAble
,
changeDirectoryAble
,
deleteAble
]
=
React
.
useMemo
(()
=>
{
let
[
_addAble
,
_addAsAssetAble
,
_distributeAble
,
_
autoDistributeAble
,
_batchEditAble
,
_checkAble
,
_importAble
,
_exportAble
,
_changeDiretoryAble
,
_deleteAble
]
=
[
false
,
false
,
false
,
false
,
false
,
false
,
false
,
false
,
false
,
false
]
const
[
addAble
,
addAsAssetAble
,
distributeAble
,
batchEditAble
,
checkAble
,
importAble
,
exportAble
,
changeDirectoryAble
,
deleteAble
]
=
React
.
useMemo
(()
=>
{
let
[
_addAble
,
_addAsAssetAble
,
_distributeAble
,
_
batchEditAble
,
_checkAble
,
_importAble
,
_exportAble
,
_changeDiretoryAble
,
_deleteAble
]
=
[
false
,
false
,
false
,
false
,
false
,
false
,
false
,
false
,
false
]
_addAble
=
(
permissions
??[]).
findIndex
(
item
=>
item
===
'add'
)
!==
-
1
...
...
@@ -257,11 +263,10 @@ const FC = (props) => {
_exportAble
=
allowExport
}
let
[
allowAddAsAsset
,
allowDistribute
,
allow
AutoDistribute
,
allowBatchEdit
,
allowCheck
,
allowChangeDirectory
,
allowDelete
]
=
[
true
,
true
,
true
,
true
,
true
,
true
,
true
]
let
[
allowAddAsAsset
,
allowDistribute
,
allow
BatchEdit
,
allowCheck
,
allowChangeDirectory
,
allowDelete
]
=
[
true
,
true
,
true
,
true
,
true
,
true
]
for
(
const
row
of
selectedRows
)
{
const
addAsAssetIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'addAsAsset'
)
const
distributeIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'distribute'
)
const
autoDistributeIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'autoDistribute'
)
const
batchEditIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'batchEdit'
)
const
checkIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'check'
)
const
changeDirecotoryIndex
=
(
row
.
allowButtons
??[]).
findIndex
(
item
=>
item
===
'changeDir'
)
...
...
@@ -272,9 +277,6 @@ const FC = (props) => {
if
(
distributeIndex
===
-
1
)
{
allowDistribute
=
false
}
if
(
autoDistributeIndex
===
-
1
)
{
allowAutoDistribute
=
false
}
if
(
batchEditIndex
===
-
1
)
{
allowBatchEdit
=
false
}
...
...
@@ -291,13 +293,12 @@ const FC = (props) => {
_addAsAssetAble
=
allowAddAsAsset
_distributeAble
=
allowDistribute
_autoDistributeAble
=
allowAutoDistribute
_batchEditAble
=
allowBatchEdit
_checkAble
=
allowCheck
_changeDiretoryAble
=
allowChangeDirectory
_deleteAble
=
allowDelete
return
[
_addAble
,
_addAsAssetAble
,
_distributeAble
,
_
autoDistributeAble
,
_
batchEditAble
,
_checkAble
,
_importAble
,
_exportAble
,
_changeDiretoryAble
,
_deleteAble
]
return
[
_addAble
,
_addAsAssetAble
,
_distributeAble
,
_batchEditAble
,
_checkAble
,
_importAble
,
_exportAble
,
_changeDiretoryAble
,
_deleteAble
]
},
[
permissions
,
selectedRows
])
const
menuData
=
React
.
useMemo
(()
=>
{
...
...
@@ -640,7 +641,11 @@ const FC = (props) => {
}
const
onAutoDistributeTaskClick
=
()
=>
{
setAutoDistributeTaskParams
({
visible
:
true
,
node
,
args
})
}
const
onBatchEditClick
=
()
=>
{
...
...
@@ -953,9 +958,7 @@ const FC = (props) => {
</PermissionMenuItem>
<PermissionMenuItem
key='autoDistribute'
defaultPermission={autoDistributeAble}
disabled={(selectedRows??[]).length===0}
tip={(selectedRows??[]).length===0?'请先选择资源':''}
permissions={permissions}
>
<div className='text-center'>
自动分配
...
...
@@ -1067,10 +1070,9 @@ const FC = (props) => {
任务分配
</PermissionButton>
<PermissionButton
defaultPermission={autoDistributeAble}
onClick={onAutoDistributeTaskClick}
disabled={(selectedRows??[]).length===0}
tip={(selectedRows??[]).length===0?'请先选择资源':''}
key='autoDistribute'
permissions={permissions}
onClick={onAutoDistributeTaskClick}
>
自动分配
</PermissionButton>
...
...
@@ -1399,6 +1401,18 @@ const FC = (props) => {
refresh && getAssets()
}}
/>
<AutoDistributeTask
{...autoDistributeTaskParams}
onCancel={(refresh) => {
setAutoDistributeTaskParams({
visible: false,
node: undefined,
args: 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