From c6be5ad8ef96f5748adad2ded96744b45f5d3dee Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期二, 08 八月 2023 15:07:40 +0800
Subject: [PATCH] 提交代码

---
 Source/UBCS-WEB/src/components/Master/MasterTransfer.vue |  137 ++++++++++++++++++++++++++++++---------------
 1 files changed, 90 insertions(+), 47 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue b/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue
index cdb319c..24ea436 100644
--- a/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue
+++ b/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue
@@ -57,6 +57,7 @@
         data: []
       },
       exportArr:{},
+      exportArrTwo:{},
       ids:""
     };
   },
@@ -66,28 +67,29 @@
       this.dialogPush = this.visible;
     },
     //琛ㄥご鏁版嵁 鐢ㄦ潵娓叉煋绌挎妗�
-    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
-           }
-         })
-       }
+    tableHeadData: {
+      handler(newval, oldval) {
+        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,
+            });
+          });
+          // excel琛ㄦ牸鏁版嵁杞崲
+          this.option.column[0].children = newval.map(obj => {
+            return {
+              label: obj.label,
+              prop: obj.prop
+            }
+          })
+        }
       }
-},
+    },
     tableData(){
       // 灏嗗�奸噷闈㈢殑true鎴杅alse鏀瑰彉涓烘槸鎴栧惁
       this.option.data = this.tableData.map(obj => {
@@ -103,6 +105,11 @@
     },
     codeClassifyOid:{
       handler(newval,oldval){
+      }
+    },
+    value:{
+      handler(newval,oldval){
+        console.log('value',newval)
       }
     }
   },
@@ -122,9 +129,6 @@
       this.$emit('update:visible', false);
     },
     handleExcel(){
-      if(this.value <= 0){
-        this.$message.warning('璇烽�夋嫨灞炴��')
-      }else {
         this.value.map(index => this.tableHeadData[index].prop).forEach((item, index) => {
           this.exportArr[`attrIdIndexMap[${index}]`] = item
         })
@@ -136,30 +140,58 @@
             const selectList=[]
             //宸查�夋嫨灞炴��
             let exportArr={}
-            const ids = this.selectRow.map(item => item.oid).join(',')
+            this.ids = this.selectRow.map(item => item.oid).join(',')
             this.selectRow.forEach(item=>{
               selectList.push(
                 item.oid
               )
             })
-            exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArr}).then(res=>{
+            if(this.value <= 0){
+              this.tableHeadData.map(item => item.prop)
+                .forEach((prop, index) => {
+                  this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop;
+                });
+              exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArrTwo,limit:-1}).then(res=>{
+                // console.log('res',res)
+                if(res){
+                  func.downloadFileByBlobHandler(res);
+                  this.escHandler()
+                }
+              })
+            }else {
+
+              exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArr}).then(res=>{
+                // console.log('res',res)
+                if(res){
+                  func.downloadFileByBlobHandler(res);
+                  this.escHandler()
+                }
+              })
+
+            }
+            }
+        }else if(this.radio === 1){
+          if(this.value <= 0){
+            this.tableHeadData.map(item => item.prop)
+              .forEach((prop, index) => {
+                this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop;
+              });
+            exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArrTwo,limit:-1}).then(res=>{
               // console.log('res',res)
               if(res){
-                func.downloadFileByBlob(res);
+                func.downloadFileByBlobHandler(res);
                 this.escHandler()
               }
             })
-
+          }else {
+            exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArr,limit:-1}).then(res=>{
+              // console.log('res',res)
+              if(res){
+                func.downloadFileByBlobHandler(res);
+                this.escHandler()
+              }
+            })
           }
-        }else if(this.radio === 1){
-          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 if(this.radio === 2){
           const input = this.pageExport.trim();
           let start, end;
@@ -185,17 +217,28 @@
               return;
             }
           }
-          exportCode({ codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: this.limit, page: start, endPage: end }).then((res) => {
-            // console.log('res',res)
-            if (res) {
-              func.downloadFileByBlobHandler(res);
-              this.escHandler()
-            }
-          });
+          if(this.value >=1 ){
+            exportCode({ codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: this.limit, page: start, endPage: end }).then((res) => {
+              // console.log('res',res)
+              if (res) {
+                func.downloadFileByBlobHandler(res);
+                this.escHandler()
+              }
+            });
+          }else {
+            this.tableHeadData.map(item => item.prop)
+              .forEach((prop, index) => {
+                this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop;
+              });
+            exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArrTwo,limit:this.limit,page: start, endPage: end}).then(res=>{
+              // console.log('res',res)
+              if(res){
+                func.downloadFileByBlobHandler(res);
+                this.escHandler()
+              }
+            })
+          }
         }
-
-      }
-
     },
   }
 }

--
Gitblit v1.9.3