WindStationCardDetail.vue 33 KB

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