WindStationCardDetail.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248
  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. 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. body {
  703. font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', STHeiti, 'Microsoft Yahei', Tahoma, Simsun, sans-serif;
  704. font-size: 20px;
  705. color: silver;
  706. background: #020202;
  707. }
  708. @font-face {
  709. font-family: '方正兰亭细黑_GBK';
  710. src: url(../../static/方正兰亭细黑_GBK.TTF);
  711. }
  712. page {
  713. background-color: #1f1f1f;
  714. font-family: '方正兰亭细黑_GBK';
  715. color: silver;
  716. }
  717. .InformationCard {
  718. margin-top: 10px;
  719. width: 100%;
  720. height: 90px;
  721. background-color: #242424;
  722. float: left;
  723. }
  724. .informationCardAll {
  725. width: 100%;
  726. margin-top: 10px;
  727. height: 60px;
  728. float: left;
  729. }
  730. .informationCardTextOne {
  731. width: 100%;
  732. height: 35px;
  733. float: left;
  734. }
  735. .informationCardTextNo1 {
  736. margin-left: 2%;
  737. width: 115px;
  738. height: 35px;
  739. font-size: 13px;
  740. line-height: 35px;
  741. float: left;
  742. }
  743. .informationCardText {
  744. margin-left: 2%;
  745. width: 115px;
  746. height: 35px;
  747. line-height: 35px;
  748. user-select: text;
  749. -webkit-user-select: text;
  750. -moz-user-select: text;
  751. -ms-user-select: text;
  752. color: silver;
  753. font-size: 13px;
  754. float: left;
  755. }
  756. .informationCardTextzj {
  757. /* margin-left: 43%; */
  758. width: 115px;
  759. height: 35px;
  760. line-height: 35px;
  761. user-select: text;
  762. -webkit-user-select: text;
  763. -moz-user-select: text;
  764. -ms-user-select: text;
  765. color: silver;
  766. font-size: 13px;
  767. float: right;
  768. margin-right: 1%;
  769. }
  770. .informationCardTextTwo {
  771. width: 100%;
  772. height: 35px;
  773. float: left;
  774. user-select: text;
  775. -webkit-user-select: text;
  776. -moz-user-select: text;
  777. -ms-user-select: text;
  778. color: silver;
  779. }
  780. .informationCardText2 {
  781. /* margin-left: 6%; */
  782. margin-left: calc(48% - 175px);
  783. width: 115px;
  784. height: 35px;
  785. font-size: 13px;
  786. line-height: 35px;
  787. float: left;
  788. }
  789. .informationCardText3 {
  790. /* margin-left: 6%; */
  791. margin-left: calc(48% - 175px);
  792. width: 120px;
  793. height: 35px;
  794. font-size: 13px;
  795. line-height: 35px;
  796. float: left;
  797. }
  798. .textWhite {
  799. color: white;
  800. float: left;
  801. width: 24px;
  802. text-align: right;
  803. }
  804. .textSilver {
  805. user-select: text;
  806. -webkit-user-select: text;
  807. -moz-user-select: text;
  808. -ms-user-select: text;
  809. color: silver;
  810. float: left;
  811. }
  812. .speedPower {
  813. width: 100%;
  814. height: 180px;
  815. background-color: #242424;
  816. float: left;
  817. margin-top: 20rpx;
  818. margin-bottom: 10px;
  819. }
  820. .cardinstallredSpeed {
  821. margin-top: 8px;
  822. margin-left: 9px;
  823. width: 46%;
  824. height: 78px;
  825. background-color: #1f1f1f;
  826. /* background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%); */
  827. border-radius: 5px;
  828. float: left;
  829. }
  830. .cardinstalltitlegreen {
  831. width: 80%;
  832. height: 25px;
  833. text-align: center;
  834. margin-left: 10%;
  835. user-select: text;
  836. -webkit-user-select: text;
  837. -moz-user-select: text;
  838. -ms-user-select: text;
  839. font-size: 14px;
  840. color: silver;
  841. line-height: 25px;
  842. float: left;
  843. }
  844. .cardinstalltitlegreen span {
  845. color: white;
  846. /* float: right; */
  847. /* margin-right: 70px; */
  848. }
  849. .cardinstallnumbergreen {
  850. width: 100%;
  851. height: 25px;
  852. text-align: center;
  853. user-select: text;
  854. -webkit-user-select: text;
  855. -moz-user-select: text;
  856. -ms-user-select: text;
  857. font-size: 20px;
  858. color: silver;
  859. /* color: #449618; */
  860. line-height: 25px;
  861. float: left;
  862. }
  863. .cardinstallnumbergreenmin {
  864. margin-left: 2px;
  865. width: 45%;
  866. height: 20px;
  867. user-select: text;
  868. -webkit-user-select: text;
  869. -moz-user-select: text;
  870. -ms-user-select: text;
  871. font-size: 12px;
  872. color: silver;
  873. /* color: #449618; */
  874. float: left;
  875. }
  876. .cardinstallnumbergreenmax {
  877. /* font-weight: bold; */
  878. margin-right: 2px;
  879. width: 45%;
  880. height: 20px;
  881. user-select: text;
  882. -webkit-user-select: text;
  883. -moz-user-select: text;
  884. -ms-user-select: text;
  885. font-size: 12px;
  886. color: silver;
  887. /* color: #449618; */
  888. float: right;
  889. }
  890. .greenMinText {
  891. line-height: 20px;
  892. float: right;
  893. }
  894. .greenMaxText {
  895. line-height: 20px;
  896. float: left;
  897. }
  898. .cardinstalltitleRed {
  899. width: 80%;
  900. height: 25px;
  901. text-align: center;
  902. margin-left: 10%;
  903. user-select: text;
  904. -webkit-user-select: text;
  905. -moz-user-select: text;
  906. -ms-user-select: text;
  907. font-size: 14px;
  908. color: silver;
  909. line-height: 25px;
  910. float: left;
  911. }
  912. .cardinstalltitleRed span {
  913. color: white;
  914. /* float: right;
  915. margin-right: 85px; */
  916. }
  917. .cardinstallnumberred {
  918. width: 100%;
  919. height: 25px;
  920. text-align: center;
  921. user-select: text;
  922. -webkit-user-select: text;
  923. -moz-user-select: text;
  924. -ms-user-select: text;
  925. font-size: 20px;
  926. color: silver;
  927. /* color: #E93131; */
  928. line-height: 25px;
  929. float: left;
  930. }
  931. .cardinstallnumberredmin {
  932. margin-left: 2px;
  933. width: 45%;
  934. height: 20px;
  935. user-select: text;
  936. -webkit-user-select: text;
  937. -moz-user-select: text;
  938. -ms-user-select: text;
  939. font-size: 12px;
  940. color: silver;
  941. /* color: #E93131; */
  942. float: left;
  943. }
  944. .cardinstallnumberredmax {
  945. margin-right: 2px;
  946. width: 45%;
  947. height: 20px;
  948. user-select: text;
  949. -webkit-user-select: text;
  950. -moz-user-select: text;
  951. -ms-user-select: text;
  952. font-size: 12px;
  953. color: silver;
  954. /* color: #E93131; */
  955. float: right;
  956. }
  957. .redMinText {
  958. line-height: 20px;
  959. float: right;
  960. }
  961. .redMaxText {
  962. line-height: 20px;
  963. float: left;
  964. }
  965. /* .quatoCardAndFrame {
  966. clear: both;
  967. width: 100%;
  968. height: 10px;
  969. background-color:red;
  970. position: relative;
  971. } */
  972. /* .quatoCardContainer {
  973. width: 375px;
  974. height: 12px;
  975. background-color:blue;
  976. } */
  977. .quatoCard {
  978. width: 32%;
  979. height: 30px;
  980. float: left;
  981. margin-right: 1.5%;
  982. margin-bottom: 8px;
  983. text-align: center;
  984. line-height: 30px;
  985. font-size: 14px;
  986. /* background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  987. }
  988. .quatoCardLast {
  989. width: 32%;
  990. height: 30px;
  991. float: left;
  992. text-align: center;
  993. line-height: 30px;
  994. margin-bottom: 8px;
  995. font-size: 14px;
  996. /* background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%); */
  997. }
  998. .sanJiaoUp {
  999. clear: both;
  1000. width: 0;
  1001. height: 0;
  1002. /* border-right: 20px solid transparent;
  1003. border-left: 20px solid transparent;
  1004. border-bottom: 15px solid #E47369; */
  1005. margin-left: calc(50% - 20px);
  1006. }
  1007. .sanJiaoDown {
  1008. clear: both;
  1009. width: 0;
  1010. height: 0;
  1011. /* border-right: 20px solid transparent;
  1012. border-left: 20px solid transparent;
  1013. border-top: 15px solid #E47369; */
  1014. margin-left: calc(50% - 20px);
  1015. }
  1016. .frame {
  1017. width: calc(100% - 18px);
  1018. margin-left: 9px;
  1019. height: 150px;
  1020. position: absolute;
  1021. /* top: 20px; */
  1022. left: 0px;
  1023. z-index: 20;
  1024. /* background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%); */
  1025. background-color: #242424;
  1026. border-top: 0.5px solid #242424;
  1027. }
  1028. .frameCardLeft {
  1029. width: 34%;
  1030. height: 10px;
  1031. float: left;
  1032. /* margin-right: 1.5%; */
  1033. margin-bottom: 8px;
  1034. /* text-align: center; */
  1035. line-height: 30px;
  1036. font-size: 13px;
  1037. color: #a1a1a1;
  1038. margin-top: 15px;
  1039. }
  1040. .frameCardLeftValue {
  1041. float: right;
  1042. color: #ffffff;
  1043. margin-right: 18px;
  1044. /* margin-left: 20px; */
  1045. }
  1046. .frameCardLeftValueSulfurdioxide{
  1047. }
  1048. .frameCardMiddleValue {
  1049. float: right;
  1050. color: #ffffff;
  1051. }
  1052. .frameCardRightValue {
  1053. float: right;
  1054. color: #ffffff;
  1055. }
  1056. .frameCardMiddle {
  1057. width: 29%;
  1058. height: 10px;
  1059. float: left;
  1060. /* margin-right: 1.5%; */
  1061. margin-left: 1.5%;
  1062. margin-bottom: 8px;
  1063. /* text-align: center; */
  1064. line-height: 30px;
  1065. font-size: 13px;
  1066. color: #a1a1a1;
  1067. margin-top: 15px;
  1068. }
  1069. .frameCardRight {
  1070. width: 34%;
  1071. height: 10px;
  1072. float: left;
  1073. /* text-align: center; */
  1074. line-height: 30px;
  1075. margin-bottom: 8px;
  1076. font-size: 13px;
  1077. color: #a1a1a1;
  1078. margin-left: 1.5%;
  1079. margin-top: 15px;
  1080. }
  1081. .speedPowerDiagram {
  1082. clear: both;
  1083. width: 130px;
  1084. height: 30px;
  1085. user-select: text;
  1086. -webkit-user-select: text;
  1087. -moz-user-select: text;
  1088. -ms-user-select: text;
  1089. color: silver;
  1090. float: left;
  1091. margin-top: 18px;
  1092. margin-left: 9px;
  1093. font-size: 11px;
  1094. }
  1095. .qiun-charts {
  1096. width: 750upx;
  1097. height: 400upx;
  1098. }
  1099. .charts {
  1100. width: 750upx;
  1101. height: 400upx;
  1102. }
  1103. .lineChart {
  1104. clear: both;
  1105. width: 100%;
  1106. height: 225px;
  1107. background-color: #242424;
  1108. }
  1109. .Histogram {
  1110. width: 100%;
  1111. height: 225px;
  1112. clear: both;
  1113. background-color: #242424;
  1114. margin-top: 10px;
  1115. margin-bottom: 20px;
  1116. }
  1117. .PowerColunm {
  1118. width: 130px;
  1119. height: 30px;
  1120. /* user-select: text;
  1121. -webkit-user-select: text;
  1122. -moz-user-select: text;
  1123. -ms-user-select: text; */
  1124. color: silver;
  1125. float: left;
  1126. margin-top: 18px;
  1127. margin-left: 10px;
  1128. font-size: 11px;
  1129. position: relative;
  1130. z-index: 20;
  1131. /* overflow:auto; */
  1132. }
  1133. .img {
  1134. width: 18px;
  1135. height: 20px;
  1136. float: right;
  1137. background-color: #242424;
  1138. /* background-color: red; */
  1139. margin-top: -10px;
  1140. margin-right: -10px;
  1141. /* margin-top: -15px; */
  1142. background-image: url(../../static/picture/zuizhongsanjiao2.png);
  1143. }
  1144. .value {
  1145. color: #ffffff;
  1146. font-size: 14px;
  1147. float: right;
  1148. }
  1149. .rightValue {
  1150. color: #ffffff;
  1151. font-size: 14px;
  1152. float: right;
  1153. }
  1154. .informationCardText4 {
  1155. width: 120px;
  1156. height: 35px;
  1157. font-size: 14px;
  1158. line-height: 35px;
  1159. float: right;
  1160. /* margin-left: 4px; */
  1161. margin-right: 9px;
  1162. }
  1163. .textSilverDay {
  1164. user-select: text;
  1165. -webkit-user-select: text;
  1166. -moz-user-select: text;
  1167. -ms-user-select: text;
  1168. color: silver;
  1169. float: left;
  1170. font-size: 14px;
  1171. margin-left: 2%;
  1172. }
  1173. </style>