refactor(xispeak): 操作栏拆分为流程操作和表单操作两个下拉菜单
- 操作栏样式对齐 dq/inspectTask 模块,使用两个独立 Dropdown 组件 - 流程操作:发起流程、查询督办流程、删除关联流程 - 表单操作:查看反馈、编辑、详情、添加下级、删除 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -69,7 +69,12 @@
|
||||
|
||||
<!--操作栏-->
|
||||
<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 v-slot:bodyCell="{ column, record, index, text }"> </template>
|
||||
@@ -89,7 +94,8 @@
|
||||
|
||||
<script lang="ts" name="bg.xispeak-bgXiSpeak" setup>
|
||||
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 { useModal } from '/@/components/Modal';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
@@ -471,83 +477,103 @@ import { defHttp } from '/@/utils/http/axios';
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
* 流程操作菜单
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'bg.xispeak:bg_xi_speak:edit',
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '确定删除吗? 将同时删除该记录关联的所有流程信息',
|
||||
confirm: handleDeleteWithProcess.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'bg.xispeak:bg_xi_speak:delete',
|
||||
},
|
||||
{
|
||||
label: '查看反馈',
|
||||
onClick: handleViewFeedback.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
let dropDownAction = [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '添加下级',
|
||||
onClick: handleAddSub.bind(null, { pid: record.id }),
|
||||
},
|
||||
{
|
||||
label: '查询督办流程',
|
||||
onClick: handleQueryProcess.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除关联流程',
|
||||
function getFlowMenuList(record) {
|
||||
const list: any[] = [];
|
||||
if (record.bpmStatus == '1' || !record.bpmStatus) {
|
||||
list.push({
|
||||
text: '发起落实措施收集流程',
|
||||
icon: 'ant-design:play-circle-outlined',
|
||||
event: 'process',
|
||||
onClick: handleProcess.bind(null, record),
|
||||
});
|
||||
list.push({
|
||||
text: '发起经办人执行反馈流程',
|
||||
icon: 'ant-design:play-circle-outlined',
|
||||
event: 'processJbr',
|
||||
onClick: handleProcessJbr.bind(null, record),
|
||||
});
|
||||
}
|
||||
if (record.bpmStatus == '3') {
|
||||
list.push({
|
||||
text: '发起经办人执行反馈流程',
|
||||
icon: 'ant-design:play-circle-outlined',
|
||||
event: 'processJbr',
|
||||
onClick: handleProcessJbr.bind(null, record),
|
||||
});
|
||||
}
|
||||
if (record.bpmStatus == '2') {
|
||||
list.push({
|
||||
text: '再次发起经办人执行反馈流程',
|
||||
icon: 'ant-design:play-circle-outlined',
|
||||
event: 'processJbrAgain',
|
||||
onClick: handleProcessJbr.bind(null, record),
|
||||
});
|
||||
}
|
||||
list.push({
|
||||
text: '查询督办流程',
|
||||
icon: 'ant-design:search-outlined',
|
||||
event: 'queryProcess',
|
||||
divider: true,
|
||||
onClick: handleQueryProcess.bind(null, record),
|
||||
});
|
||||
if (record.bpmStatus && record.bpmStatus !== '1') {
|
||||
list.push({
|
||||
text: '删除关联流程',
|
||||
icon: 'ant-design:delete-outlined',
|
||||
event: 'withdraw',
|
||||
popConfirm: {
|
||||
title: '确定删除该记录关联的所有运行中流程吗?',
|
||||
confirm: handleWithDraw.bind(null, record),
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user