|
@@ -178,10 +178,8 @@
|
|
|
async handleAddOrEdit(row, formPath) {
|
|
async handleAddOrEdit(row, formPath) {
|
|
|
await updateNotifyMessageReadByIdAPI([row.id]);
|
|
await updateNotifyMessageReadByIdAPI([row.id]);
|
|
|
if (formPath) {
|
|
if (formPath) {
|
|
|
- // 跨子系统跳转:pushState + 触发 popstate 让 qiankun 主应用感知路由变化
|
|
|
|
|
- window.history.pushState(null, '', formPath);
|
|
|
|
|
- const evt = new PopStateEvent('popstate', { state: null });
|
|
|
|
|
- window.dispatchEvent(evt);
|
|
|
|
|
|
|
+ // 跨子系统跳转:使用 location.href 整页跳转
|
|
|
|
|
+ window.location.href = formPath;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
this.$refs.table.reload();
|
|
this.$refs.table.reload();
|
|
@@ -197,13 +195,12 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
goDetail(row) {
|
|
goDetail(row) {
|
|
|
- console.log('111111111111111111');
|
|
|
|
|
console.log('row', row.formPath);
|
|
console.log('row', row.formPath);
|
|
|
const formPath = row.formPath;
|
|
const formPath = row.formPath;
|
|
|
if (!formPath) return;
|
|
if (!formPath) return;
|
|
|
// 获取当前子系统的路由 base 前缀
|
|
// 获取当前子系统的路由 base 前缀
|
|
|
const routerBase = this.$router.options.base || '/';
|
|
const routerBase = this.$router.options.base || '/';
|
|
|
- // 判断目标路径是否属于当前子系统
|
|
|
|
|
|
|
+ // 判断目标路径是否属于当前子系统(以当前子系统 base 开头或不含 /page- 前缀)
|
|
|
const isCurrentApp =
|
|
const isCurrentApp =
|
|
|
formPath.startsWith(routerBase) || !formPath.startsWith('/page-');
|
|
formPath.startsWith(routerBase) || !formPath.startsWith('/page-');
|
|
|
if (isCurrentApp) {
|
|
if (isCurrentApp) {
|
|
@@ -213,10 +210,8 @@
|
|
|
: formPath;
|
|
: formPath;
|
|
|
this.$router.push(innerPath);
|
|
this.$router.push(innerPath);
|
|
|
} else {
|
|
} else {
|
|
|
- // 跨子系统跳转:通过修改 URL 并触发 popstate 让 qiankun 主应用切换子系统
|
|
|
|
|
- window.history.pushState(null, '', formPath);
|
|
|
|
|
- const evt = new PopStateEvent('popstate', { state: null });
|
|
|
|
|
- window.dispatchEvent(evt);
|
|
|
|
|
|
|
+ // 跨子系统跳转:使用 location.href 整页跳转,让主应用重新加载目标子系统
|
|
|
|
|
+ window.location.href = formPath;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|