Merge branch 'dev_lxw' of https://whyclxw1@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw
New file |
| | |
| | | <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
| | | <%
|
| | | String path = request.getContextPath();
|
| | | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
| | | %>
|
| | | <%@ taglib uri="/struts-tags" prefix="s" %>
|
| | | <!DOCTYPE HTML>
|
| | | <html>
|
| | | <head>
|
| | | <base href="<%=basePath%>">
|
| | | <meta charset="UTF-8">
|
| | | <meta name="viewport" content="width=device-width, initial-scale=1">
|
| | | <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">
|
| | | <title>电池信息配置</title>
|
| | | <link rel="stylesheet" type="text/css" href="pages/css/base.css">
|
| | | <link rel="stylesheet" type="text/css" href="jqueryui/jquery-ui.css">
|
| | | <link rel="stylesheet" type="text/css" href="src/css/layui.css">
|
| | | <link rel="stylesheet" type="text/css" href="pages/css/mylayui.css">
|
| | | <style>
|
| | | .dataTypeCont {
|
| | | width: 160px;
|
| | | text-align: center;
|
| | | }
|
| | | .dataTypeCont .layui-form-switch {
|
| | | min-width: 70px;
|
| | | margin-top: 4px;
|
| | | }
|
| | | </style>
|
| | | </head>
|
| | | <body>
|
| | | <!--头部内容开始-->
|
| | | <jsp:include page="Top.jsp" flush="true"/>
|
| | | <!--头部内容结束-->
|
| | | <!--导航开始-->
|
| | | <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">电池信息配置</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;">
|
| | | <!-- 表格内容 -->
|
| | | <table id="pageTbl" lay-filter="pageTbl"></table>
|
| | | </div>
|
| | | <div class="data-footer">
|
| | | <!-- 分页内容 -->
|
| | | <div id="paging">
|
| | | <a href="javascript:" class="search"><s:text name="Search"/></a> <!-- 查询 -->
|
| | | <a href="javascript:" id="export_table"><s:text name="Export"/></a> <!-- 导出 -->
|
| | | <span id="current">1/1</span>
|
| | | <span><s:text name="Each_page"/><input type="text" id="number" value="10"/><s:text name="Item"/></span>
|
| | | <s:text name="Total_data"/><!-- 数据总量 --><span id="total">0</span>
|
| | | <a href="javascript:" id="page_home"><s:text name="HomePage"/></a> |
| | | <a href="javascript:" id="page_pre"><s:text name="Page_Up"/></a>
|
| | | <a href="javascript:" id="page_next_p"><s:text name="Page_Down"/></a>
|
| | | <a href="javascript:" id="page_last"><s:text name="End_Page"/></a>
|
| | | <span id="cont">
|
| | | <s:text name="Goto"/><input type="text" id="page_num" value="1"/>
|
| | | <a href="javascript:" id="page_go"><s:text name="Jump"/></a>
|
| | | </span>
|
| | | <a href="javascript:;" class="new-item"><s:text name="Newly_build"/><!-- 新建 --></a>
|
| | | <a href="javascript:;" class="reflush"><s:text name="Refresh"/><!-- 刷新 --></a>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <!-- 存储iframe -->
|
| | | <div id="iframeEdit"></div>
|
| | | <!-- 关闭页面中iframe弹出层 -->
|
| | | <div id="iframeClose"></div>
|
| | | <script type="text/html" id="battGrouptools">
|
| | | <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
| | | </script>
|
| | | <script type="text/html" id="produceTime">
|
| | | {{= d.BattProductDate.substr(0,10)}}
|
| | | </script>
|
| | | <script type="text/html" id="useTime">
|
| | | {{= d.BattInUseDate.substr(0,10)}}
|
| | | </script>
|
| | | <script type="text/html" id="isInstall">
|
| | | {{# if(d.Station_install) { }}
|
| | | <button class="layui-btn layui-btn-normal layui-btn-xs">已安装</button>
|
| | | {{# }else { }}
|
| | | <button class="layui-btn layui-btn-disabled layui-btn-xs">未安装</button>
|
| | | {{# } }}
|
| | | </script>
|
| | | |
| | | <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
|
| | | <script type="text/javascript" src="js/echarts.js"></script>
|
| | | <script type="text/javascript" src="jqueryui/jquery-ui.min.js"></script>
|
| | | <script type="text/javascript" src="src/layui.js"></script>
|
| | | <script type="text/javascript" src="pages/js/mylayui.js"></script>
|
| | | <script type="text/javascript">
|
| | | layui.use(['form', 'table', 'layer', 'element'], function() {
|
| | | var table = layui.table; // 获取表格模块
|
| | | var form = layui.form; // 获取表单模块
|
| | | var layer = layui.layer; // 获取弹出框模块
|
| | | var element = layui.element; // 获取元素操作模块
|
| | | |
| | | var iframePopup; // 页面中iframe的弹出层
|
| | | $('#iframeClose').click(function() {
|
| | | layer.close(iframePopup);
|
| | | });
|
| | | |
| | | var Page = new TblPage();
|
| | | Page.set(1, 0, 20); // 设置分页初始配置项
|
| | | setPageVal(Page);
|
| | | |
| | | // 设置检测文件名弹出框的content
|
| | | var addGroupContent = '<div style="width:300px; height: 40px;"><div style="margin-top: 20px;margin-left: 8px; margin-right: 8px; text-algin: center;">'+
|
| | | '<span>新建 </span>'+
|
| | | '<select id="addGroupnum" style="width: 190px;height: 26px; border: 1px solid #ccc">'+
|
| | | '<option value="1">1</option>'+
|
| | | '<option value="2">2</option>'+
|
| | | '<option value="3">3</option>'+
|
| | | '<option value="4">4</option>'+
|
| | | '</select>个电池组'+
|
| | | '<br><br>'+
|
| | | '</div></div>';
|
| | | |
| | | 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.StationName, _attr, _data);
|
| | | if(pre_home == _data.StationName && isNewLoad){
|
| | | _tmp = getLayuiSelect(_data.StationName, _data.StationName, _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);
|
| | | |
| | | // 初始化分页信息
|
| | | Page.setCurr(1);
|
| | | |
| | | // 查询后台数据
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | // 切换机房
|
| | | form.on('select(home)', function(data) {
|
| | | // 初始化分页信息
|
| | | Page.setCurr(1);
|
| | | // 查询后台数据
|
| | | search(createSearchParam(), true);
|
| | | });
|
| | | |
| | | |
| | | // 表格模块
|
| | | var tOptions = {
|
| | | elem: '#pageTbl'
|
| | | ,toolbar: false
|
| | | ,cellMinWidth: 80
|
| | | ,cols: [[
|
| | | {field:'StationId', title:'机房编号', align:'center', width: 120}
|
| | | ,{field:'StationName1', title:'省', align:'center', width: 100}
|
| | | ,{field:'StationName2', title:'市', align:'center', width: 100}
|
| | | ,{field:'StationName5', title:'区县', align:'center', width: 100}
|
| | | ,{field:'StationName3', title:'机房名称', align:'center', width: 360}
|
| | | ,{field:'StationName4', title:'设备名称', align:'center', width: 150}
|
| | | ,{field:'StationIp', title:'机房ip', align:'center', width: 160}
|
| | | ,{field: 'FBSDeviceId', title: 'FBS设备ID(重要)', align: 'center', width: 160}
|
| | | ,{field:'FbsDeviceIp', title:'FBS设备IP(重要)', align:'center', width: 160}
|
| | | ,{field:'FbsDeviceIp_YM', title:'子网掩码', align:'center', width: 160}
|
| | | ,{field:'FbsDeviceIp_WG', title:'网关', align:'center', width: 160}
|
| | | ,{field:'FBSDeviceName', title:'FBS设备名称', align:'center', width: 160}
|
| | | ,{field:'GroupIndexInFBSDevice', title:'FBS设备索引', align:'center', width: 160}
|
| | | ,{field:'BattGroupId', title:'电池组ID', align:'center', width: 160}
|
| | | ,{field:'BattGroupNum', title:'机房内电池组编号', align:'center', width: 160}
|
| | | ,{field:'BattGroupName', title:'电池组名称', align:'center', width: 160}
|
| | | ,{field:'FloatVolLevel', title:'浮充电压阀值', align:'center', width: 160}
|
| | | ,{field:'OfflineVolLevel', title:'离线电压阀值', align:'center', width: 160}
|
| | | ,{field:'BattFloatCurrent', title:'浮充阀值', align:'center', width: 100}
|
| | | ,{field:'MonCount', title:'单体数量', align:'center', width: 100}
|
| | | ,{field:'MonCapStd', title:'标称容量', align:'center', width: 100}
|
| | | ,{field:'MonVolStd', title:'标称单体电压', align:'center', width: 140}
|
| | | ,{field:'MonResStd', title:'标称单体内阻', align:'center', width: 140}
|
| | | ,{field:'MonSerStd', title:'标称单体电导', align:'center', width: 140}
|
| | | ,{field:'MonVolLowToAvg', title:'单体电压次低偏移量', align:'center', width: 140}
|
| | | ,{field:'Load_curr', title:'负载电流', align:'center', width: 140}
|
| | | ,{field:'DisCurrMax', title:'最大核容电流', align:'center', width: 140}
|
| | | ,{field:'station_phone', title:'基站手机号码', align:'center', width: 140}
|
| | | ,{field:'BattProducer', title:'电池品牌', align:'center', width: 140}
|
| | | ,{field:'BattModel', title:'电池型号', align:'center', width: 260}
|
| | | ,{field:'productDate', title:'电池生产日期', templet: '#produceTime', align:'center', width: 140}
|
| | | ,{field:'useDate', title:'投入使用日期', templet: '#useTime', align:'center', width: 140}
|
| | | ,{field:'isInstall', title:'安装状态', templet: '#isInstall', align:'center', width: 140}
|
| | | ,{field:'install_user', title:'设备安装人员', align:'center', width: 260}
|
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#battGrouptools', width:150}
|
| | | ]]
|
| | | ,data:[]
|
| | | ,limit: 10000
|
| | | ,page: false
|
| | | ,height: 'full-290'
|
| | | };
|
| | | |
| | | // 生成表格数据
|
| | | table.render(tOptions);
|
| | | |
| | | // 点击表格中的工具按钮
|
| | | table.on('tool(pageTbl)', function(obj){
|
| | | //console.log(obj);
|
| | | switch(obj.event) {
|
| | | case 'edit':
|
| | | editBattGroup(obj);
|
| | | break;
|
| | | case 'del':
|
| | | delBattGroup(obj);
|
| | | break;
|
| | | default:
|
| | | layer.msg('功能开发中...');
|
| | | break;
|
| | | };
|
| | | });
|
| | | |
| | | // 编辑电池组信息
|
| | | function editBattGroup(obj) {
|
| | | $('#iframeEdit').data('data', obj.data);
|
| | | iframePopup = layer.open({
|
| | | type: 2
|
| | | ,area:['1200px', '520px']
|
| | | ,resize: false
|
| | | ,content: 'iframe/batt-info-edit.html'
|
| | | });
|
| | | }
|
| | | |
| | | // 删除电池组
|
| | | function delBattGroup(obj) {
|
| | | //console.log(obj);
|
| | | var data = obj.data;
|
| | | var content = '是否确认删除<span style="font-weight: bold; color: #FF5722">'+data.StationName3+'</span>'
|
| | | layer.confirm(content,{
|
| | | icon: 2
|
| | | ,title: '提示'
|
| | | }, function(index) {
|
| | | // 关闭确认框
|
| | | layer.close(index);
|
| | | var province = data.StationName1; // 省
|
| | | var city = data.StationName2; // 市
|
| | | var home = data.StationName3; // 机房名称
|
| | | var bts = data.StationName4; // 设备名称
|
| | | data.StationName = province+'-'+city+'-'+home+'-'+bts;
|
| | | var temp = [data];
|
| | | delBatt(temp);
|
| | | });
|
| | | }
|
| | | |
| | | //删除多个电池组
|
| | | function delBatt(temp){
|
| | | var load = layer.load(1);
|
| | | $.ajax({
|
| | | type: "post", |
| | | url: "BattInfAction!delete", |
| | | async:true, |
| | | dataType:'text',
|
| | | data:"json="+JSON.stringify(temp), |
| | | success: function(data){ |
| | | data = eval('('+data+')');
|
| | | var model = eval('('+data.result+')');
|
| | | //console.info(model);
|
| | | if(model.code ==1){
|
| | | layer.msg('删除成功!');
|
| | | $('#paging .search').click();
|
| | | }else{
|
| | | layer.msg('删除失败!');
|
| | | }
|
| | | },
|
| | | error:function(){
|
| | | layer.msg('删除失败!');
|
| | | },
|
| | | complete: function() {
|
| | | layer.close(load);
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | var defaultData = {
|
| | | StationId: '4011100'
|
| | | ,StationName1: '湖北省'
|
| | | ,StationName2: '武汉'
|
| | | ,StationName5: '东西湖区'
|
| | | ,StationName3: '实验室机房'
|
| | | ,StationName4: 'BTS设备'
|
| | | ,StationIp: '127.0.0.1'
|
| | | ,FBSDeviceId: '960000001'
|
| | | ,FbsDeviceIp: '127.0.0.1'
|
| | | ,FbsDeviceIp_YM: '255.255.255.0'
|
| | | ,FbsDeviceIp_WG: '127.0.0.1'
|
| | | ,FBSDeviceName: '设备名称'
|
| | | ,GroupIndexInFBSDevice: 1 |
| | | ,BattGroupId: 1000005
|
| | | ,BattGroupNum: 2
|
| | | ,BattGroupName: '电池组1'
|
| | | ,FloatVolLevel: 54
|
| | | ,OfflineVolLevel: 42.9 |
| | | ,BattFloatCurrent: 10
|
| | | ,MonCount: 24
|
| | | ,MonCapStd: 300
|
| | | ,MonVolStd: 2
|
| | | ,MonResStd: 0.2
|
| | | ,MonSerStd: 5000
|
| | | ,MonVolLowToAvg: 0.05 |
| | | ,Load_curr: 15
|
| | | ,DisCurrMax: '0'
|
| | | ,station_phone: 12345678912
|
| | | ,BattProducer: ''
|
| | | ,BattModel: ''
|
| | | ,productDate: '2018-09-18 00:00:00'
|
| | | ,useDate: '2018-09-18 00:00:00'
|
| | | ,install_user: ''
|
| | | };
|
| | | |
| | | // 点击新建按钮
|
| | | $('#paging .new-item').click(function() {
|
| | | var len = tOptions.data.length;
|
| | | var _rsData = defaultData;
|
| | | if(len) {
|
| | | _rsData = tOptions.data[len-1];
|
| | | }
|
| | | |
| | | // 打开面板设置新建电池组个数
|
| | | layer.open({
|
| | | type: 1
|
| | | ,title: '选择新建电池组个数'
|
| | | ,content: addGroupContent
|
| | | ,fixed: true
|
| | | ,resize: false
|
| | | ,btn:['确定', '取消']
|
| | | ,yes: function(index) {
|
| | | var groupNum = $('#addGroupnum').val();
|
| | | layer.close(index);
|
| | | // 生成数组
|
| | | var _arr = [];
|
| | | for(var i=0; i<groupNum; i++) {
|
| | | _arr.push(i+1);
|
| | | }
|
| | | |
| | | _rsData.addGroupNum = _arr;
|
| | | $('#iframeEdit').data('data', _rsData);
|
| | | |
| | | iframePopup = layer.open({
|
| | | type: 2
|
| | | ,area:['1200px', '520px']
|
| | | ,resize: false
|
| | | ,content: 'iframe/batt-info-add.html'
|
| | | });
|
| | | }
|
| | | });
|
| | | });
|
| | | |
| | | |
| | | // 查询电池组信息
|
| | | function search(temp, newLoad) {
|
| | | var load;
|
| | | if(newLoad) {
|
| | | load = layer.load(1)
|
| | | }
|
| | | //console.log(temp);
|
| | | $.ajax({
|
| | | type: "post", |
| | | url: "BattInfAction!searchInform", |
| | | async:true, |
| | | dataType:'text',
|
| | | data:"json="+JSON.stringify(temp), |
| | | success: function(res){ |
| | | var rs = eval('('+res+')');
|
| | | var model = eval('('+rs.result+')');
|
| | | if(model.code ==1){
|
| | | var data = model.data;
|
| | | tOptions.data = data;
|
| | | for(var i=0; i<data.length; i++) {
|
| | | Page.setAll(data[i].num);
|
| | | }
|
| | | |
| | | // 生成表格数据
|
| | | table.render(tOptions);
|
| | | }else{
|
| | | layer.msg("未查询到数据");
|
| | | Page.setAll(0);
|
| | | Page.setCurr(1);
|
| | | }
|
| | | |
| | | // 设置分页信息
|
| | | setPageVal(Page);
|
| | | },
|
| | | error:function(){
|
| | | layer.msg("查询失败");
|
| | | layer.close(load);
|
| | | },
|
| | | complete: function() {
|
| | | layer.close(load);
|
| | | } |
| | | });
|
| | | }
|
| | | |
| | | // 构造查询条件
|
| | | function createSearchParam() {
|
| | | var homename = $('#home').val()?$('#home').val(): '';
|
| | | var temp = {
|
| | | binf:{
|
| | | StationName1:$('#province').val(), // 省
|
| | | StationName2:$('#city').val(), // 市
|
| | | StationName5:$('#county').val(), // 区/县
|
| | | StationName: homename // 机房名称
|
| | | }
|
| | | ,page: Page.getPage()
|
| | | };
|
| | | |
| | | return temp;
|
| | | |
| | | |
| | | }
|
| | | |
| | | // 点击查询
|
| | | $('#paging .search').click(function() {
|
| | | search(createSearchParam(), true);
|
| | | });
|
| | | |
| | | // 点击刷新
|
| | | $('#paging .reflush').click(function() {
|
| | | search(createSearchParam(), true);
|
| | | });
|
| | | |
| | | |
| | | //首页
|
| | | $('#page_home').click(function(){
|
| | | alert(123);
|
| | | if(Page != undefined){
|
| | | if(Page.curr != 1){
|
| | | Page.setCurr(1);
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | } |
| | | });
|
| | | |
| | | //点击上一页
|
| | | $("#page_pre").click(function(){
|
| | | if(Page != undefined){
|
| | | if(Page.curr > 1){
|
| | | Page.setCurr(Page.curr-1);
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | //点击下一页
|
| | | $("#page_next_p").click(function(){ |
| | | if(Page != undefined){
|
| | | if(Page.num > Page.curr){
|
| | | Page.setCurr(Page.curr+1);
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | //尾页
|
| | | $('#page_last').click(function(){
|
| | | if(Page != undefined){
|
| | | if(Page.pageCurr < Page.num){
|
| | | Page.setCurr(Page.num);
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | //设置每页行数
|
| | | $('#number').blur(function(){
|
| | | var value=$('#number').val();
|
| | | //当输入的数大于0时
|
| | | if(value>0){
|
| | | if(value != Page.pageSize){
|
| | | Page.setSize(parseInt(value));
|
| | | Page.setCurr(1);
|
| | | }
|
| | | }else{
|
| | | //当输入非法数字时
|
| | | alert("请输入合法的数字"); /* 请输入合法的整数 */
|
| | | $('#number').val(Page.size); |
| | | }
|
| | | });
|
| | | |
| | | //点击跳转
|
| | | $('#page_go').click(function(){
|
| | | var tarpage=$('#page_num').attr('value');
|
| | | if(tarpage > Page.num){
|
| | | Page.setCurr(Page.num);
|
| | | search(createSearchParam(), true);
|
| | | }else if(tarpage > 0 && tarpage!= Page.curr){
|
| | | Page.setCurr(parseInt(tarpage));
|
| | | search(createSearchParam(), true);
|
| | | }
|
| | | |
| | | });
|
| | | |
| | | // 设置页面Page
|
| | | function setPageVal(page) {
|
| | | $('#current').text(page.curr+'/'+page.num);
|
| | | $('#total').text(page.all);
|
| | | $('#number').val(page.size);
|
| | | }
|
| | | |
| | | });
|
| | | </script>
|
| | | </body>
|
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html>
|
| | | <html lang="en">
|
| | | <head>
|
| | | <meta charset="UTF-8">
|
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| | | <meta http-equiv="X-UA-Compatible" content="ie=edge">
|
| | | <title>修改电池信息</title>
|
| | | <link rel="stylesheet" href="../src/css/layui.css">
|
| | | <style>
|
| | | .layui-form-pane .layui-form-label {
|
| | | width: 130px;
|
| | | }
|
| | | .layui-form-pane .layui-input-block {
|
| | | margin-left: 130px;
|
| | | }
|
| | | .red {
|
| | | font-size: 20px;
|
| | | color: #FF5722;
|
| | | }
|
| | | </style>
|
| | | </head>
|
| | | <body>
|
| | | <div class="layui-fluid">
|
| | | <div style="height: 8px;"></div>
|
| | | <div class="layui-form layui-form-pane" lay-filter="battInfoFilter">
|
| | | <div class="layui-form-item">
|
| | | <div class="layui-row layui-col-space8" id="battInfo"></div>
|
| | | <div style="height: 8px;"></div>
|
| | | <div class="layui-row">
|
| | | <div class="layui-col-xs3 layui-col-xs-offset9 layui-col-sm3 layui-col-sm-offset9 layui-col-md2 layui-col-md-offset10 layui-col-lg2 layui-col-lg-offset10">
|
| | | <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="" lay-filter="enAdd">确认添加</button>
|
| | | <button class="layui-btn layui-btn-sm layui-btn-normal" id="closePage">关闭面板</button>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <script type="text/html" id="battInfoTpl">
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">机房编号</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationId" lay-verify="required|number" id="homenum" autocomplete="off" class="layui-input" value="{{= d.StationId }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">省</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationName1" lay-verify="required" id="province" autocomplete="off" class="layui-input" value="{{= d.StationName1 }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">市</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationName2" lay-verify="required" id="StationName2" autocomplete="off" class="layui-input" value="{{= d.StationName2 }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">区/县</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationName5" lay-verify="required" id="county" autocomplete="off" class="layui-input" value="{{= d.StationName5 }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg6">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">机房名称</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationName3" lay-verify="required" id="homename" autocomplete="off" class="layui-input" value="{{= d.StationName3 }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">设备名称</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationName4" lay-verify="required" id="homename" autocomplete="off" class="layui-input" value="{{= d.StationName4 }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">机房ip</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationIp" lay-verify="required" id="homeip" autocomplete="off" class="layui-input" value="{{= d.StationIp }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">设备ID<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="FBSDeviceId" lay-verify="devid" id="devid" autocomplete="off" class="layui-input" value="{{= d.FBSDeviceId }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">设备IP</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="FbsDeviceIp" disabled="" id="fbsip" autocomplete="off" class="layui-input layui-bg-gray" value="{{= d.FbsDeviceIp }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">子网掩码</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="FbsDeviceIp_YM" id="ym" disabled="" autocomplete="off" class="layui-input layui-bg-gray" value="{{= d.FbsDeviceIp_YM }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">网关</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="FbsDeviceIp_WG" id="wg" disabled="" autocomplete="off" class="layui-input layui-bg-gray" value="{{= d.FbsDeviceIp_WG }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">设备名称</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="FBSDeviceName" lay-verify="required" id="devname" autocomplete="off" class="layui-input" value="{{= d.FBSDeviceName }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">电池组ID</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattGroupId" lay-verify="required|number" id="groupid" disabled="" autocomplete="off" class="layui-input layui-bg-gray" value="{{= d.BattGroupId }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">电池组编号</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattGroupNum" lay-verify="required|number" id="groupnum" disabled="" autocomplete="off" class="layui-input layui-bg-gray" value="{{= d.BattGroupNum }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">浮充电压阀值</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="FloatVolLevel" lay-verify="required|number" id="floatVolLevel" autocomplete="off" class="layui-input" value="{{= d.FloatVolLevel }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">离线电压阀值</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="OfflineVolLevel" lay-verify="required|number" id="offlineVolLevel" autocomplete="off" class="layui-input" value="{{= d.OfflineVolLevel }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">浮充电流阀值</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattFloatCurrent" lay-verify="required|number" id="floatCurrLevel" autocomplete="off" class="layui-input" value="{{= d.BattFloatCurrent }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">单体数量<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="MonCount" lay-verify="required|number" id="moncount" autocomplete="off" class="layui-input" value="{{= d.MonCount }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">标称容量<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="MonCapStd" lay-verify="required|number" id="moncap" autocomplete="off" class="layui-input" value="{{= d.MonCapStd }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">单体电压<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="MonVolStd" lay-verify="required|number" id="monvol" autocomplete="off" class="layui-input" value="{{= d.MonVolStd }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">单体内阻</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="MonResStd" lay-verify="required|number" id="monres" autocomplete="off" class="layui-input" value="{{= d.MonResStd }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">单体电导</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="MonSerStd" lay-verify="required|number" id="monser" autocomplete="off" class="layui-input" value="{{= d.MonSerStd }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">次低偏移量</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="MonVolLowToAvg" lay-verify="required|number" id="monVolLowToAvg" autocomplete="off" class="layui-input" value="{{= d.MonVolLowToAvg }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">负载电流<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="Load_curr" lay-verify="required|number" id="loadcurr" autocomplete="off" class="layui-input" value="{{= d.Load_curr }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">核容电流</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="DisCurrMax" lay-verify="required|number" id="discurrmax" autocomplete="off" class="layui-input" value="{{ d.DisCurrMax }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">基站手机号码<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="station_phone" lay-verify="required|phone" id="stationphone" autocomplete="off" class="layui-input" value="{{= d.station_phone }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">电池品牌<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattProducer" lay-verify="required" id="producer" autocomplete="off" class="layui-input" value="{{= d.BattProducer }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">电池型号<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattModel" lay-verify="required" id="battmodel" autocomplete="off" class="layui-input" value="{{= d.BattModel }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">生产日期</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattProductDate" id="productdate" autocomplete="off" class="layui-input" value="{{= d.BattProductDate }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">使用日期</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattInUseDate" id="usedate" autocomplete="off" class="layui-input" value="{{= d.BattInUseDate }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">安装状态</label>
|
| | | <div class="layui-input-block">
|
| | | <select name="Station_install" id="isInstall">
|
| | | {{# |
| | | var isInstall = function(value) {
|
| | | var rs = '未安装';
|
| | | if(value) {
|
| | | rs = '已安装';
|
| | | }
|
| | | return rs;
|
| | | };
|
| | | }}
|
| | | {{# layui.each([0,1], function(index) { }}
|
| | | {{# if(index == d.Station_install) { }}
|
| | | <option value="{{ index }}" selected>{{= isInstall(index) }}</option>
|
| | | {{# }else{ }}
|
| | | <option value="{{ index }}">{{= isInstall(index) }}</option>
|
| | | {{# } }}
|
| | | {{# }); }}
|
| | | </select>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">安装人员<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="install_user" id="insperson" autocomplete="off" class="layui-input" value="{{= d.install_user }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-row layui-col-space8">
|
| | | {{# layui.each(d.addGroupNum, function(index, item) { }}
|
| | | <div class="layui-col-lg6">
|
| | | <div class="layui-card">
|
| | | <div class="layui-card-header layui-bg-gray">电池组{{= item}}</div>
|
| | | <div class="layui-card-body">
|
| | | <div class="layui-row layui-col-space8">
|
| | | <div class="layui-col-lg6">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">设备索引<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <select name="group{{= item}}.index">
|
| | | {{# layui.each([0,1,2,3], function(k) { }}
|
| | | {{# if(index == k) { }}
|
| | | <option value="{{ k }}" selected>{{ k }}</option>
|
| | | {{# }else{ }}
|
| | | <option value="{{ k }}">{{ k }}</option>
|
| | | {{# } }}
|
| | | {{# }); }}
|
| | | </select>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-lg6">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">电池组名称</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="group{{= item}}.name" lay-verify="required" autocomplete="off" class="layui-input" value="电池组{{= item}}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | {{# }); }}
|
| | | </div>
|
| | | </script>
|
| | | <script type="text/javascript" src="../src/layui.js"></script>
|
| | | <script type="text/javascript">
|
| | | layui.use(['form', 'laytpl', 'jquery', 'element', 'laydate'], function() {
|
| | | var form = layui.form;
|
| | | var laytpl = layui.laytpl;
|
| | | var $ = layui.jquery;
|
| | | var element = layui.element;
|
| | | var laydate = layui.laydate;
|
| | |
|
| | | var battInfoTpl = $('#battInfoTpl').html();
|
| | | var editInfo = parent.$('#iframeEdit').data('data');
|
| | | //console.log(editInfo);
|
| | | var data = {
|
| | | StationId: '4011100'
|
| | | ,StationName1: '广西省'
|
| | | ,StationName2: '白色市'
|
| | | ,StationName5: '乐业县'
|
| | | ,StationName3: 'GX百色乐业县立新小区WF'
|
| | | ,StationName4: 'BTS设备'
|
| | | ,StationIp: '192.168.0.1'
|
| | | ,FBSDeviceId: '960000111'
|
| | | ,FbsDeviceIp: '127.0.0.1'
|
| | | ,FbsDeviceIp_YM: '255.255.255.0'
|
| | | ,FbsDeviceIp_WG: '127.0.0.1'
|
| | | ,FBSDeviceName: '设备名称'
|
| | | ,GroupIndexInFBSDevice: 1 |
| | | ,BattGroupId: 1000005
|
| | | ,BattGroupNum: 2
|
| | | ,BattGroupName: '电池组1'
|
| | | ,FloatVolLevel: 54
|
| | | ,OfflineVolLevel: 42.9 |
| | | ,BattFloatCurrent: 10
|
| | | ,MonCount: 24
|
| | | ,MonCapStd: 300
|
| | | ,MonVolStd: 2
|
| | | ,MonResStd: 0.2
|
| | | ,MonSerStd: 5000
|
| | | ,MonVolLowToAvg: 0.05 |
| | | ,Load_curr: 15
|
| | | ,DisCurrMax: '0'
|
| | | ,station_phone: 12345678912
|
| | | ,BattProducer: '升阳'
|
| | | ,BattModel: ''
|
| | | ,productDate: '2018-09-18 00:00:00'
|
| | | ,useDate: '2018-09-18 00:00:00'
|
| | | ,install_user: '呵呵'
|
| | | };
|
| | | |
| | | // 渲染内容
|
| | | laytpl(battInfoTpl).render(editInfo, function(html) {
|
| | | $('#battInfo').html(html);
|
| | | form.render();
|
| | |
|
| | | // 生产日期渲染
|
| | | laydate.render({
|
| | | elem: '#productdate'
|
| | | ,format: 'yyyy-MM-dd HH:mm:ss'
|
| | | });
|
| | |
|
| | | // 投入使用日期渲染
|
| | | laydate.render({
|
| | | elem: '#usedate'
|
| | | ,format: 'yyyy-MM-dd HH:mm:ss'
|
| | | });
|
| | | |
| | | |
| | | });
|
| | | |
| | | // 验证信息
|
| | | form.verify({
|
| | | string: function(value) {
|
| | | var _value = value.trim();
|
| | | if(_value.length == 0){
|
| | | return '不能为空';
|
| | | }
|
| | | }
|
| | | ,ip: function(value) {
|
| | | //var ptn = /^1$/;
|
| | | }
|
| | | ,devid: function(value) {
|
| | | var ptn = /^91([0-9]{7})$/;
|
| | | if(!ptn.test(value)) {
|
| | | return '设备id的格式不正确!以91开头的11位数字';
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | // 更改设备ID
|
| | | $('#battInfo').on('input propertychange', '#devid', function() {
|
| | | var val = $(this).val();
|
| | | |
| | | $('#fbsip').val(getDevIp(val));
|
| | | });
|
| | | |
| | | // 提交内容
|
| | | form.on('submit(enAdd)', function(data) {
|
| | | // console.log(data);
|
| | | layer.confirm('是否确认添加', {icon: 3, title:'提示'}, function(index){
|
| | | var _data = data.field;
|
| | | var province = _data.StationName1; // 省
|
| | | var city = _data.StationName2; // 市
|
| | | var home = _data.StationName3; // 机房名称
|
| | | var bts = _data.StationName4; // 设备名称
|
| | | _data.StationName = province+'-'+city+'-'+home+'-'+bts;
|
| | | //console.log(_data);
|
| | | var temp = analysisData(editInfo.addGroupNum, _data);
|
| | | //console.log(temp);
|
| | | // 添加电池信息
|
| | | addBatt(temp);
|
| | | });
|
| | | return false;
|
| | | });
|
| | | |
| | | // 关闭面板
|
| | | $('#closePage').click(function() {
|
| | | parent.$('#iframeClose').click();
|
| | | });
|
| | | // 根据设备id计算设备ip
|
| | | function getDevIp(dev_id) {
|
| | | var ptn = /^91([0-9]{7})$/;
|
| | | var ip = '';
|
| | | if(ptn.test(dev_id)) {
|
| | | var value = Number(RegExp.$1);
|
| | | // console.log(value);
|
| | | var intNum = prefixInteger(Math.floor(value/256), 3);
|
| | | var resNum = prefixInteger(value%256, 3);
|
| | | ip = '127.000.'+intNum+'.'+resNum;
|
| | | }else {
|
| | | ip = '设备ID格式不正确';
|
| | | }
|
| | | |
| | | return ip;
|
| | | }
|
| | | |
| | | // 获取001类似数据
|
| | | function prefixInteger(num, length) {
|
| | | return (Array(length).join('0') + num).slice(-length);
|
| | | }
|
| | | |
| | | |
| | | // 解析添加的数据
|
| | | function analysisData(arr, data) {
|
| | | //console.log(arr);
|
| | | var rs = [];
|
| | | for(var i=0; i<arr.length; i++) {
|
| | | var temp = {};
|
| | | var _arr = arr[i];
|
| | | var _index = 'group'+_arr+'.index';
|
| | | var _name = 'group'+_arr+'.name';
|
| | | Object.keys(data).forEach(function(key) {
|
| | | if(checkKeyNotVal(key)) {
|
| | | if(key == _index) {
|
| | | temp.GroupIndexInFBSDevice = data[key];
|
| | | }else if(key == _name){
|
| | | temp.BattGroupName = data[key];
|
| | | }
|
| | | }else {
|
| | | temp[key] = data[key]; |
| | | }
|
| | | });
|
| | | |
| | | rs.push(temp);
|
| | | }
|
| | | |
| | | return rs;
|
| | | }
|
| | | //console.log(checkKeyNotVal('group1index'));
|
| | | // 检测当前属性是否为废属性
|
| | | function checkKeyNotVal(key) {
|
| | | var patt = /^group[0-9]{1}\./;
|
| | | |
| | | return patt.test(key);
|
| | | }
|
| | | |
| | | //添加多个电池组
|
| | | function addBatt(temp){
|
| | | var load = layer.load(1);
|
| | | $.ajax({
|
| | | type: "post", |
| | | url: "BattInfAction!add", |
| | | async:true, |
| | | dataType:'text',
|
| | | data:"json="+JSON.stringify(temp), |
| | | success: function(data){ |
| | | data = eval('('+data+')');
|
| | | var model = eval('('+data.result+')');
|
| | | //console.info(model);
|
| | | if(model.code ==1){
|
| | | layer.msg('添加成功!3秒后面板自动关闭');
|
| | | setTimeout(function() {
|
| | | parent.$('#iframeClose').click();
|
| | | }, 3000);
|
| | | }else{
|
| | | layer.msg('添加失败!');
|
| | | }
|
| | | loading.hideLoading($('#main')); |
| | | },
|
| | | error:function(){
|
| | | layer.msg('添加失败!');
|
| | | },
|
| | | complete: function() {
|
| | | layer.close(load);
|
| | | }
|
| | | });
|
| | | }
|
| | | });
|
| | | </script>
|
| | | </body>
|
| | | </html>
|
New file |
| | |
| | | <!DOCTYPE html>
|
| | | <html lang="en">
|
| | | <head>
|
| | | <meta charset="UTF-8">
|
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| | | <meta http-equiv="X-UA-Compatible" content="ie=edge">
|
| | | <title>修改电池信息</title>
|
| | | <link rel="stylesheet" href="../src/css/layui.css">
|
| | | <style>
|
| | | .layui-form-pane .layui-form-label {
|
| | | width: 130px;
|
| | | }
|
| | | .layui-form-pane .layui-input-block {
|
| | | margin-left: 130px;
|
| | | }
|
| | | .red {
|
| | | font-size: 20px;
|
| | | color: #FF5722;
|
| | | }
|
| | | </style>
|
| | | </head>
|
| | | <body>
|
| | | <div class="layui-fluid">
|
| | | <div style="height: 8px;"></div>
|
| | | <div class="layui-form layui-form-pane" lay-filter="battInfoFilter">
|
| | | <div class="layui-form-item">
|
| | | <div class="layui-row layui-col-space8" id="battInfo"></div>
|
| | | <div style="height: 8px;"></div>
|
| | | <div class="layui-row">
|
| | | <div class="layui-col-xs3 layui-col-xs-offset9 layui-col-sm3 layui-col-sm-offset9 layui-col-md2 layui-col-md-offset10 layui-col-lg2 layui-col-lg-offset10">
|
| | | <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="" lay-filter="enEidt">确认编辑</button>
|
| | | <button class="layui-btn layui-btn-sm layui-btn-normal" id="closePage">关闭面板</button>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <script type="text/html" id="battInfoTpl">
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">机房编号</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationId" lay-verify="required|number" id="homenum" autocomplete="off" class="layui-input" value="{{= d.StationId }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">省</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationName1" lay-verify="required" id="province" autocomplete="off" class="layui-input" value="{{= d.StationName1 }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">市</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationName2" lay-verify="required" id="StationName2" autocomplete="off" class="layui-input" value="{{= d.StationName2 }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">区/县</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationName5" lay-verify="required" id="county" autocomplete="off" class="layui-input" value="{{= d.StationName5 }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg6">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">机房名称</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationName3" lay-verify="required" id="homename" autocomplete="off" class="layui-input" value="{{= d.StationName3 }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">设备名称</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationName4" lay-verify="required" id="homename" autocomplete="off" class="layui-input" value="{{= d.StationName4 }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">机房ip</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="StationIp" lay-verify="required" id="homeip" autocomplete="off" class="layui-input" value="{{= d.StationIp }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">设备ID<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="FBSDeviceId" lay-verify="devid" id="devid" autocomplete="off" class="layui-input" value="{{= d.FBSDeviceId }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">设备IP</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="FbsDeviceIp" disabled="" id="fbsip" autocomplete="off" class="layui-input layui-bg-gray" value="{{= d.FbsDeviceIp }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">子网掩码</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="FbsDeviceIp_YM" id="ym" disabled="" autocomplete="off" class="layui-input layui-bg-gray" value="{{= d.FbsDeviceIp_YM }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">网关</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="FbsDeviceIp_WG" id="wg" disabled="" autocomplete="off" class="layui-input layui-bg-gray" value="{{= d.FbsDeviceIp_WG }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">设备名称</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="FBSDeviceName" lay-verify="required" id="devname" autocomplete="off" class="layui-input" value="{{= d.FBSDeviceName }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">设备索引<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <select name="GroupIndexInFBSDevice" id="devindex">
|
| | | {{# layui.each([0,1,2,3], function(index) { }};
|
| | | {{# if(index == d.GroupIndexInFBSDevice) { }}
|
| | | <option value="{{ index }}" selected>{{ index }}</option>
|
| | | {{# }else{ }}
|
| | | <option value="{{ index }}">{{ index }}</option>
|
| | | {{# } }}
|
| | | {{# }); }}
|
| | | </select>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">电池组ID</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattGroupId" lay-verify="required|number" id="groupid" disabled="" autocomplete="off" class="layui-input layui-bg-gray" value="{{= d.BattGroupId }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">电池组编号</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattGroupNum" lay-verify="required|number" id="groupnum" disabled="" autocomplete="off" class="layui-input layui-bg-gray" value="{{= d.BattGroupNum }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">电池组名称</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattGroupName" lay-verify="required" id="groupname" autocomplete="off" class="layui-input" value="{{= d.BattGroupName }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">浮充电压阀值</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="FloatVolLevel" lay-verify="required|number" id="floatVolLevel" autocomplete="off" class="layui-input" value="{{= d.FloatVolLevel }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">离线电压阀值</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="OfflineVolLevel" lay-verify="required|number" id="offlineVolLevel" autocomplete="off" class="layui-input" value="{{= d.OfflineVolLevel }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">浮充电流阀值<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattFloatCurrent" lay-verify="required|number" id="floatCurrLevel" autocomplete="off" class="layui-input" value="{{= d.BattFloatCurrent }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">单体数量<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="MonCount" lay-verify="required|number" id="moncount" autocomplete="off" class="layui-input" value="{{= d.MonCount }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">标称容量<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="MonCapStd" lay-verify="required|number" id="moncap" autocomplete="off" class="layui-input" value="{{= d.MonCapStd }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">单体电压<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="MonVolStd" lay-verify="required|number" id="monvol" autocomplete="off" class="layui-input" value="{{= d.MonVolStd }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">单体内阻</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="MonResStd" lay-verify="required|number" id="monres" autocomplete="off" class="layui-input" value="{{= d.MonResStd }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">单体电导</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="MonSerStd" lay-verify="required|number" id="monser" autocomplete="off" class="layui-input" value="{{= d.MonSerStd }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">次低偏移量</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="MonVolLowToAvg" lay-verify="required|number" id="monVolLowToAvg" autocomplete="off" class="layui-input" value="{{= d.MonVolLowToAvg }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">负载电流<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="Load_curr" lay-verify="required|number" id="loadcurr" autocomplete="off" class="layui-input" value="{{= d.Load_curr }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">核容电流</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="DisCurrMax" lay-verify="required|number" id="discurrmax" autocomplete="off" class="layui-input" value="{{ d.DisCurrMax }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">基站手机号码<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="station_phone" lay-verify="required|phone" id="stationphone" autocomplete="off" class="layui-input" value="{{= d.station_phone }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">电池品牌<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattProducer" lay-verify="required" id="producer" autocomplete="off" class="layui-input" value="{{= d.BattProducer }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">电池型号<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattModel" lay-verify="required" id="battmodel" autocomplete="off" class="layui-input" value="{{= d.BattModel }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">生产日期</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattProductDate" id="productdate" autocomplete="off" class="layui-input" value="{{= d.BattProductDate }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">使用日期</label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="BattInUseDate" id="usedate" autocomplete="off" class="layui-input" value="{{= d.BattInUseDate }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">安装状态</label>
|
| | | <div class="layui-input-block">
|
| | | <select name="Station_install" id="isInstall">
|
| | | {{# |
| | | var isInstall = function(value) {
|
| | | var rs = '未安装';
|
| | | if(value) {
|
| | | rs = '已安装';
|
| | | }
|
| | | return rs;
|
| | | };
|
| | | }}
|
| | | {{# layui.each([0,1], function(index) { }}
|
| | | {{# if(index == d.Station_install) { }}
|
| | | <option value="{{ index }}" selected>{{= isInstall(index) }}</option>
|
| | | {{# }else{ }}
|
| | | <option value="{{ index }}">{{= isInstall(index) }}</option>
|
| | | {{# } }}
|
| | | {{# }); }}
|
| | | </select>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div class="layui-col-xs6 layui-col-sm6 layui-col-md4 layui-col-lg3">
|
| | | <div class="layui-block">
|
| | | <label class="layui-form-label">安装人员<span class="red">*</span></label>
|
| | | <div class="layui-input-block">
|
| | | <input type="text" name="install_user" id="insperson" autocomplete="off" class="layui-input" value="{{= d.install_user }}">
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </script>
|
| | | <script type="text/javascript" src="../src/layui.js"></script>
|
| | | <script type="text/javascript">
|
| | | layui.use(['form', 'laytpl', 'jquery', 'element', 'laydate'], function() {
|
| | | var form = layui.form;
|
| | | var laytpl = layui.laytpl;
|
| | | var $ = layui.jquery;
|
| | | var element = layui.element;
|
| | | var laydate = layui.laydate;
|
| | |
|
| | | var battInfoTpl = $('#battInfoTpl').html();
|
| | | var editInfo = parent.$('#iframeEdit').data('data');
|
| | | //console.log(editInfo);
|
| | | var data = {
|
| | | StationId: '4011100'
|
| | | ,StationName1: '广西省'
|
| | | ,StationName2: '白色市'
|
| | | ,StationName5: '乐业县'
|
| | | ,StationName3: 'GX百色乐业县立新小区WF'
|
| | | ,StationName4: 'BTS设备'
|
| | | ,StationIp: '192.168.0.1'
|
| | | ,FBSDeviceId: '960000111'
|
| | | ,FbsDeviceIp: '127.0.0.1'
|
| | | ,FbsDeviceIp_YM: '255.255.255.0'
|
| | | ,FbsDeviceIp_WG: '127.0.0.1'
|
| | | ,FBSDeviceName: '设备名称'
|
| | | ,GroupIndexInFBSDevice: 1 |
| | | ,BattGroupId: 1000005
|
| | | ,BattGroupNum: 2
|
| | | ,BattGroupName: '电池组1'
|
| | | ,FloatVolLevel: 54
|
| | | ,OfflineVolLevel: 42.9 |
| | | ,BattFloatCurrent: 10
|
| | | ,MonCount: 24
|
| | | ,MonCapStd: 300
|
| | | ,MonVolStd: 2
|
| | | ,MonResStd: 0.2
|
| | | ,MonSerStd: 5000
|
| | | ,MonVolLowToAvg: 0.05 |
| | | ,Load_curr: 15
|
| | | ,DisCurrMax: '0'
|
| | | ,station_phone: 12345678912
|
| | | ,BattProducer: '升阳'
|
| | | ,BattModel: ''
|
| | | ,productDate: '2018-09-18 00:00:00'
|
| | | ,useDate: '2018-09-18 00:00:00'
|
| | | ,install_user: '呵呵'
|
| | | };
|
| | | |
| | | // 渲染内容
|
| | | laytpl(battInfoTpl).render(editInfo, function(html) {
|
| | | $('#battInfo').html(html);
|
| | | form.render();
|
| | |
|
| | | // 生产日期渲染
|
| | | laydate.render({
|
| | | elem: '#productdate'
|
| | | ,format: 'yyyy-MM-dd HH:mm:ss'
|
| | | });
|
| | |
|
| | | // 投入使用日期渲染
|
| | | laydate.render({
|
| | | elem: '#usedate'
|
| | | ,format: 'yyyy-MM-dd HH:mm:ss'
|
| | | });
|
| | | |
| | | |
| | | });
|
| | | |
| | | // 验证信息
|
| | | form.verify({
|
| | | string: function(value) {
|
| | | var _value = value.trim();
|
| | | if(_value.length == 0){
|
| | | return '不能为空';
|
| | | }
|
| | | }
|
| | | ,ip: function(value) {
|
| | | //var ptn = /^1$/;
|
| | | }
|
| | | ,devid: function(value) {
|
| | | var ptn = /^91([0-9]{7})$/;
|
| | | if(!ptn.test(value)) {
|
| | | return '设备id的格式不正确!以91开头的11位数字';
|
| | | }
|
| | | }
|
| | | });
|
| | | |
| | | // 更改设备ID
|
| | | $('#battInfo').on('input propertychange', '#devid', function() {
|
| | | var val = $(this).val();
|
| | | |
| | | $('#fbsip').val(getDevIp(val));
|
| | | });
|
| | | |
| | | // 提交内容
|
| | | form.on('submit(enEidt)', function(data) {
|
| | | layer.confirm('是否确认修改', {icon: 3, title:'提示'}, function(index){
|
| | | var _data = data.field;
|
| | | var province = _data.StationName1; // 省
|
| | | var city = _data.StationName2; // 市
|
| | | var home = _data.StationName3; // 机房名称
|
| | | var bts = _data.StationName4; // 设备名称
|
| | | _data.StationName = province+'-'+city+'-'+home+'-'+bts;
|
| | | var temp = [_data];
|
| | | //console.log(temp);
|
| | | // 更新数据
|
| | | updBatt(temp);
|
| | | });
|
| | | return false;
|
| | | });
|
| | | |
| | | // 关闭面板
|
| | | $('#closePage').click(function() {
|
| | | parent.$('#iframeClose').click();
|
| | | });
|
| | | // 根据设备id计算设备ip
|
| | | function getDevIp(dev_id) {
|
| | | var ptn = /^91([0-9]{7})$/;
|
| | | var ip = '';
|
| | | if(ptn.test(dev_id)) {
|
| | | var value = Number(RegExp.$1);
|
| | | // console.log(value);
|
| | | var intNum = prefixInteger(Math.floor(value/256), 3);
|
| | | var resNum = prefixInteger(value%256, 3);
|
| | | ip = '127.000.'+intNum+'.'+resNum;
|
| | | }else {
|
| | | ip = '设备ID格式不正确';
|
| | | }
|
| | | |
| | | return ip;
|
| | | }
|
| | | |
| | | // 获取001类似数据
|
| | | function prefixInteger(num, length) {
|
| | | return (Array(length).join('0') + num).slice(-length);
|
| | | }
|
| | | |
| | | //修改电池组信息
|
| | | function updBatt(temp){
|
| | | var load= layer.load(1);
|
| | | $.ajax({
|
| | | type: "post", |
| | | url: "BattInfAction!update", |
| | | async:true, |
| | | dataType:'text',
|
| | | data:"json="+JSON.stringify(temp), |
| | | success: function(data){ |
| | | data = eval('('+data+')');
|
| | | var model = eval('('+data.result+')');
|
| | | //console.info(model);
|
| | | if(model.code ==1){
|
| | | layer.msg('修改成功!3秒后面板自动关闭');
|
| | | setTimeout(function() {
|
| | | parent.$('#iframeClose').click();
|
| | | }, 3000);
|
| | | }else{
|
| | | layer.msg('修改失败!');
|
| | | } |
| | | },
|
| | | error:function(){
|
| | | |
| | | },
|
| | | complete: function() {
|
| | | layer.close(load);
|
| | | }
|
| | | });
|
| | | }
|
| | | });
|
| | | </script>
|
| | | </body>
|
| | | </html>
|
New file |
| | |
| | | <!DOCTYPE html>
|
| | | <html lang="en">
|
| | | <head>
|
| | | <meta charset="UTF-8">
|
| | | <title>添加包机机房或设备</title>
|
| | | <meta name="viewport" content="width=device-width,initial-scale=1">
|
| | | <link rel="stylesheet" href="mobilCss/jquery.mobile-1.4.5.min.css"/> |
| | | <link rel="stylesheet" type="text/css" href="css/tbl.css">
|
| | | <script type="text/javascript" src="mobilJs/jquery-1.8.2.js"></script>
|
| | | <script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script>
|
| | | <link rel="stylesheet" href="css/fgpanel.css">
|
| | | <style type="text/css">
|
| | | .tbl-container table{
|
| | | color:#e61212!important;
|
| | | }
|
| | | </style> |
| | | </head>
|
| | | <body>
|
| | | <div data-role="page" id="pageone">
|
| | | <!-- 面板内容 -->
|
| | | <div class="fg-panel">
|
| | | <form>
|
| | | <div class="fg-panel-header">筛选</div>
|
| | | <div class="fg-panel-content">
|
| | | <fieldset data-role="controlgroup">
|
| | | <p>省</p>
|
| | | <select id="mainteArea" data-mini="true">
|
| | | <option value="">全部</option>
|
| | | </select>
|
| | | <p>市</p>
|
| | | <select id="city" data-mini="true">
|
| | | <option value="">全部</option>
|
| | | </select>
|
| | | <p>区/县</p>
|
| | | <select id="country" data-mini="true">
|
| | | <option value="">全部</option>
|
| | | </select>
|
| | | <p>机房站点</p>
|
| | | <select id="homeName" data-mini="true">
|
| | | <option value="">全部</option>
|
| | | </select>
|
| | | <p>蓄电池组</p>
|
| | | <select id="battgroup_name" data-mini="true">
|
| | | <option value="0">全部</option>
|
| | | </select>
|
| | | </fieldset>
|
| | | </div>
|
| | | <div class="fg-panel-btn">
|
| | | <a href="javascript:panel.hide(true);" data-role="button" id="submit" class="ui-btn ui-mini ui-btn-b ui-shadow">添加</a>
|
| | | </div>
|
| | | </form>
|
| | | </div>
|
| | | |
| | | <!-- 头部内容 -->
|
| | | <div data-role="header" data-position="fixed">
|
| | | <a href="elegroup-batt.html" target="_top" class="ui-btn ui-corner-all ui-shadow ui-icon-back ui-btn-icon-left" style="padding-top: 0.7em; padding-bottom: 0.7em;">返回</a>
|
| | | <h1>添加包机机房或设备</h1>
|
| | | <a href="javascript:panel.show();" class="ui-btn ui-corner-all ui-shadow ui-icon-grid ui-btn-icon-left" style="padding-top: 0.7em; padding-bottom: 0.7em;" id="screen">筛选</a>
|
| | | </div>
|
| | | <!-- 主体内容 -->
|
| | | <div data-role="main">
|
| | | <div class="pre-page"><a href="#" class="ui-btn ui-corner-all ui-icon-carat-l ui-btn-icon-notext">图标</a></div>
|
| | | <div class="next-page"><a href="#" class="ui-btn ui-corner-all ui-icon-carat-r ui-btn-icon-notext">图标</a></div> |
| | | <!-- 表格容器 -->
|
| | | <div class="tbl-container"></div>
|
| | | <table data-role="table" class="ui-responsive ui-shadow" id="tab" >
|
| | | </table>
|
| | | </div>
|
| | | <!-- 页脚内容 -->
|
| | | <div data-role="footer" data-position="fixed" data-theme="a"> |
| | | <div data-role="navbar">
|
| | | <ul>
|
| | | <li><a href="#yourPopup" data-rel="popup" class="ui-btn ui-btn-inline ui-corner-all operat-but ui-btn-icon-check" data-position-to="window" data-icon="check" data-role="button">应用</a></li>
|
| | | <li><a href="elegroup-batt.html" id="cancel" data-rel="popup" class="ui-btn ui-btn-inline ui-corner-all operat-but ui-btn-icon-delete" data-position-to="window" data-icon="delete" data-role="button">取消</a></li>
|
| | | </ul>
|
| | | </div> |
| | | </div> |
| | | <div data-role="popup" id="yourPopup" class="ui-content" data-overlay-theme="b">
|
| | | <a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn ui-icon-delete ui-btn-icon-notext ui-btn-right">关闭</a>
|
| | | <a href="" data-rel="back" id="sure" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ui-icon-check" >提交应用</a>
|
| | | <a href="" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-icon-left ui-icon-delete" >取消应用</a>
|
| | | </div> |
| | | </div>
|
| | | |
| | | </body>
|
| | |
|
| | | <script type="text/javascript" src="mobilJs/base.js"></script>
|
| | | <script type="text/javascript" src="js/tbl.js"></script>
|
| | | <script type="text/javascript" src="js/echarts.js"></script>
|
| | | <script type="text/javascript" src="js/eleAnalyse.js"></script>
|
| | | <script type="text/javascript" src="js/panel.js"></script>
|
| | | <script type="text/javascript">
|
| | |
|
| | | var data = new Date;
|
| | | var arrTh = ['包机机房', '包机电池组'];
|
| | | var dataArr = new Array();
|
| | | dataArr = [];
|
| | | var newArrTd = [];
|
| | | var tblCon = $('.tbl-container');
|
| | | var battProducer = "";
|
| | | var Page = {
|
| | | pageSize : 10,
|
| | | pageCurr : 1,
|
| | | pageAll : 0, |
| | | };
|
| | | |
| | | var startTime = "1980-01-01";
|
| | | var endTime = new Date;
|
| | | |
| | | $(document).ready(function(){
|
| | | $("#submit").click(function(){
|
| | | searchDisCharage();
|
| | | });
|
| | | });
|
| | | |
| | | |
| | | function searchDisCharage(){
|
| | | loadshow();
|
| | | arr=[];
|
| | | for(i=0;i<100;i++){arr[i]=i*10}
|
| | | createTbl(tblCon, arrTh, arr);
|
| | | loadclose();
|
| | | }
|
| | | |
| | | |
| | | function judgepronextshow(){
|
| | | var pageNum = Math.ceil(Page.pageAll/Page.pageSize);
|
| | | console.info(Page.pageCurr);
|
| | | if (pageNum!==1){//有多页
|
| | | if (Page.pageCurr==1){
|
| | | setPageTurning(false, true); //当前页为1,隐藏左边
|
| | | }
|
| | | else if (Page.pageCurr== pageNum)
|
| | | {
|
| | | setPageTurning(true, false); //当前页为最后一页,隐藏右边
|
| | | }
|
| | | else
|
| | | {
|
| | | setPageTurning(true, true); //为中间,两边都不隐藏
|
| | | }
|
| | | }else{
|
| | | setPageTurning(false, false);
|
| | | } //只有一页,隐藏两边
|
| | | } |
| | | |
| | | |
| | | //构造查询条件对象
|
| | | function createSearchForm(){
|
| | | var temp={
|
| | | page:{
|
| | | pageCurr:Page.pageCurr,
|
| | | pageSize:Page.pageSize,
|
| | | },
|
| | | binf:{
|
| | | StationName1:$('#privince').val(),
|
| | | StationName2:$('#city').val(),
|
| | | StationName5: $('#country').val(),
|
| | | StationName:$('#homeName').val(),
|
| | | BattGroupId:$('#battgroup_name').val(),
|
| | | BattProducer:battProducer,
|
| | | MonVolStd:"0",
|
| | | MonCapStd:$('#moncap_std2').val(),
|
| | | BattGroupName1:"",
|
| | | BattProductDate:startTime,
|
| | | BattProductDate1:endTime,
|
| | | BattInUseDate:startTime,
|
| | | BattInUseDate1:endTime,
|
| | | },
|
| | | uinf:{
|
| | | UId:"0",
|
| | | },
|
| | | tdata:{
|
| | | test_type:"0",
|
| | | record_time:startTime,
|
| | | record_time1:endTime,
|
| | | test_starttype:"0",
|
| | | },
|
| | | mainf:{
|
| | | /*
|
| | | remark:"100",
|
| | | maint_done_time:startTime,
|
| | | maint_done_time1:endTime,
|
| | | */
|
| | | } |
| | | };
|
| | | return temp;
|
| | | }
|
| | | |
| | | //页面加载时查询省
|
| | | $.post("BattInfAction_serchByStation",null,function(data){
|
| | | data = data.result;
|
| | | data = eval("("+data+")");
|
| | | //console.info(data);
|
| | | //console.info(data.code);
|
| | | if(data.code==1&&data.data.length>0){
|
| | | var $Ostation_name1=$("#mainteArea");
|
| | | $Ostation_name1.text("");
|
| | | var arr = new Array();
|
| | | for(var i=0;i<=data.data.length;i++)
|
| | | {
|
| | | if(i == 0){
|
| | | arr.push({
|
| | | val:"",
|
| | | txt:"全部(共"+data.sum+"个)",
|
| | | });
|
| | | }else{
|
| | | arr.push({
|
| | | val:data.data[i-1].StationName1,
|
| | | txt:data.data[i-1].StationName1,
|
| | | });
|
| | | }
|
| | | }
|
| | | updataSel($Ostation_name1, arr);
|
| | | }
|
| | | findCity();
|
| | | });
|
| | |
|
| | | |
| | | //当省改变时更新市
|
| | | function findCity(){
|
| | | var data = {
|
| | | StationName1: $("#mainteArea").val()
|
| | | };
|
| | | //console.info(data);
|
| | | // 请求获取当前省下的市
|
| | | $.ajax({ |
| | | type: "post", |
| | | url: "BattInfAction!serchStationName2", |
| | | async:true, |
| | | dataType:'json',
|
| | | data:"json = "+JSON.stringify(data), |
| | | success: function(data){
|
| | | data = data.result;
|
| | | data = eval("("+data+")");
|
| | | //console.info(data);
|
| | | //console.info(data.code); |
| | | if(data.code==1&&data.data.length>0){
|
| | | var $Ostation_name1=$("#city");
|
| | | $Ostation_name1.text("");
|
| | | var arr = new Array();
|
| | | for(var i=0;i<=data.data.length;i++)
|
| | | {
|
| | | if(i == 0){
|
| | | arr.push({
|
| | | val:"",
|
| | | txt:"全部(共"+data.data.length+"个)",
|
| | | });
|
| | | }else{
|
| | | arr.push({
|
| | | val:data.data[i-1].StationName2,
|
| | | txt:data.data[i-1].StationName2,
|
| | | });
|
| | | }
|
| | | }
|
| | | updataSel($Ostation_name1, arr);
|
| | | }
|
| | | findCounty();
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | //当市改变时更新区/县
|
| | | function findCounty(){
|
| | | var data = {
|
| | | StationName1: $("#mainteArea").val(),
|
| | | StationName2:$("#city").val(),
|
| | | };
|
| | | //console.info(data);
|
| | | $.ajax({ |
| | | type: "post", |
| | | url: "BattInfAction!serchStationName5", |
| | | async:true, |
| | | dataType:'json',
|
| | | data:"json = "+JSON.stringify(data), |
| | | success: function(data){
|
| | | data = data.result;
|
| | | data = eval("("+data+")");
|
| | | //console.info(data);
|
| | | //console.info(data.code); |
| | | if(data.code==1&&data.data.length>0){
|
| | | var $Ostation_name1=$("#country");
|
| | | $Ostation_name1.text("");
|
| | | var arr = new Array();
|
| | | for(var i=0;i<=data.data.length;i++)
|
| | | {
|
| | | if(i == 0){
|
| | | arr.push({
|
| | | val:"",
|
| | | txt:"全部(共"+data.data.length+"个)",
|
| | | });
|
| | | }else{
|
| | | arr.push({
|
| | | val:data.data[i-1].StationName5,
|
| | | txt:data.data[i-1].StationName5,
|
| | | });
|
| | | }
|
| | | }
|
| | | updataSel($Ostation_name1, arr);
|
| | | }
|
| | | findStationNamebyStationname1(); |
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | //当区县更新时更新机房 |
| | | function findStationNamebyStationname1(){
|
| | | var data = {
|
| | | StationName1: $("#mainteArea").val(),
|
| | | StationName2:$("#city").val(),
|
| | | StationName5:$("#country").val()
|
| | | };
|
| | | //console.info(data);
|
| | | $.ajax({ |
| | | type: "post", |
| | | url: "BattInfAction!serchStationName3", |
| | | async:true, |
| | | dataType:'json',
|
| | | data:"json = "+JSON.stringify(data), |
| | | success: function(data){
|
| | | data = data.result;
|
| | | data = eval("("+data+")");
|
| | | //console.info(data);
|
| | | //console.info(data.code); |
| | | if(data.code==1&&data.data.length>0){
|
| | | var $Ostation_name1=$("#homeName");
|
| | | $Ostation_name1.text("");
|
| | | var arr = new Array();
|
| | | for(var i=0;i<=data.data.length;i++)
|
| | | {
|
| | | if(i == 0){
|
| | | arr.push({
|
| | | val:"",
|
| | | stationid:"",
|
| | | txt:"全部(共"+data.data.length+"个)",
|
| | | });
|
| | | }else{
|
| | | arr.push({
|
| | | val:data.data[i-1].StationName,
|
| | | stationid:data.data[i-1].StationId,
|
| | | txt:data.data[i-1].StationName3,
|
| | | });
|
| | | }
|
| | | }
|
| | | //console.info(111111111111111);
|
| | | updataSelStation($Ostation_name1, arr);
|
| | | }
|
| | | |
| | | findserchByBattGroupNamebystationname(); |
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | //根据机房获取电池组 |
| | | function findserchByBattGroupNamebystationname(){
|
| | | var stationid = $("#homeName").find('option:selected').attr('stationid')?$("#homeName").find('option:selected').attr('stationid'):'';
|
| | |
|
| | | var data = {
|
| | | StationName1: $("#mainteArea").val(),
|
| | | StationName2:$("#city").val(),
|
| | | StationName5:$("#country").val(),
|
| | | StationName: $("#homeName").val(),
|
| | | StationId: stationid
|
| | | };
|
| | | |
| | | //console.info(data);
|
| | | $.ajax({ |
| | | type: "post", |
| | | url: "BattInfAction!serchBattByStation", |
| | | async:true, |
| | | dataType:'json',
|
| | | data:"json = "+JSON.stringify(data), |
| | | success: function(data){
|
| | | data = data.result;
|
| | | data = eval("("+data+")");
|
| | | //console.warn();
|
| | | //console.info(data);
|
| | | //console.info(data.code); |
| | | if(data.code==1&&data.data.length>0){
|
| | | var $Ostation_name1=$("#battgroup_name");
|
| | | $Ostation_name1.text("");
|
| | | var arr = new Array();
|
| | | for(var i=0;i<=data.data.length;i++)
|
| | | {
|
| | | if(i == 0){
|
| | | arr.push({
|
| | | val:0,
|
| | | txt:"全部(共"+data.data.length+"个)",
|
| | | });
|
| | | }else{
|
| | | arr.push({
|
| | | val:data.data[i-1].BattGroupId,
|
| | | txt:data.data[i-1].BattGroupName,
|
| | | });
|
| | | }
|
| | | }
|
| | | updataSel($Ostation_name1, arr);
|
| | | }
|
| | | |
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | //当省改变时更新市
|
| | | $('#mainteArea').change(function(){
|
| | | findCity(); |
| | | });
|
| | | //当市改变时改变区/县
|
| | | $('#city').change(function(){
|
| | | findCounty(); |
| | | });
|
| | | //当区/县改变时改变机房
|
| | | $('#country').change(function(){
|
| | | findStationNamebyStationname1(); |
| | | }); |
| | | //当机房改变时,更新电池组 |
| | | $('#homeName').change(function(){
|
| | | findserchByBattGroupNamebystationname();
|
| | | });
|
| | | |
| | | //查询电池容量
|
| | | $.post("BattInfAction_serchByMonCapStd",null,function(data){
|
| | | data=data.result;
|
| | | data=eval("("+data+")");
|
| | | if(data.code==1 && data.data.length>0){
|
| | | var $Omoncap_std2=$("#moncap_std2");
|
| | | $Omoncap_std2.text=("");
|
| | | console.info(data.data[1].MonCapStd);
|
| | | var arr = new Array();
|
| | | for(var i=0;i <= data.data.length;i++){
|
| | | if(i == 0){
|
| | | arr.push({
|
| | | val:0,
|
| | | txt:"全部(共"+data.sum+")种"
|
| | | });
|
| | | }else{
|
| | | arr.push({
|
| | | val:data.data[i-1].MonCapStd,
|
| | | txt:data.data[i-1].MonCapStd
|
| | | });
|
| | | }
|
| | | }
|
| | | updataSel($('#moncap_std2'),arr);
|
| | | };
|
| | | });
|
| | | |
| | | |
| | |
|
| | | |
| | | $(function() {
|
| | | $('.pre-page').on('click', 'a', function() {
|
| | | var isShowPre = true;
|
| | | Page.pageSize = 10;
|
| | | var pageNum = Math.ceil(Page.pageAll/Page.pageSize)
|
| | | if(Page.pageCurr>1){
|
| | | Page.pageCurr = Page.pageCurr - 1;
|
| | | searchDisCharage();
|
| | | }else { |
| | | searchDisCharage(); |
| | | }
|
| | | });
|
| | | |
| | | $('.next-page').on('click', 'a', function() {
|
| | | var isShowNext = true;
|
| | | Page.pageSize = 10;
|
| | | console.info(Page.pageAll);
|
| | | console.info(Page.pageSize);
|
| | | var pageNum = Math.ceil(Page.pageAll/Page.pageSize);
|
| | | if(Page.pageCurr<pageNum){
|
| | | Page.pageCurr = Page.pageCurr + 1;
|
| | | console.info(Page.pageCurr);
|
| | | searchDisCharage()
|
| | | }
|
| | | });
|
| | | });
|
| | | |
| | | |
| | | // 判断是否显示翻页按钮
|
| | | function setPageTurning(isShowPre, isShowNext) {
|
| | | if(isShowPre) { // 判断是否显示向上翻页按钮
|
| | | $('.pre-page').show();
|
| | | }else {
|
| | | $('.pre-page').hide();
|
| | | }
|
| | |
|
| | | if(isShowNext) { // 判断是否显示向下翻页按钮
|
| | | $('.next-page').show();
|
| | | }else {
|
| | | $('.next-page').hide();
|
| | | }
|
| | | } |
| | |
|
| | | $('document').ready(function(){
|
| | | panel.show();
|
| | | }); |
| | | </script>
|
| | | </html>
|
| | |
|
| | | |
New file |
| | |
| | | <!DOCTYPE html>
|
| | | <html lang="en">
|
| | | <head>
|
| | | <meta charset="UTF-8">
|
| | | <title>已添加包机机房</title>
|
| | | <meta name="viewport" content="width=device-width,initial-scale=1">
|
| | | <link rel="stylesheet" href="mobilCss/jquery.mobile-1.4.5.min.css"/> |
| | | <link rel="stylesheet" type="text/css" href="css/tbl.css">
|
| | | <script type="text/javascript" src="mobilJs/jquery-1.8.2.js"></script>
|
| | | <script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script>
|
| | | |
| | | </head>
|
| | | <body>
|
| | | <div data-role="page" id="pageone">
|
| | | |
| | | |
| | | <!-- 头部内容 -->
|
| | | <div data-role="header" data-position="fixed">
|
| | | <a href="elegroup-list-user.html" target="_top" class="ui-btn ui-corner-all ui-shadow ui-icon-back ui-btn-icon-left" style="padding-top: 0.7em; padding-bottom: 0.7em;">返回</a>
|
| | | <h1>已添加包机机房</h1>
|
| | | |
| | | </div>
|
| | | <!-- 主体内容 -->
|
| | | <div data-role="main">
|
| | | <div class="pre-page"><a href="#" class="ui-btn ui-corner-all ui-icon-carat-l ui-btn-icon-notext">图标</a></div>
|
| | | <div class="next-page"><a href="#" class="ui-btn ui-corner-all ui-icon-carat-r ui-btn-icon-notext">图标</a></div> |
| | | <!-- 表格容器 -->
|
| | | <div class="tbl-container"></div>
|
| | | <table data-role="table" class="ui-responsive ui-shadow" id="tab" >
|
| | | </table>
|
| | | </div>
|
| | | <!-- 页脚内容 -->
|
| | | <div data-role="footer" data-position="fixed" data-theme="a"> |
| | | <div data-role="navbar">
|
| | | <ul>
|
| | | <li><a href="index.html" target="_top" data-role="button" data-icon="home" data-transition="slide">首页</a></li>
|
| | | <li><a href="elegroup-batt-add.html" target="_top" data-role="button" data-icon="plus" data-transition="slide">添加</a></li>
|
| | | </ul>
|
| | | </div> |
| | | </div> |
| | | </div>
|
| | | |
| | | </body>
|
| | |
|
| | | <script type="text/javascript" src="mobilJs/base.js"></script>
|
| | | <script type="text/javascript" src="js/tbl.js"></script>
|
| | | <script type="text/javascript" src="js/echarts.js"></script>
|
| | | <script type="text/javascript" src="js/eleAnalyse.js"></script>
|
| | |
|
| | | <script type="text/javascript">
|
| | |
|
| | | var data = new Date;
|
| | | var arrTh = ['包机机房', '包机电池组'];
|
| | | var dataArr = new Array();
|
| | | dataArr = [];
|
| | | var newArrTd = [];
|
| | | var tblCon = $('.tbl-container');
|
| | | var battProducer = "";
|
| | | var Page = {
|
| | | pageSize : 10,
|
| | | pageCurr : 1,
|
| | | pageAll : 0, |
| | | };
|
| | | |
| | | var startTime = "1980-01-01";
|
| | | var endTime = new Date;
|
| | | |
| | | $(document).ready(function(){
|
| | | |
| | | searchDisCharage();
|
| | | |
| | | });
|
| | | |
| | | |
| | | function searchDisCharage(){
|
| | | loadshow();
|
| | | |
| | | arr=[];
|
| | | for(i=0;i<100;i++){arr[i]=i*10}
|
| | | createTbl(tblCon, arrTh, arr);
|
| | | loadclose();
|
| | | |
| | | }
|
| | | |
| | | |
| | | function judgepronextshow(){
|
| | | var pageNum = Math.ceil(Page.pageAll/Page.pageSize);
|
| | | console.info(Page.pageCurr);
|
| | | if (pageNum!==1){//有多页
|
| | | if (Page.pageCurr==1){
|
| | | setPageTurning(false, true); //当前页为1,隐藏左边
|
| | | }
|
| | | else if (Page.pageCurr== pageNum)
|
| | | {
|
| | | setPageTurning(true, false); //当前页为最后一页,隐藏右边
|
| | | }
|
| | | else
|
| | | {
|
| | | setPageTurning(true, true); //为中间,两边都不隐藏
|
| | | }
|
| | | }else{
|
| | | setPageTurning(false, false);
|
| | | } //只有一页,隐藏两边
|
| | | } |
| | | |
| | | |
| | | //构造查询条件对象
|
| | | function createSearchForm(){
|
| | | var temp={
|
| | | page:{
|
| | | pageCurr:Page.pageCurr,
|
| | | pageSize:Page.pageSize,
|
| | | },
|
| | | binf:{
|
| | | StationName1:$('#privince').val(),
|
| | | StationName2:$('#city').val(),
|
| | | StationName5: $('#country').val(),
|
| | | StationName:$('#homeName').val(),
|
| | | BattGroupId:$('#battgroup_name').val(),
|
| | | BattProducer:battProducer,
|
| | | MonVolStd:"0",
|
| | | |
| | | BattGroupName1:"",
|
| | | BattProductDate:startTime,
|
| | | BattProductDate1:endTime,
|
| | | BattInUseDate:startTime,
|
| | | BattInUseDate1:endTime,
|
| | | },
|
| | | uinf:{
|
| | | UId:"0",
|
| | | },
|
| | | tdata:{
|
| | | test_type:"0",
|
| | | record_time:startTime,
|
| | | record_time1:endTime,
|
| | | test_starttype:"0",
|
| | | },
|
| | | mainf:{
|
| | | /*
|
| | | remark:"100",
|
| | | maint_done_time:startTime,
|
| | | maint_done_time1:endTime,
|
| | | */
|
| | | } |
| | | };
|
| | | return temp;
|
| | | }
|
| | |
|
| | | |
| | | $(function() {
|
| | | $('.pre-page').on('click', 'a', function() {
|
| | | var isShowPre = true;
|
| | | Page.pageSize = 10;
|
| | | var pageNum = Math.ceil(Page.pageAll/Page.pageSize)
|
| | | if(Page.pageCurr>1){
|
| | | Page.pageCurr = Page.pageCurr - 1;
|
| | | searchDisCharage();
|
| | | }else { |
| | | searchDisCharage(); |
| | | }
|
| | | });
|
| | | |
| | | $('.next-page').on('click', 'a', function() {
|
| | | var isShowNext = true;
|
| | | Page.pageSize = 10;
|
| | | console.info(Page.pageAll);
|
| | | console.info(Page.pageSize);
|
| | | var pageNum = Math.ceil(Page.pageAll/Page.pageSize);
|
| | | if(Page.pageCurr<pageNum){
|
| | | Page.pageCurr = Page.pageCurr + 1;
|
| | | console.info(Page.pageCurr);
|
| | | searchDisCharage()
|
| | | }
|
| | | });
|
| | | });
|
| | | |
| | | |
| | | // 判断是否显示翻页按钮
|
| | | function setPageTurning(isShowPre, isShowNext) {
|
| | | if(isShowPre) { // 判断是否显示向上翻页按钮
|
| | | $('.pre-page').show();
|
| | | }else {
|
| | | $('.pre-page').hide();
|
| | | }
|
| | |
|
| | | if(isShowNext) { // 判断是否显示向下翻页按钮
|
| | | $('.next-page').show();
|
| | | }else {
|
| | | $('.next-page').hide();
|
| | | }
|
| | | } |
| | |
|
| | | |
| | | </script>
|
| | | </html>
|
| | |
|
| | | |
New file |
| | |
| | | <!doctype html>
|
| | | <html>
|
| | | <head>
|
| | | <meta charset="utf-8">
|
| | | <title>包机组用户列表</title>
|
| | | <meta name="viewport" content="width=device-width,initial-scale=1">
|
| | | <link rel="stylesheet" href="mobilCss/jquery.mobile-1.4.5.min.css"/>
|
| | | <link rel="stylesheet" href="css/breadcrumb.css">
|
| | | <link rel="stylesheet" type="text/css" href="css/defined.popup.css"/>
|
| | | <script type="text/javascript" src="mobilJs/jquery-1.8.2.js"></script>
|
| | | <script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script>
|
| | | <script type="text/javascript" src="mobilJs/base.js"></script>
|
| | | </head>
|
| | | <body>
|
| | | <div data-role="page" tabindex="0" id="page0">
|
| | | <div data-role="header" data-position="fixed">
|
| | | <a href="elegroup-list.html" target="_top" style="padding-top:0.7em;padding-bottom:0.7em;">返回</a>
|
| | | <h1>包机组用户列表</h1>
|
| | | </div>
|
| | | |
| | | <div data-role="content">
|
| | | <ul class="breadcrumb"></ul>
|
| | | <div id="battList"></div>
|
| | | </div>
|
| | | <div data-role="popup" id="myPopup" class="defined-popup">
|
| | | <div class="popup-container">
|
| | | <div class="popup-title">查询数据失败</div>
|
| | | <div class="popup-footer">
|
| | | <div class="footer-float footer-left">
|
| | | <button type="button" id="right" data-mini="true" style="visibility: hidden;">确定</button>
|
| | | </div>
|
| | | <div class="footer-float footer-right">
|
| | | <button type="button" id="hidePopup" data-mini="true">取消</button>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div data-role="footer" data-position="fixed">
|
| | | <!-- <h1>福光电子有限公司</h1> -->
|
| | | </div>
|
| | | </div>
|
| | | </body>
|
| | | <script type="text/javascript" src="js/battNav.js"></script>
|
| | | <script type="text/javascript">
|
| | | var citylist = new Array();
|
| | | |
| | | // 初始化页面内容
|
| | | $(document).ready(function(){
|
| | | setCookie("",null);
|
| | | setCookie("",null);
|
| | | seachAllCity();
|
| | | });
|
| | | |
| | | // 点击城市事件
|
| | | $(function () {
|
| | | var aLi = -1;
|
| | | $('#battList').on('click', 'ul li', function () {
|
| | | aLi = $(this).index();
|
| | | city = getbatt(citylist,aLi);
|
| | | |
| | | var json=window.JSON.stringify(city);
|
| | | setCookie("",json);
|
| | | window.location.href="elegroup-batt.html";
|
| | | });
|
| | | |
| | | });
|
| | | |
| | | // 定义面包屑导航条
|
| | | /* $(function(){
|
| | | var data = [
|
| | | {url: 'javascript:JumpHomePage();', txt: '首页'},
|
| | | {url: 'javascript:JumpElegroupListPage();', txt: 包机组列表'},
|
| | | {url: 'javascript:;', txt: '包机组用户列表'}
|
| | | ];
|
| | | addBreadCrumb($('.breadcrumb').eq(0),data);
|
| | | }); */
|
| | | var temp=getCookie("");
|
| | | temp = JSON.parse(temp);
|
| | | console.info(temp); |
| | | //查询所有机房
|
| | | function seachAllCity(){
|
| | | loadshow();
|
| | | var data = {
|
| | | StationName1: temp.StationName1
|
| | | };
|
| | | console.info(data);
|
| | | $.ajax({ |
| | | type: "post", |
| | | url: "", |
| | | async:true, |
| | | dataType:'text',
|
| | | data:"json = "+JSON.stringify(data), |
| | | success: function(data){ |
| | | data = eval('('+data+')');
|
| | | var model = eval('('+data.result+')');
|
| | | console.info(model);
|
| | | if(model.code == 1){
|
| | | citylist = model.data;
|
| | | createUl($('#battList'),model.data);
|
| | | }else {
|
| | | //alert(213);
|
| | | $('#myPopup').popup('open');
|
| | | }
|
| | | loadclose();
|
| | | },
|
| | | error:function(){
|
| | | loadclose();
|
| | | } |
| | | });
|
| | | }
|
| | | |
| | | /*
|
| | | 声明一个函数createUl,用于生成ul和li
|
| | | @param ulCon ul的容器
|
| | | @param dataList ul的数据内容
|
| | | */
|
| | | function createUl(ulCon, dataList) {
|
| | | //console.info(index);
|
| | | // 清理容器下的ul
|
| | | ulCon.find('ul').remove();
|
| | | |
| | | // 创建ul
|
| | | var _ul = $('<ul data-role="listview" data-inset="true"></ul>');
|
| | | |
| | | // 遍历dataList生成li和a
|
| | | for (var i = 0; i < dataList.length; i++){
|
| | | var _li = $('<li></li');
|
| | | |
| | | var _a = $('<a href="#page1" value="" data-transition="slide">'+dataList[i].StationName2+'</a>');
|
| | | |
| | | // 将_a添加到_li,将_li添加到_ul中
|
| | | _li.append(_a);
|
| | | _ul.append(_li);
|
| | | }
|
| | | |
| | | // 将_ul添加到容器中
|
| | | ulCon.append(_ul).trigger('create'); |
| | | loadclose();
|
| | | }
|
| | | |
| | | //获取当前选中的city
|
| | | function getbatt(arr,index){
|
| | | if(arr.length>index){
|
| | | return arr[index];
|
| | | }
|
| | | return undefined;
|
| | | };
|
| | | </script>
|
| | | |
| | | </html> |
New file |
| | |
| | | <!doctype html>
|
| | | <html>
|
| | | <head>
|
| | | <meta charset="utf-8">
|
| | | <title>包机组列表</title>
|
| | | <meta name="viewport" content="width=device-width,initial-scale=1">
|
| | | <link rel="stylesheet" href="mobilCss/jquery.mobile-1.4.5.min.css"/>
|
| | | <link rel="stylesheet" href="css/breadcrumb.css">
|
| | | <link rel="stylesheet" type="text/css" href="css/defined.popup.css"/>
|
| | | <script type="text/javascript" src="mobilJs/jquery-1.8.2.js"></script>
|
| | | <script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script>
|
| | | <script type="text/javascript" src="mobilJs/base.js"></script>
|
| | | </head>
|
| | | <body>
|
| | | <div data-role="page" tabindex="0" id="page0">
|
| | | <div data-role="header" data-position="fixed">
|
| | | <a href="index.html" target="_top" style="padding-top:0.7em;padding-bottom:0.7em;">返回</a>
|
| | | <h1>包机组列表</h1>
|
| | | </div>
|
| | | |
| | | <div data-role="content">
|
| | | <ul class="breadcrumb"></ul>
|
| | | <div id="battList"></div>
|
| | | </div>
|
| | | <div data-role="popup" id="myPopup" class="defined-popup">
|
| | | <div class="popup-container">
|
| | | <div class="popup-title">查询数据失败</div>
|
| | | <div class="popup-footer">
|
| | | <div class="footer-float footer-left">
|
| | | <button type="button" id="right" data-mini="true" style="visibility: hidden;">确定</button>
|
| | | </div>
|
| | | <div class="footer-float footer-right">
|
| | | <button type="button" id="hidePopup" data-mini="true">取消</button>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | <div data-role="footer" data-position="fixed">
|
| | | <!-- <h1>福光电子有限公司</h1> -->
|
| | | </div>
|
| | | </div>
|
| | | </body>
|
| | | <script type="text/javascript" src="js/battNav.js"></script>
|
| | | <script type="text/javascript">
|
| | | var stationlist = new Array();
|
| | | |
| | | // 初始化页面内容
|
| | | $(document).ready(function(){
|
| | | setCookie("",null);
|
| | | setCookie("",null);
|
| | | //seachAllStation();
|
| | | });
|
| | | |
| | | // 点击机房事件
|
| | | $(function () {
|
| | | var aLi = -1;
|
| | | $('#battList').on('click', 'ul li', function () {
|
| | | aLi = $(this).index();
|
| | | station = getbatt(stationlist,aLi);
|
| | | |
| | | var json=window.JSON.stringify(station);
|
| | | setCookie("",json);
|
| | | window.location.href="elegroup-list-user.html";
|
| | | });
|
| | | |
| | | });
|
| | | |
| | | // 定义面包屑导航条
|
| | | /* $(function(){
|
| | | var data = [
|
| | | {url: 'javascript:JumpHomePage();', txt: '首页'},
|
| | | {url: 'javascript:;', txt: '包机组列表'}
|
| | | ];
|
| | | addBreadCrumb($('.breadcrumb').eq(0),data);
|
| | | }); */
|
| | | |
| | | //查询所有市
|
| | | function seachAllStation(){
|
| | | loadshow();
|
| | | $.ajax({ |
| | | type: "post", |
| | | url: "", |
| | | async:true, |
| | | dataType:'text',
|
| | | data:null, |
| | | success: function(data){ |
| | | data = eval('('+data+')');
|
| | | var model = eval('('+data.result+')');
|
| | | console.info(model);
|
| | | if(model.code == 1){
|
| | | stationlist = model.data;
|
| | | createUl($('#battList'),model.data);
|
| | | }else {
|
| | | //alert(213);
|
| | | $('#myPopup').popup('open');
|
| | | }
|
| | | loadclose();
|
| | | },
|
| | | error:function(){
|
| | | loadclose();
|
| | | } |
| | | });
|
| | | }
|
| | | |
| | | /*
|
| | | 声明一个函数createUl,用于生成ul和li
|
| | | @param ulCon ul的容器
|
| | | @param dataList ul的数据内容
|
| | | */
|
| | | function createUl(ulCon, dataList) {
|
| | | //console.info(index);
|
| | | // 清理容器下的ul
|
| | | ulCon.find('ul').remove();
|
| | | |
| | | // 创建ul
|
| | | var _ul = $('<ul data-role="listview" data-inset="true"></ul>');
|
| | | |
| | | // 遍历dataList生成li和a
|
| | | for (var i = 0; i < dataList.length; i++){
|
| | | var _li = $('<li></li');
|
| | | |
| | | var _a = $('<a href="#page1" value="" data-transition="slide">'+dataList[i].StationName1+'</a>');
|
| | | |
| | | // 将_a添加到_li,将_li添加到_ul中
|
| | | _li.append(_a);
|
| | | _ul.append(_li);
|
| | | }
|
| | | |
| | | // 将_ul添加到容器中
|
| | | ulCon.append(_ul).trigger('create'); |
| | | loadclose();
|
| | | }
|
| | | |
| | | //获取当前选中的batt
|
| | | function getbatt(arr,index){
|
| | | if(arr.length>index){
|
| | | return arr[index];
|
| | | }
|
| | | return undefined;
|
| | | };
|
| | | </script>
|
| | | |
| | | </html> |
| | |
| | | setCookie("pages","2");
|
| | | window.location.href="machineroomM.html";
|
| | | }
|
| | | function JumpElegroupListPage(){
|
| | | setCookie("pages","4");
|
| | | window.location.href="elegroup-list.html";
|
| | | } |