From 14e02654e0545ee69456d64aef2f35c7c219d708 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Fri, 07 May 2021 11:26:49 +0800
Subject: [PATCH] 地图模式设备状态修改
---
src/page/index/top/top-menu.vue | 156 +++++++++++++++++++++++++++++++---------------------
1 files changed, 93 insertions(+), 63 deletions(-)
diff --git a/src/page/index/top/top-menu.vue b/src/page/index/top/top-menu.vue
index 3af35f2..a5b8fad 100644
--- a/src/page/index/top/top-menu.vue
+++ b/src/page/index/top/top-menu.vue
@@ -1,25 +1,36 @@
<template>
<div class="top-menu">
- <el-menu :default-active="activeIndex"
- mode="horizontal"
- text-color="#333">
- <el-menu-item index="0" @click.native="openHome(itemHome)" key="0">
+ <el-menu :default-active="activeIndex" mode="horizontal" text-color="#333">
+ <el-menu-item index="0" @click.native="openHome(dataItem)" key="0">
<template slot="title">
- <i :class="itemHome.source"></i>
- <span>{{generateTitle(itemHome)}}</span>
+ <i style="font-size: 20px!important;" :class="dataItem.source" :title="dataItem.name"></i>
</template>
</el-menu-item>
- <el-menu-item index="0" @click.native="openHomes(ZHAJ)" key="0">
+ <el-menu-item index="1" @click.native="openHome(mapItem)" key="0">
<template slot="title">
- <i :class="ZHAJ.source"></i>
- <span>{{generateTitle(ZHAJ)}}</span>
+ <i style="font-size: 20px!important;" :class="mapItem.source" :title="mapItem.name"></i>
</template>
</el-menu-item>
- <template v-for="(item,index) in items">
- <el-menu-item :index="item.id+''" @click.native="openMenu(item)" :key="index">
+ <el-menu-item index="2" @click.native="openHome(cardItem)" key="0">
+ <template slot="title">
+ <i style="font-size: 20px!important;" :class="cardItem.source" :title="cardItem.name"></i>
+ </template>
+ </el-menu-item>
+ <!-- <el-menu-item index="0" @click.native="openHomes(ZHAJ)" key="0">-->
+ <!-- <template slot="title">-->
+ <!-- <i :class="ZHAJ.source"></i>-->
+ <!-- <span>{{generateTitle(ZHAJ)}}</span>-->
+ <!-- </template>-->
+ <!-- </el-menu-item>-->
+ <template v-for="(item, index) in items">
+ <el-menu-item
+ :index="item.id + ''"
+ @click.native="openMenu(item)"
+ :key="index"
+ >
<template slot="title">
- <i :class="item.source" style="padding-right: 5px;"></i>
- <span>{{generateTitle(item)}}</span>
+ <i :class="item.source" style="padding-right: 5px"></i>
+ <span>{{ generateTitle(item) }}</span>
</template>
</el-menu-item>
</template>
@@ -28,58 +39,77 @@
</template>
<script>
- import {mapGetters} from "vuex";
+import { mapGetters } from "vuex";
- export default {
- name: "top-menu",
- data() {
- return {
- itemHome: {
- name: '首页',
- source: 'el-icon-menu',
- },
- ZHAJ: {
- name: '智慧安检',
- source: 'el-icon-menu',
- },
- activeIndex: "0",
- items: [],
- };
+export default {
+ name: "top-menu",
+ data() {
+ return {
+ dataItem: {
+ name: "数据模式",
+ source: "el-icon-s-data",
+ path: "/wel/index",
+ },
+ mapItem: {
+ name: "地图模式",
+ source: "el-icon-location",
+ path: "/welcomeData/map",
+ },
+ cardItem: {
+ name: "卡片模式",
+ source: "el-icon-menu",
+ path: "/welcomeData/card",
+ },
+ ZHAJ: {
+ name: "智慧安检",
+ source: "icon-anbao",
+ },
+ activeIndex: "0",
+ items: [],
+ };
+ },
+ inject: ["index"],
+ created() {
+ this.getMenu();
+ },
+ computed: {
+ ...mapGetters(["tagCurrent", "menu"]),
+ },
+ methods: {
+ openHome(itemHome) {
+ this.index.openMenu(itemHome);
+ this.$store.state.common.liuState ++;
+ this.$router.push({
+ path: itemHome.path,
+ });
},
- inject: ["index"],
- created() {
- this.getMenu();
+ openHomes(itemHome) {
+ this.index.openMenu(itemHome);
+ this.$router.push({
+ path: this.$router.$avueRouter.getPath(
+ {
+ name: itemHome.name,
+ src:
+ "https://cas.sf-express.com/cas/login?service=http://fengkong.sf-express.com/backstageprd/#/homeInfo/infoOverview",
+ },
+ {}
+ ),
+ });
},
- computed: {
- ...mapGetters(["tagCurrent", "menu"])
+ openMenu(item) {
+ this.index.openMenu(item);
},
- methods: {
- openHome(itemHome) {
- this.index.openMenu(itemHome);
- this.$router.push({
- path: this.$router.$avueRouter.getPath({name: itemHome.name, src: ''}, {})
- });
- },
- openHomes(itemHome) {
- this.index.openMenu(itemHome);
- this.$router.push({
- path: this.$router.$avueRouter.getPath({name: itemHome.name, src: 'http://fengkong.sf-express.com/backstageprd/#/homeInfo/infoOverview'}, {})
- });
- },
- openMenu(item) {
- this.index.openMenu(item)
- },
- getMenu() {
- this.$store.dispatch("GetTopMenu").then(res => {
- this.items = res;
- });
- },
- generateTitle(item) {
- return this.$router.$avueRouter.generateTitle(
- item.name,
- (item.meta || {}).i18n
- );
- },
- }
- };
+ getMenu() {
+ this.$store.dispatch("GetTopMenu").then((res) => {
+ this.items = res;
+ });
+ },
+ generateTitle(item) {
+ return this.$router.$avueRouter.generateTitle(
+ item.name,
+ (item.meta || {}).i18n
+ );
+ },
+ },
+};
</script>
--
Gitblit v1.9.3