소스 검색

Merge branch 'msg-sever' of http://39.106.8.246:3003/web/ibms into msg-sever

LXXXY 5 년 전
부모
커밋
79fbd384f1

+ 2 - 0
src/components/business_space/business/handsontable.vue

@@ -614,6 +614,8 @@ export default {
   },
   watch: {
     projectId() {
+      this.buildFloorData = []
+      buildFloor.getData(this.buildFloorData)
       this.setData()
       this.main = null
     },

+ 1 - 0
src/components/config_point/step3_point/steps3_main.vue

@@ -145,6 +145,7 @@
                                     // KeyEquipmentParameter: '温度',
                                     // KeyEquipmentType: '冷机'
                                 },
+                                Orders: 'EquipmentMark asc',
                                 PageNumber: this.pages.currentPage,
                                 PageSize: this.pages.size
                             },

+ 2 - 0
src/components/ledger/handsontables/assets.vue

@@ -996,6 +996,8 @@ export default {
   },
   watch: {
     projectId() {
+      this.buildFloorData = []
+      buildFloor.getData(this.buildFloorData)
       this.main = []
       this.mess.deviceId = null
       this.page.total = 0

+ 2 - 0
src/components/ledger/handsontables/device.vue

@@ -948,6 +948,8 @@ export default {
   },
   watch: {
     projectId() {
+      this.buildFloorData = []
+      buildFloor.getData(this.buildFloorData)
       this.tableData = []
       this.mess.deviceId = null
       this.page.total = 0

+ 11 - 2
src/router/system.js

@@ -80,7 +80,8 @@ import overView from '@/views/relation/overview'
 import supplier from '@/views/manufactor/supplier'
 
 /**  业务空间数据导入工具 */
-import dataUtil from '@/views/business_space/dataUtil'
+import dataUtil from '@/views/business_space/dataUtil/index'
+import dataUtil2 from '@/views/business_space/dataUtil/index2'
 
 /**市场及商务 */
 const OwnerManage = () =>
@@ -99,7 +100,15 @@ export default [{
     { path: '/auth', name: 'auth', component: auth },
     { path: '/noUser', name: 'noUser', component: noUser },
     // 业务空间数据导入工具
-    { path: '/dataUtil', name: 'dataUtil', component: LayoutMain, children: [{ path: 'index', component: dataUtil }] },
+    { 
+        path: '/dataUtil',
+        name: 'dataUtil',
+        component: LayoutMain,
+        children:[
+            { path: 'index', component: dataUtil },
+            { path: 'index2', component: dataUtil2 }
+        ] 
+    },
     // 平台管理
     {
         path: '/platform',

+ 161 - 0
src/views/business_space/dataUtil/index2.vue

@@ -0,0 +1,161 @@
+<template>
+  <div class="main-box">
+    <div class="saga-build-mess">
+      <el-button @click="queryZone">导入业务空间BIMLocation</el-button>
+    </div>
+  </div>
+</template>
+<script>
+import {
+  queryZone,
+  updateZone,
+} from "@/api/scan/request";
+import { mapGetters } from "vuex";
+import pako from '@/assets/pako/pako'
+import axios from "axios";
+export default {
+  data() {
+    return {
+      options: [],
+      tabsList: [
+        {
+          "Code": "GeneralZone",
+          "Name": "默认分区",
+          "Rel_type": "99"
+        },
+        {
+          "Name": "供电分区",
+          "Rel_type": "1",
+          "Code": "PowerSupplyZone"
+        },
+        {
+          "Name": "照明分区",
+          "Rel_type": "2",
+          "Code": "LightingZone"
+        },
+        {
+          "Name": "网络分区",
+          "Rel_type": "3",
+          "Code": "NetworkZone"
+        },
+        {
+          "Code": "AirConditioningZone",
+          "Name": "空调分区",
+          "Rel_type": "4"
+        },
+        {
+          "Name": "采暖分区",
+          "Rel_type": "5",
+          "Code": "HeatingZone"
+        },
+        {
+          "Name": "洁净分区",
+          "Rel_type": "6",
+          "Code": "CleanZone"
+        },
+        {
+          "Name": "生活给水分区",
+          "Rel_type": "7",
+          "Code": "DomesticWaterSupplyZone"
+        },
+        {
+          "Code": "FireZone",
+          "Name": "防火分区",
+          "Rel_type": "8"
+        },
+        {
+          "Name": "安防分区",
+          "Rel_type": "9",
+          "Code": "SecurityZone"
+        },
+        {
+          "Name": "租户分区",
+          "Rel_type": "10",
+          "Code": "TenantZone"
+        },
+        {
+          "Name": '功能分区',
+          'Rel_type': '11',
+          "Code": 'FunctionZone'
+        }
+      ],
+    }
+  },
+  computed: {
+    ...mapGetters('layout', ['projectId', 'userId', 'secret'])
+  },
+  methods: {
+    init() { },
+    // 查询该项目下所有的业务空间
+    queryZone() {
+      this.tabsList.map(t => {
+        this.getZone(t.Code, 1, t.Name);
+      })
+    },
+    getZone(Code, PageNumber, Name) {
+      let pa = {
+        data: {
+          PageNumber: PageNumber,
+          PageSize: 1000,
+          Orders: 'RoomID asc'
+        },
+        zone: Code
+      }
+      queryZone(pa, res => {
+        if (res.Total > PageNumber * 1000) {
+          let num = PageNumber + 1
+          console.log(num)
+          this.getZone(Code, num, Name)
+        }
+        let params = {
+          data: {
+            Content: [],
+            Projection: ["BIMLocation"]
+          },
+          zone: Code
+        }
+        res.Content.map(t => {
+          if (t.Outline && t.Outline[0]) {
+            t.BIMLocation = this.getAverageVal(t.Outline);
+            let obj = {
+              RoomID: t.RoomID,
+              BIMLocation: t.BIMLocation
+            }
+            params.data.Content.push(obj);
+          }
+        });
+        if (params.data.Content.length) {
+          updateZone(params, res => {
+            console.log(`${this.projectId},${Name},${params.data.Content.length}条更新完成`);
+          })
+        }
+      })
+    },
+    getAverageVal(Outline) {
+      let X = 0, Y = 0, Z = 0, len = 0;
+      Outline.map(t => {
+        if (t[0]) {
+          t[0].map(item => {
+            X += item.X;
+            Y += item.Y;
+            Z += item.Z;
+          })
+          len += t[0].length
+        }
+      })
+      X = (X / len).toFixed(2);
+      Y = (Y / len).toFixed(2);
+      Z = (Z / len).toFixed(2);
+      return `${X},${Y},${Z}`
+    },
+  },
+  created() {
+    this.init()
+  },
+  watch: {
+    projectId() {
+      this.init()
+    }
+  }
+}
+</script>