From 0db9c78a6a839c9fcf98df7184cbacda89aef219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com> Date: Tue, 14 Oct 2025 17:15:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E7=9A=84=E5=88=9D=E5=A7=8B=E5=8C=96=E5=9B=9E?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/hTable/hTable.ts | 3 +++ src/components/hTable/hTableEdit.vue | 3 +++ src/views/admin/index.vue | 10 +++++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/hTable/hTable.ts b/src/components/hTable/hTable.ts index 3de9845..00412b4 100644 --- a/src/components/hTable/hTable.ts +++ b/src/components/hTable/hTable.ts @@ -1,3 +1,4 @@ +import { Ref } from "vue"; import { array } from "vue-types"; export interface Dialog { @@ -329,6 +330,8 @@ export interface TableConfig { searchCallback?: (s: SearchConditions) => void; /** 新增/修改回调函数 */ editCallback?: (from: any) => void; + /** 编辑表单初始化回调函数 */ + editInitCallback?: (from: Ref>) => void; /** 展开行的回调 */ expandChange?: (row: any, expandedRows: any[]) => void; /** API地址 */ diff --git a/src/components/hTable/hTableEdit.vue b/src/components/hTable/hTableEdit.vue index 0eeaf0a..3df60df 100644 --- a/src/components/hTable/hTableEdit.vue +++ b/src/components/hTable/hTableEdit.vue @@ -46,6 +46,9 @@ onMounted(() => { intiColumn(); fetchInitData(); fetchFormData(); + //回调 + if (editData.value.table.editInitCallback) + editData.value.table.editInitCallback(column); }); function execute(obj, btn) { diff --git a/src/views/admin/index.vue b/src/views/admin/index.vue index 4c21d29..283167b 100644 --- a/src/views/admin/index.vue +++ b/src/views/admin/index.vue @@ -69,13 +69,13 @@ const tableData: TableConfig = intTableData({ { topBtn: true, // 头部按钮 label: "导入", - click:entryAdminnfo, + click: entryAdminnfo, btnStyle: "info", // topBtn: true才生效 success danger }, { topBtn: true, // 头部按钮 label: "导入模板", - click:DwImportTemplate, + click: DwImportTemplate, btnStyle: "info", // topBtn: true才生效 success danger }, ], @@ -149,16 +149,16 @@ function entryAdminnfo(eid: number) { const url = res && window.URL.createObjectURL(res); const link = document.createElement("a"); link.href = url; - link.setAttribute("download","导入失败管理员信息.xlsx"); + link.setAttribute("download", "导入失败管理员信息.xlsx"); document.body.appendChild(link); link.click(); document.body.removeChild(link); ElMessage.warning("导入失败,已导出错误数据"); }; - + try { fileE.click(); - } catch (error) { } + } catch (error) {} } function DwImportTemplate(obj, row, callBack) { const baseUrl = import.meta.env.VITE_API_BASEURL;