jwyu 2 years ago
parent
commit
ee581d6c22

+ 10 - 12
src/layout/component/Aside.vue

@@ -16,15 +16,9 @@ watch(
     immediate: true,
   }
 );
-const submenuEvent = (index)=>{
-  // console.log(index)
-  if(index==6){
-    //展开第一项
-    router.push('/question/list')
-  }
-  if(index==7){
-    router.push('/voice/list')
-  }
+const submenuEvent = (path)=>{
+  // console.log(path)
+  router.push(path)
 }
 let menuList = reactive([
   {
@@ -88,13 +82,13 @@ let menuList = reactive([
   }
 ]);
 
-// 
+// 设置语音播报侧边栏
 watch(
   ()=>store.state.userInfo,
   ()=>{
     menuList.forEach(item=>{
       if(item.MenuId==7){
-        if(store.state.userInfo.is_voice_admin==1){
+        if(store.state.userInfo?.is_voice_admin==1){
           item.children=[
             {
               MenuId:7.1,
@@ -112,6 +106,10 @@ watch(
         }
       }
     })
+  },
+  {
+    deep:true,
+    immediate:true
   }
 )
 
@@ -126,7 +124,7 @@ watch(
           <img class="menu-icon" :src="menu.icon_path" alt="" />
           <span class="menu-text">{{ menu.name }}</span>
         </el-menu-item>
-        <el-sub-menu :index="menu.MenuId + ''" :key="menu.MenuId+1" v-else>
+        <el-sub-menu :index="menu.path" :key="menu.MenuId" v-else>
           <template #title>
             <img class="menu-icon" :src="menu.icon_path" alt="" />
             <span class="menu-text">{{ menu.name }}</span>

+ 6 - 2
src/style/global.scss

@@ -14,6 +14,10 @@ body,
   // min-width: 1024px;
 }
 
+:root{
+  --el-color-primary:#F3A52F;
+}
+
 // 禁止页面打印
 @media print{
   body{
@@ -110,9 +114,9 @@ img {
 }
 
 .self-elmessage-confirm-btn {
-  background-color: #F3A52F;
+  background-color: #F3A52F !important;
   color: #fff;
-  border: none;
+  border: none !important;
   width: 90px;
 
   &:hover {

+ 1 - 1
src/utils/interceptRouterMethod.js

@@ -59,7 +59,7 @@ router.push = function push(location) {
                 router.replace(path)
             }
         }, 10);
-        return
+        // return
     }
 
 

+ 4 - 6
src/utils/reportErr.js

@@ -3,26 +3,24 @@ import {apiReportingErrInfo} from '@/api/common'
 
 const reportErr=(app)=>{
     let errObj={}
-    console.log();
     app.config.errorHandler=(err, instance, info)=>{
-        console.log(err, instance, info);
+        console.error(err)
         errObj={
             msg:err.message,
             stack:err.stack
         }
-        console.log(errObj);
-        if(import.meta.env.MODE!=='development'){
+        if(import.meta.env.MODE==='production'){
             apiReportingErrInfo({errInfo:errObj})
         }
     }
 
     window.addEventListener('error',(e)=>{
-        console.log(e);
+        console.error(e)
         errObj={
             msg:e.error?.message,
             stack:e.error?.stack
         }
-        if(import.meta.env.MODE!=='development'){
+        if(import.meta.env.MODE==='production'){
             apiReportingErrInfo({errInfo:errObj})
         }
     })

+ 2 - 6
src/views/question/List.vue

@@ -9,7 +9,6 @@ import {apiGetTagTree} from "@/api/common"
 import { apiApplyPermission } from '@/api/user'
 import{ref,reactive} from "vue"
 import {onBeforeRouteLeave,useRouter} from "vue-router"
-import { useElementSize } from '@vueuse/core'
 import {ElMessage,ElMessageBox} from "element-plus"
 import SelfList from '@/components/SelfList.vue'
 import {useStore} from "vuex"
@@ -21,9 +20,6 @@ const store = useStore()
 const router = useRouter()
 
 moment.locale('zh-cn');
-//监听列表页面版心宽度
-const listPageEl=ref('')
-const {width}=useElementSize(listPageEl)
 
 const askForm = ref(null)
 
@@ -315,8 +311,8 @@ const setCancelNickHandle = async() => {
   </div>
   <!-- 有权限 -->
   <template v-if="question.isAuthor == 1 && question.isFinish"> 
-    <div class="question-list-container" ref="listPageEl" >
-        <div class="top-nav-box" :style="{width:width+'px'}">
+    <div class="question-list-container">
+        <div class="top-nav-box" >
             <div class="first-nav-box">
                 <span 
                     v-for="item in question.optionList" 

+ 2 - 6
src/views/question/MyList.vue

@@ -13,16 +13,12 @@ import {useStore} from 'vuex'
 import {ElMessageBox} from "element-plus"
 import SelfList from '@/components/SelfList.vue'
 import {onBeforeRouteLeave,useRouter} from "vue-router"
-import { useElementSize } from '@vueuse/core'
 import moment from 'moment';
 
 const store = useStore()
 const router = useRouter()
 
 moment.locale('zh-cn');
-//监听列表页面版心宽度
-const listPageEl=ref('')
-const {width}=useElementSize(listPageEl)
 
 const askForm = ref(null)
 
@@ -324,8 +320,8 @@ getBarList()
     </div>
   </div>
   <template v-if="question.isAuthor == 1 && question.isFinish"> 
-    <div class="my-questionList-contain" ref="listPageEl">
-      <div class="top-tabbar-box" :style="{width:width+'px'}">
+    <div class="my-questionList-contain">
+      <div class="top-tabbar-box">
         <div class="top-tabbar-row" >
           <div v-for="item in question.barList" :key="item.key" @click="changeTopTar(item.key)"
           :class="['top-tabbar-item',item.key == question.selectKey?'tabbar-active':'']">