From 7745715cf591176567807c7f0bf6abc561521de8 Mon Sep 17 00:00:00 2001
From: hdw <496960745@qq.com>
Date: 星期五, 30 十一月 2018 11:33:30 +0800
Subject: [PATCH] 修改饼状图显示逻辑
---
gx_tieta/WebRoot/index.jsp | 86 +++++++++++++++++++++++++++++-------------
1 files changed, 59 insertions(+), 27 deletions(-)
diff --git a/gx_tieta/WebRoot/index.jsp b/gx_tieta/WebRoot/index.jsp
index c31ca2f..b17e1e2 100644
--- a/gx_tieta/WebRoot/index.jsp
+++ b/gx_tieta/WebRoot/index.jsp
@@ -1250,12 +1250,34 @@
{name:"缁埅涓嶈冻1灏忔椂",val:data[0],color:'#FF0000'}
,{name:"缁埅1~2灏忔椂",val:data[1],color:'#D1D105'}
,{name:"缁埅2~3灏忔椂",val:data[2],color:'#31CB36'}
- ,{name:"缁埅3灏忔椂浠ヤ笂",val:data[3],color:'#800080'}
+ ,{name:"缁埅3灏忔椂浠ヤ笂",val:data[3],color:'#619FA7'}
];
if(!isEcharts) {
//鍒涘缓鐢垫睜鏁呴殰楗肩姸鍥�
createPie(endurPie,endurTle,endurObj);
+
+ // 鐐瑰嚮楗肩姸鍥捐繘琛岃烦杞�
+ endurPie.on('click', function(param) {
+ var str = '';
+ switch(param.dataIndex) {
+ case 0:
+ str = 'timelong=60';
+ break;
+ case 1:
+ str = 'timelong=120';
+ break;
+ case 2:
+ str = 'timelong=180';
+ break;
+ case 3:
+ str = 'is_stand=0';
+ break;
+ }
+
+ window.open('batt-life-manage.jsp?'+str); // 璺宠浆鍒拌惤鍚庡崟浣撴煡璇�
+ });
+
}else {
var opts = getOpt(endurTle, endurObj);
endurPie.setOption(opts);
@@ -2543,7 +2565,7 @@
// 鏄剧ず鍖哄煙鐨勫浘鏍�
bmap.setDots(allStation);
bmap.queryInRect(map, createMapDot);
- updateStation(setRect);
+ updateStation();
// 鏇存柊灏忓伐鍏锋悳绱㈡満鎴垮姛鑳�
updateSearchSource(allStation);
@@ -3007,6 +3029,8 @@
//console.info(allStation);
console.info(allStation);
var temp = getStationMap(allStation, mk.point);
+ console.info(temp);
+ temp.StationName = temp.title;
if(confirm("纭浠庡湴鍥句笂鍒犻櫎'"+temp.title+"'鐨勪綅缃俊鎭悧锛�")){
if(temp != undefined){
var json = JSON.stringify(temp);
@@ -3746,35 +3770,43 @@
data:null,
success: function(data){
var model = eval('('+data.result+')');
+ var resData;
if(model.code == 1) {
var result = model.data;
- //console.log(result);
- var formatData = formatPieRsData(result[0]);
- laytpl(pieConfTpl).render(formatData, function(html) {
- layer.open({
- id: 'pie',
- title: '楗肩姸鍥鹃厤缃�',
- maxHeight: 450,
- content: html,
- yes: function(index) {
- var iptList = $('#tplTblOpts .tpl-tbl-opts-header input[type=checkbox]');
- var iptArr = [];
- iptList.each(function() {
- if($(this).is(':checked')) {
- iptArr.push(1);
- }else {
- iptArr.push(0);
- }
- });
-
- var temp = structUpdatePie(iptArr);
- layer.load();
- updateUserBieState(temp);
- }
- });
- });
+ resData = result[0];
+ }else {
+ resData = {
+ echarts1_enable:1,
+ echarts2_enable:1,
+ echarts3_enable:1,
+ echarts4_enable:1
+ };
}
+ // 鏍煎紡鑾峰彇鍒扮殑鏁版嵁
+ var formatData = formatPieRsData(resData);
+ laytpl(pieConfTpl).render(formatData, function(html) {
+ layer.open({
+ id: 'pie',
+ title: '楗肩姸鍥鹃厤缃�',
+ maxHeight: 450,
+ content: html,
+ yes: function(index) {
+ var iptList = $('#tplTblOpts .tpl-tbl-opts-header input[type=checkbox]');
+ var iptArr = [];
+ iptList.each(function() {
+ if($(this).is(':checked')) {
+ iptArr.push(1);
+ }else {
+ iptArr.push(0);
+ }
+ });
+ var temp = structUpdatePie(iptArr);
+ layer.load();
+ updateUserBieState(temp);
+ }
+ });
+ });
}
});
}
--
Gitblit v1.9.1