refactor: 请假申请 按钮区域重构

This commit is contained in:
dap 2025-07-18 11:55:25 +08:00
parent 808406ebce
commit 5d88de78c7
2 changed files with 58 additions and 38 deletions

View File

@ -11,6 +11,7 @@
- Modal/Drawer中使用VxeTable tooltip需要设置更高的z-index 防止被遮挡
- 字典(DictTag)使用tsx写法重构
- 请假申请 按钮区域重构
**OTHERS**

View File

@ -60,11 +60,27 @@ const gridOptions: VxeGridProps = {
},
//
id: 'workflow-leave-index',
cellClassName: ({ row }) => {
// 稿
if (row.status === 'draft') {
return 'cursor-pointer';
}
},
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
gridEvents: {
cellClick: ({ row }) => {
// 稿
if (row.status !== 'draft') {
return;
}
//
handleInfo(row);
},
},
});
const router = useRouter();
@ -152,47 +168,50 @@ function handleInfo(row: Required<LeaveForm>) {
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-if="['draft', 'cancel', 'back'].includes(row.status)"
<a-button
size="small"
type="link"
:disabled="!['draft', 'cancel', 'back'].includes(row.status)"
v-access:code="['workflow:leave:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</a-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认撤销?"
@confirm.stop="handleRevoke(row)"
@cancel.stop=""
>
<a-button
size="small"
type="link"
:disbaled="!['waiting'].includes(row.status)"
v-access:code="['workflow:leave:edit']"
@click.stop="handleEdit(row)"
@click.stop=""
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认撤销?"
@confirm="handleRevoke(row)"
撤销
</a-button>
</Popconfirm>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm.stop="handleDelete(row)"
@cancel.stop=""
>
<a-button
size="small"
type="link"
:disabled="!['draft', 'cancel', 'back'].includes(row.status)"
danger
v-access:code="['workflow:leave:remove']"
@click.stop=""
>
<ghost-button
v-if="['waiting'].includes(row.status)"
v-access:code="['workflow:leave:edit']"
@click.stop=""
>
撤销
</ghost-button>
</Popconfirm>
<ghost-button v-if="row.status !== 'draft'" @click="handleInfo(row)">
详情
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
v-if="['draft', 'cancel', 'back'].includes(row.status)"
danger
v-access:code="['workflow:leave:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
{{ $t('pages.common.delete') }}
</a-button>
</Popconfirm>
</template>
</BasicTable>
<FlowInfoModal />