Skip to content

input-table 组件 添加分页后,点击分页,会导致列表数据混乱,丢失,出现重复数据 #11817

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

Open
taoyao-code opened this issue Apr 7, 2025 · 1 comment
Labels
feat need confirm style Bug or PR related to component's style

Comments

@taoyao-code
Copy link

taoyao-code commented Apr 7, 2025

描述问题:

点击分页按钮,出现如视频所示,数据重复,部分数据被覆盖。

截图或视频:

iShot_2025-04-07_17.07.10.mp4

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

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

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

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

{
  "type": "page",
  "title": "1",
  "body": [
    {
      "type": "form",
      "body": [
        {
          "type": "input-excel",
          "name": "wl_travel_user",
          "label": "上传 Excel",
          "id": "u:3cf73744e9cd"
        },
        {
          "type": "tabs",
          "id": "input_tabs",
          "tabs": [
            {
              "title": "行程信息",
              "body": [
                {
                  "type": "group",
                  "id": "group8",
                  "body": [
                    {
                      "type": "wrapper",
                      "name": "wl_travel_user",
                      "id": "input_wl_travel_user",
                      "visibleOn": "${ls:page_pr.input_wl_travel_user !== 0}",
                      "disabledOn": "${ls:page_pr.input_wl_travel_user === 1}",
                      "label": "游客信息",
                      "placeholder": "请输入游客信息",
                      "body": [
                        {
                          "type": "button",
                          "label": "清除全部",
                          "level": "warning",
                          "confirmText": "确定要清除全部游客数据吗?",
                          "onEvent": {
                            "click": {
                              "actions": [
                                {
                                  "actionType": "reset",
                                  "componentId": "wl_travel_user"
                                }
                              ]
                            }
                          },
                          "id": "u:d2f9d0e8a0b9"
                        },
                        {
                          "type": "tpl",
                          "tpl": "总数:${COUNT(wl_travel_user)}人",
                          "id": "u:85c6c0c17bd7"
                        },
                        {
                          "type": "input-table",
                          "name": "wl_travel_user",
                          "id": "wl_travel_user",
                          "label": "游客信息",
                          "showIndex": true,
                          "needConfirm": false,
                          "deleteBtnLabel": "删除",
                          "deleteBtnIcon": "fa fa-times text-danger",
                          "placeholder": "请输入游客信息",
                          "columns": [
                            {
                              "type": "hidden",
                              "name": "TravelUserID",
                              "id": "TravelUserID",
                              "className": "w-0",
                              "quickEdit": false,
                              "placeholder": "-"
                            },
                            {
                              "type": "input-text",
                              "name": "username",
                              "label": "<font color='red'>*</font>姓名",
                              "mode": "inline",
                              "quickEdit": false,
                              "className": "w-sm",
                              "clearable": true,
                              "id": "u:3af02f33ff74"
                            },
                            {
                              "type": "input-text",
                              "name": "cert_no",
                              "label": "<font color='red'>*</font>证件号码",
                              "clearable": true,
                              "id": "u:8cd23dc917e4"
                            },
                            {
                              "type": "input-text",
                              "name": "contact_phone",
                              "label": "联系电话",
                              "mode": "inline",
                              "quickEdit": false,
                              "className": "w-sm",
                              "clearable": true,
                              "id": "u:50f79fb6500c"
                            },
                            {
                              "type": "hidden",
                              "name": "source",
                              "quickEdit": false,
                              "value": 1,
                              "id": "u:0158b288c419"
                            }
                          ],
                          "body": [
                            {
                              "type": "button",
                              "label": "清除全部",
                              "level": "warning",
                              "confirmText": "确定要清除全部游客数据吗?",
                              "onEvent": {
                                "click": {
                                  "actions": [
                                    {
                                      "actionType": "reset",
                                      "componentId": "wl_travel_user"
                                    }
                                  ]
                                }
                              }
                            },
                            {
                              "type": "tpl",
                              "tpl": "总数:${COUNT(wl_travel_user)}人"
                            }
                          ],
                          "perPage": 3,
                          "addable": true,
                          "copyable": false,
                          "editable": true,
                          "removable": true,
                          "canAccessSuperData": true,
                          "showTableAddBtn": true,
                          "strictMode": false
                        }
                      ],
                      "style": {
                        "position": "static",
                        "display": "block",
                        "fontFamily": "",
                        "fontSize": 12
                      },
                      "isFixedHeight": false,
                      "isFixedWidth": false
                    }
                  ]
                },
                {
                  "type": "divider",
                  "id": "u:2bee3c913372"
                },
                {
                  "type": "divider",
                  "id": "u:1d7490a613da"
                },
                {
                  "type": "group",
                  "id": "group15",
                  "body": [
                    {
                      "type": "uuid",
                      "name": "_UUID",
                      "id": "input__UUID",
                      "visibleOn": "${ls:page_pr.input__UUID !== 0}",
                      "disabledOn": "${ls:page_pr.input__UUID === 1}",
                      "placeholder": "请输入"
                    }
                  ]
                }
              ],
              "id": "input_Tab1"
            }
          ],
          "onEvent": {
            "change": {
              "actions": [
                {
                  "componentId": "addForm",
                  "actionType": "reload",
                  "data": {
                    "edtbsValue": 2
                  },
                  "expression": "${event.data.value == 2}"
                },
                {
                  "componentId": "service-reload",
                  "actionType": "reload",
                  "expression": "${event.data.value == 2}"
                }
              ]
            }
          }
        }
      ],
      "id": "addForm",
      "data": {
        "code": "${code}"
      },
      "feat": "Edit",
      "debug": true,
      "showCloseButton": true,
      "closeOnOutside": false,
      "closeOnEsc": false,
      "showErrorMsg": true,
      "showLoading": true,
      "draggable": false,
      "dsType": "api",
      "labelAlign": "left",
      "actions": [
        {
          "type": "submit",
          "label": "提交",
          "primary": true,
          "id": "u:73599851a50d"
        }
      ]
    }
  ],
  "id": "u:90a9a49c318c",
  "asideResizor": false,
  "pullRefresh": {
    "disabled": true
  }
}
  1. 操作步骤
    在官网可复现操作,

测试文件.xlsx

@github-actions github-actions bot added feat style Bug or PR related to component's style labels Apr 7, 2025
Copy link

github-actions bot commented Apr 7, 2025

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

Please review the labels and make any necessary changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat need confirm style Bug or PR related to component's style
Projects
None yet
Development

No branches or pull requests

1 participant