提交 11dd4494 编写于 作者: KK's avatar KK

表单检查逻辑

上级 6278bfc5
......@@ -191,12 +191,17 @@ ${P.getLogicCode(logic, "LOGIC.vue").code}
* @memberof ${srfclassname('${view.name}')}Base
*/
protected closeView(args: any[]): void {
<#if userCloseView??>
${userCloseView}
<#else>
if (this.viewDefaultUsage) {
this.$store.commit("deletePage", this.$route.fullPath);
this.$router.go(-1);
} else {
this.$emit("close", { status: "success", action: "close", data: args instanceof MouseEvent ? null : args });
}
</#if>
}
/**
......
......@@ -4,6 +4,18 @@
Object.assign(this.viewparams,bainfo);
}
</#assign>
<#assign userCloseView>
let result = await this.cheackChange();
if(result){
if (this.viewDefaultUsage) {
this.$store.commit("deletePage", this.$route.fullPath);
this.$router.go(-1);
} else {
this.$emit("close", { status: "success", action: "close", data: args instanceof MouseEvent ? null : args });
}
}
</#assign>
<#ibizinclude>
../@MACRO/LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
......@@ -41,7 +53,28 @@
}
}
/**
* 检查表单是否修改
*
* @param {any[]} args
* @memberof PimEducationMobEditViewBase
*/
public async cheackChange(): Promise<any>{
const view = this.$store.getters['viewaction/getAppView'](this.viewtag);
if (view && view.viewdatachange) {
const title: any = this.$t('app.tabpage.sureclosetip.title');
const contant: any = this.$t('app.tabpage.sureclosetip.content');
const result = await this.$notice.confirm(title, contant);
if (result) {
this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: false });
return true;
} else {
return false;
}
}else{
return true;
}
}
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册