修复一些路由跳转问题

This commit is contained in:
梁州 2025-05-08 16:58:18 +08:00
parent ab65f82cf4
commit 64f1067a8d
5 changed files with 5264 additions and 13809 deletions

File diff suppressed because it is too large Load Diff

View File

@ -14,9 +14,9 @@
</template> </template>
<script setup> <script setup>
import store from '@/store' import store from '@/store'
import { nextTick, ref, watch } from 'vue' import {nextTick, ref, watch} from 'vue'
import { onMounted } from 'vue'; import {onMounted} from 'vue';
import { useRouter } from 'vue-router'; import {useRouter} from 'vue-router';
const router = useRouter() const router = useRouter()
let tags = ref([]) let tags = ref([])
const scrollbar = ref() const scrollbar = ref()
@ -40,21 +40,20 @@ const closeTag = (tag) => {
} }
// //
const handleClose = (tag, index) => { const handleClose = (tag, index) => {
if (tags.value.length === 1) { // //
return if (router.currentRoute.value.path === tag.path) {
} console.log(index + ':' + tags.value.length)
closeTag(tag) // tag
if (router.path !== tag.path) {
if (index === (tags.value.length - 1)) { // , if (index === (tags.value.length - 1)) { // ,
router.push(this.tags[index].path) router.push('/home')
} else { // } else { //
if (index === 0) { if (index === 0) {
router.push(tags.value[0].path) router.push(tags.value[index + 1].path)
} else { } else {
router.push(tags.value[index - 1].path) router.push(tags.value[index - 1].path)
} }
} }
} }
closeTag(tag) // tag
} }
// tags // tags
const handleClick = (tag) => { const handleClick = (tag) => {

View File

@ -1,7 +1,8 @@
<template> <template>
<div class="menu-title">主菜单</div> <div class="menu-title">主菜单</div>
<!-- 侧边栏菜单区域 --> <!-- 侧边栏菜单区域 -->
<el-menu :default-active="route.path" active-text-color="#409Eff" background-color="#fff" text-color="#000" :router="true" unique-opened> <el-menu :default-active="route.path" active-text-color="#409Eff" background-color="#fff" text-color="#000"
:router="true" unique-opened>
<!-- 一级菜单 --> <!-- 一级菜单 -->
<el-sub-menu :index="item.id" v-for="item in menuList" :key="item.id"> <el-sub-menu :index="item.id" v-for="item in menuList" :key="item.id">
<!-- 一级菜单模板区域 --> <!-- 一级菜单模板区域 -->
@ -24,7 +25,8 @@
<script setup> <script setup>
import store from '@/store' import store from '@/store'
import { useRoute } from 'vue-router' import {useRoute} from 'vue-router'
const menuList = store.getters.getMenuList const menuList = store.getters.getMenuList
const route = useRoute() const route = useRoute()
// //

View File

@ -4,7 +4,7 @@
<div class="work-area"> <div class="work-area">
<fieldset class="search-area"> <fieldset class="search-area">
<el-form ref="stockQueryFormRef" :model="stockQuery" :label-position="labelPosition" <el-form ref="stockQueryFormRef" :model="stockQuery" :label-position="labelPosition"
label-width="158px" style="max-width: 100%" status-icon> label-width="auto" style="max-width: 100%" status-icon>
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<el-row> <el-row>
<el-form-item label="箱号"> <el-form-item label="箱号">

View File

@ -30,7 +30,8 @@
<script setup> <script setup>
import store from '@/store' import store from '@/store'
import router from '@/router' import router from '@/router'
const user = store.getters.getUserNam//
const user = store.getters.getUserName//
const token = store.getters.getToken// const token = store.getters.getToken//
// WMS // WMS
const loginToWms = () => { const loginToWms = () => {
@ -50,12 +51,10 @@ const loginToScanImage = () => {
} }
// WCS // WCS
const loginToWcs = () => { const loginToWcs = () => {
const wcsUrl = `https://cxlasrs.ecorp.cat.com/wcs/#/login?user=user&pwd=user` window.location.href = `https://cxlasrs.ecorp.cat.com/wcs/#/login?user=user&pwd=user`//
window.location.href = wcsUrl//
} }
const loginToMonitor = () => { const loginToMonitor = () => {
const mpnitorUrl = `https://cxlasrs.ecorp.cat.com?user=${user}&token=${token}` window.location.href = `https://cxlasrs.ecorp.cat.com?user=${user}&token=${token}`//
window.location.href = mpnitorUrl//
} }
</script> </script>