dangsn
2023-08-02 54f35ae7866dac5c497372b68d03309c7eae9424
Source/UBCS-WEB/src/components/Master/MasterTransfer.vue
@@ -66,28 +66,31 @@
      this.dialogPush = this.visible;
    },
    //表头数据 用来渲染穿梭框
    tableHeadData:{
      handler(newval,oldval){
    tableHeadData: {
      handler(newval, oldval) {
        console.log(newval)
       if(newval){
         //excel表头数据转换
         this.tableHeadFindData=newval.map(obj => obj.label);
         this.tableHeadFindData.forEach((city, index) => {
           this.data.push({
             label: city,
             key: index,
           });
         });
         //excel表格数据转换
         this.option.column[0].children=newval.map(obj => {
           return {
             label: obj.label,
             prop: obj.prop
           }
         })
       }
        if (newval) {
          // 清空data数组
          this.data = [];
          // excel表头数据转换
          this.tableHeadFindData = newval.map(obj => obj.label);
          this.tableHeadFindData.forEach((city, index) => {
            this.data.push({
              label: city,
              key: index,
            });
          });
          console.log(this.data)
          // excel表格数据转换
          this.option.column[0].children = newval.map(obj => {
            return {
              label: obj.label,
              prop: obj.prop
            }
          })
        }
      }
},
    },
    tableData(){
      // 将值里面的true或false改变为是或否
      this.option.data = this.tableData.map(obj => {