lambo-design-bi 0.0.198 → 0.0.199

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.
@@ -80,10 +80,14 @@ export default {
80
80
  for (let i = 1; i < columns.length; i++) {
81
81
  let col = columns[i]
82
82
  let colKey = col.key
83
- if (Object.prototype.hasOwnProperty.call(allSumObj, colKey)) {
83
+ if (Object.prototype.hasOwnProperty.call(col, "hasSum") && (col["hasSum"] === "true" || col["hasSum"] === true) && Object.prototype.hasOwnProperty.call(allSumObj, colKey)) {
84
+ let sumVal = allSumObj[colKey]
85
+ if (sumVal === null || sumVal === undefined) {
86
+ sumVal = ''
87
+ }
84
88
  sums[colKey] = {
85
89
  key: colKey,
86
- value: allSumObj[colKey] || ''
90
+ value: sumVal
87
91
  }
88
92
  } else {
89
93
  sums[colKey] = {
@@ -99,7 +103,8 @@ export default {
99
103
  const key = column.key
100
104
  if (index > 0) {
101
105
  const values = data.map(item => Number(item[key]))
102
- if (values && values.length > 0 && !values.every(value => isNaN(value))) {
106
+ if (Object.prototype.hasOwnProperty.call(column, "hasSum") && (column["hasSum"] === "true" || column["hasSum"] === true)
107
+ && values && values.length > 0 && !values.every(value => isNaN(value))) {
103
108
  const v = values.reduce((prev, curr) => {
104
109
  const value = Number(curr)
105
110
  if (!isNaN(value)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambo-design-bi",
3
- "version": "0.0.198",
3
+ "version": "0.0.199",
4
4
  "description": "Vue2 BI 数据可视化组件库",
5
5
  "main": "index.js",
6
6
  "author": "finch",