From e5e65bb50cbfb973f98191993ab559767eff7a53 Mon Sep 17 00:00:00 2001
From: suerprisePlus <15810472099@163.com>
Date: 星期二, 30 七月 2024 17:06:34 +0800
Subject: [PATCH] 页面添加(知识图谱,数据统计,数据分析,站点管理)

---
 src/views/visual/mapView/lineRoaming.vue |  118 ++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 97 insertions(+), 21 deletions(-)

diff --git a/src/views/visual/mapView/lineRoaming.vue b/src/views/visual/mapView/lineRoaming.vue
index 8ba57cd..5fb625a 100644
--- a/src/views/visual/mapView/lineRoaming.vue
+++ b/src/views/visual/mapView/lineRoaming.vue
@@ -1,19 +1,26 @@
 <template>
-    <Popup ref="pop" top="20px" left="calc(100% - 600px)" :title="title" @close="close(true)" width="300px" :maxHeight="'700px'" @cancel="close(false)">
-         <div class="menuBox">
-            <el-form ref="form"   label-width="80px">
-              <el-form-item label="绾胯矾:">
-               
-              </el-form-item>
-              <el-form-item label="绾胯矾:">
-          
-              </el-form-item>
-              <el-form-item>
-                <el-button size="mini" >寮�濮嬫极娓�</el-button>
-                <el-button size="mini" >缁撴潫婕父</el-button>
-              </el-form-item>
+    <Popup ref="pop" top="20px" left="calc(100% - 600px)" :title="title" @close="close(true)" width="300px"
+        :maxHeight="'700px'" @cancel="close(false)">
+        <div class="menuBox">
+            <el-form ref="form" label-width="80px">
+                <el-form-item label="绾胯矾:">
+                    <el-select v-model="value" @chagne="setLineOptionChagne" placeholder="璇烽�夋嫨">
+                        <el-option v-for="item in lineOption" :key="item.value" :label="item.name" :value="item.value">
+                        </el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="绾胯矾:">
+                    <el-select v-model="value1" placeholder="璇烽�夋嫨">
+                        <el-option v-for="item in lineOption1" :key="item.value" :label="item.name" :value="item.value">
+                        </el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item>
+                    <el-button size="mini" @click="setRoamStart">寮�濮嬫极娓�</el-button>
+                    <el-button size="mini" @click="setRoamStop">缁撴潫婕父</el-button>
+                </el-form-item>
             </el-form>
-         </div>
+        </div>
     </Popup>
 </template>
 
@@ -22,20 +29,26 @@
 import {
     zhangzitou_selectAllLine
 } from '@/api/mapView/map.js'
+import WKT from 'terraformer-wkt-parser';
 export default {
     name: 'location',
     components: { Popup },
     data() {
         return {
             title: '绾胯矾婕父',
+            lineOption: [],
+            lineOption1: [],
+            lineObj: null,
+            value: '',
+            value1: '',
+            roamLine: null,
         };
     },
-   
- 
+
+
     methods: {
         // 鍏抽棴寮圭獥
         close(isCloseBtn, removeLayer = true) {
-            //   removeLayer && this.removeImageLayer();
             // 閲嶇疆data鍊�
             Object.assign(this.$data, this.$options.data());
             !isCloseBtn && this.$refs.pop.close();
@@ -46,14 +59,77 @@
             this.$refs.pop.open();
             this.romaLineStart();
         },
-        romaLineStart(){
-            zhangzitou_selectAllLine({  
+        romaLineStart() {
+            zhangzitou_selectAllLine({
                 limit: 100000,
                 page: 1
-            }).then((response)=>{
-                console.log(response);
+            }).then((response) => {
+                if (response.data.code != 200) return
+                this.lineOption = [];
+                this.lineObj = response.data.result.pois;
+                this.lineObj.map(item => {
+                    if (this.lineOption.length == 0) {
+                        this.lineOption.push({
+                            name: item.line,
+                            value: item.line
+                        })
+                    } else {
+                        const n = this.lineOption.filter(r => {
+                            if (r.name == item.line) {
+                                return r
+                            }
+
+                        })
+                        if (n.length == 0) {
+                            this.lineOption.push({
+                                name: item.line,
+                                value: item.line
+                            })
+                        }
+                    }
+                })
+                this.value = this.lineOption[0].value
+                this.setLineOptionChagne();
             })
         },
+        setLineOptionChagne() {
+            const a = this.value
+            this.lineOption1 = [];
+            this.lineObj.map(item => {
+                if (item.line == a) {
+                    this.lineOption1.push({
+                        name: item.name,
+                        value: item.geom,
+                    })
+                }
+            })
+            this.value1 = this.lineOption1[0].value;
+            this.setLineOption1Chagne();
+
+        },
+        setLineOption1Chagne() {
+            this.roamLine = this.value1;
+        },
+        setRoamStart() {
+            if (!this.roamLine) return;
+            const obj = WKT.parse(this.roamLine).coordinates[0]
+            var degreesArr = obj.reduce((combined, current) => combined.concat(current), []);
+            earthCtrl.factory.getFlyData(degreesArr, data => {
+                data.showPoint = false;
+                data.showLine = true;
+                data.mode = 1;
+
+            })
+        },
+        setRoamStop(){
+
+        },
+
+
+
+
+
+
     },
 };
 </script>

--
Gitblit v1.9.3