From 44117ba8319bf49b5d9e4ca5870f8b6df7392ee0 Mon Sep 17 00:00:00 2001 From: gssong <1742057357@qq.com> Date: Wed, 4 Dec 2024 22:39:00 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=B0=83=E6=95=B4=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/workflow/processInstance/types.ts | 2 +- src/views/workflow/processInstance/index.vue | 56 ++++++++++++++++++-- src/views/workflow/task/allTaskWaiting.vue | 49 ++--------------- 3 files changed, 56 insertions(+), 51 deletions(-) diff --git a/src/api/workflow/processInstance/types.ts b/src/api/workflow/processInstance/types.ts index 9318fee..3f0ac69 100644 --- a/src/api/workflow/processInstance/types.ts +++ b/src/api/workflow/processInstance/types.ts @@ -10,7 +10,7 @@ export interface ProcessInstanceQuery extends PageQuery { export interface ProcessInstanceVO extends BaseEntity { id: string; definitionId: string; - flowNmae: string; + flowName: string; flowCode: string; version: string; businessId: string; diff --git a/src/views/workflow/processInstance/index.vue b/src/views/workflow/processInstance/index.vue index 169f8a7..0547167 100644 --- a/src/views/workflow/processInstance/index.vue +++ b/src/views/workflow/processInstance/index.vue @@ -101,9 +101,12 @@ - + 查看 + + 变量 + @@ -135,6 +138,22 @@ + + + + +
+ +
+
+
+ @@ -144,13 +163,16 @@ import { getPageByFinish, deleteRunAndHisInstance, deleteFinishAndHisInstance, - deleteRunInstance + deleteRunInstance, + getInstanceVariable } from '@/api/workflow/processInstance'; import { listCategory } from '@/api/workflow/category'; import { CategoryVO } from '@/api/workflow/category/types'; import { ProcessInstanceQuery, ProcessInstanceVO } from '@/api/workflow/processInstance/types'; import workflowCommon from '@/api/workflow/workflowCommon'; import { RouterJumpVo } from '@/api/workflow/workflowCommon/types'; +import VueJsonPretty from 'vue-json-pretty'; +import 'vue-json-pretty/lib/styles.css'; //审批记录组件 const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { wf_business_status } = toRefs(proxy?.useDict('wf_business_status')); @@ -171,8 +193,13 @@ const multiple = ref(true); const showSearch = ref(true); // 总条数 const total = ref(0); -// 流程定义id -const processDefinitionId = ref(''); + +// 流程变量是否显示 +const variableVisible = ref(false); +const variableLoading = ref(true); +const variables = ref('') +//流程定义名称 +const processDefinitionName = ref(); // 模型定义表格数据 const processInstanceList = ref([]); const processDefinitionHistoryList = ref>([]); @@ -327,6 +354,27 @@ const handleView = (row) => { workflowCommon.routerJump(routerJumpVo, proxy); }; +//查询流程变量 +const handleInstanceVariable = async (row: ProcessInstanceVO) => { + variableLoading.value = true; + variableVisible.value = true; + processDefinitionName.value = row.flowName; + let data = await getInstanceVariable(row.id); + variables.value = data.data.variable; + variableLoading.value = false; +}; + +/** + * json转为对象 + * @param data 原始数据 + */ + function formatToJsonObject(data: string) { + try { + return JSON.parse(data); + } catch (error) { + return data; + } +} onMounted(() => { getProcessInstanceRunningList(); getTreeselect(); diff --git a/src/views/workflow/task/allTaskWaiting.vue b/src/views/workflow/task/allTaskWaiting.vue index 7c47090..853dcfa 100644 --- a/src/views/workflow/task/allTaskWaiting.vue +++ b/src/views/workflow/task/allTaskWaiting.vue @@ -80,18 +80,15 @@ @@ -109,32 +106,11 @@ - - - - -
- - - {{ v.value }} - - -
-
-
-