1
0

feat(web): 实现数据产品上架审核功能

- 新增数据产品列表、详情、编辑等功能页面
- 实现数据产品提交审核、撤销审核、同意审核等操作
- 优化数据产品相关API接口,支持审核功能
- 重构部分代码以支持新功能
This commit is contained in:
2024-12-17 18:29:16 +08:00
parent 4934c6727e
commit 3138539bc5
12 changed files with 377 additions and 60 deletions

View File

@@ -5,6 +5,7 @@ import {resourceDetailDialog} from '../resource/dialog-resource.js'
function detailForm() {
return {
id: 'ware-form',
debug: information.debug,
type: 'form',
...horizontalFormOptions(),
@@ -17,13 +18,38 @@ function detailForm() {
name: 'id',
},
{
visibleOn: '${!detail}',
type: 'input-image',
name: 'icon',
label: '图标',
required: true,
receiver: apiPost("${base}/upload"),
autoFill: {
iconId: '${id}',
onEvent: {
success: {
actions: [
{
actionType: 'setValue',
componentId: 'ware-form',
args: {
value: {
iconId: '${event.data.result.id}'
}
}
}
]
}
}
},
{
visibleOn: '${detail}',
type: 'control',
name: 'icon',
label: '图标',
required: true,
body: {
type: 'image',
src: '${icon}',
innerClassName: 'no-border',
}
},
{
@@ -79,7 +105,7 @@ function detailForm() {
name: 'content',
label: '商品详情',
required: true,
receiver: '',
receiver: apiPost("${base}/upload"),
options: {
min_height: 300,
}
@@ -108,21 +134,28 @@ export function wareAddDialog() {
body: {
...detailForm(),
api: apiPost(`\${base}/ware/save`),
data: {
add: true,
}
}
}
}
}
export function wareDetailDialog() {
export function wareDetailDialog(field = 'id', actions = []) {
return {
actionType: 'dialog',
dialog: {
title: '确权申请详情',
title: '数据产品详情',
size: 'md',
actions: actions,
body: {
...detailForm(),
initApi: apiGet(`\${base}/ware/detail/\${id}`),
initApi: apiGet(`\${base}/ware/detail/\${${field}}`),
static: true,
data: {
detail: true,
}
}
}
}
@@ -132,7 +165,7 @@ export function wareEditeDialog() {
return {
actionType: 'dialog',
dialog: {
title: '确权申请详情',
title: '数据产品详情',
size: 'md',
actions: [
{
@@ -148,7 +181,10 @@ export function wareEditeDialog() {
body: {
...detailForm(),
api: apiPost(`\${base}/ware/save`),
initApi: apiGet(`\${base}/ware/detail/\${${field}}`),
initApi: apiGet(`\${base}/ware/detail/\${id}`),
data: {
edit: true
}
},
}
}