doway-coms 2.1.8 → 2.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/BaseGrid/src/index.vue +34 -23
package/package.json
CHANGED
|
@@ -1093,6 +1093,12 @@ export default {
|
|
|
1093
1093
|
},
|
|
1094
1094
|
deep: true,
|
|
1095
1095
|
},
|
|
1096
|
+
customFooterMethod:{
|
|
1097
|
+
type:Function,
|
|
1098
|
+
default:()=>{
|
|
1099
|
+
return null
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1096
1102
|
},
|
|
1097
1103
|
beforeCreate() {
|
|
1098
1104
|
this.simpleImage = Empty.PRESENTED_IMAGE_SIMPLE
|
|
@@ -2675,30 +2681,35 @@ export default {
|
|
|
2675
2681
|
* 表尾
|
|
2676
2682
|
*/
|
|
2677
2683
|
footerMethod({ columns, data }) {
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
column.formatter &&
|
|
2688
|
-
column.formatter !== 'defaultFormat' &&
|
|
2689
|
-
VXETable.formats.store[column.formatter]
|
|
2690
|
-
) {
|
|
2691
|
-
tempSumVal = VXETable.formats.store[column.formatter]({
|
|
2692
|
-
cellValue: tempSumVal,
|
|
2693
|
-
})
|
|
2684
|
+
let footerData= this.customFooterMethod({ columns, data })
|
|
2685
|
+
if(footerData){
|
|
2686
|
+
return footerData
|
|
2687
|
+
}else{
|
|
2688
|
+
if (this.footerSum.length > 0) {
|
|
2689
|
+
return [
|
|
2690
|
+
columns.map((column, columnIndex) => {
|
|
2691
|
+
if (columnIndex === 0) {
|
|
2692
|
+
return '合计'
|
|
2694
2693
|
}
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2694
|
+
if (this.footerSum.includes(column.property)) {
|
|
2695
|
+
let tempSumVal = XEUtils.sum(data, column.property)
|
|
2696
|
+
if (
|
|
2697
|
+
column.formatter &&
|
|
2698
|
+
column.formatter !== 'defaultFormat' &&
|
|
2699
|
+
VXETable.formats.store[column.formatter]
|
|
2700
|
+
) {
|
|
2701
|
+
tempSumVal = VXETable.formats.store[column.formatter]({
|
|
2702
|
+
cellValue: tempSumVal,
|
|
2703
|
+
})
|
|
2704
|
+
}
|
|
2705
|
+
return tempSumVal
|
|
2706
|
+
}
|
|
2707
|
+
return null
|
|
2708
|
+
}),
|
|
2709
|
+
]
|
|
2710
|
+
} else {
|
|
2711
|
+
return []
|
|
2712
|
+
}
|
|
2702
2713
|
}
|
|
2703
2714
|
},
|
|
2704
2715
|
cellClick({ row, column }) {
|