forecast-system.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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 :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 ArrowLineChart from "../../components/chart/line/arrow-line-chart.vue";
  98. import svgIcon from "../../components/coms/icon/svg-icon.vue";
  99. import Panel from "../../components/coms/panel/panel.vue";
  100. export default {
  101. components: { svgIcon, MultipleBarLineChart, Panel, ArrowLineChart },
  102. setup() {},
  103. data() {
  104. return {
  105. wpList:[],
  106. wpId:"MHS_FDC",
  107. wpName:"麻黄山风电场",
  108. weatherInfo:{},
  109. chart1Bar:[],
  110. chart1Line:[],
  111. chart2List:[],
  112. chart3List:[],
  113. timer:null,
  114. };
  115. },
  116. methods: {
  117. tabSelect(item) {
  118. this.wpId = item["id"];
  119. this.wpName = item["name"];
  120. {
  121. this.getData();
  122. this.getChart1();
  123. this.getChart3();
  124. }
  125. },
  126. async getWp() {
  127. const res = await this.API.requestData({
  128. method: "GET",
  129. subUrl: "powercompare/windfarmAllAjax"
  130. });
  131. if(res) {
  132. this.wpList = res.data.data.filter(ele=>{
  133. return ele.id.indexOf("_FDC")>-1;
  134. });
  135. }
  136. },
  137. async getData() {
  138. const res = await this.API.requestData({
  139. method: "POST",
  140. subUrl: "weather/weatherInfo",
  141. data:{wpId:this.wpId}
  142. });
  143. if(res) {
  144. this.weatherInfo = res.data.data;
  145. }
  146. },
  147. async getChart1() {
  148. const res = await this.API.requestData({
  149. method: "POST",
  150. subUrl: "weather/powerChart",
  151. data:{wpId:this.wpId}
  152. });
  153. if(res) {
  154. const fdlValue = {title:"电量",yAxisIndex:0,value:[]};
  155. const glValue = {title:"功率",yAxisIndex:1,value:[]};
  156. const fsValue = {name:"风速",unit:"m/s",data:[]};
  157. res.data.data.forEach(e => {
  158. if(fdlValue.value.length == 0){
  159. fdlValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: 0});
  160. }else{
  161. fdlValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value1});
  162. }
  163. glValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value2});
  164. fsValue.data.push(e.value3);
  165. });
  166. this.chart1Bar = [fdlValue,glValue];
  167. this.chart1Line = fsValue;
  168. }
  169. },
  170. async getChart3() {
  171. const res = await this.API.requestData({
  172. method: "POST",
  173. subUrl: "weather/weatherChart",
  174. data:{wpId:this.wpId}
  175. });
  176. if(res) {
  177. // 短期预测功率
  178. {
  179. const ycglValue = {title:"预测功率",yAxisIndex:0,value:[]};
  180. const sjglValue = {title:"实际功率",yAxisIndex:0,value:[]};
  181. const fsValue = {title:"风速",yAxisIndex:1,value:[]};
  182. let hour = new Date().getHours();
  183. res.data.data.forEach(e => {
  184. if(ycglValue.value.length<=(24+hour)) {
  185. ycglValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value7});
  186. sjglValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value2});
  187. fsValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value6});
  188. }
  189. });
  190. this.chart3List = [ycglValue,sjglValue,fsValue];
  191. }
  192. // 超短期预测功率
  193. const cdqGlValue = {title:"预测功率",yAxisIndex:0,value:[]};
  194. const sjglValue = {title:"实际功率",yAxisIndex:0,value:[]};
  195. const fsValue = {title:"风速",yAxisIndex:1,value:[]};
  196. let hour = new Date().getHours();
  197. res.data.data.forEach(e => {
  198. if(cdqGlValue.value.length<=(4+hour)) {
  199. cdqGlValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value4});
  200. sjglValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value2});
  201. fsValue.value.push({text: new Date(e.time).formatDate("hh:mm"),value: e.value6});
  202. }
  203. });
  204. this.chart2List = [cdqGlValue,sjglValue,fsValue];
  205. }
  206. },
  207. },
  208. created() {
  209. this.getWp();
  210. let that = this;
  211. that.$nextTick(() => {
  212. that.getData();
  213. that.getChart1()
  214. that.getChart3();
  215. that.timer = setInterval(() => {
  216. that.getData();
  217. that.getChart1()
  218. that.getChart3();
  219. }, 60000);
  220. });
  221. },
  222. unmounted() {
  223. clearInterval(this.timer);
  224. this.timer = null;
  225. },
  226. };
  227. </script>
  228. <style lang="less">
  229. .forecast-system {
  230. .com-panel{
  231. .panel-body{
  232. height: 43vh;
  233. }
  234. }
  235. .bottom-charts{
  236. .panel-body{
  237. height: 35vh;
  238. }
  239. }
  240. .action-bar {
  241. .selections {
  242. flex: 1 0 auto;
  243. display: flex;
  244. .item {
  245. flex: 0 0 94px;
  246. text-align: center;
  247. height: 33px;
  248. line-height: 33px;
  249. margin-right: 8px;
  250. color: @font-color;
  251. font-size: @fontsize-s;
  252. background: fade(@gray, 20);
  253. border: 1px solid fade(@gray, 20);
  254. &:hover,
  255. &.active {
  256. background: fade(@green, 20);
  257. border: 1px solid @green;
  258. color: @green;
  259. cursor: pointer;
  260. }
  261. }
  262. }
  263. }
  264. // 风场信息
  265. .fc-info {
  266. .fc-item {
  267. & > .title {
  268. background: fade(@gray, 20);
  269. padding: 0 1.4815vh;
  270. line-height: 27px;
  271. color: fade(@white, 75);
  272. font-size: @fontsize-s;
  273. margin-bottom: 0.7407vh;
  274. }
  275. & + .fc-item {
  276. margin-left: 8px;
  277. }
  278. .tags {
  279. display: flex;
  280. flex-wrap: wrap;
  281. .tag {
  282. flex: 1 0 calc(100% / 3 - 8px);
  283. background: fade(@gray, 20);
  284. margin-bottom: 8px;
  285. height: 10vh;
  286. .tag-title {
  287. font-size: 12px;
  288. color: @gray-l;
  289. line-height: 24px;
  290. background: fade(@gray, 40);
  291. text-align: center;
  292. }
  293. .tag-value {
  294. position: relative;
  295. font-size: 20px;
  296. color: @green;
  297. text-align: center;
  298. padding: 3vh 0;
  299. .unit {
  300. position: absolute;
  301. color: @gray;
  302. font-size: 12px;
  303. bottom: 8px;
  304. right: 8px;
  305. top: 40%;
  306. }
  307. }
  308. & + .tag {
  309. margin-left: 8px;
  310. }
  311. &:nth-child(1) {
  312. display: flex;
  313. justify-content: center;
  314. align-items: center;
  315. i {
  316. width: 56px;
  317. height: 56px;
  318. svg {
  319. width: 56px;
  320. height: 56px;
  321. }
  322. }
  323. }
  324. &:nth-child(3n + 1) {
  325. margin-left: 0px;
  326. }
  327. }
  328. }
  329. }
  330. }
  331. }
  332. </style>