From 6155669d6cecdff465688ec86bc69453b7896b2c Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Wed, 03 Jul 2024 19:01:40 +0800
Subject: [PATCH] 代码优化

---
 src/views/wel/index.vue |  437 ++++++++++++++++++++++++++++--------------------------
 1 files changed, 224 insertions(+), 213 deletions(-)

diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index 89f6fad..bcf2d98 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -1,175 +1,186 @@
 <template>
-    <div id="homeL">
-        <div class="homeL-up">
-            <span class="h1">{{ webTitle }}</span>
-            <span class="h2"></span>
-        </div>
-        <div class="homeL-bar" v-if="homeMenuData.length">
-            <div class="outS" v-for="(item, index) in homeMenuData" :key="index" @click="openMenu(item, item.newOpen)">
-                <div :style="{ backgroundImage: `url(${publicPath + item.imageUrl})` }"><span>{{ item.title }}</span>
-                </div>
-            </div>
-        </div>
+  <div id="homeL">
+    <div class="homeL-up">
+      <span class="h1">{{ webTitle }}</span>
+      <span class="h2"></span>
     </div>
+    <div class="homeL-bar" v-if="homeMenuData.length">
+      <div class="outS" v-for="(item, index) in homeMenuData" :key="index" @click="openMenu(item, item.newOpen)">
+        <div :style="{ backgroundImage: `url(${publicPath + item.imageUrl})` }"><span>{{ item.title }}</span>
+        </div>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
-import { getToken } from '@/util/auth'
-import { getStore } from "@/util/store"
+  import {
+    getToken
+  } from '@/util/auth'
+  import {
+    getStore
+  } from "@/util/store"
 
-export default {
-    data () {
-        return {
-            webTitle: getStore({ name: "webTitle" }),
-            webType: getStore({ name: "webType" }),
-            a: 1,
-            globalUserInfo: getStore({ name: "userInfo" }),
+  export default {
+    data() {
+      return {
+        webTitle: getStore({
+          name: "webTitle"
+        }),
+        webType: getStore({
+          name: "webType"
+        }),
+        a: 1,
+        globalUserInfo: getStore({
+          name: "userInfo"
+        }),
 
-            publicPath: process.env.BASE_URL,
-            homeMenuData: []
-        }
+        publicPath: process.env.BASE_URL,
+        homeMenuData: []
+      }
     },
 
-    created () {
-        if (this.webType == 'secend') {
-            // 住建局
-            // if (this.globalUserInfo.role_name == 'zjj') {
-            //     this.homeMenuData = [
-            //         {
-            //             imageUrl: 'img/yijianbaoj.png',
-            //             url: '/propertySupervision/residentSupervision',
-            //             title: '居民监管',
-            //             newOpen: false,
-            //         },
-            //         {
-            //             imageUrl: 'img/yijianbaoj.png',
-            //             url: '/propertySupervision/houseHoldSupervision',
-            //             title: '住房监管',
-            //             newOpen: false,
-            //         },
-            //         {
-            //             imageUrl: 'img/yijianbaoj.png',
-            //             url: '/propertySupervision/ownersCommittee',
-            //             title: '业主大会',
-            //             newOpen: false,
-            //         },
-            //         {
-            //             imageUrl: 'img/yijianbaoj.png',
-            //             url: '/propertySupervision/propertyCapitalManage',
-            //             title: '维修基金管理',
-            //             newOpen: false,
-            //         },
-            //     ]
-            // } else {
-            //     // 物业
-            //     this.homeMenuData = [
-            //         {
-            //             imageUrl: 'img/yijianbaoj.png',
-            //             url: '/userHouse/houseHoldList',
-            //             title: '住户管理',
-            //             newOpen: false,
-            //         },
-            //     ]
-            // }
-        } else {
-            this.homeMenuData = [
-                {
-                    imageUrl: 'img/yijianbaoj.png',
-                    url: '/userHouse/houseHoldList',
-                    title: '住户管理',
-                    newOpen: false,
-                },
-                {
-                    imageUrl: 'img/fangyi.png',
-                    url: '/userHouse/houseList',
-                    title: '房屋管理',
-                    newOpen: false,
-                },
-                {
-                    imageUrl: 'img/anjian.png',
-                    url: '/cGovernance/taskECall',
-                    title: 'E呼即办',
-                    newOpen: false,
-                },
-                {
-                    imageUrl: 'img/tiwen.png',
-                    url: '/cGovernance/reportForRepairs',
-                    title: '报事报修',
-                    newOpen: false,
-                },
-                {
-                    imageUrl: 'img/tongji.png',
-                    url: '/cGovernance/gridWorkLog',
-                    title: '走访日志',
-                    newOpen: false,
-                }
-            ]
+    created() {
+      if (this.webType == 'secend') {
+        // 住建局
+        // if (this.globalUserInfo.role_name == 'zjj') {
+        //     this.homeMenuData = [
+        //         {
+        //             imageUrl: 'img/yijianbaoj.png',
+        //             url: '/propertySupervision/residentSupervision',
+        //             title: '居民监管',
+        //             newOpen: false,
+        //         },
+        //         {
+        //             imageUrl: 'img/yijianbaoj.png',
+        //             url: '/propertySupervision/houseHoldSupervision',
+        //             title: '住房监管',
+        //             newOpen: false,
+        //         },
+        //         {
+        //             imageUrl: 'img/yijianbaoj.png',
+        //             url: '/propertySupervision/ownersCommittee',
+        //             title: '业主大会',
+        //             newOpen: false,
+        //         },
+        //         {
+        //             imageUrl: 'img/yijianbaoj.png',
+        //             url: '/propertySupervision/propertyCapitalManage',
+        //             title: '维修基金管理',
+        //             newOpen: false,
+        //         },
+        //     ]
+        // } else {
+        //     // 物业
+        //     this.homeMenuData = [
+        //         {
+        //             imageUrl: 'img/yijianbaoj.png',
+        //             url: '/userHouse/houseHoldList',
+        //             title: '住户管理',
+        //             newOpen: false,
+        //         },
+        //     ]
+        // }
+      } else {
+        this.homeMenuData = [{
+            imageUrl: 'img/yijianbaoj.png',
+            url: '/userHouse/houseHoldList',
+            title: '住户管理',
+            newOpen: false,
+          },
+          {
+            imageUrl: 'img/fangyi.png',
+            url: '/userHouse/houseList',
+            title: '房屋管理',
+            newOpen: false,
+          },
+          {
+            imageUrl: 'img/anjian.png',
+            url: '/cGovernance/taskECall',
+            title: 'E呼即办',
+            newOpen: false,
+          },
+          {
+            imageUrl: 'img/tiwen.png',
+            url: '/cGovernance/reportForRepairs',
+            title: '报事报修',
+            newOpen: false,
+          },
+          {
+            imageUrl: 'img/tongji.png',
+            url: '/cGovernance/gridWorkLog',
+            title: '走访日志',
+            newOpen: false,
+          }
+        ]
 
-            if (this.globalUserInfo.role_name.indexOf('gagly') != -1) {
-                this.homeMenuData = [
-                    {
-                        imageUrl: 'img/yijianbaoj.png',
-                        url: '/userHouse/houseHoldList',
-                        title: '住户管理',
-                        newOpen: false,
-                    },
-                    {
-                        imageUrl: 'img/fangyi.png',
-                        url: '/userHouse/houseList',
-                        title: '房屋管理',
-                        newOpen: false,
-                    },
-                    {
-                        imageUrl: 'img/csjc.png',
-                        url: '/publicSecurity/ninePlaceManage/patrolRecord',
-                        title: '场所检查',
-                        newOpen: false,
-                    },
-                    {
-                        imageUrl: 'img/dagl.png',
-                        url: '/publicSecurity/ninePlaceManage/archivesManage',
-                        title: '档案管理',
-                        newOpen: false,
-                    },
-                    {
-                        imageUrl: 'img/zgqk.png',
-                        url: '/publicSecurity/ninePlaceManage/hiddenDangerStatistics',
-                        title: '整改情况',
-                        newOpen: false,
-                    }
-                ]
+        if (this.globalUserInfo.role_name.indexOf('gagly') != -1) {
+          this.homeMenuData = [{
+              imageUrl: 'img/yijianbaoj.png',
+              url: '/userHouse/houseHoldList',
+              title: '住户管理',
+              newOpen: false,
+            },
+            {
+              imageUrl: 'img/fangyi.png',
+              url: '/userHouse/houseList',
+              title: '房屋管理',
+              newOpen: false,
+            },
+            {
+              imageUrl: 'img/csjc.png',
+              url: '/publicSecurity/ninePlaceManage/patrolRecord',
+              title: '场所检查',
+              newOpen: false,
+            },
+            {
+              imageUrl: 'img/dagl.png',
+              url: '/publicSecurity/ninePlaceManage/archivesManage',
+              title: '档案管理',
+              newOpen: false,
+            },
+            {
+              imageUrl: 'img/zgqk.png',
+              url: '/publicSecurity/ninePlaceManage/hiddenDangerStatistics',
+              title: '整改情况',
+              newOpen: false,
             }
-
-            if (this.globalUserInfo.role_name == 'administrator' ||
-                this.globalUserInfo.role_name.indexOf('jdgly') != -1 ||
-                this.globalUserInfo.role_name.indexOf('sqgly') != -1 ||
-                this.globalUserInfo.role_name.indexOf('gagly') != -1 ||
-                this.globalUserInfo.role_name.split(',').find(item => item == 'admin')) {
-                this.homeMenuData.push({
-                    imageUrl: 'img/jsc.png',
-                    url: `http://srgdjczzxtpt.com:2181/uniform-auth/login?app=app_smart_aoi&Blade-Auth=bearer ${getToken()}`,
-                    title: '驾驶舱',
-                    newOpen: true,
-                })
-            }
+          ]
         }
+
+        if (this.globalUserInfo.role_name == 'administrator' ||
+          this.globalUserInfo.role_name.indexOf('jdgly') != -1 ||
+          this.globalUserInfo.role_name.indexOf('sqgly') != -1 ||
+          this.globalUserInfo.role_name.indexOf('gagly') != -1 ||
+          this.globalUserInfo.role_name.indexOf('mj') != -1 ||
+          this.globalUserInfo.role_name.split(',').find(item => item == 'admin')) {
+          this.homeMenuData.push({
+            imageUrl: 'img/jsc.png',
+            url: `http://srgdjczzxtpt.com:2181/uniform-auth/login?app=app_smart_aoi&Blade-Auth=bearer ${getToken()}`,
+            title: '驾驶舱',
+            newOpen: true,
+          })
+        }
+      }
     },
 
     methods: {
-        openMenu (data, flag = false) {
-            if (flag) {
-                window.open(data.url)
-            } else {
-                this.$router.push({ path: data.url })
-            }
+      openMenu(data, flag = false) {
+        if (flag) {
+          window.open(data.url)
+        } else {
+          this.$router.push({
+            path: data.url
+          })
         }
+      }
     },
-    mouted () { },
-}
+    mouted() {},
+  }
 </script>
 
 <style lang="scss">
-#homeL {
+  #homeL {
     display: flex;
     flex-direction: column;
     width: 100%;
@@ -177,78 +188,78 @@
 
     //   border: 1px solid #000;
     .homeL-up {
-        width: 100%;
-        height: 74%;
-        // border: 1px solid rgb(39, 164, 185);
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        flex-direction: column;
-        background-image: url("../../../public/img/bjkeji.png");
-        background-color: #fff;
-        background-repeat: no-repeat;
-        background-size: 100% 100%;
-        -moz-background-size: 100% 100%;
-        color: #4BA3FE;
+      width: 100%;
+      height: 74%;
+      // border: 1px solid rgb(39, 164, 185);
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      flex-direction: column;
+      background-image: url("../../../public/img/bjkeji.png");
+      background-color: #fff;
+      background-repeat: no-repeat;
+      background-size: 100% 100%;
+      -moz-background-size: 100% 100%;
+      color: #4BA3FE;
 
-        .h1,
-        .h2 {
-            position: relative;
-            left: 22%;
-        }
+      .h1,
+      .h2 {
+        position: relative;
+        left: 22%;
+      }
 
-        .h1 {
-            font-size: 54px;
-        }
+      .h1 {
+        font-size: 54px;
+      }
 
-        .h2 {
-            font-size: 28px;
-        }
+      .h2 {
+        font-size: 28px;
+      }
     }
 
     .homeL-bar {
-        height: 0;
+      height: 0;
+      flex: 1;
+      width: 100%;
+      display: flex;
+      align-items: center;
+
+      .outS {
+        width: 0;
         flex: 1;
-        width: 100%;
+        height: 94.6%;
         display: flex;
-        align-items: center;
+        justify-content: center;
 
-        .outS {
-            width: 0;
-            flex: 1;
-            height: 94.6%;
-            display: flex;
-            justify-content: center;
+        &>div {
+          width: 96%;
+          height: 100%;
+          background-repeat: no-repeat;
+          background-size: 100% 100%;
+          cursor: pointer;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          border-radius: 5px;
 
-            &>div {
-                width: 96%;
-                height: 100%;
-                background-repeat: no-repeat;
-                background-size: 100% 100%;
-                cursor: pointer;
-                display: flex;
-                align-items: center;
-                justify-content: center;
-                border-radius: 5px;
+          &:hover {
+            width: 99%;
+            height: 99%;
+            transition: all 0.3s ease;
+          }
 
-                &:hover {
-                    width: 99%;
-                    height: 99%;
-                    transition: all 0.3s ease;
-                }
-
-                span {
-                    position: relative;
-                    top: -30px;
-                    left: -50px;
-                    font-weight: 600;
-                    font-size: 30px;
-                    color: #fff;
-                    display: inline-block;
-                    // border: 1px solid rgb(180, 22, 75);
-                }
-            }
+          span {
+            position: relative;
+            top: -30px;
+            left: -50px;
+            font-weight: 600;
+            font-size: 30px;
+            color: #fff;
+            display: inline-block;
+            // border: 1px solid rgb(180, 22, 75);
+          }
         }
+      }
     }
-}
+  }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3