提交 28faa522 编写于 作者: KK's avatar KK

多数据 兼容排序 分类

上级 3dd7d2a5
...@@ -28,6 +28,22 @@ ...@@ -28,6 +28,22 @@
*/ */
public isExpandSearchForm: boolean = false; public isExpandSearchForm: boolean = false;
/**
* 排序值
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
public sortValue :any;
/**
* 分类值
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}Base
*/
public categoryValue :any;
/** /**
* 执行搜索表单 * 执行搜索表单
* *
...@@ -131,30 +147,22 @@ ...@@ -131,30 +147,22 @@
public onSort(field: any) { public onSort(field: any) {
if (this.sort.desc == field) { if (this.sort.desc == field) {
this.sort.desc = ""; this.sort.desc = "";
this.engine.onViewEvent('mdctrl', 'sort', {}); this.sortValue = {};
this.onViewLoad();
return return
} }
if (this.sort.asc == field) { if (this.sort.asc == field) {
this.sort.asc = ""; this.sort.asc = "";
this.sort.desc = field; this.sort.desc = field;
this.engine.onViewEvent('mdctrl', 'sort', { sort: field + ",desc" }); this.sortValue = { sort: field + ",desc" };
this.onViewLoad();
} else { } else {
this.sort.asc = field; this.sort.asc = field;
this.sort.desc = ""; this.sort.desc = "";
this.engine.onViewEvent('mdctrl', 'sort', { sort: field + ",asc" }); this.sortValue = { sort: field + ",asc" };
this.onViewLoad();
} }
} }
/**
* 分类搜索
*
* @param {*} value
* @memberof ${srfclassname('${view.name}')}Base
*/
public onCategory(value:any){
this.engine.onViewEvent('mdctrl','category',value);
}
</#if> </#if>
</#if> </#if>
</#if> </#if>
...@@ -219,6 +227,26 @@ ...@@ -219,6 +227,26 @@
this.showCheackChange(false); this.showCheackChange(false);
} }
/**
* 视图加载(排序|分类)
* @memberof ${srfclassname('${view.name}')}Base
*/
public onViewLoad() {
let value = Object.assign(this.categoryValue,this.sortValue);
this.engine.onViewEvent('mdctrl','viewload',value);
}
/**
* 分类搜索
*
* @param {*} value
* @memberof MOBENTITYHDLBBase
*/
public onCategory(value:any){
this.categoryValue = value;
this.onViewLoad();
}
<#if view.hasPSControl('mdctrl')> <#if view.hasPSControl('mdctrl')>
<#assign mdctrl = view.getPSControl('mdctrl')> <#assign mdctrl = view.getPSControl('mdctrl')>
<#if mdctrl.getBatchPSDEToolbar?? && mdctrl.getBatchPSDEToolbar()??> <#if mdctrl.getBatchPSDEToolbar?? && mdctrl.getBatchPSDEToolbar()??>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册