|
|
@@ -92,6 +92,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
|
|
|
}, {
|
|
|
text: 'Excel xml (包含分组合计)',
|
|
|
cfg: {
|
|
|
+ type: 'excel03',
|
|
|
+ ext: 'xml',
|
|
|
includeGroups: true,
|
|
|
includeSummary: true
|
|
|
}
|
|
|
@@ -319,6 +321,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
|
|
|
|
|
|
if(c.xtype == 'datecolumn') {
|
|
|
Ext.applyIf(c, {
|
|
|
+ // 这两个都要写上,才能控制到不同类型的导出格式,原因不明- -!
|
|
|
format: 'Y-m-d',
|
|
|
exportStyle: [{
|
|
|
type: 'csv',
|
|
|
@@ -326,6 +329,10 @@ Ext.define('saas.view.core.report.ReportPanel', {
|
|
|
}],
|
|
|
exportRenderer: function (value) {
|
|
|
return Ext.Date.format(new Date(value), 'Y-m-d');
|
|
|
+ },
|
|
|
+ // 下面这个方法不写会造成日期列求和,原因不明- -!
|
|
|
+ exportSummaryRenderer: function(v) {
|
|
|
+ return v;
|
|
|
}
|
|
|
})
|
|
|
}else if(c.xtype == 'numbercolumn') {
|
|
|
@@ -336,14 +343,15 @@ Ext.define('saas.view.core.report.ReportPanel', {
|
|
|
var xr = (new Array(arr[1].length)).fill('0');
|
|
|
var format = '0.' + xr.join();
|
|
|
return Ext.util.Format.number(v, format);
|
|
|
- }
|
|
|
+ },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if(c.summaryType) {
|
|
|
+ me.initSummaryType(c);
|
|
|
summarys.push({
|
|
|
field: c.dataIndex,
|
|
|
- operation: c.summaryType,
|
|
|
+ operation: c.summaryTypeName,
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
@@ -353,6 +361,19 @@ Ext.define('saas.view.core.report.ReportPanel', {
|
|
|
return columns;
|
|
|
},
|
|
|
|
|
|
+ initSummaryType: function(column) {
|
|
|
+ var summaryType = column.summaryType;
|
|
|
+ if(Ext.isString(summaryType)) {
|
|
|
+ column.summaryTypeName = summaryType;
|
|
|
+ }
|
|
|
+ if(summaryType == 'sum') {
|
|
|
+ // 原生的求和方法使用的是Store.sum,在数据存在null时计算结果为NaN,这里重写一下
|
|
|
+ column.summaryType = function(records, values) {
|
|
|
+ return Ext.Array.sum(values);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
initSearchItems: function() {
|
|
|
var me = this,
|
|
|
items = me.searchItems,
|
|
|
@@ -470,6 +491,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
|
|
|
type = 'number';
|
|
|
}else if(me.isContainsAny(xtypes, ['datefield', 'condatefield'])) {
|
|
|
type = 'date';
|
|
|
+ }else if(me.isContainsAny(xtypes, ['dbfindtrigger'])) {
|
|
|
+ type = 'string';
|
|
|
}else if(me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
|
|
|
type = 'enum';
|
|
|
}else {
|
|
|
@@ -524,6 +547,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
|
|
|
to = value.to;
|
|
|
|
|
|
conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
|
|
|
+ }else if(me.isContainsAny(xtypes, ['dbfindtrigger'])) {
|
|
|
+ conditionValue = value;
|
|
|
}else if(me.isContainsAny(xtypes, ['combobox', 'combo'])) {
|
|
|
conditionValue = '\'' + value + '\'';
|
|
|
}else if(me.isContainsAny(xtypes, ['multicombo'])) {
|