Prechádzať zdrojové kódy

Merge branch 'msg-sever' into dev

haojianlong 5 rokov pred
rodič
commit
47d98c0e1d

+ 6 - 0
src/api/scan/request.js

@@ -183,6 +183,12 @@ export function updateLocationPoint(param, success) {
     http.postJson(url, param, success)
 }
 
+//根据点位标签推荐业务空间
+export function zoneQueryByPoint(param, success) {
+    let url = `${baseUrl}/equip-component/space/in-bdfl-zonespacebase?X=${param.X}&Y=${param.Y}`;
+    http.postJson(url, param.data, success)
+}
+
 //扫楼作业-位置标签-删除图片
 export function deleteLocationImg(param, success) {
     let url = `${baseUrl}/datacenter/location-point/delete-image`;

+ 2 - 1
src/components/business_space/newAddDialogs/addEquipDialog.vue

@@ -139,6 +139,7 @@ export default {
           Filters: '',
           PageNumber: this.page.pageNumber,
           PageSize: this.page.pageSize,
+          Orders: 'EquipID asc'
         },
         type: this.zone,
         spaceId: this.spaceId
@@ -157,7 +158,7 @@ export default {
         pa.data.Filters += `;EquipName contain "${this.keycode}" or EquipLocalName contain "${this.keycode}" or EquipLocalID contain "${this.keycode}"`
       }
       // 删除首尾分号
-      pa.data.Filters = pa.data.Filters.replace(/(^;)|(;$)/g,'');
+      pa.data.Filters = pa.data.Filters.replace(/(^;)|(;$)/g, '');
       if (pa.data.Filters == '') {
         delete pa.data.Filters
       }

+ 1 - 0
src/components/business_space/newAddDialogs/addSystemDialog.vue

@@ -87,6 +87,7 @@ export default {
       let pa = {
         data: {
           PageSize: 200,
+          Orders: 'SysID asc'
         },
         type: this.zone,
         spaceId: this.spaceId

+ 1 - 1
src/components/business_space/newGraphy/graphy.vue

@@ -729,7 +729,7 @@ export default {
     },
     // 清除canvas
     clearGraphy() {
-      if (this.view && this.view.scene) {
+      if (this.view) {
         this.view.scene = null;
         return
       }

+ 1 - 1
src/components/business_space/newGraphy/unRelateBSP.vue

@@ -123,7 +123,7 @@ export default {
           t.Floor.unshift({ BuildID: 'all', BuildLocalName: '全部' }, { BuildID: 'isNull', BuildLocalName: '未明确楼层' })
           return t;
         })
-        this.options.unshift({ BuildID: 'all', BuildLocalName: '全部' }, { BuildID: 'isNull', BuildLocalName: '未明确楼层' })
+        this.options.unshift({ BuildID: 'all', BuildLocalName: '全部' }, { BuildID: 'isNull', BuildLocalName: '未明确建筑' })
       })
     },
     // 查询未关联平面图的业务空间(项目下+当前分区)

+ 1 - 1
src/components/business_space/newTables/eqToSpaceTable.vue

@@ -150,7 +150,7 @@ export default {
     },
     // 添加设备
     add() {
-      this.$refs.addEqDialog.floor = [this.params.BuildingId, this.params.FloorId];
+      this.$refs.addEqDialog.floor = this.params.buildFloorSelectd;
       this.$refs.addEqDialog.showDialog()
     }
   },

+ 65 - 25
src/views/data_admin/buildGraphy/createPointZone.vue

@@ -3,16 +3,16 @@
     <div class="condition">
       <div class="header">
         <el-button style="float:left;" size="small" type="default" icon="el-icon-back" @click="goBack"></el-button>
-        <el-button size="small" style="float:right" @click="createZone">创建</el-button>
+        <el-button size="small" style="float:right" @click="createZ">创建</el-button>
       </div>
       <el-scrollbar style="height:calc(100% - 43px)">
         <div class="item">
           <span>基本信息:</span>
           <div>
             <label><span style="color:red;">*</span>业务空间名称</label>
-            <el-input placeholder="请输入业务空间名称" v-model="zoneObj.RoomLocalName" clearable style="width:215px;margin-right:10px;"></el-input>
+            <el-input placeholder="请输入业务空间名称" v-model="RoomLocalName" clearable style="width:215px;margin-right:10px;"></el-input>
             <label>业务空间编码</label>
-            <el-input placeholder="请输入业务空间编码" v-model="zoneObj.RoomLocalID" clearable style="width:215px;margin-right:10px;"></el-input>
+            <el-input placeholder="请输入业务空间编码" v-model="RoomLocalID" clearable style="width:215px;margin-right:10px;"></el-input>
           </div>
           <div>
             <label><span style="color:red;">*</span>所属建筑楼层</label>
@@ -31,17 +31,18 @@
             @click="showEx = (showEx == 'el-icon-arrow-up' ? 'el-icon-arrow-down' : 'el-icon-arrow-up')"></i>
           <div v-show="showEx == 'el-icon-arrow-up'" v-loading="loadingOtherMsg">
             <div v-if="otherList.length">
-            <div class="suppMsg" v-for="(item, key) in otherList" :key="key" >
-              <label>{{item.InfoPointName}}:</label>
-              <el-input :placeholder="`请输入${item.InfoPointName}`" v-model="otherMsg[item.InfoPointCode]" clearable style="width:215px;margin-right:10px;"></el-input>
-            </div>
+              <div class="suppMsg" v-for="(item, key) in otherList" :key="key">
+                <label>{{item.InfoPointName}}:</label>
+                <el-input :placeholder="`请输入${item.InfoPointName}`" v-model="item.inputValue" clearable style="width:215px;margin-right:10px;">
+                </el-input>
+              </div>
             </div>
             <p v-else>请选择业务空间类型</p>
           </div>
         </div>
         <div class="item">
           <p>位置标签图片信息:</p>
-          <locationPointMsg :pointObj="$route.params.item"></locationPointMsg>
+          <locationPointMsg ref="pointMsg" :pointObj="$route.params.item"></locationPointMsg>
         </div>
       </el-scrollbar>
     </div>
@@ -50,7 +51,7 @@
 
 <script>
 import locationPointMsg from '@/views/data_admin/buildGraphy/locationPointMsg'
-import { queryDictionaryHead, getDataDictionary } from '@/api/scan/request';
+import { queryDictionaryHead, getDataDictionary, createZone } from '@/api/scan/request';
 import { mapGetters } from 'vuex'
 export default {
   data() {
@@ -67,15 +68,11 @@ export default {
       zoneName: '',//业务空间名称
       zoneLocalId: '',//业务空间编码
       showEx: 'el-icon-arrow-down',//下拉菜单
-      zoneObj: {
-        RoomLocalID: '',//业务空间本地编码
-        RoomLocalName:'',//业务空间名称
-      },
-      otherMsg:{//其他可补充信息
-
-      },
-      otherList:[],//可补充信息list
-      loadingOtherMsg:false,
+      RoomLocalID: '',//业务空间本地编码
+      RoomLocalName: '',//业务空间名称
+      otherList: [],//可补充信息list
+      loadingOtherMsg: false,
+      test: '1'
     }
   },
   computed: {
@@ -93,10 +90,52 @@ export default {
   },
   methods: {
     //创建
-    createZone() {
+    createZ() {
       let param = {
-
+        zone: '',
+        data: {
+          content: []
+        }
+      }
+      let reqData = {
+        Pic: {}
+      };
+      //图片信息
+      this.$refs.pointMsg.choImg.map((item,key) => {
+        reqData.Pic[`additionalProp${key + 1}`] = item;
+      })
+      //其他补充信息
+      this.otherList.map(item => {
+        if (item.inputValue) {
+          reqData[item.InfoPointCode] = item.inputValue;
+        }
+      });
+      if (this.RoomLocalName && this.buildFloor.length && this.space) {
+        reqData.RoomLocalName = this.RoomLocalName;
+        reqData.RoomLocalID = this.RoomLocalID;
+        reqData.BuildingId = this.buildFloor[0];
+        reqData.FloorId = this.buildFloor[1];
+        param.zone = this.space;
+        param.data.content = [reqData];
+        createZone(param, res => {
+          this.$message.success("创建成功");
+          this.RoomLocalName = ''
+          this.RoomLocalID = ''
+          this.buildFloor = []
+          this.space = ''
+          
+        })
+      }
+      else if (!this.RoomLocalName) {
+        this.$message("请输入业务空间名称");
       }
+      else if (!this.buildFloor.length) {
+        this.$message("请选择所属建筑楼层");
+      }
+      else {
+        this.$message("请选择业务空间类型");
+      }
+      console.log(param);
     },
     //获取空间列表
     getSpaceList() {
@@ -109,7 +148,7 @@ export default {
     },
     //选择楼层
     changeFloor(val) {
-
+      this.buildFloor = val;
     },
     //选择业务空间
     changeSpace(val) {
@@ -123,11 +162,12 @@ export default {
       this.loadingOtherMsg = true;
       getDataDictionary(pa, res => {
         this.loadingOtherMsg = false;
-        this.otherMsg = {}
+        let filterCode = ["RoomLocalID", "RoomLocalName"]
+        res.Content = res.Content.filter(item => {
+          item.inputValue = null;
+          return filterCode.indexOf(item.InfoPointCode) == -1
+        });
         this.otherList = res.Content;
-        res.Content.map(item => {
-          this.otherMsg[item.InfoPointCode] = '';
-        })
       })
     },
     //返回

+ 1 - 1
src/views/data_admin/buildGraphy/graphyTabs.vue

@@ -262,7 +262,7 @@ export default {
       }).then(() => {
         this.$emit("closeCanvas")
         this.$router.push({
-          name: 'updateLocationPointZone',
+          name: 'updatePointZone',
           params: { item: item, floorData: this.floorOption, nowBuildFloor: this.buildingData }
         })
       }).catch(action => {

+ 2 - 8
src/views/data_admin/buildGraphy/locationPointMsg.vue

@@ -23,7 +23,6 @@
 </template>
 
 <script>
-const cityOptions = ['上海', '北京', '广州', '深圳'];
 export default {
   data() {
     return {
@@ -43,18 +42,13 @@ export default {
     handleCheckAllChange(val) {
       this.choImg = val ? this.pointObj.ImageList : [];
       this.isIndeterminate = false;
-
     },
     //选中
     handleCheckedCitiesChange(value) {
       let checkedCount = value.length;
-      this.checkAll = checkedCount === this.pointObj.ImageList.length && this.pointObj.ImageList;
-      this.isIndeterminate = checkedCount > 0 && checkedCount < this.pointObj.ImageList.length && this.pointObj.ImageList;
+      this.checkAll = checkedCount === this.pointObj.ImageList.length;
+      this.isIndeterminate = checkedCount > 0 && checkedCount < this.pointObj.ImageList.length;
     },
-    //获取选中的图片
-    getChoImg(){
-      return this.choImg;
-    }
   }
 }
 </script>

+ 156 - 36
src/views/data_admin/buildGraphy/updatePointZone.vue

@@ -3,17 +3,26 @@
     <div class="condition">
       <div class="header">
         <el-button style="float:left;" size="small" type="default" icon="el-icon-back" @click="goBack"></el-button>
-        <el-button size="small" style="float:right" @click="createZone">更新</el-button>
+        <el-button size="small" style="float:right" @click="updateZ">更新</el-button>
       </div>
       <el-scrollbar style="height:calc(100% - 43px)">
         <div class="item">
-          <span>将位置标签图片批量补充到业务空间:</span>
-          <div>
+          <p>将位置标签图片批量补充到业务空间:</p>
+          <div v-for="item in zoneList" :key="item.objid" class="zone-item">
+            <el-tooltip class="item" effect="light" :content="item.RoomLocalName || item.RoomName" placement="top">
+              <p>{{item.RoomLocalName || item.RoomName}}</p>
+            </el-tooltip>
+            <el-button type="info" icon="el-icon-delete" circle style="float:right;" size="mini" @click="deleteZone(item.RoomID)"></el-button>
+          </div>
+          <div class="zone-item" style="border:none;">
+            <el-cascader :props="zoneCascader" :show-all-levels="false" v-model="zoneCa" @change="changeCascader" filterable style="float:left;">
+            </el-cascader>
+            <el-button type="primary" icon="el-icon-plus" circle style="float:right;" size="mini" @click="addZone"></el-button>
           </div>
         </div>
         <div class="item">
           <p>位置标签图片信息:</p>
-          <locationPointMsg :pointObj="$route.params.item"></locationPointMsg>
+          <locationPointMsg :pointObj="$route.params.item" ref="pointMsg"></locationPointMsg>
         </div>
       </el-scrollbar>
     </div>
@@ -22,65 +31,163 @@
 
 <script>
 import locationPointMsg from '@/views/data_admin/buildGraphy/locationPointMsg'
-import { queryDictionaryHead } from '@/api/scan/request';
+import { queryDictionaryHead, zoneQueryByPoint, queryZone } from '@/api/scan/request';
 import { mapGetters } from 'vuex'
 export default {
   data() {
+    let that = this;
     return {
-      floorProps: {
-        value: 'BuildID',
-        label: 'BuildLocalName',
-        children: 'Floor'
+      zoneList: [],//业务空间列表
+      pointItem: {},//点位标签对象
+      zoneTypeList: [],//业务空间类型
+      zoneCascader: {//业务空间忌廉器
+        lazy: true,
+        lazyLoad(node, resolve) {
+          const { level } = node;
+          that.getCascaderNode(level, node, resolve);
+        }
       },
-      options: [],//建筑楼层
-      spaceList: [],//空间列表
-      space: '',//当前空间
-      buildFloor: [],//建筑楼层信息
-      zoneName: '',//业务空间名称
-      zoneLocalId: '',//业务空间编码
-      showEx: 'el-icon-arrow-down',//下拉菜单
+      newZoneObj: {},//当前新建业务空间
+      zoneCa: []
     }
   },
   computed: {
     ...mapGetters("layout", ["projectId"])
   },
-  props: {
-
-  },
   components: {
     locationPointMsg
   },
   created() {
-    this.options = this.$route.params.floorData
+    this.pointItem = this.$route.params.item
     this.getSpaceList();
-    console.log(this.$route.params.item)
-    console.log(this.$route.params.floorData)
   },
   methods: {
     //创建
-    createZone(){
-      let param = {
-
+    updateZ() {
+      console.log(this.zoneList);
+      if (this.$refs.pointMsg.choImg.length && this.zoneList.length) {
+        let imgs = {};
+        this.$refs.pointMsg.choImg.map((item, key) => {
+          imgs[`additionalProp${key + 1}`] = item;
+        })
+        this.zoneList.map(item => {
+          item.Pic = imgs;
+        })
+        let param = {
+          data: {
+            content: this.zoneList
+          }
+        }
+      }
+      else if (!this.$refs.pointMsg.choImg.length) {
+        this.$message("请至少选择一张图片");
       }
+      else {
+        this.$message("请至少添加一个业务空间");
+      }
+
     },
     //获取空间列表
     getSpaceList() {
       let pa = {
-        Filters: `parentId='Space'`
+        X: this.pointItem.X,
+        Y: this.pointItem.Y,
+        data: { Filters: `buildingId = '${this.pointItem.BuildId}' and floorId = '${this.pointItem.FloorId}'` }
       }
-      queryDictionaryHead(pa, res => {
-        this.spaceList = res.Content.filter((item => { return item.Name != '元空间' }));
+      zoneQueryByPoint(pa, res => {
+        this.zoneList = res.Content;
       });
     },
-    //选择楼层
-    changeFloor(val) {
-
+    //级联node
+    getCascaderNode(level, node, resolve) {
+      let id = (level + 1) * 10;
+      //建筑
+      if (level == 0) {
+        let nodes = this.$route.params.floorData.map(item => ({
+          value: item.BuildID,
+          label: item.BuildLocalName || item.BuildName,
+          leaf: level >= 3
+        }))
+        resolve(nodes)
+      }
+      //楼层
+      else if (level == 1) {
+        let floors = this.$route.params.floorData.filter(item => { return item.BuildID == node.value })
+        let nodes = floors[0].Floor.map(item => ({
+          value: item.FloorID,
+          label: item.FloorLocalName || item.FloorName,
+          leaf: level >= 3
+        }))
+        resolve(nodes)
+      }
+      //空间类型
+      else if (level == 2) {
+        if (this.zoneTypeList && this.zoneTypeList.length) {
+          resolve(this.zoneTypeList)
+        }
+        else {
+          let pa = {
+            Filters: `parentId='Space'`
+          }
+          queryDictionaryHead(pa, res => {
+            this.zoneTypeList = res.Content.filter((item => { return item.Name != '元空间' })).map(item => ({
+              value: item.Code,
+              label: item.Name,
+              leaf: level >= 3
+            }))
+            resolve(this.zoneTypeList)
+          });
+        }
+      }
+      //业务空间
+      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
+          }
+        }
+        queryZone(pa, res => {
+          let nodes = res.Content.map(item => ({
+            value: item,
+            label: item.RoomLocalName || item.RoomName,
+            leaf: level >= 3
+          }))
+          resolve(nodes)
+        })
+      }
+    },
+    //删除业务空间
+    deleteZone(zoneid) {
+      this.zoneList = this.zoneList.filter(item => { return item.RoomID != zoneid });
+    },
+    //添加业务空间
+    addZone() {
+      if (this.newZoneObj.RoomID && this.zoneList.findIndex((item) => (item.RoomID == this.newZoneObj.RoomID)) == -1) {
+        this.zoneList.push(this.newZoneObj)
+        console.log(this.zoneList)
+      }
+      else if (!this.newZoneObj.RoomID) {
+        this.$message("请选择业务空间后添加")
+      }
+      else {
+        this.$message("已有业务空间,请重新选择");
+      }
+      this.zoneCa = [];
+      this.newZoneObj = {}
+    },
+    //选择业务空间
+    changeCascader(val) {
+      this.newZoneObj = val[3]
     },
     //返回
     goBack() {
       this.$router.push({
         name: "buildGraphy",
-        params:{nowBuildFloor: this.$route.params.nowBuildFloor}
+        params: { nowBuildFloor: this.$route.params.nowBuildFloor }
       })
     }
   },
@@ -123,11 +230,24 @@ export default {
   label {
     display: inline-block;
     padding: 5px 10px;
-    width:100px;
+    width: 130px;
   }
 }
-.suppMsg{
-  display:inline-block;
-  position:relative;
+.zone-item {
+  display: inline-block;
+  position: relative;
+  width: 245px;
+  padding: 5px 10px;
+  margin: 0 5px 5px 0;
+}
+.zone-item p {
+  width: 200px;
+  float: left;
+  height: 32px;
+  overflow: hidden;
+  border: 1px solid rgb(220, 223, 230);
+  padding-left: 15px;
+  padding: 0 0 0 15px;
+  border-radius: 5px;
 }
 </style>

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

@@ -112,7 +112,7 @@ export default {
         children: "Floor"
       },
       floorToMap: {}, //楼层及其对应的模型图
-      FloorMap: "", //当前选中的楼层对象
+      FloorMap: {}, //当前选中的楼层对象
       buildFloorSelectd: ['all'], //当前所选的建筑楼层
       childBackParam: {}
     };
@@ -196,12 +196,11 @@ export default {
     },
     //修改所选建筑楼层
     changeCascader(val) {
-          console.log(this.buildFloorSelectd);
-          console.log(1111111111111111111);
       this.buildFloorSelectd = val;
       // 如果选择的是全部或者未明确
       if (val.indexOf('noKnow') > -1 || val.indexOf('all') > -1) {
         this.isMyTab = 2;
+        this.FloorMap = {}
       } else {
         // 选择的是具体某个楼层
         if (!this.floorToMap[val[1]].StructureInfo || !this.floorToMap[val[1]].StructureInfo.FloorMap) {

+ 2 - 2
src/views/ready/buildfloor/drawGraphy/drawFloor.vue

@@ -65,7 +65,6 @@ export default {
     //
     init(){
       this.getFloorData();
-      this.getOtherFloorOutLine();
     },
     // 初始化canvas
     initGraphy(Id, type) {
@@ -123,12 +122,13 @@ export default {
       }
       floorQuery(pa, res => {
         this.floorData = res.Content[0];
+        this.getOtherFloorOutLine();
         this.initGraphy(this.floorData.StructureInfo.FloorMap, 2)
       })
     },
     // 获取绑定该模型id的其他楼层轮廓线
     getOtherFloorOutLine() {
-      let modelid = this.$route.query.modelId;
+      let modelid = this.floorData.ModelId;
       let pa = {
         Filters: `ModelId='${modelid}'`
       }

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

@@ -27,12 +27,12 @@ export default {
   },
   data() {
     return {
-      modelId: "", // 
+      // modelId: "", // 
       isEdit: false, // 是否编辑模式
     };
   },
   created() {
-    this.modelId = this.$route.query.modelId;
+    // this.modelId = this.$route.query.modelId;
     this.FloorID = this.$route.query.FloorID;
     this.BuildID = this.$route.query.BuildID;
   },
@@ -87,7 +87,8 @@ export default {
     },
     // 替换模型文件成功
     refresh(modelId) {
-      this.modelId = modelId
+      // this.modelId = modelId
+      this.$refs.drawFloor.init();
     }
   },
   watch: {