WindFarmcard.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  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="c"></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. export default {
  85. data: function() {
  86. return {
  87. index_windStation_cardmodule: [],
  88. fdcstatusmodule:[],
  89. lineChartdata:[],
  90. userRights_FDC: [],
  91. cardmodule: true,
  92. module: true,
  93. windStationCardCWidth: '',
  94. windStationCardCHeight: '',
  95. windStationCardPixelRatio: 1,
  96. plusDrawerList: [],
  97. }
  98. },
  99. onLoad: function() {
  100. this.windStationCardCWidth = 250;
  101. this.windStationCardCHeight = 150;
  102. },
  103. methods: {
  104. getWindfieldid:function(plusDrawerList) {
  105. this.plusDrawerList = plusDrawerList;
  106. console.log(this.plusDrawerList)
  107. },
  108. getWindfielddata:function(index_windStation_cardmodule){
  109. this.cardmodule = false;
  110. this.index_windStation_cardmodule = [];
  111. this.index_windStation_cardmodule = index_windStation_cardmodule;
  112. },
  113. getHoursWeatherData: function(fdcstatusmodule) {
  114. this.module = false;
  115. this.fdcstatusmodule = fdcstatusmodule;
  116. },
  117. getUchartData:function(lineChartdata){
  118. this.lineChartdata = [];
  119. this.lineChartdata = lineChartdata;
  120. console.log(this.lineChartdata);
  121. },
  122. getLinAcharts: function() {
  123. let LineC = {
  124. categories: [],
  125. series: [{
  126. name: '功率',
  127. data: [],
  128. color: '#4BB94B',
  129. textColor: '#FFFFFF',
  130. textSize: this.seriesTextSize,
  131. format: val => {
  132. return val + 'kwh';
  133. },
  134. index: 0,
  135. legendShape: 'circle'
  136. },
  137. {
  138. name: '风速',
  139. data: [],
  140. color: '#E82E2F',
  141. textColor: '#FFFFFF',
  142. textSize: this.seriesTextSize,
  143. format: val => {
  144. return val + 'm/s';
  145. },
  146. index: 1,
  147. legendShape: 'circle'
  148. },
  149. {
  150. name: '理论功率',
  151. data: [],
  152. color: '#F5A83C',
  153. textColor: '#FFFFFF',
  154. textSize: this.seriesTextSize,
  155. format: val => {
  156. return val + 'kwh';
  157. },
  158. index: 0,
  159. legendShape: 'circle'
  160. },
  161. {
  162. name: '预测功率',
  163. data: [],
  164. color: '#4A80B1',
  165. textColor: '#FFFFFF',
  166. textSize: this.seriesTextSize,
  167. format: val => {
  168. return val + 'kwh';
  169. },
  170. index: 1,
  171. legendShape: 'circle'
  172. }
  173. ],
  174. };
  175. let _this = this;
  176. LineC.categories = [];
  177. LineC.series[0].data = [];
  178. for (var i = 0; i < _this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule[
  179. 'KB_FDC']['gl'].length; i++) {
  180. let time = new Date(
  181. _this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule['KB_FDC'][
  182. 'gl'
  183. ][i].pointTime * 1000
  184. ).Format('hh');
  185. LineC.categories.push(time);
  186. //console.log(_this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule['MHS_FDC']['gl'][i].pointValueInDouble);
  187. LineC.series[0].data.push(
  188. _this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule['KB_FDC'][
  189. 'gl'
  190. ][i].pointValueInDouble
  191. );
  192. LineC.series[1].data.push(
  193. _this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule['KB_FDC'][
  194. 'fs'
  195. ][i].pointValueInDouble
  196. );
  197. LineC.series[2].data.push(
  198. _this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule['KB_FDC'][
  199. 'llgl'
  200. ][i].pointValueInDouble
  201. );
  202. LineC.series[3].data.push(
  203. _this.index_curve_columnar_windSpeed_powermodule.index_curve_columnar_windSpeed_powermodule['KB_FDC'][
  204. 'ycgl'
  205. ][i].pointValueInDouble
  206. );
  207. }
  208. _this.showWindStationCardLineA3('windStationCanvasLineC', LineC);
  209. },
  210. showWindStationCardLineA3(canvasId, chartData) {
  211. var _self = this;
  212. canvaLineB3 = new uCharts({
  213. $this: _self,
  214. canvasId: canvasId,
  215. type: 'line',
  216. fontSize: 11,
  217. legend: {
  218. show: true,
  219. position: 'top',
  220. float: 'right',
  221. fontColor: 'silver',
  222. itemGap: '9',
  223. itemWidth: '3'
  224. },
  225. dataLabel: false,
  226. dataPointShape: false,
  227. background: '#FFFFFF',
  228. pixelRatio: _self.windStationCardPixelRatio,
  229. categories: chartData.categories,
  230. series: chartData.series,
  231. animation: true,
  232. xAxis: {
  233. disableGrid: true,
  234. type: 'grid',
  235. gridColor: 'silver',
  236. fontColor: 'silver',
  237. gridType: 'solid',
  238. gridColor: '#2E2E2E',
  239. axisLineColor: '#2E2E2E',
  240. labelCount: '3'
  241. // itemCount:"3"
  242. },
  243. yAxis: {
  244. data: [{
  245. type: 'value',
  246. fontColor: 'silver',
  247. disabled: false, //y轴轴线
  248. min: 0,
  249. max: 40,
  250. position: 'left',
  251. axisLineColor: '#2E2E2E',
  252. title: ' 风速:(m/s)',
  253. titleFontColor: 'silver'
  254. },
  255. {
  256. fontColor: 'silver',
  257. disabled: false, //y轴轴线
  258. min: 0,
  259. max: 40,
  260. position: 'right',
  261. axisLineColor: '#2E2E2E',
  262. title: '功率:(kwh)',
  263. titleFontColor: 'silver'
  264. }
  265. ],
  266. disabled: true,
  267. gridColor: '#2E2E2E',
  268. splitNumber: 4,
  269. gridType: 'solid',
  270. dashLength: 8,
  271. showTitle: 'true',
  272. format: val => {
  273. return val.toFixed(0) + '元';
  274. }
  275. },
  276. width: _self.windStationCardCWidth * _self.windStationCardPixelRatio,
  277. height: _self.windStationCardCHeight * _self.windStationCardPixelRatio,
  278. padding: [10, 0, 0, 0], //画布填充边距,顺序为上右下左,同css,但必须4位
  279. extra: {
  280. line: {
  281. type: 'line',
  282. width: '1'
  283. }
  284. }
  285. });
  286. },
  287. touchLineB3(e) {
  288. canvaLineB3.showToolTip(e, {
  289. format: function(item, category) {
  290. return category + ' ' + item.name + ':' + item.data;
  291. }
  292. });
  293. },
  294. }
  295. }
  296. </script>
  297. <style>
  298. page {
  299. /* background-color: #242424; */
  300. }
  301. .windStation {
  302. clear: both;
  303. width: calc(100% - 18%);
  304. margin-left: 9px;
  305. height: 350px;
  306. color: silver;
  307. margin-bottom: 0px;
  308. background-color: #242424;
  309. }
  310. .scrollWindStationCard {
  311. white-space: nowrap;
  312. }
  313. .windStationCard {
  314. width: 250px;
  315. height: 100%;
  316. margin-right: 9px;
  317. float: left;
  318. background-color: #242424;
  319. }
  320. .windStationCardContainer {
  321. width: 100%;
  322. height: 350px;
  323. margin-top: 10px;
  324. }
  325. .windStationTitle {
  326. width: 90%;
  327. height: 30px;
  328. line-height: 30px;
  329. font-size: 12px;
  330. margin-left: 5px;
  331. }
  332. .powerAndSpeedContainer {
  333. width: 100%;
  334. height: 90px;
  335. }
  336. .powerAndSpeedRed {
  337. margin-top: 8px;
  338. margin-left: 2%;
  339. margin-right: 2%;
  340. width: 46%;
  341. height: 37px;
  342. line-height: 37px;
  343. text-align: left;
  344. font-size: 12px;
  345. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  346. border-radius: 5px;
  347. float: left;
  348. }
  349. .UChartContainer {
  350. width: 250px;
  351. height: 150px;
  352. margin-top: 8px;
  353. }
  354. .windStationUChart {
  355. width: 250px;
  356. height: 150px;
  357. position: absolute;
  358. }
  359. .windStationQiun-charts {
  360. width: 250px;
  361. height: 150px;
  362. background-color: #242424;
  363. }
  364. .windStationCharts {
  365. width: 250px;
  366. height: 150px;
  367. background-color: #242424;
  368. }
  369. .fanStatusContainer {
  370. width: 100%;
  371. height: 70px;
  372. }
  373. .fanStatus {
  374. width: 32%;
  375. height: 30px;
  376. margin-top: 5px;
  377. margin-right: 0.5%;
  378. margin-left: 0.5%;
  379. float: left;
  380. }
  381. .fanStatus {
  382. height: 30px;
  383. line-height: 30px;
  384. font-size: 12px;
  385. }
  386. .statusIcon {
  387. width: 22px;
  388. height: 30px;
  389. margin-left: 3px;
  390. float: left;
  391. }
  392. </style>