From 7d0a869a569bab80b371d25192a4d65fe8fc707b Mon Sep 17 00:00:00 2001 From: Seven Date: Tue, 20 Jan 2026 01:52:22 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=95=B4=E5=90=88?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=BB=84=E4=BB=B6=E5=88=B0=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E6=94=AF=E6=8C=81=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/product/components/edit.vue | 172 ++++++++++++++++++++++++++ src/views/product/index.vue | 21 +++- 2 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 src/views/product/components/edit.vue diff --git a/src/views/product/components/edit.vue b/src/views/product/components/edit.vue new file mode 100644 index 0000000..1ea9002 --- /dev/null +++ b/src/views/product/components/edit.vue @@ -0,0 +1,172 @@ + + + + + diff --git a/src/views/product/index.vue b/src/views/product/index.vue index 3a66e1c..51be5ac 100644 --- a/src/views/product/index.vue +++ b/src/views/product/index.vue @@ -5,6 +5,7 @@ import dayjs from 'dayjs'; import { client, safeClient } from '@/service/api'; import type { TableBaseColumns, TableFetchData, TableInst } from '@/components/table'; import Add from './components/add.vue'; +import Edit from './components/edit.vue'; const message = useMessage(); const dialog = useDialog(); @@ -102,7 +103,9 @@ const columns: TableBaseColumns = [ { contentText: '编辑', size: 'small', - onClick() {} + onClick() { + handleEdit(row); + } } ] } @@ -122,6 +125,22 @@ function handleAdd() { style: { width: '800px' } }); } + +function handleEdit(row: any) { + const d = dialog.create({ + title: '编辑产品', + showIcon: false, + style: { width: '800px' }, + content: () => + h(Edit, { + data: row, + onClose: () => { + d.destroy(); + tableInst.value?.reload(); + } + }) + }); +}