haojianlong 5 years ago
parent
commit
b23e74e732

+ 2 - 0
src/views/point/dynamicdata/index.vue

@@ -34,6 +34,8 @@
     <systemRules v-else-if="curType=='系统'" ref="system" :typeName="curType" @refresh="refreshTabs" :isPending="isPending"></systemRules>
     <!-- 空间 -->
     <spaceRules v-else-if="curType=='空间'" ref="space" :typeName="curType" @refresh="refreshTabs" :isPending="isPending"></spaceRules>
+    <!-- 开发中 -->
+    <div v-else>开发中</div>
     <!-- 应用规则弹窗 -->
     <apply-rules-dialog ref="apply" @refresh="getExecuteFeedback" @cancel="cancelApply" @clash="getClash"></apply-rules-dialog>
     <!-- 冲突日志 -->

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

@@ -9,8 +9,7 @@
       </div>
       <!-- 展示框 -->
       <div class="showBox">
-        <drawFloor ref="drawFloor" :findGraphyItemId="findGraphyItemId" :point="point" :pointWidth="pointWidth" :cadWidth="720"
-          :cadHeight="300" :isScale="true"></drawFloor>
+        <drawFloor ref="drawFloor"></drawFloor>
       </div>
     </div>
     <span slot="footer" class="dialog-footer">
@@ -20,7 +19,6 @@
   </el-dialog>
 </template>
 <script>
-let id = 0;
 import drawFloor from "./drawFloor";
 import { mapGetters, mapActions } from "vuex";
 import request from "@/api/model/file.js";
@@ -36,17 +34,9 @@ export default {
     return {
       casVal:[],
       jsonKey: "", //map.josn
-      point: [40703.54760591985, 42678.14510522981], //坐标
-      pointWidth: 2000,
-      findGraphyItemId: "", //高亮的i
       checkGraphyVisible: false,
       options: [],
-      props: {
-        value: 'value',
-        label: 'label',
-        children: 'children'
-      },
-      floor: '', // 当前选中的楼层数据
+      floor: {}, // 当前选中的楼层数据
     };
   },
   methods: {
@@ -82,10 +72,8 @@ export default {
     },
     // 点击多级联动
     handleChange(val) {
-      console.log(val)
       this.$refs.drawFloor.initGraphy(val[1])
       this.jsonKey = val[1]
-      // this.jsonKey = val[1];
     },
     // 通过id查询文件夹下模型文件
     handleItemChange(val) {

+ 12 - 72
src/views/ready/buildfloor/drawGraphy/drawFloor.vue

@@ -1,5 +1,5 @@
 <template>
-  <div id="drawFloor">
+  <div id="drawFloor" v-loading="canvasLoading">
     <canvas id="floorCanvas" :width="cadWidth" :height="cadHeight" ref="canvas"></canvas>
   </div>
 </template>
@@ -10,77 +10,14 @@ import { SGraphyView } from "@sybotan-web/graphy/lib";
 import { FloorScene } from "cad-engine";
 import { SColor } from "@sybotan-web/draw/lib";
 export default {
-  props: {
-    // cadWidth: {
-    //   type: String | Number,
-    //   default: "100%",
-    //   required: false
-    // },
-    // cadHeight: {
-    //   type: String | Number,
-    //   default: "100%",
-    //   required: false
-    // },
-    point: {
-      type: Array,
-      default: [0, 0],
-      required: false
-    },
-    pointWidth: {
-      type: Number,
-      default: 2000,
-      required: false
-    },
-    initColor: {
-      type: Array,
-      default: function () {
-        return [
-          "#F9C3C3",
-          "#FFD1BF",
-          "#FFF3BF",
-          "#D8F7C6",
-          "#C6F2F6",
-          "#DCE3C0",
-          "#FAE6C9",
-          "#E3D7F7",
-          "#C4CBF8",
-          "#DEC3F6"
-        ];
-      },
-      required: false
-    },
-    findGraphyItemId: {
-      //高亮的id
-      type: String,
-      default: "",
-      required: false
-    },
-    highlightColor: {
-      //高亮的color
-      type: String,
-      default: "#1abc9c",
-      required: false
-    },
-    isScale: {
-      //是否放大缩小
-      type: Boolean,
-      default: false,
-      required: false
-    },
-    indexs: {
-      //是否放大缩小
-      type: Number | String,
-      default: "",
-      required: false
-    }
-  },
   data() {
     return {
       drawMainScene: null,
       view: null,
       dataKey: '',
       cadWidth: 800,
-      cadHeight: 600
+      cadHeight: 600,
+      canvasLoading: false
     };
   },
   mounted() {
@@ -124,8 +61,8 @@ export default {
       if (!this.dataKey) {
         return;
       }
-      this.drawMainScene = null;
-      this.view = null;
+      this.canvasLoading = true
+      this.clearGraphy()
       // 初始化view类
       this.view = new SGraphyView("floorCanvas");
       this.drawMainScene = new FloorScene(null);
@@ -133,6 +70,7 @@ export default {
       this.drawMainScene.getFloorData('/modelapi/base-graph/query', { ModelId: ModelId }).then(res => {
         that.view.scene = that.drawMainScene
         that.view.fitSceneToView();
+        this.canvasLoading = false
       })
       if (this.isScale) {
         this.cancelScale(this.view);
@@ -154,10 +92,12 @@ export default {
       //计算缩放比例
       this.view.scale = val;
     },
-    clearGraphy(){
-      this.drawMainScene.root.children = null
-      this.drawMainScene = null;
-      this.view = null;
+    clearGraphy() {
+      if(this.drawMainScene){
+        this.drawMainScene.root.children = null
+        this.drawMainScene = null;
+        this.view = null;
+      }
     }
   },
   watch: {

+ 3 - 0
src/views/ready/buildfloor/index.vue

@@ -28,6 +28,9 @@
             <el-table-column label="楼层本地名">
               <template slot-scope="scope">{{scope.row.FloorLocalName||scope.row.FloorName}}</template>
             </el-table-column>
+            <el-table-column label="楼层顺序号">
+              <template slot-scope="scope">{{scope.row.FloorSequenceID}}</template>
+            </el-table-column>
             <el-table-column label="楼层信息">
               <template slot-scope="scope">
                 <el-button size="mini" @click="editFloorData(scope.row)" plain icon="el-icon-edit-outline"></el-button>

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

@@ -1,4 +1,5 @@
 <template>
+  <!-- 查看平面图页面 -->
   <div id="repetitionGraphy">
     <div class="buttons">
       <el-button icon="el-icon-back" size="mini" @click="backRouter"></el-button>
@@ -7,8 +8,7 @@
     </div>
     <!-- 展示图片 -->
     <div class="drawImg">
-      <drawFloor ref="drawFloor" :findGraphyItemId="findGraphyItemId" :point="point" :pointWidth="pointWidth"
-        :isScale="false" indexs="repetion"></drawFloor>
+      <drawFloor ref="drawFloor"></drawFloor>
     </div>
     <!-- 查看图片弹窗 -->
     <checkGraphy :checkGraphyVisible="checkGraphyVisible" @handleCloseCGraphy="checkGraphyVisible=false"></checkGraphy>
@@ -76,7 +76,7 @@ export default {
     position: absolute;
     left: 50%;
     bottom: 100px;
-    // margin-left: 
+    // margin-left:
   }
 }
 </style>