Kaynağa Gözat

增加帮助文档跳转按钮

cxmo 1 yıl önce
ebeveyn
işleme
15a7732311
1 değiştirilmiş dosya ile 36 ekleme ve 1 silme
  1. 36 1
      src/views/update/Index.vue

+ 36 - 1
src/views/update/Index.vue

@@ -1,9 +1,12 @@
 <script setup>
 import { onMounted , ref , reactive} from 'vue';
+import { useRoute , useRouter} from"vue-router";
 import {apiLogMenu,apiLogList} from '@/api/updateLog';
-import { ElLoading } from 'element-plus'
 
 const MenuList = ref([])
+const route = useRoute()
+const router = useRouter()
+let beforeMounted = ref(false)
 let logList = ref([])
 let activeMenu = ref('')
 let listLoading = ref(false)
@@ -42,9 +45,22 @@ function changeExpand(type,index,itemIndex){
         logList.value[index].list[itemIndex].expand = !logList.value[index].list[itemIndex].expand
     }
 }
+function goHelpDoc(){
+    //获取url里的商家编码,如果有
+    //存本地里,跳转帮助文档要用到
+    const {bus_code} = route.query
+    bus_code&&localStorage.setItem('bus_code',bus_code)
+    router.push({
+        path:'/help/index',
+        query:{
+            bus_code:bus_code||''
+        }
+    })
+}
 onMounted(()=>{
     getLogMenu()
     getLogList()
+    beforeMounted.value = true
 })
 </script>
 
@@ -87,6 +103,14 @@ onMounted(()=>{
             </div>
         </div>
     </div>
+    <!-- 跳转帮助文档的按钮 -->
+    <Teleport to=".layout-header-other" v-if="beforeMounted">
+        <div class="update-header-btn" @click="goHelpDoc">
+            <el-icon color="#FFF">
+                <QuestionFilled />
+            </el-icon>
+            帮助文档</div>
+    </Teleport>
 </template>
 
 <style scoped lang="scss">
@@ -183,4 +207,15 @@ onMounted(()=>{
         }
     }
 }
+.update-header-btn{
+    display: flex;
+    align-items: center;
+    cursor: pointer;
+    gap: 10px;
+    margin-right: 48px;
+    .el-icon{
+        background-color: black;
+        border-radius: 50%;
+    }
+}
 </style>