whx 7 tháng trước cách đây
mục cha
commit
4755b1d67f
29 tập tin đã thay đổi với 85 bổ sung111 xóa
  1. 0 5
      virgo.wzfrontend/console/package-lock.json
  2. 0 1
      virgo.wzfrontend/console/package.json
  3. 5 2
      virgo.wzfrontend/console/public/index.html
  4. 48 63
      virgo.wzfrontend/console/src/components/work/common/amap.vue
  5. 1 1
      virgo.wzfrontend/console/src/components/work/common/selectLocation.vue
  6. 3 2
      virgo.wzfrontend/console/src/components/work/space/project/edit.vue
  7. 7 3
      virgo.wzfrontend/console/src/layout/website.vue
  8. 10 23
      virgo.wzfrontend/console/src/views/website/homeDetail.vue
  9. 1 1
      virgo.wzfrontend/src/main/resources/static/console/index.html
  10. 0 1
      virgo.wzfrontend/src/main/resources/static/console/static/css/2636.e193389d.css
  11. 0 1
      virgo.wzfrontend/src/main/resources/static/console/static/css/3428.e193389d.css
  12. 1 0
      virgo.wzfrontend/src/main/resources/static/console/static/css/6055.bd099838.css
  13. 1 0
      virgo.wzfrontend/src/main/resources/static/console/static/css/7023.bd099838.css
  14. 0 0
      virgo.wzfrontend/src/main/resources/static/console/static/css/8719.b3e4c47c.css
  15. 0 0
      virgo.wzfrontend/src/main/resources/static/console/static/css/8722.b3e4c47c.css
  16. 0 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/2636.bc43f291.js
  17. 0 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/3428-legacy.ff7723f9.js
  18. 1 0
      virgo.wzfrontend/src/main/resources/static/console/static/js/3760-legacy.901323f8.js
  19. 1 0
      virgo.wzfrontend/src/main/resources/static/console/static/js/3760.901323f8.js
  20. 1 0
      virgo.wzfrontend/src/main/resources/static/console/static/js/6055-legacy.dba86b51.js
  21. 1 0
      virgo.wzfrontend/src/main/resources/static/console/static/js/7023.68bce7a3.js
  22. 0 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/7194-legacy.a7a5f9d3.js
  23. 0 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/7194.a7a5f9d3.js
  24. 1 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/1515.8ae26c0f.js
  25. 1 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/7033-legacy.f76e3cb5.js
  26. 1 0
      virgo.wzfrontend/src/main/resources/static/console/static/js/app-legacy.aa709d40.js
  27. 0 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/app-legacy.feebc5c0.js
  28. 0 1
      virgo.wzfrontend/src/main/resources/static/console/static/js/app.cd5927c7.js
  29. 1 0
      virgo.wzfrontend/src/main/resources/static/console/static/js/app.f475c686.js

+ 0 - 5
virgo.wzfrontend/console/package-lock.json

@@ -15,11 +15,6 @@
 				"js-message": "1.0.7"
 			}
 		},
-		"@amap/amap-jsapi-loader": {
-			"version": "1.0.1",
-			"resolved": "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
-			"integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw=="
-		},
 		"@ampproject/remapping": {
 			"version": "2.3.0",
 			"resolved": "https://registry.npmmirror.com/@ampproject/remapping/-/remapping-2.3.0.tgz",

+ 0 - 1
virgo.wzfrontend/console/package.json

@@ -8,7 +8,6 @@
 		"lint": "vue-cli-service lint"
 	},
 	"dependencies": {
-		"@amap/amap-jsapi-loader": "^1.0.1",
 		"@babel/polyfill": "^7.12.1",
 		"autofit.js": "^3.1.3",
 		"core-js": "^3.3.2",

+ 5 - 2
virgo.wzfrontend/console/public/index.html

@@ -5,12 +5,15 @@
 		<meta http-equiv="X-UA-Compatible" content="IE=edge">
 		<link rel="icon" href="https://file-node.oss-cn-shanghai.aliyuncs.com/youji/2f7b4bfaf9e64817bc2cb46f3a632b01">
 		<link rel="stylesheet" type="text/css" href="<%= BASE_URL %>reset.css" />
-		<link rel="stylesheet" href="//at.alicdn.com/t/c/font_4358860_plro02z515r.css">
+		<link rel="stylesheet" href="//at.alicdn.com/t/c/font_4358860_plro02z515r.css">
+		<script type="text/javascript" src="http://api.tianditu.gov.cn/api?v=4.0&tk=72632adad893994a0450b55949c8a8fc">
+		</script>
 		<title>红链智慧建筑</title>
 		<script src="<%= BASE_URL %>jquery.js"></script>
 		<link rel="stylesheet" type="text/css" href="<%= BASE_URL %>icon/font.css" />
 		<script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.3/echarts.min.js"></script>
-		<script src="https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js"></script>
+		<script src="https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js"></script>
+		
 	</head>
 	<body id="body">
 		<noscript>

+ 48 - 63
virgo.wzfrontend/console/src/components/work/common/amap.vue

@@ -3,7 +3,9 @@
 		<div class="hui-flex-box hui-dialog-content" style="padding: 0;padding-bottom: 20px;">
 			<div class="map">
 				<div class="map-input" v-if="type == 'insert'">
-					<input type="text" placeholder="请输入地理位置" v-model="input" id="tipinput" />
+					<el-autocomplete v-model="input" :fetch-suggestions="querySearchAsync" placeholder="请输入地理位置"
+						@select="handleSelect">
+					</el-autocomplete>
 				</div>
 				<div ref="gaode_Map" id="gaode_Map"></div>
 			</div>
@@ -15,11 +17,6 @@
 	</div>
 </template>
 <script>
-	import AMapLoader from "@amap/amap-jsapi-loader"; //引入AMapLoader
-	window._AMapSecurityConfig = {
-		// 设置安全密钥
-		securityJsCode: "3e392dc7eb2cf2c04b1b8899776e8905",
-	};
 	export default {
 		props: ['coordinates', 'type'],
 		data() {
@@ -27,60 +24,52 @@
 				map: {},
 				input: '',
 				markers: [],
-				address: [116.397428, 39.90923],
-				visible: false
+				address: [116.39121, 39.90715],
+				visible: false,
+				timeout: null
 			}
 		},
 		created() {
-			if (this.coordinates) this.address = this.coordinates.split(',');
+			if (this.coordinates) {
+				this.address = this.coordinates.split(',');
+			}
 		},
 		mounted() {
 			this.initMap();
 		},
-		beforeDestroy() {
-			this.map && this.map.destroy();
-		},
 		methods: {
 			initMap() {
-				AMapLoader.load({
-					key: "880f8193c52d9dee80cd82212d9508cf", // 申请好的Web端开发者Key,首次调用 load 时必填
-					version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
-					plugins: ["AMap.AutoComplete", "AMap.PlaceSearch", "AMap.Geocoder"],
-				}).then((AMap) => {
-					this.map = new AMap.Map("gaode_Map", {
-						// 设置地图容器id
-						viewMode: "3D", //  是否为3D地图模式
-						zoom: 18, // 初始化地图级别
-						center: this.address, //中心点坐标
-						resizeEnable: true,
-					});
+				this.$nextTick(() => {
+					let position = new T.LngLat(this.address[0], this.address[1]);
+					this.map = new T.Map('gaode_Map');
+					this.map.centerAndZoom(position, 18);
 					this.setMarker();
-					if (this.type === 'look') return;
-					this.searchMap();
-					// 监听鼠标点击事件
-					this.map.on("click", this.clickMapHandler);
-				}).catch((e) => {});
+					this.map.addEventListener('click', this.clickMapHandler);
+				})
 			},
-			searchMap() {
-				// 搜索框自动完成类
-				let auto = new AMap.AutoComplete({
-					input: "tipinput", // 使用联想输入的input的id
-				});
-				//构造地点查询类
-				let placeSearch = new AMap.PlaceSearch({
-					map: this.map,
-				});
-				// 当选中某条搜索记录时触发
-				auto.on("select", e => {
-					if (e.poi.location) {
-						placeSearch.setCity(e.poi.adcode);
-						placeSearch.search(e.poi.name);
-						this.address = [e.poi.location.lng, e.poi.location.lat];
-						this.setMarker();
-					} else {
-						this.$message.error("查询地址失败,请重新输入地址");
+			querySearchAsync(queryString, cb) {
+				if (!queryString) return;
+				let search = new T.LocalSearch(this.map, {
+					pageCapacity: 6,
+					onSearchComplete: data => {
+						if (data.pois) {
+							let searchData = data.pois.map(node => {
+								return {
+									value: node.name + '-' + node.address,
+									lonlat: node.lonlat
+								}
+							});
+							cb(searchData)
+						}
 					}
-				});
+				})
+				search.search(queryString, 1);
+			},
+			handleSelect(item) {
+				this.address = item.lonlat.split(',');
+				this.map.clearOverLays();
+				this.map.panTo(new T.LngLat(this.address[0], this.address[1]));
+				this.setMarker();
 			},
 			// 点击地图事件获取经纬度,并添加标记
 			clickMapHandler(e) {
@@ -89,18 +78,12 @@
 			},
 			//  添加标记
 			setMarker() {
-				this.removeMarker();
-				let marker = new AMap.Marker({
-					position: this.address,
+				this.map.clearOverLays();
+				let position = new T.LngLat(this.address[0], this.address[1]);
+				let mark = new T.Marker(position, {
+					z: 12
 				});
-				marker.setMap(this.map);
-				this.markers.push(marker);
-			},
-			// 删除之前后的标记点
-			removeMarker() {
-				if (this.markers) {
-					this.map.remove(this.markers);
-				}
+				this.map.addOverLay(mark);
 			},
 			submit() {
 				this.$emit('callback', 'set', this.address);
@@ -133,12 +116,14 @@
 			box-shadow: 0 2px 2px rgba(0, 0, 0, .15);
 			border-radius: 3px;
 
-			input {
+			.el-autocomplete {
 				width: 100%;
 				height: 100%;
-				height: 38px;
-				line-height: 38px;
-				padding: 0 10px;
+			}
+
+			.el-input__inner {
+				color: #000;
+				border: none;
 			}
 		}
 	}

+ 1 - 1
virgo.wzfrontend/console/src/components/work/common/selectLocation.vue

@@ -15,7 +15,7 @@
 			</el-button>
 		</div>
 		<el-dialog :close-on-click-modal="false" title="选择位置" :visible.sync="visible" width="900px" :append-to-body="true">
-			<amap v-if="visible" :coordinates="coordinates" @callback="callback" :type="type"></amap>
+			<amap v-if="visible" :coordinates="address" @callback="callback" :type="type"></amap>
 		</el-dialog>
 	</div>
 

+ 3 - 2
virgo.wzfrontend/console/src/components/work/space/project/edit.vue

@@ -107,14 +107,14 @@
 					if (this.$store.getters.projectData.organizationId != this.$store.getters.organization.id) {
 						return this.$store.dispatch('projectBase/changeProjectData', {});
 					}
-					this.initForm(this.$store.getters.projectData);
+					// this.initForm(this.$store.getters.projectData);
 				}
 				this.projectForm['organizationId'] = this.$store.getters.organization.id;
 				this.showMap = true;
 			}
 		},
 		beforeDestroy() {
-			this.cacheData();
+			// this.cacheData();
 		},
 		methods: {
 			initForm(data) {
@@ -143,6 +143,7 @@
 				postData['coordinates'] = this.$refs.map.address;
 				postData['supportingFacilities'] = this.supportingFacilities.join(',');
 				postData['addressCode'] = this.$refs.city.addressCode();
+				console.log(postData);
 				return postData;
 			},
 			submit() {

+ 7 - 3
virgo.wzfrontend/console/src/layout/website.vue

@@ -71,9 +71,13 @@
 			},
 			initLocation() {
 				if (this.$store.getters.city && this.$store.getters.city.cityCode) return;
-				$.getJSON("https://restapi.amap.com/v3/ip?key=36b8970fe5bcfd92fe9e34e32d0e7461", res => {
-					let arr = city.filter(node => node.cityName == res.city.replace('市', ''));
-					this.$store.dispatch('app/changeCity', arr[0]);
+				$.getJSON("https://location.tianditu.gov.cn/data/getCityName?callback=query", res => {
+					if (res.code == 200) {
+						let arr = city.filter(node => node.cityName == res.data.cityShort);
+						this.$store.dispatch('app/changeCity', arr[0]);
+					} else {
+						this.$store.dispatch('app/changeCity', city[0]);
+					}
 				}).fail(error => {
 					this.$store.dispatch('app/changeCity', city[0]);
 				});

+ 10 - 23
virgo.wzfrontend/console/src/views/website/homeDetail.vue

@@ -124,7 +124,6 @@
 	import Swiper from 'swiper'; // 注意引入的是Swiper
 	import 'swiper/css/swiper.min.css' // 注意这里的引入
 	import houseFoot from "@/components/website/houseFoot.vue"
-	import AMapLoader from "@amap/amap-jsapi-loader"; //引入AMapLoader
 	import Crypto from '@/uitls/crypto'
 	import {
 		getToken
@@ -196,33 +195,21 @@
 						this.getSwiper();
 						if (this.detail.coordinates) {
 							this.coordinates = this.detail.coordinates.split(',');
-							this.initMap([this.coordinates[0], this.coordinates[1]]);
+							this.initMap();
 						}
 					}
 				})
 			},
-			initMap(position) {
-				window._AMapSecurityConfig = {
-					// 设置安全密钥
-					securityJsCode: "3e392dc7eb2cf2c04b1b8899776e8905",
-				};
-				AMapLoader.load({
-					key: "880f8193c52d9dee80cd82212d9508cf", //申请好的Web端开发者key,调用 load 时必填
-					version: "2.0", //指定要加载的 JS API 的版本,缺省时默认为 1.4.15
-				}).then((AMap) => {
-					//JS API 加载完成后获取AMap对象
-					const map = new AMap.Map("map", {
-						divMode: '2D', //默认使用 2D 模式
-						zoom: 20, //地图级别
-						center: position, //地图中心点
-					});
-					const marker = new AMap.Marker({
-						position: position,
+			initMap() {
+				this.$nextTick(() => {
+					let position = new T.LngLat(this.coordinates[0], this.coordinates[1]);
+					let map = new T.Map('map');
+					map.centerAndZoom(position, 18);
+					let mark = new T.Marker(position, {
+						z: 12
 					});
-					map.add(marker);
-				}).catch((e) => {
-					console.error(e); //加载错误提示
-				});
+					map.addOverLay(mark);
+				})
 			},
 			getSwiper() {
 				this.$nextTick(() => {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
virgo.wzfrontend/src/main/resources/static/console/index.html


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/css/2636.e193389d.css


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/css/3428.e193389d.css


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/css/6055.bd099838.css


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/css/7023.bd099838.css


virgo.wzfrontend/src/main/resources/static/console/static/css/1515.b3e4c47c.css → virgo.wzfrontend/src/main/resources/static/console/static/css/8719.b3e4c47c.css


virgo.wzfrontend/src/main/resources/static/console/static/css/7033.b3e4c47c.css → virgo.wzfrontend/src/main/resources/static/console/static/css/8722.b3e4c47c.css


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/2636.bc43f291.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/3428-legacy.ff7723f9.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/js/3760-legacy.901323f8.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/js/3760.901323f8.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/js/6055-legacy.dba86b51.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/js/7023.68bce7a3.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/7194-legacy.a7a5f9d3.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/7194.a7a5f9d3.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/1515.8ae26c0f.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/7033-legacy.f76e3cb5.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/js/app-legacy.aa709d40.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/app-legacy.feebc5c0.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/app.cd5927c7.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/js/app.f475c686.js