From ffd0af47ee31a9592cfab56a907e9841a9113c52 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期四, 20 七月 2023 10:37:17 +0800
Subject: [PATCH] 代码提交,前端代码打包

---
 Source/UBCS-WEB/dist/src/views/flow/deploy.vue |  154 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 154 insertions(+), 0 deletions(-)

diff --git a/Source/UBCS-WEB/dist/src/views/flow/deploy.vue b/Source/UBCS-WEB/dist/src/views/flow/deploy.vue
new file mode 100644
index 0000000..a0247f9
--- /dev/null
+++ b/Source/UBCS-WEB/dist/src/views/flow/deploy.vue
@@ -0,0 +1,154 @@
+<template>
+  <basic-container>
+    <avue-form ref="form" :option="option" v-model="form" :upload-before="uploadBefore" :upload-after="uploadAfter"/>
+  </basic-container>
+</template>
+
+<script>
+  import {deployUpload} from "@/api/flow/flow";
+  import {flowCategory} from "@/util/flow";
+
+  export default {
+    data() {
+      return {
+        form: {
+          flowCategory: '',
+          tenantId: '',
+          flowFile: [],
+          file: {},
+        },
+        option: {
+          labelWidth: 120,
+          menuBtn: false,
+          column: [
+            {
+              label: '娴佺▼绫诲瀷',
+              prop: 'flowCategory',
+              type: 'select',
+              dicUrl: `/api/ubcs-system/dict/dictionary?code=flow`,
+              props: {
+                label: "dictValue",
+                value: "dictKey"
+              },
+              row: true,
+              span: 12,
+              dataType: "number",
+              rules: [
+                {
+                  required: true,
+                  message: '璇烽�夋嫨娴佺▼绫诲瀷',
+                  trigger: 'blur'
+                }
+              ]
+            },
+            {
+              label: "娴佺▼妯″紡",
+              prop: "flowMode",
+              type: "radio",
+              dicData: [
+                {
+                  label: "閫氱敤娴佺▼",
+                  value: 1
+                },
+                {
+                  label: "瀹氬埗娴佺▼",
+                  value: 2
+                }
+              ],
+              value: 1,
+              row: true,
+              span: 12,
+              rules: [
+                {
+                  required: true,
+                  message: '璇烽�夋嫨娴佺▼妯″紡',
+                  trigger: 'blur'
+                }
+              ],
+            },
+            {
+              label: "鎵�灞炵鎴�",
+              prop: "tenantId",
+              type: "tree",
+              multiple: true,
+              dicUrl: "/api/ubcs-system/tenant/select",
+              props: {
+                label: "tenantName",
+                value: "tenantId"
+              },
+              display: false,
+              row: true,
+              span: 12,
+              rules: [
+                {
+                  required: true,
+                  message: '璇烽�夋嫨鎵�灞炵鎴�',
+                  trigger: 'blur'
+                }
+              ],
+            },
+            {
+              label: '闄勪欢涓婁紶',
+              prop: 'flowFile',
+              type: 'upload',
+              loadText: '闄勪欢涓婁紶涓紝璇风◢绛�',
+              span: 24,
+              propsHttp: {
+                res: 'data'
+              },
+              tip: '璇蜂笂浼� bpmn20.xml 鏍囧噯鏍煎紡鏂囦欢',
+              action: '/api/ubcs-flow/manager/check-upload'
+            },
+          ]
+        }
+      }
+    },
+    watch: {
+      'form.flowMode'() {
+        this.$refs.form.option.column.filter(item => {
+          if (item.prop === "tenantId") {
+            item.display = this.form.flowMode === 2;
+          }
+        });
+      }
+    },
+    methods: {
+      uploadBefore(file, done) {
+        this.$message.success('閮ㄧ讲寮�濮�');
+        this.file = file;
+        done()
+      },
+      uploadAfter(res, done, loading) {
+        if (!this.form.flowCategory) {
+          this.$message.warning('娓呭厛閫夋嫨娴佺▼绫诲瀷');
+          loading()
+          return false;
+        }
+        if (this.form.flowMode === 2 && !this.form.tenantId) {
+          this.$message.warning('娓呭厛閫夋嫨瀵瑰簲绉熸埛');
+          loading();
+          return false;
+        }
+        if (res.success) {
+          deployUpload(
+            flowCategory(this.form.flowCategory),
+            (this.form.tenantId) ? this.form.tenantId.join(",") : "",
+            [this.file]
+          ).then(res => {
+            const data = res.data;
+            if (data.success) {
+              done()
+            } else {
+              this.$message.error(data.msg);
+              loading()
+            }
+          })
+        } else {
+          this.$message.warning('璇蜂笂浼� bpmn20.xml 鏍囧噯鏍煎紡鏂囦欢');
+          loading()
+          return false;
+        }
+      },
+    }
+  }
+</script>

--
Gitblit v1.9.3