提交 ae891562 编写于 作者: lijinyang's avatar lijinyang

Merge branch 'dev' of http://demo.ibizlab.cn/ibizr7pfstdtempl/ibizvuer7 into dev

...@@ -307,9 +307,9 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -307,9 +307,9 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
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); let _chartOption = this.handleChartOPtion(codelist);
console.log(this.chartOption); console.log(_chartOption);
this.myChart.setOption(this.chartOption); this.myChart.setOption(_chartOption);
this.myChart.resize(); this.myChart.resize();
} }
...@@ -319,6 +319,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -319,6 +319,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
* @memberof ${srfclassname('${ctrl.name}')}Base * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public handleChartOPtion(allcodelist:any){ public handleChartOPtion(allcodelist:any){
let _chartOption:any = JSON.parse(JSON.stringify(this.chartOption));
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++){
...@@ -330,12 +331,12 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -330,12 +331,12 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
} }
if(tempDataSourceMap.size > 0){ if(tempDataSourceMap.size > 0){
tempDataSourceMap.forEach((item:any) =>{ tempDataSourceMap.forEach((item:any) =>{
this.chartOption.dataset.push({'source':item}); _chartOption.dataset.push({'source':item});
}) })
} }
Object.keys(this.seriesModel).forEach((seriesName:string) =>{ Object.keys(this.seriesModel).forEach((seriesName:string) =>{
if(this.chartOption && this.chartOption.series.length > 0){ if(_chartOption && _chartOption.series.length > 0){
this.chartOption.series.forEach((item:any) =>{ _chartOption.series.forEach((item:any) =>{
if(this.seriesModel[seriesName].ecxObject){ if(this.seriesModel[seriesName].ecxObject){
item = Util.deepObjectMerge(item,this.seriesModel[seriesName].ecxObject); item = Util.deepObjectMerge(item,this.seriesModel[seriesName].ecxObject);
} }
...@@ -351,25 +352,26 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -351,25 +352,26 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
let tempSeries:any = this.seriesModel[seriesName]; let tempSeries:any = this.seriesModel[seriesName];
// 非雷达图 // 非雷达图
if(tempSeries && tempSeries.seriesIdField && tempSeries.seriesValues.length > 0 && !Object.is(tempSeries.type,'radar')){ 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 = _chartOption.series.findIndex((item:any) =>{
return Object.is(item.id,seriesName); return Object.is(item.id,seriesName);
}) })
this.chartOption.series.splice(returnIndex,1); _chartOption.series.splice(returnIndex,1);
let tempSeriesArray:Array<any> = []; let tempSeriesArray:Array<any> = [];
tempSeries.seriesValues.forEach((seriesvalueItem:any) =>{ tempSeries.seriesValues.forEach((seriesvalueItem:any) =>{
let tempSeriesTemp:any = JSON.parse(JSON.stringify(tempSeries.seriesTemp)); 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> <#noparse>Object.assign(tempSeriesTemp,{name:tempSeries.seriesMap[seriesvalueItem],datasetIndex:tempSeries.seriesIndex,encode:{x:tempSeries.categorField,y:`${seriesvalueItem}`}});</#noparse>
this.chartOption.series.push(tempSeriesTemp); _chartOption.series.push(tempSeriesTemp);
}) })
} }
}) })
} }
if(Object.keys(this.chartBaseOPtion).length > 0){ if(Object.keys(this.chartBaseOPtion).length > 0){
Object.assign(this.chartOption,this.chartBaseOPtion); Object.assign(_chartOption,this.chartBaseOPtion);
} }
if(Object.keys(this.chartUserParams).length >0){ if(Object.keys(this.chartUserParams).length >0){
Object.assign(this.chartOption,this.chartUserParams); Object.assign(_chartOption,this.chartUserParams);
} }
return _chartOption;
} }
/** /**
......
...@@ -307,9 +307,9 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -307,9 +307,9 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
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); let _chartOption = this.handleChartOPtion(codelist);
console.log(this.chartOption); console.log(_chartOption);
this.myChart.setOption(this.chartOption); this.myChart.setOption(_chartOption);
this.myChart.resize(); this.myChart.resize();
} }
...@@ -319,6 +319,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -319,6 +319,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
* @memberof ${srfclassname('${ctrl.name}')}Base * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public handleChartOPtion(allcodelist:any){ public handleChartOPtion(allcodelist:any){
let _chartOption:any = JSON.parse(JSON.stringify(this.chartOption));
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++){
...@@ -330,12 +331,12 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -330,12 +331,12 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
} }
if(tempDataSourceMap.size > 0){ if(tempDataSourceMap.size > 0){
tempDataSourceMap.forEach((item:any) =>{ tempDataSourceMap.forEach((item:any) =>{
this.chartOption.dataset.push({'source':item}); _chartOption.dataset.push({'source':item});
}) })
} }
Object.keys(this.seriesModel).forEach((seriesName:string) =>{ Object.keys(this.seriesModel).forEach((seriesName:string) =>{
if(this.chartOption && this.chartOption.series.length > 0){ if(_chartOption && _chartOption.series.length > 0){
this.chartOption.series.forEach((item:any) =>{ _chartOption.series.forEach((item:any) =>{
if(this.seriesModel[seriesName].ecxObject){ if(this.seriesModel[seriesName].ecxObject){
item = Util.deepObjectMerge(item,this.seriesModel[seriesName].ecxObject); item = Util.deepObjectMerge(item,this.seriesModel[seriesName].ecxObject);
} }
...@@ -351,25 +352,26 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -351,25 +352,26 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
let tempSeries:any = this.seriesModel[seriesName]; let tempSeries:any = this.seriesModel[seriesName];
// 非雷达图 // 非雷达图
if(tempSeries && tempSeries.seriesIdField && tempSeries.seriesValues.length > 0 && !Object.is(tempSeries.type,'radar')){ 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 = _chartOption.series.findIndex((item:any) =>{
return Object.is(item.id,seriesName); return Object.is(item.id,seriesName);
}) })
this.chartOption.series.splice(returnIndex,1); _chartOption.series.splice(returnIndex,1);
let tempSeriesArray:Array<any> = []; let tempSeriesArray:Array<any> = [];
tempSeries.seriesValues.forEach((seriesvalueItem:any) =>{ tempSeries.seriesValues.forEach((seriesvalueItem:any) =>{
let tempSeriesTemp:any = JSON.parse(JSON.stringify(tempSeries.seriesTemp)); 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> <#noparse>Object.assign(tempSeriesTemp,{name:tempSeries.seriesMap[seriesvalueItem],datasetIndex:tempSeries.seriesIndex,encode:{x:tempSeries.categorField,y:`${seriesvalueItem}`}});</#noparse>
this.chartOption.series.push(tempSeriesTemp); _chartOption.series.push(tempSeriesTemp);
}) })
} }
}) })
} }
if(Object.keys(this.chartBaseOPtion).length > 0){ if(Object.keys(this.chartBaseOPtion).length > 0){
Object.assign(this.chartOption,this.chartBaseOPtion); Object.assign(_chartOption,this.chartBaseOPtion);
} }
if(Object.keys(this.chartUserParams).length >0){ if(Object.keys(this.chartUserParams).length >0){
Object.assign(this.chartOption,this.chartUserParams); Object.assign(_chartOption,this.chartUserParams);
} }
return _chartOption;
} }
/** /**
......
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
:is="selection.view.viewname" :is="selection.view.viewname"
class="viewcontainer2" class="viewcontainer2"
:viewDefaultUsage="false" :viewDefaultUsage="false"
:viewdata="JSON.stringify(selection.data)"> :viewdata="JSON.stringify(selection.context)"
:viewparam="JSON.stringify(selection.viewparam)">
</component> </component>
</div> </div>
</split> </split>
...@@ -149,6 +150,7 @@ ...@@ -149,6 +150,7 @@
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public split: number = 0.5; public split: number = 0.5;
<#if ctrl.getXDataPSControl()??> <#if ctrl.getXDataPSControl()??>
<#assign xDataControl = ctrl.getXDataPSControl() /> <#assign xDataControl = ctrl.getXDataPSControl() />
...@@ -194,7 +196,7 @@ ...@@ -194,7 +196,7 @@
* @type {*} * @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public tempNavigateParams:any = <@getNavigateParams xDataControl />; public navigateParams:any = <@getNavigateParams xDataControl />;
</#if> </#if>
</#if> </#if>
...@@ -351,24 +353,39 @@ ...@@ -351,24 +353,39 @@
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void { public ${ctrl.name}_selectionchange(args: any [], tag?: string, $event2?: any): void {
let data:any = {}; let tempContext:any = {};
let tempViewParam:any = {};
if (args.length === 0) { if (args.length === 0) {
return ; return ;
} }
const arg:any = args[0]; const arg:any = args[0];
if(this.context){ if(this.context){
Object.assign(data,JSON.parse(JSON.stringify(this.context))); Object.assign(tempContext,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()??>
<#assign curDataEntity = xDataControl.getPSAppDataEntity()/> <#assign curDataEntity = xDataControl.getPSAppDataEntity()/>
Object.assign(data,{'${curDataEntity.getCodeName()?lower_case}':arg['${curDataEntity.getCodeName()?lower_case}']}); Object.assign(tempContext,{'${curDataEntity.getCodeName()?lower_case}':arg['${curDataEntity.getCodeName()?lower_case}']});
Object.assign(data,{srfparentdename:'${curDataEntity.getCodeName()}',srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']}); Object.assign(tempContext,{srfparentdename:'${curDataEntity.getCodeName()}',srfparentkey:arg['${curDataEntity.getCodeName()?lower_case}']});
if(this.navFilter && !Object.is(this.navFilter,"")){
Object.assign(tempViewParam,{[this.navFilter]:arg['${curDataEntity.getCodeName()?lower_case}']});
}
if(this.navPSDer && !Object.is(this.navPSDer,"")){
Object.assign(tempViewParam,{[this.navPSDer]:arg['${curDataEntity.getCodeName()?lower_case}']});
}
</#if> </#if>
</#if> </#if>
if(this.navigateContext && Object.keys(this.navigateContext).length >0){
let _context:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateContext);
Object.assign(tempContext,_context);
}
if(this.navigateParams && Object.keys(this.navigateParams).length >0){
let _params:any = this.$util.computedNavData(arg,tempContext,tempViewParam,this.navigateParams);
Object.assign(tempViewParam,_params);
}
this.selection = {}; this.selection = {};
Object.assign(this.selection, { view: { viewname: this.navViewName }, data:data }); Object.assign(this.selection, { view: { viewname: this.navViewName }, context:tempContext,viewparam:tempViewParam });
this.$emit('selectionchange',args); this.$emit('selectionchange',args);
this.$forceUpdate(); this.$forceUpdate();
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册