|
@@ -8,6 +8,7 @@ import { reactive, ref, onMounted, h } from "vue";
|
|
|
import type { FormItemProps } from "../utils/types";
|
|
import type { FormItemProps } from "../utils/types";
|
|
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
|
|
import { cloneDeep, isAllEmpty, deviceDetection } from "@pureadmin/utils";
|
|
import { cloneDeep, isAllEmpty, deviceDetection } from "@pureadmin/utils";
|
|
|
|
|
+import { initRouter } from "@/router/utils";
|
|
|
import Sortable from "sortablejs";
|
|
import Sortable from "sortablejs";
|
|
|
|
|
|
|
|
export function useMenu() {
|
|
export function useMenu() {
|
|
@@ -303,6 +304,12 @@ export function useMenu() {
|
|
|
try {
|
|
try {
|
|
|
await updateMenuSort(sortData);
|
|
await updateMenuSort(sortData);
|
|
|
message("排序更新成功", { type: "success" });
|
|
message("排序更新成功", { type: "success" });
|
|
|
|
|
+ // 刷新侧边栏路由顺序
|
|
|
|
|
+ try {
|
|
|
|
|
+ await initRouter();
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error("侧边栏路由刷新失败:", e);
|
|
|
|
|
+ }
|
|
|
} catch {
|
|
} catch {
|
|
|
message("排序更新失败", { type: "error" });
|
|
message("排序更新失败", { type: "error" });
|
|
|
}
|
|
}
|