'<a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="glyphicon glyphicon-repeat" aria-hidden="true" @click="convert" data-command="show" title="图表切换"></a><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="glyphicon glyphicon-transfer" aria-hidden="true" @click="transpose" data-command="show" title="行列转置"></a>'+
'</span></template><template><div v-show="!tableAndMap" :id="item.indicatorName"></div></template><template v-if="tableAndMap"><el-table :data="item.tableData" max-height="300" stripe border fix fit style="width: 100%">'+
'<el-table-column v-for="(column,index) in item.columns" :prop="column" :fixed="index==0" :label="column" :min-width="column.length<8?118:column.length>16?250:column.length*15"></el-table-column></el-table></template></el-collapse-item></el-collapse></div>',
props : ['item','mapOption'],
data : {
indicator : indicators[i],
rowOrColumn : false, // 行列转换
tableOrMap : true, // 表和图切换
tableAndMap : true, // 表和图同时显示
indexid : i,
mapInitOption : {
title : {
text : '',
show : false
},
tooltip : {
trigger : 'item',
formatter: ''
},
legend : {
data : [],
right : 90, // 不要遮住右边的按钮
left : 85,
padding : 10
},
toolbox : {
show : true,
feature : {
mark : {
show : true
},
magicType : {
show : true,
type : ['line', 'bar'] },
restore : {
show : true
},
saveAsImage : {
show : true
}
}
},
grid : {
y : '',
y2 : '',
containLabel : true
},
calculable : true,
xAxis : [{
type : 'category',
boundaryGap : false,
axisLabel : {
interval : 0
// rotate : 45
}
}
],
yAxis : [{
type : 'value',
axisLabel : {
formatter : yAxisFormatter
}
}
] } // echarts 初始化参数
},
methods : {
transpose : function (ev) {
if (this.rowOrColumn) {
this.item = this.listToRowObject(this.indicator);
this.mapOption = this.listToRowMap(this.indicator);
this.rowOrColumn = false;
} else {
this.item = this.listToColumnObject(this.indicator);
this.mapOption = this.listToColumnMap(this.indicator);










