fix: 空间交互失效

This commit is contained in:
limingzhang 2023-03-11 18:19:30 +08:00 committed by 奔跑的面条
parent 0db6976e4a
commit c2e733aaaa
2 changed files with 6 additions and 6 deletions

View File

@ -19,9 +19,9 @@ export const useChartInteract = (
return item.interactOn === onEvent
})
if (fnOnEvent.length === 0) return
fnOnEvent.forEach(item => {
const index = chartEditStore.fetchTargetIndex(item.interactComponents)
if (index !== -1) return
const { Params, Header } = toRefs(chartEditStore.componentList[index].request.requestParams)
Object.keys(item.interactFn).forEach(key => {
if (Params.value[key]) {

View File

@ -31,12 +31,12 @@ const option = shallowReactive({
const onChange = (v: number | number[]) => {
if (v instanceof Array) {
const data1 = dayjs(v[0]).format('YYYY-MM-DD')
const data2 = dayjs(v[1]).format('YYYY-MM-DD')
useChartInteract(props.chartConfig, useChartEditStore, { data1, data2 }, 'change')
const dateStart = dayjs(v[0]).format('YYYY-MM-DD')
const dateEnd = dayjs(v[1]).format('YYYY-MM-DD')
useChartInteract(props.chartConfig, useChartEditStore, { dateStart, dateEnd }, 'change')
} else {
const data1 = dayjs(v).format('YYYY-MM-DD')
useChartInteract(props.chartConfig, useChartEditStore, { data1 }, 'change')
const date = dayjs(v).format('YYYY-MM-DD')
useChartInteract(props.chartConfig, useChartEditStore, { date }, 'change')
}
}