From d44134d06fc57865bc8995972e9035dbb90fd8b9 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期二, 18 七月 2023 15:19:25 +0800
Subject: [PATCH] 7-18整合代码
---
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