|
@@ -35,10 +35,28 @@
|
|
<el-date-picker v-model="resAnnual" value-format="YYYY-MM-DD" type="daterange"
|
|
<el-date-picker v-model="resAnnual" value-format="YYYY-MM-DD" type="daterange"
|
|
placeholder="请选择时间" />
|
|
placeholder="请选择时间" />
|
|
</div>
|
|
</div>
|
|
- <seachs @handleSeach="getSeachData" :showRest="false"></seachs>
|
|
|
|
|
|
+ <!-- <seachs @handleSeach="getSeachData" :showRest="false"></seachs> -->
|
|
|
|
+ <el-row :gutter="10" class="btnsA">
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button type="primary" size="mini" @click="getSeachData('1')">
|
|
|
|
+ <span>对标</span>
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button type="primary" size="mini" @click="getSeachData('2')">
|
|
|
|
+ <span>同期</span>
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button type="primary" size="mini" @click="getSeachData('3')">
|
|
|
|
+ <span>上期</span>
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
</div>
|
|
</div>
|
|
<div class="benchmarkBasicPageTableData">
|
|
<div class="benchmarkBasicPageTableData">
|
|
- <el-table :data="benchmarkBasicPageData" style="width: 100%" :class="unitRatingTableSty()">
|
|
|
|
|
|
+ <el-table :data="benchmarkBasicPageData" style="width: 100%" :class="unitRatingTableSty()"
|
|
|
|
+ v-if="showType === '1'">
|
|
<el-table-column type="index" label="序号" align="center"></el-table-column>
|
|
<el-table-column type="index" label="序号" align="center"></el-table-column>
|
|
<el-table-column v-for="(it, index) in benchmarkBasicHeader" :key="index" :label="it.name"
|
|
<el-table-column v-for="(it, index) in benchmarkBasicHeader" :key="index" :label="it.name"
|
|
align="center">
|
|
align="center">
|
|
@@ -47,6 +65,29 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
|
|
+ <el-table :data="benchmarkBasicPageData" style="width: 100%" :class="unitRatingTableSty()" v-else>
|
|
|
|
+ <el-table-column type="index" label="序号" align="center"></el-table-column>
|
|
|
|
+ <el-table-column prop="time" label="频度" align="center"></el-table-column>
|
|
|
|
+ <el-table-column v-for="(it, index) in benchmarkBasicHeader" :key="index" :label="it.name"
|
|
|
|
+ align="center">
|
|
|
|
+
|
|
|
|
+ <el-table-column prop="state" label="本期" align="center">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <span>{{scope.row[it.code+'_b']}}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="city" label="同期" v-if="showType === '2'" align="center">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <span>{{scope.row[it.code+'_t']}}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="city" label="上期" v-if="showType === '3'" align="center">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <span>{{scope.row[it.code]}}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
<div id="basicEcharts" style="width: 100%; height: 40vh"></div>
|
|
<div id="basicEcharts" style="width: 100%; height: 40vh"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -55,8 +96,12 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import seachs from '../seachGroup.vue'
|
|
import seachs from '../seachGroup.vue'
|
|
|
|
+ // import baxicjson from '../basicJSON.json'
|
|
|
|
+ // import baxic2json from '../basic2JSON.json'
|
|
import {
|
|
import {
|
|
apiPostbenchmarkBasicList,
|
|
apiPostbenchmarkBasicList,
|
|
|
|
+ apiPostbenchmarkcontemporaneousData,
|
|
|
|
+ apiPostbenchmarkpreviousPeriodData,
|
|
apiPostTreeSelectList1015,
|
|
apiPostTreeSelectList1015,
|
|
apiPostTreeSelectList1019,
|
|
apiPostTreeSelectList1019,
|
|
apiPostTreeSelectList1020
|
|
apiPostTreeSelectList1020
|
|
@@ -80,7 +125,10 @@
|
|
evalSelectArr: [],
|
|
evalSelectArr: [],
|
|
rangeArr: [],
|
|
rangeArr: [],
|
|
winPix: window.devicePixelRatio,
|
|
winPix: window.devicePixelRatio,
|
|
- innerWidth: window.innerWidth
|
|
|
|
|
|
+ innerWidth: window.innerWidth,
|
|
|
|
+ showType: '1',
|
|
|
|
+ // baxicjson: baxicjson,
|
|
|
|
+ // baxic2json: baxic2json
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -100,7 +148,7 @@
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.getorgSelectList()
|
|
this.getorgSelectList()
|
|
- this.getEchartsData()
|
|
|
|
|
|
+ this.getbenchmarkBasicList('1')
|
|
this.resAnnual = [this.getTime(new Date(new Date().getTime() - 6 * 30 * 24 * 60 * 60 * 1000)), this.getTime(
|
|
this.resAnnual = [this.getTime(new Date(new Date().getTime() - 6 * 30 * 24 * 60 * 60 * 1000)), this.getTime(
|
|
new Date(new Date().getTime()))]
|
|
new Date(new Date().getTime()))]
|
|
},
|
|
},
|
|
@@ -178,12 +226,12 @@
|
|
if (datas && datas.data.data) {
|
|
if (datas && datas.data.data) {
|
|
that.evalSelectArr = datas.data.data
|
|
that.evalSelectArr = datas.data.data
|
|
that.evalVal = datas.data.data[0].itemsCode
|
|
that.evalVal = datas.data.data[0].itemsCode
|
|
- that.getbenchmarkBasicList()
|
|
|
|
|
|
+ that.getbenchmarkBasicList('1')
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//获取指标数据
|
|
//获取指标数据
|
|
- getbenchmarkBasicList() {
|
|
|
|
|
|
+ getbenchmarkBasicList(type) {
|
|
let that = this
|
|
let that = this
|
|
let params = {
|
|
let params = {
|
|
type: '1011',
|
|
type: '1011',
|
|
@@ -202,38 +250,50 @@
|
|
endTime: that.resAnnual[1]
|
|
endTime: that.resAnnual[1]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- apiPostbenchmarkBasicList(params).then(datas => {
|
|
|
|
- if (datas && datas.data) {
|
|
|
|
- if (datas.data.title) {
|
|
|
|
- that.benchmarkBasicHeader = datas.data.title
|
|
|
|
- }
|
|
|
|
- if (datas.data.list) {
|
|
|
|
- that.benchmarkBasicPageData = datas.data.list
|
|
|
|
- let xaxisArr = []
|
|
|
|
- let seriesArr = []
|
|
|
|
- that.benchmarkBasicPageData.forEach(it => {
|
|
|
|
- xaxisArr.push(it.time)
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- that.benchmarkBasicHeader.forEach(iv => {
|
|
|
|
- if (iv.code !== 'time') {
|
|
|
|
- let seriesitemArr = []
|
|
|
|
- that.benchmarkBasicPageData.forEach(item => {
|
|
|
|
- seriesitemArr.push(item[iv.code])
|
|
|
|
- })
|
|
|
|
- let obj = {
|
|
|
|
- name: iv.name,
|
|
|
|
- type: 'line',
|
|
|
|
- symbol: 'none',
|
|
|
|
- data: seriesitemArr
|
|
|
|
- }
|
|
|
|
- seriesArr.push(obj)
|
|
|
|
- }
|
|
|
|
|
|
+ if (type === '1') {
|
|
|
|
+ apiPostbenchmarkBasicList(params).then(datas => {
|
|
|
|
+ that.changeData(datas)
|
|
|
|
+ })
|
|
|
|
+ } else if (type === '2') {
|
|
|
|
+ apiPostbenchmarkcontemporaneousData(params).then(datas => {
|
|
|
|
+ that.changeData(datas)
|
|
|
|
+ })
|
|
|
|
+ } else if (type === '3') {
|
|
|
|
+ apiPostbenchmarkpreviousPeriodData(params).then(datas => {
|
|
|
|
+ that.changeData(datas)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ changeData(showData) {
|
|
|
|
+ if (showData.data.title) {
|
|
|
|
+ that.benchmarkBasicHeader = showData.data.title
|
|
|
|
+ }
|
|
|
|
+ if (showData.data.list) {
|
|
|
|
+ that.benchmarkBasicPageData = showData.data.list
|
|
|
|
+ let xaxisArr = []
|
|
|
|
+ let seriesArr = []
|
|
|
|
+ that.benchmarkBasicPageData.forEach(it => {
|
|
|
|
+ xaxisArr.push(it.time)
|
|
|
|
+ })
|
|
|
|
+ that.benchmarkBasicHeader.forEach(iv => {
|
|
|
|
+ if (iv.code !== 'time') {
|
|
|
|
+ let seriesitemArr = []
|
|
|
|
+ that.benchmarkBasicPageData.forEach(item => {
|
|
|
|
+ seriesitemArr.push(item[iv.code])
|
|
})
|
|
})
|
|
- that.getEchartsData(xaxisArr, seriesArr)
|
|
|
|
|
|
+ let obj = {
|
|
|
|
+ name: iv.name,
|
|
|
|
+ type: type === '1' ? 'line' : 'bar',
|
|
|
|
+ data: seriesitemArr
|
|
|
|
+ }
|
|
|
|
+ if (type === '1') {
|
|
|
|
+ obj.symbol = 'none'
|
|
|
|
+ }
|
|
|
|
+ seriesArr.push(obj)
|
|
}
|
|
}
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ })
|
|
|
|
+ that.getEchartsData(xaxisArr, seriesArr)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
//获取echarts数据
|
|
//获取echarts数据
|
|
getEchartsData(xaxisArr, seriesArr) {
|
|
getEchartsData(xaxisArr, seriesArr) {
|
|
@@ -262,6 +322,49 @@
|
|
chat.resize()
|
|
chat.resize()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ getPowerBar(xAxis, series) {
|
|
|
|
+ let option = {
|
|
|
|
+ tooltip: {
|
|
|
|
+ trigger: 'axis',
|
|
|
|
+ axisPointer: {
|
|
|
|
+ type: 'shadow'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ grid: {
|
|
|
|
+ left: '2%',
|
|
|
|
+ right: '2%',
|
|
|
|
+ bottom: '5%',
|
|
|
|
+ height: '90px',
|
|
|
|
+ containLabel: true
|
|
|
|
+ },
|
|
|
|
+ legend: {
|
|
|
|
+ right: '20',
|
|
|
|
+ top: '20',
|
|
|
|
+ itemWidth: 5,
|
|
|
|
+ itemHeight: 5,
|
|
|
|
+ data: ['日发电量', '上网电量', '购网电量']
|
|
|
|
+ },
|
|
|
|
+ xAxis: [{
|
|
|
|
+ type: 'category',
|
|
|
|
+ axisTick: {
|
|
|
|
+ show: false
|
|
|
|
+ },
|
|
|
|
+ data: xAxis
|
|
|
|
+ }],
|
|
|
|
+ yAxis: [{
|
|
|
|
+ type: 'value'
|
|
|
|
+ }],
|
|
|
|
+ series: series
|
|
|
|
+ };
|
|
|
|
+ // 基于准备好的dom,初始化echarts实例
|
|
|
|
+ let dom = document.getElementById('basicEcharts');
|
|
|
|
+ dom.removeAttribute("_echarts_instance_") ? dom.removeAttribute("_echarts_instance_") : ''
|
|
|
|
+ let myChart = this.$echarts.init(dom);
|
|
|
|
+ myChart.setOption(option);
|
|
|
|
+ window.addEventListener("resize", function () {
|
|
|
|
+ myChart.resize()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
getTime(date) {
|
|
getTime(date) {
|
|
var y = date.getFullYear();
|
|
var y = date.getFullYear();
|
|
var m = date.getMonth() + 1;
|
|
var m = date.getMonth() + 1;
|
|
@@ -271,8 +374,9 @@
|
|
let timeF = y + '-' + m + '-' + d
|
|
let timeF = y + '-' + m + '-' + d
|
|
return timeF
|
|
return timeF
|
|
},
|
|
},
|
|
- getSeachData() {
|
|
|
|
- this.getbenchmarkBasicList()
|
|
|
|
|
|
+ getSeachData(type) {
|
|
|
|
+ this.showType = type
|
|
|
|
+ this.getbenchmarkBasicList(type)
|
|
},
|
|
},
|
|
unitRatingTableSty() {
|
|
unitRatingTableSty() {
|
|
if (this.winPix === 1.25 || this.innerWidth < 1800) {
|
|
if (this.winPix === 1.25 || this.innerWidth < 1800) {
|
|
@@ -327,6 +431,12 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ .btnsA {
|
|
|
|
+ .el-button {
|
|
|
|
+ width: 80px !important;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
.exceedWidth {
|
|
.exceedWidth {
|
|
.el-select {
|
|
.el-select {
|
|
width: 70px;
|
|
width: 70px;
|