提交 49976c84 编写于 作者: WodahsOrez's avatar WodahsOrez

lxm--列表快速分组和快速搜索表单

上级 0d6a853d
......@@ -279,7 +279,9 @@
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams});
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction, this.context?JSON.parse(JSON.stringify(this.context)):{}, arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response || response.status !== 200) {
......
......@@ -9,28 +9,42 @@
<div class='content-container'>
<#assign MDContent>
<#comment><!--开始:快速搜索或工具栏存在--></#comment>
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar'))>
<row style="margin-bottom:6px;">
<#if view.getPSSysCounterRef() ?? && view.getPSSysCounterRef().getPSAppCounter()??>
<#assign appCounter = view.getPSSysCounterRef().getPSAppCounter() />
</#if>
<#-- BEGIN:快速搜索框或工具栏或支持快速分组搜索或快速搜索表单部件存在 -->
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar') || view.isEnableQuickGroup() || view.getQuickPSDESearchForm()??)>
<div style="margin-bottom:6px;">
<#if view.isEnableQuickGroup()>
<div class="quick-group-container">
<app-quick-group :items="quickGroupModel" :counterService="${srfclassname('${appCounter.getCodeName()}')}counterservice" @valuechange="qucikGroupValueChange"></app-quick-group>
</div>
</#if>
<#if view.getQuickPSDESearchForm()??>
<div class="quick-search-container">
<#assign quickSearchForm = view.getQuickPSDESearchForm() />
${P.getCtrlCode(quickSearchForm, 'CONTROL.html').code}
</div>
</#if>
<#if view.isEnableQuickSearch()>
<i-input<#if view.hasPSControl('searchform')><#if view.isExpandSearchForm??> v-show="!isExpandSearchForm"</#if></#if> v-model="query" search enter-button @on-search="onSearch($event)" class='pull-left' placeholder="<@getQuickSearchPlaceholder view />" style='max-width: 400px;margin-top:6px;' />
</#if>
<div class='pull-right'>
<@ibizindent blank=8>
<#if view.hasPSControl('toolbar')>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</#if>
</@ibizindent>
<#if view.hasPSControl('toolbar')>
<@ibizindent blank=8>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</@ibizindent>
</#if>
</div>
</row>
</#if>
<#comment><!--结束:快速搜索或工具栏存在--></#comment>
<#if view.hasPSControl('searchform')>
</div>
</#if>
<#-- END:快速搜索框或工具栏或支持快速分组搜索或快速搜索表单部件存在 -->
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'CONTROL.html').code}
</#if>
<#if view.hasPSControl('list')>
</#if>
<#if view.hasPSControl('list')>
${P.getCtrlCode('list', 'CONTROL.html').code}
</#if>
</#if>
</#assign>
<#ibizinclude>
......
......@@ -3,10 +3,22 @@
./LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude>
<#assign import_block>
import CodeListService from "@service/app/codelist-service";
<#if view.getPSSysCounterRef?? && view.getPSSysCounterRef()?? && view.getPSSysCounterRef().getPSAppCounter()??>
<#assign appCounter = view.getPSSysCounterRef().getPSAppCounter() />
import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/counter/${srffilepath2(appCounter.getCodeName())}/${srffilepath2(appCounter.getCodeName())}-counter';
</#if>
</#assign>
<#ibizinclude>
./VIEW_HEADER-BASE.vue.ftl
</#ibizinclude>
<#assign mounted_block>
<#if view.isEnableQuickGroup()>_this.loadQuickGroupModel();</#if>
</#assign>
<#ibizinclude>
./VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude>
......@@ -39,6 +51,136 @@
}
}
<#if view.getPSSysCounterRef() ?? && view.getPSSysCounterRef().getPSAppCounter()??>
<#assign appCounter = view.getPSSysCounterRef().getPSAppCounter() />
/**
* ${srfclassname('${appCounter.getCodeName()}')}CounterService计数器服务对象
*
* @type {${srfclassname('${appCounter.getCodeName()}')}CounterService}
* @memberof ${srfclassname('${view.name}')}Base
*/
public ${srfclassname('${appCounter.getCodeName()}')}counterservice: ${srfclassname('${appCounter.getCodeName()}')}CounterService = new ${srfclassname('${appCounter.getCodeName()}')}CounterService({ $store: this.$store });
</#if>
<#if view.isEnableQuickGroup()>
/**
* 代码表服务对象
*
* @type {CodeListService}
* @memberof ${srfclassname('${view.name}')}Base
*/
public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/**
* 快速分组数据对象
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public qucikGroupData:any;
/**
* 快速分组是否有抛值
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public isEmitQuickGroupValue:boolean = false;
/**
* 快速分组模型
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public quickGroupModel:Array<any> = [];
/**
* 加载快速分组模型
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public loadQuickGroupModel(){
<#if view.getQuickGroupPSCodeList()??>
<#assign codelist=view.getQuickGroupPSCodeList() />
let quickGroupCodeList:any = {tag:'${codelist.codeName}',codelistType:'${codelist.getCodeListType()}'};
if(quickGroupCodeList.tag && Object.is(quickGroupCodeList.codelistType,"STATIC")){
const codelist = this.$store.getters.getCodeList(quickGroupCodeList.tag);
if (codelist) {
this.quickGroupModel = [...this.handleDynamicData(JSON.parse(JSON.stringify(codelist.items)))];
} else {
<#noparse>console.log(`----${quickGroupCodeList.tag}----代码表不存在`);</#noparse>
}
}else if(quickGroupCodeList.tag && Object.is(quickGroupCodeList.codelistType,"DYNAMIC")){
this.codeListService.getItems(quickGroupCodeList.tag,{},{}).then((res:any) => {
this.quickGroupModel = res;
}).catch((error:any) => {
<#noparse>console.log(`----${quickGroupCodeList.tag}----代码表不存在`);</#noparse>
});
}
</#if>
}
/**
* 处理快速分组模型动态数据部分(%xxx%)
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public handleDynamicData(inputArray:Array<any>){
if(inputArray.length >0){
inputArray.forEach((item:any) =>{
if(item.data && Object.keys(item.data).length >0){
Object.keys(item.data).forEach((name:any) =>{
let value: any = item.data[name];
if (value && typeof(value)=='string' && value.startsWith('%') && value.endsWith('%')) {
const key = (value.substring(1, value.length - 1)).toLowerCase();
if (this.context[key]) {
value = this.context[key];
} else if(this.viewparams[key]){
value = this.viewparams[key];
}
}
item.data[name] = value;
})
}
})
}
return inputArray;
}
/**
* 快速分组值变化
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public qucikGroupValueChange($event:any){
if($event && $event.data){
this.qucikGroupData = $event.data;
if(this.isEmitQuickGroupValue){
this.onSearch($event);
}
}
this.isEmitQuickGroupValue = true;
}
</#if>
<#if view.getQuickPSDESearchForm()??>
/**
* 快速搜索栏数据对象
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public qucikFormData:any;
/**
* 快速搜索栏值变化
*
* @memberof ${srfclassname('${view.name}')}Base
*/
public qucikFormValueChange($event:any){
this.qucikFormData = $event;
this.onSearch($event);
}
</#if>
<#ibizinclude>
./VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册