baidu / baidu/amis

vue 大屏跳转 amis 界面params 参数amis crud中无法获取

Open
#7,660 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

need confirm
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

描述问题:

vue 大屏跳转 amis 界面params 参数amis crud中无法获取

截图或视频:
  //query 请求正常 可携带参数 amis 界面使用id_num ='${id_num}可正常接收 但是id_num路由写死后重置按钮无效清空'
  this.$router.push({
    path: '/warningpersons',
    query: {
      id_num_by_screen: this.infoItem.id_num
    },
    // 通过params 来传参 amis 拿不到id_num 中的值 amis 文档中---页面中可以通过 ${params.id} 取到此值。
    // path: '/warningpersons/:id_num',
    // name: 'warningpersons',
    // params:{
    //   id_num:this.infoItem.id_num,
    // },
    props: true
  })

image

如何复现(请务必完整填写下面内容):
  1. 你是如何使用 amis 的?
    sdk 3.2 .0 通过json 来配置实现

  2. 粘贴有问题的完整 amis schema 代码:
    这里的data 传参 只为了 大屏能跳才这样写的

            type: 'crud',
            syncLocation: false,
            api: {
              method: 'post',
              url: '/system/metro/select-pass-warning-records-data',
              dataType: 'form-data',
              data: {
                // 在这里指定需要传递的参数
                'page': '${page}',
                'perPage': '${perPage}',
                id: '${id}',
                xm: '${xm}',
                id_num: '${parmas.id_num}',
                id_num_by_screen: '${id_num_by_screen}',
                pass_mode: '${pass_mode}',
                pass: '${pass}',
                company_id: '${company_id}',
                station_id: '${station_id}',
                security_id: '${security_id}',
                select_data: '${select_data}',
                staff_name: '${staff_name}'
              },
              'pagination': {
                'pageSizeField': 'perPage',
                'pageField': 'page'
              }
            },
  1. 操作步骤
    使用params来跳转页面 接口无法拿到id_num这个信息 ,

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Vue router navigation to /warningpersons and the CRUD schema's parameter expressions, comparing the query-based and params-based paths shown in the report. Verify how route parameters enter the page data and test the reset behavior; done means the CRUD request receives id_num after params navigation and reset still clears it.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.