Przeglądaj źródła

fix:修改-股东信息导出时间名称

贾宇博 2 miesięcy temu
rodzic
commit
4c509e9d3f
1 zmienionych plików z 13 dodań i 3 usunięć
  1. 13 3
      src/views/Shareholders/Information/index.vue

+ 13 - 3
src/views/Shareholders/Information/index.vue

@@ -335,14 +335,24 @@ function handleDelete(row) {
     }).catch(() => { });
     }).catch(() => { });
 }
 }
 
 
+/** 导出按钮操作 */
 /** 导出按钮操作 */
 /** 导出按钮操作 */
 function handleExport() {
 function handleExport() {
+    // 获取当前时间
+    const now = new Date();
+    // 格式化时间为 YYYYMMDD_HHmmss
+    const formattedTime = `${now.getFullYear()}${String(now.getMonth() + 1).padStart(2, '0')}${String(now.getDate()).padStart(2, '0')}_${String(now.getHours()).padStart(2, '0')}${String(now.getMinutes()).padStart(2, '0')}${String(now.getSeconds()).padStart(2, '0')}`;
+    // 生成文件名
+    const fileName = `股东信息_${formattedTime}.xlsx`;
+
+    console.log("格式化时间:", formattedTime); // 打印格式化时间
+    console.log("生成的文件名:", fileName); // 打印生成的文件名
+
+    // 调用下载方法
     proxy.download('/equity/info/exportEquityInfo', {
     proxy.download('/equity/info/exportEquityInfo', {
         ...queryParams.value
         ...queryParams.value
-    }, `info_${new Date().getTime()}.xlsx`)
+    }, fileName);
 }
 }
-
-
 /**导入 */
 /**导入 */
 function handleImport() {
 function handleImport() {
     upload.title = "用户导入";
     upload.title = "用户导入";