代码拉取完成,页面将自动刷新
兄弟 有实现吗?
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
我已经实现了,只要改变参数属性,它会自动重新请求。
关键代码
// 点击区域
const chartPEvents = (e: any) => {
if (e.seriesType !== 'effectScatter') return
if (!props.chartConfig.option.mapRegion.enter) {
return
}
if(levelHistory.value.length >= 2) {
return window.$message.warning('已经是最后一级了')
}
let code = String(e.data.adcode)
levelHistory.value.push(code)
checkOrMap(code)
onChange(code)
updateMapComponent(code)
}
//手动更新地图的 请求参数,触发动态adcode参数请求
const updateMapComponent = (code: string) =>{
const chartEditStore = useChartEditStore();
const { fetchTargetIndex, getComponentList, updateComponentList} = chartEditStore
const index = fetchTargetIndex(props.chartConfig.id);
if(index !== -1) {
const curCom = getComponentList[index];
curCom.request.requestParams.Params.adcode = code; //改变参数
updateComponentList(index, curCom);
}
}
登录 后才可以发表评论