amis icon indicating copy to clipboard operation
amis copied to clipboard

select组件 使用数据source后data提交到了url上去了

Open dikar opened this issue 4 years ago • 2 comments

描述问题:

请用一段清晰简洁的文字描述问题是什么...

CRUD 组件里,配置了filter里的 select 的source之后。页面打开就把data带到url上去了。每次页面刷新都带上去了。

截图或视频:

image

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

  1. 你是如何使用 amis 的? sdk、npm 或其他...

SDK

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

1.5.3

  1. 粘贴有问题的完整 amis schema 代码:
(function () {
  let amis = amisRequire('amis/embed');
  // 通过替换下面这个配置来生成不同页面
  let amisJSON = {
                     "type": "page",
                     "title": "管理",
                     "body": [
                         {
                             "type": "crud",
                             "api": "",
                             "itemActions": [
                             ],
                             "features": [
                                 "create",
                                 "filter",
                                 "update",
                                 "view",
                                 "delete"
                             ],

                             "filter": {
                                 "title": "",
                                 "rules": [
                                 ],
                                 "submitText": "查询",
                                 "body": [
                                     {
                                         "type": "select",
                                         "label": "账户类型",
                                         "name": "accountType",
                                         "source": "${itemsAccountTypeOption}",
                                         "size": "sm",
                                         "placeholder": "请选择账户类型"
                                     },
                                     {
                                         "type": "select",
                                         "label": "状态",
                                         "name": "active",
                                         "source": "${itemsStatusOption}"
                                     }
                                 ],
                                 "data": {
                                     "itemsAccountTypeOption": [
                                         {
                                             "label": "现金",
                                             "value": "1"
                                         },
                                         {
                                             "label": "银行卡",
                                             "value": "2"
                                         },
                                         {
                                             "label": "微信",
                                             "value": "3"
                                         },
                                         {
                                             "label": "支付宝",
                                             "value": "4"
                                         },
                                         {
                                             "label": "其他",
                                             "value": "5"
                                         }
                                     ],
                                     "itemsStatusOption": [
                                         {
                                             "label": "不限",
                                             "value": "0"
                                         },
                                         {
                                             "label": "已启用",
                                             "value": "1"
                                         },
                                         {
                                             "label": "已禁用",
                                             "value": "2"
                                         }
                                     ]
                                 }
                             },
                             "perPageAvailable": [
                                 10
                             ],
                             "messages": {
                             },
                             "defaultParams": {
                             },
                             "keepItemSelectionOnPageChange": false,
                             "quickSaveApi": "",
                             "mode": "table",
                             "columns": [
                                 {
                                     "name": "id",
                                     "label": "ID",
                                     "type": "text",
                                     "fixed": "left"
                                 }
                             ],
                             "data": [
                                 {
                                     "id": "1",
                                     "budget": "50000元",
                                     "adGoal": "1",
                                     "beginDate": "2020-08-31 7:00",
                                     "endDate": "2020-11-11 7:00",
                                     "accountType": "2",
                                     "storeBelongto": "1",
                                     "settleAccountName": "四季水果-现金",
                                     "active": true,
                                     "currentRemains": "4535.00",
                                     "beginPeriodRemains": "0.00"
                                 },
                                 {
                                     "id": "2",
                                     "budget": "30000元",
                                     "adGoal": "2",
                                     "campaignID": "506669",
                                     "campaignName": "618广告活动",
                                     "active": true,
                                     "accountType": "1",
                                     "storeBelongto": "2",
                                     "settleAccountName": "兄弟水果-银行卡",
                                     "currentRemains": "2145.00",
                                     "beginPeriodRemains": "0.00"
                                 }
                             ]
                         }
                     ],
                     "messages": {
                     },
                     "regions": [
                         "toolbar",
                         "body",
                         "header"
                     ],
                     "style": {
                     }
                 };

  let amisScoped = amis.embed('#root', amisJSON);
  amisScoped.updateProps({
    theme: 'antd'
  });
})();
  1. 操作步骤 请简单描述一下复现的操作步骤...

把这个json配置了以后,打开页面或者提交查询,都会把data数组也提交上去。希望不提交。

dikar avatar Dec 24 '21 05:12 dikar

当前习惯使用 source方式,所以先不修改为 option的方式。希望能有个参数配置不提交data 这个关键词的数据

dikar avatar Dec 24 '21 05:12 dikar

CRUD 配置 syncLocation: false

RickCole21 avatar Jan 05 '22 07:01 RickCole21