田源
2023-08-03 b675af4f2956cf6792cfe2bae2bcaa2c7814d8c0
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 => {
@@ -130,7 +133,14 @@
        })
        if(this.radio === 0){
          if(this.selectRow.length<=0){
            this.$message.warning('请选择要导出的模板')
            this.ids=this.tableData.map(item => item.oid).join(',')
            exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArr,limit:-1}).then(res=>{
              // console.log('res',res)
              if(res){
                func.downloadFileByBlob(res);
                this.escHandler()
              }
            })
          }else {
            //已选择多选
            const selectList=[]
@@ -188,7 +198,7 @@
          exportCode({ codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: this.limit, page: start, endPage: end }).then((res) => {
            // console.log('res',res)
            if (res) {
              func.downloadFileByBlob(res);
              func.downloadFileByBlobHandler(res);
              this.escHandler()
            }
          });