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 防止被遮挡 - Modal/Drawer中使用VxeTable tooltip需要设置更高的z-index 防止被遮挡
- 字典(DictTag)使用tsx写法重构 - 字典(DictTag)使用tsx写法重构
- 请假申请 按钮区域重构
**OTHERS** **OTHERS**

View File

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