Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复表单项公式默认值优先级高于实际返回值的问题 #9974

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

2betop
Copy link
Collaborator

@2betop 2betop commented Apr 7, 2024

What

问题 schema

{
  "type": "page",
  "title": "表单页面",
  "body": [
    {
      "type": "form",
      "mode": "horizontal",
      "initApi": {
        "method": "get",
        "url": "/api/sample/show?id=${id}",
        "mockResponse": {
          "status": 200,
          "data": {
            "id": 1,
            "varc": "123",
            "vard": "124xxx",
            "combo": [
              {
                "vara": "123",
                "varb": "123xxx"
              }
            ],
            "vare": "xxx"
          }
        }
      },
      "body": [
        {
          "label": "Combo",
          "type": "combo",
          "name": "combo",
          "multiple": true,
          "items": [
            {
              "type": "input-text",
              "name": "vara"
            },
            {
              "type": "input-text",
              "name": "varb",
              "value": "${vara}yyy"
            }
          ]
        },
        {
          "type": "input-text",
          "name": "varc",
          "value": "234"
        },
        {
          "type": "input-text",
          "name": "vard",
          "value": "${varc}yyy"
        },
        {
          "type": "input-text",
          "name": "vare",
          "value": "yyyy"
        }
      ]
    }
  ]
}

Why

公式默认值在 form 与在 combo 内部表现不统一,预期初始值高于表达式,除非表达式关联变量发生变化,才更新公式结果

How

@github-actions github-actions bot added the fix label Apr 7, 2024
Copy link

github-actions bot commented Apr 7, 2024

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@2betop 2betop merged commit 676067a into baidu:master Apr 9, 2024
4 checks passed
@2betop 2betop deleted the fix-formite-defaultValue-expression branch May 15, 2024 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants