告警管理

This commit is contained in:
sliang 2024-03-27 20:57:39 +08:00
parent 790f69bfa0
commit 5650de66bb
6 changed files with 526 additions and 46 deletions

View File

@ -1,13 +1,13 @@
let aqEnnable = false;// 参数加密开关
const commonUrl = "http://10.40.92.33:18080/zhgd/";
const commonUrl = "http://10.40.92.106:18080/zhgd/";
/* 登录相关 */
const login_url = commonUrl + "auth/login"; // 登录url
const login_out = commonUrl + "auth/logout"; // 登出url
const page_jump = commonUrl + "auth/pageJump"; // 登出url
const login_sg_page = "http://10.40.92.33:8101/sg_login.html" // 施工大屏登录页面
const login_sc_page = "http://10.40.92.33:8100/sc_login.html" // 省侧大屏登录页面
const login_sg_index = "http://10.40.92.33:8101/pages/home/navigation.html" // 施工大屏首页
const login_sc_index = "http://10.40.92.33:8100/pages/web/index.html" // 省侧大屏首页
const login_sg_page = "http://10.40.92.106:8101/sg_login.html" // 施工大屏登录页面
const login_sc_page = "http://10.40.92.106:8100/sc_login.html" // 省侧大屏登录页面
const login_sg_index = "http://10.40.92.106:8101/pages/home/navigation.html" // 施工大屏首页
const login_sc_index = "http://10.40.92.106:8100/pages/web/index.html" // 省侧大屏首页
// ajax 请求封装
function ajaxRequest(url, type, data, async, beforeFn, successFn, errorFn, contentType) {

View File

@ -64,6 +64,7 @@ body {
justify-content: center;
align-items: center;
margin-top: 4%;
cursor: pointer;
}
.bright{
@ -77,4 +78,5 @@ body {
justify-content: center;
align-items: center;
margin-top: 4%;
cursor: pointer;
}

View File

@ -1,36 +1,112 @@
let layer;
layui.use(['layer'], function () {
let layer,table;
const bidCode = parent.$('#bidPro').val();
layui.use(['layer','table'], function () {
layer = layui.layer;
getSelect();
table = layui.table;
//选择单位下拉选
getSelectLists();
updateSelection();
//建管单位下拉选
getBuildLists();
});
function getSelect(){
function getBuildLists(){
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 += '<option value="' + item.orgId + '">' + item.name + '</option>'
})
}
$('#build').empty().append(html);
layui.form.render();
} else if (result.code === 500) {
layer.msg(result.msg, { icon: 2 });
}
}, function (xhr) {
error(xhr)
});
}
function getSelectLists(){
const url = commonUrl + "system/sys/select/getSelectLists"; // 建管单位url
ajaxRequest(url, "get", null , true, function () {
}, function (result) {
if (result.code === 200) {
getSelect(result.data)
} else if (result.code === 500) {
layer.msg(result.msg, { icon: 2 });
}
}, function (xhr) {
error(xhr)
});
}
function getSelect(data){
$("#selection").empty();
var data = [
{ a: 1, b: 2,c:1 },
{ a: 2, b: 2,c:2 },
{ a: 2, b: 2,c:3 }
];
var html ="";
data = JSON.parse(JSON.stringify(data)); // 创建一个新的变量存储 JSON 化后的数据
for (var i = 0; i < data.length; i++) {
if(data[i].a == 1){
html += '<div class="item bright" id="'+data[i].c+'">'+data[i].b+'</div>' ;
if(i == 0){
html += '<div class="item bright" id="'+data[i].id+'">'+data[i].name+'</div>' ;
}else{
html += '<div class="item dark" id="'+data[i].c+'">'+data[i].b+'</div>' ;
html += '<div class="item dark" id="'+data[i].id+'">'+data[i].name+'</div>' ;
}
}
console.log(html)
init(data[0].id);
$("#selection").append(html);
}
function updateSelection() {
$(".item").on("click", function() {
$("#selection").on("click", ".item", function() {
$(".item").removeClass("bright").addClass("dark"); // 点击时将所有元素设置为 dark 类
$(this).removeClass("dark").addClass("bright"); // 点击的元素设置为 bright 类
var clickedId = $(this).attr('id'); // 获取被点击的 div 元素的 id 值
console.log("选中的值为: " + clickedId);
init(clickedId);
});
}
function init(warnType){
const url = commonUrl + "screen/largeScreen/alarmMge/getAlarmMgeList"; // 建管单位url
table.render({
elem: '#demo',
url: url,
skin: 'line',
page: true,
headers:{
decrypt:"decrypt",
"Authorization":token
},
where: {
warnType:warnType,
orgId:$('#build').val(),
proName:$('#proName').val(),
teamLeader:$('#teamLeader').val()
},
cols: [[
{type: 'numbers', title: '序号'}, // 添加序号列
{field: 'orgName', title: '建管单位',align:'center'},
{field: 'proName', title: '工程名称',align:'center'},
{field: 'warnContent', title: '告警内容',align:'center'},
{field: 'teamLeader', title: '班组长',align:'center'},
{field: '', title: '操作',align:'center',templet:function(d){
}},
]],
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);
}
})
}

View File

@ -0,0 +1,271 @@
let layer,table;
let myChart = echarts.init(document.getElementById('tendency'));
layui.use(['layer','table'], function () {
layer = layui.layer;
table = layui.table;
init();
inits();
initEchartsOne();
});
function init(){
var data = [
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 2, proName: '李四', teamName: '666', teamLeader: '女', quality: 1, content: '起飞'}
];
table.render({
elem: '#demo1',
data: data,
skin: 'line',
page: true,
cols: [[
{field: 'id', title: '排名',align:'center'},
{field: 'proName', title: '工程名称',align:'center'},
{field: 'teamName', title: '班组名称',align:'center'},
{field: 'teamLeader', title: '班组长',align:'center'},
{field: 'quality', title: '施工质量',align:'center'},
]]
})
}
function inits(){
var data = [
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 1, proName: '张三', teamName: '666', teamLeader: '男', quality: 1, content: '芜湖'},
{id: 2, proName: '李四', teamName: '666', teamLeader: '女', quality: 1, content: '起飞'}
];
table.render({
elem: '#demo2',
data: data,
skin: 'line',
page: true,
cols: [[
{field: 'id', title: '排名',align:'center'},
{field: 'proName', title: '工程名称',align:'center'},
{field: 'teamName', title: '班组名称',align:'center'},
{field: 'teamLeader', title: '班组长',align:'center'},
{field: 'quality', title: '施工质量',align:'center'},
]]
})
}
/* 变化趋势 */
function initEchartsOne() {
let fontSize = '14', fontFamily = 'Alibaba PuHuiTi R', fontColor = '#fff';
let xLabel = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
let dataValue = [20, 30, 40, 35, 34, 15, 56, 15, 12, 25, 34, 42];
const tooltip = {
show: true,
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
backgroundColor: 'rgba(75, 79, 82, 0.80)', //设置背景颜色
textStyle: {
color: fontColor,
fontFamily: fontFamily
},
borderColor: "rgba(255,255,255, .5)",
};
let option = {
backgroundColor: 'transparent',
tooltip,
legend: {
show: false,
},
grid: {
top: '25%',
left: '5%',
right: '5%',
bottom: '15%',
},
xAxis: [
{
type: 'category',
boundaryGap: true,
axisLine: {
//坐标轴轴线相关设置。数学上的x轴
show: true,
lineStyle: {
color: '#5A6E71',
},
},
axisLabel: {
//坐标轴刻度标签的相关设置
textStyle: {
color: fontColor,
fontSize: fontSize,
fontFamily: fontFamily
},
},
splitLine: {
show: false,
lineStyle: {
color: '#233653',
},
},
axisTick: {
show: false,
},
data: xLabel,
},
],
yAxis: [
{
name: "",
nameTextStyle: {
color: fontColor,
fontSize: fontSize,
padding: [0, 60, 0, 0],
fontFamily: fontFamily
},
// minInterval: 1,
type: 'value',
splitLine: {
show: true,
lineStyle: {
color: '#25393B',
type: 'dashed'
},
},
axisLine: {
show: false,
lineStyle: {
color: '#008de7',
},
},
axisLabel: {
show: true,
textStyle: {
color: fontColor,
fontSize: fontSize,
fontFamily: fontFamily
}
},
axisTick: {
show: false,
},
},
],
series: [
{
name: '周计划数',
type: 'line',
symbol: 'circle', // 默认是空心圆(中间是白色的),改成实心圆
smooth: true,
lineStyle: {
normal: {
width: 3,
// color: '#1ED6FF', // 线条颜色
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: '#0DF0FD',
},
{
offset: 0.6,
color: '#00F1D4',
},
{
offset: 1,
color: '#0EEEFC',
},
],
false
),
},
},
itemStyle: {
normal: {
color: '#1ED6FF',//拐点颜色
// borderColor: '#fff600',//拐点边框颜色
// borderWidth: 13//拐点边框大小
label: {
show: true, //开启显示
color: fontColor,
fontFamily: fontFamily,
position: 'top', //在上方显示
formatter: function (res) {
if (res.value) {
return res.value
} else {
return 0
}
},
},
},
},
symbolSize: 8, //设定实心点的大小
areaStyle: {
normal: {
//线性渐变前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是true则该四个值是绝对像素位置。
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: '#01DDE9',
},
{
offset: 0.6,
color: '#086A79',
},
{
offset: 1,
color: '#0D3134',
},
],
false
),
},
},
data: dataValue,
}
]
}
myChart.setOption(option, true);
window.addEventListener("resize", function () {
myChart.resize();
});
}

View File

@ -3,35 +3,23 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../../css/font.css">
<link rel="stylesheet" href="../../plugin/layui-v2.9.7/layui/css/layui.css">
<link rel="stylesheet" href="../../css/coreTable.css"/>
<link rel="stylesheet" href="../../css/alarmMge/alarmMge.css">
<link rel="stylesheet" href="../../plugin/toolTip/mTips.css">
<script src="../../js/publics/jquery-3.6.0.min.js" type="text/javascript"></script>
<script src="../../js/publics/public.js"></script>
<script src="../../plugin/layui-v2.9.7/layui/layui.js"></script>
<script src="../../plugin/toolTip/mTips.js"></script>
<script src="../../js/publics/aes.js"></script>
<script src="../../js/publics/sm3.js"></script>
<script src="../../js/publics/public.js" type="text/javascript"></script>
<script src="../../api/commonRequest.js" type="text/javascript"></script>
<script src="../../js/publics/aescbc.js"></script>
<title>告警管理</title>
<style>
.single-option {
width: 90%;
height: 5vh;
background: linear-gradient(90deg, red, green, blue);
}
</style>
</head>
<body>
<div class="layout main-box">
<div class="left-box">
<div class="layout select" >
<div style="width: 100%;height: 100%;" id="selection"></div>
<!-- <div class="dark">qqq</div>
<div class="dark">qqq</div>
<div class="bright">qqq</div> -->
</div>
</div>
@ -42,11 +30,7 @@
<div class="layui-inline">
<label class="layui-form-label">建管单位:</label>
<div class="layui-input-inline">
<select>
<option value="">请选择</option>
<option value="AAA">选项 A</option>
<option value="BBB">选项 B</option>
<option value="CCC">选项 C</option>
<select lay-search id="build">
</select>
</div>
</div>
@ -54,7 +38,7 @@
<div class="layui-inline">
<label class="layui-form-label">工程名称:</label>
<div class="layui-input-inline">
<input type="text" id="searchKey" placeholder="请输入工程名称" autocomplete="off"
<input type="text" id="proName" placeholder="请输入工程名称" autocomplete="off"
class="layui-input">
</div>
</div>
@ -62,7 +46,7 @@
<div class="layui-inline">
<label class="layui-form-label">班组长:</label>
<div class="layui-input-inline">
<input type="text" id="searchKey" placeholder="请输入班组长" autocomplete="off"
<input type="text" id="teamLeader" placeholder="请输入班组长" autocomplete="off"
class="layui-input">
</div>
</div>
@ -74,6 +58,10 @@
</div>
</div>
</form>
<div class="right-down-right">
<table id="demo" lay-filter="test"></table>
</div>
</div>
</div>

View File

@ -2,10 +2,153 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../../css/font.css">
<link rel="stylesheet" href="../../plugin/layui-v2.9.7/layui/css/layui.css">
<link rel="stylesheet" href="../../css/coreTable.css"/>
<link rel="stylesheet" href="../../css/towerAssInspect/towerAssInspect.css">
<link rel="stylesheet" href="../../plugin/toolTip/mTips.css">
<script src="../../js/publics/jquery-3.6.0.min.js" type="text/javascript"></script>
<script src="../../js/publics/public.js"></script>
<script src="../../plugin/layui-v2.9.7/layui/layui.js"></script>
<script src="../../plugin/toolTip/mTips.js"></script>
<script src="../../js/publics/aes.js"></script>
<script src="../../js/publics/sm3.js"></script>
<script src="../../js/publics/echarts.js"></script>
<title>组塔检测</title>
</head>
<body>
组塔检测
<div class="layout main-box">
<div class="top-box">
<!-- 基塔模型 -->
<div class="top-box-left">
<div class="img-style tower-model layui-form">
<select >
<option>1号塔基</option>
<option>2号塔基</option>
<option>3号塔基</option>
</select>
<div class="img-style model">
</div>
</div>
</div>
<!-- 中间的 -->
<div class="top-box-center">
<!-- 设备列表 -->
<div class="top-box-center-top">
<div class="img-style device-list">
<div class="device-list-top">
<div class="alarm-title"></div> 告警
<div class="normal-title"></div> 正常
<div class="connection-title"></div> 掉线
</div>
<div class="device-list-bot">
<div class="device-list-device">
<div class="img-style alarm"></div>
<div class="device-list-font">设备1</div>
</div>
<div class="device-list-device">
<div class="img-style alarm"></div>
<div class="device-list-font">设备1</div>
</div>
<div class="device-list-device">
<div class="img-style alarm"></div>
<div class="device-list-font">设备1</div>
</div>
<div class="device-list-device">
<div class="img-style alarm"></div>
<div class="device-list-font">设备1</div>
</div>
<div class="device-list-device">
<div class="img-style alarm"></div>
<div class="device-list-font">设备1</div>
</div>
<div class="device-list-device">
<div class="img-style alarm"></div>
<div class="device-list-font">设备1</div>
</div>
<div class="device-list-device">
<div class="img-style alarm"></div>
<div class="device-list-font">设备1</div>
</div>
<div class="device-list-device">
<div class="img-style alarm"></div>
<div class="device-list-font">设备1</div>
</div>
<div class="device-list-device">
<div class="img-style alarm"></div>
<div class="device-list-font">设备1</div>
</div>
<div class="device-list-device">
<div class="img-style alarm"></div>
<div class="device-list-font">设备1</div>
</div>
<div class="device-list-device">
<div class="img-style alarm"></div>
<div class="device-list-font">设备1</div>
</div>
<div class="device-list-device">
<div class="img-style alarm"></div>
<div class="device-list-font">设备1</div>
</div>
</div>
</div>
</div>
<!-- 实时检测 -->
<div class="top-box-center-bot">
<div class="img-style detection">
<div class="detection-style detection-incline">
<div class="detection-style-font">
<div class="detection-style-font-top">倾斜检测</div>
<div class="detection-style-font-bot">倾角30°</div>
</div>
</div>
<div class="detection-style detection-tension">
<div class="detection-style-font">
<div class="detection-style-font-top">张力检测</div>
<div class="detection-style-font-bot">张力30N</div>
</div>
</div>
<div class="detection-style detection-crash">
<div class="detection-style-font">
<div class="detection-style-font-top">碰撞检测</div>
<div class="detection-style-font-bot">碰撞正常</div>
</div>
</div>
</div>
</div>
</div>
<!-- 变化趋势 -->
<div class="top-box-right">
<div class="img-style tendency" id="tendency">
</div>
</div>
</div>
<div class="bot-box">
<!-- 实施告警 -->
<div class="bot-box-left">
<div class="img-style real">
<div class="right-down-right">
<table id="demo1" lay-filter="test"></table>
</div>
</div>
</div>
<!-- 历史记录 -->
<div class="bot-box-right">
<div class="img-style history">
<div class="right-down-right">
<table id="demo2" lay-filter="test"></table>
</div>
</div>
</div>
</div>
</div>
</body>
<script src="../../js/pages/towerAssInspect/towerAssInspect.js" type="text/javascript"></script>
</html>