Browse Source

Merge branch 'dev' of http://39.106.8.246:3003/web/ibms into dev

 Conflicts:
	src/components/ledger/details/detail/exhibitionBaseInformation.vue
shaun-sheep 5 years ago
parent
commit
604dce31d5

+ 3 - 3
config/dev.env.js

@@ -4,11 +4,11 @@ const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
     NODE_ENV: '"development"',
-    // BASE_URL: '"http://192.168.20.215"', //测试iframe地址
-    // SSO_SERVER: '"http://192.168.20.235:8081"', //测试环境
+    // BASE_URL: '"http://172.16.44.215"', //测试iframe地址
+    // SSO_SERVER: '"http://172.16.44.235:8081"', //测试环境
     // BASE_URL: '"http://192.168.20.236"', //(新)测试iframe地址
     // SSO_SERVER: '"http://192.168.20.236:8086"', //(新)测试环境
-    // MQTT_SERVICE: '"ws://192.168.20.225:61614/stomp/"' //MQ测试环境地址
+    // MQTT_SERVICE: '"ws://172.16.42.210:61614/stomp/"' //MQ测试环境地址
     SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
     BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
     MQTT_SERVICE: '"ws://adm.sagacloud.cn/stomp/"' //MQ正式环境地址

+ 11 - 11
config/index.js

@@ -101,14 +101,14 @@ module.exports = {
 
     // proxyTable: {
     //     '/admin': {
-    //         target: 'http://192.168.20.235:8080',
+    //         target: 'http://172.16.44.235:8080',
     //         changeOrigin: true,
     //         pathRewrite: {
     //             "^/admin": "/"
     //         }
     //     },
     //     '/api': {
-    //         target: 'http://192.168.20.235:8080',
+    //         target: 'http://172.16.44.235:8080',
     //         changeOrigin: true,
     //         pathRewrite: {
     //             "^/api": "/"
@@ -116,7 +116,7 @@ module.exports = {
     //     },
     //     '/data-platform-3': {
     //         // 目标 API 地址
-    //         target: 'http://192.168.20.225:8080/',
+    //         target: 'http://172.16.42.210:8080/',
     //         // 如果要代理 websockets
     //         ws: true,
     //         // 将主机标头的原点更改为目标URL
@@ -124,7 +124,7 @@ module.exports = {
     //     },
     //     '/business-space': {
     //         // 目标 API 地址
-    //         target: 'http://192.168.20.225:8080/',
+    //         target: 'http://172.16.42.210:8080/',
     //         // 如果要代理 websockets
     //         ws: true,
     //         // 将主机标头的原点更改为目标URL
@@ -132,7 +132,7 @@ module.exports = {
     //     },
     //     '/pointconfig': {
     //         // 目标 API 地址
-    //         target: 'http://192.168.20.236:8080/',
+    //         target: 'http://172.16.44.235:8080/',
     //         // 如果要代理 websockets
     //         ws: true,
     //         // 将主机标头的原点更改为目标URL
@@ -140,7 +140,7 @@ module.exports = {
     //     },
     //     '/venders-dp': {
     //         // 目标 API 地址
-    //         target: 'http://192.168.20.225:8080/',
+    //         target: 'http://172.16.42.210:8080/',
     //         // 如果要代理 websockets
     //         ws: true,
     //         // 将主机标头的原点更改为目标URL
@@ -148,7 +148,7 @@ module.exports = {
     //     },
     //     '/venders': {
     //         // 目标 API 地址
-    //         target: 'http://192.168.20.225:8080/',
+    //         target: 'http://172.16.42.210:8080/',
     //         // 如果要代理 websockets
     //         ws: true,
     //         // 将主机标头的原点更改为目标URL
@@ -156,7 +156,7 @@ module.exports = {
     //     },
     //     '/ScanBuilding': {
     //         // 目标 API 地址
-    //         target: 'http://192.168.20.236:8080/',
+    //         target: 'http://172.16.44.235:8080/',
     //         // 如果要代理 websockets
     //         ws: true,
     //         // 将主机标头的原点更改为目标URL
@@ -164,7 +164,7 @@ module.exports = {
     //     },
     //     '/image-service': {
     //         // 目标 API 地址
-    //         target: 'http://192.168.20.225:8080/',
+    //         target: 'http://172.16.42.210:8080/',
     //         // 如果要代理 websockets
     //         ws: true,
     //         // 将主机标头的原点更改为目标URL
@@ -172,14 +172,14 @@ module.exports = {
     //     },
     //     '/godhand': {
     //         // 目标 API 地址
-    //         target: 'http://192.168.20.225:8080/',
+    //         target: 'http://172.16.42.210:8080/',
     //         // 如果要代理 websockets
     //         ws: true,
     //         // 将主机标头的原点更改为目标URL
     //         changeOrigin: false
     //     },
     //     '/modelapi': {
-    //         target: 'http://192.168.20.225:8082',
+    //         target: 'http://192.168.0.2:8082',
     //         // target: 'http://192.168.20.218:8082',//景灏
     //         changeOrigin: true,
     //         pathRewrite: {

+ 3 - 3
config/prod.env.js

@@ -1,11 +1,11 @@
 'use strict'
 module.exports = {
     NODE_ENV: '"production"',
-    BASE_URL: '"http://192.168.20.215"', //测试iframe地址
-    SSO_SERVER: '"http://192.168.20.235:8081"', //测试环境
+    BASE_URL: '"http://172.16.44.215"', //测试iframe地址
+    SSO_SERVER: '"http://172.16.44.235:8081"', //测试环境
     // BASE_URL: '"http://192.168.20.236"', //(新)测试iframe地址
     // SSO_SERVER: '"http://192.168.20.236:8086"', //(新)测试环境
-    MQTT_SERVICE: '"ws://192.168.20.225:61614/stomp/"' //MQ测试环境地址
+    MQTT_SERVICE: '"ws://172.16.42.210:61614/stomp/"' //MQ测试环境地址
     // BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
     // SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
     // MQTT_SERVICE: '"ws://adm.sagacloud.cn/stomp/"' //MQ正式环境地址

+ 3 - 3
src/components/ledger/details/detail/exhibitionBaseInformation.vue

@@ -59,7 +59,7 @@
         <el-button slot="reference" type="text">{{value.Value ? '有' :'-'}}</el-button>
       </el-popover>
       <el-popover
-        v-else-if="value.Value && value.Value.length  && `${value.InfoPointName}:${value.Value}`.length>23 "
+        v-else-if="value.Value && value.Value.length  && `${value.InfoPointName}:${value.Value}`.length>22 "
         placement="right"
         width="160"
         trigger="hover">
@@ -99,7 +99,7 @@
       },
       handleName(infoPoint, val) {
         let text = `${infoPoint}:${val}`
-        return text.length > 23 ? val.substring(0, 23-`${infoPoint}:`.length) + '...' : val
+        return text.length > 22 ? val.substring(0, 22-`${infoPoint}:`.length) + '...' : val
       }
     }
   }
@@ -130,7 +130,7 @@
     }
 
     .infoPoint-item {
-      width: 350px;
+      width: 335px;
       display: inline-block;
       margin-left: 20px;
     }

+ 3 - 1
src/components/ledger/details/detail/exhibitionEnergy.vue

@@ -43,7 +43,9 @@
     .table-dynamic {
       height: 85px;
       width: 100%;
-      margin: 5px 5px 5px 20px;
+      margin: 5px 0;
+      padding-left: 20px;
+      box-sizing: border-box;
     }
 
     .table-title {

+ 1 - 1
src/components/ready/buildfloor/addConnectivity.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-dialog title="楼层贯通关系维护" :visible.sync="connectDialogVis" width="50%" id="messageDialog">
+  <el-dialog title="楼层贯通关系维护" :visible.sync="connectDialogVis" width="730px" id="messageDialog">
     <el-row>
       <div style="line-height:32px;">添加与{{floor.FloorLocalName}}层有贯通关系的楼层 : </div>
       <div style="width:70%">

+ 3 - 1
src/router/system.js

@@ -85,6 +85,7 @@ import integrateResults from '@/views/screen/splitScreen/integrateresults'
 import dataUtil from '@/views/business_space/dataUtil/index'
 import dataUtil2 from '@/views/business_space/dataUtil/index2'
 import checkJsonUtil from '@/views/business_space/dataUtil/checkJsonUtil'
+import topology from '@/views/business_space/dataUtil/topology'
 
 /**市场及商务 */
 const OwnerManage = () =>
@@ -110,7 +111,8 @@ export default [{
         children: [
             { path: 'index', component: dataUtil },
             { path: 'index2', component: dataUtil2 },
-            { path: 'checkJsonUtil', component: checkJsonUtil }
+            { path: 'checkJsonUtil', component: checkJsonUtil },
+            { path: 'topology', component: topology },
         ]
     },
     // 辅助屏

+ 256 - 0
src/views/business_space/dataUtil/topology.vue

@@ -0,0 +1,256 @@
+<template>
+  <!-- 拓扑图demo -->
+  <el-container>
+    <el-aside width="200px" class="el-scrollbar">
+      <div style="height: 300px;">
+        <el-input type="textarea" v-model="ModelID" placeholder='输入业务空间轮廓线,三维数组,X,Y,Z均为大写;或者模型ID' style="height: 100%;"></el-input>
+      </div>
+      <div title="上传json文件">
+        <el-button size="mini" @click="clickInputFile" icon="el-icon-upload"></el-button>
+        <input type="file" @change="filechange" ref="file">
+      </div>
+      <div title="适配底图">
+        <el-button size="mini" @click="fitClick" icon="el-icon-crop"></el-button>
+      </div>
+      <div title="切割">
+        <el-button size="mini" @click="cut" icon="el-icon-edit"></el-button>
+      </div>
+      <div title="清除">
+        <el-button size="mini" @click="clear" icon="el-icon-refresh-left"></el-button>
+      </div>
+      <div title="定位">
+        <el-button size="mini" @click="location" icon="el-icon-position"></el-button>
+      </div>
+      <div title="开启/关闭吸附">
+        <el-button size="mini" @click="absorb" icon="el-icon-price-tag"></el-button>
+      </div>
+      <div title="矩形选择">
+        <el-button size="mini" @click="rectSelection" icon="el-icon-mouse"></el-button>
+      </div>
+      <div title="通过模型ID生成平面图">
+        <el-button size="mini" icon="el-icon-s-promotion" @click="modelChange"></el-button>
+      </div>
+      <div title="通过轮廓线生成业务空间">
+        <el-button size="mini" @click="showOutline" icon="el-icon-magic-stick"></el-button>
+      </div>
+      <div title="打印">
+        <el-button size="mini" @click="console" icon="el-icon-printer"></el-button>
+      </div>
+    </el-aside>
+    <el-main>
+      <div ref="graphy" v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
+        element-loading-background="rgba(0, 0, 0, 0.8)" style="height: 100%">
+        <canvas id="bg" :width="canvasWidth" :height="canvasHeight" ref="canvas" tabindex="0"></canvas>
+      </div>
+    </el-main>
+  </el-container>
+</template>
+<script>
+
+import { SGraphyScene } from "@saga-web/graphy/lib/";
+import { DivideFloorScene, LocationPointScene } from "@saga-web/cad-engine/lib";
+import { FloorView } from "@saga-web/cad-engine/lib/FloorView";
+export default {
+  data() {
+    return {
+      view: null,
+      scene: null,
+      flag: undefined,
+      show: true,
+      loading: false,
+      canvasWidth: 800,
+      canvasHeight: 800,
+      ModelID: "4cea832a217c11ea962ac576d98e7540"
+    }
+  },
+  mounted() {
+    this.canvasWidth = this.$refs.graphy.offsetWidth;
+    this.canvasHeight = this.$refs.graphy.offsetHeight;
+    this.createGraphy();
+    document.onkeydown = E => {
+      console.log(E)
+    }
+    window.onresize = () => {
+      this.canvasWidth = this.$refs.graphy.offsetWidth;
+      this.canvasHeight = this.$refs.graphy.offsetHeight;
+    }
+  },
+  beforeCreate() {
+    // 读取文件
+    FileReader.prototype.reading = function ({ encode } = pms) {
+      let bytes = new Uint8Array(this.result);    //无符号整型数组
+      let text = new TextDecoder(encode || 'UTF-8').decode(bytes);
+      return text;
+    };
+    /* 重写readAsBinaryString函数 */
+    FileReader.prototype.readAsBinaryString = function (f) {
+      if (!this.onload)       //如果this未重写onload函数,则创建一个公共处理方式
+        this.onload = e => {  //在this.onload函数中,完成公共处理
+          let rs = this.reading();
+          console.log(rs);
+        };
+      this.readAsArrayBuffer(f);  //内部会回调this.onload方法
+    };
+  },
+  methods: {
+    createGraphy() {
+      let that = this;
+      // this.disableRightButton()
+      this.clearGraphy()
+      that.scene = new DivideFloorScene();
+      this.loading = true;
+      that.scene.getFloorData('/modelapi/base-graph/query', { ModelId: this.ModelID }).then(res => {
+        if (res.Result == 'failure') {
+          this.$message.warning(res.Message)
+        }
+        console.log(res)
+        that.view.scene = that.scene;
+        that.view.fitSceneToView();
+        this.loading = false;
+      }).catch(err => {
+        console.log(err)
+      })
+    },
+    // 清除canvas
+    clearGraphy() {
+      if (this.view) {
+        this.view.scene = null;
+        return
+      }
+      this.view = new FloorView('bg')
+    },
+    fitClick() {
+      this.view.fitSceneToView();
+    },
+    showSpace() {
+      this.show = !this.show
+      // this.scene.isShowDoor = this.show
+      // this.scene.isShowSpace = this.show
+      this.scene.spaceList.map(t => {
+        if (!t.selected) {
+          t.visible = false;
+        }
+      })
+      this.scene.isShowColumn = this.show
+      // Opt.spaceColor = new SColor(100,100,100,100);
+    },
+    disableRightButton() {
+      this.$refs.canvas.addEventListener('contextmenu', (e) => {
+        console.log(e)
+        e.preventDefault();
+      })
+      this.scene.isShowSpace = false
+    },
+    cut() {
+      this.scene.isMarking = true;
+      console.log(this.scene)
+    },
+    console() {
+      console.log(this.scene.getSelectedSpaces())
+      this.scene.isShowColumn = false
+      this.scene.isShowWall = false
+    },
+    clear() {
+      this.scene.clearSceneMark()
+    },
+    location() {
+      // console.log(this)
+      this.view.fitSelectedToView()
+    },
+    move() {
+      this.view.isMoving = !this.view.isMoving;
+    },
+    absorb() {
+      this.scene.isAbsorbing = !this.scene.isAbsorbing;
+    },
+    rectSelection() {
+      this.scene.isRectSelection = 1;
+      console.log(this.scene)
+    },
+    showOutline() {
+      try {
+        let outline = JSON.parse(this.ModelID)
+        console.log(outline)
+        let obj = {
+          RoomLocalName: '哈哈哈哈',
+          OutLine: outline,
+          RoomID: 12312,
+          Color: "#006bd6",
+          Height: 5000,
+          HeightLightFlag: true
+        }
+        this.scene.removeAllZone()
+        this.scene.addZone(obj);
+        this.scene.zoneList[0].selected = true;
+        this.view.fitSelectedToView();
+      } catch (err) {
+        alert('格式不正确')
+      }
+    },
+    filechange(e) {
+      let file = e.target.files[0]
+      this.read(file)
+    },
+    read(f) {
+      let rd = new FileReader();
+      this.loading = true;
+      rd.onload = e => {
+        //this.readAsArrayBuffer函数内,会回调this.onload函数。在这里处理结果
+        let cont = rd.reading({ encode: 'UTF-8' });
+        let res = JSON.parse(cont);
+        this.JSON = res;
+        this.loadRes()
+      };
+      rd.readAsBinaryString(f);
+    },
+    loadRes() {
+      if (this.JSON) {
+        this.view.scene = null;
+        this.scene = new DivideFloorScene();
+        this.scene.addBaseMapItem(this.JSON.EntityList[0].Elements)
+        this.view.scene = this.scene;
+        console.log(this.scene)
+        this.view.fitSceneToView();
+      }
+      this.loading = false;
+    },
+    modelChange() {
+      console.log(this.ModelID)
+      this.createGraphy();
+    },
+    clickInputFile() {
+      this.$refs.file.click()
+    },
+  },
+}
+</script>
+<style lang="less" scoped>
+.el-container {
+  background: #fff;
+
+  /deep/ textarea.el-textarea__inner {
+    width: 100%;
+    height: 100% !important;
+  }
+
+  .el-aside {
+    padding: 10px;
+    border: 1px solid #e4e4e4;
+  }
+
+  .el-aside > div {
+    margin: 10px auto;
+    text-align: right;
+  }
+
+  .el-main {
+    padding: 10px !important;
+    border: 1px solid #e4e4e4;
+    border-left: none;
+  }
+
+  input[type="file"] {
+    display: none;
+  }
+}
+</style>

+ 1 - 1
src/views/ledger/facility/details/index.vue

@@ -558,7 +558,7 @@
           }
 
           .content-point-right {
-            width: 350px;
+            width: 300px;
             border-left: 1px solid #ccc;
           }
         }

+ 1 - 1
src/views/ledger/spacelist/spaceDetail/index.vue

@@ -583,7 +583,7 @@
             flex: 1;
           }
           .content-point-right {
-            width: 350px;
+            width: 300px;
             border-left: 1px solid #ccc;
           }
         }

+ 9 - 3
src/views/ready/buildfloor/index.vue

@@ -108,7 +108,7 @@
     <!-- 添加贯通关系弹窗 -->
     <addConnectivity @refresh="refresh" ref="addConnectivity"/>
     <!-- 查看图片弹窗 -->
-    <checkGraphy :alreadyRelatedModel='alreadyRelatedModel' @refresh="refresh" ref="checkGraphy"></checkGraphy>
+    <checkGraphy :alreadyRelatedModel='alreadyRelatedModel' @refresh="bindRefresh" ref="checkGraphy"></checkGraphy>
   </div>
 
 </template>
@@ -165,6 +165,7 @@
         alreadyRelatedModel: [],
         // currentType: 'add'
         buildMessage: {},
+        selectedBuildIndex: 0
       };
     },
     computed: {
@@ -187,12 +188,13 @@
         buildingQueryAndCount(bdParam, res => {
           this.buildList = res.Content;
           if (this.buildList.length) {
-            this.changeBuild(0);
+            this.changeBuild(this.selectedBuildIndex);
           }
         });
       },
       //change build
       changeBuild(index) {
+        this.selectedBuildIndex = index;
         this.buildList.map(item => {
           item.active = false;
           return item;
@@ -325,6 +327,10 @@
           }).filter(t => t);
         });
       },
+      // 绑定图以后刷新
+      bindRefresh() {
+        this.init();
+      },
       // 创建楼层成功-修改关系成功
       refresh() {
         this.getFloorTableData();
@@ -336,7 +342,7 @@
           manageDeleteFloor(delParam, res => {
             this.$message.success("删除成功");
             this.delDialogVis = false;
-            this.getFloorTableData();
+            this.init();
           });
         } else {
           //todo

+ 4 - 2
src/views/ready/buildfloor/repetitionGraphy.vue

@@ -4,7 +4,7 @@
     <div class="buttons">
       <el-button icon="el-icon-back" size="mini" @click="backRouter"></el-button>
       <el-button v-if="!isEdit" size="mini" @click="changeGraphy">替换平面图</el-button>
-      <el-button v-if="!isEdit" size="mini" @click="editGraphy">编辑平面图</el-button>
+      <el-button v-if="sign&&!isEdit" size="mini" @click="editGraphy">编辑平面图</el-button>
       <el-button v-if="isEdit" size="mini" @click="cancel">取消</el-button>
       <el-button v-if="isEdit" size="mini" @click="confirm" type="primary">确认</el-button>
       <span style="float:right;" v-if="file.FolderName">当前对应的模型文件:{{file.FolderName}} - {{file.FloorName}}</span>
@@ -32,7 +32,8 @@ export default {
       modelId: "", // 
       isEdit: false, // 是否编辑模式
       file: {},
-      alreadyRelatedModel: []
+      alreadyRelatedModel: [],
+      sign: false
     };
   },
   created() {
@@ -118,6 +119,7 @@ export default {
       floorQueryAndSign(floorParam, res => {
         this.alreadyRelatedModel = res.Content.map(t => {
           if (t.FloorID != this.FloorID) return t.ModelId
+          this.sign = t.Sign > 0
         }).filter(t => t);
       });
     },

+ 2 - 1
src/views/ready/collectsetting/index.vue

@@ -697,8 +697,9 @@
           let param = {
             data: {
               Orders: "sort asc,InfoPointCode asc",
+              Distinct: true,
               PageNumber: 1,
-              PageSize: 500
+              PageSize: 1000
             },
             type: code
           };