Pārlūkot izejas kodu

无数据时不可导出;

chengbeibei 11 mēneši atpakaļ
vecāks
revīzija
1da3242b06
1 mainītis faili ar 10 papildinājumiem un 0 dzēšanām
  1. 10 0
      src/mixins/JeecgListMixin.js

+ 10 - 0
src/mixins/JeecgListMixin.js

@@ -306,6 +306,16 @@ export const JeecgListMixin = {
       window.location.href = url;
     },
     handleExportXls(fileName){
+      console.log("this.dataSource.length", this.dataSource.length);
+      if (this.dataSource.length == 0) {
+        /*this.$notification.error({
+          message: '提示',
+          description: `无相关记录,不支持导出!`,
+          duration:3
+        })*/
+        this.$message.error("无相关记录可导出!")
+        return
+      }
       if(!fileName || typeof fileName != "string"){
         fileName = "导出文件"
       }