fix(system): 修复新增菜单未选择父菜单时的提交问题- 在提交菜单表单时,如果未选择父菜单,将 parent 字段设置为 null
-确保在更新或添加菜单时,父菜单字段的值是正确的
This commit is contained in:
@@ -254,6 +254,9 @@ const handleSubmit = () => {
|
|||||||
let res;
|
let res;
|
||||||
menuBtnLoading.value = true;
|
menuBtnLoading.value = true;
|
||||||
if (menuFormData.id) {
|
if (menuFormData.id) {
|
||||||
|
if (menuFormData.parent == undefined) {
|
||||||
|
menuFormData.parent = null
|
||||||
|
}
|
||||||
res = await UpdateObj(menuFormData);
|
res = await UpdateObj(menuFormData);
|
||||||
} else {
|
} else {
|
||||||
res = await AddObj(menuFormData);
|
res = await AddObj(menuFormData);
|
||||||
|
|||||||
Reference in New Issue
Block a user