智慧农业后台管理页面
shuishen
2022-07-29 d6a0abe9024f87fc517a2b71df0f17c5cadc41a0
src/views/flow/deploy.vue
@@ -1,12 +1,18 @@
<template>
  <basic-container>
    <avue-form ref="form" :option="option" v-model="form" :upload-before="uploadBefore" :upload-after="uploadAfter"/>
        <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";
import { deployUpload } from "@/api/flow/flow"
import { flowCategory } from "@/util/flow"
  export default {
    data() {
@@ -107,27 +113,27 @@
      'form.flowMode'() {
        this.$refs.form.option.column.filter(item => {
          if (item.prop === "tenantId") {
            item.display = this.form.flowMode === 2;
                    item.display = this.form.flowMode === 2
          }
        });
            })
      }
    },
    methods: {
      uploadBefore(file, done) {
        this.$message.success('部署开始');
        this.file = file;
            this.$message.success('部署开始')
            this.file = file
        done()
      },
      uploadAfter(res, done, loading) {
        if (!this.form.flowCategory) {
          this.$message.warning('清先选择流程类型');
                this.$message.warning('清先选择流程类型')
          loading()
          return false;
                return false
        }
        if (this.form.flowMode === 2 && !this.form.tenantId) {
          this.$message.warning('清先选择对应租户');
          loading();
          return false;
                this.$message.warning('清先选择对应租户')
                loading()
                return false
        }
        if (res.success) {
          deployUpload(
@@ -135,18 +141,18 @@
            (this.form.tenantId) ? this.form.tenantId.join(",") : "",
            [this.file]
          ).then(res => {
            const data = res.data;
                    const data = res.data
            if (data.success) {
              done()
            } else {
              this.$message.error(data.msg);
                        this.$message.error(data.msg)
              loading()
            }
          })
        } else {
          this.$message.warning('请上传 bpmn20.xml 标准格式文件');
                this.$message.warning('请上传 bpmn20.xml 标准格式文件')
          loading()
          return false;
                return false
        }
      },
    }