Skip to content

Commit

Permalink
fix bug: 列表视图上筛选按钮展开的表单项和“搜索此列表”搜索框输入内容未按回车键或搜索按钮后 刷新页面丢失数据。
Browse files Browse the repository at this point in the history
  • Loading branch information
Flyingliao committed Nov 29, 2023
1 parent 570efdc commit b1d0f6c
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit b1d0f6c

Please sign in to comment.