| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291 |
- <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <base href="<%=basePath%>">
-
- <title>报警参数设置</title>
-
- <meta http-equiv="pragma" content="no-cache">
- <meta http-equiv="cache-control" content="no-cache">
- <meta http-equiv="expires" content="0">
- <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
- <meta http-equiv="description" content="This is my page">
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta http-equiv="X-UA-Compatible" content="IE=10"/>
- <link rel="stylesheet" type="text/css" href="css/easyui/themes/default/easyui.css">
- <link rel="stylesheet" type="text/css" href="css/easyui/themes/icon.css">
- <link rel="stylesheet" type="text/css" href="css/easyui/demo/demo.css">
- <script type="text/javascript" src="css/easyui/jquery.min.js"></script>
- <script type="text/javascript" src="css/easyui/jquery.easyui.min.js" charset="utf-8"></script>
- <script type="text/javascript" src="css/easyui/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>
- <link rel="stylesheet" type="text/css" href="css/common/hzbstyle.css">
- <script type="text/javascript">
- var i = 1;//第几页
- var sum;//总条数
- var totalpage;//总页数
- $(document).ready(function(){
- fLoadTable();
- fLoadData(1,10);
- //信息修改按钮
- $('#infoalter').click(function(){
- infoalter();
- });
- });
- function infoalter(){
- var row = $('#tt').datagrid('getSelected');
- if(!row){
- $.messager.alert('提示', "请选择一条数据信息", 'info');
- return;
- }
- if (row){
-
- $('#infoalterwindows').dialog('open').dialog('setTitle','编辑信息');
- $('#infoalterform').form('load',row);
-
-
- initalterwindow();
- infoalterurl = "ajax/infoalter?vn="+row.village;
- }
- }
- function fLoadTable(){
- $('#tt').datagrid({
- fit: true,//自动大小
- title: '',
- width: '100%',
- height: 580,
- fitColumns: true,
- loadMsg:'正在加载, 请稍等 …',
- nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取
- striped : true,//设置为true将交替显示行背景
- collapsible : false,//显示可折叠按钮
- fitColumns:true,//允许表格自动缩放,以适应父容器
- rownumbers:true,
- columns:[[
- {field:'area',title:'待检验气瓶提前告警时间',width:'240px',align:'left',formatter: function(value, row, index){
- seriesName = value;
- return '<font style="color:black;font-size:14px;" class="hzbspan">'+seriesName+'<font style="color:red;font-size:12px;" class="hzbspan">(双击可编辑)</font></font>';
-
-
- }},
- {field:'time1',title:'刷外地车标签告警百分比',width:'240px',align:'left',formatter: function(value, row, index){
- return '<font style="color:black;font-size:14px;" class="hzbspan">'+value+'<font style="color:red;font-size:12px;" class="hzbspan">(双击可编辑)</font></font>';
-
-
- }},
- {field:'time2',title:'断网时长告警(0表示只有要断网就告警)',width:'240px',align:'left',formatter: function(value, row, index){
- return '<font style="color:black;font-size:14px;" class="hzbspan">'+value+'<font style="color:red;font-size:12px;" class="hzbspan">(双击可编辑)</font></font>';
-
-
- }}
- ]],
- onDblClickRow: function (rowIndex, rowData) {
- $('#infoalterwindows').dialog('open').dialog('setTitle','编辑报警参数');
- var aa = rowData.area;
- aa = aa.replace(/[^0-9]/g,'');
- var bb = rowData.time2;
- bb = bb.replace(/[^0-9]/g,'');
- var cc = rowData.time1;
- cc = cc.replace(/[^0-9]/g,'');
- //var select2 = document.getElementById("selectoption2");
-
- var opList1 = document.getElementById("selectoption2").childNodes;
- for (var i = 0, len = opList1.length; i < len; i++) {
- if (opList1[i].value == rowData.time2Unit) {
- opList1[i].selected = true;
- break;
- }
- }
-
- //select2.options.add(new Option(rowData.time2Unit, rowData.time2Unit));
- var Cts = rowData.area;
- var opList = document.getElementById("selectoption").childNodes;
- if(Cts.indexOf("月") > 0 ){
- for (var i = 0, len = opList.length; i < len; i++) {
- if (opList[i].value == 1) {
- opList[i].selected = true;
- break;
- }
- }
-
- }
- if(Cts.indexOf("天") > 0 ){
- for (var i = 0, len = opList.length; i < len; i++) {
- if (opList[i].value == 0) {
- opList[i].selected = true;
- break;
- }
- }
-
- }
-
- //$('#infoalterform').form('load',rowData);
- document.getElementById("alterlat11").value = aa;
- document.getElementById("time1").value = cc;
- document.getElementById("time2").value = bb;
- infoalterurl = "ajax/infoalter?vn="+rowData.village;
-
-
-
-
-
-
- }
- });
- }
- function fLoadData(page,rows){
- $.messager.progress({
- title: '请等待',
- msg: '正在加载数据...',
- text: '查询中.......'
- });
- $.ajax({
- type:"POST",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- url:"ajax/getoldwarningparam",
- success:function (data){
- $.messager.progress('close');
- var vData = $.parseJSON(data);
- sum = vData.total;
- totalpage = Math.ceil(sum/rows);
- $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
- $('#pp').pagination({
- total:sum,
- pageList: [2,10,50,100],
- beforePageText: '第',//页数文本框前显示的汉字
- afterPageText: '页 共 {pages} 页',
- displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
- onSelectPage:function(pageNumber, pageSize){
- fLoadData();
- }
-
-
- });
- }
- });
-
-
- }
- function infoaltersave(){
-
-
- var t1=document.getElementById("alterlat11").value.replace(/\s+/g,"");
- var t2=document.getElementById("time1").value.replace(/\s+/g,"");
- var t3= document.getElementById("time2").value.replace(/\s+/g,"");
- if(!t1){
- show("待检验气瓶提前警告时间不能为空!");
- return;
- }
- if(!t2){
- show("刷外地车标签告警百分比不能为空!");
- return;
- }
- if(!t3){
- show("断网时长告警不能为空!");
- return;
- }
- if(!isNaN(t1)){
- }else{
- show("待检验气瓶提前警告时间不是数字!");
- return;
- }
- if(!isNaN(t2)){
- }else{
- show("刷外地车标签告警百分比不是数字!");
- return;
- }
- if(!isNaN(t3)){
- }else{
- show("断网时长告警不是数字!");
- return;
- }
- $.ajax({
- type:"POST",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- data:$('#alterWarningform').serialize(),
- url:"ajax/warningparaset",
- success:function (data){
- var obj=eval("(" + data + ")");
- $.each(obj.rows, function(i,item){
- if(item.sresult=="0000"){
- $('#infoalterwindows').dialog('close');
- show("修改成功");
- }else{
- show("修改失败");
- }
- });
-
- }
- });
- }
-
- function show(message) {
- $.messager.show({
- title: '提示信息',
- msg: message,
- timeout: 2000,
- showType: 'slide'
- });
- }
- </script>
- </head>
-
- <body>
- <!-- 查询结果:数据表格 -->
- <table id="tt" cellspacing="0" cellpadding="0" >
- </table>
-
-
- <!-- 信息修改窗口 -->
- <div id="infoalterwindows" class="easyui-window" modal="true" closed="true" collapsible="false" minimizable="false" maximizable="false" icon="icon-edit" style="width:670px;height: 375px;padding:5px;background:#fafafa;" >
- <div class="easyui-layout" fit="true">
- <div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
- <form id="alterWarningform" method="post" >
- <table>
- <tr>
- <td style="width: auto;">
- <span style="cursor: default"><span class="hzbspan">待检验气瓶提前告警时间:</span></span> <input type="text" name="area" id="alterlat11" style="width: 500px;" class="hzbspan"/><select id="selectoption" name="selectoption" class="hzbspan">
- <option value="0">天</option>
- <option value="1">月</option>
-
- </select><span class="hzbspan"></span>
- </td>
- </tr>
-
- <tr>
- <td style="width: auto;">
- <span style="cursor: default"><span class="hzbspan">刷外地车标签告警百分比:</span></span> <input type="text" name="time1" id="time1" style="width: 500px;" class="hzbspan"/><span class="hzbspan"></span>
- <select id="selectoption1" name="selectoption1" class="hzbspan">
- <option value="%">%</option>
-
- </select></td>
- </tr>
-
-
- <tr>
- <td style="width: auto;">
- <span style="cursor: default"><span class="hzbspan">断网时长告警(0表示只有要断网就告警):</span></span> <input type="text" name="time2" id="time2" style="width: 500px;" class="hzbspan"/><span class="hzbspan"></span>
- <select id="selectoption2" name="selectoption2" class="hzbspan">
- <option value="小时">小时</option>
- <option value="分钟">分钟</option>
- </select>
- </td>
- </tr>
-
- </table>
- </form>
- </div>
-
- <div region="south" border="false" style="text-align: right; height: 30px; line-height: 30px;">
- <a onclick="infoaltersave();" class="easyui-linkbutton" icon="icon-save">保存</a>
- <a class="easyui-linkbutton" onclick="javascript:$('#infoalterwindows').dialog('close')" iconcls="icon-cancel">取消</a>
- </div>
- </div>
- </div>
- </body>
- </html>
|