提交 23a94ed0 编写于 作者: WodahsOrez's avatar WodahsOrez

lxm---修复视图非路由方式打开后,内部路由跳转无效无提示的bug

上级 0b5285e9
...@@ -129,6 +129,9 @@ ${front_block} ...@@ -129,6 +129,9 @@ ${front_block}
delete data.srfparentdata; delete data.srfparentdata;
} }
const openIndexViewTab = (viewpath: string, data: any) => { const openIndexViewTab = (viewpath: string, data: any) => {
if(this.isModal){
this.$Notice.error({ title: '错误', desc: '父视图是非路由方式打开,子视图无法进行路由跳转' });
}else{
const _params = this.$util.prepareRouteParmas({ const _params = this.$util.prepareRouteParmas({
route: this.$route, route: this.$route,
sourceNode: this.$route.name, sourceNode: this.$route.name,
...@@ -136,6 +139,7 @@ ${front_block} ...@@ -136,6 +139,7 @@ ${front_block}
data: data, data: data,
}); });
this.$router.push({ name: viewpath, params: _params }); this.$router.push({ name: viewpath, params: _params });
}
resolve(); resolve();
} }
<#-- 打开模态 --> <#-- 打开模态 -->
...@@ -302,6 +306,9 @@ ${front_block} ...@@ -302,6 +306,9 @@ ${front_block}
delete data.srfparentdata; delete data.srfparentdata;
} }
const openIndexViewTab = (viewpath: string, data: any) => { const openIndexViewTab = (viewpath: string, data: any) => {
if(this.isModal){
this.$Notice.error({ title: '错误', desc: '父视图是非路由方式打开,子视图无法进行路由跳转' });
}else{
const _params = this.$util.prepareRouteParmas({ const _params = this.$util.prepareRouteParmas({
route: this.$route, route: this.$route,
sourceNode: this.$route.name, sourceNode: this.$route.name,
...@@ -309,6 +316,7 @@ ${front_block} ...@@ -309,6 +316,7 @@ ${front_block}
data: data, data: data,
}); });
this.$router.push({ name: viewpath, params: _params }); this.$router.push({ name: viewpath, params: _params });
}
resolve(); resolve();
} }
openIndexViewTab('${frontview.getPSAppModule().codeName?lower_case}_${frontview.codeName?lower_case}', data); openIndexViewTab('${frontview.getPSAppModule().codeName?lower_case}_${frontview.codeName?lower_case}', data);
......
...@@ -64,6 +64,9 @@ ...@@ -64,6 +64,9 @@
Object.assign(data, _this.srfparentdata); Object.assign(data, _this.srfparentdata);
} }
const openIndexViewTab = (viewpath: string, data: any) => { const openIndexViewTab = (viewpath: string, data: any) => {
if(this.isModal){
this.$Notice.error({ title: '错误', desc: '父视图是非路由方式打开,子视图无法进行路由跳转' });
}else{
Object.assign(data, { w: (new Date().getTime()) }); Object.assign(data, { w: (new Date().getTime()) });
const _params = this.$util.prepareRouteParmas({ const _params = this.$util.prepareRouteParmas({
route: this.$route, route: this.$route,
...@@ -73,6 +76,7 @@ ...@@ -73,6 +76,7 @@
}); });
this.$router.push({ name: viewpath, params: _params }); this.$router.push({ name: viewpath, params: _params });
} }
}
openIndexViewTab('${dataview.getPSAppModule().codeName?lower_case}_${dataview.codeName?lower_case}', data); openIndexViewTab('${dataview.getPSAppModule().codeName?lower_case}_${dataview.codeName?lower_case}', data);
<#elseif dataview.getOpenMode() = 'POPUPMODAL'> <#elseif dataview.getOpenMode() = 'POPUPMODAL'>
<#-- 打开模态 --> <#-- 打开模态 -->
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
<#-- 打开顶级分页视图 --> <#-- 打开顶级分页视图 -->
// 打开顶级分页视图 // 打开顶级分页视图
const openIndexViewTab = (viewpath: string, data: any) => { const openIndexViewTab = (viewpath: string, data: any) => {
if(this.isModal){
this.$Notice.error({ title: '错误', desc: '父视图是非路由方式打开,子视图无法进行路由跳转' });
}else{
const _params = this.$util.prepareRouteParmas({ const _params = this.$util.prepareRouteParmas({
route: this.$route, route: this.$route,
sourceNode: this.$route.name, sourceNode: this.$route.name,
...@@ -25,6 +28,7 @@ ...@@ -25,6 +28,7 @@
}); });
this.$router.push({ name: viewpath, params: _params }); this.$router.push({ name: viewpath, params: _params });
} }
}
<#-- 打开模态 --> <#-- 打开模态 -->
// 打开模态 // 打开模态
const openPopupModal = (view: any, data: any) => { const openPopupModal = (view: any, data: any) => {
...@@ -152,6 +156,9 @@ ...@@ -152,6 +156,9 @@
Object.assign(data, _this.srfparentdata); Object.assign(data, _this.srfparentdata);
} }
const openIndexViewTab = (viewpath: string, data: any) => { const openIndexViewTab = (viewpath: string, data: any) => {
if(this.isModal){
this.$Notice.error({ title: '错误', desc: '父视图是非路由方式打开,子视图无法进行路由跳转' });
}else{
const _params = this.$util.prepareRouteParmas({ const _params = this.$util.prepareRouteParmas({
route: this.$route, route: this.$route,
sourceNode: this.$route.name, sourceNode: this.$route.name,
...@@ -160,6 +167,7 @@ ...@@ -160,6 +167,7 @@
}); });
this.$router.push({ name: viewpath, params: _params }); this.$router.push({ name: viewpath, params: _params });
} }
}
openIndexViewTab('${dataview.getPSAppModule().codeName?lower_case}_${dataview.codeName?lower_case}', data); openIndexViewTab('${dataview.getPSAppModule().codeName?lower_case}_${dataview.codeName?lower_case}', data);
<#elseif dataview.getOpenMode() = 'POPUPMODAL'> <#elseif dataview.getOpenMode() = 'POPUPMODAL'>
<#-- 打开模态 --> <#-- 打开模态 -->
......
...@@ -62,6 +62,14 @@ export default class ${srfclassname('${view.name}')} extends Vue { ...@@ -62,6 +62,14 @@ export default class ${srfclassname('${view.name}')} extends Vue {
*/ */
@Prop() public viewdata!: string; @Prop() public viewdata!: string;
/**
* 该视图是否为模态方式打开
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}
*/
@Prop({default:false}) public isModal?:boolean;
/** /**
* 视图标识 * 视图标识
* *
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册