提交 8a572da1 编写于 作者: tony001's avatar tony001

选择面板导航参数处理---fix1

上级 13cc018e
...@@ -176,6 +176,7 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code ...@@ -176,6 +176,7 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public afterCreated(){ public afterCreated(){
this.initNavParam();
if (this.viewState) { if (this.viewState) {
this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => { this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
if (!Object.is(tag, this.name)) { if (!Object.is(tag, this.name)) {
...@@ -190,6 +191,25 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code ...@@ -190,6 +191,25 @@ import ${srfclassname('${ctrl.codeName}')}Model from './${srffilepath2(ctrl.code
} }
} }
/**
* 初始化导航参数
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public initNavParam(){
if(this.localContext && Object.keys(this.localContext).length >0){
let _context:any = this.$util.computedNavData({},this.context,this.viewparams,this.localContext);
Object.assign(this.context,_context);
}
if(this.localViewParam && Object.keys(this.localViewParam).length >0){
let _param:any = this.$util.computedNavData({},this.context,this.viewparams,this.localViewParam);
Object.assign(this.viewparams,_param);
}
this.viewdata = JSON.stringify(this.context);
this.viewparam = JSON.stringify(this.viewparams);
}
/** /**
* vue 生命周期 * vue 生命周期
* *
......
<#-- content --> <view_${ctrl.getName()}
<#assign content> :viewState="viewState"
:viewparams="JSON.parse(JSON.stringify(viewparams))"
:context="JSON.parse(JSON.stringify(context))"
:isSingleSelect="isSingleSelect" :isSingleSelect="isSingleSelect"
:selectedData="selectedData" :selectedData="selectedData"
:isShowButton="isShowButton" :isShowButton="isShowButton"
</#assign> name="${ctrl.name}"
<#ibizinclude> ref='${ctrl.name}'
../@MACRO/HTML/DEFAULT.html.ftl <#if ctrl.getHookEventNames()??>
</#ibizinclude> <#list ctrl.getHookEventNames() as eventName>
\ No newline at end of file @${eventName?lower_case}="${ctrl.name}_${eventName?lower_case}($event)"
</#list>
</#if>
@closeview="closeView($event)">
</view_${ctrl.getName()}>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册