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 }} - - -
-
-
-