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/common.js | 41 ++++++++++++++++++++++++++++++++++++++---
1 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/gx_tieta/WebRoot/pages/js/common.js b/gx_tieta/WebRoot/pages/js/common.js
index 5a80746..fe0877c 100644
--- a/gx_tieta/WebRoot/pages/js/common.js
+++ b/gx_tieta/WebRoot/pages/js/common.js
@@ -549,7 +549,7 @@
// 瀵煎嚭鎶ヨ〃
;(function($, window, document, gl, undefined) {
// 瀹氫箟testVal鐨勫懡鍚嶇┖闂�
- gl.namespace('expExcel');
+ gl.namespace('Table');
var ExpExcel = function() {
this.thead = ''; // 琛ㄦ牸鐨勫ご閮�
this.tbody = ''; // 琛ㄦ牸鐨勫唴瀹�
@@ -678,9 +678,44 @@
var expExcel = new ExpExcel();
- console.log(expExcel);
+ //console.log(expExcel);
// 缁戝畾瀵煎嚭鏁版嵁瀵硅薄
- GLOBAL.expExcel = expExcel;
+ GLOBAL.Table.expExcel = expExcel;
+
+
+ //鏋勯�犲鍑鸿〃鏍煎璞�
+ function createTableData(tOptions){
+ var thead_arr = new Array(); //琛ㄥご鏁版嵁鏁扮粍
+ var thody_arr = new Array(); //琛ㄦ牸鏁版嵁鏁扮粍
+ var proname_arr = new Array(); //灞炴�у悕鏁扮粍
+ //console.info(tOptions);
+ if(tOptions != undefined){
+ //鏋勯�犺〃澶存暟缁�
+ for(var i = 0;i< tOptions.cols.length;i++){
+ var _th = tOptions.cols[i];
+ for(var k=0;k<_th.length;k++){
+ if(_th[k].field != undefined){
+ proname_arr.push(_th[k].field);
+ thead_arr.push(_th[k].title);
+ }
+ }
+ }
+ //鏋勯�犺〃鏍煎唴閮ㄦ暟鎹暟缁�
+ for(var j = 0;j < tOptions.data.length;j++){
+ var _data = tOptions.data[j];
+ for(var k=0;k<proname_arr.length;k++){
+ thody_arr.push(_data[proname_arr[k]]);
+ }
+ }
+ }
+ return {
+ thead: [thead_arr],
+ tbody:[thody_arr]
+ };
+ }
+
+ // 缁戝畾瀵煎嚭鏁版嵁瀵硅薄
+ GLOBAL.Table.cTblData = createTableData;
})(jQuery, window, document, GLOBAL);
// 鐢熸垚闃块噷鍥炬爣鐨勫厓绱�
--
Gitblit v1.9.1