fix(projects): fix manage page drawer operate about data reset. fixed #415, fixed #417

This commit is contained in:
Soybean
2024-05-05 00:41:50 +08:00
parent 734ef9852c
commit f4513e1e38
4 changed files with 16 additions and 22 deletions

View File

@ -1,6 +1,7 @@
import { computed, effectScope, onScopeDispose, reactive, ref, watch } from 'vue';
import type { Ref } from 'vue';
import type { PaginationProps } from 'naive-ui';
import { cloneDeep } from 'lodash-es';
import { useBoolean, useHookTable } from '@sa/hooks';
import { useAppStore } from '@/store/modules/app';
import { $t } from '@/locales';
@ -186,7 +187,8 @@ export function useTableOperate<T extends TableData = TableData>(data: Ref<T[]>,
function handleEdit(id: T['id']) {
operateType.value = 'edit';
editingData.value = data.value.find(item => item.id === id) || null;
const findItem = data.value.find(item => item.id === id) || null;
editingData.value = cloneDeep(findItem);
openDrawer();
}