From 9a3166f150232e951f3c94072f7f9e474bc52fd8 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Sat, 7 Dec 2024 08:07:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(1.3.0-beta1):=20=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=B7=BB=E5=8A=A0=E5=A4=8D=E5=88=B6=E6=8C=89?= =?UTF-8?q?=E9=92=AE,=20=E4=BD=BF=E7=94=A8[=E6=9B=B4=E5=A4=9A]=E5=AF=B9?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=8C=89=E9=92=AE=E8=BF=9B=E8=A1=8C=E6=8A=98?= =?UTF-8?q?=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/common/table.ts | 10 ++ src/views/job/task/index.vue | 120 +++++++++++++----- .../task/modules/job-task-operate-drawer.vue | 4 +- 3 files changed, 97 insertions(+), 37 deletions(-) diff --git a/src/hooks/common/table.ts b/src/hooks/common/table.ts index 3e86d38..3544cfd 100644 --- a/src/hooks/common/table.ts +++ b/src/hooks/common/table.ts @@ -245,6 +245,15 @@ export function useTableOperate(data: Ref, openDrawer(); } + function handleCopy(id: T['id']) { + operateType.value = 'add'; + const findItem = data.value.find(item => item.id === id) || null; + editingData.value = jsonClone(findItem); + delete editingData.value?.id; + + openDrawer(); + } + /** the checked row keys of table */ const checkedRowKeys = ref([]); @@ -272,6 +281,7 @@ export function useTableOperate(data: Ref, handleAdd, editingData, handleEdit, + handleCopy, checkedRowKeys, onBatchDeleted, onDeleted diff --git a/src/views/job/task/index.vue b/src/views/job/task/index.vue index 9a7349e..0aa96cc 100644 --- a/src/views/job/task/index.vue +++ b/src/views/job/task/index.vue @@ -1,5 +1,5 @@