Browse Source

adm:fix> 新版数据字典-需采集信息点

shaun-sheep 4 years ago
parent
commit
21efe9ae66

+ 2 - 1
config/dev.env.js

@@ -4,8 +4,9 @@ const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
-  // BASE_URL: '"http://172.16.44.215"', //测试iframe地址
+  // BASE_URL: '"http://192.168.12.15"', //测试iframe地址
   // SSO_SERVER: '"http://172.16.44.235:8081"', //测试环境
+  // SSO_SERVER: '"http://192.168.12.238:8081"', //测试环境
   // BASE_URL: '"http://192.168.20.236"', //(新)测试iframe地址
   // SSO_SERVER: '"http://192.168.20.236:8086"', //(新)测试环境
   // MQTT_SERVICE: '"ws://172.16.42.210:61614/stomp/"' //MQ测试环境地址

+ 14 - 1
config/index.js

@@ -202,13 +202,15 @@ module.exports = {
     // },
     proxyTable: { // 新版数据字典
       '/admin': {
-        target: 'http://mbi.sagacloud.cn:8080',
+        // target: 'http://192.168.12.238:8080/',
+        target: 'http://mbi.sagacloud.cn:8080/',
         changeOrigin: true,
         pathRewrite: {
           "^/admin": "/"
         }
       },
       '/api': {
+        // target: 'http://api.sagacloud.cn/',
         target: 'http://60.205.177.43:8080',
         changeOrigin: true,
         pathRewrite: {
@@ -217,6 +219,7 @@ module.exports = {
       },
       '/data-platform-3': {
         // 目标 API 地址
+        // target: 'http://172.16.42.210:8080/',
         target: 'http://api.sagacloud.cn/',
         // 如果要代理 websockets
         ws: true,
@@ -225,7 +228,9 @@ module.exports = {
       },
       '/business-space': {
         // 目标 API 地址
+        // target: 'http://172.16.42.210:8080/',
         target: 'http://api.sagacloud.cn/',
+
         // 如果要代理 websockets
         ws: true,
         // 将主机标头的原点更改为目标URL
@@ -233,6 +238,7 @@ module.exports = {
       },
       '/pointconfig': {
         // 目标 API 地址
+        // target: 'http://192.168.12.238:8080/',
         target: 'http://mbi.sagacloud.cn:8080/',
         // 如果要代理 websockets
         ws: true,
@@ -241,6 +247,7 @@ module.exports = {
       },
       '/venders-dp': {
         // 目标 API 地址
+        // target: 'http://172.16.42.210:8080/',
         target: 'http://api.sagacloud.cn/',
         // 如果要代理 websockets
         ws: true,
@@ -249,6 +256,7 @@ module.exports = {
       },
       '/venders': {
         // 目标 API 地址
+        // target: 'http://172.16.42.210:8080/',
         target: 'http://api.sagacloud.cn/',
         // 如果要代理 websockets
         ws: true,
@@ -257,6 +265,7 @@ module.exports = {
       },
       '/ScanBuilding': {
         // 目标 API 地址
+        // target: 'http://192.168.12.238:8080/',
         target: 'http://mbi.sagacloud.cn:8080/',
         // 如果要代理 websockets
         ws: true,
@@ -265,6 +274,7 @@ module.exports = {
       },
       '/scanbuilding-2': {
         // 目标 API 地址
+        // target: 'http://192.168.12.238:8080/',
         target: 'http://mbi.sagacloud.cn:8080/',
         // 如果要代理 websockets
         ws: true,
@@ -273,6 +283,7 @@ module.exports = {
       },
       '/image-service': {
         // 目标 API 地址
+        // target: 'http://172.16.42.210:8080/',
         target: 'http://api.sagacloud.cn/',
         // 如果要代理 websockets
         ws: true,
@@ -280,6 +291,7 @@ module.exports = {
         changeOrigin: false
       },
       '/modelapi': {
+        // target: 'http://172.16.42.210:8082',
         target: 'http://mbi.sagacloud.cn:8080',
         // target: 'http://192.168.20.218:8082',//景灏
         changeOrigin: true,
@@ -288,6 +300,7 @@ module.exports = {
         }
       },
       '/schedulerapi': {
+        // target: 'http://172.16.42.210:8081',
         target: 'http://mbi.sagacloud.cn:8080',
         changeOrigin: true,
         pathRewrite: {

+ 3 - 2
config/prod.env.js

@@ -1,8 +1,9 @@
 'use strict'
 module.exports = {
   NODE_ENV: '"production"',
-  BASE_URL: '"http://172.16.44.215"', //测试iframe地址
-  SSO_SERVER: '"http://172.16.44.235:8081"', //测试环境
+  BASE_URL: '"http://192.168.12.15"', //测试iframe地址
+  // SSO_SERVER: '"http://172.16.44.235:8081"', //测试环境
+  SSO_SERVER: '"http://192.168.12.238:8081"', //测试环境
   // BASE_URL: '"http://192.168.20.236"', //(新)测试iframe地址
   // SSO_SERVER: '"http://192.168.20.236:8086"', //(新)测试环境
   MQTT_SERVICE: '"ws://172.16.42.210:61614/stomp/"' //MQ测试环境地址

+ 13 - 1
src/api/dict/index.js

@@ -1,5 +1,5 @@
 import fetch from "@/api/scan/fetch";
-import { baseUrl } from "@/api/scan/config";
+import {baseUrl} from "@/api/scan/config";
 import http from "@/api/scan/httpUtil";
 import storage from "@/framework/utils/storage";
 
@@ -14,3 +14,15 @@ export function getDataDictionary(param, success) {
   let url = `${baseUrl}/datacenter/dict/query`;
   http.postJson(url, param, success);
 }
+
+//批量处理字典信息操作
+export function setInfoPoint(param, success) {
+  let url = `${baseUrl}/datacenter/dict/dict-batch`;
+  http.postJson(url, param, success)
+}
+
+//设置-项目定制化字典
+export function setDataDictionary(param, success) {
+  let url = `${baseUrl}/datacenter/dict/setting-dic-project`;
+  http.postJson(url, param, success)
+}

+ 0 - 14
src/api/scan/newRequest.js

@@ -1,14 +0,0 @@
-import {baseUrl} from "./config";
-import http from "./httpUtil";
-
-//头部信息查询(查询所有设备类型-所有部件类型-所有系统类型-所有专业类型)
-export function queryPhysicsAllType(param, success) {
-  let url = `${baseUrl}/datacenter/dict/category`;
-  http.postJson(url, param, success)
-}
-
-//查询项目下类型的信息点
-export function getDataDictionary(param, success) {
-  let url = `${baseUrl}/datacenter/dict/query`;
-  http.postJson(url, param, success)
-}

+ 60 - 56
src/components/dialogs/config/infoPoint.vue

@@ -2,23 +2,28 @@
   <el-dialog title="按条件批量配置" :visible.sync="dialog.config" @close="handleClose" width="900px">
     <el-form ref="dataForm" :model="form" label-width="90px">
       <el-form-item label="方案:">
-        <el-radio-group v-model="form.SchemeId">
+        <el-radio-group v-model="form.schemeId">
           <el-radio label="schemeZero">全新设定</el-radio>
           <el-radio label="schemeOne">预置方案</el-radio>
           <el-radio label="schemeTwo">万达专用方案</el-radio>
         </el-radio-group>
       </el-form-item>
-      <el-form-item v-show="form.SchemeId == 'schemeZero'" label="优先级:">
-        <el-checkbox-group v-model="form.PriorityList">
-          <el-checkbox v-for="item in PriorityList" :key="item.Priority" :label="item.Priority" name="priority">{{ item.name }}</el-checkbox>
+      <el-form-item v-show="form.schemeId == 'schemeZero'" label="优先级:">
+        <el-checkbox-group v-model="form.priorityList">
+          <template v-for="item in priorityList">
+            <el-checkbox :key="item.priority" :label="item.priority" name="priority" v-if="item.name">
+              {{ item.name }}
+            </el-checkbox>
+          </template>
         </el-checkbox-group>
       </el-form-item>
-      <el-form-item v-show="form.SchemeId == 'schemeZero'" label="一级标签:">
-        <el-checkbox-group v-model="form.FirstNameList">
-          <el-checkbox style="width:99px;" v-for="(item, index) in FirstNameList" :key="index" :label="item.FirstName" name="firstTag"></el-checkbox>
+      <el-form-item v-show="form.schemeId == 'schemeZero'" label="一级标签:">
+        <el-checkbox-group v-model="form.firstNameList">
+          <el-checkbox style="width:99px;" v-for="(item, index) in firstNameList" :key="index" :label="item.firstName"
+                       name="firstTag"></el-checkbox>
         </el-checkbox-group>
       </el-form-item>
-      <el-form-item v-show="form.SchemeId == 'schemeZero'" label="二级标签:">
+      <el-form-item v-show="form.schemeId == 'schemeZero'" label="二级标签:">
         <span style="color:#bbb;font-size:12px;">二级标签暂未提供,如确实需要请联系产品添加。</span>
       </el-form-item>
     </el-form>
@@ -29,8 +34,9 @@
   </el-dialog>
 </template>
 <script>
-import { getDataDictionary, setInfoPoint } from "@/api/scan/request"
-import { mapGetters, mapActions } from "vuex"
+import {mapGetters, mapActions} from "vuex"
+import {setInfoPoint, getDataDictionary} from "@/api/dict";
+
 export default {
   props: {
     dialog: {
@@ -45,12 +51,12 @@ export default {
   data() {
     return {
       form: {
-        SchemeId: 'schemeZero',
-        PriorityList: [],
-        FirstNameList: []
+        schemeId: 'schemeZero',
+        priorityList: [],
+        firstNameList: []
       },
-      FirstNameList: [],
-      PriorityList: [],
+      firstNameList: [],
+      priorityList: [],
       loading: false
     };
   },
@@ -63,25 +69,19 @@ export default {
   methods: {
     getInfos() {
       let params1 = {
-        data: {
-          Distinct: true,
-          Filters: "FirstName != ''",
-          Orders: "FirstName desc",
-          PageNumber: 1,
-          PageSize: 1000,
-          Projection: [ "FirstName" ]
-        },
-        type: ""
+        distinct: true,
+        filters: "firstName != ''",
+        orders: "firstName desc",
+        pageNumber: 1,
+        pageSize: 1000,
+        projection: ["firstName"]
       }, params2 = {
-        data: {
-          Distinct: true,
-          Filters: "Priority != '';Priority != 'null'",
-          Orders: "Priority desc",
-          PageNumber: 1,
-          PageSize: 1000,
-          Projection: [ "Priority" ]
-        },
-        type: ""
+        distinct: true,
+        filters: "priority != '';priority != 'null'",
+        orders: "priority desc",
+        pageNumber: 1,
+        pageSize: 1000,
+        projection: ["priority"]
       };
       let promise1 = new Promise((resolve, reject) => {
         getDataDictionary(params1, res => {
@@ -94,18 +94,22 @@ export default {
         })
       })
       Promise.all([promise1, promise2]).then(values => {
-        this.FirstNameList = values[0].Content
-        this.PriorityList = values[1].Content.map((item) => {
-          if (item.Priority == "S") {
-            item.name = `(${item.Priority})关键信息`
-            return item
-          } else if (item.Priority == "M") {
-            item.name = `(${item.Priority})次要信息`
-            return item
-          } else if (item.Priority == "R") {
-            item.name = `(${item.Priority})参考信息`
-            return item
+        this.firstNameList = values[0].content
+        this.priorityList = values[1].content.map(item => {
+          switch (item.priority) {
+            case "S":
+              item.name = `(${item.priority})关键信息`;
+              break;
+            case "M":
+              item.name = `(${item.priority})次要信息`
+              break
+            case "R":
+              item.name = `(${item.priority})次要信息`;
+              break
+            default:
+              break
           }
+          return item
         })
       })
     },
@@ -113,17 +117,17 @@ export default {
     onSubmit() {
       let params = {}
       this.loading = true
-      if (this.form.SchemeId == 'schemeZero') {
+      if (this.form.schemeId == 'schemeZero') {
         params = this.form
       } else {
         params = {
-          SchemeId: this.form.SchemeId
+          schemeId: this.form.schemeId
         }
       }
       setInfoPoint(params, res => {
-        this.form.SchemeId = 'schemeZero'
-        this.form.FirstNameList = []
-        this.form.PriorityList = []
+        this.form.schemeId = 'schemeZero'
+        this.form.firstNameList = []
+        this.form.priorityList = []
         this.dialog.config = false
         this.loading = false
         this.$emit('configInfo')
@@ -131,17 +135,17 @@ export default {
     },
     //弹窗关闭回调
     handleClose() {
-      this.form.SchemeId = 'schemeZero'
-      this.form.FirstNameList = []
-      this.form.PriorityList = []
+      this.form.schemeId = 'schemeZero'
+      this.form.firstNameList = []
+      this.form.priorityList = []
       this.loading = false
     }
   }
 };
 </script>
 <style lang="scss">
-  .el-dialog__body {
-    max-height: 420px;
-    overflow-y: auto;
-  }
+.el-dialog__body {
+  max-height: 420px;
+  overflow-y: auto;
+}
 </style>

+ 85 - 69
src/views/ready/collectsetting/index.vue

@@ -3,7 +3,8 @@
     <nav>
       <div class="tab-box">
         <el-tabs v-model="value" @tab-click="chooseMedicine" type="card">
-          <el-tab-pane v-for="item in options" :key="item.value" :label="item.label" :name="item.value">{{ item.label }}
+          <el-tab-pane v-for="item in options" :key="item.value" :label="item.label" :name="item.value"
+                       :disabled="item.disabled">{{ item.label }}
           </el-tab-pane>
         </el-tabs>
       </div>
@@ -124,10 +125,9 @@ import configDialog from "@/components/dialogs/config/infoPoint"
 import {
   getBussTypes,
   queryFamilyAll,
-  setDataDictionary,
   queryDictionaryHead
 } from "@/api/scan/request";
-import {queryPhysicsAllType, getDataDictionary} from "@/api/scan/newRequest";
+import {queryPhysicsAllType, getDataDictionary, setDataDictionary} from "@/api/dict";
 
 import {mapGetters} from "vuex";
 
@@ -143,25 +143,32 @@ export default {
       stepActive: '0',
       options: [{
         label: "设备",
-        value: "equipment"
+        value: "equipment",
+        disabled: false,
       }, {
         label: "部件",
-        value: "component"
+        value: "component",
+        disabled: false,
       }, {
         label: "资产",
-        value: "property"
+        value: "property",
+        disabled: false,
       }, {
         label: "业务空间",
-        value: "space"
+        value: "space",
+        disabled: false,
       }, {
         label: "系统",
-        value: "system"
+        value: "system",
+        disabled: false,
       }, {
         label: "租户",
-        value: "tenant"
+        value: "tenant",
+        disabled: true,
       }, {
         label: "竖井",
-        value: "shaft"
+        value: "shaft",
+        disabled: false,
       }],
       tabsFalg: false,
       active: "",
@@ -585,56 +592,69 @@ export default {
       this.searchVal = "";
       this.allFamily = [];
       this.isLoading = true;
-      if (this.value == "property") {
-        queryFamilyAll(res => {
-          this.allFamily = res.Content.map((item) => {
-            return {
-              code: item.Code,
-              name: item.Name
-            }
-          })
-          this.isLoading = false
-          this.familySort()
-        })
-      } else if (this.value == "space") {
-        queryDictionaryHead({Filters: "parentId = 'Space';Code != 'Ispace'"}, res => {
-          this.allFamily = res.Content.map(item => {
-            return {
-              "code": item.Code,
-              "name": item.Name
-            }
-          })
-          console.log(this.allFamily)
-          this.isLoading = false
-          this.familySort();
-        })
-      } else if (this.value == "tenant") {
-        this.allFamily = [{
-          "code": "Tenant",
-          "name": "租户"
-        }]
-        this.isLoading = false
-        this.familySort()
-      } else if (this.value == "shaft") {
-        this.allFamily = [{
-          "code": "Shaft",
-          "name": "竖井"
-        }]
+      console.log(this.value)
+      // if (this.value == "property") {
+      //   queryFamilyAll(res => {
+      //     this.allFamily = res.Content.map((item) => {
+      //       return {
+      //         code: item.Code,
+      //         name: item.Name
+      //       }
+      //     })
+      //     this.isLoading = false
+      //     this.familySort()
+      //   })
+      // } else if (this.value == "space") {
+      //   queryDictionaryHead({Filters: "parentId = 'Space';Code != 'Ispace'"}, res => {
+      //     this.allFamily = res.Content.map(item => {
+      //       return {
+      //         "code": item.Code,
+      //         "name": item.Name
+      //       }
+      //     })
+      //     console.log(this.allFamily)
+      //     this.isLoading = false
+      //     this.familySort();
+      //   })
+      // } else if (this.value == "tenant") {
+      //   this.allFamily = [{
+      //     "code": "Tenant",
+      //     "name": "租户"
+      //   }]
+      //   this.isLoading = false
+      //   this.familySort()
+      // } else if (this.value == "shaft") {
+      //   this.allFamily = [{
+      //     "code": "Shaft",
+      //     "name": "竖井"
+      //   }]
+      //   this.isLoading = false
+      //   this.familySort()
+      // } else {
+      //   let param = {"Type": this.value, ProjectId: 'Pj1101050029'}
+      //   queryPhysicsAllType(param, res => {
+      //     this.allFamily = res.content.map((item) => ({
+      //       code: item.code,
+      //       name: item.name,
+      //       aliasName: item.aliasName,
+      //       aliasCode: item.aliasCode
+      //     }))
+      //     this.isLoading = false
+      //     this.familySort()
+      //   })
+      // }
+
+      let param = {"Type": this.value, ProjectId: 'Pj1101050029'}
+      queryPhysicsAllType(param, res => {
+        this.allFamily = res.content.map((item) => ({
+          code: item.code,
+          name: item.name,
+          aliasName: item.aliasName,
+          aliasCode: item.aliasCode
+        }))
         this.isLoading = false
         this.familySort()
-      } else {
-        let param = {"Type": this.value, ProjectId: 'Pj1101050029'}
-        queryPhysicsAllType(param, res => {
-          this.allFamily = res.content.map((item) => ({
-            code: item.code,
-            name: item.name,
-            aliasName: item.aliasName,
-            aliasCode: item.aliasCode
-          }))
-          this.isLoading = false
-          this.familySort()
-        })
-      }
+      })
     },
     changeSpace(arr) {
       return arr.map(item => {
@@ -646,11 +666,13 @@ export default {
     },
     //点击checkBox的事件
     boxChange(detail) {
-      let param = [{
-        Type: this.code,
-        InfoPointCode: detail.InfoPointCode,
-        Visible: detail.Visible
-      }]
+      let param = {
+        content: [{
+          classCode: this.code,
+          code: detail.InfoPointCode,
+          visible: detail.Visible
+        }]
+      }
       setDataDictionary(param, res => {
         return
       });
@@ -693,12 +715,6 @@ export default {
       this.code = code
       if (code) {
         let param = {
-          // data: {
-          //   Orders: "sort asc,InfoPointCode asc",
-          //   Distinct: true,
-          //   PageNumber: 1,
-          //   PageSize: 1000
-          // },
           type: code
         };
         this.rightLoading = true