From 265e07e56a6abfac6c5aa941397dcbca573d18af Mon Sep 17 00:00:00 2001
From: hdw <496960745@qq.com>
Date: 星期一, 12 十一月 2018 11:42:10 +0800
Subject: [PATCH] 添加面板

---
 gx_tieta/WebRoot/js/elecircle.content.js |   94 +++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 90 insertions(+), 4 deletions(-)

diff --git a/gx_tieta/WebRoot/js/elecircle.content.js b/gx_tieta/WebRoot/js/elecircle.content.js
index 6ae94b9..265753a 100644
--- a/gx_tieta/WebRoot/js/elecircle.content.js
+++ b/gx_tieta/WebRoot/js/elecircle.content.js
@@ -812,7 +812,18 @@
         }
         this.ele.append(_ul);
     };
-
+    
+    // 璁剧疆閰嶇疆椤�
+    _prop.setOpts = function(options) {
+    	this.options = options;
+        
+        this._init();
+        
+        if(this.options.length != 0) {
+            this.show();
+        }
+    };
+    
     // 鏍规嵁閰嶇疆椤圭殑鍊艰幏鍙杔i
     _prop._setLi = function(li, option) {
         var _i, _a = $('<a></a>');
@@ -838,6 +849,9 @@
         	}
         	var list = option.content.list[option.status]?option.content.list[option.status]:'鏈煡';
         	var txt = option.content.text+list;
+        	_a.append(txt);
+        }else if(option.type == 'text') {
+        	var txt = option.content.text;
         	_a.append(txt);
         }
         
@@ -884,6 +898,29 @@
             }
         }
 
+    };
+    
+    // 璁剧疆鏂囨湰鍐呭
+    _prop.setText = function(name, text, notShow) {
+    	var _itemList = this.ele.find('li');
+    	// 閬嶅巻閰嶇疆椤�
+        for(var i =0; i<this.options.length; i++) {
+        	var _opts = this.options[i];    // 鑾峰彇褰撳墠寰幆鐨勫彉閲�
+        	// 鏍规嵁鍚嶇О纭畾鏇存敼鐨勫唴瀹�
+            if(_opts.name == name) {
+                var _tmp = $.extend({}, _opts); // 鑾峰彇鍏ㄦ柊瀵硅薄锛岄伩鍏嶅紩鐢ㄤ紶閫�
+                _tmp.content.text = text;
+                
+                // 璁剧疆鏄惁鏄剧ず
+                if(notShow) {
+                	_tmp.notShow = true;
+                }else {
+                	_tmp.notShow = false;
+                }
+                
+                this._setLi(_itemList.eq(i), _tmp); // 鏇存柊li鐨勫唴瀹�
+            }
+        }
     };
     var options = [
 		{
@@ -935,6 +972,53 @@
         	}
         }
     ];
+    // 61850閰嶇疆椤�
+    gl.circleStatus.e61850Opts = options;
+    
+    var optionsBts = [
+		{
+			name: 'workstatus',
+			type: 'list',
+			notShow: false,
+			imgCallback: gl.statusImg.getImg,
+			status: 0,
+			content: {
+				list:gl.BTS9100.workstates,
+				text: '璁惧鐘舵��:'
+			}
+		},
+		{
+			name: 'stop',
+			type: 'list',
+			status: 0,
+			notShow: false,
+			content: {
+				list:gl.BTS9100.alarmstates,
+				text: '涓婁竴娆℃牳瀹圭粓姝㈠師鍥狅細'
+			}
+		},
+		{
+			name: 'count',
+			type: 'text',
+			status: 0,
+			notShow: false,
+			content: {
+				text: '閫氫俊璁℃暟:'
+			}
+		},
+		{
+			name: 'percent',
+			type: 'text',
+			status: 0,
+			notShow: false,
+			content: {
+				text:'閫氫俊涓㈠寘鐜�:'
+			}
+		}
+    ];
+    // bts9100閰嶇疆椤�
+    gl.circleStatus.btsOpts = optionsBts;
+    
     var status = new Status($('#eleCircleStatus'), options);
     gl.circleStatus.status = status;
     
@@ -955,9 +1039,6 @@
     		var data = model.data[0];
         	var alarmstatus = data.dev_alarmstate;	//[0:'鏃�',1:'鏆傚仠',2:'鏀剧數娴嬭瘯',3:'鏀剧數绛夊緟',4:'闄愭祦鍏呯數',5:'鐩存祦鍏呯數',6:'鍏呯數绛夊緟',7:'娴嬭瘯鏃堕棿鍒�',8:'娴嬭瘯瀹归噺鍒�',9:'鍗曚綋涓嬮檺鍒�',10:'缁勭涓嬮檺鍒�',11:'甯傜數寮傚父',12:'瀛樺偍鍗′笉瓒�',13:'璐熻浇娓╁害楂�',14:'鐢垫祦寮傚父',15:'杩滅▼閫氫俊鍧�',16:'璐熻浇閫氫俊鍧�',17:'閫夋嫨閫氫俊鍧�',18:'璐熻浇鐢垫祦鍧�',19:'鍐呭瓨鐢宠鍧�',20:'鏈煡'];
     		var workstatus =parseInt(data.dev_workstate) ;	//[0:'鍦ㄧ嚎鐩戞祴',1:'鏀剧數娴嬭瘯',2:'鍏呯數娴嬭瘯',3:'鍐呴樆娴嬭瘯',4:'鏈煡'];
-        	if(typeof callback == 'function') {
-        		callback.call({}, data);
-        	}
         	// 鍒ゆ柇workstatus
         	switch(workstatus) {
         		case 0:	{	// 娴厖鐘舵��
@@ -1020,6 +1101,11 @@
         		}
         		break;
         	}
+        	
+        	// 璁剧疆宸︿笂鏂瑰唴瀹�
+        	if(typeof callback == 'function') {
+        		callback.apply({}, [batt, data, mygraph]);
+        	}
     	}else {
     		mygraph.graphtype = 4 ;
 			_str = '(鏈繛鎺�)';

--
Gitblit v1.9.1