From b1d0f6c978f4229279c97484c11ae3e9ce9685d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=96=E5=A4=A7=E9=9B=AA?= <2291335922@qq.com> Date: Wed, 29 Nov 2023 22:16:01 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug:=20=E5=88=97=E8=A1=A8=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E4=B8=8A=E7=AD=9B=E9=80=89=E6=8C=89=E9=92=AE=E5=B1=95?= =?UTF-8?q?=E5=BC=80=E7=9A=84=E8=A1=A8=E5=8D=95=E9=A1=B9=E5=92=8C=E2=80=9C?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=AD=A4=E5=88=97=E8=A1=A8=E2=80=9D=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A1=86=E8=BE=93=E5=85=A5=E5=86=85=E5=AE=B9=E6=9C=AA?= =?UTF-8?q?=E6=8C=89=E5=9B=9E=E8=BD=A6=E9=94=AE=E6=88=96=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=90=8E=20=E5=88=B7=E6=96=B0=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=B8=A2=E5=A4=B1=E6=95=B0=E6=8D=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #504 --- .../src/lib/converter/amis/fields/table.js | 16 +++++++++++++++- 1 file changed, 15 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 0dcbc7d6c..bfda2083e 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 @@ -1093,7 +1093,7 @@ export async function getTableApi(mainObject, fields, options){ if(options.isRelated){ api.url += "&recordId=${_master.recordId}"; } - api.cache = 3000; + // api.cache = 3000; api.data.$term = "$term"; api.data.term = "$term"; @@ -1354,6 +1354,20 @@ export async function getTableApi(mainObject, fields, options){ selfData.page = localListViewProps.page || 1; } } + + // 列表视图(对象表格)筛选按钮表单输入框输入内容后,如果不按回车键或者搜索按钮,selfData中该输入框是没有最新值的。 + const __filterFormValues = api.body.__filterFormValues; + if(__filterFormValues){ + let filterFormValues = JSON.parse(JSON.stringify(__filterFormValues)) || {}; + selfData = Object.assign({}, selfData, filterFormValues); + } + // “搜索此列表”搜索框同理。 + const __serachBoxValues = api.body.__serachBoxValues; + if(__serachBoxValues){ + let serachBoxValues = JSON.parse(JSON.stringify(__serachBoxValues)) || {}; + selfData = Object.assign({}, selfData, serachBoxValues); + } + delete selfData.context; delete selfData.global; sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify(selfData));