From 9ce29c536ba2a636416c618761985e2b9a711ee6 Mon Sep 17 00:00:00 2001
From: lxl <lixuliang_hd@126.com>
Date: 星期四, 27 十月 2022 14:17:45 +0800
Subject: [PATCH] user

---
 src/views/Synthesis/plotting.vue |  197 ++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 160 insertions(+), 37 deletions(-)

diff --git a/src/views/Synthesis/plotting.vue b/src/views/Synthesis/plotting.vue
index f4313d4..dd33b88 100644
--- a/src/views/Synthesis/plotting.vue
+++ b/src/views/Synthesis/plotting.vue
@@ -11,65 +11,188 @@
         </div>
         <div class="div_li">{{ $t(item.name) }}</div>
       </li>
+      <li v-if="plotStatus.delete" style="margin-left: 20px">
+        <div class="divli">
+          <div class="backimge8"><i class="el-icon-delete"></i></div>
+        </div>
+        <div class="div_li">鍒犻櫎</div>
+      </li>
+      <li v-if="plotStatus.upload" style="margin-left: 20px">
+        <div class="divli">
+          <div class="backimge8"><i class="el-icon-upload2"></i></div>
+        </div>
+        <div class="div_li">涓婁紶</div>
+      </li>
+      <li v-if="plotStatus.upload" style="margin-left: 20px">
+        <div class="divli">
+          <div class="backimge8"><i class="el-icon-plus"></i></div>
+        </div>
+        <div class="div_li">鏂板</div>
+      </li>
+      <li v-if="plotStatus.upload" style="margin-left: 20px">
+        <div class="divli">
+          <div class="backimge8"><i class="el-icon-edit"></i></div>
+        </div>
+        <div class="div_li">淇敼</div>
+      </li>
     </ul>
+    <terrainDig ref="terrainDig" />
+    <modelPress ref="modelPress" />
   </div>
 </template>
 
 <script>
+// 娴嬮噺-淇℃伅寮圭獥
+import terrainDig from '../Tools/terrainDig.vue';
+import modelPress from '../Tools/modelPress.vue';
 export default {
+  components: { terrainDig, modelPress },
   data() {
     return {
+      plotStatus: {
+        delete: false,
+        upload: false,
+        insert: false,
+        update: false,
+      },
       itemsOne: [
         {
-          id: "1",
-          name: "synthesis.point",
-          class: "h1",
+          id: '1',
+          name: 'synthesis.point',
+          class: 'h1',
         },
         {
-          id: "2",
-          name: "synthesis.line",
-          class: "h2",
+          id: '2',
+          name: 'synthesis.line',
+          class: 'h2',
         },
         {
-          id: "3",
-          name: "synthesis.rectangle",
-          class: "h3",
+          id: '3',
+          name: 'synthesis.rectangle',
+          class: 'h3',
         },
         {
-          id: "4",
-          name: "synthesis.polygon",
-          class: "h4",
+          id: '4',
+          name: 'synthesis.polygon',
+          class: 'h4',
         },
         {
-          id: "7",
-          name: "synthesis.symboliclabel",
-          class: "h7",
+          id: '7',
+          name: 'synthesis.symboliclabel',
+          class: 'h7',
         },
         {
-          id: "5",
-          name: "synthesis.flatterrain",
-          class: "h5",
+          id: '5',
+          name: 'synthesis.flatterrain',
+          class: 'h5',
         },
         {
-          id: "6",
-          name: "synthesis.terrainexcavation",
-          class: "h6",
+          id: '6',
+          name: 'synthesis.terrainexcavation',
+          class: 'h6',
         },
         {
-          id: "8",
-          name: "synthesis.removepaint",
-          class: "h8",
+          id: '8',
+          name: 'synthesis.removepaint',
+          class: 'h8',
         },
       ],
     };
   },
+  created() {
+    var cover_Id = this.$store.state.syntiesis.menu;
+    var cover_perms = this.$store.state.permsEntity;
+
+    for (var i = 0; i < cover_perms.length; i++) {
+      if (cover_perms[i].pid == cover_Id) {
+        this.showViewMenu(cover_perms[i]);
+      }
+    }
+  },
   methods: {
+    showViewMenu(res) {
+      if (res.cnName != '鏍囩粯') return;
+      switch (res.tag) {
+        case '/delete':
+          this.plotStatus.delete = true;
+          break;
+        case '/upload':
+          this.plotStatus.upload = true;
+          break;
+        case '/insert':
+          this.plotStatus.insert = true;
+          break;
+        case '/update':
+          this.plotStatus.update = true;
+          break;
+      }
+    },
     changePlot(res) {
-      var res_val = {
-        url: "",
-        name: res.name,
-      };
-      this.$bus.$emit("changetool", res_val);
+      switch (res.id) {
+        case '1':
+          sgworld.Creator.createSimpleGraphic(
+            'point',
+            {},
+            function (entity) {}
+          );
+          break;
+        case '2':
+          sgworld.Creator.createSimpleGraphic(
+            'polyline',
+            {},
+            function (entity) {}
+          );
+          break;
+        case '3':
+          sgworld.Creator.createSimpleGraphic(
+            'rectangle',
+            {},
+            function (entity) {}
+          );
+          break;
+        case '4':
+          sgworld.Creator.createSimpleGraphic(
+            'polygon',
+            {},
+            function (entity) {}
+          );
+          break;
+        case '6':
+          if (window.Excavation) {
+            window.Excavation.clear();
+            window.Excavation = null;
+          } else {
+            this.$refs.terrainDig.open();
+          }
+
+          break;
+        case '5':
+          if (window.TerrainFlattening) {
+            window.TerrainFlattening.remove();
+            window.TerrainFlattening = null;
+          } else {
+            this.$refs.modelPress.open();
+          }
+
+          break;
+        case '7':
+          sgworld.Creator.createModelLibrary();
+          break;
+        case '8':
+          this.clearAll();
+          break;
+      }
+    },
+    clearAll() {
+      sgworld.Creator.SimpleGraphic.clear();
+      if (window.Excavation) {
+        window.Excavation.clear();
+        window.Excavation = null;
+      }
+      if (window.TerrainFlattening) {
+        window.TerrainFlattening.remove();
+        window.TerrainFlattening = null;
+      }
     },
   },
 };
@@ -95,34 +218,34 @@
   margin: 0px;
 }
 .h1 {
-  background: url("../../assets/img/synthesis/妞渾 5 鎷疯礉 3.png") no-repeat
+  background: url('../../assets/img/synthesis/妞渾 5 鎷疯礉 3.png') no-repeat
     center;
 }
 .h2 {
-  background: url("../../assets/img/synthesis/妞渾 3 鎷疯礉 16.png") no-repeat
+  background: url('../../assets/img/synthesis/妞渾 3 鎷疯礉 16.png') no-repeat
     center;
 }
 .h3 {
-  background: url("../../assets/img/synthesis/妞渾 3 鎷疯礉 20.png") no-repeat
+  background: url('../../assets/img/synthesis/妞渾 3 鎷疯礉 20.png') no-repeat
     center;
 }
 .h4 {
-  background: url("../../assets/img/synthesis/妞渾 3 鎷疯礉 23.png") no-repeat
+  background: url('../../assets/img/synthesis/妞渾 3 鎷疯礉 23.png') no-repeat
     center;
 }
 .h5 {
-  background: url("../../assets/img/synthesis/鐭╁舰 14 鎷疯礉.png") no-repeat
+  background: url('../../assets/img/synthesis/鐭╁舰 14 鎷疯礉.png') no-repeat
     center;
 }
 .h6 {
-  background: url("../../assets/img/synthesis/鐭╁舰 14 鎷疯礉 7.png") no-repeat
+  background: url('../../assets/img/synthesis/鐭╁舰 14 鎷疯礉 7.png') no-repeat
     center;
 }
 .h7 {
-  background: url("../../assets/img/synthesis/鏂囨湰椋庢牸.png") no-repeat center;
+  background: url('../../assets/img/synthesis/鏂囨湰椋庢牸.png') no-repeat center;
 }
 .h8 {
-  background: url("../../assets/img/synthesis/娓呴櫎.png") no-repeat center;
+  background: url('../../assets/img/synthesis/娓呴櫎.png') no-repeat center;
 }
 .backimge8 {
   width: 30px;

--
Gitblit v1.9.3