From 13313f7a3d725783e08a7e6c9727c88ca9486010 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 05 Aug 2022 11:49:59 +0800
Subject: [PATCH] 设置token,卷帘

---
 src/components/selectTime/index.vue |  102 ++++++++++++++++-----------------------------------
 1 files changed, 32 insertions(+), 70 deletions(-)

diff --git a/src/components/selectTime/index.vue b/src/components/selectTime/index.vue
index c0fed82..6c12b73 100644
--- a/src/components/selectTime/index.vue
+++ b/src/components/selectTime/index.vue
@@ -2,7 +2,7 @@
     <!--时间线-->
     <div>
         <div class="current-select" @click="listFlag = !listFlag">
-            <div class="title">2019-2M第一季度</div>
+            <div class="title">{{ currentTitle }}</div>
             <i class="el-icon-caret-bottom"></i>
         </div>
 
@@ -43,13 +43,14 @@
 
     methods: {
         init () {
-            this.currentTitle = this.selectList[0].title
-            this.currentIndex = 0
-
             if (this.leftOrRight == 'left') {
-                this.leftAddLayer()
+                this.currentTitle = this.selectList[0].title
+                this.currentIndex = 0
+                this.leftAddLayer(this.selectList[0])
             } else {
-                this.rightAddLayer()
+                this.currentTitle = this.selectList[1].title
+                this.currentIndex = 1
+                this.rightAddLayer(this.selectList[1])
             }
         },
 
@@ -61,76 +62,32 @@
             }
         },
 
-        leftAddLayer () {
+        leftAddLayer (params) {
             leftCurrentLayer = global.viewer.imageryLayers.addImageryProvider(
                 new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
-                    url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengyjjddom/MapServer/WMTS',
-                    // url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer/WMTS',
-                    layer: 'nanchengyjjddom',
-                    style: 'default',
-                    tileMatrixSetID: 'default028mm',
-                    format: 'image/png',
-                    tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(),
-                    maximumLevel: 19,
-                    tileMatrixLabels: [
-                        '0',
-                        '1',
-                        '2',
-                        '3',
-                        '4',
-                        '5',
-                        '6',
-                        '7',
-                        '8',
-                        '9',
-                        '10',
-                        '11',
-                        '12',
-                        '13',
-                        '14',
-                        '15',
-                        '16',
-                        '17',
-                        '18',
-                        '19'
-                    ]
+                    url: params.url,
+                    layer: params.layer,
+                    style: params.style,
+                    tileMatrixSetID: params.tileMatrixSetID,
+                    format: params.format,
+                    tilingScheme: params.tilingScheme,
+                    maximumLevel: params.maximumLevel,
+                    tileMatrixLabels: params.tileMatrixLabels
                 }), 10
             )
         },
 
-        rightAddLayer () {
+        rightAddLayer (params) {
             rightCurrentLayer = global.viewer.mapSplit.addBaseLayer(
                 new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
-                    url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer/WMTS',
-                    // url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/nanchengdom/MapServer/WMTS',
-                    layer: 'nanchengdom',
-                    style: 'default',
-                    tileMatrixSetID: 'default028mm',
-                    format: 'image/png',
-                    tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(),
-                    maximumLevel: 19,
-                    tileMatrixLabels: [
-                        '0',
-                        '1',
-                        '2',
-                        '3',
-                        '4',
-                        '5',
-                        '6',
-                        '7',
-                        '8',
-                        '9',
-                        '10',
-                        '11',
-                        '12',
-                        '13',
-                        '14',
-                        '15',
-                        '16',
-                        '17',
-                        '18',
-                        '19'
-                    ]
+                    url: params.url,
+                    layer: params.layer,
+                    style: params.style,
+                    tileMatrixSetID: params.tileMatrixSetID,
+                    format: params.format,
+                    tilingScheme: params.tilingScheme,
+                    maximumLevel: params.maximumLevel,
+                    tileMatrixLabels: params.tileMatrixLabels
                 }), 21
             )
         },
@@ -200,12 +157,15 @@
             }
 
             if (this.leftOrRight) {
+                this.currentTitle = item.title
+                this.currentIndex = index
+
                 if (this.leftOrRight == 'left') {
                     this.removeLeftAddLayer()
-                    this.leftAddLayer()
+                    this.leftAddLayer(item)
                 } else {
                     this.removeRightAddLayer()
-                    this.rightAddLayer()
+                    this.rightAddLayer(item)
                 }
 
                 this.listFlag = false
@@ -279,6 +239,8 @@
 
     li {
         line-height: 30px;
+        text-align: center;
+        cursor: pointer;
     }
 }
 </style>

--
Gitblit v1.9.3