|
@@ -28,6 +28,7 @@
|
|
|
setup(_, { emit }) {
|
|
|
const isUpdate = ref(true);
|
|
|
const tData = ref<TreeMenuNode[]>([]);
|
|
|
+ const menuId = ref(0);
|
|
|
|
|
|
const [registerForm, { resetFields, setFieldsValue, updateSchema, validate }] = useForm({
|
|
|
labelWidth: 100,
|
|
@@ -42,6 +43,8 @@
|
|
|
isUpdate.value = !!data?.isUpdate;
|
|
|
|
|
|
if (unref(isUpdate)) {
|
|
|
+ console.log('data.record', data.record.menuId);
|
|
|
+ menuId.value = data.record.menuId;
|
|
|
setFieldsValue({
|
|
|
...data.record,
|
|
|
});
|
|
@@ -78,6 +81,7 @@
|
|
|
if (!unref(isUpdate)) {
|
|
|
await saveMenuApi(values);
|
|
|
} else {
|
|
|
+ values.menuId = menuId.value;
|
|
|
await updateMenuApi(values);
|
|
|
}
|
|
|
|