forked from github/dataease
Merge pull request #4179 from dataease/pr@dev@fix_map_daxis
fix(地图): 切换数据集后标记字段没有消失
This commit is contained in:
commit
9838359f93
@ -51,7 +51,7 @@ export function baseMapOption(chart_option, chart, themeStyle, curAreaCode, seri
|
||||
currentSeriesId = yAxis?.length ? yAxis[0].id : null
|
||||
}
|
||||
chart.data?.series.forEach((item, index) => {
|
||||
if (item.data[0].quotaList[0].id === currentSeriesId) {
|
||||
if (item.data?.length && item.data[0].quotaList[0].id === currentSeriesId) {
|
||||
seriesIndex = index
|
||||
return false
|
||||
}
|
||||
|
@ -143,6 +143,8 @@
|
||||
import { DEFAULT_MARK } from '../../chart/chart'
|
||||
import DeIconGroupPicker from '@/components/deIconPicker/deIconGroupPicker'
|
||||
import deSvgIcons from '@/deicons'
|
||||
import { getItemType } from '@/views/chart/components/dragItem/utils'
|
||||
import bus from '@/utils/bus'
|
||||
export default {
|
||||
name: 'MapMarkSelector',
|
||||
components: { DeIconGroupPicker },
|
||||
@ -275,7 +277,12 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
bus.$off('reset-change-table', this.getItemTagType)
|
||||
},
|
||||
mounted() {
|
||||
bus.$on('reset-change-table', this.getItemTagType)
|
||||
this.initData()
|
||||
this.loadSvg()
|
||||
},
|
||||
@ -309,6 +316,12 @@ export default {
|
||||
}
|
||||
if (customAttr.mark) {
|
||||
this.markForm = customAttr.mark
|
||||
if (this.markForm.fieldId) {
|
||||
const valid = this.fieldOptions.some(group => group.options.some(item => item.id === this.markForm.fieldId))
|
||||
if (!valid) {
|
||||
this.markForm.fieldId = null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -360,8 +373,25 @@ export default {
|
||||
}
|
||||
|
||||
this.changeMarkAttr('fieldId')
|
||||
},
|
||||
getItemTagType() {
|
||||
if (this.markForm.fieldId) {
|
||||
const field = this.getField(this.markForm.fieldId)
|
||||
if (!field) {
|
||||
this.changeFields()
|
||||
this.markForm.fieldId = null
|
||||
return
|
||||
}
|
||||
const tagType = getItemType(this.dimensionData, this.quotaData, field)
|
||||
if (tagType === 'danger') {
|
||||
this.changeFields()
|
||||
this.markForm.fieldId = null
|
||||
}
|
||||
} else {
|
||||
this.changeFields()
|
||||
this.markForm.fieldId = null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -29,8 +29,8 @@
|
||||
:param="param"
|
||||
:index="index"
|
||||
:item="item"
|
||||
:dimension-data="dimension"
|
||||
:quota-data="quota"
|
||||
:dimension-data="dimensionData"
|
||||
:quota-data="quotaData"
|
||||
@onDetailItemRemove="locationXItemRemove"
|
||||
/>
|
||||
</transition-group>
|
||||
@ -69,8 +69,8 @@
|
||||
:param="param"
|
||||
:index="index"
|
||||
:item="item"
|
||||
:dimension-data="dimension"
|
||||
:quota-data="quota"
|
||||
:dimension-data="dimensionData"
|
||||
:quota-data="quotaData"
|
||||
@onDetailItemRemove="locationYItemRemove"
|
||||
/>
|
||||
</transition-group>
|
||||
|
Loading…
Reference in New Issue
Block a user