feat: ✨ 菜单支持获取上级菜单列表(排除按钮)
This commit is contained in:
@@ -36,10 +36,11 @@ class MenuAPI {
|
|||||||
*
|
*
|
||||||
* @returns 菜单下拉数据源
|
* @returns 菜单下拉数据源
|
||||||
*/
|
*/
|
||||||
static getOptions() {
|
static getOptions(onlyParent?: boolean) {
|
||||||
return request<any, OptionType[]>({
|
return request<any, OptionType[]>({
|
||||||
url: `${MENU_BASE_URL}/options`,
|
url: `${MENU_BASE_URL}/options`,
|
||||||
method: "get",
|
method: "get",
|
||||||
|
params: { onlyParent: onlyParent },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ function handleRowClick(row: MenuVO) {
|
|||||||
* @param menuId 菜单ID
|
* @param menuId 菜单ID
|
||||||
*/
|
*/
|
||||||
function handleOpenDialog(parentId?: number, menuId?: number) {
|
function handleOpenDialog(parentId?: number, menuId?: number) {
|
||||||
MenuAPI.getOptions()
|
MenuAPI.getOptions(true)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
menuOptions.value = [{ value: 0, label: "顶级菜单", children: data }];
|
menuOptions.value = [{ value: 0, label: "顶级菜单", children: data }];
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user