Browse Source

Merge branch 'msg-sever' into dev

haojianlong 5 years ago
parent
commit
612b8165f7

+ 3 - 3
package.json

@@ -26,9 +26,9 @@
         "vuex": "^3.1.0",
         "cad-engine": "2.0.250",
         "@saga-web/base": "2.1.9",
-        "@saga-web/draw": "2.1.58",
-        "@saga-web/graphy": "2.1.30",
-        "@saga-web/cad-engine": "2.0.406"
+        "@saga-web/draw": "2.1.61",
+        "@saga-web/graphy": "2.1.34",
+        "@saga-web/cad-engine": "2.0.420"
     },
     "devDependencies": {
         "ajv": "^6.9.1",

+ 38 - 11
src/components/business_space/newGraphy/graphy.vue

@@ -603,21 +603,48 @@ export default {
     // 根据图批量创建所选业务空间
     groupCreateZone() {
       let arr = this.scene.getSelectedSpaces();
-      let spaces = arr.map(t => {
-        return {
-          IspaceId: this.BIMIDToSID[t.data.SourceId],
-          RoomLocalName: t.data.Name,
-          Outline: [t.data.OutLine],
-          BuildingId: this.buildFloor[0],
-          FloorId: this.buildFloor[1],
-          Height: t.data.Height > 100 ? (t.data.Height / 1000).toFixed(2) : t.data.Height || 0
+      let spaces = [];
+      // 如果有划分,求交集
+      if (this.scene.cutItem || this.scene.sceneMark) {
+        let outlines = this.scene.getIntersectInSpace();
+        for (let k in outlines) {
+          outlines[k] = outlines[k].map(t => {
+            t = t.map(item => {
+              item = item.map(j => {
+                return { X: j.x, Y: -j.y, Z: 0 }
+              })
+              return item
+            })
+            return t;
+          })
         }
-      })
+        spaces = arr.map(t => {
+          return {
+            IspaceId: this.BIMIDToSID[t.data.SourceId],
+            RoomLocalName: t.data.Name,
+            Outline: outlines[t.data.SourceId],
+            BuildingId: this.buildFloor[0],
+            FloorId: this.buildFloor[1],
+            Height: t.data.Height > 100 ? (t.data.Height / 1000).toFixed(2) : t.data.Height || 0
+          }
+        }).filter(item => item.Outline && item.Outline.length)
+      } else {
+        spaces = arr.map(t => {
+          return {
+            IspaceId: this.BIMIDToSID[t.data.SourceId],
+            RoomLocalName: t.data.Name,
+            Outline: [t.data.OutLine],
+            BuildingId: this.buildFloor[0],
+            FloorId: this.buildFloor[1],
+            Height: t.data.Height > 100 ? (t.data.Height / 1000).toFixed(2) : t.data.Height || 0
+          }
+        })
+      }
       if (spaces.length) {
         this.canvasLoading = true;
         this.groupCreateBSP(spaces)
       } else {
-        this.$message.warning('未选择空间');
+        this.$message.warning('未选择本层空间');
       }
     },
     // 更新业务空间和元空间的关系
@@ -752,7 +779,7 @@ export default {
     },
     // 框选
     groupSelect() {
-      this.scene.isRectSelection = true;
+      this.scene.isRectSelection = 1;
     },
     // 适配底图到窗口
     fit() {

+ 37 - 38
src/views/ledger/cenotelist/index.vue

@@ -26,15 +26,8 @@
         <handson-table ref="table"></handson-table>
       </div>
     </div>
-    <el-pagination
-      class="right"
-      v-show="tableData && tableData.length"
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
-      :current-page="page.pageNumber"
-      :page-sizes="page.pageSizes"
-      :page-size="page.pageSize"
-      layout="total, sizes, prev, pager, next, jumper"
+    <el-pagination class="right" v-show="tableData && tableData.length" @size-change="handleSizeChange" @current-change="handleCurrentChange"
+      :current-page="page.pageNumber" :page-sizes="page.pageSizes" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper"
       :total="page.total">
     </el-pagination>
     <!-- 不支持的输入方式 -->
@@ -59,7 +52,7 @@ import showTools from "@/utils/handsontable/notShow"
 import text from "@/utils/handsontable/mainText"
 import cenoteType from "@/components/ledger/lib/cenoteType";
 import handsonTable from "@/components/common/handsontable";
-import { getDataDictionary, getCenoteTableData, updataCenoteTableData, deleteCenoteTableData, saveCenoteRelateSpace, BeatchQueryParam } from "@/api/scan/request"
+import { getDataDictionary, queryCenoteTableData, updataCenoteTableData, deleteCenoteTableData, saveCenoteRelateSpace, BeatchQueryParam } from "@/api/scan/request"
 import { mapGetters, mapActions } from "vuex";
 export default {
   components: {
@@ -90,11 +83,11 @@ export default {
       },
       tableData: [],
       copyTableData: [],
-      tableExample:null,
+      tableExample: null,
       myDialog: {
         update: false,//临时维护信息点
       },
-      inputMap: { }, //信息点和输入方式映射表
+      inputMap: {}, //信息点和输入方式映射表
       updateInputShow: false, //是否显示临时维护输入框
       updateInfoPoint: '',//临时维护信息点
       updateInput: '', //临时维护信息点值
@@ -102,14 +95,14 @@ export default {
   },
   computed: {
     ...mapGetters("layout", [
-        "projectId",
-        "secret",
-        "userId"
+      "projectId",
+      "secret",
+      "userId"
     ]),
-    showTypes () {
-      return this.onlyRead?
-        [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]:
-        [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]
+    showTypes() {
+      return this.onlyRead ?
+        [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }] :
+        [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }]
     }
   },
   created() {
@@ -142,7 +135,7 @@ export default {
       await getDataDictionary(param, res => {
         this.tableHeader = res.Content;
         this.tableHeader.forEach(item => {
-          if(item.Path && item.InputMode){
+          if (item.Path && item.InputMode) {
             this.inputMap[item.Path] = item.InputMode
           }
         })
@@ -151,17 +144,18 @@ export default {
     },
     async getTableData() {//获取表格数据
       let params = {
-        Filters: this.cenoteId? `ProjectId='${this.projectId}';structureInfo.ShaftFuncType='${this.cenoteId}'`: `ProjectId='${this.projectId}'`,
+        Cascade: [{ Name: 'spaceList' }],
+        Filters: this.cenoteId ? `ProjectId='${this.projectId}';structureInfo.ShaftFuncType='${this.cenoteId}'` : `ProjectId='${this.projectId}'`,
         Orders: "createTime desc, ShaftID asc",
         PageNumber: this.page.pageNumber,
         PageSize: this.page.pageSize
       }
-      await getCenoteTableData(params, (res) => {
+      await queryCenoteTableData(params, (res) => {
         this.tableData = res.Content
         this.copyTableData = tools.deepCopy(res.Content)
         this.page.pageNumber = res.PageNumber
         this.page.total = res.Total
-        if(this.tableData && this.tableData.length){
+        if (this.tableData && this.tableData.length) {
           if (this.onlyRead) {
             this.getBatch(res.Content)
           }
@@ -175,7 +169,7 @@ export default {
         Content: [],
         Projection: []
       }, keyList = [];
-       //生成要修改字段列表
+      //生成要修改字段列表
       change.map(item => {
         let key = item[1].split(".")[0]
         if (item[1] && keyList.indexOf(key) == -1) {
@@ -223,7 +217,7 @@ export default {
     },
     // 添加竖井
     handleCreateTableData() {
-      this.$router.push({ name: 'cenoteadd'})
+      this.$router.push({ name: 'cenoteadd' })
     },
     // 删除表格行
     handleDeleteTableRow() {
@@ -233,7 +227,7 @@ export default {
       }
       let param = []
       params.map(item => {
-        param.push({ShaftID: item.ShaftID})
+        param.push({ ShaftID: item.ShaftID })
       })
       this.$confirm("此操作将删除竖井,是否继续?", "提示", {
         confirmButtonText: '确定',
@@ -297,10 +291,14 @@ export default {
       let arr = tools.copyArr(list);
       let data = showTools.headerTypeFilter(arr, "shaft", this.onlyRead, this.showType)
       data.unshift({
-        data: "SpaceCount",
-        renderer: tools.num,
+        data: "SpaceList",
+        renderer: (instance, td, row, col, prop, value, cellProperties) => {
+          td.style.color = "#409EFF";
+          td.innerHTML = `<span>${value?value.length:0}</span>`
+          return td;
+        },
         readOnly: true
-      },{
+      }, {
         data: "OtheRelations",
         renderer: (instance, td, row, col, prop, value, cellProperties) => {
           td.style.color = "#409EFF";
@@ -343,13 +341,13 @@ export default {
       //其他的开始判断
       let val = this.tableExample.colToProp(row.col)
       let inputMode = this.inputMap[val]
-      let name = infos.ShaftLocalName?infos.ShaftLocalName:infos.ShaftName
+      let name = infos.ShaftLocalName ? infos.ShaftLocalName : infos.ShaftName
       this.shaftId = infos.ShaftID //要操作的数据id
       //点击关联的元空间
-      if (val === "SpaceCount") {
+      if (val === "SpaceList") {
         this.$router.push({
-          path:'/ledger/relatedSpace',
-          query:{ShaftId: this.shaftId,name:name,onlyRead:this.onlyRead}
+          path: '/ledger/relatedSpace',
+          query: { ShaftId: this.shaftId, name: name, onlyRead: this.onlyRead }
         })
         return false
       } else if (val === "OtheRelations") {
@@ -375,7 +373,7 @@ export default {
       this.updateInput = ''
     },
     //更新临时维护信息点
-    handleClickUpdate(){
+    handleClickUpdate() {
       tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
       this.handleUpdataTable([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
       this.updateInputShow = false
@@ -489,7 +487,7 @@ export default {
                         item,
                         head.Path,
                         // child.error ? "表号功能号格式错误" : "表号功能号不存在"
-                        child.error ? child.value? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据"
+                        child.error ? child.value ? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据"
                       );
                     }
                   });
@@ -535,7 +533,7 @@ export default {
       padding: 5px 15px;
       margin-right: 5px;
       box-shadow: 0px 1px 5px 0px rgba(59, 66, 84, 0.15);
-      .table_right_box::after{
+      .table_right_box::after {
         display: block;
         content: "";
         clear: both;
@@ -547,7 +545,8 @@ export default {
     }
   }
 }
-.el-pagination button, .el-pagination span:not([class*=suffix]) {
-    vertical-align: middle;
+.el-pagination button,
+.el-pagination span:not([class*="suffix"]) {
+  vertical-align: middle;
 }
 </style>