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/pages/js/pages/index-common.js | 4 +
gx_tieta/WebRoot/index.jsp | 58 ++++++++++++++++------------
2 files changed, 36 insertions(+), 26 deletions(-)
diff --git a/gx_tieta/WebRoot/index.jsp b/gx_tieta/WebRoot/index.jsp
index 745e6a6..b17e1e2 100644
--- a/gx_tieta/WebRoot/index.jsp
+++ b/gx_tieta/WebRoot/index.jsp
@@ -3770,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);
+ }
+ });
+ });
}
});
}
diff --git a/gx_tieta/WebRoot/pages/js/pages/index-common.js b/gx_tieta/WebRoot/pages/js/pages/index-common.js
index 6a683c0..8a0c0f8 100644
--- a/gx_tieta/WebRoot/pages/js/pages/index-common.js
+++ b/gx_tieta/WebRoot/pages/js/pages/index-common.js
@@ -45,10 +45,12 @@
var data = rs.data[0];
var rsStatus = formaterPieStauts(data);
pieItems = getPieList(rsStatus);
+ }else {
+ pieItems = getPieList([1, 1, 1, 1]);
}
}
});
-
+ //console.log(pieItems);
return pieItems;
}
--
Gitblit v1.9.1