| | |
| | | gl.CMD.batt.set = 0x37; // 设置电池参数
|
| | | })(jQuery, window, document, GLOBAL);
|
| | |
|
| | | // 问题类型
|
| | | ;(function($, window, document, gl, undefined) {
|
| | | // HomeQues的命名空间
|
| | | gl.namespace('HomeQues');
|
| | | var lists = ['电池问题', '电源问题', '空调问题', '漏水问题', 'BTS设备问题', 'GPRS模块问题', '施工安装问题', '铁锂电池问题', '其他问题'];
|
| | | |
| | | // 将questions绑定到HomeQues下
|
| | | gl.HomeQues.lists = lists;
|
| | | |
| | | // 获取option列表
|
| | | function getOptions(bool) {
|
| | | var options = '';
|
| | | // 是否添加全部选项
|
| | | if(bool) {
|
| | | options += '<option value="-1">全部</option>';
|
| | | }
|
| | | // 遍历lists返回所有的option
|
| | | for(var i=0; i<lists.length; i++) {
|
| | | options += '<option value="'+i+'">'+lists[i]+'</option>';
|
| | | }
|
| | | return options;
|
| | | }
|
| | | |
| | | // 将getOptions绑定到HomeQues下
|
| | | gl.HomeQues.getOptions = getOptions;
|
| | | |
| | | // 获取故障类型layuiBtn
|
| | | function getLayuiBtn(num) {
|
| | | var txt = lists[num];
|
| | | return '<a href="javascript:;" class="layui-btn layui-btn-xs">'+txt+'</a>';
|
| | | }
|
| | | |
| | | // 将getLayuiBtn绑定到HomeQues下
|
| | | gl.HomeQues.getLayuiBtn = getLayuiBtn;
|
| | | |
| | | })(jQuery, window, document, GLOBAL);
|
| | |
|
| | | // 地图信息
|
| | | ;(function($, window, document, gl, undefined) {
|
| | | // 定义BMap的命名空间
|
| | |
| | | // 导出报表
|
| | | ;(function($, window, document, gl, undefined) {
|
| | | // 定义testVal的命名空间
|
| | | gl.namespace('expExcel');
|
| | | gl.namespace('Table');
|
| | | var ExpExcel = function() {
|
| | | this.thead = ''; // 表格的头部
|
| | | this.tbody = ''; // 表格的内容
|
| | |
| | |
|
| | |
|
| | | var expExcel = new ExpExcel();
|
| | | console.log(expExcel);
|
| | | //console.log(expExcel);
|
| | | // 绑定导出数据对象
|
| | | GLOBAL.expExcel = expExcel; |
| | | GLOBAL.Table.expExcel = expExcel;
|
| | | |
| | | |
| | | //构造导出表格对象
|
| | | function createTableData(tOptions){
|
| | | var thead_arr = new Array(); //表头数据数组
|
| | | var thody_arr = new Array(); //表格数据数组
|
| | | var proname_arr = new Array(); //属性名数组
|
| | | //console.info(tOptions); |
| | | if(tOptions != undefined){ |
| | | //构造表头数组 |
| | | for(var i = 0;i< tOptions.cols.length;i++){
|
| | | var _th = tOptions.cols[i];
|
| | | for(var k=0;k<_th.length;k++){ |
| | | if(_th[k].field != undefined){ |
| | | proname_arr.push(_th[k].field);
|
| | | thead_arr.push(_th[k].title);
|
| | | }
|
| | | }
|
| | | }
|
| | | //构造表格内部数据数组
|
| | | for(var j = 0;j < tOptions.data.length;j++){
|
| | | var _data = tOptions.data[j];
|
| | | for(var k=0;k<proname_arr.length;k++){
|
| | | thody_arr.push(_data[proname_arr[k]]);
|
| | | }
|
| | | }
|
| | | }
|
| | | return {
|
| | | thead: [thead_arr],
|
| | | tbody:[thody_arr]
|
| | | };
|
| | | }
|
| | | |
| | | // 绑定导出数据对象
|
| | | GLOBAL.Table.cTblData = createTableData;
|
| | | })(jQuery, window, document, GLOBAL);
|
| | |
|
| | | // 生成阿里图标的元素
|