123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608 |
- <template>
- <div class="app-container">
- <div class="dark-el-input dark-el-button">
- <el-form ref="queryForm" size="small" :inline="true">
- <el-form-item label="时间">
- <el-date-picker
- :clearable="false"
- v-model="dateTime"
- type="datetimerange"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :default-time="['00:00:00', '23:45:00']"
- popper-class="cpp-popper"
- :picker-options="pickerOptions"
- />
- </el-form-item>
- <el-form-item label="场站名称">
- <el-select v-model="stationCode" placeholder="请选择" popper-class="cpp-popper">
- <el-option
- v-for="item in stationList"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="预测类型">
- <el-select v-model="forecastType" placeholder="请选择" popper-class="cpp-popper" @change="forecastType=='dq'?ago=1:ago=8">
- <el-option
- v-for="item in forecastTypeList"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="this.forecastType=='dq'?'预测D+':'预测T+'">
- <el-select v-model="ago" placeholder="请选择" popper-class="cpp-popper">
- <el-option
- v-for="item in this.points()"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" popper-class="cpp-popper" style="margin-left: 5px" icon="el-icon-search"
- @click="dataQuery">查询
- </el-button>
- </el-form-item>
- </el-form>
- </div>
- <div style="padding-top: 10px">
- <div>当前结果为:[<span style="color: #FF0000">{{ this.stationCodeInfo }}</span>发电站]-[预测<span
- style="color: #FF0000">{{ this.forecastTypeInfo }}</span>]-[预测<span
- style="color: #FF0000">{{ this.forecastTypeInfo == '短期' ? 'D+' : 'T+' }}{{ this.agoInfo }}</span>]-结果统计
- </div>
- <el-row :gutter="20" style="">
- <el-col :span="8">
- <vxe-table
- align="center"
- :loading="loading"
- ref="xTable"
- auto-resize
- border
- resizable
- highlight-current-row
- show-overflow
- height="700"
- :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)"
- :cell-class-name="cellClassName"
- >
- <vxe-table-column
- v-for="(item, index) in fromHead"
- :key="index"
- align="center"
- :title="item.label"
- :field="item.field"
- ></vxe-table-column>
- </vxe-table>
- <vxe-pager
- perfect
- :current-page.sync="currentPage"
- :page-size.sync="pageSize"
- :total="total"
- :page-sizes=[10,50,100]
- :layouts="['PrevJump', 'PrevPage','JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']"
- @page-change="handlePageChange"
- >
- </vxe-pager>
- </el-col>
- <el-col :span="16" style="margin-top: -47px">
- <el-row>
- <div style="float:left;width: 100%;height: 410px" id="zqlCharts"></div>
- </el-row>
- <el-row>
- <div style="float:left;width: 100%;height: 410px" id="pcCharts"></div>
- </el-row>
- </el-col>
- </el-row>
- </div>
- </div>
- </template>
- <script>
- import * as echarts from "echarts";
- export default {
- name: 'inverterinfo',
- data() {
- return {
- fromHead: [
- {
- label: "时间",
- field: "time"
- },
- {
- label: "准确率(%)",
- field: "accuracy"
- },
- {
- label: "单点平均偏差(cap*%)",
- field: "deviationSum"
- }
- ],
- pcChart: null,
- zqlChart: null,
- activeName: 'first',
- dateTime: [new Date(new Date().toLocaleDateString()).getTime() - 15 * 60 * 60 * 24 * 1000, new Date(new Date().toLocaleDateString()).getTime() - 60 * 60 * 24 * 1000],
- total: 0,
- sortOrder: 'asc',
- pageSize: 10,
- currentPage: 1,
- stationList: [],
- stationCode: [],
- searchForm: {},
- tableData: [],
- nameList: [],
- loading: false,
- modId: '',//备用id
- lineColor: '#3b3b3b',
- forecastTypeList: [
- {
- label: "短期",
- value: "dq"
- },
- {
- label: "超短期",
- value: "cdq"
- }
- ],
- forecastType: "dq",
- ago: 1,
- forecastTypeInfo: "",
- agoInfo: "",
- stationCodeInfo: "",
- pickerOptions: {
- disabledDate: (time) => {
- return time.getTime() > new Date(new Date().toLocaleDateString()).getTime() -1
- }
- },
- }
- },
- created() {
- this.getStationCode()
- },
- mounted() {
- },
- beforeDestroy() {
- if (this.zqlChart) {
- this.zqlChart.dispose()
- this.zqlChart = null
- }
- if (this.pcChart) {
- this.pcChart.dispose()
- this.pcChart = null
- }
- },
- computed: {},
- methods: {
- cellClassName({row, rowIndex, column, columnIndex}) {
- if (columnIndex == 10) {
- if (row.cz === '—') {
- return "class-style-yellow"
- }
- if (row.cz != '' && row.cz != undefined && row.cz != 0) {
- return "class-style-red"
- }
- }
- },
- tabClick(tab) {
- if (this.activeName == 'second') {
- this.$nextTick(function () {
- this.wsChart.resize();
- })
- }
- },
- nameFormat({cellValue, row, column}) {
- const item = this.nameList.find(item => item.value === cellValue)
- return item ? item.label : ''
- },
- stationCodeFormat({cellValue, row, column}) {
- const item = this.stationList.find(item => item.value === cellValue)
- return item ? item.label : ''
- },
- handlePageChange({currentPage, pageSize}) {
- this.currentPage = currentPage
- this.pageSize = pageSize
- },
- async dataQuery() {
- let startTime = Math.round(this.dateTime[0])
- let endTime = Math.round(this.dateTime[1])
- if (endTime <= startTime) {
- this.$message.warning("开始时间不能大于结束时间")
- return
- }
- if (endTime - startTime > 60 * 60 * 24 * 1000 * 30) {
- this.$message.warning("查询数据不能超过30天!")
- return
- }
- let queryParams = {
- "stationCode": this.stationCode,
- "startTime": startTime,
- "endTime": endTime,
- "forecastType": this.forecastType,
- "dataSources": 'E4',
- "forecastModel": '',
- "ago": this.ago
- }
- this.loading = true
- this.$axios.get('/accuracyPassRate/getByTimeBetweenAndForecastTypeAndDataSourcesAndForecastModelAndStationCode', {params: queryParams}).then(response => {
- this.agoInfo = this.points().filter(s => s.value == this.ago)[0].label
- this.forecastTypeInfo = this.forecastTypeList.filter(s => s.value == this.forecastType)[0].label
- this.stationCodeInfo = this.stationList.filter(s => s.value == this.stationCode)[0].label
- this.tableData = response.data
- this.total = response.data.length
- let times = []
- let pcDatas = []
- let zqlDatas = []
- this.tableData.forEach(t => {
- times.push(t.time)
- zqlDatas.push(t.accuracy.replace("%", ""))
- pcDatas.push(t.deviationSum == null ? "" : t.deviationSum.replace("%", ""))
- })
- this.pcDraw(times, pcDatas)
- this.zqlDraw(times, zqlDatas,this.forecastType)
- this.loading = false
- }).catch(() => {
- this.loading = false
- })
- },
- getStationCode() {
- this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
- this.stationList = response.data
- if (this.stationList.length > 0) {
- this.stationCode = this.stationList[0].value
- this.dataQuery()
- }
- })
- },
- zqlDraw(times, datas,forecastType) {
- this.zqlChart = echarts.init(document.getElementById('zqlCharts'), "dark", {renderer: 'svg'})
- let option = {
- backgroundColor: 'transparent',
- title: {
- top: 20,
- text: '准确率(%)',
- textStyle: {
- fontWeight: 'normal',
- fontSize: 16,
- // //color: this.lineColor
- },
- left: '1%'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- lineStyle: {
- color: '#57617B'
- }
- }
- },
- legend: {
- top: 20,
- width: '70%',
- icon: 'rect',
- itemWidth: 14,
- itemHeight: 5,
- itemGap: 13,
- data: ["准确率(%)"],
- right: '4%',
- textStyle: {
- fontSize: 12,
- // //color: this.lineColor
- },
- selected: {}
- },
- dataZoom: [{
- show: true,
- realtime: true,
- start: 0,
- end: 100,
- top: "90%",
- left: "15%",
- right: "15%",
- textStyle: {
- // //color: this.lineColor
- }
- }, {
- type: 'inside'
- }],
- grid: {
- top: '12%',
- left: '3%',
- right: '4%',
- bottom: '10%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- axisLine: {
- lineStyle: {
- //color: this.lineColor
- }
- },
- data: times
- }],
- yAxis: [{
- type: 'value',
- // name: '%',
- max: 100,
- min: 0,
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- //color: this.lineColor
- }
- },
- axisLabel: {
- margin: 10,
- textStyle: {
- fontSize: 14,
- //color: this.lineColor
- },
- formatter: '{value}',
- },
- splitLine: {
- lineStyle: {
- color: '#57617B'
- }
- }
- }],
- }
- if (forecastType === 'cdq'){
- option.series=[
- {
- name: '准确率(%)',
- type: 'line',
- smooth: false,
- symbol: 'circle',
- symbolSize: 5,
- showSymbol: true,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- markLine: {
- silent: true,
- itemStyle: {
- normal: {
- show: true,
- color: 'red'
- }
- },
- data: [{
- label: {
- position: 'start',
- formatter: "合格(75%)"
- },
- yAxis: 75
- }]
- },
- itemStyle: {
- normal: {
- color: 'rgb(213,219,50)',
- borderColor: 'rgba(16,217,16,0.96)',
- borderWidth: 12
- }
- },
- data: datas
- }
- ]
- }else {
- option.series= [
- {
- name: '准确率(%)',
- type: 'line',
- smooth: false,
- symbol: 'circle',
- symbolSize: 5,
- showSymbol: true,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- markLine: {
- silent: true,
- itemStyle: {
- normal: {
- show: true,
- color: 'red'
- }
- },
- },
- itemStyle: {
- normal: {
- color: 'rgb(213,219,50)',
- borderColor: 'rgba(16,217,16,0.96)',
- borderWidth: 12
- }
- },
- data: datas
- }
- ]
- }
- this.zqlChart.setOption(option, true)
- var _this = this
- window.addEventListener("resize", function () {
- _this.zqlChart.resize();
- });
- },
- pcDraw(times, datas) {
- this.pcChart = echarts.init(document.getElementById('pcCharts'), "dark", {renderer: 'svg'})
- let option = {
- backgroundColor: 'transparent',
- title: {
- top: 20,
- text: '单点平均偏差(cap*%)',
- textStyle: {
- fontWeight: 'normal',
- fontSize: 16,
- //color: this.lineColor
- },
- left: '1%'
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- lineStyle: {
- color: '#57617B'
- }
- }
- },
- legend: {
- top: 20,
- width: '70%',
- icon: 'rect',
- itemWidth: 14,
- itemHeight: 5,
- itemGap: 13,
- data: ["单点平均偏差(cap*%)"],
- right: '4%',
- textStyle: {
- fontSize: 12,
- //color: this.lineColor
- },
- selected: {}
- },
- dataZoom: [{
- show: true,
- realtime: true,
- start: 0,
- end: 100,
- left: "15%",
- right: "15%",
- top: "90%",
- textStyle: {
- //color: this.lineColor
- }
- }, {
- type: 'inside'
- }],
- grid: {
- top: 100,
- left: '4%',
- right: '4%',
- bottom: '10%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- axisLine: {
- lineStyle: {
- //color: this.lineColor
- }
- },
- data: times
- }],
- yAxis: [{
- type: 'value',
- name: 'cap*h',
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- //color: this.lineColor
- }
- },
- axisLabel: {
- margin: 10,
- textStyle: {
- fontSize: 14,
- //color: this.lineColor
- },
- formatter: '{value}',
- },
- splitLine: {
- lineStyle: {
- color: '#57617B'
- }
- }
- }],
- series: [
- {
- name: '单点平均偏差(cap*%)',
- type: 'line',
- smooth: false,
- symbol: 'circle',
- symbolSize: 5,
- showSymbol: true,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- itemStyle: {
- normal: {
- color: 'rgb(140,50,219)',
- borderColor: 'rgba(140,50,219,0.2)',
- borderWidth: 12
- }
- },
- data: datas
- }
- ]
- }
- this.pcChart.setOption(option, true)
- var _this = this
- window.addEventListener("resize", function () {
- _this.pcChart.resize();
- });
- },
- points() {
- let points = []
- if (this.forecastType == 'dq') {
- for (let i = 1; i < 11; i++) {
- points.push({label: i + "", value: i})
- }
- } else {
- for (let i = 1; i < 17; i++) {
- points.push({label: i + "", value: i})
- }
- }
- return points
- }
- },
- }
- </script>
- <style scoped>
- /* //然后给对应的单元格样式 */
- >>> .vxe-table .vxe-body--row .vxe-body--column.class-style-yellow {
- background-color: #FFFF00;
- }
- >>> .vxe-table .vxe-body--row .vxe-body--column.class-style-red {
- background-color: #FF0000;
- color: #ffffff;
- }
- </style>
- <!-->>>.vxe-table .vxe-body--row .vxe-body--column.class-style .vxe-cell .vxe-cell--label{-->
|