瀏覽代碼

modify canvas repeat replacedialog and fix text

haojianlong 5 年之前
父節點
當前提交
79c79b0c70

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

@@ -2,7 +2,7 @@
   <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
     <el-row class="filters">
       <el-col :span="9">
-        <el-input placeholder="输入设备名称或设备本地编码查询进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
+        <el-input placeholder="输入设备名称或设备本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
           <i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
         </el-input>
       </el-col>

+ 1 - 1
src/components/business_space/table/addEquip.vue

@@ -3,7 +3,7 @@
     <div class="search" style="margin-bottom:10px;">
       <div>
         <el-input
-          placeholder="输入设备名称或设备本地编码查询进行查询"
+          placeholder="输入设备名称或设备本地编码进行查询"
           style="width:300px;float:left;margin-right:10px;"
           v-model="search.filter"
           clearable

+ 1 - 1
src/components/ledger/cenote/dialog/addCenoteDialog.vue

@@ -2,7 +2,7 @@
   <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
     <el-row class="filters">
       <el-col :span="9">
-        <el-input placeholder="输入竖井名称或竖井本地编码查询进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
+        <el-input placeholder="输入竖井名称或竖井本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
           <i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
         </el-input>
       </el-col>

+ 1 - 1
src/components/ledger/cenote/dialog/addEquipDialog.vue

@@ -2,7 +2,7 @@
   <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
     <el-row class="filters">
       <el-col :span="9">
-        <el-input placeholder="输入设备名称或设备本地编码查询进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
+        <el-input placeholder="输入设备名称或设备本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
           <i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
         </el-input>
       </el-col>

+ 1 - 1
src/components/ready/buildfloor/formItems.vue

@@ -88,7 +88,7 @@ export default {
     }
   }
   /deep/ .FloorTypeSelect .el-form-item__content {
-    width: 178px;
+    width: 200px;
   }
 }
 </style>

+ 7 - 3
src/views/ready/buildfloor/addFloor/index.vue

@@ -1,8 +1,8 @@
 <template>
   <el-dialog :title="title" :visible.sync="dialogVisible" width="40%" @close="handleClose" id="messageDialog">
-    <div>
+    <el-row>
       <formItems :type="'Floor'" ref="formItems"></formItems>
-    </div>
+    </el-row>
     <span slot="footer" class="dialog-footer">
       <el-button size="small" @click="dialogVisible=false">取消</el-button>
       <el-button size="small" type="primary" @click="confirm">确认</el-button>
@@ -89,13 +89,17 @@ export default {
 </script>
 <style lang="scss" scoped>
 #messageDialog {
+  /deep/ .el-dialog__body {
+    height: 420px;
+    overflow: auto;
+  }
   .el-form-item {
     /deep/ label.el-form-item__label {
       font-size: 12px;
     }
   }
   /deep/ .FloorTypeSelect .el-form-item__content {
-    width: 178px;
+    width: 200px;
   }
 }
 </style>

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

@@ -59,12 +59,12 @@ export default {
         return
       }
       let pa = {
-        Content: [{ FloorId: this.floor.FloorID, Id: this.modelIdToFloorId[this.jsonKey] }]
+        Content: [{ FloorId: this.floor.FloorID, Id: this.modelIdToFloorId[this.jsonKey], BuildingId: this.floor.BuildID }]
       };
       bindFloorModel(pa, res => {
         this.$message.success("更新成功");
         this.handleClose()
-        this.$emit('refresh')
+        this.$emit('refresh', this.jsonKey)
       });
     },
     // 点击多级联动

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

@@ -44,7 +44,6 @@ export default {
     }
   },
   created() {
-    this.modelId = this.$route.query.modelId;
     this.FloorID = this.$route.query.FloorID;
     this.OutlineFlag = this.$route.query.OutlineFlag;
   },
@@ -55,9 +54,8 @@ export default {
   methods: {
     initGraphy(ModelId) {
       let that = this;
+      that.modelId = ModelId;
       that.clearGraphy()
-      let id = `floorCanvas${that.id}`;
-      that.view = new SGraphyView(id)
       that.drawMainScene = new DivideFloorScene();
       that.canvasLoading = true;
       that.drawMainScene.getFloorData('/modelapi/base-graph/query', { ModelId: ModelId }).then(res => {
@@ -74,8 +72,10 @@ export default {
           that.canvasLoading = false;
           that.view.maxScale = that.view.scale * 10;
           that.view.minScale = that.view.scale;
-          that.$refs.canvasFun.everyScale = that.view.scale;
           that.drawMainScene.isSpaceSelectable = false;
+          if (this.$refs.canvasFun) {
+            that.$refs.canvasFun.everyScale = that.view.scale;
+          }
           if (that.OutlineFlag) {
             this.getFloorData()
           }
@@ -96,10 +96,11 @@ export default {
     // 清空平面图
     clearGraphy() {
       if (this.view) {
-        this.drawMainScene.root.children = null;
-        this.drawMainScene = null;
-        this.view = null;
+        this.view.scene = null;
+        return
       }
+      let id = `floorCanvas${this.id}`;
+      this.view = new SGraphyView(id)
     },
     // canvas 获取焦点
     focus() {
@@ -144,6 +145,9 @@ export default {
     redo() { },
     // 缩放
     scale(val) {
+      if (!this.view) {
+        return;
+      }
       let scale = this.view.scale;
       this.view.scaleByPoint(val / scale, this.cadWidth / 2, this.cadHeight / 2)
     },

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

@@ -237,7 +237,7 @@ export default {
         this.modelId = "";
       } else {
         this.modelId = row.ModelId;
-        let pa = { modelId: this.modelId, FloorID: row.FloorID }
+        let pa = { modelId: this.modelId, FloorID: row.FloorID, BuildID: row.BuildID }
         if (row.Outline && row.Outline.length) {
           pa.OutlineFlag = true;
         }

+ 14 - 2
src/views/ready/buildfloor/repetitionGraphy.vue

@@ -34,6 +34,8 @@ export default {
   created() {
     this.modelId = this.$route.query.modelId;
     this.FloorID = this.$route.query.FloorID;
+    this.BuildID = this.$route.query.BuildID;
+    this.OutlineFlag = this.$route.query.OutlineFlag;
   },
   mounted() {
     this.$refs.drawFloor.initGraphy(this.modelId)
@@ -45,7 +47,7 @@ export default {
     },
     // 替换模型文件
     changeGraphy() {
-      this.$refs.checkGraphy.showDialog({ FloorID: this.FloorID })
+      this.$refs.checkGraphy.showDialog({ FloorID: this.FloorID, BuildID: this.BuildID })
     },
     // 确认保存
     confirm() {
@@ -77,8 +79,18 @@ export default {
     editGraphy() {
       this.isEdit = true;
     },
-    refresh() { }
+    // 替换模型文件成功
+    refresh(modelId) {
+      this.modelId = modelId
+    }
   },
+  watch: {
+    modelId(n, o) {
+      if (o && n != o) {
+        this.$refs.drawFloor.initGraphy(n)
+      }
+    }
+  }
 };
 </script>
 <style lang="less">