From 6db4de77bb9f1554854e50778fda8d9b479d6781 Mon Sep 17 00:00:00 2001
From: hdw <496960745@qq.com>
Date: 星期五, 07 十二月 2018 13:53:08 +0800
Subject: [PATCH] Merge branch 'dev_lxw' of https://whychdw@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw
---
gx_tieta/WebRoot/pages/js/pages/siderbar.js | 745 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 739 insertions(+), 6 deletions(-)
diff --git a/gx_tieta/WebRoot/pages/js/pages/siderbar.js b/gx_tieta/WebRoot/pages/js/pages/siderbar.js
index 9ca0203..333fa50 100644
--- a/gx_tieta/WebRoot/pages/js/pages/siderbar.js
+++ b/gx_tieta/WebRoot/pages/js/pages/siderbar.js
@@ -1,19 +1,752 @@
+;(function($, window, document, gl) {
+ // 瀹氫箟TreeView鐨勫懡鍚嶇┖闂�
+ gl.namespace('pages.TreeView');
+
+ /**
+ * @param jquery ele jQuery 瀵硅薄
+ * @param Object first 绗竴灞傜殑鏁版嵁瀵硅薄
+ */
+ var TreeView = function (ele, options) {
+ this.ele = ele;
+ this.container;
+ this.init(options);
+ };
+
+ var _prop = TreeView.prototype;
+
+ // 鍒濆鍖栧鍣ㄥ苟璁剧疆鍩虹鐨勭偣鍑讳簨浠�
+ _prop.init = function(options) {
+ var _this = this;
+ // 娓呯┖瀹瑰櫒
+ this.ele.addClass('whyc-sider-menu-container');
+ this.ele.text('');
+
+ var whycTreeView = $('<div class="whyc-sider-menu"></div>');
+ this.ele.append(whycTreeView);
+
+ this.container = whycTreeView;
+ this.setContainer();
+ //this.resize(options);
+
+ // 缁欏鍣ㄥ唴瀹规坊鍔犵粦瀹氫簨浠�
+ this.ele.off('click.treeView.folder').on('click.treeView.folder', '.sider-menu-folder', function() {
+ $(this).parent().toggleClass('sider-menu-open');
+ });
+
+ this.ele.off('click.treeView.file').on('click.treeView.file', '.sider-menu-file', function() {
+ if(!$(this).hasClass('active')) {
+ _this.ele.find('.sider-menu-file').removeClass('active');
+ $(this).addClass('active');
+ }
+ });
+ };
+
+ // 璁剧疆resizable
+ _prop.resize = function(options) {
+ var _this = this;
+ var defaults = {
+ minWidth: 200,
+ maxWidth: 400
+ };
+ var opts = $.extend({}, defaults, options || {});
+ if(this.ele.resizable) {
+ this.ele.resizable({
+ handles: 'e',
+ maxWidth: opts.maxWidth,
+ minWidth: opts.minWidth,
+ alsoResize: this.container,
+ stop:function() {
+ _this.container.height('100%');
+ }
+ });
+ }
+ };
+
+ // 璁剧疆瀹瑰櫒鐨勫搴�
+ _prop.setContainer = function() {
+ var eleWidth = this.ele.width();
+ //this.container.width(eleWidth+20);
+ };
+
+ // 鐢熸垚鍒楄〃
+ _prop.treeView = function(container, data, flush) {
+ var defaults = {
+ file: false
+ };
+ // 瀛樺湪ul涓斿綋鍓嶄笉鍏佽鍒锋柊
+ if(container.find('ul').length !=0 && !flush) {
+ return;
+ }else if(flush) {
+ container.text('');
+ }
+
+ // 鍒犻櫎绛夊緟妗�
+ this.delProgress(container);
+ // 鐢熸垚鍏冪礌
+ var _ul = $('<ul></ul>');
+ for(var i=0; i<data.length; i++) {
+ var _data = $.extend({}, defaults, data[i]);
+ // 璁剧疆鍐呭瀹瑰櫒
+ var _li = $('<li></li>');
+ var _a = $('<a href="javascript:;" id="'+_data.id+'" class="sider-menu-folder"></a>');
+ var _i = $('<i class="fa fa fa-caret-right"></i>');
+ var _span = $('<span class="treeview-txt">'+_data.txt+'</span>');
+ if(_data.file) {
+ _a = $('<a href="javascript:;" id="'+_data.id+'" class="sider-menu-file"></a>');
+ _i = $('<i class="fa"></i>');
+ }
+ _a.addClass(_data.cla);
+
+ _a.append(_i);
+ _a.append(_span);
+ _li.append(_a);
+
+ // 瀛樺偍鐢熸垚鍏冪礌鐨勫��
+ _a.data('attr', _data.attr);
+
+ _ul.append(_li);
+ }
+
+ container.append(_ul);
+ };
+
+ // 鑾峰彇folder鐨勪竴鏉℃暟鎹�
+ _prop.getFolder = function (txt, cla, id,attr) {
+ var tmp = {};
+ tmp.txt = txt;
+ tmp.cla = cla;
+ tmp.id = id;
+ tmp.attr = attr;
+ return tmp;
+ };
+
+ // 鑾峰彇file鐨勪竴鏉℃暟鎹�
+ _prop.getFile =function(txt, cla, id, attr) {
+ var tmp = {};
+ tmp.txt = txt;
+ tmp.cla = cla;
+ tmp.id = id;
+ tmp.file = true;
+ tmp.attr = attr;
+ return tmp;
+ };
+
+ // 娣诲姞progressBar
+ _prop.addProgress = function(container) {
+ // 瀛樺湪灏变笉鐢ㄥ啀娣诲姞
+ if(container.find('.treeView-progressBar-container').length != 0) {
+ return;
+ }
+ var cont = $('<div class="treeView-progressBar-container" style="margin-left: 15px; margin-right: 15px;"></div>');
+ var progress = $('<div class="treeView-progressBar"></div>');
+ var progressLabel = '<div class="progress-label">鍔犺浇...</div>';
+
+ progress.append(progressLabel);
+ cont.append(progress);
+ container.append(cont);
+
+ // 璁剧疆鏍峰紡
+ progress.progressbar({
+ value: false,
+ change: function() {
+ progressLabel.text( progressbar.progressbar( "value" ) + "%" );
+ },
+ complete: function() {
+ progressLabel.text( "瀹屾垚锛�" );
+ }
+ });
+ };
+
+ // 绉婚櫎progressBar
+ _prop.delProgress = function(container) {
+ container.find('.treeView-progressBar-container').remove();
+ };
+
+ // 灞曞紑鎸囧畾鐨�
+ _prop.spreadFolder = function(cla, txt, callback) {
+ var rsCla = '.sider-menu-folder'+'.'+cla;
+ var aFolders = this.ele.find(rsCla);
+ // 娌℃湁鑾峰彇鍒板唴瀹瑰氨杩斿洖false
+ if(aFolders.length == 0) {
+ return false;
+ }
+ var tgt = aFolders.eq(0);
+ aFolders.each(function() {
+ var _txt = $(this).find('.treeview-txt').parent().attr('id');
+ if(txt == _txt) {
+ tgt = $(this);
+ }
+ });
+ tgt.parent().addClass('sider-menu-open');
+ // 璁剧疆鍥炶皟鍑芥暟骞朵笖璁剧疆榛樿鐨勫��
+ if(callback) {
+ callback(this, tgt.parent(), tgt.data('attr'));
+ }
+
+ };
+
+ _prop.activeFile = function(container, cla, id, callback) {
+ var rsCla = '.sider-menu-file'+'.'+cla;
+ var aFiles = container.find(rsCla);
+ //console.log(aFiles.length);
+ // 娌℃湁鑾峰彇鍒板唴瀹瑰氨杩斿洖false
+ if(aFiles.length == 0) {
+ return false;
+ }
+ var tgt = aFiles.eq(0);
+
+ // 閬嶅巻鍒楄〃
+ aFiles.each(function() {
+ var _id = $(this).attr('id');
+ // id鍖归厤
+ if(_id == id) {
+ tgt = $(this);
+ }
+ });
+
+ tgt.click();
+ };
+
+ // 娣诲姞鍒癵l.pages.TreeView鐨勫懡鍚嶇┖闂翠笅
+ gl.pages.TreeView = TreeView;
+})(jQuery, window, document, GLOBAL);
+
// 瀹氫箟椤甸潰涓殑siderbar缁勪欢
;(function($, window, document, gl, undefined) {
gl.namespace('pages.siderbar');
- first();
- // 鐢熸垚涓�绾у鑸�
- function first() {
+ // 鑾峰彇褰撳墠閫変腑鍐呭锛堢渷-甯�-鏈烘埧-鐢垫睜缁勶級
+ var province = getQueryString('province'); // 鐪�
+ var city = getQueryString('city'); // 甯�
+ var county = getQueryString('county'); // 鍖�/鍘�
+ var home = getQueryString('home'); // 鏈烘埧
+ var homeid = getQueryString('battid'); // 鐢垫睜缁刬d
+ //console.log(province);
+
+ // 鐢熸垚涓�绾у鑸�-鐪�
+ function first(treeView, container) {
+ //treeView.addProgress(container);
$.ajax({
type: "post",
url: "BattInfAction!serchAllStation",
async:true,
- dataType:'text',
+ dataType:'json',
data:null,
success: function(data){
- console.info(data);
+ var rs = JSON.parse(data.result);
+ if(rs.code == 1) {
+ var _data= rs.data;
+ var formatData = [];
+ for(var i=0; i<_data.length;i++) {
+ var __data = _data[i];
+ var tmp = treeView.getFolder(__data.StationName1, 'province', __data.StationName1,__data);
+ formatData.push(tmp);
+ }
+ treeView.treeView(container, formatData);
+ treeView.spreadFolder('province', province, firstSpread);
+ }else {
+
+ }
}
});
}
-})(jQuery, window, document, GLOBAL);
\ No newline at end of file
+
+ // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅
+ gl.pages.siderbar.first = first;
+
+ // 灞曞紑涓�绾у鑸�
+ function firstSpread(treeView, container, data) {
+ second(treeView, container, data, true);
+ }
+
+
+ // 鐢熸垚浜岀骇瀵艰埅-甯�
+ function second(treeView, container, data, spread) {
+ // 宸茬粡瀛樺湪
+ if(container.find('ul').length !=0) {
+ return;
+ }
+ treeView.addProgress(container);
+ $.ajax({
+ type: "post",
+ url: "BattInfAction!serchStationName2",
+ async:true,
+ dataType:'json',
+ data:"json = "+JSON.stringify(data),
+ success: function(data){
+ var rs = JSON.parse(data.result);
+ treeView.delProgress(container);
+ if(rs.code == 1) {
+ var _data= rs.data;
+ var formatData = [];
+ for(var i=0; i<_data.length;i++) {
+ var __data = _data[i];
+ var tmp = treeView.getFolder(__data.StationName2, 'city', __data.StationName2, __data);
+ formatData.push(tmp);
+ }
+ treeView.treeView(container, formatData);
+
+ if(spread) {
+ treeView.spreadFolder('city', city, secondSpread, true);
+ }
+ }else {
+
+ }
+ }
+ });
+ }
+
+ // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅
+ gl.pages.siderbar.second = second;
+
+ // 灞曞紑浜岀骇瀵艰埅
+ function secondSpread(treeView, container, data) {
+ third(treeView, container, data, true);
+ }
+
+
+ // 鐢熸垚 涓夌骇瀵艰埅-鍖�/鍘�
+ function third(treeView, container, data, spread) {
+ // 宸茬粡瀛樺湪
+ if(container.find('ul').length !=0) {
+ return;
+ }
+ treeView.addProgress(container);
+ $.ajax({
+ type: "post",
+ url: "BattInfAction!serchStationName5",
+ async:true,
+ dataType:'json',
+ data:"json = "+JSON.stringify(data),
+ success: function(data){
+ var rs = JSON.parse(data.result);
+ treeView.delProgress(container);
+ if(rs.code == 1) {
+ var _data= rs.data;
+ var formatData = [];
+ for(var i=0; i<_data.length;i++) {
+ var __data = _data[i];
+ var tmp = treeView.getFolder(__data.StationName5, 'county', __data.StationName5,__data);
+ formatData.push(tmp);
+ }
+ treeView.treeView(container, formatData);
+ if(spread) {
+ treeView.spreadFolder('county', county, thirdSpread, true);
+ }
+ }else {
+
+ }
+ }
+ });
+ }
+
+ // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅
+ gl.pages.siderbar.third = third;
+
+ // 灞曞紑涓夌骇瀵艰埅
+ function thirdSpread(treeView, container, data) {
+ var tmp = {
+ StationName1: data.StationName1,
+ StationName2: data.StationName2,
+ StationName5: data.StationName5,
+ };
+ fourth(treeView, container, tmp, true);
+ }
+
+
+ // 鐢熸垚 涓夌骇瀵艰埅-鍖�/鍘�
+ function thirdFile(treeView, container, data) {
+ // 宸茬粡瀛樺湪
+ if(container.find('ul').length !=0) {
+ return;
+ }
+ treeView.addProgress(container);
+ $.ajax({
+ type: "post",
+ url: "BattInfAction!serchStationName5",
+ async:true,
+ dataType:'json',
+ data:"json = "+JSON.stringify(data),
+ success: function(data){
+ var rs = JSON.parse(data.result);
+ treeView.delProgress(container);
+ if(rs.code == 1) {
+ var _data= rs.data;
+ var formatData = [];
+ for(var i=0; i<_data.length;i++) {
+ var __data = _data[i];
+ var tmp = treeView.getFile(__data.StationName5, 'county', '',__data);
+ formatData.push(tmp);
+ }
+ treeView.treeView(container, formatData);
+ }else {
+
+ }
+ }
+ });
+ }
+
+ // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅
+ gl.pages.siderbar.thirdFile = thirdFile;
+
+ //鐢熸垚鍥涚骇瀵艰埅-鏈烘埧
+ function fourth(treeView, container, data, spread) {
+ // 宸茬粡瀛樺湪
+ if(container.find('ul').length !=0) {
+ return;
+ }
+ treeView.addProgress(container);
+ $.ajax({
+ type: "post",
+ url: "BattInfAction!serchStationName3",
+ async:true,
+ dataType:'json',
+ data:"json = "+JSON.stringify(data),
+ success: function(data){
+ var rs = JSON.parse(data.result);
+ treeView.delProgress(container);
+ if(rs.code == 1) {
+ var _data= rs.data;
+ var formatData = [];
+ for(var i=0; i<_data.length;i++) {
+ var __data = _data[i];
+ var tmp = treeView.getFolder(__data.StationName3, 'home', __data.StationName,__data);
+ formatData.push(tmp);
+ }
+ treeView.treeView(container, formatData);
+ if(spread) {
+ treeView.spreadFolder('home', home, fourthSpread, true);
+ }
+ }else {
+
+ }
+ }
+ });
+ }
+
+ // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅
+ gl.pages.siderbar.fourth = fourth;
+
+ // 灞曞紑鍥涚骇瀵艰埅
+ function fourthSpread(treeView, container, data) {
+ var tmp = {
+ StationName1: data.StationName1,
+ StationName2: data.StationName2,
+ StationName5: data.StationName5,
+ StationName: data.StationName,
+ StationId: data.StationId
+ };
+ fifth(treeView, container, tmp, true);
+ }
+
+ // 鐢熸垚浜旂骇瀵艰埅-鐢垫睜缁�
+ function fifth(treeView, container, data, active) {
+ // 宸茬粡瀛樺湪
+ if(container.find('ul').length !=0) {
+ return;
+ }
+ treeView.addProgress(container);
+ $.ajax({
+ type: "post",
+ url: "BattInfAction!serchBattByStation",
+ async:true,
+ dataType:'json',
+ data:"json = "+JSON.stringify(data),
+ success: function(data){
+ var rs = JSON.parse(data.result);
+ treeView.delProgress(container);
+ if(rs.code == 1) {
+ var _data= rs.data;
+ //console.log(_data);
+ var formatData = [];
+ for(var i=0; i<_data.length;i++) {
+ var __data = _data[i];
+ var tmp = treeView.getFile(__data.BattGroupName, 'eleGroup', __data.BattGroupId, __data);
+ formatData.push(tmp);
+ }
+ treeView.treeView(container, formatData);
+ //console.info(formatData);
+ if(active) {
+ treeView.activeFile(container,'eleGroup', homeid);
+ var battId = formatData[0].id;
+ location.hash="#"+battId;
+ location.hash = "";
+ }
+ }else {
+
+ }
+ }
+ });
+ }
+ // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅
+ gl.pages.siderbar.fifth = fifth;
+})(jQuery, window, document, GLOBAL);
+
+
+// 璁剧疆鏍规嵁鐪佸競鏈烘埧鍜岀數姹犺繘琛屽畾浣�
+;(function($, window, document, gl, undefined) {
+ gl.namespace('pages.siderbar');
+
+ var homeInfo = {
+ StationName1: '',
+ StationName2: '',
+ StationName: '',
+ StationId: ''
+ };
+
+ var battId=undefined;
+
+ // 瀹氫綅鏈烘埧
+ function localSideBar(treeView, container, data) {
+ // 鍏抽棴鎵�鏈夌殑
+ treeView.ele.find('li').removeClass('sider-menu-open');
+
+
+ first(treeView, container);
+ homeInfo.StationName1 = data.province;
+ homeInfo.StationName2 = data.city;
+ homeInfo.StationName5 = data.county;
+ homeInfo.StationName = data.home;
+ homeInfo.StationId = data.homeid;
+ battId = data.battid;
+ }
+
+ // 灏嗗嚱鏁扮粦瀹氬埌GLOBAL.pages.siderbar鐨勫懡鍚嶇┖闂翠笅
+ gl.pages.siderbar.localSideBar = localSideBar;
+
+ // 鐢熸垚涓�绾у鑸�-鐪�
+ function first(treeView, container) {
+ //treeView.addProgress(container);
+ $.ajax({
+ type: "post",
+ url: "BattInfAction!serchAllStation",
+ async:true,
+ dataType:'json',
+ data:null,
+ success: function(data){
+ var rs = JSON.parse(data.result);
+ if(rs.code == 1) {
+ var _data= rs.data;
+ var formatData = [];
+ for(var i=0; i<_data.length;i++) {
+ var __data = _data[i];
+ var tmp = treeView.getFolder(__data.StationName1, 'province', __data.StationName1,__data);
+ formatData.push(tmp);
+ }
+ treeView.treeView(container, formatData);
+ treeView.spreadFolder('province', homeInfo.StationName1, firstSpread);
+ }else {
+
+ }
+ }
+ });
+ }
+
+ // 灞曞紑涓�绾у鑸�
+ function firstSpread(treeView, container) {
+ second(treeView, container, homeInfo, true);
+ }
+
+
+ // 鐢熸垚浜岀骇瀵艰埅-甯�
+ function second(treeView, container, data, spread) {
+ // 宸茬粡瀛樺湪
+ if(container.find('ul').length !=0) {
+ treeView.spreadFolder('city', homeInfo.StationName2, secondSpread, true);
+ return;
+ }
+ treeView.addProgress(container);
+ $.ajax({
+ type: "post",
+ url: "BattInfAction!serchStationName2",
+ async:true,
+ dataType:'json',
+ data:"json = "+JSON.stringify(data),
+ success: function(data){
+ var rs = JSON.parse(data.result);
+ treeView.delProgress(container);
+ if(rs.code == 1) {
+ var _data= rs.data;
+ var formatData = [];
+ for(var i=0; i<_data.length;i++) {
+ var __data = _data[i];
+ var tmp = treeView.getFolder(__data.StationName2, 'city', __data.StationName2, __data);
+ formatData.push(tmp);
+ }
+ treeView.treeView(container, formatData);
+
+ if(spread) {
+ treeView.spreadFolder('city', homeInfo.StationName2, secondSpread);
+ }
+ }
+ }
+ });
+ }
+
+ // 灞曞紑浜岀骇瀵艰埅
+ function secondSpread(treeView, container) {
+ third(treeView, container, homeInfo, true);
+ }
+
+
+ // 鐢熸垚 涓夌骇瀵艰埅-鍖�/鍘�
+ function third(treeView, container, data, spread) {
+ // 宸茬粡瀛樺湪
+ if(container.find('ul').length !=0) {
+ location.hash="#"+homeInfo.StationName5;
+ location.hash="";
+ treeView.spreadFolder('county', homeInfo.StationName5, thirdSpread, true);
+ return;
+ }
+ treeView.addProgress(container);
+ $.ajax({
+ type: "post",
+ url: "BattInfAction!serchStationName5",
+ async:true,
+ dataType:'json',
+ data:"json = "+JSON.stringify(data),
+ success: function(data){
+ var rs = JSON.parse(data.result);
+ treeView.delProgress(container);
+ if(rs.code == 1) {
+ var _data= rs.data;
+ var formatData = [];
+ for(var i=0; i<_data.length;i++) {
+ var __data = _data[i];
+ var tmp = treeView.getFolder(__data.StationName5, 'county', __data.StationName5, __data);
+ formatData.push(tmp);
+ }
+ treeView.treeView(container, formatData);
+ if(spread) {
+ location.hash="#"+homeInfo.StationName5;
+ location.hash="";
+ treeView.spreadFolder('county', homeInfo.StationName5, thirdSpread, true);
+ }
+ }
+ }
+ });
+ }
+
+ // 灞曞紑涓夌骇瀵艰埅
+ function thirdSpread(treeView, container, data) {
+ fourth(treeView, container, homeInfo, true);
+ }
+
+ // 鐢熸垚 鍥涚骇瀵艰埅-鏈烘埧
+ function fourth(treeView, container, data, spread) {
+ // 宸茬粡瀛樺湪
+ if(container.find('ul').length !=0) {
+ location.hash="#"+homeInfo.StationName;
+ location.hash="";
+ treeView.spreadFolder('home', homeInfo.StationName, fourthSpread, true);
+ return;
+ }
+ treeView.addProgress(container);
+ $.ajax({
+ type: "post",
+ url: "BattInfAction!serchStationName3",
+ async:true,
+ dataType:'json',
+ data:"json = "+JSON.stringify(data),
+ success: function(data){
+ var rs = JSON.parse(data.result);
+ treeView.delProgress(container);
+ if(rs.code == 1) {
+ var _data= rs.data;
+ var formatData = [];
+ for(var i=0; i<_data.length;i++) {
+ var __data = _data[i];
+ var tmp = treeView.getFolder(__data.StationName3, 'home', __data.StationName, __data);
+ formatData.push(tmp);
+ }
+ treeView.treeView(container, formatData);
+ if(spread) {
+ location.hash="#"+homeInfo.StationName;
+ location.hash="";
+ treeView.spreadFolder('home', homeInfo.StationName, fourthSpread, true);
+ }
+ }
+ }
+ });
+ }
+
+
+ // 灞曞紑涓夌骇瀵艰埅
+ function fourthSpread(treeView, container, data) {
+ fifth(treeView, container, homeInfo, true);
+ }
+
+
+
+ // 鐢熸垚 浜旂骇瀵艰埅-鐢垫睜缁�
+ function fifth(treeView, container, data, active) {
+ // 宸茬粡瀛樺湪
+ if(container.find('ul').length !=0) {
+ container.addClass('sider-menu-open');
+ if(battId) {
+ treeView.activeFile(container,'eleGroup', battId);
+ }else {
+ treeView.activeFile(container,'eleGroup', '');
+ }
+ return;
+ }
+ treeView.addProgress(container);
+ $.ajax({
+ type: "post",
+ url: "BattInfAction!serchBattByStation",
+ async:true,
+ dataType:'json',
+ data:"json = "+JSON.stringify(data),
+ success: function(data){
+ var rs = JSON.parse(data.result);
+ treeView.delProgress(container);
+ if(rs.code == 1) {
+ var _data= rs.data;
+ //console.log(_data);
+ var formatData = [];
+ for(var i=0; i<_data.length;i++) {
+ var __data = _data[i];
+ var tmp = treeView.getFile(__data.BattGroupName, 'eleGroup', __data.BattGroupId, __data);
+ formatData.push(tmp);
+ }
+ treeView.treeView(container, formatData);
+ if(active) {
+ if(battId) {
+ treeView.activeFile(container,'eleGroup', battId);
+ location.hash="#"+battId;
+ location.hash="";
+ }else {
+ treeView.activeFile(container,'eleGroup', '');
+ }
+ }
+ }
+ }
+ });
+ }
+})(jQuery, window, document, GLOBAL);
+
+//鐢熸垚鍏呮斁鐢电洃娴嬫ā鍧楀唴瀹�
+function createBattListen(ele, list) {
+ ele.text("");
+ var discharge_num = 0;
+ var charge_num = 0;
+ var ul = $('<ul></ul>');
+ for(var i = 0; i < list.length; i++) {
+ var li = "";
+ if(list[i].isCharge) {
+ li = $('<li><a href="javascript:;" class="batt-charge" value="'+list[i].val+'" note="'+list[i].note+'">'+list[i].val+'鐢垫睜缁勫厖鐢垫祴璇�!</a></li>');
+ charge_num++;
+ }else {
+ li = $('<li><a href="javascript:;" class="batt-discharge" value="'+list[i].val+'" note="'+list[i].note+'">'+list[i].val+'鐢垫睜缁勬斁鐢垫祴璇�!</a></li>');
+ discharge_num++;
+ }
+
+ li.data('attr', list[i]);
+ ul.append(li);
+
+ }
+
+ $('#ele_content .batt-listen .count-num').find('span').eq(0).text(discharge_num);
+ $('#ele_content .batt-listen .count-num').find('span').eq(1).text(charge_num);
+ ele.append(ul);
+}
\ No newline at end of file
--
Gitblit v1.9.1