添加索道口、中转口

This commit is contained in:
cwchen 2025-05-20 15:39:36 +08:00
parent a9636fa199
commit 381b89a261
20 changed files with 712 additions and 37 deletions

View File

@ -55,4 +55,11 @@ public class DigitalSignageController {
public ServerResponse getTowersInfo(EncryptedReq<QueryParamDto> dto) {
return service.getTowersInfo(dto.getData());
}
@ApiOperation("查询工程杆塔坐标及工程坐标")
@PostMapping(value = "getTowersPosition")
@DecryptAndVerify(decryptedClass = QueryParamDto.class)//加解密统一管理
public ServerResponse getTowersPosition(EncryptedReq<QueryParamDto> dto) {
return service.getTowersPosition(dto.getData());
}
}

View File

@ -4,6 +4,7 @@ import com.bonus.digitalSignage.backstage.entity.dto.QueryParamDto;
import com.bonus.digitalSignage.backstage.entity.vo.DigitalSignageVo;
import com.bonus.digitalSignage.backstage.entity.vo.ProTreeVo;
import org.springframework.stereotype.Repository;
import com.bonus.digitalSignage.backstage.entity.vo.TowersInfo;
import java.util.List;
@ -78,4 +79,13 @@ public interface DigitalSignageDao {
* @date 2025/4/25 10:35
*/
List<DigitalSignageVo.SpanInfoVo> getSpanInfoVos(QueryParamDto dto);
/**
* 查询工程杆塔坐标及工程坐标
* @param dto
* @return List<TowersInfo>
* @author cwchen
* @date 2025/5/20 10:08
*/
List<TowersInfo> getTowersPosition(QueryParamDto dto);
}

View File

@ -0,0 +1,24 @@
package com.bonus.digitalSignage.backstage.entity.vo;
import lombok.Data;
/**
* @className:TowersInfo
* @author:cwchen
* @date:2025-05-20-10:04
* @version:1.0
* @description:杆塔-vo
*/
@Data
public class TowersInfo {
private String towerName;
private String lon;
private String lat;
private String proLon;
private String proLat;
}

View File

@ -45,4 +45,13 @@ public interface DigitalSignageService {
* @date 2025/4/24 16:52
*/
ServerResponse getTowersInfo(QueryParamDto data);
/**
* 查询工程杆塔坐标及工程坐标
* @param data
* @return ServerResponse
* @author cwchen
* @date 2025/5/20 10:03
*/
ServerResponse getTowersPosition(QueryParamDto data);
}

View File

@ -3,8 +3,8 @@ package com.bonus.digitalSignage.backstage.service.impl;
import com.bonus.digitalSignage.backstage.dao.DigitalSignageDao;
import com.bonus.digitalSignage.backstage.entity.dto.QueryParamDto;
import com.bonus.digitalSignage.backstage.entity.vo.DigitalSignageVo;
import com.bonus.digitalSignage.backstage.entity.vo.ProProgressVo;
import com.bonus.digitalSignage.backstage.entity.vo.ProTreeVo;
import com.bonus.digitalSignage.backstage.entity.vo.TowersInfo;
import com.bonus.digitalSignage.backstage.service.DigitalSignageService;
import com.bonus.digitalSignage.utils.ServerResponse;
import lombok.extern.slf4j.Slf4j;
@ -113,4 +113,15 @@ public class DigitalSignageServiceImpl implements DigitalSignageService {
}
return ServerResponse.createSuccess(map);
}
@Override
public ServerResponse getTowersPosition(QueryParamDto dto) {
try {
List<TowersInfo> towersInfos = Optional.ofNullable(dao.getTowersPosition(dto)).orElseGet(ArrayList::new);
return ServerResponse.createSuccess(towersInfos);
} catch (Exception e) {
log.error(e.toString(),e);
return ServerResponse.createErroe("查询失败");
}
}
}

View File

@ -16,4 +16,31 @@ public interface TbCablewaTransMapper {
void delTbCablewaTrans(TbCablewaTransVo data);
List<TbCablewaTransVo> getTbCablewaTransByTowerId(Long towerId);
/**
* 添加索道口中转口索道终点经纬度
* @param data
* @return void
* @author cwchen
* @date 2025/5/20 15:14
*/
void addCablewaTransPoint(TbCablewaTransVo data);
/**
* 删除索道口中转口索道终点经纬度
* @param data
* @return void
* @author cwchen
* @date 2025/5/20 15:15
*/
void delCablewaTransPoint(TbCablewaTransVo data);
/**
* 查询索道口中转口索道终点经纬度
* @param data
* @return List<CablewaTransPointVo>
* @author cwchen
* @date 2025/5/20 15:23
*/
List<TbCablewaTransVo.CablewaTransPointVo> getCablewaTransPointVos(TbCablewaTransVo data);
}

View File

@ -1,5 +1,6 @@
package com.bonus.digitalSignage.basic.service.impl;
import com.bonus.digitalSignage.backstage.entity.vo.TowersInfo;
import com.bonus.digitalSignage.basic.dao.TbCablewaTransMapper;
import com.bonus.digitalSignage.basic.service.TbCablewaTransService;
import com.bonus.digitalSignage.basic.vo.TbCablewaTransVo;
@ -7,11 +8,14 @@ import com.bonus.digitalSignage.utils.ServerResponse;
import com.bonus.digitalSignage.utils.UserUtil;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
/**
* @author 马三炮
@ -51,6 +55,8 @@ public class TbCablewaTransServiceImpl implements TbCablewaTransService {
public ServerResponse getTbCablewaTransById(TbCablewaTransVo data) {
try {
TbCablewaTransVo tbCablewaTransVo = tbCablewaTransMapper.getTbCablewaTransById(data);
List<TbCablewaTransVo.CablewaTransPointVo> cablewaTransPointVos = Optional.ofNullable(tbCablewaTransMapper.getCablewaTransPointVos(data)).orElseGet(ArrayList::new);
tbCablewaTransVo.setCablewaTransPointVoList(cablewaTransPointVos);
return ServerResponse.createSuccess(tbCablewaTransVo);
} catch (Exception e) {
log.error(e.toString(), e);
@ -66,10 +72,14 @@ public class TbCablewaTransServiceImpl implements TbCablewaTransService {
@Override
public ServerResponse addTbCablewaTrans(TbCablewaTransVo data) {
try {
if(CollectionUtils.isEmpty(data.getCablewaTransPointVoList())){
return ServerResponse.createErroe("未配置索道口、中转口、索道终点经纬度");
}
Long userId = UserUtil.getLoginUser().getId();
data.setCreateUserId(userId);
data.setCreateTime(new Date());
tbCablewaTransMapper.addTbCablewaTrans(data);
tbCablewaTransMapper.addCablewaTransPoint(data);
return ServerResponse.createBySuccessMsg("索道运输-新增成功");
} catch (Exception e) {
log.error(e.toString(), e);
@ -85,9 +95,14 @@ public class TbCablewaTransServiceImpl implements TbCablewaTransService {
@Override
public ServerResponse updateTbCablewaTrans(TbCablewaTransVo data) {
try {
if(CollectionUtils.isEmpty(data.getCablewaTransPointVoList())){
return ServerResponse.createErroe("未配置索道口、中转口、索道终点经纬度");
}
Long userId = UserUtil.getLoginUser().getId();
data.setUpdateUserId(userId);
tbCablewaTransMapper.updateTbCablewaTrans(data);
tbCablewaTransMapper.delCablewaTransPoint(data);
tbCablewaTransMapper.addCablewaTransPoint(data);
return ServerResponse.createBySuccessMsg("索道运输-修改成功");
} catch (Exception e) {
log.error(e.toString(), e);
@ -104,6 +119,7 @@ public class TbCablewaTransServiceImpl implements TbCablewaTransService {
public ServerResponse delTbCablewaTrans(TbCablewaTransVo data) {
try {
tbCablewaTransMapper.delTbCablewaTrans(data);
tbCablewaTransMapper.delCablewaTransPoint(data);
return ServerResponse.createBySuccessMsg("索道运输-删除成功");
} catch (Exception e) {
log.error(e.toString(), e);

View File

@ -4,6 +4,7 @@ import com.bonus.digitalSignage.utils.Excel;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author 马三炮
@ -57,6 +58,10 @@ public class TbCablewaTransVo {
@Excel(name = "最大坡度", sort = 5)
private String maxSlope;
@Excel(name = "索道宽度m", sort = 6)
private String cablewayWidth;
/**
* 是否可用 1,可用 0.不可用
*/
@ -89,4 +94,24 @@ public class TbCablewaTransVo {
private int page = 1;
private int limit = 10;
private List<CablewaTransPointVo> cablewaTransPointVoList;
@Data
public static class CablewaTransPointVo {
/**
* 经度
*/
private String lng;
/**
* 纬度
*/
private String lat;
/**
* 排序
*/
private int sort;
}
}

View File

@ -164,4 +164,16 @@
) A ON tts.id = A.three_span_id
WHERE tts.pro_id = #{id} AND tts.span_type = '1' and tts.is_active='1'
</select>
<!--查询工程杆塔坐标及工程坐标-->
<select id="getTowersPosition" resultType="com.bonus.digitalSignage.backstage.entity.vo.TowersInfo">
SELECT tt.tower_name AS towerName,
tt.baidu_lon AS lon,
tt.baidu_lat AS lat,
tp.lon AS proLon,
tp.lat AS proLat
FROM tb_project tp
LEFT JOIN tb_tower tt ON tp.id = tt.pro_id AND tt.is_actvice = '1'
WHERE tp.id = #{id} AND tp.is_active = '1'
ORDER BY tt.sort
</select>
</mapper>

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.digitalSignage.basic.dao.TbCablewaTransMapper">
<insert id="addTbCablewaTrans">
<insert id="addTbCablewaTrans" useGeneratedKeys="true" keyProperty="id">
insert into tb_cablewa_trans
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="proId != null ">pro_id,</if>
@ -13,6 +13,7 @@
<if test="maxSlope != null ">max_slope,</if>
<if test="createTime != null">create_time,</if>
<if test="createUserId != null ">create_user_id,</if>
<if test="cablewayWidth != null and cablewayWidth!=''">cableway_width,</if>
is_active
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -24,9 +25,19 @@
<if test="maxSlope != null ">#{maxSlope},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="createUserId != null ">#{createUserId},</if>
<if test="cablewayWidth != null and cablewayWidth!=''">#{cablewayWidth},</if>
1
</trim>
</insert>
<!--添加索道口、中转口、索道终点经纬度-->
<insert id="addCablewaTransPoint">
INSERT INTO tb_cablewa_trans_point(pro_id,cablewa_trans_id,lng,lat,sort) VALUES
<foreach collection="cablewaTransPointVoList" separator="," item="item">
(
${proId},#{id},#{item.lng},#{item.lat},#{item.sort}
)
</foreach>
</insert>
<update id="updateTbCablewaTrans">
update tb_cablewa_trans
<trim prefix="SET" suffixOverrides=",">
@ -35,6 +46,7 @@
<if test="maxHeight != null">max_height = #{maxHeight},</if>
<if test="safetyDistance != null">safety_distance = #{safetyDistance},</if>
<if test="maxSlope != null">max_slope = #{maxSlope},</if>
<if test="cablewayWidth != null and cablewayWidth!=''">cableway_width = #{cablewayWidth},</if>
<if test="updateUserId != null">update_user_id = #{updateUserId},</if>
update_time = now()
</trim>
@ -43,11 +55,15 @@
<delete id="delTbCablewaTrans">
update tb_cablewa_trans set is_active = '0' where id =#{id}
</delete>
<!--删除索道口、中转口、索道终点经纬度-->
<delete id="delCablewaTransPoint">
DELETE FROM tb_cablewa_trans_point WHERE cablewa_trans_id = #{id}
</delete>
<select id="tbCablewaTransList" resultType="com.bonus.digitalSignage.basic.vo.TbCablewaTransVo">
select tct.id as id,tct.pro_id as proId,tct.tower_id as towerId,tct.cableway_length as cablewayLength,
tct.max_height as maxHeight,tct.safety_distance as safetyDistance,tct.max_slope as maxSlope,
tct.create_user_id as createUserId,tt.tower_name as towerName
tct.create_user_id as createUserId,tt.tower_name as towerName,tct.cableway_length AS cablewayWidth
from tb_cablewa_trans tct
left join tb_tower tt on tct.tower_id = tt.id
where tct.pro_id = #{proId} and tct.is_active = '1'
@ -58,7 +74,7 @@
<select id="getTbCablewaTransById" resultType="com.bonus.digitalSignage.basic.vo.TbCablewaTransVo">
select tct.id as id,tct.pro_id as proId,tct.tower_id as towerId,tct.cableway_length as cablewayLength,
tct.max_height as maxHeight,tct.safety_distance as safetyDistance,tct.max_slope as maxSlope,
tct.create_user_id as createUserId,tt.tower_name as towerName
tct.create_user_id as createUserId,tt.tower_name as towerName,tct.cableway_length AS cablewayWidth
from tb_cablewa_trans tct
left join tb_tower tt on tct.tower_id = tt.id
where tct.id = #{id}
@ -66,7 +82,15 @@
<select id="getTbCablewaTransByTowerId" resultType="com.bonus.digitalSignage.basic.vo.TbCablewaTransVo">
select tct.id as id,tct.pro_id as proId,tct.tower_id as towerId,tct.cableway_length as cablewayLength,
tct.max_height as maxHeight,tct.safety_distance as safetyDistance,tct.max_slope as maxSlope,
tct.create_user_id as createUserId
tct.create_user_id as createUserId,tct.cableway_length AS cablewayWidth
from tb_cablewa_trans tct where tct.tower_id = #{towerId} and tct.is_active='1'
</select>
<!--索道口、中转口、索道终点经纬度-->
<select id="getCablewaTransPointVos"
resultType="com.bonus.digitalSignage.basic.vo.TbCablewaTransVo$CablewaTransPointVo">
SELECT lng,lat,sort
FROM tb_cablewa_trans_point
WHERE cablewa_trans_id = #{id}
ORDER BY sort
</select>
</mapper>

View File

@ -0,0 +1,52 @@
html {
width: 100%;
height: 100%;
margin: 0;
}
body {
margin: 0;
font-family: 'Alibaba PuHuiTi R';
height: 98%;
}
.layout {
display: flex;
justify-content: center;
align-items: center;
}
#main-box {
width: 100%;
height: 100%;
padding: 1% 1% 0 1%;
box-sizing: border-box;
background-color: #fff;
border-radius: 5px;
flex-direction: column;
}
#map-box {
width: 100%;
height: calc(100% - 80px);
}
.btn-box {
width: 100%;
height: 60px;
margin-top: 10px;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
}
.save {
background-color: #00377A;
}
/** 去除百度地图的水印和logo */
.BMap_cpyCtrl,
.anchorBL {
display: none;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

View File

@ -1,9 +1,10 @@
let form, layer, util,laydate, idParam, phoneParam,proId;
let form, layer, util, laydate, idParam, phoneParam, proId;
let arr = ['background', 'web', 'mobile', 'wx'];
let background, web, mobile, wx;
let data = [], appResList = [];
let pointsStr = null;
let startDate, endDate;
function setParams(params) {
console.log(params)
idParam = JSON.parse(params).id;
@ -24,28 +25,34 @@ function setParams(params) {
}
// 监听杆塔选择
form.on('select(towerSelect)', function(data) {
form.on('select(towerSelect)', function (data) {
// 这里可以根据选择的杆塔自动填写相关信息
if(data.value) {
if (data.value) {
getTowerInfo(data.value);
}
});
// 表单验证
form.verify({
required: function(value, item) {
if(!value) {
required: function (value, item) {
if (!value) {
return '必填项不能为空';
}
},
number: [
number: function (value, item) {
const strictPositiveNumberRegex = /^([1-9]\d*(\.\d+)?|0\.\d*[1-9]\d*)$/;
if (!strictPositiveNumberRegex.test(value)) {
return '请输入有效的数字';
}
},
/*number: [
/^-?\d+\.?\d*$/,
'请输入有效的数字'
]
],*/
});
// 表单提交
form.on('submit(formData)', function(data) {
form.on('submit(formData)', function (data) {
let formData = data.field;
formData.proId = proId;
saveData(formData);
@ -56,12 +63,12 @@ function setParams(params) {
// 加载杆塔选项
function loadTowerOptions() {
let url = dataUrl + "/tbTower/getTbTowerAll";
let params = {"proId":proId};
let params = {"proId": proId};
params = {
encryptedData: encryptCBC(JSON.stringify(params))
}
ajaxRequest(url, "POST", params, true, null, function(result) {
if(result.code === 200) {
ajaxRequest(url, "POST", params, true, null, function (result) {
if (result.code === 200) {
let options = '<option value="">选择杆塔</option>';
result.data.forEach(item => {
options += `<option value="${item.id}">${item.towerName}</option>`;
@ -79,9 +86,9 @@ function getTowerInfo(towerId) {
id: towerId,
encryptedData: encryptCBC(JSON.stringify({id: towerId}))
};
ajaxRequest(url, "POST", params, true, null, function(result) {
if(result.code === 200) {
ajaxRequest(url, "POST", params, true, null, function (result) {
if (result.code === 200) {
// 可以根据杆塔信息自动填写一些表单项
console.log("获取到杆塔信息:", result.data);
}
@ -95,15 +102,15 @@ function getRopewayById() {
let params = {
encryptedData: encryptCBC(JSON.stringify({id: idParam}))
};
ajaxRequest(url, "POST", params, true, null, function(result) {
ajaxRequest(url, "POST", params, true, null, function (result) {
layer.close(loadingMsg);
if (result.code === 200) {
setFormData(result.data);
} else {
layer.alert(result.msg, {icon: 2});
}
}, function(xhr) {
}, function (xhr) {
layer.close(loadingMsg);
error(xhr);
});
@ -111,8 +118,9 @@ function getRopewayById() {
// 设置表单数据
function setFormData(data) {
if(data) {
if (data) {
form.val("ropewayForm", data);
pointsStr = JSON.stringify(data.cablewaTransPointVoList);
// 设置跨越类型并触发切换事件
form.render('select');
}
@ -124,18 +132,22 @@ function saveData2() {
// 保存数据
function saveData(data) {
if (!pointsStr) {
return layer.msg("请配置索道口、中转口、索道终点经纬度", {icon: 7});
}
let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0});
let url = dataUrl + "/tbCablewaTrans/addTbCablewaTrans";
let params = data;
params.cablewaTransPointVoList = JSON.parse(pointsStr);
if (params.id) {
url = dataUrl + "/tbCablewaTrans/updateTbCablewaTrans";
}
console.log("索道运输的新增修改", params);
params = {
encryptedData: encryptCBC(JSON.stringify(params))
}
// 禁用所有输入框和按钮
function disableForm() {
$('input, select').attr('disabled', true);
@ -149,7 +161,7 @@ function saveData(data) {
$('.span-type-option').css('pointer-events', 'auto');
$('.save, .cancel').removeClass("layui-btn-disabled").attr("disabled", false);
}
ajaxRequest(url, "POST", params, true, function () {
disableForm();
}, function (result) {
@ -158,12 +170,12 @@ function saveData(data) {
layer.msg(result.msg, {icon: 1});
setTimeout(function () {
closePage(1);
},3000)
}, 3000)
} else {
layer.alert(result.msg, {icon: 2})
setTimeout(function () {
enableForm();
},3000)
}, 3000)
}
}, function (xhr) {
layer.close(loadingMsg);
@ -172,6 +184,22 @@ function saveData(data) {
});
}
// 配置索道口、中转口
function setLonAndLatData() {
let obj = {};
obj.id = proId;
obj.points = pointsStr;
openIframeByParamObj2("setLonAndLatData", "配置索道口、中转口、索道终点经纬度", "../../lineManagement/child/setLonAndLat.html", "92%", "95%", obj);
}
function savePointData(str) {
pointsStr = str;
}
function clearPointData() {
pointsStr = null;
}
// 关闭页面
function closePage(type) {
let index = parent.layer.getFrameIndex(window.name);

View File

@ -76,6 +76,7 @@ function initTable(dataList, limit, page) {
{field: "maxHeight", title: "最大载重kg", unresize: true, align: "center"},
{field: "safetyDistance", title: "安全距离m", unresize: true, align: "center"},
{field: "maxSlope", title: "最大坡度", unresize: true, align: "center"},
{field: "cablewayWidth", title: "索道宽度m", unresize: true, align: "center"},
{
title: "操作", unresize: true, width: 200, align: "center",
templet: function (d) {

View File

@ -0,0 +1,348 @@
let form, layer;
let objParams = {};
let map = null; // 地图实例
let intLng = 116.254; // 初始经度
let intLat = 39.965; // 初始纬度
let isMap = true; // 是否是地图模式
let markerCount = 0; // 标记点计数器
let markers = []; // 标记点数组
let polylineView = null;
function setParams(obj) {
objParams = JSON.parse(obj);
layui.use(['form', 'layer'], function () {
form = layui.form;
layer = layui.layer;
table = layui.table;
initData();
});
}
// 地图配置项
const config = {
polyline: {
strokeWeight: 1, // 线条宽度
strokeOpacity: 0.9, // 透明度
strokeStyle: "dashed", // solid(实线)或dashed(虚线)
enableEditing: false, // 是否可编辑
enableClicking: true, // 是否可点击
},
};
// 加载工程杆塔数据
function initData() {
let url = dataUrl + "/backstage/digitalSignage/getTowersPosition"
let obj = {
id: objParams.id
}
let params = {
encryptedData: encryptCBC(JSON.stringify(obj))
}
ajaxRequest(url, "POST", params, true, function () {
}, function (result) {
if (result.status === 200) {
setData(result.data);
} else {
layer.msg(result.msg, {icon: 2})
}
}, function (xhr) {
error(xhr)
});
function setData(list) {
if (list && list.length > 0) {
if (objParams.points) {
let points = JSON.parse(objParams.points)
intLng = points[0].lng;
intLat = points[0].lat;
}else{
intLng = list[0].proLon ? list[0].proLon : list[0].lon;
intLat = list[0].proLat ? list[0].proLat : list[0].lat;
}
}
initMap(list);
}
}
// 百度地图初始化
function initMap(list) {
if (map) {
map = null;
}
map = new BMapGL.Map("map-box");
// 以第一个点为中心初始化地图
map.centerAndZoom(new BMapGL.Point(intLng, intLat), 16);
map.setTilt(60); //设置地图的倾斜角度
map.enableScrollWheelZoom(true); // 启用滚轮缩放
// map.setTilt(60); // 设置地图倾斜角度
// map.setDisplayOptions({
// building: true, // 显示3D建筑物
// });
var navigationControl = new BMapGL.NavigationControl3D();
map.addControl(navigationControl);
// 每次初始化的时候清除所有标点以及线
map.clearOverlays();
var styleJson = [
// 隐藏道路
{
featureType: "highway",
elementType: "all",
stylers: {visibility: "off"},
},
{
featureType: "arterial",
elementType: "all",
stylers: {visibility: "off"},
},
{
featureType: "local",
elementType: "all",
stylers: {visibility: "off"},
},
{
featureType: "railway",
elementType: "all",
stylers: {visibility: "off"},
},
// 保留背景、水域、绿地等(避免地图变空白)
{
featureType: "background",
elementType: "all",
stylers: {visibility: "on"},
},
{
featureType: "water",
elementType: "all",
stylers: {visibility: "on"},
},
{
featureType: "green",
elementType: "all",
stylers: {visibility: "on"},
},
// 保留标点和文字(避免自定义点被隐藏)
{
featureType: "point",
elementType: "all",
stylers: {visibility: "on"},
},
{
featureType: "label",
elementType: "all",
stylers: {visibility: "on"},
},
];
if (isMap) {
// map.setMapType(BMAP_EARTH_MAP); // 地球模式
map.setMapType(BMAP_SATELLITE_MAP); // 地球模式
/*map.setDisplayOptions({
poiText: false, // 隐藏POI文字
poiIcon: false, // 隐藏POI图标
building: false, // 隐藏建筑物
});*/
} else {
map.setMapType(BMAP_NORMAL_MAP); // 普通模式
// 增加不是纯白的背景色
map.setMapStyleV2({
styleJson: [
{
featureType: "background",
elementType: "all",
stylers: {color: "#f5f5f5"},
},
],
});
}
if (isMap) {
map.setMapStyleV2({
styleJson,
});
}
initTowerLine(list);
// 点击地图添加标记
map.addEventListener("click", function (e) {
addMarker(e.latlng.lng, e.latlng.lat);
});
if (objParams.points) {
let points = JSON.parse(objParams.points)
$.each(points, function (i, item) {
addMarker(item.lng, item.lat)
viewPointLine();
})
}
function addMarker(lng, lat) {
var point = new BMapGL.Point(lng, lat);
// 创建点标记
var marker = new BMapGL.Marker(point);
// 添加到地图
map.addOverlay(marker);
// 创建标签
var label = new BMapGL.Label("点" + (markerCount + 1), {
position: point,
offset: new BMapGL.Size(10, -30)
});
label.setStyle({
color: "#333",
fontSize: "12px",
fontWeight: "bold",
backgroundColor: "rgba(255,255,255,0.9)",
border: "1px solid #ddd",
borderRadius: "4px",
padding: "2px 6px"
});
map.addOverlay(label);
// 存储标记和标签
markers.push({
marker: marker,
label: label,
point: point
});
// 更新计数器
markerCount++;
}
}
// 杆塔连线
function initTowerLine(points) {
// 存储所有点的坐标用于连线
var linePoints = [];
// 添加点覆盖物和标签
points.forEach(function (item, index) {
var point = new BMapGL.Point(item.lon, item.lat);
linePoints.push(point); // 添加到连线数组
// 创建点标记
var icon = new BMapGL.Icon("../../../../img/synthesisQuery/tower.png", new BMapGL.Size(32, 32), {
// 图标定位点
anchor: new BMapGL.Size(16, 30),
});
var marker = new BMapGL.Marker(point, {icon: icon});
map.addOverlay(marker);
// 创建标签
var label = new BMapGL.Label(item.towerName, {
position: point,
offset: new BMapGL.Size(20, -40)
});
label.setStyle({
color: "#333",
fontSize: "12px",
fontWeight: "bold",
backgroundColor: "rgba(255,255,255,0.9)",
border: "1px solid #ddd",
borderRadius: "4px",
padding: "2px 6px"
});
map.addOverlay(label);
});
// 创建连线
var polyline = new BMapGL.Polyline(linePoints, {
strokeColor: '#FF0305',
strokeWeight: 6,
strokeOpacity: 0.8
});
map.addOverlay(polyline);
// 可选:自动调整视图以包含所有点
map.setViewport(linePoints);
// 2. 获取视口边界和中心点
var bounds = map.getBounds();
var center = bounds.getCenter();
// 3. 计算视口距离
var viewportDistance = Math.max(
BMapGL.Map.prototype.getDistance(center, new BMapGL.Point(bounds.getSouthWest().lng, center.lat)),
BMapGL.Map.prototype.getDistance(center, new BMapGL.Point(center.lng, bounds.getSouthWest().lat))
);
// 4. 设置3D参数
var zoom = map.getZoom();
var newTilt = 60;
var newHeading = 30;
// 5. 应用3D视角
map.setTilt(newTilt);
map.setHeading(newHeading);
// 6. 稍微缩小以确保所有点在3D视角下可见
setTimeout(function () {
map.setZoom(zoom - 1);
}, 100);
}
// 清除所有标点
document.getElementById("clearMarkers").addEventListener("click", function () {
markers.forEach(function (item) {
map.removeOverlay(item.marker);
map.removeOverlay(item.label);
});
markers = [];
markerCount = 0;
if (polylineView) {
map.removeOverlay(polylineView); // 移除旧的折线
}
let frameId = parent.document.getElementById('addDataRopeway').getElementsByTagName("iframe")[0];
frameId.contentWindow.clearPointData();
});
// 预览标点连线
document.getElementById("viewPoint").addEventListener("click", function () {
viewPointLine();
});
function viewPointLine() {
if (markers && markers.length === 0) {
return layer.msg('请先创建点位', {icon: 7});
}
if (polylineView) {
map.removeOverlay(polylineView); // 移除旧的折线
}
let points = [];
$.each(markers, function (index, item) {
points.push(item.point);
})
// 2. 创建折线连接这些点位
var polyline = new BMapGL.Polyline(points, {
strokeColor: "#0C14CA", // 线颜色
strokeWeight: 4, // 线宽
strokeOpacity: 0.8 // 线透明度
});
polylineView = polyline;
map.addOverlay(polyline);
}
// 保存点位数据
function saveData() {
if (markers && markers.length === 0) {
return layer.msg('请先创建点位', {icon: 7});
}
if (markers && markers.length < 2) {
return layer.msg('至少创建两个点位', {icon: 7});
}
let points = [];
$.each(markers, function (index, item) {
points.push({
lng: item.point.lng,
lat: item.point.lat,
sort:index + 1
});
})
let frameId = parent.document.getElementById('addDataRopeway').getElementsByTagName("iframe")[0];
frameId.contentWindow.savePointData(JSON.stringify(points));
parent.layer.msg('保存成功', {icon: 1});
let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
parent.layer.close(index); //再执行关闭
}
// 关闭页面
function closePage() {
let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
parent.layer.close(index); //再执行关闭
}

View File

@ -270,21 +270,21 @@ function addTower(id){
let param = {
'id': id
}
openIframe2("tower", '杆塔管理', "child/towerList.html", '1200px', '685px', param);
openIframe2("tower", '杆塔管理', "child/towerList.html", '1600px', '855px', param);
}
function addThreeSpan(id){
let param = {
'id': id
}
openIframe2("threeSpan", '“三跨”管理', "child/threeSpanList.html", '1200px', '685px', param);
openIframe2("threeSpan", '“三跨”管理', "child/threeSpanList.html", '1600px', '855px', param);
}
function addRopeway(id){
let param = {
'id': id
}
openIframe2("ropeway", '索道运输', "child/ropewayList.html", '1200px', '685px', param);
openIframe2("ropeway", '索道运输', "child/ropewayList.html", '1600px', '855px', param);
}
function exportPro(){

View File

@ -64,4 +64,27 @@ function openIframeByParamObj(id, title, content, width, height, paramsObj,isRef
}
}
});
}
function openIframeByParamObj2(id, title, content, width, height, paramsObj) {
let layerIndex = parent.layer.open({
id: id,
type: 2,
title: ['<div style="border-left: 3px solid #00377A;color:#00377A;font-size:18px;display: flex;letter-spacing:1px;align-items: center;height: 20px;padding: 0 10px;font-weight: bold;">' + title + '</div>', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'],
content: content,
shade: 0.3,
anim: 2,
shadeClose: false,
area: [width, height],
move: false,
success: function () {
if (paramsObj) {
let iframeWin = parent.window["layui-layer-iframe" + layerIndex];
iframeWin.setParams(JSON.stringify(paramsObj));
}
},
end: function () {
}
});
}

View File

@ -23,14 +23,14 @@ function initSetProData() {
$('.layui-progress').remove();
$('#proName').html(obj.proName);
$('#companyName').html(obj.companyName);
$('#proStatus').html('<span style="color: #51d351;"> ● </span>' + obj.proStatus);
$('#voltageLevel').html(obj.voltageLevel);
$('#proStatus').html('<span style="color: #51d351;"> ● </span>' + (obj.proStatus || '/'));
$('#voltageLevel').html((obj.voltageLevel || '/'));
$('#lineLength').html((obj.lineLength || '/') + 'km');
$('#towerNum').html(obj.towerNum);
$('#towerNum2').html(obj.towerNum);
$('#planStartTime').html(obj.planStartTime);
$('#planEndTime').html(obj.planEndTime);
$('#updateTime').html(obj.updateTime);
$('#planStartTime').html(obj.planStartTime || '/');
$('#planEndTime').html(obj.planEndTime || '/');
$('#updateTime').html(obj.updateTime || '/');
$("#progress").after(`
<div class="layui-progress" lay-showpercent="true" lay-filter="demo-filter-progress">
<div class="layui-progress-bar layui-bg-blue" lay-percent="${obj.proProgress}%"></div>

View File

@ -65,6 +65,13 @@
placeholder="请输入" class="layui-input" maxlength="10">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"><span class="required-mark">*</span>索道宽度m:</label>
<div class="layui-input-inline">
<input type="text" name="cablewayWidth" lay-verify="required|number" autocomplete="off"
placeholder="请输入" class="layui-input" maxlength="10">
</div>
</div>
<button type="submit" id="formSubmit" class="layui-btn" lay-submit lay-filter="formData"
style="display: none;"></button>
@ -72,6 +79,7 @@
</div>
<div class="btn-box">
<button class="layui-btn layui-btn-normal save" onclick="setLonAndLatData()">配置索道口、中转口、索道终点经纬度</button>
<button class="layui-btn layui-btn-normal save" onclick="saveData2()">确定</button>
<button class="layui-btn layui-btn-primary cancel" onclick="closePage()">取消</button>
</div>
@ -83,5 +91,6 @@
<script src="../../../../js/dict.js"></script>
<script src="../../../../js/ajaxRequest.js"></script>
<script src="../../../../js/my/aes.js"></script>
<script src="../../../../js/openIframe.js"></script>
<script src="../../../../js/basic/lineManagement/child/ropewayFormTemp.js"></script>
</html>

View File

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../../../../js/layui-v2.9.14/layui/css/layui.css">
<link rel="stylesheet" href="../../../../css/font.css">
<link rel="stylesheet" href="../../../../css/synthesisQuery/setLonAndLat.css">
<script src="../../../../js/libs/jquery-3.7.0.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="../../../../js/layui-v2.9.14/layui/layui.js" charset="UTF-8" type="text/javascript"></script>
<script src="../../../../js/publicJs.js"></script>
<script src="../../../../js/commonUtils.js"></script>
<script src="../../../../js/openIframe.js"></script>
<script src="../../../../js/my/aes.js"></script>
<script src="../../../../js/ajaxRequest.js"></script>
<script type="text/javascript" src="//api.map.baidu.com/api?type=webgl&v=3.0&ak=cClgLBaLgGUdQDilX9dGvieL"></script>
<title>配置索道口、中转口经纬度</title>
</head>
<style>
.custom-info-window {
background: rgba(0, 0, 0, 0.5);
color: white;
padding: 10px;
border-radius: 4px;
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.3);
border: none;
min-width: 150px;
font-family: Arial, sans-serif;
}
.BMap_bubble_pop .BMap_bubble_arrow {
display: none !important;
}
</style>
<body>
<div id="main-box" class="layout">
<div id="map-box">
</div>
<div class="btn-box">
<button class="layui-btn layui-btn-norma save" id="viewPoint">预览标点连线</button>
<button class="layui-btn layui-btn-norma save" onclick="saveData()">保存</button>
<button class="layui-btn layui-btn-primary cancel" id="clearMarkers">清空标点</button>
<button class="layui-btn layui-btn-primary cancel" onclick="closePage()">取消</button>
</div>
</div>
</div>
</body>
<script src="../../../../js/basic/lineManagement/child/setLonAndLat.js" charset="UTF-8" type="text/javascript"></script>
</html>