From a7a255f452ce799db776cf07c81dbe45039d7389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E7=A5=A5=E7=86=A0?= Date: Mon, 13 Sep 2021 02:21:57 +0000 Subject: [PATCH] Merge branch 'cherry-pick-67e45b01' into 'wrdp_java8' Merge branch 'fix/export_More_than_26' into 'wrdp' See merge request o2oa/o2oa!5378 (cherry picked from commit 00314c7d030a69653bd19fb264a3042bb422fe9b) c0d8f853 Merge branch 'fix/export_More_than_26' into 'wrdp' --- .../x_component_process_Xform/DatagridPC.js | 3 ++- .../x_component_process_Xform/DatatablePC.js | 3 ++- .../x_component_process_Xform/Datatemplate.js | 3 ++- .../source/x_component_query_Query/Importer.js | 3 ++- .../source/x_component_query_Query/Statement.js | 3 ++- .../x_component_query_TableDesigner/Table.js | 17 ++++++++++++++++- 6 files changed, 26 insertions(+), 6 deletions(-) diff --git a/o2web/source/x_component_process_Xform/DatagridPC.js b/o2web/source/x_component_process_Xform/DatagridPC.js index ec79d72106..0b29c27f76 100644 --- a/o2web/source/x_component_process_Xform/DatagridPC.js +++ b/o2web/source/x_component_process_Xform/DatagridPC.js @@ -2644,7 +2644,8 @@ MWF.xApplication.process.Xform.DatagridPC.ExcelUtils = new Class({ if( !colWidthArr )widthArray.push( {wpx: 100} ); - var at = String.fromCharCode(97 + i).toUpperCase(); + // var at = String.fromCharCode(97 + i).toUpperCase(); + var at = this.index2ColName(i); var di = dataInfo[at+"1"]; // di.v = v; // di.t = "s"; diff --git a/o2web/source/x_component_process_Xform/DatatablePC.js b/o2web/source/x_component_process_Xform/DatatablePC.js index c0a2b9bfd5..3e0d4ea00e 100644 --- a/o2web/source/x_component_process_Xform/DatatablePC.js +++ b/o2web/source/x_component_process_Xform/DatatablePC.js @@ -2659,7 +2659,8 @@ MWF.xApplication.process.Xform.DatatablePC.ExcelUtils = new Class({ if( !colWidthArr )widthArray.push( {wpx: 100} ); - var at = String.fromCharCode(97 + i).toUpperCase(); + // var at = String.fromCharCode(97 + i).toUpperCase(); + var at = this.index2ColName(i); var di = dataInfo[at+"1"]; // di.v = v; // di.t = "s"; diff --git a/o2web/source/x_component_process_Xform/Datatemplate.js b/o2web/source/x_component_process_Xform/Datatemplate.js index 6fd89720e2..05707ea0ee 100644 --- a/o2web/source/x_component_process_Xform/Datatemplate.js +++ b/o2web/source/x_component_process_Xform/Datatemplate.js @@ -2211,7 +2211,8 @@ MWF.xApplication.process.Xform.Datatemplate.ExcelUtils = new Class({ if( !colWidthArr )widthArray.push( {wpx: 100} ); - var at = String.fromCharCode(97 + i).toUpperCase(); + // var at = String.fromCharCode(97 + i).toUpperCase(); + var at = this.index2ColName(i); var di = dataInfo[at+"1"]; // di.v = v; // di.t = "s"; diff --git a/o2web/source/x_component_query_Query/Importer.js b/o2web/source/x_component_query_Query/Importer.js index 11959e6992..9918678b62 100644 --- a/o2web/source/x_component_query_Query/Importer.js +++ b/o2web/source/x_component_query_Query/Importer.js @@ -1398,7 +1398,8 @@ MWF.xApplication.query.Query.Importer.ExcelUtils = new Class({ if( !colWidthArr )widthArray.push( {wpx: 100} ); - var at = String.fromCharCode(97 + i).toUpperCase(); + // var at = String.fromCharCode(97 + i).toUpperCase(); + var at = this.index2ColName(i); var di = dataInfo[at+"1"]; // di.v = v; // di.t = "s"; diff --git a/o2web/source/x_component_query_Query/Statement.js b/o2web/source/x_component_query_Query/Statement.js index 9cf7536e5b..42fe674da3 100644 --- a/o2web/source/x_component_query_Query/Statement.js +++ b/o2web/source/x_component_query_Query/Statement.js @@ -1104,7 +1104,8 @@ MWF.xApplication.query.Query.Statement.ExcelUtils = new Class({ if( !colWidthArr )widthArray.push( {wpx: 100} ); - var at = String.fromCharCode(97 + i).toUpperCase(); + // var at = String.fromCharCode(97 + i).toUpperCase(); + var at = this.index2ColName(i); var di = dataInfo[at+"1"]; // di.v = v; // di.t = "s"; diff --git a/o2web/source/x_component_query_TableDesigner/Table.js b/o2web/source/x_component_query_TableDesigner/Table.js index b7a927d614..f56d514331 100644 --- a/o2web/source/x_component_query_TableDesigner/Table.js +++ b/o2web/source/x_component_query_TableDesigner/Table.js @@ -1329,6 +1329,20 @@ MWF.xApplication.query.TableDesigner.Table.ExcelUtils = new Class({ window.navigator.msSaveBlob( url, saveName); } }, + index2ColName : function( index ){ + if (index < 0) { + return null; + } + var num = 65;// A的Unicode码 + var colName = ""; + do { + if (colName.length > 0)index--; + var remainder = index % 26; + colName = String.fromCharCode(remainder + num) + colName; + index = (index - remainder) / 26; + } while (index > 0); + return colName; + }, export : function(array, fileName){ this._loadResource( function(){ data = xlsxUtils.format2Sheet(array, 0, 0, null);//偏移3行按keyMap顺序转换 @@ -1341,7 +1355,8 @@ MWF.xApplication.query.TableDesigner.Table.ExcelUtils = new Class({ widthArray.push( {wpx: 100} ); - var at = String.fromCharCode(97 + i).toUpperCase(); + // var at = String.fromCharCode(97 + i).toUpperCase(); + var at = this.index2ColName(i); var di = dataInfo[at+"1"]; // di.v = v; // di.t = "s"; -- GitLab