|
@@ -1,8 +1,10 @@
|
|
|
<script setup>
|
|
|
import { reactive, ref, watch } from "vue";
|
|
|
import { useRoute,useRouter } from "vue-router";
|
|
|
+import { useStore } from "vuex";
|
|
|
const route = useRoute();
|
|
|
const router= useRouter()
|
|
|
+const store=useStore()
|
|
|
|
|
|
let activePath = ref("/report/index");
|
|
|
watch(
|
|
@@ -21,7 +23,7 @@ const submenuEvent = (index)=>{
|
|
|
router.push('/question/list')
|
|
|
}
|
|
|
}
|
|
|
-const menuList = reactive([
|
|
|
+let menuList = reactive([
|
|
|
{
|
|
|
MenuId: 1,
|
|
|
name: "研报",
|
|
@@ -56,7 +58,8 @@ const menuList = reactive([
|
|
|
path: "/video/list",
|
|
|
icon_path: new URL('../../assets/leftNav/video-s.png', import.meta.url).href,
|
|
|
children: null,
|
|
|
- },{
|
|
|
+ },
|
|
|
+ {
|
|
|
MenuId: 6,
|
|
|
name: "问答",
|
|
|
path: "/question/list",
|
|
@@ -81,6 +84,34 @@ const menuList = reactive([
|
|
|
children: null,
|
|
|
}
|
|
|
]);
|
|
|
+
|
|
|
+//
|
|
|
+watch(
|
|
|
+ ()=>store.state.userInfo,
|
|
|
+ ()=>{
|
|
|
+ menuList.forEach(item=>{
|
|
|
+ if(item.MenuId==7){
|
|
|
+ if(store.state.userInfo.is_voice_admin==1){
|
|
|
+ item.children=[
|
|
|
+ {
|
|
|
+ MenuId:7.1,
|
|
|
+ name:'语音播报',
|
|
|
+ path:'/voice/list'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ MenuId:7.2,
|
|
|
+ name:'我的语音',
|
|
|
+ path:'/voice/mine'
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ }else{
|
|
|
+ item.children=null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+)
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<template>
|