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
...@@ -13,7 +13,7 @@ $(function(){ ...@@ -13,7 +13,7 @@ $(function(){
*/ */
videoTaskPushlet.init(); videoTaskPushlet.init();
initGrid(); initGrid();
}); });
//巡检任务告警弹框消息关闭 //巡检任务告警弹框消息关闭
...@@ -64,7 +64,7 @@ function getQueryParams(){ ...@@ -64,7 +64,7 @@ function getQueryParams(){
* sParam.LIKEextend2 = $('#LIKEextend2').textbox("getValue"); * sParam.LIKEextend2 = $('#LIKEextend2').textbox("getValue");
* sParam.LIKEextend3 = $('#LIKEextend3').textbox("getValue"); * sParam.LIKEextend3 = $('#LIKEextend3').textbox("getValue");
* sParam.LIKEextend4 = $('#LIKEextend4').textbox("getValue"); * sParam.LIKEextend4 = $('#LIKEextend4').textbox("getValue");
* *
*/ */
/* /*
* var xx1 = $("#xx1").textbox("getValue");//文本 var xx2 = * var xx1 = $("#xx1").textbox("getValue");//文本 var xx2 =
...@@ -97,16 +97,16 @@ function getQueryParams(){ ...@@ -97,16 +97,16 @@ function getQueryParams(){
return sParam; return sParam;
} }
// 加载列表 // 加载列表
function initGrid(){ function initGrid(){
toolbar = [{ toolbar = [{
text : '查询', text : '查询',
iconCls : 'icon-search', iconCls : 'icon-search',
handler : doSearch handler : doSearch
},{
text:'待办事项',
iconCls:'icon-showList',
handler:showToDoList
},{ },{
text:'待办事项',
iconCls:'icon-showList',
handler:showToDoList
},{
text:'最新告警', text:'最新告警',
iconCls:'icon-latestWarning', iconCls:'icon-latestWarning',
handler:showAlarmList handler:showAlarmList
...@@ -118,6 +118,10 @@ function initGrid(){ ...@@ -118,6 +118,10 @@ function initGrid(){
text:'工单上报', text:'工单上报',
iconCls:'icon-Workorderreport', iconCls:'icon-Workorderreport',
handler:reportOrder handler:reportOrder
},{
text:'新增告警',
iconCls:'icon-Workorderreport',
handler:insertAlarm
}/* }/*
* , { text:'普通列表', iconCls:'icon-showList', handler:showList }, { * , { text:'普通列表', iconCls:'icon-showList', handler:showList }, {
* text:'统计', iconCls:'icon-showStatics', handler:showStatics }, { * text:'统计', iconCls:'icon-showStatics', handler:showStatics }, {
...@@ -137,39 +141,39 @@ function showToDoList(){ ...@@ -137,39 +141,39 @@ function showToDoList(){
queryParams:{flag:"todo",order:"order by jobreporttime desc"}, queryParams:{flag:"todo",order:"order by jobreporttime desc"},
url : 'ywrepairjobinfoAction!listYwrepairjobinfoByPage.do', url : 'ywrepairjobinfoAction!listYwrepairjobinfoByPage.do',
columns : [[ columns : [[
{ {
field: 'A', field: 'A',
checkbox:'true', checkbox:'true',
width:30 width:30
}, },
{field:'jobnum',title:'工单编号',hidden:false,width:120}, {field:'jobnum',title:'工单编号',hidden:false,width:120},
{field:'jobprocessstatename',title:'工单状态',hidden:false,width:120}, {field:'jobprocessstatename',title:'工单状态',hidden:false,width:120},
{field:'faultgradename',title:'告警等级',hidden:true,width:120}, {field:'faultgradename',title:'告警等级',hidden:true,width:120},
{field:'faultdevicetypename',title:'故障设备类型',hidden:false,width:120}, {field:'faultdevicetypename',title:'故障设备类型',hidden:false,width:120},
{field:'faultdevicename',title:'故障设备名称',hidden:false,width:120}, {field:'faultdevicename',title:'故障设备名称',hidden:false,width:120},
{field:'faultdeviceid',title:'故障设备编号',hidden:true,width:120}, {field:'faultdeviceid',title:'故障设备编号',hidden:true,width:120},
{field:'channelnum',title:'通道编号',hidden:true,width:120}, {field:'channelnum',title:'通道编号',hidden:true,width:120},
{field:'faulttypename',title:'故障类型',hidden:true,width:120}, {field:'faulttypename',title:'故障类型',hidden:true,width:120},
{field:'faultdescription',title:'故障描述',hidden:false,width:220}, {field:'faultdescription',title:'故障描述',hidden:false,width:220},
{field:'jobreportcompanyname',title:'上报单位',hidden:false,width:120}, {field:'jobreportcompanyname',title:'上报单位',hidden:false,width:120},
{field:'jobreporttime',title:'上报时间',hidden:false,width:130}, {field:'jobreporttime',title:'上报时间',hidden:false,width:130},
{field:'jobid',title:'操作',hidden:false,width:120, {field:'jobid',title:'操作',hidden:false,width:120,
formatter:function showClick(value,record,num){ formatter:function showClick(value,record,num){
if(record.jobprocessstate==901){ if(record.jobprocessstate==901){
return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px,5px;" class="l-btn l-btn-small" onclick="handleOrder(\''+value+'\',\'1\',\'accept\',\''+record.faultdeviceid+'\',\''+record.faultdevicename+'\',\''+record.channelnum+'\',\''+record.faultdevicetype+'\',\''+record.jobprocessstatename+'\')" group="" id=""><span class="l-btn-left"><span class="l-btn-text">受理审核</span></span></a>'; return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px,5px;" class="l-btn l-btn-small" onclick="handleOrder(\''+value+'\',\'1\',\'accept\',\''+record.faultdeviceid+'\',\''+record.faultdevicename+'\',\''+record.channelnum+'\',\''+record.faultdevicetype+'\',\''+record.jobprocessstatename+'\')" group="" id=""><span class="l-btn-left"><span class="l-btn-text">受理审核</span></span></a>';
}else if(record.jobprocessstate==902 || record.jobprocessstate==913){ }else if(record.jobprocessstate==902 || record.jobprocessstate==913){
return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px,5px;" class="l-btn l-btn-small" onclick="handleOrder(\''+value+'\',\'handle\',\'feedback\',\''+record.faultdeviceid+'\',\''+record.faultdevicename+'\',\''+record.channelnum+'\',\''+record.faultdevicetype+'\',\''+record.jobprocessstatename+'\')" group="" id=""><span class="l-btn-left"><span class="l-btn-text">反馈审核</span></span></a>'; return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px,5px;" class="l-btn l-btn-small" onclick="handleOrder(\''+value+'\',\'handle\',\'feedback\',\''+record.faultdeviceid+'\',\''+record.faultdevicename+'\',\''+record.channelnum+'\',\''+record.faultdevicetype+'\',\''+record.jobprocessstatename+'\')" group="" id=""><span class="l-btn-left"><span class="l-btn-text">反馈审核</span></span></a>';
}else if(record.jobprocessstate==904){ }else if(record.jobprocessstate==904){
return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px,5px;" class="l-btn l-btn-small" onclick="handleOrder(\''+value+'\',\'2\',\'accept\',\''+record.faultdeviceid+'\',\''+record.faultdevicename+'\',\''+record.channelnum+'\',\''+record.faultdevicetype+'\',\''+record.jobprocessstatename+'\')" group="" id=""><span class="l-btn-left"><span class="l-btn-text">取消挂起</span></span></a>'; return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px,5px;" class="l-btn l-btn-small" onclick="handleOrder(\''+value+'\',\'2\',\'accept\',\''+record.faultdeviceid+'\',\''+record.faultdevicename+'\',\''+record.channelnum+'\',\''+record.faultdevicetype+'\',\''+record.jobprocessstatename+'\')" group="" id=""><span class="l-btn-left"><span class="l-btn-text">取消挂起</span></span></a>';
}else if(record.jobprocessstate==906){ }else if(record.jobprocessstate==906){
return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px,5px;" class="l-btn l-btn-small" onclick="handleOrder(\''+value+'\',\'handle\',\'confirm\',\''+record.faultdeviceid+'\',\''+record.faultdevicename+'\',\''+record.channelnum+'\',\''+record.faultdevicetype+'\',\''+record.jobprocessstatename+'\')" group="" id=""><span class="l-btn-left"><span class="l-btn-text">确认审核</span></span></a>'; return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px,5px;" class="l-btn l-btn-small" onclick="handleOrder(\''+value+'\',\'handle\',\'confirm\',\''+record.faultdeviceid+'\',\''+record.faultdevicename+'\',\''+record.channelnum+'\',\''+record.faultdevicetype+'\',\''+record.jobprocessstatename+'\')" group="" id=""><span class="l-btn-left"><span class="l-btn-text">确认审核</span></span></a>';
}else if(record.jobprocessstate==908){ }else if(record.jobprocessstate==908){
return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px,5px;" class="l-btn l-btn-small" onclick="handleOrder(\''+value+'\',\'handle\',\'delay\',\''+record.faultdeviceid+'\',\''+record.faultdevicename+'\',\''+record.channelnum+'\',\''+record.faultdevicetype+'\',\''+record.jobprocessstatename+'\')" group="" id=""><span class="l-btn-left"><span class="l-btn-text">延期审核</span></span></a>'; return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px,5px;" class="l-btn l-btn-small" onclick="handleOrder(\''+value+'\',\'handle\',\'delay\',\''+record.faultdeviceid+'\',\''+record.faultdevicename+'\',\''+record.channelnum+'\',\''+record.faultdevicetype+'\',\''+record.jobprocessstatename+'\')" group="" id=""><span class="l-btn-left"><span class="l-btn-text">延期审核</span></span></a>';
// return '<button href="javascript:void(0);" class="ahref" onclick="handleOrder(\''+value+'\',\'handel\')">工单处理</button>'; // return '<button href="javascript:void(0);" class="ahref" onclick="handleOrder(\''+value+'\',\'handel\')">工单处理</button>';
} }
} }
} }
]] ]]
}); });
$(".datagrid-toolbar table tbody td:eq(3)").hide(); $(".datagrid-toolbar table tbody td:eq(3)").hide();
$(".datagrid-toolbar table tbody td:eq(4)").hide(); $(".datagrid-toolbar table tbody td:eq(4)").hide();
...@@ -179,7 +183,7 @@ function showToDoList(){ ...@@ -179,7 +183,7 @@ function showToDoList(){
function handleOrder(jobid,type,handleType,faultdeviceid,faultdevicename,channelnum,faultdevicetype,jobprocessstatename){ function handleOrder(jobid,type,handleType,faultdeviceid,faultdevicename,channelnum,faultdevicetype,jobprocessstatename){
var title = '工单受理'; var title = '工单受理';
var url = sysUrl+"/yw/repairmanage/acceptWorkOrder/ywrepairaccept.jsp?faultdeviceid="+faultdeviceid+"&channelnum="+channelnum+"&faultdevicename="+encodeURI(faultdevicename)+"&jobid="+jobid+"&faultdevicetype="+faultdevicetype+"&jobStatus="+encodeURI(jobprocessstatename); var url = sysUrl+"/yw/repairmanage/acceptWorkOrder/ywrepairaccept.jsp?faultdeviceid="+faultdeviceid+"&channelnum="+channelnum+"&faultdevicename="+encodeURI(faultdevicename)+"&jobid="+jobid+"&faultdevicetype="+faultdevicetype+"&jobStatus="+encodeURI(jobprocessstatename);
if(handleType=="accept"){ if(handleType=="accept"){
title = '工单受理'; title = '工单受理';
url = sysUrl+"/yw/repairmanage/acceptWorkOrder/ywrepairaccept.jsp?faultdeviceid="+faultdeviceid+"&channelnum="+channelnum+"&faultdevicename="+encodeURI(faultdevicename)+"&jobid="+jobid+"&faultdevicetype="+faultdevicetype+"&jobStatus="+encodeURI(jobprocessstatename); url = sysUrl+"/yw/repairmanage/acceptWorkOrder/ywrepairaccept.jsp?faultdeviceid="+faultdeviceid+"&channelnum="+channelnum+"&faultdevicename="+encodeURI(faultdevicename)+"&jobid="+jobid+"&faultdevicetype="+faultdevicetype+"&jobStatus="+encodeURI(jobprocessstatename);
...@@ -193,8 +197,8 @@ function handleOrder(jobid,type,handleType,faultdeviceid,faultdevicename,channel ...@@ -193,8 +197,8 @@ function handleOrder(jobid,type,handleType,faultdeviceid,faultdevicename,channel
handler:refresh handler:refresh
}], }],
onClose:function(){ onClose:function(){
var win = $.getTopWindowById(windowId); var win = $.getTopWindowById(windowId);
win.unloadWindow(); win.unloadWindow();
}, },
url : url url : url
}); });
...@@ -219,7 +223,7 @@ function handleOrder(jobid,type,handleType,faultdeviceid,faultdevicename,channel ...@@ -219,7 +223,7 @@ function handleOrder(jobid,type,handleType,faultdeviceid,faultdevicename,channel
}else if(handleType=="confirm"){ }else if(handleType=="confirm"){
title = '工单确认'; title = '工单确认';
url = sysUrl+"/yw/repairmanage/confirmWorkOrder/ywrepairconfirm.jsp?faultdeviceid="+faultdeviceid+"&channelnum="+channelnum+"&faultdevicename="+encodeURI(faultdevicename)+"&jobid="+jobid+"&faultdevicetype="+faultdevicetype+"&jobStatus="+encodeURI(jobprocessstatename); url = sysUrl+"/yw/repairmanage/confirmWorkOrder/ywrepairconfirm.jsp?faultdeviceid="+faultdeviceid+"&channelnum="+channelnum+"&faultdevicename="+encodeURI(faultdevicename)+"&jobid="+jobid+"&faultdevicetype="+faultdevicetype+"&jobStatus="+encodeURI(jobprocessstatename);
windowId = top.$.createWin({ windowId = top.$.createWin({
title : title, title : title,
width : 800, width : 800,
...@@ -281,7 +285,7 @@ function showPicture(){ ...@@ -281,7 +285,7 @@ function showPicture(){
}, },
rownumbers:true, rownumbers:true,
}); });
} }
// 统计展示 // 统计展示
function showStatics(){ function showStatics(){
...@@ -308,16 +312,16 @@ function showStatics(){ ...@@ -308,16 +312,16 @@ function showStatics(){
//console.log(res[i]); //console.log(res[i]);
total += res[i].num; total += res[i].num;
alarmArr.push( alarmArr.push(
{ {
name : res[i].name, name : res[i].name,
value : res[i].num, value : res[i].num,
color : colorObj[res[i].alarmtype+""] color : colorObj[res[i].alarmtype+""]
} }
) )
} }
$("#deviceAnalysisGraphChartCount").text(total); $("#deviceAnalysisGraphChartCount").text(total);
var data={"title":"设备故障类型占比分析", var data={"title":"设备故障类型占比分析",
data : alarmArr, data : alarmArr,
// data:[ // data:[
// {name:"网络异常",value:res.networkerrorNum,color:"#fe0000"}, // {name:"网络异常",value:res.networkerrorNum,color:"#fe0000"},
// {name:"信号异常",value:res.nosignalstatusNum,color:"#e16616"}, // {name:"信号异常",value:res.nosignalstatusNum,color:"#e16616"},
...@@ -331,19 +335,19 @@ function showStatics(){ ...@@ -331,19 +335,19 @@ function showStatics(){
// {name:"编码异常",value:res.videocodeerrorstatusNum,color:"#c0bebf"}, // {name:"编码异常",value:res.videocodeerrorstatusNum,color:"#c0bebf"},
// {name:"噪声雪花异常",value:res.videonoisestatusNum,color:"#c8da2e"}, // {name:"噪声雪花异常",value:res.videonoisestatusNum,color:"#c8da2e"},
// {name:"滚动条纹异常",value:res.videorollstripestatusNum,color:"#c8da2e"} // {name:"滚动条纹异常",value:res.videorollstripestatusNum,color:"#c8da2e"}
// ,{name:"执行异常",value:res.runstatusNum,color:"#c8da2e"} // ,{name:"执行异常",value:res.runstatusNum,color:"#c8da2e"}
// ] // ]
}; };
EchartsBase.alarmWorkbenchPieChart( EchartsBase.alarmWorkbenchPieChart(
{ {
id:"searchGridStaticsEchartPie", id:"searchGridStaticsEchartPie",
data:data data:data
}); });
} }
//console.log("resresres",res); //console.log("resresres",res);
} }
}); });
} }
// 统计展示 // 统计展示
function showStaticsLine(staticsType){ function showStaticsLine(staticsType){
...@@ -362,54 +366,54 @@ function showStaticsLine(staticsType){ ...@@ -362,54 +366,54 @@ function showStaticsLine(staticsType){
var yData = []; var yData = [];
if(staticsType=="1"){// 按小时 if(staticsType=="1"){// 按小时
xData = ['01','02','03','04','05','06','07','08','09', xData = ['01','02','03','04','05','06','07','08','09',
'10','11','12','13','14','15','16','17','18','19', '10','11','12','13','14','15','16','17','18','19',
'20','21','22','23','24' '20','21','22','23','24'
]; ];
yData = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; yData = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
$("#deviceAnalysisGraphChartBoxTime li").eq(0).addClass("active"); $("#deviceAnalysisGraphChartBoxTime li").eq(0).addClass("active");
}else if(staticsType=="2"){// 按天 }else if(staticsType=="2"){// 按天
xData = ['1','2','3','4','5','6','7','8','9', xData = ['1','2','3','4','5','6','7','8','9',
'10','11','12','13','14','15','16','17','18','19', '10','11','12','13','14','15','16','17','18','19',
'20','21','22','23','24','25','26','27','28','29','30','31' '20','21','22','23','24','25','26','27','28','29','30','31'
]; ];
yData = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; yData = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
$("#deviceAnalysisGraphChartBoxTime li").eq(1).addClass("active"); $("#deviceAnalysisGraphChartBoxTime li").eq(1).addClass("active");
}else{// 按月 }else{// 按月
xData = ['1','2','3','4','5','6','7','8','9', xData = ['1','2','3','4','5','6','7','8','9',
'10','11','12' '10','11','12'
]; ];
yData = [0,0,0,0,0,0,0,0,0,0,0,0]; yData = [0,0,0,0,0,0,0,0,0,0,0,0];
$("#deviceAnalysisGraphChartBoxTime li").eq(2).addClass("active"); $("#deviceAnalysisGraphChartBoxTime li").eq(2).addClass("active");
} }
res.forEach(function(item){ res.forEach(function(item){
if(item!=null && item.xData!=null){ if(item!=null && item.xData!=null){
var index = 0; var index = 0;
if(item.xData.indexOf("0")==0){ if(item.xData.indexOf("0")==0){
index = parseInt(item.xData.substring(1)) index = parseInt(item.xData.substring(1))
}else{ }else{
index = parseInt(item.xData) index = parseInt(item.xData)
} }
yData.splice(index-1,1,item.num); yData.splice(index-1,1,item.num);
} }
}); });
var data={"title":"告警趋势分析", var data={"title":"告警趋势分析",
xAxis:xData, xAxis:xData,
legend:[{name:"",data:yData,"color":"#00accb"}] legend:[{name:"",data:yData,"color":"#00accb"}]
} }
// EchartsBase.data={"title":"本周运维告警统计",xAxis: // EchartsBase.data={"title":"本周运维告警统计",xAxis:
// ["监控","NVR","服务器","应用系统"],"legend":[{"name":"Doset","data":[5, // ["监控","NVR","服务器","应用系统"],"legend":[{"name":"Doset","data":[5,
// 20, 36, 50],"color":"#00accb"},{"name":"Yeland","data":[51, 210, // 20, 36, 50],"color":"#00accb"},{"name":"Yeland","data":[51, 210,
// 36, 10],"color":"#fa102a"}]}; // 36, 10],"color":"#fa102a"}]};
EchartsBase.lineChart( EchartsBase.lineChart(
{ {
id:"searchGridStaticsEchartLine", id:"searchGridStaticsEchartLine",
data:data data:data
}); });
} }
//console.log(res) //console.log(res)
} }
}); });
...@@ -426,24 +430,24 @@ function showAlarmList(){ ...@@ -426,24 +430,24 @@ function showAlarmList(){
queryParams:{processstatus : '900',order:'order by alarmtime desc'}, queryParams:{processstatus : '900',order:'order by alarmtime desc'},
url : 'ywalarmeventinfoAction!listYwalarmeventinfoByPage.do', url : 'ywalarmeventinfoAction!listYwalarmeventinfoByPage.do',
columns : [[ columns : [[
{ {
field: 'A', field: 'A',
checkbox:'true', checkbox:'true',
width:30 width:30
}, },
{field:'alarmeventid',title:'alarmeventid',hidden:true,width:120, {field:'alarmeventid',title:'alarmeventid',hidden:true,width:120,
formatter:function showClick(value,record,num){ formatter:function showClick(value,record,num){
return "<a href='javascript:void(0);' class='ahref' onclick='doUpdate("+num+")'>"+value+"</a>"; return "<a href='javascript:void(0);' class='ahref' onclick='doUpdate("+num+")'>"+value+"</a>";
} }
}, },
{field:'alarmruleid',title:'告警规则id',hidden:true,width:120}, {field:'alarmruleid',title:'告警规则id',hidden:true,width:120},
{field:'alarmrulename',title:'告警规则名称',hidden:true,width:120}, {field:'alarmrulename',title:'告警规则名称',hidden:true,width:120},
{field:'alarmdevicetypename',title:'设备类型',hidden:false,width:100}, {field:'alarmdevicetypename',title:'设备类型',hidden:false,width:100},
{field:'alarmdevicename',title:'设备名称',hidden:false,width:145}, {field:'alarmdevicename',title:'设备名称',hidden:false,width:145},
{field:'alarmdeviceid',title:'告警设备编号',hidden:true,width:120}, {field:'alarmdeviceid',title:'告警设备编号',hidden:true,width:120},
{field:'channelnum',title:'通道编号',hidden:true,width:120}, {field:'channelnum',title:'通道编号',hidden:true,width:120},
{field:'alarmgradename',title:'告警级别',hidden:false,width:80, {field:'alarmgradename',title:'告警级别',hidden:false,width:80,
formatter:function showClick(value,record,num){ formatter:function showClick(value,record,num){
var html=""; var html="";
var grade=record.alarmgrade; var grade=record.alarmgrade;
var backgroundColor=""; var backgroundColor="";
...@@ -456,9 +460,9 @@ function showAlarmList(){ ...@@ -456,9 +460,9 @@ function showAlarmList(){
return html; return html;
}}, }},
{field:'processstatus',title:'处理状态',hidden:false,width:120, {field:'processstatus',title:'处理状态',hidden:false,width:120,
formatter:function showClick(value,record,num){ formatter:function showClick(value,record,num){
return CommonData.jobprocessstate[value]; return CommonData.jobprocessstate[value];
} }
}, },
{field:'alarmtime',title:'告警时间',hidden:false,width:140}, {field:'alarmtime',title:'告警时间',hidden:false,width:140},
{field:'alarmtypename',title:'告警类型',hidden:true,width:120}, {field:'alarmtypename',title:'告警类型',hidden:true,width:120},
...@@ -489,7 +493,7 @@ function showAlarmList(){ ...@@ -489,7 +493,7 @@ function showAlarmList(){
{field:'extend4',title:'扩展4',hidden:true,width:120}, {field:'extend4',title:'扩展4',hidden:true,width:120},
{field:'B',title:'操作',hidden:false,width:120, {field:'B',title:'操作',hidden:false,width:120,
formatter:function(value,record,num){ formatter:function(value,record,num){
return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px 12px;" class="l-btn l-btn-small" onclick="alarmDetail(\''+num+'\')" group="" id="">详情</a>'; return '<a href="javascript:;" style="background: #67c23a;color:white;padding: 2px 12px;" class="l-btn l-btn-small" onclick="alarmDetail(\''+num+'\')" group="" id="">详情</a>';
} }
} }
]] ]]
...@@ -498,7 +502,7 @@ function showAlarmList(){ ...@@ -498,7 +502,7 @@ function showAlarmList(){
} }
// 删除 // 删除
function doDelete(){ function doDelete(){
var selRows = $('#tableGrid').datagrid('getSelected'); var selRows = $('#tableGrid').datagrid('getSelected');
if(!selRows){ if(!selRows){
$.showMsg('请先选择记录! '); $.showMsg('请先选择记录! ');
return; return;
...@@ -525,35 +529,35 @@ function doDelete(){ ...@@ -525,35 +529,35 @@ function doDelete(){
} }
// 批量删除 // 批量删除
function doDelete_batch(){ function doDelete_batch(){
var selRows = $('#tableGrid').datagrid('getChecked'); var selRows = $('#tableGrid').datagrid('getChecked');
var keyword = []; var keyword = [];
if(selRows===null){ if(selRows===null){
$.showMsg('请先选择一行! '); $.showMsg('请先选择一行! ');
return; return;
}else{ }else{
for(var i=0; i<selRows.length; i++){ for(var i=0; i<selRows.length; i++){
keyword.push(selRows[i].alarmeventid); keyword.push(selRows[i].alarmeventid);
} }
top.$.dlg.confirm('你确认要删除吗?',function(){ top.$.dlg.confirm('你确认要删除吗?',function(){
$.ajax({ $.ajax({
type:'post', type:'post',
dataType : 'json', dataType : 'json',
url:'ywalarmeventinfoAction!batch_delete_Ywalarmeventinfo.do', url:'ywalarmeventinfoAction!batch_delete_Ywalarmeventinfo.do',
data:{keyword : keyword.join(",")}, data:{keyword : keyword.join(",")},
success:function(flag){ success:function(flag){
if(!$.isNull(flag)){ if(!$.isNull(flag)){
$.showMsg("操作成功!"); $.showMsg("操作成功!");
doSearch(); doSearch();
}else{ }else{
$.showMsg("操作失败!"); $.showMsg("操作失败!");
} }
} }
}); });
}); });
} }
} }
// 查询 // 查询
function doSearch(){ function doSearch(){
if(displayType=="list"){ if(displayType=="list"){
showList(); showList();
}else if(displayType=="picture"){ }else if(displayType=="picture"){
...@@ -579,7 +583,7 @@ function doAdd(){ ...@@ -579,7 +583,7 @@ function doAdd(){
handler:saveNodeInfo handler:saveNodeInfo
}], }],
url : sysUrl+"/yw/ywalarmeventinfo/ywalarmeventinfo_show.jsp" url : sysUrl+"/yw/ywalarmeventinfo/ywalarmeventinfo_show.jsp"
}); });
} }
// 修改 // 修改
function doUpdate(index){ function doUpdate(index){
...@@ -604,7 +608,7 @@ function saveNodeInfo(){ ...@@ -604,7 +608,7 @@ function saveNodeInfo(){
var model = $.getFormValues("childform",windowId); var model = $.getFormValues("childform",windowId);
//console.log(model); //console.log(model);
if(!win.$('#childform').form('enableValidation').form('validate')){ if(!win.$('#childform').form('enableValidation').form('validate')){
return; return;
} }
if(toEdit){// 修改 if(toEdit){// 修改
model.XGTJalarmeventid = jq('#alarmeventid').val(); model.XGTJalarmeventid = jq('#alarmeventid').val();
...@@ -653,10 +657,10 @@ function doEdit(){ ...@@ -653,10 +657,10 @@ function doEdit(){
var selIndex = $('#tableGrid').datagrid('getRowIndex', $("#tableGrid").datagrid('getSelected')) var selIndex = $('#tableGrid').datagrid('getRowIndex', $("#tableGrid").datagrid('getSelected'))
if(selIndex==-1){ if(selIndex==-1){
$.showMsg('请先选择一行! '); $.showMsg('请先选择一行! ');
return; return;
}else{ }else{
doUpdate(selIndex); doUpdate(selIndex);
} }
} }
// 模板下载 // 模板下载
function doTemplate(){ function doTemplate(){
...@@ -668,12 +672,12 @@ function doTemplate(){ ...@@ -668,12 +672,12 @@ function doTemplate(){
function doImport(){ function doImport(){
toEdit=false; toEdit=false;
windowId = top.$.createWin({ windowId = top.$.createWin({
id : $.uniqueId(), id : $.uniqueId(),
title : '导入', title : '导入',
width : 400, width : 400,
height : 130, height : 130,
url : sysUrl+"/im/xx/ywalarmeventinfo_imp.jsp" url : sysUrl+"/im/xx/ywalarmeventinfo_imp.jsp"
}); });
} }
// 导出 // 导出
function doExport(){ function doExport(){
...@@ -696,11 +700,11 @@ function doExport(){ ...@@ -696,11 +700,11 @@ function doExport(){
function countExport(totalSize) { function countExport(totalSize) {
var limit = 5000; var limit = 5000;
if (totalSize > 5000) { if (totalSize > 5000) {
top.$.dlg.confirm('记录过多支持前5000条,确定要将记录导出Excel为表格吗?',function(){ top.$.dlg.confirm('记录过多支持前5000条,确定要将记录导出Excel为表格吗?',function(){
execExport(); execExport();
}); });
} else { } else {
top.$.dlg.confirm('确认导出?',function(){ top.$.dlg.confirm('确认导出?',function(){
execExport(); execExport();
}) })
} }
...@@ -712,7 +716,7 @@ function execExport() { ...@@ -712,7 +716,7 @@ function execExport() {
//console.log(document) //console.log(document)
//console.log(document.excelForm) //console.log(document.excelForm)
document.excelForm.action = 'ywalarmeventinfoAction!exp_Ywalarmeventinfo.do?downParam='+downParam; document.excelForm.action = 'ywalarmeventinfoAction!exp_Ywalarmeventinfo.do?downParam='+downParam;
document.excelForm.submit(); document.excelForm.submit();
} }
// 选择设备列表 // 选择设备列表
function openDevice(type,value){ function openDevice(type,value){
...@@ -736,7 +740,7 @@ function chooseDevice(){ ...@@ -736,7 +740,7 @@ function chooseDevice(){
var data = top.$("#"+WindowId).panel("options").data; var data = top.$("#"+WindowId).panel("options").data;
var win = top.$.getTopWindowById(WindowId); var win = top.$.getTopWindowById(WindowId);
top.$("#"+WindowId).dialog('close'); top.$("#"+WindowId).dialog('close');
var rows = win.$('#sbtdspsrInfo')[0].contentWindow.getSelectedRows(); var rows = win.$('#sbtdspsrInfo')[0].contentWindow.getSelectedRows();
var result = ""; var result = "";
var text = ""; var text = "";
var deviceType = $("#deviceType").combobox("getValue"); var deviceType = $("#deviceType").combobox("getValue");
...@@ -781,47 +785,47 @@ function initSelect(){ ...@@ -781,47 +785,47 @@ function initSelect(){
} }
} }
var deviceChooseArr = [ {"id":"","text":"全部","selected":true}, var deviceChooseArr = [ {"id":"","text":"全部","selected":true},
{"id":"1","text":"列表选择"} {"id":"1","text":"列表选择"}
] ]
$("#alarmLevel").combobox( "loadData", alarmLevelArr); $("#alarmLevel").combobox( "loadData", alarmLevelArr);
$("#deviceType").combobox( "loadData", alarmDeviceTypeArr); $("#deviceType").combobox( "loadData", alarmDeviceTypeArr);
$("#deviceChoose").combobox( "loadData", deviceChooseArr); $("#deviceChoose").combobox( "loadData", deviceChooseArr);
$("#processStatus").combobox( "loadData", processStatusArr); $("#processStatus").combobox( "loadData", processStatusArr);
$("#alarmType").combobox( "loadData", alarmTypeArr); $("#alarmType").combobox( "loadData", alarmTypeArr);
} }
} }
}); });
} }
$.extend($.fn.datagrid.methods, $.extend($.fn.datagrid.methods,
{ {
renderMonitorData:function(n, g, h){ renderMonitorData:function(n, g, h){
var m = n.parent(".datagrid-view:eq(0)"), var m = n.parent(".datagrid-view:eq(0)"),
c; c;
var k = m.prev("div").append("<table cellspacing=0 cellpadding=0 style='display:inline-block;height:26px;float:right;'><tbody><tr/></tbody></table>").children("table:eq(1)").find("tbody tr"); var k = m.prev("div").append("<table cellspacing=0 cellpadding=0 style='display:inline-block;height:26px;float:right;'><tbody><tr/></tbody></table>").children("table:eq(1)").find("tbody tr");
var b = m.parent().height(); var b = m.parent().height();
var o = m.parent().width(); var o = m.parent().width();
if (!m.next("div.imgcontainer").html()) { if (!m.next("div.imgcontainer").html()) {
c = $("<div class='imgcontainer' style='overflow-y:auto; width:99%;height:" + (b - 70) + "px;'></div>"); c = $("<div class='imgcontainer' style='overflow-y:auto; width:99%;height:" + (b - 70) + "px;'></div>");
m.after(c) m.after(c)
} else { } else {
c = m.next("div.imgcontainer") c = m.next("div.imgcontainer")
} }
if (!g) { if (!g) {
return return
} }
if(g.total<1){ if(g.total<1){
c.html('<div style="text-align:center;margin:80px 0 0 0;font-size:12px;" class="img-box">没有查询到符合条件的记录!</div>'); c.html('<div style="text-align:center;margin:80px 0 0 0;font-size:12px;" class="img-box">没有查询到符合条件的记录!</div>');
return ; return ;
} }
var f = 0, var f = 0,
l = [], l = [],
e, e,
d, d,
j = this; j = this;
for (; (g.data[f]); f++) { for (; (g.data[f]); f++) {
// g.data[f].oprStatusStr = g.data[f].oprStatus == 0 ? "正常": "异常"; // g.data[f].oprStatusStr = g.data[f].oprStatus == 0 ? "正常": "异常";
g.data[f].oprStatusColor = 'style="color:' + (g.data[f].oprStatus == 0 ? "blue;": "red;") + '"'; g.data[f].oprStatusColor = 'style="color:' + (g.data[f].oprStatus == 0 ? "blue;": "red;") + '"';
// g.data[f].picturepath = // g.data[f].picturepath =
// sysUrl+"/sourceProxy?fileType=picUrlProxy&picUrl="+g.data[f].picturepath; // sysUrl+"/sourceProxy?fileType=picUrlProxy&picUrl="+g.data[f].picturepath;
...@@ -842,47 +846,47 @@ $.extend($.fn.datagrid.methods, ...@@ -842,47 +846,47 @@ $.extend($.fn.datagrid.methods,
// onclick="oprStatus(this,1);" >标记异常</a>&nbsp;&nbsp;&nbsp; <a // onclick="oprStatus(this,1);" >标记异常</a>&nbsp;&nbsp;&nbsp; <a
// href="javascript:void(0);" tag=' + g.data[f].id + ' class="ahref" // href="javascript:void(0);" tag=' + g.data[f].id + ' class="ahref"
// onclick="oprStatus(this,2);" >重点关注</a></p>' + "</div></div>") // onclick="oprStatus(this,2);" >重点关注</a></p>' + "</div></div>")
l.push('<div class="view-item" style="width:220px;position:relative;">' l.push('<div class="view-item" style="width:220px;position:relative;">'
+' <div class="showAlarmType" style="top: -15px;right: 4px;width: 67px; color: white;z-index: 10; height: 40px;background: #1612263b;font-size: 14px;font-weight: bolder;position:absolute;text-align: center; line-height: 40px;display:block;">'+g.data[f].processstatusname+'</div>' +' <div class="showAlarmType" style="top: -15px;right: 4px;width: 67px; color: white;z-index: 10; height: 40px;background: #1612263b;font-size: 14px;font-weight: bolder;position:absolute;text-align: center; line-height: 40px;display:block;">'+g.data[f].processstatusname+'</div>'
+ '<img onclick="detailVideoQuality(\''+g.data[f].alarmeventid+'\');" src="' + (g.data[f].pictureurl) + '" onerror="javascript:$.loadErrorPic(this);" style="width:218px;"/><div style="width:218px;">' + "<p>设备名称:&nbsp;" + (g.data[f].alarmdevicename || "") + "</p>" + "<p style='line-height:20px;'>告警时间:&nbsp;" + (g.data[f].alarmtime || "") + "</p>" + "<p style='line-height:20px;'>告警类型:&nbsp;<span " + g.data[f].oprStatusColor + ">" + (g.data[f].alarmtypename || "") + "</span></p></div></div>") + '<img onclick="detailVideoQuality(\''+g.data[f].alarmeventid+'\');" src="' + (g.data[f].pictureurl) + '" onerror="javascript:$.loadErrorPic(this);" style="width:218px;"/><div style="width:218px;">' + "<p>设备名称:&nbsp;" + (g.data[f].alarmdevicename || "") + "</p>" + "<p style='line-height:20px;'>告警时间:&nbsp;" + (g.data[f].alarmtime || "") + "</p>" + "<p style='line-height:20px;'>告警类型:&nbsp;<span " + g.data[f].oprStatusColor + ">" + (g.data[f].alarmtypename || "") + "</span></p></div></div>")
} }
c.html('<div class="img-box">' + l.join("") + "</div>") c.html('<div class="img-box">' + l.join("") + "</div>")
} }
}); });
function detailVideoQuality(id){ function detailVideoQuality(id){
var url = sysUrl+"/yw/videoalarm/itemPage/detailVideoQuality.jsp"; var url = sysUrl+"/yw/videoalarm/itemPage/detailVideoQuality.jsp";
windowid = top.$.createWin({ windowid = top.$.createWin({
title : '详情', title : '详情',
width : '720', width : '720',
height : '400', height : '400',
data:id, data:id,
url : url, url : url,
onClose:function(){ onClose:function(){
var win = $.getTopWindowById(windowid); var win = $.getTopWindowById(windowid);
for(var i = 0;i < win.BlockCacher.blockCache.length;i++){ for(var i = 0;i < win.BlockCacher.blockCache.length;i++){
if(win.BlockCacher.blockCache[i].fdId && win.BlockCacher.blockCache[i].channelId != null){ if(win.BlockCacher.blockCache[i].fdId && win.BlockCacher.blockCache[i].channelId != null){
win.BlockUtil.stopMonitor(i); win.BlockUtil.stopMonitor(i);
}
} }
} }
}); }
});
} }
var colorObj = { var colorObj = {
"1" : "#fe0000", "1" : "#fe0000",
"2" : "#e16616", "2" : "#e16616",
"3" : "#754599", "3" : "#754599",
"4" : "#84ccc9" "4" : "#84ccc9"
} }
//忽略告警 //忽略告警
function ignoreAlarm(){ function ignoreAlarm(){
var selRows = $('#showAlarmList').datagrid('getChecked'); var selRows = $('#showAlarmList').datagrid('getChecked');
// console.log("忽略:",selRows); // console.log("忽略:",selRows);
if(selRows===null || selRows.length < 1){ if(selRows===null || selRows.length < 1){
$.showMsg('请先选择一行! '); $.showMsg('请先选择一行! ');
return; return;
}else{ }else{
windowId = top.$.createWin({ windowId = top.$.createWin({
title : '忽略告警', title : '忽略告警',
width : 450, width : 450,
...@@ -892,14 +896,14 @@ function ignoreAlarm(){ ...@@ -892,14 +896,14 @@ function ignoreAlarm(){
handler:sureIgnore handler:sureIgnore
}], }],
url : sysUrl+"/yw/homepage/ignorecase.jsp" url : sysUrl+"/yw/homepage/ignorecase.jsp"
}); });
} }
} }
function sureIgnore(){ function sureIgnore(){
var win = $.getTopWindowById(windowId); var win = $.getTopWindowById(windowId);
var hlyy = win.$('#hlyy').val(); var hlyy = win.$('#hlyy').val();
// console.log("忽略原因:",hlyy); // console.log("忽略原因:",hlyy);
var selRows = $('#showAlarmList').datagrid('getChecked'); var selRows = $('#showAlarmList').datagrid('getChecked');
// console.log("忽略:",selRows); // console.log("忽略:",selRows);
var flag = false; var flag = false;
selRows.forEach(function(item){ selRows.forEach(function(item){
...@@ -911,19 +915,19 @@ function sureIgnore(){ ...@@ -911,19 +915,19 @@ function sureIgnore(){
channelnum = item.channelnum; channelnum = item.channelnum;
} }
$.ajax({ $.ajax({
type : 'post', type : 'post',
dataType : 'json', dataType : 'json',
url : 'ywalarmeventinfoAction!ignore_Ywalarmeventinfo.do', url : 'ywalarmeventinfoAction!ignore_Ywalarmeventinfo.do',
data : {'processdescription':hlyy, 'alarmdevicetype':alarmdevicetype,'alarmeventid':alarmeventid, data : {'processdescription':hlyy, 'alarmdevicetype':alarmdevicetype,'alarmeventid':alarmeventid,
'alarmdeviceid':alarmdeviceid,'channelnum':channelnum}, 'alarmdeviceid':alarmdeviceid,'channelnum':channelnum},
async : false, async : false,
success:function(res){ success:function(res){
if(res == 'success'){ if(res == 'success'){
flag = true; flag = true;
}else{ }else{
flag = false; flag = false;
} }
} }
}) })
if(flag){ if(flag){
$.showMsg("操作成功!"); $.showMsg("操作成功!");
...@@ -938,11 +942,11 @@ function sureIgnore(){ ...@@ -938,11 +942,11 @@ function sureIgnore(){
// 工单上报 // 工单上报
function reportOrder(){ function reportOrder(){
var selRows = $('#showAlarmList').datagrid('getChecked'); var selRows = $('#showAlarmList').datagrid('getChecked');
// console.log("忽略:",selRows); // console.log("忽略:",selRows);
if(selRows===null || selRows.length < 1){ if(selRows===null || selRows.length < 1){
$.showMsg('请先选择一行! '); $.showMsg('请先选择一行! ');
return; return;
} }
if(selRows.length ==1){ if(selRows.length ==1){
windowId = top.$.createWin({ windowId = top.$.createWin({
...@@ -972,7 +976,88 @@ function reportOrder(){ ...@@ -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(){ function saveBatchOrder(){
var flag = false; var flag = false;
var win = $.getTopWindowById(windowId); var win = $.getTopWindowById(windowId);
...@@ -987,8 +1072,8 @@ function saveBatchOrder(){ ...@@ -987,8 +1072,8 @@ function saveBatchOrder(){
$.showMsg('工单接收人不能为空 '); $.showMsg('工单接收人不能为空 ');
return; return;
} }
var selRows = $('#showAlarmList').datagrid('getChecked'); var selRows = $('#showAlarmList').datagrid('getChecked');
var jobnums=win.jobNum; var jobnums=win.jobNum;
var jobacceptphone = jq('#jobacceptphone').html(); // 接收人联系方式 var jobacceptphone = jq('#jobacceptphone').html(); // 接收人联系方式
if(jobacceptphone==undefined || jobacceptphone==""){ if(jobacceptphone==undefined || jobacceptphone==""){
...@@ -997,9 +1082,9 @@ function saveBatchOrder(){ ...@@ -997,9 +1082,9 @@ function saveBatchOrder(){
} }
var reportInfo = win.reportInfo; var reportInfo = win.reportInfo;
//console.log(jobnums,reportInfo) //console.log(jobnums,reportInfo)
for(var i=0;i<selRows.length;i++){ for(var i=0;i<selRows.length;i++){
var sel = selRows[i]; var sel = selRows[i];
model.jobnum = jobnums[i]; model.jobnum = jobnums[i];
model.jobsource = "1"; model.jobsource = "1";
model.alarmeventid = sel.alarmeventid; model.alarmeventid = sel.alarmeventid;
...@@ -1018,43 +1103,43 @@ function saveBatchOrder(){ ...@@ -1018,43 +1103,43 @@ function saveBatchOrder(){
model.faultdescription = sel.alarmsubtypename; model.faultdescription = sel.alarmsubtypename;
model.faultoccurtime = sel.alarmtime; model.faultoccurtime = sel.alarmtime;
model.jobprocessstate = '901'; // 受理状态 model.jobprocessstate = '901'; // 受理状态
model.jobreportcompany = reportInfo.bmbh; model.jobreportcompany = reportInfo.bmbh;
model.jobreportpeople = reportInfo.yhzh; model.jobreportpeople = reportInfo.yhzh;
model.jobreportphone = reportInfo.sjhm; model.jobreportphone = reportInfo.sjhm;
model.jobreporttime = win.getNowTime("-"); model.jobreporttime = win.getNowTime("-");
model.jobacceptphone = jobacceptphone; model.jobacceptphone = jobacceptphone;
$.ajax({ $.ajax({
type : 'post', type : 'post',
dataType : 'json', dataType : 'json',
url : 'ywrepairjobinfoAction!insert_Ywrepairjobinfo.do', url : 'ywrepairjobinfoAction!insert_Ywrepairjobinfo.do',
data : model, data : model,
async: false, async: false,
success:function(res){ success:function(res){
if(res == 'success'){ if(res == 'success'){
flag = true; flag = true;
}else{ }else{
flag = false; flag = false;
} }
} }
}) })
} }
if(flag){ if(flag){
$.showMsg("操作成功!"); $.showMsg("操作成功!");
top.$("#"+windowId).dialog('close'); top.$("#"+windowId).dialog('close');
showAlarmList(); showAlarmList();
}else{ }else{
$.showMsg("操作失败!"); $.showMsg("操作失败!");
} }
} }
//工单上报--确定 //工单上报--确定
function saveOrder(){ function saveOrder(){
var win = $.getTopWindowById(windowId); var win = $.getTopWindowById(windowId);
var jq = win.$; var jq = win.$;
var model = $.getFormValues("order",windowId); // 得到 工单接收人和单位 var model = $.getFormValues("order",windowId); // 得到 工单接收人和单位
if(model.jobacceptcompany==null || model.jobacceptcompany==""){ if(model.jobacceptcompany==null || model.jobacceptcompany==""){
$.showMsg('工单接收人单位不能为空 '); $.showMsg('工单接收人单位不能为空 ');
return; return;
...@@ -1070,7 +1155,7 @@ function saveOrder(){ ...@@ -1070,7 +1155,7 @@ function saveOrder(){
var jobreporttime = jq('#jobreporttime').html(); // 上报时间 var jobreporttime = jq('#jobreporttime').html(); // 上报时间
var jobacceptphone = jq('#jobacceptphone').html(); // 接收人联系方式 var jobacceptphone = jq('#jobacceptphone').html(); // 接收人联系方式
var faultdescription = jq('#faultdescription').val(); // 故障描述 var faultdescription = jq('#faultdescription').val(); // 故障描述
var sel = $('#showAlarmList').datagrid('getSelected'); var sel = $('#showAlarmList').datagrid('getSelected');
if(jobacceptphone==undefined || jobacceptphone==""){ if(jobacceptphone==undefined || jobacceptphone==""){
$.showMsg("请到平台用户管理更新接收人联系电话"); $.showMsg("请到平台用户管理更新接收人联系电话");
...@@ -1101,23 +1186,23 @@ function saveOrder(){ ...@@ -1101,23 +1186,23 @@ function saveOrder(){
model.jobreporttime = jobreporttime; model.jobreporttime = jobreporttime;
model.jobacceptphone = jobacceptphone; model.jobacceptphone = jobacceptphone;
model.extend1 = model.jobacceptpeople; model.extend1 = model.jobacceptpeople;
// console.log("order:",model); // console.log("order:",model);
$.ajax({ $.ajax({
type : 'post', type : 'post',
dataType : 'json', dataType : 'json',
url : 'ywrepairjobinfoAction!insert_Ywrepairjobinfo.do', url : 'ywrepairjobinfoAction!insert_Ywrepairjobinfo.do',
data : model, data : model,
success:function(res){ success:function(res){
if(res == 'success'){ if(res == 'success'){
$.showMsg("操作成功!"); $.showMsg("操作成功!");
top.$("#"+windowId).dialog('close'); top.$("#"+windowId).dialog('close');
showAlarmList(); showAlarmList();
}else{ }else{
$.showMsg("操作失败!"); $.showMsg("操作失败!");
} }
} }
}) })
} }
function alarmDetail(index){ function alarmDetail(index){
...@@ -1156,16 +1241,17 @@ function createDetailWindow(name){ ...@@ -1156,16 +1241,17 @@ function createDetailWindow(name){
height:510, height:510,
modal:true, modal:true,
onClose:function(){ onClose:function(){
var win = detailWindow.children('iframe')[0].contentWindow; var win = detailWindow.children('iframe')[0].contentWindow ;
win.unloadWindow(); win.unloadWindow();
}, },
buttons:[{ buttons:[{
text:$.fn.textbox.defaults.close, text:$.fn.textbox.defaults.close,
handler:function(){ handler:function(){
var win = detailWindow.children('iframe')[0].contentWindow; var win = detailWindow.children('iframe')[0].contentWindow;
win.unloadWindow(); win.unloadWindow();
detailWindow.dialog('close'); detailWindow.dialog('close');
} }
}] }]
}); });
} }
<%@ 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 = { ...@@ -37,9 +37,9 @@ dojoConfig = {
var map = new esri.Map("map"); 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("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); 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