wangting
2023-08-07 db860f9c08a23fe916121a2c76001e05d2acee3e
Source/UBCS-WEB/src/components/template/FlowPath.vue
@@ -2,7 +2,7 @@
        <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">
            @current-change="handleCurrentPage" v-if="Formlist.length>0">
        </avue-crud>
</template>
@@ -23,6 +23,10 @@
        typeof: String,
        required: true,
        default: ""
      },
      Formlist:{
        type:Array,
        default:[]
      }
    },
    data() {
@@ -47,6 +51,7 @@
              index: true,
              searchMenuSpan: 8,
              searchBtn: false,
              refreshBtn:false,
              emptyBtn: false,
              columnBtn: false,
              editBtn:!this.checkStatus || this.crudLCStatus == 'Editing',
@@ -158,23 +163,27 @@
              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 } })
            if (response.status === 200) {
                loading()
            await flowpathSave({ ...row, ...{ templateId: this.code } }).then(response=>{
              if (response.status === 200) {
                console.log(response)
                this.$message({
                    type: 'success',
                    message: '新增数据成功!'
                  type: 'success',
                  message: '新增数据成功!'
                })
                done()
                this.getDataList()
            }
              }
            }).catch(res=>{
              loading()
            })
        },
        // 编辑
@@ -182,16 +191,19 @@
            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 } })
            if (response.status === 200) {
                loading()
            await flowpathSave({ ...param, ...{ templateId: this.code } }).then(response=>{
              if (response.status === 200) {
                this.$message({
                    type: 'success',
                    message: '修改数据成功!'
                  type: 'success',
                  message: '修改数据成功!'
                })
                done()
                this.getDataList()
            }
              }
            }).catch(()=>{
              //loading控制禁用 默认是开启
              loading()
            })
        },
        // 删除单条