提交 9ee3e123 编写于 作者: KK's avatar KK

分页导航视图计数器

上级 06c4e745
......@@ -17,9 +17,8 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/ap
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
<#if ctrl.getPSAppCounterRefs?? && ctrl.getPSAppCounterRefs()??>
<#assign counterRefs = ''/>
<#if ctrl.getPSAppCounterRefs?? && ctrl.getPSAppCounterRefs()??>
<#list ctrl.getPSAppCounterRefs() as singleCounterRef>
<#if singleCounterRef.getPSAppCounter()??>
<#assign appCounter = singleCounterRef.getPSAppCounter()/>
......@@ -34,6 +33,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/ap
protected ${srfclassname('${appCounter.getCodeName()}')}counterservice: ${srfclassname('${appCounter.getCodeName()}')}CounterService = new ${srfclassname('${appCounter.getCodeName()}')}CounterService({$store: this.$store,context:this.context,viewparams:this.viewparams});
</#if>
</#list>
</#if>
/**
* 计数器服务对象集合
......@@ -42,8 +42,16 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/ap
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected counterServiceArray:Array<any> = [${counterRefs}];
</#if>
/**
* 加载计数器数据
*
* @param {any[]} args
* @memberof ProdMobTabExpViewtabexppanel
*/
public async loadCounterData() {
this.$emit("counterInit",this.counterServiceArray[0]);
}
/**
* 销毁计数器服务
......@@ -129,6 +137,25 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/ap
}
}
/**
* vue 生命周期
*
* @returns
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public mounted() {
this.afterMounted();
}
/**
* 执行mounted后的逻辑
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public afterMounted(){
this.loadCounterData();
}
/**
* vue 生命周期
*
......
<#assign content>
:activiedTabViewPanel="activiedTabViewPanel"
@changepanel="changePanel"
:activiedTabViewPanel="activiedTabViewPanel"
@changepanel="changePanel"
@counterInit="counterInit"
</#assign>
<#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl
......
......@@ -9,7 +9,7 @@
<#if tabviewpanel.getPSSysImage?? && tabviewpanel.getPSSysImage()?? && tabviewpanel.getPSSysImage().getCssClass?? && tabviewpanel.getPSSysImage().getCssClass()?? >
<ion-icon name="${tabviewpanel.getPSSysImage().getCssClass()}"></ion-icon>
</#if>
<ion-badge v-if="false" color="danger">2</ion-badge>
<#if tabviewpanel.getCounterId?? && tabviewpanel.getCounterId()><ion-badge color="danger">{{counter.counterData.${tabviewpanel.getCounterId()}?counter.counterData.${tabviewpanel.getCounterId()}:''}}</ion-badge></#if>
${tabviewpanel.getCaption()}</ion-segment-button>
</#list>
</#if>
......
......@@ -13,6 +13,26 @@
<#assign created_block>
this.getLocalStorage();
</#assign>
/**
* 计数器数据
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
public counter:any = {counterData:{}} ;
/**
* 计数器初始化
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}Base
*/
private counterInit(value:any) {
this.counter = value;
}
/**
* 被激活的分页面板
*
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册