diff --git a/bns/html/supplement/child/monitoring_watch_list.html b/bns/html/supplement/child/monitoring_watch_list.html new file mode 100644 index 0000000..0834285 --- /dev/null +++ b/bns/html/supplement/child/monitoring_watch_list.html @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + +
+

+
+
+ +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/bns/html/supplement/monitoring_coverage.html b/bns/html/supplement/monitoring_coverage.html index 4cd75fc..852f9c4 100644 --- a/bns/html/supplement/monitoring_coverage.html +++ b/bns/html/supplement/monitoring_coverage.html @@ -23,9 +23,9 @@
-

监控活跃度分析

+

监控活跃度分析

-
+
@@ -96,7 +96,7 @@
-

下行观看分析

+

下行观看分析

diff --git a/bns/js/supplement/child/monitoring_watch_list.js b/bns/js/supplement/child/monitoring_watch_list.js new file mode 100644 index 0000000..b739061 --- /dev/null +++ b/bns/js/supplement/child/monitoring_watch_list.js @@ -0,0 +1,235 @@ +let form, layer, table, laydate, tableIns, user = getUser(), tableHeight; +let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10 +let objParam; +function setParams(params) { + objParam = JSON.parse(params); + $('#title').html(objParam.title); + layui.use(['form', 'layer', 'table', 'laydate'], function () { + form = layui.form; + layer = layui.layer; + table = layui.table; + laydate = layui.laydate; + pages(1, 10, 1); + }) +} + +/* 加载表格 */ +function pages(pageNum, pageSize, typeNum) { + let params = getReqParams(pageNum, pageSize, typeNum); + let url = dataUrl + "proteam/pot/monitoringCoverage/getMonitoringHydList"; + ajaxRequest(url, "POST", params, true, function () { + }, function (result) { + if (result.code === 200) { + initTable(result.data, result.limit, result.curr) + laypages(result.count, result.curr, result.limit) + } else if (result.code === 500) { + layer.alert(result.msg, { icon: 2 }) + } + }, function (xhr, status, error) { + errorFn(xhr, status, error) + }, null); +} + +function laypages(total, page, limit) { + layui.use(['laypage'], function () { + let laypage = layui.laypage; + laypage.render({ + elem: 'voi-page', + count: total, + curr: page, + limit: limit, + limits: [10, 20, 50, 100, 200, 500], + layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'], + groups: 5, + jump: function (obj, first) { + if (!first) { + pageNum = obj.curr, limitSize = obj.limit; + pages(obj.curr, obj.limit, null); + } + } + }); + }) +} + +/*初始化表格*/ +function initTable(dataList, limit, page) { + let loadingMsg = layer.msg("数据加载中,请稍候...", { icon: 16, scrollbar: false, time: 0, }); + tableIns = table.render({ + id: 'currTable', + elem: "#currTable", + height: 'full-230', + data: dataList, + limit: limit, + cols: [ + [ + { + title: "排名", + width: '7%', + unresize: true, + align: "center", + templet: function (d) { + return (page - 1) * limit + d.LAY_NUM; + } + }, + { + field: "proName", + title: "工程名称", + width: '15%', + unresize: true, + align: "center", + style: 'word-break: break-all' + }, + { + field: "riskLevel", + title: "风险等级", + width: '10%', + unresize: true, + align: "center", + templet: function (d) { + return setRiskLevelColor(d.riskLevel); + } + }, + { + field: "org", + title: "建管单位", + width: '10%', + unresize: true, + align: "center", + }, + { + field: "teamName", + title: "班组名称", + width: '13%', + unresize: true, + align: "center", + }, + { + title: "班组长姓名", + width: '10%', + unresize: true, + align: "center", + templet: function (d) { + return '

' + transformNull(d.workManager) + '

' + transformNull(d.workManagerPhone) + '

'; + } + }, + + { + title: "球机地址", + width: '10%', + unresize: true, + align: "center", + templet: function (d) { + return '

' + d.lon + '

' + d.lat + '

'; + } + }, + { + field: "watchTime", + title: "观看次数", + width: '10%', + unresize: true, + align: "center", + }, + { + field: "name", + title: "球机编号", + width: '15%', + unresize: true, + align: "center", + }, + ], + ], + done: function (res, curr, count) { + layer.close(loadingMsg); + table.resize("currTable"); + count || this.elem.next(".layui-table-view").find(".layui-table-header").css("display", "inline-block"); + count || this.elem.next(".layui-table-view").find(".layui-table-box").css("overflow", "auto"); + let that = this.elem.next(); + res.data.forEach(function (item, index) { + if (index % 2 === 0) { + that.find(".layui-table-box tbody tr[data-index='" + index + "']").css('background-color', '#06182E') + } else { + that.find(".layui-table-box tbody tr[data-index='" + index + "']").css('background-color', '#1F2F43') + } + }) + }, + }); +} + +// 获取参数 +function getReqParams(page, limit, type) { + let obj = {}; + if (!type) { + obj = { + page: page + "", + limit: limit + "", + proName: $('#proName').val(), + org: $('#org').val(), + riskLevel: $('#riskLevel').val(), + teamName: $('#teamName').val(), + workManager: $('#workManager').val(), + type:objParam.type, + id:objParam.id, + currentUserId: user.userId + '', + isSup: user.isSup, + currentUserOrgId: user.orgId + }; + } else { + obj = { + page: '1', + limit: '10', + proName: '', + org:'', + riskLevel:'', + teamName:'', + workManager:'', + type:objParam.type, + id:objParam.id, + currentUserId: user.userId + '', + isSup: user.isSup, + currentUserOrgId: user.orgId + }; + } + return obj; +} + +// 查询/重置 +function queryTable(type) { + if (type === 2) { + $('#proName').val(''); + $('#org').val(''); + $('#riskLevel').val(''); + $('#teamName').val(''); + $('#workManager').val(''); + layui.form.render(); + } + let pattern = new RegExp("[%_<>]"); + if (pattern.test($("#proName").val())) { + $("#proName").val(''); + return layer.msg('工程名称查询包含特殊字符,请重新输入', { + icon: 2, + time: 2000 //2秒关闭(如果不配置,默认是3秒) + }); + } + if (pattern.test($("#teamName").val())) { + $("#teamName").val(''); + return layer.msg('班组名称查询包含特殊字符,请重新输入', { + icon: 2, + time: 2000 //2秒关闭(如果不配置,默认是3秒) + }); + } + if (pattern.test($("#workManager").val())) { + $("#workManager").val(''); + return layer.msg('班组长查询包含特殊字符,请重新输入', { + icon: 2, + time: 2000 //2秒关闭(如果不配置,默认是3秒) + }); + } + pageNum = 1; + pages(1, limitSize) +} + +// 关闭页面 +function closePage(type) { + let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引 + parent.layer.close(index); //再执行关闭 +} \ No newline at end of file diff --git a/bns/js/supplement/monitoring_coverage.js b/bns/js/supplement/monitoring_coverage.js index c85b59a..f0e2f2f 100644 --- a/bns/js/supplement/monitoring_coverage.js +++ b/bns/js/supplement/monitoring_coverage.js @@ -149,4 +149,14 @@ function openHyd() { id: '' } openIframeByParamObj3("hyd_detail", "监控活跃度分析", "../supplement/child/monitoring_hyd_list.html", "62%", "85%", obj); -} \ No newline at end of file +} + +function openWatch() { + let obj = { + type: 3, + title:'下行观看分析', + id:'' + } + openIframeByParamObj3("watch_detail", "下行观看分析", "../supplement/child/monitoring_watch_list.html", "62%", "85%", obj); +} + diff --git a/bns/js/supplement/monitoring_coverage_echarts.js b/bns/js/supplement/monitoring_coverage_echarts.js index 6f39d46..9c2575c 100644 --- a/bns/js/supplement/monitoring_coverage_echarts.js +++ b/bns/js/supplement/monitoring_coverage_echarts.js @@ -318,7 +318,6 @@ function initEchartsThree(list) { type: 'shadow', }, formatter: function (params) { - console.error(params); let result = ''; $.each(list, function (index, item) { if (parseInt(params[0].name) === item.num) { @@ -462,6 +461,22 @@ function initEchartsThree(list) { window.addEventListener("resize", function () { myChart3.resize(); }); + let name = '',id = ''; + myChart3.off("click").on("click", function (params) { + $.each(list, function (index, item) { + if (parseInt(params.name) === item.num) { + name = item.name; + id = item.id; + } + }) + let obj = { + name: name, + type: 3, + title:'下行观看分析', + id:id + } + openIframeByParamObj3("watch_detail", "下行观看分析", "../supplement/child/monitoring_watch_list.html", "62%", "85%", obj); + }); } function initEchartsFour(list) {