From 0308b3dad4c5faa864a52290611c63229de0f494 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Mon, 4 Aug 2025 14:56:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/synthesisQuery/digitalSignage-new.js | 63 ++- .../proProgressUpdateDetailAjax.js | 480 +++++++++++------- .../proProgressUpdateDetail.html | 221 ++++---- 3 files changed, 472 insertions(+), 292 deletions(-) diff --git a/src/main/resources/static/js/synthesisQuery/digitalSignage-new.js b/src/main/resources/static/js/synthesisQuery/digitalSignage-new.js index a12626f..1b638d4 100644 --- a/src/main/resources/static/js/synthesisQuery/digitalSignage-new.js +++ b/src/main/resources/static/js/synthesisQuery/digitalSignage-new.js @@ -881,7 +881,11 @@ async function addMapLine() { let lineMaterial = null; // 用于存储线材质 // 判断条件部分保持不变 - if (startPoint.towerProgress == 8 && endPoint.towerProgress == 8) { + if ( + (startPoint.towerProgress == 8 && + endPoint.towerProgress == 8) || + startPoint.towerProgress == 8 + ) { // lineColor = "#FFFF00"; // lineMaterial = new Cesium.ColorMaterialProperty({ // // 实线 @@ -940,7 +944,8 @@ async function addMapLine() { (startPoint.towerProgress === 9 && endPoint.towerProgress === 9) || (startPoint.towerProgress === 10 && - endPoint.towerProgress === 10) + endPoint.towerProgress === 10) || + startPoint.towerProgress === 9 ) { // lineColor = "#d81e06"; // lineMaterial = new Cesium.ColorMaterialProperty({ @@ -1079,13 +1084,38 @@ async function addMapLine() { const polyline = new mars3d.graphic.PolylineEntity({ positions: positions, - eventParent: false, + // eventParent: true, style: { width: 2, // 线宽(像素) color: "#FFFF00", // 线颜色 clampToGround: true, // 是否贴地(山区建议设为true) }, }); + + // 添加点击事件 + polyline.on(mars3d.EventType.click, function (event) { + // console.log("点击了标点", event.graphic.attr); + const graphic = event.graphic; + let infoContent = ` +
+

公路所在杆塔:${highwayList[i].towerName}

+
+ 宽度 + ${highwayList[i].cablewayWidth || "/"} +
+
+ 长度 + ${highwayList[i].cablewayLength || "/"} +
+
`; + // 创建自定义信息窗体 + // graphicLayer.bindPopup(infoContent, { + // position: graphic.position, + // }); + + graphic.bindPopup(infoContent); + graphic.openPopup(); + }); graphicLayer.addGraphic(polyline); graphicLayerList.push(polyline); } @@ -1118,7 +1148,7 @@ async function addMapAThousandFields() { if (points.length > 0) { const graphic = new mars3d.graphic.PolygonEntity({ positions: points, - eventParent: false, + // eventParent: false, style: { color: "#00FFFF", // 区域填充颜色 opacity: 0.5, // 透明度(0-1) @@ -1129,6 +1159,31 @@ async function addMapAThousandFields() { }, attr: { remark: "示例区域" }, }); + + // 添加点击事件 + graphic.on(mars3d.EventType.click, function (event) { + // console.log("点击了标点", event.graphic.attr); + const graphic = event.graphic; + let infoContent = ` +
+

名称:${item.name}

+
+ 宽度 + ${item.cablewayWidth || "/"} +
+
+ 长度 + ${item.cablewayLength || "/"} +
+
`; + // 创建自定义信息窗体 + // graphicLayer.bindPopup(infoContent, { + // position: graphic.position, + // }); + + graphic.bindPopup(infoContent); + graphic.openPopup(); + }); graphicLayer.addGraphic(graphic); graphicLayerList.push(graphic); } diff --git a/src/main/resources/static/js/synthesisQuery/proProgressUpdateDetailAjax.js b/src/main/resources/static/js/synthesisQuery/proProgressUpdateDetailAjax.js index 09ac590..3d035e4 100644 --- a/src/main/resources/static/js/synthesisQuery/proProgressUpdateDetailAjax.js +++ b/src/main/resources/static/js/synthesisQuery/proProgressUpdateDetailAjax.js @@ -1,43 +1,52 @@ // 基本数据赋值 function initSetProData() { - let url = dataUrl + "/backstage/proProgress/detailQuery" + let url = dataUrl + "/backstage/proProgress/detailQuery"; let obj = { id: objParams.id, - departId: objParams.departId - } + departId: objParams.departId, + }; 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}) + 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 (xhr) { - error(xhr) - }); + ); function setData(obj) { - $('.layui-progress').remove(); - $('#proName').html(obj.proName); - $('#companyName').html(obj.companyName); - $('#proStatus').html('' + (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 || '/'); + $(".layui-progress").remove(); + $("#proName").html(obj.proName); + $("#companyName").html(obj.companyName); + $("#proStatus").html( + '' + (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 || "/"); $("#progress").after(`
`); for (let i = 1; i <= 10; i++) { - $('#num' + i).html(obj['num' + i]); + $("#num" + i).html(obj["num" + i]); } element.render(); } @@ -45,147 +54,200 @@ function initSetProData() { /**更新记录*/ function setUpdateRecord() { - let url = dataUrl + "/backstage/proProgress/updateRecord" + let url = dataUrl + "/backstage/proProgress/updateRecord"; let obj = { - id: objParams.id - } + id: objParams.id, + }; let params = { - encryptedData: encryptCBC(JSON.stringify(obj)) - } - let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,}); - ajaxRequest(url, "POST", params, true, function () { - }, function (result) { - layer.close(loadingMsg); - if (result.status === 200) { - setUpdateRecordInfo(result.data); - } else { - layer.msg(result.msg, {icon: 2}) - } - }, function (xhr) { - layer.close(loadingMsg); - error(xhr) + encryptedData: encryptCBC(JSON.stringify(obj)), + }; + let loadingMsg = layer.msg("数据加载中,请稍候...", { + icon: 16, + scrollbar: false, + time: 0, }); + ajaxRequest( + url, + "POST", + params, + true, + function () {}, + function (result) { + layer.close(loadingMsg); + if (result.status === 200) { + setUpdateRecordInfo(result.data); + } else { + layer.msg(result.msg, { icon: 2 }); + } + }, + function (xhr) { + layer.close(loadingMsg); + error(xhr); + } + ); function setUpdateRecordInfo(list, obj) { - let html = ''; + let html = ""; if (list && list.length > 0) { - let imgUrl = '../../img/synthesisQuery/user_head_icon.png'; - let imgUrl2 = '../../img/synthesisQuery/time_icon.png'; + let imgUrl = "../../img/synthesisQuery/user_head_icon.png"; + let imgUrl2 = "../../img/synthesisQuery/time_icon.png"; $.each(list, function (index, item) { - html += '
' + + html += + '
' + '' + '
' + - '

' + item.updateDate + '

' + + '

' + + item.updateDate + + "

" + '
' + '
' + '
' + - '' + - '
' + + '' + + "
" + '
' + '
' + - '' + item.userName + '' + - '
' + + "" + + item.userName + + "" + + "
" + '
' + - '' + item.updateDesc + '' + - '
' + + "" + + item.updateDesc + + "" + + "
" + '
' + - '' + - '' + item.updateTime + '' + - '
' + - '
' + + '' + + '' + + item.updateTime + + "" + + "
" + + "
" + '
' + - '完成进度 ' + item.finishProgress + ' % ' + - '
' + - '' + - '' + - '' + - ''; - }) + '完成进度 ' + + item.finishProgress + + " % " + + "" + + "" + + "" + + "" + + ""; + }); } - console.log(html) - $('.layui-timeline').empty().append(html); + console.log(html); + $(".layui-timeline").empty().append(html); } } /**更新项目数据赋值*/ function setUpdateProData(value) { - let url = dataUrl + "/backstage/proProgress/getGxData" + let url = dataUrl + "/backstage/proProgress/getGxData"; let obj = { id: objParams.id, - type: value - } + type: value, + }; let params = { - encryptedData: encryptCBC(JSON.stringify(obj)) - } - let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,}); - ajaxRequest(url, "POST", params, true, function () { - }, function (result) { - layer.close(loadingMsg); - if (result.status === 200) { - setData(result.data); - } else { - layer.msg(result.msg, {icon: 2}) - } - }, function (xhr) { - layer.close(loadingMsg); - error(xhr) + encryptedData: encryptCBC(JSON.stringify(obj)), + }; + let loadingMsg = layer.msg("数据加载中,请稍候...", { + icon: 16, + scrollbar: false, + time: 0, }); + ajaxRequest( + url, + "POST", + params, + true, + function () {}, + function (result) { + layer.close(loadingMsg); + if (result.status === 200) { + setData(result.data); + } else { + layer.msg(result.msg, { icon: 2 }); + } + }, + function (xhr) { + layer.close(loadingMsg); + error(xhr); + } + ); function setData(data) { let obj = data.vo; let list = data.list; - $('#towerNum2').html(obj.towerNum); + $("#towerNum2").html(obj.towerNum); for (let i = 1; i <= 10; i++) { - $('#num' + i).html(obj['num' + i]); + $("#num" + i).html(obj["num" + i]); } - let html = ''; + let html = ""; $.each(list, function (index, item) { if (item.chooseStatus === 1) { - html += '

' + item.towerName + '

'; + html += + '

' + + item.towerName + + "

"; } else if (item.chooseStatus === 0) { - html += '

' + item.towerName + '

'; + html += + '

' + + item.towerName + + "

"; } - }) - $('.tower-box').empty().append(html); + }); + $(".tower-box").empty().append(html); } } function chooseData(that) { - let towerName = $(that).find('p').eq(0).html(); - if ($(that).hasClass('choose')) { - $(that).removeClass('choose'); - let oldData = $('#updateDesc').val(); - let dataArr = oldData.split(';'); - const filteredArray = dataArr.filter(item => !item.includes(towerName)); - $('#updateDesc').val(filteredArray.join(';')); + let towerName = $(that).find("p").eq(0).html(); + if ($(that).hasClass("choose")) { + $(that).removeClass("choose"); + let oldData = $("#updateDesc").val(); + let dataArr = oldData.split(";"); + const filteredArray = dataArr.filter( + (item) => !item.includes(towerName) + ); + $("#updateDesc").val(filteredArray.join(";")); } else { - $(that).addClass('choose'); - let oldData = $('#updateDesc').val(); + $(that).addClass("choose"); + let oldData = $("#updateDesc").val(); let value = getTypeName(towerName); - $('#updateDesc').val(oldData + value); + $("#updateDesc").val(oldData + value); } function getTypeName(towerName) { if (checkType === 1) { - return towerName + '-' + '协调完成;'; + return towerName + "-" + "协调完成;"; } else if (checkType === 2) { - return towerName + '-' + '基础开挖;'; + return towerName + "-" + "基础开挖;"; } else if (checkType === 3) { - return towerName + '-' + '基础开挖完成;'; - }else if (checkType === 4) { - return towerName + '-' + '基础浇筑;'; + return towerName + "-" + "基础开挖完成;"; + } else if (checkType === 4) { + return towerName + "-" + "基础浇筑;"; } else if (checkType === 5) { - return towerName + '-' + '基础浇筑完成;'; + return towerName + "-" + "基础浇筑完成;"; } else if (checkType === 6) { - return towerName + '-' + '铁塔组立;'; + return towerName + "-" + "铁塔组立;"; } else if (checkType === 7) { - return towerName + '-' + '铁塔组立完成;'; + return towerName + "-" + "铁塔组立完成;"; } else if (checkType === 8) { - return towerName + '-' + '架线施工;'; - }else if (checkType === 9) { - return towerName + '-' + '架线施工完成;'; + return towerName + "-" + "架线施工;"; + } else if (checkType === 9) { + return towerName + "-" + "架线施工完成;"; } else if (checkType === 10) { - return towerName + '-' + '附件安装完成;'; + return towerName + "-" + "附件安装完成;"; } } } @@ -199,62 +261,102 @@ function saveData(data, towers, towerNames) { paramsObj.id = objParams.id; paramsObj.progressType = checkType; let params = { - encryptedData: encryptCBC(JSON.stringify(paramsObj)) - } - let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0}); - ajaxRequest(url, "POST", params, true, function () { - $('.save').addClass("layui-btn-disabled").attr("disabled", true); - $('.cancel').addClass("layui-btn-disabled").attr("disabled", true); - }, function (result) { - layer.close(loadingMsg); // 关闭提示层 - $('.save').removeClass("layui-btn-disabled").attr("disabled", false); - $('.cancel').removeClass("layui-btn-disabled").attr("disabled", false); - if (result.code === 200) { - parent.layer.msg(result.msg, {icon: 1}); - setUpdateProData(checkType); - $('#updateDesc').val(''); - } else { - layer.msg(result.msg, {icon: 2}) - } - }, function (xhr) { - layer.close(loadingMsg); // 关闭提示层 - $('.save').removeClass("layui-btn-disabled").attr("disabled", false); - $('.cancel').removeClass("layui-btn-disabled").attr("disabled", false); - error(xhr) + encryptedData: encryptCBC(JSON.stringify(paramsObj)), + }; + let loadingMsg = layer.msg("数据上传中,请稍候...", { + icon: 16, + scrollbar: false, + time: 0, }); + ajaxRequest( + url, + "POST", + params, + true, + function () { + $(".save").addClass("layui-btn-disabled").attr("disabled", true); + $(".cancel").addClass("layui-btn-disabled").attr("disabled", true); + }, + function (result) { + layer.close(loadingMsg); // 关闭提示层 + $(".save") + .removeClass("layui-btn-disabled") + .attr("disabled", false); + $(".cancel") + .removeClass("layui-btn-disabled") + .attr("disabled", false); + if (result.code === 200) { + parent.layer.msg(result.msg, { icon: 1 }); + setUpdateProData(checkType); + $("#updateDesc").val(""); + } else { + layer.msg(result.msg, { icon: 2 }); + } + }, + function (xhr) { + layer.close(loadingMsg); // 关闭提示层 + $(".save") + .removeClass("layui-btn-disabled") + .attr("disabled", false); + $(".cancel") + .removeClass("layui-btn-disabled") + .attr("disabled", false); + error(xhr); + } + ); } /**取消回退*/ function getBackGxData() { - let url = dataUrl + "/backstage/proProgress/getGxData" + let url = dataUrl + "/backstage/proProgress/getGxData"; let obj = { id: objParams.id, - type: 0 - } + type: 0, + }; let params = { - encryptedData: encryptCBC(JSON.stringify(obj)) - } - let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,}); - ajaxRequest(url, "POST", params, true, function () { - }, function (result) { - layer.close(loadingMsg); - if (result.status === 200) { - setData(result.data); - } else { - layer.msg(result.msg, {icon: 2}) - } - }, function (xhr) { - layer.close(loadingMsg); - error(xhr) + encryptedData: encryptCBC(JSON.stringify(obj)), + }; + let loadingMsg = layer.msg("数据加载中,请稍候...", { + icon: 16, + scrollbar: false, + time: 0, }); + ajaxRequest( + url, + "POST", + params, + true, + function () {}, + function (result) { + layer.close(loadingMsg); + if (result.status === 200) { + setData(result.data); + } else { + layer.msg(result.msg, { icon: 2 }); + } + }, + function (xhr) { + layer.close(loadingMsg); + error(xhr); + } + ); function setData(data) { let list = data.list; - let html = ''; + let html = ""; $.each(list, function (index, item) { - html += '

' + item.towerName + '

'; - }) - $('.tower-box').empty().append(html); + html += + '

' + + item.towerName + + "

"; + }); + $(".tower-box").empty().append(html); } } @@ -264,27 +366,47 @@ function towerBackAjax(obj) { let url = dataUrl + "/backstage/proProgress/towerGxBack"; let paramsObj = obj; let params = { - encryptedData: encryptCBC(JSON.stringify(paramsObj)) - } - let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0}); - ajaxRequest(url, "POST", params, true, function () { - $('.save').addClass("layui-btn-disabled").attr("disabled", true); - $('.cancel').addClass("layui-btn-disabled").attr("disabled", true); - }, function (result) { - layer.close(loadingMsg); // 关闭提示层 - $('.save').removeClass("layui-btn-disabled").attr("disabled", false); - $('.cancel').removeClass("layui-btn-disabled").attr("disabled", false); - if (result.code === 200) { - parent.layer.msg(result.msg, {icon: 1}); - getBackGxData(); - $('.tower-progress-box').empty(); - } else { - layer.msg(result.msg, {icon: 2}) - } - }, function (xhr) { - layer.close(loadingMsg); // 关闭提示层 - $('.save').removeClass("layui-btn-disabled").attr("disabled", false); - $('.cancel').removeClass("layui-btn-disabled").attr("disabled", false); - error(xhr) + encryptedData: encryptCBC(JSON.stringify(paramsObj)), + }; + let loadingMsg = layer.msg("数据上传中,请稍候...", { + icon: 16, + scrollbar: false, + time: 0, }); -} \ No newline at end of file + ajaxRequest( + url, + "POST", + params, + true, + function () { + $(".save").addClass("layui-btn-disabled").attr("disabled", true); + $(".cancel").addClass("layui-btn-disabled").attr("disabled", true); + }, + function (result) { + layer.close(loadingMsg); // 关闭提示层 + $(".save") + .removeClass("layui-btn-disabled") + .attr("disabled", false); + $(".cancel") + .removeClass("layui-btn-disabled") + .attr("disabled", false); + if (result.code === 200) { + parent.layer.msg(result.msg, { icon: 1 }); + getBackGxData(); + $(".tower-progress-box").empty(); + } else { + layer.msg(result.msg, { icon: 2 }); + } + }, + function (xhr) { + layer.close(loadingMsg); // 关闭提示层 + $(".save") + .removeClass("layui-btn-disabled") + .attr("disabled", false); + $(".cancel") + .removeClass("layui-btn-disabled") + .attr("disabled", false); + error(xhr); + } + ); +} diff --git a/src/main/resources/static/pages/synthesisQuery/proProgressUpdateDetail.html b/src/main/resources/static/pages/synthesisQuery/proProgressUpdateDetail.html index abf63cd..d040df5 100644 --- a/src/main/resources/static/pages/synthesisQuery/proProgressUpdateDetail.html +++ b/src/main/resources/static/pages/synthesisQuery/proProgressUpdateDetail.html @@ -1,5 +1,6 @@ + @@ -15,129 +16,131 @@ 工程进度更新 + -
-
-
- -
-

-

+
+
+
+ +
+

+

+
+
+
+ +
-
- - +
+
+

项目状态

+

+
+
+

电压等级

+

+
+
+

线路长度

+

+
+
+

杆塔数量

+

+
+
+

项目计划开始时间

+

+
+
+

项目计划结束时间

+

+
+
+

最后更新

+

+
+
+

项目进度

+
-
-
-
-

项目状态

-

-
-
-

电压等级

-

-
-
-

线路长度

-

-
-
-

杆塔数量

-

-
-
-

项目计划开始时间

-

-
-
-

项目计划结束时间

-

-
-
-

最后更新

-

-
-
-

项目进度

-
-
-
-
-
    -
  • 项目进度
  • -
  • 更新记录
  • -
-
-
-
-
-
-

杆塔数

-

+
+
+
    +
  • 项目进度
  • +
  • 更新记录
  • +
+
+
+
+
+
+

杆塔数

+

+
+
+

协调完成

+

0

+
+
+

基础开挖

+

0

+
+
+

基础开挖完成

+

0

+
+
+

基础浇筑

+

0

+
+
+

基础浇筑完成

+

0

+
+
+

铁塔组立

+

0

+
+
+

铁塔组立完成

+

0

+
+
+

架线施工

+

0

+
+
+

架线施工完成

+

0

+
+
+

附件安装完成

+

0

+
-
-

协调完成

-

0

+
+
+
-
-

基础开挖

-

0

-
-
-

基础开挖完成

-

0

-
-
-

基础浇筑

-

0

-
-
-

基础浇筑完成

-

0

-
-
-

铁塔组立

-

0

-
-
-

铁塔组立完成

-

0

-
-
-

架线施工

-

0

-
-
-

架线施工完成

-

0

-
-
-

附件安装完成

-

0

-
-
-
-
-
-
-
-
+
+
+
-
-
+
+ \ No newline at end of file