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
541d5517
Commit
541d5517
authored
Oct 19, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分配
parent
3110622b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
281 additions
and
7 deletions
+281
-7
assetmanage.js
src/model/assetmanage.js
+17
-0
dataassetmanager.js
src/service/dataassetmanager.js
+17
-0
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+1
-1
distribute-task.jsx
src/view/Manage/AssetResourceManage/distribute-task.jsx
+209
-0
table.jsx
src/view/Manage/AssetResourceManage/table.jsx
+37
-6
No files found.
src/model/assetmanage.js
View file @
541d5517
...
@@ -298,10 +298,26 @@ export function* syncResourceDraft(payload) {
...
@@ -298,10 +298,26 @@ export function* syncResourceDraft(payload) {
return
yield
call
(
service
.
syncResourceDraft
,
payload
)
return
yield
call
(
service
.
syncResourceDraft
,
payload
)
}
}
export
function
*
deleteResources
(
payload
)
{
return
yield
call
(
service
.
deleteResources
,
payload
)
}
export
function
*
getTasks
(
payload
)
{
export
function
*
getTasks
(
payload
)
{
return
yield
call
(
service
.
getTasks
,
payload
)
return
yield
call
(
service
.
getTasks
,
payload
)
}
}
export
function
*
distributeTask
(
payload
)
{
return
yield
call
(
service
.
distributeTask
,
payload
)
}
export
function
*
getNoticeTypes
(
payload
)
{
return
yield
call
(
service
.
getNoticeTypes
,
payload
)
}
export
function
*
listDistributeAbleUsersByName
(
payload
)
{
return
yield
call
(
service
.
listDistributeAbleUsersByName
,
payload
)
}
export
function
*
getMetadataColumns
(
payload
)
{
export
function
*
getMetadataColumns
(
payload
)
{
return
yield
call
(
metadataService
.
getMetadataColumns
,
payload
)
return
yield
call
(
metadataService
.
getMetadataColumns
,
payload
)
}
}
\ No newline at end of file
src/service/dataassetmanager.js
View file @
541d5517
...
@@ -288,6 +288,22 @@ export function getPreviewRangeByDirId(payload) {
...
@@ -288,6 +288,22 @@ export function getPreviewRangeByDirId(payload) {
return
PostJSON
(
"/dataassetmanager/resourceApi/syncDraft"
,
payload
)
return
PostJSON
(
"/dataassetmanager/resourceApi/syncDraft"
,
payload
)
}
}
export
function
deleteResources
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/resourceApi/deleteResources"
,
payload
)
}
export
function
getTasks
(
payload
)
{
export
function
getTasks
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/resource/taskApi/listTasksByPage"
,
payload
)
return
GetJSON
(
"/dataassetmanager/resource/taskApi/listTasksByPage"
,
payload
)
}
}
export
function
distributeTask
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/resource/taskApi/distributeTask"
,
payload
)
}
export
function
getNoticeTypes
()
{
return
GetJSON
(
"/dataassetmanager/resource/taskApi/listNoticeTypes"
)
}
export
function
listDistributeAbleUsersByName
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/userApi/listDistributeAbleUsersByName"
,
payload
)
}
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
541d5517
...
@@ -559,7 +559,7 @@ const AssetAction = (props) => {
...
@@ -559,7 +559,7 @@ const AssetAction = (props) => {
key={_index}
key={_index}
style={{ marginBottom: (_index===sameAttributeElements.length-1)? 0 : 15 }}
style={{ marginBottom: (_index===sameAttributeElements.length-1)? 0 : 15 }}
>
>
{ (element.
name==='资产项
') ? <MetadataInfo /> : <Input disabled={element.manualMaintain==='否'} /> }
{ (element.
metadataItem==='是
') ? <MetadataInfo /> : <Input disabled={element.manualMaintain==='否'} /> }
</Form.Item>
</Form.Item>
);
);
})
})
...
...
src/view/Manage/AssetResourceManage/distribute-task.jsx
0 → 100644
View file @
541d5517
import
React
from
"react"
import
{
Modal
,
Button
,
Form
,
Select
,
Spin
,
Checkbox
}
from
"antd"
import
{
debounceTime
,
Subject
}
from
'rxjs'
import
produce
from
"immer"
import
{
dispatch
}
from
'../../../model'
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.distributeTask'
,
payload
:
{
params
:
{
resourceIds
:
(
items
??[]).
map
(
item
=>
item
.
id
).
toString
(),
},
data
:
rows
},
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
[
noticeTypes
,
setNoticeTypes
]
=
React
.
useState
()
const
[
form
]
=
Form
.
useForm
()
React
.
useImperativeHandle
(
ref
,
()
=>
({
validate
:
async
()
=>
{
return
await
form
.
validateFields
()
},
}),
[
form
])
React
.
useEffect
(()
=>
{
getNoticeTypes
()
},
[])
const
getNoticeTypes
=
()
=>
{
dispatch
({
type
:
'assetmanage.getNoticeTypes'
,
callback
:
(
data
)
=>
{
const
newData
=
produce
(
data
,
(
draft
)
=>
{
draft
?.
forEach
(
item
=>
{
item
.
label
=
item
.
desc
item
.
value
=
item
.
type
})
})
setNoticeTypes
(
newData
)
},
error
:
()
=>
{
}
})
}
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
.
Item
label=
'通知方式'
name=
'noticeTypes'
rules=
{
[{
required
:
true
,
message
:
'请选择通知方式!'
}]
}
>
<
Checkbox
.
Group
options=
{
noticeTypes
}
/>
</
Form
.
Item
>
</
Form
>
)
})
const
HandlersItem
=
({
value
,
onChange
})
=>
{
const
$keyword
=
React
.
useMemo
(()
=>
new
Subject
(),
[])
const
[
keyword
,
setKeyword
]
=
React
.
useState
()
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
users
,
setUsers
]
=
React
.
useState
()
const
[
options
,
setOptions
]
=
React
.
useState
([])
React
.
useEffect
(()
=>
{
const
$$keyword
=
$keyword
.
pipe
(
debounceTime
(
1000
)).
subscribe
((
keyword
)
=>
{
setKeyword
(
keyword
)
})
return
()
=>
{
$$keyword
.
unsubscribe
()
}
},
[])
React
.
useEffect
(()
=>
{
if
(
keyword
)
{
getHandlers
()
}
},
[
keyword
])
const
getHandlers
=
()
=>
{
setLoading
(
true
)
dispatch
({
type
:
'assetmanage.listDistributeAbleUsersByName'
,
payload
:
{
keyword
,
pageNum
:
1
,
pageSize
:
1000
},
callback
:
(
data
)
=>
{
setLoading
(
false
)
setUsers
(
data
?.
data
)
const
newOptions
=
produce
(
data
?.
data
,
(
draft
)
=>
{
draft
?.
forEach
(
item
=>
{
item
.
label
=
item
.
name
item
.
value
=
item
.
id
})
})
setOptions
(
newOptions
)
},
error
:
()
=>
{
setLoading
(
false
)
}
})
}
const
onHandleChange
=
(
val
)
=>
{
onChange
?.((
users
??[]).
filter
(
item
=>
(
val
??[]).
includes
(
item
.
id
)))
}
return
(
<
Select
placeholder=
'请选择用户'
loading=
{
loading
}
value=
{
value
?
value
.
map
(
item
=>
item
.
id
):
undefined
}
onChange=
{
onHandleChange
}
onSearch=
{
(
val
)
=>
{
$keyword
.
next
(
val
)
}
}
allowClear
mode=
'multiple'
filterOption=
{
false
}
notFoundContent=
{
loading
?
<
Spin
size=
"small"
/>
:
null
}
options=
{
options
}
/>
)
}
\ No newline at end of file
src/view/Manage/AssetResourceManage/table.jsx
View file @
541d5517
...
@@ -26,6 +26,7 @@ import SelectBatchEditElements from './select-batch-edit-elements'
...
@@ -26,6 +26,7 @@ import SelectBatchEditElements from './select-batch-edit-elements'
import
{
AssetDirectorySubject
}
from
'../AssetManage/Component/AssetDirectory'
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
'../AssetManage/Component/AssetTable.less'
import
'../AssetManage/Component/AssetTable.less'
...
@@ -107,6 +108,10 @@ const FC = (props) => {
...
@@ -107,6 +108,10 @@ const FC = (props) => {
visible
:
false
,
visible
:
false
,
type
:
undefined
type
:
undefined
})
})
const
[
distributeTaskParams
,
setDistributeTaskParams
]
=
React
.
useState
({
visible
:
false
,
items
:
undefined
})
const
[
page
,
setPage
]
=
usePage
()
const
[
page
,
setPage
]
=
usePage
()
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
()
...
@@ -586,8 +591,11 @@ const FC = (props) => {
...
@@ -586,8 +591,11 @@ const FC = (props) => {
})
})
}
}
const
onTaskAllocationClick
=
()
=>
{
const
onDistributeTaskClick
=
()
=>
{
setDistributeTaskParams
({
visible
:
true
,
items
:
selectedRows
})
}
}
const
onTaskAutoAllocationClick
=
()
=>
{
const
onTaskAutoAllocationClick
=
()
=>
{
...
@@ -692,6 +700,13 @@ const FC = (props) => {
...
@@ -692,6 +700,13 @@ const FC = (props) => {
})
})
}
}
const onRightDistributeTaskClick = () => {
setDistributeTaskParams({
visible: true,
items: [rightRow]
})
}
const onRightChangeToUncombedClick = () => {
const onRightChangeToUncombedClick = () => {
modal.confirm({
modal.confirm({
title: '提示',
title: '提示',
...
@@ -792,7 +807,7 @@ const FC = (props) => {
...
@@ -792,7 +807,7 @@ const FC = (props) => {
if (key === 'addToAsset') {
if (key === 'addToAsset') {
onAddToAssetClick()
onAddToAssetClick()
} else if (key === 'taskAllocation') {
} else if (key === 'taskAllocation') {
on
TaskAllocation
Click()
on
DistributeTask
Click()
} else if (key === 'taskAutoAllocation') {
} else if (key === 'taskAutoAllocation') {
onTaskAutoAllocationClick()
onTaskAutoAllocationClick()
} else if (key === 'batchEdit') {
} else if (key === 'batchEdit') {
...
@@ -816,7 +831,7 @@ const FC = (props) => {
...
@@ -816,7 +831,7 @@ const FC = (props) => {
if (key === '新增为资产') {
if (key === '新增为资产') {
onRightAddToAssetClick()
onRightAddToAssetClick()
} else if (key === '分配') {
} else if (key === '分配') {
onRightDistributeTaskClick()
} else if (key === '转分配') {
} else if (key === '转分配') {
} else if (key === '复核') {
} else if (key === '复核') {
...
@@ -841,7 +856,12 @@ const FC = (props) => {
...
@@ -841,7 +856,12 @@ const FC = (props) => {
新增为资产
新增为资产
</div>
</div>
</PermissionMenuItem>
</PermissionMenuItem>
<PermissionMenuItem key='taskAllocation' defaultPermission={true}>
<PermissionMenuItem
key='taskAllocation'
defaultPermission={true}
disabled={(selectedRows??[]).length===0}
tip={(selectedRows??[]).length===0?'请先选择资源':''}
>
<div className='text-center'>
<div className='text-center'>
任务分配
任务分配
</div>
</div>
...
@@ -945,7 +965,7 @@ const FC = (props) => {
...
@@ -945,7 +965,7 @@ const FC = (props) => {
</PermissionButton>
</PermissionButton>
<PermissionButton
<PermissionButton
defaultPermission={true}
defaultPermission={true}
onClick={on
TaskAllocation
Click}
onClick={on
DistributeTask
Click}
>
>
任务分配
任务分配
</PermissionButton>
</PermissionButton>
...
@@ -1254,6 +1274,17 @@ const FC = (props) => {
...
@@ -1254,6 +1274,17 @@ const FC = (props) => {
}
}
}}
}}
/>
/>
<DistributeTask
{...distributeTaskParams}
onCancel={(refresh) => {
setDistributeTaskParams({
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