public/assets/images/map/exhaust/fq_blue.pngpublic/assets/images/map/exhaust/fq_bright_green.pngpublic/assets/images/map/exhaust/fq_gray.pngpublic/assets/images/map/exhaust/fq_green.pngpublic/assets/images/map/exhaust/fq_green_xc.pngpublic/assets/images/map/exhaust/fq_orange.pngpublic/assets/images/map/exhaust/fq_red.pngpublic/assets/images/map/exhaust/fq_yellow.pngsrc/api/mapApi.js
@@ -17,6 +17,9 @@ }, getSolidWasteBaseInfo (data) { return axios.get(mapUrl.getSolidWasteBaseInfo, data) }, GetWasteGas (data) { return axios.get(mapUrl.GetWasteGas, data) } } src/api/mapUrl.js
@@ -5,5 +5,7 @@ export const GetUser = $HOST + '/user/getUser' export const GetWasteGas = $HOST + '/wasteGas/getWasteGas' export const getSolidWaste = $HOST + '/wasteSolid/getSolidWaste' export const getSolidWasteBaseInfo = $HOST + '/wasteSolid/getSolidWasteBaseInfo' src/components/BaseNav/PublicBounced/GasComponents/GasTabs.vue
@@ -1,10 +1,10 @@ <template> <div> <el-tabs v-model="activeName"> <el-tab-pane label="用户管理" name="first">用户管理</el-tab-pane> <el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane> <el-tab-pane label="角色管理" name="third">角色管理</el-tab-pane> <el-tab-pane label="定时任务补偿" name="fourth">定时任务补偿</el-tab-pane> <el-tab-pane label="实时数据" name="first">用户管理</el-tab-pane> <el-tab-pane label="日数据" name="second">配置管理</el-tab-pane> <el-tab-pane label="月数据" name="third">角色管理</el-tab-pane> <el-tab-pane label="人工数据" name="fourth">定时任务补偿</el-tab-pane> </el-tabs> </div> </template> src/components/BaseNav/PublicBounced/PublicBounced.vue
@@ -97,14 +97,17 @@ display: flex; //align-items: center; justify-content: space-around; padding: 10px; .public-bounced-content-left { width: 48%; flex: 3; height: 100%; margin-right: 10px; } .public-bounced-content-right { width: 48%; flex: 2; //width: 48%; height: 100%; } } src/components/LayerController/logic/WasteGas.js
@@ -2,40 +2,47 @@ * 废气 */ const AnimalService = require('../service/AnimalService').default const AjaxUtils = require('../../../utils/AjaxUtils').default // const AjaxUtils = require('../../../utils/AjaxUtils').default // 区分不同类型 使用不同img const ImgBlue = '/assets/images/map/exhaust/fq_blue.png' const ImgGray = '/assets/images/map/exhaust/fq_gray.png' const ImagGreen = '/assets/images/map/exhaust/fq_green.png' const ImagBright = '/assets/images/map/exhaust/fq_bright_green.png' const mapApi = require('../../../api/mapApi').default module.exports = function () { /** * 返回marker对象数组 * @param L leaflet对象 */ this.init = (layer, L) => { this.init = async (layer, L) => { this.animalService = new AnimalService({ L: L, layer: layer }) AjaxUtils.get4JsonDataByUrl('http://10.246.162.140:8080/EPInterface/DataService/EPMapService.asmx/ObtainningConInfo', { companyId: 3900100145, id: '', monType: 1, userCode: 'wenchun.deng', monDuration: '', epName: '', secdDeptId: '', contrLevel: '', dataStatus: '', dataFlag: '', runStatus: '', emissTypeId: '' }, function (res) { const data = res.data.Result.DataInfo const res = await mapApi.GetWasteGas() const data = res.Result.DataInfo || {} console.log(data) for (let i = 0; i < data.length; i++) { // 经纬度 位置 // const positionX = data[i].Latitude // const positionY = data[i].Longitude const positionX = data[i].Latitude const positionY = data[i].Longitude // 定义类型 用来区分数据 const ContrLevel = data[i].ContrLevel var iconUrl = this.differentTypes(ContrLevel) const marker = L.marker.magic([positionX, positionY], { icon: L.icon({ iconUrl: iconUrl, iconSize: [50, 50], iconAnchor: [25, 25] }) }) layer.addLayer(marker) // layer.addLayer(L.marker([positionX, positionY], {})) } }) } this.bindTooltip = (layer) => { console.log(layer) return '测试废气' } @@ -43,4 +50,18 @@ console.log(e) this.animalService.pulseEffect(e.latlng) } // 不同类型图片封装 this.differentTypes = (ContrLevel) => { var effectOfChange if (ContrLevel === 1) { effectOfChange = ImgBlue } else if (ContrLevel === 2) { effectOfChange = ImagGreen } else if (ContrLevel === 3) { effectOfChange = ImagBright } else { effectOfChange = ImgGray } return effectOfChange } } src/utils/axios.js
@@ -83,7 +83,7 @@ // 创建axios实例 const Service = axios.create({ timeout: 1000 timeout: 5000 }) const CancelToken = axios.CancelToken