mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-14 13:13:51 +08:00
up 更新web端依赖包版本,修复潜在错误
This commit is contained in:
@@ -21,16 +21,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {
|
||||
getCurrentInstance,
|
||||
ref,
|
||||
nextTick,
|
||||
unref,
|
||||
computed,
|
||||
useAttrs,
|
||||
defineEmits,
|
||||
defineProps,
|
||||
} from 'vue';
|
||||
import { getCurrentInstance, ref, nextTick, unref, computed, useAttrs } from 'vue';
|
||||
import { basicProps } from './props';
|
||||
import startDrag from '@/utils/Drag';
|
||||
import { deepMerge } from '@/utils';
|
||||
|
||||
@@ -129,10 +129,9 @@ export const dynamicImport = (
|
||||
* 移除隐藏的菜单
|
||||
* @param menus
|
||||
*/
|
||||
export const removeHiddenMenus = (menus: RouteRecordRaw[]) => {
|
||||
const arr = [];
|
||||
export const removeHiddenMenus = (menus: any[]) => {
|
||||
const arr: any[] = [];
|
||||
for (let j = 0; j < menus.length; j++) {
|
||||
// console.log('menus[j]:' + JSON.stringify(menus[j]));
|
||||
if (menus[j].meta?.type === 3) {
|
||||
continue;
|
||||
}
|
||||
@@ -140,19 +139,13 @@ export const removeHiddenMenus = (menus: RouteRecordRaw[]) => {
|
||||
continue;
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
if (menus[j].children?.length > 0) {
|
||||
// @ts-ignore
|
||||
menus[j].children = removeHiddenMenus(menus[j].children);
|
||||
if (menus[j].children?.length === 0) {
|
||||
delete menus[j].children;
|
||||
}
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
arr.push(menus[j]);
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
return arr;
|
||||
};
|
||||
|
||||
@@ -3,9 +3,10 @@ import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
|
||||
import { RedirectRoute } from '@/router/base';
|
||||
import { PageEnum } from '@/enums/pageEnum';
|
||||
import { createRouterGuards } from './router-guards';
|
||||
import { createRouterIcon } from './router-icons';
|
||||
|
||||
// @ts-ignore
|
||||
const modules = import.meta.globEager('./modules/**/*.ts');
|
||||
const modules = import.meta.glob('./modules/**/*.ts');
|
||||
const routeModuleList: RouteRecordRaw[] = [];
|
||||
|
||||
Object.keys(modules).forEach((key) => {
|
||||
@@ -55,6 +56,7 @@ export function setupRouter(app: App) {
|
||||
app.use(router);
|
||||
// 创建路由守卫
|
||||
createRouterGuards(router);
|
||||
createRouterIcon();
|
||||
}
|
||||
|
||||
export default router;
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import { renderIcon } from '@/utils/index';
|
||||
import { renderIcon } from '@/utils';
|
||||
import * as antdIcons from '@vicons/antd';
|
||||
// import * as x5Icons from '@vicons/ionicons5';
|
||||
|
||||
export const constantRouterIcon = {};
|
||||
for (const element of Object.keys(antdIcons)) {
|
||||
constantRouterIcon[element] = renderIcon(antdIcons[element]);
|
||||
}
|
||||
|
||||
// for (const element of Object.keys(x5Icons)) {
|
||||
// constantRouterIcon[element] = renderIcon(x5Icons[element]);
|
||||
// }
|
||||
export function createRouterIcon() {
|
||||
for (const element of Object.keys(antdIcons)) {
|
||||
constantRouterIcon[element] = renderIcon(antdIcons[element]);
|
||||
}
|
||||
|
||||
// for (const element of Object.keys(x5Icons)) {
|
||||
// constantRouterIcon[element] = renderIcon(x5Icons[element]);
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import { cloneDeep } from 'lodash-es';
|
||||
import { VNode } from 'vue';
|
||||
import { DictType, useDictStore } from '@/store/modules/dict';
|
||||
import { fallbackSrc } from '@/utils/hotgo';
|
||||
import {getFileExt} from "@/utils/urlUtils";
|
||||
import { getFileExt } from '@/utils/urlUtils';
|
||||
|
||||
export const renderTooltip = (trigger, content) => {
|
||||
return h(NTooltip, null, {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="index === 2" #extra="{ extra }">
|
||||
<n-progress type="line" :percentage="extra.data" />
|
||||
<n-progress type="line" :percentage="Number(extra.data)" />
|
||||
</template>
|
||||
<template v-else-if="index === 3" #extra>
|
||||
<LoadChart ref="loadChartRef" :data-model="dataSource.load" />
|
||||
|
||||
Reference in New Issue
Block a user