Просмотр исходного кода

村庄规划成果包下载名称修改

wanger 5 месяцев назад
Родитель
Сommit
92f4cb5b3f
2 измененных файлов с 13 добавлено и 1 удалено
  1. 10 0
      website/src/utils/index.js
  2. 3 1
      website/src/views/ghcgscygl/ghcgsb/xxgh/Czgh/Qxyh.vue

+ 10 - 0
website/src/utils/index.js

@@ -1,5 +1,15 @@
 import { parseTime } from "./ruoyi";
 
+/**
+ * 通过文件路径获取文件名
+ */
+export function getFileName(filepath) {
+  filepath = filepath.replaceAll("\\", "/");
+  let list = filepath.split("/")
+  return list[list.length - 1]
+}
+
+
 /**
  * 表格时间格式化
  */

+ 3 - 1
website/src/views/ghcgscygl/ghcgsb/xxgh/Czgh/Qxyh.vue

@@ -196,6 +196,7 @@ import { socket } from "@/utils/websocket.js";
 import { reactive, toRefs, ref } from "@vue/reactivity";
 import { getCurrentInstance, onMounted, watch } from "@vue/runtime-core";
 import { GetXzq } from "@/api/homeApi.js";
+import { getFileName } from "@/utils/index.js";
 import { scmxlist, startczghcgsc } from "@/api/ghcgysc/cggl.js";
 import { Getlist, ReportSubmit, Delete } from "@/api/ghcgysc/czghApi.js";
 import XqDialog from "@/components/ghcgscygl/ghcgsb/xxgh/czgh/Qxyh/xqDialog.vue";
@@ -485,7 +486,8 @@ export default {
         proxy.download(
           "/apply/xzczghcgsb/downloadZip",
           params,
-          qxyh.tableData[index].fileName
+          getFileName(qxyh.tableData[index].filePath)
+          // qxyh.tableData[index].fileName
         );
       },
       // 获取列表数据