提交 e344ddc9 编写于 作者: tony001's avatar tony001

Merge branch 'dev'

上级 2b42df5e
...@@ -15,7 +15,7 @@ import view_${subctrl.getName()} from '@widgets/app/${srffilepath2(subctrl.getCo ...@@ -15,7 +15,7 @@ import view_${subctrl.getName()} from '@widgets/app/${srffilepath2(subctrl.getCo
<#if ctrl.getPSLayoutPanels?? && ctrl.getPSLayoutPanels()??> <#if ctrl.getPSLayoutPanels?? && ctrl.getPSLayoutPanels()??>
<#list ctrl.getPSLayoutPanels() as panel> <#list ctrl.getPSLayoutPanels() as panel>
import layout_${panel.getName()} from '@widgets/${srffilepath2(panel.getPSDataEntity().getCodeName())}/${srffilepath2(panel.getCodeName())}-${panel.getControlType()?lower_case}/${srffilepath2(panel.getCodeName())}-${panel.getControlType()?lower_case}.vue'; import layout_${panel.getName()} from '@widgets/${srffilepath2(panel.getPSAppDataEntity().getCodeName())}/${srffilepath2(panel.getCodeName())}-${panel.getControlType()?lower_case}/${srffilepath2(panel.getCodeName())}-${panel.getControlType()?lower_case}.vue';
</#list> </#list>
</#if> </#if>
<#if import_block??>${import_block}</#if> <#if import_block??>${import_block}</#if>
......
...@@ -156,7 +156,7 @@ export default class ${srfclassname('${ctrl.codeName}')}Base extends Vue impleme ...@@ -156,7 +156,7 @@ export default class ${srfclassname('${ctrl.codeName}')}Base extends Vue impleme
<#else> <#else>
<#if ctrlLogic.getEventArg()?? && ctrlLogic.getEventArg()?length gt 0> <#if ctrlLogic.getEventArg()?? && ctrlLogic.getEventArg()?length gt 0>
if (Object.is($event.tag, '${ctrlLogic.getEventArg()}')) { if (Object.is($event.tag, '${ctrlLogic.getEventArg()}')) {
this.${ctrlLogic.name}($event, '<#if ctrlLogic.getLogicTag()?length gt 0>${ctrlLogic.getLogicTag()}</#if>', $event2); this.${ctrlLogic.name}(null, '<#if ctrlLogic.getLogicTag()?length gt 0>${ctrlLogic.getLogicTag()}</#if>', $event2);
} }
<#else> <#else>
this.${ctrlLogic.name}($event, '<#if ctrlLogic.getLogicTag()?length gt 0>${ctrlLogic.getLogicTag()}</#if>', $event2); this.${ctrlLogic.name}($event, '<#if ctrlLogic.getLogicTag()?length gt 0>${ctrlLogic.getLogicTag()}</#if>', $event2);
......
.tree-right-menu { .tree-right-menu {
.ivu-divider-horizontal { .ivu-divider-horizontal {
width: calc(100% - 32px); width: 100%;
min-width: calc(100% - 32px); min-width: 100%;
margin: 0 auto; margin: 0 auto;
} }
.ivu-dropdown-item { .ivu-dropdown-item {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
h('span', '${tabviewpanel.getCaption()}'), h('span', '${tabviewpanel.getCaption()}'),
h('Badge', { h('Badge', {
props: { props: {
count: <#if tabviewpanel.getPSSysCounterRef()?? && tabviewpanel.getPSSysCounterRef().getPSAppCounter()??><#assign appCounter = tabviewpanel.getPSSysCounterRef().getPSAppCounter()/>${srfclassname('${appCounter.getCodeName()}')}counterservice.counterData.<#if tabviewpanel.getCounterId()??>${tabviewpanel.getCounterId()}</#if><#else>undefined</#if>, count: <#if tabviewpanel.getPSSysCounterRef?? && tabviewpanel.getPSSysCounterRef()?? && tabviewpanel.getPSSysCounterRef().getPSAppCounter()??><#assign appCounter = tabviewpanel.getPSSysCounterRef().getPSAppCounter()/>${srfclassname('${appCounter.getCodeName()}')}counterservice.counterData.<#if tabviewpanel.getCounterId()??>${tabviewpanel.getCounterId()}</#if><#else>undefined</#if>,
type: 'primary' type: 'primary'
} }
}) })
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<${srffilepath2(embedddevedview.getCodeName())} <${srffilepath2(embedddevedview.getCodeName())}
class='viewcontainer2' class='viewcontainer2'
:viewdata="JSON.stringify(context)" :viewdata="JSON.stringify(context)"
:viewparam="JSON.stringify(viewparams)" :viewparam="JSON.stringify(getNavViewParams())"
@viewload="viewDatasChange($event)" @viewload="viewDatasChange($event)"
:viewDefaultUsage="false" > :viewDefaultUsage="false" >
</${srffilepath2(embedddevedview.getCodeName())}></#if> </${srffilepath2(embedddevedview.getCodeName())}></#if>
...@@ -42,6 +42,14 @@ ...@@ -42,6 +42,14 @@
*/ */
public isActivied: boolean = true; public isActivied: boolean = true;
/**
* 视图面板过滤项
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public navfilter: string = "<#if ctrl.getNavFilter?? && ctrl.getNavFilter()??>${ctrl.getNavFilter()}</#if>";
/** /**
* vue 生命周期 * vue 生命周期
* *
...@@ -76,6 +84,21 @@ ...@@ -76,6 +84,21 @@
} }
} }
/**
* 传入导航视图参数
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getNavViewParams(){
if(Object.is(this.navfilter,"")){
return this.viewparams;
}else{
let tempViewParams:any = JSON.parse(JSON.stringify(this.viewparams));
Object.assign(tempViewParams,{[this.navfilter]:this.context['${ctrl.getPSAppDataEntity().getCodeName()?lower_case}']});
return tempViewParams;
}
}
/** /**
* 视图数据变化 * 视图数据变化
* *
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div v-for = "item in items" :key="item.srfmajortext" :class="['app-list-item', {'isSelect': item.isselected === true ? true : false}]" @click="handleClick(item)" @dblclick="handleDblClick(item)"> <div v-for = "item in items" :key="item.srfmajortext" :class="['app-list-item', {'isSelect': item.isselected === true ? true : false}]" @click="handleClick(item)" @dblclick="handleDblClick(item)">
<#if ctrl.getItemPSLayoutPanel()??> <#if ctrl.getItemPSLayoutPanel()??>
<#assign panel = ctrl.getItemPSLayoutPanel()> <#assign panel = ctrl.getItemPSLayoutPanel()>
<layout_${panel.getName()} name='${panel.name}' :inputData="item"></layout_${panel.getName()}> <layout_${panel.getName()} name='${panel.name}' :inputData="item" :parentRef="thisRef"></layout_${panel.getName()}>
<#elseif ctrl.itemRender??> <#elseif ctrl.itemRender??>
${ctrl.itemRender.code} ${ctrl.itemRender.code}
<#else> <#else>
...@@ -93,6 +93,37 @@ ...@@ -93,6 +93,37 @@
*/ */
@Prop() public fetchAction!: string; @Prop() public fetchAction!: string;
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
/**
* 打开新建数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() public newdata: any;
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() public opendata: any;
</#if>
</#list>
</#if>
/**
* this引用
*
* @type {number}
* @memberof Main
*/
public thisRef: any = this;
/** /**
* 当前页 * 当前页
* *
...@@ -123,7 +154,7 @@ ...@@ -123,7 +154,7 @@
* @type {number} * @type {number}
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public limit: number = 20; public limit: number = ${ctrl.getPagingSize()?c};
/** /**
* 总条数 * 总条数
...@@ -133,6 +164,14 @@ ...@@ -133,6 +164,14 @@
*/ */
public totalRecord: number = 0; public totalRecord: number = 0;
/**
* 加载的数据是否附加在items之后
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public isAddBehind:boolean = false;
/** /**
* 排序方向 * 排序方向
* *
...@@ -178,6 +217,7 @@ ...@@ -178,6 +217,7 @@
}) })
} }
/** /**
* Vue声明周期,组件创建完毕 * Vue声明周期,组件创建完毕
* *
...@@ -237,6 +277,7 @@ ...@@ -237,6 +277,7 @@
if(this.totalRecord>this.items.length) if(this.totalRecord>this.items.length)
{ {
this.curPage = ++this.curPage; this.curPage = ++this.curPage;
this.isAddBehind = true;
this.load({}); this.load({});
} }
} }
...@@ -280,7 +321,9 @@ ...@@ -280,7 +321,9 @@
this.$emit('beforeload', parentdata); this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata); Object.assign(arg, parentdata);
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{}; let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
if(this.viewparams){
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams))); Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
}
Object.assign(arg,{viewparams:tempViewParams}); 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); const post: Promise<any> = this.service.search(this.fetchAction, this.context?JSON.parse(JSON.stringify(this.context)):{}, arg, this.showBusyIndicator);
post.then((response: any) => { post.then((response: any) => {
...@@ -291,7 +334,9 @@ ...@@ -291,7 +334,9 @@
return; return;
} }
const data: any = response.data; const data: any = response.data;
if(!this.isAddBehind){
this.items = []; this.items = [];
}
if (Object.keys(data).length > 0) { if (Object.keys(data).length > 0) {
let datas = JSON.parse(JSON.stringify(data)); let datas = JSON.parse(JSON.stringify(data));
datas.map((item: any) => { datas.map((item: any) => {
...@@ -300,6 +345,7 @@ ...@@ -300,6 +345,7 @@
this.totalRecord = response.total; this.totalRecord = response.total;
this.items.push(...datas); this.items.push(...datas);
} }
this.isAddBehind = false;
this.$emit('load', this.items); this.$emit('load', this.items);
if(this.isSelectFirstDefault){ if(this.isSelectFirstDefault){
this.handleClick(this.items[0]); this.handleClick(this.items[0]);
......
...@@ -8,6 +8,16 @@ ...@@ -8,6 +8,16 @@
<#if view.getViewType() == 'DELISTEXPVIEW'> <#if view.getViewType() == 'DELISTEXPVIEW'>
:isSelectFirstDefault="true" :isSelectFirstDefault="true"
</#if> </#if>
<#if view.getPSAppViewLogics?? && view.getPSAppViewLogics()??>
<#list view.getPSAppViewLogics() as logic>
<#if logic.getPFLogicCodeType() == 'APP_NEWDATA'>
:newdata="newdata"
</#if>
<#if logic.getPFLogicCodeType() == 'APP_OPENDATA'>
:opendata="opendata"
</#if>
</#list>
</#if>
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl ../@MACRO/HTML/DEFAULT.html.ftl
......
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
</#if> </#if>
</#if> </#if>
</#list> </#list>
</#if>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'MODEL_CONTENT.ts').code}
</#if> </#if>
{ {
name:'size', name:'size',
......
...@@ -295,6 +295,9 @@ ...@@ -295,6 +295,9 @@
return ; return ;
} }
const arg:any = args[0]; const arg:any = args[0];
if(this.context){
Object.assign(data,JSON.parse(JSON.stringify(this.context)));
}
<#if ctrl.getXDataPSControl()??> <#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl()/> <#assign xDataControl = ctrl.getXDataPSControl()/>
<#if xDataControl.getPSAppDataEntity()??> <#if xDataControl.getPSAppDataEntity()??>
...@@ -303,9 +306,6 @@ ...@@ -303,9 +306,6 @@
Object.assign(data,{srfparentdename:'${curDataEntity.getCodeName()}',srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']}); Object.assign(data,{srfparentdename:'${curDataEntity.getCodeName()}',srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']});
</#if> </#if>
</#if> </#if>
if(this.context){
Object.assign(data,JSON.parse(JSON.stringify(this.context)));
}
this.selection = {}; this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName }, data:data }); Object.assign(this.selection, { view: { viewname: this.navViewName }, data:data });
this.$emit('selectionchange',args); this.$emit('selectionchange',args);
......
...@@ -3,4 +3,6 @@ ...@@ -3,4 +3,6 @@
</#ibizinclude> </#ibizinclude>
.multieditviewpanel{ .multieditviewpanel{
width: 100%; width: 100%;
height: 100%;
overflow: auto;
} }
\ No newline at end of file
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
appfunctag: '', appfunctag: '',
</#if> </#if>
resourcetag: '<#if item.getAccessKey()??>${item.getAccessKey()}</#if>', resourcetag: '<#if item.getAccessKey()??>${item.getAccessKey()}</#if>',
authtag:'${app.getCodeName()}-${ctrl.getCodeName()}-${item.getName()}',
<#if item.getPSAppMenuItems()??> <#if item.getPSAppMenuItems()??>
items: [ items: [
<#list item.getPSAppMenuItems() as child> <#list item.getPSAppMenuItems() as child>
......
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
loaddraftAction="<#if ctrl.getGetDraftPSControlAction()?? && ctrl.getGetDraftPSControlAction().getPSAppDEMethod()??>${ctrl.getGetDraftPSControlAction().getPSAppDEMethod().getCodeName()}</#if>" loaddraftAction="<#if ctrl.getGetDraftPSControlAction()?? && ctrl.getGetDraftPSControlAction().getPSAppDEMethod()??>${ctrl.getGetDraftPSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
loadAction="<#if ctrl.getGetPSControlAction()?? && ctrl.getGetPSControlAction().getPSAppDEMethod()??>${ctrl.getGetPSControlAction().getPSAppDEMethod().getCodeName()}</#if>" loadAction="<#if ctrl.getGetPSControlAction()?? && ctrl.getGetPSControlAction().getPSAppDEMethod()??>${ctrl.getGetPSControlAction().getPSAppDEMethod().getCodeName()}</#if>"
<#if ctrl.getFormStyle() == "SEARCHBAR">@valuechange="qucikFormValueChange"</#if> <#if ctrl.getFormStyle() == "SEARCHBAR">@valuechange="qucikFormValueChange"</#if>
<#if view.getViewType() == "DECALENDARVIEW" || view.getViewType() == "DECALENDARVIEW9">
@search="searchform_search($event)"
@load="searchform_load($event)"
</#if>
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl ../@MACRO/HTML/DEFAULT.html.ftl
......
.app-dr-tab { .drtab{
height:100%;
.app-dr-tab {
height: 100%; height: 100%;
>.ivu-tabs-bar { >.ivu-tabs-bar {
margin-bottom: 0px; margin-bottom: 0px;
...@@ -14,6 +16,7 @@ ...@@ -14,6 +16,7 @@
} }
} }
} }
}
} }
<#ibizinclude> <#ibizinclude>
......
...@@ -12,5 +12,12 @@ ${item.render.code} ...@@ -12,5 +12,12 @@ ${item.render.code}
<#if item.getBaseOptionJOString()??> <#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()} ${item.getBaseOptionJOString()}
</#if> </#if>
<#if item.getUserParamNames()??>
<#list item.getUserParamNames() as userparam>
<#if userparam?index_of("EC.")==0>
${userparam?remove_beginning("EC.")}:${item.getUserParam(userparam)}<#if userparam_has_next>,</#if>
</#if>
</#list>
</#if>
} }
</#if> </#if>
\ No newline at end of file
...@@ -12,5 +12,12 @@ ${item.render.code} ...@@ -12,5 +12,12 @@ ${item.render.code}
<#if item.getBaseOptionJOString()??> <#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()} ${item.getBaseOptionJOString()}
</#if> </#if>
<#if item.getUserParamNames()??>
<#list item.getUserParamNames() as userparam>
<#if userparam?index_of("EC.")==0>
${userparam?remove_beginning("EC.")}:${item.getUserParam(userparam)}<#if userparam_has_next>,</#if>
</#if>
</#list>
</#if>
} }
</#if> </#if>
\ No newline at end of file
...@@ -9,6 +9,13 @@ ${item.render.code} ...@@ -9,6 +9,13 @@ ${item.render.code}
name:<#if item.getCaption()??>'${item.getCaption()}'</#if>, name:<#if item.getCaption()??>'${item.getCaption()}'</#if>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if> <#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if> <#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
<#if item.getUserParamNames()??>
<#list item.getUserParamNames() as userparam>
<#if userparam?index_of("EC.")==0>
${userparam?remove_beginning("EC.")}:${item.getUserParam(userparam)}<#if userparam_has_next>,</#if>
</#if>
</#list>
</#if>
<#if item.getBaseOptionJOString()??> <#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()} ${item.getBaseOptionJOString()}
</#if> </#if>
......
...@@ -9,6 +9,13 @@ ${item.render.code} ...@@ -9,6 +9,13 @@ ${item.render.code}
name:<#if item.getCaption()??>'${item.getCaption()}'</#if>, name:<#if item.getCaption()??>'${item.getCaption()}'</#if>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if> <#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if> <#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
<#if item.getUserParamNames()??>
<#list item.getUserParamNames() as userparam>
<#if userparam?index_of("EC.")==0>
${userparam?remove_beginning("EC.")}:${item.getUserParam(userparam)}<#if userparam_has_next>,</#if>
</#if>
</#list>
</#if>
<#if item.getBaseOptionJOString()??> <#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()} ${item.getBaseOptionJOString()}
</#if> </#if>
......
<#-- 雷达图坐标系start -->
<#if item.render??>
${item.render.code}
<#else>
<#if item.getIndicatorPSCodeList?? && item.getIndicatorPSCodeList()??>
<#assign indicatorCodeList = item.getIndicatorPSCodeList() />
indicator:[
<#list indicatorCodeList.getAllPSCodeItems() as codeItem>
{name:'${codeItem.getText()}',max:${codeItem.getUserParam('MAXVALUE',100)}}<#if codeItem_has_next>,</#if>
</#list>
]
</#if>
</#if>
<#-- 雷达图坐标系end -->
\ No newline at end of file
...@@ -7,6 +7,7 @@ new ChartLineSeries({ ...@@ -7,6 +7,7 @@ new ChartLineSeries({
<#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if> <#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if>
categorField:'${item.getCatalogField()?lower_case}', categorField:'${item.getCatalogField()?lower_case}',
<#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if> <#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if>
<#if item.getSeriesPSCodeList()??><#assign seriesCodeList = item.getSeriesPSCodeList() />seriesCodeList:{type:'${seriesCodeList.getCodeListType()}',tag:'${seriesCodeList.getCodeName()}',emptycode:'empty',emptytext:'${seriesCodeList.getEmptyText()}'},</#if>
valueField:'${item.getValueField()?lower_case}', valueField:'${item.getValueField()?lower_case}',
seriesValues:[], seriesValues:[],
seriesIndex:${item.getIndex()}, seriesIndex:${item.getIndex()},
...@@ -17,7 +18,7 @@ new ChartLineSeries({ ...@@ -17,7 +18,7 @@ new ChartLineSeries({
<#if chartDataSet.getPSChartDataSetFields()??> <#if chartDataSet.getPSChartDataSetFields()??>
dataSetFields:[ dataSetFields:[
<#list chartDataSet.getPSChartDataSetFields() as singleField> <#list chartDataSet.getPSChartDataSetFields() as singleField>
{name:"${singleField.getName()?lower_case}",codelist:<#if singleField.getPSCodeList()??><#assign codelist = singleField.getPSCodeList()/>{type:"${codelist.getCodeListType()}",tag:"${codelist.getCodeName()}",emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'}<#else>null</#if>,isGroupField:${singleField.isGroupField()?c},groupMode:"${singleField.getGroupMode()}"}<#if singleField_has_next>,</#if> {name:"${singleField.getName()?lower_case}",codelist:<#if singleField.getPSCodeList()??><#assign codelist = singleField.getPSCodeList()/>{type:"${codelist.getCodeListType()}",tag:"${codelist.getCodeName()}",emptycode:'empty',emptytext:'${codelist.getEmptyText()}'}<#else>null</#if>,isGroupField:${singleField.isGroupField()?c},groupMode:"${singleField.getGroupMode()}"}<#if singleField_has_next>,</#if>
</#list> </#list>
], ],
</#if> </#if>
...@@ -97,6 +98,7 @@ new ChartFunnelSeries({ ...@@ -97,6 +98,7 @@ new ChartFunnelSeries({
<#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if> <#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if>
categorField:'${item.getCatalogField()?lower_case}', categorField:'${item.getCatalogField()?lower_case}',
<#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if> <#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if>
<#if item.getSeriesPSCodeList()??><#assign seriesCodeList = item.getSeriesPSCodeList() />seriesCodeList:{type:'${seriesCodeList.getCodeListType()}',tag:'${seriesCodeList.getCodeName()}',emptycode:'empty',emptytext:'${seriesCodeList.getEmptyText()}'},</#if>
valueField:'${item.getValueField()?lower_case}', valueField:'${item.getValueField()?lower_case}',
seriesValues:[], seriesValues:[],
seriesIndex:${item.getIndex()}, seriesIndex:${item.getIndex()},
...@@ -187,6 +189,7 @@ new ChartPieSeries({ ...@@ -187,6 +189,7 @@ new ChartPieSeries({
<#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if> <#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if>
categorField:'${item.getCatalogField()?lower_case}', categorField:'${item.getCatalogField()?lower_case}',
<#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if> <#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if>
<#if item.getSeriesPSCodeList()??><#assign seriesCodeList = item.getSeriesPSCodeList() />seriesCodeList:{type:'${seriesCodeList.getCodeListType()}',tag:'${seriesCodeList.getCodeName()}',emptycode:'empty',emptytext:'${seriesCodeList.getEmptyText()}'},</#if>
valueField:'${item.getValueField()?lower_case}', valueField:'${item.getValueField()?lower_case}',
seriesValues:[], seriesValues:[],
seriesIndex:${item.getIndex()}, seriesIndex:${item.getIndex()},
...@@ -278,6 +281,7 @@ new ChartBarSeries({ ...@@ -278,6 +281,7 @@ new ChartBarSeries({
<#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if> <#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if>
categorField:'${item.getCatalogField()?lower_case}', categorField:'${item.getCatalogField()?lower_case}',
<#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if> <#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if>
<#if item.getSeriesPSCodeList()??><#assign seriesCodeList = item.getSeriesPSCodeList() />seriesCodeList:{type:'${seriesCodeList.getCodeListType()}',tag:'${seriesCodeList.getCodeName()}',emptycode:'empty',emptytext:'${seriesCodeList.getEmptyText()}'},</#if>
valueField:'${item.getValueField()?lower_case}', valueField:'${item.getValueField()?lower_case}',
seriesValues:[], seriesValues:[],
seriesIndex:${item.getIndex()}, seriesIndex:${item.getIndex()},
...@@ -288,7 +292,7 @@ new ChartBarSeries({ ...@@ -288,7 +292,7 @@ new ChartBarSeries({
<#if chartDataSet.getPSChartDataSetFields()??> <#if chartDataSet.getPSChartDataSetFields()??>
dataSetFields:[ dataSetFields:[
<#list chartDataSet.getPSChartDataSetFields() as singleField> <#list chartDataSet.getPSChartDataSetFields() as singleField>
{name:"${singleField.getName()?lower_case}",codelist:<#if singleField.getPSCodeList()??><#assign codelist = singleField.getPSCodeList()/>{type:"${codelist.getCodeListType()}",tag:"${codelist.getCodeName()}",emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'}<#else>null</#if>,isGroupField:${singleField.isGroupField()?c},groupMode:"${singleField.getGroupMode()}"}<#if singleField_has_next>,</#if> {name:"${singleField.getName()?lower_case}",codelist:<#if singleField.getPSCodeList()??><#assign codelist = singleField.getPSCodeList()/>{type:"${codelist.getCodeListType()}",tag:"${codelist.getCodeName()}",emptycode:'empty',emptytext:'${codelist.getEmptyText()}'}<#else>null</#if>,isGroupField:${singleField.isGroupField()?c},groupMode:"${singleField.getGroupMode()}"}<#if singleField_has_next>,</#if>
</#list> </#list>
], ],
</#if> </#if>
...@@ -369,6 +373,7 @@ new ChartRadarSeries({ ...@@ -369,6 +373,7 @@ new ChartRadarSeries({
<#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if> <#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if>
categorField:'${item.getCatalogField()?lower_case}', categorField:'${item.getCatalogField()?lower_case}',
<#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if> <#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if>
<#if item.getSeriesPSCodeList()??><#assign seriesCodeList = item.getSeriesPSCodeList() />seriesCodeList:{type:'${seriesCodeList.getCodeListType()}',tag:'${seriesCodeList.getCodeName()}',emptycode:'empty',emptytext:'${seriesCodeList.getEmptyText()}'},</#if>
valueField:'${item.getValueField()?lower_case}', valueField:'${item.getValueField()?lower_case}',
seriesValues:[], seriesValues:[],
data:[], data:[],
......
...@@ -7,7 +7,7 @@ ${item.render.code} ...@@ -7,7 +7,7 @@ ${item.render.code}
name:'<#if item.getCaption()??>${item.getCaption()}</#if>', name:'<#if item.getCaption()??>${item.getCaption()}</#if>',
type:'radar', type:'radar',
encode:{ encode:{
<#if item.getCatalogField()??>itemName:"${item.getCatalogField()}"</#if> itemName:"type"
}<#if item.getBaseOptionJOString()??>, }<#if item.getBaseOptionJOString()??>,
${item.getBaseOptionJOString()} ${item.getBaseOptionJOString()}
</#if> </#if>
......
...@@ -201,6 +201,19 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -201,6 +201,19 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
], ],
</#if> </#if>
<#-- 绘图网格end --> <#-- 绘图网格end -->
<#-- 雷达图坐标系start -->
<#if ctrl.getPSChartRadars?? && ctrl.getPSChartRadars()??>
<#list ctrl.getPSChartRadars() as chartRadar>
<#if chartRadar_index == 0>
radar:{
<@ibizindent blank=8>
${P.getPartCode(chartRadar).code}
</@ibizindent>
},
</#if>
</#list>
</#if>
<#-- 雷达图坐标系end -->
<#-- X轴start --> <#-- X轴start -->
<#if ctrl.getPSChartXAxises()??> <#if ctrl.getPSChartXAxises()??>
xAxis: [ xAxis: [
...@@ -276,7 +289,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -276,7 +289,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
</#if> </#if>
this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)),arg,this.showBusyIndicator).then((res) => { this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)),arg,this.showBusyIndicator).then((res) => {
if (res) { if (res) {
this.transformToBasicChartSetData(res.data,() =>{_this.drawCharts()}); this.transformToBasicChartSetData(res.data,(codelist:any) =>{_this.drawCharts(codelist)});
} }
}).catch((error) => { }).catch((error) => {
console.error(error); console.error(error);
...@@ -289,12 +302,12 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -289,12 +302,12 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
* @returns {*} * @returns {*}
* @memberof ${srfclassname('${ctrl.name}')}Base * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public drawCharts(){ public drawCharts(codelist:any){
if(!this.myChart){ if(!this.myChart){
let element:any = document.getElementById(this.chartId); let element:any = document.getElementById(this.chartId);
this.myChart = echarts.init(element); this.myChart = echarts.init(element);
} }
this.handleChartOPtion(); this.handleChartOPtion(codelist);
console.log(this.chartOption); console.log(this.chartOption);
this.myChart.setOption(this.chartOption); this.myChart.setOption(this.chartOption);
this.myChart.resize(); this.myChart.resize();
...@@ -305,7 +318,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -305,7 +318,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
* *
* @memberof ${srfclassname('${ctrl.name}')}Base * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public handleChartOPtion(){ public handleChartOPtion(allcodelist:any){
if(Object.keys(this.seriesModel).length > 0){ if(Object.keys(this.seriesModel).length > 0){
let tempDataSourceMap:Map<string,any> = new Map(); let tempDataSourceMap:Map<string,any> = new Map();
for(let i=0;i<Object.keys(this.seriesModel).length;i++){ for(let i=0;i<Object.keys(this.seriesModel).length;i++){
...@@ -336,17 +349,8 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -336,17 +349,8 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
} }
//设置多序列 //设置多序列
let tempSeries:any = this.seriesModel[seriesName]; let tempSeries:any = this.seriesModel[seriesName];
// 雷达图
if(tempSeries.type && Object.is(tempSeries.type,'radar') && tempSeries.seriesIdField && tempSeries.seriesValues.length > 0){
let tempIndicator:any = [];
tempSeries.seriesValues.forEach((item:any) =>{
let singleIndicatorObj:any = {name:item,max:100};
tempIndicator.push(singleIndicatorObj);
})
this.chartOption.radar = {'indicator':tempIndicator};
}else{
// 非雷达图 // 非雷达图
if(tempSeries && tempSeries.seriesIdField && tempSeries.seriesValues.length > 0){ if(tempSeries && tempSeries.seriesIdField && tempSeries.seriesValues.length > 0 && !Object.is(tempSeries.type,'radar')){
const returnIndex:number = this.chartOption.series.findIndex((item:any) =>{ const returnIndex:number = this.chartOption.series.findIndex((item:any) =>{
return Object.is(item.id,seriesName); return Object.is(item.id,seriesName);
}) })
...@@ -358,7 +362,6 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -358,7 +362,6 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
this.chartOption.series.push(tempSeriesTemp); this.chartOption.series.push(tempSeriesTemp);
}) })
} }
}
}) })
} }
if(Object.keys(this.chartBaseOPtion).length > 0){ if(Object.keys(this.chartBaseOPtion).length > 0){
...@@ -417,10 +420,19 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -417,10 +420,19 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
} }
}else{ }else{
// 序列属性存在时 // 序列属性存在时
// 序列代码表存在时,翻译tempSeriesValues的键值对
if(singleSeries.seriesCodeList){
const seriesCodeList:Map<string,any> = allCodeList.get(singleSeries.seriesCodeList.tag);
let tempSeriesValueItem = tempSeriesValues.get(seriesCodeList.get(item[singleSeries.seriesIdField]));
if(!tempSeriesValueItem){
tempSeriesValues.set(seriesCodeList.get(item[singleSeries.seriesIdField]),seriesCodeList.get(item[singleSeries.seriesIdField]));
}
}else{
let tempSeriesValueItem = tempSeriesValues.get(item[singleSeries.seriesIdField]); let tempSeriesValueItem = tempSeriesValues.get(item[singleSeries.seriesIdField]);
if(!tempSeriesValueItem){ if(!tempSeriesValueItem){
tempSeriesValues.set(item[singleSeries.seriesIdField],item[singleSeries.seriesNameField]); tempSeriesValues.set(item[singleSeries.seriesIdField],item[singleSeries.seriesNameField]);
} }
}
Object.assign(tempChartSetDataItem,{name:item[singleSeries.seriesIdField]}); Object.assign(tempChartSetDataItem,{name:item[singleSeries.seriesIdField]});
if(singleSeries.dataSetFields && singleSeries.dataSetFields.length >0){ if(singleSeries.dataSetFields && singleSeries.dataSetFields.length >0){
singleSeries.dataSetFields.forEach((singleDataSetField:any) =>{ singleSeries.dataSetFields.forEach((singleDataSetField:any) =>{
...@@ -432,6 +444,14 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -432,6 +444,14 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
}) })
// 补全数据集合 // 补全数据集合
this.completeDataSet(tempChartSetData,singleSeries,allCodeList); this.completeDataSet(tempChartSetData,singleSeries,allCodeList);
// 序列代码表存在时,补全序列
if(singleSeries.seriesCodeList){
const seriesCodeList:Map<string,any> = allCodeList.get(singleSeries.seriesCodeList.tag);
tempSeriesValues = new Map();
seriesCodeList.forEach((item:any) =>{
tempSeriesValues.set(item,item);
})
}
singleSeries.seriesValues = [...tempSeriesValues.keys()]; singleSeries.seriesValues = [...tempSeriesValues.keys()];
let tempSeriesMapObj:any = {}; let tempSeriesMapObj:any = {};
tempSeriesValues.forEach((value:any,key:any) =>{ tempSeriesValues.forEach((value:any,key:any) =>{
...@@ -496,7 +516,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -496,7 +516,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
item.data = this.groupAndAdd(tempGroupField,[],tempValueField,data,item,groupField,allCodeList); item.data = this.groupAndAdd(tempGroupField,[],tempValueField,data,item,groupField,allCodeList);
} }
if(callback && callback instanceof Function){ if(callback && callback instanceof Function){
callback(); callback(allCodeList);
} }
} }
...@@ -610,11 +630,19 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -610,11 +630,19 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
} }
returnArray = this.sortReturnArray(returnArray,groupFieldModel,allCodeList); returnArray = this.sortReturnArray(returnArray,groupFieldModel,allCodeList);
// 雷达图数据格式处理 // 雷达图数据格式处理
if(Object.is(item.type,'radar')){ if(Object.is(item.type,'radar') && returnArray.length >0){
let tempReturnArray:Array<any> = [];
let seriesValues:Array<any> = item.seriesValues;
if(seriesValues && seriesValues.length >0){
seriesValues.forEach((singleSeriesName:any) =>{
let singleSeriesObj:any = {type:singleSeriesName};
returnArray.forEach((item:any) =>{ returnArray.forEach((item:any) =>{
item.type = item[groupField[0]]; Object.assign(singleSeriesObj,{[item[groupField[0]]]:item[singleSeriesName]});
delete item[groupField[0]];
}) })
tempReturnArray.push(singleSeriesObj);
})
}
returnArray = tempReturnArray;
} }
console.log(JSON.stringify(returnArray)); console.log(JSON.stringify(returnArray));
return returnArray; return returnArray;
......
<#-- 绘图极坐标系的角度轴 -->
<#if item.render??>
${item.render.code}
<#else>
{
min: 0,
max: 360,
interval: 30,
startAngle: 45
}
</#if>
\ No newline at end of file
<#-- 绘图X轴 -->
<#if item.render??>
${item.render.code}
<#else>
{
<#if item.getIndex()??>gridIndex:${item.getIndex()},</#if>
position:<#if item.getPosition()?? && item.getPosition() =='bottom'>"bottom"<#else>"top"</#if>,
type:<#if item.getType()??>'${item.getType()}'<#else>'category'</#if>,
name:<#if item.getCaption()??>'${item.getCaption()}'</#if>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
<#if item.getUserParamNames()??>
<#list item.getUserParamNames() as userparam>
<#if userparam?index_of("EC.")==0>
${userparam?remove_beginning("EC.")}:${item.getUserParam(userparam)}<#if userparam_has_next>,</#if>
</#if>
</#list>
</#if>
}
</#if>
\ No newline at end of file
<#-- 绘图极坐标系的径向轴 -->
<#if item.render??>
${item.render.code}
<#else>
{
min: 0,
max: 10,
interval: 2
}
</#if>
\ No newline at end of file
<#-- 绘图平行坐标系 -->
<#if item.render??>
${item.render.code}
<#else>
{
}
</#if>
\ No newline at end of file
<#-- 绘图单轴 -->
<#if item.render??>
${item.render.code}
<#else>
{
}
</#if>
\ No newline at end of file
<#-- 绘图Y轴 -->
<#if item.render??>
${item.render.code}
<#else>
{
<#if item.getIndex()??>gridIndex:${item.getIndex()},</#if>
position:<#if item.getPosition()?? && item.getPosition() =='bottom'>"bottom"<#else>"top"</#if>,
type:<#if item.getType()?? && item.getType() == 'numeric'>'value'<#else>'${item.getType()}'</#if>,
name:<#if item.getCaption()??>'${item.getCaption()}'</#if>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
<#if item.getUserParamNames()??>
<#list item.getUserParamNames() as userparam>
<#if userparam?index_of("EC.")==0>
${userparam?remove_beginning("EC.")}:${item.getUserParam(userparam)}<#if userparam_has_next>,</#if>
</#if>
</#list>
</#if>
}
</#if>
\ No newline at end of file
<#-- 绘图X轴 -->
<#if item.render??>
${item.render.code}
<#else>
{
<#if item.getIndex()??>gridIndex:${item.getIndex()},</#if>
position:<#if item.getPosition()?? && item.getPosition() =='bottom'>"bottom"<#else>"top"</#if>,
type:<#if item.getType()??>'${item.getType()}'<#else>'category'</#if>,
name:<#if item.getCaption()??>'${item.getCaption()}'</#if>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
<#if item.getUserParamNames()??>
<#list item.getUserParamNames() as userparam>
<#if userparam?index_of("EC.")==0>
${userparam?remove_beginning("EC.")}:${item.getUserParam(userparam)}<#if userparam_has_next>,</#if>
</#if>
</#list>
</#if>
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
}
</#if>
\ No newline at end of file
<#-- 绘图Y轴 -->
<#if item.render??>
${item.render.code}
<#else>
{
<#if item.getIndex()??>gridIndex:${item.getIndex()},</#if>
position:<#if item.getPosition()?? && item.getPosition() =='bottom'>"bottom"<#else>"top"</#if>,
type:<#if item.getType()?? && item.getType() == 'numeric'>'value'<#else>'${item.getType()}'</#if>,
name:<#if item.getCaption()??>'${item.getCaption()}'</#if>,
<#if item.getMinValue()??>min:${item.getMinValue()},</#if>
<#if item.getMaxValue()??>max:${item.getMaxValue()},</#if>
<#if item.getUserParamNames()??>
<#list item.getUserParamNames() as userparam>
<#if userparam?index_of("EC.")==0>
${userparam?remove_beginning("EC.")}:${item.getUserParam(userparam)}<#if userparam_has_next>,</#if>
</#if>
</#list>
</#if>
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
}
</#if>
\ No newline at end of file
<#-- 绘图网格start -->
<#if item.render??>
${item.render.code}
<#else>
{
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
}
</#if>
<#-- 绘图网格end -->
\ No newline at end of file
<#-- 雷达图坐标系start -->
<#if item.render??>
${item.render.code}
<#else>
<#if item.getIndicatorPSCodeList?? && item.getIndicatorPSCodeList()??>
<#assign indicatorCodeList = item.getIndicatorPSCodeList() />
indicator:[
<#list indicatorCodeList.getAllPSCodeItems() as codeItem>
{name:'${codeItem.getText()}',max:${codeItem.getUserParam('MAXVALUE',100)}}<#if codeItem_has_next>,</#if>
</#list>
]
</#if>
</#if>
<#-- 雷达图坐标系end -->
\ No newline at end of file
<#-- 柱状图序列start -->
<#if item.render??>
${item.render.code}
<#else>
{
id:'<#if item.getName()??>${item.getName()?lower_case}</#if>',
name:'<#if item.getCaption()??>${item.getCaption()}</#if>',
type:'bar',
xAxisIndex:${item.getIndex()},
yAxisIndex:${item.getIndex()},
datasetIndex:${item.getIndex()},
encode: {
<#if item.getPSChartSeriesEncode()??><#assign chartSeriesEncode = item.getPSChartSeriesEncode() /></#if>
x: [<#if chartSeriesEncode.getX()??><#list chartSeriesEncode.getX() as xValue>'${xValue?lower_case}'<#if xValue_has_next>,</#if></#list></#if>],
y: [<#if chartSeriesEncode.getY()??><#list chartSeriesEncode.getY() as yValue>'${yValue?lower_case}'<#if yValue_has_next>,</#if></#list></#if>]
}<#if item.getBaseOptionJOString()??>,
${item.getBaseOptionJOString()}
</#if>
}
</#if>
<#-- 柱状图序列end -->
\ No newline at end of file
<#-- 折线图序列start -->
<#if item.render??>
${item.render.code}
<#else>
{
id:'<#if item.getName()??>${item.getName()?lower_case}</#if>',
name:'<#if item.getCaption()??>${item.getCaption()}</#if>',
type:'funnel',
datasetIndex:${item.getIndex()},
<#compress><#if item.getLeft()?? && item.getLeft() != "">left:"${item.getLeft()}",</#if>
<#if item.getTop()?? && item.getTop() != 0>top:"${item.getTop()}",</#if>
<#if item.getBottom()?? && item.getBottom() != 0>bottom:"${item.getBottom()}",</#if>
<#if item.getRight()?? && item.getRight() != "">right:"${item.getRight()}",</#if>
<#if item.getWidth()?? && item.getWidth() != "">width:"${item.getWidth()}",</#if>
<#if item.getHeight()?? && item.getHeight() != "">height:"${item.getHeight()}",</#if>
<#if item.getMinValue()?? && item.getMinValue() != 0 >min:"${item.getMinValue()}",</#if>
<#if item.getMaxValue()?? && item.getMaxValue() != 0 >max:"${item.getMaxSize()}",</#if>
<#if item.getMinSize()?? && item.getMinSize() != "">minSize:"${item.getMinSize()}",</#if>
<#if item.getMaxSize()?? && item.getMaxSize() != "">maxSize: "${item.getMaxSize()}",</#if>
<#if item.getFunnelAlign()?? && item.getFunnelAlign() != "">funnelAlign:"${item.getFunnelAlign()}",</#if></#compress>
seriesLayoutBy:"${item.getSeriesLayoutBy()}",
encode:{
<#if item.getPSChartSeriesEncode()??><#assign chartSeriesEncode = item.getPSChartSeriesEncode() /></#if>
itemName:"<#if chartSeriesEncode.getCategory()??>${chartSeriesEncode.getCategory()?lower_case}<#else>${item.getCatalogField()?lower_case}</#if>",
value:"<#if chartSeriesEncode.getValue()??>${chartSeriesEncode.getValue()?lower_case}<#else>${item.getValueField()?lower_case}</#if>"
}<#if item.getBaseOptionJOString()??>,
${item.getBaseOptionJOString()}
</#if>
}
</#if>
<#-- 折线图序列end -->
\ No newline at end of file
<#-- 折线图序列start -->
<#if item.render??>
${item.render.code}
<#else>
{
id:'<#if item.getName()??>${item.getName()?lower_case}</#if>',
name:'<#if item.getCaption()??>${item.getCaption()}</#if>',
type:'line',
xAxisIndex:${item.getIndex()},
yAxisIndex:${item.getIndex()},
datasetIndex:${item.getIndex()},
encode: {
<#if item.getPSChartSeriesEncode()??><#assign chartSeriesEncode = item.getPSChartSeriesEncode() /></#if>
x: [<#if chartSeriesEncode.getX()??><#list chartSeriesEncode.getX() as xValue>'${xValue?lower_case}'<#if xValue_has_next>,</#if></#list></#if>],
y: [<#if chartSeriesEncode.getY()??><#list chartSeriesEncode.getY() as yValue>'${yValue?lower_case}'<#if yValue_has_next>,</#if></#list></#if>]
}<#if item.getBaseOptionJOString()??>,
${item.getBaseOptionJOString()}
</#if>
}
</#if>
<#-- 折线图序列end -->
\ No newline at end of file
<#-- 序列模型start -->
<#if item.getEChartsType()??>
<#if item.getEChartsType() == "line">
new ChartLineSeries({
name:'${item.name?lower_case}',
<#if item.getIdField()??>seriesIdField:"${item.getIdField()?lower_case}",</#if>
<#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if>
categorField:'${item.getCatalogField()?lower_case}',
<#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if>
<#if item.getSeriesPSCodeList()??><#assign seriesCodeList = item.getSeriesPSCodeList() />seriesCodeList:{type:'${seriesCodeList.getCodeListType()}',tag:'${seriesCodeList.getCodeName()}',emptycode:'empty',emptytext:'${seriesCodeList.getEmptyText()}'},</#if>
valueField:'${item.getValueField()?lower_case}',
seriesValues:[],
seriesIndex:${item.getIndex()},
data:[],
seriesMap:{},
<#if item.getPSChartDataSet()??>
<#assign chartDataSet = item.getPSChartDataSet()/>
<#if chartDataSet.getPSChartDataSetFields()??>
dataSetFields:[
<#list chartDataSet.getPSChartDataSetFields() as singleField>
{name:"${singleField.getName()?lower_case}",codelist:<#if singleField.getPSCodeList()??><#assign codelist = singleField.getPSCodeList()/>{type:"${codelist.getCodeListType()}",tag:"${codelist.getCodeName()}",emptycode:'empty',emptytext:'${codelist.getEmptyText()}'}<#else>null</#if>,isGroupField:${singleField.isGroupField()?c},groupMode:"${singleField.getGroupMode()}"}<#if singleField_has_next>,</#if>
</#list>
],
</#if>
</#if>
ecxObject:{
<#-- 序列label start -->
<#if item.containsUserParam("ECX.label")>
label:${item.getUserParam("ECX.label")},
<#else>
label:{
show: true,
position: 'inside'
},
</#if>
<#-- 序列label end -->
<#-- 序列labelLine start -->
<#if item.containsUserParam("ECX.labelLine")>
labelLine:${item.getUserParam("ECX.labelLine")},
<#else>
labelLine:{
length: 10,
lineStyle: {
width: 1,
type: 'solid'
}
},
</#if>
<#-- 序列labelLine end -->
<#-- 序列itemStyle start -->
<#if item.containsUserParam("ECX.itemStyle")>
itemStyle:${item.getUserParam("ECX.itemStyle")},
<#else>
itemStyle:{
borderColor: '#fff',
borderWidth: 1
},
</#if>
<#-- 序列itemStyle end -->
<#-- 序列emphasis start -->
<#if item.containsUserParam("ECX.emphasis")>
emphasis:${item.getUserParam("ECX.emphasis")},
<#else>
emphasis:{
label: {
fontSize: 20
}
}
</#if>
<#-- 序列emphasis end -->
},
ecObject:{
<#if item.getUserParamNames()??>
<#list item.getUserParamNames() as userparam>
<#if userparam?index_of("EC.")==0>
${userparam?remove_beginning("EC.")}:${item.getUserParam(userparam)},
</#if>
</#list>
</#if>
},
seriesTemp:{
type:'line',
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
},
seriesLayoutBy:"${item.getSeriesLayoutBy()}",
baseOption:{
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
}
})
<#elseif item.getEChartsType() == "funnel">
new ChartFunnelSeries({
name:'${item.name?lower_case}',
<#if item.getIdField()??>seriesIdField:"${item.getIdField()?lower_case}",</#if>
<#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if>
categorField:'${item.getCatalogField()?lower_case}',
<#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if>
<#if item.getSeriesPSCodeList()??><#assign seriesCodeList = item.getSeriesPSCodeList() />seriesCodeList:{type:'${seriesCodeList.getCodeListType()}',tag:'${seriesCodeList.getCodeName()}',emptycode:'empty',emptytext:'${seriesCodeList.getEmptyText()}'},</#if>
valueField:'${item.getValueField()?lower_case}',
seriesValues:[],
seriesIndex:${item.getIndex()},
data:[],
seriesMap:{},
<#if item.getPSChartDataSet()??>
<#assign chartDataSet = item.getPSChartDataSet()/>
<#if chartDataSet.getPSChartDataSetFields()??>
dataSetFields:[
<#list chartDataSet.getPSChartDataSetFields() as singleField>
{name:"${singleField.getName()?lower_case}",codelist:<#if singleField.getPSCodeList()??><#assign codelist = singleField.getPSCodeList()/>{type:"${codelist.getCodeListType()}",tag:"${codelist.getCodeName()}",emptycode:'empty',emptytext:'${codelist.getEmptyText()}'}<#else>null</#if>,isGroupField:${singleField.isGroupField()?c},groupMode:"${singleField.getGroupMode()}"}<#if singleField_has_next>,</#if>
</#list>
],
</#if>
</#if>
ecxObject:{
<#-- 序列label start -->
<#if item.containsUserParam("ECX.label")>
label:${item.getUserParam("ECX.label")},
<#else>
label:{
show: true,
position: 'inside'
},
</#if>
<#-- 序列label end -->
<#-- 序列labelLine start -->
<#if item.containsUserParam("ECX.labelLine")>
labelLine:${item.getUserParam("ECX.labelLine")},
<#else>
labelLine:{
length: 10,
lineStyle: {
width: 1,
type: 'solid'
}
},
</#if>
<#-- 序列labelLine end -->
<#-- 序列itemStyle start -->
<#if item.containsUserParam("ECX.itemStyle")>
itemStyle:${item.getUserParam("ECX.itemStyle")},
<#else>
itemStyle:{
borderColor: '#fff',
borderWidth: 1
},
</#if>
<#-- 序列itemStyle end -->
<#-- 序列emphasis start -->
<#if item.containsUserParam("ECX.emphasis")>
emphasis:${item.getUserParam("ECX.emphasis")},
<#else>
emphasis:{
label: {
fontSize: 20
}
}
</#if>
<#-- 序列emphasis end -->
},
ecObject:{
<#if item.getUserParamNames()??>
<#list item.getUserParamNames() as userparam>
<#if userparam?index_of("EC.")==0>
${userparam?remove_beginning("EC.")}:${item.getUserParam(userparam)},
</#if>
</#list>
</#if>
},
seriesTemp:{
type:'funnel',
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
},
baseOption:{
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
},
seriesLayoutBy:"${item.getSeriesLayoutBy()}"
})
<#elseif item.getEChartsType() == "pie">
new ChartPieSeries({
name:'${item.name?lower_case}',
<#if item.getIdField()??>seriesIdField:"${item.getIdField()?lower_case}",</#if>
<#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if>
categorField:'${item.getCatalogField()?lower_case}',
<#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if>
<#if item.getSeriesPSCodeList()??><#assign seriesCodeList = item.getSeriesPSCodeList() />seriesCodeList:{type:'${seriesCodeList.getCodeListType()}',tag:'${seriesCodeList.getCodeName()}',emptycode:'empty',emptytext:'${seriesCodeList.getEmptyText()}'},</#if>
valueField:'${item.getValueField()?lower_case}',
seriesValues:[],
seriesIndex:${item.getIndex()},
data:[],
seriesMap:{},
<#if item.getPSChartDataSet()??>
<#assign chartDataSet = item.getPSChartDataSet()/>
<#if chartDataSet.getPSChartDataSetFields()??>
dataSetFields:[
<#list chartDataSet.getPSChartDataSetFields() as singleField>
{name:"${singleField.getName()?lower_case}",codelist:<#if singleField.getPSCodeList()??><#assign codelist = singleField.getPSCodeList()/>{type:"${codelist.getCodeListType()}",tag:"${codelist.getCodeName()}",emptycode:'empty',emptytext:'${codelist.getEmptyText()}'}<#else>null</#if>,isGroupField:${singleField.isGroupField()?c},groupMode:"${singleField.getGroupMode()}"}<#if singleField_has_next>,</#if>
</#list>
],
</#if>
</#if>
ecxObject:{
<#-- 序列label start -->
<#if item.containsUserParam("ECX.label")>
label:${item.getUserParam("ECX.label")},
<#else>
label:{
show: true,
position: 'outside',
},
</#if>
<#-- 序列label end -->
<#-- 序列labelLine start -->
<#if item.containsUserParam("ECX.labelLine")>
labelLine:${item.getUserParam("ECX.labelLine")},
<#else>
labelLine:{
show: true,
length: 10,
lineStyle: {
width: 1,
type: 'solid'
}
},
</#if>
<#-- 序列labelLine end -->
<#-- 序列itemStyle start -->
<#if item.containsUserParam("ECX.itemStyle")>
itemStyle:${item.getUserParam("ECX.itemStyle")},
<#else>
itemStyle:{
borderColor: '#fff',
borderWidth: 1
},
</#if>
<#-- 序列itemStyle end -->
<#-- 序列emphasis start -->
<#if item.containsUserParam("ECX.emphasis")>
emphasis:${item.getUserParam("ECX.emphasis")},
<#else>
emphasis:{
label: {
fontSize: 20
}
}
</#if>
<#-- 序列emphasis end -->
},
ecObject:{
<#if item.getUserParamNames()??>
<#list item.getUserParamNames() as userparam>
<#if userparam?index_of("EC.")==0>
${userparam?remove_beginning("EC.")}:${item.getUserParam(userparam)},
</#if>
</#list>
</#if>
},
seriesTemp:{
type:'pie',
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
},
baseOption:{
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
},
seriesLayoutBy:"${item.getSeriesLayoutBy()}"
})
<#elseif item.getEChartsType() == "bar">
new ChartBarSeries({
name:'${item.name?lower_case}',
<#if item.getIdField()??>seriesIdField:"${item.getIdField()?lower_case}",</#if>
<#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if>
categorField:'${item.getCatalogField()?lower_case}',
<#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if>
<#if item.getSeriesPSCodeList()??><#assign seriesCodeList = item.getSeriesPSCodeList() />seriesCodeList:{type:'${seriesCodeList.getCodeListType()}',tag:'${seriesCodeList.getCodeName()}',emptycode:'empty',emptytext:'${seriesCodeList.getEmptyText()}'},</#if>
valueField:'${item.getValueField()?lower_case}',
seriesValues:[],
seriesIndex:${item.getIndex()},
data:[],
seriesMap:{},
<#if item.getPSChartDataSet()??>
<#assign chartDataSet = item.getPSChartDataSet()/>
<#if chartDataSet.getPSChartDataSetFields()??>
dataSetFields:[
<#list chartDataSet.getPSChartDataSetFields() as singleField>
{name:"${singleField.getName()?lower_case}",codelist:<#if singleField.getPSCodeList()??><#assign codelist = singleField.getPSCodeList()/>{type:"${codelist.getCodeListType()}",tag:"${codelist.getCodeName()}",emptycode:'empty',emptytext:'${codelist.getEmptyText()}'}<#else>null</#if>,isGroupField:${singleField.isGroupField()?c},groupMode:"${singleField.getGroupMode()}"}<#if singleField_has_next>,</#if>
</#list>
],
</#if>
</#if>
ecxObject:{
<#-- 序列label start -->
<#if item.containsUserParam("ECX.label")>
label:${item.getUserParam("ECX.label")},
<#else>
label:{
show: true,
position: 'inside'
},
</#if>
<#-- 序列label end -->
<#-- 序列labelLine start -->
<#if item.containsUserParam("ECX.labelLine")>
labelLine:${item.getUserParam("ECX.labelLine")},
<#else>
labelLine:{
length: 10,
lineStyle: {
width: 1,
type: 'solid'
}
},
</#if>
<#-- 序列labelLine end -->
<#-- 序列itemStyle start -->
<#if item.containsUserParam("ECX.itemStyle")>
itemStyle:${item.getUserParam("ECX.itemStyle")},
<#else>
itemStyle:{
borderColor: '#fff',
borderWidth: 1
},
</#if>
<#-- 序列itemStyle end -->
<#-- 序列emphasis start -->
<#if item.containsUserParam("ECX.emphasis")>
emphasis:${item.getUserParam("ECX.emphasis")},
<#else>
emphasis:{
label: {
fontSize: 20
}
}
</#if>
<#-- 序列emphasis end -->
},
ecObject:{
<#if item.getUserParamNames()??>
<#list item.getUserParamNames() as userparam>
<#if userparam?index_of("EC.")==0>
${userparam?remove_beginning("EC.")}:${item.getUserParam(userparam)},
</#if>
</#list>
</#if>
},
seriesTemp:{
type:'bar',
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
},
baseOption:{
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
},
seriesLayoutBy:"${item.getSeriesLayoutBy()}"
})
<#elseif item.getEChartsType() == "radar">
new ChartRadarSeries({
name:'${item.name?lower_case}',
type:'radar',
<#if item.getIdField()??>seriesIdField:"${item.getIdField()?lower_case}",</#if>
<#if item.getSeriesField()??>seriesNameField:"${item.getSeriesField()?lower_case}",</#if>
categorField:'${item.getCatalogField()?lower_case}',
<#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}',emptycode:'empty',emptytext:'${categorCodeList.getEmptyText()}'},</#if>
<#if item.getSeriesPSCodeList()??><#assign seriesCodeList = item.getSeriesPSCodeList() />seriesCodeList:{type:'${seriesCodeList.getCodeListType()}',tag:'${seriesCodeList.getCodeName()}',emptycode:'empty',emptytext:'${seriesCodeList.getEmptyText()}'},</#if>
valueField:'${item.getValueField()?lower_case}',
seriesValues:[],
data:[],
<#if item.getPSChartDataSet()??>
<#assign chartDataSet = item.getPSChartDataSet()/>
<#if chartDataSet.getPSChartDataSetFields()??>
dataSetFields:[
<#list chartDataSet.getPSChartDataSetFields() as singleField>
{name:"${singleField.getName()?lower_case}",codelist:<#if singleField.getPSCodeList()??><#assign codelist = singleField.getPSCodeList()/>{type:"${codelist.getCodeListType()}",tag:"${codelist.getCodeName()}",emptycode:'empty',emptytext:'${codelist.getEmptyText()}'}<#else>null</#if>,isGroupField:${singleField.isGroupField()?c},groupMode:"${singleField.getGroupMode()}"}<#if singleField_has_next>,</#if>
</#list>
],
</#if>
</#if>
baseOption:{
<#if item.getBaseOptionJOString()??>
${item.getBaseOptionJOString()}
</#if>
}
})
<#else>
new ChartLineSeries({name:'${item.name?lower_case}',categorField:'${item.getCatalogField()?lower_case}',<#if item.getCatalogPSCodeList()??><#assign categorCodeList = item.getCatalogPSCodeList() />categorCodeList:{type:'${categorCodeList.getCodeListType()}',tag:'${categorCodeList.getCodeName()}'},</#if>valueField:'${item.getValueField()?lower_case}',data:[]}),
</#if>
</#if>
<#-- 序列模型end -->
\ No newline at end of file
<#-- 折线图序列start -->
<#if item.render??>
${item.render.code}
<#else>
{
id:'<#if item.getName()??>${item.getName()?lower_case}</#if>',
name:'<#if item.getCaption()??>${item.getCaption()}</#if>',
type:'pie',
datasetIndex:${item.getIndex()},
<#compress><#if item.getLeft()?? && item.getLeft() != "">left:"${item.getLeft()}",</#if>
<#if item.getTop()?? && item.getTop() != 0>top:"${item.getTop()}",</#if>
<#if item.getBottom()?? && item.getBottom() != 0>bottom:"${item.getBottom()}",</#if>
<#if item.getRight()?? && item.getRight() != "">right:"${item.getRight()}",</#if>
<#if item.getWidth()?? && item.getWidth() != "">width:"${item.getWidth()}",</#if>
<#if item.getHeight()?? && item.getHeight() != "">height:"${item.getHeight()}",</#if></#compress>
seriesLayoutBy:"${item.getSeriesLayoutBy()}",
encode:{
<#if item.getPSChartSeriesEncode()??><#assign chartSeriesEncode = item.getPSChartSeriesEncode() /></#if>
itemName:"<#if chartSeriesEncode.getCategory()??>${chartSeriesEncode.getCategory()?lower_case}<#else>${item.getCatalogField()?lower_case}</#if>",
value:"<#if chartSeriesEncode.getValue()??>${chartSeriesEncode.getValue()?lower_case}<#else>${item.getValueField()?lower_case}</#if>"
}<#if item.getBaseOptionJOString()??>,
${item.getBaseOptionJOString()}
</#if>
}
</#if>
<#-- 折线图序列end -->
\ No newline at end of file
<#-- 折线图序列start -->
<#if item.render??>
${item.render.code}
<#else>
{
id:'<#if item.getName()??>${item.getName()?lower_case}</#if>',
name:'<#if item.getCaption()??>${item.getCaption()}</#if>',
type:'radar',
encode:{
itemName:"type"
}<#if item.getBaseOptionJOString()??>,
${item.getBaseOptionJOString()}
</#if>
}
</#if>
<#-- 折线图序列end -->
\ No newline at end of file
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
<#assign import_block> <#assign import_block>
import echarts from 'echarts'; import echarts from 'echarts';
import moment from "moment";
import CodeListService from "@service/app/codelist-service";
import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,ChartBarSeries,ChartRadarSeries} from '@/model/chart-detail';
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
...@@ -106,7 +109,7 @@ import echarts from 'echarts'; ...@@ -106,7 +109,7 @@ import echarts from 'echarts';
* 图表div绑定的id * 图表div绑定的id
* *
* @type {} * @type {}
* @memberof ${srfclassname('${ctrl.name}')} * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public chartId:string = this.$util.createUUID(); public chartId:string = this.$util.createUUID();
...@@ -114,132 +117,149 @@ import echarts from 'echarts'; ...@@ -114,132 +117,149 @@ import echarts from 'echarts';
* echarts图表对象 * echarts图表对象
* *
* @type {} * @type {}
* @memberof ${srfclassname('${ctrl.name}')} * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public myChart:any; public myChart:any;
/** /**
* 初始化图表所需参数 * 代码表服务对象
* *
* @type {} * @type {CodeListService}
* @memberof ${srfclassname('${ctrl.name}')} * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public chartOption:any = {}; public codeListService:CodeListService = new CodeListService({ $store: this.$store });
/** /**
* 图表基础配置参数 * 序列模型
* *
* @returns {*} * @type {}
* @memberof ${srfclassname('${ctrl.name}')}Service * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public defaultConfig: any = { public seriesModel:any = {
<#-- 获取模板对象:BEGIN --> <#if ctrl.getPSDEChartSerieses()??>
<#assign title=ctrl.getPSDEChartTitle()> <#list ctrl.getPSDEChartSerieses() as chartSeries>
<#list ctrl.getPSDEChartSerieses() as series> ${chartSeries.getName()?lower_case}:${P.getPartCode(chartSeries, 'SERIES_MODEL').code}<#if chartSeries_has_next>,</#if>
<#-- 暂只支持第一个序列 --> </#list>
<#if series_index == 0>
<#assign chartSeries = series/>
</#if>
</#list>
<#-- 获取模板对象:END -->
<#-- 公共配置:BEGIN -->
title: {
show: <#if title.isShowTitle()>true<#else>false</#if>,
<#if title.getTitle()??>
text: '${title.getTitle()}',
</#if>
<#if title.getSubTitle()??>
subtext: '${title.getSubTitle()}'
</#if>
},
legend: {top: 20},
toolbox: {
show: true,
feature: {
dataView: {
show: true,
readOnly: true,
title: '数据视图'
},
saveAsImage: {
show: true,
title: '保存为图片'
}
}
},
<#-- 公共配置:END -->
<#-- 饼图配置:BEGIN -->
<#if chartSeries.getSeriesType() == 'pie'>
tooltip: { trigger: 'item' },
<#-- 饼图配置:END -->
<#-- 折线图,柱状图配置:BEGIN -->
<#elseif chartSeries.getSeriesType() == 'line' || chartSeries.getSeriesType() == 'bar'>
<#assign xAxes = chartSeries.getXPSDEChartAxes() />
<#assign yAxes = chartSeries.getYPSDEChartAxes() />
tooltip: { trigger: 'axis' },
<#if xAxes??>
xAxis: {
<#if xAxes.getAxesType?? && xAxes.getAxesType()??>
type: '${xAxes.getAxesType()}',
</#if>
<#if xAxes.getAxesPos?? && xAxes.getAxesPos()??>
position: '${xAxes.getAxesPos()}',
</#if> </#if>
<#if xAxes.getCaption?? && xAxes.getCaption()??> };
name: '${xAxes.getCaption()}',
/**
* 图表自定义参数集合
*
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public chartUserParams:any ={
<#if ctrl.getUserParamNames()??>
<#list ctrl.getUserParamNames() as userparam>
<#if userparam?index_of("EC.")==0>
${userparam?remove_beginning("EC.")}:${ctrl.getUserParam(userparam)}<#if userparam_has_next>,</#if>
</#if> </#if>
<#if xAxes.getMaxValue?? && xAxes.getMaxValue()??> </#list>
max: '${xAxes.getMaxValue()}',
</#if> </#if>
<#if xAxes.getMinValue?? && xAxes.getMinValue()??> };
min: '${xAxes.getMinValue()}',
/**
* 图表基础动态模型
*
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public chartBaseOPtion:any = {<#if ctrl.getBaseOptionJOString()??>${ctrl.getBaseOptionJOString()}</#if>};
/**
* 初始化图表所需参数
*
* @type {}
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public chartOption:any = {
<#-- 标题start -->
<#if ctrl.getPSDEChartTitle()??>
<#assign title= ctrl.getPSDEChartTitle() />
title:{
show:<#if title.isShowTitle()>true<#else>false</#if> ,
text:'<#if title.getTitle()??>${title.getTitle()}</#if>',
subtext:'<#if title.getSubTitle()??>${title.getSubTitle()}</#if>'
},
</#if> </#if>
<#-- 标题end -->
<#-- 图例start -->
<#if ctrl.getPSDEChartLegend()??>
<#assign legend= ctrl.getPSDEChartLegend() />
legend:{
show:<#if legend.isShowLegend()>true<#else>false</#if>
}, },
</#if> </#if>
<#if yAxes??> <#-- 图例end -->
yAxis: { <#-- 绘图网格start -->
<#if yAxes.getAxesType?? && yAxes.getAxesType()??> <#if ctrl.getPSChartGrids()??>
type: '<#if yAxes.getAxesType() == 'numeric'>value<#else>${yAxes.getAxesType()}</#if>', grid:[
<@ibizindent blank=8>
<#list ctrl.getPSChartGrids() as chartGrid>
${P.getPartCode(chartGrid).code}<#if chartGrid_has_next>,</#if>
</#list>
</@ibizindent>
],
</#if> </#if>
<#if yAxes.getAxesPos?? && yAxes.getAxesPos()??> <#-- 绘图网格end -->
position: '${yAxes.getAxesPos()}', <#-- 雷达图坐标系start -->
<#if ctrl.getPSChartRadars?? && ctrl.getPSChartRadars()??>
<#list ctrl.getPSChartRadars() as chartRadar>
<#if chartRadar_index == 0>
radar:{
<@ibizindent blank=8>
${P.getPartCode(chartRadar).code}
</@ibizindent>
},
</#if> </#if>
<#if yAxes.getCaption?? && yAxes.getCaption()??> </#list>
name: '${yAxes.getCaption()}',
</#if> </#if>
<#if yAxes.getMaxValue?? && yAxes.getMaxValue()??> <#-- 雷达图坐标系end -->
max: '${yAxes.getMaxValue()}', <#-- X轴start -->
<#if ctrl.getPSChartXAxises()??>
xAxis: [
<@ibizindent blank=8>
<#list ctrl.getPSChartXAxises() as chartXAxise>
${P.getPartCode(chartXAxise).code}<#if chartXAxise_has_next>,</#if>
</#list>
</@ibizindent>
],
</#if> </#if>
<#if yAxes.getMinValue?? && yAxes.getMinValue()??> <#-- X轴end -->
min: '${yAxes.getMinValue()}', <#-- Y轴start -->
<#if ctrl.getPSChartYAxises()??>
yAxis:[
<@ibizindent blank=8>
<#list ctrl.getPSChartYAxises() as chartYAxise>
${P.getPartCode(chartYAxise).code}<#if chartYAxise_has_next>,</#if>
</#list>
</@ibizindent>
],
</#if> </#if>
<#-- Y轴end -->
<#-- 提示框组件start -->
tooltip:{
show:true
}, },
</#if> <#-- 提示框组件end -->
</#if> <#-- 数据集start -->
<#-- 折线图,柱状图配置:BEGIN --> dataset:[],
} <#-- 数据集end -->
<#-- 序列start -->
/** series:[
* 深度合并对象,把secondObj的内容合并给firstObj,返回合并后的firstObj <@ibizindent blank=8>
* @param {} firstObj 被合并对象 <#list ctrl.getPSDEChartSerieses() as chartSeriese>
* @param {} secondObj 合并对象 ${P.getPartCode(chartSeriese).code}<#if chartSeriese_has_next>,</#if>
* @memberof ${srfclassname('${ctrl.name}')} </#list>
*/ </@ibizindent>
public deepObjectMerge(firstObj: any, secondObj: any) { ]
for (let key in secondObj) { <#-- 序列end -->
firstObj[key] = };
firstObj[key] && firstObj[key].toString() === "[object Object]"
? this.deepObjectMerge(firstObj[key], secondObj[key])
: (firstObj[key] = secondObj[key]);
}
return firstObj;
}
/** /**
* 刷新 * 刷新
* *
* @param {*} [opt={}] * @param {*} [opt={}]
* @memberof ${srfclassname('${ctrl.name}')} * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public refresh(opt: any = {}) { public refresh(opt: any = {}) {
this.load(opt); this.load(opt);
...@@ -249,7 +269,7 @@ import echarts from 'echarts'; ...@@ -249,7 +269,7 @@ import echarts from 'echarts';
* 获取图表数据 * 获取图表数据
* *
* @returns {*} * @returns {*}
* @memberof ${srfclassname('${ctrl.name}')} * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public load(opt?:any) { public load(opt?:any) {
let _this = this; let _this = this;
...@@ -257,11 +277,19 @@ import echarts from 'echarts'; ...@@ -257,11 +277,19 @@ import echarts from 'echarts';
const parentdata: any = {}; const parentdata: any = {};
this.$emit('beforeload', parentdata); this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata); Object.assign(arg, parentdata);
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams,page:0,size:1000});
<#if ctrl.getPSDEDataSet()??>
<#assign appDataSet = ctrl.getPSDEDataSet() />
<#if appDataSet.getMajorSortDir()?? && appDataSet.getMajorSortPSDEField()??>
Object.assign(arg,{sort: '${appDataSet.getMajorSortPSDEField().getCodeName()?lower_case},${appDataSet.getMajorSortDir()?lower_case}'});
</#if>
<#if appDataSet.getPageSize()?? && appDataSet.getPageSize() != -1>
Object.assign(arg,{size:${appDataSet.getPageSize()?c}});
</#if>
</#if>
this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)),arg,this.showBusyIndicator).then((res) => { this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)),arg,this.showBusyIndicator).then((res) => {
if (res) { if (res) {
_this.chartOption = _this.deepObjectMerge(_this.defaultConfig, res.data); this.transformToBasicChartSetData(res.data,(codelist:any) =>{_this.drawCharts(codelist)});
_this.drawCharts();
} }
}).catch((error) => { }).catch((error) => {
console.error(error); console.error(error);
...@@ -272,17 +300,781 @@ import echarts from 'echarts'; ...@@ -272,17 +300,781 @@ import echarts from 'echarts';
* 绘制图表 * 绘制图表
* *
* @returns {*} * @returns {*}
* @memberof ${srfclassname('${ctrl.name}')} * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public drawCharts(){ public drawCharts(codelist:any){
if(!this.myChart){ if(!this.myChart){
let element:any = document.getElementById(this.chartId); let element:any = document.getElementById(this.chartId);
this.myChart = echarts.init(element); this.myChart = echarts.init(element);
} }
this.handleChartOPtion(codelist);
console.log(this.chartOption);
this.myChart.setOption(this.chartOption); this.myChart.setOption(this.chartOption);
this.myChart.resize(); this.myChart.resize();
} }
/**
* 处理图表参数
*
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public handleChartOPtion(allcodelist:any){
if(Object.keys(this.seriesModel).length > 0){
let tempDataSourceMap:Map<string,any> = new Map();
for(let i=0;i<Object.keys(this.seriesModel).length;i++){
Object.values(this.seriesModel).forEach((seriesvalue:any) =>{
if(seriesvalue.seriesIndex === i){
tempDataSourceMap.set(seriesvalue.name,seriesvalue.data);
}
})
}
if(tempDataSourceMap.size > 0){
tempDataSourceMap.forEach((item:any) =>{
this.chartOption.dataset.push({'source':item});
})
}
Object.keys(this.seriesModel).forEach((seriesName:string) =>{
if(this.chartOption && this.chartOption.series.length > 0){
this.chartOption.series.forEach((item:any) =>{
if(this.seriesModel[seriesName].ecxObject){
item = Util.deepObjectMerge(item,this.seriesModel[seriesName].ecxObject);
}
if(this.seriesModel[seriesName].baseOption && Object.keys(this.seriesModel[seriesName].baseOption).length > 0){
item = Util.deepObjectMerge(item,this.seriesModel[seriesName].baseOption);
}
if(this.seriesModel[seriesName].ecObject){
item = Util.deepObjectMerge(item,this.seriesModel[seriesName].ecObject);
}
})
}
//设置多序列
let tempSeries:any = this.seriesModel[seriesName];
// 非雷达图
if(tempSeries && tempSeries.seriesIdField && tempSeries.seriesValues.length > 0 && !Object.is(tempSeries.type,'radar')){
const returnIndex:number = this.chartOption.series.findIndex((item:any) =>{
return Object.is(item.id,seriesName);
})
this.chartOption.series.splice(returnIndex,1);
let tempSeriesArray:Array<any> = [];
tempSeries.seriesValues.forEach((seriesvalueItem:any) =>{
let tempSeriesTemp:any = JSON.parse(JSON.stringify(tempSeries.seriesTemp));
<#noparse>Object.assign(tempSeriesTemp,{name:tempSeries.seriesMap[seriesvalueItem],datasetIndex:tempSeries.seriesIndex,encode:{x:tempSeries.categorField,y:`${seriesvalueItem}`}});</#noparse>
this.chartOption.series.push(tempSeriesTemp);
})
}
})
}
if(Object.keys(this.chartBaseOPtion).length > 0){
Object.assign(this.chartOption,this.chartBaseOPtion);
}
if(Object.keys(this.chartUserParams).length >0){
Object.assign(this.chartOption,this.chartUserParams);
}
}
/**
* 实体数据集转化为图表数据集
*
* 1.获取图表所有代码表值
* 2.查询集合映射图表数据集
* 3.补全图表数据集
* 4.图表数据集分组求和
* 5.排序图表数据集
*
* @param {*} data 实体数据集
* @param {Function} callback 回调
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public async transformToBasicChartSetData(data:any,callback:Function){
if(!data || !Array.isArray(data) || data.length === 0){
return;
}
//获取代码表值
let allCodeList:any = await this.getChartAllCodeList();
if(Object.values(this.seriesModel).length > 0){
Object.values(this.seriesModel).forEach((singleSeries:any,index:number) =>{
// 值属性为srfcount设置{srfcount:1}到data
let valueField = singleSeries.dataSetFields.find((datasetField:any) =>{
return datasetField.name === singleSeries.valueField;
});
if(valueField && valueField.name && Object.is(valueField.name,"srfcount")){
data.forEach((singleData:any) =>{
Object.assign(singleData,{srfcount:1});
})
}
// 分组属性
let groupField = singleSeries.dataSetFields.find((datasetField:any) =>{
return datasetField.name === singleSeries.categorField;
});
let tempChartSetData:Array<any> = [];
let tempSeriesValues:Map<string,any> = new Map();
data.forEach((item:any) =>{
let tempChartSetDataItem:any = {};
// 序列属性不存在
if(!singleSeries.seriesIdField){
Object.assign(tempChartSetDataItem,{name:singleSeries.name});
if(singleSeries.dataSetFields && singleSeries.dataSetFields.length >0){
singleSeries.dataSetFields.forEach((singleDataSetField:any) =>{
this.handleSingleDataSetField(item,singleDataSetField,allCodeList,tempChartSetDataItem,groupField);
})
}
}else{
// 序列属性存在时
// 序列代码表存在时,翻译tempSeriesValues的键值对
if(singleSeries.seriesCodeList){
const seriesCodeList:Map<string,any> = allCodeList.get(singleSeries.seriesCodeList.tag);
let tempSeriesValueItem = tempSeriesValues.get(seriesCodeList.get(item[singleSeries.seriesIdField]));
if(!tempSeriesValueItem){
tempSeriesValues.set(seriesCodeList.get(item[singleSeries.seriesIdField]),seriesCodeList.get(item[singleSeries.seriesIdField]));
}
}else{
let tempSeriesValueItem = tempSeriesValues.get(item[singleSeries.seriesIdField]);
if(!tempSeriesValueItem){
tempSeriesValues.set(item[singleSeries.seriesIdField],item[singleSeries.seriesNameField]);
}
}
Object.assign(tempChartSetDataItem,{name:item[singleSeries.seriesIdField]});
if(singleSeries.dataSetFields && singleSeries.dataSetFields.length >0){
singleSeries.dataSetFields.forEach((singleDataSetField:any) =>{
this.handleSingleDataSetField(item,singleDataSetField,allCodeList,tempChartSetDataItem,groupField);
})
}
}
tempChartSetData.push(tempChartSetDataItem);
})
// 补全数据集合
this.completeDataSet(tempChartSetData,singleSeries,allCodeList);
// 序列代码表存在时,补全序列
if(singleSeries.seriesCodeList){
const seriesCodeList:Map<string,any> = allCodeList.get(singleSeries.seriesCodeList.tag);
tempSeriesValues = new Map();
seriesCodeList.forEach((item:any) =>{
tempSeriesValues.set(item,item);
})
}
singleSeries.seriesValues = [...tempSeriesValues.keys()];
let tempSeriesMapObj:any = {};
tempSeriesValues.forEach((value:any,key:any) =>{
tempSeriesMapObj[key] = value;
})
singleSeries.seriesMap = tempSeriesMapObj;
let callbackFunction:any = (index === (Object.values(this.seriesModel).length - 1))?callback:null;
this.transformToChartSeriesDataSet(tempChartSetData,singleSeries,callbackFunction,allCodeList);
})
}
}
/**
* 构建图表序列数据集合
*
* 1.分组求和
* 2.排序求和数组
*
* @param {Array<any>} data 传入数据
* @param {Array<any>} item 单个序列
* @param {Array<any>} callback 回调
* @param {*} allCodeList 所有代码表
*
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public transformToChartSeriesDataSet(data:any,item:any,callback:Function,allCodeList:any):any{
if(item.seriesIdField){
// 多序列
let groupField = item.dataSetFields.filter((datasetField:any) =>{
return datasetField.name === item.categorField;
});
let tempGroupField:Array<any> = groupField.map((item:any) =>{
return item.name;
});
let seriesField = item.dataSetFields.filter((datasetField:any) =>{
return datasetField.name === item.seriesIdField;
});
let tempSeriesField:Array<any> = seriesField.map((item:any) =>{
return item.name;
});
let valueField = item.dataSetFields.filter((datasetField:any) =>{
return datasetField.name === item.valueField;
});
let tempValueField:Array<any> = valueField.map((item:any) =>{
return item.name;
});
item.data = this.groupAndAdd(tempGroupField,tempSeriesField,tempValueField,data,item,groupField,allCodeList);
}else{
//单序列
let groupField = item.dataSetFields.filter((datasetField:any) =>{
return datasetField.name === item.categorField;
});
let tempGroupField:Array<any> = groupField.map((item:any) =>{
return item.name;
})
let valueField = item.dataSetFields.filter((datasetField:any) =>{
return datasetField.name === item.valueField;
});
let tempValueField:Array<any> = valueField.map((item:any) =>{
return item.name;
})
item.data = this.groupAndAdd(tempGroupField,[],tempValueField,data,item,groupField,allCodeList);
}
if(callback && callback instanceof Function){
callback(allCodeList);
}
}
/**
* 分组和求和
* @param {Array<any>} groupField 分组属性
* @param {Array<any>} groupField 值属性
* @param {Array<any>} data 传入数据
* @param {*} groupFieldModel 分组属性模型
* @param {*} allCodeList 所有代码表
*
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public groupAndAdd(groupField:Array<any>,seriesField:Array<any>,valueField:Array<any>,data:any,item:any,groupFieldModel:any,allCodeList:any){
let tempMap:Map<string,any> = new Map();
let groupMode:string = groupFieldModel[0].groupMode;
let groupKeyStr:string = "";
data.forEach((item:any) =>{
let tempGroupField:string = groupField[0];
groupKeyStr = item[tempGroupField];
let tempMapItem:any = tempMap.get(groupKeyStr);
if(tempMapItem){
tempMapItem.push(item);
tempMap.set(groupKeyStr,tempMapItem);
}else{
tempMap.set(groupKeyStr,[item]);
}
})
// 处理多序列
if(seriesField.length > 0 && tempMap.size > 0){
let tempSeriesField:string = seriesField[0];
tempMap.forEach((item:any,key:string) =>{
let tempItemMap:Map<string,any> = new Map();
item.forEach((singleItem:any)=>{
let seriesValueArray:any = tempItemMap.get(singleItem[tempSeriesField]);
if(seriesValueArray){
seriesValueArray.push(singleItem);
tempItemMap.set(singleItem[tempSeriesField],seriesValueArray);
}else{
tempItemMap.set(singleItem[tempSeriesField],[singleItem]);
}
})
tempMap.set(key,tempItemMap);
});
}
let returnArray:Array<any> = [];
if(seriesField.length == 0){
//单序列
tempMap.forEach((tempItem:any) =>{
if(tempItem.length >0){
let curObject:any = {};
let valueResult:number = 0;
let categorResult:any;
tempItem.forEach((singleItem:any) =>{
categorResult = singleItem[groupField[0]];
valueResult += singleItem[valueField[0]];
})
Object.defineProperty(curObject, groupField[0], {
value: categorResult,
writable : true,
enumerable : true,
configurable : true
});
Object.defineProperty(curObject, valueField[0], {
value: valueResult,
writable : true,
enumerable : true,
configurable : true
});
returnArray.push(curObject);
}
})
}else{
// 多序列
let seriesValuesArray:Array<any> = item.seriesValues;
tempMap.forEach((groupItem:any,groupKey:string) =>{
//求和
let curObject:any = {};
Object.defineProperty(curObject, groupField[0], {
value: groupKey,
writable : true,
enumerable : true,
configurable : true
});
seriesValuesArray.forEach((seriesValueItem:any) =>{
Object.defineProperty(curObject, seriesValueItem, {
value: 0,
writable : true,
enumerable : true,
configurable : true
});
});
groupItem.forEach((seriesItem:any,seriesKey:string) =>{
let seriesNum:number = 0;
seriesItem.forEach((dataItem:any) =>{
seriesNum += dataItem[valueField[0]];
})
curObject[seriesKey] = seriesNum;
})
returnArray.push(curObject);
})
}
// 补全空白分类
if(returnArray.length >0){
let emptyText = (groupFieldModel[0] && groupFieldModel[0].codeList)?groupFieldModel[0].codeList.emptytext:"未定义";
returnArray.forEach((item:any) =>{
if(!item[groupField[0]]){
item[groupField[0]] = emptyText;
}
})
}
returnArray = this.sortReturnArray(returnArray,groupFieldModel,allCodeList);
// 雷达图数据格式处理
if(Object.is(item.type,'radar') && returnArray.length >0){
let tempReturnArray:Array<any> = [];
let seriesValues:Array<any> = item.seriesValues;
if(seriesValues && seriesValues.length >0){
seriesValues.forEach((singleSeriesName:any) =>{
let singleSeriesObj:any = {type:singleSeriesName};
returnArray.forEach((item:any) =>{
Object.assign(singleSeriesObj,{[item[groupField[0]]]:item[singleSeriesName]});
})
tempReturnArray.push(singleSeriesObj);
})
}
returnArray = tempReturnArray;
}
console.log(JSON.stringify(returnArray));
return returnArray;
}
/**
* 排序数组
*
* @param {Array<any>} arr 传入数组
* @param {*} groupField 分组属性
* @param {*} allCodeList 所有代码表
*
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public sortReturnArray(arr:Array<any>,groupField:any,allCodeList:any){
let returnArray:Array<any> = [];
// todo
// 分组属性有代码表的情况(最后执行)
if(groupField[0].codelist){
let curCodeList:Map<number,any> = allCodeList.get(groupField[0].codelist.tag);
curCodeList.forEach((codelist:any) =>{
arr.forEach((item:any) =>{
if(Object.is(item[groupField[0].name],codelist)){
returnArray.push(item);
item.hasused = true;
}
})
})
arr.forEach((item:any,index:number) =>{
if(!item.hasused){
returnArray.push(item);
}
})
returnArray.forEach((item:any) =>{
delete item.hasused;
})
}else{
// 分组为年份
if(Object.is(groupField[0].groupMode,"YEAR")){
returnArray = arr.sort((a:any, b:any) => {
return Number(a[groupField[0].name]) - Number(b[groupField[0].name]);
});
}else if(Object.is(groupField[0].groupMode,"QUARTER")){
returnArray = this.handleSortGroupData(arr,groupField,"季度");
}else if(Object.is(groupField[0].groupMode,"MONTH")){
returnArray = this.handleSortGroupData(arr,groupField,"月");
}else if(Object.is(groupField[0].groupMode,"YEARWEEK")){
returnArray = this.handleSortGroupData(arr,groupField,"周");
}else if(Object.is(groupField[0].groupMode,"DAY")){
returnArray = arr.sort((a:any, b:any) => {
return moment(a[groupField[0].name]).unix() - moment(b[groupField[0].name]).unix();
});
}else{
let groupFieldName:string = groupField[0].name;
let isConvert:boolean = true;
arr.forEach((item:any) =>{
if(isNaN(item[groupFieldName])){
isConvert = false;
}
})
if(isConvert){
returnArray = arr.sort((a:any, b:any) => {
return a[groupFieldName] - b[groupFieldName];
});
}else{
returnArray = arr;
}
}
}
return returnArray;
}
/**
* 排序分组模式下的数据
*
* @param {Array<any>} arr 传入数据
* @param {Array<any>} groupField 分组属性
* @param {Array<any>} label label标签
*
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public handleSortGroupData(arr:Array<any>,groupField:any,label:string){
arr.forEach((item:any) =>{
let sortFieldValue:Array<any> = item[groupField[0].name].split("-");
Object.assign(item,{sortField:Number(sortFieldValue[0])*10000+Number(sortFieldValue[1])});
item[groupField[0].name] = sortFieldValue[0]+"年"+sortFieldValue[1]+label;
})
arr.sort((a:any, b:any) => {
return Number(a.sortField) - Number(b.sortField);
});
arr.forEach((item:any) =>{
delete item.sortField;
})
return arr;
}
/**
* 补全数据集
*
* @param {Array<any>} data 传入数据
* @param {Array<any>} item 单个序列
* @param {Array<any>} allCodeList 所有的代码表
*
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public completeDataSet(data:any,item:any,allCodeList:any){
// 分组属性
let groupField = item.dataSetFields.find((datasetField:any) =>{
return datasetField.name === item.categorField;
});
if(Object.is(groupField.groupMode,"")){
return;
}
//分组模式为代码表(补值)
if(Object.is(groupField.groupMode,'CODELIST')){
this.completeCodeList(data,item,allCodeList);
}
//分组模式为年/季度/月份(最大值,最小值,分组,补值)
if(Object.is(groupField.groupMode,"YEAR") || Object.is(groupField.groupMode,"QUARTER") || Object.is(groupField.groupMode,"MONTH") || Object.is(groupField.groupMode,"YEARWEEK") || Object.is(groupField.groupMode,"DAY")){
this.handleTimeData(data,item,allCodeList,groupField);
}
}
/**
* 获取最大值最小值
*
* @param {Array<any>} tempTimeArray 传入数据
*
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public getRangeData(tempTimeArray:Array<any>){
tempTimeArray.forEach((item:any) =>{
let tempParams:Array<any> = item._i.split("-");
item.sortField = Number(tempParams[0] + tempParams[1]);
})
tempTimeArray.sort((a:any, b:any) => {
return Number(a.sortField) - Number(b.sortField);
});
tempTimeArray.forEach((item:any) =>{
delete item.sortField;
})
return tempTimeArray;
}
/**
* 补全时间类型数据集
*
* @param {Array<any>} data 传入数据
* @param {Array<any>} item 单个序列
* @param {Array<any>} allCodeList 所有的代码表
* @param {Array<any>} groupField 分组属性
*
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public handleTimeData(data:any,item:any,allCodeList:any,groupField:any){
let valueField = item.dataSetFields.find((datasetField:any) =>{
return datasetField.name === item.valueField;
});
let groupMode:string = groupField.groupMode;
// 排序数据,找到最大值、最小值
let tempTimeArray:Array<any> = [];
if(data && data.length >0){
data.forEach((dataItem:any) =>{
// 判断时间类型是否为空,为空不处理
if(dataItem[groupField.name]){
tempTimeArray.push(moment(dataItem[groupField.name]));
}
})
}
let maxTime:any;
let minTime:any;
if(Object.is(groupMode,"YEAR") || Object.is(groupMode,"DAY")){
maxTime = moment.max(tempTimeArray);
minTime = moment.min(tempTimeArray);
}
if(Object.is(groupMode,"QUARTER")){
tempTimeArray = this.getRangeData(tempTimeArray);
minTime = moment().year((tempTimeArray[0]._i.split("-"))[0]).quarters((tempTimeArray[0]._i.split("-"))[1]);
maxTime = moment().year((tempTimeArray[tempTimeArray.length - 1]._i.split("-"))[0]).quarters((tempTimeArray[tempTimeArray.length - 1]._i.split("-"))[1]);
}
if(Object.is(groupMode,"MONTH")){
tempTimeArray = this.getRangeData(tempTimeArray);
minTime = moment().year((tempTimeArray[0]._i.split("-"))[0]).month((tempTimeArray[0]._i.split("-"))[1]);
maxTime = moment().year((tempTimeArray[tempTimeArray.length - 1]._i.split("-"))[0]).month((tempTimeArray[tempTimeArray.length - 1]._i.split("-"))[1]);
}
if(Object.is(groupMode,"YEARWEEK")){
tempTimeArray = this.getRangeData(tempTimeArray);
minTime = moment().year((tempTimeArray[0]._i.split("-"))[0]).week((tempTimeArray[0]._i.split("-"))[1]);
maxTime = moment().year((tempTimeArray[tempTimeArray.length - 1]._i.split("-"))[0]).week((tempTimeArray[tempTimeArray.length - 1]._i.split("-"))[1]);
}
let timeFragmentArray:Array<any> = [];
let tempGrounpData:Map<string,any> = new Map();
// 时间分段
//groupMode为"YEAR"
if(Object.is(groupMode,"YEAR")){
let curTime:any = minTime;
while(curTime){
if(curTime.isSameOrBefore(maxTime)){
let tempcurTime:any = curTime.clone();
timeFragmentArray.push(tempcurTime.year().toString());
curTime = tempcurTime.clone().add(1, 'years');
}else{
curTime = null;
}
}
}
//groupMode为"QUARTER"
if(Object.is(groupMode,"QUARTER")){
let curTime:any = minTime;
while(curTime){
if(curTime.isSameOrBefore(maxTime)){
let tempcurTime:any = curTime.clone();
timeFragmentArray.push(tempcurTime.year().toString()+"-"+tempcurTime.quarter().toString());
curTime = tempcurTime.clone().add(1, 'quarters');
}else{
curTime = null;
}
}
}
//groupMode为"MONTH"
if(Object.is(groupMode,"MONTH")){
let curTime:any = minTime;
while(curTime){
if(curTime.isSameOrBefore(maxTime)){
let tempcurTime:any = curTime.clone();
timeFragmentArray.push(tempcurTime.year().toString()+"-"+tempcurTime.month().toString());
curTime = tempcurTime.clone().add(1, 'months');
}else{
curTime = null;
}
}
}
//groupMode为"YEARWEEK"
if(Object.is(groupMode,"YEARWEEK")){
let curTime:any = minTime;
while(curTime){
if(curTime.isSameOrBefore(maxTime)){
let tempcurTime:any = curTime.clone();
timeFragmentArray.push(tempcurTime.year().toString()+"-"+tempcurTime.week().toString());
curTime = tempcurTime.clone().add(1, 'weeks');
}else{
curTime = null;
}
}
}
//groupMode为"DAY"
if(Object.is(groupMode,"DAY")){
let curTime:any = minTime;
while(curTime){
if(curTime.isSameOrBefore(maxTime)){
let tempcurTime:any = curTime.clone();
timeFragmentArray.push(tempcurTime.format('YYYY-MM-DD'));
curTime = tempcurTime.clone().add(1, 'days');
}else{
curTime = null;
}
}
}
data.forEach((item:any) =>{
let tempKeyStr:string = item[groupField.name];
let tempGrounpItem:any = tempGrounpData.get(tempKeyStr);
if(!tempGrounpItem){
tempGrounpData.set(tempKeyStr,item);
}
})
timeFragmentArray.forEach((timeFragment:any) =>{
if(!tempGrounpData.get(timeFragment)){
let copyTemp:any = JSON.parse(JSON.stringify(data[0]));
let curObj:any = {};
curObj[groupField.name] = timeFragment;
curObj[valueField.name] = 0;
Object.assign(copyTemp,curObj);
data.push(copyTemp);
}
})
}
/**
* 补全代码表
*
* @param {Array<any>} data 传入数据
* @param {Array<any>} item 单个序列
* @param {Array<any>} allCodeList 所有的代码表
*
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public completeCodeList(data:any,item:any,allCodeList:any){
let groupField = item.dataSetFields.find((datasetField:any) =>{
return datasetField.name === item.categorField;
});
if(!groupField.codelist){
return;
}
let valueField = item.dataSetFields.find((datasetField:any) =>{
return datasetField.name === item.valueField;
});
let curCodeList:Map<number,any> = allCodeList.get(groupField.codelist.tag);
// 对分类实现分组
let tempGrounpData:Map<string,any> = new Map();
data.forEach((item:any) =>{
let tempGrounpItem:any = tempGrounpData.get(item[groupField.name+'_srfvalue']);
if(!tempGrounpItem){
tempGrounpData.set(item[groupField.name+'_srfvalue'],item);
}
})
if(curCodeList.size !== tempGrounpData.size){
curCodeList.forEach((text:any,value:any) =>{
if(!tempGrounpData.get(value)){
let copyTemp:any = JSON.parse(JSON.stringify(data[0]));
let curObj:any = {};
curObj[groupField.name+'_srfvalue'] = value;
curObj[groupField.name] = text;
curObj[valueField.name] = 0;
Object.assign(copyTemp,curObj);
data.push(copyTemp);
}
})
}
}
/**
* 处理单个属性
*
* @param {*} input 输入值
* @param {*} field 属性值
* @param {*} allCodeList 所有代码表
* @param {*} result 结果值
*
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public handleSingleDataSetField(input:any,field:any,allCodeList:any,result:any,groupField:any){
let tempFieldObj:any = {};
//存在代码表的情况(自动转化值)
if(field.codelist){
//获取代码表
let curCodeList:Map<number,any> = allCodeList.get(field.codelist.tag);
tempFieldObj[field.name] = curCodeList.get(input[field.name]);
tempFieldObj[field.name+'_srfvalue'] = input[field.name];
}else{
// 不存在代码表的情况
if(groupField && Object.is(groupField.name,field.name)){
if(Object.is(groupField.groupMode,"YEAR") ){
tempFieldObj[field.name] = moment(input[field.name]).year().toString();
}else if(Object.is(groupField.groupMode,"QUARTER") ){
tempFieldObj[field.name] = moment(input[field.name]).year().toString()+"-"+moment(input[field.name]).quarters().toString();
}else if(Object.is(groupField.groupMode,"MONTH") ){
tempFieldObj[field.name] = moment(input[field.name]).year().toString()+"-"+moment(input[field.name]).month().toString();
}else if(Object.is(groupField.groupMode,"YEARWEEK") ){
tempFieldObj[field.name] = moment(input[field.name]).year().toString()+"-"+moment(input[field.name]).week().toString();
}else if(Object.is(groupField.groupMode,"DAY") ){
tempFieldObj[field.name] = moment(input[field.name]).format("YYYY-MM-DD");
}else{
tempFieldObj[field.name] = input[field.name];
}
}else{
tempFieldObj[field.name] = input[field.name]
}
}
Object.assign(result,tempFieldObj);
}
/**
* 获取图表所需代码表
*
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public getChartAllCodeList():Promise<any>{
return new Promise((resolve:any,reject:any) =>{
let codeListMap:Map<string,any> = new Map();
if(Object.values(this.seriesModel).length >0){
let tempFlag:boolean = true;
Object.values(this.seriesModel).forEach((singleSeries:any) =>{
if(singleSeries.dataSetFields && singleSeries.dataSetFields.length >0){
let promiseArray:Array<any> = [];
let promiseKeyArray:Array<any> = [];
singleSeries.dataSetFields.forEach((singleDataSetField:any,index:any) =>{
if(singleDataSetField.codelist){
tempFlag = false;
if(!codeListMap.get(singleDataSetField.codelist.tag)){
promiseArray.push(this.getCodeList(singleDataSetField.codelist));
promiseKeyArray.push(singleDataSetField.codelist.tag);
Promise.all(promiseArray).then((result:any) =>{
if(result && result.length >0){
result.forEach((codeList:any) =>{
let tempCodeListMap:Map<number,any> = new Map();
if(codeList.length >0){
codeList.forEach((codeListItem:any) =>{
tempCodeListMap.set(codeListItem.value,codeListItem.text);
})
}
codeListMap.set(singleDataSetField.codelist.tag,tempCodeListMap);
})
resolve(codeListMap);
}
})
}
}
})
}
})
if(tempFlag){resolve(codeListMap);}
}else{
resolve(codeListMap);
}
})
}
/**
* 获取代码表
*
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.name}')}Base
*/
public getCodeList(codeListObject:any):Promise<any>{
return new Promise((resolve:any,reject:any) =>{
if(codeListObject.tag && Object.is(codeListObject.type,"STATIC")){
const codelist = this.$store.getters.getCodeList(codeListObject.tag);
if (codelist) {
resolve([...JSON.parse(JSON.stringify(codelist.items))]);
} else {
console.log(`<#noparse>----${codeListObject.tag}----代码表不存在</#noparse>`);
}
}else if(codeListObject.tag && Object.is(codeListObject.type,"DYNAMIC")){
this.codeListService.getItems(codeListObject.tag).then((res:any) => {
resolve(res);
}).catch((error:any) => {
console.log(`<#noparse>----${codeListObject.tag}----代码表不存在</#noparse>`);
});
}
})
}
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
......
...@@ -10,10 +10,22 @@ ...@@ -10,10 +10,22 @@
*/ */
public getDataItems(): any[] { public getDataItems(): any[] {
return [ return [
{
name:'size',
prop:'size'
},
{ {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'page',
prop:'page'
},
{
name:'sort',
prop:'sort'
}
] ]
} }
......
...@@ -24,100 +24,12 @@ ...@@ -24,100 +24,12 @@
result =_appEntityService.FetchDefault(Context,Data, isloading); result =_appEntityService.FetchDefault(Context,Data, isloading);
} }
result.then((response) => { result.then((response) => {
this.handleSeries(response);
resolve(response); resolve(response);
}).catch(response => { }).catch(response => {
reject(response); reject(response);
}); });
}); });
} }
<#-- 暂只支持第一个序列 -->
<#list ctrl.getPSDEChartSerieses() as series>
<#if series_index == 0>
<#assign chartSeries = series/>
</#if>
</#list>
/**
* 生成图表数据
*
* @param {*} response
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public handleSeries(response: any) {
let chartOption:any = {};
<#-- 获取x轴的分类属性字段 -->
<#if chartSeries.getCatalogField?? && chartSeries.getCatalogField()??>
<#assign catalogField = chartSeries.getCatalogField()>
let catalogFields: any = [<#rt>
<#list catalogField?split(";") as field>
"${field?lower_case}",<#t>
</#list>
];<#lt>
</#if>
<#-- 获取y轴值属性字段和中文名称 -->
<#if chartSeries.getValueField?? && chartSeries.getValueField()??>
<#assign valueField = chartSeries.getValueField()>
let valueFields: any = [<#rt>
<#list valueField?split(";") as field>
[ "${field?lower_case}", "${de.getPSDEField(field).getLogicName()}" ],<#t>
</#list>
];<#lt>
</#if>
// 数据按分类属性分组处理
let xFields:any = [];
let yFields:any = [];
valueFields.forEach((field: any,index: number) => {
yFields[index] = [];
});
response.data.forEach((item:any) => {
if(xFields.indexOf(item[catalogFields[0]]) > -1){
let num = xFields.indexOf(item[catalogFields[0]]);
valueFields.forEach((field: any,index: number) => {
yFields[index][num] += item[field[0]];
});
}else{
xFields.push(item[catalogFields[0]]);
valueFields.forEach((field: any,index: number) => {
yFields[index].push(item[field[0]]);
});
}
});
<#-- 折线图和柱状图需要配置xAxis,饼图不需要 -->
<#if chartSeries.getSeriesType() == 'line' || chartSeries.getSeriesType() == 'bar'>
chartOption.xAxis = { data: xFields };
</#if>
<#-- 配置series -->
let series: any = [];
valueFields.forEach((field: any,index: number) => {
let yData: any = [];
xFields.forEach((item:any, num: number) => {
<#if chartSeries.getSeriesType() == 'line' || chartSeries.getSeriesType() == 'bar'>
yData.push(yFields[index][num]);
<#elseif chartSeries.getSeriesType() == 'pie'>
yData.push({value: yFields[index][num], name: item});
</#if>
});
yData.sort(function (a:any, b:any) { return a.value - b.value; });
series.push({
name:field[1],
type:"${chartSeries.getSeriesType()}",
data:yData,
<#-- 饼图额外配置 -->
<#if chartSeries.getSeriesType() == 'pie'>
top:"40px",
left: (100/valueFields.length)*index+"%",
right: (100/valueFields.length)*(valueFields.length-index-1)+"%",
animationType: 'scale',
animationEasing: 'elasticOut',
animationDelay: function (idx: any) {
return Math.random() * 200;
}
</#if>
});
});
chartOption.series = series;
response.data = chartOption;
}
<#ibizinclude> <#ibizinclude>
../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl ../@MACRO/SERVICE/SERVICE_BOTTOM.ts.ftl
</#ibizinclude> </#ibizinclude>
\ No newline at end of file
...@@ -237,7 +237,7 @@ import UtilService from '@/utilservice/util-service'; ...@@ -237,7 +237,7 @@ import UtilService from '@/utilservice/util-service';
public loadModel(){ public loadModel(){
if(this.isEnableCustomized){ if(this.isEnableCustomized){
this.utilService.getService(this.utilServiceName).then((service:any) =>{ this.utilService.getService(this.utilServiceName).then((service:any) =>{
service.loadModelData(JSON.parse(JSON.stringify(this.context)),{modelid:this.modelId}).then((res:any) =>{ service.loadModelData(JSON.parse(JSON.stringify(this.context)),{modelid:this.modelId,utilServiceName:this.utilServiceName}).then((res:any) =>{
if(res && res.status == 200){ if(res && res.status == 200){
const data:any = res.data; const data:any = res.data;
if(data && data.length >0){ if(data && data.length >0){
......
...@@ -160,6 +160,14 @@ ...@@ -160,6 +160,14 @@
*/ */
public totalRecord: number = 0; public totalRecord: number = 0;
/**
* 加载的数据是否附加在items之后
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public isAddBehind:boolean = false;
/** /**
* 选中数组 * 选中数组
* @type {Array<any>} * @type {Array<any>}
...@@ -298,6 +306,7 @@ ...@@ -298,6 +306,7 @@
if(this.totalRecord>this.items.length) if(this.totalRecord>this.items.length)
{ {
this.curPage = ++this.curPage; this.curPage = ++this.curPage;
this.isAddBehind = true;
this.load({}); this.load({});
} }
} }
...@@ -363,8 +372,10 @@ ...@@ -363,8 +372,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) {
...@@ -373,7 +384,9 @@ ...@@ -373,7 +384,9 @@
return; return;
} }
const data: any = response.data; const data: any = response.data;
if(!this.isAddBehind){
this.items = []; this.items = [];
}
if (Object.keys(data).length > 0) { if (Object.keys(data).length > 0) {
let datas = JSON.parse(JSON.stringify(data)); let datas = JSON.parse(JSON.stringify(data));
datas.map((item: any) => { datas.map((item: any) => {
...@@ -386,6 +399,7 @@ ...@@ -386,6 +399,7 @@
this.items.push(...datas); this.items.push(...datas);
} }
} }
this.isAddBehind = false;
this.$emit('load', this.items); this.$emit('load', this.items);
if(this.isSelectFirstDefault){ if(this.isSelectFirstDefault){
this.handleClick(this.items[0]); this.handleClick(this.items[0]);
......
...@@ -324,6 +324,9 @@ ...@@ -324,6 +324,9 @@
return ; return ;
} }
const arg:any = args[0]; const arg:any = args[0];
if(this.context){
Object.assign(data,JSON.parse(JSON.stringify(this.context)));
}
switch(arg.itemType) { switch(arg.itemType) {
<#if xDataControl?? && xDataControl.getPSSysCalendarItems()??> <#if xDataControl?? && xDataControl.getPSSysCalendarItems()??>
<#list xDataControl.getPSSysCalendarItems() as calendarItem> <#list xDataControl.getPSSysCalendarItems() as calendarItem>
...@@ -337,9 +340,6 @@ ...@@ -337,9 +340,6 @@
</#list> </#list>
</#if> </#if>
} }
if(this.context){
Object.assign(data,JSON.parse(JSON.stringify(this.context)));
}
this.selection = {}; this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName[arg.itemType] }, data:data }); Object.assign(this.selection, { view: { viewname: this.navViewName[arg.itemType] }, data:data });
this.$emit('selectionchange',args); this.$emit('selectionchange',args);
......
...@@ -3,6 +3,22 @@ ...@@ -3,6 +3,22 @@
</#ibizinclude> </#ibizinclude>
<template> <template>
<div :class='calendarClass'> <div :class='calendarClass'>
<#if ctrl.getQuickPSDEToolbar?? && ctrl.getQuickPSDEToolbar()??>
<span class="quick-toolbar">
<#assign quickToolbar = ctrl.getQuickPSDEToolbar()/>
<@ibizindent blank=12>
${P.getCtrlCode(quickToolbar, 'CONTROL.html').code}
</@ibizindent>
</span>
</#if>
<#if ctrl.getBatchPSDEToolbar?? && ctrl.getBatchPSDEToolbar()??>
<span v-if="selections.length > 0" class="batch-toolbar">
<#assign batchToolbar = ctrl.getBatchPSDEToolbar()/>
<@ibizindent blank=12>
${P.getCtrlCode(batchToolbar, 'CONTROL.html').code}
</@ibizindent>
</span>
</#if>
<#if ctrl.getCalendarStyle?? && ctrl.getCalendarStyle() == 'TIMELINE'> <#if ctrl.getCalendarStyle?? && ctrl.getCalendarStyle() == 'TIMELINE'>
<el-timeline> <el-timeline>
<el-timeline-item <el-timeline-item
...@@ -18,6 +34,16 @@ ...@@ -18,6 +34,16 @@
</el-timeline-item> </el-timeline-item>
</el-timeline> </el-timeline>
<#else> <#else>
<div class="event-legends">
<#if ctrl.getPSSysCalendarItems()??>
<#list ctrl.getPSSysCalendarItems() as calendarItem>
<div :class="{'event-lengend':true, '${calendarItem.getItemType()}':true, 'event-disabled':!isShowlegend.${calendarItem.getItemType()}}" @click="legendTrigger('${calendarItem.getItemType()}')">
<div class="lengend-icon" style="background:${calendarItem.getBKColor()};"></div>
<span style="color:${calendarItem.getColor()};">${calendarItem.getName()}</span>
</div>
</#list>
</#if>
</div>
<FullCalendar <FullCalendar
ref="calendar" ref="calendar"
:locale="$i18n.locale" :locale="$i18n.locale"
...@@ -261,6 +287,41 @@ FullCalendar, ...@@ -261,6 +287,41 @@ FullCalendar,
*/ */
public calendarType: string = "${ctrl.getCalendarStyle()}"; public calendarType: string = "${ctrl.getCalendarStyle()}";
/**
* 图例显示控制
*
* @public
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public isShowlegend: any = {
<#if ctrl.getPSSysCalendarItems()??>
<#list ctrl.getPSSysCalendarItems() as calendarItem>
${calendarItem.getItemType()}:true,
</#list>
</#if>
};
/**
* 图例点击事件
*
* @public
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
legendTrigger(itemType:string){
this.isShowlegend[itemType] = !this.isShowlegend[itemType];
this.refresh();
}
/**
* 查询参数缓存
*
* @public
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public searchArgCache: any = {};
/** /**
* 搜索获取日程事件 * 搜索获取日程事件
* *
...@@ -268,6 +329,7 @@ FullCalendar, ...@@ -268,6 +329,7 @@ FullCalendar,
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public searchEvents(fetchInfo?:any, successCallback?:any, failureCallback?:any ) { public searchEvents(fetchInfo?:any, successCallback?:any, failureCallback?:any ) {
// 处理请求参数
let start = (fetchInfo && fetchInfo.start) ? this.$util.dateFormat(fetchInfo.start) : null; let start = (fetchInfo && fetchInfo.start) ? this.$util.dateFormat(fetchInfo.start) : null;
let end = (fetchInfo && fetchInfo.end) ? this.$util.dateFormat(fetchInfo.end) : null; let end = (fetchInfo && fetchInfo.end) ? this.$util.dateFormat(fetchInfo.end) : null;
let arg = { start: start, end: end }; let arg = { start: start, end: end };
...@@ -275,6 +337,39 @@ FullCalendar, ...@@ -275,6 +337,39 @@ FullCalendar,
Object.assign(arg,{query : fetchInfo.query}); Object.assign(arg,{query : fetchInfo.query});
} }
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
const parentdata: any = {};
this.$emit('beforeload', parentdata);
Object.assign(arg, parentdata);
// 处理events数据
let _this = this;
let handleEvents = ()=>{
if(_this.isSelectFirstDefault){
// 模拟$event数据
let tempEvent = JSON.parse(JSON.stringify(_this.events[0]));
_this.onEventClick(tempEvent,true);
_this.events[0].className = "select-first-event";
_this.calendarClass = "calendar select-first-calendar";
}
let filterEvents = this.events.filter((event:any)=>{
return _this.isShowlegend[event.itemType];
});
if(successCallback){
successCallback(filterEvents);
}
// 刷新日历的大小(仅fullcalendar组件使用)
if(!Object.is(_this.calendarType,"TIMELINE")){
let appCalendar: any = _this.$refs.calendar;
let api = appCalendar.getApi();
api.updateSize();
}
}
if(JSON.stringify(arg) === JSON.stringify(this.searchArgCache)){
handleEvents();
return;
}else{
this.searchArgCache = arg;
}
const post: Promise<any> = this.service.search(this.loadAction, JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator); const post: Promise<any> = this.service.search(this.loadAction, 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) {
...@@ -285,22 +380,7 @@ FullCalendar, ...@@ -285,22 +380,7 @@ FullCalendar,
} }
// 默认选中第一项 // 默认选中第一项
this.events = response.data; this.events = response.data;
if(this.isSelectFirstDefault){ handleEvents();
// 模拟$event数据
let tempEvent = JSON.parse(JSON.stringify(this.events[0]));
this.onEventClick(tempEvent,true);
this.events[0].className = "select-first-event";
this.calendarClass = "calendar select-first-calendar";
}
if(successCallback){
successCallback(this.events);
}
// 刷新日历的大小(仅fullcalendar组件使用)
if(!Object.is(this.calendarType,"TIMELINE")){
let appCalendar: any = this.$refs.calendar;
let api = appCalendar.getApi();
api.updateSize();
}
}, (response: any) => { }, (response: any) => {
if (response && response.status === 401) { if (response && response.status === 401) {
return; return;
...@@ -331,7 +411,7 @@ FullCalendar, ...@@ -331,7 +411,7 @@ FullCalendar,
switch(deName){ switch(deName){
<#if view.getAllRelatedPSAppViews?? && view.getAllRelatedPSAppViews()??> <#if view.getAllRelatedPSAppViews?? && view.getAllRelatedPSAppViews()??>
<#list view.getAllRelatedPSAppViews() as editview> <#list view.getAllRelatedPSAppViews() as editview>
case "${editview.getPSDataEntity().getCodeName()?lower_case}": case "${editview.getPSAppDataEntity().getCodeName()?lower_case}":
view = { view = {
viewname: '${srffilepath2(editview.getCodeName())}', viewname: '${srffilepath2(editview.getCodeName())}',
height: ${editview.getHeight()?c}, height: ${editview.getHeight()?c},
...@@ -418,15 +498,17 @@ FullCalendar, ...@@ -418,15 +498,17 @@ FullCalendar,
</#list> </#list>
</#if> </#if>
} }
// 导航栏中不需要打开视图,只要抛出选中数据
if(this.isSelectFirstDefault){
_context.itemType = itemType; _context.itemType = itemType;
this.selections = [_context]; this.selections = [_context];
// 导航栏中不需要打开视图,只要抛出选中数据
if(this.isSelectFirstDefault){
this.$emit("selectionchange",[_context]); this.$emit("selectionchange",[_context]);
return; return;
} }
// 根据打开模式打开视图 // 根据打开模式打开视图
if (Object.is(view.placement, 'INDEXVIEWTAB') || Object.is(view.placement, '')) { if(!view.viewname){
return;
} else if (Object.is(view.placement, 'INDEXVIEWTAB') || Object.is(view.placement, '')) {
const routePath = this.$viewTool.buildUpRoutePath(this.$route, this.context, view.deResParameters, view.parameters, [JSON.parse(JSON.stringify(_context))] , JSON.parse(JSON.stringify(this.viewparams))); const routePath = this.$viewTool.buildUpRoutePath(this.$route, this.context, view.deResParameters, view.parameters, [JSON.parse(JSON.stringify(_context))] , JSON.parse(JSON.stringify(this.viewparams)));
this.$router.push(routePath); this.$router.push(routePath);
} else { } else {
...@@ -588,6 +670,16 @@ FullCalendar, ...@@ -588,6 +670,16 @@ FullCalendar,
</#if> </#if>
} }
<#if ctrl.getQuickPSDEToolbar?? && ctrl.getQuickPSDEToolbar()??>
<#assign quickToolbar = ctrl.getQuickPSDEToolbar()/>
${P.getCtrlCode(quickToolbar, 'CONTROL.vue').code}
</#if>
<#if ctrl.getBatchPSDEToolbar?? && ctrl.getBatchPSDEToolbar()??>
<#assign batchToolbar = ctrl.getBatchPSDEToolbar()/>
${P.getCtrlCode(batchToolbar, 'CONTROL.vue').code}
</#if>
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
<#if view.getViewType() == 'DECALENDAREXPVIEW'> <#if view.getViewType() == 'DECALENDAREXPVIEW'>
:isSelectFirstDefault="true" :isSelectFirstDefault="true"
</#if> </#if>
<#if view.getViewType() == 'DECALENDARVIEW' || view.getViewType() == 'DECALENDARVIEW9'>
@beforeload="onBeforeLoad($event)"
</#if>
</#assign> </#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl ../@MACRO/HTML/DEFAULT.html.ftl
......
...@@ -8,17 +8,49 @@ ...@@ -8,17 +8,49 @@
.calendar{ .calendar{
height:100%; height:100%;
overflow: auto;
.el-timeline{ .el-timeline{
padding-left: 2px; padding-left: 2px;
} }
.event-legends{
width: 100%;
text-align: center;
.event-lengend{
display: inline-block;
margin-left: 10px;
height: 20px;
.lengend-icon{
display: inline-block;
width: 30px;
height: 20px;
border-radius: 5px;
}
span{
display: inline-block;
margin-left: 5px;
line-height: 20px;
vertical-align: top;
}
}
.event-lengend.event-disabled{
.lengend-icon{
background:#cccccc !important;
}
span{
color:#cccccc !important;
}
}
}
} }
// 选中样式 // 选中样式
.calendar .selected-event, .calendar .selected-event,
.select-first-calendar .select-first-event{ .select-first-calendar .select-first-event{
border: 2px solid #ff8711 !important; border: 2px solid #ff8711 !important;
} }
.calendar .selected-event:before, .calendar .fc-dayGrid-view .selected-event:before,
.select-first-calendar .select-first-event:before{ .select-first-calendar .fc-dayGrid-view .select-first-event:before,
.calendar .fc-timeGrid-view .selected-event:before,
.select-first-calendar .fc-timeGrid-view .select-first-event:before{
content: ''; content: '';
display: block; display: block;
position: absolute; position: absolute;
...@@ -29,8 +61,10 @@ ...@@ -29,8 +61,10 @@
border-left-color: transparent; border-left-color: transparent;
color: #fff; color: #fff;
} }
.calendar .selected-event:after, .calendar .fc-dayGrid-view .selected-event:after,
.select-first-calendar .select-first-event:after{ .select-first-calendar .fc-dayGrid-view .select-first-event:after,
.calendar .fc-timeGrid-view .selected-event:after,
.select-first-calendar .fc-timeGrid-view .select-first-event:after{
content: ''; content: '';
display: block; display: block;
width: 4px; width: 4px;
......
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
</#if> </#if>
</#list> </#list>
</#if> </#if>
</#if>
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'MODEL_CONTENT.ts').code}
</#if> </#if>
// 前端新增修改标识,新增为"0",修改为"1"或未设值 // 前端新增修改标识,新增为"0",修改为"1"或未设值
{ {
......
.tree-right-menu { .tree-right-menu {
.ivu-divider-horizontal { .ivu-divider-horizontal {
width: calc(100% - 32px); width: 100%;
min-width: calc(100% - 32px); min-width: 100%;
margin: 0 auto; margin: 0 auto;
} }
.ivu-dropdown-item { .ivu-dropdown-item {
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
.icon{
padding-right: 10px;
}
} }
<#ibizinclude> <#ibizinclude>
../@MACRO/CSS/DEFAULT.less.ftl ../@MACRO/CSS/DEFAULT.less.ftl
......
...@@ -432,9 +432,9 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se ...@@ -432,9 +432,9 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se
</#if> </#if>
}); });
</#if> </#if>
<#if node.getTreeNodeType() == 'DE' && node.getPSDataEntity()??> <#if node.getTreeNodeType() == 'DE' && node.getPSAppDataEntity()??>
<#assign filtername>${node.getPSDataEntity().codeName}SearchFilter</#assign> <#assign filtername>${node.getPSAppDataEntity().codeName}SearchFilter</#assign>
<#assign entityname>${node.getPSDataEntity().codeName}</#assign> <#assign entityname>${node.getPSAppDataEntity().codeName}</#assign>
let searchFilter: any = {}; let searchFilter: any = {};
<#list ctrl.getPSDETreeNodeRSs() as noders> <#list ctrl.getPSDETreeNodeRSs() as noders>
<#if noders.getChildPSDETreeNode().id == node.id> <#if noders.getChildPSDETreeNode().id == node.id>
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
> .ivu-split-pane { > .ivu-split-pane {
> div { > div {
height: 100%; height: 100%;
overflow: auto; overflow-y: auto;
overflow-x: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.tree-exp-bar-header { .tree-exp-bar-header {
......
...@@ -179,7 +179,7 @@ GanttElastic, ...@@ -179,7 +179,7 @@ GanttElastic,
<#if dataItem.getFrontPSCodeList()??> <#if dataItem.getFrontPSCodeList()??>
<#assign codelist = dataItem.getFrontPSCodeList()/> <#assign codelist = dataItem.getFrontPSCodeList()/>
if (Object.is(field, '${dataItem.name}')) { if (Object.is(field, '${dataItem.name}')) {
let codelist: any[] = this.$store.getters.getCodeList('CodeList4'); let codelist: any[] = this.$store.getters.getCodeList('${codelist.getCodeName()}');
if(codelist) { if(codelist) {
return this.getCodeListItem(codelist, task[field]); return this.getCodeListItem(codelist, task[field]);
} }
......
...@@ -465,9 +465,9 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se ...@@ -465,9 +465,9 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se
</#if> </#if>
}); });
</#if> </#if>
<#if node.getTreeNodeType() == 'DE' && node.getPSDataEntity()??> <#if node.getTreeNodeType() == 'DE' && node.getPSAppDataEntity()??>
<#assign filtername>${node.getPSDataEntity().codeName}SearchFilter</#assign> <#assign filtername>${node.getPSAppDataEntity().codeName}SearchFilter</#assign>
<#assign entityname>${node.getPSDataEntity().codeName}</#assign> <#assign entityname>${node.getPSAppDataEntity().codeName}</#assign>
let searchFilter: any = {}; let searchFilter: any = {};
<#list ctrl.getPSDETreeNodeRSs() as noders> <#list ctrl.getPSDETreeNodeRSs() as noders>
<#if noders.getChildPSDETreeNode().id == node.id> <#if noders.getChildPSDETreeNode().id == node.id>
......
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
<#macro getColumnHeader item blankNum> <#macro getColumnHeader item blankNum>
<@insertBlank blankNum /><template v-slot:header="{column}"> <@insertBlank blankNum /><template v-slot:header="{column}">
<@insertBlank blankNum /> <span class="column-header <#if item.getHeaderPSSysCss?? && item.getHeaderPSSysCss()??>${item.getHeaderPSSysCss().getCssName()}</#if>"> <@insertBlank blankNum /> <span class="column-header <#if item.getHeaderPSSysCss?? && item.getHeaderPSSysCss()??>${item.getHeaderPSSysCss().getCssName()}</#if>">
<#if item.getPSSysImage()??> <#if item.getPSSysImage?? && item.getPSSysImage()??>
<#assign img=item.getPSSysImage()> <#assign img=item.getPSSysImage()>
<@insertBlank blankNum /> <i class='<#if img.getCssClass()?? && (img.getCssClass()?length gt 0)>${img.getCssClass()}</#if>'></i> <@insertBlank blankNum /> <i class='<#if img.getCssClass?? && img.getCssClass()?? && (img.getCssClass()?length gt 0)>${img.getCssClass()}</#if>'></i>
</#if> </#if>
<@insertBlank blankNum /> {{<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>}} <@insertBlank blankNum /> {{<#if langbase??>$t('${langbase}.columns.${item.getName()?lower_case}')<#else>'${item.getCaption()}'</#if>}}
<@insertBlank blankNum /> </span> <@insertBlank blankNum /> </span>
......
...@@ -29,14 +29,14 @@ ...@@ -29,14 +29,14 @@
ref='multipleTable' :data="items" :show-header="!isHideHeader"> ref='multipleTable' :data="items" :show-header="!isHideHeader">
<template slot="empty"> <template slot="empty">
无数据 无数据
<span class="quick-toolbar">
<#if ctrl.getQuickPSDEToolbar?? && ctrl.getQuickPSDEToolbar()??> <#if ctrl.getQuickPSDEToolbar?? && ctrl.getQuickPSDEToolbar()??>
<span class="quick-toolbar">
<#assign quickToolbar = ctrl.getQuickPSDEToolbar()/> <#assign quickToolbar = ctrl.getQuickPSDEToolbar()/>
<@ibizindent blank=12> <@ibizindent blank=12>
${P.getCtrlCode(quickToolbar, 'CONTROL.html').code} ${P.getCtrlCode(quickToolbar, 'CONTROL.html').code}
</@ibizindent> </@ibizindent>
</#if>
</span> </span>
</#if>
</template> </template>
<template v-if="!isSingleSelect"> <template v-if="!isSingleSelect">
<el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column> <el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
...@@ -70,14 +70,14 @@ ...@@ -70,14 +70,14 @@
</div> </div>
</poptip> </poptip>
</span> </span>
<span v-if="selections.length > 0" class="batch-toolbar">
<#if ctrl.getBatchPSDEToolbar?? && ctrl.getBatchPSDEToolbar()??> <#if ctrl.getBatchPSDEToolbar?? && ctrl.getBatchPSDEToolbar()??>
<span v-if="selections.length > 0" class="batch-toolbar">
<#assign batchToolbar = ctrl.getBatchPSDEToolbar()/> <#assign batchToolbar = ctrl.getBatchPSDEToolbar()/>
<@ibizindent blank=12> <@ibizindent blank=12>
${P.getCtrlCode(batchToolbar, 'CONTROL.html').code} ${P.getCtrlCode(batchToolbar, 'CONTROL.html').code}
</@ibizindent> </@ibizindent>
</#if>
</span> </span>
</#if>
<span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp; <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
<span> <span>
{{$t('app.gridpage.show')}}&nbsp; {{$t('app.gridpage.show')}}&nbsp;
...@@ -1202,7 +1202,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1202,7 +1202,7 @@ import { FormItemModel } from '@/model/form-detail';
} }
// 已选中则删除,没选中则添加 // 已选中则删除,没选中则添加
let selectIndex = this.selections.findIndex((item:any)=>{ let selectIndex = this.selections.findIndex((item:any)=>{
return Object.is(item.${ctrl.getPSDataEntity().getName()?lower_case},$event.${ctrl.getPSDataEntity().getName()?lower_case}); return Object.is(item.${ctrl.getPSAppDataEntity().getName()?lower_case},$event.${ctrl.getPSAppDataEntity().getName()?lower_case});
}); });
if (Object.is(selectIndex,-1)){ if (Object.is(selectIndex,-1)){
this.selections.push(JSON.parse(JSON.stringify($event))); this.selections.push(JSON.parse(JSON.stringify($event)));
...@@ -1481,7 +1481,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1481,7 +1481,7 @@ import { FormItemModel } from '@/model/form-detail';
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public setColState() { public setColState() {
const _data: any = localStorage.getItem('${ctrl.getPSDataEntity().getName()?lower_case}_${ctrl.getCodeName()?lower_case}_${ctrl.name}'); const _data: any = localStorage.getItem('${ctrl.getPSAppDataEntity().getName()?lower_case}_${ctrl.getCodeName()?lower_case}_${ctrl.name}');
if (_data) { if (_data) {
let columns = JSON.parse(_data); let columns = JSON.parse(_data);
columns.forEach((col: any) => { columns.forEach((col: any) => {
...@@ -1499,7 +1499,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1499,7 +1499,7 @@ import { FormItemModel } from '@/model/form-detail';
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public onColChange() { public onColChange() {
localStorage.setItem('${ctrl.getPSDataEntity().getName()?lower_case}_${ctrl.getCodeName()?lower_case}_${ctrl.name}', JSON.stringify(this.allColumns)); localStorage.setItem('${ctrl.getPSAppDataEntity().getName()?lower_case}_${ctrl.getCodeName()?lower_case}_${ctrl.name}', JSON.stringify(this.allColumns));
} }
/** /**
......
...@@ -331,6 +331,9 @@ ...@@ -331,6 +331,9 @@
return ; return ;
} }
const arg:any = args[0]; const arg:any = args[0];
if(this.context){
Object.assign(data,JSON.parse(JSON.stringify(this.context)));
}
<#if ctrl.getXDataPSControl()??> <#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl()/> <#assign xDataControl = ctrl.getXDataPSControl()/>
<#if xDataControl.getPSAppDataEntity()??> <#if xDataControl.getPSAppDataEntity()??>
...@@ -339,9 +342,6 @@ ...@@ -339,9 +342,6 @@
Object.assign(data,{srfparentdename:'${curDataEntity.getCodeName()}',srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']}); Object.assign(data,{srfparentdename:'${curDataEntity.getCodeName()}',srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']});
</#if> </#if>
</#if> </#if>
if(this.context){
Object.assign(data,JSON.parse(JSON.stringify(this.context)));
}
this.selection = {}; this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName }, data:data }); Object.assign(this.selection, { view: { viewname: this.navViewName }, data:data });
this.$emit('selectionchange',args); this.$emit('selectionchange',args);
......
...@@ -1499,7 +1499,7 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -1499,7 +1499,7 @@ import CodeListService from "@service/app/codelist-service";
return; return;
} }
row[$event.name] = $event.value; row[$event.name] = $event.value;
this.gridEditItemChange(row, $event.name, $event.value); this.gridEditItemChange(row, $event.name, $event.value, rowIndex);
} }
/** /**
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
<#ibizinclude>../../@MACRO/FUNC/MACRO.ftl</#ibizinclude>
<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>
<card class='view-card<#if !view.isShowCaptionBar()> view-no-caption</#if> <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :bordered="false" :dis-hover="true" >
<#ibizinclude>
../@MACRO/VIEW_CAPTION_DATAINFO.vue.ftl
</#ibizinclude>
<div class='content-container'>
<#assign MDContent>
<#if view.getPSSysCounterRef?? && 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" <#if appCounter??>:counterService="${srfclassname('${appCounter.getCodeName()}')}counterservice"</#if> @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'>
<#if view.hasPSControl('toolbar')>
<@ibizindent blank=8>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</@ibizindent>
</#if>
</div>
</div>
</#if>
<#-- END:快速搜索框或工具栏或支持快速分组搜索或快速搜索表单部件存在 -->
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'CONTROL.html').code}
</#if>
<#if view.hasPSControl('calendar')>
${P.getCtrlCode('calendar', 'CONTROL.html').code}
</#if>
</#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/DEFAULT.vue.ftl ../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude> </#ibizinclude>
</div>
</card>
</div>
\ No newline at end of file
<#ibizinclude>../../@MACRO/FUNC/MACRO.ftl</#ibizinclude>
<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>
<card class='view-card view-no-caption <#if !view.hasPSControl('toolbar')> view-no-toolbar</#if>' :bordered="false" :dis-hover="true" >
<div class='content-container'>
<#assign MDContent>
<#if view.getPSSysCounterRef?? && 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" <#if appCounter??>:counterService="${srfclassname('${appCounter.getCodeName()}')}counterservice"</#if> @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'>
<#if view.hasPSControl('toolbar')>
<@ibizindent blank=16>
${P.getCtrlCode('toolbar', 'CONTROL.html').code}
</@ibizindent>
</#if>
</div>
</div>
</#if>
<#-- END:快速搜索框或工具栏或支持快速分组搜索或快速搜索表单部件存在 -->
<#if view.hasPSControl('searchform')>
${P.getCtrlCode('searchform', 'CONTROL.html').code}
</#if>
<#if view.hasPSControl('calendar')>
${P.getCtrlCode('calendar', 'CONTROL.html').code}
</#if>
</#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/DEFAULT.vue.ftl ../@MACRO/VIEW_MD_CONTENT.vue.ftl
</#ibizinclude> </#ibizinclude>
</div>
</card>
</div>
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
<#ibizinclude> <#ibizinclude>
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.view-container { .app-modal{
.view-container {
.view-card { .view-card {
.ivu-card-body { .ivu-card-body {
.content-container{ .content-container{
...@@ -9,4 +10,5 @@ ...@@ -9,4 +10,5 @@
} }
} }
} }
}
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
../@MACRO/DEFAULT.less.ftl ../@MACRO/DEFAULT.less.ftl
</#ibizinclude> </#ibizinclude>
.${srffilepath2(view.getCodeName())}{ .${srffilepath2(view.getCodeName())}{
width:100%; display: block;
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<#assign portletClass = "portlet"> <#assign portletClass = "portlet">
</#if> </#if>
<template> <template>
<div class='${portletClass} ${srffilepath2(ctrl.getCodeName())} <#if ctrl.getPSSysCss()??> ${ctrl.getPSSysCss().getCssName()}</#if>' :style="{<#if (ctrl.getHeight?? && ctrl.getHeight() gt 0)>'height': isAdaptiveSize ? '${portletHeight}' : <#if ctrl.getHeight() == 1>'auto'<#else>'${ctrl.getHeight()?c}px'</#if>,</#if><#if (ctrl.getWidth?? && ctrl.getWidth() gt 0)>'width': isAdaptiveSize ? '${portletWidth}' : '${ctrl.getWidth()?c}px '</#if>}"> <div class='${portletClass} ${srffilepath2(ctrl.getCodeName())} <#if ctrl.getPSSysCss()??> ${ctrl.getPSSysCss().getCssName()}</#if>' :style="{<#if (ctrl.getHeight?? && ctrl.getHeight() gt 0)>'height': isAdaptiveSize ? '${portletHeight}' : <#if ctrl.getHeight() == 0>'auto'<#else>'${ctrl.getHeight()?c}px'</#if>,</#if><#if (ctrl.getWidth?? && ctrl.getWidth() gt 0)>'width': isAdaptiveSize ? '${portletWidth}' : '${ctrl.getWidth()?c}px '</#if>}">
<#if ctrl.getPortletType?? && ctrl.getPortletType()??><#t> <#if ctrl.getPortletType?? && ctrl.getPortletType()??><#t>
<#-- 视图 --> <#-- 视图 -->
<#if ctrl.getPortletType() == 'VIEW' && ctrl.getPortletPSAppView?? && ctrl.getPortletPSAppView()??><#t> <#if ctrl.getPortletType() == 'VIEW' && ctrl.getPortletPSAppView?? && ctrl.getPortletPSAppView()??><#t>
......
...@@ -38,7 +38,7 @@ import view_${subctrl.getName()} from '@widgets/app/${srffilepath2(subctrl.getCo ...@@ -38,7 +38,7 @@ import view_${subctrl.getName()} from '@widgets/app/${srffilepath2(subctrl.getCo
<#if ctrl.getPSLayoutPanels?? && ctrl.getPSLayoutPanels()??> <#if ctrl.getPSLayoutPanels?? && ctrl.getPSLayoutPanels()??>
<#list ctrl.getPSLayoutPanels() as panel> <#list ctrl.getPSLayoutPanels() as panel>
import layout_${panel.getName()} from '@widgets/${srffilepath2(panel.getPSDataEntity().getCodeName())}/${srffilepath2(panel.getCodeName())}-${panel.getControlType()?lower_case}/${srffilepath2(panel.getCodeName())}-${panel.getControlType()?lower_case}.vue'; import layout_${panel.getName()} from '@widgets/${srffilepath2(panel.getPSAppDataEntity().getCodeName())}/${srffilepath2(panel.getCodeName())}-${panel.getControlType()?lower_case}/${srffilepath2(panel.getCodeName())}-${panel.getControlType()?lower_case}.vue';
</#list> </#list>
</#if> </#if>
<#if import_block??>${import_block}</#if> <#if import_block??>${import_block}</#if>
......
<div class='view-container'> <div class='panel-container'>
<row class="app-layoutpanel"> <row class="app-layoutpanel">
<@ibizindent blank=8> <@ibizindent blank=8>
<#if ctrl.getRootPSPanelItems()??> <#if ctrl.getRootPSPanelItems()??>
......
...@@ -17,10 +17,10 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -17,10 +17,10 @@ import CodeListService from "@service/app/codelist-service";
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
getDatas(): any[] { getDatas(): any[] {
if (!this.data) { if (!this.panelData) {
return []; return [];
} }
return [this.data]; return [this.panelData];
} }
/** /**
...@@ -33,6 +33,14 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -33,6 +33,14 @@ import CodeListService from "@service/app/codelist-service";
return this.data; return this.data;
} }
/**
* 父级部件引用
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
@Prop() public parentRef?: any;
/** /**
* 面板数据对象 * 面板数据对象
* *
...@@ -90,6 +98,14 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -90,6 +98,14 @@ import CodeListService from "@service/app/codelist-service";
*/ */
public data:any = {}; public data:any = {};
/**
* 面板数据对象
*
* @type {*}
* @memberof Mob
*/
public panelData:any = null;
/** /**
* 监听数据对象 * 监听数据对象
* *
...@@ -135,13 +151,46 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -135,13 +151,46 @@ import CodeListService from "@service/app/codelist-service";
} }
} }
/**
* 计算面板数据
*
* @param codelistArray 代码表模型数组
* @memberof Mob
*/
public async computePanelData(){
let codelistArray:Array<any> = [];
let panelData:any = {};
if((this.dataModel.getDataItems instanceof Function) && this.dataModel.getDataItems().length >0){
this.dataModel.getDataItems().forEach((item:any) =>{
if(item.codelist){
codelistArray.push(item.codelist);
}
})
if(codelistArray.length >0){
let res:any = await this.getAllCodeList(codelistArray,true);
this.dataModel.getDataItems().forEach((item:any) =>{
if(item.codelist){
panelData[item.prop] = res.get(item.codelist.tag).get(this.data[item.name]);
}else{
panelData[item.prop] = this.data[item.name];
}
})
}else{
this.dataModel.getDataItems().forEach((item:any) =>{
panelData[item.prop] = this.data[item.name];
})
}
}
this.panelData = Object.assign(JSON.parse(JSON.stringify(this.inputData)),panelData);
}
/** /**
* 获取所有代码表 * 获取所有代码表
* *
* @param codelistArray 代码表模型数组 * @param codelistArray 代码表模型数组
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public getAllCodeList(codelistArray:Array<any>):Promise<any>{ public getAllCodeList(codelistArray:Array<any>,reverse:boolean = false):Promise<any>{
return new Promise((resolve:any,reject:any) =>{ return new Promise((resolve:any,reject:any) =>{
let codeListMap:Map<string,any> = new Map(); let codeListMap:Map<string,any> = new Map();
let promiseArray:Array<any> = []; let promiseArray:Array<any> = [];
...@@ -154,7 +203,11 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -154,7 +203,11 @@ import CodeListService from "@service/app/codelist-service";
let tempCodeListMap:Map<number,any> = new Map(); let tempCodeListMap:Map<number,any> = new Map();
if(codeList.length >0){ if(codeList.length >0){
codeList.forEach((codeListItem:any) =>{ codeList.forEach((codeListItem:any) =>{
if(reverse){
tempCodeListMap.set(codeListItem.text,codeListItem.value);
}else{
tempCodeListMap.set(codeListItem.value,codeListItem.text); tempCodeListMap.set(codeListItem.value,codeListItem.text);
}
}) })
} }
codeListMap.set(item.tag,tempCodeListMap); codeListMap.set(item.tag,tempCodeListMap);
...@@ -194,24 +247,6 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -194,24 +247,6 @@ import CodeListService from "@service/app/codelist-service";
}) })
} }
<#if ctrl.getAllPSPanelItems()??>
<#list ctrl.getAllPSPanelItems() as panelItem>
<#if panelItem.getItemType() == "BUTTON">
/**
* 面板 ${panelItem.getCaption()} 事件
*
* @memberof @memberof ${srfclassname('${ctrl.codeName}')}
*/
public ${panelItem.getName()}_click($event: any): void {
<#if panelItem.getPSUIAction?? && panelItem.getPSUIAction()??>
<#assign uiaction = panelItem.getPSUIAction()>
this.${ctrl.name}_${panelItem.getName()}_click(null, null, $event);
</#if>
}
</#if>
</#list>
</#if>
/** /**
* 界面行为 * 界面行为
* *
...@@ -220,7 +255,8 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -220,7 +255,8 @@ import CodeListService from "@service/app/codelist-service";
* @param {*} $event * @param {*} $event
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public uiAction(row: any, tag: any, $event: any) { public async uiAction(row: any, tag: any, $event: any) {
await this.computePanelData();
<#if ctrl.getPSAppViewLogics()??> <#if ctrl.getPSAppViewLogics()??>
<#list ctrl.getPSAppViewLogics() as logic> <#list ctrl.getPSAppViewLogics() as logic>
<#if logic.getPSAppViewUIAction().getPSUIAction()??> <#if logic.getPSAppViewUIAction().getPSUIAction()??>
...@@ -233,6 +269,55 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -233,6 +269,55 @@ import CodeListService from "@service/app/codelist-service";
</#if> </#if>
} }
/**
* 打开编辑数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public opendata(args: any[],fullargs?:any[],params?: any, $event?: any, xData?: any){
if (this.parentRef.opendata && this.parentRef.opendata instanceof Function) {
this.parentRef.opendata(args,fullargs,params, $event, xData);
}
}
/**
* 打开新建数据视图
*
* @type {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public newdata(args: any[],fullargs?:any[], params?: any, $event?: any, xData?: any) {
if (this.parentRef.newdata && this.parentRef.newdata instanceof Function) {
this.parentRef.newdata(args,fullargs,params, $event, xData);
}
}
/**
* 删除
*
* @param {any[]} datas
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public async remove(datas: any[]): Promise<any> {
if (this.parentRef.remove && this.parentRef.remove instanceof Function) {
return this.parentRef.remove(datas);
}
}
/**
* 刷新
*
* @param {*} [opt={}]
* @memberof Main
*/
public refresh(opt: any = {}) {
if (this.parentRef.refresh && this.parentRef.refresh instanceof Function) {
this.parentRef.refresh(opt);
}
}
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
<#assign content>
:parentRef="thisRef"
</#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/HTML/DEFAULT.html.ftl ../@MACRO/HTML/DEFAULT.html.ftl
</#ibizinclude> </#ibizinclude>
\ No newline at end of file
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
"{ <#t> "{ <#t>
viewname: '${srffilepath2(pickupview.codeName)}'<#t> viewname: '${srffilepath2(pickupview.codeName)}'<#t>
<#if pickupview.isPSDEView()> <#if pickupview.isPSDEView()>
, title: $t('entities.${pickupview.getPSDataEntity().getCodeName()?lower_case}.views.${pickupview.getPSDEViewCodeName()?lower_case}.title')<#t> , title: $t('entities.${pickupview.getPSAppDataEntity().getCodeName()?lower_case}.views.${pickupview.getPSDEViewCodeName()?lower_case}.title')<#t>
<#else> <#else>
, title: $t('app.views.${pickupview.getCodeName()?lower_case}.title')<#t> , title: $t('app.views.${pickupview.getCodeName()?lower_case}.title')<#t>
</#if> </#if>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
"{ <#t> "{ <#t>
viewname: '${linkview.codeName}'<#t> viewname: '${linkview.codeName}'<#t>
<#if linkview.isPSDEView()> <#if linkview.isPSDEView()>
, title: $t('entities.${linkview.getPSDataEntity().getCodeName()?lower_case}.views.${linkview.getPSDEViewCodeName()?lower_case}.title')<#t> , title: $t('entities.${linkview.getPSAppDataEntity().getCodeName()?lower_case}.views.${linkview.getPSDEViewCodeName()?lower_case}.title')<#t>
<#else> <#else>
, title: $t('app.views.${linkview.getCodeName()?lower_case}.title')<#t> , title: $t('app.views.${linkview.getCodeName()?lower_case}.title')<#t>
</#if> </#if>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
, isRedirectView: <#t> , isRedirectView: <#t>
<#if linkview.isRedirectView()> <#if linkview.isRedirectView()>
true<#t> true<#t>
<#assign link_de = linkview.getPSDataEntity()/> <#assign link_de = linkview.getPSAppDataEntity().getPSDataEntity()/>
, url: '/${app.getPKGCodeName()?lower_case}/${link_de.getPSSystemModule().codeName?lower_case}/${link_de.codeName?lower_case}/${linkview.getPSDEViewCodeName()?lower_case}/getmodel'<#t> , url: '/${app.getPKGCodeName()?lower_case}/${link_de.getPSSystemModule().codeName?lower_case}/${link_de.codeName?lower_case}/${linkview.getPSDEViewCodeName()?lower_case}/getmodel'<#t>
<#else><#t> <#else><#t>
false<#t> false<#t>
...@@ -123,9 +123,6 @@ ...@@ -123,9 +123,6 @@
<#if currentItem.getParamJOString?? && currentItem.getParamJOString()??> <#if currentItem.getParamJOString?? && currentItem.getParamJOString()??>
param:${editor.getParamJOString()},<#t> param:${editor.getParamJOString()},<#t>
</#if> </#if>
<#if currentItem.getEditorParam('PARENTDATA','') != ''>
parentdata:${currentItem.getEditorParam('PARENTDATA','')?replace("'", "\"")}, <#t>
</#if>
}' <#t> }' <#t>
</#macro> </#macro>
<#-- END:获取AC参数 --> <#-- END:获取AC参数 -->
\ No newline at end of file
<dropdown-list-dynamic v-model="data.${editor.name}" :data="data" :itemParam="<#if item.getEditorParam('PARENTDATA','') != ''>{parentdata:${item.getEditorParam('PARENTDATA','')}}<#else>{}</#if>" :disabled="detailsModel.${editor.name}.disabled" <#if editor.getPSCodeList()??><#assign codelist=editor.getPSCodeList()>tag='${codelist.codeName}' codelistType='${codelist.getCodeListType()}'</#if> placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if> style="${editor.getEditorCssStyle()}"></dropdown-list-dynamic> <dropdown-list-dynamic
\ No newline at end of file v-model="data.${editor.name}"
:data="data"
:context="context"
:viewparams="viewparams"
:itemParam="<#if item.getEditorParam('ITEMPARAM','') != ''>${item.getEditorParam('ITEMPARAM','')}<#else>{}</#if>"
:disabled="detailsModel.${editor.name}.disabled"
<#if editor.getPSCodeList()??>
<#assign codelist=editor.getPSCodeList()>
tag='${codelist.codeName}'
codelistType='${codelist.getCodeListType()}'
</#if>
placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if> style="${editor.getEditorCssStyle()}">
</dropdown-list-dynamic>
\ No newline at end of file
<dropdown-list v-model="data.${editor.name}" :data="data" :itemParam="<#if item.getEditorParam('PARENTDATA','') != ''>{parentdata:${item.getEditorParam('PARENTDATA','')}}<#else>{}</#if>" :disabled="detailsModel.${editor.name}.disabled" <#if editor.getPSCodeList()??><#assign codelist=editor.getPSCodeList()>tag='${codelist.codeName}' codelistType='${codelist.getCodeListType()}'</#if> placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if> style="${editor.getEditorCssStyle()}"></dropdown-list> <dropdown-list
\ No newline at end of file v-model="data.${editor.name}"
:data="data"
:context="context"
:viewparams="viewparams"
:itemParam="<#if item.getEditorParam('ITEMPARAM','') != ''>${item.getEditorParam('ITEMPARAM','')}<#else>{}</#if>"
:disabled="detailsModel.${editor.name}.disabled"
<#if editor.getPSCodeList()??>
<#assign codelist=editor.getPSCodeList()>
tag='${codelist.codeName}'
codelistType='${codelist.getCodeListType()}'
</#if>
placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if> style="${editor.getEditorCssStyle()}">
</dropdown-list>
\ No newline at end of file
<dropdown-list v-model="data.${editor.name}" :data="data" :itemParam="<#if item.getEditorParam('PARENTDATA','') != ''>{parentdata:${item.getEditorParam('PARENTDATA','')}}<#else>{}</#if>" :disabled="detailsModel.${editor.name}.disabled" style="${editor.getEditorCssStyle()}width: 100px;" <#if editor.getPSCodeList()??><#assign codelist=editor.getPSCodeList()>tag='${codelist.codeName}' codelistType='${codelist.getCodeListType()}'</#if> placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if>></dropdown-list> <dropdown-list
\ No newline at end of file v-model="data.${editor.name}"
:data="data"
:context="context"
:viewparams="viewparams"
:itemParam="<#if item.getEditorParam('ITEMPARAM','') != ''>${item.getEditorParam('ITEMPARAM','')}<#else>{}</#if>"
:disabled="detailsModel.${editor.name}.disabled"
style="${editor.getEditorCssStyle()}width: 100px;"
<#if editor.getPSCodeList()??>
<#assign codelist=editor.getPSCodeList()>
tag='${codelist.codeName}'
codelistType='${codelist.getCodeListType()}'
</#if>
placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if>>
</dropdown-list>
\ No newline at end of file
<dropdown-list-mpicker v-model="data.${editor.name}" :itemParam="<#if item.getEditorParam('PARENTDATA','') != ''>{parentdata:${item.getEditorParam('PARENTDATA','')}}<#else>{}</#if>" :disabled="detailsModel.${editor.name}.disabled" <#if editor.getPSCodeList()??><#assign codelist=editor.getPSCodeList()>tag='${codelist.codeName}' codelistType='${codelist.getCodeListType()}' <#if codelist.valueSeparator?has_content>valueSeparator="${codelist.valueSeparator}"</#if></#if> placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if> style="${editor.getEditorCssStyle()}"></dropdown-list-mpicker> <dropdown-list-mpicker
\ No newline at end of file v-model="data.${editor.name}"
:data="data"
:context="context"
:viewparams="viewparams"
:itemParam="<#if item.getEditorParam('ITEMPARAM','') != ''>${item.getEditorParam('ITEMPARAM','')}<#else>{}</#if>" :disabled="detailsModel.${editor.name}.disabled"
<#if editor.getPSCodeList()??>
<#assign codelist=editor.getPSCodeList()>
tag='${codelist.codeName}'
codelistType='${codelist.getCodeListType()}'
<#if codelist.valueSeparator?has_content>
valueSeparator="${codelist.valueSeparator}"
</#if>
</#if>
placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if> style="${editor.getEditorCssStyle()}">
</dropdown-list-mpicker>
\ No newline at end of file
<dropdown-list-mpicker <dropdown-list-mpicker
v-model="row[column.property]" v-model="row[column.property]"
:itemParam="<#if item.getEditorParam('PARENTDATA','') != ''>{parentdata:${item.getEditorParam('PARENTDATA','')}}<#else>{}</#if>" :itemParam="<#if item.getEditorParam('ITEMPARAM','') != ''>${item.getEditorParam('ITEMPARAM','')}<#else>{}</#if>"
:disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1"
<#if item.getPSCodeList()??> <#if item.getPSCodeList()??>
<#assign codelist=editor.getPSCodeList()> <#assign codelist=editor.getPSCodeList()>
......
<app-radio-group v-model="data.${editor.name}" :disabled="detailsModel.${editor.name}.disabled" name="${editor.name}" <#if editor.getPSCodeList()??><#assign codelist=editor.getPSCodeList()>tag='${codelist.codeName}' codelistType='${codelist.getCodeListType()}' </#if> style="${editor.getEditorCssStyle()}"></app-radio-group> <app-radio-group
\ No newline at end of file v-model="data.${editor.name}"
:data="data"
:context="context"
:viewparams="viewparams"
:disabled="detailsModel.${editor.name}.disabled"
name="${editor.name}"
:itemParam="<#if item.getEditorParam('ITEMPARAM','') != ''>${item.getEditorParam('ITEMPARAM','')}<#else>{}</#if>"
<#if editor.getPSCodeList()??>
<#assign codelist=editor.getPSCodeList()>
tag='${codelist.codeName}'
codelistType='${codelist.getCodeListType()}'
</#if>
style="${editor.getEditorCssStyle()}">
</app-radio-group>
\ No newline at end of file
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
name="${editor.name}" name="${editor.name}"
:context="context" :context="context"
:viewparams="viewparams" :viewparams="viewparams"
:itemParam=<@getItemParams editor />
:service="service" :service="service"
<#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??> <#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??>
deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}' deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}'
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
name="${editor.name}" name="${editor.name}"
:context="context" :context="context"
:viewparams="viewparams" :viewparams="viewparams"
:itemParam=<@getItemParams editor />
:service="service" :service="service"
<#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??> <#if editor.getPSAppDataEntity?? && editor.getPSAppDataEntity()??>
deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}' deMajorField='${editor.getPSAppDataEntity().getMajorPSAppDEField().getCodeName()?lower_case}'
......
...@@ -15,5 +15,9 @@ ...@@ -15,5 +15,9 @@
textSeparator="${codelist.textSeparator}" <#t> textSeparator="${codelist.textSeparator}" <#t>
</#if> </#if>
</#if> </#if>
:data="data"
:context="context"
:viewparams="viewparams"
:itemParam="<#if item.getEditorParam('ITEMPARAM','') != ''>${item.getEditorParam('ITEMPARAM','')}<#else>{}</#if>"
style="${editor.getEditorCssStyle()}"><#t> style="${editor.getEditorCssStyle()}"><#t>
</app-span><#lt> </app-span><#lt>
\ No newline at end of file
...@@ -15,5 +15,9 @@ ...@@ -15,5 +15,9 @@
textSeparator="${codelist.textSeparator}" <#t> textSeparator="${codelist.textSeparator}" <#t>
</#if> </#if>
</#if> </#if>
:data="data"
:context="context"
:viewparams="viewparams"
:itemParam="<#if item.getEditorParam('ITEMPARAM','') != ''>${item.getEditorParam('ITEMPARAM','')}<#else>{}</#if>"
style="${editor.getEditorCssStyle()}"><#t> style="${editor.getEditorCssStyle()}"><#t>
</app-span><#lt> </app-span><#lt>
\ No newline at end of file
<app-checkbox-list v-model="data.${editor.name}" :disabled="detailsModel.${editor.name}.disabled" <#if editor.getPSCodeList()??><#assign codelist=editor.getPSCodeList()>tag='${codelist.codeName}' codelistType='${codelist.getCodeListType()}' <#if codelist.valueSeparator?has_content>valueSeparator="${codelist.valueSeparator}"</#if> mode="${codelist.getOrMode()?lower_case}"</#if> name="${editor.name}" style="${editor.getEditorCssStyle()}"></app-checkbox-list> <app-checkbox-list
\ No newline at end of file v-model="data.${editor.name}"
:data="data"
:context="context"
:viewparams="viewparams"
:disabled="detailsModel.${editor.name}.disabled"
:itemParam="<#if item.getEditorParam('ITEMPARAM','') != ''>${item.getEditorParam('ITEMPARAM','')}<#else>{}</#if>"
<#if editor.getPSCodeList()??>
<#assign codelist=editor.getPSCodeList()>
tag='${codelist.codeName}'
codelistType='${codelist.getCodeListType()}'
<#if codelist.valueSeparator?has_content>
valueSeparator="${codelist.valueSeparator}"
</#if>
mode="${codelist.getOrMode()?lower_case}"
</#if>
name="${editor.name}"
style="${editor.getEditorCssStyle()}">
</app-checkbox-list>
\ No newline at end of file
...@@ -298,7 +298,7 @@ ${front_block} ...@@ -298,7 +298,7 @@ ${front_block}
window.open(url, '_blank'); window.open(url, '_blank');
return null; return null;
} }
<#assign dataview_de = dataview.getPSDataEntity()/> <#assign dataview_de = dataview.getPSAppDataEntity().getPSDataEntity()/>
const url: string = '/${app.getPKGCodeName()?lower_case}/${dataview_de.getPSSystemModule().codeName?lower_case}/${dataview_de.codeName?lower_case}/${dataview.getPSDEViewCodeName()?lower_case}/getmodel'; const url: string = '/${app.getPKGCodeName()?lower_case}/${dataview_de.getPSSystemModule().codeName?lower_case}/${dataview_de.codeName?lower_case}/${dataview.getPSDEViewCodeName()?lower_case}/getmodel';
actionContext.$http.get(url, data).then((response: any) => { actionContext.$http.get(url, data).then((response: any) => {
if (!response || response.status !== 200) { if (!response || response.status !== 200) {
......
...@@ -94,6 +94,10 @@ ...@@ -94,6 +94,10 @@
data.srfsourcekey = args[0].srfsourcekey; data.srfsourcekey = args[0].srfsourcekey;
} }
let curViewParam = JSON.parse(JSON.stringify(this.context)); let curViewParam = JSON.parse(JSON.stringify(this.context));
<#if dataview.isPSDEView()>
<#assign appDataEntity = dataview.getPSAppDataEntity()/>
delete curViewParam.${appDataEntity.getCodeName()?lower_case};
</#if>
if(args.length >0){ if(args.length >0){
Object.assign(curViewParam,args[0]); Object.assign(curViewParam,args[0]);
} }
......
<#macro getViewLanguageTitle tempView> <#macro getViewLanguageTitle tempView>
<#if tempView.isPSDEView()> <#if tempView.isPSDEView()>
$t('entities.${tempView.getPSDataEntity().getCodeName()?lower_case}.views.${tempView.getPSDEViewCodeName()?lower_case}.title')<#t> $t('entities.${tempView.getPSAppDataEntity().getCodeName()?lower_case}.views.${tempView.getPSDEViewCodeName()?lower_case}.title')<#t>
<#else> <#else>
$t('app.views.${tempView.getCodeName()?lower_case}.title')<#t> $t('app.views.${tempView.getCodeName()?lower_case}.title')<#t>
</#if> </#if>
......
...@@ -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()?? && 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>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<#assign import_block> <#assign import_block>
import CodeListService from "@service/app/codelist-service"; import CodeListService from "@service/app/codelist-service";
<#if view.getPSSysCounterRef?? && view.getPSSysCounterRef() ?? && view.getPSSysCounterRef().getPSAppCounter()??> <#if view.getPSSysCounterRef?? && view.getPSSysCounterRef()?? && view.getPSSysCounterRef().getPSAppCounter()??>
<#assign appCounter = view.getPSSysCounterRef().getPSAppCounter() /> <#assign appCounter = view.getPSSysCounterRef().getPSAppCounter() />
import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/counter/${srffilepath2(appCounter.getCodeName())}/${srffilepath2(appCounter.getCodeName())}-counter'; import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/counter/${srffilepath2(appCounter.getCodeName())}/${srffilepath2(appCounter.getCodeName())}-counter';
</#if> </#if>
...@@ -48,7 +48,7 @@ if(this.formDruipart){ ...@@ -48,7 +48,7 @@ if(this.formDruipart){
public isSingleSelect: boolean = ${grid.isSingleSelect()?c}; public isSingleSelect: boolean = ${grid.isSingleSelect()?c};
</#if> </#if>
<#if view.getPSSysCounterRef?? && view.getPSSysCounterRef() ?? && view.getPSSysCounterRef().getPSAppCounter()??> <#if view.getPSSysCounterRef?? && view.getPSSysCounterRef?? && view.getPSSysCounterRef()?? && view.getPSSysCounterRef().getPSAppCounter()??>
<#assign appCounter = view.getPSSysCounterRef().getPSAppCounter() /> <#assign appCounter = view.getPSSysCounterRef().getPSAppCounter() />
/** /**
* ${srfclassname('${appCounter.getCodeName()}')}CounterService计数器服务对象 * ${srfclassname('${appCounter.getCodeName()}')}CounterService计数器服务对象
......
...@@ -51,7 +51,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co ...@@ -51,7 +51,7 @@ import ${srfclassname('${appCounter.getCodeName()}')}CounterService from '@/co
} }
} }
<#if view.getPSSysCounterRef() ?? && view.getPSSysCounterRef().getPSAppCounter()??> <#if view.getPSSysCounterRef?? && view.getPSSysCounterRef()?? && view.getPSSysCounterRef().getPSAppCounter()??>
<#assign appCounter = view.getPSSysCounterRef().getPSAppCounter() /> <#assign appCounter = view.getPSSysCounterRef().getPSAppCounter() />
/** /**
* ${srfclassname('${appCounter.getCodeName()}')}CounterService计数器服务对象 * ${srfclassname('${appCounter.getCodeName()}')}CounterService计数器服务对象
......
...@@ -3,14 +3,233 @@ ...@@ -3,14 +3,233 @@
../@MACRO/LAYOUTPANEL_VIEW.template.ftl ../@MACRO/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>
../@MACRO/VIEW_HEADER-BASE.vue.ftl ../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
<#assign mounted_block>
<#if view.isEnableQuickGroup()>_this.loadQuickGroupModel();</#if>
</#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/VIEW_CONTENT-BASE.vue.ftl ../@MACRO/VIEW_CONTENT-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
/**
* 搜索值
*
* @type {string}
* @memberof ${srfclassname('${view.name}')}
*/
public query: string = '';
/**
* 是否展开搜索表单
*
* @type {boolean}
* @memberof ${srfclassname('${view.name}')}
*/
public isExpandSearchForm: boolean = ${view.isExpandSearchForm()?c};
/**
* 快速搜索
*
* @param {*} $event
* @memberof ${srfclassname('${view.name}')}
*/
public onSearch($event: any): void {
const refs: any = this.$refs;
if (refs.calendar) {
refs.calendar.refresh();
}
}
/**
* calendar 的 beforeload 事件
*
* @param {*} arg
* @memberof ${srfclassname('${view.name}')}
*/
public onBeforeLoad(arg: any){
let _this:any = this;
if (_this.viewparams && Object.keys(_this.viewparams).length > 0) {
Object.assign(arg, _this.viewparams);
}
if (_this.$refs.searchform && _this.isExpandSearchForm) {
Object.assign(arg, _this.$refs.searchform.getData());
}
if (_this && !_this.isExpandSearchForm) {
Object.assign(arg, { query: _this.query });
}
// 快速分组和快速搜索栏
let otherQueryParam:any = {};
if(_this && (_this.qucikGroupData as any)){
Object.assign(otherQueryParam,_this.qucikGroupData);
}
if(_this && _this.qucikFormData){
Object.assign(otherQueryParam,_this.qucikFormData);
}
Object.assign(arg,{viewparams:otherQueryParam});
}
/**
* searchform 部件 search 事件
*
* @param {*} $event
* @memberof ${srfclassname('${view.name}')}
*/
public searchform_search($event: any) {
this.onSearch($event);
}
/**
* searchform 部件 load 事件
*
* @param {*} $event
* @memberof ${srfclassname('${view.name}')}
*/
public searchform_load($event: any) {
this.onSearch($event);
}
<#if view.getPSSysCounterRef?? && 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>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl ../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
...@@ -3,6 +3,14 @@ ...@@ -3,6 +3,14 @@
../@MACRO/LAYOUTPANEL_VIEW.template.ftl ../@MACRO/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>
../@MACRO/VIEW_HEADER-BASE.vue.ftl ../@MACRO/VIEW_HEADER-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
...@@ -12,7 +12,7 @@ Vue.use(Router); ...@@ -12,7 +12,7 @@ Vue.use(Router);
{ {
path: '<#if !isIncludeIndex>/</#if>appdataredirectview/:appdataredirectview?', path: '<#if !isIncludeIndex>/</#if>appdataredirectview/:appdataredirectview?',
meta: { meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>', caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
<#if subView.getPSSysImage()??> <#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}', imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}', iconCls: '${subView.getPSSysImage().getCssClass()}',
...@@ -30,7 +30,7 @@ Vue.use(Router); ...@@ -30,7 +30,7 @@ Vue.use(Router);
{ {
path: '<#if !isIncludeIndex>/</#if>appwfdataredirectview/:appwfdataredirectview?', path: '<#if !isIncludeIndex>/</#if>appwfdataredirectview/:appwfdataredirectview?',
meta: { meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>', caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
<#if subView.getPSSysImage()??> <#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}', imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}', iconCls: '${subView.getPSSysImage().getCssClass()}',
...@@ -48,7 +48,7 @@ Vue.use(Router); ...@@ -48,7 +48,7 @@ Vue.use(Router);
{ {
path: '<#if !isIncludeIndex>/</#if>${subView.getViewType()?lower_case}/:${subView.getViewType()?lower_case}?', path: '<#if !isIncludeIndex>/</#if>${subView.getViewType()?lower_case}/:${subView.getViewType()?lower_case}?',
meta: { meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>', caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
<#if subView.getPSSysImage()??> <#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}', imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}', iconCls: '${subView.getPSSysImage().getCssClass()}',
...@@ -66,7 +66,7 @@ Vue.use(Router); ...@@ -66,7 +66,7 @@ Vue.use(Router);
{ {
path: '<#if !isIncludeIndex>/</#if>${subView.getCodeName()?lower_case}/:${subView.getCodeName()?lower_case}?', path: '<#if !isIncludeIndex>/</#if>${subView.getCodeName()?lower_case}/:${subView.getCodeName()?lower_case}?',
meta: { meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>', caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
<#if subView.getPSSysImage()??> <#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}', imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}', iconCls: '${subView.getPSSysImage().getCssClass()}',
...@@ -102,7 +102,7 @@ Vue.use(Router); ...@@ -102,7 +102,7 @@ Vue.use(Router);
path: '/${path}${srfpluralize(appDataEntity.codeName)?lower_case}/:${appDataEntity.getCodeName()?lower_case}?/${subView.getPSDEViewCodeName()?lower_case}/:${subView.getPSDEViewCodeName()?lower_case}?', path: '/${path}${srfpluralize(appDataEntity.codeName)?lower_case}/:${appDataEntity.getCodeName()?lower_case}?/${subView.getPSDEViewCodeName()?lower_case}/:${subView.getPSDEViewCodeName()?lower_case}?',
<#-- 嵌入关系路由未设置name属性 --> <#-- 嵌入关系路由未设置name属性 -->
meta: { meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>', caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
<#if subView.getPSSysImage()??> <#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}', imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}', iconCls: '${subView.getPSSysImage().getCssClass()}',
...@@ -125,7 +125,7 @@ Vue.use(Router); ...@@ -125,7 +125,7 @@ Vue.use(Router);
{ {
path: '/${srfpluralize(appDataEntity.codeName)?lower_case}/:${appDataEntity.getCodeName()?lower_case}?/${subView.getPSDEViewCodeName()?lower_case}/:${subView.getPSDEViewCodeName()?lower_case}?', path: '/${srfpluralize(appDataEntity.codeName)?lower_case}/:${appDataEntity.getCodeName()?lower_case}?/${subView.getPSDEViewCodeName()?lower_case}/:${subView.getPSDEViewCodeName()?lower_case}?',
meta: { meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>', caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
<#if subView.getPSSysImage()??> <#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}', imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}', iconCls: '${subView.getPSSysImage().getCssClass()}',
...@@ -142,7 +142,7 @@ Vue.use(Router); ...@@ -142,7 +142,7 @@ Vue.use(Router);
{ {
path: '/${subView.getCodeName()?lower_case}/:${subView.getCodeName()?lower_case}?', path: '/${subView.getCodeName()?lower_case}/:${subView.getCodeName()?lower_case}?',
meta: { meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>', caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
<#if subView.getPSSysImage()??> <#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}', imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}', iconCls: '${subView.getPSSysImage().getCssClass()}',
...@@ -182,7 +182,7 @@ const router = new Router({ ...@@ -182,7 +182,7 @@ const router = new Router({
}); });
}, },
meta: { meta: {
caption: '<#if view.isPSDEView()>entities.${view.getPSDataEntity().getCodeName()?lower_case}.views.${view.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${view.getCodeName()?lower_case}.caption</#if>', caption: '<#if view.isPSDEView()>entities.${view.getPSAppDataEntity().getCodeName()?lower_case}.views.${view.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${view.getCodeName()?lower_case}.caption</#if>',
viewType: 'APPINDEX', viewType: 'APPINDEX',
<#if view.getPSSysImage()??> <#if view.getPSSysImage()??>
imgPath: '${view.getPSSysImage().getImagePath()}', imgPath: '${view.getPSSysImage().getImagePath()}',
...@@ -212,7 +212,7 @@ const router = new Router({ ...@@ -212,7 +212,7 @@ const router = new Router({
{ {
path: '${path}${srfpluralize(appDataEntity.codeName)?lower_case}/:${appDataEntity.getCodeName()?lower_case}?/${subView.getPSDEViewCodeName()?lower_case}/:${subView.getPSDEViewCodeName()?lower_case}?', path: '${path}${srfpluralize(appDataEntity.codeName)?lower_case}/:${appDataEntity.getCodeName()?lower_case}?/${subView.getPSDEViewCodeName()?lower_case}/:${subView.getPSDEViewCodeName()?lower_case}?',
meta: { meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>', caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
<#if subView.getPSSysImage()??> <#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}', imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}', iconCls: '${subView.getPSSysImage().getCssClass()}',
...@@ -236,7 +236,7 @@ const router = new Router({ ...@@ -236,7 +236,7 @@ const router = new Router({
{ {
path: '${srfpluralize(appDataEntity.codeName)?lower_case}/:${appDataEntity.getCodeName()?lower_case}?/${subView.getPSDEViewCodeName()?lower_case}/:${subView.getPSDEViewCodeName()?lower_case}?', path: '${srfpluralize(appDataEntity.codeName)?lower_case}/:${appDataEntity.getCodeName()?lower_case}?/${subView.getPSDEViewCodeName()?lower_case}/:${subView.getPSDEViewCodeName()?lower_case}?',
meta: { meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>', caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
<#if subView.getPSSysImage()??> <#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}', imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}', iconCls: '${subView.getPSSysImage().getCssClass()}',
...@@ -254,7 +254,7 @@ const router = new Router({ ...@@ -254,7 +254,7 @@ const router = new Router({
{ {
path: '${subView.getCodeName()?lower_case}/:${subView.getCodeName()?lower_case}?', path: '${subView.getCodeName()?lower_case}/:${subView.getCodeName()?lower_case}?',
meta: { meta: {
caption: '<#if subView.isPSDEView()>entities.${subView.getPSDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>', caption: '<#if subView.isPSDEView()>entities.${subView.getPSAppDataEntity().getCodeName()?lower_case}.views.${subView.getPSDEViewCodeName()?lower_case}.caption<#else>app.views.${subView.getCodeName()?lower_case}.caption</#if>',
<#if subView.getPSSysImage()??> <#if subView.getPSSysImage()??>
imgPath: '${subView.getPSSysImage().getImagePath()}', imgPath: '${subView.getPSSysImage().getImagePath()}',
iconCls: '${subView.getPSSysImage().getCssClass()}', iconCls: '${subView.getPSSysImage().getCssClass()}',
......
...@@ -24,6 +24,8 @@ export const Environment = { ...@@ -24,6 +24,8 @@ export const Environment = {
uniteAddress: "http://172.16.100.202:8114", uniteAddress: "http://172.16.100.202:8114",
// 是否为开发模式 // 是否为开发模式
devMode: true, devMode: true,
// 是否开启权限认证
enablePermissionValid:false,
// 项目模板地址 // 项目模板地址
ProjectUrl: "http://demo.ibizlab.cn/ibizr7pfstdtempl/ibizvuer7plus", ProjectUrl: "http://demo.ibizlab.cn/ibizr7pfstdtempl/ibizvuer7plus",
// 配置平台地址 // 配置平台地址
......
...@@ -3,7 +3,7 @@ TARGET=PSSYSAPP ...@@ -3,7 +3,7 @@ TARGET=PSSYSAPP
</#ibiztemplate> </#ibiztemplate>
<#ibizinclude>../@MACRO/FUNC.ts</#ibizinclude> <#ibizinclude>../@MACRO/FUNC.ts</#ibizinclude>
<#list app.getAllPSAppDataEntities() as dataEntitey> <#list app.getAllPSAppDataEntities() as dataEntitey>
import ${dataEntitey.getCodeName()?lower_case}_en_US from '@locale/lanres/${srffilepath2(dataEntitey.getCodeName())}/${srffilepath2(dataEntitey.getCodeName())}_en_US'; import ${dataEntitey.getCodeName()?lower_case}_en_US from '@locale/lanres/entities/${srffilepath2(dataEntitey.getCodeName())}/${srffilepath2(dataEntitey.getCodeName())}_en_US';
</#list> </#list>
import components_en_US from '@locale/lanres/components/components_en_US'; import components_en_US from '@locale/lanres/components/components_en_US';
import codelist_en_US from '@locale/lanres/codelist/codelist_en_US'; import codelist_en_US from '@locale/lanres/codelist/codelist_en_US';
......
...@@ -3,7 +3,7 @@ TARGET=PSSYSAPP ...@@ -3,7 +3,7 @@ TARGET=PSSYSAPP
</#ibiztemplate> </#ibiztemplate>
<#ibizinclude>../@MACRO/FUNC.ts</#ibizinclude> <#ibizinclude>../@MACRO/FUNC.ts</#ibizinclude>
<#list app.getAllPSAppDataEntities() as dataEntitey> <#list app.getAllPSAppDataEntities() as dataEntitey>
import ${dataEntitey.getCodeName()?lower_case}_zh_CN from '@locale/lanres/${srffilepath2(dataEntitey.getCodeName())}/${srffilepath2(dataEntitey.getCodeName())}_zh_CN'; import ${dataEntitey.getCodeName()?lower_case}_zh_CN from '@locale/lanres/entities/${srffilepath2(dataEntitey.getCodeName())}/${srffilepath2(dataEntitey.getCodeName())}_zh_CN';
</#list> </#list>
import components_zh_CN from '@locale/lanres/components/components_zh_CN'; import components_zh_CN from '@locale/lanres/components/components_zh_CN';
import codelist_zh_CN from '@locale/lanres/codelist/codelist_zh_CN'; import codelist_zh_CN from '@locale/lanres/codelist/codelist_zh_CN';
......
<#ibiztemplate> <#ibiztemplate>
TARGET=PSAPPDATAENTITY TARGET=PSAPPDATAENTITY
</#ibiztemplate> </#ibiztemplate>
<#ibizinclude>../../@MACRO/FUNC.ts</#ibizinclude> <#ibizinclude>../../../@MACRO/FUNC.ts</#ibizinclude>
<#assign langrestype = 'EN'/> <#assign langrestype = 'EN'/>
export default { export default {
...@@ -18,7 +18,7 @@ export default { ...@@ -18,7 +18,7 @@ export default {
views: { views: {
<#list item.getAllPSAppViews() as obj> <#list item.getAllPSAppViews() as obj>
${obj.getPSDEViewCodeName()?lower_case}: { ${obj.getPSDEViewCodeName()?lower_case}: {
caption: "<#ibizinclude>../../@MACRO/CAPTIONLANG.ts</#ibizinclude>", caption: "<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>",
title: '<@getTitleLanguage obj langrestype />', title: '<@getTitleLanguage obj langrestype />',
}, },
</#list> </#list>
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
<#if ctrl.getControlType() == 'FORM' || ctrl.getControlType() == 'SEARCHFORM'> <#if ctrl.getControlType() == 'FORM' || ctrl.getControlType() == 'SEARCHFORM'>
details: { details: {
<#list ctrl.getAllPSDEFormDetails() as obj> <#list ctrl.getAllPSDEFormDetails() as obj>
${obj.name?lower_case}: "<#ibizinclude>../../@MACRO/CAPTIONLANG.ts</#ibizinclude>", ${obj.name?lower_case}: "<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>",
</#list> </#list>
}, },
</#if> </#if>
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
columns: { columns: {
<#if ctrl.getAllPSDEGridColumns()??> <#if ctrl.getAllPSDEGridColumns()??>
<#list ctrl.getAllPSDEGridColumns() as obj> <#list ctrl.getAllPSDEGridColumns() as obj>
${obj.getName()?lower_case}: "<#ibizinclude>../../@MACRO/CAPTIONLANG.ts</#ibizinclude>", ${obj.getName()?lower_case}: "<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>",
</#list> </#list>
</#if> </#if>
}, },
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
exportColumns: { exportColumns: {
<#if ctrl.getPSDEDataExport().getPSDEDataExportItems()??> <#if ctrl.getPSDEDataExport().getPSDEDataExportItems()??>
<#list ctrl.getPSDEDataExport().getPSDEDataExportItems() as obj> <#list ctrl.getPSDEDataExport().getPSDEDataExportItems() as obj>
${obj.getName()?lower_case}: "<#ibizinclude>../../@MACRO/CAPTIONLANG.ts</#ibizinclude>", ${obj.getName()?lower_case}: "<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>",
</#list> </#list>
</#if> </#if>
}, },
...@@ -72,8 +72,8 @@ export default { ...@@ -72,8 +72,8 @@ export default {
<#if ctrl.getAllPSDEToolbarItems()??> <#if ctrl.getAllPSDEToolbarItems()??>
<#list ctrl.getAllPSDEToolbarItems() as obj> <#list ctrl.getAllPSDEToolbarItems() as obj>
${obj.getName()?lower_case}: { ${obj.getName()?lower_case}: {
caption: "<#ibizinclude>../../@MACRO/CAPTIONLANG.ts</#ibizinclude>", caption: "<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>",
tip: "<#ibizinclude>../../@MACRO/TIPLANG.ts</#ibizinclude>", tip: "<#ibizinclude>../../../@MACRO/TIPLANG.ts</#ibizinclude>",
}, },
</#list> </#list>
</#if> </#if>
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
<#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??> <#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??>
uiactions: { uiactions: {
<#list ctrl.getPSUIActions() as obj> <#list ctrl.getPSUIActions() as obj>
${obj.getUIActionTag()?lower_case}: "<#ibizinclude>../../@MACRO/CAPTIONLANG.ts</#ibizinclude>", ${obj.getUIActionTag()?lower_case}: "<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>",
</#list> </#list>
}, },
</#if> </#if>
......
<#ibiztemplate> <#ibiztemplate>
TARGET=PSAPPDATAENTITY TARGET=PSAPPDATAENTITY
</#ibiztemplate> </#ibiztemplate>
<#ibizinclude>../../@MACRO/FUNC.ts</#ibizinclude> <#ibizinclude>../../../@MACRO/FUNC.ts</#ibizinclude>
<#assign langrestype = 'ZH_CN'/> <#assign langrestype = 'ZH_CN'/>
export default { export default {
<#-- 实体属性输出 --> <#-- 实体属性输出 -->
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
views: { views: {
<#list item.getAllPSAppViews() as obj> <#list item.getAllPSAppViews() as obj>
${obj.getPSDEViewCodeName()?lower_case}: { ${obj.getPSDEViewCodeName()?lower_case}: {
caption: '<#ibizinclude>../../@MACRO/CAPTIONLANG.ts</#ibizinclude>', caption: '<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>',
title: '<@getTitleLanguage obj langrestype />', title: '<@getTitleLanguage obj langrestype />',
}, },
</#list> </#list>
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
<#if ctrl.getControlType() == 'FORM' || ctrl.getControlType() == 'SEARCHFORM'> <#if ctrl.getControlType() == 'FORM' || ctrl.getControlType() == 'SEARCHFORM'>
details: { details: {
<#list ctrl.getAllPSDEFormDetails() as obj> <#list ctrl.getAllPSDEFormDetails() as obj>
${obj.name?lower_case}: '<#ibizinclude>../../@MACRO/CAPTIONLANG.ts</#ibizinclude>', ${obj.name?lower_case}: '<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>',
</#list> </#list>
}, },
</#if> </#if>
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
columns: { columns: {
<#if ctrl.getAllPSDEGridColumns()??> <#if ctrl.getAllPSDEGridColumns()??>
<#list ctrl.getAllPSDEGridColumns() as obj> <#list ctrl.getAllPSDEGridColumns() as obj>
${obj.getName()?lower_case}: '<#ibizinclude>../../@MACRO/CAPTIONLANG.ts</#ibizinclude>', ${obj.getName()?lower_case}: '<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>',
</#list> </#list>
</#if> </#if>
}, },
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
exportColumns: { exportColumns: {
<#if ctrl.getPSDEDataExport().getPSDEDataExportItems()??> <#if ctrl.getPSDEDataExport().getPSDEDataExportItems()??>
<#list ctrl.getPSDEDataExport().getPSDEDataExportItems() as obj> <#list ctrl.getPSDEDataExport().getPSDEDataExportItems() as obj>
${obj.getName()?lower_case}: "<#ibizinclude>../../@MACRO/CAPTIONLANG.ts</#ibizinclude>", ${obj.getName()?lower_case}: "<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>",
</#list> </#list>
</#if> </#if>
}, },
...@@ -71,8 +71,8 @@ export default { ...@@ -71,8 +71,8 @@ export default {
<#if ctrl.getAllPSDEToolbarItems()??> <#if ctrl.getAllPSDEToolbarItems()??>
<#list ctrl.getAllPSDEToolbarItems() as obj> <#list ctrl.getAllPSDEToolbarItems() as obj>
${obj.getName()?lower_case}: { ${obj.getName()?lower_case}: {
caption: '<#ibizinclude>../../@MACRO/CAPTIONLANG.ts</#ibizinclude>', caption: '<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>',
tip: '<#ibizinclude>../../@MACRO/TIPLANG.ts</#ibizinclude>', tip: '<#ibizinclude>../../../@MACRO/TIPLANG.ts</#ibizinclude>',
}, },
</#list> </#list>
</#if> </#if>
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
<#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??> <#if ctrl.getPSUIActions?? && ctrl.getPSUIActions()??>
uiactions: { uiactions: {
<#list ctrl.getPSUIActions() as obj> <#list ctrl.getPSUIActions() as obj>
${obj.getUIActionTag()?lower_case}: '<#ibizinclude>../../@MACRO/CAPTIONLANG.ts</#ibizinclude>', ${obj.getUIActionTag()?lower_case}: '<#ibizinclude>../../../@MACRO/CAPTIONLANG.ts</#ibizinclude>',
</#list> </#list>
}, },
</#if> </#if>
......
...@@ -19,13 +19,44 @@ import { Verify } from '@/utils/verify/verify'; ...@@ -19,13 +19,44 @@ import { Verify } from '@/utils/verify/verify';
<#macro setParam logicNode> <#macro setParam logicNode>
<#if logicNode.getPSDELogicNodeParams()??> <#if logicNode.getPSDELogicNodeParams()??>
<#list logicNode.getPSDELogicNodeParams() as logicparam> <#list logicNode.getPSDELogicNodeParams() as logicparam>
<#if logicparam.getSrcFieldName()?? && logicparam.getDstFieldName()??> <#if logicparam.getDstPSDELogicParam()?? && logicparam.getDstFieldName()?? && logicparam.getSrcValueType()??>
Object.assign(params,{${logicparam.getDstFieldName()?lower_case}:<#if logicparam.getSrcFieldName()?? && logicparam.getSrcFieldName() != "">params.${logicparam.getSrcFieldName()?lower_case}<#else>params.${logicparam.getDstFieldName()?lower_case}</#if>}); <#-- 源参数 -->
<#if logicparam.getDstPSDELogicParam?? && logicparam.getDstPSDELogicParam()?? && logicparam.getDstPSDELogicParam().getParamPSAppDataEntity()??> <#if logicparam.getSrcPSDELogicParam()??><#assign srcParam = logicparam.getSrcPSDELogicParam() /></#if>
<#if logicparam.getSrcFieldName()?lower_case?contains("id") > <#-- 源参数属性名称 -->
Object.assign(context,{${logicparam.getDstPSDELogicParam().getParamPSAppDataEntity().getCodeName()?lower_case}:params.${logicparam.getSrcFieldName()?lower_case} ? params.${logicparam.getSrcFieldName()?lower_case} : null}); <#if logicparam.getSrcFieldName()??><#assign srcFieldParam = logicparam.getSrcFieldName()?lower_case /></#if>
<#-- 目标参数 -->
<#assign dstParam = logicparam.getDstPSDELogicParam() />
<#-- 目标参数属性名称 -->
<#assign dstFieldParam = logicparam.getDstFieldName()?lower_case />
<#-- 源逻辑参数 -->
let tempDstParam${logicparam_index}Context:any = this.paramsMap.get('${dstParam.getCodeName()}').context?this.paramsMap.get('${dstParam.getCodeName()}').context:{};
let tempDstParam${logicparam_index}Data:any = this.paramsMap.get('${dstParam.getCodeName()}').data?this.paramsMap.get('${dstParam.getCodeName()}').data:{};
<#if logicparam.getSrcValueType() =="SRCDLPARAM">
let tempSrcParam${logicparam_index}Data:any = this.paramsMap.get('${srcParam.getCodeName()}').data?this.paramsMap.get('${srcParam.getCodeName()}').data:{};
<#if dstParam.getParamPSAppDataEntity?? && dstParam.getParamPSAppDataEntity()?? && dstFieldParam == dstParam.getParamPSAppDataEntity().getKeyPSAppDEField().getCodeName()?lower_case>
Object.assign(tempDstParam${logicparam_index}Context,{${dstParam.getParamPSAppDataEntity().getCodeName()?lower_case}:tempSrcParam${logicparam_index}Data['${srcFieldParam}']});
</#if> </#if>
Object.assign(tempDstParam${logicparam_index}Data,{${dstFieldParam}:tempSrcParam${logicparam_index}Data['${srcFieldParam}']});
<#-- 应用上下文 -->
<#elseif logicparam.getSrcValueType() =="APPDATA">
<#if dstParam.getParamPSAppDataEntity?? && dstParam.getParamPSAppDataEntity()?? && dstFieldParam == dstParam.getParamPSAppDataEntity().getKeyPSAppDEField().getCodeName()?lower_case>
Object.assign(tempDstParam${logicparam_index}Context,{${dstParam.getParamPSAppDataEntity().getCodeName()?lower_case}:context['${srcFieldParam}']});
</#if> </#if>
Object.assign(tempDstParam${logicparam_index}Data,{${dstFieldParam}:context['${srcFieldParam}']});
<#-- 数据上下文 -->
<#elseif logicparam.getSrcValueType() =="DATACONTEXT">
<#if dstParam.getParamPSAppDataEntity?? && dstParam.getParamPSAppDataEntity()?? && dstFieldParam == dstParam.getParamPSAppDataEntity().getKeyPSAppDEField().getCodeName()?lower_case>
Object.assign(tempDstParam${logicparam_index}Context,{${dstParam.getParamPSAppDataEntity().getCodeName()?lower_case}:params['${srcFieldParam}']});
</#if>
Object.assign(tempDstParam${logicparam_index}Data,{${dstFieldParam}:params['${srcFieldParam}']});
<#-- 直接值 -->
<#elseif logicparam.getSrcValueType() =="SRCVALUE">
<#if dstParam.getParamPSAppDataEntity?? && dstParam.getParamPSAppDataEntity()?? && dstFieldParam == dstParam.getParamPSAppDataEntity().getKeyPSAppDEField().getCodeName()?lower_case>
Object.assign(tempDstParam${logicparam_index}Context,{${dstParam.getParamPSAppDataEntity().getCodeName()?lower_case}:${logicparam.getSrcValue()}});
</#if>
Object.assign(tempDstParam${logicparam_index}Data,{${dstFieldParam}:"${logicparam.getSrcValue()}"});
</#if>
this.paramsMap.set('${dstParam.getCodeName()}',{data:tempDstParam${logicparam_index}Data,context:tempDstParam${logicparam_index}Context});
</#if> </#if>
</#list> </#list>
</#if> </#if>
...@@ -48,7 +79,7 @@ import { Verify } from '@/utils/verify/verify'; ...@@ -48,7 +79,7 @@ import { Verify } from '@/utils/verify/verify';
</#if> </#if>
</#list> </#list>
<#else> <#else>
return params; return this.paramsMap.get(this.defaultParamName).data;
</#if> </#if>
</#macro> </#macro>
...@@ -84,6 +115,13 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase { ...@@ -84,6 +115,13 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase {
*/ */
private defaultParamName:string = "${item.getDefaultParamName()}"; private defaultParamName:string = "${item.getDefaultParamName()}";
/**
* 参数集合
*
* @memberof ${srfclassname('${item.getCodeName()}')}LogicBase
*/
private paramsMap:Map<string,any> = new Map();
/** /**
* Creates an instance of ${srfclassname('${item.getCodeName()}')}LogicBase. * Creates an instance of ${srfclassname('${item.getCodeName()}')}LogicBase.
* *
...@@ -91,7 +129,25 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase { ...@@ -91,7 +129,25 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase {
* @memberof ${srfclassname('${item.getCodeName()}')}LogicBase * @memberof ${srfclassname('${item.getCodeName()}')}LogicBase
*/ */
constructor(opts: any = {}) { constructor(opts: any = {}) {
this.initParams(opts);
}
/**
* 初始化参数集合
*
* @param {*} [opts={}]
* @memberof ${srfclassname('${item.getCodeName()}')}LogicBase
*/
public initParams(opts:any){
<#if item.getPSDELogicParams?? && item.getPSDELogicParams()??>
<#list item.getPSDELogicParams() as logicParam>
<#if logicParam.isDefault()>
this.paramsMap.set('${logicParam.getCodeName()}',opts);
<#else>
this.paramsMap.set('${logicParam.getCodeName()}',{});
</#if>
</#list>
</#if>
} }
<#if item.getPSDELogicLinks()??> <#if item.getPSDELogicLinks()??>
...@@ -157,12 +213,17 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase { ...@@ -157,12 +213,17 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase {
<#assign targetEntity = delogicNode.getDstPSAppDataEntity() /> <#assign targetEntity = delogicNode.getDstPSAppDataEntity() />
<#assign deAction = delogicNode.getDstPSAppDEAction() /> <#assign deAction = delogicNode.getDstPSAppDEAction() />
let result: any; let result: any;
<#if delogicNode.getDstPSDELogicParam()??>
let actionParam:any = this.paramsMap.get('${delogicNode.getDstPSDELogicParam().getCodeName()}');
<#else>
let actionParam:any = this.paramsMap.get(this.defaultParamName);
</#if>
const targetService:${srfclassname('${targetEntity.getCodeName()}')}Service = new ${srfclassname('${targetEntity.getCodeName()}')}Service(); const targetService:${srfclassname('${targetEntity.getCodeName()}')}Service = new ${srfclassname('${targetEntity.getCodeName()}')}Service();
if (targetService['${deAction.getCodeName()}'] && targetService['${deAction.getCodeName()}'] instanceof Function) { if (targetService['${deAction.getCodeName()}'] && targetService['${deAction.getCodeName()}'] instanceof Function) {
result = await targetService['${deAction.getCodeName()}'](context,params, false); result = await targetService['${deAction.getCodeName()}'](actionParam.context,actionParam.data, false);
} }
if(result && result.status == 200){ if(result && result.status == 200){
Object.assign(params,result.data); Object.assign(actionParam.data,result.data);
<@executeNext delogicNode /> <@executeNext delogicNode />
} }
</#if> </#if>
...@@ -190,7 +251,7 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase { ...@@ -190,7 +251,7 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase {
*/ */
private async execute${delogicNode.codeName}(context:any,params:any,isloading:boolean){ private async execute${delogicNode.codeName}(context:any,params:any,isloading:boolean){
// 开始流程节点 // 开始流程节点
return params; return this.paramsMap.get(this.defaultParamName).data;
} }
<#-- 异常捕获节点 --> <#-- 异常捕获节点 -->
<#elseif delogicNode.getLogicNodeType()?? && delogicNode.getLogicNodeType() == "THROWEXCEPTION"> <#elseif delogicNode.getLogicNodeType()?? && delogicNode.getLogicNodeType() == "THROWEXCEPTION">
...@@ -202,7 +263,7 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase { ...@@ -202,7 +263,7 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase {
*/ */
private async execute${delogicNode.codeName}(context:any,params:any,isloading:boolean){ private async execute${delogicNode.codeName}(context:any,params:any,isloading:boolean){
// 异常捕获节点 // 异常捕获节点
return params; return this.paramsMap.get(this.defaultParamName).data;
} }
<#-- 前端插件 --> <#-- 前端插件 -->
<#elseif delogicNode.getLogicNodeType()?? && delogicNode.getLogicNodeType() == "PFPLUGIN"> <#elseif delogicNode.getLogicNodeType()?? && delogicNode.getLogicNodeType() == "PFPLUGIN">
...@@ -214,7 +275,7 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase { ...@@ -214,7 +275,7 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase {
*/ */
private async execute${delogicNode.codeName}(context:any,params:any,isloading:boolean){ private async execute${delogicNode.codeName}(context:any,params:any,isloading:boolean){
// 前端插件 // 前端插件
return params; return this.paramsMap.get(this.defaultParamName).data;
} }
<#else> <#else>
/** /**
...@@ -226,7 +287,7 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase { ...@@ -226,7 +287,7 @@ export default class ${srfclassname('${item.getCodeName()}')}LogicBase {
private async execute${delogicNode.codeName}(context:any,params:any,isloading:boolean){ private async execute${delogicNode.codeName}(context:any,params:any,isloading:boolean){
// ${delogicNode.getLogicNodeType()}暂未支持 // ${delogicNode.getLogicNodeType()}暂未支持
console.log("${delogicNode.getLogicNodeType()}暂未支持"); console.log("${delogicNode.getLogicNodeType()}暂未支持");
return params; return this.paramsMap.get(this.defaultParamName).data;
} }
</#if> </#if>
</#list> </#list>
......
...@@ -469,7 +469,7 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends ...@@ -469,7 +469,7 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends
<#assign appdeAction = singleAppMethod.getPSDEAction() /> <#assign appdeAction = singleAppMethod.getPSDEAction() />
<#if appdeAction.getPSDELogic?? && appdeAction.getPSDELogic()?? && (appdeAction.getActionHolder() == 2 || appdeAction.getActionHolder() == 3) > <#if appdeAction.getPSDELogic?? && appdeAction.getPSDELogic()?? && (appdeAction.getActionHolder() == 2 || appdeAction.getActionHolder() == 3) >
<#assign appdelogic = appdeAction.getPSDELogic() /> <#assign appdelogic = appdeAction.getPSDELogic() />
let appLogic:${appdelogic.codeName}Logic = new ${appdelogic.codeName}Logic(); let appLogic:${srfclassname('${appdelogic.getCodeName()}')}Logic = new ${srfclassname('${appdelogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
const result = await appLogic.onExecute(context,data,isloading?true:false); const result = await appLogic.onExecute(context,data,isloading?true:false);
return {status:200,data:result}; return {status:200,data:result};
<#else> <#else>
......
...@@ -50,6 +50,14 @@ export default class CodeListService { ...@@ -50,6 +50,14 @@ export default class CodeListService {
*/ */
public static codelistCache:Map<string,any> = new Map(); public static codelistCache:Map<string,any> = new Map();
/**
* 动态代码表缓存(已完成)
*
* @type {Map<string,any>}
* @memberof CodeListService
*/
public static codelistCached:Map<string,any> = new Map();
<#if app.getAllPSAppCodeLists()??> <#if app.getAllPSAppCodeLists()??>
<#list app.getAllPSAppCodeLists() as codelist> <#list app.getAllPSAppCodeLists() as codelist>
<#if codelist.getCodeListType() == "DYNAMIC"> <#if codelist.getCodeListType() == "DYNAMIC">
...@@ -73,33 +81,24 @@ export default class CodeListService { ...@@ -73,33 +81,24 @@ export default class CodeListService {
* @returns {Promise<any[]>} * @returns {Promise<any[]>}
* @memberof CodeListService * @memberof CodeListService
*/ */
public getItems(tag: string,context:any = {}, data?: any, isloading?: boolean,): Promise<any[]> { <#noparse>public getItems(tag: string,context:any = {}, data?: any, isloading?: boolean,): Promise<any[]> {
let _this: any = this; let _this: any = this;
if(context && context.srfsessionid){
delete context.srfsessionid;
}
let isEnableCache:boolean = _this[tag].isEnableCache; let isEnableCache:boolean = _this[tag].isEnableCache;
let cacheTimeout:any = _this[tag].cacheTimeout; let cacheTimeout:any = _this[tag].cacheTimeout;
return new Promise((resolve:any,reject:any) =>{ return new Promise((resolve:any,reject:any) =>{
// 如有查询参数传递过来,需直接加载,不能使用缓存
if(data && Object.keys(data).length >0){
if (_this[tag]) {
_this[tag].getItems(context,JSON.parse(JSON.stringify(data)),isloading).then((result:any) =>{
resolve(result);
}).catch((error:any) =>{
Promise.reject([]);
})
}else{
return Promise.reject([]);
}
}else{
// 启用缓存 // 启用缓存
if(isEnableCache){ if(isEnableCache){
// 加载完成,从store获取 // 加载完成,从本地缓存获取
if(this.$store && _this.$store.getters){ if(CodeListService.codelistCached.get(`${JSON.stringify(context)}-${JSON.stringify(data)}-${tag}`)){
let items:any = _this.$store.getters.getCodeListItems(tag); let items:any = CodeListService.codelistCached.get(`${JSON.stringify(context)}-${JSON.stringify(data)}-${tag}`);
if(items.length >0){ if(items.length >0){
if(cacheTimeout !== -1){ if(cacheTimeout !== -1){
if(new Date().getTime() > _this[tag].expirationTime){ if(new Date().getTime() > _this[tag].expirationTime){
_this[tag].getItems(context,data,isloading).then((result:any) =>{ _this[tag].getItems(context,data,isloading).then((result:any) =>{
_this.$store.commit('updateCodeList',{srfkey:tag,items:result}); CodeListService.codelistCached.set(`${JSON.stringify(context)}-${JSON.stringify(data)}-${tag}`,{items:result});
_this[tag].expirationTime = new Date().getTime() + cacheTimeout; _this[tag].expirationTime = new Date().getTime() + cacheTimeout;
resolve(result); resolve(result);
}).catch((error:any) =>{ }).catch((error:any) =>{
...@@ -114,10 +113,11 @@ export default class CodeListService { ...@@ -114,10 +113,11 @@ export default class CodeListService {
} }
} }
if (_this[tag]) { if (_this[tag]) {
const callback:Function = (tag:string,promise:Promise<any>) =>{ const callback:Function = (context:any ={},data:any ={},tag:string,promise:Promise<any>) =>{
promise.then((result:any) =>{ promise.then((result:any) =>{
console.log()
if(result.length > 0){ if(result.length > 0){
_this.$store.commit('updateCodeList',{srfkey:tag,items:result}); CodeListService.codelistCached.set(`${JSON.stringify(context)}-${JSON.stringify(data)}-${tag}`,{items:result});
return resolve(result); return resolve(result);
}else{ }else{
return resolve([]); return resolve([]);
...@@ -127,15 +127,15 @@ export default class CodeListService { ...@@ -127,15 +127,15 @@ export default class CodeListService {
}) })
} }
// 加载中,UI又需要数据,解决连续加载同一代码表问题 // 加载中,UI又需要数据,解决连续加载同一代码表问题
if(CodeListService.codelistCache.get(tag)){ if(CodeListService.codelistCache.get(`${JSON.stringify(context)}-${JSON.stringify(data)}-${tag}`)){
callback(tag,CodeListService.codelistCache.get(tag)); callback(context,data,tag,CodeListService.codelistCache.get(`${JSON.stringify(context)}-${JSON.stringify(data)}-${tag}`));
}else{ }else{
let result:Promise<any> = _this[tag].getItems(context,data,isloading); let result:Promise<any> = _this[tag].getItems(context,data,isloading);
CodeListService.codelistCache.set(tag,result); CodeListService.codelistCache.set(`${JSON.stringify(context)}-${JSON.stringify(data)}-${tag}`,result);
if(cacheTimeout !== -1){ if(cacheTimeout !== -1){
_this[tag].expirationTime = new Date().getTime() + cacheTimeout; _this[tag].expirationTime = new Date().getTime() + cacheTimeout;
} }
callback(tag,result); callback(context,data,tag,result);
} }
} }
}else{ }else{
...@@ -149,7 +149,6 @@ export default class CodeListService { ...@@ -149,7 +149,6 @@ export default class CodeListService {
return Promise.reject([]); return Promise.reject([]);
} }
} }
}
}) })
} }</#noparse>
} }
\ No newline at end of file
...@@ -69,10 +69,10 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext ...@@ -69,10 +69,10 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext
* @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase * @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase
*/ */
public initBasicParam(){ public initBasicParam(){
this.modelIdField = "${item.getModelIdPSAppDEField().getCodeName()?lower_case}"; <#if item.getModelIdPSAppDEField()??>this.modelIdField = "${item.getModelIdPSAppDEField().getCodeName()?lower_case}";</#if>
this.modelField = "${item.getModelPSAppDEField().getCodeName()?lower_case}"; <#if item.getModelIdPSAppDEField()??>this.modelField = "${item.getModelPSAppDEField().getCodeName()?lower_case}";</#if>
this.appIdField = "${item.getAppIdPSAppDEField().getCodeName()?lower_case}"; <#if item.getModelIdPSAppDEField()??>this.appIdField = "${item.getAppIdPSAppDEField().getCodeName()?lower_case}";</#if>
this.userIdField = "${item.getUserIdPSAppDEField().getCodeName()?lower_case}"; <#if item.getModelIdPSAppDEField()??>this.userIdField = "${item.getUserIdPSAppDEField().getCodeName()?lower_case}";</#if>
<#if item.getStoagePSAppDataEntity()??> <#if item.getStoagePSAppDataEntity()??>
<#assign stoageDataEntity = item.getStoagePSAppDataEntity() /> <#assign stoageDataEntity = item.getStoagePSAppDataEntity() />
this.stoageEntityName ="${stoageDataEntity.getCodeName()?lower_case}"; this.stoageEntityName ="${stoageDataEntity.getCodeName()?lower_case}";
...@@ -89,8 +89,19 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext ...@@ -89,8 +89,19 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext
* @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase * @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase
*/ */
public loadModelData(context: any = {},data: any = {}, isloading?: boolean): Promise<any>{ public loadModelData(context: any = {},data: any = {}, isloading?: boolean): Promise<any>{
<#-- const {context:contextResult,data:dataResult} = this.handlePreParam(context,data); -->
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
//从接口加载
if(data && data.utilServiceName){
const requestParam:any ={configType:data.utilServiceName,targetType:data.modelid};
this.stoageDataService.getDynaModel(context,requestParam).then((res:any) =>{
if(res && res.status === 200){
const data: any = res.data;
resolve({status:200,data:(data && data.model)?data.model:[]});
}
}).catch((error:any) =>{
reject(error);
})
}else{
let dataStr = window.localStorage.getItem(data.modelid); let dataStr = window.localStorage.getItem(data.modelid);
if(dataStr) { if(dataStr) {
const data: any = JSON.parse(dataStr); const data: any = JSON.parse(dataStr);
...@@ -98,18 +109,7 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext ...@@ -98,18 +109,7 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext
} else { } else {
resolve({status:200,data:[]}); resolve({status:200,data:[]});
} }
<#-- let result: Promise<any>;
const _appEntityService: any = this.stoageDataService;
if (_appEntityService[this.loadAction] && _appEntityService[this.loadAction] instanceof Function) {
result = _appEntityService[this.loadAction](contextResult,dataResult, isloading);
} else {
result = _appEntityService.Get(contextResult,dataResult, isloading);
} }
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
}); -->
}); });
} }
...@@ -123,61 +123,23 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext ...@@ -123,61 +123,23 @@ export default class ${srfclassname('${item.getCodeName()}')}UtilServiceBase ext
* @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase * @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase
*/ */
public saveModelData(context: any = {},action:string,data: any = {}, isloading?: boolean):Promise<any>{ public saveModelData(context: any = {},action:string,data: any = {}, isloading?: boolean):Promise<any>{
<#-- const {context:contextResult,data:dataResult} = this.handlePreParam(context,data); -->
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
// 存储到数据库
if(data && data.utilServiceName){
const requestParam:any ={configType:data.utilServiceName,targetType:data.modelid,model:data.model};
this.stoageDataService.setDynaModel(context,requestParam).then((res:any) =>{
if(res && res.status === 200){
resolve({status:200,data:data.model});
}
}).catch((error:any) =>{
reject(error);
})
}else{
window.localStorage.setItem(data.modelid, JSON.stringify(data)); window.localStorage.setItem(data.modelid, JSON.stringify(data));
resolve({status:200,data:data.model}); resolve({status:200,data:data.model});
<#-- let result: Promise<any> = Object.is(action,"Update") ? this.updateModelData(context,data,isloading):this.createdModelData(context,data,isloading);
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
}); -->
});
} }
/**
* 新建模型数据
*
* @param context 应用上下文
* @param data 传入模型数据
* @param isloading 是否加载
* @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase
*/
public createdModelData(context: any = {},data: any = {}, isloading?: boolean):Promise<any>{
const {context:contextResult,data:dataResult} = this.handlePreParam(context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.stoageDataService;
result = _appEntityService[this.createAction](contextResult,dataResult, isloading);
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
}); });
} }
/**
* 更新模型数据
*
* @param context 应用上下文
* @param data 传入模型数据
* @param isloading 是否加载
* @memberof ${srfclassname('${item.getCodeName()}')}UtilServiceBase
*/
public updateModelData(context: any = {},data: any = {}, isloading?: boolean):Promise<any>{
const {context:contextResult,data:dataResult} = this.handlePreParam(context,data);
return new Promise((resolve: any, reject: any) => {
let result: Promise<any>;
const _appEntityService: any = this.stoageDataService;
result = _appEntityService[this.updateAction](contextResult,dataResult, isloading);
result.then((response) => {
resolve(response);
}).catch(response => {
reject(response);
});
});
}
} }
\ No newline at end of file
...@@ -19,7 +19,7 @@ module.exports = { ...@@ -19,7 +19,7 @@ module.exports = {
port: 8111, port: 8111,
compress: true, compress: true,
disableHostCheck: true, disableHostCheck: true,
// proxy: "http://127.0.0.1:<#if app.getHttpPort?? && app.getHttpPort() == 0>8080<#else>${app.getHttpPort()?c}</#if>/", // proxy: "http://127.0.0.1:8080/",
historyApiFallback: { historyApiFallback: {
rewrites: [ rewrites: [
<#if app.getAllRefPSAppViews()??> <#if app.getAllRefPSAppViews()??>
......
## v7.0.0-alpha.6 [2020-6-5]
### Bug修复
修复树右键菜单事件传值bug
修复树节点图标样式
修复viewdata和viewparams解析不同步
修复界面行为多主键分隔符由";"改为","
修复多层导航失效
数据选择,自动填充编辑器参数处理,动态代码表编辑器参数
修复富文本国际化bug
修复坐标轴的自定义参数
修复分页面板配置导航参数
修复实体处理逻辑
修复应用级context对象特性丢失的问题
修复新建逻辑
修复动态代码表传递上下文、参数逻辑
### 功能新增及优化
#### 模板
树选择双击
列表快速分组和快速搜索表单
数据视图快速分组和快速搜索表单
日历图例、日历快速分组和批处理工具栏
实体国际化路径调整
面板界面行为支持
列表,数据视图下拉加载
增加图表名称代码表识别、雷达图支持
uaa菜单权限
增加数据看板动态模型数据存库
应用样式调整
#### 基础文件
人员选择标准控件样式调整
应用样式调整
表格EX报错修复
注销
## v7.0.0-alpha.5 [2020-5-28] ## v7.0.0-alpha.5 [2020-5-28]
### Bug修复 ### Bug修复
...@@ -204,20 +270,6 @@ ...@@ -204,20 +270,6 @@
实体工作流动态导航表格视图 实体工作流动态导航表格视图
更新默认值
#### 基础文件
表格文件上传信息显示
实体工作流动态视图
实体工作流动态导航表格视图
#### 基础文件
表格文件上传信息显示
实体工作流动态视图 实体工作流动态视图
实体工作流动态导航表格视图 实体工作流动态导航表格视图
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册