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