From e6aa64c0b672fde38cfac39e9424285370ea81f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=82=E4=BD=B3=E4=BF=8A?= Date: Sun, 7 Jan 2024 17:55:10 +0800 Subject: [PATCH] =?UTF-8?q?[Bug]:=20amis3.6.3=E6=97=A0=E6=B3=95=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/steedos/steedos-platform/issues/6135 --- .../src/lib/converter/amis/fields/table.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/fields/table.js b/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/fields/table.js index 325936c76..020395784 100644 --- a/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/fields/table.js +++ b/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/fields/table.js @@ -95,7 +95,6 @@ async function getQuickEditSchema(field, options){ { "actionType": "custom", "script": ` - var _display = _.cloneDeep(event.data._display); ${displayField} doAction({actionType: 'setValue', "args": {"value": {_display}},componentId: "${quickEditId}"}); @@ -268,6 +267,23 @@ async function getQuickEditSchema(field, options){ "onEvent":{ "init":{ "actions":[ + //amis3.6无法从数据域中直接拿到正确的selectitems,需要通过crud组件的getSelected()函数获取 + { + "actionType": "custom", + "script": ` + crudScoped = event.context.scoped.getComponentById('${options.crudId}'); + const selectedItems = crudScoped && crudScoped.control.getSelected(); + doAction({ + "componentId": "${quickEditId}", + "actionType": "setValue", + "args": { + "value": { + selectedItems + } + } + }); + ` + }, { "actionType": "setValue", "componentId": quickEditId,