master
黄欣 4 years ago
parent f3f0bf1284
commit 773093114c

@ -151,7 +151,6 @@ export default {
},
created() {
this.init()
console.log('init')
//
eventBus.$on('resizing', (componentId) => {
this.chartResize()
@ -224,7 +223,6 @@ export default {
let fields = this.fields.filter((e) =>
xaxisFieldId.includes(e.dataeaseName)
)
console.log(fields)
let rowSum = 0
let columnValue = []
let rowName = []
@ -312,10 +310,8 @@ export default {
yaxisExtFieldId[0] +
subEle[yaxisExtFieldId[0]]
ele[key] = subEle[fieldValueName].toFixed(2)
console.log(1, ele[key])
if (this.fields[findValueIndex].summary === 'ratio') {
ele[key] += '%'
console.log(2, ele[key])
}
rowSum += subEle[fieldValueName]
}
@ -332,7 +328,6 @@ export default {
if (this.fields[findValueIndex].summary === 'ratio') {
ele[key] += '%'
}
rowSum += subEle[fieldValueName]
}
})
@ -372,7 +367,6 @@ export default {
if (this.fields[findValueIndex].summary === 'ratio') {
ele[key] += '%'
}
rowSum += subEle[fieldValueName]
}
})
@ -384,9 +378,7 @@ export default {
if (this.fields[findValueIndex].summary === 'ratio') {
ele[key] += '%'
}
rowSum += subEle[fieldValueName]
console.log(3, subEle)
}
})
}
@ -394,21 +386,34 @@ export default {
if (this.fields[findValueIndex].summary === 'ratio') {
rowSum += '%'
}
ele.rowTotal = rowSum
rowSum = 0
})
}
fields = fields.concat(rowName)
fields.push({
dataeaseName: 'rowTotal',
name: `合计(${this.fields[findValueIndex].name})`
})
for (let i = columnValue.length - 1; i >= 0; i--) {
const element = columnValue[i]
if (element.rowTotal === '0.00%') {
for (let j = this.mergeCells.length - 1; j >= 0; j--) {
if (this.mergeCells[j].row > i) {
this.mergeCells[j].row -= 1
} else if (this.mergeCells[j].row <= i) {
this.mergeCells[j].rowspan -= 1
if (this.mergeCells[j].rowspan === 0) {
this.mergeCells.splice(j, 1)
}
break
}
}
columnValue.splice(i, 1)
}
}
datas = columnValue
this.fields = fields
console.log(columnValue)
console.log(fields)
}
} else {
this.fields = []

Loading…
Cancel
Save