提交 c3dda3b0 编写于 作者: Cano1997's avatar Cano1997

update:视图标题多语言优化

上级 0c5f1056
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</template> </template>
<template #headerLeft> <template #headerLeft>
<#if view.isShowCaptionBar()> <#if view.isShowCaptionBar()>
<app-caption :openType="openType" :caption="$t(model.srfCaption<#if view.getCaption()??>, '${view.getCaption()}'</#if>)"></app-caption> <app-caption :openType="openType" :caption="model.srfCaption"></app-caption>
</#if> </#if>
</template> </template>
<template #headerRight> <template #headerRight>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar') || view.isEnableQuickGroup() || view.getQuickPSDESearchForm()??)> <#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar') || view.isEnableQuickGroup() || view.getQuickPSDESearchForm()??)>
<template #headerTop> <template #headerTop>
<#if view.isShowCaptionBar()> <#if view.isShowCaptionBar()>
<app-caption v-if="openType == 'EMBED'" :openType="openType" :caption="$t(model.srfCaption<#if view.getCaption()??>, '${view.getCaption()}'</#if>)"></app-caption> <app-caption v-if="openType == 'EMBED'" :openType="openType" :caption="model.srfCaption"></app-caption>
</#if> </#if>
<#if view.hasPSControl('toolbar')> <#if view.hasPSControl('toolbar')>
<@ibizindent blank=8> <@ibizindent blank=8>
......
...@@ -9,6 +9,6 @@ ...@@ -9,6 +9,6 @@
<span class='caption-image'><img src='${viewimg.getImagePath()}'/></span> <span class='caption-image'><img src='${viewimg.getImagePath()}'/></span>
</#if> </#if>
</#if> </#if>
<span class='caption-info' :title="$t(model.srfCaption)">{{$t(model.srfCaption<#if view.getCaption()??>, '${view.getCaption()}'</#if>)}}</span> <span class='caption-info' :title="model.srfCaption">{{model.srfCaption}}</span>
</div> </div>
</#if> </#if>
\ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<span class='caption-image'><img src='${viewimg.getImagePath()}'/></span> <span class='caption-image'><img src='${viewimg.getImagePath()}'/></span>
</#if> </#if>
</#if> </#if>
<span class='caption-info'>{{$t(model.srfCaption<#if view.getCaption()??>, '${view.getCaption()}'</#if>)}}</span> <span class='caption-info'>{{model.srfCaption}}</span>
</#if> </#if>
<#if view.hasPSControl('toolbar')> <#if view.hasPSControl('toolbar')>
<#if selfToolbarRender??> <#if selfToolbarRender??>
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<span class='caption-image'><img src='${viewimg.getImagePath()}'/></span> <span class='caption-image'><img src='${viewimg.getImagePath()}'/></span>
</#if> </#if>
</#if> </#if>
<span class='caption-info'>{{$t(model.srfCaption<#if view.getCaption()??>, '${view.getCaption()}'</#if>)}}</span> <span class='caption-info'>{{model.srfCaption}}</span>
</#if> </#if>
</div> </div>
</#if> </#if>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<app-index-view-layout-top :class="{ [themeClasses]: true, '${srffilepath2(view.getCodeName())}': true<#if view.getPSSysCss?? && view.getPSSysCss()??>, '${view.getPSSysCss().getCssName()}': true</#if> }" :style="themeStyle"> <app-index-view-layout-top :class="{ [themeClasses]: true, '${srffilepath2(view.getCodeName())}': true<#if view.getPSSysCss?? && view.getPSSysCss()??>, '${view.getPSSysCss().getCssName()}': true</#if> }" :style="themeStyle">
<template #headerLeft> <template #headerLeft>
<img class="app-icon" src="../../../assets/img/logo.png" /> <img class="app-icon" src="../../../assets/img/logo.png" />
<span class="app-caption">{{$t(model.srfCaption<#if view.getCaption()??>, '${view.getCaption()}'</#if>)}}</span> <span class="app-caption">{{model.srfCaption}}</span>
</template> </template>
<template #headerRight> <template #headerRight>
${P.getCtrlCode('appmenu', 'CONTROL.html').code} ${P.getCtrlCode('appmenu', 'CONTROL.html').code}
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<#else> <#else>
<span class="menuicon" v-if="isEnableAppSwitch" @click="contextMenuDragVisiable=!contextMenuDragVisiable"><Icon class="app-icon" type="md-menu" /></span> <span class="menuicon" v-if="isEnableAppSwitch" @click="contextMenuDragVisiable=!contextMenuDragVisiable"><Icon class="app-icon" type="md-menu" /></span>
</#if> </#if>
<span class="app-caption" v-show="!collapseChange">{{$t(model.srfCaption<#if view.getCaption()??>, '${view.getCaption()}'</#if>)}}</span> <span class="app-caption" v-show="!collapseChange">{{model.srfCaption}}</span>
</div> </div>
</template> </template>
<template #siderContent> <template #siderContent>
......
...@@ -292,7 +292,7 @@ ...@@ -292,7 +292,7 @@
*/ */
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){ public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){ if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'${srffilepath2(view.getCodeName())}',tag:this.viewtag,srfkey:isNew ? null : <#if appde??>this.context.${appde.getCodeName()?lower_case}<#else>null</#if>,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath}); this.navDataService.addNavData({id:'${srffilepath2(view.getCodeName())}',tag:this.viewtag,srfkey:isNew ? null : <#if appde??>this.context.${appde.getCodeName()?lower_case}<#else>null</#if>,title:this.model.srfCaption,data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
} }
} }
...@@ -303,7 +303,7 @@ ...@@ -303,7 +303,7 @@
*/ */
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){ public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){ if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'${srffilepath2(view.getCodeName())}',tag:this.viewtag,srfkey:<#if appde??>this.context.${appde.getCodeName()?lower_case}<#else>null</#if>,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd); this.navDataService.addNavDataByOnly({id:'${srffilepath2(view.getCodeName())}',tag:this.viewtag,srfkey:<#if appde??>this.context.${appde.getCodeName()?lower_case}<#else>null</#if>,title:this.model.srfCaption,data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
} }
} }
......
...@@ -186,9 +186,9 @@ export default class ${srfclassname('${view.name}')}Base extends Vue { ...@@ -186,9 +186,9 @@ export default class ${srfclassname('${view.name}')}Base extends Vue {
* @memberof ${srfclassname('${view.name}')}Base * @memberof ${srfclassname('${view.name}')}Base
*/ */
public model: any = { public model: any = {
srfCaption: '<#if view.getCapPSLanguageRes()??>${view.getCapPSLanguageRes().getLanResTag()}<#else><#if view.getCaption()??>${view.getCaption()}</#if></#if>', srfCaption: <#if view.getCapPSLanguageRes()??>this.$t('${view.getCapPSLanguageRes().getLanResTag()}','<#if view.getCaption()??>${view.getCaption()}</#if>')<#else>'<#if view.getCaption()??>${view.getCaption()}</#if>'</#if>,
srfTitle: '<#if view.getTitlePSLanguageRes()??>${view.getTitlePSLanguageRes().getLanResTag()}<#else><#if view.getTitle()??>${view.getTitle()}</#if></#if>', srfTitle: <#if view.getTitlePSLanguageRes()??>this.$t('${view.getTitlePSLanguageRes().getLanResTag()}','<#if view.getTitle()??>${view.getTitle()}</#if>')<#else>'<#if view.getTitle()??>${view.getTitle()}</#if>'</#if>,
srfSubTitle: '<#if view.getSubCapPSLanguageRes()??>${view.getSubCapPSLanguageRes().getLanResTag()}<#else><#if view.getSubCaption()??>${view.getSubCaption()}</#if></#if>', srfSubTitle: <#if view.getSubCapPSLanguageRes()??>this.$t('${view.getSubCapPSLanguageRes().getLanResTag()}','<#if view.getSubCaption()??>${view.getSubCaption()}</#if>')<#else>'<#if view.getSubCaption()??>${view.getSubCaption()}</#if>'</#if>,
dataInfo: '' dataInfo: ''
} }
......
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
Object.assign(this.model, { dataInfo: _data.${appDataEntity.getMajorPSAppDEField().getCodeName()?lower_case} }); Object.assign(this.model, { dataInfo: _data.${appDataEntity.getMajorPSAppDEField().getCodeName()?lower_case} });
if(this.$tabPageExp){ if(this.$tabPageExp){
let _this:any = this; let _this:any = this;
this.$tabPageExp.setCurPageCaption(_this.$t(this.model.srfCaption), this.model.srfCaption, _this.model.dataInfo); this.$tabPageExp.setCurPageCaption(this.model.srfCaption, this.model.dataInfo);
} }
if(this.$route && this.$route.meta){ if(this.$route && this.$route.meta){
this.$route.meta.info = this.model.dataInfo; this.$route.meta.info = this.model.dataInfo;
} }
<#noparse>Object.assign(this.model, { srfCaption: `${this.$t(this.model.srfCaption)} - ${this.$t(this.model.dataInfo)}` });</#noparse> <#noparse>Object.assign(this.model, { srfCaption: `${this.model.srfCaption} - ${this.$t(this.model.dataInfo)}` });</#noparse>
} }
}) })
} }
......
...@@ -21,12 +21,12 @@ this.$forceUpdate(); ...@@ -21,12 +21,12 @@ this.$forceUpdate();
Object.assign(this.model, { dataInfo: _data.${appDataEntity.getMajorPSAppDEField().getCodeName()?lower_case} }); Object.assign(this.model, { dataInfo: _data.${appDataEntity.getMajorPSAppDEField().getCodeName()?lower_case} });
if(this.$tabPageExp){ if(this.$tabPageExp){
let _this:any = this; let _this:any = this;
this.$tabPageExp.setCurPageCaption(_this.$t(this.model.srfCaption), this.model.srfCaption, _this.model.dataInfo); this.$tabPageExp.setCurPageCaption(this.model.srfCaption, this.model.dataInfo);
} }
if(this.$route && this.$route.meta){ if(this.$route && this.$route.meta){
this.$route.meta.info = this.model.dataInfo; this.$route.meta.info = this.model.dataInfo;
} }
<#noparse>Object.assign(this.model, { srfCaption: `${this.$t(this.model.srfCaption)} - ${this.$t(this.model.dataInfo)}` });</#noparse> <#noparse>Object.assign(this.model, { srfCaption: `${this.model.srfCaption} - ${this.$t(this.model.dataInfo)}` });</#noparse>
} }
}) })
} }
......
...@@ -31,12 +31,12 @@ this.$forceUpdate(); ...@@ -31,12 +31,12 @@ this.$forceUpdate();
Object.assign(this.model, { dataInfo: _data.${appDataEntity.getMajorPSAppDEField().getCodeName()?lower_case} }); Object.assign(this.model, { dataInfo: _data.${appDataEntity.getMajorPSAppDEField().getCodeName()?lower_case} });
if(this.$tabPageExp){ if(this.$tabPageExp){
let _this:any = this; let _this:any = this;
this.$tabPageExp.setCurPageCaption(_this.$t(this.model.srfCaption), this.model.srfCaption, _this.model.dataInfo); this.$tabPageExp.setCurPageCaption(this.model.srfCaption, this.model.dataInfo);
} }
if(this.$route && this.$route.meta){ if(this.$route && this.$route.meta){
this.$route.meta.info = this.model.dataInfo; this.$route.meta.info = this.model.dataInfo;
} }
<#noparse>Object.assign(this.model, { srfCaption: `${this.$t(this.model.srfCaption)} - ${this.$t(this.model.dataInfo)}` });</#noparse> <#noparse>Object.assign(this.model, { srfCaption: `${this.model.srfCaption} - ${this.$t(this.model.dataInfo)}` });</#noparse>
} }
}) })
} }
......
...@@ -31,12 +31,12 @@ this.$forceUpdate(); ...@@ -31,12 +31,12 @@ this.$forceUpdate();
Object.assign(this.model, { dataInfo: _data.${appDataEntity.getMajorPSAppDEField().getCodeName()?lower_case} }); Object.assign(this.model, { dataInfo: _data.${appDataEntity.getMajorPSAppDEField().getCodeName()?lower_case} });
if(this.$tabPageExp){ if(this.$tabPageExp){
let _this:any = this; let _this:any = this;
this.$tabPageExp.setCurPageCaption(_this.$t(this.model.srfCaption), this.model.srfCaption, _this.model.dataInfo); this.$tabPageExp.setCurPageCaption(this.model.srfCaption, this.model.dataInfo);
} }
if(this.$route && this.$route.meta){ if(this.$route && this.$route.meta){
this.$route.meta.info = this.model.dataInfo; this.$route.meta.info = this.model.dataInfo;
} }
<#noparse>Object.assign(this.model, { srfCaption: `${this.$t(this.model.srfCaption)} - ${this.$t(this.model.dataInfo)}` });</#noparse> <#noparse>Object.assign(this.model, { srfCaption: `${this.model.srfCaption} - ${this.$t(this.model.dataInfo)}` });</#noparse>
} }
}) })
} }
......
...@@ -241,9 +241,9 @@ export default class ${srfclassname('${view.name}')}Base extends Vue { ...@@ -241,9 +241,9 @@ export default class ${srfclassname('${view.name}')}Base extends Vue {
* @memberof ${srfclassname('${view.name}')}Base * @memberof ${srfclassname('${view.name}')}Base
*/ */
public model: any = { public model: any = {
srfCaption: '<#if view.getCapPSLanguageRes()??>${view.getCapPSLanguageRes().getLanResTag()}<#else><#if view.getCaption()??>${view.getCaption()}</#if></#if>', srfCaption: <#if view.getCapPSLanguageRes()??>this.$t('${view.getCapPSLanguageRes().getLanResTag()}','<#if view.getCaption()??>${view.getCaption()}</#if>')<#else>'<#if view.getCaption()??>${view.getCaption()}</#if>'</#if>,
srfTitle: '<#if view.getTitlePSLanguageRes()??>${view.getTitlePSLanguageRes().getLanResTag()}<#else><#if view.getTitle()??>${view.getTitle()}</#if></#if>', srfTitle: <#if view.getTitlePSLanguageRes()??>this.$t('${view.getTitlePSLanguageRes().getLanResTag()}','<#if view.getTitle()??>${view.getTitle()}</#if>')<#else>'<#if view.getTitle()??>${view.getTitle()}</#if>'</#if>,
srfSubTitle: '<#if view.getSubCapPSLanguageRes()??>${view.getSubCapPSLanguageRes().getLanResTag()}<#else><#if view.getSubCaption()??>${view.getSubCaption()}</#if></#if>', srfSubTitle: <#if view.getSubCapPSLanguageRes()??>this.$t('${view.getSubCapPSLanguageRes().getLanResTag()}','<#if view.getSubCaption()??>${view.getSubCaption()}</#if>')<#else>'<#if view.getSubCaption()??>${view.getSubCaption()}</#if>'</#if>,
dataInfo: '' dataInfo: ''
} }
...@@ -640,7 +640,7 @@ export default class ${srfclassname('${view.name}')}Base extends Vue { ...@@ -640,7 +640,7 @@ export default class ${srfclassname('${view.name}')}Base extends Vue {
*/ */
public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){ public initNavDataWithRoute(data:any = null, isNew:boolean = false, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){ if( isAlways || (this.viewDefaultUsage && Object.is(this.navModel,"route")) ){
this.navDataService.addNavData({id:'${srffilepath2(view.getCodeName())}',tag:this.viewtag,srfkey:isNew ? null : <#if appde??>this.context.${appde.getCodeName()?lower_case}<#else>null</#if>,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath}); this.navDataService.addNavData({id:'${srffilepath2(view.getCodeName())}',tag:this.viewtag,srfkey:isNew ? null : <#if appde??>this.context.${appde.getCodeName()?lower_case}<#else>null</#if>,title:this.model.srfCaption,data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath});
} }
} }
...@@ -651,7 +651,7 @@ export default class ${srfclassname('${view.name}')}Base extends Vue { ...@@ -651,7 +651,7 @@ export default class ${srfclassname('${view.name}')}Base extends Vue {
*/ */
public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){ public initNavDataWithTab(data:any = null,isOnlyAdd:boolean = true, isAlways:boolean = false){
if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){ if( isAlways || (this.viewDefaultUsage && !Object.is(this.navModel,"route")) ){
this.navDataService.addNavDataByOnly({id:'${srffilepath2(view.getCodeName())}',tag:this.viewtag,srfkey:<#if appde??>this.context.${appde.getCodeName()?lower_case}<#else>null</#if>,title:this.$t(this.model.srfCaption),data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd); this.navDataService.addNavDataByOnly({id:'${srffilepath2(view.getCodeName())}',tag:this.viewtag,srfkey:<#if appde??>this.context.${appde.getCodeName()?lower_case}<#else>null</#if>,title:this.model.srfCaption,data:data,context:this.context,viewparams:this.viewparams,path:this.$route.fullPath},isOnlyAdd);
} }
} }
...@@ -934,12 +934,12 @@ export default class ${srfclassname('${view.name}')}Base extends Vue { ...@@ -934,12 +934,12 @@ export default class ${srfclassname('${view.name}')}Base extends Vue {
} }
// 解决表格视图标题问题 // 解决表格视图标题问题
if (this.$tabPageExp && this.viewDefaultUsage) { if (this.$tabPageExp && this.viewDefaultUsage) {
this.$tabPageExp.setCurPageCaption(this.$t(this.model.srfCaption) as string, this.model.srfCaption, info); this.$tabPageExp.setCurPageCaption(this.model.srfCaption, info);
} }
if (this.$route && this.$route.meta) { if (this.$route && this.$route.meta) {
this.$route.meta.info = info; this.$route.meta.info = info;
} }
<#noparse>this.model.srfCaption = `${this.$t(this.model.srfCaption)}-${this.$t(this.model.dataInfo)}`;</#noparse> <#noparse>this.model.srfCaption = `${this.model.srfCaption}-${this.$t(this.model.dataInfo)}`;</#noparse>
this.initNavDataWithRoute(null,isNew); this.initNavDataWithRoute(null,isNew);
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册