From bf42ef43fccdf3d3486eec84ad4073b0c7650aba Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 13 八月 2025 17:35:37 +0800
Subject: [PATCH] 新增场景信息文件导入功能

---
 src/views/fysp/data-product/ProdLawEnforceList.vue |   43 ++++++++++++-------------------------------
 1 files changed, 12 insertions(+), 31 deletions(-)

diff --git a/src/views/fysp/data-product/ProdLawEnforceList.vue b/src/views/fysp/data-product/ProdLawEnforceList.vue
index 2dccfb8..940d70d 100644
--- a/src/views/fysp/data-product/ProdLawEnforceList.vue
+++ b/src/views/fysp/data-product/ProdLawEnforceList.vue
@@ -1,5 +1,6 @@
 <template>
   <FYTable
+    id="fyTable"
     @search="onSearch"
     :data="tableData"
     :pagination="false"
@@ -47,15 +48,12 @@
       </el-descriptions>
     </template>
     <template #buttons>
-      <el-button
-        icon="Download"
-        type="primary"
-        plain
-        @click="download"
-        :loading="dlLoading"
+      <FYDownloadTableButton
+        label="涓嬭浇娓呭崟"
+        table-id="fyTable"
+        :file-name="fileName"
         :disabled="downloadDisabled"
-        >涓嬭浇娓呭崟</el-button
-      >
+      ></FYDownloadTableButton>
     </template>
     <template #table-column="{ size }">
       <el-table-column fixed="left" label="搴忓彿" width="53">
@@ -160,13 +158,8 @@
 import evaluateApi from '@/api/fysp/evaluateApi';
 import problemApi from '@/api/fysp/problemApi';
 import sceneApi from '@/api/fysp/sceneApi';
-import { conversionFromTable } from "@/utils/excel";
 import { envCreditCode } from '@/constants/index';
 import { useTablePaste } from '@/composables/tablePaste';
-import { useCloned } from '@vueuse/core';
-import { useMessageBoxTip } from '@/composables/messageBox';
-import * as XLSX from 'xlsx';
-import FileSaver from 'file-saver';
 
 export default {
   setup() {
@@ -239,6 +232,12 @@
         });
         return b;
       }
+    },
+    fileName() {
+      const { locations, scenetype, time } = this.formSearch;
+      return `${locations.dName}${dayjs(time).format(
+        'YYYY骞碝M鏈�'
+      )}鑱斿悎鎵ф硶娓呭崟`;
     }
   },
   methods: {
@@ -327,24 +326,6 @@
       const property = column['property'];
       return row[property] === value;
     },
-    download() {
-      // const workbook = XLSX.utils.book_new();
-      // const worksheet = XLSX.utils.json_to_sheet(this.tableData);
-      // XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
-      // const excelData = XLSX.write(workbook, {
-      //   bookType: 'xlsx',
-      //   type: 'array'
-      // });
-      // const blob = new Blob([excelData], {
-      //   type: 'application/vnd.openxmlformats-officedocumnet.spreadsheetml.sheet'
-      // });
-      const { locations, scenetype, time } = this.formSearch;
-      const name = `${locations.dName}${dayjs(time).format(
-        'YYYY骞碝M鏈�'
-      )}鑱斿悎鎵ф硶娓呭崟.xlsx`;
-      // FileSaver.saveAs(blob, name);
-      conversionFromTable('fyTable', name)
-    }
   },
   mounted() {
     this.addRefreshEvent(this.$refs.tableRef.doLayout);

--
Gitblit v1.9.3