1
0

feat(web): 增加数据资源确权状态显示

This commit is contained in:
2024-11-29 10:28:28 +08:00
parent 5aef7728b2
commit 51bca63ec6
5 changed files with 49 additions and 5 deletions

View File

@@ -3,7 +3,16 @@ import {
resourceDetailDialog,
resourceEditeDialog
} from "../../components/resource/dialog-resource.js";
import {apiGet, crudCommonOptions, userOnly} from "../../components/constants.js";
import {
apiGet,
arrayInCheck,
arrayOutCheck,
confirmationState,
confirmationStateMapping,
crudCommonOptions,
mappingField,
userOnly
} from "../../components/constants.js";
export function resourceList() {
return {
@@ -23,12 +32,18 @@ export function resourceList() {
{
label: '名称',
name: 'name',
width: 200,
width: 150,
},
{
label: '描述',
name: 'description',
},
{
label: '确权状态',
width: 80,
align: 'center',
...mappingField('confirmationState', confirmationStateMapping)
},
{
label: '创建时间',
width: 150,
@@ -57,14 +72,18 @@ export function resourceList() {
trigger: 'hover',
buttons: [
{
disabledOn: '${confirmationId}',
disabledOn: arrayOutCheck([confirmationState.none, confirmationState.draft], 'confirmationState'),
disabledTip: '审查或确权成功后无法编辑',
tooltipPlacement: 'top',
type: 'action',
label: '编辑',
level: 'link',
...resourceEditeDialog(),
},
{
disabledOn: '${confirmationId}',
disabledOn: arrayInCheck([confirmationState.checking], 'confirmationState'),
disabledTip: '审查中无法删除',
tooltipPlacement: 'bottom',
type: 'action',
label: "删除",
confirmTitle: '确认删除',