From 3e359e4550d018035406a97c190b98f83839ba7f Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期五, 13 十二月 2024 10:41:05 +0800 Subject: [PATCH] 1、工作流重做更新 2、@import修改为@use以应对sass升级弃用@import 3、进入系统后自动redirect到home页 --- src/views/bpm/processInstance/detail/ProcessInstanceBpmnViewer.vue | 67 ++++++++++++++++++--------------- 1 files changed, 37 insertions(+), 30 deletions(-) diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceBpmnViewer.vue b/src/views/bpm/processInstance/detail/ProcessInstanceBpmnViewer.vue index 8912593..781263d 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceBpmnViewer.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceBpmnViewer.vue @@ -1,54 +1,61 @@ <template> <el-card v-loading="loading" class="box-card"> - <template #header> - <span class="el-icon-picture-outline">流程图</span> - </template> - <MyProcessViewer - key="designer" - :activityData="activityList" - :prefix="bpmnControlForm.prefix" - :processInstanceData="processInstance" - :taskData="tasks" - :value="bpmnXml" - v-bind="bpmnControlForm" - /> + <MyProcessViewer key="designer" :xml="view.bpmnXml" :view="view" class="process-viewer" /> </el-card> </template> <script lang="ts" setup> import { propTypes } from '@/utils/propTypes' import { MyProcessViewer } from '@/components/bpmnProcessDesigner/package' -import * as ActivityApi from '@/api/bpm/activity' defineOptions({ name: 'BpmProcessInstanceBpmnViewer' }) const props = defineProps({ - loading: propTypes.bool, // 是否加载中 - id: propTypes.string, // 流程实例的编号 - processInstance: propTypes.any, // 流程实例的信息 - tasks: propTypes.array, // 流程任务的数组 - bpmnXml: propTypes.string // BPMN XML + loading: propTypes.bool.def(false), // 是否加载中 + bpmnXml: propTypes.string, // BPMN XML + modelView: propTypes.object }) -const bpmnControlForm = ref({ - prefix: 'flowable' -}) -const activityList = ref([]) // 任务列表 +const view = ref({ + bpmnXml: '' +}) // BPMN 流程图数据 + /** 只有 loading 完成时,才去加载流程列表 */ watch( - () => props.loading, - async (value) => { - if (value && props.id) { - activityList.value = await ActivityApi.getActivityList({ - processInstanceId: props.id - }) + () => props.modelView, + async (newModelView) => { + // 加载最新 + if (newModelView) { + //@ts-ignore + view.value = newModelView } } ) + +/** 监听 bpmnXml */ +watch( + () => props.bpmnXml, + (value) => { + view.value.bpmnXml = value + } +) </script> -<style> +<style lang="scss" scoped> .box-card { + height: 100%; width: 100%; - margin-bottom: 20px; + margin-bottom: 0; + + :deep(.el-card__body) { + height: 100%; + padding: 0; + } + + :deep(.process-viewer) { + height: 100% !important; + min-height: 100%; + width: 100%; + overflow: auto; + } } </style> -- Gitblit v1.9.3