From 018f52c49e59f82c73ca27982f115e306bfed3d6 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 17 Oct 2025 14:53:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E7=9B=91=E6=B5=8B=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/pages/index/dialog.js | 180 ++++++++++++++++++++++++++++++++++++ js/pages/index/indexAjax.js | 79 ++++++++++------ js/publics/openIframe.js | 34 +++++-- pages/index/dialog.html | 94 +++++++++++++++++++ pages/index/index.html | 29 +++--- 5 files changed, 363 insertions(+), 53 deletions(-) create mode 100644 js/pages/index/dialog.js create mode 100644 pages/index/dialog.html diff --git a/js/pages/index/dialog.js b/js/pages/index/dialog.js new file mode 100644 index 0000000..54a347a --- /dev/null +++ b/js/pages/index/dialog.js @@ -0,0 +1,180 @@ +let element, layer, laydate; +const bidCode = parent.parent.$("#bidPro").val(); +var table; +var alarmTableIns; +var qualityInspectionTableIns; +layui.use(["layer", "element", "table"], function () { + element = layui.element; + layer = layui.layer; + laydate = layui.laydate; + table = layui.table; + + //下拉选 + getConstruction(); + getRegion(); + //施工质量列表 + ConstructionQualityList(); + // laydate.render({ + // elem: "#ID-laydate-type-datetime", + // }); + + laydate.render({ + elem: "#ID-laydate-rangeLinked", + range: ["#ID-laydate-start-date-1", "#ID-laydate-end-date-1"], + rangeLinked: true, // 开启日期范围选择时的区间联动标注模式 --- 2.8+ 新增 + }); +}); + +//下拉选 +function getConstruction() { + const url = commonUrl + "system/sys/select/getBuildLists"; // 建管单位url + ajaxRequest( + url, + "get", + null, + true, + function () {}, + function (result) { + if (result.code === 200) { + let html = ""; + if (result.data && result.data.length > 0) { + $.each(result.data, function (index, item) { + html += + '"; + }); + } + $("#construction").empty().append(html); + layui.form.render(); + } else if (result.code === 500) { + layer.msg(result.msg, { icon: 2 }); + } + }, + function (xhr) { + error(xhr); + } + ); +} + +function getRegion() { + const url = commonUrl + "system/sys/select/getAreaLists"; // 建管单位url + ajaxRequest( + url, + "get", + null, + true, + function () {}, + function (result) { + if (result.code === 200) { + let html = ""; + if (result.data && result.data.length > 0) { + $.each(result.data, function (index, item) { + html += + '"; + }); + } + $("#region").empty().append(html); + layui.form.render(); + } else if (result.code === 500) { + layer.msg(result.msg, { icon: 2 }); + } + }, + function (xhr) { + error(xhr); + } + ); +} + +function ConstructionQualityList() { + const url = commonUrl + "screen/sj/twoPage/getEnvironmentList"; + + console.log("bidCode", bidCode); + + let times = ""; + let startTime = ""; + let endTime = ""; + if ($("#ID-laydate-start-date-1").val() != "") { + times = + $("#ID-laydate-start-date-1").val() + + " - " + + $("#ID-laydate-end-date-1").val(); + startTime = $("#ID-laydate-start-date-1").val(); + endTime = $("#ID-laydate-end-date-1").val(); + } else { + times = ""; + startTime = ""; + endTime = ""; + } + + console.log("times", times); + + qualityInspectionTableIns = table.render({ + elem: "#demo", + url: url, + skin: "line", + headers: { + decrypt: "decrypt", + Authorization: token, + }, + where: { + roleCode: roleCode, + orgId: orgId, + userId: userId, + bidCode: bidCode, + deviceType: "1902", + startTime, + endTime, + deviceName: $("#deviceName").val(), + modelName: $("#modelName").val(), + // month: $('#ID-laydate-type-datetime').val(), + }, + cols: [ + [ + { + field: "number", + width: 80, + title: "序号", + align: "center", + type: "numbers", + fixed: "left", + }, + // {field: 'areaName', align: 'center', title: '区域'}, + { field: "bdName", align: "center", title: "边带名称" }, + { field: "deviceName", align: "center", title: "设备名称" }, + { field: "modelName", align: "center", title: "检测属性" }, + { field: "val", align: "center", title: "检测值" }, // 拼接 + { field: "createTime", align: "center", title: "检测时间" }, + { field: "changeVal", align: "center", title: "变化值" }, + { field: "isWarn", align: "center", title: "是否告警" }, // 拼接 + ], + ], + initComplete: function () { + // 在表格渲染完成后,重新渲染序号列 + var that = this.elem.next(); + var tool = that + .children(".layui-table-box") + .children(".layui-table-fixed") + .children(".layui-table-body") + .children(".layui-table"); + tool.find("tr").each(function (index, item) { + $(this) + .find('td[data-field="LAY_TABLE_INDEX"]') + .text(index + 1); + }); + }, + done: function (res, curr, count, origin) { + console.log(res); + }, + page: true, //开启分页 + loading: true, //数据加载中。。。 + limits: [5, 10, 20, 100], + limit: 20, + }); +} diff --git a/js/pages/index/indexAjax.js b/js/pages/index/indexAjax.js index d60cf55..3248ca6 100644 --- a/js/pages/index/indexAjax.js +++ b/js/pages/index/indexAjax.js @@ -118,38 +118,57 @@ function loadRealMonitor(montageParam) { console.log("点击的monitor-data的data-id:", dataId); // 您可以在这里添加其他需要执行的逻辑 + openIframeByParamObj( + "handleData", + "实时监测信息", + "./dialog.html", + "72%", + "95%", + null, + 1 + ); + // openIframe2( + // "HISTORY_layui", + // "历史记录", + // "../dialog.html", + // "90%", + // "90%", + // { + // dataId: dataId, + // } + // ); - layer.open({ - type: 1, - title: "历史记录", //显示标题栏 - closeBtn: 1, - area: ["90%", "90%"], - id: "HISTORY_layui", //设定一个id,防止重复弹出 - resize: false, - // btn: ['确定'], - btnAlign: "c", - moveType: 0, //拖拽模式,0或者1 - skin: "layui-layer-molv", - content: $("#divDialog"), - success: function (layero) { - // initHistory(); + // layer.open({ + // type: 1, + // title: "历史记录", //显示标题栏 + // closeBtn: 1, + // area: ["90%", "90%"], + // id: "HISTORY_layui", //设定一个id,防止重复弹出 + // resize: false, + // // btn: ['确定'], + // btnAlign: "c", + // moveType: 0, //拖拽模式,0或者1 + // skin: "layui-layer-molv", + // content: $("#divDialog"), + // success: function (layero) { + // // initHistory(); - initDialogTable(); - $("th").css("color", "#000"); - $(".layui-table").css("color", "#000"); - }, - yes: function (layero, index) { - layer.close("HISTORY_layui"); - }, - cancel: function () { - // 右上角关闭事件的逻辑 - layer.close("HISTORY_layui"); - }, - end: function () { - $("th").css("color", "#fff"); - $(".layui-table").css("color", "#fff"); - }, - }); + // initDialogTable(); + // $("th").css("color", "#000"); + // $(".layui-table").css("color", "#000"); + // }, + // yes: function (layero, index) { + // layer.close("HISTORY_layui"); + // }, + // cancel: function () { + // // 右上角关闭事件的逻辑 + // layer.close("HISTORY_layui"); + // }, + // end: function () { + // $("th").css("color", "#fff"); + // $(".layui-table").css("color", "#fff"); + // }, + // }); }); // if (item.modelName === '温度') { // $('#wd').html(item.val ? item.val : 0); diff --git a/js/publics/openIframe.js b/js/publics/openIframe.js index a9564a1..2625357 100644 --- a/js/publics/openIframe.js +++ b/js/publics/openIframe.js @@ -3,7 +3,12 @@ function openIframe(id, title, content, width, height) { let layerIndex = layer.open({ id: id, type: 2, - title: ['
' + title + '
', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'], + title: [ + '
' + + title + + "
", + "font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;", + ], content: content, shade: 0.3, shadeClose: false, @@ -11,7 +16,7 @@ function openIframe(id, title, content, width, height) { move: false, success: function () { let iframeWin = window["layui-layer-iframe" + layerIndex]; - } + }, }); } @@ -20,7 +25,12 @@ function openIframe2(id, title, content, width, height, params) { let layerIndex = layer.open({ id: id, type: 2, - title: ['
' + title + '
', 'font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;'], + title: [ + '
' + + title + + "
", + "font-size:16px;background-color:#f0f0f0;display: flex;align-items: center;", + ], content: content, shade: 0.3, shadeClose: false, @@ -28,7 +38,7 @@ function openIframe2(id, title, content, width, height, params) { move: false, success: function () { let iframeWin = window["layui-layer-iframe" + layerIndex]; - console.log(params) + console.log(params); iframeWin.setParams(JSON.stringify(params)); }, cancel: function () { @@ -37,15 +47,23 @@ function openIframe2(id, title, content, width, height, params) { let iframeWin = window["layui-layer-iframe" + layerIndex]; iframeWin.clickLogout(); } - } + }, }); } -function openIframeByParamObj(id, title, content, width, height, paramsObj, type) { +function openIframeByParamObj( + id, + title, + content, + width, + height, + paramsObj, + type +) { let layerIndex = layer.open({ id: id, type: 2, - title:false, + title: false, content: content, shade: 0.3, anim: 2, @@ -63,6 +81,6 @@ function openIframeByParamObj(id, title, content, width, height, paramsObj, type if (type) { showPlugin(); } - } + }, }); } diff --git a/pages/index/dialog.html b/pages/index/dialog.html new file mode 100644 index 0000000..b31a1bf --- /dev/null +++ b/pages/index/dialog.html @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + 施工质量 + + + + +
+ +
+
+
+
+
+
+ + + +
+
+ +
+
-
+
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/pages/index/index.html b/pages/index/index.html index f7c69f9..16696eb 100644 --- a/pages/index/index.html +++ b/pages/index/index.html @@ -19,6 +19,7 @@ + 首页 @@ -117,11 +118,10 @@
- -