feat(web): 实现授权申请功能
- 新增授权申请提交和撤销功能 - 实现授权申请的审核流程 - 优化授权申请的列表和详情展示- 添加时间格式配置
This commit is contained in:
@@ -253,7 +253,7 @@ export const permissionStateMapping = [
|
||||
mappingItem('未确权', 'NONE'),
|
||||
mappingItem('草稿', 'DRAFT', 'bg-primary'),
|
||||
mappingItem('审查中', 'CHECKING', 'bg-warning'),
|
||||
mappingItem('用户审查中', 'USER_CHECKING', 'bg-warning'),
|
||||
mappingItem('用户审查中', 'OWNER_CHECKING', 'bg-warning'),
|
||||
mappingItem('通过', 'NORMAL', 'bg-success'),
|
||||
mappingItem('驳回', 'REJECT', 'bg-danger'),
|
||||
]
|
||||
@@ -294,10 +294,11 @@ export function arrayOutCheck(array, field) {
|
||||
return `\${!ARRAYINCLUDES(['${array.join("','")}'], ${field})}`
|
||||
}
|
||||
|
||||
export const confirmationState = {
|
||||
export const checkState = {
|
||||
none: 'NONE',
|
||||
draft: 'DRAFT',
|
||||
checking: 'CHECKING',
|
||||
ownerChecking: 'OWNER_CHECKING',
|
||||
normal: 'NORMAL',
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
stringField,
|
||||
timeField,
|
||||
} from "../../components/constants.js";
|
||||
import {confirmationDetailDialog} from "../../components/permission/dialog-permission.js";
|
||||
import {authenticationDetailDialog, confirmationDetailDialog} from "../../components/permission/dialog-permission.js";
|
||||
|
||||
export function tabCheck() {
|
||||
return {
|
||||
@@ -36,7 +36,7 @@ export function tabCheck() {
|
||||
stringField('modifiedUsername', '最后操作人', 100),
|
||||
operationField('操作', undefined, [
|
||||
{
|
||||
visibleOn: '${!over}',
|
||||
visibleOn: `\${type == 'CONFIRMATION' && !over}`,
|
||||
type: 'action',
|
||||
label: '处理',
|
||||
level: 'link',
|
||||
@@ -63,12 +63,46 @@ export function tabCheck() {
|
||||
),
|
||||
},
|
||||
{
|
||||
visibleOn: '${over}',
|
||||
visibleOn: `\${type == 'CONFIRMATION' && over}`,
|
||||
type: 'action',
|
||||
label: '查看',
|
||||
level: 'link',
|
||||
...confirmationDetailDialog('parameters.confirmationId'),
|
||||
},
|
||||
{
|
||||
visibleOn: `\${type == 'AUTHENTICATION' && !over}`,
|
||||
type: 'action',
|
||||
label: '处理',
|
||||
level: 'link',
|
||||
...authenticationDetailDialog(
|
||||
'parameters.authenticationId',
|
||||
[
|
||||
{
|
||||
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 == 'AUTHENTICATION' && over}`,
|
||||
type: 'action',
|
||||
label: '查看',
|
||||
level: 'link',
|
||||
...authenticationDetailDialog('parameters.authenticationId'),
|
||||
},
|
||||
]),
|
||||
],
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
apiGet,
|
||||
arrayInCheck,
|
||||
arrayOutCheck,
|
||||
confirmationState,
|
||||
checkState,
|
||||
crudCommonOptions,
|
||||
mappingField,
|
||||
operationField,
|
||||
@@ -57,7 +57,7 @@ export function resourceList() {
|
||||
trigger: 'hover',
|
||||
buttons: [
|
||||
{
|
||||
disabledOn: arrayOutCheck([confirmationState.none, confirmationState.draft], 'confirmationState'),
|
||||
disabledOn: arrayOutCheck([checkState.none, checkState.draft], 'confirmationState'),
|
||||
disabledTip: '审查或确权成功后无法编辑',
|
||||
tooltipPlacement: 'top',
|
||||
type: 'action',
|
||||
@@ -66,7 +66,7 @@ export function resourceList() {
|
||||
...resourceEditeDialog(),
|
||||
},
|
||||
{
|
||||
disabledOn: arrayInCheck([confirmationState.checking], 'confirmationState'),
|
||||
disabledOn: arrayInCheck([checkState.checking], 'confirmationState'),
|
||||
disabledTip: '审查中无法删除',
|
||||
tooltipPlacement: 'bottom',
|
||||
type: 'action',
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import {
|
||||
apiGet,
|
||||
arrayInCheck,
|
||||
arrayOutCheck,
|
||||
checkState,
|
||||
crudCommonOptions,
|
||||
customerOnly,
|
||||
mappingField,
|
||||
@@ -60,22 +63,22 @@ export function tabPermissions() {
|
||||
...authenticationDetailDialog(),
|
||||
},
|
||||
{
|
||||
visibleOn: "${state === 'CHECKING'}",
|
||||
visibleOn: arrayInCheck([checkState.ownerChecking, checkState.checking], checkState),
|
||||
type: 'action',
|
||||
label: '撤销',
|
||||
level: 'link',
|
||||
confirmTitle: '确认撤销',
|
||||
confirmText: '确认撤销名称为「${name}」的确权申请吗?',
|
||||
confirmText: '确认撤销名称为「${name}」的授权申请吗?',
|
||||
actionType: 'ajax',
|
||||
api: apiGet('${base}/authentication/retract/${id}'),
|
||||
},
|
||||
{
|
||||
visibleOn: "${state === 'DRAFT' || state === 'REJECT'}",
|
||||
visibleOn: arrayInCheck([checkState.draft], 'state'),
|
||||
type: 'action',
|
||||
label: '提交',
|
||||
level: 'link',
|
||||
confirmTitle: '确认提交',
|
||||
confirmText: '确认提交名称为「${name}」的确权申请吗?',
|
||||
confirmText: '确认提交名称为「${name}」的授权申请吗?',
|
||||
actionType: 'ajax',
|
||||
api: apiGet('${base}/authentication/submit/${id}'),
|
||||
},
|
||||
@@ -87,14 +90,14 @@ export function tabPermissions() {
|
||||
trigger: 'hover',
|
||||
buttons: [
|
||||
{
|
||||
disabledOn: "${state !== 'DRAFT'}",
|
||||
disabledOn: arrayOutCheck([checkState.draft], 'state'),
|
||||
type: 'action',
|
||||
label: '编辑',
|
||||
level: 'link',
|
||||
...authenticationEditeDialog(),
|
||||
},
|
||||
{
|
||||
disabledOn: "${state === 'CHECKING'}",
|
||||
disabledOn: arrayInCheck([checkState.ownerChecking, checkState.checking], 'state'),
|
||||
type: 'action',
|
||||
label: "删除",
|
||||
confirmTitle: '确认删除',
|
||||
|
||||
Reference in New Issue
Block a user