Merge pull request #11228 from dataease/pr@dev-v2@fix_pivot_summary_sort

fix(图表): 透视表排序字段选择失效
This commit is contained in:
wisonic-s 2024-07-29 17:18:43 +08:00 committed by GitHub
commit e280ed860d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,10 +67,12 @@ const init = () => {
const yAxis = props.chart.yAxis
if (yAxis?.length > 0) {
const axisArr = yAxis.map(i => i.dataeaseName)
if (axisArr.indexOf(state.tableTotalForm.row.totalSortField) != -1) {
if (axisArr.indexOf(state.tableTotalForm.row.totalSortField) === -1) {
state.tableTotalForm.row.totalSortField = yAxis[0].dataeaseName
}
state.tableTotalForm.col.totalSortField = yAxis[0].dataeaseName
if (axisArr.indexOf(state.tableTotalForm.col.totalSortField) === -1) {
state.tableTotalForm.col.totalSortField = yAxis[0].dataeaseName
}
} else {
state.tableTotalForm.row.totalSortField = ''
state.tableTotalForm.col.totalSortField = ''
@ -279,7 +281,7 @@ onMounted(() => {
v-model="state.tableTotalForm.row.totalSortField"
class="form-item-select"
:placeholder="t('chart.total_sort_field')"
@change="changeTableTotal('row')"
@change="changeTableTotal('row.totalSortField')"
>
<el-option
v-for="option in chart.yAxis"