index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <!--
  2. - Copyright (c) 2018-2025, lengleng All rights reserved.
  3. -
  4. - Redistribution and use in source and binary forms, with or without
  5. - modification, are permitted provided that the following conditions are met:
  6. -
  7. - Redistributions of source code must retain the above copyright notice,
  8. - this list of conditions and the following disclaimer.
  9. - Redistributions in binary form must reproduce the above copyright
  10. - notice, this list of conditions and the following disclaimer in the
  11. - documentation and/or other materials provided with the distribution.
  12. - Neither the name of the pig4cloud.com developer nor the names of its
  13. - contributors may be used to endorse or promote products derived from
  14. - this software without specific prior written permission.
  15. - Author: lengleng (wangiegie@gmail.com)
  16. -->
  17. <template>
  18. <div class="execution">
  19. <div class="filter">
  20. <div class="endTime" style="display: inline-block">
  21. <span class="timeText" style="font-weight: bold;font-size: 14px">&#12288;超短期日期:</span>
  22. <el-date-picker
  23. value-format="timestamp"
  24. v-model="cdqDate"
  25. :clearable="false"
  26. type="date"
  27. placeholder="选择日期">
  28. </el-date-picker>
  29. </div>
  30. <div class="timeQuery" style="display: inline-block">
  31. &#12288;<el-button size="small" :loading="loading" @click="fetchStationData">查询</el-button>
  32. <el-button size="small" :loading="loading" @click="exportDataEvent">导出</el-button>
  33. </div>
  34. </div>
  35. <div class="station-container">
  36. <el-tabs v-model="activeStation" type="card" @tab-click="handleClick">
  37. <el-tab-pane
  38. v-for="(stationData, stationName) in stationMap"
  39. :key="stationName"
  40. :label="stationName"
  41. :name="stationName"
  42. >
  43. </el-tab-pane>
  44. </el-tabs>
  45. <el-table
  46. :data="tableData"
  47. border
  48. style="width: 100%"
  49. :cell-style="{ textAlign: 'center' }"
  50. v-loading="loading"
  51. height="720"
  52. >
  53. <el-table-column header-align="center" prop="time" label="时间" ></el-table-column>
  54. <el-table-column header-align="center" prop="value1" label="第1点" ></el-table-column>
  55. <el-table-column header-align="center" prop="value2" label="第2点" ></el-table-column>
  56. <el-table-column header-align="center" prop="value3" label="第3点" ></el-table-column>
  57. <el-table-column header-align="center" prop="value4" label="第4点" ></el-table-column>
  58. <el-table-column header-align="center" prop="value5" label="第5点" ></el-table-column>
  59. <el-table-column header-align="center" prop="value6" label="第6点" ></el-table-column>
  60. <el-table-column header-align="center" prop="value7" label="第7点" ></el-table-column>
  61. <el-table-column header-align="center" prop="value8" label="第8点" ></el-table-column>
  62. <el-table-column header-align="center" prop="value9" label="第9点" ></el-table-column>
  63. <el-table-column header-align="center" prop="value10" label="第10点" ></el-table-column>
  64. <el-table-column header-align="center" prop="value11" label="第11点" ></el-table-column>
  65. <el-table-column header-align="center" prop="value12" label="第12点" ></el-table-column>
  66. <el-table-column header-align="center" prop="value13" label="第13点" ></el-table-column>
  67. <el-table-column header-align="center" prop="value14" label="第14点" ></el-table-column>
  68. <el-table-column header-align="center" prop="value15" label="第15点" ></el-table-column>
  69. <el-table-column header-align="center" prop="value16" label="第16点" ></el-table-column>
  70. </el-table>
  71. </div>
  72. </div>
  73. </template>
  74. <script>
  75. import {mapGetters} from 'vuex'
  76. import * as echarts from 'echarts';
  77. import {
  78. queryCharts
  79. } from '@/api/windtotalpowercontrast'
  80. export default {
  81. name: 'forecastReport',
  82. data() {
  83. return {
  84. activeStation: '', // 当前激活的场站名称
  85. stationMap: {}, // 存储所有场站数据
  86. cdqDate: new Date(new Date().toLocaleDateString()).getTime() - 60 * 60 * 24 * 1000,
  87. dynamicColumns: [], // 动态风电场信息,例如: [{ name: '哈斯风电场' }, { name: '千伏苏加风电场' }]
  88. columns: [],
  89. searchForm: {},
  90. tableData: [],
  91. times: [],
  92. page: {
  93. total: 0, // 总页数
  94. currentPage: 1, // 当前页数
  95. pageSize: 20 // 每页显示多少条
  96. },
  97. total: 0, // 总页数
  98. currentPage: 1, // 当前页数
  99. pageSize: 10, // 每页显示多少条
  100. wsChart:null,
  101. tableLoading: false,
  102. stationCode: '',
  103. stationType:'',
  104. stationList: [],
  105. forecastManufactor: '',
  106. forecastManufactorList: [],
  107. resizeKey: 1,
  108. activeName: 'first',
  109. loading: false,
  110. ultraShortData: [],
  111. shortData: [],
  112. powerStationStatusData: [],
  113. timeStamp: [],
  114. arrays: [],
  115. fromHead: []
  116. }
  117. },
  118. computed: {
  119. ...mapGetters(['permissions']),
  120. },
  121. mounted() {
  122. this.$nextTick(() => {
  123. this.$refs.table.doLayout();
  124. });
  125. },
  126. methods: {
  127. // 获取场站数据
  128. async fetchStationData() {
  129. this.loading = true;
  130. var queryParams = {
  131. ycDate:this.ycDate,
  132. cdqDate:this.cdqDate,
  133. sjDate:this.sjDate,
  134. agcDate:this.agcDate
  135. }
  136. this.$axios.get('/ultraForecast16Controller/queryReport',{params: queryParams}).then((res) => {
  137. this.times = res.data.data.times;
  138. this.stationMap = res.data.data.dataMap;
  139. // 设置默认激活第一个场站
  140. const stationNames = Object.keys(this.stationMap);
  141. if (stationNames.length > 0) {
  142. this.activeStation = stationNames[0];
  143. this.tableData = []
  144. const value = this.stationMap[this.activeStation];
  145. for(let i = 0;i< 96;i++){
  146. const temp = {}
  147. temp.time = this.times[i]
  148. temp.value1 = value.value1[i]
  149. temp.value2 = value.value2[i]
  150. temp.value3 = value.value3[i]
  151. temp.value4 = value.value4[i]
  152. temp.value5 = value.value5[i]
  153. temp.value6 = value.value6[i]
  154. temp.value7 = value.value7[i]
  155. temp.value8 = value.value8[i]
  156. temp.value9 = value.value9[i]
  157. temp.value10 = value.value10[i]
  158. temp.value11 = value.value11[i]
  159. temp.value12 = value.value12[i]
  160. temp.value13 = value.value13[i]
  161. temp.value14 = value.value14[i]
  162. temp.value15 = value.value15[i]
  163. temp.value16 = value.value16[i]
  164. this.tableData.push(temp)
  165. }
  166. }
  167. })
  168. this.loading = false;
  169. },
  170. handleClick(tab, event) {
  171. this.tableData = []
  172. const value = this.stationMap[tab.name];
  173. for(let i = 0;i< 96;i++){
  174. const temp = {}
  175. temp.time = this.times[i]
  176. temp.value1 = value.value1[i]
  177. temp.value2 = value.value2[i]
  178. temp.value3 = value.value3[i]
  179. temp.value4 = value.value4[i]
  180. temp.value5 = value.value5[i]
  181. temp.value6 = value.value6[i]
  182. temp.value7 = value.value7[i]
  183. temp.value8 = value.value8[i]
  184. temp.value9 = value.value9[i]
  185. temp.value10 = value.value10[i]
  186. temp.value11 = value.value11[i]
  187. temp.value12 = value.value12[i]
  188. temp.value13 = value.value13[i]
  189. temp.value14 = value.value14[i]
  190. temp.value15 = value.value15[i]
  191. temp.value16 = value.value16[i]
  192. this.tableData.push(temp)
  193. }
  194. },
  195. exportDataEvent() {
  196. this.$axios.get("/ultraForecast16Controller/exportDataEvent/" + this.cdqDate, {
  197. responseType: 'blob'// 用于解决中文乱码
  198. }).then((response) => {
  199. this.loading = false
  200. }).catch((error) => {
  201. this.loading = false
  202. this.$message.error('导出失败' + error)
  203. })
  204. },
  205. getCapacity(param) {
  206. return new Promise(function (resolve, reject) {
  207. getCapacity(param).then(response => {
  208. resolve(response.data.data)
  209. })
  210. })
  211. },
  212. handlePageChange({currentPage, pageSize}) {
  213. this.currentPage = currentPage;//当前页
  214. this.pageSize = pageSize//每页显示的条数
  215. },
  216. refreshChange() {
  217. // this.getCompositeData()
  218. this.getStationCode()
  219. }
  220. }
  221. }
  222. </script>