提交 78b9f8ae 编写于 作者: KK's avatar KK

排序逻辑调整

上级 7dbe735a
......@@ -25,8 +25,8 @@
<#list mdctrl.getPSListItems() as item>
<#if item.isEnableSort() && !item.getPSCodeList()??>
<div class="view-tool-sorts-item">
<span class="text" @click="setSort('<#if item.getName()??>${item.getName()}</#if>')"><#if item.getCaption()??>${item.getCaption()}</#if></span>
<span class="sort-icon" @click="setSort('<#if item.getName()??>${item.getName()}</#if>')">
<span class="text" @click="onSort('<#if item.getName()??>${item.getName()}</#if>')"><#if item.getCaption()??>${item.getCaption()}</#if></span>
<span class="sort-icon" @click="onSort('<#if item.getName()??>${item.getName()}</#if>')">
<ion-icon :class="{'ios' : true ,'hydrated': true ,'sort-select': sort.asc == '<#if item.getName()??>${item.getName()}</#if>'}" name="chevron-up-outline" ></ion-icon>
<ion-icon :class="{'ios' : true ,'hydrated': true ,'sort-select': sort.desc == '<#if item.getName()??>${item.getName()}</#if>'}" name="chevron-down-outline" ></ion-icon>
</span>
......
......@@ -136,20 +136,20 @@
* @param {*} field
* @memberof ${srfclassname('${view.name}')}Base
*/
public setSort(field: any) {
public onSort(field: any) {
if (this.sort.desc == field) {
this.sort.desc = "";
this.viewState.next({ tag: 'mdctrl', action: 'load', data: {} });
this.engine.onViewEvent('mdctrl', 'sort', {});
return
}
if (this.sort.asc == field) {
this.sort.asc = "";
this.sort.desc = field;
this.viewState.next({ tag: 'mdctrl', action: 'load', data: { sort: field + ",desc" } });
this.engine.onViewEvent('mdctrl', 'sort', { sort: field + ",desc" });
} else {
this.sort.asc = field;
this.sort.desc = "";
this.viewState.next({ tag: 'mdctrl', action: 'load', data: { sort: field + ",asc" } });
this.engine.onViewEvent('mdctrl', 'sort', { sort: field + ",asc" });
}
}
......@@ -170,6 +170,7 @@
if (this.sort.asc != "") {
sortvalue = this.sort.asc + ",asc";
}
this.viewState.next({ tag: 'mdctrl', action: 'load', data: { sort: sortvalue,...this.queryparam} });
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册