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 @@