提交 0654fb6f 编写于 作者: Mosher's avatar Mosher

update:更新表格导航视图

上级 230b4226
......@@ -21,8 +21,9 @@
</#if>
<#if ctrl.isEnableSearch()>
<div class='search-container'>
<i-input :search="true"
@on-change="($event) => { this.searchText = $event.target.value; }"
<i-input
v-model="searchText"
:search="true"
:placeholder="placeholder"
@on-search="onSearch">
</i-input>
......@@ -151,15 +152,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
* @type {(string)}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public searchText:string = "";
/**
* 分割宽度
*
* @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public split: number = 0.5;
public searchText: string = "";
<#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl() />
......@@ -458,42 +451,48 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void {
let tempContext:any = {};
let tempViewParam:any = {};
const tempContext: any = {};
const tempViewParam: any = {};
if (args.length === 0) {
this.calcToolbarItemState(true);
return ;
}
const arg:any = args[0];
if(this.context){
Object.assign(tempContext,JSON.parse(JSON.stringify(this.context)));
const arg: any = args[0];
if (this.context) {
Object.assign(tempContext, JSON.parse(JSON.stringify(this.context)));
}
<#if ctrl.getXDataPSControl()??>
<#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl()/>
<#if xDataControl.getPSAppDataEntity()??>
<#assign curDataEntity = xDataControl.getPSAppDataEntity()/>
Object.assign(tempContext,{'${curDataEntity.getCodeName()?lower_case}':arg['${curDataEntity.getCodeName()?lower_case}']});
Object.assign(tempContext,{srfparentdename:'${curDataEntity.getCodeName()}',srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']});
if(this.navFilter && !Object.is(this.navFilter,"")){
Object.assign(tempViewParam,{[this.navFilter]:arg['${curDataEntity.getCodeName()?lower_case}']});
Object.assign(tempContext, { '${curDataEntity.getCodeName()?lower_case}': arg['${curDataEntity.getCodeName()?lower_case}']});
Object.assign(tempContext, { srfparentdename: '${curDataEntity.getCodeName()}', srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']});
if (this.navFilter && !Object.is(this.navFilter, "")) {
Object.assign(tempViewParam, { [this.navFilter]: arg['${curDataEntity.getCodeName()?lower_case}']});
}
if(this.navPSDer && !Object.is(this.navPSDer,"")){
Object.assign(tempViewParam,{[this.navPSDer]:arg['${curDataEntity.getCodeName()?lower_case}']});
if (this.navPSDer && !Object.is(this.navPSDer,"")) {
Object.assign(tempViewParam, { [this.navPSDer]: arg['${curDataEntity.getCodeName()?lower_case}']});
}
</#if>
</#if>
if(this.navigateContext && Object.keys(this.navigateContext).length >0){
let _context:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateContext);
Object.assign(tempContext,_context);
</#if>
if (this.navigateContext && Object.keys(this.navigateContext).length > 0) {
let _context:any = this.$util.computedNavData(arg, tempContext, tempViewParam, this.navigateContext);
Object.assign(tempContext, _context);
}
if (this.navigateParams && Object.keys(this.navigateParams).length > 0) {
let _params:any = this.$util.computedNavData(arg, tempContext, tempViewParam, this.navigateParams);
Object.assign(tempViewParam, _params);
}
const navItem: any = {
navView: this.navViewName,
data: args,
srfnavdata: {
context: tempContext,
viewparams: tempViewParam
}
if(this.navigateParams && Object.keys(this.navigateParams).length >0){
let _params:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateParams);
Object.assign(tempViewParam,_params);
}
this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName }, context:tempContext,viewparam:tempViewParam });
this.calcToolbarItemState(false);
this.$forceUpdate();
this.$emit('selectionchange', navItem);
}
/**
......
......@@ -27,12 +27,12 @@
</div>
<div slot="<#if view.getSideBarLayout()?? && view.getSideBarLayout() == "LEFT">right<#else>bottom</#if>">
<component
v-if="selection.view && !Object.is(this.selection.view.viewname, '')"
:is="selection.view.viewname"
v-if="navItem && navItem.navView"
:is="navItem.navView"
class="viewcontainer2"
:viewDefaultUsage="false"
:viewdata="JSON.stringify(selection.context)"
:viewparam="JSON.stringify(selection.viewparam)">
:viewdata="JSON.stringify(navItem.srfnavdata.context)"
:viewparam="JSON.stringify(navItem.srfnavdata.viewparams)">
</component>
</div>
</split>
......
......@@ -21,10 +21,18 @@
/**
* 分隔值
*
* @type {string}
* @type {number}
* @memberof ${srfclassname('${view.name}')}Base
*/
public split: number = 0.5;
/**
* 导航项
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
public split: number = 0.3;
public navItem: any = {};
/**
* split值变化事件
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册