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(); + } + }); +}