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
87ee4442
Commit
87ee4442
authored
Aug 29, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
草稿状态
parent
03638d17
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
10 deletions
+44
-10
assetmanage.js
src/model/assetmanage.js
+4
-0
dataassetmanager.js
src/service/dataassetmanager.js
+4
-0
draft.jsx
src/view/Manage/AssetDraft/draft.jsx
+36
-10
No files found.
src/model/assetmanage.js
View file @
87ee4442
...
...
@@ -190,6 +190,10 @@ export function* loadDataAssets(payload) {
return
yield
call
(
service
.
loadDataAssets
,
payload
);
}
export
function
*
listDraftStates
()
{
return
yield
call
(
service
.
listDraftStates
)
}
export
function
*
loadDataAssetsAsDraft
(
payload
)
{
return
yield
call
(
service
.
loadDataAssetsAsDraft
,
payload
);
}
...
...
src/service/dataassetmanager.js
View file @
87ee4442
...
...
@@ -92,6 +92,10 @@ export function loadDataAssets(payload) {
return
PostJSON
(
"/dataassetmanager/dataAssetApi/loadDataAssets"
,
payload
);
}
export
function
listDraftStates
()
{
return
GetJSON
(
"/dataassetmanager/draftApi/listDraftStates"
)
}
export
function
loadDataAssetsAsDraft
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/draftApi/loadDataAssetsAsDraft"
,
payload
)
}
...
...
src/view/Manage/AssetDraft/draft.jsx
View file @
87ee4442
...
...
@@ -30,18 +30,20 @@ const operationMap = {
changeToPendingSubmit
:
'转为待提交'
,
}
const
draftStates
=
[
{
id
:
'PENDINGSUBMIT'
,
name
:
'待提交'
},
{
id
:
'tobeReleased'
,
name
:
'待发布'
},
{
id
:
'PROCESSING'
,
name
:
'处理中'
},
{
id
:
'DONE'
,
name
:
'已完成'
},
{
id
:
'PUBLISHED'
,
name
:
'已发布'
},
]
//
const draftStates = [
//
{ id: 'PENDINGSUBMIT', name: '待提交' },
//
{ id: 'tobeReleased', name: '待发布' },
//
{ id: 'PROCESSING', name: '处理中' },
//
{ id: 'DONE', name: '已完成' },
//
{ id: 'PUBLISHED', name: '已发布' },
//
]
const
FC
=
(
props
)
=>
{
const
[
loadingTemplates
,
setLoadingTemplates
]
=
React
.
useState
(
false
)
const
[
templates
,
setTemplates
]
=
React
.
useState
()
const
[
currentTemplateValue
,
setTemplateValue
]
=
React
.
useState
()
const
[
loadingDraftStates
,
setLoadingDraftStates
]
=
React
.
useState
(
false
)
const
[
draftStates
,
setDraftStates
]
=
React
.
useState
()
const
[
pagination
,
setPagination
]
=
React
.
useState
({
pageNum
:
1
,
pageSize
:
20
})
const
[
currentElementValue
,
setElementValue
]
=
React
.
useState
()
const
[
keyword
,
setKeyword
]
=
React
.
useState
()
...
...
@@ -86,6 +88,7 @@ const FC = (props) => {
getAdmin
()
getUsers
()
getTemplates
()
getStates
()
},
[])
React
.
useEffect
(()
=>
{
...
...
@@ -337,8 +340,30 @@ const FC = (props) => {
})
}
const
getStates
=
()
=>
{
setLoadingDraftStates
(
true
)
dispatch
({
type
:
'assetmanage.listDraftStates'
,
callback
:
data
=>
{
setLoadingDraftStates
(
false
)
setDraftStates
(
data
)
},
error
:
()
=>
{
setLoadingDraftStates
(
false
)
}
})
}
const
getDrafts
=
()
=>
{
setLoading
(
true
)
let
code
=
null
if
(
draftState
!==
undefined
&&
draftState
!==
null
&&
draftState
!==
''
)
{
const
index
=
(
draftStates
??[]).
findIndex
(
item
=>
item
.
id
===
draftState
)
if
(
index
!==
-
1
)
{
code
=
draftStates
[
index
].
state
}
}
dispatch
({
type
:
'assetmanage.getDrafts'
,
payload
:
{
...
...
@@ -346,7 +371,7 @@ const FC = (props) => {
queryElementId
:
currentElementValue
,
templateType
:
currentTemplateValue
,
keyword
:
encodeURIComponent
(
keyword
??
''
),
state
:
draftStat
e
,
state
:
cod
e
,
pageNum
:
pagination
.
pageNum
,
pageSize
:
pagination
.
pageSize
,
},
...
...
@@ -570,11 +595,12 @@ const FC = (props) => {
onChange={(val) => {
setDraftState(val)
}}
loading={loadingDraftStates}
style={{ width: 160 }}
>
{
draftStates.map((item, index) => (
<Select.Option key={item.id} value={item.id}>{item.
name
}</Select.Option>
draftStates
?
.map((item, index) => (
<Select.Option key={item.id} value={item.id}>{item.
desc
}</Select.Option>
))
}
</Select>
...
...
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