From dc590d026e1130a98c70181fb65f8ed09414e787 Mon Sep 17 00:00:00 2001
From: yuxc <653031404@qq.com>
Date: 星期五, 14 七月 2023 17:48:11 +0800
Subject: [PATCH] 1、主要解决获取当前用户信息等问题,使用AuthUtil来进行获取,对生成token等信息进行了修改增加。

---
 Source/UBCS-WEB/dist/src/components/flow-design/main.vue |  123 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 123 insertions(+), 0 deletions(-)

diff --git a/Source/UBCS-WEB/dist/src/components/flow-design/main.vue b/Source/UBCS-WEB/dist/src/components/flow-design/main.vue
new file mode 100644
index 0000000..34560f8
--- /dev/null
+++ b/Source/UBCS-WEB/dist/src/components/flow-design/main.vue
@@ -0,0 +1,123 @@
+<template>
+  <div>
+    <el-dialog v-if="isDialog"
+               :visible.sync="visible"
+               append-to-body
+               destroy-on-close
+               title="娴佺▼鍥惧睍绀�"
+               width="70%"
+               custom-class="flow-design-dialog">
+      <wf-design-base ref="bpmn"
+                      style="height: 60vh;"
+                      :options="option"></wf-design-base>
+    </el-dialog>
+    <div v-else>
+      <wf-design-base v-if="visible"
+                      ref="bpmn"
+                      style="height: 60vh;"
+                      :options="option"></wf-design-base>
+    </div>
+  </div>
+</template>
+
+<script>
+import {modelView} from '@/api/flow/flow'
+
+export default {
+  name: 'flowDesign',
+  props: {
+    isDialog: {
+      type: Boolean,
+      default: false
+    },
+    isDisplay: {
+      type: Boolean,
+      default: false
+    },
+    processInstanceId: String,
+    processDefinitionId: String,
+  },
+  data() {
+    return {
+      visible: false,
+      option: {
+        mode: 'view'
+      }
+    }
+  },
+  watch: {
+    isDisplay: {
+      handler(val) {
+        this.visible = val
+      },
+      immediate: true
+    },
+    visible: {
+      handler(val) {
+        this.$emit('update:is-display', val)
+      }
+    },
+    processInstanceId: {
+      handler(val) {
+        if (!val) return
+        this.getDetail({processInstanceId: this.processInstanceId})
+      },
+      immediate: true
+    },
+    processDefinitionId: {
+      handler(val) {
+        if (!val) return
+        this.getDetail({processDefinitionId: this.processDefinitionId})
+      },
+      immediate: true
+    }
+  },
+  methods: {
+    getDetail(params) {
+      modelView(params).then(res => {
+        const data = res.data.data
+        const {xml, flow} = data
+        this.$set(this.option, 'xml', xml)
+        if (flow) {
+          const flows = []
+          flow.forEach(f => {
+            let {endTime} = f
+
+            const ff = {
+              id: f.historyActivityId,
+              class: (!endTime && f.historyActivityType !== 'candidate') ? 'nodePrimary' : ''
+            }
+
+            if (f.historyActivityType === 'sequenceFlow') ff.class = 'lineWarn'
+            else if (!ff.class && f.historyActivityType !== 'candidate') ff.class = 'nodeSuccess'
+
+            const index = flows.findIndex(fl => fl.id === f.historyActivityId)
+            if (index !== -1) flows.splice(index, 1, ff)
+            else flows.push(ff)
+          })
+          this.$set(this.option, 'flows', flows)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+.flow-design-dialog {
+  display: flex;
+  flex-direction: column;
+  margin: 0 !important;
+  position: absolute;
+  top: 40%;
+  left: 50%;
+  transform: translate(-50%, -40%);
+  max-height: calc(100% - 30px);
+  max-width: calc(100% - 30px);
+
+  .el-dialog__body {
+    flex: 1;
+    overflow: auto;
+  }
+}
+</style>

--
Gitblit v1.9.3