소스 검색

点位标签整理

LXXXY 5 년 전
부모
커밋
b6d1310242

+ 9 - 2
src/api/scan/request.js

@@ -171,6 +171,13 @@ export function getPT(param) {
     return fetch({ method: 'POST', url: `${api}/service/fm/point_group`, data })
 }
 
+//查询点位标签信息/location-point/query
+export function locationPointQuery(param, success) {
+    let url = `${baseUrl}/datacenter/location-point/query`;
+    http.postJson(url, param, success)
+}
+
+
 //点位标签查看详情
 export function getPoint(param) {
     let data = {
@@ -958,10 +965,10 @@ export function queryLinkSys(param, success) {
 //查询系统信息 - 建筑楼层 - 系统一对多
 export function querySysLinkBuild(param, success) {
     let url = `${baseUrl}/datacenter/general—system/query-new`;
-    if(param.buildingId){
+    if (param.buildingId) {
         url += `?buildingId=${param.buildingId}`
     }
-    if(param.floorId){
+    if (param.floorId) {
         url += `&floorId=${param.floorId}`
     }
     http.postJson(url, param.data, success)

+ 1 - 1
src/components/ledger/lib/cenoteGraphy.vue

@@ -66,7 +66,7 @@ export default {
   methods: {
     //获取楼层map
     getFloorMap(buildfloor, space) {
-      if (buildfloor.length == 2) {
+      if (buildfloor.length == 2 && space && buildfloor[1]) {
         this.buildingData = buildfloor
         let pa = {
           Filters: `FloorID='${this.buildingData[1]}'`

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 329 - 909
src/views/data_admin/buildGraphy/graphyCanvas.vue


+ 192 - 181
src/views/data_admin/buildGraphy/graphyTabs.vue

@@ -5,167 +5,154 @@ getLocation 定位
 <template>
     <div id="graphy-tabs">
         <el-tabs style="height:100%;" v-model="activeName2" type="card" @tab-click="handleClick">
-            <el-tab-pane label="本层的点位标签" name="point">
-                <div v-if="pointData.length" v-loading="isLoading" style="max-height: 600px;overflow-y:auto;">
+            <el-tab-pane label="本层的点位标签" name="point" style="height:100%">
+                <el-scrollbar style="height:100%;"  v-if="pointData.length" v-loading="isLoading">
                     <div v-for="(item,index) in pointData" :key="index">
                         <div class="point">
                             <span>{{item.Name}}</span>
                             <el-button size="mini" @click="getDetails(item)">编辑点位标签</el-button>
-                            <el-button :disabled="!map" size="mini" @click="btnClick(item)">{{ item.X == 0 && item.Y == 0 ? '插旗' : '定位'}}</el-button>
+                            <el-button :disabled="!map" size="mini" @click="btnClick(item)">
+                                {{ item.X == 0 && item.Y == 0 ? '插旗' : '定位'}}</el-button>
+                        </div>
+                    </div>
+                </el-scrollbar>
+
+                <div v-if="!pointData.length" class="center"
+                    style="height: 400px;padding-top: 260px; box-sizing:border-box;">
+                    <i class="icon-wushuju iconfont"></i>
+                    {{pointParam.FloorId ? "数据为空" : "请选择楼层"}}
+                </div>
+            </el-tab-pane>
+            <el-tab-pane label="无法定位到楼层的点位标签" name="noPoint">
+                <div v-if="pointNoData.length" v-loading="isLoading" style="max-height: 600px;">
+                    <div v-for="(item,index) in pointNoData" :key="index">
+                        <div class="point">
+                            <span>{{item.Name}}</span>
+                            <el-button @click="getDetails(item)">编辑点位标签</el-button>
+                            <el-button :disabled="!(item.X == 0 && item.Y == 0)" @click="btnClick(item)">
+                                {{ item.X == 0 && item.Y == 0 ? '插旗' : '定位'}}</el-button>
                         </div>
                     </div>
                 </div>
-                <div v-if="!pointData.length" class="center" style="height: 400px;padding-top: 260px; box-sizing:border-box;">
+                <div v-if="!pointNoData.length" class="center"
+                    style="height: 400px;padding-top: 260px; box-sizing:border-box;">
                     <i class="icon-wushuju iconfont"></i>
                     {{pointParam.FloorId ? "数据为空" : "请选择楼层"}}
                 </div>
-      </el-tab-pane>
-      <el-tab-pane label="无法定位到楼层的点位标签" name="noPoint">
-            <div v-if="pointNoData.length" v-loading="isLoading" style="max-height: 600px;">
-                <div v-for="(item,index) in pointNoData" :key="index">
-                    <div class="point">
-                    <span>{{item.Name}}</span>
-                    <el-button @click="getDetails(item)">编辑点位标签</el-button>
-                    <el-button
-                        :disabled="!(item.X == 0 && item.Y == 0)"
-                        @click="btnClick(item)"
-                    >{{ item.X == 0 && item.Y == 0 ? '插旗' : '定位'}}</el-button>
+            </el-tab-pane>
+        </el-tabs>
+        <el-dialog title="详情" :visible.sync="pointShow" width="500px">
+            <div class="qrcode">
+                <div class="qrcode-view">
+                    <img :src="'/ScanBuilding/service/qrcode/point?projectId=' + projectId + '&pointId=' + pointDetails.PointId + '&FloorId=' + pointDetails.FloorId + '&width=200&height=200'"
+                        alt="点位标签二维码">
+                </div>
+                <div class="point-edit">
+                    <p>
+                        点位标签的现场位置:{{activeName2 != 'point' ? '无楼层' : pointParam.fllorName}}
+                        -{{pointDetails.spaceName || '未知原空间'}}
+                        -({{pointDetails.X}},{{pointDetails.Y}})
+                    </p>
+                    <div>
+                        <form-input :width="100" @change="changeInput" :value="pointDetails.PointName"
+                            :keys="'PointName'" :label="'点位标签'" :isRule="false"></form-input>
+                        <form-input :width="100" @change="changeInput" :value="pointDetails.PointLocalId"
+                            :keys="'PointLocalId'" :label="'点位本地编码'" :isRule="false"></form-input>
+                        <!-- <form-input></form-input> -->
+                    </div>
                 </div>
             </div>
+            <div class="point-coding">
+                <p>编码及关系</p>
+                <ul>
+                    <li>
+                        <span>点位标签ID</span>
+                        <span>{{pointDetails.PointId}}</span>
+                    </li>
+                    <li>
+                        <span>模型ID</span>
+                        <span>{{pointDetails.BimId || '暂无'}}</span>
+                    </li>
+                </ul>
             </div>
-            <div v-if="!pointNoData.length" class="center" style="height: 400px;padding-top: 260px; box-sizing:border-box;">
-                <i class="icon-wushuju iconfont"></i>
-                {{pointParam.FloorId ? "数据为空" : "请选择楼层"}}
+            <div class="point-coding">
+                <p>基本信息</p>
+                <ul>
+                    <li>
+                        <span>信标类型</span>
+                        <span>二维码</span>
+                    </li>
+                    <li>
+                        <span>备注</span>
+                        <span>
+                            <form-input :width="0" @change="changeInput" :value="pointDetails.Note" :keys="'Note'"
+                                :label="''" :isRule="false"></form-input>
+                        </span>
+                    </li>
+                </ul>
             </div>
-        </el-tab-pane>
-    </el-tabs>
-    <el-dialog title="详情" :visible.sync="pointShow" width="500px">
-      <div class="qrcode">
-        <div class="qrcode-view">
-          <img
-            :src="'/ScanBuilding/service/qrcode/point?projectId=' + projectId + '&pointId=' + pointDetails.PointId + '&FloorId=' + pointDetails.FloorId + '&width=200&height=200'"
-            alt="点位标签二维码"
-          >
-        </div>
-        <div class="point-edit">
-          <p>
-            点位标签的现场位置:{{activeName2 != 'point' ? '无楼层' : pointParam.fllorName}}
-            -{{pointDetails.spaceName || '未知原空间'}}
-            -({{pointDetails.X}},{{pointDetails.Y}})
-          </p>
-          <div>
-            <form-input
-              :width="100"
-              @change="changeInput"
-              :value="pointDetails.PointName"
-              :keys="'PointName'"
-              :label="'点位标签'"
-              :isRule="false"
-            ></form-input>
-            <form-input
-              :width="100"
-              @change="changeInput"
-              :value="pointDetails.PointLocalId"
-              :keys="'PointLocalId'"
-              :label="'点位本地编码'"
-              :isRule="false"
-            ></form-input>
-            <!-- <form-input></form-input> -->
-          </div>
-        </div>
-      </div>
-      <div class="point-coding">
-        <p>编码及关系</p>
-        <ul>
-          <li>
-            <span>点位标签ID</span>
-            <span>{{pointDetails.PointId}}</span>
-          </li>
-          <li>
-            <span>模型ID</span>
-            <span>{{pointDetails.BimId || '暂无'}}</span>
-          </li>
-        </ul>
-      </div>
-      <div class="point-coding">
-        <p>基本信息</p>
-        <ul>
-          <li>
-            <span>信标类型</span>
-            <span>二维码</span>
-          </li>
-          <li>
-            <span>备注</span>
-            <span>
-              <form-input
-                :width="0"
-                @change="changeInput"
-                :value="pointDetails.Note"
-                :keys="'Note'"
-                :label="''"
-                :isRule="false"
-              ></form-input>
-            </span>
-          </li>
-        </ul>
-      </div>
-      <div class="point-pic">
-            <p>点位安装位置效果照片</p>
-            <template v-for="(item,index) in installPic">
-                <div class="point-image" :key="index">
-                    <i class="el-icon-delete" @click="delImage(index,installPic)"></i>
-                    <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
-                </div>
-            </template>
-            <load-img keyName="安装位置" @getKey="getKey"></load-img>
-        </div>
-        <div class="point-pic">
-            <p>全景照片</p>
-            <template v-for="(item,index) in panorama">
-                <div class="point-image" :key="index">
-                    <i class="el-icon-delete" @click="delImage(index,panorama)"></i>
-                    <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
-                </div>
-            </template>
-            <load-img keyName="全景照片" @getKey="getKey"></load-img>
-        </div>
-        <div class="point-pic">
-            <p>周边照片</p>
-            <template v-for="(item,index) in rimPic">
-                <div class="point-image" :key="index">
-                    <i class="el-icon-delete" @click="delImage(index,rimPic)"></i>
-                    <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
-                </div>
-            </template>
-            <load-img keyName="周边照片" @getKey="getKey"></load-img>
-        </div>
-        <div class="point-pic">
-            <p>视频资料</p>
-            <template v-for="(item,index) in videoPic">
-                <div class="point-image" :key="index">
-                    <i class="el-icon-delete" @click="delImage(index,videoPic)"></i>
-                    <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
-                </div>
-            </template>
-            <load-img keyName="视频" @getKey="getKey"></load-img>
-        </div>
-        <div class="point-pic">
-            <p>其他照片</p>
-            <template v-for="(item,index) in elsePic">
-                <div class="point-image" :key="index">
-                    <i class="el-icon-delete" @click="delImage(index,elsePic)"></i>
-                    <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
-                </div>
-            </template>
-        <load-img keyName="其他照片" @getKey="getKey"></load-img>
-      </div>
-    </el-dialog>
-  </div>
+            <div class="point-pic">
+                <p>点位安装位置效果照片</p>
+                <template v-for="(item,index) in installPic">
+                    <div class="point-image" :key="index">
+                        <i class="el-icon-delete" @click="delImage(index,installPic)"></i>
+                        <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'"
+                            alt>
+                    </div>
+                </template>
+                <load-img keyName="安装位置" @getKey="getKey"></load-img>
+            </div>
+            <div class="point-pic">
+                <p>全景照片</p>
+                <template v-for="(item,index) in panorama">
+                    <div class="point-image" :key="index">
+                        <i class="el-icon-delete" @click="delImage(index,panorama)"></i>
+                        <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'"
+                            alt>
+                    </div>
+                </template>
+                <load-img keyName="全景照片" @getKey="getKey"></load-img>
+            </div>
+            <div class="point-pic">
+                <p>周边照片</p>
+                <template v-for="(item,index) in rimPic">
+                    <div class="point-image" :key="index">
+                        <i class="el-icon-delete" @click="delImage(index,rimPic)"></i>
+                        <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'"
+                            alt>
+                    </div>
+                </template>
+                <load-img keyName="周边照片" @getKey="getKey"></load-img>
+            </div>
+            <div class="point-pic">
+                <p>视频资料</p>
+                <template v-for="(item,index) in videoPic">
+                    <div class="point-image" :key="index">
+                        <i class="el-icon-delete" @click="delImage(index,videoPic)"></i>
+                        <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'"
+                            alt>
+                    </div>
+                </template>
+                <load-img keyName="视频" @getKey="getKey"></load-img>
+            </div>
+            <div class="point-pic">
+                <p>其他照片</p>
+                <template v-for="(item,index) in elsePic">
+                    <div class="point-image" :key="index">
+                        <i class="el-icon-delete" @click="delImage(index,elsePic)"></i>
+                        <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'"
+                            alt>
+                    </div>
+                </template>
+                <load-img keyName="其他照片" @getKey="getKey"></load-img>
+            </div>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
     import {
-        getPT, //获取点位列表
+        locationPointQuery, //获取点位列表
         getPoint, //获取点位详情
         updatePoint //修改点位
     } from "@/api/scan/request";
@@ -199,7 +186,8 @@ getLocation 定位
                 rimPic: [], //周边照片
                 videoPic: [], //视频资料
                 elsePic: [], //其他照片
-                map: true
+                map: true,
+                buildingData:[],//建筑楼层信息
             };
         },
         computed: {
@@ -291,21 +279,9 @@ getLocation 定位
                 });
             },
             getDetails(item) {
-                let params = {
-                    ProjId: this.projectId,
-                    UserId: this.userId,
-                    PointId: item.Id
-                };
-                getPoint(params).then(res => {
-                    let data = res.data;
-                    if (data.Result == "success") {
-                        this.pointShow = true;
-                        this.pointDetails = data.PointList[0];
-                        this.getPic(data.PointList[0].ImageList);
-                    } else {
-                        this.$message.error("请求出错");
-                    }
-                });
+                this.pointShow = true;
+                this.pointDetails = item;
+                this.getPic(item.ImageList);
             },
             getPic(imgArr) {
                 this.installPic = [];
@@ -334,28 +310,31 @@ getLocation 定位
             },
             //获取point
             getPointList() {
-                this.isLoading = true;
-                if (this.pointParam.FloorId) {
+                if (this.buildingData[0] && this.buildingData[1]) {
                     let param = {
-                        FloorId: this.pointParam.FloorId,
-                        ProjId: this.pointParam.ProjId,
-                        UserId: this.pointParam.UserId
+                        Filters:`BuildId='${this.buildingData[0]}';floorId='${this.buildingData[1]}'`,
+                        "Cascade": [ {"Name": "imageList"} ]
                     };
-                    console.log(param)
+                    // console.log(param)
                     //当index为1时FloorId为空
                     if (this.index == "1") {
-                        param.FloorId = "";
+                        // param.FloorId = "";
                     }
-                    getPT(param).then(res => {
-                        res.data.PointList.splice(0, 1);
-                        if (this.index == "1") {
-                            this.pointNoData = res.data.PointList;
-                        } else {
-                            this.$emit("getPointList", res.data.PointList);
-                            this.pointData = res.data.PointList;
-                        }
+                    this.isLoading = true;
+                    locationPointQuery(param, res => {
                         this.isLoading = false;
-                    });
+                        console.log(res)
+                        // res.data.PointList.splice(0, 1);
+                        this.pointData = res.Content;
+                        // this.$emit("getPointList", res.Content);
+                        // if (this.index == "1") {
+                        //     this.pointNoData = res.data.PointList;
+                        // } else {
+                        //     this.$emit("getPointList", res.data.PointList);
+                        //     this.pointData = res.data.PointList;
+                        // }
+                    })
+
                 }
             },
             //初始化
@@ -363,6 +342,7 @@ getLocation 定位
                 this.map = map
                 this.pointParam.FloorId = data.FloorId;
                 this.pointParam.fllorName = data.fllorName;
+                this.buildingData = data.buildingData;
                 this.activeName2 = "point";
                 this.getPointList();
             }
@@ -370,32 +350,43 @@ getLocation 定位
         watch: {
             pointShow: {
                 deep: true,
-                handler: function(old, val) {
+                handler: function (old, val) {
                     if (old == false && val == true) {
                         this.getPointList();
                     }
                 }
             },
-            projectId(){
-                this.pointData= []
-                this.pointNoData= []
+            projectId() {
+                this.pointData = []
+                this.pointNoData = []
                 this.activeName2 = "point"
             }
         }
     };
+
 </script>
 
 <style lang="scss" scoped>
+    
     #graphy-tabs {
+        /deep/ .el-scrollbar__wrap {
+            overflow-x: hidden;
+        }
+        /deep/ .el-tabs__content{
+            height:calc(100% - 56px);
+        }
         height: 100%;
         border-left: 1px solid #E4E7ED;
+
         .el-tabs__content {
             height: calc(100% - 60px) !important;
             background: red;
         }
-        .el-dialog__body{
+
+        .el-dialog__body {
             max-height: 400px;
         }
+
         .saga-message {
             height: calc(100vh - 220px);
             line-height: 400px;
@@ -403,9 +394,11 @@ getLocation 定位
             font-size: 24px;
             text-align: center;
         }
+
         .point {
             padding-left: 20px;
             height: 30px;
+
             span {
                 font-size: 12px;
                 width: 180px;
@@ -414,27 +407,33 @@ getLocation 定位
                 text-overflow: ellipsis;
                 overflow: hidden;
             }
+
             button {
                 margin-bottom: 5px;
             }
         }
+
         .point:hover {
             background-color: #f2f6fc;
         }
+
         .qrcode {
             width: 100%;
             height: 180px;
             overflow: hidden;
+
             .qrcode-view {
                 width: 180px;
                 height: 180px;
                 overflow: hidden;
                 float: left;
+
                 img {
                     width: 100%;
                     height: 100%;
                 }
             }
+
             .point-edit {
                 height: 180px;
                 display: inline-block;
@@ -443,11 +442,13 @@ getLocation 定位
                 width: calc(100% - 180px);
             }
         }
+
         .point-coding {
             width: 100%;
             height: 120px;
             margin-top: 5px;
             overflow: hidden;
+
             p {
                 height: 30px;
                 line-height: 30px;
@@ -456,14 +457,17 @@ getLocation 定位
                 font-size: 16px;
                 text-align: left;
             }
+
             ul {
                 width: 100%;
                 border: 1px solid #ccc;
                 border-bottom: none;
                 box-sizing: border-box;
+
                 li {
                     line-height: 40px;
                     height: 40px;
+
                     span {
                         display: block;
                         float: left;
@@ -475,18 +479,22 @@ getLocation 定位
                         height: 40px;
                         overflow: hidden;
                     }
+
                     span:first-child {
                         width: 30%;
                     }
+
                     span:last-child {
                         width: 70%;
                     }
                 }
             }
         }
+
         .point-pic {
             width: 100%;
             overflow: hidden;
+
             p {
                 height: 25px;
                 line-height: 25px;
@@ -497,6 +505,7 @@ getLocation 定位
                 margin-bottom: 5px;
             }
         }
+
         .point-image {
             width: 180px;
             height: 180px;
@@ -505,10 +514,12 @@ getLocation 定位
             margin-right: 10px;
             margin-bottom: 10px;
             border: 1px solid #ccc;
+
             img {
                 width: 100%;
                 height: 100%;
             }
+
             i {
                 position: absolute;
                 bottom: 10px;
@@ -519,5 +530,5 @@ getLocation 定位
             }
         }
     }
-</style>
 
+</style>

+ 237 - 228
src/views/data_admin/buildGraphy/index.vue

@@ -2,242 +2,251 @@
   revit空间管理
  -->
 <template>
-    <div id="graphy">
-        <!-- <div class="graphy-left">
+  <div id="graphy">
+    <!-- <div class="graphy-left">
           <graphy-tree v-if="show" :param="param" @change="getPoint"></graphy-tree>
         </div> -->
-        <div class='search-title'>
-            <span class="p12">建筑楼层</span>
-            <el-cascader placeholder='请选择' :options="options" @active-item-change="handleItemChange" @change="changeFloor" filterable></el-cascader>
-        </div>
-        <div class="graphy-view">
-            <div class="graphy-main">
-                <graphy-canvas v-if="show" :param="param" @getDetails="getDetails" @resetPoint="resetPoint" ref="canvas"></graphy-canvas>
-            </div>
-            <div class="graphy-right">
-                <graphy-tabs v-show="show" ref="tabs" :pointParam="pointParam" @setFalg="setFalg" @getLocation="getLocation" @getPointList="sendPointList"></graphy-tabs>
-            </div>
-        </div>
+    <div class='search-title'>
+      <span class="p12">建筑楼层</span>
+      <el-cascader placeholder='请选择' :options="options" @change="changeFloor" filterable :props="props" ref="buildfloor"></el-cascader>
     </div>
+    <div class="graphy-view">
+      <div class="graphy-main">
+        <graphy-canvas v-if="show" @getDetails="getDetails" @resetPoint="resetPoint" ref="canvas"></graphy-canvas>
+      </div>
+      <div class="graphy-right">
+        <graphy-tabs v-show="show" ref="tabs" :pointParam="pointParam" @setFalg="setFalg" @getLocation="getLocation" @getPointList="sendPointList">
+        </graphy-tabs>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
-    //接口
-    import graphyTree from "./graphyTree";
-    import graphyTabs from "./graphyTabs";
-    import graphyCanvas from "./graphyCanvas";
-    import {
-        mapGetters,
-        mapActions
-    } from 'vuex';
-    import {
-        getPT,
-        getBuildSelect,
-        getFloor
-    } from "@/api/scan/request"; //获取点位坐标
-    import tools from "@/utils/scan/tools"
-    import Handsontable from "handsontable-pro"
-    import 'handsontable-pro/dist/handsontable.full.css'
-    import zhCN from 'handsontable-pro/languages/zh-CN';
-    export default {
-        components: {
-            graphyTree,
-            graphyTabs,
-            graphyCanvas
-        },
-        data() {
-            return {
-                param: {
-                    ProjId: this.projectId, //项目id
-                    UserId: this.userId //用户id
-                },
-                pointParam: {
-                    //point请求参数
-                    ProjId: this.projectId, //项目id
-                    UserId: this.userId, //用户id
-                    fllorName: ""
-                },
-                options: [],
-                map: null,
-                pointId: null,
-                show: false,
-                buildVlaue: []
-            };
-        },
-        mounted() {
-            this.changeValue()
-            this.getList()
-        },
-        computed: {
-            ...mapGetters('layout', ['projectId', 'secret', 'userId'])
-        },
-        methods: {
-            //修改楼层
-            changeFloor(val) {
-                console.log(val)
-                let floorMap = "",
-                    name = ""
-                this.options.map(item => {
-                    if (!!item.children && item.children.length) {
-                        if (item.value == val[0]) {
-                            item.children.map(child => {
-                                if (child.value == val[1]) {
-                                    console.log(child, 'child')
-                                    floorMap = child.map
-                                    name = child.label
-                                }
-                            })
-                        }
-                    }
-                })
-                let obj = {
-                    code: val[1],
-                    map: floorMap,
-                    name: name
-                }
-                this.getPoint(obj)
-                console.log(floorMap)
-            },
-            //获取建筑列表
-            getList() {
-                getBuildSelect(this.param).then(res => {
-                    console.log(res)
-                    this.options = res.data.BuildList.map(item => {
-                        return {
-                            value: item.BuildId,
-                            label: item.BuildLocalName,
-                            children: []
-                        }
-                    })
-                })
-            },
-            //点击事件
-            handleItemChange(val) {
-                if (val.length == 1) {
-                    let obj = Object.assign({
-                        BuildId: val[0]
-                    }, this.param)
-                    getFloor(obj).then(res => {
-                        console.log(res)
-                        this.options = this.options.map(item => {
-                            if (item.value == val[0]) {
-                                let FloorList = tools.sortArr(res.data.FloorList, "FloorSequenceId" , false)
-                                item.children = FloorList.map(child => {
-                                    return {
-                                        value: child.FloorId,
-                                        label: child.FloorLocalName + (child.FloorMap ? '' : '(需初始化数据)'),
-                                        map: child.FloorMap
-                                    }
-                                })
-                            }
-                            return item
-                        })
-                        console.log(this.options)
-                    })
-                } else if (val.length == 2) {
-                }
-            },
-            changeValue() {
-                this.$set(this.param, 'ProjId', this.projectId)
-                this.$set(this.param, 'UserId', this.userId)
-                this.$set(this.pointParam, 'ProjId', this.projectId)
-                this.$set(this.pointParam, 'UserId', this.userId)
-                this.show = true
-            },
-            //渲染
-            getPoint(data) {
-                this.pointParam.FloorId = data.code;
-                this.pointParam.fllorName = data.name;
-                this.$refs.tabs.reset(this.pointParam, data.map);
-                if (this.map != data.map) {
-                    this.map = data.map;
-                    this.$refs.canvas.getData(data);
-                } else {
-                    return;
-                }
-            },
-            //获取到点位标签坐标
-            sendPointList(list) {
-                if (list && list.length && list[0].Id == this.pointId) {
-                    this.$refs.canvas.doPoint(list);
-                } else {
-                    if (list.length) {
-                        this.pointId = list[0].Id;
-                        this.$refs.canvas.doPoint(list);
-                    } else {
-                        this.$refs.canvas.doPoint([]);
-                    }
-                }
-            },
-            //插旗setFalg
-            setFalg(item) {
-                this.$refs.canvas.addPoint(item);
-            },
-            //定位getLocation
-            getLocation(item) {
-                this.$refs.canvas.locationGraphy({
-                    X: item.X,
-                    Y: item.Y * -1
-                });
-            },
-            //重新获取点位信息resetPoint
-            resetPoint() {
-                this.$refs.tabs.reset(this.pointParam, true);
-            },
-            //查看详情
-            getDetails(item) {
-                this.$refs.tabs.getDetails(item);
-            }
-        },
-        watch: {
-            projectId(){
-                this. map = null
-                this.show = false
-                this.options = []
-                this.buildVlaue = []
-                this.changeValue()
-                this.getList()
-            }
-        }
+//接口
+import graphyTree from "./graphyTree";
+import graphyTabs from "./graphyTabs";
+import graphyCanvas from "./graphyCanvas";
+import {
+  mapGetters,
+  mapActions
+} from 'vuex';
+import {
+  getPT,
+  buildingQuery,
+  getFloor
+} from "@/api/scan/request"; //获取点位坐标
+import tools from "@/utils/scan/tools"
+import Handsontable from "handsontable-pro"
+import 'handsontable-pro/dist/handsontable.full.css'
+import zhCN from 'handsontable-pro/languages/zh-CN';
+export default {
+  components: {
+    graphyTree,
+    graphyTabs,
+    graphyCanvas
+  },
+  data() {
+    return {
+      props: {
+        value: 'BuildID',
+        label: 'BuildLocalName',
+        children: 'Floor'
+      },
+      param: {
+        ProjId: this.projectId, //项目id
+        UserId: this.userId //用户id
+      },
+      pointParam: {
+        ProjId: this.projectId, //项目id
+        UserId: this.userId, //用户id
+        fllorName: "",
+        buildingData:[],//建筑楼层信息
+      },
+      options: [],
+      map: null,
+      pointId: null,
+      show: false,
+      buildVlaue: []
     };
+  },
+  mounted() {
+    this.changeValue()
+    this.getList()
+  },
+  computed: {
+    ...mapGetters('layout', ['projectId', 'secret', 'userId'])
+  },
+  methods: {
+    //修改楼层
+    changeFloor(val) {
+      let floorMap = "",
+        name = ""
+      this.options.map(item => {
+        if (!!item.Floor && item.Floor.length) {
+          if (item.BuildID == val[0]) {
+            item.Floor.map(child => {
+              if (child.BuildID == val[1]) {
+                floorMap = child.StructureInfo ? child.StructureInfo.FloorMap : ''
+                name = child.FloorLocalName
+              }
+            })
+          }
+        }
+      })
+      let obj = {
+        code: val[1],
+        map: floorMap,
+        name: name,
+        buildingData:val
+      }
+      this.getPoint(obj)
+    },
+    //获取建筑列表
+    getList() {
+      let param = {
+        Cascade: [
+          { Name: "floor", Orders: 'FloorSequenceID desc' }
+        ],
+        PageNumber: 1,
+        PageSize: 50
+      }
+      buildingQuery(this.param, res => {
+        res.Content.map(t => {
+          if (t.Floor && t.Floor.length) {
+            t.Floor = t.Floor.map(item => {
+              if (item.FloorID == this.FloorID) return
+              item.BuildID = item.FloorID
+              item.BuildLocalName = item.FloorLocalName || item.FloorName
+              return item
+            }).filter(it => it)
+          }
+        })
+        this.options = res.Content
+      })
+    },
+    //获取建筑列表
+    getList() {
+      let param = {
+        Cascade: [
+          { Name: "floor", Orders: "FloorSequenceID desc", }
+        ],
+        PageNumber: 1,
+        PageSize: 50
+      }
+      buildingQuery(param, res => {
+        res.Content.map(t => {
+          if (t.Floor && t.Floor.length) {
+            t.Floor = t.Floor.map(item => {
+              if (item.FloorID == this.FloorID) return
+              item.BuildID = item.FloorID
+              item.BuildLocalName = item.FloorLocalName || item.FloorName
+              return item
+            }).filter(it => it)
+          }
+        })
+        this.options = res.Content
+      })
+    },
+    changeValue() {
+      this.$set(this.param, 'ProjId', this.projectId)
+      this.$set(this.param, 'UserId', this.userId)
+      this.$set(this.pointParam, 'ProjId', this.projectId)
+      this.$set(this.pointParam, 'UserId', this.userId)
+      this.show = true
+    },
+    //渲染
+    getPoint(data) {
+      this.pointParam.FloorId = data.code;
+      this.pointParam.fllorName = data.name;
+      this.pointParam.buildingData = data.buildingData
+      this.$refs.tabs.reset(this.pointParam, data.map);
+      console.log('无情',data.map,this.map)
+      if (this.map != data.map) {
+        this.map = data.map;
+        this.$refs.canvas.getData(data);
+      } else {
+        return;
+      }
+    },
+    //获取到点位标签坐标
+    sendPointList(list) {
+      if (list && list.length) {
+        this.pointId = list[0].Id;
+        this.$refs.canvas.doPoint(list);
+      } else {
+        this.$refs.canvas.doPoint([]);
+      }
+    },
+    //插旗setFalg
+    setFalg(item) {
+      this.$refs.canvas.addPoint(item);
+    },
+    //定位getLocation
+    getLocation(item) {
+      this.$refs.canvas.locationGraphy({
+        X: item.X,
+        Y: item.Y * -1
+      });
+    },
+    //重新获取点位信息resetPoint
+    resetPoint() {
+      this.$refs.tabs.reset(this.pointParam, true);
+    },
+    //查看详情
+    getDetails(item) {
+      this.$refs.tabs.getDetails(item);
+    }
+  },
+  watch: {
+    projectId() {
+      this.map = null
+      this.show = false
+      this.options = []
+      this.buildVlaue = []
+      this.changeValue()
+      this.getList()
+    }
+  }
+};
 </script>
 
 <style lang="less" scoped>
-    #graphy {
-        // position: relative;
-        display: flex;
-        flex-direction: column;
-        .graphy-view {
-            display: flex;
-            background-color: #fff;
-            flex: 1; 
-            .graphy-main {
-                flex: 1;
-                // position: absolute;
-                // left: 200px;
-                // top: 0;
-                // right: 400px;
-                // bottom: 0;
-                // overflow: auto;
-            }
-            .graphy-right {
-                // position: absolute;
-                // right: 0;
-                width: 400px; // top: 0;
-                // bottom: 0;
-                // border-left: 1px solid #ccc;
-                // overflow: hidden;
-            }
-        }
-        .graphy-left {
-            // width: 200px;
-            // height: 100%;
-            // position: absolute;
-            // overflow-y: auto;
-            // left: 0;
-            // top: 0;
-            // bottom: 0;
-            // border-right: 1px solid #ccc;
-        }
+#graphy {
+  // position: relative;
+  display: flex;
+  flex-direction: column;
+  .graphy-view {
+    display: flex;
+    background-color: #fff;
+    flex: 1;
+    .graphy-main {
+      flex: 1;
+      // position: absolute;
+      // left: 200px;
+      // top: 0;
+      // right: 400px;
+      // bottom: 0;
+      // overflow: auto;
+    }
+    .graphy-right {
+      // position: absolute;
+      // right: 0;
+      width: 400px; // top: 0;
+      // bottom: 0;
+      // border-left: 1px solid #ccc;
+      // overflow: hidden;
     }
-</style>
+  }
+  .graphy-left {
+    // width: 200px;
+    // height: 100%;
+    // position: absolute;
+    // overflow-y: auto;
+    // left: 0;
+    // top: 0;
+    // bottom: 0;
+    // border-right: 1px solid #ccc;
+  }
+}
+</style>

+ 7 - 0
src/views/ledger/cenotelist/relatedSpace.vue

@@ -270,6 +270,13 @@ export default {
           this.$refs.cenotegraphy.getFloorMap(buildfloor, this.space)
       }
     },
+    space: {
+      handler(val) {
+          this.isEdit = false;
+          let buildfloor = [this.building, this.floor]
+          this.$refs.cenotegraphy.getFloorMap(buildfloor, val)
+      }
+    },
     isEdit: {
       handler(val) {
         this.$refs.cenotegraphy.setSelectAble(val);