联调 承载能力评估 40%

This commit is contained in:
GGJ
2024-03-07 19:02:49 +08:00
parent f92e820986
commit 5b296d9203
10 changed files with 227 additions and 190 deletions

View File

@@ -1,8 +1,8 @@
<template>
<component :is='config.layout.layoutMode'></component>
<component :is="config.layout.layoutMode"></component>
</template>
<script setup lang='ts'>
<script setup lang="ts">
import { reactive } from 'vue'
import { useConfig } from '@/stores/config'
import { useNavTabs } from '@/stores/navTabs'
@@ -21,7 +21,7 @@ import { isEmpty } from 'lodash-es'
import { setNavTabsWidth } from '@/utils/layout'
import { adminBaseRoutePath } from '@/router/static'
import { getRouteMenu, dictDataCache } from '@/api/auth'
import { getAreaList } from '@/api/common'
import { getAreaList, areaSelect } from '@/api/common'
import { BasicDictData } from '@/stores/interface'
import { getUserById } from '@/api/user-boot/user'
@@ -51,10 +51,11 @@ onBeforeMount(() => {
})
const init = async () => {
await Promise.all([getAreaList(), dictDataCache(), getUserById()]).then(res => {
await Promise.all([getAreaList(), dictDataCache(), getUserById(), areaSelect()]).then(res => {
dictData.state.area = res[0].data
dictData.state.basic = res[1].data
adminInfo.dataFill(res[2].data)
dictData.state.areaTree = res[3].data
})
/**
* 后台初始化请求,获取站点配置,动态路由等信息
@@ -62,11 +63,16 @@ const init = async () => {
getRouteMenu().then((res: any) => {
const handlerMenu = (data: any) => {
data.forEach((item: any) => {
item.routePath = item.routePath[0] == '/' ? item.routePath.substring(1, item.routePath.length) : item.routePath
item.routePath =
item.routePath[0] == '/' ? item.routePath.substring(1, item.routePath.length) : item.routePath
item.path = item.routePath
item.name = item.routePath
item.keepalive = item.routePath
item.component = item.routeName ? item.routeName.indexOf('/src/views/') > -1 ? item.routeName : `/src/views/${item.routeName}/index.vue` : ''
item.component = item.routeName
? item.routeName.indexOf('/src/views/') > -1
? item.routeName
: `/src/views/${item.routeName}/index.vue`
: ''
item.type = item.children && item.children.length > 0 ? 'menu_dir' : 'menu'
item.menu_type = item.children && item.children.length > 0 ? null : 'tab'
if (item.children) {