bill 10 月之前
父节点
当前提交
de625e5e06
共有 3 个文件被更改,包括 23 次插入16 次删除
  1. 14 12
      src/util/file-serve.ts
  2. 8 3
      src/view/statistics/statisticsInject.ts
  3. 1 1
      vite.config.ts

+ 14 - 12
src/util/file-serve.ts

@@ -94,22 +94,24 @@ export const saveAs: SaveAs =
         a.download = name;
         a.rel = "noopener";
 
-        if (typeof blob === "string") {
-          a.href = blob;
-          if (a.origin !== location.origin) {
-            if (corsEnabled(a.href)) {
-              return download(blob, name, opts);
-            }
-            a.target = "_blank";
-          }
-          return click(a);
-        } else {
-          a.href = URL.createObjectURL(blob);
+        // if (typeof blob === "string") {
+        //   a.href = blob;
+        //   if (a.origin !== location.origin) {
+        //     if (corsEnabled(a.href)) {
+        //       return download(blob, name, opts);
+        //     }
+        //     a.target = "_blank";
+        //   }
+        //   return click(a);
+        // } else {
+        a.href = typeof blob === "string" ? blob : URL.createObjectURL(blob);
+        if (typeof blob !== "string") {
           setTimeout(function () {
             URL.revokeObjectURL(a.href);
           }, 4e4); // 40s
-          return click(a);
         }
+        return click(a);
+        // }
       }
     : "msSaveOrOpenBlob" in navigator
     ? (blob, name = "download", opts) => {

+ 8 - 3
src/view/statistics/statisticsInject.ts

@@ -208,12 +208,17 @@ export const updateParams = async (params: StatisticsParams) => {
     if (radiusNds.includes(ndx)) {
       statisticsConfigs[ndx].data.series![0].data = items.map((item) => ({
         value: item.dataCount,
-        name: item.groupKey,
+        name:
+          item.groupKey.length > 15
+            ? item.groupKey.substring(0, 15) + "..."
+            : item.groupKey,
       }));
       console.log(statisticsConfigs[ndx].data);
     } else {
-      statisticsConfigs[ndx].data.xAxis.data = items.map(
-        (item) => item.groupKey
+      statisticsConfigs[ndx].data.xAxis.data = items.map((item) =>
+        item.groupKey.length > 15
+          ? item.groupKey.substring(0, 15) + "..."
+          : item.groupKey
       );
       statisticsConfigs[ndx].data.xAxis.axisLabel = {
         interval: "auto",

+ 1 - 1
vite.config.ts

@@ -3,7 +3,7 @@ import vue from "@vitejs/plugin-vue";
 import { resolve } from "path";
 import ElementPlus from "unplugin-element-plus/vite";
 
-let app = "criminal";
+let app = "fire";
 if (process.argv.length > 3) {
   app = process.argv[process.argv.length - 1].trim();
 }