hrp-ui-base 1.3.4 → 1.3.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hrp-ui-base",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "HRP 前端公共组件、工具方法和基础样式包",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -11,7 +11,7 @@
11
11
  "devDependencies": {},
12
12
  "module": "index.ts",
13
13
  "peerDependencies": {
14
- "hrp-ui-base": "1.3.3",
14
+ "hrp-ui-base": "1.3.4",
15
15
  "vue": "^3.0.0"
16
16
  }
17
17
  }
@@ -213,7 +213,37 @@ const handleParentClick = (_item: HomeMenu, index: number) => {
213
213
  };
214
214
 
215
215
  const goHomePage = () => {
216
- router?.replace({ path: options?.entryUrl || "/application-entry" });
216
+ const subApps = [
217
+ "imd",
218
+ "agoal",
219
+ "scm",
220
+ "bms",
221
+ "coc",
222
+ "hws",
223
+ "fms",
224
+ "hrm",
225
+ "hrms",
226
+ "itrms",
227
+ "personalization",
228
+ "projectManagement",
229
+ ];
230
+ const pathname = window.location.pathname;
231
+ // 获取最后一个 / 之间的内容
232
+ const segments = pathname.replace(/\/$/, "").split("/");
233
+ const lastSegment = segments[segments.length - 1];
234
+
235
+ if (subApps.includes(lastSegment)) {
236
+ // 删除最后一个路径段
237
+ segments.pop();
238
+ const basePath = segments.join("/") || "/";
239
+ const targetUrl =
240
+ window.location.origin +
241
+ (basePath.endsWith("/") ? basePath : basePath + "/") +
242
+ "#/application-entry";
243
+ window.location.replace(targetUrl);
244
+ } else {
245
+ router?.replace({ path: options?.entryUrl || "/application-entry" });
246
+ }
217
247
  };
218
248
 
219
249
  const handleCollapseChange = (collapsed: boolean) => {
package/src/init.ts CHANGED
@@ -30,7 +30,7 @@ const MenuStateRelation = {
30
30
  fms:"fms",
31
31
  hrm:"hrm",
32
32
  hrms:'hrms',
33
- itr::'itr',
33
+ itr:'itr',
34
34
  personalization:'imd',
35
35
  projectManagement:'projectManagement',
36
36
  }