WindStationCardDetail.vue 30 KB

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