Browse Source

区域导航

DESKTOP-CRQ4N2U\jintian 2 years ago
parent
commit
498e8d6238
1 changed files with 46 additions and 47 deletions
  1. 46 47
      src/views/Map3d/components/mapNavigate.vue

+ 46 - 47
src/views/Map3d/components/mapNavigate.vue

@@ -59,7 +59,7 @@
 				currentIndex: -1,
 				isindex: 0, //判断选中第几个标题
 				cityList: [{
-					label: '牟平',
+					label: '南部山区',
 					number: 0,
 					dj: 1
 				}], //tab数组展示列表
@@ -135,6 +135,7 @@
 			 * * dj  村镇等级
 			 */
 			selectCity(label, index, regioncode, dj) {
+
 				let _this = this
 
 				if (!regioncode) {
@@ -142,41 +143,44 @@
 				}
 
 				//如果等级为1,代表点击的乡镇,需要重新设置ALLlist为村庄列表,并在头部添加乡镇名称
-				if (dj == 1) {
-					this.cityList.push({
-						label: label,
-						number: index,
-						dj: 2
-					})
-					var id = regioncode.slice(0, 9)
-					this.isindex = index
-					this.activeName = index
-					this.$http.get('/getTableList', {
-						tableName: 'map_region', //
-						sqlWhere: "dj = 2 and regioncode like '" + id + "%'",
-						orderByField: ''
-					}).then(res => {
-						if(res.data.length == 0) return
-						this.dj = 2
-						this.ALLlist = []
-						res.data.forEach(
-							item => {
-								this.ALLlist.push({
-									label: item.regionname,
-									regioncode: item.regioncode,
-									dj: item.dj
-								})
-							}
-						)
-					})
-				}
+				// if (dj == 1) {
+				// 	this.cityList.push({
+				// 		label: label,
+				// 		number: index,
+				// 		dj: 2
+				// 	})
+
+				// 	// var id = regioncode.slice(0, 9)
+				// 	var id = "3701120162"
+
+				// 	this.isindex = index
+				// 	this.activeName = index
+				// 	this.$http.get('/getTableList', {
+				// 		tableName: 'xzqh', //
+				// 		sqlWhere: " zldwdm like '" + id + "%'",
+				// 		orderByField: ''
+				// 	}).then(res => {
+				// 		this.dj = 2
+				// 		this.ALLlist = []
+				// 		res.data.forEach(
+				// 			item => {
+				// 				this.ALLlist.push({
+				// 					label: item.zldwmc,
+				// 					regioncode: item.zldwdm,
+				// 					dj: 2
+				// 				})
+				// 			}
+				// 		)
+				// 	})
+				// }
 
 				//根据等级与id获取乡镇或者村庄的面坐标
 				this.$http.get('/getGeoJson', {
-					tableName: 'map_region', //
-					sqlWhere: "dj = " + dj + " and regioncode like '" + regioncode + "%'",
+					tableName: 'xzqh', //
+					sqlWhere: " zldwdm like '" + regioncode + "%'",
 					orderByField: ''
 				}).then(res => {
+
 					if (window["viewer"].dataSources.getByName('标绘区')) {
 						window["viewer"].dataSources.remove(window["viewer"].dataSources.getByName('标绘区')[0])
 					}
@@ -215,7 +219,7 @@
 							[50, 160, 255, 77]
 						]
 
-						let flyPromise = window["viewer"].flyTo(entities, {
+						let flyPromise = window["viewer"].flyTo(entity, {
 							duration: options.duration,
 							offset: {
 								heading: Cesium.Math.toRadians(options.heading),
@@ -224,8 +228,6 @@
 							}
 						});
 						flyPromise.then(res => {
-							let isremove = true
-
 							//面首次加载颜色
 							const entity = entities[0];
 							entity.polygon.material = Cesium.Color.fromBytes(colorList[0][0],
@@ -234,39 +236,36 @@
 							let idx = 1
 							let timer = setInterval(res => {
 								const entity = entities[0];
-								entity.polygon.material = Cesium.Color.fromBytes(
-									colorList[idx][0], colorList[idx][1],
-									colorList[idx][2], colorList[idx][3])
+								entity.polygon.material = Cesium.Color.fromBytes(colorList[idx][0], colorList[idx][1], colorList[idx][2], colorList[idx][3]);
 								idx++
 							}, 500)
 							setTimeout(res => {
 								clearInterval(timer)
 								
 								_this.hide();
-								
 							}, 2100)
 						})
 					});
 				})
-
 			},
 
+			//获取一级街道
 			getcityList() {
+
 				this.dj = 1
 				this.ALLlist = []
-				this.$http.get('/getTableList', {
-					tableName: 'map_region',
-					sqlWhere: 'dj = 1',
+				this.$http.get("/getTableList", {
+					tableName: "xzqh",
+					sqlWhere: "zldwdm like '3701120162%'",
 					orderByField: ''
 				}).then(res => {
-					if(res.data.length == 0) return
 					res.data.forEach(
 						item => {
-							console.log('城镇信息', item)
+							console.log('街道信息', item)
 							this.ALLlist.push({
-								label: item.regionname,
-								regioncode: item.regioncode,
-								dj: item.dj
+								label: item.zldwmc,
+								regioncode: item.zldwdm,
+								dj: 1
 							})
 						}
 					)