|
|
@@ -1,12 +1,18 @@
|
|
|
<template>
|
|
|
<div class="chart-wrap">
|
|
|
<div class="wrap-fix">
|
|
|
- <div class="col-1 col">
|
|
|
+ <div class="col-2 col">
|
|
|
<v-chart autoresize :option="option1"/>
|
|
|
</div>
|
|
|
- <div class="col-2 col">
|
|
|
+ <div class="col-1 col">
|
|
|
<v-chart autoresize :option="option2"/>
|
|
|
</div>
|
|
|
+ <div class="col-1 col">
|
|
|
+ <v-chart autoresize :option="option3"/>
|
|
|
+ </div>
|
|
|
+ <div class="col-1 col">
|
|
|
+ <v-chart autoresize :option="option4"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -20,7 +26,9 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
option1: {},
|
|
|
- option2: {}
|
|
|
+ option2: {},
|
|
|
+ option3: {},
|
|
|
+ option4: {}
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -33,12 +41,20 @@ export default {
|
|
|
const res = await chartMapTable()
|
|
|
if (res.code === 200) {
|
|
|
arrMap = [
|
|
|
- [res.info.series[0].data[0], res.info.series[1].data[0]].reverse(),
|
|
|
- [res.info.series[0].data[1], res.info.series[1].data[1]].reverse(),
|
|
|
- [res.info.series[0].data[2], res.info.series[1].data[2]].reverse()
|
|
|
+ // [res.info.series[0].data[0], res.info.series[1].data[0]].reverse(),
|
|
|
+ // [res.info.series[0].data[1], res.info.series[1].data[1]].reverse(),
|
|
|
+ // [res.info.series[0].data[2], res.info.series[1].data[2]].reverse()
|
|
|
]
|
|
|
+ res.info.xaxis.forEach((_, index) => {
|
|
|
+ const itemArr = []
|
|
|
+ res.info.series.forEach((item) => {
|
|
|
+ itemArr.push(item['data'][index])
|
|
|
+ })
|
|
|
+ arrMap.push(itemArr)
|
|
|
+ })
|
|
|
+ window['arrMap'] = arrMap;
|
|
|
}
|
|
|
- var xData2 = ['变电']
|
|
|
+
|
|
|
var data = arrMap || [
|
|
|
[50, 10],
|
|
|
[100, 10],
|
|
|
@@ -50,13 +66,27 @@ export default {
|
|
|
[data[2][0]]
|
|
|
]
|
|
|
const data2 = [
|
|
|
+ [data[0][2]],
|
|
|
+ [data[1][2]],
|
|
|
+ [data[2][2]]
|
|
|
+ ]
|
|
|
+ const data3 = [
|
|
|
[data[0][1]],
|
|
|
[data[1][1]],
|
|
|
[data[2][1]]
|
|
|
]
|
|
|
- const xDataSum = [arrMap[0][0] + arrMap[1][0] + arrMap[2][0], arrMap[0][1] + arrMap[1][1] + arrMap[2][1]]
|
|
|
-
|
|
|
- window['xDataSum'] = xDataSum
|
|
|
+ const data4 = [
|
|
|
+ [data[0][3]],
|
|
|
+ [data[1][3]],
|
|
|
+ [data[2][3]]
|
|
|
+ ]
|
|
|
+ const xDataSum = [
|
|
|
+ arrMap[0][0] + arrMap[1][0] + arrMap[2][0],
|
|
|
+ arrMap[0][2] + arrMap[1][2] + arrMap[2][2],
|
|
|
+ arrMap[0][1] + arrMap[1][1] + arrMap[2][1],
|
|
|
+ arrMap[0][3] + arrMap[1][3] + arrMap[2][3]
|
|
|
+ ]
|
|
|
+ window['xDataSum'] = xDataSum;
|
|
|
|
|
|
const gapWidth = this.EchartfontSize(125)
|
|
|
const barWidth = this.EchartfontSize(10)
|
|
|
@@ -64,8 +94,8 @@ export default {
|
|
|
const symbolSizeWidth = this.EchartfontSize(4)
|
|
|
const barGap = 10
|
|
|
const params = {
|
|
|
- xData2: xData2,
|
|
|
- data: data2,
|
|
|
+ xData2: ['(推送)变电'],
|
|
|
+ data: data1,
|
|
|
gapWidth,
|
|
|
barWidth,
|
|
|
symbolOffsetWidth,
|
|
|
@@ -75,8 +105,8 @@ export default {
|
|
|
}
|
|
|
this.renderOption('option1', params)
|
|
|
const params2 = {
|
|
|
- xData2: ['电力'],
|
|
|
- data: data1,
|
|
|
+ xData2: ['(推送)电力'],
|
|
|
+ data: data2,
|
|
|
gapWidth,
|
|
|
barWidth,
|
|
|
symbolOffsetWidth,
|
|
|
@@ -85,8 +115,32 @@ export default {
|
|
|
xDataSum
|
|
|
}
|
|
|
this.renderOption('option2', params2)
|
|
|
+ const params3 = {
|
|
|
+ xData2: ['(自主)变电'],
|
|
|
+ data: data3,
|
|
|
+ gapWidth,
|
|
|
+ barWidth,
|
|
|
+ symbolOffsetWidth,
|
|
|
+ symbolSizeWidth,
|
|
|
+ barGap,
|
|
|
+ xDataSum
|
|
|
+ }
|
|
|
+ this.renderOption('option3', params3)
|
|
|
+ const params4 = {
|
|
|
+ xData2: ['(自主)电力'],
|
|
|
+ data: data4,
|
|
|
+ gapWidth,
|
|
|
+ barWidth,
|
|
|
+ symbolOffsetWidth,
|
|
|
+ symbolSizeWidth,
|
|
|
+ barGap,
|
|
|
+ xDataSum
|
|
|
+ }
|
|
|
+ this.renderOption('option4', params4)
|
|
|
},
|
|
|
renderOption(optionName, params) {
|
|
|
+ console.log('optionName',optionName)
|
|
|
+ const renderIndex = parseInt(optionName.replace('option', ''))
|
|
|
const {
|
|
|
xData2,
|
|
|
data,
|
|
|
@@ -97,8 +151,6 @@ export default {
|
|
|
barGap,
|
|
|
xDataSum
|
|
|
} = params
|
|
|
- window['params'] = params
|
|
|
- window['tis'] = this
|
|
|
|
|
|
let sealingData = []
|
|
|
const gapPerSize = 3
|
|
|
@@ -149,7 +201,7 @@ export default {
|
|
|
},
|
|
|
legend: {
|
|
|
selectedMode: false,
|
|
|
- show: optionName !== 'option2',
|
|
|
+ show: optionName === 'option1',
|
|
|
top: '5%',
|
|
|
right: '30%',
|
|
|
width: '100%',
|
|
|
@@ -194,9 +246,9 @@ export default {
|
|
|
grid: {
|
|
|
right: '10%',
|
|
|
left: '5%',
|
|
|
- height: '80%',
|
|
|
- top: optionName === 'option2' ? '10%' : '50%',
|
|
|
- bottom: optionName === 'option2' ? '0%' : 0,
|
|
|
+ height: '160%',
|
|
|
+ top: optionName === 'options1' ? '100%' : 0,
|
|
|
+ bottom: '-100%',
|
|
|
containLabel: true
|
|
|
|
|
|
},
|
|
|
@@ -567,17 +619,16 @@ export default {
|
|
|
// position: [-baseWidth - offsetWidth / this.EchartfontSize(10), -this.EchartfontSize(20)]
|
|
|
position: 'right',
|
|
|
formatter: (item) => {
|
|
|
- if (optionName === 'option1') {
|
|
|
- return xDataSum[1]
|
|
|
- } else {
|
|
|
- return xDataSum[0]
|
|
|
- }
|
|
|
+ const ret = xDataSum[renderIndex - 1];
|
|
|
+ console.log('renderIndex,ret', renderIndex, ret)
|
|
|
+ return ret
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
]
|
|
|
}
|
|
|
+ window['tis'] = this;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -597,10 +648,22 @@ export default {
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
+ align-items: flex-start;
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
|
.col {
|
|
|
flex: 1;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ flex-shrink: 0;
|
|
|
+ overflow: hidden;
|
|
|
+ //background: teal;
|
|
|
+ //border: 1px solid white;
|
|
|
+ }
|
|
|
+ .col-2{
|
|
|
+ flex: 1.6;
|
|
|
flex-shrink: 0;
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
|
}
|
|
|
|