Jelajahi Sumber

Merge branch 'infoPoint' of git.sagacloud.cn:web/ibms into infoPoint

zhangyu 5 tahun lalu
induk
melakukan
62c4619693

+ 7 - 1
src/api/scan/request.js

@@ -1227,4 +1227,10 @@ export function createRelationInFloor(param, success) {
 export function queryBaseGraphy(param, success) {
     let url = `/modelapi/base-graph/query`;
     http.postJson(url, param, success)
-}
+}
+//楼层接口-----更新楼层信息
+export function floorUpdate(param, success) {
+    let url = `${baseUrl}/datacenter/floor/update`;
+    http.postJson(url, param, success)
+}
+

+ 39 - 14
src/components/model/file/floorTable.vue

@@ -19,11 +19,29 @@
     <el-table-column prop="address" align="center" label="操作">
       <template slot-scope="scope">
         <div class="operate" v-show="!scope.row.isDown">
-          <el-button type="primary" size="mini" class="iconfont icon-download" @click="downloadModel(scope.row)" ></el-button>
-          <el-button type="primary" size="mini" class="iconfont icon-replace" @click="repliaceModel(scope.row)" ></el-button>
-          <el-button type="primary" size="mini" class="iconfont icon-Log" @click="queryModelLog(scope.row)" ></el-button>
+          <el-button
+            type="primary"
+            size="mini"
+            class="iconfont icon-download"
+            @click="downloadModel(scope.row)"
+          ></el-button>
+          <el-button
+            type="primary"
+            size="mini"
+            class="iconfont icon-replace"
+            @click="repliaceModel(scope.row)"
+          ></el-button>
+          <el-button
+            type="primary"
+            size="mini"
+            class="iconfont icon-Log"
+            @click="queryModelLog(scope.row)"
+          ></el-button>
         </div>
-        <div :class="[scope.row.Status == 1 ||scope.row.Status == 2 ? 'upLoad-loading':'','upLoad']" v-show="scope.row.isDown" >
+        <div
+          :class="[scope.row.Status == 1 ||scope.row.Status == 2 ? 'upLoad-loading':'','upLoad']"
+          v-show="scope.row.isDown"
+        >
           <div class="progress">
             <el-progress
               :text-inside="scope.row.Status == 1 || scope.row.Status == 2 ?false:true"
@@ -39,9 +57,9 @@
               class="iconfont icon-termination"
               @click="closeUpdate(scope.row)"
               circle
-            ></el-button> -->
+            ></el-button>-->
             <span v-show="scope.row.Status == 1">等待检查...</span>
-            <span v-show="scope.row.Status == 2">模型检查中</span>
+            <span v-show="scope.row.Status == 10">模型检查中</span>
           </div>
         </div>
       </template>
@@ -70,7 +88,15 @@ export default {
     },
     // 替换日志
     repliaceModel(item) {
-      this.$emit("replaceModel", item);
+      if (item.row.Status == 2) {
+        this.$alert("正在识别模型对象,请稍后再替换。", "替换模型", {
+          confirmButtonText: "确定",
+          callback: action => {
+          }
+        });
+      } else {
+        this.$emit("replaceModel", item);
+      }
     },
     filterTag(Id, precent) {
       this.$refs.filterTable.data.map(item => {
@@ -105,11 +131,11 @@ export default {
     },
     // 停止上传
     closeUpdate(item) {
-      if (this.userInfo.username ==item.UserName ) {
+      if (this.userInfo.username == item.UserName) {
         this.$emit("closeUpdateFile", item);
       } else {
         this.$message({
-          message:"您不是该文件的上传者,不能停止该文件上传!",
+          message: "您不是该文件的上传者,不能停止该文件上传!",
           type: "error"
         });
       }
@@ -147,7 +173,7 @@ export default {
     }
   }
   .icon-termination {
-    color: #F56C6C;
+    color: #f56c6c;
     background: #fff;
     padding: 0;
     border: 0;
@@ -168,7 +194,6 @@ export default {
       height: 20px;
       line-height: 20px;
     }
-
   }
   .upLoad-loading {
     position: relative;
@@ -194,10 +219,10 @@ export default {
   display: none;
 }
 /deep/ .upLoad-loading .el-progress-bar {
-    padding-right: 44px;
-    margin-right: -44px;
+  padding-right: 44px;
+  margin-right: -44px;
 }
 /deep/ .el-progress-bar__inner {
-    text-align: center;
+  text-align: center;
 }
 </style>

+ 1 - 1
src/views/model/file/index.vue

@@ -259,7 +259,7 @@ export default {
       return new Promise((resolve, reject) => {
         request.queryFloorList(data, res => {
           res.Content.map(item => {
-            // 显示进度条:Status == 0 || null 正在上传 ;:Status == 1:等待检查;Status == 2:模型检查中; Status == 3 文件上传完成
+            // 显示进度条:Status == 0 || null 正在上传 ;:Status == 1: 等待检查;Status == 10 正在检查中 ;Status == 2 已通过检查(展示按钮,不可以替换模型); Status == 3 || Status == 4 (可以替换模型文件)
             if (item.Status == 3) {
               Object.assign(item, { isDown: false, precent: 0 });
             } else {

+ 48 - 20
src/views/ready/buildfloor/drawGraphy/checkGraphy.vue

@@ -7,7 +7,7 @@
     :before-close="handleClose"
   >
     <div class="bodys">
-      <el-cascader :props="props" :show-all-levels="false"  @change="handleChange"></el-cascader>
+      <el-cascader :props="props" :show-all-levels="false" @change="handleChange" placeholder="请选择模型文件"></el-cascader>
       <div>
         <el-button type="text">上传图片</el-button>
@@ -37,17 +37,14 @@ let id = 0;
 import drawFloor from "./drawFloor";
 import { mapGetters, mapActions } from "vuex";
 import request from "@/api/model/file.js";
+import { floorUpdate } from "@/api/scan/request";
 export default {
   components: {
     drawFloor
   },
   props: {
     checkGraphyVisible: Boolean,
-    jsonKey: {
-      type: String,
-      default: "",
-      required: false
-    }
+    checkGraphyItem: Object
   },
   computed: {
     ...mapGetters("layout", ["projectId"])
@@ -55,11 +52,13 @@ export default {
   data() {
     return {
       value: "",
-      dataKey:'',
+      dataKey: "", //url
+      jsonKey: "", //map.josn
       point: [40703.54760591985, 42678.14510522981], //坐标
       pointWidth: 2000,
-      findGraphyItemId: "", //高亮的id
-      props: {                 //联级框
+      findGraphyItemId: "", //高亮的i
+      props: {
+        //联级框
         lazy: true,
         lazyLoad(node, resolve) {
           const { level } = node;
@@ -80,17 +79,17 @@ export default {
               ProjectId: this.projectId
             };
             request.queryFloorList(data, res => {
-                const nodes = Array.from(res.Content).map(item => ({
-                  value: item.Url,
-                  label: item.FloorName,
-                  leaf: level >= 1
-                }));
-                // 通过调用resolve将子节点数据返回,通知组件数据加载完成
-                resolve(nodes);
+              const nodes = Array.from(res.Content).map(item => ({
+                value: item.Url,
+                label: item.FloorName,
+                leaf: level >= 1
+              }));
+              // 通过调用resolve将子节点数据返回,通知组件数据加载完成
+              resolve(nodes);
             });
           }
         }
-      },
+      }
     };
   },
   methods: {
@@ -98,7 +97,34 @@ export default {
       this.$emit("handleCloseCGraphy");
     },
     // 绑定图片
-    bindGraphy() {},
+    bindGraphy() {
+      if(!this.jsonKey){
+            this.$message.warning("请选择模型文件");
+            return
+      }
+      let data = {
+        Content: [
+          {
+            FloorID: this.checkGraphyItem.FloorID,
+            StructureInfo: {
+              FloorMap: this.jsonKey
+            }
+          }
+        ]
+      };
+      floorUpdate(data, res => {
+        if (res.Result == "success") {
+          this.$message.success("添加成功");
+          this.handleClose()
+        } else {
+          if (res.Message) {
+            this.$message.warning(res.Message);
+          } else {
+            this.$message.warning("绑定失败");
+          }
+        }
+      });
+    },
     initOption() {
       // let data = {
       //   FloorName: item.FloorLocalName,
@@ -109,8 +135,10 @@ export default {
       return new Promose((resolve, reject) => {});
     },
     // 点击多级联动
-    handleChange(val){
-     this.dataKey = val[1];
+    handleChange(val) {
+      console.log(val)
+      // this.jsonKey = val[1];
+      // this.dataKey = `/image-service/common/file_get/${this.jsonKey}?systemId=revit`;
     }
   },
   mounted() {

+ 7 - 4
src/views/ready/buildfloor/drawGraphy/drawFloor.vue

@@ -116,8 +116,8 @@ export default {
       this.drawMainScene = new mainScene(null);
       this.drawMainScene
         .urlGetData(
-          // "/image-service/common/file_get/Fl4201050001c72ff970d2ba11e8a57543fa3e79672520181120041440bim.jsonz?systemId=revit", ///////////测试路径
-          this.dataKey       //开发url 
+          "/image-service/common/file_get/Fl4201050001c72ff970d2ba11e8a57543fa3e79672520181120041440bim.jsonz?systemId=revit", ///////////测试路径
+          // this.dataKey       //开发url 
         )
         .then(() => {
           //  将场景赋给view对图进行绘制
@@ -127,6 +127,7 @@ export default {
           // 绘制地图颜色
           this.drawAllItemColor();
           // this.drawMainScene.click(this, this.clickItem);
+           this.drawMainScene.mouseMove(this,this.leftClickMove);
         });
         if(this.isScale){
           this.cancelScale(view)
@@ -138,9 +139,11 @@ export default {
     },
     // 取消放大缩小
     cancelScale(view){
-      console.log(2123)
       view.wheelZoom = 1;
-        console.log(view)
+    },
+    // 左键长按控制canvas的坐标
+    leftClickMove(a,b){ 
+        //  console.log('move',a,b)
     }
   },
   watch: {

+ 3 - 2
src/views/ready/buildfloor/drawGraphy/operateGraphyItem.vue

@@ -10,13 +10,13 @@
       <i class="el-icon-download"></i>
     </div>
     <div class="div-box">
-      <i class="el-icon-circle-plus-outline"></i>
+      <i class="el-icon-remove-outline"></i>
     </div>
     <div class="line">
       <el-slider tooltip-class="tooltip-class" v-model="value1"></el-slider>
     </div>
     <div class="div-box">
-      <i class="el-icon-remove-outline"></i>
+      <i class="el-icon-circle-plus-outline"></i>
     </div>
   </div>
 </template>
@@ -46,6 +46,7 @@ export default {
     align-items: center;
     color: #fff;
     border-right: 1px #ddd solid;
+    cursor: pointer;
   }
   .line {
     width: 200px;

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

@@ -139,6 +139,7 @@
     <checkGraphy
       :checkGraphyVisible="checkGraphyVisible"
       @handleCloseCGraphy="checkGraphyVisible=false"
+      :checkGraphyItem="checkGraphyItem"
     ></checkGraphy>
   </div>
 </template>
@@ -185,7 +186,8 @@ export default {
       loading: false, //列表loading
       curBuildId: "", //当前选中的建筑id
       curFloorId: "", //当前选中的楼层id
-      jsonKey: ""
+      jsonKey: "",
+      checkGraphyItem:{}
     };
   },
   computed: {
@@ -298,6 +300,7 @@ export default {
       if (3 == index) {
         // 查看
         this.jsonKey = "";
+        this.checkGraphyItem = item
         this.checkGraphyVisible = true;
       } else {
         this.jsonKey = item.StructureInfo.FloorMap;