提交 1d3de7b8 编写于 作者: tony001's avatar tony001

修复数据关系栏导航参数

上级 67c3fbe7
......@@ -55,7 +55,7 @@
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public formData!:any;
@Prop({default:{}}) public formData?:any;
/**
* 获取多项数据
......
......@@ -28,6 +28,10 @@
</template>
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
</#ibizinclude>
<#ibizinclude>
../@MACRO/FUNC/MACRO.ftl
</#ibizinclude>
/**
......@@ -58,6 +62,14 @@
*/
@Prop() public loadAction?: string;
/**
* 表单数据
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop({default:{}}) public formData?:any;
/**
* 数据选中项
*
......@@ -93,6 +105,24 @@
</#list>
];
/**
* 关系栏数据项导航参数集合
*
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public navParamsArray:Array<any> = [
<#if ctrl.getPSDEDRCtrlItems?? && ctrl.getPSDEDRCtrlItems()??>
<#list ctrl.getPSDEDRCtrlItems() as appdeDrCtrlItem>
{
id:'${appdeDrCtrlItem.getName()?lower_case}',
localContext:<#if appdeDrCtrlItem.getPSNavigateContexts?? && appdeDrCtrlItem.getPSNavigateContexts()??><@getNavigateContext appdeDrCtrlItem /><#else>null</#if>,
localViewParam:<#if appdeDrCtrlItem.getPSNavigateParams?? && appdeDrCtrlItem.getPSNavigateParams()??><@getNavigateParams appdeDrCtrlItem /><#else>null</#if>
}<#if appdeDrCtrlItem_has_next>,</#if>
</#list>
</#if>
];
/**
* 默认打开项
*
......@@ -229,6 +259,36 @@
return item;
}
/**
* 初始化导航参数
*
* @param {*} drItem
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public initNavParam(drItem:any){
let returnNavParam:any = {};
if(drItem && drItem.id){
let curDRItem:any = this.navParamsArray.find((item:any) =>{
return Object.is(item.id,drItem.id);
})
if(curDRItem){
let localContext:any = curDRItem.localContext;
let localViewParam:any = curDRItem.localViewParam;
if(localContext && Object.keys(localContext).length >0){
let _context:any = this.$util.computedNavData(this.formData,this.context,this.viewparams,localContext);
returnNavParam.localContext = _context;
}
if(localViewParam && Object.keys(localViewParam).length >0){
let _params:any = this.$util.computedNavData(this.formData,this.context,this.viewparams,localViewParam);
returnNavParam.localViewParam = _params;
}
return returnNavParam;
}else{
return null;
}
}
}
/**
* 节点选中
*
......
<#assign self_content>
/**
* 表单数据
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
public formData:any = {};
</#assign>
<#ibizinclude>
../@MACRO/VIEW-BASE.vue.ftl
</#ibizinclude>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册