Przeglądaj źródła

需采集信息点接口替换,获取登录信息数据格式替换

zhangyu 5 lat temu
rodzic
commit
f214581d84

+ 2 - 1
config/dev.env.js

@@ -5,7 +5,8 @@ const prodEnv = require('./prod.env')
 module.exports = merge(prodEnv, {
 module.exports = merge(prodEnv, {
     NODE_ENV: '"development"',
     NODE_ENV: '"development"',
     BASE_URL: '"http://192.168.20.215"', //测试iframe地址
     BASE_URL: '"http://192.168.20.215"', //测试iframe地址
-    SSO_SERVER: '"http://192.168.20.101:8004"' //测试环境
+    SSO_SERVER: '"http://192.168.20.102:8080"' //(新)测试环境
+    // SSO_SERVER: '"http://192.168.20.101:8004"' //测试环境
     // SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
     // SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
     // BASE_URL: '"http://mbi.sagacloud.cn"' //线上iframe地址
     // BASE_URL: '"http://mbi.sagacloud.cn"' //线上iframe地址
 })
 })

+ 0 - 1
config/index.js

@@ -14,7 +14,6 @@ module.exports = {
                 target: 'http://192.168.20.235:8080',
                 target: 'http://192.168.20.235:8080',
                 changeOrigin: true,
                 changeOrigin: true,
                 pathRewrite: {
                 pathRewrite: {
-                    // "^/apis": ""
                     "^/admin": "/"
                     "^/admin": "/"
                 }
                 }
             },
             },

+ 4 - 3
config/prod.env.js

@@ -1,8 +1,9 @@
 'use strict'
 'use strict'
 module.exports = {
 module.exports = {
     NODE_ENV: '"production"',
     NODE_ENV: '"production"',
-    // BASE_URL: '"http://192.168.20.215"', //测试iframe地址
+    BASE_URL: '"http://192.168.20.215"', //测试iframe地址
+    SSO_SERVER: '"http://192.168.20.102:8080"' //(新)测试环境
     // SSO_SERVER: '"http://192.168.20.101:8004"' //测试环境
     // SSO_SERVER: '"http://192.168.20.101:8004"' //测试环境
-    BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
-    SSO_SERVER: '"http://sso.sagacloud.cn"'  //正式环境
+    // BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
+    // SSO_SERVER: '"http://sso.sagacloud.cn"'  //正式环境
 }
 }

+ 6 - 0
src/api/scan/request.js

@@ -1040,6 +1040,12 @@ export function queryPhysicsAllType(param, success) {
     http.postJson(url, {}, success)
     http.postJson(url, {}, success)
 }
 }
 
 
+//查询所有设备族信息
+export function queryFamilyAll( success) {
+    let url = `${baseUrl}/datacenter/data-dictionary/family-query-All`;
+    http.getJson(url, {}, success)
+}
+
 //字典头部信息查询接口
 //字典头部信息查询接口
 export function queryDictionaryHead(param, success) {
 export function queryDictionaryHead(param, success) {
     let url = `${baseUrl}/datacenter/class-def/query`;
     let url = `${baseUrl}/datacenter/class-def/query`;

+ 13 - 12
src/framework/layout/layout-store.js

@@ -63,6 +63,7 @@ export default {
             storage.set(KEY_MENU_SELECTED, val)
             storage.set(KEY_MENU_SELECTED, val)
         },
         },
         setprojectId: (state, val) => {
         setprojectId: (state, val) => {
+            debugger
             state.projectId = val
             state.projectId = val
             localStorage.setItem('projectId', val)
             localStorage.setItem('projectId', val)
             storage.set(KEY_PROJECT_SELECTED, val)
             storage.set(KEY_PROJECT_SELECTED, val)
@@ -79,23 +80,23 @@ export default {
             return new Promise((resolve, reject) => {
             return new Promise((resolve, reject) => {
                 frameworkApi.loadUserInfo().then(resp => {
                 frameworkApi.loadUserInfo().then(resp => {
                     console.log(resp)
                     console.log(resp)
-                    if (resp.result == 'success') {
-                        state.userInfo = { username: resp.username }
+                    if (resp.Result == 'success') {
+                        state.userInfo = { username: resp.Username }
                         state.permissions = {}
                         state.permissions = {}
-                        if (resp.permissions) {
-                            resp.permissions.forEach(p => (state.permissions[p] = true))
+                        if (resp.Permissions) {
+                            resp.Permissions.forEach(p => (state.permissions[p] = true))
                         }
                         }
                         state.projects = []
                         state.projects = []
-                        if (resp.projects) {
-                            if(resp.projects[0] && resp.projects[0].projId) {
-                                state.projectId = resp.projects[0].projId
-                                state.secret = resp.projects[0].secret?resp.projects[0].secret:""
+                        if (resp.Projects) {
+                            if(resp.Projects[0] && resp.Projects[0].ProjId) {
+                                state.projectId = resp.Projects[0].ProjId
+                                state.secret = resp.Projects[0].Secret?resp.Projects[0].Secret:""
                             }
                             }
-                            resp.projects.forEach(proj =>
+                            resp.Projects.forEach(proj =>
                                 state.projects.push({
                                 state.projects.push({
-                                    id: proj.projId,
-                                    name: proj.projLocalName,
-                                    pwd: proj.secret?proj.secret:""
+                                    id: proj.ProjId,
+                                    name: proj.ProjLocalName,
+                                    pwd: proj.Secret?proj.Secret:""
                                 })
                                 })
                             )
                             )
                         }
                         }

+ 18 - 57
src/views/ready/collectsetting/index.vue

@@ -74,11 +74,12 @@
     import buildInput from "@/components/common/search_input";
     import buildInput from "@/components/common/search_input";
     import configDialog from "@/components/dialogs/config/infoPoint"
     import configDialog from "@/components/dialogs/config/infoPoint"
     import {
     import {
-        getAllFamily, //获取所有设备族
-        queryPhysicsAllType, //获取部件
+        // getAllFamily, //获取所有设备族
+        queryPhysicsAllType, //查询设备、部件、系统
+        queryFamilyAll, //查询所有设备族
         getDataDictionary, //点击时后去右侧的数据
         getDataDictionary, //点击时后去右侧的数据
         setDataDictionary, //修改右侧数据
         setDataDictionary, //修改右侧数据
-        getEqCode,
+        // getEqCode,
         getBussTypes
         getBussTypes
     } from "@/api/scan/request";
     } from "@/api/scan/request";
     import { mapGetters, mapActions } from "vuex";
     import { mapGetters, mapActions } from "vuex";
@@ -96,13 +97,13 @@
                     value: "property"
                     value: "property"
                 }, {
                 }, {
                     label: "系统",
                     label: "系统",
-                    value: "system"
+                    value: "System"
                 }, {
                 }, {
                     label: "设备",
                     label: "设备",
-                    value: "equip"
+                    value: "Equipment"
                 }, {
                 }, {
                     label: "部件",
                     label: "部件",
-                    value: "parts"
+                    value: "Component"
                 }, {
                 }, {
                     label: "空间",
                     label: "空间",
                     value: "space"
                     value: "space"
@@ -534,16 +535,16 @@
                 this.active = ""
                 this.active = ""
                 this.searchVal = ""
                 this.searchVal = ""
                 if (this.value == "property") {
                 if (this.value == "property") {
-                    getAllFamily().then(result => {
+                    queryFamilyAll(res => {
+                       this.allFamily = res.Content.map((item) => {
+                            return {
+                                code: item.Code,
+                                name: item.Name
+                            }
+                        })
                         this.isLoading = false
                         this.isLoading = false
-                        if (result.data.Result == "success") {
-                            this.allFamily = result.data.Content;
-                            this.familySort();
-                        } else {
-                            this.dialogVisible = true;
-                            this.ajaxMsg = "请求出错";
-                        }
-                    });
+                        this.familySort() 
+                    })
                 } else if (this.value == "space") {
                 } else if (this.value == "space") {
                     getBussTypes(res => {
                     getBussTypes(res => {
                         this.isLoading = false
                         this.isLoading = false
@@ -590,8 +591,8 @@
                         }
                         }
                     ]
                     ]
                     this.familySort()
                     this.familySort()
-                } else if (this.value == "parts") {
-                    queryPhysicsAllType('Component', res => {
+                }else {
+                    queryPhysicsAllType(this.value, res => {
                         this.allFamily = res.Content.map((item) => {
                         this.allFamily = res.Content.map((item) => {
                             return {
                             return {
                                 code: item.Code,
                                 code: item.Code,
@@ -600,17 +601,6 @@
                         })
                         })
                         this.familySort()
                         this.familySort()
                     })
                     })
-                } else {
-                    getEqCode().then(res => {
-                        if (res.data.Result == "success") {
-                            this.allFamily = this.changeValue(res.data.Content, this.value)
-                            this.familySort();
-                        } else {
-                            this.$message.error("请求错误:" + res.data.ResultMsg)
-                        }
-                    }).catch(_ => {
-                        this.$message.error("请求错误")
-                    })
                 }
                 }
             },
             },
             changeSpace(arr) {
             changeSpace(arr) {
@@ -621,35 +611,6 @@
                     }
                     }
                 })
                 })
             },
             },
-            changeValue(list, val) {
-                let data = []
-                list.map(item => {
-                    if (!!item.content && item.content.length) {
-                        item.content.map(child => {
-                            //val为系统放入
-                            if (val == "system") {
-                                data.push({
-                                    name: child.system,
-                                    code: child.code
-                                })
-                            } else {
-                                //否则为设备
-                                if (!!child.content && !!child.content.length) {
-                                    child.content.map(facility => {
-                                        if (val == "equip") {
-                                            data.push({
-                                                name: facility.facility,
-                                                code: facility.code
-                                            })
-                                        }
-                                    })
-                                }
-                            }
-                        })
-                    }
-                })
-                return data
-            },
             //点击checkBox的事件
             //点击checkBox的事件
             boxChange(detail) {
             boxChange(detail) {
                 let param = [{
                 let param = [{

+ 1 - 1
src/views/system/auth/index.vue

@@ -20,7 +20,7 @@ export default {
         console.log(this.$store.state.ssoToken)         
         console.log(this.$store.state.ssoToken)         
         this.$store.dispatch('layout/loadUserInfo').then(resp => {
         this.$store.dispatch('layout/loadUserInfo').then(resp => {
             console.log('store dispatch result ', resp)
             console.log('store dispatch result ', resp)
-            if (resp.result == 'success') {
+            if (resp.Result == 'success') {
                 let lastRoute = this.$store.getters['lastRoute']
                 let lastRoute = this.$store.getters['lastRoute']
                 console.log('last route ', lastRoute)
                 console.log('last route ', lastRoute)
                 if (lastRoute) {
                 if (lastRoute) {