@steedos/standard-ui 2.5.11-beta.8 → 2.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  * @Author: 殷亮辉 yinlianghui@hotoa.com
3
3
  * @Date: 2023-05-16 17:00:38
4
4
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
5
- * @LastEditTime: 2023-05-28 10:13:45
5
+ * @LastEditTime: 2023-08-04 12:48:06
6
6
  */
7
7
  var buttonTriggerHistoryPathsChange;
8
8
  ; (function () {
@@ -90,17 +90,18 @@ FlowRouter.triggers.enter(debounce(function (context, redirect, stop) {
90
90
  const params = context.params || {};
91
91
  // const pathDef = context.route.pathDef;
92
92
  const recordId = params.record_id;
93
+ var paths = getHistoryPaths() || [];
94
+ let lastPath = paths && paths[paths.length - 1];
93
95
  if (recordId) {
94
- // 触发广播事件,把当前path和params累加存入amis变量historyPaths中
95
- var paths = getHistoryPaths() || [];
96
- let lastPath = paths && paths[paths.length - 1];
97
96
  //判断当前路由与记录的路由是否相同,为解决从设计器微页面返回重复记录的问题#4978
98
97
  if(path.split('?')[0] != lastPath?.path?.split('?')[0]){
98
+ // 触发广播事件前,把当前path和params累加存入amis变量historyPaths中
99
99
  pushHistoryPath(path, params);
100
100
  }
101
101
  }
102
102
  else {
103
- // 触发广播事件重围amis变量historyPaths值为空数组,并把当前path和params存入amis变量historyPaths中
103
+ clearHistoryFilters(context, lastPath);
104
+ // 触发广播事件前重置amis变量historyPaths值为空数组,并把当前path和params存入amis变量historyPaths中
104
105
  resetHistoryPath(path, params);
105
106
  }
106
107
  triggerBroadcastHistoryPathsChanged(buttonTriggerHistoryPathsChange);
@@ -113,6 +114,22 @@ function goBack(){
113
114
  }
114
115
  }
115
116
 
117
+ // 切换应用、对象、列表视图时清除本地存储中的过滤条件
118
+ function clearHistoryFilters(context, lastPath) {
119
+ const path = context.path;
120
+ const params = context.params || {};
121
+ if (!lastPath || lastPath.params.app_id != params.app_id || lastPath.params.object_name != params.object_name || lastPath.params.list_view_id != params.list_view_id) {
122
+ let listViewPropsStoreKey;
123
+ if (lastPath) {
124
+ listViewPropsStoreKey = lastPath.path + "/crud/" + (lastPath.params.list_view_id || "");
125
+ }
126
+ else {
127
+ listViewPropsStoreKey = path + "/crud/" + (params.list_view_id || "");
128
+ }
129
+ sessionStorage.removeItem(listViewPropsStoreKey);
130
+ }
131
+ }
132
+
116
133
  /**
117
134
  * 移除最后一个path,并且返回要返回的上一个path
118
135
  * 如果是从推送通知中点开进入记录详细页面,则返回当前记录所属对象的列表页面
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-ui",
3
- "version": "2.5.11-beta.8",
3
+ "version": "2.5.11",
4
4
  "main": "package.service.js",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -12,5 +12,5 @@
12
12
  "description": "steedos package",
13
13
  "repository": {},
14
14
  "license": "MIT",
15
- "gitHead": "9abbe2ea0aa1c624500fa5111a8207f841a16f62"
15
+ "gitHead": "fa315255231ac336e95125366f6c4362a1a3200e"
16
16
  }