!62 refactor(xispeak): 操作栏拆分为流程操作和表单操作两个下拉菜单

Merge pull request !62 from wsm/feature/20260626_02
This commit is contained in:
wsm
2026-06-26 08:09:15 +00:00
committed by Gitee
+97 -71
View File
@@ -69,7 +69,12 @@
<!--操作栏--> <!--操作栏-->
<template #action="{ record }"> <template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" /> <Dropdown :trigger="['hover']" :dropMenuList="getFlowMenuList(record)" popconfirm>
<a-button type="link" size="small">流程操作 <Icon icon="mdi-light:chevron-down" /></a-button>
</Dropdown>
<Dropdown :trigger="['hover']" :dropMenuList="getFormMenuList(record)" popconfirm>
<a-button type="link" size="small">表单操作 <Icon icon="mdi-light:chevron-down" /></a-button>
</Dropdown>
</template> </template>
<!--字段回显插槽--> <!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }"> </template> <template v-slot:bodyCell="{ column, record, index, text }"> </template>
@@ -89,7 +94,8 @@
<script lang="ts" name="bg.xispeak-bgXiSpeak" setup> <script lang="ts" name="bg.xispeak-bgXiSpeak" setup>
import { ref, reactive, unref, computed, provide } from 'vue'; import { ref, reactive, unref, computed, provide } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { BasicTable, useTable } from '/@/components/Table';
import { Dropdown } from '/@/components/Dropdown';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
@@ -471,83 +477,103 @@ import { defHttp } from '/@/utils/http/axios';
} }
/** /**
* 操作栏 * 流程操作菜单
*/ */
function getTableAction(record) { function getFlowMenuList(record) {
return [ const list: any[] = [];
{ if (record.bpmStatus == '1' || !record.bpmStatus) {
label: '编辑', list.push({
onClick: handleEdit.bind(null, record), text: '发起落实措施收集流程',
auth: 'bg.xispeak:bg_xi_speak:edit', icon: 'ant-design:play-circle-outlined',
}, event: 'process',
{ onClick: handleProcess.bind(null, record),
label: '删除', });
popConfirm: { list.push({
title: '确定删除吗? 将同时删除该记录关联的所有流程信息', text: '发起经办人执行反馈流程',
confirm: handleDeleteWithProcess.bind(null, record), icon: 'ant-design:play-circle-outlined',
placement: 'topLeft', event: 'processJbr',
}, onClick: handleProcessJbr.bind(null, record),
auth: 'bg.xispeak:bg_xi_speak:delete', });
}, }
{ if (record.bpmStatus == '3') {
label: '查看反馈', list.push({
onClick: handleViewFeedback.bind(null, record), text: '发起经办人执行反馈流程',
}, icon: 'ant-design:play-circle-outlined',
]; event: 'processJbr',
} onClick: handleProcessJbr.bind(null, record),
});
/** }
* 下拉操作栏 if (record.bpmStatus == '2') {
*/ list.push({
function getDropDownAction(record) { text: '再次发起经办人执行反馈流程',
let dropDownAction = [ icon: 'ant-design:play-circle-outlined',
{ event: 'processJbrAgain',
label: '详情', onClick: handleProcessJbr.bind(null, record),
onClick: handleDetail.bind(null, record), });
}, }
{ list.push({
label: '添加下级', text: '查询督办流程',
onClick: handleAddSub.bind(null, { pid: record.id }), icon: 'ant-design:search-outlined',
}, event: 'queryProcess',
{ divider: true,
label: '查询督办流程', onClick: handleQueryProcess.bind(null, record),
onClick: handleQueryProcess.bind(null, record), });
}, if (record.bpmStatus && record.bpmStatus !== '1') {
{ list.push({
label: '删除关联流程', text: '删除关联流程',
icon: 'ant-design:delete-outlined',
event: 'withdraw',
popConfirm: { popConfirm: {
title: '确定删除该记录关联的所有运行中流程吗?', title: '确定删除该记录关联的所有运行中流程吗?',
confirm: handleWithDraw.bind(null, record), confirm: handleWithDraw.bind(null, record),
placement: 'topLeft', placement: 'topLeft',
}, },
ifShow: !!record.bpmStatus && record.bpmStatus !== '1', });
}
return list;
}
/**
* 表单操作菜单
*/
function getFormMenuList(record) {
return [
{
text: '查看反馈',
icon: 'ant-design:eye-outlined',
event: 'feedback',
divider: true,
onClick: handleViewFeedback.bind(null, record),
},
{
text: '编辑',
icon: 'ant-design:edit-outlined',
event: 'edit',
onClick: handleEdit.bind(null, record),
},
{
text: '详情',
icon: 'ant-design:file-text-outlined',
event: 'detail',
onClick: handleDetail.bind(null, record),
},
{
text: '添加下级',
icon: 'ant-design:plus-outlined',
event: 'addSub',
onClick: handleAddSub.bind(null, { pid: record.id }),
},
{
text: '删除',
icon: 'ant-design:delete-outlined',
event: 'delete',
popConfirm: {
title: '确定删除吗? 将同时删除该记录关联的所有流程信息',
confirm: handleDeleteWithProcess.bind(null, record),
placement: 'topLeft',
},
}, },
]; ];
if (record.bpmStatus == '1' || !record.bpmStatus) {
dropDownAction.push({
label: '发起落实措施收集流程',
onClick: handleProcess.bind(null, record),
});
dropDownAction.push({
label: '发起经办人执行反馈流程',
onClick: handleProcessJbr.bind(null, record),
});
}
if (record.bpmStatus == '3') {
dropDownAction.push({
label: '发起经办人执行反馈流程',
onClick: handleProcessJbr.bind(null, record),
});
}
if (record.bpmStatus == '2') {
dropDownAction.push({
label: '再次发起经办人执行反馈流程',
onClick: handleProcessJbr.bind(null, record),
});
}
return dropDownAction;
} }
function splitDeptValue(value) { function splitDeptValue(value) {