index.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031
  1. <template>
  2. <div class="app-container">
  3. <div class="dark-el-input dark-el-button">
  4. <el-form ref="queryForm" size="small" :inline="true">
  5. <el-form-item label="时间">
  6. <el-date-picker
  7. :clearable="false"
  8. v-model="dateTime"
  9. type="datetimerange"
  10. range-separator="至"
  11. start-placeholder="开始日期"
  12. end-placeholder="结束日期"
  13. :default-time="['00:00:00', '23:45:00']" popper-class="cpp-popper"
  14. :picker-options="pickerOptions"
  15. />
  16. </el-form-item>
  17. <el-form-item label="场站名称">
  18. <el-select v-model="stationCode" placeholder="请选择" popper-class="cpp-popper">
  19. <el-option
  20. v-for="item in stationList"
  21. :key="item.value"
  22. :label="item.label"
  23. :value="item.value">
  24. </el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item>
  28. <el-button type="primary" style="margin-left: 5px" icon="el-icon-search" @click="dataQuery">查询
  29. </el-button>
  30. </el-form-item>
  31. </el-form>
  32. </div>
  33. <div style="padding-top: 10px">
  34. <div style="display: flex">
  35. <div style="float:left;width: 65%;height: 350px" id="wscharts"></div>
  36. <div style="float:left;width: 35%;height: 350px" id="wdcharts"></div>
  37. </div>
  38. <div class="vxe-max-height-65vh">
  39. <vxe-table
  40. highlight-hover-row
  41. :keep-source="true"
  42. align="center"
  43. :loading="loading"
  44. ref="xTable"
  45. auto-resize
  46. highlight-current-row
  47. border
  48. resizable
  49. show-overflow
  50. :data="tableData.slice((currentPage-1) * pageSize,currentPage * pageSize)">
  51. <vxe-table-column field="stationCode" title="场站名称" :formatter="stationCodeFormat" width="200px"
  52. fixed="left"></vxe-table-column>
  53. <vxe-table-column field="time" title="时间" width="180px" fixed="left"></vxe-table-column>
  54. <vxe-table-column field="t" title="温度(℃)" width="180px"></vxe-table-column>
  55. <vxe-table-column field="rh" title="湿度(RH%)" width="180px"></vxe-table-column>
  56. <vxe-table-column field="pa" title="气压(kPa)" width="180px"></vxe-table-column>
  57. <vxe-table-column field="wsHubHeight" title="轮毂风速(m/s)" width="180px"></vxe-table-column>
  58. <vxe-table-column field="wdHubHeight" title="轮毂风向(°)" width="180px"></vxe-table-column>
  59. <vxe-table-column field="ws10" title="10米风速(m/s)" width="180px"></vxe-table-column>
  60. <vxe-table-column field="wd10" title="10米风向(°)" width="180px"></vxe-table-column>
  61. <vxe-table-column field="ws30" title="30米风速(m/s)" width="180px"></vxe-table-column>
  62. <vxe-table-column field="wd30" title="30米风向(°)" width="180px"></vxe-table-column>
  63. <vxe-table-column field="ws50" title="50米风速(m/s)" width="180px"></vxe-table-column>
  64. <vxe-table-column field="wd50" title="50米风向(°)" width="180px"></vxe-table-column>
  65. <vxe-table-column field="ws60" title="60米风速(m/s)" width="180px"></vxe-table-column>
  66. <vxe-table-column field="wd60" title="60米风向(°)" width="180px"></vxe-table-column>
  67. <vxe-table-column field="ws70" title="70米风速(m/s)" width="180px"></vxe-table-column>
  68. <vxe-table-column field="wd70" title="70米风向(°)" width="180px"></vxe-table-column>
  69. <vxe-table-column field="ws80" title="80米风速(m/s)" width="180px"></vxe-table-column>
  70. <vxe-table-column field="wd80" title="80米风向(°)" width="180px"></vxe-table-column>
  71. <vxe-table-column field="ws90" title="90米风速(m/s)" width="180px"></vxe-table-column>
  72. <vxe-table-column field="wd90" title="90米风向(°)" width="180px"></vxe-table-column>
  73. <vxe-table-column field="ws100" title="100米风速(m/s)" width="180px"></vxe-table-column>
  74. <vxe-table-column field="wd100" title="100米风向(°)" width="180px"></vxe-table-column>
  75. </vxe-table>
  76. <vxe-pager
  77. perfect
  78. :current-page.sync="currentPage"
  79. :page-size.sync="pageSize"
  80. :total="total"
  81. :page-sizes=[10,50,100]
  82. :layouts="['PrevJump', 'PrevPage','JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']"
  83. @page-change="handlePageChange"
  84. >
  85. </vxe-pager>
  86. </div>
  87. </div>
  88. </div>
  89. </template>
  90. <script>
  91. import * as echarts from "echarts";
  92. export default {
  93. name: 'inverterinfo',
  94. data() {
  95. return {
  96. wsChart: null,
  97. wdChart: null,
  98. dateTime: [new Date(new Date().toLocaleDateString()).getTime(), new Date(new Date().toLocaleDateString()).getTime() + 60 * 60 * 24 * 1000 - 5 * 1000 * 60],
  99. total: 0,
  100. sortOrder: 'asc',
  101. pageSize: 7,
  102. currentPage: 1,
  103. stationList: [],
  104. stationCode: [],
  105. searchForm: {},
  106. tableData: [],
  107. nameList: [],
  108. loading: false,
  109. modId: '',//备用id
  110. itemStyle: [
  111. {
  112. itemStyle: {
  113. normal: {
  114. lineStyle: {
  115. color: '#4A99FF',
  116. // shadowColor: '#4A99FF',
  117. // shadowBlur: 10,
  118. },
  119. shadowColor: '#4A99FF',
  120. shadowBlur: 10,
  121. },
  122. },
  123. areaStyle: {
  124. normal: { // 单项区域填充样式
  125. color: {
  126. type: 'linear',
  127. x: 0, //右
  128. y: 0, //下
  129. x2: 1, //左
  130. y2: 1, //上
  131. colorStops: [{
  132. offset: 0,
  133. color: '#4A99FF'
  134. }, {
  135. offset: 0.5,
  136. color: 'rgba(0,0,0,0)'
  137. }, {
  138. offset: 1,
  139. color: '#4A99FF'
  140. }],
  141. globalCoord: false
  142. },
  143. opacity: 1 // 区域透明度
  144. }
  145. }
  146. },
  147. {
  148. itemStyle: {
  149. normal: {
  150. lineStyle: {
  151. color: '#4BFFFC',
  152. // shadowColor: '#4BFFFC',
  153. // shadowBlur: 10,
  154. },
  155. shadowColor: '#4BFFFC',
  156. shadowBlur: 10,
  157. },
  158. },
  159. areaStyle: {
  160. normal: { // 单项区域填充样式
  161. color: {
  162. type: 'linear',
  163. x: 0, //右
  164. y: 0, //下
  165. x2: 1, //左
  166. y2: 1, //上
  167. colorStops: [{
  168. offset: 0,
  169. color: '#4BFFFC'
  170. }, {
  171. offset: 0.5,
  172. color: 'rgba(0,0,0,0)'
  173. }, {
  174. offset: 1,
  175. color: '#4BFFFC'
  176. }],
  177. globalCoord: false
  178. },
  179. opacity: 1 // 区域透明度
  180. }
  181. }
  182. },
  183. {
  184. itemStyle: {
  185. normal: {
  186. lineStyle: {
  187. color: '#ff654a',
  188. // shadowColor: '#4A99FF',
  189. // shadowBlur: 10,
  190. },
  191. shadowColor: '#ff654a',
  192. shadowBlur: 10,
  193. },
  194. },
  195. areaStyle: {
  196. normal: { // 单项区域填充样式
  197. color: {
  198. type: 'linear',
  199. x: 0, //右
  200. y: 0, //下
  201. x2: 1, //左
  202. y2: 1, //上
  203. colorStops: [{
  204. offset: 0,
  205. color: '#ff654a'
  206. }, {
  207. offset: 0.5,
  208. color: 'rgba(0,0,0,0)'
  209. }, {
  210. offset: 1,
  211. color: '#ff654a'
  212. }],
  213. globalCoord: false
  214. },
  215. opacity: 1 // 区域透明度
  216. }
  217. }
  218. },
  219. {
  220. itemStyle: {
  221. normal: {
  222. lineStyle: {
  223. color: '#edff4a',
  224. // shadowColor: '#4A99FF',
  225. // shadowBlur: 10,
  226. },
  227. shadowColor: '#edff4a',
  228. shadowBlur: 10,
  229. },
  230. },
  231. areaStyle: {
  232. normal: { // 单项区域填充样式
  233. color: {
  234. type: 'linear',
  235. x: 0, //右
  236. y: 0, //下
  237. x2: 1, //左
  238. y2: 1, //上
  239. colorStops: [{
  240. offset: 0,
  241. color: '#edff4a'
  242. }, {
  243. offset: 0.5,
  244. color: 'rgba(0,0,0,0)'
  245. }, {
  246. offset: 1,
  247. color: '#edff4a'
  248. }],
  249. globalCoord: false
  250. },
  251. opacity: 1 // 区域透明度
  252. }
  253. }
  254. },
  255. {
  256. itemStyle: {
  257. normal: {
  258. lineStyle: {
  259. color: '#65ff4a',
  260. // shadowColor: '#4A99FF',
  261. // shadowBlur: 10,
  262. },
  263. shadowColor: '#65ff4a',
  264. shadowBlur: 10,
  265. },
  266. },
  267. areaStyle: {
  268. normal: { // 单项区域填充样式
  269. color: {
  270. type: 'linear',
  271. x: 0, //右
  272. y: 0, //下
  273. x2: 1, //左
  274. y2: 1, //上
  275. colorStops: [{
  276. offset: 0,
  277. color: '#65ff4a'
  278. }, {
  279. offset: 0.5,
  280. color: 'rgba(0,0,0,0)'
  281. }, {
  282. offset: 1,
  283. color: '#65ff4a'
  284. }],
  285. globalCoord: false
  286. },
  287. opacity: 1 // 区域透明度
  288. }
  289. }
  290. },
  291. {
  292. itemStyle: {
  293. normal: {
  294. lineStyle: {
  295. color: '#4affea',
  296. // shadowColor: '#4A99FF',
  297. // shadowBlur: 10,
  298. },
  299. shadowColor: '#4affea',
  300. shadowBlur: 10,
  301. },
  302. },
  303. areaStyle: {
  304. normal: { // 单项区域填充样式
  305. color: {
  306. type: 'linear',
  307. x: 0, //右
  308. y: 0, //下
  309. x2: 1, //左
  310. y2: 1, //上
  311. colorStops: [{
  312. offset: 0,
  313. color: '#4affea'
  314. }, {
  315. offset: 0.5,
  316. color: 'rgba(0,0,0,0)'
  317. }, {
  318. offset: 1,
  319. color: '#4affea'
  320. }],
  321. globalCoord: false
  322. },
  323. opacity: 1 // 区域透明度
  324. }
  325. }
  326. },
  327. {
  328. itemStyle: {
  329. normal: {
  330. lineStyle: {
  331. color: '#894aff',
  332. // shadowColor: '#4A99FF',
  333. // shadowBlur: 10,
  334. },
  335. shadowColor: '#894aff',
  336. shadowBlur: 10,
  337. },
  338. },
  339. areaStyle: {
  340. normal: { // 单项区域填充样式
  341. color: {
  342. type: 'linear',
  343. x: 0, //右
  344. y: 0, //下
  345. x2: 1, //左
  346. y2: 1, //上
  347. colorStops: [{
  348. offset: 0,
  349. color: '#894aff'
  350. }, {
  351. offset: 0.5,
  352. color: 'rgba(0,0,0,0)'
  353. }, {
  354. offset: 1,
  355. color: '#894aff'
  356. }],
  357. globalCoord: false
  358. },
  359. opacity: 1 // 区域透明度
  360. }
  361. }
  362. },
  363. {
  364. itemStyle: {
  365. normal: {
  366. lineStyle: {
  367. color: '#d84aff',
  368. // shadowColor: '#4A99FF',
  369. // shadowBlur: 10,
  370. },
  371. shadowColor: '#d84aff',
  372. shadowBlur: 10,
  373. },
  374. },
  375. areaStyle: {
  376. normal: { // 单项区域填充样式
  377. color: {
  378. type: 'linear',
  379. x: 0, //右
  380. y: 0, //下
  381. x2: 1, //左
  382. y2: 1, //上
  383. colorStops: [{
  384. offset: 0,
  385. color: '#d84aff'
  386. }, {
  387. offset: 0.5,
  388. color: 'rgba(0,0,0,0)'
  389. }, {
  390. offset: 1,
  391. color: '#d84aff'
  392. }],
  393. globalCoord: false
  394. },
  395. opacity: 1 // 区域透明度
  396. }
  397. }
  398. },
  399. {
  400. itemStyle: {
  401. normal: {
  402. lineStyle: {
  403. color: '#ff4aae',
  404. // shadowColor: '#4A99FF',
  405. // shadowBlur: 10,
  406. },
  407. shadowColor: '#ff4aae',
  408. shadowBlur: 10,
  409. },
  410. },
  411. areaStyle: {
  412. normal: { // 单项区域填充样式
  413. color: {
  414. type: 'linear',
  415. x: 0, //右
  416. y: 0, //下
  417. x2: 1, //左
  418. y2: 1, //上
  419. colorStops: [{
  420. offset: 0,
  421. color: '#ff4aae'
  422. }, {
  423. offset: 0.5,
  424. color: 'rgba(0,0,0,0)'
  425. }, {
  426. offset: 1,
  427. color: '#ff4aae'
  428. }],
  429. globalCoord: false
  430. },
  431. opacity: 1 // 区域透明度
  432. }
  433. }
  434. },
  435. ],
  436. colorArr: [
  437. {
  438. start: "rgba(155, 101, 229,",
  439. end: "rgba(219,44,44,0.5)"
  440. },
  441. {
  442. start: "rgba(71, 173, 245,",
  443. end: "rgba(231,132,46,0.5)"
  444. },
  445. {
  446. start: "rgba(82, 249, 107,",
  447. end: "rgba(190,229,50,0.5)"
  448. },
  449. {
  450. start: "rgba(82, 249, 107,",
  451. end: "rgba(44,214,140,0.5)"
  452. },
  453. {
  454. start: "rgba(82, 249, 107,",
  455. end: "rgba(43,73,221,0.5)"
  456. },
  457. {
  458. start: "rgba(82, 249, 107,",
  459. end: "rgba(40,203,203,0.5)"
  460. },
  461. {
  462. start: "rgba(82, 249, 107,",
  463. end: "rgba(195,42,180,0.5)"
  464. },
  465. {
  466. start: "rgba(82, 249, 107,",
  467. end: "rgba(231,45,119,0.5)"
  468. },
  469. {
  470. start: "rgba(82, 249, 107,",
  471. end: "rgba(229,46,46,0.5)"
  472. },
  473. ],
  474. lineStyle: [
  475. {
  476. areaStyle: {
  477. normal: {
  478. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  479. offset: 0,
  480. color: 'rgba(219,50,51,0.3)'
  481. }, {
  482. offset: 0.8,
  483. color: 'rgba(219, 50, 51, 0)'
  484. }], false),
  485. shadowColor: 'rgba(0, 0, 0, 0.1)',
  486. shadowBlur: 10
  487. }
  488. },
  489. itemStyle: {
  490. normal: {
  491. color: 'rgb(219,50,51)',
  492. borderColor: 'rgba(219,50,51,0.2)',
  493. borderWidth: 12
  494. }
  495. },
  496. },
  497. {
  498. areaStyle: {
  499. normal: {
  500. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  501. offset: 0,
  502. color: 'rgba(219,196,50,0.3)'
  503. }, {
  504. offset: 0.8,
  505. color: 'rgba(219, 50, 51, 0)'
  506. }], false),
  507. shadowColor: 'rgba(0, 0, 0, 0.1)',
  508. shadowBlur: 10
  509. }
  510. },
  511. itemStyle: {
  512. normal: {
  513. color: 'rgb(219,196,50)',
  514. borderColor: 'rgba(219,196,50,0.2)',
  515. borderWidth: 12
  516. }
  517. },
  518. },
  519. {
  520. areaStyle: {
  521. normal: {
  522. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  523. offset: 0,
  524. color: 'rgba(101,219,50,0.3)'
  525. }, {
  526. offset: 0.8,
  527. color: 'rgba(219, 50, 51, 0)'
  528. }], false),
  529. shadowColor: 'rgba(0, 0, 0, 0.1)',
  530. shadowBlur: 10
  531. }
  532. },
  533. itemStyle: {
  534. normal: {
  535. color: 'rgb(101,219,50)',
  536. borderColor: 'rgba(101,219,50,0.2)',
  537. borderWidth: 12
  538. }
  539. },
  540. },
  541. {
  542. areaStyle: {
  543. normal: {
  544. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  545. offset: 0,
  546. color: 'rgba(50,219,171,0.3)'
  547. }, {
  548. offset: 0.8,
  549. color: 'rgba(219, 50, 51, 0)'
  550. }], false),
  551. shadowColor: 'rgba(0, 0, 0, 0.1)',
  552. shadowBlur: 10
  553. }
  554. },
  555. itemStyle: {
  556. normal: {
  557. color: 'rgb(50,219,171)',
  558. borderColor: 'rgba(50,219,171,0.2)',
  559. borderWidth: 12
  560. }
  561. },
  562. },
  563. {
  564. areaStyle: {
  565. normal: {
  566. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  567. offset: 0,
  568. color: 'rgba(50,118,219,0.3)'
  569. }, {
  570. offset: 0.8,
  571. color: 'rgba(219, 50, 51, 0)'
  572. }], false),
  573. shadowColor: 'rgba(0, 0, 0, 0.1)',
  574. shadowBlur: 10
  575. }
  576. },
  577. itemStyle: {
  578. normal: {
  579. color: 'rgb(50,118,219)',
  580. borderColor: 'rgba(50,118,219,0.2)',
  581. borderWidth: 12
  582. }
  583. },
  584. },
  585. {
  586. areaStyle: {
  587. normal: {
  588. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  589. offset: 0,
  590. color: 'rgba(140,50,219,0.3)'
  591. }, {
  592. offset: 0.8,
  593. color: 'rgba(219, 50, 51, 0)'
  594. }], false),
  595. shadowColor: 'rgba(0, 0, 0, 0.1)',
  596. shadowBlur: 10
  597. }
  598. },
  599. itemStyle: {
  600. normal: {
  601. color: 'rgb(140,50,219)',
  602. borderColor: 'rgba(140,50,219,0.2)',
  603. borderWidth: 12
  604. }
  605. },
  606. },
  607. {
  608. areaStyle: {
  609. normal: {
  610. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  611. offset: 0,
  612. color: 'rgba(202,50,219,0.3)'
  613. }, {
  614. offset: 0.8,
  615. color: 'rgba(219, 50, 51, 0)'
  616. }], false),
  617. shadowColor: 'rgba(0, 0, 0, 0.1)',
  618. shadowBlur: 10
  619. }
  620. },
  621. itemStyle: {
  622. normal: {
  623. color: 'rgb(202,50,219)',
  624. borderColor: 'rgba(202,50,219,0.2)',
  625. borderWidth: 12
  626. }
  627. },
  628. },
  629. {
  630. areaStyle: {
  631. normal: {
  632. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  633. offset: 0,
  634. color: 'rgba(50,199,219,0.3)'
  635. }, {
  636. offset: 0.8,
  637. color: 'rgba(219, 50, 51, 0)'
  638. }], false),
  639. shadowColor: 'rgba(0, 0, 0, 0.1)',
  640. shadowBlur: 10
  641. }
  642. },
  643. itemStyle: {
  644. normal: {
  645. color: 'rgb(50,199,219)',
  646. borderColor: 'rgba(50,199,219,0.2)',
  647. borderWidth: 12
  648. }
  649. },
  650. },
  651. {
  652. areaStyle: {
  653. normal: {
  654. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  655. offset: 0,
  656. color: 'rgba(219,143,50,0.3)'
  657. }, {
  658. offset: 0.8,
  659. color: 'rgba(219, 50, 51, 0)'
  660. }], false),
  661. shadowColor: 'rgba(0, 0, 0, 0.1)',
  662. shadowBlur: 10
  663. }
  664. },
  665. itemStyle: {
  666. normal: {
  667. color: 'rgb(219,143,50)',
  668. borderColor: 'rgba(219,143,50,0.2)',
  669. borderWidth: 12
  670. }
  671. },
  672. }
  673. ],
  674. lineColor: '#3b3b3b',
  675. pickerMinDate: null,
  676. pickerMaxDate: null,
  677. day30: 30 * 24 * 3600 * 1000,
  678. // 日期使用
  679. pickerOptions: {
  680. onPick: ({maxDate, minDate}) => {
  681. if (minDate && this.pickerMinDate) {
  682. this.pickerMinDate = null;
  683. } else if (minDate) {
  684. this.pickerMinDate = minDate.getTime();
  685. }
  686. },
  687. disabledDate: (time) => {
  688. if (this.pickerMinDate) {
  689. return (time.getTime() > (this.pickerMinDate + this.day30)) || (time.getTime() < (this.pickerMinDate - this.day30));
  690. }
  691. return false;
  692. }
  693. },
  694. }
  695. },
  696. created() {
  697. this.getStationCode()
  698. },
  699. mounted() {
  700. },
  701. beforeDestroy() {
  702. if (!this.wsChart) {
  703. return
  704. }
  705. this.wsChart.dispose()
  706. this.wsChart = null
  707. if (!this.wdChart) {
  708. return
  709. }
  710. this.wdChart.dispose()
  711. this.wdChart = null
  712. },
  713. computed: {},
  714. methods: {
  715. nameFormat({cellValue, row, column}) {
  716. const item = this.nameList.find(item => item.value === cellValue)
  717. return item ? item.label : ''
  718. },
  719. stationCodeFormat({cellValue, row, column}) {
  720. const item = this.stationList.find(item => item.value === cellValue)
  721. return item ? item.label : ''
  722. },
  723. handlePageChange({currentPage, pageSize}) {
  724. this.currentPage = currentPage
  725. this.pageSize = pageSize
  726. },
  727. async dataQuery() {
  728. let startTime = Math.round(this.dateTime[0])
  729. let endTime = Math.round(this.dateTime[1])
  730. if (endTime <= startTime) {
  731. this.$message.error("开始时间不能大于结束时间")
  732. return
  733. }
  734. this.loading = true
  735. let queryParams = {
  736. "stationCode": this.stationCode,
  737. "startTime": startTime,
  738. "endTime": endTime,
  739. }
  740. this.$axios.get('/windtowerstatusdata/queryTableData', {params: queryParams}).then(response => {
  741. this.tableData = response.data.tableList
  742. this.total = response.data.tableList.length
  743. let wsMap = response.data.wsMap
  744. let wsTime = response.data.wsTime
  745. let wdMap = response.data.wdMap
  746. this.wsDraw(wsTime, wsMap)
  747. this.wdDraw(wdMap);
  748. this.loading = false
  749. }).catch(() => {
  750. this.loading = false
  751. })
  752. },
  753. getStationCode() {
  754. const param = {
  755. "type": 'E2',
  756. }
  757. this.$axios.get('/electricfield/findByType', {params: param}).then(response => {
  758. this.stationList = response.data
  759. if (this.stationList.length > 0) {
  760. this.stationCode = this.stationList[0].value
  761. this.dataQuery()
  762. }
  763. })
  764. },
  765. wsDraw(wsTime, wsMap) {
  766. this.wsChart = echarts.init(document.getElementById('wscharts'), 'dark')
  767. let option = {
  768. backgroundColor: 'transparent',
  769. title: {
  770. top: 20,
  771. text: '风速图',
  772. textStyle: {
  773. fontWeight: 'normal',
  774. fontSize: 16,
  775. // color: this.lineColor
  776. },
  777. left: '1%'
  778. },
  779. tooltip: {
  780. confine: true,
  781. trigger: 'axis',
  782. axisPointer: {
  783. lineStyle: {
  784. color: '#57617B'
  785. }
  786. }
  787. },
  788. legend: {
  789. left:'center',
  790. top: 20,
  791. width: '100%',
  792. icon: 'rect',
  793. itemWidth: 14,
  794. itemHeight: 5,
  795. itemGap: 13,
  796. data: [],
  797. right: '4%',
  798. textStyle: {
  799. fontSize: 12,
  800. // color: this.lineColor
  801. },
  802. selected: {}
  803. },
  804. dataZoom: [{
  805. show: false,
  806. realtime: true,
  807. showDetail: false,
  808. left: "15%",
  809. right: "15%",
  810. handleSize: 0,
  811. }, {
  812. type: 'inside'
  813. }],
  814. grid: {
  815. top: 100,
  816. left: '2%',
  817. right: '2%',
  818. bottom: '10%',
  819. containLabel: true
  820. },
  821. xAxis: [{
  822. type: 'category',
  823. boundaryGap: false,
  824. // axisLine: {
  825. // lineStyle: {
  826. // color: this.lineColor
  827. // }
  828. // },
  829. data: []
  830. }],
  831. yAxis: [{
  832. type: 'value',
  833. name: 'm/s',
  834. axisTick: {
  835. show: false
  836. },
  837. // axisLine: {
  838. // lineStyle: {
  839. // color: this.lineColor
  840. // }
  841. // },
  842. axisLabel: {
  843. margin: 10,
  844. textStyle: {
  845. fontSize: 14,
  846. // color: this.lineColor
  847. },
  848. formatter: '{value}',
  849. },
  850. splitLine: {
  851. lineStyle: {
  852. color: '#57617B'
  853. }
  854. }
  855. }],
  856. series: []
  857. }
  858. option.xAxis[0].data = wsTime
  859. var index = 0;
  860. for (var key in wsMap) {
  861. for (let i = 0; i < wsMap[key].length; i++) {
  862. wsMap[key][i] = wsMap[key][i] == -99 ? null : wsMap[key][i]
  863. }
  864. option.legend.data.push(key)
  865. if (key == '轮毂风速') {
  866. option.legend.selected[key] = true
  867. } else {
  868. option.legend.selected[key] = false
  869. }
  870. var sValue = {
  871. name: '',
  872. type: 'line',
  873. smooth: false,
  874. symbol: 'circle',
  875. symbolSize: 5,
  876. showSymbol: false,
  877. lineStyle: {
  878. normal: {
  879. width: 2
  880. }
  881. },
  882. itemStyle: {},
  883. data: []
  884. }
  885. sValue.name = key
  886. sValue.data = wsMap[key]
  887. sValue.itemStyle = this.lineStyle[index].itemStyle
  888. sValue.connectNulls = true
  889. option.series.push(sValue)
  890. index++;
  891. }
  892. this.wsChart.setOption(option, true)
  893. var _this = this
  894. window.addEventListener("resize", function () {
  895. _this.wsChart.resize();
  896. });
  897. },
  898. wdDraw(wdMap) {
  899. this.wdChart = echarts.init(document.getElementById('wdcharts'), 'dark')
  900. const option = {
  901. backgroundColor: 'transparent',
  902. color: ['#4A99FF', '#4BFFFC', '#ff654a', '#edff4a', '#65ff4a', '#4affea', '#894aff', '#d84aff', '#ff4aae'],
  903. legend: {
  904. top: 20,
  905. width: 50,
  906. icon: 'rect',
  907. itemWidth: 14,
  908. itemHeight: 5,
  909. itemGap: 13,
  910. data: [],
  911. right: '4%',
  912. textStyle: {
  913. fontSize: 12,
  914. // color: '#F1F1F3'
  915. },
  916. selected: {}
  917. },
  918. title: {
  919. top: 20,
  920. text: '风向玫瑰图',
  921. textStyle: {
  922. fontWeight: 'normal',
  923. fontSize: 16,
  924. // color: this.lineColor
  925. },
  926. left: '15%'
  927. },
  928. tooltip: {
  929. confine: true,
  930. trigger: 'axis',
  931. axisPointer: {
  932. lineStyle: {
  933. color: '#FFFFFF'
  934. }
  935. }
  936. },
  937. radar: [
  938. {
  939. name: {
  940. textStyle: {
  941. color: '#FFFFFF',
  942. fontSize: 16
  943. },
  944. },
  945. splitArea: { // 坐标轴在 grid 区域中的分隔区域,默认不显示。
  946. show: true,
  947. areaStyle: { // 分隔区域的样式设置。
  948. color: ['rgba(255,255,255,0)', 'rgba(255,255,255,0)'], // 分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。
  949. }
  950. },
  951. axisLine: { //指向外圈文本的分隔线样式
  952. lineStyle: {
  953. color: '#FFFFFF'
  954. }
  955. },
  956. splitLine: {
  957. lineStyle: {
  958. color: '#FFFFFF', // 分隔线颜色
  959. width: 1, // 分隔线线宽
  960. }
  961. },
  962. indicator: [
  963. {text: 'N', max: 1},
  964. {text: 'NNW', max: 1},
  965. {text: 'NW', max: 1},
  966. {text: 'WNW', max: 1},
  967. {text: 'W', max: 1},
  968. {text: 'WSW', max: 1},
  969. {text: 'SW', max: 1},
  970. {text: 'SSW', max: 1},
  971. {text: 'S', max: 1},
  972. {text: 'SSE', max: 1},
  973. {text: 'SE', max: 1},
  974. {text: 'ESE', max: 1},
  975. {text: 'E', max: 1},
  976. {text: 'ENE', max: 1},
  977. {text: 'NE', max: 1},
  978. {text: 'NNE', max: 1},
  979. ],
  980. center: ['50%', '50%'],
  981. radius: '70%'
  982. },
  983. ],
  984. series: [
  985. {
  986. type: 'radar',
  987. tooltip: {
  988. trigger: 'item',
  989. },
  990. areaStyle: {},
  991. data: []
  992. }
  993. ],
  994. }
  995. var index = 0;
  996. for (var key in wdMap) {
  997. option.legend.data.push(key)
  998. if (key == '轮毂风向') {
  999. option.legend.selected[key] = true
  1000. } else {
  1001. option.legend.selected[key] = false
  1002. }
  1003. var wd = new Object
  1004. wd.name = key
  1005. wd.value = wdMap[key]
  1006. wd.connectNulls = true
  1007. wd.itemStyle = this.itemStyle[index].itemStyle
  1008. wd.areaStyle = this.itemStyle[index].areaStyle
  1009. option.series[0].data.push(wd)
  1010. index++;
  1011. }
  1012. this.wdChart.setOption(option, true)
  1013. var _this = this
  1014. window.addEventListener("resize", function () {
  1015. _this.wdChart.resize();
  1016. });
  1017. },
  1018. },
  1019. }
  1020. </script>