WindFarmcard.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. <template>
  2. <view>
  3. <view class="windStationCard" @tap="common.navTo('/components/windStationCardDetail/WindStationCardDetail?option=' + plusDrawerList.name.substring(0,2) )" v-if="plusDrawerList.windId!=0">
  4. <view class="windStationTitle">{{plusDrawerList.name}}</view>
  5. <view class="powerAndSpeedContainer">
  6. <view class="powerAndSpeedRed">
  7. 预测发(万kwh):
  8. <span v-if="cardmodule"></span>
  9. <span v-if="cardmodule==false">{{index_windStation_cardmodule.ycdl}}</span>
  10. </view>
  11. <view class="powerAndSpeedRed">
  12. 日发(万kwh):
  13. <span v-if="cardmodule"></span>
  14. <span v-if="cardmodule==false"> {{index_windStation_cardmodule.rfdl}}</span>
  15. </view>
  16. <view class="powerAndSpeedRed">
  17. 实风速(m/s):
  18. <span v-if="cardmodule"></span>
  19. <span v-if="cardmodule==false"> {{ index_windStation_cardmodule.ssfs}}</span>
  20. </view>
  21. <view class="powerAndSpeedRed">
  22. 实功率(万kw):
  23. <span v-if="cardmodule"></span>
  24. <span v-if="cardmodule==false"> {{ index_windStation_cardmodule.ssgl}}</span>
  25. </view>
  26. </view>
  27. <!-- HQChart图 -->
  28. <view class="UChartContainer">
  29. <view class="windStationUChart">
  30. <view class="windStationQiun-charts">
  31. <canvas canvas-id="windStationCanvasLineC" id="windStationCanvasLineC" class="windStationCharts" @touchstart="touchLineB3"></canvas>
  32. </view>
  33. </view>
  34. <view class="UChartTitle">风速功率曲线图</view>
  35. </view>
  36. <view class="fanStatusContainer">
  37. <view class="fanStatus">
  38. <view class="statusIcon">
  39. <image src="../../static/picture/001.png" style="width: 16px;height: 16px;margin-top: 7px;"></image>
  40. </view>
  41. <span v-if="module">接入&nbsp;&nbsp;0</span>
  42. <span v-if="module==false">接入&nbsp;&nbsp;{{ fdcstatusmodule.jr }}</span>
  43. </view>
  44. <view class="fanStatus">
  45. <view class="statusIcon">
  46. <image src="../../static/picture/002.png" style="width: 16px;height: 16px;margin-top: 7px;"></image>
  47. </view>
  48. <span v-if="module">待机&nbsp;&nbsp;0</span>
  49. <span v-if="module==false">待机&nbsp;&nbsp;{{ fdcstatusmodule.dj }}</span>
  50. </view>
  51. <view class="fanStatus">
  52. <view class="statusIcon">
  53. <image src="../../static/picture/003.png" style="width: 16px;height: 16px;margin-top: 7px;"></image>
  54. </view>
  55. <span v-if="module">运行&nbsp;&nbsp;0</span>
  56. <span v-if="module==false">运行&nbsp;&nbsp;{{ fdcstatusmodule.yx }}</span>
  57. </view>
  58. <view class="fanStatus">
  59. <view class="statusIcon">
  60. <image src="../../static/picture/004.png" style="width: 16px;height: 16px;margin-top: 7px;"></image>
  61. </view>
  62. <span v-if="module">故障&nbsp;&nbsp;0</span>
  63. <span v-if="module==false">故障&nbsp;&nbsp;{{ fdcstatusmodule.gz }}</span>
  64. </view>
  65. <view class="fanStatus">
  66. <view class="statusIcon">
  67. <image src="../../static/picture/005.png" style="width: 16px;height: 16px;margin-top: 7px;"></image>
  68. </view>
  69. <span v-if="module">维护&nbsp;&nbsp;0</span>
  70. <span v-if="module==false">维护&nbsp;&nbsp;{{ fdcstatusmodule.wh }}</span>
  71. </view>
  72. <view class="fanStatus">
  73. <view class="statusIcon">
  74. <image src="../../static/picture/006.png" style="width: 16px;height: 16px;margin-top: 7px;"></image>
  75. </view>
  76. <span v-if="module">离线&nbsp;&nbsp;0</span>
  77. <span v-if="module==false">离线&nbsp;&nbsp;{{ fdcstatusmodule.lx }}</span>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. import uCharts from '../tools/u-charts/u-charts.js';
  85. var _self;
  86. var canvaLineB3 = null;
  87. export default {
  88. data: function() {
  89. return {
  90. index_windStation_cardmodule: [],
  91. fdcstatusmodule:[],
  92. lineChartdata:[],
  93. userRights_FDC: [],
  94. cardmodule: true,
  95. module: true,
  96. windStationCardCWidth: '',
  97. windStationCardCHeight: '',
  98. windStationCardPixelRatio: 1,
  99. plusDrawerList: [],
  100. }
  101. },
  102. onLoad: function() {
  103. this.windStationCardCWidth = 250;
  104. this.windStationCardCHeight = 150;
  105. },
  106. methods: {
  107. getWindfieldid:function(plusDrawerList) {
  108. this.plusDrawerList = plusDrawerList;
  109. },
  110. getWindfielddata:function(index_windStation_cardmodule){
  111. this.cardmodule = false;
  112. this.index_windStation_cardmodule = [];
  113. this.index_windStation_cardmodule = index_windStation_cardmodule;
  114. },
  115. getHoursWeatherData: function(fdcstatusmodule) {
  116. this.module = false;
  117. this.fdcstatusmodule = fdcstatusmodule;
  118. },
  119. getUchartData:function(lineChartdata){
  120. this.lineChartdata = [];
  121. this.lineChartdata = lineChartdata;
  122. this.getLinAcharts();
  123. },
  124. getLinAcharts: function() {
  125. Date.prototype.Format = function(fmt) {
  126. var o = {
  127. 'M+': this.getMonth() + 1, //月份
  128. 'd+': this.getDate(), //日
  129. 'h+': this.getHours(), //小时
  130. 'm+': this.getMinutes(), //分
  131. 's+': this.getSeconds(), //秒
  132. 'q+': Math.floor((this.getMonth() + 3) / 3), //季度
  133. S: this.getMilliseconds() //毫秒
  134. };
  135. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
  136. for (var k in o)
  137. if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[
  138. k]).substr(('' + o[k]).length));
  139. return fmt;
  140. };
  141. let LineC = {
  142. categories: [],
  143. series: [{
  144. name: '功率',
  145. data: [],
  146. color: '#4BB94B',
  147. textColor: '#FFFFFF',
  148. textSize: this.seriesTextSize,
  149. format: val => {
  150. return val + 'kwh';
  151. },
  152. index: 0,
  153. legendShape: 'circle'
  154. },
  155. {
  156. name: '风速',
  157. data: [],
  158. color: '#E82E2F',
  159. textColor: '#FFFFFF',
  160. textSize: this.seriesTextSize,
  161. format: val => {
  162. return val + 'm/s';
  163. },
  164. index: 1,
  165. legendShape: 'circle'
  166. },
  167. {
  168. name: '理论功率',
  169. data: [],
  170. color: '#F5A83C',
  171. textColor: '#FFFFFF',
  172. textSize: this.seriesTextSize,
  173. format: val => {
  174. return val + 'kwh';
  175. },
  176. index: 0,
  177. legendShape: 'circle'
  178. },
  179. {
  180. name: '预测功率',
  181. data: [],
  182. color: '#4A80B1',
  183. textColor: '#FFFFFF',
  184. textSize: this.seriesTextSize,
  185. format: val => {
  186. return val + 'kwh';
  187. },
  188. index: 1,
  189. legendShape: 'circle'
  190. }
  191. ],
  192. };
  193. let _this = this;
  194. LineC.categories = [];
  195. LineC.series[0].data = [];
  196. console.log( _this.lineChartdata)
  197. for (var i = 0; i < _this.lineChartdata.length; i++) {
  198. let time = new Date(
  199. _this.lineChartdata[i].value2.pointTime * 1000
  200. ).Format('hh');
  201. // console.log(time)
  202. LineC.categories.push(time);
  203. //console.log(_this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule['MHS_FDC']['gl'][i].pointValueInDouble);
  204. LineC.series[0].data.push(
  205. _this.lineChartdata[i].value2.pointValueInDouble
  206. );
  207. LineC.series[1].data.push(
  208. _this.lineChartdata[i].value4.pointValueInDouble
  209. );
  210. LineC.series[2].data.push(
  211. _this.lineChartdata[i].value3.pointValueInDouble
  212. );
  213. LineC.series[3].data.push(
  214. _this.lineChartdata[i].value1.pointValueInDouble
  215. );
  216. }
  217. _this.showWindStationCardLineA3('windStationCanvasLineC', LineC);
  218. },
  219. showWindStationCardLineA3(canvasId, chartData) {
  220. var _self = this;
  221. canvaLineB3 = new uCharts({
  222. $this: _self,
  223. canvasId: canvasId,
  224. type: 'line',
  225. fontSize: 11,
  226. legend: {
  227. show: true,
  228. position: 'top',
  229. float: 'right',
  230. fontColor: 'silver',
  231. itemGap: '9',
  232. itemWidth: '3'
  233. },
  234. dataLabel: false,
  235. dataPointShape: false,
  236. background: '#FFFFFF',
  237. pixelRatio: _self.windStationCardPixelRatio,
  238. categories: chartData.categories,
  239. series: chartData.series,
  240. animation: true,
  241. xAxis: {
  242. disableGrid: true,
  243. type: 'grid',
  244. gridColor: 'silver',
  245. fontColor: 'silver',
  246. gridType: 'solid',
  247. gridColor: '#2E2E2E',
  248. axisLineColor: '#2E2E2E',
  249. labelCount: '3'
  250. // itemCount:"3"
  251. },
  252. yAxis: {
  253. data: [{
  254. type: 'value',
  255. fontColor: 'silver',
  256. disabled: false, //y轴轴线
  257. min: 0,
  258. max: 40,
  259. position: 'left',
  260. axisLineColor: '#2E2E2E',
  261. title: ' 风速:(m/s)',
  262. titleFontColor: 'silver'
  263. },
  264. {
  265. fontColor: 'silver',
  266. disabled: false, //y轴轴线
  267. min: 0,
  268. max: 40,
  269. position: 'right',
  270. axisLineColor: '#2E2E2E',
  271. title: '功率:(kwh)',
  272. titleFontColor: 'silver'
  273. }
  274. ],
  275. disabled: true,
  276. gridColor: '#2E2E2E',
  277. splitNumber: 4,
  278. gridType: 'solid',
  279. dashLength: 8,
  280. showTitle: 'true',
  281. format: val => {
  282. return val.toFixed(0) + '元';
  283. }
  284. },
  285. width: _self.windStationCardCWidth * _self.windStationCardPixelRatio,
  286. height: _self.windStationCardCHeight * _self.windStationCardPixelRatio,
  287. padding: [10, 0, 0, 0], //画布填充边距,顺序为上右下左,同css,但必须4位
  288. extra: {
  289. line: {
  290. type: 'line',
  291. width: '1'
  292. }
  293. }
  294. });
  295. },
  296. touchLineB3(e) {
  297. canvaLineB3.showToolTip(e, {
  298. format: function(item, category) {
  299. return category + ' ' + item.name + ':' + item.data;
  300. }
  301. });
  302. },
  303. }
  304. }
  305. </script>
  306. <style>
  307. page {
  308. /* background-color: #242424; */
  309. }
  310. .windStation {
  311. clear: both;
  312. width: calc(100% - 18%);
  313. margin-left: 9px;
  314. height: 350px;
  315. color: silver;
  316. margin-bottom: 0px;
  317. background-color: #242424;
  318. }
  319. .scrollWindStationCard {
  320. white-space: nowrap;
  321. }
  322. .windStationCard {
  323. width: 250px;
  324. height: 100%;
  325. margin-right: 9px;
  326. float: left;
  327. background-color: #242424;
  328. }
  329. .windStationCardContainer {
  330. width: 100%;
  331. height: 350px;
  332. margin-top: 10px;
  333. }
  334. .windStationTitle {
  335. width: 90%;
  336. height: 30px;
  337. line-height: 30px;
  338. font-size: 12px;
  339. margin-left: 5px;
  340. }
  341. .powerAndSpeedContainer {
  342. width: 100%;
  343. height: 90px;
  344. }
  345. .powerAndSpeedRed {
  346. margin-top: 8px;
  347. margin-left: 2%;
  348. margin-right: 2%;
  349. width: 46%;
  350. height: 37px;
  351. line-height: 37px;
  352. text-align: left;
  353. font-size: 12px;
  354. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  355. border-radius: 5px;
  356. float: left;
  357. }
  358. .UChartContainer {
  359. width: 250px;
  360. height: 150px;
  361. margin-top: 8px;
  362. }
  363. .windStationUChart {
  364. width: 250px;
  365. height: 150px;
  366. position: absolute;
  367. }
  368. .windStationQiun-charts {
  369. width: 250px;
  370. height: 150px;
  371. background-color: #242424;
  372. }
  373. .windStationCharts {
  374. width: 250px;
  375. height: 150px;
  376. background-color: #242424;
  377. }
  378. .fanStatusContainer {
  379. width: 100%;
  380. height: 70px;
  381. }
  382. .fanStatus {
  383. width: 32%;
  384. height: 30px;
  385. margin-top: 5px;
  386. margin-right: 0.5%;
  387. margin-left: 0.5%;
  388. float: left;
  389. }
  390. .fanStatus {
  391. height: 30px;
  392. line-height: 30px;
  393. font-size: 12px;
  394. }
  395. .statusIcon {
  396. width: 22px;
  397. height: 30px;
  398. margin-left: 3px;
  399. float: left;
  400. }
  401. .UChartTitle {
  402. position: relative;
  403. top: -2px;
  404. left: 2px;
  405. font-size: 12px;
  406. width: 100px;
  407. }
  408. </style>