Переглянути джерело

无数据时不可导出;

chengbeibei 11 місяців тому
батько
коміт
1da3242b06
1 змінених файлів з 10 додано та 0 видалено
  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 = "导出文件"
       }