909 Star 12.8K Fork 3.9K

GVPdromara / go-view

 / 详情

请教点击地图后如果将当前区域regionId值传给动态请求参数?

待办的
创建于  
2023-12-01 08:40
暂无描述。

评论 (2)

apollo2017 创建了任务

兄弟 有实现吗?

我已经实现了,只要改变参数属性,它会自动重新请求。
关键代码

// 点击区域
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);
  }
}

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
980793 tozou 1580607607
TypeScript
1
https://gitee.com/dromara/go-view.git
git@gitee.com:dromara/go-view.git
dromara
go-view
go-view

搜索帮助