Pārlūkot izejas kodu

修改导出功能

silent 4 gadi atpakaļ
vecāks
revīzija
22bacb3aa7
1 mainītis faili ar 12 papildinājumiem un 1 dzēšanām
  1. 12 1
      src/views/sing_active/activeproductrecord.vue

+ 12 - 1
src/views/sing_active/activeproductrecord.vue

@@ -70,7 +70,8 @@
           <el-button type="primary" :size="size" icon="el-icon-search" slot="append"
                      @click="searchStateChange"></el-button>
         </el-input>
-        <el-button type="primary" :size="size" icon="el-icon-top" @click="generateListAndDownload">生成列表</el-button>
+        <el-button type="primary" :size="size" icon="el-icon-top" @click="generateListAndDownload">生成列表[后端]</el-button>
+        <el-button type="primary" :size="size" icon="el-icon-top" @click="generateListAndDownloadOfWeb">生成列表[前端]</el-button>
         <!--        <el-button type="primary" :size="size">导出已生成列表</el-button>-->
       </template>
       <template slot="menuLeft">
@@ -634,6 +635,16 @@ export default {
         this.loading = false;
       });
     },
+    generateListAndDownloadOfWeb() {
+      const filterArray = ["数据统计"];
+      this.$Export.excel({
+        title: `活动作品数据导出-${moment().format("yyyy-MM-DD HH:mm:ss")}`,
+        columns: this.option.column.filter(ele=>{
+          return filterArray.indexOf(ele.label)===-1;
+        }),
+        data: this.selectionList.length!==0?this.selectionList:this.data
+      });
+    }
   }
 };
 </script>