first commit
This commit is contained in:
177
bin/WebRoot/jsp/msg/msgAlarmlevelList.jsp
Normal file
177
bin/WebRoot/jsp/msg/msgAlarmlevelList.jsp
Normal file
@ -0,0 +1,177 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@page import="com.sipai.tools.SessionManager"%>
|
||||
<%SessionManager sessionManager = new SessionManager();%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if($('#pid').combobox('getValue')==""){
|
||||
alert("类型种类为必填项,不可为空");
|
||||
return 0;
|
||||
}
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/msg/updateMsgType.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新列表
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(function() {
|
||||
$('#pid').combobox('setValue', '${msgType.pid}');
|
||||
$('#sendway').combobox('setValue', '${msgType.sendway}');
|
||||
});
|
||||
|
||||
function doadd() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '消息报警级别',
|
||||
url : ext.contextPath + '/msg/addMsgAlarmlevel.do?iframeId=iframeadd',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/msg/deleteMsgAlarmlevel.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
function dodeletes() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/msg/deletesMsgAlarmlevel.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
alert();
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeedit',
|
||||
title : '编辑消息类型',
|
||||
url : ext.contextPath + '/msg/editAlarmlevel.do?iframeId=iframeedit&id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看消息类型',
|
||||
url : ext.contextPath + '/msg/viewAlarmlevel.do?id=' + id
|
||||
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
$('#p').panel({
|
||||
width:"100%",
|
||||
height:"300",
|
||||
title: '报警级别',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){doadd();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){dodeletes();}
|
||||
}]
|
||||
});
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/msg/getMsgAlarmlevel.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
idfield :'id',
|
||||
columns :[[
|
||||
{checkbox:true, field:'ck'},
|
||||
{width : '100',title : '报警级别',field : 'alarmLevel', sortable : true, halign:'center'},
|
||||
{width : '100',title : '短信发送用户',field : 'smssend', sortable : true, halign :'center'},
|
||||
{width : '100',title : '消息发送用户',field : 'msgsend', sortable :true, halign :'center'},
|
||||
{width : '100',title : '发送方式', field : 'sendway', sortable: true, halign : 'center',formatter :function(value,row){
|
||||
if(value=="both"){
|
||||
return "消息+短信发送";
|
||||
}else if(value=="msg"){
|
||||
return "消息发送";
|
||||
} else if(value=="sms"){
|
||||
return "短信发送";
|
||||
}
|
||||
}},
|
||||
{width : '100',title : '备注' , field : 'remark' ,sortable : true, halign : 'center'},
|
||||
{width : '100',title : '操作' ,field :'action', halign:'center',align :'center', formatter : function(value, row){
|
||||
var str = '';
|
||||
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/> ';
|
||||
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/> ';
|
||||
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/> ';
|
||||
|
||||
return str;
|
||||
}}
|
||||
|
||||
]],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="p" >
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user