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

crud使用source本地数据源时setValue分页条数有问题 #11535

Open
thinkingc opened this issue Jan 22, 2025 · 0 comments
Open

crud使用source本地数据源时setValue分页条数有问题 #11535

thinkingc opened this issue Jan 22, 2025 · 0 comments

Comments

@thinkingc
Copy link
Contributor

描述问题:

crud使用source本地数据源时setValue分页条数有问题。

截图或视频:

Image

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的?
    npm

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    最新依然存在

  3. 粘贴有问题的完整 amis schema 代码:

{
  "type": "page",
  "id": "pageid",
  "data": {
    "myItems": [
      {
        "id": 1
      },
      {
        "id": 2
      },
      {
        "id": 3
      },
      {
        "id": 4
      },
      {
        "id": 5
      },
      {
        "id": 6
      },
      {
        "id": 7
      },
      {
        "id": 8
      },
      {
        "id": 9
      },
      {
        "id": 10
      },
      {
        "id": 11
      },
      {
        "id": 12
      },
      {
        "id": 13
      }
    ]
  },
  "body": [
    {
      "type": "button",
      "label": "更新crud",
      "onEvent": {
        "click": {
          "actions": [
            {
              "actionType": "setValue",
              "componentId": "pageid",
              "args": {
                "value": {
                  "myItems": [
                    {
                      "id": 1
                    },
                    {
                      "id": 2
                    },
                    {
                      "id": 3
                    },
                    {
                      "id": 4
                    },
                    {
                      "id": 5
                    },
                    {
                      "id": 6
                    },
                    {
                      "id": 7
                    },
                    {
                      "id": 8
                    },
                    {
                      "id": 9
                    },
                    {
                      "id": 10
                    },
                    {
                      "id": 11
                    },
                    {
                      "id": 12
                    }
                  ]
                }
              }
            },
            {
              "actionType": "changePage",
              "componentId": "crudid",
              "args": {
                "page": 1,
                "perPage": 10
              }
            }
          ]
        }
      }
    },
    {
      "type": "crud",
      "id": "crudid",
      "source": "${myItems}",
      "alwaysShowPagination": true,
      "syncLocation": false,
      "footerToolbar": [
        {
          "type": "pagination",
          "layout": "total,pager,perPage,go",
          "perPageAvailable": [
            5,
            10,
            20,
            50
          ],
        }
      ],
      "columns": [
        {
          "name": "id",
          "label": "ID"
        }
      ]
    }
  ]
}
  1. 操作步骤
    1、点击”更新crud"按钮
    2、第一页变成12条
    3、切到第2页,然后再切到第1页,第一页变成了10条。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant