From 757b5f5e674abd212586a0af94577dec4cc46c2d Mon Sep 17 00:00:00 2001 From: hdw <496960745@qq.com> Date: 星期四, 25 十月 2018 11:57:16 +0800 Subject: [PATCH] 导航定位 --- gx_tieta/WebRoot/index.jsp | 68 ++++++++++++++++++++++++++++++++-- 1 files changed, 64 insertions(+), 4 deletions(-) diff --git a/gx_tieta/WebRoot/index.jsp b/gx_tieta/WebRoot/index.jsp index d81e5ce..2064a1b 100644 --- a/gx_tieta/WebRoot/index.jsp +++ b/gx_tieta/WebRoot/index.jsp @@ -3390,10 +3390,22 @@ id: 'pie', title: '楗肩姸鍥鹃厤缃�', maxHeight: 450, - yes: function(index, kk) { + 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); + } + }); - }, - content: html + var temp = structUpdatePie(iptArr); + layer.load(); + updateUserBieState(temp); + } }); }); } @@ -3411,7 +3423,6 @@ var tmp = {}; var num = i+1; var key = 'echarts'+num+'_enable'; - console.log(key); tmp.name = pieType[i].name; tmp.status = result[key]; data.tblData.push(tmp); @@ -3419,6 +3430,55 @@ return data; } + + + // 鏋勯�犳洿鏂伴ゼ鐘跺浘鍙傛暟 + function structUpdatePie(arr) { + var rs = { + echarts1_enable:0, + echarts2_enable:0, + echarts3_enable:0, + echarts4_enable:0, + echarts5_enable:0, + echarts6_enable:0, + echarts7_enable:0, + echarts8_enable:0, + echarts9_enable:0, + echarts10_enable:0 + }; + + // 閬嶅巻arr缁檙s鍊奸噸瀹氫箟 + for(var i=0; i<arr.length; i++) { + var num = i+1; + var key = 'echarts'+num+'_enable'; + rs[key] = arr[i]; + } + + return rs; + } + + // 鏇存柊褰撳墠鐢ㄦ埛璁剧疆楗肩姸鍥剧殑浣胯兘鐘舵�� + function updateUserBieState(temp, dialog, load){ + // 鏇存柊鍚庡彴鏁版嵁 + $.ajax({ + type:"post", + url: "Echarts_usrAction!add", + async:true, + dataType:'json', + data:'json='+JSON.stringify(temp), + success: function(data){ + layer.closeAll(); + + var model = eval('('+data.result+')'); + if(model.code == 1) { + layer.msg('閰嶇疆鎴愬姛锛侊紒锛�'); + }else { + layer.msg('閰嶇疆澶辫触锛侊紒锛�'); + } + } + }); + } + }); </script> </html> -- Gitblit v1.9.1