From 5f75a6dc85a6589d4cf46e6f67a91581c213d80c Mon Sep 17 00:00:00 2001
From: ye1023 <12588209+ye1023@user.noreply.gitee.com>
Date: Tue, 26 May 2026 15:40:11 +0800
Subject: [PATCH] =?UTF-8?q?yxk-20260526-=E5=85=9A=E5=A7=94=E4=BC=9A?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=9D=A3=E5=8A=9E=E6=B5=81=E7=A8=8B=EF=BC=9A?=
=?UTF-8?q?=E5=86=99=E4=B8=80=E4=B8=AA=E9=80=9A=E7=94=A8=E7=9A=84=E5=88=A0?=
=?UTF-8?q?=E9=99=A4=E6=B5=81=E7=A8=8B=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/common/api.ts | 19 +++--
.../process/BusinessProcessListModal.vue | 84 ++++++++++++++-----
src/views/bg/xispeak/BgXiSpeak.api.ts | 34 ++++----
src/views/bg/xispeak/BgXiSpeakList.vue | 19 ++---
4 files changed, 97 insertions(+), 59 deletions(-)
diff --git a/src/api/common/api.ts b/src/api/common/api.ts
index 8dd36df..dca4646 100644
--- a/src/api/common/api.ts
+++ b/src/api/common/api.ts
@@ -17,6 +17,7 @@ enum Api {
startProcess = '/act/process/extActProcess/startMutilProcess',
startProcessSchedules = '/tasktask/taskTask/flow-schedules',
queryByBusinessId = '/tasktask/taskTask/queryByBusinessId',
+ deleteSingleProcess = '/tasktask/taskTask/deleteSingleProcess',
}
/**
@@ -115,8 +116,8 @@ export const downloadFile = (url, fileName?, parameter?) => {
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data]), fileName);
} else {
- let url = window.URL.createObjectURL(new Blob([data]));
- let link = document.createElement('a');
+ const url = window.URL.createObjectURL(new Blob([data]));
+ const link = document.createElement('a');
link.style.display = 'none';
link.href = url;
link.setAttribute('download', fileName);
@@ -154,8 +155,8 @@ export const startProcessSchedules = (params) => {
return defHttp.post({
url: Api.startProcessSchedules,
params,
- })
-}
+ });
+};
/**
* 发起流程
@@ -173,9 +174,15 @@ export const startProcess = (params) => {
* 根据业务ID查询流程列表
* @param params
*/
-export const queryByBusinessId = (params) =>
- defHttp.get({ url: Api.queryByBusinessId, params }, { isTransformResponse: false });
+export const queryByBusinessId = (params) => defHttp.get({ url: Api.queryByBusinessId, params }, { isTransformResponse: false });
+/**
+ * 删除单个流程实例
+ * @param params { processInstId: string }
+ */
+export const deleteSingleProcess = (params) => {
+ return defHttp.post({ url: Api.deleteSingleProcess, params }, { joinParamsToUrl: true, isTransformResponse: false });
+};
/**
* 【用于评论功能】自定义文件上传-方法
diff --git a/src/components/semri/process/BusinessProcessListModal.vue b/src/components/semri/process/BusinessProcessListModal.vue
index 7cc8568..759a6e1 100644
--- a/src/components/semri/process/BusinessProcessListModal.vue
+++ b/src/components/semri/process/BusinessProcessListModal.vue
@@ -8,6 +8,16 @@
+
+
+
@@ -17,14 +27,14 @@
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
import { useModal } from '/@/components/Modal';
import { columns } from './QueryProcessList.data';
- import { queryByBusinessId } from '/@/api/common/api';
+ import { deleteSingleProcess, queryByBusinessId } from '/@/api/common/api';
import { useMessage } from '/@/hooks/web/useMessage';
+ import TaskApprovalHistoryContent from '/@/views/super/bpm/process/personalOffice/myHandleTask/content/TaskApprovalHistoryContent.vue';
interface OpenParams {
businessId?: string;
title?: string;
columns?: BasicColumn[];
- onDeleteProcess?: (record: Recordable, reload: () => Promise) => Promise;
}
const title = ref('流程列表');
@@ -32,12 +42,15 @@
const currentBusinessId = ref('');
const defaultColumns = columns;
const modalWidth = 'min(1280px, calc(100vw - 64px))';
+ const approvalHistoryModalWidth = 'min(1100px, calc(100vw - 96px))';
// 按当前列宽合计收敛横向滚动距离,避免少量列被默认宽度撑得过大。
const tableScrollX = 1680;
// 固定表体高度,让横向滚动条停留在弹窗底部,而不是跟随少量数据行出现在中间。
const tableBodyHeight = 500;
const { createMessage } = useMessage();
- const onDeleteProcessRef = ref();
+ const approvalHistoryVisible = ref(false);
+ const approvalHistoryFormData = ref({});
+ const approvalHistoryRef = ref();
const [registerBpmModal, { openModal: bpmPicModal }] = useModal();
const [registerTable, { setColumns, setTableData, setLoading, clearSelectedRowKeys }] = useTable({
@@ -51,7 +64,7 @@
actionColumn: {
title: '操作',
dataIndex: 'action',
- width: 120,
+ width: 240,
fixed: 'right',
slots: { customRender: 'action' },
},
@@ -86,7 +99,6 @@
async function open(params: OpenParams = {}) {
currentBusinessId.value = params.businessId || '';
title.value = params.title || '流程列表';
- onDeleteProcessRef.value = params.onDeleteProcess;
visible.value = true;
await nextTick();
setColumns(params.columns?.length ? params.columns : defaultColumns);
@@ -96,9 +108,9 @@
function handleCancel() {
visible.value = false;
currentBusinessId.value = '';
- onDeleteProcessRef.value = undefined;
setColumns(defaultColumns);
setTableData([]);
+ handleApprovalHistoryCancel();
clearSelectedRowKeys();
}
@@ -109,34 +121,66 @@
});
}
+ async function handlePreviewApprovalHistory(record) {
+ const processInstId = record?.processInstId;
+ if (!processInstId) {
+ createMessage.error('流程实例ID不能为空');
+ return;
+ }
+
+ approvalHistoryFormData.value = {
+ procInstId: processInstId,
+ processInstId,
+ };
+ approvalHistoryVisible.value = true;
+ await nextTick();
+ approvalHistoryRef.value?.reload?.();
+ }
+
+ function handleApprovalHistoryCancel() {
+ approvalHistoryVisible.value = false;
+ approvalHistoryFormData.value = {};
+ }
+
async function handleDeleteProcess(record) {
- if (typeof onDeleteProcessRef.value === 'function') {
- await onDeleteProcessRef.value(record, loadData);
- } else {
- createMessage.warning('未配置删除流程回调');
+ const processInstId = record?.processInstId;
+ if (!processInstId) {
+ createMessage.error('流程实例ID不能为空');
+ return;
+ }
+
+ try {
+ const res = await deleteSingleProcess({ processInstId });
+ if (res?.success) {
+ createMessage.success(res.message || '删除流程成功');
+ await loadData();
+ } else {
+ createMessage.error(res?.message || '删除流程失败');
+ }
+ } catch (error) {
+ createMessage.error('删除流程失败');
}
}
function getTableAction(record) {
- const actions: any[] = [
+ return [
{
- label: '审批历史',
+ label: '流程图',
onClick: handlePreviewPic.bind(null, record),
},
- ];
-
- if (typeof onDeleteProcessRef.value === 'function') {
- actions.push({
+ {
+ label: '审批历史',
+ onClick: handlePreviewApprovalHistory.bind(null, record),
+ },
+ {
label: '删除流程',
popConfirm: {
title: '确定删除该流程吗?',
confirm: handleDeleteProcess.bind(null, record),
placement: 'topLeft',
},
- });
- }
-
- return actions;
+ },
+ ];
}
defineExpose({
diff --git a/src/views/bg/xispeak/BgXiSpeak.api.ts b/src/views/bg/xispeak/BgXiSpeak.api.ts
index 1b78c49..7578055 100644
--- a/src/views/bg/xispeak/BgXiSpeak.api.ts
+++ b/src/views/bg/xispeak/BgXiSpeak.api.ts
@@ -1,12 +1,12 @@
-import { defHttp } from "/@/utils/http/axios";
-import { useMessage } from "/@/hooks/web/useMessage";
+import { defHttp } from '/@/utils/http/axios';
+import { useMessage } from '/@/hooks/web/useMessage';
const { createConfirm } = useMessage();
enum Api {
list = '/bg/xispeak/bgXiSpeak/rootList',
- save='/bg/xispeak/bgXiSpeak/add',
- edit='/bg/xispeak/bgXiSpeak/edit',
+ save = '/bg/xispeak/bgXiSpeak/add',
+ edit = '/bg/xispeak/bgXiSpeak/edit',
deleteBgXiSpeak = '/bg/xispeak/bgXiSpeak/delete',
importExcel = '/bg/xispeak/bgXiSpeak/importExcel',
exportXls = '/bg/xispeak/bgXiSpeak/exportXls',
@@ -41,11 +41,11 @@ export const getRootListWithDept = (deptIds: string) => defHttp.get({ url: Api.g
* @param params
* @param handleSuccess
*/
-export const deleteBgXiSpeak = (params,handleSuccess) => {
+export const deleteBgXiSpeak = (params, handleSuccess) => {
return defHttp.delete({ url: Api.deleteBgXiSpeak, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
-}
+};
/**
* 批量删除
@@ -63,9 +63,9 @@ export const batchDeleteBgXiSpeak = (params, handleSuccess) => {
return defHttp.delete({ url: Api.deleteBgXiSpeak, data: params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
- }
+ },
});
-}
+};
/**
* 保存或者更新
@@ -73,27 +73,27 @@ export const batchDeleteBgXiSpeak = (params, handleSuccess) => {
* @param isUpdate
*/
export const saveOrUpdateDict = (params, isUpdate) => {
- let url = isUpdate ? Api.edit : Api.save;
- return defHttp.post({ url: url, params },{ isTransformResponse:false });
-}
+ const url = isUpdate ? Api.edit : Api.save;
+ return defHttp.post({ url: url, params }, { isTransformResponse: false });
+};
/**
* 查询全部树形节点数据
* @param params
*/
-export const loadTreeData = (params) => defHttp.get({ url: Api.loadTreeData,params });
+export const loadTreeData = (params) => defHttp.get({ url: Api.loadTreeData, params });
/**
* 查询子节点数据
* @param params
*/
export const getChildList = (params) => defHttp.get({ url: Api.getChildList, params });
-
+
/**
* 批量查询子节点数据
* @param params
*/
-export const getChildListBatch = (params) => defHttp.get({ url: Api.getChildListBatch, params },{ isTransformResponse:false });
+export const getChildListBatch = (params) => defHttp.get({ url: Api.getChildListBatch, params }, { isTransformResponse: false });
// ====================== 子表反馈相关API ======================
@@ -153,7 +153,7 @@ export const bgXiSpeakFeedbackDeleteBatch = (params, handleSuccess) => {
* @param isUpdate
*/
export const bgXiSpeakFeedbackSaveOrUpdate = (params, isUpdate) => {
- let url = isUpdate ? '/bg/xispeak/bgXiSpeak/editBgXiSpeakFeedback' : '/bg/xispeak/bgXiSpeak/addBgXiSpeakFeedback';
+ const url = isUpdate ? '/bg/xispeak/bgXiSpeak/editBgXiSpeakFeedback' : '/bg/xispeak/bgXiSpeak/addBgXiSpeakFeedback';
return defHttp.post({ url: url, params }, { isTransformResponse: false });
};
@@ -185,10 +185,6 @@ export const withDrawXiSpeak = (params) => {
return defHttp.post({ url: '/bg/xispeak/bgXiSpeak/withDrawXiSpeak', params }, { joinParamsToUrl: true, isTransformResponse: false });
};
-export const deleteSingleProcess = (params) => {
- return defHttp.post({ url: '/tasktask/taskTask/deleteSingleProcess', params }, { joinParamsToUrl: true, isTransformResponse: false });
-};
-
/**
* 批量查询反馈统计数量(每个 xispeak 下的 feedback 总条数和已闭环数)
* @param params { ids: "id1,id2,id3" }
diff --git a/src/views/bg/xispeak/BgXiSpeakList.vue b/src/views/bg/xispeak/BgXiSpeakList.vue
index 3fb2242..39b8b8c 100644
--- a/src/views/bg/xispeak/BgXiSpeakList.vue
+++ b/src/views/bg/xispeak/BgXiSpeakList.vue
@@ -83,7 +83,6 @@
updateLaunchType,
saveOrUpdateDict,
withDrawXiSpeak,
- deleteSingleProcess,
getRootListWithDept,
bgXiSpeakFeedbackList,
} from './BgXiSpeak.api';
@@ -137,8 +136,11 @@
},
});
- const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource, setTableData }, { rowSelection, selectedRowKeys }] =
- tableContext;
+ const [
+ registerTable,
+ { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource, setTableData },
+ { rowSelection, selectedRowKeys },
+ ] = tableContext;
const mainId = computed(() => (unref(selectedRowKeys).length > 0 ? unref(selectedRowKeys)[0] : ''));
provide('mainId', mainId);
@@ -593,20 +595,9 @@
title: '流程列表',
businessId: record.id,
columns: '',
- onDeleteProcess: handleDeleteProcess,
});
}
- async function handleDeleteProcess(processRecord, reload) {
- const res = await deleteSingleProcess({ processInstId: processRecord.processInstId });
- if (res.success) {
- createMessage.success(res.message || '删除流程成功');
- await reload();
- } else {
- createMessage.error(res.message || '删除流程失败');
- }
- }
-
async function handleFlowScheduleConfirm({ payload, options }) {
const record = payload?.record || {};
const flowCode = payload?.flowCode || FLOW_CODE;