WindStationCardDetail.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252
  1. <template>
  2. <view>
  3. <!--导航栏-->
  4. <view @tap="closeFrame">
  5. <cu-custom bgColor="bg-gradual-sisBlack" :isBack="true">
  6. <block slot="backText">
  7. <view style="height: 80rpx;line-height: 80rpx;color: silver;">返回</view>
  8. </block>
  9. <block slot="content">
  10. <view style="color: silver;">{{ windStationName }}</view>
  11. </block>
  12. </cu-custom>
  13. </view>
  14. <!--电量卡片-->
  15. <view class="InformationCard" @tap="frameShow">
  16. <view class="informationCardAll">
  17. <view class="informationCardTextOne">
  18. <view class="informationCardText">
  19. <view class="textSilver">安全天数(&nbsp;天&nbsp;)&nbsp;:</view>
  20. <view class="textWhite">{{windpowerstationdetail.comprehensive_target.aqts}}</view>
  21. </view>
  22. <view class="informationCardTextzj">
  23. <view class="textSilver">装机容量(MV):</view>
  24. <view class="textWhite">{{windpowerstationdetail.comprehensive_target.zjrl}}</view>
  25. </view>
  26. </view>
  27. <view class="informationCardTextTwo">
  28. <view class="informationCardTextNo1">
  29. <view class="textSilver">日发电量(kwh):</view>
  30. <view class="textWhite">{{windpowerstationdetail.comprehensive_target.rfdl}}</view>
  31. </view>
  32. <view class="informationCardText3">
  33. <view class="textSilver">预测发电量(kwh):</view>
  34. <view class="textWhite2">{{windpowerstationdetail.comprehensive_target.ycfdl}}</view>
  35. </view>
  36. <view class="informationCardText2">
  37. <view class="textSilver">上网电量(kwh):</view>
  38. <view class="textWhite">{{windpowerstationdetail.comprehensive_target.swdl}}</view>
  39. <view class="img"></view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <!-- 指标卡片 -->
  45. <view class="quatoCardAndFrame">
  46. <view class="quatoCardContainer" @tap="frameShow">
  47. <view :class="sanJiao"></view>
  48. <!-- <view class="icon cuIcon-unfold"></view> -->
  49. </view>
  50. <!-- 弹框 -->
  51. <view class="frame" v-show="isFrameShow">
  52. <view class="frameCardLeft">
  53. mttr(h):
  54. <a class="frameCardLeftValue"><view style="font-size: 12px;position: absolute;transform: scale(0.8);margin-left: -12.5%;margin-top: 0.3%;">{{windpowerstationdetail.windpowerstationdetail_springbox_target.mttr}}</view></a>
  55. </view>
  56. <view class="frameCardMiddle">
  57. 月利用小时(h):
  58. <a class="frameCardMiddleValue"><view style="font-size: 12px;position: absolute;transform: scale(0.8);margin-left: -5.5%;margin-top: 0.3%;">{{windpowerstationdetail.windpowerstationdetail_springbox_target.ylyxs}}</view></a>
  59. </view>
  60. <view class="frameCardRight">
  61. 综合场用电率(%):
  62. <a class="frameCardRightValue"><view style="font-size: 12px;position: absolute;transform: scale(0.8);margin-left: -5.5%;margin-top: 0.3%;">{{windpowerstationdetail.windpowerstationdetail_springbox_target.zhcydl}}</view></a>
  63. </view>
  64. <view class="frameCardLeft">
  65. mtbf(h):
  66. <a class="frameCardLeftValue"><view style="font-size: 12px;position: absolute;transform: scale(0.80);margin-left: -12.5%;margin-top: 0.3%;">{{windpowerstationdetail.windpowerstationdetail_springbox_target.mtbf}}</view></a>
  67. </view>
  68. <view class="frameCardMiddle">
  69. 年利用小时(h):
  70. <a class="frameCardMiddleValue"><view style="font-size: 12px;position: absolute;transform: scale(0.80);margin-left: -5.5%;margin-top: 0.3%;">{{windpowerstationdetail.windpowerstationdetail_springbox_target.nlyxs}}</view></a>
  71. </view>
  72. <view class="frameCardRight">
  73. 设备可利用率(%):
  74. <a class="frameCardRightValue"><view style="font-size: 12px;position: absolute;transform: scale(0.80);margin-left: -5.5%;margin-top: 0.3%;">{{windpowerstationdetail.windpowerstationdetail_springbox_target.sbklyl}}</view></a>
  75. </view>
  76. <view class="frameCardLeft">
  77. 节约标煤(吨):
  78. <a class="frameCardLeftValue"><view style="font-size: 12px;position: absolute;transform: scale(0.80);margin-left: -5.5%;margin-top: 0.3%;">{{windpowerstationdetail.windpowerstationdetail_springbox_target.jybm}}</view></a>
  79. </view>
  80. <view class="frameCardMiddle">
  81. 节约用水(吨):
  82. <a class="frameCardMiddleValue"><view style="font-size: 12px;position: absolute;transform: scale(0.80);margin-left: -5.5%;margin-top: 0.3%;">{{windpowerstationdetail.windpowerstationdetail_springbox_target.jyys}}</view></a>
  83. </view>
  84. <view class="frameCardRight">
  85. 减排二氧化碳(吨):
  86. <a class="frameCardRightValue"><view style="font-size: 12px;position: absolute;transform: scale(0.80);margin-left: -5.5%;margin-top: 0.3%;">{{windpowerstationdetail.windpowerstationdetail_springbox_target.jpeyht}}</view></a>
  87. </view>
  88. <view class="frameCardLeft">
  89. 减排二氧化硫(吨):
  90. <a class="frameCardRightValue"><view style="font-size: 12px;position: absolute;transform: scale(0.80);margin-left: -5.5%;margin-top: 0.3%;">{{windpowerstationdetail.windpowerstationdetail_springbox_target.jpeyhl}}</view></a>
  91. </view>
  92. </view>
  93. </view>
  94. <!--风速卡片-->
  95. <view class="speedPower" @tap="closeFrame">
  96. <view class="cardinstallredSpeed">
  97. <view class="cardinstalltitlegreen">
  98. 平均风速
  99. <span>(km/h)</span>
  100. </view>
  101. <view class="cardinstallnumbergreen">{{windspeedpowermodule.index_windSpeed_power_target_detail.pjfs}}</view>
  102. <view class="cardinstallnumbergreenmin">
  103. <view class="greenMinText">min: {{windspeedpowermodule.index_windSpeed_power_target_detail.pjfsMin}}</view>
  104. </view>
  105. <view class="cardinstallnumbergreenmax">
  106. <view class="greenMaxText">max: {{windspeedpowermodule.index_windSpeed_power_target_detail.pjfsMax}}</view>
  107. </view>
  108. </view>
  109. <view class="cardinstallredSpeed">
  110. <view class="cardinstalltitlegreen">
  111. 预测风速
  112. <span>(km/h)</span>
  113. </view>
  114. <view class="cardinstallnumbergreen">{{windspeedpowermodule.index_windSpeed_power_target_detail.ycfs}}</view>
  115. <view class="cardinstallnumbergreenmin">
  116. <view class="greenMinText">min: {{windspeedpowermodule.index_windSpeed_power_target_detail.ycfsMin}}</view>
  117. </view>
  118. <view class="cardinstallnumbergreenmax">
  119. <view class="greenMaxText">max: {{windspeedpowermodule.index_windSpeed_power_target_detail.ycfsMax}}</view>
  120. </view>
  121. </view>
  122. <view class="cardinstallredSpeed">
  123. <view class="cardinstalltitleRed">
  124. 实际功率
  125. <span>(kw)</span>
  126. </view>
  127. <view class="cardinstallnumberred">{{windspeedpowermodule.index_windSpeed_power_target_detail.sjgl}}</view>
  128. <view class="cardinstallnumberredmin">
  129. <view class="redMinText">min: {{windspeedpowermodule.index_windSpeed_power_target_detail.sjglMin}}</view>
  130. </view>
  131. <view class="cardinstallnumberredmax">
  132. <view class="redMaxText">max: {{windspeedpowermodule.index_windSpeed_power_target_detail.sjglMax}}</view>
  133. </view>
  134. </view>
  135. <view class="cardinstallredSpeed">
  136. <view class="cardinstalltitleRed">
  137. 理论功率
  138. <span>(kw)</span>
  139. </view>
  140. <view class="cardinstallnumberred">{{windspeedpowermodule.index_windSpeed_power_target_detail.llgl}}</view>
  141. <view class="cardinstallnumberredmin">
  142. <view class="redMinText">min: {{windspeedpowermodule.index_windSpeed_power_target_detail.llglMax}}</view>
  143. </view>
  144. <view class="cardinstallnumberredmax">
  145. <view class="redMaxText">max: {{windspeedpowermodule.index_windSpeed_power_target_detail.llglMin}}</view>
  146. </view>
  147. </view>
  148. </view>
  149. <!-- 曲线图 -->
  150. <view class="lineChart" @tap="closeFrame">
  151. <view class="qiun-charts">
  152. <view class="speedPowerDiagram">风速功率曲线图</view>
  153. <canvas canvas-id="canvasLineA" id="canvasLineA" class="charts" @touchstart="touchLineA"></canvas>
  154. </view>
  155. </view>
  156. <!--柱状图-->
  157. <view class="Histogram" @tap="closeFrame">
  158. <view class="qiun-charts">
  159. <view class="PowerColunm">发电量柱状图</view>
  160. <canvas canvas-id="canvasColumn" id="canvasColumn" class="charts" disable-scroll="true" @touchstart="touchColumn"
  161. @touchmove="moveColumn" @touchend="touchEndColumn"></canvas>
  162. </view>
  163. </view>
  164. </view>
  165. </template>
  166. <script>
  167. Date.prototype.Format = function(fmt) {
  168. var o = {
  169. "M+": this.getMonth() + 1, //月份
  170. "d+": this.getDate(), //日
  171. "h+": this.getHours(), //小时
  172. "m+": this.getMinutes(), //分
  173. "s+": this.getSeconds(), //秒
  174. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  175. "S": this.getMilliseconds() //毫秒
  176. };
  177. if(/(y+)/.test(fmt))
  178. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  179. for(var k in o)
  180. if(new RegExp("(" + k + ")").test(fmt))
  181. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  182. return fmt;
  183. };
  184. import uCharts from '../tools/u-charts/u-charts.js';
  185. var _self;
  186. var canvaLineA = null;
  187. var canvaColumn = null;
  188. export default {
  189. data: function() {
  190. return {
  191. FDC: "MHS_FDC",
  192. socketTask_comprehensive_target: '',
  193. socketTask_index_windSpeed_power_target_detail: '',
  194. socketTask_windpowerstationdetail_springbox_target: '',
  195. socketTask_windpowerstationdetail_twentyfourhourlinechart_target:'',
  196. socketTask_index_windStation_card:'',
  197. windpowerstationdetail: {
  198. comprehensive_target: "",
  199. windpowerstationdetail_springbox_target: ""
  200. },
  201. windspeedpowermodule:{
  202. index_windSpeed_power_target_detail:""
  203. },
  204. windspeedpowercurvedetail:{
  205. windpowerstationdetail_twentyfourhourlinechart_target:""
  206. },
  207. index_windStation_cardmodule:{
  208. index_windStation_cardmodule:""
  209. },
  210. gl:[],
  211. fs:[],
  212. llgl:[],
  213. ycgl:[],
  214. windStationName: '',
  215. isFrameShow: false,
  216. count: 0,
  217. cWidth: '',
  218. cHeight: '',
  219. pixelRatio: 1,
  220. serverData: '',
  221. sanJiao: 'sanJiaoDown',
  222. };
  223. },
  224. onLoad(option) {
  225. this.windStationName = option.option;
  226. if(this.windStationName == '麻黄山'){
  227. this.FDC = 'MHS_FDC'
  228. };
  229. if(this.windStationName == '牛首山'){
  230. this.FDC = 'NSS_FDC'
  231. };
  232. if(this.windStationName == "石板泉"){
  233. this.FDC = 'SBQ_FDC'
  234. };
  235. if(this.windStationName == "香山"){
  236. this.FDC = 'XS_FDC'
  237. };
  238. if(this.windStationName == "青山"){
  239. this.FDC = 'QS_FDC'
  240. };
  241. this.cWidth = uni.upx2px(750);
  242. this.cHeight = uni.upx2px(400);
  243. this.getServerData();
  244. this.getColumnServerData();
  245. this.comprehensive_target();
  246. this.windpowerstationdetail_springbox_target();
  247. this.index_windSpeed_power_target_detail();
  248. this.windpowerstationdetail_twentyfourhourlinechart_target();
  249. },
  250. computed: {
  251. backStageIp: function() {
  252. return this.$store.state.wholeSituationBackStageIp;
  253. },
  254. backStagePort: function() {
  255. return this.$store.state.wholeSituationBackStagePort;
  256. },
  257. windpowerstationNameToId: function() {
  258. return this.$store.state.windpowerstationNameToId;
  259. }
  260. },
  261. methods: {
  262. async comprehensive_target() {
  263. let _this = this;
  264. // 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
  265. this.socketTask_comprehensive_target = uni.connectSocket({
  266. // 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
  267. url: 'ws://' + this.backStageIp + ':' + this.backStagePort + '/websocket/pageNumber_7/functionNumber_1',
  268. success(data) {
  269. console.log('websocket连接成功');
  270. }
  271. });
  272. let windpowerstationid = uni.getStorageSync('windpowerstationName');
  273. // 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
  274. this.socketTask_comprehensive_target.onOpen(res => {
  275. console.log('WebSocket连接正常打开中...!');
  276. this.is_open_socket = true;
  277. // 注:只有连接正常打开中 ,才能正常收到消息
  278. this.socketTask_comprehensive_target.onMessage(res => {
  279. //console.log("收到服务器内容:" + res.data);
  280. _this.windpowerstationdetail.comprehensive_target = JSON.parse(res.data)[_this.FDC];
  281. });
  282. });
  283. // 这里仅是事件监听【如果socket关闭了会执行】
  284. /* this.socketTask_comprehensive_target.onClose(() => {
  285. uni.request({
  286. url: 'http://'+this.backStageIp+':'+this.backStagePort+'/targetdetail/close_targetdetail_target?pointKey='+this.pointKey,
  287. success: (res) => {
  288. }
  289. });
  290. }) */
  291. },
  292. async windpowerstationdetail_springbox_target() {
  293. let _this = this;
  294. // 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
  295. this.socketTask_windpowerstationdetail_springbox_target = uni.connectSocket({
  296. // 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
  297. url: 'ws://' + this.backStageIp + ':' + this.backStagePort + '/websocket/pageNumber_7/functionNumber_2',
  298. success(data) {
  299. console.log('websocket连接成功');
  300. }
  301. });
  302. let windpowerstationid = uni.getStorageSync('windpowerstationName');
  303. // 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
  304. this.socketTask_windpowerstationdetail_springbox_target.onOpen(res => {
  305. console.log('WebSocket连接正常打开中...!');
  306. this.is_open_socket = true;
  307. // 注:只有连接正常打开中 ,才能正常收到消息
  308. this.socketTask_windpowerstationdetail_springbox_target.onMessage(res => {
  309. //console.log("收到服务器内容:" + res.data);
  310. _this.windpowerstationdetail.windpowerstationdetail_springbox_target = JSON.parse(res.data)[_this.FDC];
  311. });
  312. });
  313. },
  314. async index_windSpeed_power_target_detail() {
  315. let _this = this;
  316. // 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
  317. this.socketTask_index_windSpeed_power_target_detail = uni.connectSocket({
  318. // 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
  319. url: 'ws://' + this.backStageIp + ':' + this.backStagePort + '/websocket/pageNumber_7/functionNumber_3',
  320. success(data) {
  321. console.log('websocket连接成功');
  322. }
  323. });
  324. let windpowerstationid = uni.getStorageSync('windpowerstationName');
  325. // 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
  326. this.socketTask_index_windSpeed_power_target_detail.onOpen(res => {
  327. console.log('WebSocket连接正常打开中...!');
  328. this.is_open_socket = true;
  329. // 注:只有连接正常打开中 ,才能正常收到消息
  330. this.socketTask_index_windSpeed_power_target_detail.onMessage(res => {
  331. //console.log("收到服务器内容:" + res.data);
  332. _this.windspeedpowermodule.index_windSpeed_power_target_detail = JSON.parse(res.data)[_this.FDC];
  333. });
  334. });
  335. },
  336. async windpowerstationdetail_twentyfourhourlinechart_target() {
  337. let _this = this;
  338. // 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
  339. this.socketTask_windpowerstationdetail_twentyfourhourlinechart_target = uni.connectSocket({
  340. // 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
  341. url: 'ws://' + this.backStageIp + ':' + this.backStagePort + '/websocket/pageNumber_7/functionNumber_4',
  342. success(data) {
  343. console.log('websocket连接成功');
  344. }
  345. });
  346. let windpowerstationid = uni.getStorageSync('windpowerstationName');
  347. // 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
  348. this.socketTask_windpowerstationdetail_twentyfourhourlinechart_target.onOpen(res => {
  349. console.log('WebSocket连接正常打开中...!');
  350. this.is_open_socket = true;
  351. // 注:只有连接正常打开中 ,才能正常收到消息
  352. this.socketTask_windpowerstationdetail_twentyfourhourlinechart_target.onMessage(res => {
  353. //console.log("收到服务器内容:" + res.data);
  354. _this.windspeedpowercurvedetail.windpowerstationdetail_twentyfourhourlinechart_target = JSON.parse(res.data)[_this.FDC];
  355. _this.gl = _this.windspeedpowercurvedetail.windpowerstationdetail_twentyfourhourlinechart_target.gl;
  356. _this.fs = _this.windspeedpowercurvedetail.windpowerstationdetail_twentyfourhourlinechart_target.fs;
  357. _this.llgl = _this.windspeedpowercurvedetail.windpowerstationdetail_twentyfourhourlinechart_target.llgl;
  358. _this.ycgl = _this.windspeedpowercurvedetail.windpowerstationdetail_twentyfourhourlinechart_target.ycgl;
  359. _this.getServerData();
  360. });
  361. });
  362. },
  363. frameShow: function() {
  364. this.count = this.count + 1;
  365. if (this.count % 2 == 0) {
  366. this.isFrameShow = false;
  367. this.sanJiao = 'sanJiaoDown';
  368. } else {
  369. this.isFrameShow = true;
  370. this.sanJiao = 'sanJiaoUp';
  371. }
  372. },
  373. closeFrame: function() {
  374. this.count = this.count + 1;
  375. if (this.isFrameShow) {
  376. this.isFrameShow = false;
  377. this.sanJiao = 'sanJiaoDown';
  378. }
  379. },
  380. getServerData() {
  381. // 折线图
  382. let LineA = {
  383. categories: [
  384. ' 17:26',
  385. '18:56',
  386. '19:56',
  387. '20:56',
  388. '21:56',
  389. '22:56',
  390. '23:56',
  391. '00:56',
  392. '01:56',
  393. '02:56',
  394. '03:56',
  395. '04:56',
  396. '05:56',
  397. '06:56',
  398. '07:56',
  399. '08:56',
  400. '09:56',
  401. '10:56',
  402. '11:56',
  403. '12:56',
  404. '13:56',
  405. '14:56',
  406. '15:56',
  407. '16:56',
  408. '17:56 '
  409. ],
  410. series: [{
  411. name: '功率',
  412. data: [11, 12, 14, 12, 13, 12, 16, 14, 11, 13, 10, 14, 11, 13, 11, 12, 11, 12.1, 12.2, 11.5, 11.7, 11.3, 12.7,
  413. 13, 12.8
  414. ],
  415. color: '#4BB94B',
  416. textColor: '#FFFFFF',
  417. textSize: this.seriesTextSize,
  418. format: val => {
  419. return val + 'kwh';
  420. },
  421. index: 0,
  422. legendShape: 'circle'
  423. },
  424. {
  425. name: '风速',
  426. data: [21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22.1, 22.2, 21.5, 21.7, 21.3, 22.7,
  427. 23, 22.8
  428. ],
  429. color: '#E82E2F',
  430. textColor: '#FFFFFF',
  431. textSize: this.seriesTextSize,
  432. format: val => {
  433. return val + 'km/h';
  434. },
  435. index: 1,
  436. legendShape: 'circle'
  437. },
  438. {
  439. name: '理论功率',
  440. data: [31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32, 31, 32.1, 32.2, 31.5, 31.7, 31.3, 32.7,
  441. 33, 32.8
  442. ],
  443. color: '#F5A83C',
  444. textColor: '#FFFFFF',
  445. textSize: this.seriesTextSize,
  446. format: val => {
  447. return val + 'kwh';
  448. },
  449. index: 0,
  450. legendShape: 'circle'
  451. },
  452. {
  453. name: '预测功率',
  454. data: [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2.1, 2.2, 1.5, 1.7, 1.3, 2.7, 3, 2.8],
  455. color: '#4A80B1',
  456. textColor: '#FFFFFF',
  457. textSize: this.seriesTextSize,
  458. format: val => {
  459. return val + 'kwh';
  460. },
  461. index: 1,
  462. legendShape: 'circle'
  463. }
  464. ]
  465. };
  466. let _this = this;
  467. LineA.categories = [];
  468. LineA.series[0].data = [];
  469. LineA.series[1].data = [];
  470. LineA.series[2].data = [];
  471. LineA.series[3].data = [];
  472. // for(let i=0;i<_this.gl.length;i++){
  473. // _this.gl[i].pointTime = new Date(_this.gl[i].pointTime*1000).Format("hh");
  474. // LineA.categories.push(_this.gl[i].pointTime);
  475. // LineA.series[1].data.push(_this.gl[i].pointValueInDouble);
  476. // console.log(_this.gl[i].pointValueInDouble)
  477. // };
  478. for(let i=0;i<_this.gl.length;i++){
  479. _this.gl[i].pointTime = new Date(_this.gl[i].pointTime*1000).Format("hh");
  480. // LineA.categories.push(_this.fs[i].pointTime);
  481. LineA.series[0].data.push(_this.gl[i].pointValueInDouble);
  482. }
  483. for(let i=0;i<_this.fs.length;i++){
  484. _this.fs[i].pointTime = new Date(_this.fs[i].pointTime*1000).Format("hh");
  485. LineA.categories.push(_this.fs[i].pointTime);
  486. LineA.series[1].data.push(_this.fs[i].pointValueInDouble);
  487. }
  488. for(let i=0;i<_this.llgl.length;i++){
  489. _this.llgl[i].pointTime = new Date(_this.llgl[i].pointTime*1000).Format("hh");
  490. // LineA.categories.push(_this.ycgl[i].pointTime);
  491. LineA.series[2].data.push(_this.llgl[i].pointValueInDouble);
  492. }
  493. for(let i=0;i<_this.ycgl.length;i++){
  494. _this.ycgl[i].pointTime = new Date(_this.ycgl[i].pointTime*1000).Format("hh");
  495. // LineA.categories.push(_this.ycgl[i].pointTime);
  496. LineA.series[3].data.push(_this.ycgl[i].pointValueInDouble);
  497. }
  498. this.showLineA('canvasLineA', LineA);
  499. },
  500. showLineA(canvasId, chartData) {
  501. var _self = this;
  502. canvaLineA = new uCharts({
  503. $this: _self,
  504. canvasId: canvasId,
  505. type: 'line',
  506. fontSize: 11,
  507. legend: {
  508. show: true,
  509. position: 'top',
  510. float: 'right',
  511. fontColor: 'silver',
  512. itemGap: '4',
  513. itemWidth: '3'
  514. },
  515. dataLabel: false,
  516. dataPointShape: false,
  517. background: '#FFFFFF',
  518. pixelRatio: _self.pixelRatio,
  519. categories: chartData.categories,
  520. series: chartData.series,
  521. animation: true,
  522. xAxis: {
  523. type: 'grid',
  524. gridColor: 'silver',
  525. fontColor: 'silver',
  526. gridType: 'solid',
  527. gridColor: '#2E2E2E',
  528. axisLineColor: '#2E2E2E',
  529. labelCount: '3'
  530. // itemCount:"3"
  531. },
  532. yAxis: {
  533. data: [{
  534. type: 'value',
  535. fontColor: 'silver',
  536. disabled: false, //y轴轴线
  537. min: 0,
  538. max: 40,
  539. position: 'left',
  540. axisLineColor: '#2E2E2E',
  541. title: ' 风速:(km/h)',
  542. titleFontColor: 'silver'
  543. },
  544. {
  545. fontColor: 'silver',
  546. disabled: false, //y轴轴线
  547. min: 0,
  548. max: 40,
  549. position: 'right',
  550. axisLineColor: '#2E2E2E',
  551. title: '功率:(kwh)',
  552. titleFontColor: 'silver'
  553. }
  554. ],
  555. gridColor: '#2E2E2E',
  556. splitNumber: 4,
  557. gridType: 'solid',
  558. dashLength: 8,
  559. showTitle: 'true',
  560. format: val => {
  561. return val.toFixed(0) + '元';
  562. }
  563. },
  564. width: _self.cWidth * _self.pixelRatio,
  565. height: _self.cHeight * _self.pixelRatio,
  566. extra: {
  567. line: {
  568. type: 'line',
  569. width: '1'
  570. }
  571. }
  572. });
  573. },
  574. touchLineA(e) {
  575. canvaLineA.showToolTip(e, {
  576. format: function(item, category) {
  577. return category + ' ' + item.name + ':' + item.data;
  578. }
  579. });
  580. },
  581. moveLineA(e) {
  582. canvaLineA.scroll(e);
  583. },
  584. getColumnServerData() {
  585. let Column = {
  586. categories: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17',
  587. '18', '19', '20', '21', '22', '23', '24'
  588. ],
  589. series: [{
  590. legendShape: 'circle',
  591. name: '发电量',
  592. data: [10, 20, 30, 40, 20, 15, 20, 10, 20, 30, 40, 20, 15, 20, 10, 20, 30, 40, 20, 15, 20, 20, 15, 20, 10],
  593. textColor: '#ffffff',
  594. color: '#2fc25b'
  595. }]
  596. };
  597. // res.data.data = res.data;
  598. // let Column = {
  599. // categories: [],
  600. // series: []
  601. // };
  602. // //这里我后台返回的是数组,所以用等于,如果您后台返回的是单条数据,需要push进去
  603. // Column.categories = res.data.data.ColumnB.categories;
  604. // Column.series = res.data.data.ColumnB.series;
  605. // _self.textarea = JSON.stringify(res.data.data.ColumnB);
  606. this.showColumn('canvasColumn', Column);
  607. },
  608. showColumn(canvasId, chartData) {
  609. var _self = this;
  610. canvaColumn = new uCharts({
  611. $this: _self,
  612. canvasId: canvasId,
  613. type: 'column',
  614. legend: {
  615. show: true,
  616. fontSize: 12,
  617. padding: 5,
  618. fontColor: 'silver',
  619. itemGap: '4',
  620. // margin:0,
  621. position: 'top',
  622. float: 'right'
  623. },
  624. fontSize: 11,
  625. background: '#121212',
  626. pixelRatio: _self.pixelRatio,
  627. animation: true,
  628. categories: chartData.categories,
  629. series: chartData.series,
  630. enableScroll: true,
  631. xAxis: {
  632. // disabled:true,
  633. rotateLabel: false,
  634. disableGrid: true,
  635. axisLineColor: '#2D2D2D',
  636. fontColor: '#ffffff',
  637. itemCount: 10,
  638. // labelCount:10,
  639. scrollShow: false
  640. // gridColor:'#2D2D2D',
  641. },
  642. yAxis: {
  643. showTitle: true,
  644. // disableGrid:true,
  645. gridType: 'solid',
  646. dashLength: 8,
  647. gridColor: '#2D2D2D',
  648. splitNumber: 5,
  649. min: 0,
  650. max: 40,
  651. data: [{
  652. min: 0,
  653. max: 40,
  654. position: 'left',
  655. axisLine: false,
  656. fontColor: 'silver',
  657. title: ' 发电量:(kw/h)',
  658. titleFontColor: 'silver',
  659. titleFontSize: 11,
  660. format: val => {
  661. return val.toFixed(0) + '';
  662. }
  663. }]
  664. },
  665. dataLabel: true,
  666. width: _self.cWidth * _self.pixelRatio,
  667. height: _self.cHeight * _self.pixelRatio,
  668. extra: {
  669. column: {
  670. type: 'group',
  671. // width: _self.cWidth * _self.pixelRatio * 0.45 / chartData.categories.length
  672. width: 12,
  673. lineStyle: {
  674. width: 5
  675. }
  676. }
  677. }
  678. });
  679. },
  680. touchEndColumn(e) {
  681. canvaColumn.scrollEnd(e);
  682. canvaColumn.showToolTip(e, {
  683. format: function(item, category) {
  684. if (typeof item.data === 'object') {
  685. return category + ' ' + item.name + ':' + item.data.value;
  686. } else {
  687. return category + ' ' + item.name + ':' + item.data;
  688. }
  689. }
  690. });
  691. },
  692. touchColumn(e) {
  693. canvaColumn.scrollStart(e);
  694. },
  695. moveColumn(e) {
  696. canvaColumn.scroll(e);
  697. }
  698. }
  699. };
  700. </script>
  701. <style>
  702. .textSmail{
  703. font-size: 12px;
  704. transform: scale(0.80)
  705. }
  706. body {
  707. font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', STHeiti, 'Microsoft Yahei', Tahoma, Simsun, sans-serif;
  708. font-size: 20px;
  709. color: silver;
  710. background: #020202;
  711. }
  712. @font-face {
  713. font-family: '方正兰亭细黑_GBK';
  714. src: url(../../static/方正兰亭细黑_GBK.TTF);
  715. }
  716. page {
  717. background-color: #1f1f1f;
  718. font-family: '方正兰亭细黑_GBK';
  719. color: silver;
  720. }
  721. .InformationCard {
  722. margin-top: 10px;
  723. width: 100%;
  724. height: 90px;
  725. background-color: #242424;
  726. float: left;
  727. }
  728. .informationCardAll {
  729. width: 100%;
  730. margin-top: 10px;
  731. height: 60px;
  732. float: left;
  733. }
  734. .informationCardTextOne {
  735. width: 100%;
  736. height: 35px;
  737. float: left;
  738. }
  739. .informationCardTextNo1 {
  740. margin-left: 2%;
  741. width: 115px;
  742. height: 35px;
  743. font-size: 13px;
  744. line-height: 35px;
  745. float: left;
  746. }
  747. .informationCardText {
  748. margin-left: 2%;
  749. width: 115px;
  750. height: 35px;
  751. line-height: 35px;
  752. user-select: text;
  753. -webkit-user-select: text;
  754. -moz-user-select: text;
  755. -ms-user-select: text;
  756. color: silver;
  757. font-size: 13px;
  758. float: left;
  759. }
  760. .informationCardTextzj {
  761. /* margin-left: 43%; */
  762. width: 115px;
  763. height: 35px;
  764. line-height: 35px;
  765. user-select: text;
  766. -webkit-user-select: text;
  767. -moz-user-select: text;
  768. -ms-user-select: text;
  769. color: silver;
  770. font-size: 13px;
  771. float: right;
  772. margin-right: 1%;
  773. }
  774. .informationCardTextTwo {
  775. width: 100%;
  776. height: 35px;
  777. float: left;
  778. user-select: text;
  779. -webkit-user-select: text;
  780. -moz-user-select: text;
  781. -ms-user-select: text;
  782. color: silver;
  783. }
  784. .informationCardText2 {
  785. /* margin-left: 6%; */
  786. margin-left: calc(48% - 175px);
  787. width: 115px;
  788. height: 35px;
  789. font-size: 13px;
  790. line-height: 35px;
  791. float: left;
  792. }
  793. .informationCardText3 {
  794. /* margin-left: 6%; */
  795. margin-left: calc(48% - 175px);
  796. width: 120px;
  797. height: 35px;
  798. font-size: 13px;
  799. line-height: 35px;
  800. float: left;
  801. }
  802. .textWhite {
  803. color: white;
  804. float: left;
  805. width: 24px;
  806. text-align: right;
  807. }
  808. .textSilver {
  809. user-select: text;
  810. -webkit-user-select: text;
  811. -moz-user-select: text;
  812. -ms-user-select: text;
  813. color: silver;
  814. float: left;
  815. }
  816. .speedPower {
  817. width: 100%;
  818. height: 180px;
  819. background-color: #242424;
  820. float: left;
  821. margin-top: 20rpx;
  822. margin-bottom: 10px;
  823. }
  824. .cardinstallredSpeed {
  825. margin-top: 8px;
  826. margin-left: 9px;
  827. width: 46%;
  828. height: 78px;
  829. background-color: #1f1f1f;
  830. /* background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%); */
  831. border-radius: 5px;
  832. float: left;
  833. }
  834. .cardinstalltitlegreen {
  835. width: 80%;
  836. height: 25px;
  837. text-align: center;
  838. margin-left: 10%;
  839. user-select: text;
  840. -webkit-user-select: text;
  841. -moz-user-select: text;
  842. -ms-user-select: text;
  843. font-size: 14px;
  844. color: silver;
  845. line-height: 25px;
  846. float: left;
  847. }
  848. .cardinstalltitlegreen span {
  849. color: white;
  850. /* float: right; */
  851. /* margin-right: 70px; */
  852. }
  853. .cardinstallnumbergreen {
  854. width: 100%;
  855. height: 25px;
  856. text-align: center;
  857. user-select: text;
  858. -webkit-user-select: text;
  859. -moz-user-select: text;
  860. -ms-user-select: text;
  861. font-size: 20px;
  862. color: silver;
  863. /* color: #449618; */
  864. line-height: 25px;
  865. float: left;
  866. }
  867. .cardinstallnumbergreenmin {
  868. margin-left: 2px;
  869. width: 45%;
  870. height: 20px;
  871. user-select: text;
  872. -webkit-user-select: text;
  873. -moz-user-select: text;
  874. -ms-user-select: text;
  875. font-size: 12px;
  876. color: silver;
  877. /* color: #449618; */
  878. float: left;
  879. }
  880. .cardinstallnumbergreenmax {
  881. /* font-weight: bold; */
  882. margin-right: 2px;
  883. width: 45%;
  884. height: 20px;
  885. user-select: text;
  886. -webkit-user-select: text;
  887. -moz-user-select: text;
  888. -ms-user-select: text;
  889. font-size: 12px;
  890. color: silver;
  891. /* color: #449618; */
  892. float: right;
  893. }
  894. .greenMinText {
  895. line-height: 20px;
  896. float: right;
  897. }
  898. .greenMaxText {
  899. line-height: 20px;
  900. float: left;
  901. }
  902. .cardinstalltitleRed {
  903. width: 80%;
  904. height: 25px;
  905. text-align: center;
  906. margin-left: 10%;
  907. user-select: text;
  908. -webkit-user-select: text;
  909. -moz-user-select: text;
  910. -ms-user-select: text;
  911. font-size: 14px;
  912. color: silver;
  913. line-height: 25px;
  914. float: left;
  915. }
  916. .cardinstalltitleRed span {
  917. color: white;
  918. /* float: right;
  919. margin-right: 85px; */
  920. }
  921. .cardinstallnumberred {
  922. width: 100%;
  923. height: 25px;
  924. text-align: center;
  925. user-select: text;
  926. -webkit-user-select: text;
  927. -moz-user-select: text;
  928. -ms-user-select: text;
  929. font-size: 20px;
  930. color: silver;
  931. /* color: #E93131; */
  932. line-height: 25px;
  933. float: left;
  934. }
  935. .cardinstallnumberredmin {
  936. margin-left: 2px;
  937. width: 45%;
  938. height: 20px;
  939. user-select: text;
  940. -webkit-user-select: text;
  941. -moz-user-select: text;
  942. -ms-user-select: text;
  943. font-size: 12px;
  944. color: silver;
  945. /* color: #E93131; */
  946. float: left;
  947. }
  948. .cardinstallnumberredmax {
  949. margin-right: 2px;
  950. width: 45%;
  951. height: 20px;
  952. user-select: text;
  953. -webkit-user-select: text;
  954. -moz-user-select: text;
  955. -ms-user-select: text;
  956. font-size: 12px;
  957. color: silver;
  958. /* color: #E93131; */
  959. float: right;
  960. }
  961. .redMinText {
  962. line-height: 20px;
  963. float: right;
  964. }
  965. .redMaxText {
  966. line-height: 20px;
  967. float: left;
  968. }
  969. /* .quatoCardAndFrame {
  970. clear: both;
  971. width: 100%;
  972. height: 10px;
  973. background-color:red;
  974. position: relative;
  975. } */
  976. /* .quatoCardContainer {
  977. width: 375px;
  978. height: 12px;
  979. background-color:blue;
  980. } */
  981. .quatoCard {
  982. width: 32%;
  983. height: 30px;
  984. float: left;
  985. margin-right: 1.5%;
  986. margin-bottom: 8px;
  987. text-align: center;
  988. line-height: 30px;
  989. font-size: 14px;
  990. /* background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  991. }
  992. .quatoCardLast {
  993. width: 32%;
  994. height: 30px;
  995. float: left;
  996. text-align: center;
  997. line-height: 30px;
  998. margin-bottom: 8px;
  999. font-size: 14px;
  1000. /* background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%); */
  1001. }
  1002. .sanJiaoUp {
  1003. clear: both;
  1004. width: 0;
  1005. height: 0;
  1006. /* border-right: 20px solid transparent;
  1007. border-left: 20px solid transparent;
  1008. border-bottom: 15px solid #E47369; */
  1009. margin-left: calc(50% - 20px);
  1010. }
  1011. .sanJiaoDown {
  1012. clear: both;
  1013. width: 0;
  1014. height: 0;
  1015. /* border-right: 20px solid transparent;
  1016. border-left: 20px solid transparent;
  1017. border-top: 15px solid #E47369; */
  1018. margin-left: calc(50% - 20px);
  1019. }
  1020. .frame {
  1021. width: calc(100% - 18px);
  1022. margin-left: 9px;
  1023. height: 150px;
  1024. position: absolute;
  1025. /* top: 20px; */
  1026. left: 0px;
  1027. z-index: 20;
  1028. /* background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%); */
  1029. background-color: #242424;
  1030. border-top: 0.5px solid #242424;
  1031. }
  1032. .frameCardLeft {
  1033. width: 34%;
  1034. height: 10px;
  1035. float: left;
  1036. /* margin-right: 1.5%; */
  1037. margin-bottom: 8px;
  1038. /* text-align: center; */
  1039. line-height: 30px;
  1040. font-size: 13px;
  1041. color: #a1a1a1;
  1042. margin-top: 15px;
  1043. }
  1044. .frameCardLeftValue {
  1045. float: right;
  1046. color: #ffffff;
  1047. margin-right: 25px;
  1048. /* margin-left: 20px; */
  1049. }
  1050. .frameCardLeftValueSulfurdioxide{
  1051. }
  1052. .frameCardMiddleValue {
  1053. float: right;
  1054. color: #ffffff;
  1055. }
  1056. .frameCardRightValue {
  1057. float: right;
  1058. color: #ffffff;
  1059. }
  1060. .frameCardMiddle {
  1061. width: 29%;
  1062. height: 10px;
  1063. float: left;
  1064. /* margin-right: 1.5%; */
  1065. margin-left: -5.5%;
  1066. margin-bottom: 8px;
  1067. /* text-align: center; */
  1068. line-height: 30px;
  1069. font-size: 13px;
  1070. color: #a1a1a1;
  1071. margin-top: 15px;
  1072. }
  1073. .frameCardRight {
  1074. width: 34%;
  1075. height: 10px;
  1076. float: left;
  1077. /* text-align: center; */
  1078. line-height: 30px;
  1079. margin-bottom: 8px;
  1080. font-size: 13px;
  1081. color: #a1a1a1;
  1082. margin-left: 5.5%;
  1083. margin-top: 15px;
  1084. }
  1085. .speedPowerDiagram {
  1086. clear: both;
  1087. width: 130px;
  1088. height: 30px;
  1089. user-select: text;
  1090. -webkit-user-select: text;
  1091. -moz-user-select: text;
  1092. -ms-user-select: text;
  1093. color: silver;
  1094. float: left;
  1095. margin-top: 18px;
  1096. margin-left: 9px;
  1097. font-size: 11px;
  1098. }
  1099. .qiun-charts {
  1100. width: 750upx;
  1101. height: 400upx;
  1102. }
  1103. .charts {
  1104. width: 750upx;
  1105. height: 400upx;
  1106. }
  1107. .lineChart {
  1108. clear: both;
  1109. width: 100%;
  1110. height: 225px;
  1111. background-color: #242424;
  1112. }
  1113. .Histogram {
  1114. width: 100%;
  1115. height: 225px;
  1116. clear: both;
  1117. background-color: #242424;
  1118. margin-top: 10px;
  1119. margin-bottom: 20px;
  1120. }
  1121. .PowerColunm {
  1122. width: 130px;
  1123. height: 30px;
  1124. /* user-select: text;
  1125. -webkit-user-select: text;
  1126. -moz-user-select: text;
  1127. -ms-user-select: text; */
  1128. color: silver;
  1129. float: left;
  1130. margin-top: 18px;
  1131. margin-left: 10px;
  1132. font-size: 11px;
  1133. position: relative;
  1134. z-index: 20;
  1135. /* overflow:auto; */
  1136. }
  1137. .img {
  1138. width: 18px;
  1139. height: 20px;
  1140. float: right;
  1141. background-color: #242424;
  1142. /* background-color: red; */
  1143. margin-top: -10px;
  1144. margin-right: -10px;
  1145. /* margin-top: -15px; */
  1146. background-image: url(../../static/picture/zuizhongsanjiao2.png);
  1147. }
  1148. .value {
  1149. color: #ffffff;
  1150. font-size: 14px;
  1151. float: right;
  1152. }
  1153. .rightValue {
  1154. color: #ffffff;
  1155. font-size: 14px;
  1156. float: right;
  1157. }
  1158. .informationCardText4 {
  1159. width: 120px;
  1160. height: 35px;
  1161. font-size: 14px;
  1162. line-height: 35px;
  1163. float: right;
  1164. /* margin-left: 4px; */
  1165. margin-right: 9px;
  1166. }
  1167. .textSilverDay {
  1168. user-select: text;
  1169. -webkit-user-select: text;
  1170. -moz-user-select: text;
  1171. -ms-user-select: text;
  1172. color: silver;
  1173. float: left;
  1174. font-size: 14px;
  1175. margin-left: 2%;
  1176. }
  1177. </style>