diff --git a/src/views/erp/product/category/index.vue b/src/views/erp/product/category/index.vue index daf9407d..eab93d80 100644 --- a/src/views/erp/product/category/index.vue +++ b/src/views/erp/product/category/index.vue @@ -185,7 +185,9 @@ const resetQuery = () => { /** 添加/修改操作 */ const formRef = ref() const openForm = (type: string, id?: number) => { - formRef.value.open(type, id) + const currentType = queryParams.type ?? (activeTab.value ? Number(activeTab.value) : undefined) + const defaultData = type === 'create' && currentType !== undefined ? { type: currentType } : undefined + formRef.value.open(type, id, defaultData) } /** 删除按钮操作 */