Commit df52ddfdb3997d9cd062b15471a746eeb3c37b4a
1 parent
3e9f4cb9
浦东新增间隔信息、闵行超速异常优化!
Showing
6 changed files
with
738 additions
and
44 deletions
src/main/resources/static/pages/base/interval/add.html
0 → 100644
| 1 | +<!-- 片段标题 START --> | |
| 2 | +<div class="page-head"> | |
| 3 | + <div class="page-title"> | |
| 4 | + <h1>新增间隔信息</h1> | |
| 5 | + </div> | |
| 6 | +</div> | |
| 7 | +<!-- 片段标题 END --> | |
| 8 | + | |
| 9 | +<!-- 线路信息导航栏组件 START --> | |
| 10 | +<ul class="page-breadcrumb breadcrumb"> | |
| 11 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | |
| 12 | + <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li> | |
| 13 | + <li><a href="/pages/base/interval/list.html" data-pjax>间隔信息</a> <i class="fa fa-circle"></i></li> | |
| 14 | + <li><span class="active">新增间隔信息</span></li> | |
| 15 | +</ul> | |
| 16 | +<!-- 线路信息导航栏组件 END --> | |
| 17 | + | |
| 18 | +<!-- 信息容器组件 START --> | |
| 19 | +<div class="portlet light bordered"> | |
| 20 | + | |
| 21 | + <!-- 信息容器组件标题 START --> | |
| 22 | + <div class="portlet-title"> | |
| 23 | + <div class="caption"> | |
| 24 | + <i class="icon-equalizer font-red-sunglo"></i> | |
| 25 | + <span class="caption-subject font-red-sunglo bold uppercase">新增间隔信息</span> | |
| 26 | + </div> | |
| 27 | + </div> | |
| 28 | + <!-- 信息容器组件标题 END --> | |
| 29 | + | |
| 30 | + <!-- 表单容器组件 START --> | |
| 31 | + <div class="portlet-body form" id="intervalAddForm"> | |
| 32 | + | |
| 33 | + <!-- START FORM --> | |
| 34 | + <form action="/" class="form-horizontal" id="interval_add_form" > | |
| 35 | + | |
| 36 | + <!-- 错误提示信息组件 START --> | |
| 37 | + <div class="alert alert-danger display-hide"> | |
| 38 | + <button class="close" data-close="alert"></button> | |
| 39 | + 您的输入有误,请检查下面的输入项 | |
| 40 | + </div> | |
| 41 | + <!-- 错误提示信息组件 END --> | |
| 42 | + | |
| 43 | + <!-- 表单内容 START --> | |
| 44 | + <div class="form-body"> | |
| 45 | + | |
| 46 | + <!-- 表单分组组件 form-group START --> | |
| 47 | + <div class="form-group"> | |
| 48 | + <div class="col-md-12" style="margin-top:10px"> | |
| 49 | + <label class="control-label col-md-5"> 间隔等级 :</label> | |
| 50 | + <div class="col-md-4"> | |
| 51 | + <input type="text" class="form-control" name="level" id="level" placeholder="间隔等级"> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + | |
| 55 | + <div class="col-md-12" style="margin-top:10px"> | |
| 56 | + <label class="control-label col-md-5"> 高峰间隔时间 : </label> | |
| 57 | + <div class="col-md-4"> | |
| 58 | + <input type="text" class="form-control" name="peak" id="peak" placeholder="高峰间隔时间"> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + | |
| 62 | + <div class="col-md-12" style="margin-top:10px"> | |
| 63 | + <label class="control-label col-md-5"> 低谷间隔时间 : </label> | |
| 64 | + <div class="col-md-4"> | |
| 65 | + <input type="text" class="form-control" name="trough" id="trough" placeholder="低谷间隔时间"> | |
| 66 | + </div> | |
| 67 | + </div> | |
| 68 | + | |
| 69 | + <div class="col-md-12" style="margin-top:10px" hidden> | |
| 70 | + <label class="control-label col-md-5"> 创建人 : </label> | |
| 71 | + <div class="col-md-4"> | |
| 72 | + <input type="text" class="form-control" name="createBy" id="createBy" placeholder="创建人"> | |
| 73 | + </div> | |
| 74 | + </div> | |
| 75 | + | |
| 76 | + </div> | |
| 77 | + <!-- 表单分组组件 form-group END --> | |
| 78 | + | |
| 79 | + <!-- 表单按钮组件 START --> | |
| 80 | + <div class="form-actions"> | |
| 81 | + <div class="row"> | |
| 82 | + <div class="col-md-offset-5 col-md-7"> | |
| 83 | + <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> | |
| 84 | + <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a> | |
| 85 | + </div> | |
| 86 | + </div> | |
| 87 | + </div> | |
| 88 | + <!-- 表单按钮组件 END --> | |
| 89 | + </form> | |
| 90 | + <!-- END FORM--> | |
| 91 | + </div> | |
| 92 | + <!-- 表单组件 END --> | |
| 93 | +</div> | |
| 94 | +<!-- 信息容器组件 END --> | |
| 95 | + | |
| 96 | +<!-- 线路信息修改片段JS模块 --> | |
| 97 | +<script src="/pages/base/interval/js/interval-add-form.js"></script> | |
| 0 | 98 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/interval/edit.html
0 → 100644
| 1 | +<!-- 片段标题 START --> | |
| 2 | +<div class="page-head"> | |
| 3 | + <div class="page-title"> | |
| 4 | + <h1>修改间隔信息</h1> | |
| 5 | + </div> | |
| 6 | +</div> | |
| 7 | +<!-- 片段标题 END --> | |
| 8 | + | |
| 9 | +<!-- 线路信息导航栏组件 START --> | |
| 10 | +<ul class="page-breadcrumb breadcrumb"> | |
| 11 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | |
| 12 | + <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li> | |
| 13 | + <li><a href="/pages/base/interval/list.html" data-pjax>间隔信息</a> <i class="fa fa-circle"></i></li> | |
| 14 | + <li><span class="active">修改间隔信息</span></li> | |
| 15 | +</ul> | |
| 16 | +<!-- 线路信息导航栏组件 END --> | |
| 17 | + | |
| 18 | +<!-- 信息容器组件 START --> | |
| 19 | +<div class="portlet light bordered"> | |
| 20 | + | |
| 21 | + <!-- 信息容器组件标题 START --> | |
| 22 | + <div class="portlet-title"> | |
| 23 | + <div class="caption"> | |
| 24 | + <i class="icon-equalizer font-red-sunglo"></i> | |
| 25 | + <span class="caption-subject font-red-sunglo bold uppercase">修改间隔信息</span> | |
| 26 | + </div> | |
| 27 | + </div> | |
| 28 | + <!-- 信息容器组件标题 END --> | |
| 29 | + | |
| 30 | + <!-- 表单容器组件 START --> | |
| 31 | + <div class="portlet-body form" id="intervalEditForm"> | |
| 32 | + | |
| 33 | + <!-- START FORM --> | |
| 34 | + <form action="/" class="form-horizontal" id="interval_edit_form" > | |
| 35 | + | |
| 36 | + <!-- 错误提示信息组件 START --> | |
| 37 | + <div class="alert alert-danger display-hide"> | |
| 38 | + <button class="close" data-close="alert"></button> | |
| 39 | + 您的输入有误,请检查下面的输入项 | |
| 40 | + </div> | |
| 41 | + <!-- 错误提示信息组件 END --> | |
| 42 | + | |
| 43 | + <!-- 表单内容 START --> | |
| 44 | + <div class="form-body"> | |
| 45 | + <input type="hidden" name="id" id="intervalId"> | |
| 46 | + | |
| 47 | + <!-- 表单分组组件 form-group START --> | |
| 48 | + <div class="form-group"> | |
| 49 | + <div class="col-md-12" style="margin-top:10px"> | |
| 50 | + <label class="control-label col-md-5"> 间隔等级 :</label> | |
| 51 | + <div class="col-md-4"> | |
| 52 | + <input type="text" class="form-control" name="level" id="levelInput" placeholder="间隔等级"> | |
| 53 | + </div> | |
| 54 | + </div> | |
| 55 | + | |
| 56 | + <div class="col-md-12" style="margin-top:10px"> | |
| 57 | + <label class="control-label col-md-5"> 高峰间隔时间 : </label> | |
| 58 | + <div class="col-md-4"> | |
| 59 | + <input type="text" class="form-control" name="peak" id="peakInput" placeholder="高峰间隔时间"> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + | |
| 63 | + <div class="col-md-12" style="margin-top:10px"> | |
| 64 | + <label class="control-label col-md-5"> 低谷间隔时间 : </label> | |
| 65 | + <div class="col-md-4"> | |
| 66 | + <input type="text" class="form-control" name="trough" id="troughInput" placeholder="低谷间隔时间"> | |
| 67 | + </div> | |
| 68 | + </div> | |
| 69 | + | |
| 70 | + <div class="col-md-12" style="margin-top:10px"> | |
| 71 | + <label class="control-label col-md-5"> 创建人 : </label> | |
| 72 | + <div class="col-md-4"> | |
| 73 | + <input type="text" class="form-control" name="createBy" id="createByInput" readonly> | |
| 74 | + </div> | |
| 75 | + </div> | |
| 76 | + | |
| 77 | + <div class="col-md-12" style="margin-top:10px"> | |
| 78 | + <label class="control-label col-md-5"> 创建时间 : </label> | |
| 79 | + <div class="col-md-4"> | |
| 80 | + <input type="text" class="form-control" name="createDate" id="createDateInput" disabled> | |
| 81 | + </div> | |
| 82 | + </div> | |
| 83 | + | |
| 84 | + <div class="col-md-12" style="margin-top:10px"> | |
| 85 | + <label class="control-label col-md-5"> 修改人 : </label> | |
| 86 | + <div class="col-md-4"> | |
| 87 | + <input type="text" class="form-control" name="updateBy" id="updateByInput" readonly> | |
| 88 | + </div> | |
| 89 | + </div> | |
| 90 | + | |
| 91 | + <div class="col-md-12" style="margin-top:10px"> | |
| 92 | + <label class="control-label col-md-5"> 修改时间 : </label> | |
| 93 | + <div class="col-md-4"> | |
| 94 | + <input type="text" class="form-control" name="updateDate" id="updateDateInput" disabled> | |
| 95 | + </div> | |
| 96 | + </div> | |
| 97 | + | |
| 98 | + </div> | |
| 99 | + <!-- 表单分组组件 form-group END --> | |
| 100 | + | |
| 101 | + <!-- 表单按钮组件 START --> | |
| 102 | + <div class="form-actions"> | |
| 103 | + <div class="row"> | |
| 104 | + <div class="col-md-offset-5 col-md-7"> | |
| 105 | + <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> | |
| 106 | + <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a> | |
| 107 | + </div> | |
| 108 | + </div> | |
| 109 | + </div> | |
| 110 | + <!-- 表单按钮组件 END --> | |
| 111 | + </form> | |
| 112 | + <!-- END FORM--> | |
| 113 | + </div> | |
| 114 | + <!-- 表单组件 END --> | |
| 115 | +</div> | |
| 116 | +<!-- 信息容器组件 END --> | |
| 117 | + | |
| 118 | +<!-- 线路信息修改片段JS模块 --> | |
| 119 | +<script src="/pages/base/interval/js/interval-edit-form.js"></script> | |
| 0 | 120 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/interval/js/interval-add-form.js
0 → 100644
| 1 | +/** | |
| 2 | + * @description TODO(公司信息添加片段JS模块) | |
| 3 | + * | |
| 4 | + * @author bsth@lq | |
| 5 | + * | |
| 6 | + * @date 二〇一六年十月十八日 13:31:58 | |
| 7 | + * | |
| 8 | + */ | |
| 9 | + | |
| 10 | +$(function(){ | |
| 11 | + // 定义表单 | |
| 12 | + var form = $('#interval_add_form'); | |
| 13 | + // 定义表单异常 | |
| 14 | + var error = $('.alert-danger',form); | |
| 15 | + $.ajax({ | |
| 16 | + type: "get", | |
| 17 | + async:false, | |
| 18 | + url: '/user/currentUser', | |
| 19 | + success: function (user) { | |
| 20 | + $("#createBy").val(user.userName); | |
| 21 | + } | |
| 22 | + }) | |
| 23 | + // 表单验证 | |
| 24 | + form.validate({ | |
| 25 | + // 错误提示元素span对象 | |
| 26 | + errorElement : 'span', | |
| 27 | + // 错误提示元素class名称 | |
| 28 | + errorClass : 'help-block help-block-error', | |
| 29 | + // 验证错误获取焦点 | |
| 30 | + focusInvalid : true, | |
| 31 | + // 需要验证的表单元素 | |
| 32 | + rules : { | |
| 33 | + // 公司名称编码 | |
| 34 | + 'level' : { | |
| 35 | + // 必填项 | |
| 36 | + required : true, | |
| 37 | + // 最大长度 | |
| 38 | + maxlength: 10 | |
| 39 | + }, | |
| 40 | + // 公司名称 | |
| 41 | + 'peak' : { | |
| 42 | + // 必填项 | |
| 43 | + required : true, | |
| 44 | + // 最大长度 | |
| 45 | + maxlength: 10 | |
| 46 | + }, | |
| 47 | + // 公司名称 | |
| 48 | + 'trough' : { | |
| 49 | + // 必填项 | |
| 50 | + required : true, | |
| 51 | + // 最大长度 | |
| 52 | + maxlength: 10 | |
| 53 | + }, | |
| 54 | + }, | |
| 55 | + /** | |
| 56 | + * 类型:Callback。当未通过验证的表单提交时,可以在该回调函数中处理一些事情。 | |
| 57 | + * | |
| 58 | + * 参数:该回调函数有两个参数:第一个为一个事件对象,第二个为验证器(validator) | |
| 59 | + */ | |
| 60 | + invalidHandler : function(event, validator) { | |
| 61 | + // 显示表单未通过提示信息 | |
| 62 | + error.show(); | |
| 63 | + // 把提示信息放到指定的位置。 | |
| 64 | + App.scrollTo(error, -200); | |
| 65 | + }, | |
| 66 | + /** | |
| 67 | + * 类型:Callback。 | |
| 68 | + * | |
| 69 | + * 默认:添加errorClass("has-error")到表单元素。将未通过验证的表单元素设置高亮。 | |
| 70 | + */ | |
| 71 | + highlight : function(element) { | |
| 72 | + // 添加errorClass("has-error")到表单元素 | |
| 73 | + $(element).closest('.form-group').addClass('has-error'); | |
| 74 | + | |
| 75 | + }, | |
| 76 | + /** | |
| 77 | + * 类型:Callback。 | |
| 78 | + * | |
| 79 | + * 默认:移除errorClass("has-error")。与highlight操作相反 | |
| 80 | + */ | |
| 81 | + unhighlight : function(element) { | |
| 82 | + // 移除errorClass("has-error") | |
| 83 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 84 | + | |
| 85 | + }, | |
| 86 | + /** | |
| 87 | + * 类型:String,Callback。 | |
| 88 | + * | |
| 89 | + * 如果指定它,当验证通过时显示一个消息。 | |
| 90 | + * | |
| 91 | + * 如果是String类型的,则添加该样式到标签中; | |
| 92 | + * | |
| 93 | + * 如果是一个回调函数,则将标签作为其唯一的参数。 | |
| 94 | + */ | |
| 95 | + success : function(label) { | |
| 96 | + // 当验证通过时,移除errorClass("has-error") | |
| 97 | + label.closest('.form-group').removeClass('has-error'); | |
| 98 | + }, | |
| 99 | + | |
| 100 | + /** | |
| 101 | + * 类型:Callback。 | |
| 102 | + * | |
| 103 | + * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form | |
| 104 | + */ | |
| 105 | + submitHandler : function(f) { | |
| 106 | + // 隐藏错误提示 | |
| 107 | + error.hide(); | |
| 108 | + // 表单序列化 | |
| 109 | + var params = form.serializeJSON(); | |
| 110 | + console.log(params); | |
| 111 | + submit(); | |
| 112 | + // 提交 | |
| 113 | + function submit() { | |
| 114 | + // 添加数据 | |
| 115 | + $post('/interval', params, function(result) { | |
| 116 | + // 如果返回结果不为空 | |
| 117 | + if(result){ | |
| 118 | + // 返回状态码为"SUCCESS" ,则添加成功;返回状态码为"ERROR" ,则添加失败 | |
| 119 | + if(result.status=='SUCCESS') { | |
| 120 | + // 弹出添加成功提示消息 | |
| 121 | + layer.msg('添加成功...'); | |
| 122 | + } else if(result.status=='ERROR') { | |
| 123 | + // 弹出添加失败提示消息 | |
| 124 | + layer.msg('添加失败...'); | |
| 125 | + } | |
| 126 | + } | |
| 127 | + // 返回list.html页面 | |
| 128 | + //loadPage('list.html'); | |
| 129 | + window.location.href = 'list.html'; | |
| 130 | + }); | |
| 131 | + } | |
| 132 | + } | |
| 133 | + }); | |
| 134 | +}); | |
| 0 | 135 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/interval/js/interval-edit-form.js
0 → 100644
| 1 | +/** | |
| 2 | + * @description TODO(间隔信息修改片段JS模块) | |
| 3 | + * | |
| 4 | + * @author bsth@zb | |
| 5 | + * | |
| 6 | + * @date 2017.08.01 | |
| 7 | + * | |
| 8 | + */ | |
| 9 | + | |
| 10 | +!function(){ | |
| 11 | + // 获取参数ID | |
| 12 | + var intervalId = $.url().param('no'); | |
| 13 | + // 如果参数ID不为空 | |
| 14 | + if(intervalId) { | |
| 15 | + // 获取线路Id元素并设值 | |
| 16 | + $('#intervalId').val(intervalId); | |
| 17 | + /** 根据ID查询详细信息 */ | |
| 18 | + $get('/interval/' + intervalId ,null, function(result){ | |
| 19 | + if(result) { | |
| 20 | + /** 填充修改线路表单元素值 @param:<result:数据结果集;interval_edit_form:表单元素> */ | |
| 21 | + // 定义日期格式 | |
| 22 | + var fs = 'YYYY-MM-DD' | |
| 23 | + // 设置日期 | |
| 24 | + result.createDate = moment(result.createDate).format(fs); | |
| 25 | + result.updateDate = moment(result.updateDate).format(fs); | |
| 26 | + putFormData(result, '#interval_edit_form'); | |
| 27 | + } | |
| 28 | + }); | |
| 29 | + } else { | |
| 30 | + // 缺少ID | |
| 31 | + layer.confirm('【ID缺失,请点击返回,重新进行修改操作】', {btn : [ '返回' ],icon: 3, title:'提示'}, function(index){ | |
| 32 | + // 关闭弹出层 | |
| 33 | + layer.close(index); | |
| 34 | + // 跳转到list页面 | |
| 35 | + loadPage('list.html'); | |
| 36 | + }); | |
| 37 | + } | |
| 38 | + // 定义表单 | |
| 39 | + var form = $('#interval_edit_form'); | |
| 40 | + | |
| 41 | + // 定义表单异常 | |
| 42 | + var error = $('.alert-danger',form); | |
| 43 | + // 表单验证 | |
| 44 | + form.validate({ | |
| 45 | + // 错误提示元素span对象 | |
| 46 | + errorElement : 'span', | |
| 47 | + // 错误提示元素class名称 | |
| 48 | + errorClass : 'help-block help-block-error', | |
| 49 | + // 验证错误获取焦点 | |
| 50 | + focusInvalid : true, | |
| 51 | + // 需要验证的表单元素 | |
| 52 | + rules : { | |
| 53 | + // 公司名称编码 | |
| 54 | + 'level' : { | |
| 55 | + // 必填项 | |
| 56 | + required : true, | |
| 57 | + // 最大长度 | |
| 58 | + maxlength: 10 | |
| 59 | + }, | |
| 60 | + // 公司名称 | |
| 61 | + 'peak' : { | |
| 62 | + // 必填项 | |
| 63 | + required : true, | |
| 64 | + // 最大长度 | |
| 65 | + maxlength: 10 | |
| 66 | + }, | |
| 67 | + // 公司名称 | |
| 68 | + 'trough' : { | |
| 69 | + // 必填项 | |
| 70 | + required : true, | |
| 71 | + // 最大长度 | |
| 72 | + maxlength: 10 | |
| 73 | + }, | |
| 74 | + }, | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * 类型:Callback。当未通过验证的表单提交时,可以在该回调函数中处理一些事情。 | |
| 78 | + * | |
| 79 | + * 参数:该回调函数有两个参数:第一个为一个事件对象,第二个为验证器(validator) | |
| 80 | + */ | |
| 81 | + invalidHandler : function(event, validator) { | |
| 82 | + | |
| 83 | + // 显示表单未通过提示信息 | |
| 84 | + error.show(); | |
| 85 | + | |
| 86 | + // 把提示信息放到指定的位置。 | |
| 87 | + App.scrollTo(error, -200); | |
| 88 | + }, | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * 类型:Callback。 | |
| 92 | + * | |
| 93 | + * 默认:添加errorClass("has-error")到表单元素。将未通过验证的表单元素设置高亮。 | |
| 94 | + */ | |
| 95 | + highlight : function(element) { | |
| 96 | + | |
| 97 | + // 添加errorClass("has-error")到表单元素 | |
| 98 | + $(element).closest('.form-group').addClass('has-error'); | |
| 99 | + | |
| 100 | + }, | |
| 101 | + | |
| 102 | + /** | |
| 103 | + * 类型:Callback。 | |
| 104 | + * | |
| 105 | + * 默认:移除errorClass("has-error")。与highlight操作相反 | |
| 106 | + */ | |
| 107 | + unhighlight : function(element) { | |
| 108 | + | |
| 109 | + // 移除errorClass("has-error") | |
| 110 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 111 | + | |
| 112 | + }, | |
| 113 | + | |
| 114 | + /** | |
| 115 | + * 类型:String,Callback。 | |
| 116 | + * | |
| 117 | + * 如果指定它,当验证通过时显示一个消息。 | |
| 118 | + * | |
| 119 | + * 如果是String类型的,则添加该样式到标签中; | |
| 120 | + * | |
| 121 | + * 如果是一个回调函数,则将标签作为其唯一的参数。 | |
| 122 | + */ | |
| 123 | + success : function(label) { | |
| 124 | + | |
| 125 | + // 当验证通过时,移除errorClass("has-error") | |
| 126 | + label.closest('.form-group').removeClass('has-error'); | |
| 127 | + | |
| 128 | + }, | |
| 129 | + /** | |
| 130 | + * 类型:Callback。 | |
| 131 | + * | |
| 132 | + * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form | |
| 133 | + */ | |
| 134 | + submitHandler : function(f) { | |
| 135 | + // 隐藏错误提示 | |
| 136 | + error.hide(); | |
| 137 | + // 表单序列化 | |
| 138 | + $.ajax({ | |
| 139 | + type: "get", | |
| 140 | + async:false, | |
| 141 | + url: '/user/currentUser', | |
| 142 | + success: function (user) { | |
| 143 | + $("#updateByInput").val(user.userName); | |
| 144 | + } | |
| 145 | + }); | |
| 146 | + var params = form.serializeJSON(); | |
| 147 | + console.log(params); | |
| 148 | + submit(); | |
| 149 | + // 提交 | |
| 150 | + function submit() { | |
| 151 | + // 修改数据 | |
| 152 | + $post('/interval', params, function(result) { | |
| 153 | + // 如果返回结果不为空 | |
| 154 | + if(result){ | |
| 155 | + // 返回状态码为"SUCCESS" ,则添加成功;返回状态码为"ERROR" ,则添加失败 | |
| 156 | + if(result.status=='SUCCESS') { | |
| 157 | + // 弹出添加成功提示消息 | |
| 158 | + layer.msg('添加成功...'); | |
| 159 | + } else if(result.status=='ERROR') { | |
| 160 | + // 弹出添加失败提示消息 | |
| 161 | + layer.msg('添加失败...'); | |
| 162 | + } | |
| 163 | + } | |
| 164 | + // 返回list.html页面 | |
| 165 | + //loadPage('list.html'); | |
| 166 | + window.location.href = 'list.html'; | |
| 167 | + }); | |
| 168 | + } | |
| 169 | + } | |
| 170 | + }); | |
| 171 | +}(); | |
| 0 | 172 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/interval/js/interval-list-table.js
0 → 100644
| 1 | +/** | |
| 2 | + * | |
| 3 | + * @JSName : list.js(站点信息list.html页面js) | |
| 4 | + * | |
| 5 | + * @Author : bsth@zb | |
| 6 | + * | |
| 7 | + * @Description : TODO(站点信息list.html页面js) | |
| 8 | + * | |
| 9 | + * @Data : 2017年8月1日 上午9:21:17 | |
| 10 | + * | |
| 11 | + * @Version 公交调度系统BS版 0.1 | |
| 12 | + * | |
| 13 | + */ | |
| 14 | + | |
| 15 | +(function(){ | |
| 16 | + // 关闭左侧栏 | |
| 17 | + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} | |
| 18 | + /** page : 当前页 initPag : */ | |
| 19 | + var page = 0,initPag,storage = window.localStorage; | |
| 20 | + if(storage.xlName_AgursData!=null && storage.xlName_AgursData !='') { | |
| 21 | + $('.tipso-animation').children().remove(); | |
| 22 | + // 延迟加载 | |
| 23 | + setTimeout(function(){ | |
| 24 | + $('.tipso-animation').tipso({ | |
| 25 | + speed : 400, | |
| 26 | + background : '#0ed0e8', | |
| 27 | + color : '#ffffff', | |
| 28 | + position :'bottom', | |
| 29 | + width : 400, | |
| 30 | + delay : 100, | |
| 31 | + animationIn : 'fadeInDownBig', | |
| 32 | + animationOut : 'fadeOut', | |
| 33 | + offsetX : -50, | |
| 34 | + offsetY : -195, | |
| 35 | + content :'您可以通过点击重置按钮来清除对线路名称的记忆哦!', | |
| 36 | + | |
| 37 | + }); | |
| 38 | + $('.tipso-animation').tipso('show'); | |
| 39 | + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | |
| 40 | + },200); | |
| 41 | + } | |
| 42 | + | |
| 43 | + /** 表格数据分页加载 */ | |
| 44 | + loadTableDate(null,true); | |
| 45 | + | |
| 46 | + /** 重置按钮事件 */ | |
| 47 | + $('tr.filter .filter-cancel').on('click',function(){ | |
| 48 | + // 清空搜索框值 | |
| 49 | + $('tr.filter input,select').val('').change(); | |
| 50 | + $('.tipso-animation').tipso('hide'); | |
| 51 | + storage.setItem('xlName_AgursData',''); | |
| 52 | + // 重新加载表格数据 | |
| 53 | + loadTableDate(null,true); | |
| 54 | + }); | |
| 55 | + | |
| 56 | + /** 搜索按钮事件 */ | |
| 57 | + $('tr.filter .filter-submit').on('click',function(){ | |
| 58 | + var params = getParams(); | |
| 59 | + page = 0; | |
| 60 | + /** 表格数据分页加载 @param:<params:搜索参数;true:是否重新分页> */ | |
| 61 | + loadTableDate(params,true); | |
| 62 | + }); | |
| 63 | + | |
| 64 | + function getParams() { | |
| 65 | + // cells 集合返回表格中所有(列)单元格的一个数组 | |
| 66 | + var cells = $('tr.filter')[0].cells; | |
| 67 | + // 搜索参数集合 | |
| 68 | + var params = {}; | |
| 69 | + // 搜索字段名称 | |
| 70 | + var name; | |
| 71 | + // 遍历cells数组 | |
| 72 | + $.each(cells, function(i, cell){ | |
| 73 | + // 获取第i列的input或者select集合 | |
| 74 | + var items = $('input,select', cell); | |
| 75 | + // 遍历items集合 | |
| 76 | + for(var j = 0, item; item = items[j++];){ | |
| 77 | + // 获取字段名称 | |
| 78 | + name = $(item).attr('name'); | |
| 79 | + if(name){ | |
| 80 | + // 赋取相对应的值 | |
| 81 | + params[name] = $(item).val(); | |
| 82 | + } | |
| 83 | + } | |
| 84 | + }); | |
| 85 | + return params; | |
| 86 | + } | |
| 87 | + | |
| 88 | + /** | |
| 89 | + * 表格数据分页加载事件 | |
| 90 | + * | |
| 91 | + * ------@param : 查询参数 | |
| 92 | + * | |
| 93 | + * ------@isPon : 是否重新分页 | |
| 94 | + * | |
| 95 | + */ | |
| 96 | + function loadTableDate(param,isPon){ | |
| 97 | + // 搜索参数 | |
| 98 | + var params = {}; | |
| 99 | + if(param) { | |
| 100 | + params = param; | |
| 101 | + } | |
| 102 | + // 排序(按id) | |
| 103 | + params['order'] = 'id'; | |
| 104 | + //排序方向 | |
| 105 | + params['direction'] = 'ASC'; | |
| 106 | + // 记录当前页数 | |
| 107 | + params['page'] = page; | |
| 108 | + // 弹出正在加载层 | |
| 109 | + var i = layer.load(2); | |
| 110 | + // 异步请求获取表格数据 | |
| 111 | + $.get('/interval',params,function(result){ | |
| 112 | + // 添加序号 | |
| 113 | + result.content.page = page; | |
| 114 | + // 把数据填充到模版中 | |
| 115 | + var tbodyHtml = template('interval_list_temp',{list:result.content}); | |
| 116 | + $('#datatable_interval tbody').html(tbodyHtml); | |
| 117 | + // 是重新分页且返回数据长度大于0 | |
| 118 | + if(isPon && result.content.length > 0){ | |
| 119 | + // 重新分页 | |
| 120 | + initPag = true; | |
| 121 | + // 分页栏 | |
| 122 | + showPagination(result); | |
| 123 | + } | |
| 124 | + // 关闭弹出加载层 | |
| 125 | + layer.close(i); | |
| 126 | + }); | |
| 127 | + } | |
| 128 | + /** 分页栏组件 */ | |
| 129 | + function showPagination(data){ | |
| 130 | + // 分页组件 | |
| 131 | + $('#pagination').jqPaginator({ | |
| 132 | + // 总页数 | |
| 133 | + totalPages: data.totalPages, | |
| 134 | + // 中间显示页数 | |
| 135 | + visiblePages: 6, | |
| 136 | + // 当前页 | |
| 137 | + currentPage: page + 1, | |
| 138 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 139 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 140 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 141 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 142 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 143 | + onPageChange: function (num, type) { | |
| 144 | + if(initPag){ | |
| 145 | + initPag = false; | |
| 146 | + return; | |
| 147 | + } | |
| 148 | + var pData = getParams(); | |
| 149 | + if(pData.stationName_like!='' && pData.stationName_like != null) { | |
| 150 | + pData.stationName_like = pData.stationName_like.split('_')[0]; | |
| 151 | + } | |
| 152 | + page = num - 1; | |
| 153 | + loadTableDate(pData, false); | |
| 154 | + } | |
| 155 | + }); | |
| 156 | + } | |
| 157 | +})(); | |
| 0 | 158 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/excep/mhspeedingList.html
| ... | ... | @@ -32,9 +32,10 @@ |
| 32 | 32 | <th width="3%">#</th> |
| 33 | 33 | <th width="4%">线路</th> |
| 34 | 34 | <th width="6%">车辆自编号</th> |
| 35 | - <th width="8%">上下行</th> | |
| 36 | - <th width="10%">开始时间</th> | |
| 37 | - <th width="10%">结束时间</th> | |
| 35 | + <th width="6%">上下行</th> | |
| 36 | + <th width="8%">超速位置</th> | |
| 37 | + <th width="8%">开始时间</th> | |
| 38 | + <th width="8%">结束时间</th> | |
| 38 | 39 | <th width="8%">持续时间</th> |
| 39 | 40 | <th width="8%">查看轨迹</th> |
| 40 | 41 | <th width="6%">操作</th> |
| ... | ... | @@ -47,11 +48,6 @@ |
| 47 | 48 | <td> |
| 48 | 49 | <select class="form-control" name="nbbm" id="nbbm" style="width: 100px;"></select> |
| 49 | 50 | </td> |
| 50 | - <!-- <td> | |
| 51 | - | |
| 52 | - </td> | |
| 53 | - <td> | |
| 54 | - </td> --> | |
| 55 | 51 | <td> |
| 56 | 52 | <select class="form-control form-filter " name="updown" style="width: 90px;"> |
| 57 | 53 | <option value="">请选择...</option> |
| ... | ... | @@ -60,7 +56,9 @@ |
| 60 | 56 | <option value="-1">无效</option> |
| 61 | 57 | </select> |
| 62 | 58 | </td> |
| 63 | - <td> | |
| 59 | + <td> | |
| 60 | + </td> | |
| 61 | + <td> | |
| 64 | 62 | <input class="form-control" type="date" name="startDate" /> |
| 65 | 63 | </td> |
| 66 | 64 | <td> |
| ... | ... | @@ -114,6 +112,9 @@ |
| 114 | 112 | {{/if}} |
| 115 | 113 | </td> |
| 116 | 114 | <td> |
| 115 | + {{obj.address}} | |
| 116 | + </td> | |
| 117 | + <td> | |
| 117 | 118 | {{obj.timestampDate}} |
| 118 | 119 | </td> |
| 119 | 120 | <td> |
| ... | ... | @@ -144,6 +145,7 @@ |
| 144 | 145 | |
| 145 | 146 | <script> |
| 146 | 147 | $(function(){ |
| 148 | + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} | |
| 147 | 149 | var page = 0, initPagination; |
| 148 | 150 | var icheckOptions = { |
| 149 | 151 | checkboxClass: 'icheckbox_flat-blue', |
| ... | ... | @@ -220,41 +222,55 @@ $(function(){ |
| 220 | 222 | params['page'] = page; |
| 221 | 223 | var i = layer.load(2); |
| 222 | 224 | $get('/nowspeeding/pagequery' ,params, function(data){ |
| 223 | - var bodyHtm = template('speeding_list_temp', {list: data.dataList}); | |
| 224 | - $('#datatable_speeding tbody').html(bodyHtm) | |
| 225 | - .find('.icheck').iCheck(icheckOptions) | |
| 226 | - .on('ifChanged', iCheckChange); | |
| 227 | - if(pagination && data.dataList.length > 0){ | |
| 228 | - //重新分页 | |
| 229 | - initPagination = true; | |
| 230 | - showPagination(data); | |
| 231 | - } | |
| 232 | - layer.close(i); | |
| 233 | - $(".lookTrajectory").click(function(){ | |
| 234 | - var vehicle = $(this).data('vehicle'); | |
| 235 | - var startDate = $(this).data('startdate'); | |
| 236 | - var endDate = $(this).data('enddate'); | |
| 237 | - var lon = $(this).data('lon'); | |
| 238 | - var lat = $(this).data('lat'); | |
| 239 | - var endLon = $(this).data('endlon'); | |
| 240 | - var endLat = $(this).data('endlat'); | |
| 241 | - var lineid = $(this).data('lineid'); | |
| 242 | - var upDown = $(this).data('updown'); | |
| 243 | - var storage = window.localStorage; | |
| 244 | - storage.setItem("zbhAndDate",vehicle+","+startDate+","+endDate+","+lon+","+lat+","+endLon+","+endLat+","+lineid+","+upDown); | |
| 245 | - $.get('/pages/excep/speedingMap.html?',function (result) { | |
| 246 | - layer.open({ | |
| 247 | - type: 1, | |
| 248 | - title:'<i class="uk-icon-play-circle"></i>轨迹回放', | |
| 249 | - shadeClose: true, | |
| 250 | - shade: true, | |
| 251 | - scrollbar: false, | |
| 252 | - maxmin: false, //开启最大化最小化按钮 | |
| 253 | - area: ['100%', '100%'], | |
| 254 | - content:result,//内容 | |
| 255 | - }); | |
| 256 | - }); | |
| 257 | - }) | |
| 225 | + var listResult = data.dataList; | |
| 226 | + var index=0; | |
| 227 | + (function(){ | |
| 228 | + var f = arguments.callee; | |
| 229 | + if(index >= listResult.length){ | |
| 230 | + var bodyHtm = template('speeding_list_temp', {list:listResult}); | |
| 231 | + $('#datatable_speeding tbody').html(bodyHtm).find('.icheck').iCheck(icheckOptions).on('ifChanged', iCheckChange); | |
| 232 | + if(pagination && data.dataList.length > 0){ | |
| 233 | + //重新分页 | |
| 234 | + initPagination = true; | |
| 235 | + showPagination(data); | |
| 236 | + } | |
| 237 | + layer.close(i); | |
| 238 | + $(".lookTrajectory").click(function(){ | |
| 239 | + var vehicle = $(this).data('vehicle'); | |
| 240 | + var startDate = $(this).data('startdate'); | |
| 241 | + var endDate = $(this).data('enddate'); | |
| 242 | + var lon = $(this).data('lon'); | |
| 243 | + var lat = $(this).data('lat'); | |
| 244 | + var endLon = $(this).data('endlon'); | |
| 245 | + var endLat = $(this).data('endlat'); | |
| 246 | + var lineid = $(this).data('lineid'); | |
| 247 | + var upDown = $(this).data('updown'); | |
| 248 | + var storage = window.localStorage; | |
| 249 | + storage.setItem("zbhAndDate",vehicle+","+startDate+","+endDate+","+lon+","+lat+","+endLon+","+endLat+","+lineid+","+upDown); | |
| 250 | + $.get('/pages/excep/speedingMap.html?',function (result) { | |
| 251 | + layer.open({ | |
| 252 | + type: 1, | |
| 253 | + title:'<i class="uk-icon-play-circle"></i>轨迹回放', | |
| 254 | + shadeClose: true, | |
| 255 | + shade: true, | |
| 256 | + scrollbar: false, | |
| 257 | + maxmin: false, //开启最大化最小化按钮 | |
| 258 | + area: ['100%', '100%'], | |
| 259 | + content:result,//内容 | |
| 260 | + }); | |
| 261 | + }); | |
| 262 | + }) | |
| 263 | + return; | |
| 264 | + } | |
| 265 | + var result = listResult[index]; | |
| 266 | + new BMap.Geocoder().getLocation(new BMap.Point(result.lon,result.lat), function(rs){ | |
| 267 | + var addComp = rs.addressComponents; | |
| 268 | + result.address = addComp.district+addComp.street+addComp.streetNumber; | |
| 269 | + f(); | |
| 270 | + index++; | |
| 271 | + }); | |
| 272 | + })(); | |
| 273 | + console.log(listResult); | |
| 258 | 274 | }); |
| 259 | 275 | } |
| 260 | 276 | ... | ... |