Bläddra i källkod

Merge branch 'details-component' of http://39.106.8.246:3003/web/ibms into details-component

 Conflicts:
	src/views/ledger/spacelist/spaceDetail/index.vue
shaun-sheep 5 år sedan
förälder
incheckning
53bd4a66a6
78 ändrade filer med 5668 tillägg och 2962 borttagningar
  1. 3 2
      config/dev.env.js
  2. 2 1
      config/prod.env.js
  3. 7 7
      package.json
  4. 23 0
      src/api/relation/api.js
  5. 137 5
      src/api/scan/request.js
  6. 788 670
      src/components/business_space/business/handsontable.vue
  7. 3 6
      src/components/business_space/dialogs/detailsDialog.vue
  8. 2 2
      src/components/business_space/dialogs/list/filesDialog.vue
  9. 29 8
      src/components/business_space/lib/uploadFiles.vue
  10. 83 53
      src/components/business_space/lib/uploadImgsName.vue
  11. 2 2
      src/components/business_space/newGraphy/canvasFun.vue
  12. 360 176
      src/components/business_space/newGraphy/graphy.vue
  13. 14 15
      src/components/business_space/newGraphy/unRelateBSP.vue
  14. 10 12
      src/components/business_space/newTables/eqToSpaceTable.vue
  15. 5 7
      src/components/business_space/newTables/syInSpaceTable.vue
  16. 29 9
      src/components/config_point/dictionaryCascader.vue
  17. 3 3
      src/components/config_point/step3_edit/auto_handle.vue
  18. 5 3
      src/components/config_point/step3_edit/enum_handle.vue
  19. 3 3
      src/components/config_point/step3_edit/formula_handle.vue
  20. 324 235
      src/components/config_point/step3_edit/index.vue
  21. 3 3
      src/components/config_point/step3_edit/no_handle.vue
  22. 2 0
      src/components/config_point/step3_edit/split_handle.vue
  23. 300 245
      src/components/config_point/step3_point/3_temps.vue
  24. 21 9
      src/components/data_admin/buildTask/dialog/modelTaskDialog.vue
  25. 13 14
      src/components/data_admin/buildTask/taskStatistics.vue
  26. 48 41
      src/components/ledger/addDialog/dialogZone.vue
  27. 256 0
      src/components/ledger/cenote/elevationMap.vue
  28. 1 2
      src/components/ledger/handsontables/device.vue
  29. 25 10
      src/components/ledger/lib/cenoteGraphy.vue
  30. 52 53
      src/components/ledger/lib/linkassets.vue
  31. 138 53
      src/components/model/file/versionDialog.vue
  32. 30 3
      src/components/point/dynamicdata/buildRules.vue
  33. 248 2
      src/components/point/dynamicdata/delRelationDialog.vue
  34. 1 1
      src/components/point/dynamicdata/dictionaryDevice.vue
  35. 41 4
      src/components/point/dynamicdata/equipRules.vue
  36. 33 3
      src/components/point/dynamicdata/floorRules.vue
  37. 99 24
      src/components/point/dynamicdata/locationCascader.vue
  38. 31 4
      src/components/point/dynamicdata/partsRules.vue
  39. 31 4
      src/components/point/dynamicdata/projectRules.vue
  40. 34 4
      src/components/point/dynamicdata/spaceRules.vue
  41. 31 4
      src/components/point/dynamicdata/systemRules.vue
  42. 38 3
      src/components/point/dynamicdata/tenantRules.vue
  43. 139 108
      src/components/point/report/integrateStatistics.vue
  44. 100 33
      src/components/point/report/objectInstance.vue
  45. 269 40
      src/components/ready/buildfloor/addBuild.vue
  46. 90 57
      src/components/ready/buildfloor/formItems.vue
  47. 56 0
      src/components/ready/buildfloor/uploadFile.vue
  48. 10 9
      src/components/relation/overview/CardList.vue
  49. 95 14
      src/components/relation/relationShip/Modal/addRelationShip.vue
  50. 13 13
      src/components/relation/relationShip/Modal/exportExcel.vue
  51. 25 0
      src/framework/style/layout.scss
  52. 3 0
      src/main.js
  53. 6 4
      src/utils/buildfloor/tools.js
  54. 5 8
      src/views/data_admin/buildGraphy/createPointZone.vue
  55. 9 9
      src/views/data_admin/buildGraphy/updatePointZone.vue
  56. 34 13
      src/views/data_admin/buildTask/addTask/addDeviceTask.vue
  57. 85 46
      src/views/ledger/cenotelist/relatedSpace.vue
  58. 10 10
      src/views/ledger/rentlist/manageTenantZone.vue
  59. 92 42
      src/views/ledger/spacelist/index.vue
  60. 2 2
      src/views/ledger/spacelist/spaceDetail/index.vue
  61. 185 128
      src/views/model/report/index.vue
  62. 5 1
      src/views/point/config_point/edit_origin/index.vue
  63. 18 11
      src/views/point/config_point/steps/step3.vue
  64. 39 36
      src/views/point/dynamicdata/addRelation/buildRela/index.vue
  65. 68 25
      src/views/point/dynamicdata/addRelation/equipRela/index.vue
  66. 50 39
      src/views/point/dynamicdata/addRelation/floorRela/index.vue
  67. 69 25
      src/views/point/dynamicdata/addRelation/partsRela/index.vue
  68. 31 36
      src/views/point/dynamicdata/addRelation/projectRela/index.vue
  69. 52 31
      src/views/point/dynamicdata/addRelation/spaceRela/index.vue
  70. 34 33
      src/views/point/dynamicdata/addRelation/systemRela/index.vue
  71. 65 32
      src/views/point/dynamicdata/addRelation/tenantRela/index.vue
  72. 1 1
      src/views/ready/buildfloor/addFloor/index.vue
  73. 2 1
      src/views/ready/buildfloor/drawGraphy/checkGraphy.vue
  74. 397 249
      src/views/ready/buildfloor/index.vue
  75. 8 9
      src/views/relation/overview/detail/index.vue
  76. 266 162
      src/views/relation/relationShip/index.vue
  77. 21 22
      src/views/screen/splitscreen/integrateresults/index.vue
  78. 6 8
      src/views/screen/splitscreen/spaceledger/index.vue

+ 3 - 2
config/dev.env.js

@@ -4,9 +4,10 @@ const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
     NODE_ENV: '"development"',
-    // BASE_URL: '"http://192.168.20.236"', //测试iframe地址
+    // BASE_URL: '"http://192.168.20.215"', //测试iframe地址
     // SSO_SERVER: '"http://192.168.20.235:8081"', //测试环境
-    // // SSO_SERVER: '"http://192.168.20.236:8086"', //(新)测试环境
+    // 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测试环境地址
     SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
     BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址

+ 2 - 1
config/prod.env.js

@@ -1,8 +1,9 @@
 'use strict'
 module.exports = {
     NODE_ENV: '"production"',
-    BASE_URL: '"http://192.168.20.236"', //测试iframe地址
+    BASE_URL: '"http://192.168.20.215"', //测试iframe地址
     SSO_SERVER: '"http://192.168.20.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测试环境地址
     // BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址

+ 7 - 7
package.json

@@ -19,21 +19,21 @@
     "publish": "node publish.js"
   },
   "dependencies": {
+    "@saga-web/base": "2.1.9",
+    "@saga-web/cad-engine": "2.0.537",
+    "@saga-web/draw": "2.1.75",
+    "@saga-web/graphy": "2.1.40",
     "axios": "^0.18.0",
     "echarts": "^4.1.0",
-    "element-ui": "^2.11.0",
+    "el-cascader-multi": "^1.1.8",
+    "element-ui": "^2.11.1",
     "font-awesome": "^4.7.0",
     "handsontable-pro": "^3.0.0",
     "jquery": "^3.3.1",
     "vue": "^2.5.2",
     "vue-axios": "^2.1.4",
     "vue-router": "^3.0.1",
-    "vuex": "^3.1.0",
-    "cad-engine": "2.0.250",
-    "@saga-web/base": "2.1.9",
-    "@saga-web/draw": "2.1.72",
-    "@saga-web/graphy": "2.1.34",
-    "@saga-web/cad-engine": "2.0.523"
+    "vuex": "^3.1.0"
   },
   "devDependencies": {
     "ajv": "^6.9.1",

+ 23 - 0
src/api/relation/api.js

@@ -134,3 +134,26 @@ export function dictUpdate(param, success) {
   let url = '/api/equip-component/dict-custom/update'
   httpUtil.postJson(url, param, success)
 }
+
+// 查询关系数据
+export function relQuery(param,success) {
+  let url = '/api/datacenter/relation-manual-calc/rel-query'
+  httpUtil.postJson(url,param,success)
+}
+//添加关系数据
+export function relAdd(data) {
+  let userName = storage.get("user_name")
+  let ProjectId = localStorage.getItem("projectId")
+  return fetch({
+    method: 'POST',
+    url: `/api/datacenter/relation-manual-calc/rel-add`,
+    data,
+    headers: {'ProjectId': ProjectId, 'Comming': 'adm', 'Account': userName}
+  })
+}
+
+//删除关系
+export function relDelete(param, success) {
+  let url = '/api/datacenter/relation-manual-calc/rel-del'
+  httpUtil.postJson(url, param, success)
+}

+ 137 - 5
src/api/scan/request.js

@@ -863,6 +863,12 @@ export function spaceInShaftUnlink(param, success) {
   http.postJson(url, param.data, success)
 }
 
+//查询竖井关联的空间垂直交通关系
+export function shaftVerticalSpace(param, success) {
+  let url = `${baseUrl}/equip-component/shaft/shaft-vertical-space`
+  http.postJson(url, param, success)
+}
+
 //获取租户表格内容信息
 export function getRentTableData(param, success) {
   let url = `${baseUrl}/datacenter/tenant/query-with-count`
@@ -886,6 +892,12 @@ export function queryRentTableData(param, success) {
     http.postJson(url, param, success)
 }
 
+//查询租户信息
+export function queryTenant(param, success) {
+  let url = `${baseUrl}/datacenter/object/tenant/query`
+  http.postJson(url, param, success)
+}
+
 //创建租户信息
 export function createRentTableData(param, success) {
   let url = `${baseUrl}/datacenter/tenant/create`
@@ -1450,6 +1462,42 @@ export function dynamicAutoRelate(param, success) {
   http.postJson(url, param, success)
 }
 
+//动态数据关联-(2020改版新增接口)已关联实例查询
+export function dynamicRelatedObj(param, success) {
+  let url = `${baseUrl}/pointconfig/dynamic/query-related-objs`;
+  http.postJson(url, param, success)
+}
+
+//动态数据关联-带关联实例(设备)
+export function dynamicEquipQuery(param, success) {
+  let url = `${baseUrl}/equip-component/equip-query/zone-query`;
+  http.postJson(url, param, success)
+}
+
+//动态数据关联-带关联实例(部件)
+export function dynamicPartQuery(param, success) {
+  let url = `${baseUrl}/equip-component/equip-query/zone-component-query`;
+  http.postJson(url, param, success)
+}
+
+//动态数据关联-带关联实例(租户)
+export function dynamicTenantQuery(param, success) {
+  let url = `${baseUrl}/equip-component/tenant/zone-query`;
+  http.postJson(url, param, success)
+}
+
+//查询部件
+export function partsQuery(param, success) {
+  let url = `${baseUrl}/datacenter/object/component/query`;
+  http.postJson(url, param, success)
+}
+
+//查询项目信息
+export function projectQuery(param, success) {
+  let url = `${baseUrl}/datacenter/project/query`;
+  http.postJson(url, param, success)
+}
+
 //查询楼层信息
 export function floorQuery(param, success) {
   let url = `${baseUrl}/datacenter/floor/query`;
@@ -1474,11 +1522,23 @@ export function buildingQueryAndCount(param, success) {
   http.postJson(url, param, success)
 }
 
+// 查询建筑楼层-统计业务空间state
+export function queryBFloorWithState(param, success) {
+  let url = `${baseUrl}/datacenter/object/zone/building-floor`;
+  http.postJson(url, param, success)
+}
+
+// 查询业务空间分区类型包含其他
+export function queryAllZoneType(param, success) {
+  let url = `${baseUrl}/datacenter/object/zone/type`;
+  http.postJson(url, param, 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)
+  let data = param.data
+  let url = `${baseUrl}/datacenter/${zone[param.zone]}/create-bd-fl`;
+  http.postJson(url, data, success)
 }
 
 //删除分区信息
@@ -1789,8 +1849,13 @@ export function shaftSpaceTypeQuery(param, success) {
   let url = `${baseUrl}/datacenter/sh-contain-sp-base/space-type-query?shaftId=${param.shaftId}`;
   http.postJson(url, param, success)
 }
-//关系-----竖井下的业务空间,竖井一对多,此方法会覆盖以前的记录
+//关系-----竖井下的业务空间,竖井一对多,此方法会覆盖以前的记录
 export function shaftZoneLink(param, success) {
+  let url = `${baseUrl}/datacenter/sh-contain-sp-base/link-shsps?type=${param.type}`;
+  http.postJson(url, param.data, success)
+}
+//关系-----竖井下的业务空间,竖井一对多,此方法会覆盖以前的记录
+export function shaftZoneLinkReplace(param, success) {
   let url = `${baseUrl}/datacenter/sh-contain-sp-base/link-shsps-replace?BuildingId=${param.BuildingId}&FloorId=${param.FloorId}&Type=${param.Type}`;
   http.postJson(url, param.data, success)
 }
@@ -1874,4 +1939,71 @@ export function postRelationInforAtpism(param, success) {
 export function getAllEqPaType(param, success) {
   let url = `${baseUrl}/datacenter/class-def/query-equip-comm-type`
   http.postJson(url, param, success)
-}
+}
+/********************更换接口**************************/
+// 查询空间信息
+export function getZoneQuery(param,success) {
+let url = `${baseUrl}/datacenter/class-def/query-equip-comm-type`
+  http.postJson(url,param,success)
+}
+//创建空间分类型
+export function zoneCreateType(param,success) {
+  let url = `${baseUrl}/datacenter/object/zone/create-type`
+  http.postJson(url,param,success)
+}
+//创建空间分区对象
+export function zoneCreate(param,success) {
+  let url = `${baseUrl}/datacenter/object/zone/create`
+  http.postJson(url,param,success)
+}
+
+//跟据id删除分区对象
+export function zoneDelete(param,success) {
+  let url = `${baseUrl}/datacenter/object/zone/delete`
+  http.postJson(url,param,success)
+}
+
+//更新分区对象信息
+export function zoneUpdate(param,success) {
+  let url = `${baseUrl}/datacenter/object/zone/update`
+  http.postJson(url,param,success)
+}
+//查询分区对象信息
+export function zoneQuery(param,success) {
+  let url = `${baseUrl}/datacenter/object/zone/query`
+  http.postJson(url,param,success)
+}
+//查询分区对象信息
+export function zoneCount(param,success) {
+  let url = `${baseUrl}/datacenter/object/zone/count`
+  http.postJson(url,param,success)
+}
+//修改业务空间对象和建筑楼层的关系
+export function handleZoneUpdateBd(param,success) {
+  let url = `${baseUrl}/datacenter/object/zone/update-fl-bd`
+  http.postJson(url,param,success)
+}
+
+
+//创建建筑信息
+export function objectCreateBuild(param, success) {
+  let url = `${baseUrl}/datacenter/object/building/create`
+  http.postJson(url, param, success)
+}
+
+//更新建筑信息
+export function objectUpdateBuild(param, success) {
+  let url = `${baseUrl}/datacenter/object/building/update`
+  http.postJson(url, param, success)
+}
+//查询建筑信息
+export function objectQueryBuild(param, success) {
+  let url = `${baseUrl}/datacenter/object/building/query`
+  http.postJson(url, param, success)
+}
+//根据id删除建筑信息
+export function objectDeleteBuild(param, success) {
+  let url = `${baseUrl}/datacenter/object/building/delete`
+  http.postJson(url, param, success)
+}
+

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 788 - 670
src/components/business_space/business/handsontable.vue


+ 3 - 6
src/components/business_space/dialogs/detailsDialog.vue

@@ -45,7 +45,7 @@
 </template>
 
 <script>
-    import { deleteZone } from "@/api/scan/request";
+    import { zoneCreate } from "@/api/scan/request";
     import equipTable from "@/components/business_space/table/equipTable";
     import addEquip from "@/components/business_space/table/addEquip";
     import {
@@ -151,11 +151,8 @@
                         type: "warning"
                     })
                     .then(() => {
-                        let param = {
-                            zone: this.activeTabType.code,
-                            data: [{RoomID: this.list.id}]
-                        }
-                        deleteZone(param, res => {
+                        let param = [{RoomID: this.list.id}];
+                        zoneCreate(param, res => {
                             if (res.Result == 'success') {
                                 this.$message({ type: "success",  message: "删除成功!" })
                                 this.$emit("del")

+ 2 - 2
src/components/business_space/dialogs/list/filesDialog.vue

@@ -57,9 +57,9 @@
       changeItem(file) {
         console.log(file)
         this.$emit("changeFile", file)
-      }
+      },
     },
   };
 </script>
 <style>
-</style>
+</style>

+ 29 - 8
src/components/business_space/lib/uploadFiles.vue

@@ -18,15 +18,18 @@
           drag
       >
         <el-button
-            size="small"
-            type="primary"
-            v-if="!readOnly"
+          size="small"
+          :type="isShow ===1 ? 'text':'primary'"
+          v-if="!readOnly"
         >点击上传</el-button>
-        <div
+        <span v-if="isShow !== 1 || isShow == undefined">
+          <div
             slot="tip"
             class="el-upload__tip"
             v-if="!readOnly"
-        >请上传文件</div>
+          >请上传文件</div>
+        </span>
+
       </el-upload>
       <div
           v-if="item && filesArr.length"
@@ -67,6 +70,12 @@
         type: [Number, String],
         default: 6
       },
+      isShow: {
+        type: Number
+      },
+      contextKey: {
+        type: [String, Object]
+      },
       defined: null
     },
     data() {
@@ -136,8 +145,13 @@
         };
         reader.onprogress = function (p) {
           // 这个事件在读取进行中定时触发
-        };
 
+        };
+        reader.onUploadProgress = function (progressEvent) {
+          let percent = (progressEvent.loaded / progressEvent.total * 100) | 0
+          //调用onProgress方法来显示进度条,需要传递个对象 percent为进度值
+          uploader.onProgress({percent: percent})
+        }
         reader.onload = function () {
           // 这个事件在读取成功结束后触发
         };
@@ -169,7 +183,14 @@
                     SystemId: 'dataPlatform'
                   }
                   vm.filesArr.push(fileObject);
-                  vm.$emit("change", vm.filesArr, vm.defined);
+
+                  if(vm.isShow === 1) {
+                    let oFile = {}
+                    oFile[vm.contextKey] = vm.filesArr
+                    vm.$emit("change", oFile, vm.defined);
+                  } else {
+                    vm.$emit("change", vm.filesArr, vm.defined);
+                  }
                 } else {
                   this.$message.error(res.data.ResultMsg)
                 }
@@ -224,4 +245,4 @@
       }
     }
   }
-</style>
+</style>

+ 83 - 53
src/components/business_space/lib/uploadImgsName.vue

@@ -47,63 +47,78 @@
   </div>
 </template>
 <script>
-import tools from "@/utils/scan/tools";
-import formInput from "@/components/business_space/lib/formInput"
-import detailsDialog from "@/components/business_space/lib/detailsDia"
+  import tools from "@/utils/scan/tools";
+  import formInput from "@/components/business_space/lib/formInput"
+  import detailsDialog from "@/components/business_space/lib/detailsDia"
 
-export default {
-  components: {
-    formInput,
-    detailsDialog
-  },
-  props: {
-    keysArr: {
-      type: [Array, String]
-    },
-    readOnly: {
-      type: Boolean,
-      default: false
+  export default {
+    components: {
+      formInput,
+      detailsDialog
     },
-    max: {
-      type: [Number, String],
-      default: 6
-    },
-    accept: {
-      type: String,
-      default: "image/*"
+    props: {
+      keysArr: {
+        type: [Array, String]
+      },
+      readOnly: {
+        type: Boolean,
+        default: false
+      },
+      max: {
+        type: [Number, String],
+        default: 6
+      },
+      accept: {
+        type: String,
+        default: "image/*"
+      },
+      type: {
+        type: String,
+        default: "image"
+      },
+      contextKey: {
+        type: [String, Object]
+      },
+      isShow: {
+        type: [Number, String]
+      },
+      defined: null,
+      videoPicArr: {
+        type: Array,
+        default: function () {
+          return []
+        }
+      }
     },
-    type: {
-      type: String,
-      default: "image"
+    data() {
+      return {
+        baseUrl: "",
+        imageGetUrl: "/image-service/common/image_get?systemId=dataPlatform",
+        imageUploadUrl: "/image-service/common/image_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true",
+        imagesArr: [],
+        iframeSrc: "",
+        dialog: {
+          details: false
+        }
+      };
     },
-    defined: null,
-    videoPicArr: {
-      type: Array,
-      default: function () {
-        return []
-      }
-    }
-  },
-  data() {
-    return {
-      baseUrl: "",
-      imageGetUrl: "/image-service/common/image_get?systemId=dataPlatform",
-      imageUploadUrl: "/image-service/common/image_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true",
-      imagesArr: [],
-      iframeSrc: "",
-      dialog: {
-        details: false
-      }
-    };
-  },
-  created() {
-    this.imageFalg();
-  },
-  methods: {
-    getName(name, index) {
-      this.imagesArr[index].Name = name
-      this.$emit("change", this.imagesArr, this.defined, this.videoPicArr);
+    created() {
+      this.imageFalg();
     },
+    methods: {
+      getName(name, index) {
+
+        this.imagesArr[index].Name = name
+        if (this.isShow === 1) {
+          let oFile = {}
+          oFile[this.contextKey] = this.imagesArr
+          this.$emit("change", oFile, this.defined, this.videoPicArr);
+
+        } else {
+          this.$emit("change", this.imagesArr, this.defined, this.videoPicArr);
+
+        }
+      },
     //判断是否为空
     imageFalg() {
       let type = typeof this.keysArr;
@@ -220,7 +235,15 @@ export default {
                     CreateTime
                   })
                 }
-                vm.$emit("change", vm.imagesArr, vm.defined, vm.videoPicArr);
+                if (vm.isShow === 1) {
+                  let oFile = {}
+                  oFile[vm.contextKey] = vm.imagesArr
+                  vm.$emit("change", oFile, vm.defined, vm.videoPicArr);
+                  console.log('oFile-',oFile)
+                } else {
+                  vm.$emit("change", vm.imagesArr, vm.defined, vm.videoPicArr);
+
+                }
               }
             }
           };
@@ -316,14 +339,21 @@ export default {
 </script>
 <style lang="less">
 #sagaUploads {
+  /deep/ .el-upload--text {
+    box-sizing: border-box;
+  }
+
   overflow: hidden;
+
   .avatar-uploader {
     height: 180px;
     width: 180px;
     overflow: hidden;
+
     .el-upload {
       width: 180px;
       height: 180px;
+
       .el-upload-dragger {
         width: 180px;
         height: 180px;

+ 2 - 2
src/components/business_space/newGraphy/canvasFun.vue

@@ -32,12 +32,12 @@
     <div v-if="config.isEdit&&config.divide" @click="clearDivide">
       <i class="iconfont icon-Erase"></i>
     </div>
-    <div v-if="config.isEdit" @click="undo">
+    <!-- <div v-if="config.isEdit" @click="undo">
       <i class="iconfont icon-Cancel"></i>
     </div>
     <div v-if="config.isEdit" @click="redo">
       <i class="iconfont icon-Anti-cancel"></i>
-    </div>
+    </div> -->
     <div @click="reduce">
       <i class="iconfont icon-narrow"></i>
     </div>

+ 360 - 176
src/components/business_space/newGraphy/graphy.vue

@@ -1,15 +1,31 @@
 <template>
-  <div id="graphy" ref="graphy">
+  <div id="graphy" ref="graphy" v-loading="canvasLoading">
     <div v-show="!FloorMap">
+      <div style="margin-right:10px;width: 100%;margin-bottom: 10px" v-if="showOtherFlag">
+        <!-- 平面图其他分区 -->
+        <el-button type="primary" @click="addZoneBtn">添加分区</el-button>
+        <el-select v-model="OtherValue" placeholder="请选择分区类型" @change="changeOtherZone">
+          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+          </el-option>
+        </el-select>
+      </div>
       <div class="center" style="height: 400px;padding-top:182px;box-sizing:border-box;">
         <i class="icon-wushuju iconfont"></i>
         暂无数据
       </div>
     </div>
-    <div class="canvas-box" v-show="FloorMap" v-loading="canvasLoading">
+    <div class="canvas-box" v-show="FloorMap">
       <canvas id="floorCanvas" :width="canvasWidth" :height="canvasHeight" ref="canvas" tabindex="0"></canvas>
       <!-- 初始两个按钮 -->
       <el-row class="buttons-box">
+        <div style="margin-right:10px;width: 100%;margin-bottom: 10px" v-if="showOtherFlag">
+          <!-- 平面图其他分区 -->
+          <el-button type="primary" @click="addZoneBtn">添加分区</el-button>
+          <el-select v-model="OtherValue" placeholder="请选择分区类型" @change="changeOtherZone">
+            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+            </el-option>
+          </el-select>
+        </div>
         <div>
           <el-autocomplete popper-class="my-autocomplete" v-model="search" :fetch-suggestions="querySearch" placeholder="输入平面图中已有的业务空间名称进行查找"
             width="180px" @select="handleSelect">
@@ -35,6 +51,8 @@
             <!-- 点击已经关联的业务空间 -->
             <el-button type="primary" plain @click="refactorBSP" :disabled="zoneDisable" style="margin-left:10px;">重新划分业务空间</el-button>
             <el-button type="primary" @click="editeSpaceDetail" :disabled="zoneDisable">编辑空间详情</el-button>
+            <el-button type="primary" plain @click="confirmZoneSpace" :disabled="zoneDisable||(!zoneDisable&&!curZoneItem.isInfected)">确认业务空间
+            </el-button>
             <el-button plain @click="cancelGraphy" v-show="!zoneDisable">取 消</el-button>
           </div>
           <!-- 点击已经关联的业务空间 -->
@@ -50,15 +68,16 @@
           <div v-show="type==4">
             <el-button plain @click="cancelGraphy">取 消</el-button>
             <el-button type="primary" @click="saveRefactorBSP">保存</el-button>
+            <el-button type="primary" v-show='curZoneItem.isInfected' @click="confirmAndSave">保存并确认业务空间</el-button>
           </div>
           <!-- 批量创建所选业务空间 -->
           <div v-show="type==5">
             <el-button type="primary" @click="groupCreateZone">批量创建所选业务空间</el-button>
             <el-button plain @click="cancelGraphy">取 消</el-button>
           </div>
-        </div>
-        <div style="position: absolute;right: 0;">
-          <el-button type="text" @click="lookUnrelatBSpace(false)">未关联平面图的业务空间 {{num}} 条</el-button>
+          <div style="position: absolute;right: 10px;">
+            <el-button type="text" @click="lookUnrelatBSpace(false)">未关联平面图的业务空间 {{num}} 条</el-button>
+          </div>
         </div>
       </el-row>
       <!-- 底部操作按钮 -->
@@ -75,6 +94,10 @@
     <!-- 批量创建选择弹窗 -->
     <el-dialog title="提示" :visible.sync="groupCreateDialogVis" width="30%">
       <div id="autoRelate">
+        <p>批量创建面积大于此值的默认空间为业务空间:</p>
+        <div style="padding:10px 20px;margin:0 0 10px 0;">
+          <el-slider v-model="areaValue" :marks="areaMarks" :step="10" :format-tooltip='val=>val/100'> </el-slider>
+        </div>
         <p>请选择批量创建方式:</p>
         <p>
           <el-radio v-model="groupCreateType" :label="1">批量将所有的空白空间创建业务空间</el-radio>
@@ -88,32 +111,36 @@
         <el-button size="small" type="primary" @click="confirm">确认</el-button>
       </span>
     </el-dialog>
+    <dialogZone ref="zone" @createSuccess="getOtherType" />
   </div>
 </template>
 <script>
 import canvasFun from "./canvasFun"
-import { mapGetters, mapActions } from "vuex";
-import { SColor, SPoint } from "@saga-web/draw/lib";
-import { DivideFloorScene, SpaceItem, ZoneItem, FloorView } from "@saga-web/cad-engine/lib";
+import { mapGetters } from "vuex";
+import { SPoint } from "@saga-web/draw/lib";
+import { DivideFloorScene, FloorView, SpaceItem, ZoneItem } from "@saga-web/cad-engine/lib";
 import { colorArr } from "@/utils/spaceColor"
 import unRelateBSP from "./unRelateBSP";
 import createBSP from "./createBSP";
+import dialogZone from "../../ledger/addDialog/dialogZone";
 import {
-  buildingQuery,
-  queryZone,
-  updateZone,
-  createZone,
-  countZone,
-  getIspNotInSpace,
   createRelateInZoneAndISp,
-  groupCreRelaZoneAndISp
+  getIspNotInSpace,
+  groupCreRelaZoneAndISp,
+  queryAllZoneType,
+  queryZone,
+  zoneCount,
+  zoneCreate,
+  zoneQuery,
+  zoneUpdate
 } from "@/api/scan/request"
 
 export default {
   components: {
     canvasFun,
     unRelateBSP,
-    createBSP
+    createBSP,
+    dialogZone
   },
   data() {
     return {
@@ -148,7 +175,12 @@ export default {
       groupCreateDialogVis: false, //批量创建业务空间弹窗
       groupCreateType: 1, //批量创建方式
       zoneDisable: true, // 重新划分是否禁用
-      sourceIdToISP: {}
+      sourceIdToISP: {},
+      areaValue: 40,
+      areaMarks: { 0: '0m²', 100: '1m²' },
+      options: [], //其他分区类型
+      OtherValue: '',
+      showOtherFlag: false, //是否显示其他分区类型添加
     }
   },
   computed: {
@@ -156,8 +188,8 @@ export default {
   },
   created() { },
   mounted() {
-    this.canvasWidth = this.$refs.graphy.offsetWidth;
-    this.canvasHeight = this.$refs.graphy.offsetHeight;
+    this.canvasWidth = this.$refs.graphy.offsetWidth - 20;
+    this.canvasHeight = this.$refs.graphy.offsetHeight - 20;
   },
   methods: {
     // 初始化
@@ -194,7 +226,7 @@ export default {
       // 查询未关联平面图的业务空间
       this.getBSPunrelaISP();
     },
-    // 获取当前楼层的元空间
+    // 获取当前楼层的元空间-元空间接口不变
     getFloorISpace() {
       let pa = {
         zone: 'Ispace',
@@ -215,6 +247,10 @@ export default {
         })
       })
     },
+    //添加其他分区
+    addZoneBtn() {
+      this.$refs.zone.dialogFormVisible = true
+    },
     // 搜索
     querySearch(queryString, cb) {
       let restaurants = this.zoneList;
@@ -251,9 +287,40 @@ export default {
       this.FloorObj = FloorObj;
       this.FloorMap = FloorObj.StructureInfo ? FloorObj.StructureInfo.FloorMap : ''
       this.tab = tab;
-      console.log(arguments)
+      console.log(arguments);
+      if (tab.code == "OtherZone") {
+        // 其他分区
+        this.showOtherFlag = true
+        this.getOtherType();
+        this.OtherValue = (localStorage.getItem('otherZone')) || ''
+      } else {
+        this.showOtherFlag = false;
+      }
       this.init(initType);
     },
+    // 其他分区类型查询
+    getOtherType() {
+      let pa = {
+        Cascade: [{ Name: 'zoneType', Filters: `ProjectId='${this.projectId}'` }],
+        Filters: `Code="OtherZone"`
+      }
+      queryAllZoneType(pa, res => {
+        if (res.Content[0].ZoneType && res.Content[0].ZoneType.length) {
+          this.options = res.Content[0].ZoneType.map(t => {
+            t.value = t.Code;
+            t.label = t.Name;
+            return t;
+          })
+        } else {
+          this.options = []
+        }
+      })
+    },
+    // 其他类型下拉change
+    changeOtherZone(val) {
+      this.init(2);
+      localStorage.setItem('otherZone', val)
+    },
     // 获取未绑定业务空间的元空间
     getISPSPUnrelaBSP() {
       let pa = {
@@ -261,7 +328,7 @@ export default {
           Filters: `FloorId='${this.buildFloor[1]}'`,
           PageSize: 1000
         },
-        objectType: this.tab.code
+        objectType: this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code
       }
       this.allUnRelatISP = []
       getIspNotInSpace(pa, res => {
@@ -302,18 +369,18 @@ export default {
     // 获取当前分区下的业务空间
     getBusinessSpace() {
       this.canvasLoading = true
+      let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
       let pa = {
-        zone: this.tab.code,
-        data: {
-          Filters: ``,
-          Orders: "createTime desc, RoomID asc",
-          PageSize: 1000
-        }
+        ZoneType: ObjectType,
+        Filters: `not RoomID isNull`,
+        Orders: "createTime desc, RoomID asc",
+        PageSize: 10000
       }
       if (this.buildFloor.length && this.buildFloor.length > 1) {
-        pa.data.Filters = `BuildingId='${this.buildFloor[0]}';FloorId='${this.buildFloor[1]}'`
+        pa.BuildingId = this.buildFloor[0];
+        pa.FloorId = this.buildFloor[1];
       }
-      queryZone(pa, res => {
+      zoneQuery(pa, res => {
         // 所有业务空间
         this.businessSpaceList = res.Content;
         // 已关联元空间的业务空间
@@ -324,13 +391,15 @@ export default {
           }
         })
         // 绘制业务空间
+        let tempType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
         let tempArr = this.BSPRelaISPList.map((t, i) => {
-          if (t.FloorId == this.buildFloor[1] && t.ObjectType == this.tab.code) {
+          if (t.FloorId == this.buildFloor[1] && t.ObjectType == tempType) {
             return {
               RoomLocalName: t.RoomLocalName,
               OutLine: t.Outline,
               RoomID: t.RoomID,
               Color: colorArr[i % colorArr.length],
+              Infected: t.State
             }
           } else {
             console.log('internet slow')
@@ -341,6 +410,7 @@ export default {
         this.scene.addZoneList(tempArr);
         this.scene.click(this, this.canvasClick);
         this.zoneList = this.scene.zoneList;
+        this.view._needDraw = true;
         this.canvasLoading = false;
       })
     },
@@ -381,6 +451,7 @@ export default {
       this.scene.isSpaceSelectable = true;
       // 设置业务空间不可选
       this.scene.isZoneSelectable = false
+      this.view._needDraw = true;
     },
     // 查看未关联的业务空间--flag--查看-or-选择
     lookUnrelatBSpace(flag) {
@@ -424,6 +495,22 @@ export default {
       let text = []
       let Spaces = this.allUnRelatISP.map(t => {
         if (t.Outline) {
+          let area = 0;
+          if (t.Outline[0]) {
+            area = this.getarea(t.Outline[0]);
+            if (t.Outline.length > 1) {
+              for (let i = 1; i < t.Outline.length; i++) {
+                let temp = this.getarea(t.Outline[i]);
+                area = area - temp
+              }
+            }
+            area = (area / 1000000).toFixed(2);
+            if (area < (this.areaValue / 100)) {
+              return undefined
+            }
+          } else {
+            return undefined;
+          }
           text.push(t.RoomLocalName || t.RoomName)
           return {
             IspaceId: t.RoomID,
@@ -479,62 +566,62 @@ export default {
     },
     // 根据图创建新的业务空间-弹窗返回确认创建
     createRoom(val) {
-      // const zoneObj = { Outline: [], Height: 0 }, IspaceIdList = [];
-      // let spaces = {};
-      // if (this.scene.cutItem || this.scene.sceneMark) {
-      //   // 如果有划分,求交集
-      //   // 格式为Poly(先与业务空间求差集)
-      //   const obj = this.scene.getZoneDifference(true);
-      //   // 差集与楼层平面图或用户划分区域求交集
-      //   spaces = this.scene.getPloyIntersect(obj)
-      // } else {
-      //   // 格式为SPoint[]
-      //   spaces = this.scene.getZoneDifference();
-      // }
-      // for (let key in spaces) {
-      //   spaces[key].map(t => {
-      //     let temp = t.map(item => {
-      //       return {
-      //         X: 1*item.x.toFixed(2),
-      //         Y: -item.y.toFixed(2),
-      //         Z: 0
-      //       }
-      //     })
-      //     zoneObj.Outline.push([temp]);
-      //   })
-      //   let curISP = this.sourceIdToISP[key];
-      // if (curISP) {
-      //   curISP && IspaceIdList.push(curISP.RoomID);
-      //   zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
-      // }
-      // }
-      // 数据计算导致浏览器奔溃,临时注释
-      let zoneObj = { Outline: [], Height: 0 }, IspaceIdList = [];
-      let selectSpaces = this.scene.getSelectedSpaces();
-      selectSpaces.map(t => {
-        zoneObj.Outline.push(t.data.OutLine);
-        let key = t.data.SourceId;
-        let curISP = this.sourceIdToISP[key];
-        if (curISP) {
-          IspaceIdList.push(curISP.RoomID);
-          zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
-        }
-      })
-      // 如果有划分,求交集
+      const zoneObj = { Outline: [], Height: 0 }, IspaceIdList = [];
+      let spaces = {};
       if (this.scene.cutItem || this.scene.sceneMark) {
-        zoneObj.Outline = [];
-        let arr = this.scene.getIntersect();
-        arr.map(t => {
+        // 如果有划分,求交集
+        // 格式为Poly(先与业务空间求差集)
+        const obj = this.scene.getZoneDifference(true);
+        // 差集与楼层平面图或用户划分区域求交集
+        spaces = this.scene.getPloyIntersect(obj)
+      } else {
+        // 格式为SPoint[]
+        spaces = this.scene.getZoneDifference();
+      }
+      for (let key in spaces) {
+        spaces[key].map(t => {
           let temp = t.map(item => {
             return {
-              X: 1 * item.x,
-              Y: -item.y,
+              X: 1 * item.x.toFixed(2),
+              Y: -item.y.toFixed(2),
               Z: 0
             }
           })
           zoneObj.Outline.push([temp]);
         })
+        let curISP = this.sourceIdToISP[key];
+        if (curISP) {
+          curISP && IspaceIdList.push(curISP.RoomID);
+          zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
+        }
       }
+      // 数据计算导致浏览器奔溃,临时注释(测试计算未崩溃改好)
+      // let zoneObj = { Outline: [], Height: 0 }, IspaceIdList = [];
+      // let selectSpaces = this.scene.getSelectedSpaces();
+      // selectSpaces.map(t => {
+      //   zoneObj.Outline.push(t.data.OutLine);
+      //   let key = t.data.SourceId;
+      //   let curISP = this.sourceIdToISP[key];
+      //   if (curISP) {
+      //     IspaceIdList.push(curISP.RoomID);
+      //     zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
+      //   }
+      // })
+      // // 如果有划分,求交集
+      // if (this.scene.cutItem || this.scene.sceneMark) {
+      //   zoneObj.Outline = [];
+      //   let arr = this.scene.getIntersect();
+      //   arr.map(t => {
+      //     let temp = t.map(item => {
+      //       return {
+      //         X: 1 * item.x,
+      //         Y: -item.y,
+      //         Z: 0
+      //       }
+      //     })
+      //     zoneObj.Outline.push([temp]);
+      //   })
+      // }
       // 至此
       if (!zoneObj.Outline.length) {
         zoneObj.Outline = null;
@@ -639,12 +726,35 @@ export default {
       // 将当前业务空间的每个元素添加到场景中并选中
       this.scene.addAllLikeSpace(this.curZoneItem.data.OutLine);
     },
+    // 确认业务空间
+    confirmZoneSpace() {
+      let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
+      let space = {
+        RoomID: this.curZoneItem.data.RoomID,
+        State: 0,
+        ObjectType: ObjectType
+      }
+      let pa = {
+        Content: [space],
+        Projection: ['State']
+      }
+      zoneUpdate(pa, res => {
+        this.curZoneItem.isInfected = false;
+        this.$emit('updateState');
+        this.$message.success('更新成功');
+      })
+    },
+    // 保存并确认业务空间
+    confirmAndSave() {
+      this.confirmAndSaveFlag = true;
+      this.saveRefactorBSP();
+    },
     // 重新划分--保存
     saveRefactorBSP() {
       let selectSpace = this.scene.getSelectedSpaces();
       let selectLikeSpace = this.scene.getSelectedLikeSpace();
       //更新业务空间
-      let zoneObj = { Outline: [], Height: 0 }, IspaceIdList = [];
+      let zoneObj = { Outline: [], Height: 0, State: this.confirmAndSaveFlag ? 0 : this.curZoneItem.isInfected ? 1 : 0 }, IspaceIdList = [];
       // 空间
       selectSpace.map(t => {
         zoneObj.Outline.push(t.data.OutLine);
@@ -693,83 +803,133 @@ export default {
     },
     // 根据图批量创建所选业务空间
     groupCreateZone() {
-      // let arr = this.scene.getSelectedSpaces();
-      // let createSpaces = [], spaces = {};
-      // if (this.scene.cutItem || this.scene.sceneMark) {
-      //   // 如果有划分,求交集
-      //   // 格式为Poly(先与业务空间求差集)
-      //   const obj = this.scene.getZoneDifference(true);
-      //   // 差集与楼层平面图或用户划分区域求交集
-      //   spaces = this.scene.getPloyIntersect(obj)
-      // } else {
-      //   // 格式为SPoint[]
-      //   spaces = this.scene.getZoneDifference();
-      // }
-      // for (let key in spaces) {
-      //   let zoneObj = { Outline: [], Height: 0 }
-      //   spaces[key].map(t => {
-      //     let temp = t.map(item => {
-      //       return {
-      //         X: 1 * item.x.toFixed(2),
-      //         Y: -item.y.toFixed(2),
-      //         Z: 0
-      //       }
-      //     })
-      //     zoneObj.Outline.push([temp]);
-      //   })
-      //   if (!zoneObj.Outline.length) {
-      //     continue
-      //   }
-      //   let curISP = this.sourceIdToISP[key];
-      // if (curISP) {
-      //   zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
-      //   zoneObj.IspaceId = curISP.RoomID;
-      //   zoneObj.RoomLocalName = curISP.RoomLocalName;
-      // }
-      //   zoneObj.BuildingId = this.buildFloor[0];
-      //   zoneObj.FloorId = this.buildFloor[1];
-      //   createSpaces.push(zoneObj);
-      // }
-
-      // 改回之前逻辑
       let arr = this.scene.getSelectedSpaces();
-      let createSpaces = [];
-      // 如果有划分,求交集
+      let createSpaces = [], 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;
+        // 如果有划分,求交集
+        // 格式为Poly(先与业务空间求差集)
+        const obj = this.scene.getZoneDifference(true);
+        // 差集与楼层平面图或用户划分区域求交集
+        spaces = this.scene.getPloyIntersect(obj)
+      } else {
+        // 格式为SPoint[]
+        spaces = this.scene.getZoneDifference();
+      }
+      for (let key in spaces) {
+        let zoneObj = { Outline: [], Height: 0 }
+        spaces[key].map(t => {
+          let temp = t.map(item => {
+            return {
+              X: 1 * item.x.toFixed(2),
+              Y: -item.y.toFixed(2),
+              Z: 0
+            }
           })
+          zoneObj.Outline.push([temp]);
+        })
+        if (!zoneObj.Outline.length) {
+          continue
         }
-        createSpaces = arr.map(t => {
-          return {
-            IspaceId: this.BIMIDToSID[t.data.SourceId],
-            RoomLocalName: this.BIMIDToSIName[t.data.SourceId],
-            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 {
-        createSpaces = arr.map(t => {
-          return {
-            IspaceId: this.BIMIDToSID[t.data.SourceId],
-            RoomLocalName: this.BIMIDToSIName[t.data.SourceId],
-            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 area = 0, line = zoneObj.Outline;
+        for (let i = 0; i < line.length; i++) {
+          for (let j = 0; j < line[i].length; j++) {
+            if (j == 0) {
+              area += this.getarea(line[i][0]);
+            } else {
+              area -= this.getarea(line[i][j]);
+            }
           }
-        })
+        }
+        area = (area / 1000000).toFixed(2);
+        if (area < (this.areaValue / 100)) {
+          continue
+        }
+        //生成空间对象
+        let curISP = this.sourceIdToISP[key];
+        if (curISP) {
+          zoneObj.Height = zoneObj.Height == 0 ? curISP.Height : zoneObj.Height > curISP.Height ? curISP.Height : zoneObj.Height;
+          zoneObj.IspaceId = curISP.RoomID;
+          zoneObj.RoomLocalName = curISP.RoomLocalName;
+        }
+        zoneObj.BuildingId = this.buildFloor[0];
+        zoneObj.FloorId = this.buildFloor[1];
+        createSpaces.push(zoneObj);
       }
+
+      // 改回之前逻辑
+      // let arr = this.scene.getSelectedSpaces();
+      // let createSpaces = [];
+      // // 如果有划分,求交集
+      // 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;
+      //     })
+      //   }
+      //   createSpaces = arr.map(t => {
+      //     let line = outlines[t.data.SourceId];
+      //     if (!line || !line.length) {
+      //       return undefined
+      //     } else {
+      //       let area = 0;
+      //       for (let i = 0; i < line.length; i++) {
+      //         for (let j = 0; j < line[i].length; j++) {
+      //           if (j == 0) {
+      //             area += this.getarea(line[i][0]);
+      //           } else {
+      //             area -= this.getarea(line[i][j]);
+      //           }
+      //         }
+      //       }
+      //       area = (area / 1000000).toFixed(2);
+      //       if (area < (this.areaValue / 100)) {
+      //         return undefined;
+      //       }
+      //     }
+      //     return {
+      //       IspaceId: this.BIMIDToSID[t.data.SourceId],
+      //       RoomLocalName: this.BIMIDToSIName[t.data.SourceId],
+      //       Outline: line,
+      //       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)
+      // } else {
+      //   createSpaces = arr.map(t => {
+      //     let line = t.data.OutLine;
+      //     if (!line || !line.length) {
+      //       return undefined
+      //     } else {
+      //       let area = this.getarea(line[0]);
+      //       if (line.length > 1) {
+      //         for (let i = 1; i < line.length; i++) {
+      //           area -= this.getarea(line[i]);
+      //         }
+      //       }
+      //       area = (area / 1000000).toFixed(2);
+      //       if (area < (this.areaValue / 100)) {
+      //         return undefined;
+      //       }
+      //     }
+      //     return {
+      //       IspaceId: this.BIMIDToSID[t.data.SourceId],
+      //       RoomLocalName: this.BIMIDToSIName[t.data.SourceId],
+      //       Outline: [line],
+      //       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);
+      // }
       if (createSpaces.length) {
         this.canvasLoading = true;
         this.groupCreateBSP(createSpaces)
@@ -779,24 +939,32 @@ export default {
     },
     // 更新业务空间和元空间的关系
     relationInBSPandISP(SpaceId, IspaceIdList) {
+      let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
       let pa = {
         data: { SpaceId: SpaceId, IspaceIdList: IspaceIdList },
-        type: this.tab.code
+        type: ObjectType
       }
       createRelateInZoneAndISp(pa, res => {
         this.$message.success('创建成功');
         this.init(2);
+        if (this.confirmAndSaveFlag) {
+          this.confirmAndSaveFlag = false;
+          this.curZoneItem.selected = false;
+          this.curZoneItem = {};
+          this.$emit('updateState');
+        }
       })
     },
     // 批量更新业务空间和元空间的关系
     groupCreRelaZoneAndISp(Spaces) {
       Spaces = Spaces.filter(item => item.IspaceId);
+      let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
       if (Spaces.length) {
         let param = {
           data: {
             Content: Spaces
           },
-          type: this.tab.code
+          type: ObjectType
         }
         groupCreRelaZoneAndISp(param, res => {
           this.$message.success('创建成功')
@@ -811,17 +979,16 @@ export default {
     },
     // 批量创建
     groupCreateBSP(spaces) {
+      let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
       spaces = spaces.map(t => {
+        t.ObjectType = ObjectType;
         t.BIMLocation = this.getAverageVal(t.Outline);
         return t;
       })
       let pa = {
-        zone: this.tab.code,
-        data: {
-          Content: spaces
-        }
+        Content: spaces,
       }
-      createZone(pa, res => {
+      zoneCreate(pa, res => {
         res.EntityList.map(t => {
           spaces = spaces.map(item => {
             if (t.RoomLocalName == item.RoomLocalName) {
@@ -835,40 +1002,35 @@ export default {
     },
     // 单个创建
     createSingleBSP(space, IspaceIdList) {
+      let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
       space.BIMLocation = space.Outline ? this.getAverageVal(space.Outline) : null;
+      space.ObjectType = ObjectType;
       let pa = {
-        zone: this.tab.code,
-        data: {
-          Content: [space]
-        }
+        Content: [space]
       }
-      createZone(pa, res => {
+      zoneCreate(pa, res => {
         this.relationInBSPandISP(res.EntityList[0].RoomID, IspaceIdList)
       })
     },
     // 更新业务空间区域
     updateBSPOutline(zoneObj, IspaceIdList) {
+      let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
       zoneObj.BIMLocation = zoneObj.Outline ? this.getAverageVal(zoneObj.Outline) : null;
+      zoneObj.ObjectType = ObjectType;
       let pa = {
-        zone: this.tab.code,
-        data: {
-          Content: [zoneObj],
-          Projection: ['Outline', 'BIMLocation']
-        },
+        Content: [zoneObj]
       }
-      updateZone(pa, res => {
+      zoneUpdate(pa, res => {
         this.relationInBSPandISP(zoneObj.RoomID, IspaceIdList)
       })
     },
     // 查询未关联平面图的业务空间(项目下+当前分区)
     getBSPunrelaISP() {
+      let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
       let pa = {
-        zone: this.tab.code,
-        data: {
-          Filters: `Outline isNull`
-        }
+        Filters: `Outline isNull;ObjectType="${ObjectType}"`
       }
-      countZone(pa, res => {
+      zoneCount(pa, res => {
         this.num = res.Count;
       })
     },
@@ -890,6 +1052,19 @@ export default {
       Z = (Z / len).toFixed(2);
       return `${X},${Y},${Z}`
     },
+    // 计算面积
+    getarea(arr) {
+      if (!arr.length) {
+        return 0;
+      }
+      let sum = 0;
+      let n = arr.length;
+      arr[n] = arr[0];
+      for (let i = 1; i <= n; i++) {
+        sum += arr[i].X * arr[i - 1].Y - arr[i - 1].X * arr[i].Y;
+      }
+      return Math.abs(sum / 2)
+    },
     // canvas 获取焦点
     focus() {
       document.getElementById(`floorCanvas`).focus()
@@ -994,6 +1169,8 @@ export default {
 #graphy {
   position: relative;
   width: 100%;
+  box-sizing: border-box;
+  padding: 0 10px 10px;
   height: calc(100% - 56px);
   .canvas-box {
     width: 100%;
@@ -1002,13 +1179,15 @@ export default {
   .buttons-box {
     position: absolute;
     top: 0;
+    left: 0;
+    padding: 0 10px;
     width: 100%;
     z-index: 999;
     & > div {
       float: left;
     }
     /deep/ .el-autocomplete {
-      display: block;
+      display: inline-block;
       width: 320px;
       margin-right: 10px;
     }
@@ -1037,10 +1216,15 @@ export default {
   }
   .canvas-actions-box {
     position: absolute;
-    bottom: 20px;
+    bottom: 60px;
     left: 50%;
     transform: translateX(-50%);
-    z-index: 999;
+    z-index: 99;
+  }
+  #autoRelate {
+    /deep/ .el-slider__marks-text:nth-child(2) {
+      width: 25px;
+    }
   }
 }
 </style>

+ 14 - 15
src/components/business_space/newGraphy/unRelateBSP.vue

@@ -39,7 +39,7 @@
 <script>
 import {
   buildingQuery,
-  queryZone
+  zoneQuery
 } from "@/api/scan/request"
 export default {
   name: "unRelateBSP",
@@ -97,7 +97,7 @@ export default {
       this.getTableData();
     },
     // 页码
-    handleCurrentChange(val) { 
+    handleCurrentChange(val) {
       this.page.pageNumber = val;
       this.getTableData();
     },
@@ -129,28 +129,27 @@ export default {
     // 查询未关联平面图的业务空间(项目下+当前分区)
     getTableData() {
       let pa = {
-        zone: this.code,
-        data: {
-          Filters: `Outline isNull`,
-          Orders: "createTime desc, RoomID asc",
-          PageSize: this.page.pageSize,
-          pageNumber: this.page.pageNumber
-        }
+        ZoneType: this.code,
+        Filters: `Outline isNull`,
+        Orders: "createTime desc, RoomID asc",
+        PageSize: this.page.pageSize,
+        pageNumber: this.page.pageNumber
       }
+
       if (this.floor[0] == 'isNull') {
-        pa.data.Filters += `;BuildingId isNull`
+        pa.BuildingId = `isnull`
       } else if (this.floor[0] && this.floor[0] != 'all') {
-        pa.data.Filters += `;BuildingId='${this.floor[0]}'`
+        pa.BuildingId = this.floor[0]
       }
       if (this.floor[1] == 'isNull') {
-        pa.data.Filters += `;FloorId isNull`
+        pa.FloorId = `isnull`
       } else if (this.floor[1] && this.floor[1] != 'all') {
-        pa.data.Filters += `;FloorId='${this.floor[1]}'`
+        pa.FloorId = this.floor[1]
       }
       if (this.keycode != '') {
-        pa.data.Filters += `;RoomLocalName contain "${this.keycode}" or RoomName contain "${this.keycode}"`
+        pa.Filters += `;RoomLocalName contain "${this.keycode}" or RoomName contain "${this.keycode}"`
       }
-      queryZone(pa, res => {
+      zoneQuery(pa, res => {
         this.page.total = res.Total;
         this.tableData = res.Content.map(t => {
           t.BNAME = this.bfData[t.BuildingId];

+ 10 - 12
src/components/business_space/newTables/eqToSpaceTable.vue

@@ -45,7 +45,7 @@
 
 <script>
 import {
-  queryZone,
+  zoneQuery,
   eqInSpaceDelete, //设备所在业务空间--删除关系
   eqForSpaceDelete, //设备服务业务空间--删除关系
 } from "@/api/scan/request";
@@ -133,18 +133,16 @@ export default {
     getTableData() {
       this.loading = true;
       let pa = {
-        data: {
-          Filters: `RoomID='${this.params.RoomID}'`,
-          Cascade: [
-            {
-              Name: this.type.replace(this.type[0], this.type[0].toLowerCase()),
-              Cascade: [{ Name: 'equipCategory' }]
-            }
-          ]
-        },
-        zone: this.params.zone
+        Filters: `RoomID='${this.params.RoomID}'`,
+        Cascade: [
+          {
+            Name: this.type.replace(this.type[0], this.type[0].toLowerCase()),
+            Cascade: [{ Name: 'equipCategory' }]
+          }
+        ],
+        ZoneType: this.params.zone
       }
-      queryZone(pa, res => {
+      zoneQuery(pa, res => {
         this.loading = false;
         this.tableData = res.Content[0][this.type] || []
         this.tableData.map(t => {

+ 5 - 7
src/components/business_space/newTables/syInSpaceTable.vue

@@ -37,7 +37,7 @@
 
 <script>
 import {
-  queryZone,
+  zoneQuery,
   syInSpaceDelete
 } from "@/api/scan/request";
 import { mapGetters } from "vuex";
@@ -102,13 +102,11 @@ export default {
     getTableData() {
       this.loading = true;
       let pa = {
-        data: {
-          Cascade: [{ Name: "generalSystem" }],
-          Filters: `RoomID="${this.params.RoomID}"`,
-        },
-        zone: this.params.zone
+        Cascade: [{ Name: "generalSystem" }],
+        Filters: `RoomID="${this.params.RoomID}"`,
+        ZoneType: this.params.zone
       }
-      queryZone(pa, res => {
+      zoneQuery(pa, res => {
         this.loading = false;
         this.tableData = res.Content[0].GeneralSystem || [];
         this.tableData.map(t => {

+ 29 - 9
src/components/config_point/dictionaryCascader.vue

@@ -2,8 +2,9 @@
   <div>
     <el-form ref="form" :rules='rules' :model="form">
       <el-form-item prop="dict" class="cascader-container">
-        <el-cascader :options='options' v-model='form.dict' :props='props' filterable @change="changeSelect" ref="dictCas">
-        </el-cascader>
+        <el-cascader-multi :data='options' v-model='form.dict' :value-key='props.value' :label-key='props.label' :children-key='props.children'
+          filterable :popper-class="'select'" @change="changeSelect" ref="dictCas" :only-last="true" :no-data-text='"无数据"'>
+        </el-cascader-multi>
         <el-tooltip class="item" effect="dark" :content="`于${cacheTime}缓存,点击重新缓存`" placement="top">
           <el-button icon="el-icon-refresh" class="update-button" @click="getDictionary"></el-button>
         </el-tooltip>
@@ -47,14 +48,18 @@ export default {
     ...mapActions('project', ['getDictionary']),
     //获取物理世界所有设备类型
     getDictSuc(list) {
-      this.options = list;
+      this.options = this.transformList(list);
       this.changeSelect(this.form.dict);
     },
     changeSelect(val) {
       setTimeout(() => {
-        if (this.$refs.dictCas.getCheckedNodes()[0]) {
-          let labels = this.$refs.dictCas.getCheckedNodes()[0].pathLabels;
-          let data = this.$refs.dictCas.getCheckedNodes()[0].data;
+        if (this.$refs.dictCas) {
+          let labels = this.$refs.dictCas.selectedLabels;
+          let data = {};
+          this.$refs.dictCas.selectedNodes.forEach(t => {
+            let key = t.InfoPointCode;
+            data[key] = t;
+          });
           this.$emit('change', { val: val, labels: labels, data: data })
         }
       }, 500)
@@ -73,23 +78,38 @@ export default {
         }
       })
     },
+    transformList(list) {
+      let arr = [];
+      arr = list.map(t => {
+        if (t.Content) {
+          if (!t.Content.length) {
+            t.Content = [{ InfoPointName: '暂无可对应信息点', disabled: true }]
+          } else {
+            t.Content = this.transformList(t.Content);
+          }
+        }
+        return t;
+      })
+      return arr;
+    }
   }
 }
 </script>
 <style lang="less" scoped>
 .cascader-container.el-form-item--small.el-form-item {
   margin-bottom: 0;
-  /deep/ .el-cascader {
-    width: 89%;
+  .el-form-item__content div:nth-child(1) {
+    width: 89% !important;
     display: block;
     float: left;
-    .el-input .el-input__inner {
+    /deep/ .el-input .el-input__inner {
       border-radius: 4px 0 0 4px;
       vertical-align: bottom;
     }
   }
   .update-button {
     display: block;
+    height: 32px;
     float: left;
     border-left: 0;
     border-radius: 0 4px 4px 0;

+ 3 - 3
src/components/config_point/step3_edit/auto_handle.vue

@@ -1,8 +1,8 @@
 <template>
     <el-form ref='form' :rules='rules' :model='form' label-width='140px'>
-        <el-form-item v-if='devFlag' ref='form' label='对象标识' prop='EquipmentMark'>
+        <!-- <el-form-item v-if='devFlag' ref='form' label='对象标识' prop='EquipmentMark'>
             <el-input v-model='form.EquipmentMark'></el-input>
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item
             label='原始点位值单位'
             prop='unit'
@@ -31,7 +31,7 @@ export default {
                 unit: [],
             },
             rules: {
-                EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }],
+                // EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }],
             }
         }
     },

+ 5 - 3
src/components/config_point/step3_edit/enum_handle.vue

@@ -1,9 +1,9 @@
 <template>
     <div class='edit-box'>
         <el-form ref='form' :rules='rules' :model='form' label-width='140px'>
-            <el-form-item v-if='devFlag' label='对象标识' prop='EquipmentMark'>
+            <!-- <el-form-item v-if='devFlag' label='对象标识' prop='EquipmentMark'>
                 <el-input v-model='form.EquipmentMark'></el-input>
-            </el-form-item>
+            </el-form-item> -->
 
             <ul class='point-box'>
                 <span class='left'>如果</span>
@@ -47,7 +47,7 @@ export default {
                 pointArr: [{ from: '', to: '' }]
             },
             rules: {
-                EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }]
+                // EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }]
             }
         }
     },
@@ -112,6 +112,8 @@ export default {
             position: absolute;
             top: -35px;
             left: 23px;
+            margin: 0;
+            padding: 0;
         }
         .right {
             position: absolute;

+ 3 - 3
src/components/config_point/step3_edit/formula_handle.vue

@@ -1,9 +1,9 @@
 <template>
     <div class='edit-box'>
         <el-form ref='form' :rules='rules' :model='form' label-width='140px'>
-            <el-form-item v-if='devFlag' label='对象标识' prop='EquipmentMark'>
+            <!-- <el-form-item v-if='devFlag' label='对象标识' prop='EquipmentMark'>
                 <el-input v-model='form.EquipmentMark'></el-input>
-            </el-form-item>
+            </el-form-item> -->
         </el-form>
         <div class='formula-box'>
             <p>原始点位</p>
@@ -53,7 +53,7 @@ export default {
             },
             extract: true,
             rules: {
-                EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }]
+                // EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }]
             },
             subStrVal: false,
             from: 1,

+ 324 - 235
src/components/config_point/step3_edit/index.vue

@@ -32,23 +32,32 @@
       <el-form class='form' :rules='rules' ref='form' :model='form' label-width='140px'>
         <el-form-item label='对应数据字典' prop='diction'>
           <dictionary-cas @change="changeDictionaryCas" ref="dictionaryCas"></dictionary-cas>
-          <div class='dict'>
+        </el-form-item>
+        <el-form-item label='对象标识' prop="EquipmentMark">
+          <el-input v-model='form.EquipmentMark'></el-input>
+        </el-form-item>
+        <template v-for="(it,index) in typeList">
+          <div class='dict' :key="index">
+            <label class="el-form-item__label" style="width:140px;">信息点名称:</label><span style="line-height:40px">{{it.name||''}}</span>
             <p class='btm'>
-              <el-input readonly type='textarea' :rows='2' placeholder='信息点的单位及值的说明' v-model='ValueDescription'></el-input>
+              <el-input readonly type='textarea' :rows='2' placeholder='信息点的单位及值的说明' v-model='it.ValueDescription'>
+              </el-input>
+              <el-form-item style="margin-top:15px;" label='值处理方式' prop='DataRuleType'>
+                <el-select v-model='it.DataRuleType' placeholder='请选择'>
+                  <el-option v-for='item in handleTypeArr' :key='item.value' :label='item.label' :value='item.value'></el-option>
+                </el-select>
+              </el-form-item>
             </p>
+            <!-- components -->
+            <no-handle :ref='"noHandle"+index' v-if='it.DataRuleType == "无需处理,直接使用"' :noHandleShow='noHandleShow'></no-handle>
+            <auto-handle :ref='"autoHandle"+index' v-else-if='it.DataRuleType == "需自动单位转换"' :unitObj='it' :autoHandleShow='autoHandleShow'>
+            </auto-handle>
+            <enum-handle :ref='"enumHandle"+index' v-else-if='it.DataRuleType == "需按设置枚举转换"' :enumHandleShow='enumHandleShow'></enum-handle>
+            <formula-handle :ref='"formulaHandle"+index' v-else-if='it.DataRuleType == "需按公式转换"' :formulaHandleShow='formulaHandleShow'>
+            </formula-handle>
+            <split-handle :ref='"splitHandle"+index' v-else-if='it.DataRuleType == "需拆分处理"' :splitHandleShow='splitHandleShow'></split-handle>
           </div>
-        </el-form-item>
-        <el-form-item label='值处理方式' prop='DataRuleType'>
-          <el-select v-model='form.DataRuleType' placeholder='请选择'>
-            <el-option v-for='item in handleTypeArr' :key='item.value' :label='item.label' :value='item.value'></el-option>
-          </el-select>
-        </el-form-item>
-        <!-- components -->
-        <no-handle ref='noHandle' v-if='form.DataRuleType == "无需处理,直接使用"' :noHandleShow='noHandleShow'></no-handle>
-        <auto-handle ref='autoHandle' v-else-if='form.DataRuleType == "需自动单位转换"' :unitObj='unitObj' :autoHandleShow='autoHandleShow'></auto-handle>
-        <enum-handle ref='enumHandle' v-else-if='form.DataRuleType == "需按设置枚举转换"' :enumHandleShow='enumHandleShow'></enum-handle>
-        <formula-handle ref='formulaHandle' v-else-if='form.DataRuleType == "需按公式转换"' :formulaHandleShow='formulaHandleShow'></formula-handle>
-        <split-handle ref='splitHandle' v-else-if='form.DataRuleType == "需拆分处理"' :splitHandleShow='splitHandleShow'></split-handle>
+        </template>
       </el-form>
       <div class='btn-box'>
         <el-button type='primary' @click='save'>保存</el-button>
@@ -82,14 +91,16 @@ export default {
       dataDict: {}, //数据字典
       InfomationPoint: null, //信息点
       unitObj: {}, //传给自动单位转换的obj
-      ValueDescription: '', //值/点位描述
+      ValueDescription: {}, //值/点位描述
       form: {
         diction: '1',//占位
-        DataRuleType: '无需处理,直接使用'
+        DataRuleType: '无需处理,直接使用',
+        EquipmentMark: ''
       },
       rules: {
         DataRuleType: [{ required: true, message: '请选择值处理方式', trigger: 'change' }],
-        diction: [{ required: true }]
+        diction: [{ required: true }],
+        EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }],
       },
       handleTypeArr: [
         {
@@ -119,7 +130,8 @@ export default {
       enumHandleShow: {},
       formulaHandleShow: {},
       splitHandleShow: {},
-      dictionaryData: []
+      dictionaryData: [],
+      typeList: []
     }
   },
   props: {
@@ -139,209 +151,240 @@ export default {
   methods: {
     //保存
     save() {
+      if (!this.form.EquipmentMark) {
+        this.errMsg();
+        return false;
+      }
       this.$refs.dictionaryCas.validate(valid => {
         if (valid) {
-          var flag = this.form.DataRuleType
-          switch (flag) {
-            case '无需处理,直接使用':
-              this.$refs['noHandle'].getForm(noHandle => {
-                if (noHandle) {
-                  this.saveForm(this.form, noHandle)
-                } else {
-                  this.errMsg()
-                }
-              })
-              break
-            case '需自动单位转换':
-              this.$refs['autoHandle'].getForm(autoHandle => {
-                if (autoHandle) {
-                  this.saveForm(this.form, autoHandle)
-                } else {
-                  this.errMsg()
-                }
-              })
-              break
-            case '需按设置枚举转换':
-              this.$refs['enumHandle'].getForm(enumHandle => {
-                if (enumHandle) {
-                  this.saveForm(this.form, enumHandle)
-                } else {
-                  this.errMsg()
-                }
-              })
-              break
-            case '需按公式转换':
-              this.$refs['formulaHandle'].getForm(formulaHandle => {
-                if (formulaHandle) {
-                  this.saveForm(this.form, formulaHandle)
-                } else {
-                  this.errMsg()
-                }
-              })
-              break
-            case '需拆分处理':
-              this.$refs['splitHandle'].getForm(splitHandle => {
-                if (splitHandle) {
-                  this.saveForm(this.form, splitHandle)
-                } else {
-                  this.errMsg()
-                }
-              })
-              break
+          for (let i = 0; i < this.typeList.length; i++) {
+            let flag = this.typeList[i].DataRuleType
+            switch (flag) {
+              case '无需处理,直接使用':
+                let componnoHandle = `noHandle${i}`
+                this.$refs[componnoHandle][0].getForm(noHandle => {
+                  if (noHandle) {
+                    this.typeList[i].other = noHandle
+                    // this.saveForm(this.form, noHandle)
+                  } else {
+                    this.errMsg();
+                    return false;
+                  }
+                })
+                break
+              case '需自动单位转换':
+                let componautoHandle = `autoHandle${i}`
+                this.$refs[componautoHandle][0].getForm(autoHandle => {
+                  if (autoHandle) {
+                    this.typeList[i].other = autoHandle
+                    // this.saveForm(this.form, autoHandle)
+                  } else {
+                    this.errMsg()
+                    return false;
+                  }
+                })
+                break
+              case '需按设置枚举转换':
+                let componenumHandle = `enumHandle${i}`
+                this.$refs[componenumHandle][0].getForm(enumHandle => {
+                  if (enumHandle) {
+                    this.typeList[i].other = enumHandle
+                    // this.saveForm(this.form, enumHandle)
+                  } else {
+                    this.errMsg()
+                    return false;
+                  }
+                })
+                break
+              case '需按公式转换':
+                let componformulaHandle = `formulaHandle${i}`
+                this.$refs[componformulaHandle][0].getForm(formulaHandle => {
+                  if (formulaHandle) {
+                    this.typeList[i].other = formulaHandle
+                    // this.saveForm(this.form, formulaHandle)
+                  } else {
+                    this.errMsg()
+                    return false;
+                  }
+                })
+                break
+              case '需拆分处理':
+                let componsplitHandle = `splitHandle${i}`
+                this.$refs[componsplitHandle][0].getForm(splitHandle => {
+                  if (splitHandle) {
+                    this.typeList[i].other = formulaHandle
+                    // this.saveForm(this.form, splitHandle)
+                  } else {
+                    this.errMsg()
+                    return false;
+                  }
+                })
+                break
+            }
           }
+          this.saveForm()
         } else {
           this.errMsg()
           return false
         }
       })
     },
-    saveForm(basic, other) {
-      let type = basic.DataRuleType
-      let basicParams = {
-        InfomationPointCode: this.dictionaryData[this.dictionaryData.length - 1], //信息点code
-        InfomationPoint: this.dictionaryNames[this.dictionaryNames.length - 1], //信息点名称
-        DataRuleType: basic.DataRuleType, //值处理方式
-        DataSourceId: this.datasourceId, //数据源id
-        PointId: this.editData.Point.Id, //点位ID
-        Type: this.dictionaryNames[0], //一级分类名称
-        TypeCode: this.dictionaryData[0], //一级分类code
-      }
-      if (this.dictionaryData.length == 3) {
-        //设备-部件-空间
-        basicParams.EquipmentTypeCode = this.dictionaryData[1]
-        basicParams.EquipmentType = this.dictionaryNames[1]
-      } else if (this.dictionaryData.length == 4) { //专业系统
-        basicParams.SpecialtyCode = this.dictionaryData[1]
-        basicParams.Specialty = this.dictionaryNames[1]
-        basicParams.SystemCode = this.dictionaryData[2]
-        basicParams.System = this.dictionaryNames[2]
-        basicParams.EquipmentTypeCode = basicParams.SystemCode  //为了配置从动参取值存储
-        basicParams.EquipmentType = basicParams.System
-      }
+    saveForm() {
       let updateParams = {
         data: {
           Content: [{ Id: this.editData.Point.Id }]
         },
         type: this.protocolType
       }
-      let otherParams = {}
-      switch (type) {
-        case '无需处理,直接使用':
-          otherParams = {
-            EquipmentMark: other.EquipmentMark
-          }
-          updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
-          break
-        case '需自动单位转换':
-          let DataRuleContent1 = JSON.stringify([
-            {
-              seq: 1,
-              ruletype: 'type1',
-              content: [
-                {
-                  from: other.unit[0] + '-' + other.unit[1],
-                  to: this.unitObj.unit
-                }
-              ]
+      let params = this.typeList.map((t, i) => {
+        let temp = this.dictionaryData[i],
+          tempNames = t.name.split('-');
+        let eachData = {
+          InfomationPointCode: temp[temp.length - 1],
+          InfomationPoint: tempNames[tempNames.length - 1],
+          DataRuleType: t.DataRuleType,
+          DataSourceId: this.datasourceId, //数据源id
+          PointId: this.editData.Point.Id, //点位ID
+          TypeCode: temp[0],
+          Type: tempNames[0],
+          EquipmentMark: this.form.EquipmentMark
+        }
+        if (temp.length == 3) {
+          //设备-部件-空间
+          eachData.EquipmentTypeCode = temp[1]
+          eachData.EquipmentType = tempNames[1]
+        } else if (temp.length == 4) {
+          eachData.SpecialtyCode = temp[1]
+          eachData.Specialty = tempNames[1]
+          eachData.SystemCode = temp[2]
+          eachData.System = tempNames[2]
+          eachData.EquipmentTypeCode = eachData.SystemCode  //为了配置从动参取值存储
+          eachData.EquipmentType = eachData.System
+        }
+        let type = t.DataRuleType;
+        updateParams.data.Content[0].EquipmentMark = eachData.EquipmentMark
+        switch (type) {
+          case '无需处理,直接使用':
+            // otherParams = {
+            //   EquipmentMark: other.EquipmentMark
+            // }
+            // updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
+            break
+          case '需自动单位转换':
+            let DataRuleContent1 = JSON.stringify([
+              {
+                seq: 1,
+                ruletype: 'type1',
+                content: [
+                  {
+                    from: t.other.unit[0] + '-' + t.other.unit[1],
+                    to: this.unitObj[eachData.InfomationPointCode].unit
+                  }
+                ]
+              }
+            ])
+            eachData.DataRuleContent = DataRuleContent1;
+            // otherParams = {
+            //   DataRuleContent: DataRuleContent1,
+            //   EquipmentMark: other.EquipmentMark
+            // }
+            // updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
+            break
+          case '需按设置枚举转换':
+            let DataRuleContent2 = t.other.pointArr.length
+              ? JSON.stringify([{ seq: 1, ruletype: 'type2', content: t.other.pointArr }])
+              : undefined
+            // otherParams = {
+            //   EquipmentMark: other.EquipmentMark,
+            //   DataRuleContent: DataRuleContent2
+            // }
+            eachData.DataRuleContent = DataRuleContent2;
+            // updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
+            break
+          case '需按公式转换':
+            let subRule = t.other.from
+              ? {
+                seq: 1,
+                ruletype: 'type4',
+                content: [
+                  {
+                    from: t.other.from,
+                    to: t.other.to
+                  }
+                ]
+              }
+              : undefined
+            let extractRule = {
+              seq: 2,
+              ruletype: 'type5',
+              content: t.other.extract
+                ? [
+                  {
+                    extract: 'number'
+                  }
+                ]
+                : []
             }
-          ])
-          otherParams = {
-            DataRuleContent: DataRuleContent1,
-            EquipmentMark: other.EquipmentMark
-          }
-          updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
-          break
-        case '需按设置枚举转换':
-          let DataRuleContent2 = other.pointArr.length
-            ? JSON.stringify([{ seq: 1, ruletype: 'type2', content: other.pointArr }])
-            : undefined
-          otherParams = {
-            EquipmentMark: other.EquipmentMark,
-            DataRuleContent: DataRuleContent2
-          }
-          updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
-          break
-        case '需按公式转换':
-          let subRule = other.from
-            ? {
-              seq: 1,
-              ruletype: 'type4',
-              content: [
-                {
-                  from: other.from,
-                  to: other.to
-                }
-              ]
+            let countRule = t.other.mark
+              ? {
+                seq: 3,
+                ruletype: 'type6',
+                content: [
+                  {
+                    calculationtype: t.other.mark,
+                    value: t.other.markValue
+                  }
+                ]
+              }
+              : undefined
+
+            let DataRuleContent3 = []
+            if (subRule) {
+              DataRuleContent3.push(subRule)
             }
-            : undefined
-          let extractRule = {
-            seq: 2,
-            ruletype: 'type5',
-            content: other.extract
-              ? [
-                {
-                  extract: 'number'
-                }
-              ]
-              : []
-          }
-          let countRule = other.mark
-            ? {
-              seq: 3,
-              ruletype: 'type6',
-              content: [
-                {
-                  calculationtype: other.mark,
-                  value: other.markValue
-                }
-              ]
+            DataRuleContent3.push(extractRule)
+            if (countRule) {
+              DataRuleContent3.push(countRule)
             }
-            : undefined
-
-          let DataRuleContent3 = []
-          if (subRule) {
-            DataRuleContent3.push(subRule)
-          }
-          DataRuleContent3.push(extractRule)
-          if (countRule) {
-            DataRuleContent3.push(countRule)
-          }
-          DataRuleContent3 = DataRuleContent3.length ? JSON.stringify(DataRuleContent3) : undefined
-          otherParams = {
-            EquipmentMark: other.EquipmentMark,
-            DataRuleContent: DataRuleContent3
-          }
-          updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
-          break
-        case '需拆分处理':
-          let SplitPoints = other.devArr.length ? other.devArr : undefined
-          let DataRuleContent4 = undefined
-          var enum5 = null
-          if (other.tranfVal) {
-            enum5 = { seq: 2, ruletype: 'type2', content: other.pointArr }
-          } else {
-            enum5 = { seq: 2, ruletype: 'type2', content: [] }
-          }
-          SplitPoints.forEach(ele => {
-            let cutStr = {
-              seq: 1,
-              ruletype: 'type4',
-              content: [
-                {
-                  from: ele.SplitStart,
-                  to: ele.SplitEnd
-                }
-              ]
+            DataRuleContent3 = DataRuleContent3.length ? JSON.stringify(DataRuleContent3) : undefined
+            eachData.DataRuleContent = DataRuleContent3;
+            // otherParams = {
+            //   EquipmentMark: other.EquipmentMark,
+            //   DataRuleContent: DataRuleContent3
+            // }
+            // updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
+            break
+          case '需拆分处理':
+            let SplitPoints = t.other.devArr.length ? t.other.devArr : undefined
+            let DataRuleContent4 = undefined
+            var enum5 = null
+            if (t.other.tranfVal) {
+              enum5 = { seq: 2, ruletype: 'type2', content: t.other.pointArr }
+            } else {
+              enum5 = { seq: 2, ruletype: 'type2', content: [] }
             }
-            ele.DataRuleContent = JSON.stringify([cutStr, enum5])
-          })
-          otherParams = {
-            SplitPoints: SplitPoints
-          }
-          updateParams.data.Content[0].EquipmentMark = other.eqMark
-          break
-      }
-      let params = [Object.assign(basicParams, otherParams)]
+            SplitPoints.forEach(ele => {
+              let cutStr = {
+                seq: 1,
+                ruletype: 'type4',
+                content: [
+                  {
+                    from: ele.SplitStart,
+                    to: ele.SplitEnd
+                  }
+                ]
+              }
+              ele.DataRuleContent = JSON.stringify([cutStr, enum5])
+            })
+            eachData.SplitPoints = SplitPoints;
+            // otherParams = {
+            // SplitPoints: SplitPoints
+            // }
+            updateParams.data.Content[0].EquipmentMark = t.other.eqMark
+            break
+        }
+        return eachData;
+      })
       updatePoint(updateParams, res => { this.create(params) })
     },
     create(params) {
@@ -367,7 +410,7 @@ export default {
     },
     handleItemChange(val, cb) {
       if (val.length == 3) {
-        if(val[2]!='null'){
+        if (val[2] != 'null') {
           let params = { type: val[2] }
           getQueryProperty(params, res => {
             if (res.Result == 'success') {
@@ -435,46 +478,61 @@ export default {
     },
     init() {
       //获取所有的设备
-      this.getEqAll()
+      // this.getEqAll()
     },
     //回显数值
     async showValue(val) {
       // await this.getEqAll()
       let length = val.RelationList.length
       let eqMark = this.editData.Point.EquipmentMark
+      this.form.EquipmentMark = eqMark;
+      console.log('-------------')
+      console.log(val)
       if (length) {
         var data = val.RelationList[0]
         let dict = [data.SpecialtyCode, data.SystemCode, data.EquipmentTypeCode]
         //回显字典
-        let tempArr = []
-        if (data.TypeCode == 'Eq' || data.TypeCode == 'Ec' || data.TypeCode == 'Sp') {
-          tempArr = [data.TypeCode, data.EquipmentTypeCode, data.InfomationPointCode]
-        } else if (data.TypeCode == 'Sy') {
-          tempArr = [data.TypeCode, data.SpecialtyCode, data.SystemCode, data.InfomationPointCode]
-        } else {
-          tempArr = [data.TypeCode, data.InfomationPointCode]
-        }
+        let tempArr = val.RelationList.map(t => {
+          let eachData = [];
+          if (t.TypeCode == 'Eq' || t.TypeCode == 'Ec' || t.TypeCode == 'Sp') {
+            eachData = [t.TypeCode, t.EquipmentTypeCode, t.InfomationPointCode]
+          } else if (t.TypeCode == 'Sy') {
+            eachData = [t.TypeCode, t.SpecialtyCode, t.SystemCode, t.InfomationPointCode]
+          } else {
+            eachData = [t.TypeCode, t.InfomationPointCode]
+          }
+          return eachData;
+        })
         this.$nextTick(() => {
-          this.$refs.dictionaryCas.setCascaderVal(tempArr)
+          this.$refs.dictionaryCas.setCascaderVal(tempArr);
         })
-
-          this.form.DataRuleType = data.DataRuleType
+        this.typeList = val.RelationList.map(t => {
+          if (t.TypeCode == 'Eq' || t.TypeCode == 'Ec' || t.TypeCode == 'Sp') {
+            t.name = `${t.Type}-${t.EquipmentType}-${t.InfomationPoint}`
+          } else if (t.TypeCode == 'Sy') {
+            t.name = `${t.Type}-${t.Specialty}-${t.System}-${t.InfomationPoint}`
+          } else {
+            t.name = `${t.Type}-${t.InfomationPoint}`
+          }
+          return t;
+        });
+        this.form.DataRuleType = data.DataRuleType
         // this.handleItemChange(dict, () => {
-          // this.unitObj = this.infoDict[data.InfomationPointCode]
-          // this.InfomationPoint = this.unitObj.infoPointName || '--'
-          // if (typeof this.unitObj.dataSource == 'string') {
-          //   if (this.unitObj.dataSource.length) {
-          //     this.ValueDescription = this.unitObj.dataSource
-          //   } else {
-          //     this.ValueDescription = '无信息点单位及值说明'
-          //   }
-          // } else {
-          //   let str = ''
-          //   this.unitObj.dataSource.forEach(ele => {
-          //     str += ele.code + '.' + ele.name + ' '
-          //   })
-          //   this.ValueDescription = str
-          // }
+        // this.unitObj = this.infoDict[data.InfomationPointCode]
+        // this.InfomationPoint = this.unitObj.infoPointName || '--'
+        // if (typeof this.unitObj.dataSource == 'string') {
+        //   if (this.unitObj.dataSource.length) {
+        //     this.ValueDescription = this.unitObj.dataSource
+        //   } else {
+        //     this.ValueDescription = '无信息点单位及值说明'
+        //   }
+        // } else {
+        //   let str = ''
+        //   this.unitObj.dataSource.forEach(ele => {
+        //     str += ele.code + '.' + ele.name + ' '
+        //   })
+        //   this.ValueDescription = str
+        // }
         // })
         if (length == 1) {
           let flag = data.DataRuleType
@@ -585,11 +643,41 @@ export default {
     //对应数据字典变化
     changeDictionaryCas({ val, labels, data }) {
       this.dictionaryData = val;
-      this.dictionaryNames = labels
+      this.dictionaryNames = labels || '';
+      this.unitObj = data || {}
+      if (this.typeList.length) {
+        this.typeList = this.typeList.map(t => {
+          if (labels.indexOf(t.name) < 0) {
+            return undefined
+          }
+          return t;
+        }).filter(item => item)
+        let temp = this.typeList.map(t => {
+          return t.name;
+        })
+        for (let i = 0; i < labels.length; i++) {
+          if (temp.indexOf(labels[i]) < 0) {
+            this.typeList.push({
+              name: labels[i],
+              DataRuleType: '无需处理,直接使用'
+            })
+          }
+        }
+      } else {
+        this.typeList = labels.map(t => {
+          return {
+            name: t,
+            DataRuleType: '无需处理,直接使用'
+          }
+        })
+      }
+      this.typeList = this.typeList.map((t, i) => {
+        t.ValueDescription = this.delDataSource(data[val[i][val[i].length - 1]].DataSource)
+        return t;
+      })
       // this.infoDict = this.$refs.dictionaryCas.pointDataSource
-      this.unitObj = data
-      this.InfomationPoint = this.unitObj.InfoPointName || ''
-      this.ValueDescription = this.delDataSource(this.unitObj.DataSource)
+      // this.InfomationPoint = this.unitObj.InfoPointName || ''
+      // this.ValueDescription = this.delDataSource(this.unitObj.DataSource)
     }
   },
   mounted() {
@@ -626,7 +714,7 @@ export default {
       span:nth-of-type(2) {
         width: calc(100% - 120px);
         overflow: hidden;
-        text-overflow:ellipsis;
+        text-overflow: ellipsis;
         white-space: nowrap;
       }
     }
@@ -644,6 +732,7 @@ export default {
         }
         .btm {
           margin-top: 5px;
+          margin-left: 140px;
         }
       }
     }

+ 3 - 3
src/components/config_point/step3_edit/no_handle.vue

@@ -1,8 +1,8 @@
 <template>
     <el-form ref='form' :model='form' :rules='rules' label-width='140px'>
-        <el-form-item v-if='devFlag' label='对象标识' prop="EquipmentMark">
+        <!-- <el-form-item v-if='devFlag' label='对象标识' prop="EquipmentMark">
             <el-input v-model='form.EquipmentMark'></el-input>
-        </el-form-item>
+        </el-form-item> -->
     </el-form>
 </template>
 
@@ -15,7 +15,7 @@ export default {
                 EquipmentMark: ''
             },
             rules: {
-                EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }],
+                // EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }],
             }
         }
     },

+ 2 - 0
src/components/config_point/step3_edit/split_handle.vue

@@ -189,6 +189,8 @@ export default {
             position: absolute;
             top: -35px;
             left: 23px;
+            margin: 0;
+            padding: 0;
         }
         .right {
             position: absolute;

+ 300 - 245
src/components/config_point/step3_point/3_temps.vue

@@ -11,14 +11,19 @@
           <dictionary-cas @change="changeDictionaryCas" ref="dictionaryCas"></dictionary-cas>
         </el-form-item>
       </el-form>
-      <div class="flex-around">
-        <div class="point-despoint">
-          <p class="center">原始点位说明</p>
-          <p class="p10">{{pointDes}}</p>
-        </div>
-        <div class="point-despoint">
-          <p class="center">数据字典值说明</p>
-          <p class="content-view p10">{{delDataSource(unitObj.DataSource)}}</p>
+      <div>
+        <div v-for="(it,ind) in typeList" :key="ind">
+          <p style="margin:10px 0;">信息点名称: {{it.name}}</p>
+          <div class="flex-around">
+            <div class="point-despoint">
+              <p class="center">原始点位说明</p>
+              <p class="p10">{{pointDes}}</p>
+            </div>
+            <div class="point-despoint">
+              <p class="center">数据字典值说明</p>
+              <p class="content-view p10">{{delDataSource(it.unitObj.DataSource)}}</p>
+            </div>
+          </div>
         </div>
       </div>
       <div class="center" style="margin-top:20px;">
@@ -26,29 +31,32 @@
       </div>
     </div>
     <div class="collapse-item" v-if="activeName == 1">
-      <div class="flex-around">
-        <div class="point-despoint">
-          <p class="center">原始点位说明</p>
-          <p class="p10">{{pointDes}}</p>
-        </div>
-        <div class="point-despoint">
-          <p class="center">数据字典值说明</p>
-          <p class="content-view p10">{{delDataSource(unitObj.DataSource)}}</p>
+      <div v-for="(it,ind) in typeList" :key="ind">
+        <p style="margin:10px 0;">信息点名称: {{it.name}}</p>
+        <div class="flex-around">
+          <div class="point-despoint">
+            <p class="center">原始点位说明</p>
+            <p class="p10">{{pointDes}}</p>
+          </div>
+          <div class="point-despoint">
+            <p class="center">数据字典值说明</p>
+            <p class="content-view p10">{{delDataSource(it.unitObj.DataSource)}}</p>
+          </div>
         </div>
+        <el-form class="form" :rules="rules" ref="form2" :model="form2" label-width="140px">
+          <el-form-item label='值处理方式' prop='DataRuleType'>
+            <el-select v-model='it.DataRuleType' placeholder='请选择'>
+              <el-option v-for='item in handleTypeArr' :key='item.value' :label='item.label' :value='item.value'></el-option>
+            </el-select>
+          </el-form-item>
+          <!-- components -->
+          <div :ref='"noHandle"+ind' v-if='it.DataRuleType == "无需处理,直接使用"'></div>
+          <auto-handle :devFlag="false" :ref='"autoHandle"+ind' v-else-if='it.DataRuleType == "需自动单位转换"' :unitObj='it.unitObj'></auto-handle>
+          <enum-handle :devFlag="false" :ref='"enumHandle"+ind' v-else-if='it.DataRuleType == "需按设置枚举转换"'></enum-handle>
+          <formula-handle :devFlag="false" :ref='"formulaHandle"+ind' v-else-if='it.DataRuleType == "需按公式转换"'></formula-handle>
+          <!-- <split-handle :devFlag="false" ref='splitHandle' v-else-if='form2.DataRuleType == "需按拆分枚举转换"'></split-handle> -->
+        </el-form>
       </div>
-      <el-form class="form" :rules="rules" ref="form2" :model="form2" label-width="140px">
-        <el-form-item label='值处理方式' prop='DataRuleType'>
-          <el-select v-model='form2.DataRuleType' placeholder='请选择'>
-            <el-option v-for='item in handleTypeArr' :key='item.value' :label='item.label' :value='item.value'></el-option>
-          </el-select>
-        </el-form-item>
-        <!-- components -->
-        <div ref='noHandle' v-if='form2.DataRuleType == "无需处理,直接使用"'></div>
-        <auto-handle :devFlag="false" ref='autoHandle' v-else-if='form2.DataRuleType == "需自动单位转换"' :unitObj='unitObj'></auto-handle>
-        <enum-handle :devFlag="false" ref='enumHandle' v-else-if='form2.DataRuleType == "需按设置枚举转换"'></enum-handle>
-        <formula-handle :devFlag="false" ref='formulaHandle' v-else-if='form2.DataRuleType == "需按公式转换"'></formula-handle>
-        <!-- <split-handle :devFlag="false" ref='splitHandle' v-else-if='form2.DataRuleType == "需按拆分枚举转换"'></split-handle> -->
-      </el-form>
       <div class="center" style="margin-top:20px;">
         <el-button @click="undo">上一步</el-button>
         <el-button @click="next">下一步</el-button>
@@ -151,7 +159,7 @@ export default {
         //     value: '需按拆分枚举转换'
         // }
       ],
-      dealType: {}, //处理方式
+      dealType: [], //处理方式
       form2: {
         ValueDescription: '',
         DataRuleType: '无需处理,直接使用'
@@ -164,7 +172,8 @@ export default {
         }],
         dict: [{ required: true }]
       },
-      pointDes: ""
+      pointDes: "",
+      typeList: []
     }
   },
   created() { },
@@ -185,7 +194,7 @@ export default {
     getMain(param, pagechange) {
       if (!pagechange) {
         this.activeName = 0
-        this.dealType = {}
+        this.dealType = []
         this.form1 = {
           dict: 1
         }
@@ -236,14 +245,18 @@ export default {
       // } else {
       //   this.createParam(params)
       // }
-      let pa = Object.assign({
-        DataSourceId: this.queryParam.DataSourceId,
-        KeyEquipmentParameter: this.queryParam.EquipmentParameter,
-        KeyEquipmentType: this.queryParam.EquipmentType,
-      }, this.dealType);
-      groupCreatePointRelation(pa, res => {
-        this.$message.success("处理成功")
-        this.$emit("changed")
+      this.dealType.forEach((t, i) => {
+        let pa = Object.assign({
+          DataSourceId: this.queryParam.DataSourceId,
+          KeyEquipmentParameter: this.queryParam.EquipmentParameter,
+          KeyEquipmentType: this.queryParam.EquipmentType,
+        }, t);
+        groupCreatePointRelation(pa, res => {
+          if (i == this.dealType.length - 1) {
+            this.$message.success("处理成功")
+            this.$emit("changed")
+          }
+        })
       })
     },
     confirm(assage, params) {
@@ -291,221 +304,235 @@ export default {
           }
         })
       } else if (this.activeName == 1) {
-        this.$refs.form2.validate(valid => {
-          if (valid) {
-            var flag = this.form2.DataRuleType
-            var isNext = true;
-            switch (flag) {
-              case '无需处理,直接使用':
-                this.saveForm(this.form2, {})
-                break
-              case '需自动单位转换':
-                this.$refs.autoHandle.getForm(autoHandle => {
-                  if (autoHandle) {
-                    this.saveForm(this.form2, autoHandle)
-                  } else {
-                    isNext = false
-                    this.errMsg()
-                  }
-                })
-                break
-              case '需按设置枚举转换':
-                this.$refs.enumHandle.getForm(enumHandle => {
-                  if (enumHandle) {
-                    this.saveForm(this.form2, enumHandle)
-                  } else {
-                    isNext = false
-                    this.errMsg()
-                  }
-                })
-                break
-              case '需按公式转换':
-                this.$refs.formulaHandle.getForm(formulaHandle => {
-                  if (formulaHandle) {
-                    this.saveForm(this.form2, formulaHandle)
-                  } else {
-                    isNext = false
-                    this.errMsg()
-                  }
-                })
-                break
-              // case '需按拆分枚举转换':
-              //     this.$refs.splitHandle.getForm(splitHandle => {
-              //         if (splitHandle) {
-              //             this.saveForm(this.form2, splitHandle)
-              //         } else {
-              //             isNext = false
-              //             this.errMsg()
-              //         }
-              //     })
-              //     break
-            }
-            if (isNext) {
-              this.activeName += 1
-              let setting = {
-                data: this.renderData,
-                maxRows: 1000,
-                colHeaders: ['对象标识', '原始点位描述', '位置标签', '备注'],
-                columns: [{
-                  data: 'EquipmentMark'
-                },
-                {
-                  data: 'Description',
-                  readOnly: true
-                },
-                {
-                  data: 'LocationFlag',
-                  readOnly: true
-                },
-                {
-                  data: 'Remarks',
-                  readOnly: true
+        let isNext = true;
+        for (let i = 0; i < this.typeList.length; i++) {
+          let flag = this.typeList[i].DataRuleType
+          let compon = '';
+          switch (flag) {
+            case '无需处理,直接使用':
+              this.typeList[i].other = {}
+              // this.saveForm(this.form2, {})
+              break
+            case '需自动单位转换':
+              compon = `autoHandle${i}`
+              this.$refs[compon][0].getForm(autoHandle => {
+                if (autoHandle) {
+                  this.typeList[i].other = autoHandle;
+                  // this.saveForm(this.form2, autoHandle)
+                } else {
+                  isNext = false
+                  this.errMsg()
                 }
-                ]
-              }
-              if (this.renderData.length) {
-                this.$nextTick(_ => {
-                  this.hot = this.$refs.handsontable.init(setting)
-                })
-              }
+              })
+              break
+            case '需按设置枚举转换':
+              compon = `enumHandle${i}`
+              this.$refs[compon][0].getForm(enumHandle => {
+                if (enumHandle) {
+                  this.typeList[i].other = enumHandle;
+                  // this.saveForm(this.form2, enumHandle)
+                } else {
+                  isNext = false
+                  this.errMsg()
+                }
+              })
+              break
+            case '需按公式转换':
+              compon = `formulaHandle${i}`
+              this.$refs[compon][0].getForm(formulaHandle => {
+                if (formulaHandle) {
+                  this.typeList[i].other = formulaHandle;
+                  // this.saveForm(this.form2, formulaHandle)
+                } else {
+                  isNext = false
+                  this.errMsg()
+                }
+              })
+              break
+            // case '需按拆分枚举转换':
+            //     this.$refs.splitHandle.getForm(splitHandle => {
+            //         if (splitHandle) {
+            //             this.saveForm(this.form2, splitHandle)
+            //         } else {
+            //             isNext = false
+            //             this.errMsg()
+            //         }
+            //     })
+            //     break
+          }
+        }
+        if (isNext) {
+          this.saveForm();
+          this.activeName += 1
+          let setting = {
+            data: this.renderData,
+            maxRows: 1000,
+            colHeaders: ['对象标识', '原始点位描述', '位置标签', '备注'],
+            columns: [{
+              data: 'EquipmentMark'
+            },
+            {
+              data: 'Description',
+              readOnly: true
+            },
+            {
+              data: 'LocationFlag',
+              readOnly: true
+            },
+            {
+              data: 'Remarks',
+              readOnly: true
             }
-
-          } else {
-            this.errMsg()
-            return false
+            ]
           }
-        })
+          if (this.renderData.length) {
+            this.$nextTick(_ => {
+              this.hot = this.$refs.handsontable.init(setting)
+            })
+          }
+        }
       }
     },
-    saveForm(basic, other) {
-      let type = basic.DataRuleType
-      let basicParams = {
-        InfomationPointCode: this.dictionaryData[this.dictionaryData.length - 1], //信息点code
-        InfomationPoint: this.dictionaryNames[this.dictionaryNames.length - 1], //信息点名称
-        DataRuleType: basic.DataRuleType, //值处理方式
-        Type: this.dictionaryNames[0], //一级分类名称
-        TypeCode: this.dictionaryData[0], //一级分类code
-      }
-      if (this.dictionaryData.length == 3) {
-        //设备-部件-空间
-        basicParams.EquipmentTypeCode = this.dictionaryData[1]
-        basicParams.EquipmentType = this.dictionaryNames[1]
-      } else if (this.dictionaryData.length == 4) { //专业系统
-        basicParams.SpecialtyCode = this.dictionaryData[1]
-        basicParams.Specialty = this.dictionaryNames[1]
-        basicParams.SystemCode = this.dictionaryData[2]
-        basicParams.System = this.dictionaryNames[2]
-        basicParams.EquipmentTypeCode = basicParams.SystemCode //为了配置从动参取值存储
-        basicParams.EquipmentType = basicParams.System
-      }
-      let otherParams = {}
-      switch (type) {
-        case '无需处理,直接使用':
-          otherParams = {
-            // EquipmentMark: other.EquipmentMark
-          }
-          break
-        case '需自动单位转换':
-          let DataRuleContent1 = JSON.stringify([{
-            seq: 1,
-            ruletype: 'type1',
-            content: [{
-              from: other.unit[0] + '-' + other.unit[1],
-              to: this.unitObj.unit
-            }]
-          }])
-          otherParams = {
-            DataRuleContent: DataRuleContent1,
+    saveForm() {
+      let params = this.typeList.map((t, i) => {
+        let temp = this.dictionaryData[i],
+          tempNames = t.name.split('-');
+        let eachData = {
+          InfomationPointCode: temp[temp.length - 1],
+          InfomationPoint: tempNames[tempNames.length - 1],
+          DataRuleType: t.DataRuleType,
+          // DataSourceId: this.datasourceId, //数据源id
+          // PointId: this.editData.Point.Id, //点位ID
+          TypeCode: temp[0],
+          Type: tempNames[0],
+          // EquipmentMark: this.form.EquipmentMark
+        }
+        if (temp.length == 3) {
+          //设备-部件-空间
+          eachData.EquipmentTypeCode = temp[1]
+          eachData.EquipmentType = tempNames[1]
+        } else if (temp.length == 4) {
+          eachData.SpecialtyCode = temp[1]
+          eachData.Specialty = tempNames[1]
+          eachData.SystemCode = temp[2]
+          eachData.System = tempNames[2]
+          eachData.EquipmentTypeCode = eachData.SystemCode  //为了配置从动参取值存储
+          eachData.EquipmentType = eachData.System
+        }
+        let type = t.DataRuleType;
+        switch (type) {
+          case '无需处理,直接使用':
+            // otherParams = {
             // EquipmentMark: other.EquipmentMark
-          }
-          break
-        case '需按设置枚举转换':
-          let DataRuleContent2 = other.pointArr.length ?
-            JSON.stringify([{
+            // }
+            break
+          case '需自动单位转换':
+            let DataRuleContent1 = JSON.stringify([{
               seq: 1,
-              ruletype: 'type2',
-              content: other.pointArr
-            }]) :
-            undefined
-          otherParams = {
-            // EquipmentMark: other.EquipmentMark,
-            DataRuleContent: DataRuleContent2
-          }
-          break
-        case '需按公式转换':
-          let subRule = other.from ? {
-            seq: 1,
-            ruletype: 'type4',
-            content: [{
-              from: other.from,
-              to: other.to
-            }]
-          } :
-            undefined
-          let extractRule = {
-            seq: 2,
-            ruletype: 'type5',
-            content: other.extract ? [{
-              extract: 'number'
-            }] : []
-          }
-          let countRule = other.mark ? {
-            seq: 3,
-            ruletype: 'type6',
-            content: [{
-              calculationtype: other.mark,
-              value: other.markValue
-            }]
-          } :
-            undefined
-          let DataRuleContent3 = []
-          if (subRule) {
-            DataRuleContent3.push(subRule)
-          }
-          DataRuleContent3.push(extractRule)
-          if (countRule) {
-            DataRuleContent3.push(countRule)
-          }
-          DataRuleContent3 = DataRuleContent3.length ? JSON.stringify(DataRuleContent3) : undefined
-          otherParams = {
+              ruletype: 'type1',
+              content: [{
+                from: t.other.unit[0] + '-' + t.other.unit[1],
+                to: this.unitObj.unit
+              }]
+            }])
+            eachData.DataRuleContent = DataRuleContent1;
+            // otherParams = {
+            // DataRuleContent: DataRuleContent1,
+            // EquipmentMark: other.EquipmentMark
+            // }
+            break
+          case '需按设置枚举转换':
+            let DataRuleContent2 = t.other.pointArr.length ?
+              JSON.stringify([{
+                seq: 1,
+                ruletype: 'type2',
+                content: t.other.pointArr
+              }]) :
+              undefined
+            eachData.DataRuleContent = DataRuleContent2;
+            // otherParams = {
             // EquipmentMark: other.EquipmentMark,
-            DataRuleContent: DataRuleContent3
-          }
-          break
-        case '需拆分处理':
-          let SplitPoints = other.devArr.length ? other.devArr : undefined
-          let DataRuleContent4 = undefined
-          var enum5 = null
-          if (other.tranfVal) {
-            enum5 = {
-              seq: 2,
-              ruletype: 'type2',
-              content: other.pointArr
-            }
-          } else {
-            enum5 = {
-              seq: 2,
-              ruletype: 'type2',
-              content: []
-            }
-          }
-          SplitPoints.forEach(ele => {
-            let cutStr = {
+            // DataRuleContent: DataRuleContent2
+            // }
+            break
+          case '需按公式转换':
+            let subRule = t.other.from ? {
               seq: 1,
               ruletype: 'type4',
               content: [{
-                from: ele.SplitStart,
-                to: ele.SplitEnd
+                from: t.other.from,
+                to: t.other.to
               }]
+            } :
+              undefined
+            let extractRule = {
+              seq: 2,
+              ruletype: 'type5',
+              content: t.other.extract ? [{
+                extract: 'number'
+              }] : []
             }
-            ele.DataRuleContent = JSON.stringify([cutStr, enum5])
-          })
-          otherParams = {
-            SplitPoints: SplitPoints
-          }
-          break
-      }
-      this.dealType = Object.assign(basicParams, otherParams)
+            let countRule = t.other.mark ? {
+              seq: 3,
+              ruletype: 'type6',
+              content: [{
+                calculationtype: t.other.mark,
+                value: t.other.markValue
+              }]
+            } :
+              undefined
+            let DataRuleContent3 = []
+            if (subRule) {
+              DataRuleContent3.push(subRule)
+            }
+            DataRuleContent3.push(extractRule)
+            if (countRule) {
+              DataRuleContent3.push(countRule)
+            }
+            DataRuleContent3 = DataRuleContent3.length ? JSON.stringify(DataRuleContent3) : undefined
+            eachData.DataRuleContent = DataRuleContent3;
+            // otherParams = {
+            // EquipmentMark: other.EquipmentMark,
+            // DataRuleContent: DataRuleContent3
+            // }
+            break
+          case '需拆分处理':
+            let SplitPoints = t.other.devArr.length ? t.other.devArr : undefined
+            let DataRuleContent4 = undefined
+            var enum5 = null
+            if (t.other.tranfVal) {
+              enum5 = {
+                seq: 2,
+                ruletype: 'type2',
+                content: t.other.pointArr
+              }
+            } else {
+              enum5 = {
+                seq: 2,
+                ruletype: 'type2',
+                content: []
+              }
+            }
+            SplitPoints.forEach(ele => {
+              let cutStr = {
+                seq: 1,
+                ruletype: 'type4',
+                content: [{
+                  from: ele.SplitStart,
+                  to: ele.SplitEnd
+                }]
+              }
+              ele.DataRuleContent = JSON.stringify([cutStr, enum5])
+            })
+            eachData.SplitPoints = SplitPoints;
+            // otherParams = {
+            //   SplitPoints: SplitPoints
+            // }
+            break
+        }
+        return eachData;
+      })
+      this.dealType = params
       // this.create(params)
     },
     validateDict(rule, value, cb) {
@@ -601,10 +628,38 @@ export default {
     //对应数据字典变化
     changeDictionaryCas({ val, labels, data }) {
       this.dictionaryData = val;
-      this.dictionaryNames = labels
-      // this.infoDict = this.$refs.dictionaryCas.pointDataSource
+      this.dictionaryNames = labels;
       this.unitObj = data
-      this.InfomationPoint = this.unitObj.InfoPointName || ''
+      if (this.typeList.length) {
+        this.typeList = this.typeList.map(t => {
+          if (labels.indexOf(t.name) < 0) {
+            return undefined
+          }
+          return t;
+        }).filter(item => item)
+        let temp = this.typeList.map(t => {
+          return t.name;
+        })
+        for (let i = 0; i < labels.length; i++) {
+          if (temp.indexOf(labels[i]) < 0) {
+            this.typeList.push({
+              name: labels[i],
+              DataRuleType: '无需处理,直接使用'
+            })
+          }
+        }
+      } else {
+        this.typeList = labels.map(t => {
+          return {
+            name: t,
+            DataRuleType: '无需处理,直接使用'
+          }
+        })
+      }
+      this.typeList = this.typeList.map((t, i) => {
+        t.unitObj = data[val[i][val[i].length - 1]];
+        return t;
+      })
     },
     //分页发生更改
     changePage() {

+ 21 - 9
src/components/data_admin/buildTask/dialog/modelTaskDialog.vue

@@ -62,10 +62,10 @@ export default {
       title: "确认创建任务",
       options: [{//方案
         value: '1',
-        label: '标准'
+        label: '极简'
       }, {
         value: '2',
-        label: '极简'
+        label: '标准'
       }],
       tableData: [],
       loading: false,
@@ -164,7 +164,8 @@ export default {
         item.FolderId = this.params.modelFolderId
         item.FileName = this.params.modelFileName
         item.FileId = this.params.CurrentModelId
-        item.SchemeId = "1"
+        // 后端定义默认值(前端取消默认值设定)
+        // item.SchemeId = "1"
         return item
       })
       this.page.total = res.Total
@@ -176,12 +177,23 @@ export default {
     savaRelation() {
       if (this.selections.length) {
         let list = this.selections.map((item) => {
-          return {
-            EquipId: item.EquipID,
-            FileId: item.FileId,
-            FileName: item.FileName,
-            FolderId: item.FolderId,
-            FolderName: item.FolderName
+          if (item.SchemeId) {
+            return {
+              EquipId: item.EquipID,
+              FileId: item.FileId,
+              FileName: item.FileName,
+              FolderId: item.FolderId,
+              FolderName: item.FolderName,
+              SchemeId: item.SchemeId
+            }
+          } else {
+            return {
+              EquipId: item.EquipID,
+              FileId: item.FileId,
+              FileName: item.FileName,
+              FolderId: item.FolderId,
+              FolderName: item.FolderName
+            }
           }
         })
         let params = {

+ 13 - 14
src/components/data_admin/buildTask/taskStatistics.vue

@@ -35,19 +35,18 @@
 </template>
 
 <script>
-import { mapGetters } from "vuex"
-import { queryTaskCount, countAssetsTask } from "@/api/data_admin/buildTaskApi"
-export default {
-  components: {
-    
-  },
-  computed: {
-    ...mapGetters("layout", ["projectId", "secret", "userId" ]),
-    taskProgress(){
-      if(typeof this.alreadyCount == 'number' && typeof this.allCount == 'number'){
-        return Math.round(this.alreadyCount/this.allCount*100)
+  import {mapGetters} from "vuex"
+  import {countAssetsTask, queryTaskCount} from "@/api/data_admin/buildTaskApi"
+
+  export default {
+    components: {},
+    computed: {
+      ...mapGetters("layout", ["projectId", "secret", "userId"]),
+      taskProgress() {
+        if (typeof this.alreadyCount == 'number' && typeof this.allCount == 'number') {
+          return Math.round(this.alreadyCount / this.allCount * 100)
+        }
       }
-    }
   },
   data() {
     return {
@@ -124,7 +123,7 @@ export default {
           flex: 1;
           font-size: 15px;
           line-height: 35px;
-        } 
+        }
       }
     }
     .statistics-list{
@@ -157,4 +156,4 @@ export default {
     display: flex;
 		flex-direction: column;
   }
-</style>
+</style>

+ 48 - 41
src/components/ledger/addDialog/dialogZone.vue

@@ -1,62 +1,69 @@
 <template>
   <!-- Form -->
-  <el-dialog title="收货地址" :visible.sync="dialogFormVisible">
+  <el-dialog title="收货地址" :visible.sync="dialogFormVisible" width="30%">
     <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
-      <el-form-item label="分区名称" prop="name">
-        <el-input v-model="ruleForm.name"></el-input>
+      <el-form-item label="分区名称" prop="Name">
+        <el-input v-model="ruleForm.Name"></el-input>
       </el-form-item>
-      <el-form-item label="分区ID" prop="id">
-        <el-input v-model="ruleForm.id"></el-input>
+      <el-form-item label="分区ID" prop="Id">
+        <el-input v-model="ruleForm.Id"></el-input>
       </el-form-item>
       <el-form-item style="float: right;margin-top: 20px">
         <el-button @click="dialogFormVisible = false">取 消</el-button>
         <el-button type="primary" @click="submitForm('ruleForm')">添 加</el-button>
       </el-form-item>
-
-      <!--    <div slot="footer" class="dialog-footer">-->
-      <!--      <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>-->
-      <!--    </div>-->
     </el-form>
   </el-dialog>
 </template>
 
 <script>
-  export default {
-    name: "dialogZone",
-    data() {
-      return {
-        dialogFormVisible: false,
-        ruleForm: {
-          name: '',
-          id: ''
+import {
+  zoneCreateType
+} from "@/api/scan/request"
+export default {
+  name: "dialogZone",
+  data() {
+    return {
+      dialogFormVisible: false,
+      ruleForm: {
+        Name: '',
+        Id: '',
+        ParentId: "OtherZone"
+      },
+      rules: {
+        Name: [
+          { required: true, message: '请输入分区名称', trigger: 'blur' },
+          // {min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur'}
+        ],
+        Id: [
+          { required: true, message: '请输入分区ID', trigger: 'blur' },
+        ],
+      }
+    };
+  },
+  methods: {
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          let pa = {
+            Content: [this.ruleForm]
+          }
+          zoneCreateType(pa, res=>{
+            this.$message.success('添加成功')
+            this.dialogFormVisible = false
+            this.ruleForm.Name = ''
+            this.ruleForm.Id = '';
+            this.$emit('createSuccess')
+          })
 
-        },
-        rules: {
-          name: [
-            {required: true, message: '请输入分区名称', trigger: 'blur'},
-            // {min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur'}
-          ],
-          id: [
-            {required: true, message: '请输入分区ID', trigger: 'blur'},
-          ],
+        } else {
+          console.log('error submit!!');
+          return false;
         }
-      };
+      });
     },
-    methods: {
-      submitForm(formName) {
-        this.$refs[formName].validate((valid) => {
-          if (valid) {
-            this.dialogFormVisible = false
-            this.ruleForm.name = ''
-            this.ruleForm.id = ''
-          } else {
-            console.log('error submit!!');
-            return false;
-          }
-        });
-      },
-    }
   }
+}
 </script>
 
 <style scoped>

+ 256 - 0
src/components/ledger/cenote/elevationMap.vue

@@ -0,0 +1,256 @@
+<template>
+  <div v-loading="load" class="saga-elevation">
+    <div v-if="elevationData.length" class="saga-floor">
+      <div class="saga-rf">
+        <p class="saga-floorName">RF</p>
+        <div class="saga-spaceList">
+          <div class="saga-group" v-for="(winth, index) in groupWidth" :key="index" :style="`width: ${100*winth}px;`"></div>
+        </div>
+      </div>
+      <div class="saga-floor-item" v-for="floor in elevationData" :key="floor.FloorID">
+        <p class="saga-floorName" :title="floor.FloorLocalName?floor.FloorLocalName:floor.FloorName">
+          {{floor.FloorLocalName?floor.FloorLocalName:floor.FloorName}}
+          <i class="el-icon-right"></i>
+        </p>
+        <div class="saga-spaceList">
+          <div class="saga-group" v-for="(group, groupIndex) in floor.group" :style="`width: ${100*groupWidth[groupIndex]}px;`">
+            <div class="saga-spaceItem" 
+            :class="[spaceItem.IsAI?spaceItem.checked?'saga-spaceItem-checked':'saga-spaceItem-ai':'']" 
+            v-for="spaceItem in group.spaceList" 
+            :key="spaceItem.RoomID"
+            :title="spaceItem.RoomLocalName?spaceItem.RoomLocalName:spaceItem.RoomName"
+            @click="handleClickCheck(spaceItem)"
+            >
+            {{spaceItem.RoomLocalName?spaceItem.RoomLocalName:spaceItem.RoomName}}
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div v-else class="saga-center">
+      <i class="icon-wushuju iconfont"></i>
+      数据暂无
+    </div>
+  </div>
+</template>
+
+<script>
+  import { shaftVerticalSpace, shaftZoneLink } from "@/api/scan/request"
+
+  import {mapGetters} from 'vuex'
+  export default {
+  data () {
+    return {
+      elevationData: [],
+      groupWidth: {},
+      checkedList: [],
+      load: false,
+    }
+  },
+  computed: {
+    ...mapGetters("layout", ["projectId"])
+  },
+  props: {
+    params: Object,
+    onlyRead: Boolean,
+    isEdit: Boolean,
+    isAI: Boolean,
+  },
+  methods: {
+    init () { //获取数据并格式化数据
+      this.elevationData = [];
+      //根据isAI判断请求参数是否包含AI推介数据(暂未完成)
+      this.params.AiSwitch = this.isAI
+      console.log(this.params)
+      this.load = true;
+      // 查询竖井关联的空间垂直交通关系
+      shaftVerticalSpace(this.params, (res) => {
+        let data = res.Content;
+        let max = 0, idMap = {}, groupMap = {}, copyData = JSON.parse(JSON.stringify(data));
+        this.groupWidth = {};
+        copyData.reverse().forEach(floor => {
+          if (floor.ZoneSpaceList && floor.ZoneSpaceList.length) {
+            floor.ZoneSpaceList.forEach(space => {
+              if (idMap[space.RoomID]) {  // 该业务空间在映射列表中
+                groupMap[idMap[space.RoomID]].push(space)
+                space.SpaceIdList.forEach(RoomID =>{
+                  if (!idMap[RoomID]) {
+                    idMap[RoomID] = idMap[space.RoomID];
+                  }
+                })
+              } else { // 该业务空间不在映射列表中
+                max++;
+                idMap[space.RoomID] = max;
+                groupMap[max] = [];
+                this.groupWidth[max] = 0;
+                groupMap[max].push(space);
+                space.SpaceIdList.forEach(RoomID =>{
+                  if (!idMap[RoomID]) {
+                    idMap[RoomID] = max;
+                  }
+                })
+              }
+            })
+          }
+        })
+        data.forEach((floor, index) =>{
+          floor.group = {};
+          Object.keys(groupMap).forEach(groupIndex =>{
+            let max = 0;
+            floor.group[groupIndex] = {
+              spaceList: []
+            };
+            if (floor.ZoneSpaceList && floor.ZoneSpaceList.length) {
+              floor.ZoneSpaceList.forEach(space => {
+                if (groupMap[groupIndex].find(item => { return space.RoomID == item.RoomID })) {
+                  space.checked = false;
+                  floor.group[groupIndex].spaceList.push(space);
+                  max++;
+                }
+              })
+            }
+            if (max > this.groupWidth[groupIndex]) {
+              this.groupWidth[groupIndex] = max;
+            }
+          })
+        });
+        this.elevationData = data
+        console.log(this.elevationData)
+        this.load = false;
+      })
+    },
+    handleClickCheck (sapceItem) { //点选推介的业务空间
+      console.log(this.isEdit)
+      if (sapceItem.IsAI && this.isEdit && !this.onlyRead) { //是AI推荐并且编辑模式下
+        sapceItem.checked = sapceItem.checked? false: true;
+        if (sapceItem.checked) {
+          this.checkedList.push(sapceItem);
+          // 选中平面图的对应空间
+          this.$emit('elevationChecked',sapceItem.RoomID);
+        } else {
+          let index = this.checkedList.findIndex(item =>{ return item.RoomID == sapceItem.RoomID })
+          if (index != -1) { // 找到对应的数据
+            this.checkedList.splice(index,1);
+            // 取消选中平面图的对应空间
+            this.$emit('elevationUncheck',sapceItem.RoomID);
+          }
+        }
+      }
+    },
+    savaEdit () {// 接口保存数据和业务空间的关系
+      let params = {
+        type: this.params.ObjectType,
+        data: {
+          ShaftId: this.params.ShaftId,
+          SpaceIdList: this.checkedList.map(item => {
+            return item.RoomID
+          })
+        }
+      }
+      console.log(params);
+      shaftZoneLink(params, res =>{
+        this.$message.success("保存成功");
+        this.init();
+      })
+    }
+  },
+  watch: {
+    projectId() {
+      if (this.params.BuildingId && this.params.ObjectType && this.params.ShaftId) {
+        this.init();
+      }
+      console.log(this.projectId)
+    },
+    // isAI() {
+    //   if (this.params.BuildingId && this.params.ObjectType && this.params.ShaftId) {
+    //     this.init();
+    //   }
+    // },
+    params: {
+      handler() {
+        if (this.params.BuildingId && this.params.ObjectType && this.params.ShaftId) {
+          this.init();
+        }
+      },
+      immediate: true,
+      deep: true,
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .saga-elevation {
+    height: 100%;
+    position: relative;
+    .saga-center{
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      transform: translate(-50%,-60%);
+      text-align: center;
+    }
+    .saga-floor {
+      display: flex;
+      box-sizing: border-box;
+      flex-direction: column;
+      justify-content: flex-end;
+      padding: 60px 10px 20px 0px;
+      .saga-rf {
+        display: flex;
+        flex-direction: row;
+        font-size: 12px;
+        color: blue;
+      }
+      .saga-floor-item {
+        display: flex;
+        flex-direction: row;
+        font-size: 12px;
+        height: 60px;
+        line-height: 60px;
+      }
+      .saga-floorName {
+        min-width: 80px;
+        text-align: right;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+      }
+      .saga-spaceList {
+        display: flex;
+        flex-direction: row;
+        flex: 1;
+        border-bottom: 2px solid #c1c6d2;
+        box-sizing: border-box;
+        .saga-group {
+          display: flex;
+          flex-direction: row;
+          margin-left: 25px;
+          box-sizing: border-box;
+          .saga-spaceItem {
+            width: 100px;
+            margin-left: 1px;
+            text-align: center;
+            overflow: hidden;
+            text-overflow:ellipsis;
+            white-space: nowrap;
+            background-color: #ffcc00;
+            border: 1px solid #333333;
+          }
+          .saga-spaceItem-ai{
+            cursor: pointer;
+            box-sizing: border-box;
+            background-color: #eaeae9;
+            border: 1px dashed #333333;
+          }
+          .saga-spaceItem-checked {
+            cursor: pointer;
+            box-sizing: border-box;
+            background-color: #1abc9c;
+            border: 1px dashed #333333;
+          }
+        }
+      }
+    }
+  }
+</style>

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

@@ -16,8 +16,7 @@
       </el-select>
       <!-- <el-button size="small" style='width: 80px;' @click="download" icon="iconfont icon-xiazai">下载</el-button> -->
       <el-button size="small" style='width: 80px;' @click="addDevice">添加设备</el-button>
-      <el-button size="small" @click="Batch" v-show="!onlyRead" :disabled="!(tableData && tableData.length)">批量维护信息点
-      </el-button>
+      <el-button size="small" @click="Batch" v-show="!onlyRead" :disabled="!(tableData && tableData.length)">批量维护信息点</el-button>
       <el-button size="small" style='width: 80px;' @click="reset">刷新</el-button>
       <el-button size="small" style='width: 80px;' v-show="!onlyRead" @click="undo">撤销</el-button>
     </div>

+ 25 - 10
src/components/ledger/lib/cenoteGraphy.vue

@@ -22,7 +22,7 @@ import { SColor, SPoint } from "@saga-web/draw/lib";
 import { DivideFloorScene, SpaceItem, ZoneItem } from "@saga-web/cad-engine/lib";
 import { FloorView } from "@saga-web/cad-engine/lib/FloorView";
 import { colorArr } from '@/utils/spaceColor';
-import { getFloorMsgByFloorID, queryZone, shaftSpaceQuery, shaftZoneLink } from '@/api/scan/request';
+import { getFloorMsgByFloorID, shaftSpaceQuery, shaftZoneLinkReplace, zoneQuery } from '@/api/scan/request';
 import { resolve, reject } from 'q';
 export default {
   data() {
@@ -124,17 +124,16 @@ export default {
       });
       let promise2 = new Promise((resolve, reject) => {
         let pa = {
-          zone: this.space,
-          data: {
-            Filters: ``,
-            Orders: "createTime desc, RoomID asc",
-            PageSize: 1000
-          }
+          Filters: `not RoomID isNull`,
+          Orders: "createTime desc, RoomID asc",
+          PageSize: 1000,
+          ZoneType: this.space
         }
         if (this.buildingData.length && this.buildingData.length > 1) {
-          pa.data.Filters = `BuildingId='${this.buildingData[0]}';FloorId='${this.buildingData[1]}'`
+          pa.BuildingId = this.buildingData[0];
+          pa.FloorId = this.buildingData[1];
         }
-        queryZone(pa, res => {
+        zoneQuery(pa, res => {
           resolve(res);
         })
       })
@@ -181,6 +180,22 @@ export default {
         item.selected = false;
       }
     },
+    // 立面图选中空间对应平面图选中
+    canvasChecked(RoomID) {
+      this.scene.zoneList.map(zoneItem => {
+        if (zoneItem.data.RoomID == RoomID) {
+          zoneItem.selected = true;
+        }
+      })
+    },
+    // 立面图取消选中对应平面图取消选中
+    canvasUncheck(RoomID) {
+      this.scene.zoneList.map(zoneItem => {
+        if (zoneItem.data.RoomID == RoomID) {
+          zoneItem.selected = false;
+        }
+      })
+    },
     //取消编辑
     cancelEdit() {
       this.config.isEdit = false;
@@ -211,7 +226,7 @@ export default {
       param.data.SpaceIdList = arr.map(t => {
         return t.data.RoomID;
       })
-      shaftZoneLink(param, res => {
+      shaftZoneLinkReplace(param, res => {
         this.config.isEdit = false;
         this.$message.success("保存成功");
         this.getBusinessSpace();

+ 52 - 53
src/components/ledger/lib/linkassets.vue

@@ -3,17 +3,17 @@
     <el-row>
       <span class="condition-title">设备类型:</span>
       <el-select v-model="deviceType" filterable size="small" @change="handleChangeDevice" style="width:350px;">
-        <el-option  v-for="item in deviceTypeList" :key="item.Category" :label="item.CategoryName" :value="item.Category"></el-option>
+        <el-option v-for="item in deviceTypeList" :key="item.Category" :label="item.CategoryName" :value="item.Category"></el-option>
       </el-select>
     </el-row>
     <el-row style="margin-top:30px;">
       <span class="condition-title">建筑楼层:</span>
       <el-cascader :options="bfoptions" v-model="buildFloor" filterable size="small" @change="handleChangeBf" style="width:350px;"></el-cascader>
     </el-row>
-    <el-row style="margin-top:30px;"  v-show="spaceShow">
+    <el-row style="margin-top:30px;" v-show="spaceShow">
       <span class="condition-title">分区类型:</span>
       <el-select v-model="zone" filterable size="small" @change="handleChangeZone" style="width:350px;">
-        <el-option  v-for="item in zoneList" :key="item.Code" :label="item.Name" :value="item.Code"></el-option>
+        <el-option v-for="item in zoneList" :key="item.Code" :label="item.Name" :value="item.Code"></el-option>
       </el-select>
     </el-row>
     <el-row style="margin-top:30px;" v-show="spaceShow && zone != 'all' && zone != 'noKnow'">
@@ -31,7 +31,7 @@
 </template>
 <script>
 
-import { floorQuery, buildingQuery, queryDictionaryHead, queryZone, TypePartsDie } from '@/api/scan/request'
+import { floorQuery, buildingQuery, queryDictionaryHead, zoneQuery, TypePartsDie } from '@/api/scan/request'
 
 import { mapGetters } from "vuex"
 export default {
@@ -69,7 +69,7 @@ export default {
   mounted() { },
   methods: {
     //打开弹窗回调,初始化选择
-    handleOpenReset(){
+    handleOpenReset() {
       this.deviceType = ''
       this.buildFloor = ['all']
       this.zone = 'all'
@@ -126,9 +126,9 @@ export default {
           value: "all",
           label: "全部"
         }, {
-            value: "noKnow",
-            label: "不在建筑内"
-          })
+          value: "noKnow",
+          label: "不在建筑内"
+        })
         data.forEach(build => {
           floorData.forEach(floor => {
             if (build.value == floor.BuildID && floor.FloorID && floor.FloorLocalName) {
@@ -144,13 +144,13 @@ export default {
                   value: "all",
                   label: "全部"
                 }, {
-                    value: 'noKnow',
-                    label: "不在楼层内"
-                  }, {
-                    value: floor.FloorID,
-                    label: floor.FloorLocalName,
-                    FloorSequenceID: floor.FloorSequenceID
-                  })
+                  value: 'noKnow',
+                  label: "不在楼层内"
+                }, {
+                  value: floor.FloorID,
+                  label: floor.FloorLocalName,
+                  FloorSequenceID: floor.FloorSequenceID
+                })
               }
             }
           })
@@ -159,16 +159,16 @@ export default {
       })
     },
     //获取空间分区数据
-    getSpaceData(){
+    getSpaceData() {
       let params = {
         Filters: "parentId = 'Space'",
         PageNumber: 1,
         PageSize: 1000,
-        Projection: [ "Code", "Name" ]
+        Projection: ["Code", "Name"]
       }
       queryDictionaryHead(params, res => {
         this.zoneList = res.Content.filter(item => {
-          if(item.Code != 'Ispace'){
+          if (item.Code != 'Ispace') {
             return item
           }
         })
@@ -195,9 +195,9 @@ export default {
       this.handleChangeSpaceItem()
     },
     //判断是否显示空间分区选择
-    zoneListIsShow(){
+    zoneListIsShow() {
       let lastVal = this.buildFloor.slice(-1)[0]
-      if(!lastVal || lastVal == 'noKnow' || this.buildFloor[0] == 'all' || this.deviceType.length != 4) {
+      if (!lastVal || lastVal == 'noKnow' || this.buildFloor[0] == 'all' || this.deviceType.length != 4) {
         this.spaceShow = false
       } else {
         this.spaceShow = true
@@ -212,30 +212,29 @@ export default {
     },
     // 获取空间实例
     handleChangeSpaceItem() {
-      if(this.zone != 'all' && this.zone != 'noKnow') {
+      if (this.zone != 'all' && this.zone != 'noKnow') {
         let nodes = []
         let recursionGetData = (pageNum, zone) => {
           pageNum = pageNum ? pageNum : 1
           let params = {
-            zone: zone,
-            data: {
-              Orders: "CreateTime desc, RoomID asc",
-              PageNumber: pageNum,
-              PageSize: 1000,
-              Projection: ["RoomID", "RoomName", "RoomLocalName", "CreateTime"]
-            },
+            Orders: "CreateTime desc, RoomID asc",
+            PageNumber: pageNum,
+            PageSize: 1000,
+            Projection: ["RoomID", "RoomName", "RoomLocalName", "CreateTime"],
+            ZoneType: zone
           }
-          if(this.spaceShow) {
-            if(this.buildFloor.length == 2 && this.buildFloor[1] != 'all') {
-              params.data.Filters = `buildingId='${this.buildFloor[0]}';floorId='${this.buildFloor[1]}'`
+          if (this.spaceShow) {
+            if (this.buildFloor.length == 2 && this.buildFloor[1] != 'all') {
+              pa.BuildingId = this.buildFloor[0];
+              pa.FloorId = this.buildFloor[1];
             } else {
-              params.data.Filters = `buildingId='${this.buildFloor[0]}'`
+              pa.BuildingId = this.buildFloor[0];
             }
           }
-          queryZone(params, res => {
+          zoneQuery(params, res => {
             nodes = nodes.concat(res.Content.map(item => ({
               value: item.RoomID,
-              label: item.RoomLocalName?item.RoomLocalName:item.RoomName
+              label: item.RoomLocalName ? item.RoomLocalName : item.RoomName
             })))
             if (res.Total / (res.PageSize * res.PageNumber) > 1) {
               recursionGetData(res.PageNumber + 1, zone)
@@ -255,21 +254,21 @@ export default {
     toLinkAssets() {
       let query = {}
       // 校验必填项
-      if(!this.deviceType) {
+      if (!this.deviceType) {
         this.$message.info('请选择设备类型!')
         return false
       } else if (!this.buildFloor.length) {
         this.$message.info('请选择建筑楼层!')
         return false
       }
-      if(this.spaceShow) { //选择了空间
-        if(this.zone == 'all'){//全部空间
+      if (this.spaceShow) { //选择了空间
+        if (this.zone == 'all') {//全部空间
           query = {
             deviceType: this.deviceType,
             buildFloor: this.buildFloor
           }
         } else {
-          if(this.space.length){//选择了具体的空间实例
+          if (this.space.length) {//选择了具体的空间实例
             query = {
               deviceType: this.deviceType,
               buildFloor: this.buildFloor,
@@ -296,24 +295,24 @@ export default {
     }
   },
   watch: {
-    
+
   }
 };
 </script>
 
 <style lang="less" scoped>
-  .condition-title{
-    width: 100px;
-    display: inline-block;
-    text-align: right;
-    margin-left: 10px;
-    margin-right: 12px;
-    color: #999999;
-    font-size: 14px;
-    vertical-align: top;
-  }
-  /deep/ .el-dialog__body {
-    max-height: 420px;
-    overflow-y: auto;
-  }
+.condition-title {
+  width: 100px;
+  display: inline-block;
+  text-align: right;
+  margin-left: 10px;
+  margin-right: 12px;
+  color: #999999;
+  font-size: 14px;
+  vertical-align: top;
+}
+/deep/ .el-dialog__body {
+  max-height: 420px;
+  overflow-y: auto;
+}
 </style>

+ 138 - 53
src/components/model/file/versionDialog.vue

@@ -5,23 +5,54 @@
         <span>上传人:{{versionData.userName}}</span>
         <span style="marginLeft:30px;">上传时间:{{versionData.acceptTime}}</span>
         <p style="marginTop:15px;">更新内容:</p>
-        <div v-if="Object.keys(versionData.createData).length || Object.keys(versionData.deleteData).length">
+        <div v-if="Object.keys(versionData.createData).length || Object.keys(versionData.deleteData).length || versionData.buildList.length">
+          <!-- 新增设备概要内容 -->
           <el-divider v-if="Object.keys(versionData.createData).length">新增设备概要内容</el-divider>
           <p v-if="Object.keys(versionData.createData).length" style="marginBottom:10px;">于【{{versionData.acceptTime}}】上传模型文件,新增设备实例如下:</p>
           <p v-for="(item, key) in versionData.createData" :key="'C'+key">【{{mapType[key]}}】:【{{item.length}}】个</p>
-          <el-divider v-if="Object.keys(versionData.deleteData).length">[{{Object.keys(versionData.deleteData).length}}]删除设备概要内容</el-divider>
+          <!-- 删除设备概要内容 -->
+          <el-divider v-if="Object.keys(versionData.deleteData).length">删除设备概要内容</el-divider>
           <p v-if="Object.keys(versionData.deleteData).length" style="marginBottom:10px;">于【{{versionData.acceptTime}}】上传模型文件,删除设备实例如下:</p>
           <p v-for="(item, key) in versionData.deleteData" :key="'D'+key">【{{mapType[key]}}】:【{{item.length}}】个</p>
+          <!-- 土建设备概要内容 -->
+          <el-divider v-if="versionData.buildList.length">土建设备概要内容</el-divider>
+          <p v-if="versionData.buildList.length" style="marginBottom:10px;">于【{{versionData.acceptTime}}】上传模型文件,增删土建设备实例如下:</p>
+          <p v-if="versionData.createWall.length">【新增实体墙】:【{{versionData.createWall.length}}】个</p>
+          <p v-if="versionData.deleteWall.length">【删除实体墙】:【{{versionData.deleteWall.length}}】个</p>
+          <p v-if="versionData.createVirtualWall.length">【新增虚拟墙】:【{{versionData.createVirtualWall.length}}】个</p>
+          <p v-if="versionData.deleteVirtualWall.length">【删除虚拟墙】:【{{versionData.deleteVirtualWall.length}}】个</p>
+          <p v-if="versionData.createColumn.length">【新增柱体】:【{{versionData.createColumn.length}}】个</p>
+          <p v-if="versionData.deleteColumn.length">【删除柱体】:【{{versionData.deleteColumn.length}}】个</p>
+          <!-- 新增设备 -->
           <el-divider v-if="Object.keys(versionData.createData).length">新增设备</el-divider>
           <div v-for="(item, key) in versionData.createData" :key="'CL'+key">
             <p>【{{mapType[key]}}】</p>
             <p v-for="(obj, i) in item" :key="obj.Id">【{{i+1}}】、建筑:【{{obj.BuildingName || "无"}}】;楼层:【{{obj.FloorName || "无"}}】;设备全局id:【{{obj.ObjId || "无"}}】;BIMID:【{{obj.BimId || "无"}}】;设备本地编码:【{{obj.LocalId || "无"}}】;设备本地名称:【{{obj.LocalName || "无"}}】;CADID:【{{obj.CadId || "无"}}】;</p>
           </div>
+          <!-- 删除设备 -->
           <el-divider v-if="Object.keys(versionData.deleteData).length">删除设备</el-divider>
           <div v-for="(item, key) in versionData.deleteData" :key="'DL'+key">
             <p>【{{mapType[key]}}】</p>
             <p v-for="(obj, i) in item" :key="obj.Id">【{{i+1}}】、建筑:【{{obj.BuildingName || "无"}}】;楼层:【{{obj.FloorName || "无"}}】;设备全局id:【{{obj.ObjId || "无"}}】;BIMID:【{{obj.BimId || "无"}}】;设备本地编码:【{{obj.LocalId || "无"}}】;设备本地名称:【{{obj.LocalName || "无"}}】;CADID:【{{obj.CadId || "无"}}】;</p>
           </div>
+          <!-- 新增实体墙 -->
+          <el-divider v-if="versionData.createWall.length">新增实体墙</el-divider>
+          <p v-for="(obj, i) in versionData.createWall" :key="obj.Id">【{{i+1}}】、建筑:【{{obj.BuildingName || "无"}}】;楼层:【{{obj.FloorName || "无"}}】;Id:【{{obj.ObjId || "无"}}】;</p>
+          <!-- 删除实体墙 -->
+          <el-divider v-if="versionData.deleteWall.length">删除实体墙</el-divider>
+          <p v-for="(obj, i) in versionData.deleteWall" :key="obj.Id">【{{i+1}}】、建筑:【{{obj.BuildingName || "无"}}】;楼层:【{{obj.FloorName || "无"}}】;Id:【{{obj.ObjId || "无"}}】;</p>
+          <!-- 新增虚拟墙 -->
+          <el-divider v-if="versionData.createVirtualWall.length">新增虚拟墙</el-divider>
+          <p v-for="(obj, i) in versionData.createVirtualWall" :key="obj.Id">【{{i+1}}】、建筑:【{{obj.BuildingName || "无"}}】;楼层:【{{obj.FloorName || "无"}}】;Id:【{{obj.ObjId || "无"}}】;</p>
+          <!-- 删除虚拟墙 -->
+          <el-divider v-if="versionData.deleteVirtualWall.length">删除虚拟墙</el-divider>
+          <p v-for="(obj, i) in versionData.deleteVirtualWall" :key="obj.Id">【{{i+1}}】、建筑:【{{obj.BuildingName || "无"}}】;楼层:【{{obj.FloorName || "无"}}】;Id:【{{obj.ObjId || "无"}}】;</p>
+          <!-- 新增柱体 -->
+          <el-divider v-if="versionData.createColumn.length">新增柱体</el-divider>
+          <p v-for="(obj, i) in versionData.createColumn" :key="obj.Id">【{{i+1}}】、建筑:【{{obj.BuildingName || "无"}}】;楼层:【{{obj.FloorName || "无"}}】;Id:【{{obj.ObjId || "无"}}】;</p>
+          <!-- 删除柱体 -->
+          <el-divider v-if="versionData.deleteColumn.length">删除柱体</el-divider>
+          <p v-for="(obj, i) in versionData.deleteColumn" :key="obj.Id">【{{i+1}}】、建筑:【{{obj.BuildingName || "无"}}】;楼层:【{{obj.FloorName || "无"}}】;Id:【{{obj.ObjId || "无"}}】;</p>
         </div>
         <div v-else>
           <div style="height: 60%;transform: translateY(50%);font-weight: normal;font-size: 12px;text-align: center;color: #909399;">
@@ -60,13 +91,25 @@ export default {
     return {
       title: "版本文件信息",
       loading: true,
+      logData: [],
       versionData: {
         userName: '',
         acceptTime: '',
         createData: {},
-        deleteData:{}
+        deleteData: {},
+        buildList: [],
+        createWall: [],
+        deleteWall: [],
+        createVirtualWall: [],
+        deleteVirtualWall: [],
+        createColumn: [],
+        deleteColumn: [],
+      },
+      mapType: {
+        'Wall': '实体墙',
+        'VirtualWall': '虚拟墙',
+        'Column': '柱体',
       },
-      mapType: { },
     }
   },
   mounted() { },
@@ -81,72 +124,106 @@ export default {
         this.versionData.userName = this.modelFile.UserName;
         this.versionData.acceptTime = this.modelFile.AcceptTime;
         let promise1 = new Promise((resolve, reject) => {
-            querySyncLogCount({Filters: `ModelId='${this.modelFile.CurrentModelId?this.modelFile.CurrentModelId:this.modelFile.Id}'`}, res => {
-                resolve(res)
-            })
+          querySyncLogCount({
+            Filters: `ModelId='${this.modelFile.CurrentModelId?this.modelFile.CurrentModelId:this.modelFile.Id}'`,
+            PageNumber: 1,
+            PageSize: 1000,
+          }, res => {
+              resolve(res)
+          })
         })
         let promise2 = new Promise((resolve, reject) => {
-            getAllEqPaType({}, res => {
+            getAllEqPaType({PageNumber: 1,PageSize: 1000,}, res => {
                 resolve(res)
             })
         })
         Promise.all([promise1, promise2]).then(values => {
-          let versionData = values[0].Content, typeList = values[1].Content;
+          let typeList = values[1].Content;
+          this.logData = values[0].Content;
           typeList.forEach(item => {
             this.mapType[item.Code] = item.Name;
           });
-          console.log(this.mapType)
-          versionData.forEach(item => {
-            if(item.Operation){
-              if(this.versionData.createData[item.Type]){
-                this.versionData.createData[item.Type].push(item);
-              } else {
-                this.versionData.createData[item.Type] = [];
-                this.versionData.createData[item.Type].push(item);
-              }
-            } else {
-              if(this.versionData.deleteData[item.Type]){
-                this.versionData.deleteData[item.Type].push(item);
-              } else {
-                this.versionData.deleteData[item.Type] = [];
-                this.versionData.deleteData[item.Type].push(item);
-              }
-            }
-          });
-          this.loading = false;
-          this.$forceUpdate();
+          console.log(this.mapType);
+          if (values[0].Total / (values[0].PageSize * values[0].PageNumber) > 1) {
+            this.queryLogData(values[0].PageNumber + 1)
+          } else {
+            this.formatData();
+            this.loading = false;
+            this.$forceUpdate();
+            console.log(this.versionData);
+          }
         })
-        console.log(this.versionData)
       }
     },
+    // 格式化数据
+    formatData () {
+      this.logData.forEach(item => {
+        if (item.Type == 'Wall' || item.Type == 'VirtualWall' || item.Type == 'Column') {
+          this.versionData.buildList.push(item);
+          if (item.Type == 'Wall') {
+            if(item.Operation){//创建
+              this.versionData.createWall.push(item);
+            } else {//删除
+              this.versionData.deleteWall.push(item);
+            }
+          } else if (item.Type == 'VirtualWall') {
+            if(item.Operation){//创建
+              this.versionData.createVirtualWall.push(item);
+            } else {//删除
+              this.versionData.deleteVirtualWall.push(item);
+            }
+          } else if (item.Type == 'Column') {
+            if(item.Operation){//创建
+              this.versionData.createColumn.push(item);
+            } else {//删除
+              this.versionData.deleteColumn.push(item);
+            }
+          }
+        } else {
+          if(item.Operation){//创建
+            if(this.versionData.createData[item.Type]){
+              this.versionData.createData[item.Type].push(item);
+            } else {
+              this.versionData.createData[item.Type] = [];
+              this.versionData.createData[item.Type].push(item);
+            }
+          } else {//删除
+            if(this.versionData.deleteData[item.Type]){
+              this.versionData.deleteData[item.Type].push(item);
+            } else {
+              this.versionData.deleteData[item.Type] = [];
+              this.versionData.deleteData[item.Type].push(item);
+            }
+          }
+        }
+      });
+    },
     // 获取版本信息
     getVersionData() {
       if(this.modelFile.Id || this.modelFile.CurrentModelId){
         this.versionData.userName = this.modelFile.UserName;
         this.versionData.acceptTime = this.modelFile.AcceptTime;
-        querySyncLogCount({Filters: `ModelId='${this.modelFile.CurrentModelId?this.modelFile.CurrentModelId:this.modelFile.Id}'`}, res => {
-          res.Content.forEach(item => {
-            if(item.Operation){
-              if(this.versionData.createData[item.Type]){
-                this.versionData.createData[item.Type].push(item);
-              } else {
-                this.versionData.createData[item.Type] = [];
-                this.versionData.createData[item.Type].push(item);
-              }
-            } else {
-              if(this.versionData.deleteData[item.Type]){
-                this.versionData.deleteData[item.Type].push(item);
-              } else {
-                this.versionData.deleteData[item.Type] = [];
-                this.versionData.deleteData[item.Type].push(item);
-              }
-            }
-          });
+        this.queryLogData();
+      }
+    },
+    queryLogData(pageNum) {
+      pageNum = pageNum ? pageNum : 1
+      let params = {
+        Filters: `ModelId='${this.modelFile.CurrentModelId?this.modelFile.CurrentModelId:this.modelFile.Id}'`,
+        PageNumber: pageNum,
+        PageSize: 1000,
+      }
+      querySyncLogCount(params, res =>{
+        this.logData = this.logData.concat(res.Content);//拼接数据
+        if (res.Total / (res.PageSize * res.PageNumber) > 1) {
+          this.queryLogData(res.PageNumber + 1)
+        } else {
+          this.formatData();
           this.loading = false;
           this.$forceUpdate();
-        })
-        console.log(this.versionData)
-      }
+          console.log(this.versionData)
+        }
+      })
     },
   },
   watch: {
@@ -154,13 +231,21 @@ export default {
       handler() {
         if (this.dialogVisible) {
           this.loading = true;
+          this.logData = [];
           this.versionData = {
             userName: '',
             acceptTime: '',
             createData: {},
-            deleteData:{}
+            deleteData: {},
+            buildList: [],
+            createWall: [],
+            deleteWall: [],
+            createVirtualWall: [],
+            deleteVirtualWall: [],
+            createColumn: [],
+            deleteColumn: [],
           };
-          if(Object.keys(this.mapType).length) {
+          if(Object.keys(this.mapType).length > 3) {
             this.getVersionData();
           } else {
             this.getData();

+ 30 - 3
src/components/point/dynamicdata/buildRules.vue

@@ -102,7 +102,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  buildingQuery, //数据中心建筑查询
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -198,8 +199,34 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.BuildID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.BuildID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          buildingQuery({
+            PageSize: this.page.pageSize,
+            Filters: `BuildID in ${JSON.stringify(tempArr)}`
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.BuildID == item.BuildID) {
+                  item.ObjectLocalName = t.BuildLocalName;
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+            this.loading = false;
+            this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 248 - 2
src/components/point/dynamicdata/delRelationDialog.vue

@@ -76,7 +76,18 @@
   </el-dialog>
 </template>
 <script>
-import { dynamicDeleteRelation, dynamicQueryPrompt } from "@/api/scan/request";
+import {
+  dynamicDeleteRelation,
+  dynamicQueryPrompt,
+  queryEquip, //数据中心设备查询
+  floorQuery, //数据中心查询楼层
+  buildingQuery, //数据中心建筑查询
+  projectQuery, //数据中心查询项目信息
+  zoneQuery, //数据中心所有空间实例
+  queryLinkSys, //数据中心系统查询
+  queryTenant, //数据中心查询租户
+  partsQuery, //数据中心部件查询
+} from "@/api/scan/request";
 export default {
   data() {
     return {
@@ -186,7 +197,242 @@ export default {
       //通过标识查询对象实例
       let promise1 = new Promise((resolve, reject) => {
         dynamicQueryPrompt(p1, res => {
-          resolve(res)
+          let dyData = res.Content;
+          let name = this.typeName;
+          if (name == 'equip') {
+            let tempArr = dyData.map(t => {
+              if (t.Related == 'True') {
+                t.EquipID = t.TypeCode + t.ProjectId + t.ObjectID;
+                return t.EquipID;
+              }
+              return undefined;
+            }).filter(item => item);
+            if (tempArr.length) {
+              queryEquip({
+                PageSize: 500,
+                Filters: `EquipID in ${JSON.stringify(tempArr)}`,
+                Cascade: [{ Name: "zoneSpaceInBase" }, { Name: 'building' }, { Name: 'floor' }]
+              }, response => {
+                let Data = response.Content;
+                dyData.forEach(item => {
+                  Data.forEach(t => {
+                    if (t.EquipID == item.EquipID) {
+                      item.ObjectLocalName = t.EquipLocalName;
+                      item.FloorLocalName = t.Floor ? t.Floor.FloorLocalName : '';
+                      item.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+                      item.RoomLocalName = '';
+                      if (t.ZoneSpaceBaseIn) {
+                        t.ZoneSpaceBaseIn.forEach(it => {
+                          item.RoomLocalName += it.RoomLocalName + ',';
+                        })
+                        item.RoomLocalName = item.RoomLocalName.substring(0, item.RoomLocalName.length - 1);
+                      }
+                    }
+                  })
+                })
+                resolve(res);
+              })
+            } else {
+              resolve(res);
+            }
+          } else if (name == 'parts') {
+            let tempArr = dyData.map(t => {
+              if (t.Related == 'True') {
+                t.EquipID = t.TypeCode + t.ProjectId + t.ObjectID;
+                return t.EquipID;
+              }
+              return undefined;
+            }).filter(item => item);
+            if (tempArr.length) {
+              partsQuery({
+                PageSize: 500,
+                Filters: `EquipID in ${JSON.stringify(tempArr)}`
+              }, response => {
+                let Data = response.Content;
+                dyData.forEach(item => {
+                  Data.forEach(t => {
+                    if (t.EquipID == item.EquipID) {
+                      item.ObjectLocalName = t.EquipLocalName;
+                    }
+                  })
+                })
+                resolve(res);
+              })
+            } else {
+              resolve(res);
+            }
+          } else if (name == 'system') {
+            let tempArr = dyData.map(t => {
+              if (t.Related == 'True') {
+                t.SysID = t.TypeCode + t.ProjectId + t.ObjectID;
+                return t.SysID;
+              }
+              return undefined;
+            }).filter(item => item);
+            if (tempArr.length) {
+              queryLinkSys({
+                PageSize: 500,
+                Filters: `SysID in ${JSON.stringify(tempArr)}`
+              }, response => {
+                let Data = response.Content;
+                dyData.forEach(item => {
+                  Data.forEach(t => {
+                    if (t.SysID == item.SysID) {
+                      item.ObjectLocalName = t.SysLocalName;
+                    }
+                  })
+                })
+                resolve(res);
+              })
+            } else {
+              resolve(res);
+            }
+          } else if (name == 'space') {
+            let tempArr = dyData.map(t => {
+              if (t.Related == 'True') {
+                t.RoomID = t.TypeCode + t.ProjectId + t.ObjectID;
+                return t.RoomID;
+              }
+              return undefined;
+            }).filter(item => item);
+            if (tempArr.length) {
+              zoneQuery({
+                PageSize: 500,
+                Filters: `RoomID in ${JSON.stringify(tempArr)}`,
+                Cascade: [{ Name: 'building' }, { Name: 'floor' }],
+              }, response => {
+                let Data = response.Content;
+                dyData.forEach(item => {
+                  Data.forEach(t => {
+                    if (t.RoomID == item.RoomID) {
+                      item.ObjectLocalName = t.RoomLocalName;
+                      item.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+                      item.FloorLocalName = t.Floor ? t.Floor.FloorLocalName : '';
+                    }
+                  })
+                })
+                resolve(res);
+              })
+            } else {
+              resolve(res);
+            }
+          } else if (name == 'build') {
+            let tempArr = dyData.map(t => {
+              if (t.Related == 'True') {
+                t.BuildID = t.TypeCode + t.ProjectId + t.ObjectID;
+                return t.BuildID;
+              }
+              return undefined;
+            }).filter(item => item);
+            if (tempArr.length) {
+              buildingQuery({
+                PageSize: 500,
+                Filters: `BuildID in ${JSON.stringify(tempArr)}`
+              }, response => {
+                let Data = response.Content;
+                dyData.forEach(item => {
+                  Data.forEach(t => {
+                    if (t.BuildID == item.BuildID) {
+                      item.ObjectLocalName = t.BuildLocalName;
+                    }
+                  })
+                })
+                resolve(res);
+              })
+            } else {
+              this.loading = false;
+              this.tableData = dyData;
+            }
+          } else if (name == 'floor') {
+            let tempArr = dyData.map(t => {
+              if (t.Related == 'True') {
+                t.FloorID = t.TypeCode + t.ProjectId + t.ObjectID;
+                return t.FloorID;
+              }
+              return undefined;
+            }).filter(item => item);
+            if (tempArr.length) {
+              floorQuery({
+                PageSize: 500,
+                Cascade: [{ Name: 'building' }],
+                Filters: `FloorID in ${JSON.stringify(tempArr)}`
+              }, response => {
+                let Data = response.Content;
+                dyData.forEach(item => {
+                  Data.forEach(t => {
+                    if (t.FloorID == item.FloorID) {
+                      item.ObjectLocalName = t.FloorLocalName;
+                      item.ObjectSequenceID = t.FloorSequenceID;
+                      item.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+                    }
+                  })
+                })
+                resolve(res)
+              })
+            } else {
+              resolve(res)
+            }
+          } else if (name == 'tenant') {
+            let tempArr = dyData.map(t => {
+              if (t.Related == 'True') {
+                t.TenantID = t.TypeCode + t.ProjectId + t.ObjectID;
+                return t.TenantID;
+              }
+              return undefined;
+            }).filter(item => item);
+            if (tempArr.length) {
+              queryTenant({
+                PageSize: 500,
+                Cascade: [{ Name: 'zoneTenantList' }],
+                Filters: `TenantID in ${JSON.stringify(tempArr)}`
+              }, response => {
+                let Data = response.Content;
+                dyData.forEach(item => {
+                  Data.forEach(t => {
+                    if (t.TenantID == item.TenantID) {
+                      item.ObjectLocalName = t.TenantLocalName;
+                      item.RoomLocalName = '';
+                      if (t.ZoneTenantList) {
+                        t.ZoneTenantList.forEach(it => {
+                          item.RoomLocalName += it.RoomLocalName + ',';
+                        });
+                        item.RoomLocalName = item.RoomLocalName.substring(0, item.RoomLocalName.length - 1);
+                      }
+                    }
+                  })
+                })
+                resolve(res);
+              })
+            } else {
+              resolve(res);
+            }
+          } else if (name == 'project') {
+            let tempArr = dyData.map(t => {
+              if (t.Related == 'True') {
+                t.ProjID = t.TypeCode + t.ProjectId;
+                return t.ProjID;
+              }
+              return undefined;
+            }).filter(item => item);
+            if (tempArr.length) {
+              projectQuery({
+                PageSize: 500,
+                Filters: `ProjID in ${JSON.stringify(tempArr)}`
+              }, response => {
+                let Data = response.Content;
+                dyData.forEach(item => {
+                  Data.forEach(t => {
+                    if (t.ProjID == item.ProjID) {
+                      item.ObjectLocalName = t.ProjLocalName;
+                    }
+                  })
+                })
+                resolve(res)
+              })
+            } else {
+              resolve(res)
+            }
+          }
         })
       })
       let p2 = {

+ 1 - 1
src/components/point/dynamicdata/dictionaryDevice.vue

@@ -3,7 +3,7 @@
     <el-form>
       <el-form-item :label="`数据字典${typeName}类型`">
         <el-select v-model="SubTypeName" multiple collapse-tags placeholder="全部" filterable @change="changeType">
-          <el-option v-for="item in DynEquipList" :key="item" :label="item" :value="item"></el-option>
+          <el-option v-for="item in DynEquipList" :key="item.SubTypeCode" :label="item.SubTypeName" :value="item.SubTypeCode"></el-option>
         </el-select>
       </el-form-item>
     </el-form>

+ 41 - 4
src/components/point/dynamicdata/equipRules.vue

@@ -102,7 +102,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  queryEquip, //数据中心设备查询
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -187,7 +188,7 @@ export default {
         param.EquipmentMark = this.form.EquipmentMark;
       }
       if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
+        param.SubTypeCodeList = this.form.SubTypeName;
       }
       if (this.form.LocationFlag.length) {
         param.LocationFlagList = this.form.LocationFlag;
@@ -198,8 +199,44 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.EquipID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.EquipID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          queryEquip({
+            PageSize: this.page.pageSize,
+            Filters: `EquipID in ${JSON.stringify(tempArr)}`,
+            Cascade: [{ Name: "zoneSpaceInBase" }, { Name: 'building' }, { Name: 'floor' }]
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.EquipID == item.EquipID) {
+                  item.ObjectLocalName = t.EquipLocalName;
+                  item.FloorLocalName = t.Floor ? t.Floor.FloorLocalName : '';
+                  item.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+                  item.RoomLocalName = '';
+                  if (t.ZoneSpaceBaseIn) {
+                    t.ZoneSpaceBaseIn.forEach(it => {
+                      item.RoomLocalName += it.RoomLocalName + ',';
+                    })
+                    item.RoomLocalName = item.RoomLocalName.substring(0, item.RoomLocalName.length - 1);
+                  }
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+            this.loading = false;
+            this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 33 - 3
src/components/point/dynamicdata/floorRules.vue

@@ -110,7 +110,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  floorQuery, //数据中心查询楼层
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -206,8 +207,37 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.FloorID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.FloorID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          floorQuery({
+            PageSize: this.page.pageSize,
+            Cascade: [{ Name: 'building' }],
+            Filters: `FloorID in ${JSON.stringify(tempArr)}`
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.FloorID == item.FloorID) {
+                  item.ObjectLocalName = t.FloorLocalName;
+                  item.ObjectSequenceID = t.FloorSequenceID;
+                  item.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+          this.loading = false;
+          this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 99 - 24
src/components/point/dynamicdata/locationCascader.vue

@@ -3,18 +3,81 @@
     :props="props" clearable class="location"></el-cascader>
 </template>
 <script>
-import { dynamicLocationList } from "@/api/scan/request";
+import {
+  // dynamicLocationList,
+  buildingQuery, //数据中心查询建筑
+  floorQuery, //数据中型查询楼层
+  queryDictionaryHead, //数据中心查询分区类型
+  zoneQuery, //数据中心查询所有空间
+} from "@/api/scan/request";
 import { mapGetters, mapActions } from "vuex";
 export default {
   data() {
+    const that = this;
     return {
       LocationList: [],
       value: [],
       timer: null,
       props: {
-        value: 'Name',
-        label: 'Name',
-        children: 'List'
+        lazy: this.isFloor ? false : true,
+        lazyLoad(node, resolve) {
+          console.log(node)
+          if (node.level == 1) {
+            if (node.value == 'unknowBuild') {
+              resolve()
+            } else {
+              let pa = {
+                Filters: `BuildID='${node.value}'`
+              }
+              floorQuery(pa, res => {
+                const nodes = res.Content.map(t => {
+                  t.value = t.FloorID;
+                  t.label = t.FloorLocalName;
+                  t.leaf = that.isSpace;
+                  return t;
+                })
+                nodes.unshift({ value: 'unknowFloor', label: '未明确楼层', leaf: true })
+                resolve(nodes);
+              })
+            }
+          } else if (node.level == 2) {
+            if (that.isSpace) {
+              resolve();
+            } else {
+              let pa = {
+                Filters: "parentId='Space'"
+              }
+              queryDictionaryHead(pa, res => {
+                const nodes = res.Content.map(t => {
+                  if (t.Code == 'Ispace') {
+                    return undefined;
+                  }
+                  t.value = t.Code;
+                  t.label = t.Name;
+                  return t;
+                }).filter(item => item);
+                resolve(nodes);
+              })
+            }
+          } else if (node.level == 3) {
+            let pa = {
+              PageSize: 1000,
+              ObjectType: node.path[2],
+              Filters: `BuildingId='${node.path[0]}';FloorId='${node.path[1]}'`
+            };
+            zoneQuery(pa, res => {
+              const nodes = res.Content.map(t => {
+                t.value = t.RoomID;
+                t.label = t.RoomLocalName;
+                t.leaf = true;
+                return t;
+              })
+              resolve(nodes);
+            })
+          } else {
+            resolve();
+          }
+        }
       }
     };
   },
@@ -26,6 +89,9 @@ export default {
     typeName: {},
     isFloor: {
       default: false
+    },
+    isSpace: {
+      default: false
     }
   },
   computed: {
@@ -33,26 +99,35 @@ export default {
   },
   methods: {
     init() {
-      let param = { Related: this.Related, TypeName: this.typeName };
-      dynamicLocationList(param, res => {
-        this.LocationList = res.Content[0].List;
-        //添加未明确对象
-        this.LocationList = this.delNullItems(this.LocationList)
-        this.LocationList.map(item => {
-          if (this.isFloor) {
-            delete item.List;
-          }
-          if (item.List) {
-            item.List.map(child => {
-              if (child.List) {
-                child.List.unshift({ Name: '未明确业务空间' })
-              }
-            })
-            item.List.unshift({ Name: '未明确楼层' })
-          }
-        })
-        this.LocationList.unshift({ Name: '未明确建筑' })
-      });
+      // let param = { Related: this.Related, TypeName: this.typeName };
+      // dynamicLocationList(param, res => {
+      //   this.LocationList = res.Content[0].List;
+      //   //添加未明确对象
+      //   this.LocationList = this.delNullItems(this.LocationList)
+      //   this.LocationList.map(item => {
+      //     if (this.isFloor) {
+      //       delete item.List;
+      //     }
+      //     if (item.List) {
+      //       item.List.map(child => {
+      //         if (child.List) {
+      //           child.List.unshift({ Name: '未明确业务空间' })
+      //         }
+      //       })
+      //       item.List.unshift({ Name: '未明确楼层' })
+      //     }
+      //   })
+      //   this.LocationList.unshift({ Name: '未明确建筑' })
+      // });
+      let pa = {}
+      buildingQuery(pa, res => {
+        this.LocationList = res.Content.map(item => {
+          item.value = item.BuildID;
+          item.label = item.BuildLocalName;
+          return item;
+        });
+        this.LocationList.unshift({ value: 'unknowBuild', label: '未明确建筑', leaf: true })
+      })
     },
     delNullItems(arr) {
       let tempArr = JSON.parse(JSON.stringify(arr))

+ 31 - 4
src/components/point/dynamicdata/partsRules.vue

@@ -101,7 +101,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  partsQuery, //数据中心部件查询
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -186,7 +187,7 @@ export default {
         param.EquipmentMark = this.form.EquipmentMark;
       }
       if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
+        param.SubTypeCodeList = this.form.SubTypeName;
       }
       if (this.form.LocationFlag.length) {
         param.LocationFlagList = this.form.LocationFlag;
@@ -197,8 +198,34 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.EquipID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.EquipID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          partsQuery({
+            PageSize: this.page.pageSize,
+            Filters: `EquipID in ${JSON.stringify(tempArr)}`
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.EquipID == item.EquipID) {
+                  item.ObjectLocalName = t.EquipLocalName;
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+          this.loading = false;
+          this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 31 - 4
src/components/point/dynamicdata/projectRules.vue

@@ -84,7 +84,7 @@
       :current-page="page.pageNumber" :page-sizes="page.pageSizes" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper"
       :total="page.total"></el-pagination>
     <!-- 清除对应关系弹窗 -->
-    <del-relation-dialog ref="del" @refresh="refresh" :typeName="'space'"></del-relation-dialog>
+    <del-relation-dialog ref="del" @refresh="refresh" :typeName="'project'"></del-relation-dialog>
   </div>
 </template>
 <script>
@@ -104,7 +104,8 @@ import {
   dynamicPointTypeList,
   dynamicPendingobjs,
   dynamicCreateRelation,
-  dynamicDeleteRelation
+  dynamicDeleteRelation,
+  projectQuery, //数据中心查询项目信息
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -203,8 +204,34 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.ProjID = t.TypeCode + t.ProjectId;
+            return t.ProjID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          projectQuery({
+            PageSize: this.page.pageSize,
+            Filters: `ProjID in ${JSON.stringify(tempArr)}`
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.ProjID == item.ProjID) {
+                  item.ObjectLocalName = t.ProjLocalName;
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+          this.loading = false;
+          this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 34 - 4
src/components/point/dynamicdata/spaceRules.vue

@@ -101,7 +101,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  zoneQuery, //数据中心所有空间实例
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -186,7 +187,7 @@ export default {
         param.EquipmentMark = this.form.EquipmentMark;
       }
       if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
+        param.SubTypeCodeList = this.form.SubTypeName;
       }
       if (this.form.LocationFlag.length) {
         param.LocationFlagList = this.form.LocationFlag;
@@ -197,8 +198,37 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.RoomID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.RoomID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          zoneQuery({
+            PageSize: this.page.pageSize,
+            Filters: `RoomID in ${JSON.stringify(tempArr)}`,
+            Cascade: [{ Name: 'building' }, { Name: 'floor' }],
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.RoomID == item.RoomID) {
+                  item.ObjectLocalName = t.RoomLocalName;
+                  item.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+                  item.FloorLocalName = t.Floor ? t.Floor.FloorLocalName : '';
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+          this.loading = false;
+          this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 31 - 4
src/components/point/dynamicdata/systemRules.vue

@@ -99,7 +99,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  queryLinkSys, //数据中心系统查询
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -184,7 +185,7 @@ export default {
         param.EquipmentMark = this.form.EquipmentMark;
       }
       if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
+        param.SubTypeCodeList = this.form.SubTypeName;
       }
       if (this.form.LocationFlag.length) {
         param.LocationFlagList = this.form.LocationFlag;
@@ -195,8 +196,34 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.SysID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.SysID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          queryLinkSys({
+            PageSize: this.page.pageSize,
+            Filters: `SysID in ${JSON.stringify(tempArr)}`
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.SysID == item.SysID) {
+                  item.ObjectLocalName = t.SysLocalName;
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+          this.loading = false;
+          this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 38 - 3
src/components/point/dynamicdata/tenantRules.vue

@@ -101,7 +101,8 @@ import {
   dynamicExecute,
   dynamicQuery,
   dynamicQueryPoint,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  queryTenant, //数据中心查询租户
 } from "@/api/scan/request";
 export default {
   computed: {
@@ -197,8 +198,42 @@ export default {
       this.loading = true;
       // 查询对应关系(P1)
       dynamicQuery(param, res => {
-        this.loading = false;
-        this.tableData = res.Content;
+        let dyData = res.Content;
+        let tempArr = dyData.map(t => {
+          if (t.Related == 'True') {
+            t.TenantID = t.TypeCode + t.ProjectId + t.ObjectID;
+            return t.TenantID;
+          }
+          return undefined;
+        }).filter(item => item);
+        if (tempArr.length) {
+          queryTenant({
+            PageSize: this.page.pageSize,
+            Cascade: [{ Name: 'zoneTenantList' }],
+            Filters: `TenantID in ${JSON.stringify(tempArr)}`
+          }, response => {
+            let Data = response.Content;
+            dyData.forEach(item => {
+              Data.forEach(t => {
+                if (t.TenantID == item.TenantID) {
+                  item.ObjectLocalName = t.TenantLocalName;
+                  item.RoomLocalName = '';
+                  if (t.ZoneTenantList) {
+                    t.ZoneTenantList.forEach(it => {
+                      item.RoomLocalName += it.RoomLocalName + ',';
+                    });
+                    item.RoomLocalName = item.RoomLocalName.substring(0, item.RoomLocalName.length - 1);
+                  }
+                }
+              })
+            })
+            this.loading = false;
+            this.tableData = dyData;
+          })
+        } else {
+          this.loading = false;
+          this.tableData = dyData;
+        }
         this.page.total = res.PageSize < 50 ? res.PageSize : res.Total;
       });
     },

+ 139 - 108
src/components/point/report/integrateStatistics.vue

@@ -1,24 +1,49 @@
 <template>
   <div id="integrateStatistics">
     <!-- 环形表 -->
-    <div class="statistics-chart">
-      <div class="chart-title">表号功能号总数量:{{ pointData.tabFuncNumSum }} <span style="float:right">目前可能断数的数量:{{ pointData.disConn }}</span></div>
+    <div class="statistics-chart" v-loading="loopchartLoading">
+      <div class="chart-title">表号功能号总数量:{{ tabFuncNumSum }} <span style="float:right">目前可能断数的数量:{{ disConn }}</span></div>
       <hr style="width:90%" />
       <div ref="loopchart" class="chart" id="loopchart"></div>
     </div>
     <!-- 图形图 -->
     <div class="statistics-chart" style="border-top:5px solid #eee;min-height: calc(65% - 3px);">
       <div class="chart-title">共包含原始点位:{{ originalPoint }} 个</div>
-      <div style="padding:15px 10%;line-height:2;">
-        1点位对多表号功能号:{{ pointData.oneToM.toString() }}
+      <div style="padding:15px 20px;line-height:2;">
+        1点位对多表号功能号:{{oneToM+''}}
         <br />
-        多点位对1表号功能号:{{ pointData.mToOne.toString() }}
+        多点位对1表号功能号:{{mToOne+''}}
         <!-- 查看表号功能号一对多多对一总览 -->
         <el-button @click="showOverview" type="info" icon="el-icon-arrow-right" circle
           style="margin:-25px 0 0 50px;background:rgb(121, 187, 255);color:rgb(225, 228, 229);border:none;"></el-button>
       </div>
       <hr style="width:90%;margin-top: 1px;" />
-      <div ref="barchart" class="chart" id="barchart" :style="{height:barChartData.length * 120 + 'px'}"></div>
+      <div ref="barchart" class="" id="barchart" :style="{height:barChartData.length * 120 + 'px'}">
+        <el-row class="barchart-title">
+          <el-col :span="12">
+            <span style="background:#79bbff;"></span>已接入点位 {{pointInSum}}
+          </el-col>
+          <el-col :span="12">
+            <span style="background:#e1e4e5;"></span>未接入点位 {{pointOutSum}}
+          </el-col>
+        </el-row>
+        <div>
+          <div class="source" v-for="t in barChartData" :key="t.Id">
+            <el-row class="source-name">
+              <div :title='t.Name'>{{t.Name}}</div>
+              <div>{{t.Notrelatedall+t.Relatedall}}个原始点位</div>
+            </el-row>
+            <el-row class="source-chart already-in">
+              <el-col :style="{width:(t.widthin>1?t.widthin:1)+'%'}"></el-col>
+              <el-col>{{t.Relatedall}}</el-col>
+            </el-row>
+            <el-row class="source-chart not-in">
+              <el-col :style="{width:(t.widthout>1?t.widthout:1)+'%'}"></el-col>
+              <el-col>{{t.Notrelatedall}}</el-col>
+            </el-row>
+          </div>
+        </div>
+      </div>
     </div>
     <!-- 点位/表号功能号对应总览 -->
     <pointTabOverview ref="overviewDialog"></pointTabOverview>
@@ -43,42 +68,41 @@ export default {
     return {
       //环形图
       loopChart: null,
-      //条形图
-      barChart: null,
+      loopchartLoading: false,
       //环形图数据
       loopChartData: [],
       //条形图数据
       barChartData: [],
       //点位-标号功能号数据
-      pointData: {
-        tabFuncNumSum: 0,//总数
-        oneToM: 0,//一对多
-        mToOne: 0,//多对一
-        disConn: 0//可能断数数量
-      },
+      tabFuncNumSum: 0,//总数
+      oneToM: 0,//一对多
+      mToOne: 0,//多对一
+      disConn: 0,//可能断数数量
       //原始点数量
-      originalPoint: null
+      originalPoint: null,
+      pointInSum: 0, //左侧柱形图已接入
+      pointOutSum: 0, //左侧柱形图未接入
     };
   },
   methods: {
     //加载图表数据
     loadChart() {
+      let that = this;
+      that.loopchartLoading = true;
       //获取环形图数据
       getIntegrateStatisticsToLoop({}, res => {
         //设置点位-表号功能号数据
-        this.pointData = {
-          tabFuncNumSum: res.Content[0].Sum,
-          oneToM: res.Content[0].OtoM,
-          mToOne: res.Content[0].MtoO,
-          disConn: res.Content[0].Disconn
-        };
+        const tempData = res.Content[0];
+        that.tabFuncNumSum = tempData.Sum
+        that.oneToM = tempData.OToM
+        that.mToOne = tempData.MToO
+        that.disConn = tempData.Disconn
         //设置环形表数据
-        this.loopChartData = [
-          { value: res.Content[0].RelatedCount, name: "已对实例数量" },
-          { value: res.Content[0].Sum - res.Content[0].RelatedCount, name: "未对应实例数量" }
+        that.loopChartData = [
+          { value: tempData.RelatedCount, name: "已对实例数量" },
+          { value: tempData.Sum - tempData.RelatedCount, name: "未对应实例数量" }
         ];
 
-        let that = this;
         //环形图参数
         let loopOption = {
           tooltip: {
@@ -132,8 +156,8 @@ export default {
               avoidLabelOverlap: false,
               legendHoverLink: false,
               selectedOffset: 0,
-              label:{
-                  color:'rgb(121, 187, 255)',
+              label: {
+                color: 'rgb(121, 187, 255)',
               },
               emphasis: {
                 itemStyle: {
@@ -163,12 +187,28 @@ export default {
             }
           });
         }, 100);
+        that.loopchartLoading = false;
 
       })
 
       //获取条形图数据
       getIntegrateStatisticsToBar({}, res => {
-        this.barChartData = res.Content;
+        let max = 1;
+        res.Content.forEach(t => {
+          this.pointInSum += t.Relatedall;
+          this.pointOutSum += t.Notrelatedall;
+          if (t.Relatedall > max) {
+            max = t.Relatedall
+          }
+          if (t.Notrelatedall > max) {
+            max = t.Notrelatedall
+          }
+        })
+        this.barChartData = res.Content.map(t => {
+          t.widthin = ((t.Relatedall / max) * 0.8).toFixed(2) * 100
+          t.widthout = ((t.Notrelatedall / max) * 0.8).toFixed(2) * 100
+          return t;
+        });
         this.originalPoint = (() => {
           let sum = 0;
           this.barChartData.map(item => {
@@ -176,71 +216,6 @@ export default {
           });
           return sum;
         })();
-
-        //条形图参数
-        let barOption = {
-          tooltip: {
-            trigger: "axis",
-            axisPointer: {
-              // 坐标轴指示器,坐标轴触发有效
-              type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
-            }
-          },
-          color: ['rgb(121, 187, 255)', 'rgb(225, 228, 229)'],
-          legend: {
-            data: ["已接入", "未接入"]
-          },
-          grid: {
-            left: "3%",
-            right: "4%",
-            bottom: "3%",
-            containLabel: true
-          },
-          xAxis: [
-            {
-              type: "value",
-              position: "top"
-            }
-          ],
-          yAxis: [
-            {
-              type: "category",
-              axisTick: { show: false },
-              data: this.barChartData.map(item => item.Name)
-            }
-          ],
-          series: [
-            {
-              name: "已接入",
-              type: "bar",
-              label: {
-                normal: {
-                  show: true,
-                  position: "inside"
-                }
-              },
-              data: this.barChartData.map(item => item.Relatedall)
-            },
-            {
-              name: "未接入",
-              type: "bar",
-              stack: "总量",
-              label: {
-                normal: {
-                  show: true
-                }
-              },
-              data: this.barChartData.map(item => item.Notrelatedall)
-            }
-          ]
-        };
-
-        /* 条形图高度随数量变化,延时初始化 */
-        let that = this;
-        setTimeout(() => {
-          that.barChart = echarts.init(document.getElementById("barchart"));
-          that.barChart.setOption(barOption);
-        }, 100);
       });
     },
     //点位/表号
@@ -258,8 +233,6 @@ export default {
     window.onresize = () => {
       if (that.loopChart != null)
         that.loopChart.resize();
-      if (that.barChart != null)
-        that.barChart.resize();
     };
   },
   components: {
@@ -271,18 +244,76 @@ export default {
 <style lang="less" scoped>
 #integrateStatistics {
   border-top: 5px solid #eee;
-}
-.statistics-chart {
-  min-height: calc(35% - 3px);
-}
-.chart-title {
-  padding: 5px 5%;
-  font-size: 16px;
-  font-weight: 500;
-}
-.chart {
-  min-height: 200px;
-  height: auto;
-  width: 100%;
+  .statistics-chart {
+    min-height: calc(35% - 3px);
+    .chart-title {
+      padding: 5px 20px;
+      font-size: 16px;
+      font-weight: 500;
+    }
+  }
+  .chart {
+    min-height: 200px;
+    height: auto;
+    width: 100%;
+  }
+  #barchart {
+    font-size: 12px;
+    .barchart-title {
+      margin: 15px 0;
+      .el-col {
+        padding-left: 20px;
+        span {
+          display: inline-block;
+          width: 14px;
+          height: 14px;
+          margin: 0 10px -2px 0;
+        }
+      }
+    }
+    .source {
+      margin-bottom: 15px;
+      .source-name {
+        margin-bottom: 15px;
+        div {
+          float: left;
+          box-sizing: border-box;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+          &:nth-child(1) {
+            width: 65%;
+            padding-left: 20px;
+          }
+          &:nth-child(2) {
+            width: 35%;
+            text-align: right;
+            padding-right: 20px;
+          }
+        }
+      }
+      .source-chart {
+        box-sizing: border-box;
+        padding: 0 20px;
+        .el-col {
+          height: 30px;
+          &:nth-child(2) {
+            padding-left: 10px;
+            width: 20%;
+          }
+        }
+        &.already-in {
+          .el-col:nth-child(1) {
+            background: #79bbff;
+          }
+        }
+        &.not-in {
+          .el-col:nth-child(1) {
+            background: #e1e4e5;
+          }
+        }
+      }
+    }
+  }
 }
 </style>

+ 100 - 33
src/components/point/report/objectInstance.vue

@@ -38,7 +38,17 @@ import { SGraphyView } from "@saga-web/graphy/lib";
 import { LocationPointScene, DivideFloorScene } from "@saga-web/cad-engine"
 import { SColor } from "@saga-web/draw/lib";
 
-import { getTabFunNumObjInstance, queryEquip, floorQuery, queryZone } from '@/api/scan/request'
+import {
+  getTabFunNumObjInstance,
+  queryEquip, //数据中心设备查询
+  floorQuery, //数据中心查询楼层
+  buildingQuery, //数据中心建筑查询
+  projectQuery, //数据中心查询项目信息
+  zoneQuery, //数据中心所有空间实例
+  queryLinkSys, //数据中心系统查询
+  queryTenant, //数据中心查询租户
+  partsQuery, //数据中心部件查询
+} from '@/api/scan/request'
 
 export default {
   data() {
@@ -49,7 +59,7 @@ export default {
       loading: true,
       refreshCanvas: '',//重载canvas组件
       drawCanvas: false,//是否画canvas,
-      canvasWidth:450
+      canvasWidth: 450
     }
   },
   methods: {
@@ -68,13 +78,11 @@ export default {
           //存在实例ID
           if (item.ObjectID) {
             that.forms[key].instanceId = item.ObjectID;
-            //设备或者组件
-            if (item.TypeCode == 'Eq' || item.TypeCode == 'Ec') {
-              let pa = {
-                Filters: `EquipID='${item.TypeCode + this.projectId.substring(2) + item.ObjectID}'`
-              }
+            if (item.TypeCode == 'Eq') {
               //获取设备信息
-              queryEquip(pa, equipMsg => {
+              queryEquip({
+                Filters: `EquipID='${item.TypeCode + item.ProjectId + item.ObjectID}'`
+              }, equipMsg => {
                 if (equipMsg.Content[0] && equipMsg.Content[0].LocationJson && equipMsg.Content[0].FloorId) {
                   let canvasOption = {
                     /** 标记的id  */
@@ -86,34 +94,93 @@ export default {
                     /** Y坐标 */
                     Y: -equipMsg.Content[0].LocationJson.Y
                   }
+                  that.forms[key].ObjectLocalName = res.Content[0].EquipLocalName
+                  that.forms[key].ObjectLocalCode = res.Content[0].EquipLocalID
                   this.loadDataToInstanceByFloorID(equipMsg.Content[0].FloorId, key, item.TypeCode, canvasOption);
                 }
               })
-            }
-            //空间
-            else if (item.TypeCode == 'Sp') {
-              if(item.SubTypeCode){
-                let pa = {
-                  data: {
-                    Filters: `RoomID='${item.TypeCode + this.projectId.substring(2) + item.ObjectID}'`
-                  },
-                  zone: item.SubTypeCode
+            } else if (item.TypeCode == 'Sp') {
+              //获取空间信息
+              zoneQuery({
+                Filters: `RoomID='${item.TypeCode + item.ProjectId + item.ObjectID}'`
+              }, zoneMsg => {
+                if (zoneMsg.Content[0] && zoneMsg.Content[0].Outline) {
+                  let canvasOption = {
+                    RoomLocalName: zoneMsg.Content[0].RoomLocalName,
+                    OutLine: zoneMsg.Content[0].Outline,
+                    RoomID: zoneMsg.Content[0].RoomID,
+                    Color: '#F9C3C3'
+                  }
+                  that.forms[key].ObjectLocalName = res.Content[0].RoomLocalName
+                  that.forms[key].ObjectLocalCode = res.Content[0].RoomLocalID
+                  this.loadDataToInstanceByFloorID(zoneMsg.Content[0].FloorId, key, item.TypeCode, canvasOption);
                 }
-                //获取空间信息
-                queryZone(pa, zoneMsg => {
-                  if (zoneMsg.Content[0] && zoneMsg.Content[0].Outline) {
-                    let canvasOption = {
-                      RoomLocalName: zoneMsg.Content[0].RoomLocalName,
-                      OutLine: zoneMsg.Content[0].Outline,
-                      RoomID: zoneMsg.Content[0].RoomID,
-                      Color: new SColor('#F9C3C3')
-                    }
-                    this.loadDataToInstanceByFloorID(zoneMsg.Content[0].FloorId, key, item.TypeCode, canvasOption);
+              });
+            } else if (item.TypeCode == 'Ec') {
+              partsQuery({
+                Filters: `EquipID='${item.TypeCode + item.ProjectId + item.ObjectID}'`
+              }, equipMsg => {
+                if (equipMsg.Content[0] && equipMsg.Content[0].LocationJson && equipMsg.Content[0].FloorId) {
+                  let canvasOption = {
+                    /** 标记的id  */
+                    Id: equipMsg.Content[0].EquipID,
+                    /** 标记的名称  */
+                    Name: equipMsg.Content[0].EquipName,
+                    /** X坐标 */
+                    X: equipMsg.Content[0].LocationJson.X,
+                    /** Y坐标 */
+                    Y: -equipMsg.Content[0].LocationJson.Y
                   }
-                });
-              } else {
-                this.$message.error('缺少空间分区类型字段!')
-              }
+                  that.forms[key].ObjectLocalName = res.Content[0].EquipLocalName
+                  that.forms[key].ObjectLocalCode = res.Content[0].EquipLocalID
+                  this.loadDataToInstanceByFloorID(equipMsg.Content[0].FloorId, key, item.TypeCode, canvasOption);
+                }
+              })
+            } else if (item.TypeCode == 'Sy') {
+              queryLinkSys({
+                Filters: `SysID='${item.TypeCode + item.ProjectId + item.ObjectID}'`
+              }, res => {
+                if (res.Content.length) {
+                  that.forms[key].ObjectLocalName = res.Content[0].SysLocalName
+                  that.forms[key].ObjectLocalCode = res.Content[0].SysLocalID
+                }
+              })
+            } else if (item.TypeCode == 'Bd') {
+              buildingQuery({
+                Filters: `BuildID='${item.TypeCode + item.ProjectId + item.ObjectID}'`
+              }, res => {
+                if (res.Content.length) {
+                  that.forms[key].ObjectLocalName = res.Content[0].BuildLocalName
+                  that.forms[key].ObjectLocalCode = res.Content[0].BuildLocalID
+                }
+              })
+            } else if (item.TypeCode == 'Fl') {
+              floorQuery({
+                Filters: `FloorID='${item.TypeCode + item.ProjectId + item.ObjectID}'`
+              }, res => {
+                if (res.Content.length) {
+                  that.forms[key].ObjectLocalName = res.Content[0].FloorLocalName
+                  that.forms[key].ObjectLocalCode = res.Content[0].FloorLocalID
+                }
+              })
+            } else if (item.TypeCode == 'VOTn') {
+              queryTenant({
+                Filters: `TenantID='${item.TypeCode + item.ProjectId + item.ObjectID}'`
+              }, res => {
+                if (res.Content.length) {
+                  that.forms[key].ObjectLocalName = res.Content[0].TenantLocalName
+                  that.forms[key].ObjectLocalCode = res.Content[0].TenantLocalID
+                }
+              })
+            } else if (item.TypeCode == 'Pj') {
+              projectQuery({
+                Filters: `ProjID='${item.TypeCode + item.ProjectId + item.ObjectID}'`
+              }, res => {
+                if (res.Content.length) {
+                  that.forms[key].ObjectLocalName = res.Content[0].ProjLocalName
+                  that.forms[key].ObjectLocalCode = res.Content[0].ProjLocalID
+                }
+              })
             }
           }
         });
@@ -156,7 +223,7 @@ export default {
             that.views[key].fitSceneToView();
           })
         }
-        else{
+        else {
           that.drawCanvas = false;
         }
       });
@@ -192,7 +259,7 @@ export default {
 }
 .obj-item {
   margin: 15px 10px;
-  box-shadow: 0px 4px 10px 0px rgba(0,0,0,0.2);
+  box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.2);
   background-color: white;
   padding: 10px 10px;
   height: 600px;

+ 269 - 40
src/components/ready/buildfloor/addBuild.vue

@@ -1,51 +1,280 @@
 <template>
-    <el-dialog
-        :title="buildTitle"
-        :visible.sync="buildDialogVis"
-        width="20%"
-        id="messageDialog"
+  <el-dialog
+    :title="buildTitle"
+    :visible.sync="buildDialogVis"
+    id="messageDialog"
+    width="850px"
+  >
+    <el-form
+      :inline="true"
+      :model="form"
+      label-width="160px"
+      :label-position="'right'"
+      :rules="rules"
+      ref="ruleForm"
     >
-    <div>
-      <label>建筑名称 : </label>
-        <el-input
-            placeholder="请输入建筑名称"
-            v-model="buildName"
-        />
-    </div>
-        <span
-            slot="footer"
-            class="dialog-footer"
+      <template v-for="(val,key) in buildMessage">
+        <h4>{{key}}</h4>
+
+        <div
+          :key="item.InfoPointCode"
+          v-for="item in val"
+          :class="[{'upload-file':item.InputMode == 'F2' ||  item.Path === 'BuildingInfo.BuildingType.Pic'}]"
+          style="width: 50%;display: inline-block"
+
         >
-      <el-button
-          size="small"
-          @click="buildDialogVis = false"
-      >取消</el-button>
-      <el-button
-          size="small"
-          type="primary"
-          @click="save"
-      >确认</el-button>
-    </span>
+          <el-form-item
+            :class="{FloorTypeSelect:item.InputMode == 'D1'||item.Unit}"
+            :label="item.InfoPointName"
+            :prop="item.InfoPointCode"
+            v-if="all||item.Visible"
+
+          >
+
+            <el-input
+              v-model="form[item.Path]"
+              v-if="item.InputMode == 'B1' || item.InputMode == 'B2'"
+            />
+
+
+            <el-input type="number" v-else-if="item.InputMode == 'A1'||item.InputMode == 'A2'"
+                      v-model="form[item.Path]">
+              <template slot="append" v-if="item.Unit">{{item.Unit}}</template>
+            </el-input>
+            <el-select
+            placeholder="请选择"
+            v-else-if="item.InputMode == 'D1' || item.InputMode == 'E2'"
+            v-model="form[item.Path]"
+          >
+            <el-option :key="op.Name" :label="op.Name" :value="op.Code" v-for="op in item.options"></el-option>
+          </el-select>
+        <el-select
+          placeholder="请选择"
+          v-else-if="item.InputMode == 'D2'"
+          v-model="form[item.Path]"
+          multiple
+          collapse-tags
+        >
+
+            <el-option :key="op.Name" :label="op.Name" :value="op.Code" v-for="op in item.options"></el-option>
+          </el-select>
+           <el-date-picker
+             v-model="form[item.Path]"
+             type="daterange"
+             v-else-if="item.InputMode == 'C6'"
+             value-format="yyyy-MM-dd"
+             range-separator="至"
+             start-placeholder="开始日期"
+             end-placeholder="结束日期"
+           />
+             <el-cascader
+               v-else-if="item.InputMode == 'D1L'"
+               placeholder="请选择"
+               :options="item.options"
+               v-model="form[item.Path]"
+               :props="{ checkStrictly: true ,value: 'Code',label:'Name'}"
+               clearable
+               style="width: 200px"
+             />
+          <el-input
+            v-else-if="item.InputMode == 'L'||item.InputMode == 'L1'||item.InputMode == 'L2'||item.InputMode == 'M'"
+            v-model="form[item.Path]">
+            <template slot="append" v-if="item.Unit">{{item.Unit}}</template>
+          </el-input>
+          <el-date-picker
+            placeholder="选择日期"
+            value-format="yyyy-MM-dd"
+            type="date" v-else-if="item.InputMode == 'C5'" v-model="form[item.Path]">
+          </el-date-picker>
+
+          <uploadImgs
+            :readOnly="false"
+            v-else-if="item.InputMode == 'F2'&& item.Path === 'BuildingInfo.BuildingType.Pic'"
+            v-model="form[item.Path]"
+            :keysArr="Array.isArray(buildData[item.Path]) ? buildData[item.Path]:[]"
+            :context-key="item.Path"
+            :isShow="1"
+            @change="changeItem"
+          />
+
+             <upload-files
+               v-model="form[item.Path]"
+               v-else-if="item.InputMode == 'F2'"
+               :readOnly="false"
+               :isShow="1"
+               :keys-arr="Array.isArray(buildData[item.Path]) ? buildData[item.Path]:[] "
+               :show-file-list="false"
+               :context-key="item.Path"
+               @change="changeItem"
+             />
+            <el-input disabled title="暂不支持" v-else v-model="form[item.Path]"/>
+
+          </el-form-item>
+        </div>
+      </template>
+    </el-form>
+    <span
+      class="dialog-footer"
+      slot="footer"
+    >
+    <el-button @click="buildDialogVis = false">取 消</el-button>
+    <el-button @click="submitForm('ruleForm')" type="primary">确 定</el-button>
+  </span>
+    <el-dialog :visible.sync="dialogVisible">
+      <img width="100%" :src="dialogImageUrl" alt="">
+    </el-dialog>
   </el-dialog>
 </template>
 <script>
-export default {
-  data() {
-    return {
-      buildName: '',
-      buildDialogVis: false
+  import uploadFiles from "@/components/business_space/lib/uploadFiles";
+  import uploadImgs from "@/components/business_space/lib/uploadImgsName";
+
+  function flattenKeys(obj) {
+    let res = {}
+
+    function isObject(val) {
+      return typeof val === 'object' && !Array.isArray(val)
     }
-  },
-  props: {
-    buildTitle: {
-      default: "添加建筑"
+
+    function digKeys(prev, obj) {
+      Object.entries(obj).forEach(([key, value]) => {
+        const currentKey = prev ? `${prev}.${key}` : key
+        if (isObject(value)) {
+          digKeys(currentKey, value)
+        } else {
+          res[currentKey] = value
+        }
+      })
     }
-  },
-  methods: {
-    showDialog() {
-      this.buildDialogVis = true
+
+    digKeys('', obj)
+
+    return res
+  }
+
+  export default {
+    data() {
+
+      return {
+        buildName: '',
+        keysArr: [], //保存临时的文件key
+        buildDialogVis: false,
+        form: {},
+        dialogImageUrl: '',
+        dialogVisible: false,
+        all: true,
+        rules: {
+          "BuildLocalID": [
+            {"required": true, "message": "请输入建筑本地编码", "trigger": "blur"}
+          ],
+          "BuildLocalName": [
+            {"required": true, "message": "请输入建筑本地名称", "trigger": "blur"}
+          ]
+        },
+        buildData: {},
+      }
     },
-    save() { }
+    components: {uploadFiles, uploadImgs},
+    props: ['buildTitle', 'buildMessage', 'currentBuild'],
+    computed: {
+    },
+    mounted() {
+
+
+    },
+    methods: {
+      deepCopy(obj) {
+        return JSON.parse(JSON.stringify(obj))
+      },
+      showDialog(data) {
+        //获取信息
+        let buildData = data || {};  // string =>array key
+        buildData = flattenKeys(buildData);
+        for (let key in this.buildMessage) {
+          let arr = this.buildMessage[key];
+          if (Array.isArray(arr)) {
+            let list = arr.filter(i => i.InputMode == 'D2' || i.InputMode == 'C6');
+            list.forEach(j => {
+              if (buildData.hasOwnProperty(j.Path)) {
+                if (!Array.isArray(buildData[j.Path])) {
+                  buildData[j.Path] = buildData[j.Path].split(',');
+                }
+              }
+
+            })
+          }
+        }
+        this.buildData = buildData;
+        this.timeoutSetVal()
+        this.buildDialogVis = true
+      },
+
+      timeoutSetVal() {
+        let that = this
+        setTimeout(() => {
+          if (that.form) {
+            that.form = that.buildData
+          } else {
+            this.timeoutSetVal()
+          }
+        })
+      },
+      closeDialog() {
+        this.buildDialogVis = false
+      },
+      submitForm(formName) {
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            console.log(this.form);
+            for (let key in this.buildMessage) {
+              let arr = this.buildMessage[key];
+              if (Array.isArray(arr)) {
+                let list = arr.filter(i => i.InputMode == 'D2' || i.InputMode == 'C6');
+                list.forEach(j => {
+                  if (this.form.hasOwnProperty(j.Path)) {
+                    if (Array.isArray(this.form[j.Path])) {
+                      this.form[j.Path] = this.form[j.Path].join(',');
+                    }
+                  }
+                })
+              }
+            }
+            this.$emit('handleBuild', this.form)
+
+          } else {
+            return false;
+          }
+        });
+      },
+      changeItem(val) {
+        console.log(val)
+        let _key = Object.keys(val)[0] + '';
+        this.form[_key] = val[_key];
+
+      },
+
+    }
   }
-}
 </script>
+<style lang="less" scoped>
+
+  #messageDialog {
+    /deep/ .el-date-editor.el-input, .el-date-editor.el-input__inner, /deep/ .el-select {
+      width: 200px;
+    }
+
+    /deep/ .FloorTypeSelect .el-form-item__content {
+      width: 200px;
+    }
+
+    /deep/ .el-dialog__body {
+      height: 420px;
+      overflow: auto;
+    }
+
+    .upload-file {
+      width: 100% !important;
+      display: block !important;
+    }
+  }
+</style>

+ 90 - 57
src/components/ready/buildfloor/formItems.vue

@@ -1,10 +1,24 @@
 <template>
   <div id="inforsPoint">
-    <el-form ref="ruleForm" :model="form" label-width="150px" :rules="rules" :inline="true" :label-position="'left'">
-      <div v-for="item in InforsList" :key="item.InfoPointCode" style="width:50%;float:left;">
-        <el-form-item :label="item.InfoPointName" :prop="item.InfoPointCode" v-if="all||item.Visible"
-          :class="{FloorTypeSelect:item.InputMode == 'D1'||item.Unit}">
-          <el-input v-model="form[item.Path]" v-if="item.InputMode == 'B1'"></el-input>
+    <el-form ref="ruleForm" :model="form" label-width="150px" :rules="rules" :inline="true" :label-position="'right'">
+      <div v-for="item in InforsList" :key="item.InfoPointCode" style="width:50%;display: inline-block">
+        <el-form-item
+          :label="item.InfoPointName"
+          :prop="item.InfoPointCode"
+          v-if="all||item.Visible"
+          :class="{FloorTypeSelect:item.InputMode == 'D1'||item.Unit}"
+        >
+          <span v-if="item.InputMode == 'B1'">
+            <el-input
+              v-model="form[item.Path]"
+              :placeholder="(item.InputMode === 'B1' && item.Path==='FloorLocalID') ? '填写示例:F1、B1?':'' "
+
+            />
+              <div
+                v-if="item.InputMode === 'B1' && item.Path==='FloorLocalID' && isShowTitle"
+                style="color: gray;font-size: 12px"
+              >用于楼层平面图切换</div>
+          </span>
           <el-input v-model="form[item.Path]" v-else-if="item.InputMode == 'A1'||item.InputMode == 'A2'" type="number">
             <template slot="append" v-if="item.Unit">{{item.Unit}}</template>
           </el-input>
@@ -12,73 +26,92 @@
             <el-option v-for="op in item.options" :key="op.Code" :label="op.Name" :value="op.Code"></el-option>
           </el-select>
           <el-input v-model="form[item.Path]"
-            v-else-if="item.InputMode == 'L'||item.InputMode == 'L1'||item.InputMode == 'L2'||item.InputMode == 'M'">
+                    v-else-if="item.InputMode == 'L'||item.InputMode == 'L1'||item.InputMode == 'L2'||item.InputMode == 'M'">
             <template slot="append" v-if="item.Unit">{{item.Unit}}</template>
           </el-input>
           <el-input v-model="form[item.Path]" v-else disabled title="暂不支持"></el-input>
+
         </el-form-item>
       </div>
     </el-form>
   </div>
 </template>
 <script>
-import { getDataDictionary } from "@/api/scan/request";
+  import {getDataDictionary} from "@/api/scan/request";
 
-//  v-for="item in InforsList" :key="item.InfoPointCode"
-export default {
-  props: {
-    type: {
-      default: 'Floor'
-    }
-  },
-  data() {
-    return {
-      form: {},
-      InforsList: [],
-      all: true, // 默认显示全部
-      rules: {
-        "FloorLocalName": [
-          { "required": true, "message": "请输入楼层本地名称", "trigger": "blur" }
-        ],
-        "FloorSequenceID": [
-          { "required": true, "message": "请输入楼层顺序号", "trigger": "blur" }
-        ]
+  //  v-for="item in InforsList" :key="item.InfoPointCode"
+  export default {
+    props: {
+      type: {
+        default: 'Floor'
       }
-    };
-  },
-  created() {
-    this.getInforsPoint()
-  },
-  methods: {
-    getInforsPoint() {
-      let params = {
-        data: {
-          Orders: "sort asc,InfoPointCode asc",
-          PageNumber: 1,
-          PageSize: 50
-        },
-        type: this.type
-      };
-      getDataDictionary(params, res => {
-        this.InforsList = res.Content.map(item => {
-          if (item.InputMode === 'D1') {
-            item.options = JSON.parse(item.DataSource)
-          }
-          return item
-        })
-      })
     },
-    submitForm(call) {
-      this.$refs.ruleForm.validate((valid) => {
-        if (valid) {
-          call()
+    data() {
+      let validateId = (rule, value, callback) => {
+        if (!value) {
+          this.isShowTitle = false
+          return callback(new Error('请输入楼层本地编码'));
         } else {
-          return false;
+          this.isShowTitle = true
+          callback()
+        }
+      }
+      // }
+      return {
+        form: {},
+        isShowTitle: true,
+        InforsList: [],
+        all: true, // 默认显示全部
+        rules: {
+          "FloorLocalID": [
+            {validator: validateId, trigger: 'blur', "required": true}
+          ],
+          "FloorLocalName": [
+            {"required": true, "message": "请输入楼层本地名称", "trigger": "blur"}
+          ],
+          "FloorSequenceID": [
+            {"required": true, "message": "请输入楼层顺序号", "trigger": "blur"}
+          ]
         }
-      });
+      };
     },
-  }
-};
+
+    created() {
+      this.getInforsPoint()
+    }
+    ,
+    methods: {
+      getInforsPoint() {
+        let params = {
+          data: {
+            Orders: "sort asc,InfoPointCode asc",
+            PageNumber: 1,
+            PageSize: 50
+          },
+          type: this.type
+        };
+        getDataDictionary(params, res => {
+          this.InforsList = res.Content.map(item => {
+            if (item.InputMode === 'D1') {
+              item.options = JSON.parse(item.DataSource)
+            }
+            return item
+          })
+        })
+      }
+      ,
+      submitForm(call) {
+        this.$refs.ruleForm.validate((valid) => {
+          if (valid) {
+            call()
+          } else {
+            return false;
+          }
+        });
+      }
+      ,
+    }
+  };
 </script>
 <style lang="scss" scoped>
 #inforsPoint {

+ 56 - 0
src/components/ready/buildfloor/uploadFile.vue

@@ -0,0 +1,56 @@
+<template>
+  <el-upload
+    :before-remove="beforeRemove"
+    :file-list="fileList"
+    :limit="3"
+    :on-exceed="handleExceed"
+    :on-preview="handlePreview"
+    :on-remove="handleRemove"
+    action="https://jsonplaceholder.typicode.com/posts/"
+    class="upload-demo"
+    multiple>
+    <p
+      class="el-form-item__label"
+      style="width: 125px"
+    >{{name}}:</p>
+    <el-button
+      size="small"
+      type="text"
+    >点击上传
+    </el-button>
+    <!--    <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>-->
+  </el-upload>
+</template>
+
+<script>
+  export default {
+    name: "uploadFile",
+    props: ['name'],
+    data() {
+      return {
+        fileList: [
+          // {name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'},
+          // {name: 'food2.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}
+        ]
+      };
+    },
+    methods: {
+      handleRemove(file, fileList) {
+        console.log(file, fileList);
+      },
+      handlePreview(file) {
+        console.log(file);
+      },
+      handleExceed(files, fileList) {
+        this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
+      },
+      beforeRemove(file, fileList) {
+        return this.$confirm(`确定移除 ${file.name}?`);
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 10 - 9
src/components/relation/overview/CardList.vue

@@ -256,16 +256,17 @@
           // if (relation.RelManualType) {
           if (relation.RelationType) {
             this.values = {...this.values, optionTips, lastTime}
-            this.$refs.maintain.dialogManualOption = true //导出excel 弹窗
-            // this.$router.push({
-            //   path:"relationShip"
-            // })
+            // this.$refs.maintain.dialogManualOption = true //导出excel 弹窗
+            this.$router.push({
+              path:"relationShip"
+            })
             console.log(relation,'relation')
-          // localStorage.setItem('RelManualType',relation.RelManualType)
-          // localStorage.setItem('RelationTypeName',relation.RelationTypeName)
-          // localStorage.setItem('RelationType',relation.RelationType)
-          // localStorage.setItem('ZoneType',relation.ZoneType
-
+          localStorage.setItem('RelManualType',relation.RelManualType)
+          localStorage.setItem('RelationTypeName',relation.RelationTypeName)
+          localStorage.setItem('RelationType',relation.RelationType)
+          localStorage.setItem('ZoneType',relation.ZoneType)
+          localStorage.setItem('MainObject',relation.MainObject)
+          localStorage.setItem('FromObject',relation.FromObject)
           } else {
             this.$message.warning("设计中")
             return false

+ 95 - 14
src/components/relation/relationShip/Modal/addRelationShip.vue

@@ -13,42 +13,59 @@
         class="demo-ruleForm"
       >
         <p class="mb-20 color-AAA">{{values.codeTip}}</p>
+<!--        <el-form-item-->
+<!--          :label="values.codeTitle"-->
+<!--          prop="code"-->
+<!--          class="mb-20"-->
+<!--        >-->
+<!--          <el-input-->
+<!--            v-model="ruleForm.code"-->
+<!--            autocomplete="off"-->
+<!--            :placeholder="values.pleaseEnter"-->
+<!--          />-->
+<!--        </el-form-item>-->
         <el-form-item
           :label="values.codeTitle"
-          prop="code"
           class="mb-20"
         >
-          <el-input
-            v-model="ruleForm.code"
-            autocomplete="off"
-            :placeholder="values.pleaseEnter"
-          />
+          <el-select v-model="codeValue" placeholder="请选择">
+            <el-option
+              v-for="item in optionsCode"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
         </el-form-item>
         <el-row class="mb-20">
           <el-col :span="12">
             <p class="mb-20">{{values.mainObject}}
-              <span class="fw-bold color-AAA">(包括:XXXX类型,XXXX类型)限制条件</span>
+              <span class="fw-bold color-AAA">{{MainObject}}</span>
             </p>
             <el-form-item
               prop="main"
+              :error="mainError"
             >
               <el-input
                 v-model="ruleForm.main"
                 autocomplete="off"
                 :placeholder="values.pleaseEnterCode"
                 :disabled="disabled"
+
               />
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <p class="mb-20">{{values.affiliatedObject}}
-              <span class="fw-bold color-AAA ">(包括:XXXX类型,XXXX类型)限制条件</span>
+              <span class="fw-bold color-AAA ">{{FromObject}}</span>
             </p>
             <el-form-item
               v-for="(item,index) in ruleForm.codeList"
               :key="index"
               :prop="`codeList.${index}.value`"
               :rules="rules.codeList"
+              :error="fromError"
             >
               <el-input
                 v-model="item.value"
@@ -94,6 +111,8 @@
 </template>
 
 <script>
+  import {relAdd} from "../../../../api/relation/api";
+
   export default {
     name: "addRelationShip",
     props: ['values'],
@@ -101,7 +120,6 @@
       var checkCode = (rule, value, callback) => {
         //TODO
         callback()
-        this.disabled = false
       }
       var checkMain = (rule, value, callback) => {
         //TODO
@@ -109,13 +127,34 @@
       }
       var codeList = (rule, value, callback) => {
         //TODO
+        console.log(value)
         callback()
       }
       return {
+        mainError:'',
+        fromError:'',
         addShipDialog: false,
-        disabled: true,
+        // disabled: true,
+        optionsCode: [{
+          value: 'cadId',
+          label: 'CADID图纸编码'
+        }, {
+          value: 'name',
+          label: '设备名称'
+        }, {
+          value: 'id',
+          label: '设备ID'
+        }, {
+          value: 'localId',
+          label: '本地编码'
+        }, {
+          value: 'localName',
+          label: '本地名称'
+        }],
+        codeValue: '',
+        MainObject: `(包括:${localStorage.getItem('MainObject')} )限制条件`,
+        FromObject: `(包括:${localStorage.getItem('FromObject')} )限制条件`,
         ruleForm: {
-          code: '',
           main: '',
           codeList: [{
             value: ''
@@ -137,6 +176,13 @@
         }
       }
     },
+    computed:{
+      disabled() {
+        return this.codeValue === '' ? 'disabled':false
+      },
+
+    },
+    watch:{},
     methods: {
       addCode() {
         this.ruleForm.codeList.push({
@@ -152,15 +198,50 @@
       },
       submitForm(formName) {
         this.$refs[formName].validate(valid => {
+          console.log(valid,'valid')
           if (valid) {
-            this.addShipDialog = false
-            console.log('success')
+            let arr = []
+            for(let item  of this.ruleForm.codeList) {
+              if(item.value) {
+                arr = arr.concat(item.value)
+              }
+            }
+            let param = {
+              FromContent:arr,
+              MainContent:this.ruleForm.main,
+              RelType:localStorage.getItem('RelManualType'),
+              Type:this.codeValue
+            }
+            //清空添加value
+            let that = this
+            relAdd(param).then(res => {
+              if (res.data.Result === "failure") {
+                if(res.data.ErrorType == 1) {
+                  // this.mainError = res.data.Message
+                  this.$nextTick(()=>{this.mainError = res.data.Message})
+                } else if(res.data.ErrorType == 2) {
+                  this.$nextTick(()=>{this.fromError = res.data.Message})
+                } else {
+                  this.$message.error(res.data.Message);
+                }
+
+              } else if (res.data.Result === "success") {
+                this.$message.success(res.data.Message);
+                this.$emit('update')
+                that.addShipDialog = false
+                that.codeValue = ''
+                that.ruleForm.codeList = [{value:''}]
+                that.ruleForm.main = ''
+              }
+            })
+
           } else {
             console.log('error')
             return false
           }
         })
-      }
+      },
+
     }
   }
 </script>

+ 13 - 13
src/components/relation/relationShip/Modal/exportExcel.vue

@@ -122,24 +122,24 @@
       },
       dataId() {
         return {
-          // relType: this.ManualMaintenance.RelationType || '',
-          // zoneType: this.ManualMaintenance.ZoneType || '',
-          // projectId: this.projectId
+          relType: localStorage.getItem('RelationType') || '',
+          zoneType: localStorage.getItem('ZoneType') || '',
+          projectId: this.projectId
         }
       },
     },
     methods: {
       downloadProject(str) {
-        // let relType = this.ManualMaintenance.RelationType ? `?relType=${this.ManualMaintenance.RelationType}` : ''
-        // let zoneType = this.ManualMaintenance.ZoneType ? `&zoneType=${this.ManualMaintenance.ZoneType}` : ''
-        // let url;
-        // if (str === 'excel') {
-        //   relType = this.ManualMaintenance.RelationType ? `&relType=${this.ManualMaintenance.RelationType}` : ''
-        //   url = `/api/datacenter/graphic/export?code=对象ID${relType}${zoneType}`
-        // } else {
-        //   url = `/api/datacenter/graphic/report-downloads${relType}${zoneType}`
-        // }
-        // return url
+        let relType = localStorage.getItem('RelationType') ? `?relType=${localStorage.getItem('RelationType')}` : '';
+        let zoneType = localStorage.getItem('ZoneType') ? `&zoneType=${localStorage.getItem('ZoneType')}` : '';
+        let url;
+        if (str === 'excel') {
+          relType = localStorage.getItem('RelationType') ? `&relType=${localStorage.getItem('RelationType')}` : '';
+          url = `/api/datacenter/graphic/export?code=对象ID${relType}${zoneType}`
+        } else {
+          url = `/api/datacenter/graphic/report-downloads${relType}${zoneType}`
+        }
+        return url
       },
       progress(event, file, fileList) {
         // console.log(event.file, fileList)

+ 25 - 0
src/framework/style/layout.scss

@@ -17,7 +17,32 @@ body {
     width: 100%;
     height: 100%;
 }
+/*---滚动条默认显示样式--*/
+::-webkit-scrollbar-thumb{
+    height:50px;
+    outline-offset:-2px;
+    outline:2px solid #dddee0;
+    border: 2px solid #dddee0;
+    background-color: #dddee0;
+    border-radius: 4px;
+}
+
+/*---鼠标点击滚动条显示样式--*/
+::-webkit-scrollbar-thumb:hover{
+    height:50px;
+}
+
 
+/*---滚动条大小--*/
+::-webkit-scrollbar{
+    width:8px;
+    height:8px;
+}
+
+/*---滚动框背景样式--*/
+::-webkit-scrollbar-track-piece{
+    
+}
 #page-main {
     width: 100%;
     height: 100%;

+ 3 - 0
src/main.js

@@ -23,6 +23,9 @@ import './utils/scan/directive' //自定义指令
 import componentsPlugin from '@/framework/plugins/components'
 Vue.use(componentsPlugin)
 
+import elCascaderMulti from "el-cascader-multi";
+Vue.use(elCascaderMulti); //级联多选
+
 Vue.config.productionTip = false
 Vue.config.devtools = true;
 /* eslint-disable no-new */

+ 6 - 4
src/utils/buildfloor/tools.js

@@ -2,7 +2,7 @@ const tools = {}
 
 /**
  * @param arr [a,b,c]
- * 
+ *
  * val value
  */
 function returnNewObj(data, arr, val) {
@@ -48,11 +48,13 @@ tools.formatData = (data) => {
   return newData
 }
 
+
+
 /**
  * @param data {a:{b:{c:{}}}}
- * 
+ *
  * @returns a.b.c
- * 
+ *
  */
 tools.desFormatData = (data) => {
   let newData = {}
@@ -69,4 +71,4 @@ tools.desFormatData = (data) => {
   return newData
 }
 
-export default tools
+export default tools

+ 5 - 8
src/views/data_admin/buildGraphy/createPointZone.vue

@@ -45,7 +45,7 @@
 
 <script>
 import locationPointMsg from '@/views/data_admin/buildGraphy/locationPointMsg'
-import { queryDictionaryHead, getDataDictionary, createZone } from '@/api/scan/request';
+import { queryDictionaryHead, getDataDictionary, zoneCreate } from '@/api/scan/request';
 import { mapGetters } from 'vuex'
 import zoneInput from '@/components/data_admin/zoneInput'
 export default {
@@ -87,10 +87,7 @@ export default {
     //创建
     createZ() {
       let param = {
-        zone: '',
-        data: {
-          content: []
-        }
+        Content: []
       }
       let zObj = this.$refs.zoneInput.getFormData();
       zObj.Pic = this.$refs.pointMsg.choImg.concat();
@@ -101,13 +98,13 @@ export default {
         Type: item.Type
       }))
       if (this.RoomLocalName && this.buildFloor.length && this.space) {
+        zObj.ObjectType = this.space;
         zObj.RoomLocalName = this.RoomLocalName;
         zObj.RoomLocalID = this.RoomLocalID;
         zObj.BuildingId = this.buildFloor[0];
         zObj.FloorId = this.buildFloor[1];
-        param.zone = this.space;
-        param.data.content = [zObj];
-        createZone(param, res => {
+        param.Content = [zObj];
+        zoneCreate(param, res => {
           this.$message.success("创建成功");
           this.$refs.pointMsg.clearImg();
           this.RoomLocalName = ''

+ 9 - 9
src/views/data_admin/buildGraphy/updatePointZone.vue

@@ -38,7 +38,7 @@
 
 <script>
 import locationPointMsg from '@/views/data_admin/buildGraphy/locationPointMsg'
-import { queryDictionaryHead, zoneQueryByPoint, queryZone, updateZonePic } from '@/api/scan/request';
+import { queryDictionaryHead, zoneQueryByPoint, zoneQuery, updateZonePic } from '@/api/scan/request';
 import { mapGetters } from 'vuex'
 export default {
   data() {
@@ -163,15 +163,15 @@ export default {
       //业务空间
       else {
         let pa = {
-          zone: node.value,
-          data: {
-            "Filters": `buildingId='${node.parent.parent.value}';floorId='${node.parent.value}'`,
-            "Orders": "createTime desc, RoomID asc",
-            "PageNumber": 1,
-            "PageSize": 999
-          }
+          Filters: `not RoomID isNull`,
+          Orders: "createTime desc, RoomID asc",
+          PageNumber: 1,
+          PageSize: 1000,
+          ZoneType: node.value,
+          BuildingId: node.parent.parent.value,
+          FloorId: node.parent.value
         }
-        queryZone(pa, res => {
+        zoneQuery(pa, res => {
           let nodes = res.Content.map(item => {
             item.Building = { BuildLocalName: node.parent.parent.label };
             item.Floor = { FloorLocalName: node.parent.label };

+ 34 - 13
src/views/data_admin/buildTask/addTask/addDeviceTask.vue

@@ -23,7 +23,14 @@
               </el-form>
             </template>
           </el-table-column>
-          <el-table-column label="所属建筑楼层" width="200"></el-table-column>
+          <el-table-column label="所属建筑楼层" width="200">
+            <template slot-scope="scope">
+              <div>
+                {{scope.row.Building?scope.row.Building.BuildLocalName?scope.row.Building.BuildLocalName:'':''}} -
+                {{scope.row.Floor?scope.row.Floor.FloorLocalName?scope.row.Floor.FloorLocalName:'':''}}
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column prop="EquipLocalName" label="设备本地名称" show-overflow-tooltip>
              <template slot-scope="scope">
               <div>
@@ -91,10 +98,10 @@ export default {
       },
       options: [{//方案
         value: '1',
-        label: '标准'
+        label: '极简'
       }, {
         value: '2',
-        label: '极简'
+        label: '标准'
       }],
       tableData: [],
       multipleSelection:[],
@@ -177,7 +184,8 @@ export default {
               }
             })
           }
-          item.SchemeId = "1"
+          // 后端定义默认值(前端取消默认值设定)
+          // item.SchemeId = "1"
           return item
         })
         this.page.total = res.Total
@@ -252,16 +260,29 @@ export default {
     },
     //创建已选
     handleClickCreate() {
-      let list = this.multipleSelection.map((item) => {
-        return {EquipId: item.EquipID}
-      })
-      let param = {
-        Content: list
+      if (this.multipleSelection.length) {
+        let list = this.multipleSelection.map((item) => {
+          if (item.SchemeId) {
+            return {
+              EquipId: item.EquipID,
+              SchemeId: item.SchemeId
+            }
+          } else {
+            return {
+              EquipId: item.EquipID
+            }
+          }
+        })
+        let param = {
+          Content: list
+        }
+        createDeviceTask(param, res => {
+          this.$message.success("创建成功!")
+          this.$router.push({ name: "buildTask",query:{ newTaskTypes:this.$route.query.newTaskTypes } })
+        })
+      } else {
+        this.$message('请选择要创建的任务!')
       }
-      createDeviceTask(param, res => {
-        this.$message.success("创建成功!")
-        this.$router.push({ name: "buildTask",query:{ newTaskTypes:this.$route.query.newTaskTypes } })
-      })
     }
   }
 };

+ 85 - 46
src/views/ledger/cenotelist/relatedSpace.vue

@@ -15,10 +15,8 @@
         </div>
         <el-badge :is-dot="showSpaceDot" style="margin-left:15px;">
           <label style="line-height:32px;">业务空间类型:</label>
-          <el-select v-model="space" placeholder="请选择业务空间" @change="changeSpace" style="margin-left:15px;">
-            <el-option v-for="item in spaceList" :key="item.Code" :label="item.Name" :value="item.Code">
-            </el-option>
-          </el-select>
+          <el-cascader v-model="space" placeholder="请选择业务空间" :props="{value:'Code',label:'Name',children:'ZoneType'}" :options="spaceList"
+            @change="changeSpace" style="margin-left:15px;"></el-cascader>
         </el-badge>
       </div>
       <div class="saga-build-tab">
@@ -31,29 +29,39 @@
         <el-badge :is-dot="showBuildDot">
           <label style="line-height:32px;padding: 0 10px;">所属建筑:</label>
           <el-select v-model="building" placeholder="请选择建筑" @change="changeBuilding" v-loading="buildingLoading">
-            <el-option v-for="item in buildingList" :key="item.value" :label="item.BuildLocalName" :value="item.BuildID"></el-option>
+            <el-option v-for="item in buildingList" :key="item.value" :label="item.BuildLocalName?item.BuildLocalName:item.BuildName"
+              :value="item.BuildID"></el-option>
           </el-select>
         </el-badge>
-        <el-row style="height:calc(100% - 42px);margin:10px 0 0 0;width:100%;position:relative;">
-          <el-col :span="3" style="height:100%;border:1px solid #e4e4e4;">
-            <el-scrollbar style="height:100%;">
-              <div class="floor" style="height:100%;text-align:center;">
-                <span class="floor-item" style="border-bottom:1px solid #e4e4e4;">楼 层</span>
-                <div v-if="building" v-loading="buildingLoading">
-                  <span class="floor-item" @click="changeFloor(item.FloorID)" :class="{floorItemChoose:(item.FloorID == floor)}"
-                    v-for="item in buildingObj.Floor" :key="item.FloorID">{{ item.FloorLocalName }}</span>
+        <el-switch v-if="!cenoteObj.onlyRead" style="margin-left:15px;" v-model="isAI" active-text="打开AI">
+        </el-switch>
+        <div style="height:calc(100% - 42px);margin:10px 0 0 0;width:100%;">
+          <el-row style="height:100%;margin:0;width:55%;position:relative;display:inline-block;border:1px solid #e4e4e4;">
+            <el-col :span="4" style="height:100%;border-right:1px solid #e4e4e4;">
+              <el-scrollbar style="height:100%;">
+                <div class="floor" style="height:100%;text-align:center;">
+                  <span class="floor-item" style="border-bottom:1px solid #e4e4e4;">楼 层</span>
+                  <div v-if="building" v-loading="buildingLoading">
+                    <span class="floor-item" @click="changeFloor(item.FloorID)" :class="{floorItemChoose:(item.FloorID == floor)}"
+                      v-for="item in buildingObj.Floor" :key="item.FloorID">{{ item.FloorLocalName }}</span>
+                  </div>
                 </div>
-              </div>
-            </el-scrollbar>
-          </el-col>
-          <el-col :span="21" style="height:100%;border:1px solid #e4e4e4;border-left:none;">
-            <cenote-graphy ref="cenotegraphy"></cenote-graphy>
-          </el-col>
-        </el-row>
+              </el-scrollbar>
+            </el-col>
+            <el-col :span="20" style="height:100%;position:relative;">
+              <cenote-graphy ref="cenotegraphy"></cenote-graphy>
+            </el-col>
+          </el-row>
+          <div class="elevation-box">
+            <elevation-map ref="elevationMap" :onlyRead="cenoteObj.onlyRead" :isEdit="isEdit" :isAI="isAI" @elevationChecked="handleCheckedSpace"
+              @elevationUncheck="handleUncheckSpace" :params="{BuildingId: building, ObjectType: ObjectType, ShaftId: $route.query.ShaftId}">
+            </elevation-map>
+          </div>
+        </div>
 
       </div>
       <div v-show="isMyTab == 2" class="data-item">
-        <related-spaceList :space="space" :buildingList="buildingList" :spaceType="spaceType" :floorType="floorType" ref="relatedSpacelist">
+        <related-spaceList :space="ObjectType" :buildingList="buildingList" :spaceType="spaceType" :floorType="floorType" ref="relatedSpacelist">
         </related-spaceList>
       </div>
     </div>
@@ -63,8 +71,9 @@
 <script>
 import spaceSelect from "@/components/ledger/lib/spaceSelect";
 import relatedSpaceList from "@/components/ledger/cenote/relatedSpaceList";
+import elevationMap from "@/components/ledger/cenote/elevationMap";
 import addSpaceDialog from '@/components/ledger/cenote/dialog/addSpaceDialog';
-import { queryDictionaryHead, buildingQuery, shaftSpaceTypeQuery, shaftSpaceBuildingQuery } from '@/api/scan/request';
+import { queryAllZoneType, buildingQuery, shaftSpaceTypeQuery, shaftSpaceBuildingQuery } from '@/api/scan/request';
 import cenoteGraphy from '@/components/ledger/lib/cenoteGraphy'
 import { mapGetters } from 'vuex'
 export default {
@@ -75,21 +84,29 @@ export default {
       building: '',//当前建筑id
       buildingObj: {},//当前建筑obj
       buildingList: [],
-      space: '',//当前业务空间
+      space: [],//当前业务空间
+      ObjectType: '',//业务空间code
       spaceList: [],//空间list
       floor: '',//当前楼层
       dialogVisible: false,//添加空间弹窗
       spaceType: {},//空间种类
       floorType: {},//子组件楼层信息
       buildingLoading: false,//左侧列表加载
-      showSpaceDot: false,//空间提示红点
-      showBuildDot: false,//楼层提示红点
+      // showSpaceDot: false,//空间提示红点
+      // showBuildDot: false,//楼层提示红点
+      isAI: true,//是否打开AI
     }
   },
   computed: {
     cenoteObj() {
       return this.$route.query;
     },
+    showSpaceDot() {
+      return this.spaceList.length > 1 && this.cenoteObj.onlyRead ? true : false;
+    },
+    showBuildDot() {
+      return this.buildingList.length > 1 && this.cenoteObj.onlyRead ? true : false;
+    },
     ...mapGetters("layout", ["projectId"])
   },
   props: {
@@ -99,9 +116,11 @@ export default {
     spaceSelect,
     relatedSpaceList,
     addSpaceDialog,
-    cenoteGraphy
+    cenoteGraphy,
+    elevationMap
   },
   created() {
+    this.isAI = this.$route.query.onlyRead ? false : true;
     this.getSpaceData();
   },
   methods: {
@@ -120,9 +139,9 @@ export default {
       }
       else {
         let pa = {
-          Filters: `parentId='Space'`
+          Cascade: [{ Name: 'zoneType', Filters: `ProjectId='${this.projectId}'` }]
         }
-        queryDictionaryHead(pa, res => {
+        queryAllZoneType(pa, res => {
           this.spaceList = res.Content.map(t => {
             if (t.Name != "元空间") {
               this.spaceType[t.Code] = t.Name;
@@ -133,13 +152,14 @@ export default {
         });
       }
     },
-    //默认显示第一个空间
+    //默认显示默认分区,无默认分区显示第一个分区
     showDefaultSpace() {
       if (this.spaceList.length) {
-        this.space = this.spaceList.find((item) => {return item.Code == "GeneralZone"})? "GeneralZone": this.spaceList[0].Code;
-        if (this.spaceList.length > 1 && this.cenoteObj.onlyRead) {
-          this.showSpaceDot = true;
-        }
+        this.space = this.spaceList.find((item) => { return item.Code == "GeneralZone" }) ? ["GeneralZone"] : [this.spaceList[0].Code];
+        this.ObjectType = this.space[0];
+        // if (this.spaceList.length > 1 && this.cenoteObj.onlyRead) {
+        //   this.showSpaceDot = true;
+        // }
       }
       //处理空间类型
       this.spaceList.map(item => {
@@ -155,7 +175,7 @@ export default {
       if (this.cenoteObj.onlyRead) {
         let param = {
           ShaftId: this.$route.query.ShaftId,
-          ObjectType: this.space
+          ObjectType: this.ObjectType
         };
         this.buildingLoading = true;
         shaftSpaceBuildingQuery(param, res => {
@@ -180,7 +200,10 @@ export default {
       else {
         let param = {
           Cascade: [
-            { Name: "floor" }
+            {
+              Name: "floor",
+              Orders: "FloorSequenceID desc, name asc",
+            }
           ]
         };
         buildingQuery(param, res => {
@@ -195,16 +218,15 @@ export default {
         this.$refs.relatedSpacelist.setFloorData(this.buildingList);
       }
       if (this.buildingList.length) {
-        if (this.buildingList.length > 1 && this.cenoteObj.onlyRead) {
-          this.showBuildDot = true;
-        }
+        // if (this.buildingList.length > 1 && this.cenoteObj.onlyRead) {
+        //   this.showBuildDot = true;
+        // }
         this.changeBuilding(this.buildingList[0].BuildID);
-      }
-      else {
+      } else {
         this.buildingList = [];
         this.building = '';
         this.floor = '';
-        this.showBuildDot = false;
+        // this.showBuildDot = false;
       }
       this.buildingList.map(item => {
         if (item.BuildID && item.BuildLocalName) {
@@ -221,8 +243,7 @@ export default {
     },
     //更改业务空间类型
     changeSpace(val) {
-      this.showSpaceDot = false;
-      this.space = val;
+      this.ObjectType = val[0];
       this.floor = '';
       this.buildingList = [];
       this.building = '';
@@ -242,13 +263,20 @@ export default {
           }
         }
       })
-      this.showBuildDot = false;
     },
     //更换楼层
     changeFloor(fid) {
       this.floor = fid;
       let buildfloor = [this.building, fid]
-      this.$refs.cenotegraphy.getFloorMap(buildfloor, this.space)
+      this.$refs.cenotegraphy.getFloorMap(buildfloor, this.ObjectType)
+    },
+    //平面图选中空间,立面图对应选中
+    handleCheckedSpace(RoomID) {
+      this.$refs.cenotegraphy.canvasChecked(RoomID);
+    },
+    //平面图取消选中空间,立面图对应取消选中
+    handleUncheckSpace(RoomID) {
+      this.$refs.cenotegraphy.canvasUncheck(RoomID);
     },
     // 编辑
     changeEditType() {
@@ -264,6 +292,8 @@ export default {
     saveEdit() {
       this.isEdit = false;
       this.$refs.cenotegraphy.saveEdit();
+      // 走保存接口,然后回调渲染
+      this.$refs.elevationMap.savaEdit();
     },
     //更换列表或平面图
     changeRadio(val) {
@@ -387,6 +417,15 @@ export default {
   /deep/ .is-horizontal {
     display: none;
   }
+  .elevation-box {
+    height: 100%;
+    width: calc(45% - 14px);
+    margin-left: 10px;
+    display: inline-block;
+    box-sizing: border-box;
+    border: 1px solid #e4e4e4;
+    overflow: auto;
+  }
 }
 .floor-item {
   padding: 10px 10px;
@@ -400,4 +439,4 @@ export default {
 /deep/ .el-scrollbar__wrap {
   overflow-x: hidden;
 }
-</style>
+</style>

+ 10 - 10
src/views/ledger/rentlist/manageTenantZone.vue

@@ -85,7 +85,7 @@ import { mapGetters, mapActions } from "vuex";
 import { SColor, SPoint } from "@saga-web/draw/lib";
 import { DivideFloorScene, SpaceItem, ZoneItem, FloorView } from "@saga-web/cad-engine/lib";
 import { colorArr } from "@/utils/spaceColor"
-import { buildingQuery, queryTnRelateFloor, queryRentTableData, tnRelateZone, queryZone } from '@/api/scan/request'
+import { buildingQuery, queryTnRelateFloor, queryRentTableData, tnRelateZone, zoneQuery } from '@/api/scan/request'
 export default {
   data() {
     return {
@@ -302,16 +302,16 @@ export default {
       if (buildid && floorid && this.value) {
         this.canvasLoading = true
         let pa = {
-          zone: this.value,
-          data: {
-            Filters: `BuildingId='${buildid}';FloorId='${floorid}'`,
-            Orders: "createTime desc, RoomID asc",
-            PageSize: 1000
-          }
+          Filters: `not RoomID isNull`,
+          Orders: "createTime desc, RoomID asc",
+          PageSize: 1000,
+          ZoneType: this.value,
+          BuildingId: buildid,
+          FloorId: floorid
         }
         this.canvasLoading = false;
         let promise1 = new Promise((resolve) => {
-          queryZone(pa, res => {
+          zoneQuery(pa, res => {
             resolve(res);
           })
         })
@@ -470,8 +470,8 @@ export default {
 }
 </script>
 <style lang="less" scoped>
-@normal-border-color : #e4e4e4;
-@normal-border-active-color : #e8e8e8;
+@normal-border-color: #e4e4e4;
+@normal-border-active-color: #e8e8e8;
 #manageTenantZone {
   height: 100%;
   .main-container {

+ 92 - 42
src/views/ledger/spacelist/index.vue

@@ -8,7 +8,15 @@
     <!--------- 页面头部   -------------->
     <div class="saga-title" v-show="!needCalculate">
       <div class="saga-build-mess">
-        <floorCascader @change="changeCascader" ref="floorCascader"></floorCascader>
+        <div style="margin-left: 10px;float: left;">
+          <span style="color: #999999;font-size: 14px;margin-right: 12px;">建筑楼层</span>
+          <el-cascader :options="options" placeholder="请选择建筑楼层" v-model="buildFloorSelectd" @change="changeCascader">
+            <template slot-scope="{ node, data }">
+              <span>{{ data.label }}</span>
+              <i class="el-icon-warning-outline" v-if="data.Count" style="color:red;margin-right:10px;"></i>
+            </template>
+          </el-cascader>
+        </div>
         <input type="hidden" v-model="zoneItemID">
       </div>
       <div class="saga-build-tab">
@@ -24,17 +32,24 @@
         <div class="types">
           <el-tabs v-model="activeName" type='card' @tab-click="tabClick">
             <template v-for="(item,index) in tabsList">
-              <el-tab-pane :name="item.Code" :key="index" :label="item.Name"></el-tab-pane>
+              <el-tab-pane :name="item.Code" :key="index">
+                <span slot="label"><i class="el-icon-warning-outline" v-if="item.Count>0"
+                    style="color:red;margin-right:10px;"></i>{{item.Name}}</span>
+              </el-tab-pane>
             </template>
           </el-tabs>
         </div>
       </el-row>
       <div v-show="isMyTab == 1" style="width:100%;height:100%">
-        <graphy @getSp="checkSpace" @dimension="checkSpace" @businessDetails="getBuinessDetails" ref="graphy" @copyID="copyID"></graphy>
+        <graphy @getSp="checkSpace" @dimension="checkSpace" @businessDetails="getBuinessDetails" ref="graphy" @copyID="copyID"
+          @updateState="updateStateSuc"></graphy>
       </div>
       <div v-show="isMyTab == 2">
         <handsontable-main @lookEqu="lookEqu" ref="handsontable" :zoneCode="activeName" :id="`handsontable${activeName}`"></handsontable-main>
       </div>
+      <div class="infectedTips" v-show="isMyTab==1&&infectedTotal>0">
+        <p>因底图变化而受影响的业务空间{{infectedTotal.toString()}}个<span v-show="buildFloorSelectd.length>1">,本层受影响的业务空间{{infectedCurfloor.toString()}}个</span></p>
+      </div>
     </div>
     <div v-show="needCalculate" style="display:flex;align-items:center;justify-content:center;height:100%;background-color:#fff;">
       <div class="center" style="flex:1">
@@ -56,17 +71,17 @@ import graphy from "@/components/business_space/newGraphy/graphy";
 import roomInFloorDialog from "@/components/business_space/newAddDialogs/roomInFloorDialog";
 import handsontableMain from "@/components/business_space/business/handsontable";
 import {
+  zoneCount,
   getDataDictionary,
-  getAllbusiness,
-  getSpaceFloor,
-  buildingQuery, //数据中心-建筑查询
-  queryDictionaryHead, //数据中心-字典头部信息查询接口
-  getrelationTypeProject, //数据中心-当该项目中的"建筑体下的业务空间"“楼层下的业务空间”关系的状态为需更新时,业务空间台账功能不可用
-  getSpaceBdFlCount, // 属于多建筑楼层的空间数据统计
+  getrelationTypeProject,
+  getSpaceBdFlCount,
+  queryAllZoneType,
+  queryBFloorWithState,
+  zoneQuery
 } from "@/api/scan/request";
-import tools from '@/utils/scan/tools'
 import floorCascader from "@/components/ledger/lib/floorCascader";
-import { mapGetters, mapActions } from "vuex";
+import { mapGetters } from "vuex";
+
 export default {
   components: {
     graphy,
@@ -108,18 +123,15 @@ export default {
         "rel_type": "99"
       },
       options: [], //建筑楼层级联下拉
-      props: { //自定义字段
-        value: "BuildID",
-        label: "BuildLocalName",
-        children: "Floor"
-      },
       floorToMap: {}, //楼层及其对应的模型图
       FloorMap: "", //当前选中的楼层对象
       zoneItemID: '',
       buildFloorSelectd: [''], //当前所选的建筑楼层
       childBackParam: {},
       needCalculate: false, // 关系是否需要计算
-      mutiCount: 0
+      mutiCount: 0,
+      infectedTotal: 0,
+      infectedCurfloor: 0
     };
   },
   created() {
@@ -134,32 +146,50 @@ export default {
       this.getTypes()
       this.getBuilding()
       this.getMutiCount()
+      this.getInfected();
     },
     // 获取项目下建筑
     getBuilding() {
-      let pa = {
-        Cascade: [{ name: 'floor', Orders: 'SequenceId desc' }],
-        Orders: "BuildLocalName asc",
-      }
-      buildingQuery(pa, res => {
+      queryBFloorWithState({}, res => {
         this.options = res.Content.map(t => {
+          t.value = t.BuildID;
+          t.label = t.BuildLocalName || t.BuildName;
+          t.Count = 0;
           if (t.Floor) {
-            t.Floor = t.Floor.map(item => {
-              item.BuildID = item.FloorID;
-              item.BuildLocalName = item.FloorLocalName;
+            t.children = t.Floor.map(item => {
+              item.value = item.FloorID;
+              item.label = item.FloorLocalName;
               this.floorToMap[item.FloorID] = item;
+              if (item.Count > 0) {
+                t.Count++;
+              }
               return item;
             })
+            t.children.unshift({ value: "all", label: "全部" }, { value: 'noKnow', label: "未明确楼层" })
           } else {
-            t.Floor = []
+            t.children = []
           }
           return t;
         })
+        this.options.unshift({ value: "all", label: "全部" }, { value: "noKnow", label: "未明确建筑" })
         if (this.childBackParam.zone) {
           this.changeCascader(this.buildFloorSelectd);
-          this.$refs.floorCascader.setValue(this.buildFloorSelectd)
+        }
+      })
+    },
+    // 获取受影响统计
+    getInfected(floor) {
+      let pa = {
+        Filters: `State=1`
+      }
+      if (floor) {
+        pa.Filters += `;FloorId="${floor}"`
+      }
+      zoneCount(pa, res => {
+        if (floor) {
+          this.infectedCurfloor = res.Count
         } else {
-          this.$refs.floorCascader.setValue([''])
+          this.infectedTotal = res.Count
         }
       })
     },
@@ -168,27 +198,23 @@ export default {
       this.changeGraphyOrTable(val)
     },
     // 获取tabs的列表
-    getTypes() {
+    getTypes(floorid) {
       let pa = {
-        Filters: `parentId = 'Space'`
+        Cascade: [{ Name: 'zoneType' }]
+      }
+      if (floorid) {
+        pa.FloorId = floorid
       }
-      queryDictionaryHead(pa, res => {
+      queryAllZoneType(pa, res => {
         this.tabsList = res.Content.map(t => {
           if (t.Name == "元空间") {
             return undefined;
           }
           return t;
         }).filter(item => item);
-        // this.tabsList.push({
-        //   Code: "other",
-        //   CreateTime: "2019-06-04 14:48:39",
-        //   LastUpdate: "2019-06-04 14:48:39",
-        //   Name: "其他",
-        //   ObjectType: null,
-        //   ParentId: "Other"
-        // })
         if (this.childBackParam.zone) {
           this.activeName = this.childBackParam.zone;
+
           this.buildFloorSelectd = this.childBackParam.buildFloorSelectd;
           this.isMyTab = this.childBackParam.isMyTab;
         } else {
@@ -239,6 +265,7 @@ export default {
       this.buildFloorSelectd = val;
       // 如果选择的是全部或者未明确
       if (val.indexOf('noKnow') > -1 || val.indexOf('all') > -1) {
+        this.getTypes()
         this.isMyTab = 2;
         this.FloorMap = {}
       } else {
@@ -246,21 +273,25 @@ export default {
         if (!this.floorToMap[val[1]].StructureInfo || !this.floorToMap[val[1]].StructureInfo.FloorMap) {
           this.isMyTab = 2;
         }
+        this.getTypes(val[1]);
         this.FloorMap = this.floorToMap[val[1]];
       }
       this.changeGraphyOrTable(this.isMyTab)
     },
+
     // 判断切换至图还是表
     changeGraphyOrTable(num) {
       this.activeTabType = this.getItemForType()
       if (!this.buildFloorSelectd[0]) {
         this.$message.warning('请选择建筑楼层')
         return
-      };
+      }
       if (num == 2) {
         this.initMessage();
       } else {
+        this.getInfected(this.buildFloorSelectd[1]);
         this.$refs.graphy.getData(this.buildFloorSelectd, this.FloorMap, this.activeTabType);
+        this.childBackParam = {}
       }
     },
     // 触发获取表头-获取初始化信息点
@@ -309,7 +340,7 @@ export default {
       this.floor.facility = true
       this.$refs.facility.getData(infos, this.buildMess)
     },
-    copyID(val){
+    copyID(val) {
       this.$refs.handsontable.zoneItemID = val;
     },
     // 空间属于多个建筑楼层
@@ -322,6 +353,13 @@ export default {
     },
     relaSuc() {
       this.init();
+    },
+    // 受影响业务空间确认成功回调
+    updateStateSuc() {
+      this.getBuilding()
+      this.getTypes(this.buildFloorSelectd[1]);
+      this.infectedTotal--;
+      this.infectedCurfloor--;
     }
   },
   watch: {
@@ -425,15 +463,27 @@ export default {
     overflow: hidden;
     height: 100%;
     background: #fff;
-    padding: 10px;
+    // padding: 10px;
     /deep/ .el-tabs__item.is-top {
       border-top: 2px solid transparent;
       &.is-active {
         border-top: 2px solid #409eff;
       }
     }
+    .infectedTips {
+      position: absolute;
+      bottom: 0px;
+      box-sizing: border-box;
+      width: 100%;
+      padding: 0 20px;
+      line-height: 40px;
+      background: #ec808d;
+      color: #fff;
+      z-index: 9;
+    }
   }
   .spaceTypes {
+    padding: 10px 10px 0;
     .types {
       float: left;
       width: 100%;

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

@@ -36,8 +36,8 @@
             </div>
             <div class="content-point-right">
               <el-scrollbar style="height:100%;">
-                <div >
-                  <exhibitionEnergy :exhibitionEnergy="exhibitionEnergy"/>
+                <div>
+                  <exhibitionEnergy :exhibitionEnergy="exhibitionEnergy" />
                 </div>
               </el-scrollbar>
             </div>

+ 185 - 128
src/views/model/report/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div class="report-index">
     <div class="statistics">
       <div class="building">
         <p>建筑模型文件夹:<b>{{ModelFileCount}}</b></p>
@@ -30,9 +30,18 @@
           <el-button @click="supplement" :plain="toBeSuppCount?false:true" :disabled="toBeSuppCount?false:true">模型待补充的设备</el-button>
           <el-button type="info" :loading="load" @click='getExportReport'>导出模型问题报告</el-button>
         </div>
-        <div class="table" :style="tableList&&tableList.length?'width: 100%;height: calc(100% - 47px)':'width: 100%;height: calc(100% - 10px)'">
-          <el-table ref="multipleTable" :data="tableData" stripe height="100%" :header-cell-style="headerStyle" v-loading='loading'
-            :row-class-name="tableRowClassName">
+        <div class="table"
+             :style="tableList&&tableList.length?'width: 100%;height: calc(100% - 47px)':'width: 100%;height: calc(100% - 10px)'">
+          <el-table
+            ref="multipleTable"
+            :data="tableData"
+            stripe
+            height="100%"
+            :header-cell-style="headerStyle"
+            v-loading='loading'
+            :row-class-name="tableRowClassName"
+            :cell-style="cellStyle"
+          >
             <el-table-column prop="FloorName" label="模型楼层" fixed width="150"></el-table-column>
             <el-table-column prop="functionNo" label="待删除设备数量" fixed width="150">
               <template slot-scope="scope">
@@ -42,7 +51,8 @@
             </el-table-column>
             <el-table-column prop="toBeSupplement" label="待补充设备数量" fixed width="150">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.toBeSupplement" class="item" :type='scope.row.toBeSupplement?"danger":"success"'>
+                <el-badge :value="scope.row.toBeSupplement" class="item"
+                          :type='scope.row.toBeSupplement?"danger":"success"'>
                 </el-badge>
               </template>
             </el-table-column>
@@ -54,80 +64,91 @@
             </el-table-column>
             <el-table-column prop="ElementRangeCheck" label='构件范围检查' width="200">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.ElementRangeCheck" class="item" type='danger' v-if="scope.row.ElementRangeCheck">
-                </el-badge>
-                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.ElementRangeCheck<=0"></i>
+                <el-badge :value="scope.row.ElementRangeCheck" class="item" type='danger'
+                          v-if="scope.row.ElementRangeCheck"/>
+                <i class="msg-icon el-icon-success success-color1" style="font-size:20px;"
+                   v-if="scope.row.ElementRangeCheck<=0"></i>
               </template>
             </el-table-column>
             <el-table-column prop="FamilyNameCheck" label='设备族编码检查' width="200">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.FamilyNameCheck" class="item" type='danger' v-if="scope.row.FamilyNameCheck">
-                </el-badge>
-                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.FamilyNameCheck<=0"></i>
+                <el-badge :value="scope.row.FamilyNameCheck" class="item" type='danger'
+                          v-if="scope.row.FamilyNameCheck"/>
+                <i class="msg-icon el-icon-success success-color1" style="font-size:20px;"
+                   v-if="scope.row.FamilyNameCheck<=0"></i>
               </template>
             </el-table-column>
             <el-table-column prop="EquipPartLocationCheck" label='部件所在位置检查' width="200">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.EquipPartLocationCheck" class="item" type='danger' v-if="scope.row.EquipPartLocationCheck">
-                </el-badge>
-                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.EquipPartLocationCheck<=0"></i>
+                <el-badge :value="scope.row.EquipPartLocationCheck" class="item" type='danger'
+                          v-if="scope.row.EquipPartLocationCheck"/>
+                <i class="msg-icon el-icon-success success-color1" style="font-size:20px;"
+                   v-if="scope.row.EquipPartLocationCheck<=0"></i>
               </template>
             </el-table-column>
             <el-table-column prop="ColumnCheck" label='柱边界检查' width="200">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.ColumnCheck" class="item" type='danger' v-if="scope.row.ColumnCheck">
-                </el-badge>
-                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.ColumnCheck<=0"></i>
+                <el-badge :value="scope.row.ColumnCheck" class="item" type='danger' v-if="scope.row.ColumnCheck"/>
+                <i class="msg-icon el-icon-success success-color1" style="font-size:20px;"
+                   v-if="scope.row.ColumnCheck<=0"></i>
               </template>
             </el-table-column>
             <el-table-column prop="ConnectorCheck" label='连接件检查' width="200">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.ConnectorCheck" class="item" type='danger' v-if="scope.row.ConnectorCheck">
-                </el-badge>
-                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.ConnectorCheck<=0"></i>
+                <el-badge :value="scope.row.ConnectorCheck" class="item" type='danger' v-if="scope.row.ConnectorCheck"/>
+                <i class="msg-icon el-icon-success success-color1" style="font-size:20px;"
+                   v-if="scope.row.ConnectorCheck<=0"></i>
               </template>
             </el-table-column>
             <el-table-column prop="SystemNameCheck" label='系统类型名称检查' width="200">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.SystemNameCheck" class="item" type='danger' v-if="scope.row.SystemNameCheck">
-                </el-badge>
-                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.SystemNameCheck<=0"></i>
+                <el-badge :value="scope.row.SystemNameCheck" class="item" type='danger'
+                          v-if="scope.row.SystemNameCheck"/>
+                <i class="msg-icon el-icon-success success-color1" style="font-size:20px;"
+                   v-if="scope.row.SystemNameCheck<=0"></i>
               </template>
             </el-table-column>
             <el-table-column prop="EquipInSpaceCheck" label='未在空间中的设备' width="200">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.EquipInSpaceCheck" class="item" type='danger' v-if="scope.row.EquipInSpaceCheck">
-                </el-badge>
-                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.EquipInSpaceCheck<=0"></i>
+                <el-badge :value="scope.row.EquipInSpaceCheck" class="item" type='danger'
+                          v-if="scope.row.EquipInSpaceCheck"/>
+                <i class="msg-icon el-icon-success success-color1" style="font-size:20px;"
+                   v-if="scope.row.EquipInSpaceCheck<=0"></i>
               </template>
             </el-table-column>
             <el-table-column prop="PipeCheck" label='管段检查' width="200">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.PipeCheck" class="item" type='danger' v-if="scope.row.PipeCheck">
-                </el-badge>
-                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.PipeCheck<=0"></i>
+                <el-badge :value="scope.row.PipeCheck" class="item" type='danger' v-if="scope.row.PipeCheck"/>
+
+
+                <i class="msg-icon el-icon-success success-color1" style="font-size:20px;"
+                   v-if="scope.row.PipeCheck<=0"></i>
               </template>
             </el-table-column>
             <el-table-column prop="SystemReferEquipCheck" label='管网及相关设备检查' width="200">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.SystemReferEquipCheck" class="item" :type='scope.row.SystemReferEquipCheck?"danger":"success"'
-                  v-if="scope.row.SystemReferEquipCheck">
-                </el-badge>
-                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.SystemReferEquipCheck<=0"></i>
+                <el-badge :type='scope.row.SystemReferEquipCheck?"danger":"success"' :value="scope.row.SystemReferEquipCheck"
+                          class="item"
+                          v-if="scope.row.SystemReferEquipCheck"/>
+                <i class="msg-icon el-icon-success success-color1" style="font-size:20px;"
+                   v-if="scope.row.SystemReferEquipCheck<=0"></i>
               </template>
             </el-table-column>
             <el-table-column prop="ParameterIntegrityCheck" label='Revit族参数完整性检查' width="200">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.ParameterIntegrityCheck" class="item" type='danger' v-if="scope.row.ParameterIntegrityCheck">
-                </el-badge>
-                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.ParameterIntegrityCheck<=0"></i>
+                <el-badge :value="scope.row.ParameterIntegrityCheck" class="item" type='danger'
+                          v-if="scope.row.ParameterIntegrityCheck"/>
+
+                <i class="msg-icon el-icon-success success-color1" style="font-size:20px;"
+                   v-if="scope.row.ParameterIntegrityCheck<=0"></i>
               </template>
             </el-table-column>
             <el-table-column prop="XyzOverlapCheck" label='xyz坐标重叠检查' width="200">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.XyzOverlapCheck" class="item" type='danger' v-if="scope.row.XyzOverlapCheck">
-                </el-badge>
-                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.XyzOverlapCheck<=0"></i>
+                <el-badge :value="scope.row.XyzOverlapCheck" class="item" type='danger'
+                          v-if="scope.row.XyzOverlapCheck"/>
+                <i class="msg-icon el-icon-success success-color1" style="font-size:20px;"
+                   v-if="scope.row.XyzOverlapCheck<=0"></i>
               </template>
             </el-table-column>
             <template slot="empty">
@@ -147,43 +168,42 @@
 </template>
 
 <script>
-import { mapGetters } from "vuex";
-import dasBoard from "@/views/dasboard/index";
-import request from "@/api/model/file.js";
-import { exportReport, queryFloorList, queryModel, queryReportList, queryLostReportList } from "@/api/model/report.js";
-import { getToBeDelEquip, getSupplement } from "@/api/scan/request.js";
-import axios from 'axios'
-import { resolve } from 'q';
-export default {
-  components: {
-    dasBoard
-  },
-  data() {
-    return {
-      params: null,
-      ModelFileCount: null,// 模型文件夹数量
-      modelFloorCount: null,// 包含楼层模型文件数量
-      problemCount: 0,// 检查出问题的楼层模型文件数量
-      tableList: [], // tab数据
-      tableData: [],// 列表数据
-      activeTab: '', // tab当前选中项
-      headerStyle: { // 列表样式
-        backgroundColor: '#e1e4e5',
-        color: '#2b2b2b',
-        lineHeight: '30px'
-      },
-      page: {
-        pageSize: 50,
-        pageSizes: [10, 20, 50, 100],
-        pageNumber: 1,
-        total: 0
-      },
-      loading: false,
-      load: false,
-      floorIconType: null,
-      toBeSuppCount: 0,
-      toBeDelCount: 0
-    }
+  import {mapGetters} from "vuex";
+  import dasBoard from "@/views/dasboard/index";
+  import {queryFloorList, queryLostReportList, queryModel, queryReportList} from "@/api/model/report.js";
+  import {getSupplement, getToBeDelEquip} from "@/api/scan/request.js";
+  import axios from 'axios'
+
+  export default {
+    components: {
+      dasBoard
+    },
+    data() {
+      return {
+        params: null,
+        ModelFileCount: null,// 模型文件夹数量
+        modelFloorCount: null,// 包含楼层模型文件数量
+        problemCount: 0,// 检查出问题的楼层模型文件数量
+        tableList: [], // tab数据
+        tableData: [],// 列表数据
+        activeTab: '', // tab当前选中项
+        headerStyle: { // 列表样式
+          backgroundColor: '#e1e4e5',
+          color: '#2b2b2b',
+          lineHeight: '30px'
+        },
+        page: {
+          pageSize: 50,
+          pageSizes: [10, 20, 50, 100],
+          pageNumber: 1,
+          total: 0
+        },
+        loading: false,
+        load: false,
+        floorIconType: null,
+        toBeSuppCount: 0,
+        toBeDelCount: 0
+      }
   },
   mounted() { },
   created() {
@@ -197,6 +217,15 @@ export default {
     ...mapGetters('layout', ['projectId'])
   },
   methods: {
+    cellStyle({row, column, rowIndex, columnIndex}) {
+      console.log(row, column.label, '=====')
+      if (column.label !== '模型楼层' && column.label !== '待删除设备数量' && column.label !== '待补充设备数量' && column.label !== '有问题的检查项') {
+        return {
+          background: '#f3f3f3',
+          lineHeight: '30px'
+        }
+      }
+    },
     getModelFloorCount() {// 获取楼层模型文件数量,计算出检查出问题的模型文件
       let promise1 = new Promise(resolve => {
         queryFloorList({}, res => {
@@ -433,60 +462,88 @@ export default {
 </script>
 
 <style lang="less" scoped>
-.statistics {
-  display: flex;
-  width: 100%;
-  padding: 20px 0;
-  background: white;
-  margin-bottom: 10px;
-  div {
-    flex: 1;
-    text-align: center;
-    p {
-      b {
-        font-size: 20px;
-        margin-left: 20px;
+  .report-index {
+    .statistics {
+      display: flex;
+      width: 100%;
+      padding: 20px 0;
+      background: white;
+      margin-bottom: 10px;
+
+      div {
+        flex: 1;
+        text-align: center;
+
+        p {
+          b {
+            font-size: 20px;
+            margin-left: 20px;
+          }
+        }
       }
     }
-  }
-}
-.main-content {
-  width: 100%;
-  height: calc(100% - 90px);
-  background: white;
-  .content-box {
-    height: calc(100% - 105px);
-    .table {
-      margin-top: 15px;
+
+    .main-content {
+      width: 100%;
+      height: calc(100% - 90px);
+      background: white;
+
+      .content-box {
+        height: calc(100% - 105px);
+
+        .table {
+          margin-top: 15px;
+        }
+      }
     }
+
+    .button {
+      padding-left: 10px;
+
+      button {
+        border: 1px solid #dcdfe6;
+        color: #606266;
+        background: white;
+      }
+    }
+
+    .success-color {
+      color: #67c23a;
+    }
+
+    .error-color {
+      color: #f56c6c;
+    }
+
+    .success-color1 {
+      color: #67c23a60;
+    }
+
+    .error-color1 {
+      color: #f56c6c60;
+    }
+
+    /deep/ .el-table_1_column_4 {
+      border-right: 1px solid #e2e2e2 !important;
+    }
+
+    /deep/ .el-table {
+      .el-table__fixed {
+        height: auto !important;
+        bottom: 17px;
+      }
+    }
+
+    /deep/ .el-table__row.warning-row {
+      td {
+        background: #f9f9f9 !important;
+      }
+    }
+
+    /deep/ .el-badge__content--danger {
+      background-color: #F56C6C60;
+    }
+
   }
-}
-.button {
-  padding-left: 10px;
-  button {
-    border: 1px solid #dcdfe6;
-    color: #606266;
-    background: white;
-  }
-}
-.success-color {
-  color: #67c23a;
-}
-.error-color {
-  color: #f56c6c;
-}
-/deep/ .el-table_1_column_4 {
-  border-right: 1px solid #e2e2e2 !important;
-}
-/deep/ .el-table {
-  .el-table__fixed {
-    height: auto !important;
-    bottom: 17px;
-  }
-}
-/deep/ .el-table__row.warning-row {
-  td {
-    background: #f3f3f3 !important;
-  }
-}
+
 </style>

+ 5 - 1
src/views/point/config_point/edit_origin/index.vue

@@ -31,6 +31,9 @@
                 <el-form-item label="属性详情" v-if="formData.ProtocolType == 'common'">
                     <el-input type="textarea" :autosize="{ minRows: 8, maxRows: 8}" v-model="ProtocolInfo"  placeholder="请输入json格式数据" style="display:inline-block;width:400px;"> </el-input>
                 </el-form-item>
+                <el-form-item label="采集间隔时间">
+                    <el-input-number v-model="formData.CollectInterval" controls-position="right" @change="handleChange" :min="10"></el-input-number>&nbsp;&nbsp;s
+                </el-form-item>
             </el-form>
         </div>
     </div>
@@ -68,7 +71,8 @@
                         Password: "", //密码
                         ProgId: "", //progId
                     },
-                    Description: ""
+                    Description: "",
+                    CollectInterval: 10
                 },
                 ProtocolInfo:"",//自定义协议信息
                 options: [{

+ 18 - 11
src/views/point/config_point/steps/step3.vue

@@ -160,17 +160,24 @@
                     let content = res.Content.map(item => {
                         if (item.RelationList.length) {
                             item.Point.DataRuleType = item.RelationList[0].DataRuleType
-                            item.Point.PhysicalRelated = item.RelationList[0].Type
-                            //设备-部件-空间
-                            if(item.RelationList[0].TypeCode == 'Eq' || item.RelationList[0].TypeCode == 'Ec' || item.RelationList[0].TypeCode == 'Sp'){
-                                item.Point.PhysicalRelated += '-' + item.RelationList[0].EquipmentType
-                            }
-                            //系统
-                            if(item.RelationList[0].TypeCode == 'Sy'){
-                                item.Point.PhysicalRelated += '-' + item.RelationList[0].Specialty
-                                item.Point.PhysicalRelated += '-' + item.RelationList[0].System
-                            }
-                            item.Point.PhysicalRelated += '-' + item.RelationList[0].InfomationPoint
+                            item.Point.PhysicalRelated = '';
+                            item.RelationList.forEach(t => {
+                                if (item.Point.PhysicalRelated) {
+                                    item.Point.PhysicalRelated += '/' + t.Type;
+                                } else {
+                                    item.Point.PhysicalRelated = t.Type;
+                                }
+                                //设备-部件-空间
+                                if(t.TypeCode == 'Eq' || t.TypeCode == 'Ec' || t.TypeCode == 'Sp'){
+                                    item.Point.PhysicalRelated += '-' + t.EquipmentType
+                                }
+                                //系统
+                                if(t.TypeCode == 'Sy'){
+                                    item.Point.PhysicalRelated += '-' + t.Specialty
+                                    item.Point.PhysicalRelated += '-' + t.System
+                                }
+                                item.Point.PhysicalRelated += '-' + t.InfomationPoint
+                            })
                         }
                         return item
                     })

+ 39 - 36
src/views/point/dynamicdata/addRelation/buildRela/index.vue

@@ -155,12 +155,14 @@ import dataSource from "@/components/point/dynamicdata/dataSource";
 import locationFlag from "@/components/point/dynamicdata/locationFlag";
 import { mapGetters, mapActions } from "vuex";
 import {
-  dynamicPendingobjs,
+  // dynamicPendingobjs,
   dynamicPendingPoint,
   dynamicCreateRelation,
   dynamicDeleteRelation,
   dynamicPointTypeList,
-  dynamicQueryAI
+  dynamicQueryAI,
+  buildingQuery, //数据中心建筑查询
+  dynamicRelatedObj
 } from "@/api/scan/request";
 export default {
   components: {
@@ -389,46 +391,40 @@ export default {
     },
     //获取待关联实例-右侧
     getRightData() {
-      let param = {
+      let pa = {
         PageNumber: this.rPage.pageNumber,
         PageSize: this.rPage.pageSize,
-        TypeNameList: [this.typeName]
+        Filters: 'not BuildID isNull'
       };
       //处理查询条件
       if (this.form.ObjectLocalName && this.form.ObjectLocalName.length) {
-        param.ObjectLocalName = this.form.ObjectLocalName;
-      }
-      if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
-      }
-      if (this.form.locationVal.length > 0) {
-        param.BuildLocalName = this.form.locationVal[0];
-      }
-      if (this.form.locationVal.length > 1) {
-        param.FloorLocalName = this.form.locationVal[1];
-      }
-      if (this.form.locationVal.length > 2) {
-        param.SpaceType = this.form.locationVal[2];
-      }
-      if (this.form.locationVal.length > 3) {
-        param.RoomLocalName = this.form.locationVal[3];
-      }
-      if (!this.form.locationVal.length) {
-        delete param.BuildLocalName
-        delete param.FloorLocalName
-        delete param.SpaceType
-        delete param.RoomLocalName
+        pa.Filters += `;BuildLocalName contain '${this.form.ObjectLocalName}'`;
       }
       this.rTableLoading = true;
-      dynamicPendingobjs(param, res => {
-        this.rPage.total = res.PageSize < 50 ? res.PageSize : res.Total;
-        if (this.rPage.pageNumber == 1) {
-          this.RtableData = res.Content;
-        } else {
-          this.RtableData = this.RtableData.concat(res.Content);
-        }
-        this.rTableLoading = false;
-      });
+      dynamicRelatedObj({ Filters: `TypeName='${this.typeName}'` },
+        response => {
+          const tempArr = response.Content.map(t => {
+            return t.TypeCode + t.ProjectId + t.ObjectID
+          })
+          if (tempArr.length) {
+            pa.Filters += `;not BuildID in ${JSON.stringify(tempArr)}`
+          }
+          buildingQuery(pa, res => {
+            this.rPage.total = res.Total;
+            let tempArr = res.Content.map(t => {
+              t.ObjectID = t.BuildID.substr(12);
+              t.ObjectLocalName = t.BuildLocalName;
+              t.ObjectLocalCode = t.BuildLocalID;
+              return t;
+            });
+            if (this.rPage.pageNumber == 1) {
+              this.RtableData = tempArr;
+            } else {
+              this.RtableData = this.RtableData.concat(tempArr);
+            }
+            this.rTableLoading = false;
+          });
+        })
     },
     //清除对应关系成功
     deleteSuc() {
@@ -529,7 +525,14 @@ export default {
           let param = []
           n.map(item => {
             param.push({
-              Objs: [item],
+              Objs: [{
+                ObjectID: item.ObjectID,
+                TypeCode: 'Bd',
+                ProjectId: item.ProjectID.substring(2),
+                ObjectLocalCode: item.ObjectLocalCode,
+                ObjectLocalName: item.ObjectLocalName,
+                SubTypeCode: 'null'
+              }],
               Top: 3,
               Proximity: 0.5
             })

+ 68 - 25
src/views/point/dynamicdata/addRelation/equipRela/index.vue

@@ -155,12 +155,15 @@ import dataSource from "@/components/point/dynamicdata/dataSource";
 import locationFlag from "@/components/point/dynamicdata/locationFlag";
 import { mapGetters, mapActions } from "vuex";
 import {
-  dynamicPendingobjs,
+  // dynamicPendingobjs,
   dynamicPendingPoint,
   dynamicCreateRelation,
   dynamicDeleteRelation,
   dynamicPointTypeList,
-  dynamicQueryAI
+  dynamicQueryAI,
+  queryEquip, //数据中心设备查询
+  dynamicRelatedObj,
+  dynamicEquipQuery
 } from "@/api/scan/request";
 export default {
   components: {
@@ -368,7 +371,7 @@ export default {
         param.EquipmentMark = this.form.EquipmentMark;
       }
       if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
+        param.SubTypeCodeList = this.form.SubTypeName;
       }
       if (this.form.LocationFlag.length) {
         param.LocationFlagList = this.form.LocationFlag;
@@ -389,46 +392,79 @@ export default {
     },
     //获取待关联实例-右侧
     getRightData() {
-      let param = {
+      let pa = {
         PageNumber: this.rPage.pageNumber,
         PageSize: this.rPage.pageSize,
-        TypeNameList: [this.typeName]
+        Filters: 'not EquipID isNull',
+        Cascade: [{ Name: "zoneSpaceInBase" }, { Name: 'building' }, { Name: 'floor' }, { Name: 'equipCategory' }]
       };
       //处理查询条件
       if (this.form.ObjectLocalName && this.form.ObjectLocalName.length) {
-        param.ObjectLocalName = this.form.ObjectLocalName;
+        pa.Filters += `;EquipLocalName contain "${this.form.ObjectLocalName}"`;
       }
       if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
+        pa.Filters += `;Category in ${JSON.stringify(this.form.SubTypeName)}`;
       }
       if (this.form.locationVal.length > 0) {
-        param.BuildLocalName = this.form.locationVal[0];
+        if (this.form.locationVal[0] == 'unknowBuild') {
+          pa.Filters += `;BuildingId isNull`;
+        } else {
+          pa.Filters += `;BuildingId='${this.form.locationVal[0]}'`;
+        }
       }
       if (this.form.locationVal.length > 1) {
-        param.FloorLocalName = this.form.locationVal[1];
+        if (this.form.locationVal[1] == 'unknowFloor') {
+          pa.Filters += `;FloorId isNull`;
+        } else {
+          pa.Filters += `;FloorId='${this.form.locationVal[1]}'`;
+        }
       }
       if (this.form.locationVal.length > 2) {
-        param.SpaceType = this.form.locationVal[2];
+        pa.ZoneType = this.form.locationVal[2];
       }
       if (this.form.locationVal.length > 3) {
-        param.RoomLocalName = this.form.locationVal[3];
+        pa.ZoneId = this.form.locationVal[3];
       }
-      if (!this.form.locationVal.length) {
-        delete param.BuildLocalName
-        delete param.FloorLocalName
-        delete param.SpaceType
-        delete param.RoomLocalName
+      let pa2 = {
+        Filters: `TypeName='${this.typeName}'`
+      }
+      if (this.form.SubTypeName.length) {
+        pa2.Filters += `;SubTypeCode in ${JSON.stringify(this.form.SubTypeName)}`
       }
       this.rTableLoading = true;
-      dynamicPendingobjs(param, res => {
-        this.rPage.total = res.PageSize < 50 ? res.PageSize : res.Total;
-        if (this.rPage.pageNumber == 1) {
-          this.RtableData = res.Content;
-        } else {
-          this.RtableData = this.RtableData.concat(res.Content);
+      dynamicRelatedObj(pa2, response => {
+        const tempArr = response.Content.map(t => {
+          return t.TypeCode + t.ProjectId + t.ObjectID
+        })
+        if (tempArr.length) {
+          pa.Filters += `;not EquipID in ${JSON.stringify(tempArr)}`
         }
-        this.rTableLoading = false;
-      });
+        dynamicEquipQuery(pa, res => {
+          this.rPage.total = res.Total;
+          let tempArr = res.Content.map(t => {
+            t.ObjectID = t.EquipID.substr(12);
+            t.ObjectLocalName = t.EquipLocalName;
+            t.ObjectLocalCode = t.EquipLocalID;
+            t.SubTypeName = t.EquipCategory ? t.EquipCategory.EquipName : '';
+            t.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+            t.FloorLocalName = t.Floor ? t.Floor.FloorLocalName : '';
+            t.RoomLocalName = '';
+            if (t.ZoneSpaceBaseIn) {
+              t.ZoneSpaceBaseIn.forEach(item => {
+                t.RoomLocalName += item.RoomLocalName + ',';
+              })
+              t.RoomLocalName = t.RoomLocalName.substring(0, t.RoomLocalName.length - 1);
+            }
+            return t;
+          });
+          if (this.rPage.pageNumber == 1) {
+            this.RtableData = tempArr;
+          } else {
+            this.RtableData = this.RtableData.concat(tempArr);
+          }
+          this.rTableLoading = false;
+        });
+      })
     },
     //清除对应关系成功
     deleteSuc() {
@@ -529,7 +565,14 @@ export default {
           let param = []
           n.map(item => {
             param.push({
-              Objs: [item],
+              Objs: [{
+                ObjectID: item.ObjectID,
+                TypeCode: 'Eq',
+                ProjectId: item.ProjectId.substring(2),
+                ObjectLocalCode: item.ObjectLocalCode,
+                ObjectLocalName: item.ObjectLocalName,
+                SubTypeCode: item.Category
+              }],
               Top: 3,
               Proximity: 0.5
             })

+ 50 - 39
src/views/point/dynamicdata/addRelation/floorRela/index.vue

@@ -106,10 +106,8 @@
               <el-table-column prop="ObjectLocalCode" :label="`${typeName}本地编码`" show-overflow-tooltip></el-table-column>
               <el-table-column :label="`${typeName}顺序号`" show-overflow-tooltip>
                 <template slot-scope="scope">
-                  <el-tooltip :content="(scope.row.ObjectSequenceID&&scope.row.ObjectSequenceID!='null')?scope.row.ObjectSequenceID:''"
-                    placement="top">
-                    <div class="tool-tip">
-                      {{(scope.row.ObjectSequenceID&&scope.row.ObjectSequenceID!='null')?scope.row.ObjectSequenceID:''}}</div>
+                  <el-tooltip :content="scope.row.ObjectSequenceID+''" placement="top">
+                    <div class="tool-tip">{{scope.row.ObjectSequenceID+''}}</div>
                   </el-tooltip>
                 </template>
               </el-table-column>
@@ -167,7 +165,9 @@ import {
   dynamicCreateRelation,
   dynamicDeleteRelation,
   dynamicPointTypeList,
-  dynamicQueryAI
+  dynamicQueryAI,
+  floorQuery, //数据中心查询楼层
+  dynamicRelatedObj
 } from "@/api/scan/request";
 export default {
   components: {
@@ -396,46 +396,50 @@ export default {
     },
     //获取待关联实例-右侧
     getRightData() {
-      let param = {
+      let pa = {
+        Cascade: [{ Name: 'building' }],
         PageNumber: this.rPage.pageNumber,
         PageSize: this.rPage.pageSize,
-        TypeNameList: [this.typeName]
-      };
+        Filters: `not FloorID isNull`
+      }
       //处理查询条件
       if (this.form.ObjectLocalName && this.form.ObjectLocalName.length) {
-        param.ObjectLocalName = this.form.ObjectLocalName;
-      }
-      if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
-      }
-      if (this.form.locationVal.length > 0) {
-        param.BuildLocalName = this.form.locationVal[0];
-      }
-      if (this.form.locationVal.length > 1) {
-        param.FloorLocalName = this.form.locationVal[1];
+        pa.Filters += `;FloorLocalName contain '${this.form.ObjectLocalName}'`;
       }
-      if (this.form.locationVal.length > 2) {
-        param.SpaceType = this.form.locationVal[2];
-      }
-      if (this.form.locationVal.length > 3) {
-        param.RoomLocalName = this.form.locationVal[3];
-      }
-      if (!this.form.locationVal.length) {
-        delete param.BuildLocalName
-        delete param.FloorLocalName
-        delete param.SpaceType
-        delete param.RoomLocalName
-      }
-      this.rTableLoading = true;
-      dynamicPendingobjs(param, res => {
-        this.rPage.total = res.PageSize < 50 ? res.PageSize : res.Total;
-        if (this.rPage.pageNumber == 1) {
-          this.RtableData = res.Content;
+      if (this.form.locationVal.length) {
+        if (this.form.locationVal[0] != 'unknowBuild') {
+          pa.Filters += `;BuildID='${this.form.locationVal[0]}'`;
         } else {
-          this.RtableData = this.RtableData.concat(res.Content);
+          pa.Filters += `;BuildID isNull`;
         }
-        this.rTableLoading = false;
-      });
+      }
+      this.rTableLoading = true;
+      dynamicRelatedObj({ Filters: `TypeName='${this.typeName}'` },
+        response => {
+          const tempArr = response.Content.map(t => {
+            return t.TypeCode + t.ProjectId + t.ObjectID
+          })
+          if (tempArr.length) {
+            pa.Filters += `;not FloorID in ${JSON.stringify(tempArr)}`
+          }
+          floorQuery(pa, res => {
+            this.rPage.total = res.Total;
+            let tempArr = res.Content.map(t => {
+              t.ObjectID = t.FloorID.substr(12);
+              t.ObjectLocalName = t.FloorLocalName;
+              t.ObjectLocalCode = t.FloorLocalID;
+              t.ObjectSequenceID = t.FloorSequenceID;
+              t.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+              return t;
+            });
+            if (this.rPage.pageNumber == 1) {
+              this.RtableData = tempArr;
+            } else {
+              this.RtableData = this.RtableData.concat(tempArr);
+            }
+            this.rTableLoading = false;
+          })
+        })
     },
     //清除对应关系成功
     deleteSuc() {
@@ -536,7 +540,14 @@ export default {
           let param = []
           n.map(item => {
             param.push({
-              Objs: [item],
+              Objs: [{
+                ObjectID: item.ObjectID,
+                TypeCode: 'Fl',
+                ProjectId: item.ProjectID.substring(2),
+                ObjectLocalCode: item.ObjectLocalCode,
+                ObjectLocalName: item.ObjectLocalName,
+                SubTypeCode: 'null'
+              }],
               Top: 3,
               Proximity: 0.5
             })

+ 69 - 25
src/views/point/dynamicdata/addRelation/partsRela/index.vue

@@ -156,12 +156,15 @@ import dataSource from "@/components/point/dynamicdata/dataSource";
 import locationFlag from "@/components/point/dynamicdata/locationFlag";
 import { mapGetters, mapActions } from "vuex";
 import {
-  dynamicPendingobjs,
+  // dynamicPendingobjs,
   dynamicPendingPoint,
   dynamicCreateRelation,
   dynamicDeleteRelation,
   dynamicPointTypeList,
-  dynamicQueryAI
+  dynamicQueryAI,
+  dynamicRelatedObj,
+  partsQuery, //数据中心部件查询
+  dynamicPartQuery
 } from "@/api/scan/request";
 export default {
   components: {
@@ -369,7 +372,7 @@ export default {
         param.EquipmentMark = this.form.EquipmentMark;
       }
       if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
+        param.SubTypeCodeList = this.form.SubTypeName;
       }
       if (this.form.LocationFlag.length) {
         param.LocationFlagList = this.form.LocationFlag;
@@ -390,46 +393,80 @@ export default {
     },
     //获取待关联实例-右侧
     getRightData() {
-      let param = {
+      let pa = {
         PageNumber: this.rPage.pageNumber,
         PageSize: this.rPage.pageSize,
-        TypeNameList: [this.typeName]
+        Filters: 'not EquipID isNull',
+        Cascade: [{ Name: "zoneSpaceInBase" }, { Name: 'building' }, { Name: 'floor' }, { Name: 'equipCategory' }, { Name: 'belongedEquipment' }]
       };
       //处理查询条件
       if (this.form.ObjectLocalName && this.form.ObjectLocalName.length) {
-        param.ObjectLocalName = this.form.ObjectLocalName;
+        pa.Filters += `;EquipLocalName contain "${this.form.ObjectLocalName}"`;
       }
       if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
+        pa.Filters += `;Category in ${JSON.stringify(this.form.SubTypeName)}`;
       }
       if (this.form.locationVal.length > 0) {
-        param.BuildLocalName = this.form.locationVal[0];
+        if (this.form.locationVal[0] == 'unknowBuild') {
+          pa.Filters += `;BuildingId isNull`;
+        } else {
+          pa.Filters += `;BuildingId='${this.form.locationVal[0]}'`;
+        }
       }
       if (this.form.locationVal.length > 1) {
-        param.FloorLocalName = this.form.locationVal[1];
+        if (this.form.locationVal[1] == 'unknowFloor') {
+          pa.Filters += `;FloorId isNull`;
+        } else {
+          pa.Filters += `;FloorId='${this.form.locationVal[1]}'`;
+        }
       }
       if (this.form.locationVal.length > 2) {
-        param.SpaceType = this.form.locationVal[2];
+        pa.ZoneType = this.form.locationVal[2];
       }
       if (this.form.locationVal.length > 3) {
-        param.RoomLocalName = this.form.locationVal[3];
+        pa.ZoneId = this.form.locationVal[3];
       }
-      if (!this.form.locationVal.length) {
-        delete param.BuildLocalName
-        delete param.FloorLocalName
-        delete param.SpaceType
-        delete param.RoomLocalName
+      let pa2 = {
+        Filters: `TypeName='${this.typeName}'`
+      }
+      if (this.form.SubTypeName.length) {
+        pa2.Filters += `;SubTypeCode in ${JSON.stringify(this.form.SubTypeName)}`
       }
       this.rTableLoading = true;
-      dynamicPendingobjs(param, res => {
-        this.rPage.total = res.PageSize < 50 ? res.PageSize : res.Total;
-        if (this.rPage.pageNumber == 1) {
-          this.RtableData = res.Content;
-        } else {
-          this.RtableData = this.RtableData.concat(res.Content);
+      dynamicRelatedObj(pa2, response => {
+        const tempArr = response.Content.map(t => {
+          return t.TypeCode + t.ProjectId + t.ObjectID
+        })
+        if (tempArr.length) {
+          pa.Filters += `;not EquipID in ${JSON.stringify(tempArr)}`
         }
-        this.rTableLoading = false;
-      });
+        dynamicPartQuery(pa, res => {
+          this.rPage.total = res.Total;
+          let tempArr = res.Content.map(t => {
+            t.ObjectID = t.EquipID.substr(12);
+            t.ObjectLocalName = t.EquipLocalName;
+            t.ObjectLocalCode = t.EquipLocalID;
+            t.SubTypeName = t.EquipCategory ? t.EquipCategory.EquipName : '';
+            t.CascadeEquipLocalName = t.BelongedEquipment ? t.BelongedEquipment.EquipLocalName : '';
+            t.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+            t.FloorLocalName = t.Floor ? t.Floor.FloorLocalName : '';
+            t.RoomLocalName = '';
+            if (t.ZoneSpaceInBase) {
+              t.ZoneSpaceInBase.forEach(item => {
+                t.RoomLocalName += item.RoomLocalName + ',';
+              })
+              t.RoomLocalName = t.RoomLocalName.substring(0, t.RoomLocalName.length - 1);
+            }
+            return t;
+          });
+          if (this.rPage.pageNumber == 1) {
+            this.RtableData = tempArr;
+          } else {
+            this.RtableData = this.RtableData.concat(tempArr);
+          }
+          this.rTableLoading = false;
+        });
+      })
     },
     //清除对应关系成功
     deleteSuc() {
@@ -530,7 +567,14 @@ export default {
           let param = []
           n.map(item => {
             param.push({
-              Objs: [item],
+              Objs: [{
+                ObjectID: item.ObjectID,
+                TypeCode: 'Ec',
+                ProjectId: item.ProjectId.substring(2),
+                ObjectLocalCode: item.ObjectLocalCode,
+                ObjectLocalName: item.ObjectLocalName,
+                SubTypeCode: item.Category
+              }],
               Top: 3,
               Proximity: 0.5
             })

+ 31 - 36
src/views/point/dynamicdata/addRelation/projectRela/index.vue

@@ -9,8 +9,8 @@
         </div> -->
       </el-col>
       <el-col :span="12" class="text-right">
-        <el-switch @change="changeType" v-model="isSwitch"></el-switch>
-        <span style="padding:0 5px;">AI辅助</span>
+        <!-- <el-switch @change="changeType" v-model="isSwitch"></el-switch>
+        <span style="padding:0 5px;">AI辅助</span> -->
         <el-button size="medium" @click="showHistory" class="ani-his-plus">
           本次对应记录 {{num}}
           <span v-if="showPlus" :class="{'plusOne':true,'startAni':showPlus}">+1</span>
@@ -156,12 +156,14 @@ import dataSource from "@/components/point/dynamicdata/dataSource";
 import locationFlag from "@/components/point/dynamicdata/locationFlag";
 import { mapGetters, mapActions } from "vuex";
 import {
-  dynamicPendingobjs,
+  // dynamicPendingobjs,
   dynamicPendingPoint,
   dynamicCreateRelation,
   dynamicDeleteRelation,
   dynamicPointTypeList,
-  dynamicQueryAI
+  dynamicQueryAI,
+  projectQuery, //数据中心查询项目信息
+  dynamicRelatedObj
 } from "@/api/scan/request";
 export default {
   components: {
@@ -390,46 +392,39 @@ export default {
     },
     //获取待关联实例-右侧
     getRightData() {
-      let param = {
+      let pa = {
         PageNumber: this.rPage.pageNumber,
         PageSize: this.rPage.pageSize,
-        TypeNameList: [this.typeName]
+        Filters: 'not ProjID isNull'
       };
       //处理查询条件
       if (this.form.ObjectLocalName && this.form.ObjectLocalName.length) {
-        param.ObjectLocalName = this.form.ObjectLocalName;
-      }
-      if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
-      }
-      if (this.form.locationVal.length > 0) {
-        param.BuildLocalName = this.form.locationVal[0];
-      }
-      if (this.form.locationVal.length > 1) {
-        param.FloorLocalName = this.form.locationVal[1];
-      }
-      if (this.form.locationVal.length > 2) {
-        param.SpaceType = this.form.locationVal[2];
-      }
-      if (this.form.locationVal.length > 3) {
-        param.RoomLocalName = this.form.locationVal[3];
-      }
-      if (!this.form.locationVal.length) {
-        delete param.BuildLocalName
-        delete param.FloorLocalName
-        delete param.SpaceType
-        delete param.RoomLocalName
+        pa.Filters += `;ProjLocalName contain '${this.form.ObjectLocalName}'`;
       }
       this.rTableLoading = true;
-      dynamicPendingobjs(param, res => {
-        this.rPage.total = res.PageSize < 50 ? res.PageSize : res.Total;
-        if (this.rPage.pageNumber == 1) {
-          this.RtableData = res.Content;
-        } else {
-          this.RtableData = this.RtableData.concat(res.Content);
+      dynamicRelatedObj({ Filters: `TypeName='${this.typeName}'` }, response => {
+        const tempArr = response.Content.map(t => {
+          return t.TypeCode + t.ProjectId + t.ObjectID
+        })
+        if (tempArr.length) {
+          pa.Filters += `;not ProjID in ${JSON.stringify(tempArr)}`
         }
-        this.rTableLoading = false;
-      });
+        projectQuery(pa, res => {
+          this.rPage.total = res.Total;
+          let tempArr = res.Content.map(t => {
+            t.ObjectID = t.ProjID.substr(2);
+            t.ObjectLocalName = t.ProjLocalName;
+            t.ObjectLocalCode = t.ProjLocalID;
+            return t;
+          });
+          if (this.rPage.pageNumber == 1) {
+            this.RtableData = tempArr;
+          } else {
+            this.RtableData = this.RtableData.concat(tempArr);
+          }
+          this.rTableLoading = false;
+        });
+      })
     },
     //清除对应关系成功
     deleteSuc() {

+ 52 - 31
src/views/point/dynamicdata/addRelation/spaceRela/index.vue

@@ -91,7 +91,7 @@
           </div>
           <div class="query-item">
             <label>所在位置</label>
-            <location-cas @change="changeLocation" :Related="false" :typeName="typeName"></location-cas>
+            <location-cas @change="changeLocation" :Related="false" :typeName="typeName" :isSpace="true"></location-cas>
           </div>
         </div>
         <!-- 右侧列表 -->
@@ -156,12 +156,14 @@ import dataSource from "@/components/point/dynamicdata/dataSource";
 import locationFlag from "@/components/point/dynamicdata/locationFlag";
 import { mapGetters, mapActions } from "vuex";
 import {
-  dynamicPendingobjs,
+  // dynamicPendingobjs,
   dynamicPendingPoint,
   dynamicCreateRelation,
   dynamicDeleteRelation,
   dynamicPointTypeList,
-  dynamicQueryAI
+  dynamicQueryAI,
+  zoneQuery, //数据中心所有空间实例
+  dynamicRelatedObj, //动参-查询已关联实例
 } from "@/api/scan/request";
 export default {
   components: {
@@ -369,7 +371,7 @@ export default {
         param.EquipmentMark = this.form.EquipmentMark;
       }
       if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
+        param.SubTypeCodeList = this.form.SubTypeName;
       }
       if (this.form.LocationFlag.length) {
         param.LocationFlagList = this.form.LocationFlag;
@@ -390,46 +392,58 @@ export default {
     },
     //获取待关联实例-右侧
     getRightData() {
-      let param = {
+      let pa = {
         PageNumber: this.rPage.pageNumber,
         PageSize: this.rPage.pageSize,
-        TypeNameList: [this.typeName]
+        Cascade: [{ Name: 'building' }, { Name: 'floor' }, { Name: 'zoneName' }],
+        Filters: 'not RoomID isNull'
       };
       //处理查询条件
-      if (this.form.ObjectLocalName && this.form.ObjectLocalName.length) {
-        param.ObjectLocalName = this.form.ObjectLocalName;
-      }
       if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
+        pa.Filters += `;ObjectType in ${JSON.stringify(this.form.SubTypeName)}`
+      }
+      if (this.form.ObjectLocalName && this.form.ObjectLocalName.length) {
+        pa.Filters += `;RoomLocalName contain "${this.form.ObjectLocalName}"`;
       }
       if (this.form.locationVal.length > 0) {
-        param.BuildLocalName = this.form.locationVal[0];
+        pa.Filters += `;BuildingId="${this.form.locationVal[0]}"`;
       }
       if (this.form.locationVal.length > 1) {
-        param.FloorLocalName = this.form.locationVal[1];
-      }
-      if (this.form.locationVal.length > 2) {
-        param.SpaceType = this.form.locationVal[2];
+        pa.Filters += `;FloorId="${this.form.locationVal[1]}"`;
       }
-      if (this.form.locationVal.length > 3) {
-        param.RoomLocalName = this.form.locationVal[3];
+      let pa2 = {
+        Filters: `TypeName='${this.typeName}'`
       }
-      if (!this.form.locationVal.length) {
-        delete param.BuildLocalName
-        delete param.FloorLocalName
-        delete param.SpaceType
-        delete param.RoomLocalName
+      if (this.form.SubTypeName.length) {
+        pa2.Filters += `;SubTypeCode in ${JSON.stringify(this.form.SubTypeName)}`
       }
       this.rTableLoading = true;
-      dynamicPendingobjs(param, res => {
-        this.rPage.total = res.PageSize < 50 ? res.PageSize : res.Total;
-        if (this.rPage.pageNumber == 1) {
-          this.RtableData = res.Content;
-        } else {
-          this.RtableData = this.RtableData.concat(res.Content);
+      dynamicRelatedObj(pa2, response => {
+        const tempArr = response.Content.map(t => {
+          return t.TypeCode + t.ProjectId + t.ObjectID
+        })
+        if (tempArr.length) {
+          pa.Filters += `;not RoomID in ${JSON.stringify(tempArr)}`
         }
-        this.rTableLoading = false;
-      });
+        zoneQuery(pa, res => {
+          this.rPage.total = res.Total;
+          let tempArr = res.Content.map(t => {
+            t.ObjectID = t.RoomID.substr(12);
+            t.ObjectLocalName = t.RoomLocalName;
+            t.ObjectLocalCode = t.RoomLocalID;
+            t.BuildLocalName = t.Building ? t.Building.BuildLocalName : '';
+            t.FloorLocalName = t.Floor ? t.Floor.FloorLocalName : '';
+            t.SubTypeName = t.DClassDef ? t.DClassDef.Name : '';
+            return t;
+          });
+          if (this.rPage.pageNumber == 1) {
+            this.RtableData = tempArr;
+          } else {
+            this.RtableData = this.RtableData.concat(tempArr);
+          }
+          this.rTableLoading = false;
+        });
+      })
     },
     //清除对应关系成功
     deleteSuc() {
@@ -530,7 +544,14 @@ export default {
           let param = []
           n.map(item => {
             param.push({
-              Objs: [item],
+              Objs: [{
+                ObjectID: item.ObjectID,
+                TypeCode: 'Sp',
+                ProjectId: item.ProjectId.substring(2),
+                ObjectLocalCode: item.ObjectLocalCode,
+                ObjectLocalName: item.ObjectLocalName,
+                SubTypeCode: item.ObjectType
+              }],
               Top: 3,
               Proximity: 0.5
             })

+ 34 - 33
src/views/point/dynamicdata/addRelation/systemRela/index.vue

@@ -155,12 +155,14 @@ import dataSource from "@/components/point/dynamicdata/dataSource";
 import locationFlag from "@/components/point/dynamicdata/locationFlag";
 import { mapGetters, mapActions } from "vuex";
 import {
-  dynamicPendingobjs,
+  // dynamicPendingobjs,
   dynamicPendingPoint,
   dynamicCreateRelation,
   dynamicDeleteRelation,
   dynamicPointTypeList,
-  dynamicQueryAI
+  dynamicQueryAI,
+  queryLinkSys, //数据中心系统查询
+  dynamicRelatedObj
 } from "@/api/scan/request";
 export default {
   components: {
@@ -368,7 +370,7 @@ export default {
         param.EquipmentMark = this.form.EquipmentMark;
       }
       if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
+        param.SubTypeCodeList = this.form.SubTypeName;
       }
       if (this.form.LocationFlag.length) {
         param.LocationFlagList = this.form.LocationFlag;
@@ -389,46 +391,45 @@ export default {
     },
     //获取待关联实例-右侧
     getRightData() {
-      let param = {
+      let pa = {
         PageNumber: this.rPage.pageNumber,
         PageSize: this.rPage.pageSize,
-        TypeNameList: [this.typeName]
+        Filters: 'not SysID isNull'
       };
       //处理查询条件
-      if (this.form.ObjectLocalName && this.form.ObjectLocalName.length) {
-        param.ObjectLocalName = this.form.ObjectLocalName;
-      }
       if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
-      }
-      if (this.form.locationVal.length > 0) {
-        param.BuildLocalName = this.form.locationVal[0];
-      }
-      if (this.form.locationVal.length > 1) {
-        param.FloorLocalName = this.form.locationVal[1];
-      }
-      if (this.form.locationVal.length > 2) {
-        param.SpaceType = this.form.locationVal[2];
+        pa.Filters += `;Category in ${JSON.stringify(this.form.SubTypeName)}`
       }
-      if (this.form.locationVal.length > 3) {
-        param.RoomLocalName = this.form.locationVal[3];
+      let pa2 = {
+        Filters: `TypeName='${this.typeName}'`
       }
-      if (!this.form.locationVal.length) {
-        delete param.BuildLocalName
-        delete param.FloorLocalName
-        delete param.SpaceType
-        delete param.RoomLocalName
+      if (this.form.SubTypeName.length) {
+        pa2.Filters += `;SubTypeCode in ${JSON.stringify(this.form.SubTypeName)}`
       }
       this.rTableLoading = true;
-      dynamicPendingobjs(param, res => {
-        this.rPage.total = res.PageSize < 50 ? res.PageSize : res.Total;
-        if (this.rPage.pageNumber == 1) {
-          this.RtableData = res.Content;
-        } else {
-          this.RtableData = this.RtableData.concat(res.Content);
+      dynamicRelatedObj(pa2, response => {
+        const tempArr = response.Content.map(t => {
+          return t.TypeCode + t.ProjectId + t.ObjectID
+        })
+        if (tempArr.length) {
+          pa.Filters += `;not SysID in ${JSON.stringify(tempArr)}`
         }
-        this.rTableLoading = false;
-      });
+        queryLinkSys(pa, res => {
+          this.rPage.total = res.Total;
+          let tempArr = res.Content.map(t => {
+            t.ObjectID = t.SysID.substr(12);
+            t.ObjectLocalName = t.SysLocalName;
+            t.ObjectLocalCode = t.SysLocalID;
+            return t;
+          });
+          if (this.rPage.pageNumber == 1) {
+            this.RtableData = tempArr;
+          } else {
+            this.RtableData = this.RtableData.concat(tempArr);
+          }
+          this.rTableLoading = false;
+        });
+      })
     },
     //清除对应关系成功
     deleteSuc() {

+ 65 - 32
src/views/point/dynamicdata/addRelation/tenantRela/index.vue

@@ -156,12 +156,15 @@ import dataSource from "@/components/point/dynamicdata/dataSource";
 import locationFlag from "@/components/point/dynamicdata/locationFlag";
 import { mapGetters, mapActions } from "vuex";
 import {
-  dynamicPendingobjs,
+  // dynamicPendingobjs,
   dynamicPendingPoint,
   dynamicCreateRelation,
   dynamicDeleteRelation,
   dynamicPointTypeList,
-  dynamicQueryAI
+  dynamicQueryAI,
+  queryTenant, //数据中心查询租户
+  dynamicRelatedObj,
+  dynamicTenantQuery
 } from "@/api/scan/request";
 export default {
   components: {
@@ -390,46 +393,69 @@ export default {
     },
     //获取待关联实例-右侧
     getRightData() {
-      let param = {
+      let pa = {
         PageNumber: this.rPage.pageNumber,
         PageSize: this.rPage.pageSize,
-        TypeNameList: [this.typeName]
+        Cascade: [{ Name: 'zoneTenantList' }],
+        Filters: 'not TenantID isNull',
+        Cascade: [{ Name: "zoneTenantList" }]
       };
       //处理查询条件
       if (this.form.ObjectLocalName && this.form.ObjectLocalName.length) {
-        param.ObjectLocalName = this.form.ObjectLocalName;
-      }
-      if (this.form.SubTypeName.length) {
-        param.SubTypeNameList = this.form.SubTypeName;
-      }
-      if (this.form.locationVal.length > 0) {
-        param.BuildLocalName = this.form.locationVal[0];
-      }
-      if (this.form.locationVal.length > 1) {
-        param.FloorLocalName = this.form.locationVal[1];
+        pa.Filters += `;TenantLocalName contain "${this.form.ObjectLocalName}"`;
       }
+      // if (this.form.locationVal.length > 0) {
+      //   if (this.form.locationVal[0] == 'unknowBuild') {
+      //     pa.Filters += `;BuildingId isNull`;
+      //   } else {
+      //     pa.Filters += `;BuildingId='${this.form.locationVal[0]}'`;
+      //   }
+      // }
+      // if (this.form.locationVal.length > 1) {
+      //   if (this.form.locationVal[1] == 'unknowFloor') {
+      //     pa.Filters += `;FloorId isNull`;
+      //   } else {
+      //     pa.Filters += `;FloorId='${this.form.locationVal[1]}'`;
+      //   }
+      // }
       if (this.form.locationVal.length > 2) {
-        param.SpaceType = this.form.locationVal[2];
+        pa.ZoneType = this.form.locationVal[2];
       }
       if (this.form.locationVal.length > 3) {
-        param.RoomLocalName = this.form.locationVal[3];
-      }
-      if (!this.form.locationVal.length) {
-        delete param.BuildLocalName
-        delete param.FloorLocalName
-        delete param.SpaceType
-        delete param.RoomLocalName
+        pa.ZoneId = this.form.locationVal[3];
       }
       this.rTableLoading = true;
-      dynamicPendingobjs(param, res => {
-        this.rPage.total = res.PageSize < 50 ? res.PageSize : res.Total;
-        if (this.rPage.pageNumber == 1) {
-          this.RtableData = res.Content;
-        } else {
-          this.RtableData = this.RtableData.concat(res.Content);
-        }
-        this.rTableLoading = false;
-      });
+      dynamicRelatedObj({ Filters: `TypeName='${this.typeName}'` },
+        response => {
+          const tempArr = response.Content.map(t => {
+            return t.TypeCode + t.ProjectId + t.ObjectID
+          })
+          if (tempArr.length) {
+            pa.Filters += `;not TenantID in ${JSON.stringify(tempArr)}`
+          }
+          dynamicTenantQuery(pa, res => {
+            this.rPage.total = res.Total;
+            let tempArr = res.Content.map(t => {
+              t.ObjectID = t.TenantID.substr(14);
+              t.ObjectLocalName = t.TenantLocalName;
+              t.ObjectLocalCode = t.TenantLocalID;
+              t.RoomLocalName = '';
+              if (t.ZoneTenantList) {
+                t.ZoneTenantList.forEach(item => {
+                  t.RoomLocalName += item.RoomLocalName + ',';
+                });
+                t.RoomLocalName = t.RoomLocalName.substring(0, t.RoomLocalName.length - 1);
+              }
+              return t;
+            });
+            if (this.rPage.pageNumber == 1) {
+              this.RtableData = tempArr;
+            } else {
+              this.RtableData = this.RtableData.concat(tempArr);
+            }
+            this.rTableLoading = false;
+          });
+        })
     },
     //清除对应关系成功
     deleteSuc() {
@@ -530,7 +556,14 @@ export default {
           let param = []
           n.map(item => {
             param.push({
-              Objs: [item],
+              Objs: [{
+                ObjectID: item.ObjectID,
+                TypeCode: 'VOTn',
+                ProjectId: item.ProjectId.substring(2),
+                ObjectLocalCode: item.ObjectLocalCode,
+                ObjectLocalName: item.ObjectLocalName,
+                SubTypeCode: 'VOTn'
+              }],
               Top: 3,
               Proximity: 0.5
             })

+ 1 - 1
src/views/ready/buildfloor/addFloor/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-dialog :title="title" :visible.sync="dialogVisible" width="45%" @close="handleClose" id="messageDialog">
+  <el-dialog :title="title" :visible.sync="dialogVisible" width="850px" @close="handleClose" id="messageDialog">
     <el-row>
       <formItems :type="'Floor'" ref="formItems"></formItems>
     </el-row>

+ 2 - 1
src/views/ready/buildfloor/drawGraphy/checkGraphy.vue

@@ -70,7 +70,8 @@ export default {
       let pa = {
         FloorId: this.floor.FloorID,
         Id: this.modelIdToFloorId[this.jsonKey],
-        BuildingId: this.floor.BuildID
+        BuildingId: this.floor.BuildID,
+        Cover: true
       };
       bindFloorModel(pa, res => {
         this.$message.success("更新成功");

+ 397 - 249
src/views/ready/buildfloor/index.vue

@@ -4,28 +4,43 @@
       <div class="l-list">
         <div class="action-box">
           <div>
-            <el-button size="small" type="default" icon="el-icon-plus" @click="addBuild" />
-            <el-button size="small" type="default" icon="el-icon-minus" @click="delBuild" />
-            <el-button size="small" type="default" icon="el-icon-edit-outline" @click="editBuild" />
+            <el-button @click="addBuild" icon="el-icon-plus" size="small" type="default"/>
+            <!--            <el-popover-->
+            <!--              placement="top"-->
+            <!--              width="160"-->
+            <!--              v-model="visible">-->
+            <!--              <p>确定删除吗?</p>-->
+            <!--              <div style="text-align: right; margin: 0">-->
+            <!--                <el-button size="mini" type="text" @click="visible = false">取消</el-button>-->
+            <!--                <el-button type="primary" size="mini" @click="delBuild">确定</el-button>-->
+            <!--              </div>-->
+            <!--              <el-button slot="reference" icon="el-icon-minus" size="small" type="default"/>-->
+            <!--            </el-popover>-->
+            <el-button @click="delBuild" icon="el-icon-minus" size="small" type="default"/>
+            <el-button @click="editBuild" icon="el-icon-edit-outline" size="small" type="default"/>
           </div>
         </div>
         <h4>建筑</h4>
         <div class="build-list">
-          <div v-for="(item,index) in buildList" :key="item.BuildID" :class="{'floor-item':true,active:item.active}" @click="changeBuild(index)">
+          <div :class="{'floor-item':true,active:item.active}"
+               :key="item.BuildID"
+               @click="changeBuild(index)"
+               v-for="(item,index) in buildList">
             <span>
               {{item.BuildLocalName || item.BuildName}}
-              <el-badge v-if="item.Count>0" class="mark" :value="item.Count" />
+              <el-badge :value="item.Count" class="mark" v-if="item.Count>0"/>
             </span>
           </div>
         </div>
       </div>
       <div class="r-table">
         <div class="action-box">
-          <el-button size="small" type="default" @click="addFloor">添加楼层
+          <el-button @click="addFloor" size="small" type="default">添加楼层
           </el-button>
         </div>
         <div class="table-box">
-          <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle">
+          <el-table :data="tableData" :header-cell-style="headerStyle" height="100%" style="width: 100%"
+                    v-loading="loading">
             <el-table-column label="楼层本地名">
               <template slot-scope="scope">{{scope.row.FloorLocalName||scope.row.FloorName}}</template>
             </el-table-column>
@@ -34,35 +49,38 @@
             </el-table-column>
             <el-table-column label="楼层信息">
               <template slot-scope="scope">
-                <el-button size="mini" @click="editFloorData(scope.row)" plain icon="el-icon-edit-outline"></el-button>
+                <el-button @click="editFloorData(scope.row)" icon="el-icon-edit-outline" plain size="mini"></el-button>
               </template>
             </el-table-column>
-            <el-table-column prop="Datasource" label="平面图">
+            <el-table-column label="平面图" prop="Datasource">
               <template slot-scope="scope">
-                <p v-if="scope.row.Sign>0" @click="checkDrawImg(scope.row,2)">
+                <p @click="checkDrawImg(scope.row,2)" v-if="scope.row.Sign>0">
                   <el-badge is-dot>
-                    <i class="iconfont icon-floorplan" />
-                  </el-badge>平面图重复
+                    <i class="iconfont icon-floorplan"/>
+                  </el-badge>
+                  平面图重复
                 </p>
-                <p v-else-if="scope.row.StructureInfo?scope.row.StructureInfo.FloorMap:false" @click="checkDrawImg(scope.row,1)">
-                  <i class="iconfont icon-floorplan" />
+                <p @click="checkDrawImg(scope.row,1)"
+                   v-else-if="scope.row.StructureInfo?scope.row.StructureInfo.FloorMap:false">
+                  <i class="iconfont icon-floorplan"/>
                   查看平面图
                 </p>
-                <p v-else @click="checkDrawImg(scope.row,3)">
-                  <i class="iconfont icon-nopicture" />
+                <p @click="checkDrawImg(scope.row,3)" v-else>
+                  <i class="iconfont icon-nopicture"/>
                   暂无平面图
                 </p>
               </template>
             </el-table-column>
-            <el-table-column prop="SubTypeName" label="楼层贯通关系">
+            <el-table-column label="楼层贯通关系" prop="SubTypeName">
               <template slot-scope="scope">
-                <span style="margin-right:20px">{{scope.row.FloorThroughList?scope.row.FloorThroughList.length:0}}</span>
-                <el-button size="mini" @click="changeConnection(scope.row)" plain icon="el-icon-edit-outline" />
+                <span
+                  style="margin-right:20px">{{scope.row.FloorThroughList?scope.row.FloorThroughList.length:0}}</span>
+                <el-button @click="changeConnection(scope.row)" icon="el-icon-edit-outline" plain size="mini"/>
               </template>
             </el-table-column>
-            <el-table-column prop="action" label="操作">
+            <el-table-column label="操作" prop="action">
               <template slot-scope="scope">
-                <el-button size="mini" @click="handleDelete(scope.row)" type="danger" plain icon="el-icon-delete" />
+                <el-button @click="handleDelete(scope.row)" icon="el-icon-delete" plain size="mini" type="danger"/>
               </template>
             </el-table-column>
           </el-table>
@@ -70,279 +88,409 @@
       </div>
     </el-row>
     <!-- 添加-修改楼层 -->
-    <addFloor :title="floorTitle" ref="addFloorDialog" :curBuildId="curBuildId" :curFloorId="curFloorId" @refresh="refresh" />
-    <!-- 添加-修改建筑 -->
-    <addBuild :title="buildTitle" ref="addBuildDialog" />
+    <addFloor :curBuildId="curBuildId" :curFloorId="curFloorId" :title="floorTitle" @refresh="refresh"
+              ref="addFloorDialog"/>
+    <!-- 添加-修改建筑 :currentType="currentType"-->
+    <addBuild
+      :buildTitle="buildTitle"
+      ref="addBuildDialog"
+      :buildMessage="buildMessage"
+      @handleBuild="handleBuild"
+    />
     <!-- 删除建筑-删除楼层 -->
-    <el-dialog title="提示" :visible.sync="delDialogVis" width="20%" @close="handleClose" id="messageDialog">
+    <el-dialog :visible.sync="delDialogVis" @close="handleClose" id="messageDialog" title="提示" width="20%">
       <div>确定要删除该{{delText}}?</div>
-      <span slot="footer" class="dialog-footer">
-        <el-button size="small" @click="delDialogVis=false">取消</el-button>
-        <el-button size="small" type="primary" @click="confirmDel">确认</el-button>
+      <span class="dialog-footer" slot="footer">
+        <el-button @click="delDialogVis=false" size="small">取消</el-button>
+        <el-button @click="confirmDel" size="small" type="primary">确认</el-button>
       </span>
     </el-dialog>
     <!-- 添加贯通关系弹窗 -->
-    <addConnectivity ref="addConnectivity" @refresh="refresh" />
+    <addConnectivity @refresh="refresh" ref="addConnectivity"/>
     <!-- 查看图片弹窗 -->
-    <checkGraphy ref="checkGraphy" @refresh="refresh" :alreadyRelatedModel='alreadyRelatedModel'></checkGraphy>
+    <checkGraphy :alreadyRelatedModel='alreadyRelatedModel' @refresh="refresh" ref="checkGraphy"></checkGraphy>
   </div>
 
 </template>
 
 <script>
-import addFloor from "@/views/ready/buildfloor/addFloor/index";
-import addBuild from "@/components/ready/buildfloor/addBuild";
-import { mapGetters, mapActions } from "vuex";
-import addConnectivity from "@/components/ready/buildfloor/addConnectivity";
-import checkGraphy from "./drawGraphy/checkGraphy"; //查看图片
-import { buildingQueryAndCount, floorQueryAndSign, manageDeleteFloor } from "@/api/scan/request";
-export default {
-  components: {
-    addFloor,
-    addBuild,
-    addConnectivity,
-    checkGraphy
-  },
-  data() {
-    return {
-      repetitionGraphyVisible: false, // 替换平面图弹窗
-      floorTitle: "添加楼层",
-      buildTitle: "添加建筑",
-      delDialogVis: false,
-      delText: "建筑",
-      headerStyle: {
-        backgroundColor: "#d9d9d9",
-        color: "#2b2b2b",
-        lineHeight: "30px"
-      },
-      buildList: [],
-      tableData: [],
-      page: {
-        pageSize: 500,
-        pageSizes: [10, 20, 50, 100],
-        pageNumber: 1,
-        total: 0
-      },
-      loading: false, //列表loading
-      curBuildId: "", //当前选中的建筑id
-      curFloorId: "", //当前选中的楼层id
-      modelId: "",
-      alreadyRelatedModel: []
-    };
-  },
-  computed: {
-    ...mapGetters("layout", ["projectId"])
-  },
-  mounted() { },
-  created() {
-    this.init();
-  },
-  methods: {
-    init() {
-      let bdParam = {
-        Orders: "BuildLocalName asc",
-        PageNumber: 1,
-        PageSize: 500
-      };
-      buildingQueryAndCount(bdParam, res => {
-        this.buildList = res.Content;
-        if (this.buildList.length) {
-          this.changeBuild(0);
-        }
-      });
-    },
-    //change build
-    changeBuild(index) {
-      this.buildList.map(item => {
-        item.active = false;
-        return item;
-      });
-      this.buildList[index].active = true;
-      this.curBuildId = this.buildList[index].BuildID;
-      this.getFloorTableData();
-      this.$forceUpdate();
-    },
-    //add build
-    addBuild() {
-      this.$message.warning("开发中...");
-      return;
-      this.$refs.addBuildDialog.showDialog();
-    },
-    //delete build
-    delBuild() {
-      this.$message.warning("开发中...");
-      return;
-      this.delText = "建筑";
-      this.delDialogVis = true;
-    },
-    //edit build
-    editBuild() {
-      this.$message.warning("开发中...");
-      return;
-    },
-    //delete floor
-    handleDelete(floor) {
-      this.delText = "楼层";
-      this.delDialogVis = true;
-      this.curFloorId = floor.FloorID;
-    },
-    //确认删除弹窗关闭
-    handleClose() { },
-    addFloor() {
-      this.curFloorId = "";
-      this.$refs.addFloorDialog.showDialog();
+  import addFloor from "@/views/ready/buildfloor/addFloor/index";
+  import addBuild from "@/components/ready/buildfloor/addBuild";
+  import {mapGetters} from "vuex";
+  import addConnectivity from "@/components/ready/buildfloor/addConnectivity";
+  import checkGraphy from "./drawGraphy/checkGraphy"; //查看图片
+  import tools from "@/utils/buildfloor/tools";
+  import {
+    buildingQueryAndCount,
+    floorQueryAndSign,
+    getDataDictionary,
+    manageDeleteFloor,
+    objectCreateBuild,
+    objectDeleteBuild,
+    objectQueryBuild,
+    objectUpdateBuild
+  } from "@/api/scan/request";
+
+  export default {
+    components: {
+      addFloor,
+      addBuild,
+      addConnectivity,
+      checkGraphy
     },
-    // 获取列表
-    getFloorTableData() {
-      let floorParam = {
-        Cascade: [{ Name: "floorThroughList" }],
-        Orders: "FloorSequenceID desc",
-        PageNumber: this.page.pageNumber,
-        PageSize: this.page.pageSize,
-        Filters: `BuildID='${this.curBuildId}'`
+    data() {
+      return {
+        repetitionGraphyVisible: false, // 替换平面图弹窗
+        floorTitle: "添加楼层",
+        buildTitle: "添加建筑",
+        delDialogVis: false,
+        delText: "建筑",
+        headerStyle: {
+          backgroundColor: "#d9d9d9",
+          color: "#2b2b2b",
+          lineHeight: "30px"
+        },
+        buildList: [],
+        tableData: [],
+        page: {
+          pageSize: 500,
+          pageSizes: [10, 20, 50, 100],
+          pageNumber: 1,
+          total: 0
+        },
+        loading: false, //列表loading
+        curBuildId: "", //当前选中的建筑id
+        curFloorId: "", //当前选中的楼层id
+        modelId: "",
+        alreadyRelatedModel: [],
+        // currentType: 'add'
+        buildMessage: {},
       };
-      floorQueryAndSign(floorParam, res => {
-        this.tableData = res.Content;
-        this.page.total = res.Total;
-        this.alreadyRelatedModel = res.Content.map(t => {
-          return t.ModelId
-        }).filter(t => t);
-      });
     },
-    // 创建楼层成功-修改关系成功
-    refresh() {
-      this.getFloorTableData();
+    computed: {
+      ...mapGetters("layout", ["projectId"])
     },
-    // 确认删除(删除建筑-楼层公用)
-    confirmDel() {
-      if (this.delText == "楼层") {
-        let delParam = [{ FloorID: this.curFloorId }];
-        manageDeleteFloor(delParam, res => {
-          this.$message.success("删除成功");
-          this.delDialogVis = false;
-          this.getFloorTableData();
-        });
-      } else {
-        //todo
-      }
+    mounted() {
     },
-    // 修改楼层信息
-    editFloorData(floor) {
-      this.floorTitle = "编辑楼层信息";
-      this.curFloorId = floor.FloorID;
-      this.$refs.addFloorDialog.showDialog(floor);
+    created() {
+      this.init();
+      this.handleBuildQuery()
+      this.handleSearchBuildKey()
     },
-    // 修改楼层贯通关系
-    changeConnection(row) {
-      this.$refs.addConnectivity.showDialog();
-      this.$refs.addConnectivity.floor = row;
+    methods: {
+      init() {
+        let bdParam = {
+          Orders: "BuildLocalName asc",
+          PageNumber: 1,
+          PageSize: 500
+        };
+        buildingQueryAndCount(bdParam, res => {
+          this.buildList = res.Content;
+          if (this.buildList.length) {
+            this.changeBuild(0);
+          }
+        });
+      },
+      //change build
+      changeBuild(index) {
+        this.buildList.map(item => {
+          item.active = false;
+          return item;
+        });
+        this.buildList[index].active = true;
+        this.curBuildId = this.buildList[index].BuildID;
+        this.getFloorTableData();
+        this.$forceUpdate();
+      },
+      //add build
+      addBuild() {
+        // this.$message.warning("开发中...");
+        // return;
+        this.buildTitle = '添加建筑';
+        this.$refs.addBuildDialog.showDialog();
+        this.handleSearchBuildKey()
+      },
+      handleSearchBuildKey() {
+        let params = {
+          projectId: this.projectId,
+          data: {
+            Orders: "sort asc,InfoPointCode asc",
+            PageNumber: 1,
+            PageSize: 50
+          },
+          type: 'Building'
+        };
+        getDataDictionary(params, res => {
+          let first = {}
+          //一级循环出来一级标签
+          let list = res.Content.filter(i => (i.FirstName !== '工作历') && (i.FirstName !== '能耗信息') && (i.FirstName !== '人员信息'))
+          list.map(item => {
+            console.log(item.FirstName)
+            if ((item.InputMode === 'D1' || item.InputMode === 'D2' || item.InputMode === 'E2' || item.InputMode === 'D1L') && item.DataSource != undefined) {
+              item.options = JSON.parse(item.DataSource)
+            }
+            if (first[item.FirstName] && first[item.FirstName].length) {
+            } else {
+              first[item.FirstName] = []
+            }
+            if (
+              item.Path !== 'BuildingInfo.AreaInfo.AreaTree' &&
+              item.Path !== 'DefaultQRCode' &&
+              item.Path !== 'BuildQRCode'
+            ) {
+              first[item.FirstName].push({
+                InfoPointName: item.InfoPointName,
+                InfoPointCode: item.InfoPointCode,
+                Visible: item.Visible,
+                UnDisabled: item.UnDisabled,
+                SecondName: item.SecondName ? item.SecondName : "",
+                InputMode: item.InputMode,
+                options: item.options,
+                Unit: item.Unit,
+                Path: item.Path
+              })
+            }
+          })
+          this.buildMessage = first
+
+        })
+      },
+      //delete build ,根据id删除建筑信息
+      delBuild() {
+        this.delText = '建筑'
+        this.delDialogVis = true;
+      },
+      //edit build
+      editBuild() {
+        this.buildTitle = '编辑建筑';
+        this.handleSearchBuildKey()
+        let list = this.currentBuildList.filter(i => i.BuildID === this.curBuildId)
+        let obj = {}
+        for (let i = 0; i < list.length; i++) {
+          obj = list[i]
+        }
+        this.$refs.addBuildDialog.showDialog(obj);
+      },
+      handleFile(val,name) {
+      },
+      // handleBuild 获取建筑信息
+      handleBuild(val) {
+        let newform = tools.formatData(val)
+        let Param = {
+          Content: [newform]
+        }
+        if (newform.BuildID) {
+          objectUpdateBuild(Param, res => {
+            this.$message.success('更新成功')
+            this.$refs.addBuildDialog.closeDialog()
+          })
+        } else {
+          objectCreateBuild(Param, res => {
+            this.$message.success('创建成功')
+            this.$refs.addBuildDialog.closeDialog()
+          })
+        }
+        setTimeout(() => {
+          this.handleBuildQuery()
+          this.init()
+        })
+      },
+      //delete floor
+      handleDelete(floor) {
+        this.delText = "楼层";
+        this.delDialogVis = true;
+        this.curFloorId = floor.FloorID;
+      },
+      //确认删除弹窗关闭
+      handleClose() {
+      },
+      addFloor() {
+        this.curFloorId = "";
+        this.$refs.addFloorDialog.showDialog();
+      },
+      // 获取列表
+      getFloorTableData() {
+        let floorParam = {
+          Cascade: [{Name: "floorThroughList"}],
+          Orders: "FloorSequenceID desc",
+          PageNumber: this.page.pageNumber,
+          PageSize: this.page.pageSize,
+          Filters: `BuildID='${this.curBuildId}'`
+        };
+        floorQueryAndSign(floorParam, res => {
+          this.tableData = res.Content;
+          this.page.total = res.Total;
+          this.alreadyRelatedModel = res.Content.map(t => {
+            return t.ModelId
+          }).filter(t => t);
+        });
+      },
+      // 创建楼层成功-修改关系成功
+      refresh() {
+        this.getFloorTableData();
+      },
+      // 确认删除(删除建筑-楼层公用)
+      confirmDel() {
+        if (this.delText == "楼层") {
+          let delParam = [{FloorID: this.curFloorId}];
+          manageDeleteFloor(delParam, res => {
+            this.$message.success("删除成功");
+            this.delDialogVis = false;
+            this.getFloorTableData();
+          });
+        } else {
+          //todo
+          // 删除建筑
+          if (this.tableData && this.tableData.length) {
+            this.$message.error("当前建筑中包含楼层,不可删除");
+            this.delDialogVis = false;
+          } else {
+            let param = [{BuildId: this.curBuildId}];
+            objectDeleteBuild(param, res => {
+              setTimeout(() => {
+                this.handleBuildQuery()
+                this.init()
+              })
+              this.$message.success("删除成功");
+              this.delDialogVis = false;
+            })
+          }
+
+        }
+      },
+      // 修改楼层信息
+      editFloorData(floor) {
+        this.floorTitle = "编辑楼层信息";
+        this.curFloorId = floor.FloorID;
+        this.$refs.addFloorDialog.showDialog(floor);
+      },
+      // 修改楼层贯通关系
+      changeConnection(row) {
+        this.$refs.addConnectivity.showDialog();
+        this.$refs.addConnectivity.floor = row;
+      },
+      // 查看平面图
+      checkDrawImg(row, index) {
+        if (3 == index) {
+          this.$refs.checkGraphy.showDialog(row);
+          this.modelId = "";
+        } else {
+          this.modelId = row.ModelId;
+          let pa = {modelId: this.modelId, FloorID: row.FloorID, BuildID: row.BuildID};
+          this.$router.push({name: "repetitionGraphy", query: pa});
+        }
+      },
+      //  查询建筑信息
+      handleBuildQuery() {
+        let param = {
+          projectId: this.projectId,
+          Orders: "BuildLocalName asc",
+          PageNumber: 1,
+          PageSize: 500
+        };
+        objectQueryBuild(param, res => {
+
+          this.currentBuildList = res.Content
+        });
+      },
+
     },
-    // 查看平面图
-    checkDrawImg(row, index) {
-      if (3 == index) {
-        this.$refs.checkGraphy.showDialog(row)
-        this.modelId = "";
-      } else {
-        this.modelId = row.ModelId;
-        let pa = { modelId: this.modelId, FloorID: row.FloorID, BuildID: row.BuildID }
-        this.$router.push({ name: "repetitionGraphy", query: pa });
+    watch: {
+      projectId() {
+        this.init();
       }
     }
-  },
-  watch: {
-    projectId() {
-      this.init();
-    }
-  }
-};
+  };
 </script>
 <style lang="less" scoped>
-#bd-fl-manage {
-  overflow: hidden;
-  height: 100%;
-  position: relative;
-
-  .el-row {
+  #bd-fl-manage {
+    overflow: hidden;
     height: 100%;
+    position: relative;
 
-    .el-col-4 {
-      width: 17%;
-    }
-    .el-col-20 {
-      width: 82%;
-    }
-    & > div {
-      float: left;
+    .el-row {
       height: 100%;
-      overflow: hidden;
-      background-color: #fff;
-      box-sizing: border-box;
-      border: 1px solid #dfe6ec;
 
-      .action-box {
-        padding: 10px;
+      .el-col-4 {
+        width: 17%;
+      }
 
-        .el-button--small {
-          padding: 10px 11px;
-        }
+      .el-col-20 {
+        width: 82%;
       }
-    }
 
-    .l-list {
-      width: 17%;
-      overflow-y: auto;
+      & > div {
+        float: left;
+        height: 100%;
+        overflow: hidden;
+        background-color: #fff;
+        box-sizing: border-box;
+        border: 1px solid #dfe6ec;
 
-      h4 {
-        padding-left: 10px;
-        border-top: 1px solid #d9d9d9;
-        border-bottom: 1px solid #d9d9d9;
-        background: #d9d9d9;
-        color: #2b2b2b;
-        line-height: 44px;
+        .action-box {
+          padding: 10px;
+
+          .el-button--small {
+            padding: 10px 11px;
+          }
+        }
       }
 
-      .build-list {
-        line-height: 48px;
+      .l-list {
+        width: 17%;
+        overflow-y: auto;
+
+        h4 {
+          padding-left: 10px;
+          border-top: 1px solid #d9d9d9;
+          border-bottom: 1px solid #d9d9d9;
+          background: #d9d9d9;
+          color: #2b2b2b;
+          line-height: 44px;
+        }
+
+        .build-list {
+          line-height: 48px;
 
-        .floor-item {
-          white-space: nowrap;
-          overflow: hidden;
-          text-overflow: ellipsis;
+          .floor-item {
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
 
-          span {
-            margin-left: 10px;
+            span {
+              margin-left: 10px;
+            }
           }
-        }
 
-        .floor-item.active,
-        .floor-item:hover {
-          background-color: #f5f7fa;
-          color: #000;
+          .floor-item.active,
+          .floor-item:hover {
+            background-color: #f5f7fa;
+            color: #000;
+          }
         }
       }
-    }
 
-    .r-table {
-      width: 82%;
-      margin-left: 1%;
+      .r-table {
+        width: 82%;
+        margin-left: 1%;
 
-      .table-box {
-        height: calc(100% - 54px);
-        margin-bottom: 8px;
+        .table-box {
+          height: calc(100% - 54px);
+          margin-bottom: 8px;
 
-        .iconfont {
-          vertical-align: middle;
-        }
+          .iconfont {
+            vertical-align: middle;
+          }
 
-        /deep/ .el-badge__content.is-fixed {
-          transform: translateY(-6%) translateX(-100%);
-        }
+          /deep/ .el-badge__content.is-fixed {
+            transform: translateY(-6%) translateX(-100%);
+          }
 
-        p {
-          cursor: pointer;
+          p {
+            cursor: pointer;
+          }
         }
       }
     }
   }
-}
 </style>

+ 8 - 9
src/views/relation/overview/detail/index.vue

@@ -45,7 +45,7 @@
 <script>
 import {
   buildingQuery, //数据中心-建筑查询
-  queryZone, // 业务空间查询
+  zoneQuery, // 业务空间查询
   queryDictionaryHead, //空间类型查询
   createSpaceNeighborhood, //创建邻接关系
   querySpaceNeighborhood, // 查询邻接关系
@@ -287,19 +287,18 @@ export default {
     getBusinessSpace() {
       this.canvasLoading = true
       let pa = {
-        zone: this.zoneType,
-        data: {
-          Filters: ``,
-          Orders: "createTime desc, RoomID asc",
-          PageSize: 1000
-        }
+        Filters: `not RoomID isNull`,
+        Orders: "createTime desc, RoomID asc",
+        PageSize: 1000,
+        ZoneType: this.zoneType
       }
       if (this.buildFloor.length && this.buildFloor.length > 1) {
-        pa.data.Filters = `BuildingId='${this.buildFloor[0]}';FloorId='${this.buildFloor[1]}'`
+        pa.BuildingId = this.buildFloor[0];
+        pa.FloorId = this.buildFloor[1];
       } else {
         this.$message.warning("请选择建筑楼层");
       }
-      queryZone(pa, res => {
+      zoneQuery(pa, res => {
         // 所有业务空间
         this.businessSpaceList = res.Content;
         // 已关联元空间的业务空间

+ 266 - 162
src/views/relation/relationShip/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="relation-ship">
+  <div class="relation-ship" v-loading="loading">
     <section style="margin-top: 20px">
       <el-button
         style="padding: 10px"
@@ -23,14 +23,15 @@
       <el-row>
         <el-col :span="12">
           <p class="border-left-8">主对象
-            <span>限制条件:对象类型的范围(包括:XXXX类型,XXXX类型)</span></p>
+            <span>{{MainObject}}</span></p>
           <label>所属建筑楼层:</label>
-          <el-select v-model="buildValue">
+          <el-select disabled v-model="buildValue">
             <el-option
               v-for="item in options"
               :key="item.value"
               :label="item.label"
               :value="item.value"
+
             />
           </el-select>
           <label>类型:</label>
@@ -39,29 +40,33 @@
             :props="props"
             collapse-tags
             clearable
+            disabled
           />
           <el-input
             placeholder="请输入"
-            v-model="deviceName"
-            @keyup.enter.native="queryTable"
+            @keyup.enter.native="queryTable(1)"
+            v-model="mainValue"
+            style="margin-left: 5px"
+            class="min-margin"
           >
             <i
               slot="suffix"
               class="el-input__icon el-icon-search cursor"
-              @click="queryTable"
+              @click="queryTable(1)"
             />
           </el-input>
         </el-col>
         <el-col :span="12">
           <p class="border-left-8">从对象
-            <span>(包括:XXXX类型,XXXX类型)</span></p>
+            <span>{{FromObject}}</span></p>
           <label>所属建筑楼层:</label>
-          <el-select v-model="buildValue">
+          <el-select disabled v-model="buildValue">
             <el-option
               v-for="item in options"
               :key="item.value"
               :label="item.label"
               :value="item.value"
+
             />
           </el-select>
           <label>类型:</label>
@@ -70,16 +75,19 @@
             :props="props"
             collapse-tags
             clearable
+            disabled
           />
           <el-input
             placeholder="请输入"
-            v-model="deviceName"
-            @keyup.enter.native="queryTable"
+            @keyup.enter.native="queryTable(2)"
+            v-model="formValue"
+            style="margin-left: 5px"
+            class="min-margin"
           >
             <i
               slot="suffix"
               class="el-input__icon el-icon-search cursor"
-              @click="queryTable"
+              @click="queryTable(2)"
             />
           </el-input>
         </el-col>
@@ -87,42 +95,49 @@
 
     </section>
     <section class="table-list">
+      <!--              :span-method="objectSpanMethod"
+      -->
       <el-table
         :data="tableData"
         :span-method="objectSpanMethod"
-        border
-        :header-cell-style="{background:'#eef1f6',color:'#606266', lineHeight: '30px'}"
+        :header-cell-style="{background:'#e1e4e5',color:'#2b2b2b', lineHeight: '30px'}"
         :cell-style="cellStyle"
         class="table"
       >
         <el-table-column
-          prop="id"
+          prop="Name"
           label="全局名称"
           width="180"
-          align="center"
+          align="left"
+          min-width="100"
         >
         </el-table-column>
         <el-table-column
-          prop="name"
+          prop="LocalId"
           label="本地编码"
-          align="center"
+          align="left"
+          min-width="100"
         >
         </el-table-column>
         <el-table-column
-          prop="amount1"
+          prop="LocalName"
           label="本地名称"
-          align="center"
+          align="left"
+          min-width="100"
         >
         </el-table-column>
         <el-table-column
-          prop="amount2"
+          prop="CADID"
           label="CADID"
-          align="center"
+          align="left"
+          min-width="100"
         >
         </el-table-column>
         <el-table-column
           label="对象详情"
-          align="center"
+          prop="btn"
+          align="left"
+          min-width="90"
         >
           <template slot-scope="scope">
             <el-button
@@ -133,33 +148,34 @@
           </template>
         </el-table-column>
         <el-table-column
-          prop="ids"
+          class-name="td-bl"
+          prop="cName"
           label="全局名称"
           width="180"
-          align="center"
+          align="left"
         >
         </el-table-column>
         <el-table-column
-          prop="names"
-          align="center"
+          prop="cLocalId"
+          align="left"
           label="本地编码"
         >
         </el-table-column>
         <el-table-column
-          prop="amount11"
+          prop="cLocalName"
           label="本地名称"
-          align="center"
+          align="left"
         >
         </el-table-column>
         <el-table-column
-          prop="amount22"
+          prop="cCADID"
           label="CADID"
-          align="center"
+          align="left"
         >
         </el-table-column>
         <el-table-column
           label="对象详情"
-          align="center"
+          align="left"
         >
           <template slot-scope="scope">
             <el-button
@@ -171,18 +187,54 @@
         </el-table-column>
         <el-table-column
           label="操作"
-          align="center"
+          align="left"
         >
           <template slot-scope="scope">
-            <el-button
-              size="mini"
-              icon="el-icon-edit-outline"
-              @click="lookOver(scope.$index, scope.row)">
-            </el-button>
+            <!--            <el-popconfirm-->
+            <!--              title="确定删除吗?"-->
+            <!--              @onConfirm="deleteObject(scope.$index, scope.row)"-->
+            <!--            >-->
+            <!--              <el-button slot="reference" size="mini" icon="el-icon-delete"/>-->
+            <!--            </el-popconfirm>-->
+            <!--          </template>-->
+
+            <!--            <el-popover-->
+            <!--              placement="button"-->
+            <!--              width="160"-->
+            <!--              v-model="visible">-->
+            <!--              <p>确定删除吗?</p>-->
+            <!--              <div style="text-align: right; margin: 0">-->
+            <!--                <el-button size="mini" type="text" @click="visible = false">取消</el-button>-->
+            <!--                <el-button type="primary" size="mini" @click="deleteObject(scope.$index, scope.row)">确定</el-button>-->
+            <!--              </div>-->
+            <!--              <el-button slot="reference" size="mini" icon="el-icon-delete"/>-->
+            <!--            </el-popover>-->
+            <el-button slot="reference" size="mini" icon="el-icon-delete"
+                       @click="deleteObject(scope.$index, scope.row)"/>
           </template>
         </el-table-column>
       </el-table>
     </section>
+    <!-- 分页 -->
+    <!--    <el-pagination-->
+    <!--      @size-change="handleSizeChange"-->
+    <!--      @current-change="handleCurrentChange"-->
+    <!--      :current-page="currentPage"-->
+    <!--      :page-sizes="pageSizes"-->
+    <!--      :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"-->
+    <!--      style="float:right;margin-top:10px;padding:2px 5px;">-->
+    <!--    </el-pagination>-->
+    <el-dialog
+      title="提示"
+      :visible.sync="visible"
+      width="30%"
+    >
+      <span>确定删除吗?</span>
+      <span slot="footer" class="dialog-footer">
+    <el-button @click="visible = false">取 消</el-button>
+    <el-button type="primary" @click="confirmDelete">确 定</el-button>
+  </span>
+    </el-dialog>
     <exportExcel
       ref="export"
       :values="values"
@@ -190,6 +242,7 @@
     <addRelationShip
       ref="addShipComponent"
       :values="values"
+      @update="update"
     />
     <editRelationShip
       ref="editShipComponent"
@@ -199,18 +252,26 @@
 </template>
 
 <script>
-  import {mapActions, mapGetters, mapState} from 'vuex'
+  import {mapGetters} from 'vuex'
   import exportExcel from "../../../components/relation/relationShip/Modal/exportExcel";
   import addRelationShip from "../../../components/relation/relationShip/Modal/addRelationShip";
   import editRelationShip from "../../../components/relation/relationShip/Modal/editRelationShip";
+  import {relDelete, relQuery} from "../../../api/relation/api";
 
   export default {
     name: "index",
     data() {
       return {
+        visible: false,
+        MainObject: `(限制条件:对象类型的范围(包括:${localStorage.getItem('MainObject')}类型)`,
+        FromObject: `(限制条件:对象类型的范围(包括:${localStorage.getItem('FromObject')}类型)`,
+        pageSizes: [10, 20, 50, 100],
+        pageSize: 50,
+        currentPage: 1,
+        total: 0,
         values: {
           relation_maintenance: '关系维护',
-          optionTips: '请下载最新最新 xxxx 数据进行手动维护', //请下载最新最新 xxxx 数据进行手动维护
+          optionTips: `请下载最新最新<${localStorage.getItem('RelationTypeName')}>数据进行手动维护`, //请下载最新最新 xxxx 数据进行手动维护
           currentNum: '当前关系数量:',
           download: '下载模板(含数据)',
           lastTime: '最后更新时间为', //最后更新时间为
@@ -232,6 +293,8 @@
           cancel: '取消',
           delete: '删除关系'
         },
+        mainValue: '',
+        formValue: '',
         options: [
           {
             value: 'all',
@@ -276,92 +339,13 @@
             label: '新疆维吾尔族自治区',
           }]
         }],
-        deviceName: "",
-        tableData: [
-          {
-            id: '12987122',
-            name: '王小虎',
-            amount1: '234',
-            amount2: '3.2',
-            amount3: 10,
-            ids: '12987122',
-            names: '王小虎',
-            amount11: '234',
-            amount22: '3.2',
-          }, {
-            id: '12987122',
-            name: '王小虎',
-            amount1: '234',
-            amount2: '3.2',
-            amount3: 10,
-            ids: '12987122',
-            names: '王小虎',
-            amount11: '234',
-            amount22: '3.2',
-          }, {
-            id: '12987122',
-            name: '王小虎',
-            amount1: '234',
-            amount2: '3.2',
-            amount3: 10,
-            ids: '12987122',
-            names: '王小虎',
-            amount11: '234',
-            amount22: '3.2',
-          }, {
-            id: '12987122',
-            name: '王小虎',
-            amount1: '234',
-            amount2: '3.2',
-            amount3: 10,
-            ids: '12987122',
-            names: '王小虎',
-            amount11: '234',
-            amount22: '3.2',
-          }, {
-            id: '12987122',
-            name: '王小虎',
-            amount1: '234',
-            amount2: '3.2',
-            amount3: 10,
-            ids: '12987122',
-            names: '王小虎',
-            amount11: '234',
-            amount22: '3.2',
-          }, {
-            id: '129871225',
-            name: '王小虎',
-            amount1: '621',
-            amount2: '2.2',
-            amount3: 17,
-            ids: '12987125',
-            names: '王小虎',
-            amount11: '621',
-            amount22: '2.2',
-          },
-          {
-            id: '129871225',
-            name: '王小虎',
-            amount1: '621',
-            amount2: '2.2',
-            amount3: 17,
-            ids: '12987124',
-            names: '小虎',
-            amount11: '324',
-            amount22: '1.9',
-          }, {
-            id: '1298712w25',
-            name: '小虎',
-            amount1: '621',
-            amount2: '2.2',
-            amount3: 17,
-            ids: '12987125',
-            names: '小虎',
-            amount11: '621',
-            amount22: '2.2',
-          }],
-        spanArr: [], // 一个空的数组,用于存放每一行记录的合并数
-        pos: 0, // spanArr 的索引
+        tableData: [],
+        delParam: {},
+        loading: false,
+        needMergeArr: ['Name', 'LocalId', 'LocalName', 'CADID', 'btn'],
+        rowMergeArrs: {}
+        // needMergeArr: ['name', 'id'], // 有合并项的列
+        // rowMergeArrs: {}, // 包含需要一个或多个合并项信息的对象
       }
     },
     components: {exportExcel, addRelationShip, editRelationShip},
@@ -374,31 +358,138 @@
         path: '/relation/overview'
       },
         {
-          label: '设备控制关系',
+          label: localStorage.getItem('RelationTypeName'),
         },
       ])
+      this.init()
+    },
+    watch: {
+      projectId() {
+        this.init()
+      }
+    },
+    computed: {
+      ...mapGetters('layout', ["projectId"])
     },
     mounted() {
-      this.getSpanArr(this.tableData)
+      // this.getSpanArr(this.tableData)
+
+
     },
     methods: {
+      deepCopy(obj) {
+        return JSON.parse(JSON.stringify(obj))
+      },
+      init() {
+        this.loading = true
+        let data = {
+          projectId: this.projectId,
+          ObjectType: 1,
+          RelType: localStorage.getItem('RelManualType'),
+          PageSize: this.pageSize,
+          PageNumber: this.currentPage
+        };
+        relQuery(data, res => {
+          this.filterTable(res)
+          // this.total = res.Total
+          this.loading = false
+        })
+      },
+      filterTable(list) {
+        let arr = []
+        if(list.Content.length) {
+          list.Content.forEach(i => {
+            i.ObjectInfo && i.ObjectInfo.forEach(j => {
+              arr.push({
+                Name: i.Name,
+                LocalName: i.LocalName,
+                LocalId: i.LocalId,
+                CADID: i.CADID,
+                cName: j.Name,
+                cLocalName: j.LocalName,
+                cLocalId: j.LocalId,
+                cCADID: j.CADID,
+                Id: i.Id,
+                cId: j.Id
+              })
+            })
+          })
+          this.tableData = this.deepCopy(arr)
+          this.rowMergeArrs = this.rowMergeHandle(this.needMergeArr, this.tableData); // 处理数据
+        } else {
+          this.tableData = []
+        }
+
+
+      },
       back() {
         this.$router.go(-1)
       },
+
       addBtn() {
         this.$refs.addShipComponent.addShipDialog = true
       },
       excel() {
         this.$refs.export.dialogExport = true
       },
-      queryTable() {
+      queryTable(i) {
+        let param = {}, RelType = localStorage.getItem('RelManualType');
+        if (i === 1) {
+          param = {
+            ObjectType: 1,
+            RelType,
+            Vague: this.mainValue
+          }
+        } else {
+          param = {
+            ObjectType: 2,
+            RelType,
+            Vague: this.formValue
+          }
+        }
+        relQuery(param, res => {
+          this.filterTable(res)
+          console.log(res, '==object==')
+        })
+      },
+      //分页更换size
+      handleSizeChange(val) {
+        this.currentPage = 1;
+        this.pageSize = val;
+        this.init()
+      },
+      //分页更换页
+      handleCurrentChange(val) {
+        this.currentPage = val;
+        this.init()
+      },
+      update() {
+        this.init()
       },
-
       lookOver(index, row) {
+
         console.log(index, row)
-        this.$refs.editShipComponent.editShipDialog = true
-      },
 
+        // this.$refs.editShipComponent.editShipDialog = true
+      },
+      deleteObject(index, row) {
+        this.visible = true
+        this.delParam = {
+          "FromId": row.Id,
+          "RelType": localStorage.getItem('RelManualType'),
+          "ToId": row.cId
+        }
+        // relDelete(param, res => {
+        //   this.init()
+        // })
+      },
+      confirmDelete() {
+        relDelete(this.delParam, res => {
+          this.init()
+          this.visible = false
+          this.$message.success('删除成功')
+        })
+      },
       cellStyle({row, column, rowIndex, columnIndex}) {
         if (column.label === '全局名称') {
           return {
@@ -408,46 +499,57 @@
           }
         }
       },
-      getSpanArr(data) {
-        for (let i = 0; i < data.length; i++) {
-          if (i === 0) {
-            this.spanArr.push(1);
-            this.pos = 0;
 
-          } else {
-            if (
-              data[i].id === data[i - 1].id &&
-              data[i].name === data[i - 1].name &&
-              data[i].amount2 === data[i - 1].amount2 &&
-              data[i].amount1 === data[i - 1].amount1
-
-            ) {
-              this.spanArr[this.pos] += 1;
-              this.spanArr.push(0);
-            } else {
-              this.spanArr.push(1);
-              this.pos = i;
-            }
-          }
-        }
-      },
       objectSpanMethod({row, column, rowIndex, columnIndex}) {
-        if (columnIndex === 1 || columnIndex === 2 || columnIndex === 3) {
-          const _row = this.spanArr[rowIndex];
-          const _col = _row > 0 ? 1 : 0;
-          return {
-            rowspan: _row,
-            colspan: _col
-          };
-        }
-
+        if (column.property === 'Name') return this.mergeAction('Name', rowIndex, column);
+        if (column.property === 'LocalId' && row.LocalId != undefined) return this.mergeAction('LocalId', rowIndex, column);
+        if (column.property === 'LocalName' && row.LocalName != undefined) return this.mergeAction('LocalName', rowIndex, column);
+        if (column.property === 'CADID' && row.CADID != undefined) return this.mergeAction('CADID', rowIndex, column);
+        if (column.property === 'btn') return this.mergeAction('Name', rowIndex, column);
+      },
+      mergeAction(val, rowIndex, colData) {
+        let _row = this.rowMergeArrs[val].rowArr[rowIndex];
+        let _col = _row > 0 ? 1 : 0;
+        return [_row, _col];
       },
+      rowMergeHandle(arr, data) {
+        if (!Array.isArray(arr) && !arr.length) return false;
+        if (!Array.isArray(data) && !data.length) return false;
+        let needMerge = {};
+        arr.forEach(i => {
+          needMerge[i] = {
+            rowArr: [],
+            rowMergeNum: 0
+          };
+          data.forEach((item, index) => {
+            if (index === 0) {
+              needMerge[i].rowArr.push(1);
+              needMerge[i].rowMergeNum = 0;
+            } else {
+              if (item[i] === data[index - 1][i]) {
+                needMerge[i].rowArr[needMerge[i].rowMergeNum] += 1;
+                needMerge[i].rowArr.push(0);
+              } else {
+                needMerge[i].rowArr.push(1);
+                needMerge[i].rowMergeNum = index;
+              }
+            }
+          });
+        });
+        return needMerge;
+      }
     }
   }
 </script>
 
 <style scoped lang="less">
   .relation-ship {
+    @media screen and (max-width: 1500px) {
+      .min-margin{
+        margin-top: 10px;
+      }
+    }
+
     .cursor {
       cursor: pointer;
     }
@@ -459,6 +561,8 @@
     /deep/ .el-input {
       width: auto;
     }
+    /deep/.el-table__body-wrappe {
+    }
 
     .table-list {
       width: 100%;

+ 21 - 22
src/views/screen/splitscreen/integrateresults/index.vue

@@ -8,8 +8,8 @@
   <div>
     <div class='page-bar'>
       <el-breadcrumb separator='/'>
-      <el-breadcrumb-item>系统集成</el-breadcrumb-item>
-      <el-breadcrumb-item>系统集成成果管理</el-breadcrumb-item>                       
+        <el-breadcrumb-item>系统集成</el-breadcrumb-item>
+        <el-breadcrumb-item>系统集成成果管理</el-breadcrumb-item>
       </el-breadcrumb>
     </div>
     <div class="page-content">
@@ -24,7 +24,8 @@
       <div class="content-right" id="cadBox" v-loading="loading">
         <canvas v-show="drawCanvas" :height="cadHeight" :width="cadWidth" id="exampleCanvas" :k="refreshCanvas"></canvas>
         <div v-show="drawCanvas" class="operate">
-          <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @scale="scale" @saveJson="saveJson" :config="config" ref="canvasFun"></canvasFun>
+          <canvasFun @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @scale="scale" @saveJson="saveJson" :config="config" ref="canvasFun">
+          </canvasFun>
         </div>
         <div class="no-data" v-show="!drawCanvas">
           <div class="position-icon">
@@ -41,7 +42,7 @@
 import { SGraphyView } from "@saga-web/graphy/lib";
 import { LocationPointScene, DivideFloorScene } from "@saga-web/cad-engine";
 import { SColor } from "@saga-web/draw/lib";
-import { queryEquip, floorQuery, queryZone } from '@/api/scan/request';
+import { queryEquip, floorQuery, zoneQuery } from '@/api/scan/request';
 //组件
 import realtimeData from '@/components/screen/integrateresults/realtimeData';
 import exampleList from '@/components/screen/integrateresults/exampleList';
@@ -73,7 +74,7 @@ export default {
       },
     }
   },
-  methods:{
+  methods: {
     handleChangeExample(example) {
       this.drawCanvas = false;
       //存在实例ID
@@ -100,15 +101,13 @@ export default {
             }
           })
         } else if (example.TypeCode == 'Sp') {//空间
-          if(example.SubTypeCode) {
+          if (example.SubTypeCode) {
             let pa = {
-              data: {
-                Filters: `RoomID='${example.TypeCode + localStorage.getItem('projectId').substring(2) + example.ObjectID}'`
-              },
-              zone: example.SubTypeCode
+              Filters: `RoomID='${example.TypeCode + localStorage.getItem('projectId').substring(2) + example.ObjectID}'`,
+              ZoneType: example.SubTypeCode
             }
             //获取空间信息
-            queryZone(pa, zoneMsg => {
+            zoneQuery(pa, zoneMsg => {
               if (zoneMsg.Content[0] && zoneMsg.Content[0].Outline) {
                 let canvasOption = {
                   RoomLocalName: zoneMsg.Content[0].RoomLocalName,
@@ -168,7 +167,7 @@ export default {
             }
           })
         }
-        else{
+        else {
           this.loading = false;
           this.drawCanvas = false;
         }
@@ -204,7 +203,7 @@ export default {
     }
   },
   watch: {
-    $route(to,from){
+    $route(to, from) {
       this.queryParams = this.$route.query;
       this.ObjectLocalName = '';
       this.drawCanvas = false;
@@ -222,7 +221,7 @@ export default {
 
 <style lang="scss" scoped>
 $borderColor: rgba(201, 201, 201, 1);
-.page-bar{
+.page-bar {
   flex-grow: 0;
   flex-shrink: 0;
   height: 24px;
@@ -233,31 +232,31 @@ $borderColor: rgba(201, 201, 201, 1);
     font-size: 14px;
   }
 }
-.page-content{
+.page-content {
   display: flex;
   flex-grow: 1;
   flex-shrink: 1;
   flex-direction: row;
   justify-content: flex-start;
   overflow-y: auto;
-  .content-left{
+  .content-left {
     display: flex;
     flex-direction: column;
     justify-content: flex-start;
     width: 260px;
     margin-right: 15px;
-    .data-box{
+    .data-box {
       height: 140px;
       margin-bottom: 15px;
     }
-    .example-box{
+    .example-box {
       flex-grow: 1;
       flex-shrink: 1;
       height: calc(100% - 160px);
       border: 1px solid $borderColor;
     }
   }
-  .content-right{
+  .content-right {
     flex-grow: 1;
     flex-shrink: 1;
     border: 1px solid $borderColor;
@@ -270,16 +269,16 @@ $borderColor: rgba(201, 201, 201, 1);
       transform: translateX(-50%);
       z-index: 99;
     }
-    .no-data{
+    .no-data {
       height: 100%;
       text-align: center;
       box-sizing: border-box;
       position: relative;
-      .position-icon{
+      .position-icon {
         position: absolute;
         top: 50%;
         left: 50%;
-        transform: translate(-50%,-50%);
+        transform: translate(-50%, -50%);
       }
     }
   }

+ 6 - 8
src/views/screen/splitscreen/spaceledger/index.vue

@@ -101,7 +101,7 @@
 
 <script>
 import { mapGetters } from "vuex";
-import { queryZone, getAllbusiness, getDataDictionary, floorQuery, buildingQuery, BeatchQueryParam } from '@/api/scan/request'
+import { zoneQuery, getAllbusiness, getDataDictionary, floorQuery, buildingQuery, BeatchQueryParam } from '@/api/scan/request'
 import eqToSpaceTable from '@/components/business_space/newTables/eqToSpaceTable'
 import syInSpaceTable from '@/components/business_space/newTables/syInSpaceTable'
 import { DivideFloorScene, SpaceItem, ZoneItem, FloorView } from "@saga-web/cad-engine/lib";
@@ -162,12 +162,10 @@ export default {
       this.params = this.$route.query;
       // 获取空间数据
       let params = {
-        data: {
-          Filters: `RoomID="${this.$route.query.RoomID}"`
-        },
-        zone: this.$route.query.zone
+        Filters: `RoomID="${this.$route.query.RoomID}"`,
+        ZoneType: this.$route.query.zone
       }
-      queryZone(params, res => {
+      zoneQuery(params, res => {
         this.spaceDetails = res.Content[0];
         if (this.spaceDetails.Outline && this.spaceDetails.Outline[0] && this.spaceDetails.Outline[0].length) {
           this.getSpaceFloor();
@@ -407,10 +405,10 @@ export default {
   overflow-x: hidden !important;
   overflow-y: auto !important;
 }
-.objectRelationship{
+.objectRelationship {
   height: calc(100% - 46px) !important;
 }
-/deep/ .el-tabs__content{
+/deep/ .el-tabs__content {
   height: 100%;
 }
 </style>