Commit 79b03ec2 authored by wangjinjing's avatar wangjinjing

更新jsp页面

parent 8ab1e201
var windowId,proName = window.location.pathname.split("/")[1],sysUrl = "http://"+window.location.host+"/"+proName,toEdit;
var num=0;
$(function(){
initGrid();
});
//查询条件
function getQueryParams(){
var sParam = {};
sParam.LIKEalarmrulename = $('#LIKEalarmrulename').textbox("getValue");
return sParam;
}
//加载列表
function initGrid(){
$('#ruleGrid').datagrid({
singleSelect:true,
rownumbers:true,
queryParams:getQueryParams(),
url : 'ywalarmruleinfoAction!listYwalarmruleinfoByPage.do',
columns : [[
{
field: 'A',
checkbox:'true',
width:30
},
{field:'alarmruleid',title:'alarmruleid',hidden:true,width:120,
formatter:function showClick(value,record,num){
return "<a href='javascript:void(0);' class='ahref' onclick='doUpdate("+num+")'>"+value+"</a>";
}
},
{field:'alarmrulename',title:'告警规则名称',hidden:false,width:120},
{field:'isenablemc',title:'是否启用',hidden:false,width:80},
{field:'alarmsourcemc',title:'告警来源',hidden:false,width:120},
{field:'alarmsource',title:'告警来源',hidden:true,width:120},
{field:'alarmtype',title:'告警类型',hidden:false,width:220,
formatter:function showClick(value,record,num){
var alarmTypeMc = '';
// console.log("alarmTypeMc: ",record,value);
var alarmSource = record.alarmsource;
var types = value.toString().split(",");
var len = types.length;
var typeMc = "";
for(var i=0; i<len; i++){
var type = types[i];
type = getAlarmtypeMc(alarmSource,type);
typeMc += type+",";
}
return typeMc.substr(0,typeMc.length-1);
}
},
{field:'alarmgrademc',title:'告警等级',hidden:false,width:80},
{field:'alarmtriggermc',title:'告警时触发',hidden:false,width:80},
{field:'alarmmaxcount',title:'最大告警次数',hidden:true,width:90},
{field:'autounalarmtime',title:'自动消警时间间隔',hidden:true,width:120},
{field:'remarks',title:'备注',hidden:false,width:150},
]],
onClickRow:function(index,row){
num=index;
setchecked();
},
onLoadSuccess:function(){
$("#ruleGrid").datagrid("selectRow",num);
setchecked();
}
});
}
function getAlarmtypeMc(alarmSource, type){
if(alarmSource == '1'){ // 监控告警
if(type=='2'){
type = "网络异常"
}else if(type=='3'){
type = "设备不在线"
}else if(type=='4'){
type = "视频抽帧异常"
}else if(type=='5'){
type = "视频质量诊断异常"
}else if(type=='6'){
type = "录像异常"
}
}else if(alarmSource == '2'){ // 服务器告警
if(type=='2'){
type = "主机不在线或程序异常"
}else if(type=='3'){
type = "CPU异常"
}else if(type=='4'){
type = "内存异常"
}else if(type=='5'){
type = "硬盘异常"
}else if(type=='6'){
type = "超时未上报"
}
}else if(alarmSource == '3'){ // 应用系统告警
if(type=='1'){
type='应用不在线';
}else if(type=='2'){
type='应用异常';
}
}else if(alarmSource == '4'){ // 存储告警
if(type=='1'){
type='存储无法连接';
}else if(type=='2'){
type='存储上水位报警';
}
}
/*if(alarmSource == '1'){ // 监控告警
if(type=='101'){
type = "网络异常"
}else if(type=='102'){
type = "设备不在线"
}else if(type=='104'){
type = "视频抽帧异常"
}else if(type=='105'){
type = "视频质量诊断告警"
}else if(type=='107'){
type = "录像异常"
}
}else if(alarmSource == '2'){ // 服务器告警
if(type=='201'){
type = "主机不在线或程序异常"
}else if(type=='202'){
type = "CPU异常"
}else if(type=='203'){
type = "内存异常"
}else if(type=='204'){
type = "硬盘异常"
}
}else if(alarmSource == '3'){ // 应用系统告警
if(type=='1'){
type='应用不在线';
}else if(type=='2'){
type='应用异常';
}
}else if(alarmSource == '4'){ // 存储告警
if(type=='1'){
type='存储无法连接';
}else if(type=='2'){
type='存储上水位报警';
}
}*/
return type;
}
function setchecked(){
var selRows = $('#ruleGrid').datagrid('getSelected');
if(selRows){
var alarmruleid = selRows.alarmruleid;
var alarmtype = selRows.alarmtype;
var alarmsource = selRows.alarmsource;
$("#alarmdeviceInfo").prop("src",'../../alarmtaskmanage/alarmruleinfodevice/ywalarmrulefordevice.jsp?alarmruleid='+alarmruleid+"&alarmtype="+alarmtype+"&alarmsource="+alarmsource);
}
}
//查询
function doSearch(){
$('#ruleGrid').datagrid('load',getQueryParams());
}
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<%@include file="../../../frame/assets/header-all.jsp"%>
<script type="text/javascript" src="ywalarmruleinfolist_show.js"></script>
<style>
/*
.form-line .text-content {
width: 115px;
}
*/
</style>
</head>
<!-- 设置高度,一行 44px,二行80,三行116-->
<body class="easyui-layout" >
<div data-options="region:'west',split:true" id='west' title='告警规则' style="height: 90%; width: 100%; background: #fff; overflow-y: auto;overflow-x: hidden">
<div class="form-line clearfix">
<div class='fl'>
<span class="text-content">告警规则名称:</span>
<input class="easyui-textbox" id="LIKEalarmrulename" data-options="validType:'length[0,40]'">
</div>
<div id="search" class="btn" style="background-color: #67c23a;" onclick="doSearch();">
<span class="l-btn-left" style="color: white;">查询</span>
</div>
</div>
<div data-options="region:'center',fit:true" class="easyui-layout">
<table id='ruleGrid'></table>
</div>
</div>
</body>
</html>
html,body,ul,li{margin:0;padding:0;list-style:none;overflow: hidden;}
.tabs-selected .tabs-inner{background-color:#67c23a !important;}
.tabs-selected .tabs-title{color:white !important;}
#alarm-detail{padding:10px 6px;overflow: hidden;}
.alarm-box{display:flex;}
.alarm-info{margin-left: 14px;position:relative; width: 212px;}
.alarm-info li{margin-bottom: 8px;line-height: 20px;color:#545454;font-size:12px;color:black;}
.alarm-info li span:nth-child(1){display: inline-block;width: 58px;}
.alarm-info li span:nth-child(2){display: inline-block; vertical-align: top;width:152px;}
.alarm-btn{position:absolute;bottom:0;left:0;}
.alarm-btn span{display:inline-block;height:30px;line-height:30px;text-align:center;background-color:#67c23a;color:#fff;width: 62px;cursor:pointer;}
#alarm-history{}
#alarm-history .title{height:28px;line-height:28px;color:#5e5e5e;font-weight:bold;}
#alarm-history .list{height:92px;overflow-y:auto;border:1px solid #bfbfbf;}
#alarm-history table{width:100%;text-align:center;}
#alarm-history thead{background-color:#dcdcdc;height:24px;line-height:24px;}
#alarm-history tr{height:24px;line-height:24px;cursor:pointer;}
#alarmHistoryContent tr td:nth-child(1){width:40px;}
#alarmHistoryContent tr td:nth-child(2){width:60px;}
#alarmHistoryContent tr td:nth-child(3){width:114px;}
#alarmHistoryContent tr td:nth-child(4){width:140px;}
#alarmHistoryContent tr td:nth-child(5) div{width:320px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;}
#alarm-history tr:hover{background-color:#E6E6E6;color: #444;}
#videoControls{ height: 20px; width:100%;padding:0 1px;}
#progressWrap{background-color: #73859f;height: 20px;cursor: pointer;}
#playProgress{background-color: yellow;width: 0px; height: 20px;}
#showProgress{font-size: 12px;line-height: 20px;padding-left: 10px;color: white;font-weight:bold;}
#timeTip{font-weight: bolder;background: black;position:absolute;height:14px;line-height:14px;z-index:20;color: white;display:none;}
.tab tr td:nth-child(1){width:70px;}
.tab tr td:nth-child(2){width: 180px;}
.tab tr td:nth-child(3){width:70px;}
.tab tr td:nth-child(4){width: 160px;}
\ No newline at end of file
<%@ page language="java" import="java.util.*" pageEncoding="gbk" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<%@include file="../../frame/assets/header-all.jsp" %>
<script type="text/javascript" src="../nhyw/js/jquery.form.js"></script>
<script type="text/javascript" src=""></script>
</head>
<body>
<div class="easyui-layout">
<form id="childform" class="easyui-form" data-options="novalidate:true">
<div class="form-line clearfix">
<div class="fl">
<span class="text-content">设备类型:</span>
<input id="alarmdevicetype" class="easyui-combobox"
data-options="required:true,validType:'length[0,128]'">
</div>
<div class="fl" id="machine" style="display: none">
<span class="text-content">服务器名称:</span>
<input id="machineid" class="easyui-combobox" data-options="required:true,validType:'length[0,128]'">
</div>
<div class="fl" id="video" style="display: none">
<span class="text-content"><em class="must"></em>设备名称:</span>
<input id="gysmc" disable class="easyui-textbox" data-options="required:false">
<div class="input-addimg" style="margin-top: -22px; margin-left: 245px;">
<a href="javascript:selectGys();" class="icon-add img-btn1"></a>
</div>
</div>
</div>
<%-- 根据选择设备类型展示是服务器数据还是监控数据--%>
<div id="videoparam">
<div class="form-line clearfix">
<div class="fl">
<span class="text-content"><em class="must"></em>通道编号:</span>
<input id="LIKEtdbh" class="easyui-textbox" data-options="required:false,validType:'length[0,40]'"
>
</div>
<div class="fl">
<span class="text-content"><em class="must"></em>设备编码:</span>
<input id="sbbh" disabled class="easyui-textbox"
data-options="required:false,validType:'length[0,40]'"
>
</div>
</div>
</div>
<%-- <div class="form-line clearfix" >--%>
<%-- <div class="fl">--%>
<%-- <span class="text-content"><em class="must"></em>CPU使用率:</span>--%>
<%-- <input id="cpuusag" class="easyui-textbox" data-options="required:false,validType:'length[0,10]'">--%>
<%-- </div>--%>
<%-- <div class="fl">--%>
<%-- <span class="text-content"><em class="must"></em>内存使用率:</span>--%>
<%-- <input id="memoryusag" class="easyui-textbox" data-options="required:false,validType:'length[0,10]'">--%>
<%-- </div>--%>
<%-- <div class="fl">--%>
<%-- <span class="text-content"><em class="must"></em>硬盘使用率:</span>--%>
<%-- <input id="harddiskusag" class="easyui-textbox" data-options="required:false,validType:'length[0,10]'">--%>
<%-- </div>--%>
<%-- </div>--%>
<div class="form-line clearfix">
<div class="fl">
<span class="text-content"><em class="must"></em>告警名称:</span>
<input id="alarrulename" disable class="easyui-textbox">
<div class="input-addimg" style="margin-top: -22px; margin-left: 245px;">
<a href="javascript:selectgj();" class="icon-add img-btn1"></a>
</div>
</div>
<div class="fl">
<span class="text-content"><em class="must"></em>告警子类:</span>
<select class="easyui-combobox" id="alarmsubtypes">
</select>
</div>
</div>
<div class="form-line clearfix">
<div class="fl">
<span class="text-content"><em class="must"></em>告警等级:</span>
<select class="easyui-combobox" id="alarmgrade">
<option value="1">重要</option>
<option value="2">次要</option>
<option value="3">一般</option>
<option value="4">提示</option>
</select>
</div>
<div class="fl">
<span class="text-content"><em class="must"></em>发生时间:</span>
<input id="faultoccurtime" class="easyui-datetimebox">
</div>
</div>
<div class="form-line clearfix">
<div class="fl">
<span class="text-content"><em class="must"></em>故障描述:</span>
<textarea id="falutdescription" style="width:400px;height:60px"> </textarea>
</div>
</div>
<div id="upload">
<div class="form-line clearfix">
<div class="fl">
<span class="text-content"><em class="must"></em>故障图片:</span>
<input disabled id="xctp2" class="easyui-textbox"
data-options="required:false,validType:'length[0,128]'">
</div>
<div class="fl">
<form id="uploadForm2" class="form" action="" method="post" enctype="multipart/form-data">
<input type="file" name="myFile" multiple style="margin-left: -85px !important;"/>
<input type="button" id="submitPic2" value="上传"/>
</form>
<span id="uploadResultPic2" style="color:blue" class="text-content"></span>
</div>
</div>
<div class="form-line clearfix">
<div class="fl">
<span class="text-content"><em class="must"></em>视频地址:</span>
<input disabled id="xcsp" class="easyui-textbox"
data-options="required:false,validType:'length[0,128]'">
</div>
<div class="fl">
<form id="uploadFormVideo" class="form" action="" method="post" enctype="multipart/form-data">
<input type="file" name="myFile" id="xxxxx" multiple/>
<input type="button" id="submitVideo" value="上传"/>
</form>
<span id="uploadResultVideo" class="text-content" style="color:blue"></span>
</div>
</div>
</div>
</form>
</div>
</div>
</body>
</html>
<script type="text/javascript">
var sel = {};
var winId = $.getUrlParam("winId");
var jobid = $.getUrlParam("jobid");
var isdelayatbefor = false;
var alarmeventinfo = {};
var alarmsubtypeObj=[];
var devicetypedata = [
{"id": "1", "text": "监控", "selected": true},
{"id": "2", "text": "服务器"}
];
$(function () {
//根据选择的设备类型加载设备信息
$('#alarmdevicetype').combobox({
data: devicetypedata,//加载数据
valueField: 'id',
textField: 'text',
//onselect事件查询设备信息
onSelect: function (record) {
if (record.id == '1') {
//如果选择的是监控
$("#machine").css("display", "none");
$("#video").css("display", "block");
$("#videoparam").css("display", "block");
$("#upload").css("display", "block");
} else if (record.id == '2') {
$("#machine").css("display", "block");
$("#video").css("display", "none");
$("#videoparam").css("display", "none");
$("#upload").css("display", "none");
}
}
});
$('#machineid').combobox({
url: 'ywmachineinfoAction!query_Ywmachineinfo.do',
textField: "machinename",
valueField: "machineid",
panelWidth: 148,
value: ""
});
$("#faultoccurtime").datetimebox("setValue", $.getTodayStart(0, "00:00:00"));
// 确认 反馈人相关信息
$('#jobacceptcompany').combobox({ // 确认反馈单位
url: 'ywrepairjobinfoAction!getReportBm.do', // 查询有审批工单权限的部门
textField: "bmmc",
valueField: "bmbh",
panelWidth: 148,
value: ""
});
$("#jobacceptcompany").combobox({
onChange: function (n, o) {
$('#jobreportpeople').combobox({ // 选取确认反馈人
url: 'ywrepairjobinfoAction!getReportUser.do?bmbh=' + n, // 查询部门下有审批工单权限的人
textField: "yhmc",
valueField: "yhzh",
value: ""
});
}
})
// 点击确认提交数据
parent.parent.$(".l-btn-text").on("click", function () {
if ($(this).text() == "确定") {
//新增到库中
saveInfo();
}
})
});
function doSearch() {
//channelSmallType
var param = {
LIKEsbbh: $('#sbbh').textbox('getValue'),
LIKEtdmc: $('#tdmc').textbox('getValue'),
tdlx: $('#tdlx').combobox('getValue')
};
$('#tableGrid').datagrid('options').url = "sbtdspsrAction!query_Sbtdspsr_ext.do";
$("#tableGrid").datagrid('load', param);
}
function selectGys() {
var url = "";
if (top.sysUrl) {
url = top.sysUrl + "/yw/ptxztree/ptxzs_show.jsp";
}
gysWin = top.$.createWin({
title: "设备",
width: 800,
height: 500,
url: url,
buttons: [{
text: $.fn.textbox.defaults.ok,
handler: doUpdateGysValue
}]
});
}
function selectgj() {
var url = "";
if (top.sysUrl) {
url = top.sysUrl + "/yw/alarmtaskmanage/alarmrule/ywalarmruleinfolist_show.jsp";
}
gjWin = top.$.createWin({
title: "告警规则",
width: 700,
height: 500,
url: url,
buttons: [{
text: $.fn.textbox.defaults.ok,
handler: selectrule
}]
});
}
function doUpdateGysValue() {
var win = $.getTopWindowById(gysWin);
var selRows_no = win.$('#noCodeSearch').datagrid('getSelections');
var selRows_out = win.$('#outCodeSearch').datagrid('getSelections');
if (selRows_no.length <= 0 && selRows_out.length <= 0) {
$.showMsg('请先选择一条记录! ');
return;
}
if (selRows_no.length > 1) {
$.showMsg('选择记录数量大于1! ');
return;
}
var idArray = [];
if (selRows_no.length > 0) {
for (var i = 0; i < selRows_no.length; i++) {
alarmeventinfo.alarmdeviceid = selRows_no[i].sbbh;
$("#gysmc").textbox("setValue", selRows_no[i].tdmc);
$("#LIKEtdbh").textbox("setValue", selRows_no[i].tdbh);
$("#sbbh").textbox("setValue", selRows_no[i].sbbh);
}
}
if (selRows_out.length > 0) {
for (var i = 0; i < selRows_out.length; i++) {
alarmeventinfo.alarmdeviceid = selRows_out[i].sbbh;
$("#gysmc").textbox("setValue", selRows_out[i].tdmc);
$("#LIKEtdbh").textbox("setValue", selRows_out[i].tdbh);
$("#sbbh").textbox("setValue", selRows_out[i].sbbh);
}
}
top.$("#" + gysWin).dialog("close");
}
function selectrule() {
var win = $.getTopWindowById(gjWin);
var selRows_rule = win.$('#ruleGrid').datagrid('getSelections');
if (selRows_rule.length > 0) {
for (var i = 0; i < selRows_rule.length; i++) {
alarmeventinfo.alarmtype = parseInt(selRows_rule[i].alarmsource);
//alarmeventinfo.alarmsource = parseInt(selRows_rule[i].alarmsource);
//加载到二级目录中,将1,2,3,4转化为数据表中的subtypecode
var types= selRows_rule[i].alarmtype.split(',');
for (var j = 0; j<types.length; j++) {
getalarmtype(selRows_rule[i].alarmsource,types[j],j);
}
$('#alarmsubtypes').combobox({
data: alarmsubtypeObj,//加载数据
valueField: 'value',
textField: 'text'});
alarmeventinfo.alarmruleid = selRows_rule[i].alarmruleid;
alarmeventinfo.alarmsourcename = parseInt(selRows_rule[i].alarmsourcemc);
$("#alarrulename").textbox("setValue", selRows_rule[i].alarmrulename);
$("#faulttypeMc").textbox("setValue", selRows_rule[i].alarmsourcemc);
$('#alarmgrade').combobox('select', selRows_rule[i].alarmgrade);
}
}
top.$("#" + gjWin).dialog("close");
}
function getalarmtype(alarmsource,type,index) {
if(alarmsource=="1") {
if (type== "2") {
alarmsubtypeObj[index] = {value: "101", text: "网络异常"};
} else if (type == "3") {
alarmsubtypeObj[index] = {value: "102", text: "设备不在线"};
}
else if (type == "4") {
alarmsubtypeObj[index] = {value: "104", text: "视频抽帧异常"};
}
else if (type == "5") {
alarmsubtypeObj[index] = {value: "105", text: "视频质量诊断异常"};
}
else if (type == "6") {
alarmsubtypeObj[index] = {value: "107", text: "录像异常"};
}
}else if( alarmsource=="2"){
if (type== "2") {
alarmsubtypeObj[index] = {value: "201", text: "主机不在线或程序异常"};
} else if (type == "3") {
alarmsubtypeObj[index] = {value: "202", text: "CPU异常"};
}
else if (type == "4") {
alarmsubtypeObj[index] = {value: "203", text: "内存异常"};
}
else if (type == "5") {
alarmsubtypeObj[index] = {value: "204", text: "硬盘异常"};
}
else if (type == "6") {
alarmsubtypeObj[index] = {value: "6", text: "超时未上报"};
}
}
}
//查询条件
function getQueryParams() {
var model = {};
var tableparam = "";
model.xzId = xzTree.tree("getSelected").xzId;
model.LIKEvdId = $('#vdId').textbox('getValue');
model.LIKEchannelName = $('#channelName').textbox('getValue');
model.channelSmallType = $('#channelSmallType').combobox('getValue');
model.tableparam = tableparam;
return model;
}
$("#submitPic2").on('click', function () {
$.ajax({
url: "uploadPictureAction!uploadPicture.do",
type: "POST",
data: new FormData($('#uploadForm2')[0]),//$( '#uploadForm1').serialize(), //表单序列化 ,【注意】上传文件的文件流是无法被序列化并传递的
processData: false, // 告诉jquery不要处理发送的数据
contentType: false, // 告诉jquery不要设置content-Type请求头
success: function (data) {
if (data && data != "error") {
$.showMsg("上传成功");
$("#xctp2").textbox("setValue", data);
$("#uploadResultPic2").text("上传成功");
} else {
$.showMsg("上传失败");
$("#uploadResultPic2").text("上传失败");
}
//$("#uploadForm2").resetForm();
}
});
});
$("#submitVideo").on('click', function () {
$.ajax({
url: "uploadPictureAction!uploadPicture.do",
type: "POST",
data: new FormData($('#uploadFormVideo')[0]),//$( '#uploadForm1').serialize(), //表单序列化 ,【注意】上传文件的文件流是无法被序列化并传递的
processData: false, // 告诉jquery不要处理发送的数据
contentType: false, // 告诉jquery不要设置content-Type请求头
success: function (data) {
if (data && data != "error") {
$.showMsg("上传成功");
$("#xcsp").textbox("setValue", data);
$("#uploadResultVideo").text("上传成功");
} else {
$.showMsg("上传失败");
$("#uploadResultVideo").text("上传失败");
}
//$("#uploadFormVideo").resetForm();
}
});
});
function saveInfo() { // 数据入库
alarmeventinfo.alarmdevicetype = parseInt($('#alarmdevicetype').combobox("getValue"));
if (alarmeventinfo.alarmdevicetype == "2") {
alarmeventinfo.alarmdeviceid = $('#machineid').combobox("getValue");
if (isNull(alarmeventinfo.alarmdeviceid)) {
top.$.dlg.alertError('服务器不能为空! ');
return;
}
alarmeventinfo.alarmdevicename = $('#machineid').combobox("getText");
} else {
if (isNull($("#sbbh").textbox("getValue"))) {
top.$.dlg.alertError('监控不能为空! ');
return;
}
alarmeventinfo.channelnum = parseInt($("#LIKEtdbh").textbox("getValue"));
alarmeventinfo.pictureurl = $("#xctp2").textbox("getValue");
alarmeventinfo.videourl = $("#xcsp").textbox("getValue");
alarmeventinfo.alarmdevicename = $("#gysmc").textbox("getValue");
}
alarmeventinfo.alarmgrade = parseInt($("#alarmgrade").textbox("getValue"));
alarmeventinfo.alarmrulename = $("#alarrulename").textbox("getValue");
if (isNull(alarmeventinfo.alarmrulename)) {
top.$.dlg.alertError('告警不能为空! ');
return;
}
alarmeventinfo.alarmreason = $("#falutdescription").val();
alarmeventinfo.alarmtime = $('#faultoccurtime').datetimebox('getValue');
alarmeventinfo.alarmsubtypecode= $('#alarmsubtypes').combobox("getValue");
alarmeventinfo.alarmsubtypename= $('#alarmsubtypes').combobox("getText");
alarmeventinfo.processstatus = 900;
$.ajax({
url: "ywalarmeventinfoAction!insert_Ywalarmeventinfo.do",
type: "POST",
dataType: "JSON",
data: alarmeventinfo,
success: function (res) {
if (res == 'success') {
$.showMsg("操作成功");
top.$("#" + winId).dialog('close');
}
}
})
}
function isNull(str) {
if (str == null || str == '' || str == " " || str == "null" || str == undefined) {
return true;
} else {
return false;
}
}
</script>
\ No newline at end of file
......@@ -118,6 +118,10 @@ function initGrid(){
text:'工单上报',
iconCls:'icon-Workorderreport',
handler:reportOrder
},{
text:'新增告警',
iconCls:'icon-Workorderreport',
handler:insertAlarm
}/*
* , { text:'普通列表', iconCls:'icon-showList', handler:showList }, {
* text:'统计', iconCls:'icon-showStatics', handler:showStatics }, {
......@@ -848,7 +852,7 @@ $.extend($.fn.datagrid.methods,
}
c.html('<div class="img-box">' + l.join("") + "</div>")
}
});
});
function detailVideoQuality(id){
var url = sysUrl+"/yw/videoalarm/itemPage/detailVideoQuality.jsp";
......@@ -972,7 +976,88 @@ function reportOrder(){
});
}
}
//新增告警
function insertAlarm (){
// // 创建窗口
// if(top.$("#" + detailWindowId + "").length > 0) {
// top.$("#" + detailWindowId + "").html("");
// }
// detailWindow = top.$('<div id=' +detailWindowId+'/>');
// createDetailWindow("detailWindow");
// setTimeout(function(){
// detailWindow.children('iframe').attr('src',sysUrl+'/yw/homepage/addAlarm.jsp');
// detailWindow.dialog('open');
// //top.editInfo = rows;
// top.framewindow = detailWindow;
// },100);
toEdit=false;
windowId = top.$.createWin({
title : '新增告警信息',
width : 550,
height : 420,
buttons: [{
text:$.fn.textbox.defaults.ok,
// handler:saveNodeInfo
}],
url : sysUrl+"/yw/homepage/addAlarm.jsp"
});
}
//保存
function saveNodeInfo() {
var win = $.getTopWindowById(windowId);
var jq = win.$;
var model = $.getFormValues("childform", windowId);
console.log(model);
if (!win.$('#childform').form('enableValidation').form('validate')) {
return;
}
model.xmms = jq("#xmms").val();
model.bz = jq("#bz").val();
if (toEdit) {//修改
model.XGTJxh = jq('#xh').val();
//model.checkparam = " and xh='"+model.xh+"' ";
$.ajax({
type: 'post',
dataType: 'json',
url: 'nhywxmxxAction!update_Nhywxmxx.do',
data: model,
success: function (value) {
if (value == "success") {
$.showMsg("操作成功!");
top.$("#" + windowId).dialog('close');
doSearch();
} else if (value == "same") {
$.showMsg("已存在!");
} else {
$.showMsg("操作失败!");
}
}
});
} else {
//model.checkparam = " and xh='"+model.xh+"' ";
$.ajax({
type: 'post',
dataType: 'json',
url: 'nhywxmxxAction!insert_Nhywxmxx.do',
data: model,
success: function (value) {
if (value == "success") {
$.showMsg("操作成功!");
top.$("#" + windowId).dialog('close');
doSearch();
} else if (value == "same") {
$.showMsg("已存在!");
} else {
$.showMsg("操作失败!");
}
}
});
}
}
function saveBatchOrder(){
var flag = false;
var win = $.getTopWindowById(windowId);
......@@ -1156,7 +1241,7 @@ function createDetailWindow(name){
height:510,
modal:true,
onClose:function(){
var win = detailWindow.children('iframe')[0].contentWindow;
var win = detailWindow.children('iframe')[0].contentWindow ;
win.unloadWindow();
},
buttons:[{
......@@ -1168,4 +1253,5 @@ function createDetailWindow(name){
}
}]
});
}
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<%@include file="../../../frame/assets/header-all.jsp"%>
<script type="text/javascript" src="ywxhdcurrentstate.js"></script>
<script type="text/javascript" src=""></script>
<style>
/*
.form-line .text-content {
width: 115px;
}
*/
.progress-textRed{
border: 1px solid red !important; color: #666;
font-size: 12px;
width: 100px;
height: 20px;
line-height: 20px;
text-align: center;
}
.progress-text{ border: 1px solid green;}
.progress-value{background:green;}
</style>
</head>
<!-- 设置高度,一行 44px,二行80,三行116-->
<body class="easyui-layout" >
<div data-options="region:'north'" id='north' style="height: 44px;border-bottom: none">
<div class="form-line clearfix">
<div class='fl'>
<span class="text-content">信号灯名称:</span>
<input class="easyui-textbox" id="LIKExhdmc" data-options="validType:'length[0,40]'">
</div>
<div class='fl'>
<span class="text-content">区域名称:</span>
<input class="easyui-textbox" id="LIKEqymc" data-options="validType:'length[0,40]'">
</div>
<div class='fl'>
<span class="text-content">路口名称:</span>
<input class="easyui-textbox" id="LIKElkmc" data-options="validType:'length[0,40]'">
</div>
<!-- <div class='fl'>
<span class="text-content">主机状态:</span>
<input class="easyui-textbox" id="LIKEmachinestatusid" data-options="validType:'length[0,40]'" >
</div>
<div class='fl'>
<span class="text-content">检测时间(起):</span>
<input class="easyui-datetimebox" id="startTime" >
</div>
<div class='fl'>
<span class="text-content">检测时间(止):</span>
<input class="easyui-datetimebox" id="endTime" >
</div> -->
</div>
</div>
<div data-options="region:'center',split:false" class="easyui-layout">
<table id='tableGrid'></table>
</div>
<form action="" method="post" name="excelForm" id="excelForm" style="display: none;">
</form>
</body>
</html>
var windowId, proName = window.location.pathname.split("/")[1],
sysUrl = "http://" + window.location.host + "/" + proName, toEdit;
$(function () {
initDefault();
});
//默认
function initDefault() {
initGrid();
}
//查询条件
function getQueryParams() {
var sParam = {};
// var startTime = $('#startTime').datetimebox("getValue");
// var endTime = $('#endTime').datetimebox("getValue");
sParam.LIKExhdmc = $('#LIKExhdmc').textbox("getValue");
sParam.LIKElkmc = $('#LIKElkmc').textbox("getValue");
sParam.LIKEqymc = $('#LIKEqymc').textbox("getValue");
// sParam.startTime = startTime;
// sParam.endTime = endTime;
// sParam.order = " order by createtime desc"
return sParam;
}
//加载列表
function initGrid() {
var toolbar = [{
text: '查询',
iconCls: 'icon-search',
handler: doSearch
}];
$('#tableGrid').datagrid({
toolbar: toolbar,
singleSelect: true,
rownumbers: true,
queryParams: getQueryParams(),
url: 'nhywjtxhdglAction!listNhywjtxhdglStatusByPage.do',
columns: [[
/* {
field: 'A',
checkbox:'true',
width:30
},*/
{field: 'xhdmc', title: '信号灯名称', hidden: false, width: 120},
{field: 'xhdbh', title: '信号灯编号', hidden: false, width: 120},
{field: 'qymc', title: '区域名称', hidden: false, width: 120},
{field: 'lkmc', title: '路口名称', hidden: false, width: 120},
{field: 'time', title: '检测时间', hidden: false, width: 125,
formatter: function (value, row, index) {
return new Date(value).format("yyyy-MM-dd hh:mm:ss");
}
},
{
field: 'mode', title: '当前状态', hidden: false, width: 60,
formatter: function showClick(value, record, num) {
if (value == 20) {
return "<div style='height:13px;width:13px;background-color:#fe0000;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
// }else if(value==0){
} else {
return "<div style='height:13px;width:13px;background-color:green;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
}
// else{
// return value;
// }
}
},
{
field: 'currentstateid', title: '操作', hidden: false, width: 70,
formatter: function showClick(value, record, num) {
return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px,5px;" class="l-btn l-btn-small" onclick="lookHistory(' + num + ')" group="" id=""><span class="l-btn-left"><span class="l-btn-text">详情</span></span></a>';
}
},
]]
});
}
//删除
function doDelete() {
var selRows = $('#tableGrid').datagrid('getSelected');
if (!selRows) {
$.showMsg('请先选择记录! ');
return;
}
top.$.dlg.confirm('确认删除?', function () {
$.ajax({
type: 'post',
dataType: 'json',
url: 'ywmachinecurrentstateAction!delete_Ywmachinecurrentstate.do',
data: {
currentstateid: selRows.currentstateid
},
success: function (flag) {
if (flag == "success") {
$.showMsg("操作成功!");
doSearch();
} else {
$.showMsg("操作失败!");
}
}
});
});
}
//批量删除
function doDelete_batch() {
var selRows = $('#tableGrid').datagrid('getChecked');
var keyword = [];
if (selRows === null) {
$.showMsg('请先选择一行! ');
return;
} else {
for (var i = 0; i < selRows.length; i++) {
keyword.push(selRows[i].currentstateid);
}
top.$.dlg.confirm('你确认要删除吗?', function () {
$.ajax({
type: 'post',
dataType: 'json',
url: 'ywmachinecurrentstateAction!batch_delete_Ywmachinecurrentstate.do',
data: {keyword: keyword.join(",")},
success: function (flag) {
if (!$.isNull(flag)) {
$.showMsg("操作成功!");
doSearch();
} else {
$.showMsg("操作失败!");
}
}
});
});
}
}
//查询
function doSearch() {
$('#tableGrid').datagrid('load', getQueryParams());
}
//增加
function doAdd() {
toEdit = false;
windowId = top.$.createWin({
title: '增加信息',
width: 650,
height: 300,
buttons: [{
text: $.fn.textbox.defaults.ok,
handler: saveNodeInfo
}],
url: sysUrl + "/im/ywgl/ywmachinecurrentstate_show.jsp"
});
}
//修改
function doUpdate(index) {
toEdit = true;
var selRows = $('#tableGrid').datagrid('getRows')[index];
windowId = top.$.createWin({
title: '修改信息',
width: 650,
height: 300,
data: selRows,
buttons: [{
text: $.fn.textbox.defaults.ok,
handler: saveNodeInfo
}],
url: sysUrl + "/im/ywgl/ywmachinecurrentstate_show.jsp"
});
}
//保存
function saveNodeInfo() {
var win = $.getTopWindowById(windowId);
var jq = win.$;
var model = $.getFormValues("childform", windowId);
//console.log(model);
if (!win.$('#childform').form('enableValidation').form('validate')) {
return;
}
if (toEdit) {//修改
model.XGTJcurrentstateid = jq('#currentstateid').val();
//model.checkparam = " and xh='"+model.xh+"' ";
$.ajax({
type: 'post',
dataType: 'json',
url: 'ywmachinecurrentstateAction!update_Ywmachinecurrentstate.do',
data: model,
success: function (value) {
if (value == "success") {
$.showMsg("操作成功!");
top.$("#" + windowId).dialog('close');
doSearch();
} else if (value == "same") {
$.showMsg("已存在!");
} else {
$.showMsg("操作失败!");
}
}
});
} else {
//model.checkparam = " and xh='"+model.xh+"' ";
$.ajax({
type: 'post',
dataType: 'json',
url: 'ywmachinecurrentstateAction!insert_Ywmachinecurrentstate.do',
data: model,
success: function (value) {
if (value == "success") {
$.showMsg("操作成功!");
top.$("#" + windowId).dialog('close');
doSearch();
} else if (value == "same") {
$.showMsg("已存在!");
} else {
$.showMsg("操作失败!");
}
}
});
}
}
//打开修改
function doEdit() {
var selIndex = $('#tableGrid').datagrid('getRowIndex', $("#tableGrid").datagrid('getSelected'))
if (selIndex == -1) {
$.showMsg('请先选择一行! ');
return;
} else {
doUpdate(selIndex);
}
}
//模板下载
function doTemplate() {
var baseUrl = $.proPath();
var downFile = baseUrl + "/down/down.xls";
window.location.href = downFile;
}
//导入
function doImport() {
toEdit = false;
windowId = top.$.createWin({
id: $.uniqueId(),
title: '导入',
width: 400,
height: 130,
url: sysUrl + "/im/xx/ywmachinecurrentstate_imp.jsp"
});
}
//导出
function doExport() {
var model = getQueryParams();
$.ajax({
type: 'post',
dataType: 'json',
data: model,
url: 'ywmachinecurrentstateAction!count_Ywmachinecurrentstate.do',
success: function (value) {
if (!$.isNull(value)) {
countExport(value);
} else {
$.showMsg("操作失败!");
}
}
});
}
// 导出传参条件
function countExport(totalSize) {
var limit = 5000;
if (totalSize > 5000) {
top.$.dlg.confirm('记录过多支持前5000条,确定要将记录导出Excel为表格吗?', function () {
execExport();
});
} else {
top.$.dlg.confirm('确认导出?', function () {
execExport();
})
}
}
// 调用后台
function execExport() {
var model = getQueryParams();
var downParam = "";
document.excelForm.action = 'ywmachinecurrentstateAction!exp_Ywmachinecurrentstate.do?' + downParam;
document.excelForm.submit();
}
// 查看历史记录
function lookHistory(index) {
//console.log("历史跳转:",index);
var selRows = $('#tableGrid').datagrid('getRows')[index];
windowId = top.$.createWin({
title: '历史记录',
width: 800,
height: 500,
data: selRows,
url: sysUrl + "/yw/recordalarm/nhywjtxhdglstate/ywxhdhistorystate.jsp?qybh=" + selRows.qybh + "&lkh=" + selRows.lkh,
// onClose : closeRecordVideo
});
}
var qybh = $.getUrlParam("qybh");
var lkh = $.getUrlParam("lkh");
$(function(){
// console.log("历史记录:",currentstateid);
initDefault();
});
//默认
function initDefault(){
// 设置默认时间
$("#startTime").datetimebox("setValue",$.getTodayStart(0,"00:00:00"));
$("#endTime").datetimebox("setValue",$.getTodayEnd("23:59:59"));
initGrid();
}
//查询条件
function getQueryParams(){
var sParam = {};
sParam.qybh = qybh;
sParam.lkh = lkh;
sParam.tableparam="";
var startTime = $('#startTime').datetimebox("getValue");
var endTime = $('#endTime').datetimebox("getValue");
if(!(startTime==null||startTime==""||startTime==undefined)){
sParam.tableparam += " AND time > '" +startTime + "'";
}
if(!(endTime==null||endTime==""||endTime==undefined)){
sParam.tableparam += " AND time < '" +endTime + "'";
}
sParam.order = "order by time desc"
// console.log("查询参数:",sParam);
return sParam;
}
//加载列表
function initGrid(){
var toolbar = [/*{
text : '刷新',
iconCls : 'icon-refresh',
handler : function(){location.reload(true);}
},*/{
text : '查询',
iconCls : 'icon-search',
handler : doSearch
}];
$('#tableGrid').datagrid({
toolbar : toolbar,
singleSelect:true,
rownumbers:true,
queryParams:getQueryParams(),
url : 'nhywjtxhdglAction!listNhywjtxhdglHistoryStateByPage.do',
columns : [[
{field:'xhdmc',title:'信号灯名称',hidden:false,width:120},
{field:'xhdbh',title:'信号灯编号',hidden:false,width:120},
{field:'qymc',title:'区域名称',hidden:false,width:120},
{field:'lkmc',title:'路口名称',hidden:false,width:120},
{field:'time',title:'检测时间',hidden:false,width:125,
formatter:function(value,row,index){return new Date(value).format("yyyy-MM-dd hh:mm:ss");}},
{field:'mode',title:'当前状态',hidden:false,width:60,
formatter:function showClick(value,record,num){
// console.log("主机:",value,record);
if(value==20){
return "<div style='height:13px;width:13px;background-color:#fe0000;border-radius:50%;-moz-border-radius: 50%;-webkit-border-radius: 50%;margin:0 auto;'></div>";
}else{
return value;
}
}
}]]
});
}
//查询
function doSearch(){
$('#tableGrid').datagrid('load',getQueryParams());
}
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<%@include file="../../../frame/assets/header-all.jsp"%>
<script type="text/javascript" src="ywxhdhistorystate.js"></script>
<script type="text/javascript" src=""></script>
<style>
/*
.form-line .text-content {
width: 115px;
}
*/
</style>
</head>
<!-- 设置高度,一行 44px,二行80,三行116-->
<body class="easyui-layout" >
<div data-options="region:'north'" id='north' style="height: 44px;border-bottom: none">
<div class="form-line clearfix">
<div class='fl'>
<span class="text-content">检测时间(起):</span>
<input class="easyui-datetimebox" id="startTime" >
</div>
<div class='fl'>
<span class="text-content">检测时间(止):</span>
<input class="easyui-datetimebox" id="endTime" >
</div>
</div>
</div>
<div data-options="region:'center',split:false" class="easyui-layout">
<table id='tableGrid'></table>
</div>
<form action="" method="post" name="excelForm" id="excelForm" style="display: none;">
</form>
</body>
</html>
......@@ -37,9 +37,9 @@ dojoConfig = {
var map = new esri.Map("map");
//测试环境
//var arcGISTiledMapServiceLayer=new esri.layers.ArcGISTiledMapServiceLayer("http://101.95.167.134:6080/arcgis/rest/services/NanHai_SL/MapServer");
var arcGISTiledMapServiceLayer=new esri.layers.ArcGISTiledMapServiceLayer("http://101.95.167.134:6080/arcgis/rest/services/NanHai_SL/MapServer");
//var arcGISTiledMapServiceLayer=new esri.layers.ArcGISTiledMapServiceLayer(top.ditu.mapServer);
var arcGISTiledMapServiceLayer=new esri.layers.ArcGISTiledMapServiceLayer("http://192.168.182.37:6080/arcgis/rest/services/NH0614/MapServer");
map.addLayer(arcGISTiledMapServiceLayer);
//加入打点图层
......
<%--
Created by IntelliJ IDEA.
User: Administrator
Date: 2019/10/28
Time: 16:17
To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<%@include file="../../frame/assets/header-all.jsp"%>
<script type="text/javascript" src="../common/js/echarts/echarts.min.js"></script>
<script type="text/javascript" src="../common/js/echarts/EchartsBase.js"></script>
<script type="text/javascript" src="../../common/Constants.js"></script>
<script type="text/javascript" src="ywvideocurrentstate.js"></script>
<script type="text/javascript" src=""></script>
<style>
#deviceTotal{
padding:15px 15px;
display:flex;
}
.frontDeviceTotal{
height:150px;
width:40%;
text-align:center;
margin-right:20px;
}
.deviceAnalysisGraphChartBox{
width:60%;
background: #fff2e1;
}
.frontDeviceTotal > ul{
display:flex;
}
.frontDeviceTotal li {
position:relative;
height:150px;
width:calc(32%);
margin:0 6px;
background:url(ywvideotaskrunresult/images/1.jpg);
color:white;
}
.frontDeviceTotal li:nth-child(2){
background:url(ywvideotaskrunresult/images/2.jpg);
}
.frontDeviceTotal li:nth-child(3){
background:url(ywvideotaskrunresult/images/3.jpg);
}
.frontDeviceTotal span{
display:block;
position:absolute;
}
.total{
text-align: center;
top:40%;
left:0;
width: 100%;
font-size: 16px;
font-weight: bold;
}
.name{
text-align: center;
bottom: 0;
width: 100%;
background: rgb(0,0,0,0.4);
height: 30px;
line-height: 30px;
font-size: 13px;
}
.text-content{
width:77px !important;
}
.form-line{
padding-bottom:4px;
}
.handleCom{
border-top: 1px dashed #DADADA;
border-collapse: collapse;
padding: 5px 4px;
font-size: 12px;
background: #ccc;
}
.handleCom1{
background: #ccc;
border-top: 1px dashed #DADADA;
border-collapse: collapse;
padding: 5px 4px;
font-size: 12px;
}
</style>
</head>
<!-- 设置高度,一行 44px,二行80,三行116-->
<body class="easyui-layout" >
<div data-options="region:'north'" title="状态概览" id='north' style="height: 260px;border-bottom: none">
<div id="deviceTotal" >
<div class="frontDeviceTotal" >
<ul>
<li><span class="total" id="frontDeviceTotal">0</span><span class="name">设备总量</span></li>
<li><span class="total" id="normalFrontDeviceTotal">0</span><span class="name">正常设备量</span></li>
<li><span class="total" id="abnormalFrontDeviceTotal">0</span><span class="name">异常设备量</span></li>
</ul>
</div>
<div class="deviceAnalysisGraphChartBox">
<div id="deviceAnalysisGraphChart" style="width:100%;height:150px;"></div>
</div>
</div>
<div class="form-line clearfix">
<div class='fl'>
<span class="text-content">行政分组:</span>
<input class="easyui-combotree" id="videoalarm" data-options="validType:'length[0,80]'" >
</div>
<div class='fl'>
<span class="text-content">通道名称:</span>
<input class="easyui-textbox" id="LIKEchannelname" data-options="validType:'length[0,80]'">
</div>
<div class='fl'>
<span class="text-content">设备状态:</span>
<input class="easyui-combobox" id="currentstate" name="currentstate" data-options="multiple:true, textField:'text', valueField:'id', panelWidth:148,value:''" >
</div>
</div>
<!--
<div class="form-line clearfix">
<div class='fl'>
<span class="text-content">设备编号:</span>
<input class="easyui-textbox" id="LIKEvideonum" data-options="validType:'length[0,40]'">
</div>
<div class='fl'>
<span class="text-content">通道编号:</span>
<input class="easyui-numberbox" id="channelnum" data-options="validType:'length[0,10]'">
</div>
</div>
-->
</div>
<div data-options="region:'center',split:false" class="easyui-layout">
<table id='tableGrid'></table>
</div>
<form action="" method="post" name="excelForm" id="excelForm" style="display: none;">
</form>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment