Commit e28c31ff authored by 纪泽龙's avatar 纪泽龙

地图gis页面

parents e0bc00a6 ea47958b
package com.zehong.web.controller.inspectorLocation;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.system.domain.vo.TUserLocationVo;
import com.zehong.system.service.ISysUserService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TUserLocation;
import com.zehong.system.service.ITUserLocationService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 巡检员定位Controller
*
* @author zehong
* @date 2021-07-31
*/
@RestController
@RequestMapping("/system/location")
public class TUserLocationController extends BaseController
{
@Autowired
private ITUserLocationService tUserLocationService;
@Autowired
private ISysUserService userService;
/**
* 查询巡检员定位列表
*/
@PreAuthorize("@ss.hasPermi('system:location:list')")
@GetMapping("/list")
public TableDataInfo list(TUserLocation tUserLocation)
{
startPage();
List<TUserLocation> list = tUserLocationService.selectTUserLocationList(tUserLocation);
return getDataTable(list);
}
/**
* 初始化巡检员位置及巡检员路线
* @param tUserLocationVo
* @return
*/
@GetMapping("/getInspectorLocations")
public AjaxResult getInspectorLocations(TUserLocationVo tUserLocationVo){
if(null == tUserLocationVo.getUserId()){
List<SysUser> inspectors = userService.selectInspectorList();
List<TUserLocation> inspectorLocations = new ArrayList<>();
Map<String,Object> map = new HashMap<>(16);
for(SysUser sysUser : inspectors){
map.put("userId",sysUser.getUserId());
map.put("initInspectors","initInspectors");
inspectorLocations.addAll(tUserLocationService.selectTUserLocationListByMap(map));
}
return AjaxResult.success(inspectorLocations);
}
Map<String,Object> map = new HashMap<>(16);
map.put("userId",tUserLocationVo.getUserId());
map.put("beginTime",tUserLocationVo.getBeginTime());
map.put("endTime",tUserLocationVo.getEndTime());
return AjaxResult.success(tUserLocationService.selectTUserLocationListByMap(map));
}
/**
* 导出巡检员定位列表
*/
@PreAuthorize("@ss.hasPermi('system:location:export')")
@Log(title = "巡检员定位", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TUserLocation tUserLocation)
{
List<TUserLocation> list = tUserLocationService.selectTUserLocationList(tUserLocation);
ExcelUtil<TUserLocation> util = new ExcelUtil<TUserLocation>(TUserLocation.class);
return util.exportExcel(list, "巡检员定位数据");
}
/**
* 获取巡检员定位详细信息
*/
@PreAuthorize("@ss.hasPermi('system:location:query')")
@GetMapping(value = "/{locationId}")
public AjaxResult getInfo(@PathVariable("locationId") Long locationId)
{
return AjaxResult.success(tUserLocationService.selectTUserLocationById(locationId));
}
/**
* 新增巡检员定位
*/
@PreAuthorize("@ss.hasPermi('system:location:add')")
@Log(title = "巡检员定位", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TUserLocation tUserLocation)
{
return toAjax(tUserLocationService.insertTUserLocation(tUserLocation));
}
/**
* 修改巡检员定位
*/
@PreAuthorize("@ss.hasPermi('system:location:edit')")
@Log(title = "巡检员定位", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TUserLocation tUserLocation)
{
return toAjax(tUserLocationService.updateTUserLocation(tUserLocation));
}
/**
* 删除巡检员定位
*/
@PreAuthorize("@ss.hasPermi('system:location:remove')")
@Log(title = "巡检员定位", businessType = BusinessType.DELETE)
@DeleteMapping("/{locationIds}")
public AjaxResult remove(@PathVariable Long[] locationIds)
{
return toAjax(tUserLocationService.deleteTUserLocationByIds(locationIds));
}
}
package com.zehong.system.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 巡检员定位对象 t_user_location
*
* @author zehong
* @date 2021-07-31
*/
public class TUserLocation extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 巡检定位表id */
private Long locationId;
/** 人员id */
@Excel(name = "人员id")
private Long userId;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal latitude;
public void setLocationId(Long locationId)
{
this.locationId = locationId;
}
public Long getLocationId()
{
return locationId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setLongitude(BigDecimal longitude)
{
this.longitude = longitude;
}
public BigDecimal getLongitude()
{
return longitude;
}
public void setLatitude(BigDecimal latitude)
{
this.latitude = latitude;
}
public BigDecimal getLatitude()
{
return latitude;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("locationId", getLocationId())
.append("userId", getUserId())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("createTime", getCreateTime())
.toString();
}
}
package com.zehong.system.domain.vo;
import java.util.Date;
public class TUserLocationVo {
/**
*巡检人员id
*/
private Long userId;
/**
* 巡检开始时间
*/
private Date beginTime;
/**
* 巡检结束时间
*/
private Date endTime;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
}
package com.zehong.system.mapper;
import com.zehong.system.domain.TUserLocation;
import java.util.List;
import java.util.Map;
/**
* 巡检员定位Mapper接口
*
* @author zehong
* @date 2021-07-31
*/
public interface TUserLocationMapper
{
/**
* 查询巡检员定位
*
* @param locationId 巡检员定位ID
* @return 巡检员定位
*/
public TUserLocation selectTUserLocationById(Long locationId);
/**
* 查询巡检员定位列表
*
* @param tUserLocation 巡检员定位
* @return 巡检员定位集合
*/
public List<TUserLocation> selectTUserLocationList(TUserLocation tUserLocation);
/**
* 查询巡检员定位byMap
* @param map
* @return
*/
List<TUserLocation> selectTUserLocationListByMap(Map<String,Object> map);
/**
* 新增巡检员定位
*
* @param tUserLocation 巡检员定位
* @return 结果
*/
public int insertTUserLocation(TUserLocation tUserLocation);
/**
* 修改巡检员定位
*
* @param tUserLocation 巡检员定位
* @return 结果
*/
public int updateTUserLocation(TUserLocation tUserLocation);
/**
* 删除巡检员定位
*
* @param locationId 巡检员定位ID
* @return 结果
*/
public int deleteTUserLocationById(Long locationId);
/**
* 批量删除巡检员定位
*
* @param locationIds 需要删除的数据ID
* @return 结果
*/
public int deleteTUserLocationByIds(Long[] locationIds);
}
package com.zehong.system.service;
import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TUserLocation;
/**
* 巡检员定位Service接口
*
* @author zehong
* @date 2021-07-31
*/
public interface ITUserLocationService
{
/**
* 查询巡检员定位
*
* @param locationId 巡检员定位ID
* @return 巡检员定位
*/
public TUserLocation selectTUserLocationById(Long locationId);
/**
* 查询巡检员定位列表
*
* @param tUserLocation 巡检员定位
* @return 巡检员定位集合
*/
public List<TUserLocation> selectTUserLocationList(TUserLocation tUserLocation);
/**
* 查询巡检员定位列表ByMap
* @param map
* @return
*/
List<TUserLocation> selectTUserLocationListByMap(Map<String,Object> map);
/**
* 新增巡检员定位
*
* @param tUserLocation 巡检员定位
* @return 结果
*/
public int insertTUserLocation(TUserLocation tUserLocation);
/**
* 修改巡检员定位
*
* @param tUserLocation 巡检员定位
* @return 结果
*/
public int updateTUserLocation(TUserLocation tUserLocation);
/**
* 批量删除巡检员定位
*
* @param locationIds 需要删除的巡检员定位ID
* @return 结果
*/
public int deleteTUserLocationByIds(Long[] locationIds);
/**
* 删除巡检员定位信息
*
* @param locationId 巡检员定位ID
* @return 结果
*/
public int deleteTUserLocationById(Long locationId);
}
package com.zehong.system.service.impl;
import java.util.List;
import java.util.Map;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TUserLocationMapper;
import com.zehong.system.domain.TUserLocation;
import com.zehong.system.service.ITUserLocationService;
/**
* 巡检员定位Service业务层处理
*
* @author zehong
* @date 2021-07-31
*/
@Service
public class TUserLocationServiceImpl implements ITUserLocationService
{
@Autowired
private TUserLocationMapper tUserLocationMapper;
/**
* 查询巡检员定位
*
* @param locationId 巡检员定位ID
* @return 巡检员定位
*/
@Override
public TUserLocation selectTUserLocationById(Long locationId)
{
return tUserLocationMapper.selectTUserLocationById(locationId);
}
/**
* 查询巡检员定位列表
*
* @param tUserLocation 巡检员定位
* @return 巡检员定位
*/
@Override
public List<TUserLocation> selectTUserLocationList(TUserLocation tUserLocation)
{
return tUserLocationMapper.selectTUserLocationList(tUserLocation);
}
@Override
public List<TUserLocation> selectTUserLocationListByMap(Map<String,Object> map){
return tUserLocationMapper.selectTUserLocationListByMap(map);
}
/**
* 新增巡检员定位
*
* @param tUserLocation 巡检员定位
* @return 结果
*/
@Override
public int insertTUserLocation(TUserLocation tUserLocation)
{
tUserLocation.setCreateTime(DateUtils.getNowDate());
return tUserLocationMapper.insertTUserLocation(tUserLocation);
}
/**
* 修改巡检员定位
*
* @param tUserLocation 巡检员定位
* @return 结果
*/
@Override
public int updateTUserLocation(TUserLocation tUserLocation)
{
return tUserLocationMapper.updateTUserLocation(tUserLocation);
}
/**
* 批量删除巡检员定位
*
* @param locationIds 需要删除的巡检员定位ID
* @return 结果
*/
@Override
public int deleteTUserLocationByIds(Long[] locationIds)
{
return tUserLocationMapper.deleteTUserLocationByIds(locationIds);
}
/**
* 删除巡检员定位信息
*
* @param locationId 巡检员定位ID
* @return 结果
*/
@Override
public int deleteTUserLocationById(Long locationId)
{
return tUserLocationMapper.deleteTUserLocationById(locationId);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TUserLocationMapper">
<resultMap type="TUserLocation" id="TUserLocationResult">
<result property="locationId" column="location_id" />
<result property="userId" column="user_id" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectTUserLocationVo">
select location_id, user_id, longitude, latitude, create_time from t_user_location
</sql>
<select id="selectTUserLocationList" parameterType="TUserLocation" resultMap="TUserLocationResult">
<include refid="selectTUserLocationVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
</where>
</select>
<select id="selectTUserLocationListByMap" parameterType="java.util.Map" resultMap="TUserLocationResult">
<include refid="selectTUserLocationVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="beginTime != null and endTime != null"> and create_time BETWEEN #{beginTime} AND #{endTime}</if>
</where>
ORDER BY create_time DESC
<if test="initInspectors == 'initInspectors'">
LIMIT 1
</if>
</select>
<select id="selectTUserLocationById" parameterType="Long" resultMap="TUserLocationResult">
<include refid="selectTUserLocationVo"/>
where location_id = #{locationId}
</select>
<insert id="insertTUserLocation" parameterType="TUserLocation" useGeneratedKeys="true" keyProperty="locationId">
insert into t_user_location
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateTUserLocation" parameterType="TUserLocation">
update t_user_location
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where location_id = #{locationId}
</update>
<delete id="deleteTUserLocationById" parameterType="Long">
delete from t_user_location where location_id = #{locationId}
</delete>
<delete id="deleteTUserLocationByIds" parameterType="String">
delete from t_user_location where location_id in
<foreach item="locationId" collection="array" open="(" separator="," close=")">
#{locationId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询巡检员定位列表
export function listLocation(query) {
return request({
url: '/system/location/list',
method: 'get',
params: query
})
}
//初始化巡检员位置及路线
export function getInspectorLocations(query){
return request({
url: '/system/location/getInspectorLocations',
method: 'get',
params: query
})
}
// 查询巡检员定位详细
export function getLocation(locationId) {
return request({
url: '/system/location/' + locationId,
method: 'get'
})
}
// 新增巡检员定位
export function addLocation(data) {
return request({
url: '/system/location',
method: 'post',
data: data
})
}
// 修改巡检员定位
export function updateLocation(data) {
return request({
url: '/system/location',
method: 'put',
data: data
})
}
// 删除巡检员定位
export function delLocation(locationId) {
return request({
url: '/system/location/' + locationId,
method: 'delete'
})
}
// 导出巡检员定位
export function exportLocation(query) {
return request({
url: '/system/location/export',
method: 'get',
params: query
})
}
@font-face {
font-family: "iconfont"; /* Project id 2692138 */
src: url('//at.alicdn.com/t/font_2692138_r2b0jk88vrj.woff2?t=1627616466373') format('woff2'),
url('//at.alicdn.com/t/font_2692138_r2b0jk88vrj.woff?t=1627616466373') format('woff'),
url('//at.alicdn.com/t/font_2692138_r2b0jk88vrj.ttf?t=1627616466373') format('truetype');
src: url('//at.alicdn.com/t/font_2692138_cd9e8nk8yoo.woff2?t=1627718383904') format('woff2'),
url('//at.alicdn.com/t/font_2692138_cd9e8nk8yoo.woff?t=1627718383904') format('woff'),
url('//at.alicdn.com/t/font_2692138_cd9e8nk8yoo.ttf?t=1627718383904') format('truetype');
}
.iconfont {
......@@ -13,6 +13,14 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-zhibanrenyuan:before {
content: "\e613";
}
.icon-ylbgs:before {
content: "\e611";
}
.icon-gdcd:before {
content: "\e615";
}
......@@ -25,11 +33,7 @@
content: "\e612";
}
.icon-rqbgs:before {
content: "\e613";
}
.icon-ljsgs:before {
.icon-lljgs:before {
content: "\e614";
}
......
......@@ -94,7 +94,7 @@ export default {
.pic {
width: 177px;
height: 129px;
background-color: black;
// background-color: black;
img {
width: 100%;
height: 100%;
......
<template>
<div class="wrapper">
<span class="left">高雄:</span>
<span class="right">2019-99-99 15:21:21</span>
</div>
</template>
<script>
export default {};
</script>
<style lang="scss" scoped>
.wrapper{
width: 136px;
height: 54px;
background: #0D4F88;
font-size: 14px;
color:#fff;
box-sizing: border-box;
padding:7px 0px 7px 10px;
box-shadow: 0 0 20px -5px #0D4F88;
border-radius: 4px;
span{
word-break: break-all;
display: inline-block;
vertical-align: top;
&.right{
width:90px;
}
}
}
</style>
\ No newline at end of file
......@@ -6,9 +6,11 @@ import pipelineView from "../components/PopWindow/pipelineView.vue";
import lineInfoWindow from "../components/PopWindow/lineInfoWindow.vue";
import { delDeviceInfo } from "@/api/device/deviceInfo";
import markerInfoWindow from "../components/PopWindow/markerInfoWindow.vue";
import workerManInfowindow from "../components/PopWindow/workerManInfowindow.vue";
import { getArray } from "@/utils/gassafety.js";
import { delPipe } from "@/api/device/pipe.js";
import vue from "../main";
import {Card} from "element-ui"
let defaultCenter = "石家庄";
export let map;
export const DEVICE_TYPE = {
......@@ -159,8 +161,41 @@ class gaodeMap {
offset: new AMap.Pixel(0, 5)
});
this.setMarkerIcon(marker);
if (DEVICE_TYPE.INSPECTOR == markerType) {
// 存值
const { createTime,locationId,longitude,latitude} = data;
marker.setExtData({createTime, locationId ,pos:[longitude,latitude]});
// 值班人员的事件
marker.on("click", e => {
console.log(e);
console.log(e.target.getExtData())
// console.log(Card)
// e.target.content = this.getMarketContent(data);
});
marker.on("mouseover",(e)=>{
e.target.content = this.getMarketContent(data);
infoWindow.setContent(e.target.content);
infoWindow.open(map, e.target.getPosition());
e.target.cloneDom = infoWindow.dom.cloneNode(true);
// console.log(infoWindow.dom.offsetLeft);
// console.log(infoWindow.dom);
e.target.cloneDom.style.top = infoWindow.dom.offsetTop + 80 + "px";
e.target.cloneDom.style.left = infoWindow.dom.offsetLeft + 100 + "px";
// 先删除之前的,后增加现在的
// this.removeCloneDom();
that.removeCloneDom();
document.body.appendChild(e.target.cloneDom);
that.workerManCloneDom = e.target.cloneDom;
infoWindow.close();
that.workerManInfoWindow = infoWindow;
})
}
if (
DEVICE_TYPE.WORKORDER != markerType &&
DEVICE_TYPE.WORKORDER != markerType &&
DEVICE_TYPE.INSPECTOR != markerType
) {
marker.content = this.getMarketContent(data);
......@@ -249,7 +284,7 @@ class gaodeMap {
infoWindow.setContent(e.target.content);
infoWindow.open(map, e.target.getPosition());
console.log(infoWindow.dom);
// console.log(infoWindow.dom);
// 这个是为了盖住vue里的东西
e.target.cloneDom = infoWindow.dom.cloneNode(true);
......@@ -333,6 +368,17 @@ class gaodeMap {
dom.remove();
return html;
}
case DEVICE_TYPE.INSPECTOR: {
const dom = createPop(workerManInfowindow, {
title: "值班人员",
data: data,
map: map
});
const html = dom.$el;
dom.remove();
return html;
}
}
}
......@@ -409,7 +455,7 @@ class gaodeMap {
case DEVICE_TYPE.INSPECTOR: {
let icon = new AMap.Icon({
//size: new AMap.Size(51, 23),
image: require("../assets/images/zhibanrenyuan.png")
image: require("../assets/images/zhibanrenyuan.jpg")
});
marker.setIcon(icon);
break;
......@@ -526,8 +572,8 @@ class gaodeMap {
// 这个是为了盖住vue里的东西
polyline.cloneDom = infoWindow.dom.cloneNode(true);
console.log(infoWindow.dom.offsetLeft);
console.log(infoWindow.dom);
// console.log(infoWindow.dom.offsetLeft);
// console.log(infoWindow.dom);
polyline.cloneDom.style.top = infoWindow.dom.offsetTop + 80 + "px";
polyline.cloneDom.style.left = infoWindow.dom.offsetLeft + 100 + "px";
// 先删除之前的,后增加现在的
......@@ -554,10 +600,17 @@ class gaodeMap {
}
removeCloneDom() {
// 线
this.cloneDom && document.body.removeChild(this.cloneDom);
// 设备
this.markerCloneDom && document.body.removeChild(this.markerCloneDom);
// 值班人员
this.workerManCloneDom && document.body.removeChild(this.workerManCloneDom);
// that.workerManInfoWindow = infoWindow;
this.cloneDom = null;
this.markerCloneDom=null;
this.markerCloneDom = null;
this.workerManCloneDom = null;
}
// 创建一条新的线
......
......@@ -13,7 +13,7 @@
<template v-for="item in list">
<div class="right-content" :key="item.type">
<div class="text-icon">
<i class="iconfont" :class="iconClass(item)"></i>
<i class="iconfont" :class="[iconClass(item),{iconFontSize: item.type==4 }]"></i>
</div>
<div class="text">
<div class="top">{{ typeName[item.type] }}</div>
......@@ -44,10 +44,10 @@ export default {
99: "管道",
},
iconList: {
1: "icon-tyx",
2: "icon-fmj",
3: "icon-llj",
4: "icon-ylb",
1: "icon-tyxgs",
2: "icon-fmjgs",
3: "icon-lljgs",
4: "icon-ylbgs",
99: "icon-gdcd",
},
};
......@@ -141,5 +141,9 @@ export default {
}
}
}
// 单独调整下最后一个icon的大小
.iconFontSize{
font-size: 50px !important;
}
}
</style>
\ No newline at end of file
......@@ -63,8 +63,6 @@
</div>
</div>
<el-input
v-model="keyWord"
placeholder="点击输入"
......@@ -96,16 +94,20 @@
</div>
</div>
<RightBototmData :list="rightBototmData"/>
<RightBototmData :list="rightBototmData" />
</div>
</template>
<script>
// import from "utils/gaodeMapView.js";
import { pipeAllInfoList, countPipeLength } from "@/api/device/pipe.js";
import gaodeMap, { map, DEVICE_TYPE, mapOperateType } from "utils/gaodeMapView.js";
import gaodeMap, {
map,
DEVICE_TYPE,
mapOperateType,
} from "utils/gaodeMapView.js";
import { getAllDeviceInfo, countDeviceByType } from "@/api/device/deviceInfo";
import RightBototmData from "./components/RightBototmData.vue";
import { getInspectionDataByInspector } from "@/api/deviceInspection/inspectionData"
import { getInspectorLocations } from "@/api/inspectorLocation/location";
export default {
components: {
......@@ -161,14 +163,17 @@ export default {
},
async created() {
await countPipeLength().then((res) => {
console.log("管道管道管道管道管道管道", res);
// console.log("管道管道管道管道管道管道", res);
const obj = { number: res.data, type: "99" };
this.rightBototmData.push(obj);
});
await countDeviceByType().then((res) => {
console.log("markerresresresresresresresresresresresres", res);
// console.log("markerresresresresresresresresresresresres", res);
this.rightBototmData.push(...res.data);
});
// 值班人员
this.getInspectorLocations();
console.log(this.rightBototmData);
},
mounted() {
......@@ -183,7 +188,6 @@ export default {
gaoMap.searchTips("tipinput");
this.getDeviceInfo();
this.getPipeList();
this.getInspectionDataByInspector();
},
// 左边的Bar修改值
leftBarChange(item) {
......@@ -374,24 +378,15 @@ export default {
}
});
},
getInspectionDataByInspector(){
this.gaoMap.addMarker(
DEVICE_TYPE.INSPECTOR,
{longitude:114.525243,latitude:38.035002}
);
/* getInspectionDataByInspector().then((res) =>{
if(res.code == 200){
console.log(res.data);
for(var i =0; i<res.data.length; i++){
console.log(res.data[i].inspectionDataVo[0],"fdafdsfd================")
this.gaoMap.addMarker(
DEVICE_TYPE.INSPECTOR,
res.data[i].inspectionDataVo[0]
);
getInspectorLocations() {
getInspectorLocations().then((res) => {
if (res.code == 200) {
console.log(" 值班人员", res);
for (var i = 0; i < res.data.length; i++) {
this.gaoMap.addMarker(DEVICE_TYPE.INSPECTOR, res.data[i]);
}
}
});*/
});
},
searchClear() {
this.iconClass = "icon-create";
......@@ -437,7 +432,7 @@ export default {
}
// 辅助新建重新画线
// if (!this.gaoMap.lineFlag || this.gaoMap.lineType != 1) return;
console.log("利用window把lineFlagh恢复");
// console.log("利用window把lineFlagh恢复");
this.gaoMap.lineFlag = false;
// this.gaoMap.createNewLine();
},
......@@ -460,10 +455,10 @@ export default {
<style lang="scss" scoped>
#container{
#container {
position: fixed;
top: 80px;
bottom:0;
bottom: 0;
width: 100%;
}
// 左边的bar
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment