提交 dfd703a0 authored 作者: 刘旭's avatar 刘旭

修改空白tabs名称问题

上级 5ec4dff0
......@@ -7,7 +7,7 @@
</el-menu>
</template>
<script setup lang="ts">
import { reactive, computed } from 'vue'
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import { useStore } from '@/store/index'
import MenuItem from './MenuItem.vue'
......@@ -25,136 +25,10 @@ const activeIdex = computed(() => {
})
//菜单数据
const menuList = computed(() => {
console.log(store.getters['menu/getMenuList']);
return store.getters['menu/getMenuList']
})
// let menuList = reactive([
// {
// path: '/dashboard',
// component: "Layout",
// meta: {
// title: "首页",
// icon: "HomeFilled",
// roles: ["sys:manage"]
// },
// children: []
// },
// {
// path: "/system",
// component: "Layout",
// alwaysShow: true,
// name: "system",
// meta: {
// title: "系统管理",
// icon: "Menu",
// roles: ["sys:manage"],
// parentId: 0,
// },
// children: [
// {
// path: "/department",
// component: "/system/department/department",
// alwaysShow: false,
// name: "department",
// meta: {
// title: "机构管理",
// icon: "Platform",
// roles: ["sys:dept"],
// parentId: 17,
// },
// },
// {
// path: "/userList",
// component: "/system/User/UserList",
// alwaysShow: false,
// name: "userList",
// meta: {
// title: "用户管理",
// icon: "el-icon-s-custom",
// roles: ["sys:user"],
// parentId: 17,
// },
// },
// {
// path: "/roleList",
// component: "/system/Role/RoleList",
// alwaysShow: false,
// name: "roleList",
// meta: {
// title: "角色管理",
// icon: "el-icon-s-tools",
// roles: ["sys:role"],
// parentId: 17,
// },
// },
// {
// path: "/menuList",
// component: "/system/Menu/MenuList",
// alwaysShow: false,
// name: "menuList",
// meta: {
// title: "权限管理",
// icon: "el-icon-document",
// roles: ["sys:menu"],
// parentId: 17,
// },
// },
// ],
// },
// {
// path: "/goods",
// component: "Layout",
// alwaysShow: true,
// name: "goods",
// meta: {
// title: "商品管理",
// icon: "el-icon-document",
// roles: ["sys:goods"],
// parentId: 0,
// },
// children: [
// {
// path: "/goodCategory",
// component: "/goods/goodsCategory/goodsCategoryList",
// alwaysShow: false,
// name: "goodCategory",
// meta: {
// title: "商品分类",
// icon: "el-icon-document",
// roles: ["sys:goodsCategory"],
// parentId: 34,
// },
// },
// ],
// },
// {
// path: "/systenConfig",
// component: "Layout",
// alwaysShow: true,
// name: "systenConfig",
// meta: {
// title: "系统工具",
// icon: "el-icon-document",
// roles: ["sys:systenConfig"],
// parentId: 0,
// },
// children: [
// {
// path: "/document",
// component: "/system/config/systemDocument",
// alwaysShow: false,
// name: "http://42.193.158.170:8089/swagger-ui/index.html",
// meta: {
// title: "接口文档",
// icon: "el-icon-document",
// roles: ["sys:document"],
// parentId: 42,
// },
// },
// ],
// },
// ]);
const isCollapse = computed(() => {
// return store.getters['getCollapse']
return store.getters['menu/getCollapse']
......
......@@ -54,6 +54,8 @@ const addTab = () => {
path: path,
title: meta.title as string
}
// 路径不在后台,手动判断添加tabs名称
if (tab.path === '/manage/fieldConfiguration') tab.title = '场景配置'
// store.commit('addTabe', tab);
store.commit('tabs/addTabe', tab)
}
......
......@@ -3,7 +3,6 @@ import { RouteRecordRaw } from "vue-router";
import { ActionContext } from "vuex";
import { RootState } from "..";
import Layout from "@/layout/index.vue";
import { store } from "@/store";
const modules = import.meta.glob("../../views/**/*.vue");
//定义state
export type MenuState = {
......@@ -39,6 +38,8 @@ export const mutations = {
},
setMenuList: (state: MenuState, menuList: Array<RouteRecordRaw>) => {
state.menuList = state.menuList.concat(menuList);
console.log(state.menuList);
},
reSetList: (state: MenuState, menuList: Array<RouteRecordRaw>) => {
......@@ -60,6 +61,7 @@ export const actions = {
if (res.code == 200) {
//动态生成路由
accessedRoutes = filterAsyncRoutes(res.data, router);
console.log(accessedRoutes);
//设置到menuList
commit("setMenuList", accessedRoutes);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论