From b8d63989635bc9fb58357f76333796e21409985b Mon Sep 17 00:00:00 2001 From: yangys <y_ys79@sina.com> Date: 星期六, 13 一月 2024 22:29:17 +0800 Subject: [PATCH] 设备类型管理1 --- src/container/home/index.vue | 51 +++++++++++++++++++++++++++++---------------------- 1 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/container/home/index.vue b/src/container/home/index.vue index 8053e10..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')"> @@ -34,12 +34,12 @@ <span> 鎶ヨ〃鐢熸垚<i class="el-icon-caret-bottom"></i> </span> - <ul v-if="showSub"> + <!-- <ul v-if="showSub"> <li>2鍘�</li> <li>2鍘�</li> <li>2鍘�</li> <li>2鍘�</li> - </ul> + </ul> --> </li> <li :class="activeId ==='6' ? 'active' : ''" @click="navigateTo('6')">鐝璁剧疆</li> <li :class="activeId ==='7' ? 'active' : ''" @click="navigateTo('7')">宸ヤ欢淇℃伅</li> @@ -49,9 +49,7 @@ </span> <ul v-if="showSub"> <li @click="navigateTo('ledger')">鍙拌处</li> - <li>2鍘�</li> - <li>2鍘�</li> - <li>2鍘�</li> + <li @click="navigateTo('deviceType')">璁惧绫诲瀷绠$悊</li> </ul> </li> </ul> @@ -92,31 +90,40 @@ navigateTo (name,v) { let routers = { 2: 'map', - 3: 'workshop', + workshop: 'workshop', 4: 'maintenance', 7: 'component', ledger: 'ledger', + deviceType: 'deviceType', } - console.log(name, '>>>>>>>') - if (name === this.activeId) { - this.showSub = !this.showSub - } else { - this.showSub = true - } + if (['3','5','8'].includes(name)) { + if (name === this.activeId) { + this.showSub = !this.showSub + } else { + this.showSub = true + } this.activeId = name - console.log(v) - this.$router.push({name: routers[name],params: {id: v.id},query: { - ...v - }}) - this.$nextTick(() => { - this.showSub = false - }) + // 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