From c34bcb35a4ccb478f39f235e2e2cccbdf0336a02 Mon Sep 17 00:00:00 2001 From: gaosp <gaosp> Date: 星期五, 12 一月 2024 22:54:14 +0800 Subject: [PATCH] update --- src/container/home/index.vue | 44 +++++++++++++++++++++++++------------------- src/container/component/index.vue | 4 ++-- src/container/deviceType/index.vue | 6 +++--- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/container/component/index.vue b/src/container/component/index.vue index c463d13..29850d5 100644 --- a/src/container/component/index.vue +++ b/src/container/component/index.vue @@ -1,7 +1,7 @@ <!-- * @Date: 2024-01-06 17:40:19 * @LastEditors: Sneed - * @LastEditTime: 2024-01-07 23:34:22 + * @LastEditTime: 2024-01-12 22:44:34 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/component/index.vue --> <template> @@ -105,7 +105,7 @@ }, created () { this.init() - this.getProtocolList() + // this.getProtocolList() }, methods: { reset () { diff --git a/src/container/deviceType/index.vue b/src/container/deviceType/index.vue index c463d13..5800299 100644 --- a/src/container/deviceType/index.vue +++ b/src/container/deviceType/index.vue @@ -1,8 +1,8 @@ <!-- * @Date: 2024-01-06 17:40:19 * @LastEditors: Sneed - * @LastEditTime: 2024-01-07 23:34:22 - * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/component/index.vue + * @LastEditTime: 2024-01-12 22:44:37 + * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/deviceType/index.vue --> <template> <div class="maintenance"> @@ -105,7 +105,7 @@ }, created () { this.init() - this.getProtocolList() + // this.getProtocolList() }, methods: { reset () { diff --git a/src/container/home/index.vue b/src/container/home/index.vue index 7876258..9611b84 100644 --- a/src/container/home/index.vue +++ b/src/container/home/index.vue @@ -16,7 +16,7 @@ 杞﹂棿鍒楄〃<i class="el-icon-caret-bottom"></i> </span> <ul v-if="showSub"> - <li v-for="item in workshopList" :key="item.id" @click.stop="navigateTo('3',item)">{{ item.name }}</li> + <li v-for="item in workshopList" :key="item.id" @click.stop="navigateTo('workshop',item)">{{ item.name }}</li> </ul> </li> <li :class="activeId ==='4' ? 'active' : ''" @click="navigateTo('4')"> @@ -90,34 +90,40 @@ navigateTo (name,v) { let routers = { 2: 'map', - 3: 'workshop', + workshop: 'workshop', 4: 'maintenance', 7: 'component', ledger: 'ledger', deviceType: 'deviceType', } - if (name === this.activeId) { - this.showSub = !this.showSub - } else { - this.showSub = true - } + if (['3','5','8'].includes(name)) { - this.activeId = name - let params = {} - if (v) { - params.id = v.id + if (name === this.activeId) { + this.showSub = !this.showSub + } else { + this.showSub = true } - this.$router.push({name: routers[name],params,query: { - ...v - }}) - this.$nextTick(() => { - this.showSub = false - }) + this.activeId = name + // let param = {} + // if (v) { + // param.id = v.id + // } + // this.$router.push({name: routers[name],params: { + // id: v.id + // },query: { + // ...v + // }}) + // this.$nextTick(() => { + // this.showSub = false + // }) } else { this.activeId = name console.log(name) - // this.$router.push('/home/map') - this.$router.push({name: routers[name]}) + let params = {} + if ('workshop' === name) { + params.id = v.id + } + this.$router.push({name: routers[name],params: params}) this.$nextTick(() => { this.showSub = false }) -- Gitblit v1.9.3