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

@@ -10,6 +10,7 @@ import {
timeField,
} from "../../components/constants.js";
import {authenticationDetailDialog, confirmationDetailDialog} from "../../components/permission/dialog-permission.js";
import {wareDetailDialog} from "../../components/ware/dialog-ware.js";
export function tabCheck() {
return {
@@ -103,6 +104,40 @@ export function tabCheck() {
level: 'link',
...authenticationDetailDialog('parameters.authenticationId'),
},
{
visibleOn: `\${type === 'MARKET' && state === 'CHECKING'}`,
type: 'action',
label: '处理',
level: 'link',
...wareDetailDialog(
'parameters.wareId',
[
{
type: 'action',
label: '同意',
actionType: 'ajax',
close: true,
api: apiGet('${base}/check_order/operation/${checkOrderId}/APPLY'),
reload: 'check_order_list',
},
{
type: 'action',
label: '拒绝',
actionType: 'ajax',
close: true,
api: apiGet('${base}/check_order/operation/${checkOrderId}/REJECT'),
reload: 'check_order_list',
},
],
),
},
{
visibleOn: `\${type === 'MARKET' && state !== NORMAL}`,
type: 'action',
label: '查看',
level: 'link',
...wareDetailDialog('parameters.wareId'),
},
]),
],
},

View File

@@ -1,16 +1,132 @@
import {wareAddDialog} from "../../components/ware/dialog-ware.js";
import {wareAddDialog, wareDetailDialog, wareEditeDialog} from "../../components/ware/dialog-ware.js";
import {
apiGet,
crudCommonOptions,
mappingField,
operationField,
permissionStateMapping,
timeField
} from "../../components/constants.js";
function listColumns() {
return {
columns: [
{
name: 'name',
label: '名称',
width: 200,
},
{
name: 'description',
label: '描述',
},
{
visibleOn: '${!public}',
...mappingField('state', '状态', permissionStateMapping)
},
timeField('createdTime', '创建时间'),
operationField('操作', undefined, [
{
type: 'action',
label: '查看',
level: 'link',
...wareDetailDialog(),
},
{
visibleOn: "${state === 'CHECKING'}",
type: 'action',
label: '撤销',
level: 'link',
confirmTitle: '确认撤销',
confirmText: '确认撤销名称为「${name}」的确权申请吗?',
actionType: 'ajax',
api: apiGet('${base}/ware/retract/${id}'),
},
{
visibleOn: "${state === 'DRAFT' || state === 'REJECT'}",
type: 'action',
label: '提交',
level: 'link',
confirmTitle: '确认提交',
confirmText: '确认提交名称为「${name}」的确权申请吗?',
actionType: 'ajax',
api: apiGet('${base}/ware/submit/${id}'),
},
{
visibleOn: "${!public}",
type: 'dropdown-button',
level: 'link',
icon: 'fa fa-ellipsis-h',
hideCaret: true,
trigger: 'hover',
buttons: [
{
disabledOn: "${state !== 'DRAFT'}",
type: 'action',
label: '编辑',
level: 'link',
...wareEditeDialog(),
},
{
disabledOn: "${state === 'CHECKING'}",
type: 'action',
label: "删除",
confirmTitle: '确认删除',
confirmText: '确认删除名称为「${name}」的确权申请吗?删除后对应的数据资源处于未确权状态。',
actionType: 'ajax',
api: apiGet('${base}/ware/remove/${id}'),
},
]
},
]),
]
}
}
export function tabMarket() {
return {
title: '数据市场',
icon: 'fa fa-store',
reload: true,
body: [
{
type: 'action',
label: '',
icon: 'fa fa-plus',
...wareAddDialog()
},
type: 'tabs',
tabs: [
{
title: '公开数据',
body: {
type: 'crud',
api: apiGet('${base}/ware/list_public'),
...crudCommonOptions(),
headerToolbar: [
'reload',
],
data: {
public: true
},
...listColumns(),
}
},
{
title: '我的数据',
body: {
type: 'crud',
api: apiGet('${base}/ware/list'),
...crudCommonOptions(),
headerToolbar: [
'reload',
{
type: 'action',
label: '',
icon: 'fa fa-plus',
...wareAddDialog()
},
],
...listColumns(),
}
},
]
}
]
}
}