From 9ee1f1090eabfd1b9fd6f3d42ea6665fbec3647b Mon Sep 17 00:00:00 2001 From: Seven Date: Mon, 22 Dec 2025 00:46:16 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E8=A1=A8=E5=8D=95=E5=8F=8A=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/rwa/product/components/add.vue | 5 +- src/views/rwa/product/components/edit.vue | 111 ++++++++++++++++++++++ src/views/rwa/product/index.vue | 35 +++++-- 3 files changed, 143 insertions(+), 8 deletions(-) create mode 100644 src/views/rwa/product/components/edit.vue diff --git a/src/views/rwa/product/components/add.vue b/src/views/rwa/product/components/add.vue index 536a9b7..1cd186d 100644 --- a/src/views/rwa/product/components/add.vue +++ b/src/views/rwa/product/components/add.vue @@ -24,7 +24,10 @@ const form = ref({ name: '', code: '', categoryId: '', - description: '' + description: '', + estimatedValue: '', + totalSupplyLimit: '', + proofDocuments: '' }); const rules: FormRules = { diff --git a/src/views/rwa/product/components/edit.vue b/src/views/rwa/product/components/edit.vue new file mode 100644 index 0000000..29b13ab --- /dev/null +++ b/src/views/rwa/product/components/edit.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/src/views/rwa/product/index.vue b/src/views/rwa/product/index.vue index 0a74933..2649632 100644 --- a/src/views/rwa/product/index.vue +++ b/src/views/rwa/product/index.vue @@ -6,6 +6,7 @@ import { client, safeClient } from '@/service/api'; import type { TableBaseColumns, TableFetchData, TableFilterColumns, TableInst } from '@/components/table'; import { RwaStatusEnum } from '@/enum'; import Add from './components/add.vue'; +import Edit from './components/edit.vue'; const dialog = useDialog(); const message = useMessage(); @@ -100,14 +101,14 @@ const columns: TableBaseColumns = [ ); tableInst.value?.reload(); } + }, + { + contentText: '编辑', + size: 'small', + onClick: () => { + handleEdit(row); + } } - // { - // contentText: '编辑', - // size: 'small', - // onClick: () => { - // tableInst.value?.reload(); - // } - // } ] } ]; @@ -146,6 +147,26 @@ function handleAdd() { } }); } + +function handleEdit(row: any) { + const dialogInstance = dialog.create({ + title: '编辑产品', + content: () => + h(Edit, { + data: row, + onClose: () => { + dialogInstance.destroy(); + tableInst.value?.reload(); + } + }), + style: { width: '600px' }, + showIcon: false, + onPositiveClick: () => { + message.success('更新成功'); + tableInst.value?.reload(); + } + }); +}