| | |
| | | <jsp:include page="nav.jsp" flush="true"/>
|
| | | <!-- 主体内容 -->
|
| | | <div class="layui-page-container">
|
| | | <!-- 条件筛选 -->
|
| | | <div class="layui-page-filter">
|
| | | <div class="page-filter-header layui-page-filter-fweight"><s:text name="Dev_connect_info_query"/></div> <!-- 设备连接信息查询 -->
|
| | | <div class="page-filter-content">
|
| | | <table>
|
| | | <tr class="layui-page-filter-tbl-header layui-page-filter-fweight">
|
| | | <td>省</td> <!-- 省 -->
|
| | | <td>市</td> <!-- 市 -->
|
| | | <td>区/县</td> <!-- 市 -->
|
| | | <td><s:text name="Computer_name"/></td> <!-- 机房名称 -->
|
| | | </tr>
|
| | | <tr>
|
| | | <td>
|
| | | <div class="layui-form" lay-filter="provinceFilter">
|
| | | <div class="layui-form-item">
|
| | | <div class="layui-input-block">
|
| | | <select name="province" id="province" lay-filter="province">
|
| | | <option value="">请选择省</option>
|
| | | </select>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </td>
|
| | | <td>
|
| | | <div class="layui-form" lay-filter="cityFilter">
|
| | | <div class="layui-form-item">
|
| | | <div class="layui-input-block">
|
| | | <select name="city" id="city" lay-filter="city">
|
| | | <option value="">请选择市/区</option>
|
| | | </select>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </td>
|
| | | |
| | | <td>
|
| | | <div class="layui-form" lay-filter="countyFilter">
|
| | | <div class="layui-form-item">
|
| | | <div class="layui-input-block">
|
| | | <select name="county" id="county" lay-filter="county">
|
| | | <option value="">请选择区/县</option>
|
| | | </select>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </td>
|
| | | |
| | | <td>
|
| | | <div class="layui-form" lay-filter="homeFilter">
|
| | | <div class="layui-form-item">
|
| | | <div class="layui-input-block">
|
| | | <select name="home" id="home" lay-filter="home">
|
| | | <option value="">请选择机房</option>
|
| | | </select>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </td>
|
| | | </tr>
|
| | | </table>
|
| | | </div>
|
| | | </div>
|
| | | <!-- 页面主题内容 -->
|
| | | <div class="layui-page-content" style="position: relative;">
|
| | | <div class="tbl-filter" lay-filter="tblFilter" style="position: absolute;z-index: 891;top: 8px; left: 15px">
|
| | | <div class="layui-form layui-form-pane" lay-filter="tblFilter">
|
| | | 设备ID:
|
| | | <div class="layui-inline">
|
| | | <input class="layui-input" name="id" id="devId" autocomplete="off">
|
| | | </div>
|
| | | <button class="layui-btn layui-btn-sm layui-btn-normal" id="searchById"><i class="fa fa-search"></i>搜索</button>
|
| | | </div>
|
| | | </div>
|
| | | <!-- 表格内容 -->
|
| | | <table id="pageTbl" lay-filter="pageTbl"></table>
|
| | | </div>
|
| | |
| | | var form = layui.form; // 获取表单模块
|
| | | var layer = layui.layer; // 获取弹出框模块
|
| | | var element = layui.element; // 获取元素操作模块
|
| | | |
| | | var isNewLoad = true;
|
| | | var pre_province = getQueryString('province');
|
| | | // 查询省下拉框
|
| | | searchProvince();
|
| | | // 查询省
|
| | | var filterLoad = layer.load();
|
| | | function searchProvince() {
|
| | | // 请求后台查询
|
| | | $.ajax({
|
| | | type:'post',
|
| | | async:true,
|
| | | url: 'User_battgroup_baojigroup_battgroupAction!serchStationName1InGroup',
|
| | | data: null,
|
| | | dataType: 'json',
|
| | | success:function(result) {
|
| | | var rs = JSON.parse(result.result);
|
| | | var list = []; // option结果集
|
| | | var ele = $('#province'); // 目标select
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data;
|
| | | list.push(getLayuiSelect('请选择省/直辖市', '', {}, undefined));
|
| | | // 遍历查询结果
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | var _tmp = getLayuiSelect(_data, _data, {}, {});
|
| | | if(pre_province == _data && isNewLoad){
|
| | | _tmp = getLayuiSelect(_data, _data, {}, {},true);
|
| | | }
|
| | | list.push(_tmp);
|
| | | }
|
| | | }else {
|
| | | list.push(getLayuiSelect('暂无省/直辖市', '', {}, undefined));
|
| | | }
|
| | | |
| | | // 根据对象数组生成下拉列表
|
| | | createLayuiSelect(ele, list);
|
| | | form.render('select', 'provinceFilter');
|
| | | |
| | | // 查询市
|
| | | searchCity();
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | // 切换省-市
|
| | | form.on('select(province)', function(data) {
|
| | | // 查询市
|
| | | searchCity(true);
|
| | | });
|
| | | |
| | | // 查询市
|
| | | function searchCity(isLoad) {
|
| | | // 构造查询条件
|
| | | var tmp = {
|
| | | StationName1: $("#province").val()
|
| | | };
|
| | | var pre_city = getQueryString('city');
|
| | | |
| | | // 是否添加等待
|
| | | if(isLoad) {
|
| | | filterLoad = layer.load();
|
| | | }
|
| | | // 根据构造条件查询内容
|
| | | $.ajax({
|
| | | type: 'post',
|
| | | async: true,
|
| | | url: 'BattInfAction!serchStationName2',
|
| | | dataType: 'json',
|
| | | data: "json = "+JSON.stringify(tmp),
|
| | | success: function(result) {
|
| | | var rs = JSON.parse(result.result);
|
| | | var list = []; // option结果集
|
| | | var ele = $('#city'); // 目标select
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data;
|
| | | list.push(getLayuiSelect('请选择市/区', '', {}, undefined));
|
| | | // 遍历查询结果
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | var _tmp = getLayuiSelect(_data.StationName2, _data.StationName2, {}, _data);
|
| | | if(pre_city == _data.StationName2 && isNewLoad){
|
| | | _tmp = getLayuiSelect(_data.StationName2, _data.StationName2, {}, _data,true);
|
| | | }
|
| | | list.push(_tmp);
|
| | | }
|
| | | }else {
|
| | | list.push(getLayuiSelect('暂无市/区', '', {}, undefined));
|
| | | }
|
| | | |
| | | // 根据对象数组生成下拉列表
|
| | | createLayuiSelect(ele, list);
|
| | | form.render('select', 'cityFilter');
|
| | | |
| | | // 查询区县
|
| | | searchCounty();
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | // 切换市-区县
|
| | | form.on('select(city)', function(data) {
|
| | | // 查询区县
|
| | | searchCounty(true);
|
| | | });
|
| | | |
| | | |
| | | // 查询区/县
|
| | | function searchCounty(isLoad) {
|
| | | // 构造查询条件
|
| | | var tmp = {
|
| | | StationName1: $("#province").val(),
|
| | | StationName2: $("#city").val()
|
| | | };
|
| | | // 是否添加等待
|
| | | if(isLoad) {
|
| | | filterLoad = layer.load();
|
| | | }
|
| | | var pre_county = getQueryString('county');
|
| | | // 根据构造条件查询内容
|
| | | $.ajax({
|
| | | type: 'post',
|
| | | async: true,
|
| | | url: 'BattInfAction!serchStationName5',
|
| | | dataType: 'json',
|
| | | data: "json = "+JSON.stringify(tmp),
|
| | | success: function(result) {
|
| | | var rs = JSON.parse(result.result);
|
| | | //console.info(rs);
|
| | | var list = []; // option结果集
|
| | | var ele = $('#county'); // 目标select
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data;
|
| | | list.push(getLayuiSelect('请选择区/县', '', {}, undefined));
|
| | | // 遍历查询结果
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | var _tmp = getLayuiSelect(_data.StationName5, _data.StationName5, {}, _data);
|
| | | if(pre_county == _data.StationName5 && isNewLoad){
|
| | | _tmp = getLayuiSelect(_data.StationName5, _data.StationName5, {}, _data,true);
|
| | | }
|
| | | //console.info(_tmp);
|
| | | list.push(_tmp);
|
| | | }
|
| | | }else {
|
| | | list.push(getLayuiSelect('暂无区/县', '', {}, undefined));
|
| | | }
|
| | | |
| | | // 根据对象数组生成下拉列表
|
| | | createLayuiSelect(ele, list);
|
| | | form.render('select', 'countyFilter');
|
| | | |
| | | // 查询机房
|
| | | searchHome();
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | // 切换市-区县
|
| | | form.on('select(county)', function(data) {
|
| | | // 查询区县
|
| | | searchHome(true);
|
| | | });
|
| | | |
| | | // 查询机房
|
| | | function searchHome(isLoad) {
|
| | | // 构造查询条件
|
| | | var tmp = {
|
| | | StationName1:$("#province").val(),
|
| | | StationName2:$("#city").val(),
|
| | | StationName5:$("#county").val(),
|
| | | };
|
| | | var pre_home = getQueryString('home');
|
| | | var auto_seach = false;
|
| | | // 是否添加等待
|
| | | if(isLoad) {
|
| | | filterLoad = layer.load();
|
| | | }
|
| | | // 根据构造条件查询内容
|
| | | $.ajax({
|
| | | type: 'post',
|
| | | async: true,
|
| | | url: 'BattInfAction!serchStationName3',
|
| | | dataType: 'json',
|
| | | data: "json = "+JSON.stringify(tmp),
|
| | | success: function(result) {
|
| | | var rs = JSON.parse(result.result);
|
| | | var list = []; // option结果集
|
| | | var ele = $('#home'); // 目标select
|
| | | if(rs.code == 1) {
|
| | | var data = rs.data;
|
| | | list.push(getLayuiSelect('请选择机房', '', {StationId: '', dev_id: ''}, undefined));
|
| | | // 遍历查询结果
|
| | | for(var i=0; i<data.length; i++) {
|
| | | var _data = data[i];
|
| | | var _attr = {
|
| | | StationId: _data.StationId,
|
| | | dev_id: _data.FBSDeviceId
|
| | | };
|
| | | var _tmp = getLayuiSelect(_data.StationName, _data.StationName3, _attr, _data);
|
| | | if(pre_home == _data.StationName && isNewLoad){
|
| | | _tmp = getLayuiSelect(_data.StationName, _data.StationName3, _attr, _data,true);
|
| | | auto_seach = true;
|
| | | }
|
| | | list.push(_tmp);
|
| | | }
|
| | | }else {
|
| | | list.push(getLayuiSelect('暂无机房', '', {}, undefined));
|
| | | }
|
| | | // 根据对象数组生成下拉列表
|
| | | createLayuiSelect(ele, list);
|
| | | form.render('select', 'homeFilter');
|
| | | isNewLoad = false;
|
| | | layer.close(filterLoad);
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | // 表格模块
|
| | | var tOptions = {
|
| | | elem: '#pageTbl'
|
| | | ,toolbar: false
|
| | | ,toolbar: true
|
| | | ,defaultToolbar: []
|
| | | ,cellMinWidth: 80
|
| | | ,cols: [[
|
| | | {field: 'Staionanme', title: '机房名称', align: 'center', width: 450}
|
| | |
| | | ,{field:'dev_comm_runtime', title: '设备运行时间', align: 'center'}
|
| | | ,{field:'break_type_txt', title:'连接状态', align:'center', templet: '#breakTypeTpl', width: 150}
|
| | | ]]
|
| | | ,data:[
|
| | | {'break_type': 1}
|
| | | ]
|
| | | ,data:[]
|
| | | ,limit: 1000
|
| | | ,page: false
|
| | | ,height: 'full-290'
|
| | | ,height: 'full-190'
|
| | | };
|
| | |
|
| | | // 生成表格数据
|
| | |
| | | for(var i=0;i<model.data.length;i++){
|
| | | var _data = model.data[i];
|
| | | var _tmp = {};
|
| | | _tmp.Staionanme = _data.stationName;
|
| | | // console.log(_data);
|
| | | _tmp.Staionanme = _data.stationName?_data.stationName:'——';
|
| | | _tmp.dev_id = _data.dev_id;
|
| | | _tmp.battgroup_id1 = _data.battgroup_id1;
|
| | | _tmp.battgroup_id2 = _data.battgroup_id2;
|
| | |
| | |
|
| | | // 构造查询条件
|
| | | function createSearchParam() {
|
| | | var sid = $('#home').find('option:selected').attr('stationid')?$('#home').find('option:selected').attr('stationid'): 0;
|
| | | var temp = {
|
| | | StationId: sid,
|
| | | StationName1:$('#province').attr('value'),
|
| | | StationName2:$('#city').attr('value'),
|
| | | StationName5:$('#county').attr('value'),
|
| | | page: Page.getPage(),
|
| | | FBSDeviceId: 0
|
| | | ,page: Page.getPage()
|
| | | };
|
| | | // console.log(temp);
|
| | | return temp;
|
| | | }
|
| | | |
| | | // 点击上方的设备id搜索
|
| | | $('#searchById').click(function() {
|
| | | var dev_id = $('#devId').val();
|
| | | |
| | | // 判断数据合法新
|
| | | if(!isNumber(dev_id)) {
|
| | | layer.msg('存在违法字符串');
|
| | | }else{
|
| | | dev_id = dev_id.length==0?0:dev_id;
|
| | | Page.setCurr(1);
|
| | | // 构造查询条件
|
| | | var temp = {
|
| | | FBSDeviceId: dev_id
|
| | | ,page: Page.getPage()
|
| | | };
|
| | | search(temp, true);
|
| | | } |
| | | });
|
| | | |
| | |
|
| | | //点击查询按钮
|
| | | $('#paging .search').click(function(){
|
| | |
| | | var value=$('#number').val();
|
| | | //当输入的数大于0时
|
| | | if(value>0){
|
| | | if(value != Page.pageSize){
|
| | | if(value != Page.size){
|
| | | Page.setSize(parseInt(value));
|
| | | Page.setCurr(1);
|
| | | }
|