DESKTOP-CRQ4N2U\jintian %!s(int64=2) %!d(string=hai) anos
pai
achega
258beb42ed
Modificáronse 1 ficheiros con 41 adicións e 40 borrados
  1. 41 40
      src/views/Map3d/components/mapNavigate.vue

+ 41 - 40
src/views/Map3d/components/mapNavigate.vue

@@ -58,11 +58,11 @@
 			return {
 				currentIndex: -1,
 				isindex: 0, //判断选中第几个标题
-				cityList: [{
-					label: '南部山区',
+				cityList: [{ //tab数组展示列表
+					label: '牟平',
 					number: 0,
 					dj: 1
-				}], //tab数组展示列表
+				}],
 				activeName: 0, //选中的下标牵引
 				ALLlist: [], //所有子集城市
 				downlist: [], //村集
@@ -123,6 +123,7 @@
 					this.isindex = index
 					this.activeName = index
 
+					this.remove();
 					//全图事件
 					this.$parent.$parent.$refs.refMap3d.fullMap(jt3d);
 				}
@@ -143,41 +144,41 @@
 				}
 
 				//如果等级为1,代表点击的乡镇,需要重新设置ALLlist为村庄列表,并在头部添加乡镇名称
-				// 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
-				// 				})
-				// 			}
-				// 		)
-				// 	})
-				// }
+				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: 2
+								})
+							}
+						)
+					})
+				}
 
 				//根据等级与id获取乡镇或者村庄的面坐标
 				this.$http.get('/getGeoJson', {
-					tableName: 'xzqh', //
-					sqlWhere: " zldwdm like '" + regioncode + "%'",
+					tableName: 'map_region', //
+					sqlWhere: "dj = " + dj + " and regioncode like '" + regioncode + "%'",
 					orderByField: ''
 				}).then(res => {
 
@@ -241,7 +242,7 @@
 							}, 500)
 							setTimeout(res => {
 								clearInterval(timer)
-								
+
 								_this.hide();
 							}, 2100)
 						})
@@ -255,16 +256,16 @@
 				this.dj = 1
 				this.ALLlist = []
 				this.$http.get("/getTableList", {
-					tableName: "xzqh",
-					sqlWhere: "zldwdm like '3701120162%'",
+					tableName: "map_region",
+					sqlWhere: "dj = 1",
 					orderByField: ''
 				}).then(res => {
 					res.data.forEach(
 						item => {
 							console.log('街道信息', item)
 							this.ALLlist.push({
-								label: item.zldwmc,
-								regioncode: item.zldwdm,
+								label: item.regionname,
+								regioncode: item.regioncode,
 								dj: 1
 							})
 						}