fix(图表): 透视表排序字段选择失效

This commit is contained in:
wisonic 2024-07-29 17:17:35 +08:00
parent bd5c4004d3
commit 6a2db14093

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"