提交 032c8f08 编写于 作者: WodahsOrez's avatar WodahsOrez

lxm--数据视图快速分组和快速搜索表单

上级 aca0aa0c
...@@ -363,8 +363,10 @@ ...@@ -363,8 +363,10 @@
const parentdata: any = {}; const parentdata: any = {};
this.$emit('beforeload', parentdata); this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata); Object.assign(arg, parentdata);
let viewparamResult:any = Object.assign(arg,this.viewparams); let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), {viewparams:viewparamResult}, this.showBusyIndicator); Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => { post.then((response: any) => {
if (!response || response.status !== 200) { if (!response || response.status !== 200) {
if (response.errorMessage) { if (response.errorMessage) {
......
...@@ -2,40 +2,51 @@ ...@@ -2,40 +2,51 @@
<div class='view-container ${view.getViewType()?lower_case} ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'> <div class='view-container ${view.getViewType()?lower_case} ${srffilepath2(view.getCodeName())}<#if view.getPSSysCss?? && view.getPSSysCss()??> ${view.getPSSysCss().getCssName()}</#if>'>
<app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction> <app-studioaction :viewTitle="$t(model.srfTitle)" viewName="${view.getCodeName()?lower_case}"></app-studioaction>
<card class='view-card <#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :dis-hover="true" :bordered="false"> <card class='view-card <#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :dis-hover="true" :bordered="false">
<@ibizindent blank=8> <@ibizindent blank=8>
<#ibizinclude> <#ibizinclude>
../@MACRO/VIEW_CAPTION.vue.ftl ../@MACRO/VIEW_CAPTION.vue.ftl
</#ibizinclude> </#ibizinclude>
</@ibizindent> </@ibizindent>
<div class='content-container'> <div class='content-container'>
<#assign MDContent> <#assign MDContent>
<#comment><!--开始:快速搜索或工具栏存在--></#comment> <#-- BEGIN:快速搜索框或工具栏或支持快速分组搜索或快速搜索表单部件存在 -->
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar'))> <#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar') || view.isEnableQuickGroup() || view.getQuickPSDESearchForm()??)>
<row style='margin-bottom: 6px;'> <div style="margin-bottom:6px;">
<#if view.isEnableQuickSearch()> <#if view.isEnableQuickGroup()>
<i-input <#if view.hasPSControl('searchform')><#if view.isExpandSearchForm??> v-show='!this.isExpandSearchForm '</#if></#if> v-model='query' search @on-search='onSearch' placeholder="<@getQuickSearchPlaceholder view />" class='pull-left' style='max-width: 400px;margin-top:6px;' /> <div class="quick-group-container">
</#if> <app-quick-group :items="quickGroupModel" <#if appCounter??>:counterService="${srfclassname('${appCounter.getCodeName()}')}counterservice"</#if> @valuechange="qucikGroupValueChange"></app-quick-group>
<div class='pull-right'> </div>
<@ibizindent blank=20> </#if>
<#if view.hasPSControl('toolbar')> <#if view.getQuickPSDESearchForm()??>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}<#t> <div class="quick-search-container">
</#if> <#assign quickSearchForm = view.getQuickPSDESearchForm() />
</@ibizindent> ${P.getCtrlCode(quickSearchForm, 'CONTROL.html').code}
</div> </div>
</row> </#if>
</#if> <#if view.isEnableQuickSearch()>
<#comment><!--结束:快速搜索或工具栏存在--></#comment> <i-input <#if view.hasPSControl('searchform')><#if view.isExpandSearchForm??> v-show='!this.isExpandSearchForm '</#if></#if> v-model='query' search @on-search='onSearch' placeholder="<@getQuickSearchPlaceholder view />" class='pull-left' style='max-width: 400px;margin-top:6px;' />
<#if view.hasPSControl('searchform')> </#if>
<@ibizindent blank=12> <div class='pull-right'>
${P.getCtrlCode('searchform', 'CONTROL.html').code}<#t> <#if view.hasPSControl('toolbar')>
</@ibizindent> <@ibizindent blank=20>
</#if> ${P.getCtrlCode('toolbar', 'CONTROL.html').code}<#t>
<#if view.hasPSControl('dataview')> </@ibizindent>
<@ibizindent blank=12> </#if>
${P.getCtrlCode('dataview', 'CONTROL.html').code}<#t> </div>
</@ibizindent> </div>
</#if> </#if>
</#assign> <#-- END:快速搜索框或工具栏或支持快速分组搜索或快速搜索表单部件存在 -->
<#if view.hasPSControl('searchform')>
<@ibizindent blank=12>
${P.getCtrlCode('searchform', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
<#if view.hasPSControl('dataview')>
<@ibizindent blank=12>
${P.getCtrlCode('dataview', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
</#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/VIEW_MD_CONTENT.vue.ftl ../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude> </#ibizinclude>
......
...@@ -4,28 +4,43 @@ ...@@ -4,28 +4,43 @@
<card class='view-card <#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :dis-hover="true" :bordered="false"> <card class='view-card <#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :dis-hover="true" :bordered="false">
<div class='content-container'> <div class='content-container'>
<#assign MDContent> <#assign MDContent>
<#comment><!--开始:快速搜索或工具栏存在--></#comment> <#-- BEGIN:快速搜索框或工具栏或支持快速分组搜索或快速搜索表单部件存在 -->
<#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar'))> <#if (view.isEnableQuickSearch() || view.hasPSControl('toolbar') || view.isEnableQuickGroup() || view.getQuickPSDESearchForm()??)>
<row style='margin-bottom: 6px;'> <div style="margin-bottom:6px;">
<#if view.isEnableQuickSearch()> <#if view.isEnableQuickGroup()>
<i-input <#if view.hasPSControl('searchform')><#if view.isExpandSearchForm??> v-show='!this.isExpandSearchForm'</#if></#if> v-model='query' search @on-search='onSearch' class='pull-left' placeholder="<@getQuickSearchPlaceholder view />" style='max-width: 400px;margin-top:6px;' /> <div class="quick-group-container">
</#if> <app-quick-group :items="quickGroupModel" <#if appCounter??>:counterService="${srfclassname('${appCounter.getCodeName()}')}counterservice"</#if> @valuechange="qucikGroupValueChange"></app-quick-group>
<div class='pull-right'> </div>
<@ibizindent blank=8> </#if>
<#if view.hasPSControl('toolbar')> <#if view.getQuickPSDESearchForm()??>
${P.getCtrlCode('toolbar', 'CONTROL.html').code} <div class="quick-search-container">
</#if> <#assign quickSearchForm = view.getQuickPSDESearchForm() />
</@ibizindent> ${P.getCtrlCode(quickSearchForm, 'CONTROL.html').code}
</div> </div>
</row> </#if>
</#if> <#if view.isEnableQuickSearch()>
<#comment><!--结束:快速搜索或工具栏存在--></#comment> <i-input <#if view.hasPSControl('searchform')><#if view.isExpandSearchForm??> v-show='!this.isExpandSearchForm '</#if></#if> v-model='query' search @on-search='onSearch' placeholder="<@getQuickSearchPlaceholder view />" class='pull-left' style='max-width: 400px;margin-top:6px;' />
<#if view.hasPSControl('searchform')> </#if>
${P.getCtrlCode('searchform', 'CONTROL.html').code} <div class='pull-right'>
</#if> <#if view.hasPSControl('toolbar')>
<#if view.hasPSControl('dataview')> <@ibizindent blank=20>
${P.getCtrlCode('dataview', 'CONTROL.html').code} ${P.getCtrlCode('toolbar', 'CONTROL.html').code}<#t>
</#if> </@ibizindent>
</#if>
</div>
</div>
</#if>
<#-- END:快速搜索框或工具栏或支持快速分组搜索或快速搜索表单部件存在 -->
<#if view.hasPSControl('searchform')>
<@ibizindent blank=12>
${P.getCtrlCode('searchform', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
<#if view.hasPSControl('dataview')>
<@ibizindent blank=12>
${P.getCtrlCode('dataview', 'CONTROL.html').code}<#t>
</@ibizindent>
</#if>
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
......
...@@ -3,10 +3,22 @@ ...@@ -3,10 +3,22 @@
./LAYOUTPANEL_VIEW.template.ftl ./LAYOUTPANEL_VIEW.template.ftl
</#ibizinclude> </#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> <#ibizinclude>
./VIEW_HEADER-BASE.vue.ftl ./VIEW_HEADER-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
<#assign mounted_block>
<#if view.isEnableQuickGroup()>_this.loadQuickGroupModel();</#if>
</#assign>
<#ibizinclude> <#ibizinclude>
./VIEW_CONTENT-BASE.vue.ftl ./VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
...@@ -59,6 +71,136 @@ ...@@ -59,6 +71,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> <#ibizinclude>
./VIEW_BOTTOM-BASE.vue.ftl ./VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册