ludc
2023-07-05 b7de729e7ae27044dcfa8e996218ff2b7ec1fae5
Source/UBCS-WEB/src/components/Tree/attrCrud.vue
@@ -1,9 +1,6 @@
<template>
  <!--  <avue-crud :data="ProData" :option="option" @sort-change="sortChange" @row-update="addUpdate"-->
  <!--             @cell-click="handleRowClick" @select="selectHandle" @row-del="CrudRowDel">-->
  <div>
    <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArray.length>=1">
    <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag">
      <!--新增-->
      <el-button v-if="attrEditVisible == false && attrFlagChiledren==false" size="small" type="primary"
                 @click="busineHandle">+ 添加 {{ msg }}
@@ -33,11 +30,10 @@
      <!--    重置-->
      <el-button size="small" @click="reset">重置</el-button>
      <!--    同步到其他模板-->
      <el-button size="small"@click="syncHandle">同步到其他模板</el-button>
      <el-button size="small" @click="syncHandle">同步到其他模板</el-button>
      <!--    编码申请预览-->
      <el-button size="small" @click="applicationHandle" style="">编码申请预览</el-button>
      <!--        验证规则-->
    </div>
<!--    弹窗-->
    <div>
@@ -203,7 +199,7 @@
      </el-dialog>
      <!--        全屏编辑-->
      <el-dialog :visible.sync="attrEditVisible" append-to-body fullscreen="true">
        <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag"></attrCrud>
        <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :crudArrayFlag="this.crudArrayFlag"></attrCrud>
      </el-dialog>
      <!--      组合规则-->
      <formula-editor :systemVariableTableData="systemVariableTableData"
@@ -236,8 +232,7 @@
              style="width: 100%"
              @cell-click="handleCellClicks"
              @select="selectHandle"
              v-if="this.crudArray.length>=1"
              v-if="this.crudArrayFlag"
    >
      <el-table-column
        type="selection"
@@ -247,6 +242,7 @@
      <el-table-column v-for="item in this.option.column" :key="item.id"
                       :label="item.label"
                       :prop="item.prop"
                       :formatter="formAttr"
                       :width="item.label.length >=4 ?'150':item.label.length==3 ?'120':'90'"
                       :show-overflow-tooltip="true"
                       align="center"
@@ -254,6 +250,11 @@
        <template slot-scope="{ row }">
          <el-input v-if="editingRows === row && editShows== item.prop" v-model="row[item.prop]"
                    @blur="saveRows"></el-input>
          <el-switch
            v-if="item.label === 'true' || item.label === 'false'"
            active-color="#13ce66"
            inactive-color="#ff4949">
          </el-switch>
          <span v-else>{{ row[item.prop] }}</span>
        </template>
      </el-table-column>
@@ -280,7 +281,6 @@
export default {
  name: "attrCrud .vue",
  // props: ['ProData','crudOid','crudArray','Formlist','codeClassifyOid'],
  props: {
    ProData: {
      type: Array,
@@ -303,10 +303,29 @@
      type: Boolean,
      default: false
    },
    crudArrayFlag:{
      type: Boolean,
      default: false
    }
  },
  watch:{
    crudArray:{
      handler(newval,oldval){
        if(newval != undefined){
          if(newval.length>=1){
            this.crudArrayFlag=true
          }else{
            this.crudArrayFlag=false
          }
        }
      },
      deep:true,
      immediate:true
    }
  },
  data() {
    return {
      crudArrayFlag:false,
      editingRows: null,
      editShows:"",
      attrFlag: false,
@@ -1161,7 +1180,9 @@
  },
  methods: {
    formAttr(row, column) {
      console.log(row,column)
    },
    //属性分组按钮
    attrVisibleHandle() {
      if (this.CrudSelect.length > 1) {
@@ -1194,14 +1215,10 @@
    },
    //业务类型保存
    busineAddHandle() {
      if (this.busineSelectList.length > 1) {
        this.$message.warning('请选择一条业务类型数据')
      } else {
        this.$set(this.busineAddList, 'classifytemplateoid', this.crudOid)
        this.$set(this.busineAddList, 'oid', '')
        this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList)))
        this.addVisible = false;
      }
      this.$set(this.busineAddList, 'classifytemplateoid', this.crudOid)
      this.$set(this.busineAddList, 'oid', '')
      this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList)))
      this.addVisible = false;
    },
    //业务类型单选
    businessSelect(selection, row) {
@@ -1210,14 +1227,10 @@
    },
    // 从业务类型中选择数据
    busineHandle() {
      if (this.crudArray.length < 1) {
        this.$message.error('请选择一条模板')
      } else {
        this.addVisible = true;
        AttrByBtm({'conditionMap[oid]': this.crudOid}).then(res => {
          this.businessData = res.data.data;
        })
      }
    },
    // 级联属性按钮
    CascadeHandle() {
@@ -1244,7 +1257,7 @@
    },
    //保存
    addsHandler() {
      batchAddSave(this.ProData).then(res => {
      batchAddSave(JSON.parse(JSON.stringify(this.ProData))).then(res => {
        this.$message.success('保存成功')
      })
    },
@@ -1346,7 +1359,14 @@
    },
    //分类注入保存
    injectAddHandle() {
      this.$set(this.attrRow, 'classifyInvokeLevel', this.injectOption);
      let data = {
        "注入类型": this.injectOption.type,
        "注入类型名称": this.injectOption.set,
        "层级设置": this.injectOption.injectNum,
        "是否可修改": this.injectOption.change
      }
      console.log(this.injectOption)
      this.$set(this.attrRow, 'classifyInvokeLevel', data);
      this.injectVisible = false
    },
    //分类注入清空
@@ -1454,6 +1474,8 @@
}
</script>
<style scoped>
<style scoped lang="scss">
/deep/ .el-button {
  margin: 0 10px 10px 0;
}
</style>