Procházet zdrojové kódy

菜单箭头tubiao

Shannon_mu před 3 roky
rodič
revize
65fe85060a

+ 1 - 1
energyManagement/src/assets/css/main.scss

@@ -487,7 +487,7 @@ a {
 }
 
 // 折叠菜单栏时出现箭头图标
-.el-menu--collapse {
+.sidebar-el-menu {
     .el-submenu > .el-submenu__title > .el-submenu__icon-arrow {
         display: inline;
     }

+ 14 - 3
energyManagement/src/components/common/MenuTree.vue

@@ -3,13 +3,23 @@
         <template v-for="item in menuList">
             <el-submenu v-if="!!item.children" :index="'/' + item.linkPath" :key="item.id">
                 <template slot="title">
-                    <img :src="`${envConfig.baseImgApi}${item.menuImage}`" style="width: 14px; height: 14px; margin-right: 10px" />
+                    <img
+                        :src="`${envConfig.baseImgApi}${
+                            openArray.includes(item.linkPath) ? item.menuDynamicImage || item.menuImage : item.menuImage
+                        }`"
+                        style="width: 14px; height: 14px; margin-right: 10px"
+                    />
                     <span v-if="!collapse" slot="title">{{ item.name }}</span>
                 </template>
                 <menu-tree :menuList="item.children" :openArray="openArray" />
             </el-submenu>
             <el-menu-item v-else :index="'/' + item.linkPath" :key="item.id">
-                <img :src="`${envConfig.baseImgApi}${item.menuImage}`" style="width: 14px; height: 14px; margin-right: 10px" />
+                <img
+                    :src="`${envConfig.baseImgApi}${
+                        openArray.includes(item.linkPath) ? item.menuDynamicImage || item.menuImage : item.menuImage
+                    }`"
+                    style="width: 14px; height: 14px; margin-right: 10px"
+                />
                 <span slot="title">{{ item.name }}</span>
             </el-menu-item>
         </template>
@@ -22,7 +32,7 @@ export default {
     name: 'MenuTree',
     data() {
         return {
-            envConfig: envConfig,
+            envConfig: envConfig
         };
     },
     components: {
@@ -33,6 +43,7 @@ export default {
             return this.$route.path;
         }
     },
+    methods: {},
     props: {
         menuList: {
             type: Array,

+ 24 - 5
energyManagement/src/components/common/Sidebar.vue

@@ -18,7 +18,6 @@
                 active-text-color="#2887f2"
                 unique-opened
                 collapse-transition
-                @select="handleOpen"
                 router
                 :style="collapse ? 'width:84px' : 'width:220px'"
             >
@@ -69,12 +68,32 @@ export default {
         collapseChage() {
             this.$store.dispatch('collapse', !this.collapse);
         },
-
-        handleOpen(key, keyPath) {
-            this.openList = keyPath;
+        thisfindMen(arr, indexPath) {
+            let status = [];
+            arr.map((v) => {
+                if (v.children) {
+                    v.children.map((s) => {
+                        if ('/' + s.linkPath === indexPath) {
+                            status.push(v.linkPath, s.linkPath);
+                        }
+                    });
+                } else {
+                    if ('/' + v.linkPath === indexPath) {
+                        status.push(v.linkPath);
+                    }
+                }
+            });
+            return status;
+        }
+    },
+    watch: {
+        $route(newValue, oldValue) {
+            this.openList = this.thisfindMen(this.$store.getters['getMenuList'], newValue.path);
         }
     },
-    created() {}
+    created() {
+        this.openList = this.thisfindMen(this.$store.getters['getMenuList'], this.$route.path);
+    }
 };
 </script>
 

+ 31 - 4
energyManagement/src/components/common/Tags.vue

@@ -78,8 +78,13 @@ export default {
         // 设置标签
         setTags(route) {
             const isExist = this.tagsList.some((item) => {
+                if (route.path.indexOf('viewDetail') > -1 || route.path.indexOf('installplanView') > -1) {
+                    let itemfullpath = this.setFullPath(item.path);
+                    return itemfullpath === route.fullPath;
+                }
                 return item.path === route.fullPath;
             });
+            // debugger
             if (!isExist) {
                 if (route.path === '/') {
                     return;
@@ -87,10 +92,32 @@ export default {
                 if (this.tagsList.length >= 8) {
                     this.tagsList.shift();
                 }
-                this.tagsList.push({
-                    title: route.title || route.meta.title,
-                    path: route.fullPath
-                });
+                if (route.path.indexOf('viewDetail') > -1) {
+                    this.tagsList.push({
+                        title: route.query.deviceNo || route.meta.title,
+                        path: { path: route.path, query: { deviceId: route.query.deviceId || '', deviceNo: route.query.deviceNo || '' } }
+                    });
+                } else if (route.path.indexOf('installplanView') > -1) {
+                    this.tagsList.push({
+                        title: route.query.planName,
+                        path: { path: route.path, query: { planName: route.query.planName || '', planId: route.query.planId || '' } }
+                    });
+                } else {
+                    
+                    let tagArr = {
+                        title: route.title || route.meta.title,
+                        path: route.fullPath
+                    };
+                    if (!!route.name) {
+                        tagArr = {
+                            title: route.title || route.meta.title,
+                            path: route.fullPath,
+                            name: route.name
+                        };
+                    }
+
+                    this.tagsList.push(tagArr);
+                }
                 this.$store.dispatch('tags', this.tagsList);
             }
         }

+ 5 - 4
operationSupport/src/assets/css/main.scss

@@ -487,7 +487,7 @@ a {
 }
 
 // 折叠菜单栏时出现箭头图标
-.el-menu--collapse {
+.sidebar-el-menu {
     .el-submenu > .el-submenu__title > .el-submenu__icon-arrow {
         display: inline;
     }
@@ -512,10 +512,11 @@ a {
     }
 
     /*菜单展开*/
+    
     .el-submenu.is-opened > .el-submenu__title .el-submenu__icon-arrow {
-        -webkit-transform: rotateZ(90deg);
-        -ms-transform: rotate(90deg);
-        transform: rotateZ(90deg);
+        -webkit-transform: rotateZ(90deg)!important;
+        -ms-transform: rotate(90deg)!important;
+        transform: rotateZ(90deg)!important;
     }
 }
 

+ 14 - 3
operationSupport/src/components/common/MenuTree.vue

@@ -3,13 +3,23 @@
         <template v-for="item in menuList">
             <el-submenu v-if="!!item.children" :index="'/' + item.linkPath" :key="item.id">
                 <template slot="title">
-                    <img :src="`${envConfig.baseImgApi}${item.menuImage}`" style="width: 14px; height: 14px; margin-right: 10px" />
+                    <img
+                        :src="`${envConfig.baseImgApi}${
+                            openArray.includes(item.linkPath) ? item.menuDynamicImage || item.menuImage : item.menuImage
+                        }`"
+                        style="width: 14px; height: 14px; margin-right: 10px"
+                    />
                     <span v-if="!collapse" slot="title">{{ item.name }}</span>
                 </template>
                 <menu-tree :menuList="item.children" :openArray="openArray" />
             </el-submenu>
             <el-menu-item v-else :index="'/' + item.linkPath" :key="item.id">
-                <img :src="`${envConfig.baseImgApi}${item.menuImage}`" style="width: 14px; height: 14px; margin-right: 10px" />
+                <img
+                    :src="`${envConfig.baseImgApi}${
+                        openArray.includes(item.linkPath) ? item.menuDynamicImage || item.menuImage : item.menuImage
+                    }`"
+                    style="width: 14px; height: 14px; margin-right: 10px"
+                />
                 <span slot="title">{{ item.name }}</span>
             </el-menu-item>
         </template>
@@ -22,7 +32,7 @@ export default {
     name: 'MenuTree',
     data() {
         return {
-            envConfig: envConfig,
+            envConfig: envConfig
         };
     },
     components: {
@@ -33,6 +43,7 @@ export default {
             return this.$route.path;
         }
     },
+    methods: {},
     props: {
         menuList: {
             type: Array,

+ 24 - 7
operationSupport/src/components/common/Sidebar.vue

@@ -8,7 +8,6 @@
             <div class="text">运营支撑</div>
         </div>
         <div class="menu-wrap no-scrollbar">
-            {{ menuListsss }}
             <el-menu
                 class="sidebar-el-menu"
                 :default-active="onRoutes"
@@ -18,7 +17,6 @@
                 active-text-color="#2887f2"
                 unique-opened
                 collapse-transition
-                @select="handleOpen"
                 router
                 :style="collapse ? 'width:84px' : 'width:220px'"
             >
@@ -36,7 +34,6 @@
 </template>
 
 <script>
-import { mapState } from 'vuex';
 import MenuTree from './MenuTree.vue';
 export default {
     data() {
@@ -69,12 +66,32 @@ export default {
         collapseChage() {
             this.$store.dispatch('collapse', !this.collapse);
         },
-
-        handleOpen(key, keyPath) {
-            this.openList = keyPath;
+        thisfindMen(arr, indexPath) {
+            let status = [];
+            arr.map((v) => {
+                if (v.children) {
+                    v.children.map((s) => {
+                        if ('/' + s.linkPath === indexPath) {
+                            status.push(v.linkPath, s.linkPath);
+                        }
+                    });
+                } else {
+                    if ('/' + v.linkPath === indexPath) {
+                        status.push(v.linkPath);
+                    }
+                }
+            });
+            return status;
+        }
+    },
+    watch: {
+        $route(newValue, oldValue) {
+            this.openList = this.thisfindMen(this.$store.getters['getMenuList'], newValue.path);
         }
     },
-    created() {}
+    created() {
+        this.openList = this.thisfindMen(this.$store.getters['getMenuList'], this.$route.path);
+    }
 };
 </script>
 

+ 12 - 2
operationSupport/src/components/common/Tags.vue

@@ -103,10 +103,20 @@ export default {
                         path: { path: route.path, query: { planName: route.query.planName || '', planId: route.query.planId || '' } }
                     });
                 } else {
-                    this.tagsList.push({
+                    
+                    let tagArr = {
                         title: route.title || route.meta.title,
                         path: route.fullPath
-                    });
+                    };
+                    if (!!route.name) {
+                        tagArr = {
+                            title: route.title || route.meta.title,
+                            path: route.fullPath,
+                            name: route.name
+                        };
+                    }
+
+                    this.tagsList.push(tagArr);
                 }
                 this.$store.dispatch('tags', this.tagsList);
             }

+ 2 - 1
operationSupport/src/router/index.js

@@ -207,7 +207,8 @@ const quietRoute = [
             {
                 path: '/parkingLotAdministration',
                 component: () => import(/* webpackChunkName: "404" */ '@views/parkingLotAdministration'),
-                meta: { title: '车位管理' }
+                meta: { title: '车位管理' },
+                name:"parkingLot"
             }
             , {
                 path: '/parkingLotAdministration/pageJump/partitionManagement',

+ 6 - 2
operationSupport/src/views/parkingLotAdministration/garageList.vue

@@ -7,8 +7,12 @@
             </el-select>
             <el-button type="primary" @click="mixins_search" class="search-btn" icon="el-icon-search">查询 </el-button>
             <div class="search-icon">
-                <i class="iconfont" @click="deleteRow" v-txt-tip data-txt="删除">&#xe63b;</i>
-                <i class="iconfont" @click="addOrEdit('add')" v-left-txt-tip data-txt="新增">&#xe641;</i>
+                <el-tooltip class="item" effect="light" placement="bottom" content="新增">
+                    <i class="zoniot_font zoniot-icon-tianjia2" @click="addOrEdit('add')"></i>
+                </el-tooltip>
+                <el-tooltip class="item" effect="light" placement="bottom" content="删除">
+                    <i class="zoniot_font zoniot-icon-shanchu2" @click="deleteRow"></i>
+                </el-tooltip>
             </div>
         </div>
         <div>

+ 1 - 0
operationSupport/src/views/parkingLotAdministration/index.vue

@@ -16,6 +16,7 @@ import parkingSpaceList from './parkingSpaceList.vue';
 import garageList from './garageList.vue';
 
 export default {
+    name:'parkingLot',
     data() {
         return {
             selectName: 'parkingLot',

+ 20 - 3
operationSupport/src/views/parkingLotAdministration/pageJump/partitionManagement.vue

@@ -4,9 +4,15 @@
             <el-input v-model="mixins_query.areaName" clearable placeholder="分区名称" class="search-input"></el-input>
             <el-button type="primary" @click="mixins_search" clearable class="search-btn" icon="el-icon-search">查询 </el-button>
             <div class="search-icon">
-                <!-- 删除 新增 -->
-                <i class="iconfont" @click="addOrEdit('add')" v-left-txt-tip data-txt="新增">&#xe641;</i>
-                <i class="iconfont" @click="deleteRow" v-txt-tip data-txt="删除">&#xe63b;</i>
+                <el-tooltip class="item" effect="light" placement="bottom" content="新增">
+                    <i class="zoniot_font zoniot-icon-tianjia2" @click="addOrEdit('add')"></i>
+                </el-tooltip>
+                <el-tooltip class="item" effect="light" placement="bottom" content="删除">
+                    <i class="zoniot_font zoniot-icon-shanchu2" @click="deleteRow"></i>
+                </el-tooltip>
+                <el-tooltip class="item" effect="light" placement="bottom" content="返回">
+                    <i class="zoniot_font zoniot-icon-fanhui" @click="close()"></i>
+                </el-tooltip>
             </div>
         </div>
         <div>
@@ -159,6 +165,17 @@ export default {
         },
         selectionChange(val) {
             this.selectRow = val;
+        },
+        close() {
+            let activeRout = this.$route;
+            let tagsList = this.$store.getters['getTagsList'];
+            tagsList.forEach((item, index) => {
+                if (item.title == activeRout.meta.title || item.path == activeRout.path) {
+                    tagsList.splice(index, 1);
+                    history.go(-1);
+                    return true;
+                }
+            });
         }
     },
     created() {

+ 6 - 3
operationSupport/src/views/parkingLotAdministration/parkingSpaceList.vue

@@ -19,9 +19,12 @@
                 <!-- <i class="iconfont">&#xe6fc;</i> -->
             </el-button>
             <div class="search-icon">
-                <!-- 删除 新增 -->
-                <i class="iconfont" @click="deleteRow" v-txt-tip data-txt="删除">&#xe63b;</i>
-                <i class="iconfont" @click="addOrEdit('add')" v-left-txt-tip data-txt="新增">&#xe641;</i>
+                <el-tooltip class="item" effect="light" placement="bottom" content="新增">
+                    <i class="zoniot_font zoniot-icon-tianjia2" @click="addOrEdit('add')"></i>
+                </el-tooltip>
+                <el-tooltip class="item" effect="light" placement="bottom" content="删除">
+                    <i class="zoniot_font zoniot-icon-shanchu2" @click="deleteRow"></i>
+                </el-tooltip>
             </div>
         </div>
         <div>

+ 2 - 2
operationSupport/vue.config.js

@@ -33,8 +33,8 @@ module.exports = {
                 viewportWidth: 1920,//传参
             })
         // 配置每次打包浏览器缓存文件名的随机性
-        const filename = path.posix.join('js', `${new Date().getTime()}_[name].js`);
-        config.mode('production').devtool(false).output.filename(filename).chunkFilename(filename)
+        // const filename = path.posix.join('js', `${new Date().getTime()}_[name].js`);
+        // config.mode('production').devtool(false).output.filename(filename).chunkFilename(filename)
     },
     // 配置全局样式变量
     css: {

+ 1 - 1
userCenter/src/assets/css/main.scss

@@ -490,7 +490,7 @@ a {
 }
 
 // 折叠菜单栏时出现箭头图标
-.el-menu--collapse {
+.sidebar-el-menu {
     .el-submenu > .el-submenu__title > .el-submenu__icon-arrow {
         display: inline;
     }

+ 63 - 0
userCenter/src/components/common/MenuTree.vue

@@ -0,0 +1,63 @@
+<template>
+    <div>
+        <template v-for="item in menuList">
+            <el-submenu v-if="!!item.children" :index="'/' + item.linkPath" :key="item.id">
+                <template slot="title">
+                    <img
+                        :src="`${envConfig.baseImgApi}${
+                            openArray.includes(item.linkPath) ? item.menuDynamicImage || item.menuImage : item.menuImage
+                        }`"
+                        style="width: 14px; height: 14px; margin-right: 10px"
+                    />
+                    <span v-if="!collapse" slot="title">{{ item.name }}</span>
+                </template>
+                <menu-tree :menuList="item.children" :openArray="openArray" />
+            </el-submenu>
+            <el-menu-item v-else :index="'/' + item.linkPath" :key="item.id">
+                <img
+                    :src="`${envConfig.baseImgApi}${
+                        openArray.includes(item.linkPath) ? item.menuDynamicImage || item.menuImage : item.menuImage
+                    }`"
+                    style="width: 14px; height: 14px; margin-right: 10px"
+                />
+                <span slot="title">{{ item.name }}</span>
+            </el-menu-item>
+        </template>
+    </div>
+</template>
+<script>
+import MenuTree from './MenuTree.vue';
+import envConfig from '@/config';
+export default {
+    name: 'MenuTree',
+    data() {
+        return {
+            envConfig: envConfig
+        };
+    },
+    components: {
+        MenuTree
+    },
+    computed: {
+        onRoutes() {
+            return this.$route.path;
+        }
+    },
+    methods: {},
+    props: {
+        menuList: {
+            type: Array,
+            default: () => []
+        },
+        collapse: {
+            type: Boolean,
+            default: false
+        },
+        openArray: {
+            type: Array,
+            default: () => []
+        }
+    },
+    created() {}
+};
+</script>

+ 12 - 2
userCenter/src/components/common/Tags.vue

@@ -103,10 +103,20 @@ export default {
                         path: { path: route.path, query: { planName: route.query.planName || '', planId: route.query.planId || '' } }
                     });
                 } else {
-                    this.tagsList.push({
+                    
+                    let tagArr = {
                         title: route.title || route.meta.title,
                         path: route.fullPath
-                    });
+                    };
+                    if (!!route.name) {
+                        tagArr = {
+                            title: route.title || route.meta.title,
+                            path: route.fullPath,
+                            name: route.name
+                        };
+                    }
+
+                    this.tagsList.push(tagArr);
                 }
                 this.$store.dispatch('tags', this.tagsList);
             }