فهرست منبع

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

zhangyu 5 سال پیش
والد
کامیت
f7a17cd68a

+ 1 - 1
package.json

@@ -33,7 +33,7 @@
     "@saga-web/base": "2.1.9",
     "@saga-web/draw": "2.1.74",
     "@saga-web/graphy": "2.1.39",
-    "@saga-web/cad-engine": "2.0.532"
+    "@saga-web/cad-engine": "2.0.536"
   },
   "devDependencies": {
     "ajv": "^6.9.1",

+ 6 - 1
src/components/business_space/lib/uploadFiles.vue

@@ -145,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 () {
           // 这个事件在读取成功结束后触发
         };

+ 7 - 0
src/components/business_space/lib/uploadImgsName.vue

@@ -339,14 +339,21 @@
 </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>

+ 170 - 153
src/components/business_space/newGraphy/graphy.vue

@@ -367,7 +367,7 @@ export default {
       })
     },
     // 获取当前分区下的业务空间
-    getBusinessSpace(other) {
+    getBusinessSpace() {
       this.canvasLoading = true
       let ObjectType = this.tab.code == 'OtherZone' ? this.OtherValue : this.tab.code;
       let pa = {
@@ -451,6 +451,7 @@ export default {
       this.scene.isSpaceSelectable = true;
       // 设置业务空间不可选
       this.scene.isZoneSelectable = false
+      this.view._needDraw = true;
     },
     // 查看未关联的业务空间--flag--查看-or-选择
     lookUnrelatBSpace(flag) {
@@ -565,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;
@@ -753,7 +754,7 @@ export default {
       let selectSpace = this.scene.getSelectedSpaces();
       let selectLikeSpace = this.scene.getSelectedLikeSpace();
       //更新业务空间
-      let zoneObj = { Outline: [], Height: 0, State: this.confirmAndSaveFlag ? 0 : this.curZoneItem.Infected ? 1 : 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);
@@ -802,117 +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;
-          })
-        }
-        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)
+        // 如果有划分,求交集
+        // 格式为Poly(先与业务空间求差集)
+        const obj = this.scene.getZoneDifference(true);
+        // 差集与楼层平面图或用户划分区域求交集
+        spaces = this.scene.getPloyIntersect(obj)
       } 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]);
-              }
+        // 格式为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
             }
-            area = (area / 1000000).toFixed(2);
-            if (area < (this.areaValue / 100)) {
-              return undefined;
+          })
+          zoneObj.Outline.push([temp]);
+        })
+        if (!zoneObj.Outline.length) {
+          continue
+        }
+        //计算面积
+        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]);
             }
           }
-          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);
+        }
+        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)

+ 28 - 38
src/components/ready/buildfloor/addBuild.vue

@@ -8,40 +8,39 @@
     <el-form
       :inline="true"
       :model="form"
-      label-width="135px"
+      label-width="125px"
       :rules="rules"
       ref="ruleForm"
     >
       <template v-for="(val,key) in buildMessage">
         <h4>{{key}}</h4>
 
-        <span
+        <div
           :key="item.InfoPointCode"
           v-for="item in val"
-          :class="[{'upload-file':item.InputMode == 'F2'}]"
-        >
-        <el-form-item
-          :class="{FloorTypeSelect:item.InputMode == 'D1'||item.Unit}"
-          :label="item.InfoPointName"
-          :prop="item.InfoPointCode"
-          v-if="all||item.Visible"
+          :class="[{'upload-file':item.InputMode == 'F2' ||  item.Path === 'BuildingInfo.BuildingType.Pic'}]"
+          style="width: 50%;display: inline-block"
+
         >
-        <span v-if="item.InputMode == 'B1' || item.InputMode == 'B2'">
+          <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]"
-              :placeholder="(item.InputMode === 'B1' && item.InfoPointCode==='BuildLocalID') ? '填写示例:F1、B1?':'' "
+              v-if="item.InputMode == 'B1' || item.InputMode == 'B2'"
             />
-           <div
-             v-if="item.InputMode === 'B1' && item.InfoPointCode==='BuildLocalID' && isShowTitle"
-             style="color: gray;font-size: 12px"
-           >用于楼层平面图切换</div>
 
-        </span>
 
-          <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
+            <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]"
@@ -74,6 +73,7 @@
                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'"
@@ -106,11 +106,11 @@
                :context-key="item.Path"
                @change="changeItem"
              />
-          <el-input disabled title="暂不支持" v-else v-model="form[item.Path]"></el-input>
-        </el-form-item>
-      </span>
-      </template>
+            <el-input disabled title="暂不支持" v-else v-model="form[item.Path]"/>
 
+          </el-form-item>
+        </div>
+      </template>
     </el-form>
     <span
       class="dialog-footer"
@@ -153,15 +153,7 @@
 
   export default {
     data() {
-      let validateId = (rule,value,callback) => {
-        if (!value) {
-          this.isShowTitle = false
-          return callback(new Error('请输入建筑本地编码'));
-        } else{
-          this.isShowTitle = true
-          callback()
-        }
-      }
+
       return {
         buildName: '',
         keysArr: [], //保存临时的文件key
@@ -172,15 +164,13 @@
         all: true,
         rules: {
           "BuildLocalID": [
-            // {"required": true, "message": "请输入建筑本地编码", "trigger": "blur"}
-            {validator:validateId,trigger:'blur'}
+            {"required": true, "message": "请输入建筑本地编码", "trigger": "blur"}
           ],
           "BuildLocalName": [
             {"required": true, "message": "请输入建筑本地名称", "trigger": "blur"}
           ]
         },
         buildData: {},
-        isShowTitle:true,
       }
     },
     components: {uploadFiles, uploadImgs},
@@ -282,8 +272,8 @@
     }
 
     .upload-file {
-      width: 100%;
-      display: block;
+      width: 100% !important;
+      display: block !important;
     }
   }
 </style>

+ 89 - 56
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>
+      <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 {

+ 43 - 45
src/views/ledger/spacelist/index.vue

@@ -12,8 +12,8 @@
           <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 }">
-              <i class="el-icon-warning-outline" v-if="data.Count" style="color:red;margin-right:10px;"></i>
               <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>
@@ -48,7 +48,7 @@
         <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()}}个,本层受影响的业务空间{{infectedCurfloor.toString()}}个</p>
+        <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;">
@@ -61,48 +61,48 @@
   </div>
 </template>
 <script>
-  // import noModelDialog from "@/components/business_space/dialogs/noModelDialog";
-  // import influenceDialog from "@/components/business_space/dialogs/influenceDialog";
-  // import detailsDialog from "@/components/business_space/dialogs/detailsDialog";
-  // import notRelated from "@/components/business_space/dialogs/notRelated";
-  // import facilityDialog from "@/components/business_space/dialogs/facilityDialog";
-  // import graphy from "@/components/business_space/graphy/business";
-  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,
-    getrelationTypeProject,
-    getSpaceBdFlCount,
-    queryAllZoneType,
-    queryBFloorWithState,
-    zoneQuery
-  } from "@/api/scan/request";
-  import floorCascader from "@/components/ledger/lib/floorCascader";
-  import {mapGetters} from "vuex";
+// import noModelDialog from "@/components/business_space/dialogs/noModelDialog";
+// import influenceDialog from "@/components/business_space/dialogs/influenceDialog";
+// import detailsDialog from "@/components/business_space/dialogs/detailsDialog";
+// import notRelated from "@/components/business_space/dialogs/notRelated";
+// import facilityDialog from "@/components/business_space/dialogs/facilityDialog";
+// import graphy from "@/components/business_space/graphy/business";
+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,
+  getrelationTypeProject,
+  getSpaceBdFlCount,
+  queryAllZoneType,
+  queryBFloorWithState,
+  zoneQuery
+} from "@/api/scan/request";
+import floorCascader from "@/components/ledger/lib/floorCascader";
+import { mapGetters } from "vuex";
 
-  export default {
-    components: {
-      graphy,
-      handsontableMain,
-      roomInFloorDialog,
-      floorCascader,
-    },
-    computed: {
-      ...mapGetters('layout', ['projectId', 'userId', 'secret'])
-    },
-    data() {
-      return {
-        floor: {
-          influence: false, //受影响的业务空间弹窗
-          details: false, //详情弹窗
-          notRelated: false,
-          facility: false
-        },
-        param: {
-          ProjId: this.projectId, //项目id
-          UserId: this.userId, //用户id
+export default {
+  components: {
+    graphy,
+    handsontableMain,
+    roomInFloorDialog,
+    floorCascader,
+  },
+  computed: {
+    ...mapGetters('layout', ['projectId', 'userId', 'secret'])
+  },
+  data() {
+    return {
+      floor: {
+        influence: false, //受影响的业务空间弹窗
+        details: false, //详情弹窗
+        notRelated: false,
+        facility: false
+      },
+      param: {
+        ProjId: this.projectId, //项目id
+        UserId: this.userId, //用户id
         secret: this.secret
       },
       buildMess: {
@@ -334,8 +334,6 @@
     // },
     // 触发获取表头-获取初始化信息点
     initMessage() {
-  // this.inquireZone()
-      //
       let params = {
         data: {
           Orders: "sort asc",

+ 54 - 49
src/views/ready/buildfloor/index.vue

@@ -5,24 +5,26 @@
         <div class="action-box">
           <div>
             <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-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 :class="{'floor-item':true,active:item.active}" :key="item.BuildID" @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}}
@@ -163,7 +165,6 @@
         alreadyRelatedModel: [],
         // currentType: 'add'
         buildMessage: {},
-        visible: false,
       };
     },
     computed: {
@@ -220,33 +221,35 @@
           type: 'Building'
         };
         getDataDictionary(params, res => {
-          // let list = res.Content.map(item => {
-          //   if (item.InputMode === 'D1' && item.DataSource != undefined) {
-          //     item.options = JSON.parse(item.DataSource)
-          //   }
-          //   return item
-          // })
           let first = {}
           //一级循环出来一级标签
-          res.Content.map(item => {
-            if ((item.InputMode === 'D1' || item.InputMode === 'D2'  || item.InputMode === 'E2'|| item.InputMode === 'D1L') && item.DataSource != undefined) {
+          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] = []
             }
-            first[item.FirstName].push({
-              InfoPointName: item.InfoPointName,
-              InfoPointCode: item.InfoPointCode,
-              Visible: item.Visible,
-              UnDisabled: item.UnDisabled,
-              SecondName: item.SecondName ? item.SecondName : "",
-              Path: item.Path,
-              InputMode: item.InputMode,
-              options: item.options,
-              Unit: item.Unit
-            })
+            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
 
@@ -254,18 +257,8 @@
       },
       //delete build ,根据id删除建筑信息
       delBuild() {
-        // this.$message.warning("开发中...");
-        // return;
-
-        let param = [{BuildId: this.curBuildId}];
-        objectDeleteBuild(param, res => {
-          setTimeout(() => {
-            this.handleBuildQuery()
-            this.init()
-          })
-          this.visible = false
-          this.$message.success("删除成功");
-        })
+        this.delText = '建筑'
+        this.delDialogVis = true;
       },
       //edit build
       editBuild() {
@@ -276,11 +269,7 @@
         for (let i = 0; i < list.length; i++) {
           obj = list[i]
         }
-
-
-
         this.$refs.addBuildDialog.showDialog(obj);
-
       },
       handleFile(val,name) {
       },
@@ -351,6 +340,22 @@
           });
         } 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;
+            })
+          }
+
         }
       },
       // 修改楼层信息