forecast-system.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <template>
  2. <div class="forecast-system">
  3. <div class="action-bar mg-b-16">
  4. <div class="selections">
  5. <!-- <div class="item" @click="tabSelect(0)" :class="{ active: tabIndex == 0 }">麻黄山</div>
  6. <div class="item" @click="tabSelect(1)" :class="{ active: tabIndex == 1 }">牛首山</div>
  7. <div class="item" @click="tabSelect(2)" :class="{ active: tabIndex == 2 }">青山</div>
  8. <div class="item" @click="tabSelect(3)" :class="{ active: tabIndex == 3 }">石板泉</div>
  9. <div class="item" @click="tabSelect(3)" :class="{ active: tabIndex == 4 }">香山</div> -->
  10. <div class="item" v-for="(item) of wpList" :key="item"
  11. @click="tabSelect(item)" :class="{ active: wpId == item.id }">{{item.name}}</div>
  12. </div>
  13. </div>
  14. <div class="page-body">
  15. <el-row class="mg-b-16">
  16. <el-col :span="5" class="fc-info">
  17. <div class="fc-item">
  18. <div class="title">{{wpName}}</div>
  19. <div class="tags">
  20. <div class="tag">
  21. <i class="svg-icon svg-icon-gray-l svg-icon-lg">
  22. <svg-icon :svgid="'svg-' + weatherInfo.tqtp"/>
  23. </i>
  24. </div>
  25. <div class="tag">
  26. <div class="tag-title">风速</div>
  27. <div class="tag-value">{{weatherInfo.fs}}<span class="unit">m/s</span></div>
  28. </div>
  29. <div class="tag">
  30. <div class="tag-title">风向</div>
  31. <div class="tag-value">{{weatherInfo.fx}}<span class="unit"></span></div>
  32. </div>
  33. <div class="tag">
  34. <div class="tag-title">清晰度</div>
  35. <div class="tag-value">{{weatherInfo.qxd}}<span class="unit"></span></div>
  36. </div>
  37. <div class="tag">
  38. <div class="tag-title">温度</div>
  39. <div class="tag-value">{{weatherInfo.wd}}<span class="unit">℃</span></div>
  40. </div>
  41. <div class="tag">
  42. <div class="tag-title">大气压强</div>
  43. <div class="tag-value">{{weatherInfo.dqyl}}<span class="unit">hPa</span></div>
  44. </div>
  45. <div class="tag">
  46. <div class="tag-title">湿度</div>
  47. <div class="tag-value">{{weatherInfo.sd}}<span class="unit">%</span></div>
  48. </div>
  49. <div class="tag">
  50. <div class="tag-title">经度</div>
  51. <div class="tag-value">{{weatherInfo.jingdu}}<span class="unit"></span></div>
  52. </div>
  53. <div class="tag">
  54. <div class="tag-title">纬度</div>
  55. <div class="tag-value">{{weatherInfo.weidu}}<span class="unit"></span></div>
  56. </div>
  57. <div class="tag">
  58. <div class="tag-title">云量</div>
  59. <div class="tag-value">{{weatherInfo.yunliang}}<span class="unit"></span></div>
  60. </div>
  61. <div class="tag">
  62. <div class="tag-title">日出时间</div>
  63. <div class="tag-value">{{weatherInfo.richushijian}}<span class="unit"></span></div>
  64. </div>
  65. <div class="tag">
  66. <div class="tag-title">日落时间</div>
  67. <div class="tag-value">{{weatherInfo.riluoshijian}}<span class="unit"></span></div>
  68. </div>
  69. </div>
  70. </div>
  71. </el-col>
  72. <el-col :span="19">
  73. <panel :title="'损失电量分析'">
  74. <multiple-bar-line-chart :height="'100%'"
  75. :lineData="chart1Line" :barData="chart1Bar"
  76. :units="['功率(万kW)','电量(万kWh)']"/>
  77. </panel>
  78. </el-col>
  79. </el-row>
  80. <el-row class="bottom-charts">
  81. <el-col :span="12">
  82. <panel :title="'超短期风功率预测'">
  83. <arrow-line-chart :width="'100%'" :height="'100%'" :list="chart2List" :units="['功率(万kW)','风速(m/s)']"/>
  84. </panel>
  85. </el-col>
  86. <el-col :span="12">
  87. <panel :title="'短期风功率预测'">
  88. <arrow-line-chart :height="'100%'" :list="chart3List" :units="['功率(万kW)','风速(m/s)']"/>
  89. </panel>
  90. </el-col>
  91. </el-row>
  92. </div>
  93. </div>
  94. </template>
  95. <script>
  96. // import MultipleBarLineChart from "../../components/chart/combination/multiple-bar-line-chart.vue";
  97. import MultipleBarLineChart from "./multiple-bar-line-chart1.vue";
  98. // import ArrowLineChart from "../../components/chart/line/arrow-line-chart.vue";
  99. import ArrowLineChart from "./arrow-line-chart.vue";
  100. import svgIcon from "../../components/coms/icon/svg-icon.vue";
  101. import Panel from "../../components/coms/panel/panel.vue";
  102. export default {
  103. components: { svgIcon, MultipleBarLineChart, Panel, ArrowLineChart },
  104. setup() {},
  105. data() {
  106. return {
  107. wpList:[],
  108. wpId:"MHS_FDC",
  109. wpName:"麻黄山风电场",
  110. weatherInfo:{},
  111. chart1Bar:[],
  112. chart1Line:[],
  113. chart2List:[],
  114. chart3List:[],
  115. timer:null,
  116. };
  117. },
  118. methods: {
  119. tabSelect(item) {
  120. this.wpId = item["id"];
  121. this.wpName = item["name"];
  122. {
  123. this.getData();
  124. this.getChart1();
  125. this.getChart3();
  126. }
  127. },
  128. async getWp() {
  129. const res = await this.API.requestData({
  130. method: "GET",
  131. subUrl: "powercompare/windfarmAllAjax"
  132. });
  133. if(res) {
  134. this.wpList = res.data.data.filter(ele=>{
  135. return ele.id.indexOf("_FDC")>-1;
  136. });
  137. }
  138. },
  139. async getData() {
  140. const res = await this.API.requestData({
  141. method: "POST",
  142. subUrl: "weather/weatherInfo",
  143. data:{wpId:this.wpId}
  144. });
  145. if(res) {
  146. console.log('resWeather:',res)
  147. this.weatherInfo = res.data.data;
  148. }
  149. },
  150. async getChart1() {
  151. const res = await this.API.requestData({
  152. method: "POST",
  153. subUrl: "weather/powerChart",
  154. data:{wpId:this.wpId}
  155. });
  156. if(res) {
  157. const fdlValue = {title:"电量",yAxisIndex:0,value:[]};
  158. const glValue = {title:"功率",yAxisIndex:1,value:[]};
  159. const fsValue = {name:"风速",unit:"m/s",data:[]};
  160. res.data.data.forEach(e => {
  161. if(fdlValue.value.length == 0){
  162. fdlValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: 0});
  163. }else{
  164. fdlValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value1});
  165. }
  166. glValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value2});
  167. fsValue.data.push(e.value3);
  168. });
  169. this.chart1Bar = [fdlValue,glValue];
  170. this.chart1Line = fsValue;
  171. }
  172. },
  173. async getChart3() {
  174. const res = await this.API.requestData({
  175. method: "POST",
  176. subUrl: "weather/weatherChart",
  177. data:{wpId:this.wpId}
  178. });
  179. if(res) {
  180. // 短期预测功率
  181. {
  182. const ycglValue = {title:"预测功率",yAxisIndex:0,value:[]};
  183. const sjglValue = {title:"实际功率",yAxisIndex:0,value:[]};
  184. const fsValue = {title:"风速",yAxisIndex:1,value:[]};
  185. let hour = new Date().getHours();
  186. res.data.data.forEach(e => {
  187. if(ycglValue.value.length<=(24+hour)) {
  188. ycglValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value7});
  189. sjglValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value2});
  190. fsValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value6});
  191. }
  192. });
  193. this.chart3List = [ycglValue,sjglValue,fsValue];
  194. }
  195. // 超短期预测功率
  196. const cdqGlValue = {title:"预测功率",yAxisIndex:0,value:[]};
  197. const sjglValue = {title:"实际功率",yAxisIndex:0,value:[]};
  198. const fsValue = {title:"风速",yAxisIndex:1,value:[]};
  199. let hour = new Date().getHours();
  200. res.data.data.forEach(e => {
  201. if(cdqGlValue.value.length<=(4+hour)) {
  202. cdqGlValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value4});
  203. sjglValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value2});
  204. fsValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value6});
  205. }
  206. });
  207. this.chart2List = [cdqGlValue,sjglValue,fsValue];
  208. }
  209. },
  210. },
  211. created() {
  212. this.getWp();
  213. let that = this;
  214. that.$nextTick(() => {
  215. that.getData();
  216. that.getChart1()
  217. that.getChart3();
  218. that.timer = setInterval(() => {
  219. that.getData();
  220. that.getChart1()
  221. that.getChart3();
  222. }, 60000);
  223. });
  224. },
  225. unmounted() {
  226. clearInterval(this.timer);
  227. this.timer = null;
  228. },
  229. };
  230. </script>
  231. <style lang="less">
  232. .forecast-system {
  233. .com-panel{
  234. .panel-body{
  235. height: 43vh;
  236. }
  237. }
  238. .bottom-charts{
  239. .panel-body{
  240. height: 35vh;
  241. }
  242. }
  243. .action-bar {
  244. .selections {
  245. flex: 1 0 auto;
  246. display: flex;
  247. .item {
  248. flex: 0 0 94px;
  249. text-align: center;
  250. height: 33px;
  251. line-height: 33px;
  252. margin-right: 8px;
  253. color: @font-color;
  254. font-size: @fontsize-s;
  255. background: fade(@gray, 20);
  256. border: 1px solid fade(@gray, 20);
  257. &:hover,
  258. &.active {
  259. background: fade(@green, 20);
  260. border: 1px solid @green;
  261. color: @green;
  262. cursor: pointer;
  263. }
  264. }
  265. }
  266. }
  267. // 风场信息
  268. .fc-info {
  269. .fc-item {
  270. & > .title {
  271. background: fade(@gray, 20);
  272. padding: 0 1.4815vh;
  273. line-height: 27px;
  274. color: fade(@white, 75);
  275. font-size: @fontsize-s;
  276. margin-bottom: 0.7407vh;
  277. }
  278. & + .fc-item {
  279. margin-left: 8px;
  280. }
  281. .tags {
  282. display: flex;
  283. flex-wrap: wrap;
  284. .tag {
  285. flex: 1 0 calc(100% / 3 - 8px);
  286. background: fade(@gray, 20);
  287. margin-bottom: 8px;
  288. height: 10vh;
  289. .tag-title {
  290. font-size: 12px;
  291. color: @gray-l;
  292. line-height: 24px;
  293. background: fade(@gray, 40);
  294. text-align: center;
  295. }
  296. .tag-value {
  297. position: relative;
  298. font-size: 20px;
  299. color: @green;
  300. text-align: center;
  301. padding: 3vh 0;
  302. .unit {
  303. position: absolute;
  304. color: @gray;
  305. font-size: 12px;
  306. bottom: 8px;
  307. right: 8px;
  308. top: 40%;
  309. }
  310. }
  311. & + .tag {
  312. margin-left: 8px;
  313. }
  314. &:nth-child(1) {
  315. display: flex;
  316. justify-content: center;
  317. align-items: center;
  318. i {
  319. width: 56px;
  320. height: 56px;
  321. svg {
  322. width: 56px;
  323. height: 56px;
  324. }
  325. }
  326. }
  327. &:nth-child(3n + 1) {
  328. margin-left: 0px;
  329. }
  330. }
  331. }
  332. }
  333. }
  334. }
  335. </style>