Переглянути джерело

增加了列表地图交互

sujunling 5 місяців тому
батько
коміт
abd0e32924

+ 88 - 3
src/views/groupPage/districtPageModules/decisionSupport/constructionProgressSimulation/BottomBox.vue

@@ -48,9 +48,7 @@
           >
           <el-table-column prop="" label="查看区域">
             <template slot-scope="scope">
-              <el-button class="tdbutton" size="mini" type="primary" @click="openNewNode(scope.row.step)"
-                >查看</el-button
-              >
+              <el-button class="tdbutton" size="mini" type="primary" @click="addMarker(scope.row)">查看</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -72,6 +70,10 @@ export default {
     }
   },
   mounted() {
+    viewer.overlay = {
+      list: []
+    }
+
     window.init = function () {
       // 定义请求数据
       const requestData = {
@@ -121,6 +123,7 @@ export default {
       this.best_schedule = best_schedule
       this.titleList = t
       this.tableData = t[this.activeName].schedule
+      //   this.tableData[0].joint_unit = ['B']
     },
 
     getDate(isoDate) {
@@ -151,6 +154,88 @@ export default {
           eventBus.emit('best_schedule', arr)
         }
       }
+    },
+
+    addMarker(r) {
+      if (viewer.overlay && viewer.overlay.list && viewer.overlay.list.length) {
+        for (var i = 0; i < viewer.overlay.list.length; i++) {
+          viewer.entities.remove(viewer.overlay.list[i])
+        }
+      } else {
+        viewer.overlay.list = []
+      }
+      var list = {
+        A: [
+          [111.28617392592109, 30.690762879728375],
+          [111.28634705606925, 30.69098285392147],
+          [111.28678862317192, 30.690738044523563],
+          [111.28633188260623, 30.69010639622541],
+          [111.28585748839016, 30.69034560843397],
+          [111.28617392592109, 30.690762879728375]
+        ],
+        B: [
+          [111.28633188260623, 30.69010639622541],
+          [111.28678862317192, 30.69073804452356],
+          [111.28711359561618, 30.69055787467016],
+          [111.28666699327329, 30.68993741567625],
+          [111.28633188260623, 30.69010639622541]
+        ],
+        C: [
+          [111.28698435309421, 30.689777384704673],
+          [111.28666699327329, 30.68993741567625],
+          [111.28711359561618, 30.69055787467016],
+          [111.2874096185659, 30.690393753583784],
+          [111.28698435309421, 30.689777384704673]
+        ],
+        D: [
+          [111.28737189745326, 30.68958196090819],
+          [111.28698435309421, 30.68977738470467],
+          [111.2874096185659, 30.69039375358378],
+          [111.28779367049783, 30.69018082562396],
+          [111.28737189745326, 30.68958196090819]
+        ],
+        E: [
+          [111.28779367049783, 30.690180825623962],
+          [111.2880461592682, 30.690040838431216],
+          [111.28761529108642, 30.689459225815664],
+          [111.28737189745326, 30.68958196090819],
+          [111.28779367049783, 30.690180825623962]
+        ]
+      }
+      if (r.joint_unit && r.joint_unit.length) {
+        r.joint_unit.map((i) => {
+          var pos = []
+          for (var j = 0; j < list[i].length; j++) {
+            var l = list[i][j]
+            pos.push(Cesium.Cartesian3.fromDegrees(l[0], l[1]))
+          }
+          var line = viewer.entities.add({
+            polyline: {
+              positions: pos,
+              width: 3,
+              followSurface: true,
+              material: Cesium.Color.fromCssColorString('rgba(14,234,255,0.9)'),
+              clampToGround: true
+            }
+          })
+          viewer.flyTo(line, {
+            duration: 1
+          })
+          viewer.overlay.list.push(line)
+        })
+      }
+    },
+
+    toCartesian3(p, h) {
+      if (p) {
+        if (p instanceof Cartesian3) {
+          return p
+        } else {
+          var o = getXY(p)
+          var z = p.z || p[2] || '0.0'
+          return Cartesian3.fromDegrees(Number(o.x), Number(o.y), Number(h || z))
+        }
+      }
     }
   }
 }

+ 3 - 1
src/views/groupPage/districtPageModules/decisionSupport/constructionProgressSimulation/index.vue

@@ -20,6 +20,7 @@ import LeftBox from './LeftBox.vue'
 import RightBox from './RightBox.vue'
 import BottomBox from './BottomBox.vue'
 import { getResultList } from 'staticPub/config'
+import CesiumDraw from '@/views/pipelineDefect/common/cesiumDraw'
 
 export default {
   name: 'constructionProgressSimulation',
@@ -158,7 +159,8 @@ export default {
         })
     },
 
-    changeTable(r) {}
+    changeTable(r) {},
+
   }
 }
 </script>