Browse Source

Merge branch 'develop' of git.sagacloud.cn:web/wanda-bm-guide into develop

guoxiaohuan 4 years ago
parent
commit
48e2388c33
4 changed files with 71 additions and 19 deletions
  1. 5 4
      src/router/index.js
  2. 36 9
      src/store/index.js
  3. 3 3
      src/views/legendLibrary/index.vue
  4. 27 3
      src/views/legendRules/index.vue

+ 5 - 4
src/router/index.js

@@ -1,7 +1,9 @@
 import Vue from "vue"
 import store from "@/store"
 import VueRouter from "vue-router"
-import { query } from "@/utils/query"
+import {
+    query
+} from "@/utils/query"
 Vue.use(VueRouter)
 
 const routes = [
@@ -20,8 +22,7 @@ const routes = [
         name: "home",
         component: () => import("../views/index"),
         redirect: "/home/first",
-        children: [
-            {
+        children: [{
                 path: "first",
                 component: () => import("../views/first"),
             },
@@ -101,4 +102,4 @@ router.beforeEach(async (to, from, next) => {
         return
     }
 })
-export default router
+export default router

+ 36 - 9
src/store/index.js

@@ -1,7 +1,13 @@
 import Vue from "vue"
 import Vuex from "vuex"
-import { login, queryFloor, queryfmapID } from "@/api/login.js"
-import { queryBrand } from "@/api/public.js"
+import {
+    login,
+    queryFloor,
+    queryfmapID
+} from "@/api/login.js"
+import {
+    queryBrand
+} from "@/api/public.js"
 import axios from "axios"
 import router from "../router"
 
@@ -111,7 +117,9 @@ export default new Vuex.Store({
     },
     actions: {
         // 获取项目列表、userId
-        async getUserInfo({ commit }, palyload) {
+        async getUserInfo({
+            commit
+        }, palyload) {
             await login({}).then((res) => {
                 if (res.result == "success") {
                     // token校验成功 拿到权限
@@ -120,24 +128,41 @@ export default new Vuex.Store({
                     if (res.permissions.length == 0) {
                         //权限不足
                         console.log("权限不足!!")
-                        router.push({ path: "/404", query: { result: "权限不足" } })
+                        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: "登录失败" } })
+                    router.push({
+                        path: "/404",
+                        query: {
+                            result: "登录失败"
+                        }
+                    })
                 } else {
                     //访问出错 500
                     console.log("访问出错!!")
                     commit("SETISREQUESTtAUTH", false)
-                    router.push({ path: "/404", query: { result: "访问出错" } })
+                    router.push({
+                        path: "/404",
+                        query: {
+                            result: "访问出错"
+                        }
+                    })
                 }
             })
         },
         getFloors(context) {
-            queryFloor({ plazaId: context.state.plazaId }).then((res) => {
+            queryFloor({
+                plazaId: context.state.plazaId
+            }).then((res) => {
                 if (res.result == "success") {
                     context.commit("SETFLOORS", res.data)
                 }
@@ -154,7 +179,9 @@ export default new Vuex.Store({
             let data = {
                 plazaId: context.state.plazaId,
             }
-            await queryBrand({ data }).then((res) => {
+            await queryBrand({
+                data
+            }).then((res) => {
                 let obj = {}
                 if (res.data.data) {
                     let Data = res.data.data
@@ -167,4 +194,4 @@ export default new Vuex.Store({
         },
     },
     modules: {},
-})
+})

+ 3 - 3
src/views/legendLibrary/index.vue

@@ -619,21 +619,21 @@ export default {
     }
     .device-position {
         /deep/ .p-select-input-caption {
-            display: block;
+            display: block !important;
             width: 250px !important;
             max-width: 250px !important;
         }
     }
     .instructions {
         /deep/ .p-select-input-caption {
-            display: block;
+            display: block !important;
             width: 100px !important;
             max-width: 200px !important;
         }
     }
     .visualization {
         /deep/ .p-select-input-caption {
-            display: block;
+            display: block !important;
             width: 100px !important;
             max-width: 200px !important;
         }

+ 27 - 3
src/views/legendRules/index.vue

@@ -239,10 +239,22 @@ export default {
         init() {
             let getParams = {}
             getLegendTree({ getParams }).then(res => {
-                this.treeData = res.Content
+                // this.treeData = res.Content
+                this.treeData = this.recursion(res.Content)
                 this.getData()
             })
         },
+        recursion(arr) {
+            arr.map(i => {
+                i.selectable = true
+                if (i.Category && i.Category.length > 0) {
+                    i.selectable = false
+                    this.recursion(i.Category)
+                }
+                return i
+            })
+            return arr
+        },
         getData() {
             let postParams = this.GraphCategoryId
             let data = {}
@@ -263,6 +275,7 @@ export default {
     display: flex;
     flex-direction: column;
     color: #1f2329;
+
     .nav {
         height: 48px;
         line-height: 48px;
@@ -323,8 +336,19 @@ export default {
     .el-tree {
         background: rgba(247, 249, 250, 1);
     }
-    /deep/.ant-tree li .ant-tree-node-content-wrapper {
-        width: 90%;
+    // /deep/.ant-tree li .ant-tree-node-content-wrapper {
+    //     width: 90%;
+    // }
+    .ant-tree-treenode-selected {
+        background: #e1f2ff !important;
+        color: #0091ff !important;
+    }
+    /deep/ .ant-tree li .ant-tree-node-content-wrapper.ant-tree-node-selected {
+        background: transparent !important;
+        color: #0091ff !important;
+    }
+    /deep/ .ant-tree li .ant-tree-node-content-wrapper:hover {
+        background: transparent !important;
     }
     .is-current {
         background: #e1f2ff !important;