This commit is contained in:
parent
b0ce123801
commit
7212b9680f
|
|
@ -43,7 +43,7 @@
|
||||||
<template #header>
|
<template #header>
|
||||||
<span class="custom-sort-header">
|
<span class="custom-sort-header">
|
||||||
总配置率
|
总配置率
|
||||||
<i class="el-icon-sort" style="color: #2cbab2;" />
|
<i class="el-icon-sort" style="color: #2cbab2" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -124,6 +124,7 @@ export default {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.initChart()
|
this.initChart()
|
||||||
this.updateChartData(this.tableData)
|
this.updateChartData(this.tableData)
|
||||||
|
this.chartInstance.resize()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 初始化页面数据:请求成功后再初始化图表
|
// 初始化页面数据:请求成功后再初始化图表
|
||||||
|
|
@ -190,11 +191,7 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.chartInstance.setOption({
|
this.chartInstance.setOption({
|
||||||
xAxis: { data: xAxis },
|
xAxis: { data: xAxis },
|
||||||
series: [
|
series: [{ data: xianlu }, { data: dianlan }, { data: biandian }],
|
||||||
{ name: '线路配置率', data: xianlu },
|
|
||||||
{ name: '电缆配置率', data: dianlan },
|
|
||||||
{ name: '变电配置率', data: biandian },
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -205,7 +202,23 @@ export default {
|
||||||
getTotalOption() {
|
getTotalOption() {
|
||||||
return {
|
return {
|
||||||
tooltip: { trigger: 'axis' },
|
tooltip: { trigger: 'axis' },
|
||||||
grid: { left: '3%', right: '4%', bottom: '15%', containLabel: true },
|
graphic: {
|
||||||
|
type: 'text',
|
||||||
|
left: 20,
|
||||||
|
top: 10,
|
||||||
|
style: {
|
||||||
|
text: '单位:分',
|
||||||
|
fill: '#666',
|
||||||
|
fontSize: 14,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
top: 60,
|
||||||
|
left: '3%',
|
||||||
|
right: '4%',
|
||||||
|
bottom: '15%',
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: [],
|
data: [],
|
||||||
|
|
@ -252,23 +265,52 @@ export default {
|
||||||
/** Tab2 配置 */
|
/** Tab2 配置 */
|
||||||
getSubOption() {
|
getSubOption() {
|
||||||
return {
|
return {
|
||||||
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: { type: 'shadow' },
|
||||||
|
},
|
||||||
|
|
||||||
|
// 👉 单位说明(左上角)
|
||||||
|
graphic: {
|
||||||
|
type: 'text',
|
||||||
|
left: 20,
|
||||||
|
top: 10,
|
||||||
|
style: {
|
||||||
|
text: '单位:分',
|
||||||
|
fill: '#666',
|
||||||
|
fontSize: 14,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
// 👉 右上角图例
|
||||||
legend: {
|
legend: {
|
||||||
right: 20,
|
right: 20,
|
||||||
top: 10,
|
top: 10,
|
||||||
data: ['xianlu', 'dianlan', 'biandian'],
|
itemWidth: 12,
|
||||||
formatter(name) {
|
itemHeight: 12,
|
||||||
return { xianlu: '线路', dianlan: '电缆', biandian: '变电' }[name]
|
icon: 'roundRect',
|
||||||
|
textStyle: {
|
||||||
|
color: '#666',
|
||||||
|
fontSize: 14,
|
||||||
},
|
},
|
||||||
|
data: ['线路装备配置率', '电缆设备配置率', '变电设备配置率'],
|
||||||
},
|
},
|
||||||
grid: { left: '3%', right: '4%', bottom: '15%', containLabel: true },
|
|
||||||
|
grid: {
|
||||||
|
left: '3%',
|
||||||
|
right: '4%',
|
||||||
|
bottom: '15%',
|
||||||
|
top: 60,
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: [],
|
data: [],
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
interval: 0, // 必须
|
interval: 0,
|
||||||
formatter(value) {
|
formatter(value) {
|
||||||
const max = 6 // 每行最多 6 个字
|
const max = 6
|
||||||
let res = ''
|
let res = ''
|
||||||
for (let i = 0; i < value.length; i++) {
|
for (let i = 0; i < value.length; i++) {
|
||||||
res += value[i]
|
res += value[i]
|
||||||
|
|
@ -280,11 +322,15 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
yAxis: { type: 'value' },
|
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
},
|
||||||
|
|
||||||
series: [
|
series: [
|
||||||
this.barSeries('xianlu', ['#46A8FF', '#7BC2FF']),
|
this.barSeries('线路装备配置率', ['#46A8FF', '#7BC2FF']),
|
||||||
this.barSeries('dianlan', ['#5EDDCA', '#32E1C6']),
|
this.barSeries('电缆设备配置率', ['#5EDDCA', '#32E1C6']),
|
||||||
this.barSeries('biandian', ['#FDBE56', '#FFC468']),
|
this.barSeries('变电设备配置率', ['#FDBE56', '#FFC468']),
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -397,10 +443,10 @@ export default {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
|
|
||||||
::v-deep.el-loading-mask{
|
::v-deep.el-loading-mask {
|
||||||
background-color:#E5EEF5;
|
background-color: #e5eef5;
|
||||||
}
|
}
|
||||||
::v-deep.el-loading-spinner{
|
::v-deep.el-loading-spinner {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 40%;
|
top: 40%;
|
||||||
left: 44%;
|
left: 44%;
|
||||||
|
|
@ -412,7 +458,7 @@ export default {
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
}
|
}
|
||||||
::v-deep.el-loading-spinner>svg{
|
::v-deep.el-loading-spinner > svg {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue