Просмотр исходного кода

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

yangjunjing 4 лет назад
Родитель
Сommit
46aa2c9f70

+ 10 - 3
src/api/scan/request.js

@@ -1460,11 +1460,18 @@ export function buildingQueryAndCount(param, success) {
 
 //创建分区信息
 export function createZone(param, success) {
-  let data = param.data
-  let url = `${baseUrl}/datacenter/${zone[param.zone]}/create`;
-  http.postJson(url, data, success)
+    let data = param.data
+    let url = `${baseUrl}/datacenter/${zone[param.zone]}/create`;
+    http.postJson(url, data, success)
 }
 
+//创建分区信息
+// export function createZone(param, success) {
+//     let data = param.data
+//     let url = `${baseUrl}/datacenter/${zone[param.zone]}/create-bd-fl`;
+//     http.postJson(url, data, success)
+// }
+
 //删除分区信息
 export function deleteZone(param, success) {
   let data = param.data

+ 12 - 6
src/components/business_space/business/handsontable.vue

@@ -346,13 +346,19 @@ export default {
         this.$message("新添加业务空间内容不能为空!")
         return
       }
-      if (this.buildFloorSelectd && this.buildFloorSelectd[0] && this.buildFloorSelectd[1]) {
-        param.BuildingId = this.buildFloorSelectd[0]
-        param.FloorId = this.buildFloorSelectd[1]
+      if (param.flowBuild) {
+        param.BuildingId = param.flowBuild.split('-')[0]
+        param.FloorId = param.flowBuild.split('-')[1] || null
+      } else {
+        if (this.buildFloorSelectd) {
+          if (this.buildFloorSelectd[0] != 'all' && this.buildFloorSelectd[0] != 'noKnow') {
+            param.BuildingId = this.buildFloorSelectd[0]
+          }
+          if (this.buildFloorSelectd[1] && this.buildFloorSelectd[1] != 'all' && this.buildFloorSelectd[1] != 'noKnow') {
+            param.FloorId = this.buildFloorSelectd[1]
+          }
+        }
       }
-      //  else if (this.buildMess.selectd && this.buildMess.selectd[0] && !this.buildMess.selectd[1]) {
-      //   param.BuildingId = this.buildMess.selectd[0]
-      // }
       let params = {
         zone: this.zoneCode,
         data: {

+ 4 - 0
src/components/business_space/newGraphy/createBSP.vue

@@ -26,6 +26,10 @@ export default {
     },
     // 确认
     confirm() {
+      if (this.roomName == '') {
+        this.$message.warning("请填写空间名称");
+        return
+      }
       this.$emit('createRoom', this.roomName);
       this.dialogVisible = false;
     }

Разница между файлами не показана из-за своего большого размера
+ 537 - 489
src/components/dialogs/list/batchDialog.vue


+ 210 - 116
src/components/relation/overview/CardList.vue

@@ -36,96 +36,114 @@
             >
               <!-- border:none-->
               <!--<div class="mask"></div>-->
-              <p class="relation-title">
-                {{relation.RelationTypeName}}
-                <span class="asc">边类型编码:{{relation.RelationTypeCode}}</span>
+              <div style="overflow: hidden">
                 <el-tooltip
-                    :content="relation.Note"
+                    :content="relation.RelationTypeName"
                     placement="top"
-                    style="z-index: 3;position:relative;"
                 >
-                  <i class="iconfont icon-warn icon"/>
+                  <p class="relation-title reset-test reset-title">{{relation.RelationTypeName}}</p>
                 </el-tooltip>
-              </p>
-              <article>
-                <el-col
-                    :span="13"
-                    class="main-object "
-                >
-                  <p class="object">主要连接对象</p>
-                  <p class="group">{{relation.ConneObject}}</p>
-                </el-col>
-                <el-col
-                    :span="1"
-                    class="main-object ">&nbsp;
-                </el-col>
-                <el-col
-                    :span="10"
-                    class="main-object"
-                >
-                  <p class="line-number">连接数量</p>
-                  <p class="line-number">{{relation.count}}</p>
-                </el-col>
-              </article>
-              <p class="last-computed">
-                <span v-show="relation.ComputationalState === 3 || relation.ComputationalState === 4">关系计算中...</span>
-                <span v-show="relation.ComputationalState === 5">计算失败</span>
-                <span v-show="relation.ComputingTime">最后一次计算时间 {{relation.ComputingTime}}</span>
                 <el-tooltip
-                    content="启动计算"
+                    :content="relation.RelationTypeCode"
                     placement="top"
                 >
-                  <el-badge
-                      class="item float-right"
-                      :is-dot="relation.ComputationalState === 2"
-                  >
-                    <el-button
-                        @click="computed(relation)"
-                        :disabled="!relation.IsSource && !relation.IsAutomatic"
-                        circle
-                        type="primary"
-                        plain
-                        icon="iconfont icon-changyongtubiao-mianxing-"
-
-                    >
-                      <!--style="background: #000;color: #fff"-->
-                    </el-button>
-                  </el-badge>
+                  <p class="asc reset-title reset-test">边类型编码:{{relation.RelationTypeCode}}</p>
                 </el-tooltip>
-                <el-tooltip
-                    content="手动编辑"
-                    placement="top"
-                >
-                  <el-button
-                      :disabled="relation.Manual === 1"
-                      :style="{'border':(relation.Manual=== 1? '1px solid #DCDFE6' :'')}"
-                      @click="manual(relation)"
-                      circle
-                      class="float-right"
-                      type="primary"
-                      plain
-                      icon="iconfont icon-bianji"
+                <p class="relation-title-icon reset-test fr">
+                  <el-tooltip
+                      :content="relation.Note"
+                      placement="top"
+                      style="z-index: 3;position:relative;"
                   >
-                  </el-button>
+                    <i class="iconfont icon-warn icon"/>
+                  </el-tooltip>
+                </p>
+              </div>
+              <article>
+                <el-row>
+                  <el-col :span="13" >
+                    <div class="grid-content">
+                      <p class="object">主要连接对象</p>
+                      <el-tooltip
+                          :content="relation.ConneObject"
+                          placement="top"
+                      >
+                        <p class="group reset-title">{{relation.ConneObject}}</p>
+                      </el-tooltip>
+                    </div>
+                  </el-col>
+                  <el-col :span="1">
+                    <div class="grid-content">
+                      <p class="thread"></p>
+                    </div>
+                  </el-col>
+                  <el-col :span="10">
+                    <div class="grid-content ">
+                      <p class="line-number">连接数量</p>
+                      <p :class="relation.count > 1? 'line-number-show' :'line-number-hide'">{{relation.count}}</p>
+                      <p class="last-computed">
+                        <span v-show="relation.ComputationalState === 3 || relation.ComputationalState === 4">关系计算中...</span>
+                        <span v-show="relation.ComputationalState === 5">计算失败</span>
+                        <span v-show="relation.ComputingTime">最后一次计算时间 {{relation.ComputingTime}}</span>
+                        <el-tooltip
+                            content="启动计算"
+                            placement="top"
+                        >
+                          <el-badge
+                              class="item float-right"
+                              :is-dot="relation.ComputationalState === 2"
+                          >
+                            <el-button
+                                @click="computed(relation)"
+                                :disabled="!relation.IsSource && !relation.IsAutomatic"
+                                circle
+                                type="primary"
+                                plain
+                                icon="iconfont icon-changyongtubiao-mianxing-"
 
-                </el-tooltip>
-                <el-tooltip
-                    content="设定设备对象源/末端"
-                    placement="top"
-                    v-if="relation.IsSource"
-                >
-                  <el-button
-                      @click="equipment"
-                      type="primary"
-                      plain
-                      circle
-                      class="float-right"
-                      icon="iconfont icon-23 "
-                      style="transform: rotate(90deg);"
-                  >
-                  </el-button>
-                </el-tooltip>
-              </p>
+                            >
+                              <!--style="background: #000;color: #fff"-->
+                            </el-button>
+                          </el-badge>
+                        </el-tooltip>
+                        <el-tooltip
+                            content="手动编辑"
+                            placement="top"
+                        >
+                          <el-button
+                              :disabled="relation.Manual === 1"
+                              :style="{'border':(relation.Manual=== 1? '1px solid #DCDFE6' :'')}"
+                              @click="manual(relation)"
+                              circle
+                              class="float-right"
+                              type="primary"
+                              plain
+                              icon="iconfont icon-bianji"
+                          >
+                          </el-button>
+
+                        </el-tooltip>
+                        <el-tooltip
+                            content="设定设备对象源/末端"
+                            placement="top"
+                            v-if="relation.IsSource"
+                        >
+                          <el-button
+                              @click="equipment"
+                              type="primary"
+                              plain
+                              circle
+                              class="float-right"
+                              icon="iconfont icon-23 "
+                              style="transform: rotate(90deg);"
+                          >
+                          </el-button>
+                        </el-tooltip>
+                      </p>
+                    </div>
+                  </el-col>
+                </el-row>
+              </article>
             </el-card>
           </el-col>
         </el-row>
@@ -187,7 +205,7 @@
           downloadFile: ' 下载报告文件'
         },
         isComputed: {}, // 当前要计算的对象
-        ManualMaintenance:{},//手动编辑对象
+        ManualMaintenance: {},//手动编辑对象
       }
     },
     computed: {},
@@ -197,7 +215,7 @@
         // alert('explain click')
       },
       RelationType() {
-        this.$emit('RelationType',this.isComputed.RelationType, this.isComputed.ZoneType)
+        this.$emit('RelationType', this.isComputed.RelationType, this.isComputed.ZoneType)
 
       },
       computed(relation) {
@@ -218,16 +236,16 @@
       manual(relation) {
         let {Manual, Prompting, RelationTypeName, ComputingTime} = relation;
         let device = Prompting && Prompting.split(','),
-          tips= `请前往以下功能页面维护 <${RelationTypeName}>`,
-          optionTips= `请下载最新最新 <${RelationTypeName}> 数据进行手动维护`,
-          lastTime=`最后更新时间为 ${ComputingTime ? ComputingTime : ''}`
+          tips = `请前往以下功能页面维护 <${RelationTypeName}>`,
+          optionTips = `请下载最新最新 <${RelationTypeName}> 数据进行手动维护`,
+          lastTime = `最后更新时间为 ${ComputingTime ? ComputingTime : ''}`
 
         if (Manual === 2) {
-          this.values={...this.values,device,tips}
+          this.values = {...this.values, device, tips}
           this.$refs.maintain.dialogManualTip = true
         }
         if (Manual === 3) {
-          this.values={...this.values,optionTips,lastTime}
+          this.values = {...this.values, optionTips, lastTime}
           this.$refs.maintain.dialogManualOption = true
         }
         this.ManualMaintenance = relation
@@ -252,6 +270,7 @@
   @pos-absolute: absolute;
   @pos-zero: 0;
   @5px: 5px;
+
   .slave-relation-title {
     color: @font-code;
     font-weight: 600;
@@ -260,15 +279,75 @@
   }
 
   .container {
+    @media (max-width: 1366px) {
+      .relation-title {
+        max-width: 160px;
+      }
+
+      .group {
+        white-space: normal !important;
+      }
+
+      .asc {
+        max-width: 108px;
+      }
+      .thread{
+        margin-left: 5px !important;
+      }
+      /deep/.el-card__body {
+        padding: 18px !important;
+      }
+    }
+    .el-row {
+      margin-bottom: 20px;
+
+      &:last-child {
+        margin-bottom: 0;
+      }
+    }
+
+    .el-col {
+      border-radius: 4px;
+    }
+
+    .grid-content {
+      border-radius: 4px;
+      min-height: 36px;
+
+      .thread {
+        border-left: 1px solid @font-code;
+        margin-left: 10px;
+        min-height: 36px;
+        margin-top: 6px;
+      }
+    }
+
+    .row-bg {
+      padding: 10px 0;
+      background-color: #f9fafc;
+    }
+
+    .reset-title {
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+    }
+
+    .reset-test {
+      float: left;
+      text-align: center;
+      height: 40px;
+      line-height: 40px;
+    }
+
+    .fr {
+      float: right;
+    }
+
     .el-card {
-      /*border: 1px solid #000;*/
       margin: 10px 0;
     }
 
-    /*.el-button {*/
-    /*    border: 1px solid #000;*/
-    /*}*/
-
     .relation-text {
       overflow: hidden;
       margin-top: 10px;
@@ -303,11 +382,20 @@
     .relation-title {
       font-size: 20px;
       font-weight: @font-big;
+      margin-right: 10px;
 
-      .asc {
-        font-size: @font-small;
-        color: @font-code;
+      .icon {
+        display: block;
+        float: right;
+        color: #555;
+        font-size: 18px;
       }
+    }
+
+    .relation-title-icon {
+      font-size: 20px;
+      font-weight: @font-big;
+      overflow: hidden;
 
       .icon {
         display: block;
@@ -317,34 +405,40 @@
       }
     }
 
-    .main-object {
-      margin: 15px 0;
-      padding-left: 0 !important;
+    .asc {
+      font-size: @font-small;
+      color: @font-code;
+    }
+    .object {
+      font-size: @font-small;
+      color: @font-code;
+      font-weight: @font-big;
+    }
 
-      &:nth-child(even) {
-        border-left: 1px solid @font-code;
-        margin-top: 27px;
-      }
+    .group {
+      color: @color-text;
+      font-weight: @font-big;
+    }
 
-      .object {
-        font-size: @font-small;
-        color: @font-code;
-        font-weight: @font-big;
-      }
+    .line-number {
+      font-size: @font-small;
+      color: @font-code;
+      font-weight: @font-big;
+    }
 
-      .group {
-        color: @color-text;
-        font-weight: @font-big;
-      }
+    .line-number-show {
+      color: @color-text;
+      font-weight: @font-big;
+    }
 
-      .line-number {
-        font-size: @font-small;
-        color: @font-code;
-        font-weight: @font-big;
-      }
+    .line-number-hide {
+      color: @font-code;
+      font-weight: @font-big;
     }
 
 
+
+
     article {
       overflow: hidden;
     }

+ 3 - 1
src/router/system.js

@@ -97,6 +97,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'
 
 /**市场及商务 */
 const OwnerManage = () =>
@@ -121,7 +122,8 @@ export default [{
         component: LayoutMain,
         children: [
             { path: 'index', component: dataUtil },
-            { path: 'index2', component: dataUtil2 }
+            { path: 'index2', component: dataUtil2 },
+            { path: 'checkJsonUtil', component: checkJsonUtil }
         ]
     },
     // 辅助屏

+ 255 - 0
src/views/business_space/dataUtil/checkJsonUtil.vue

@@ -0,0 +1,255 @@
+<template>
+  <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>