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

update:更新表格导航视图

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