feat(web): 增加数据资源确权状态显示
This commit is contained in:
@@ -175,6 +175,7 @@ export const userStateMapping = [
|
||||
]
|
||||
|
||||
export const confirmationStateMapping = [
|
||||
mappingItem('未确权', 'NONE'),
|
||||
mappingItem('草稿', 'DRAFT', 'bg-primary'),
|
||||
mappingItem('审查中', 'CHECKING', 'bg-warning'),
|
||||
mappingItem('通过', 'NORMAL', 'bg-success'),
|
||||
@@ -199,6 +200,21 @@ export function apiPost(url) {
|
||||
return api('post', url)
|
||||
}
|
||||
|
||||
export function arrayInCheck(array, field) {
|
||||
return `\${ARRAYINCLUDES(['${array.join("','")}'], ${field})}`
|
||||
}
|
||||
|
||||
export function arrayOutCheck(array, field) {
|
||||
return `\${!ARRAYINCLUDES(['${array.join("','")}'], ${field})}`
|
||||
}
|
||||
|
||||
export const confirmationState = {
|
||||
none: 'NONE',
|
||||
draft: 'DRAFT',
|
||||
checking: 'CHECKING',
|
||||
normal: 'NORMAL',
|
||||
}
|
||||
|
||||
export function roleCheck(roles) {
|
||||
return `\${ARRAYINCLUDES(['${roles.join("','")}'], role)}`
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@ useAmis(information => {
|
||||
tabs: [
|
||||
// tabOverview(),
|
||||
// tabMarket(),
|
||||
tabCheck(),
|
||||
tabData(),
|
||||
tabCheck(),
|
||||
tabPermissions(),
|
||||
tabUser(),
|
||||
tabSettings(),
|
||||
|
||||
@@ -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: '确认删除',
|
||||
|
||||
Reference in New Issue
Block a user