Browse Source

处理石墨bug

shaun-sheep 4 years ago
parent
commit
56f61d254e
4 changed files with 72 additions and 82 deletions
  1. 2 2
      package.json
  2. 33 31
      src/router/index.js
  3. 31 41
      src/store/index.js
  4. 6 8
      src/views/legendLibrary/index.vue

+ 2 - 2
package.json

@@ -17,7 +17,7 @@
         "axios": "^0.19.2",
         "core-js": "^3.4.4",
         "element-ui": "^2.13.2",
-        "meri-design": "^1.3.3",
+        "meri-design": "^1.3.4",
         "moment": "^2.24.0",
         "quill": "^1.3.7",
         "vue": "^2.6.10",
@@ -52,4 +52,4 @@
         "vue-svg-loader": "^0.15.0",
         "vue-template-compiler": "^2.6.10"
     }
-}
+}

+ 33 - 31
src/router/index.js

@@ -69,38 +69,40 @@ const router = new VueRouter({
     base: process.env.BASE_URL,
     routes,
 })
+//不需要token的路由
 const ignore = ["/404"]
 router.beforeEach(async (to, from, next) => {
-    next()
-    // if (!ignore.includes(to.path)) {
-    //     const token = query().token
-    //     const ssoToken = store.getters["ssoToken"]
-    //     if (ssoToken) {
-    //         store.commit("SETSSOTOKEN", ssoToken)
-    //         await store.dispatch("getUserInfo", router)
-    //         await store.dispatch("getFloors")
-    //         await store.dispatch("getBrand")
-    //         next()
-    //     } else if (token) {
-    //         store.commit("SETSSOTOKEN", token)
-    //         await store.dispatch("getUserInfo", router)
-    //         next()
-    //     } else {
-    //         let lastRoute = {
-    //             path: to.path,
-    //             params: to.params,
-    //             query: to.query,
-    //         }
-    //         store.commit("SETLASTROUTER", lastRoute)
-    //         let ssoServer = "http://oauth.wanda-dev.cn"
-    //         let systemcode = "CAD156",
-    //             signal = new Date().getTime(),
-    //             version = "1.0.0"
-    //         window.location.href = `${ssoServer}/login?systemcode=${systemcode}&signal=${signal}&version=${version}`
-    //     }
-    // } else {
-    //     next()
-    //     return
-    // }
+    if (!ignore.includes(to.path)) {
+        const token = query().token
+        const ssoToken = store.getters["ssoToken"]
+        if (ssoToken) {
+            store.commit("SETSSOTOKEN", ssoToken)
+            await store.dispatch("getUserInfo", router)
+            await store.dispatch("getFloors")
+            await store.dispatch("getBrand")
+            next()
+        } else if (token) {
+            store.commit("SETSSOTOKEN", token)
+            await store.dispatch("getUserInfo", router)
+            next()
+        } else {
+            let lastRoute = {
+                path: to.path,
+                params: to.params,
+                query: to.query,
+            }
+            store.commit("SETLASTROUTER", lastRoute)
+            let ssoServer = "http://oauth.wanda-dev.cn"
+            let systemcode = "CAD156",
+                signal = new Date().getTime(),
+                version = "1.0.0",
+                returnUrl = window.location.protocol + '//' + window.location.host
+
+            window.location.href = `${ssoServer}/login?systemcode=${systemcode}&signal=${signal}&version=${version}`
+        }
+    } else {
+        next()
+        return
+    }
 })
 export default router

+ 31 - 41
src/store/index.js

@@ -1,15 +1,15 @@
-import Vue from "vue"
-import Vuex from "vuex"
+import Vue from 'vue'
+import Vuex from 'vuex'
 import {
     login,
     queryFloor,
     queryfmapID
-} from "@/api/login.js"
+} from '@/api/login.js'
 import {
     queryBrand
-} from "@/api/public.js"
-import axios from "axios"
-import router from "../router"
+} from '@/api/public.js'
+import axios from 'axios'
+import router from '../router'
 
 Vue.use(Vuex)
 export default new Vuex.Store({
@@ -17,25 +17,25 @@ export default new Vuex.Store({
         ssoToken: 'admin:lengqiang',
         // ssoToken: null,
         isPreview: false,
-        lastRoute: "",
+        lastRoute: '',
         isrequestAuth: true, // 是否请求登录校验接口
         permissions: [], //权限信息 "GLSMS_VIEW":"说明书查看"、"GLSMS_SYMBOL_MANAGE": "图例库管理"、 "GLSMS_PLANARGRAPH_MANAGE":"平面图维护"
         plazas: [], //项目列表
         userInfo: {
-            employeename: "", //用户名称:艾宇;
-            orgCode: "",
-            username: "lengqiang", //账户名称
+            employeename: '', //用户名称:艾宇;
+            orgCode: '',
+            username: 'lengqiang', //账户名称
         },
-        plazaId: "1000423", //项目Id
-        projectName: "", //全局项目名称
+        plazaId: '1000423', //项目Id
+        projectName: '', //全局项目名称
         floorsArr: [], //楼层数组
         floorSelect: [], //楼层下拉框
-        fmapID: "",
+        fmapID: '',
         haveFengMap: false, //是否有蜂鸟地图的数据
         isMessage: true, //是否有发布的图
         scpzTable: [], //土建系统图例展示
         legendTable: [], //除土建系统图例展示
-        remarksText: "", //备注
+        remarksText: '', //备注
         bunkObj: {}, // 铺位名称
         currentFloor: {}, //当前选中的楼层信息
     },
@@ -121,35 +121,25 @@ export default new Vuex.Store({
             commit
         }, palyload) {
             await login({}).then((res) => {
-                // if (res.result == "success") {
-                //     // token校验成功 拿到权限
-                //     //commit("SETISREQUESTtAUTH", true)
-                //     console.log("-----", palyload)
-                //     if (res.permissions.length == 0) {
-                //         //权限不足
-                //         console.log("权限不足!!")
-                //         router.push({ path: "/404", query: { result: "权限不足" } })
-                //     }
-                //     commit("SETAUTHMSG", res)
-                // } else if (res.result == "no_auth") {
-                //     //登录失败
-                //     console.log("登录失败!!")
-                //     commit("SETISREQUESTtAUTH", false)
-                //     router.push({ path: "/404", query: { result: "登录失败" } })
-                // } else {
-                //     //访问出错 500
-                //     console.log("访问出错!!")
-                //     commit("SETISREQUESTtAUTH", false)
-                //     router.push({ path: "/404", query: { result: "访问出错" } })
-                // }
+                if (res.result == 'success') {
+                    // token校验成功 拿到权限
+                    //commit("SETISREQUESTtAUTH", true)
+                    if (res.permissions.length == 0) {
+                        router.push('/404')
+                    }
+                    commit('SETAUTHMSG', res)
+                } else {
+                    commit('SETISREQUESTtAUTH', false)
+                    router.push('/404')
+                }
             })
         },
         getFloors(context) {
             queryFloor({
-                plazaId: context.state.plazaId
+                plazaId: context.state.plazaId,
             }).then((res) => {
-                if (res.result == "success") {
-                    context.commit("SETFLOORS", res.data)
+                if (res.result == 'success') {
+                    context.commit('SETFLOORS', res.data)
                 }
             })
         },
@@ -157,7 +147,7 @@ export default new Vuex.Store({
             await queryfmapID({
                 mapId: context.state.plazaId,
             }).then((res) => {
-                context.commit("SETMAPID", `${context.state.plazaId}_${res.mapVersion}`)
+                context.commit('SETMAPID', `${context.state.plazaId}_${res.mapVersion}`)
             })
         },
         async getBrand(context) {
@@ -165,7 +155,7 @@ export default new Vuex.Store({
                 plazaId: context.state.plazaId,
             }
             await queryBrand({
-                data
+                data,
             }).then((res) => {
                 let obj = {}
                 if (res.data.data) {
@@ -174,7 +164,7 @@ export default new Vuex.Store({
                         obj[i.bunkdesc] = i
                     })
                 }
-                context.commit("SETBUNKOBJ", obj)
+                context.commit('SETBUNKOBJ', obj)
             })
         },
     },

+ 6 - 8
src/views/legendLibrary/index.vue

@@ -132,11 +132,6 @@
                         <span>{{row.InfoLocal.length?row.InfoLocal.map(item => item.name).join(' ,') :''}}</span>
                     </template>
                 </el-table-column>
-                <!-- <el-table-column prop='system' label='专业' show-overflow-tooltip width='120'>
-                        <template slot-scope='{row}'>
-                            <span>{{row.InfoSystem.length ?row.InfoSystem.map(item => item.Name).join(' ,') :''}}</span>
-                        </template>
-                </el-table-column>-->
 
                 <el-table-column prop='typeId' resizable label='铺位可视化typeid' width='140' show-overflow-tooltip>
                     <template slot-scope='{row}'>
@@ -620,8 +615,8 @@ export default {
     .device-position {
         /deep/ .p-select-input-caption {
             display: block !important;
-            width: 250px !important;
-            max-width: 250px !important;
+            width: 260px !important;
+            max-width: 300px !important;
         }
     }
     .instructions {
@@ -660,7 +655,7 @@ export default {
     background: #fff;
     border: 1px solid #ccc;
 }
-.p-transfer-select{
+.p-transfer-select {
     height: 44px !important;
 }
 .p-tree-node-check,
@@ -670,4 +665,7 @@ export default {
 .p-checkbox .p-checkbox-box {
     top: 4px !important;
 }
+.p-select-option-box {
+    border: none !important;
+}
 </style>