xiejun
2023-08-12 a19d26e88360c9760b2286bac4dfb1710fd2fa21
Source/UBCS-WEB/src/components/template/FlowPath.vue
@@ -1,13 +1,14 @@
<template>
        <avue-crud ref="crud" :table-loading="loading" :data="data" v-model="form" :option="option" :page.sync="page"
            :search.sync="search" @on-load="getDataList" @row-save="handleSave" @row-del="handleDelete"
            @row-update="handleEdit" @refresh-change="handleRefresh" @size-change="handleSizePage"
            @current-change="handleCurrentPage">
  <avue-crud v-if="Formlist.length>0" ref="crud" v-model="form" :data="data" :option="option" :page.sync="page"
             :search.sync="search" :table-loading="loading" @on-load="getDataList" @row-save="handleSave"
             @row-del="handleDelete" @row-update="handleEdit" @refresh-change="handleRefresh"
             @size-change="handleSizePage" @current-change="handleCurrentPage">
        </avue-crud>
</template>
<script>
import { getFlowpathList, getStartList, flowpathSave, flowpathDelete } from '@/api/template/flowpath.js'
export default {
    name: 'FlowPath',
    props: {
@@ -23,6 +24,10 @@
        typeof: String,
        required: true,
        default: ""
    },
    Formlist: {
      type: Array,
      default: []
      }
    },
    data() {
@@ -39,7 +44,7 @@
            startData: [],
            form: {},
            option: {
              height: "auto",
        height: 340,
              border: true,
              align: 'center',
              menu:!this.checkStatus || this.crudLCStatus == 'Editing',
@@ -47,6 +52,7 @@
              index: true,
              searchMenuSpan: 8,
              searchBtn: false,
        refreshBtn: false,
              emptyBtn: false,
              columnBtn: false,
              editBtn:!this.checkStatus || this.crudLCStatus == 'Editing',
@@ -158,15 +164,16 @@
              this.data = data.records
              this.page.total = data.total
            } else this.loading = false
      } else {
        this.data = []
          }
        },
        // 新增
        async handleSave(row, done, loading) {
            console.log(row)
            const response = await flowpathSave({ ...row, ...{ templateId: this.code } })
      await flowpathSave({...row, ...{templateId: this.code}}).then(response => {
            if (response.status === 200) {
                loading()
                console.log(response)
                this.$message({
                    type: 'success',
@@ -175,6 +182,9 @@
                done()
                this.getDataList()
            }
      }).catch(res => {
        loading()
      })
        },
        // 编辑
@@ -182,9 +192,8 @@
            console.log(row)
            const { modelName, modelKey, buttonTypeKey, id ,description} = row
            let param = { modelName, modelKey, buttonTypeKey, id,description }
            const response = await flowpathSave({ ...param, ...{ templateId: this.code } })
      await flowpathSave({...param, ...{templateId: this.code}}).then(response => {
            if (response.status === 200) {
                loading()
                this.$message({
                    type: 'success',
                    message: '修改数据成功!'
@@ -192,6 +201,10 @@
                done()
                this.getDataList()
            }
      }).catch(() => {
        //loading控制禁用 默认是开启
        loading()
      })
        },
        // 删除单条