提交 bf11f757 编写于 作者: Shine-zwj's avatar Shine-zwj

列表和分组方法

上级 9c2b15e0
...@@ -175,6 +175,19 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -175,6 +175,19 @@ import CodeListService from "@service/app/codelist-service";
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public groupData: Array<any> = []; public groupData: Array<any> = [];
/**
* 分组方法
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public group(){
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'AUTO'>
this.drawGroup();
<#elseif ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'>
this.drawCodelistGroup();
</#if>
}
</#if> </#if>
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'> <#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'>
...@@ -540,10 +553,8 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -540,10 +553,8 @@ import CodeListService from "@service/app/codelist-service";
if(this.isSelectFirstDefault){ if(this.isSelectFirstDefault){
this.handleClick(this.items[0]); this.handleClick(this.items[0]);
} }
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'AUTO'> <#if ctrl.isEnableGroup?? && ctrl.isEnableGroup()>
this.drawGroup(); this.group();
<#elseif ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'>
this.drawCodelistGroup();
</#if> </#if>
}, (response: any) => { }, (response: any) => {
if (response && response.status === 401) { if (response && response.status === 401) {
...@@ -608,10 +619,8 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -608,10 +619,8 @@ import CodeListService from "@service/app/codelist-service";
this.items.some((item:any,index:number)=>{ this.items.some((item:any,index:number)=>{
if(Object.is(item.srfkey,data.srfkey)){ if(Object.is(item.srfkey,data.srfkey)){
this.items.splice(index,1); this.items.splice(index,1);
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'AUTO'> <#if ctrl.isEnableGroup?? && ctrl.isEnableGroup()>
this.drawGroup(); this.group();
<#elseif ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'>
this.drawCodelistGroup();
</#if> </#if>
return true; return true;
} }
......
...@@ -217,6 +217,19 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -217,6 +217,19 @@ import CodeListService from "@service/app/codelist-service";
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public groupData: Array<any> = []; public groupData: Array<any> = [];
/**
* 分组方法
*
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public group(){
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'AUTO'>
this.drawGroup();
<#elseif ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'>
this.drawCodelistGroup();
</#if>
}
</#if> </#if>
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'> <#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'>
...@@ -619,10 +632,8 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -619,10 +632,8 @@ import CodeListService from "@service/app/codelist-service";
if(this.isSelectFirstDefault){ if(this.isSelectFirstDefault){
this.handleClick(this.items[0]); this.handleClick(this.items[0]);
} }
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'AUTO'> <#if ctrl.isEnableGroup?? && ctrl.isEnableGroup()>
this.drawGroup(); this.group();
<#elseif ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'>
this.drawCodelistGroup();
</#if> </#if>
}, (response: any) => { }, (response: any) => {
if (response && response.status === 401) { if (response && response.status === 401) {
...@@ -650,10 +661,8 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -650,10 +661,8 @@ import CodeListService from "@service/app/codelist-service";
this.items.some((val: any, num: number) =>{ this.items.some((val: any, num: number) =>{
if(JSON.stringify(val) == JSON.stringify(record)){ if(JSON.stringify(val) == JSON.stringify(record)){
this.items.splice(num,1); this.items.splice(num,1);
<#if ctrl.getGroupMode?? && ctrl.getGroupMode() == 'AUTO'> <#if ctrl.isEnableGroup?? && ctrl.isEnableGroup()>
this.drawGroup(); this.group();
<#elseif ctrl.getGroupMode?? && ctrl.getGroupMode() == 'CODELIST'>
this.drawCodelistGroup();
</#if> </#if>
return true; return true;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册