From 69f04c9a09f68fb758e30ea84c404dc256a34dec Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Mon, 9 Jun 2025 17:18:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=AC=E8=B7=AF=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=89=B5=E5=BC=A0=E5=9C=BA=E5=9C=B0=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E6=96=B0=E5=A2=9E=E9=80=BB=E8=BE=91=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E9=A1=B5=E9=9D=A2=E5=88=9D=E6=AD=A5=E6=90=AD?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/static/css/table-common2.css | 75 +++--- .../lineManagement/child/addAndEditHighway.js | 252 ++++++++++++++++++ .../lineManagement/child/addAndEditQzSite.js | 252 ++++++++++++++++++ .../basic/lineManagement/child/ropewayList.js | 34 ++- .../child/addAndEditHighway.html | 139 ++++++++++ .../child/addAndEditQzSite.html | 138 ++++++++++ .../lineManagement/child/ropewayList.html | 6 + 7 files changed, 861 insertions(+), 35 deletions(-) create mode 100644 src/main/resources/static/js/basic/lineManagement/child/addAndEditHighway.js create mode 100644 src/main/resources/static/js/basic/lineManagement/child/addAndEditQzSite.js create mode 100644 src/main/resources/static/pages/basic/lineManagement/child/addAndEditHighway.html create mode 100644 src/main/resources/static/pages/basic/lineManagement/child/addAndEditQzSite.html diff --git a/src/main/resources/static/css/table-common2.css b/src/main/resources/static/css/table-common2.css index 6bf3757..2730a94 100644 --- a/src/main/resources/static/css/table-common2.css +++ b/src/main/resources/static/css/table-common2.css @@ -6,7 +6,7 @@ body { height: 99%; margin: 0.15% 0 0 0.25%; padding: 0; - font-family: 'Microsoft YaHei'; + font-family: "Microsoft YaHei"; } .layui-laypage-skip { @@ -20,14 +20,16 @@ body { box-sizing: border-box; } -.close, .closePage { +.close, +.closePage { width: 100%; height: 40px; justify-content: space-between; padding: 0 1%; } -.close p, .closePage p { +.close p, +.closePage p { font-size: 20px; } @@ -70,7 +72,7 @@ body { /*按钮背景色*/ .btn-1 { - background-color: #00377A; + background-color: #00377a; letter-spacing: 1px; } @@ -80,14 +82,20 @@ body { width: 88px !important; color: #000; } +.btn-3 { + background-color: #fff; + letter-spacing: 1px; + width: 130px !important; + color: #000; +} .btn-3 { - background-color: #3CA63C; + background-color: #3ca63c; letter-spacing: 1px; } .lock { - background-color: #FFAB44; + background-color: #ffab44; color: #fff !important; width: 60px; height: 23px; @@ -149,14 +157,14 @@ body { } .layui-table-cell a { - color: #2F82FB; + color: #2f82fb; font-size: 15px; text-decoration: none; cursor: pointer; } -.layui-table-cell a.layui-icon{ - color: #2F82FB; +.layui-table-cell a.layui-icon { + color: #2f82fb; font-size: 18px !important; text-decoration: none; cursor: pointer; @@ -177,7 +185,8 @@ body { font-weight: bold; } -.layui-table, .layui-table-view { +.layui-table, +.layui-table-view { margin: 0 0 10px 0; } @@ -228,16 +237,16 @@ body { } .layui-laypage .layui-laypage-curr .layui-laypage-em { - background-color: #00377A; + background-color: #00377a; } .layui-laypage a:hover { - color: #00377A; + color: #00377a; } .layui-laypage input:focus, .layui-laypage select:focus { - border-color: #00377A !important + border-color: #00377a !important; } .layui-laypage-default a, @@ -296,7 +305,6 @@ body { margin: 0; } - .layui-table-body { margin-right: 0px; } @@ -333,7 +341,7 @@ body { .layui-textarea:hover { /*border: 1px solid #595959 !important;*/ border-color: #00377a !important; - box-shadow: 0 0 0 3px rgba(0, 55, 122, .08) + box-shadow: 0 0 0 3px rgba(0, 55, 122, 0.08); } .layui-input:focus, @@ -341,11 +349,11 @@ body { .layui-textarea:focus { /*border: 1px solid #595959 !important;*/ border-color: #00377a !important; - box-shadow: 0 0 0 3px rgba(0, 55, 122, .08) + box-shadow: 0 0 0 3px rgba(0, 55, 122, 0.08); } .layui-form-item .layui-inline .layui-input-inline { - width: 255px + width: 255px; } .layui-form-item { @@ -405,7 +413,7 @@ body { padding: 2px 5px; background-color: #009688; border-radius: 2px; - color: #FFF; + color: #fff; display: inline-block; line-height: 18px; height: 18px; @@ -433,7 +441,8 @@ body { height: 40px !important; } -.xm-form-selected .xm-select, .xm-form-selected .xm-select:hover { +.xm-form-selected .xm-select, +.xm-form-selected .xm-select:hover { border-color: #595959 !important; } @@ -467,7 +476,6 @@ body { /*滚动条样式end*/ - .layui-input::-webkit-input-placeholder, .layui-textarea::-webkit-input-placeholder { color: #595959; @@ -484,8 +492,8 @@ body { } .layui-layer-btn .layui-layer-btn0 { - border-color: #00377A !important; - background-color: #00377A !important; + border-color: #00377a !important; + background-color: #00377a !important; color: #fff; } @@ -536,7 +544,7 @@ img { } .table-striped > tbody > tr > td { - border-bottom: 1px solid #D9D9D9 !important; + border-bottom: 1px solid #d9d9d9 !important; border-top: none !important; letter-spacing: 1px; } @@ -727,11 +735,18 @@ img { align-items: center; } -.confirm-form .layui-form .layui-form-item .layui-inline .layui-form-selected dl { +.confirm-form + .layui-form + .layui-form-item + .layui-inline + .layui-form-selected + dl { height: 85px; } -.confirm-form .layui-form .layui-input, .layui-select, .layui-textarea { +.confirm-form .layui-form .layui-input, +.layui-select, +.layui-textarea { height: 30px; font-size: 15px; } @@ -810,7 +825,7 @@ input:-ms-input-placeholder { .classTable tbody { display: block; - height: 300px; + height: 300px; /*height: 35vh;*/ overflow-y: auto; } @@ -857,8 +872,8 @@ input:-ms-input-placeholder { } .layui-anim { - -webkit-animation-duration: .3s; - animation-duration: .3s; + -webkit-animation-duration: 0.3s; + animation-duration: 0.3s; -webkit-animation-fill-mode: both; animation-fill-mode: both; } @@ -869,9 +884,9 @@ input:-ms-input-placeholder { } .layui-layer-adminRight { - box-shadow: 1px 1px 10px rgba(0, 0, 0, .1); + box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.1); border-radius: 0; overflow: auto; } -/* layer 右侧呼出 end */ \ No newline at end of file +/* layer 右侧呼出 end */ diff --git a/src/main/resources/static/js/basic/lineManagement/child/addAndEditHighway.js b/src/main/resources/static/js/basic/lineManagement/child/addAndEditHighway.js new file mode 100644 index 0000000..cec239f --- /dev/null +++ b/src/main/resources/static/js/basic/lineManagement/child/addAndEditHighway.js @@ -0,0 +1,252 @@ +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; + proId = JSON.parse(params).proId; + layui.use(["form", "layer", "util", "laydate"], function () { + form = layui.form; + layer = layui.layer; + util = layui.util; + laydate = layui.laydate; + var $ = layui.jquery; + + // 初始化表单 + form.render(); + loadTowerOptions(); + console.log(idParam + "idParam"); + if (idParam) { + getRopewayById(); + } + + // 监听杆塔选择 + form.on("select(towerSelect)", function (data) { + // 这里可以根据选择的杆塔自动填写相关信息 + if (data.value) { + getTowerInfo(data.value); + } + }); + // 监听杆塔选择 + form.on("select(highwayTowerSelect)", function (data) { + // 这里可以根据选择的杆塔自动填写相关信息 + if (data.value) { + getTowerInfo(data.value); + } + }); + + // 表单验证 + form.verify({ + required: function (value, item) { + if (!value) { + return "必填项不能为空"; + } + }, + 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) { + let formData = data.field; + formData.proId = proId; + saveData(formData); + }); + }); +} + +// 加载杆塔选项 +function loadTowerOptions() { + let url = dataUrl + "/tbTower/getTbTowerAll"; + let params = { proId: proId }; + params = { + encryptedData: encryptCBC(JSON.stringify(params)), + }; + ajaxRequest(url, "POST", params, true, null, function (result) { + if (result.code === 200) { + let options = ''; + result.data.forEach((item) => { + options += ``; + }); + $('select[name="towerId"]').html(options); + $('select[name="highwayTowerId"]').html(options); + form.render("select"); + } + }); +} + +// 获取杆塔信息 +function getTowerInfo(towerId) { + let url = dataUrl + "/tower/getById"; + let params = { + id: towerId, + encryptedData: encryptCBC(JSON.stringify({ id: towerId })), + }; + + ajaxRequest(url, "POST", params, true, null, function (result) { + if (result.code === 200) { + // 可以根据杆塔信息自动填写一些表单项 + console.log("获取到杆塔信息:", result.data); + } + }); +} + +// 根据id获取索道信息 +function getRopewayById() { + let loadingMsg = layer.msg("数据加载中,请稍候...", { icon: 16, time: 0 }); + let url = dataUrl + "/tbCablewaTrans/getTbCablewaTransById"; + let params = { + encryptedData: encryptCBC(JSON.stringify({ id: idParam })), + }; + + 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) { + layer.close(loadingMsg); + error(xhr); + } + ); +} + +// 设置表单数据 +function setFormData(data) { + if (data) { + form.val("ropewayForm", data); + pointsStr = JSON.stringify(data.cablewaTransPointVoList); + // 设置跨越类型并触发切换事件 + form.render("select"); + } +} + +function saveData2() { + $("#formSubmit").trigger("click"); +} + +// 保存数据 +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); + $(".span-type-option").css("pointer-events", "none"); + $(".save, .cancel") + .addClass("layui-btn-disabled") + .attr("disabled", true); + } + + // 启用所有输入框和按钮 + function enableForm() { + $("input, select").attr("disabled", false); + $(".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) { + layer.close(loadingMsg); + if (result.code === 200) { + layer.msg(result.msg, { icon: 1 }); + setTimeout(function () { + closePage(1); + }, 3000); + } else { + layer.alert(result.msg, { icon: 2 }); + setTimeout(function () { + enableForm(); + }, 3000); + } + }, + function (xhr) { + layer.close(loadingMsg); + enableForm(); + error(xhr); + } + ); +} + +// 配置索道口、中转口 +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); + parent.layer.close(index); + if (type === 1) { + parent.reloadData(); + parent.parent.reloadData(); + } +} diff --git a/src/main/resources/static/js/basic/lineManagement/child/addAndEditQzSite.js b/src/main/resources/static/js/basic/lineManagement/child/addAndEditQzSite.js new file mode 100644 index 0000000..cec239f --- /dev/null +++ b/src/main/resources/static/js/basic/lineManagement/child/addAndEditQzSite.js @@ -0,0 +1,252 @@ +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; + proId = JSON.parse(params).proId; + layui.use(["form", "layer", "util", "laydate"], function () { + form = layui.form; + layer = layui.layer; + util = layui.util; + laydate = layui.laydate; + var $ = layui.jquery; + + // 初始化表单 + form.render(); + loadTowerOptions(); + console.log(idParam + "idParam"); + if (idParam) { + getRopewayById(); + } + + // 监听杆塔选择 + form.on("select(towerSelect)", function (data) { + // 这里可以根据选择的杆塔自动填写相关信息 + if (data.value) { + getTowerInfo(data.value); + } + }); + // 监听杆塔选择 + form.on("select(highwayTowerSelect)", function (data) { + // 这里可以根据选择的杆塔自动填写相关信息 + if (data.value) { + getTowerInfo(data.value); + } + }); + + // 表单验证 + form.verify({ + required: function (value, item) { + if (!value) { + return "必填项不能为空"; + } + }, + 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) { + let formData = data.field; + formData.proId = proId; + saveData(formData); + }); + }); +} + +// 加载杆塔选项 +function loadTowerOptions() { + let url = dataUrl + "/tbTower/getTbTowerAll"; + let params = { proId: proId }; + params = { + encryptedData: encryptCBC(JSON.stringify(params)), + }; + ajaxRequest(url, "POST", params, true, null, function (result) { + if (result.code === 200) { + let options = ''; + result.data.forEach((item) => { + options += ``; + }); + $('select[name="towerId"]').html(options); + $('select[name="highwayTowerId"]').html(options); + form.render("select"); + } + }); +} + +// 获取杆塔信息 +function getTowerInfo(towerId) { + let url = dataUrl + "/tower/getById"; + let params = { + id: towerId, + encryptedData: encryptCBC(JSON.stringify({ id: towerId })), + }; + + ajaxRequest(url, "POST", params, true, null, function (result) { + if (result.code === 200) { + // 可以根据杆塔信息自动填写一些表单项 + console.log("获取到杆塔信息:", result.data); + } + }); +} + +// 根据id获取索道信息 +function getRopewayById() { + let loadingMsg = layer.msg("数据加载中,请稍候...", { icon: 16, time: 0 }); + let url = dataUrl + "/tbCablewaTrans/getTbCablewaTransById"; + let params = { + encryptedData: encryptCBC(JSON.stringify({ id: idParam })), + }; + + 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) { + layer.close(loadingMsg); + error(xhr); + } + ); +} + +// 设置表单数据 +function setFormData(data) { + if (data) { + form.val("ropewayForm", data); + pointsStr = JSON.stringify(data.cablewaTransPointVoList); + // 设置跨越类型并触发切换事件 + form.render("select"); + } +} + +function saveData2() { + $("#formSubmit").trigger("click"); +} + +// 保存数据 +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); + $(".span-type-option").css("pointer-events", "none"); + $(".save, .cancel") + .addClass("layui-btn-disabled") + .attr("disabled", true); + } + + // 启用所有输入框和按钮 + function enableForm() { + $("input, select").attr("disabled", false); + $(".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) { + layer.close(loadingMsg); + if (result.code === 200) { + layer.msg(result.msg, { icon: 1 }); + setTimeout(function () { + closePage(1); + }, 3000); + } else { + layer.alert(result.msg, { icon: 2 }); + setTimeout(function () { + enableForm(); + }, 3000); + } + }, + function (xhr) { + layer.close(loadingMsg); + enableForm(); + error(xhr); + } + ); +} + +// 配置索道口、中转口 +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); + parent.layer.close(index); + if (type === 1) { + parent.reloadData(); + parent.parent.reloadData(); + } +} diff --git a/src/main/resources/static/js/basic/lineManagement/child/ropewayList.js b/src/main/resources/static/js/basic/lineManagement/child/ropewayList.js index b879d56..aacf814 100644 --- a/src/main/resources/static/js/basic/lineManagement/child/ropewayList.js +++ b/src/main/resources/static/js/basic/lineManagement/child/ropewayList.js @@ -231,11 +231,35 @@ function addDataRopeway(id) { // 新增公路 function addHighway(id) { let title = "新增公路"; - // let param = { - // 'id': id, - // 'proId':idParam - // } - // openIframe2("addDataRopeway", title, "ropewayFormTemp.html", '1000px', '625px', param); + let param = { + id: id, + proId: idParam, + }; + openIframe2( + "addDataRopeway", + title, + "addAndEditHighway.html", + "1000px", + "625px", + param + ); +} + +// 新增千张场地 +function addQzSite(id) { + let title = "新增千张场地"; + let param = { + id: id, + proId: idParam, + }; + openIframe2( + "addDataRopeway", + title, + "addAndEditQzSite.html", + "1000px", + "625px", + param + ); } /*删除用户*/ diff --git a/src/main/resources/static/pages/basic/lineManagement/child/addAndEditHighway.html b/src/main/resources/static/pages/basic/lineManagement/child/addAndEditHighway.html new file mode 100644 index 0000000..32c6684 --- /dev/null +++ b/src/main/resources/static/pages/basic/lineManagement/child/addAndEditHighway.html @@ -0,0 +1,139 @@ + + + + + + + + + + + 线路工程管理-索道运输-新增/修改 + + + + +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+
+ +
+ + + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/pages/basic/lineManagement/child/addAndEditQzSite.html b/src/main/resources/static/pages/basic/lineManagement/child/addAndEditQzSite.html new file mode 100644 index 0000000..c7b3f78 --- /dev/null +++ b/src/main/resources/static/pages/basic/lineManagement/child/addAndEditQzSite.html @@ -0,0 +1,138 @@ + + + + + + + + + + + 线路工程管理-索道运输-新增/修改 + + + + +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+ + + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/pages/basic/lineManagement/child/ropewayList.html b/src/main/resources/static/pages/basic/lineManagement/child/ropewayList.html index 20c6be8..20ebb4d 100644 --- a/src/main/resources/static/pages/basic/lineManagement/child/ropewayList.html +++ b/src/main/resources/static/pages/basic/lineManagement/child/ropewayList.html @@ -52,6 +52,12 @@

新增公路

+