| | |
| | | orgId: 71, |
| | | city: '苏州', |
| | | formInline: { |
| | | city: '鞍山市', |
| | | cityCode: '210300', |
| | | city: '海城市', |
| | | cityCode: '210381', |
| | | dayType: 'hour', |
| | | starTime: '', |
| | | endTime: '', |
| | |
| | | } }, |
| | | { code: 'a21026', |
| | | name: 'SO2', |
| | | maxNumber: 2100, |
| | | maxNumber: 1000, |
| | | src: require('@/assets/images/tl_SO2.png'), |
| | | gradient: { |
| | | '0': '#12a112', |
| | | '0.02': '#12a112', |
| | | '0.07': '#feff01', |
| | | '0.22': '#fd8200', |
| | | '0.38': '#fd0001', |
| | | '0.76': '#95014b', |
| | | '0.05': '#12a112', |
| | | '0.15': '#feff01', |
| | | '0.47': '#fd8200', |
| | | '0.8': '#fd0001', |
| | | '0.9': '#95014b', |
| | | '1': '#7e0226' |
| | | } }, |
| | | { code: 'a21004', |
| | |
| | | maxNumber: 48, |
| | | src: require('@/assets/images/tl_CO.png'), |
| | | gradient: { |
| | | '0': '#12a112', |
| | | '0.0': '#12a112', |
| | | '0.04': '#12a112', |
| | | '0.083': '#feff01', |
| | | '0.29': '#fd8200', |
| | |
| | | } |
| | | }, |
| | | mounted () { |
| | | let dataTime = dayjs().format('YYYY-MM-DD') |
| | | this.getOrganizationId() |
| | | this.getData(`${dataTime} 00`) |
| | | this.$nextTick(() => { |
| | | this.initMap() |
| | | this.createHeatMap() |
| | |
| | | }, |
| | | getPollutant (data) { |
| | | this.selectSensor = _.find(this.sensorArr, { name: data }) |
| | | this.dateTimes = [] |
| | | if (this.heatmap) { |
| | | this.map.remove(this.heatmap) |
| | | this.heatmap = null |
| | |
| | | init1 () { // 区域遮盖 |
| | | var that = this |
| | | this.map.setCity(this.formInline.city) |
| | | console.log('this.formInline.city', this.formInline.cityCode) |
| | | console.log('海城', this.formInline.cityCode) |
| | | if (that.polygon) { |
| | | that.map.remove(that.polygon) |
| | | } |
| | |
| | | new AMap.DistrictSearch({ |
| | | extensions: 'all', |
| | | subdistrict: 0 |
| | | }).search(that.formInline.city, function (status, result) { // 外多边形坐标数组和内多边形坐标数组 |
| | | }).search(that.formInline.cityCode, function (status, result) { // 外多边形坐标数组和内多边形坐标数组 |
| | | var outer = [ |
| | | new AMap.LngLat(-360, 90, true), |
| | | new AMap.LngLat(-360, -90, true), |
| | |
| | | data: this.heatMapData, |
| | | max: this.selectSensor.maxNumber |
| | | }) |
| | | console.log('000', this.map.getZoom()) |
| | | console.log('000', this.selectSensor.maxNumber) |
| | | console.log('1111', this.heatmap.getDataSet()) |
| | | } else { |
| | | this.heatmap = null |
| | |
| | | this.map.plugin(['AMap.Heatmap'], function () { |
| | | // 初始化heatmap对象 |
| | | that.heatmap = new AMap.Heatmap(that.map, { |
| | | radius: 100, // 给定半径 |
| | | radius: 130, // 给定半径 |
| | | opacity: [0.5, 1], |
| | | gradient: that.selectSensor.gradient |
| | | }) |
| | |
| | | }, |
| | | regionData (id) { |
| | | let cityData = _.find(this.orgData, { id: id }) |
| | | this.formInline.city = cityData.cityName |
| | | this.formInline.cityCode = cityData.cityCode |
| | | this.formInline.city = cityData.areaName |
| | | this.formInline.cityCode = cityData.areaCode |
| | | }, |
| | | selectHourData (data) { |
| | | if (data) { |
| | | this.formInline.starTime = data[0] |
| | | this.formInline.endTime = data[1] |
| | | console.log('selectHourData', data) |
| | | let dataTime = dayjs().format('YYYY-MM-DD') |
| | | this.getOrganizationId() |
| | | this.getDayListData() |
| | | this.getData(`${dataTime} 00`) |
| | | } else { |
| | | this.formInline.starTime = '' |
| | | this.formInline.endTime = '' |