powerPredictionPage.vue 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511
  1. <template>
  2. <div class="powerPredictionPage" :class="!theme ? 'themeDark' : 'themeLight'">
  3. <el-row class="windStstus">
  4. <el-col :span="8" class="scrollbar">
  5. <!-- <span class="scrollbarName">场站名称:</span> -->
  6. <el-scrollbar>
  7. <div class="scrollbar-flex-content">
  8. <p v-for="item in stationData" :key="item.no" class="scrollbar-demo-item"
  9. :class="item.showBac ? 'changeBacksty' : 'defaultBacksty'" @click="changeStation(item.no)">
  10. {{ item.stationName }}
  11. </p>
  12. </div>
  13. </el-scrollbar>
  14. </el-col>
  15. <el-col :span="15">
  16. <div class="everyOne" v-for="(item, index) in !theme ? statusData : statusDataW" :key="index"
  17. :style="statusSty(item)">
  18. <div class="everyOneImg" style="width: 39px">
  19. <img :src="item.img" alt="" />
  20. </div>
  21. <span class="statusName"
  22. :style="{ color: `${!theme ? item.borderSty : '#fff'}` }">{{ item.name }}</span>
  23. <span class="statusNum" :style="statusNumSty(item)">{{
  24. item.number
  25. }}</span>
  26. </div>
  27. </el-col>
  28. </el-row>
  29. <div class="lineMain" :style="pageHeight">
  30. <el-row>
  31. <el-col :span="14">
  32. <div class="lineStyle" v-on:dblclick="doubleclick('功率预测')" style="position: relative">
  33. <div style="
  34. display: flex;
  35. float: right;
  36. justify-content: end;
  37. margin-right: 23px;
  38. ">
  39. <div v-for="item in showpowerLegend" :key="item.name">
  40. <span class="lineColor" :style="{ background: item.color }"></span>
  41. <span class="powerLegendColor" :style="{ background: item.color }"></span>
  42. <span :style="!theme ? 'color: #fff' : ''" style="
  43. font-size: 12px;
  44. margin-left: 12px;
  45. position: relative;
  46. top: 1px;
  47. ">{{ item.name }}</span>
  48. </div>
  49. </div>
  50. <div class="chart-name">
  51. <div class="point point-left bottom"></div>
  52. <div class="point point-right bottom"></div>
  53. </div>
  54. <div id="powerChart" :style="chartStyle"></div>
  55. </div>
  56. <div class="lineStyle" v-on:dblclick="doubleclick('风速预测')" style="position: relative">
  57. <div class="chart-name">
  58. <div class="point point-left bottom"></div>
  59. <div class="point point-right bottom"></div>
  60. </div>
  61. <div id="windChart" :style="chartStyle"></div>
  62. </div>
  63. <div class="lineStyle" style="position: relative">
  64. <div class="chart-name">
  65. <div class="point point-left bottom"></div>
  66. <div class="point point-right bottom"></div>
  67. </div>
  68. <div id="assessmentChart" :style="chartStyle"></div>
  69. </div>
  70. </el-col>
  71. <el-col :span="10">
  72. <div class="lineStyle1" style="position: relative">
  73. <div class="chart-name">
  74. <div class="point point-left bottom"></div>
  75. <div class="point point-right bottom"></div>
  76. </div>
  77. <div id="installChart" :style="messageStyle"></div>
  78. </div>
  79. <div class="lineStyle1" :style="messageStylexc">
  80. <div style="display: flex" :style="messageStyle">
  81. <div style="width: 50%">
  82. <div id="guageChart" style="width: 100%; height: 100%"></div>
  83. </div>
  84. <div style="width: 50%">
  85. <div id="radarChart" style="width: 100%; height: 100%"></div>
  86. </div>
  87. </div>
  88. <div style="display: flex" :style="messageStyle">
  89. <div style="width: 50%">
  90. <div id="guageChart1" style="width: 100%; height: 100%"></div>
  91. </div>
  92. <div style="width: 50%">
  93. <div id="guageChart2" style="width: 100%; height: 100%"></div>
  94. </div>
  95. </div>
  96. </div>
  97. </el-col>
  98. </el-row>
  99. </div>
  100. <power-prediction-dialog ref="prediction" :ExceedTimeList="ExceedTimeList" :echartsTheme="echartsTheme"
  101. :theme="theme"></power-prediction-dialog>
  102. </div>
  103. </template>
  104. <script>
  105. import powerPredictionDialog from "../../components/powerPredictionComponent/powerPredictionDialog/predictionDialogPage.vue";
  106. import {
  107. apiGetStationGL,
  108. apiGetglobalPowerCharts,
  109. apiGetglobalWindSpeedCharts,
  110. apiGetinstalledCapacity,
  111. apiGetpredictedAssessmentScores,
  112. apiGetmeteorologicalElements,
  113. apiGetwindRosetteChart,
  114. apiGetUnitStatusInfoByStationNo,
  115. } from "../../api/api";
  116. import oneimg from "@/assets/windStatusPic/yunxing.png";
  117. import twoimg from "@/assets/windStatusPic/daiji.png";
  118. import threeimg from "@/assets/windStatusPic/weihu.png";
  119. import fourimg from "@/assets/windStatusPic/tingji.png";
  120. import fiveimg from "@/assets/windStatusPic/xiandian.png";
  121. import siximg from "@/assets/windStatusPic/shoulei.png";
  122. import sevenimg from "@/assets/windStatusPic/guzhang.png";
  123. import oneimg1 from "@/assets/windStatusPic/yunxing_W.png";
  124. import twoimg1 from "@/assets/windStatusPic/daiji_W.png";
  125. import threeimg1 from "@/assets/windStatusPic/weihu_W.png";
  126. import fourimg1 from "@/assets/windStatusPic/tingji_W.png";
  127. import fiveimg1 from "@/assets/windStatusPic/xiandian_W.png";
  128. import siximg1 from "@/assets/windStatusPic/shoulei_W.png";
  129. import sevenimg1 from "@/assets/windStatusPic/guzhang_W.png";
  130. import jsonData from "./component/power.json";
  131. export default {
  132. components: {
  133. powerPredictionDialog,
  134. },
  135. data() {
  136. return {
  137. windTurbines: "",
  138. statusData: [],
  139. statusDataW: [],
  140. stationData: [],
  141. pickerTime: [],
  142. pickerTimeDia: [],
  143. itemVal: "",
  144. planFiveMin: "",
  145. showpowerLegend: [],
  146. echartsTheme: "",
  147. theme: null,
  148. };
  149. },
  150. watch: {
  151. "$store.state.theme": {
  152. handler: function (newVal, oldVal) {
  153. this.theme = newVal;
  154. this.echartsTheme = !newVal ? "dark" : "";
  155. this.pickerTime = [
  156. new Date(
  157. new Date(new Date().getTime()).setHours(0, 0, 0, 0) + 900 * 1000
  158. ),
  159. new Date(
  160. new Date(new Date().getTime()).setHours(0, 0, 0, 0) +
  161. 24 * 60 * 60 * 1000
  162. ),
  163. ];
  164. this.pickerTimeDia = [
  165. new Date(
  166. new Date(new Date().getTime()).setHours(0, 0, 0, 0) + 900 * 1000
  167. ),
  168. new Date(
  169. new Date(new Date().getTime()).setHours(0, 0, 0, 0) +
  170. 24 * 60 * 60 * 1000 -
  171. 1000
  172. ),
  173. ];
  174. this.getStationData();
  175. },
  176. immediate: true,
  177. },
  178. },
  179. created() {
  180. this.statusData = [{
  181. img: oneimg,
  182. name: "运行",
  183. nameEn: "yx",
  184. borderSty: "#1C99FF",
  185. backSty: "#0046C7",
  186. numBack: "#212223",
  187. number: 0,
  188. },
  189. {
  190. img: twoimg,
  191. name: "待机",
  192. nameEn: "dj",
  193. borderSty: "#05BB4C",
  194. backSty: "#258952",
  195. numBack: "#212223",
  196. number: 0,
  197. },
  198. {
  199. img: threeimg,
  200. name: "维护",
  201. nameEn: "wh",
  202. borderSty: "#E17D24",
  203. backSty: "#694119",
  204. numBack: "#212223",
  205. number: 0,
  206. },
  207. {
  208. img: fourimg,
  209. name: "停机",
  210. nameEn: "tj",
  211. borderSty: "#52595B",
  212. backSty: "#272a2b",
  213. numBack: "#212223",
  214. number: 0,
  215. },
  216. {
  217. img: fiveimg,
  218. name: "限电",
  219. nameEn: "xd",
  220. borderSty: "#C530C8",
  221. backSty: "#7A277F",
  222. numBack: "#212223",
  223. number: 0,
  224. },
  225. {
  226. img: siximg,
  227. name: "离线",
  228. nameEn: "lx",
  229. borderSty: "#fff",
  230. backSty: "#38393B",
  231. numBack: "#212223",
  232. number: 0,
  233. },
  234. {
  235. img: sevenimg,
  236. name: "检修",
  237. nameEn: "jx",
  238. borderSty: "#BA3237",
  239. backSty: "#73262B",
  240. numBack: "#212223",
  241. number: 0,
  242. },
  243. ];
  244. this.statusDataW = [{
  245. img: oneimg1,
  246. name: "运行",
  247. nameEn: "yx",
  248. borderSty: "#3777E8",
  249. backSty: "#1850B3",
  250. numBack: "#073484",
  251. number: 0,
  252. },
  253. {
  254. img: twoimg1,
  255. name: "待机",
  256. nameEn: "dj",
  257. borderSty: "#6BDB97",
  258. backSty: "#0EAC4C",
  259. numBack: "#077C35",
  260. number: 0,
  261. },
  262. {
  263. img: threeimg1,
  264. name: "维护",
  265. nameEn: "wh",
  266. borderSty: "#F1AF74",
  267. backSty: "#E17D24",
  268. numBack: "#A6530A",
  269. number: 0,
  270. },
  271. {
  272. img: fourimg1,
  273. name: "停机",
  274. nameEn: "tj",
  275. borderSty: "#CDCDCD",
  276. backSty: "#A8A8A8",
  277. numBack: "#878787",
  278. number: 0,
  279. },
  280. {
  281. img: fiveimg1,
  282. name: "限电",
  283. nameEn: "xd",
  284. borderSty: "#E757EA",
  285. backSty: "#C530C8",
  286. numBack: "#901193",
  287. number: 0,
  288. },
  289. {
  290. img: siximg1,
  291. name: "离线",
  292. nameEn: "lx",
  293. borderSty: "#595D61",
  294. backSty: "#38393B",
  295. numBack: "#151719",
  296. number: 0,
  297. },
  298. {
  299. img: sevenimg1,
  300. name: "检修",
  301. nameEn: "jx",
  302. borderSty: "#73262B",
  303. backSty: "#BA3237",
  304. numBack: "#881B1F",
  305. number: 0,
  306. },
  307. ];
  308. this.pickerTime = [
  309. new Date(
  310. new Date(new Date().getTime()).setHours(0, 0, 0, 0) + 900 * 1000
  311. ),
  312. new Date(
  313. new Date(new Date().getTime()).setHours(0, 0, 0, 0) +
  314. 24 * 60 * 60 * 1000
  315. ),
  316. ];
  317. this.pickerTimeDia = [
  318. new Date(
  319. new Date(new Date().getTime()).setHours(0, 0, 0, 0) + 900 * 1000
  320. ),
  321. new Date(
  322. new Date(new Date().getTime()).setHours(0, 0, 0, 0) +
  323. 24 * 60 * 60 * 1000 -
  324. 1000
  325. ),
  326. ];
  327. this.ExceedTimeList = [{
  328. label: "超前15分钟",
  329. value: 0,
  330. },
  331. {
  332. label: "超前30分钟",
  333. value: 1,
  334. },
  335. {
  336. label: "超前45分钟",
  337. value: 2,
  338. },
  339. {
  340. label: "超前1小时",
  341. value: 3,
  342. },
  343. {
  344. label: "超前1小时15分钟",
  345. value: 4,
  346. },
  347. {
  348. label: "超前1小时30分钟",
  349. value: 5,
  350. },
  351. {
  352. label: "超前1小时45分钟",
  353. value: 6,
  354. },
  355. {
  356. label: "超前2小时",
  357. value: 7,
  358. },
  359. {
  360. label: "超前2小时15分钟",
  361. value: 8,
  362. },
  363. {
  364. label: "超前2小时30分钟",
  365. value: 9,
  366. },
  367. {
  368. label: "超前2小时45分钟",
  369. value: 10,
  370. },
  371. {
  372. label: "超前3小时",
  373. value: 11,
  374. },
  375. {
  376. label: "超前3小时15分钟",
  377. value: 12,
  378. },
  379. {
  380. label: "超前3小时30分钟",
  381. value: 13,
  382. },
  383. {
  384. label: "超前3小时45分钟",
  385. value: 14,
  386. },
  387. {
  388. label: "超前4小时",
  389. value: 15,
  390. },
  391. {
  392. label: "超前5小时",
  393. value: 19,
  394. },
  395. {
  396. label: "超前6小时",
  397. value: 23,
  398. },
  399. ];
  400. this.showpowerLegend = [{
  401. name: "理论",
  402. color: "#5672c4",
  403. },
  404. {
  405. name: "可用",
  406. color: "#95cc7a",
  407. },
  408. {
  409. name: "AGC",
  410. color: "#f7c75f",
  411. },
  412. {
  413. name: "超短期",
  414. color: "#e96366",
  415. },
  416. {
  417. name: "实际",
  418. color: "#7ac1dd",
  419. },
  420. ];
  421. // this.getStationData();
  422. },
  423. computed: {
  424. pageHeight() {
  425. return {
  426. height: document.documentElement.clientHeight - 110 + "px",
  427. };
  428. },
  429. chartStyle() {
  430. let height =
  431. (document.documentElement.clientHeight - 100 - 100) / 3 + "px";
  432. return {
  433. width: "100%",
  434. height: height,
  435. };
  436. },
  437. messageStyle() {
  438. let height =
  439. (document.documentElement.clientHeight - 100 - 100) / 3 + "px";
  440. return {
  441. width: "96%",
  442. height: height,
  443. };
  444. },
  445. messageStylexc() {
  446. let height =
  447. ((document.documentElement.clientHeight - 100 - 60) / 3) * 2 + "px";
  448. return {
  449. width: "96%",
  450. height: height,
  451. };
  452. },
  453. },
  454. mounted() {
  455. let that = this;
  456. // that.initPageData();
  457. that.planFiveMin = setInterval(function () {
  458. that.seachData();
  459. }, 300000);
  460. },
  461. beforeRouteLeave(to, from, next) {
  462. next();
  463. if (this.planFiveMin) {
  464. clearInterval(this.planFiveMin);
  465. this.planFiveMin = null;
  466. }
  467. },
  468. methods: {
  469. initPageData() {
  470. const that = this;
  471. {
  472. let xAxis = [];
  473. let series = [];
  474. let legend = [];
  475. jsonData.globalPowerPredictionChartData.dateList.forEach((item) => {
  476. xAxis.push(item.substring(item.indexOf(" ") + 1));
  477. });
  478. jsonData.globalPowerPredictionChartData.dataFormatList.forEach(
  479. (iten) => {
  480. if (iten.name !== "短期") {
  481. legend.push(iten.name);
  482. let seriesObj = {
  483. name: iten.name,
  484. type: "line",
  485. data: iten.data.map((it) => {
  486. return that.$utils.isHasNum(it);
  487. }),
  488. symbol: "none",
  489. };
  490. series.push(seriesObj);
  491. }
  492. }
  493. );
  494. that.getPowerLine("powerChart", "功率预测", xAxis, legend, series);
  495. }
  496. {
  497. let xAxis = [];
  498. let series = [];
  499. let legend = [];
  500. jsonData.globalWindSpeedForecastChartData.dateList.forEach((item) => {
  501. xAxis.push(item.substring(item.indexOf(" ") + 1));
  502. });
  503. jsonData.globalWindSpeedForecastChartData.dataFormatList.forEach(
  504. (iten) => {
  505. legend.push(iten.name);
  506. let seriesObj = {
  507. name: iten.name,
  508. type: "line",
  509. data: iten.data.map((it) => {
  510. return that.$utils.isHasNum(it);
  511. }),
  512. symbol: "none",
  513. };
  514. series.push(seriesObj);
  515. }
  516. );
  517. that.getPowerLine("windChart", "风速预测", xAxis, legend, series);
  518. }
  519. {
  520. let xAxis = [];
  521. let series = [];
  522. let legend = [];
  523. jsonData.installedCapacityData.name.forEach((item) => {
  524. xAxis.push(item);
  525. });
  526. jsonData.installedCapacityData.dataFormatList.forEach((iten, index) => {
  527. legend.push(iten.name);
  528. let seriesObj = {
  529. name: iten.name,
  530. type: "bar",
  531. barGap: 0,
  532. emphasis: {
  533. focus: "series",
  534. },
  535. data: iten.data.map((it) => {
  536. return that.$utils.isHasNum(it);
  537. }),
  538. };
  539. series.push(seriesObj);
  540. });
  541. that.getPowerBar("installChart", "功率统计", xAxis, legend, series);
  542. }
  543. {
  544. let xAxis = [];
  545. let series = [];
  546. let legend = [];
  547. jsonData.predictedAssessmentScoresData.name.forEach((item) => {
  548. xAxis.push(item);
  549. });
  550. jsonData.predictedAssessmentScoresData.dataFormatList.forEach(
  551. (iten, index) => {
  552. legend.push(iten.name);
  553. let seriesObj = {
  554. name: iten.name,
  555. type: "bar",
  556. barGap: 0,
  557. emphasis: {
  558. focus: "series",
  559. },
  560. data: iten.data.map((it) => {
  561. return that.$utils.isHasNum(it);
  562. }),
  563. };
  564. series.push(seriesObj);
  565. }
  566. );
  567. that.getPowerBar(
  568. "assessmentChart",
  569. "预测考核分数",
  570. xAxis,
  571. legend,
  572. series
  573. );
  574. }
  575. {
  576. let radar = [];
  577. let radaxr = [0, 45, 90, 135, 180, 225, 270, 315, 360];
  578. let serise = [{
  579. value: [],
  580. name: "实际风向",
  581. },
  582. {
  583. value: [],
  584. name: "预测风向",
  585. },
  586. ];
  587. jsonData.windRosetteChartData.dataFormatList[0].data.forEach(
  588. (item, index) => {
  589. if (radaxr.indexOf((index + 1) * 5) !== -1) {
  590. let obj = {
  591. name: (index + 1) * 5,
  592. };
  593. radar.unshift(obj);
  594. }
  595. }
  596. );
  597. jsonData.windRosetteChartData.dataFormatList.forEach((itn) => {
  598. let ser1 = [];
  599. let ser2 = [];
  600. if (itn.name === "预测风速") {
  601. itn.data.forEach((it, index) => {
  602. if (radaxr.indexOf((index + 1) * 5) !== -1) {
  603. ser1.unshift(it && it !== 0 ? it.toFixed(1) : 0);
  604. }
  605. });
  606. serise[1].value = ser1;
  607. } else {
  608. itn.data.forEach((it, index) => {
  609. if (radaxr.indexOf((index + 1) * 5) !== -1) {
  610. ser2.unshift(it && it !== 0 ? it.toFixed(1) : 0);
  611. }
  612. });
  613. serise[0].value = ser2;
  614. }
  615. });
  616. radar.forEach((itb) => {
  617. if (itb.name === 360) {
  618. itb.name = "北";
  619. } else if (itb.name === 45) {
  620. itb.name = "东北";
  621. } else if (itb.name === 90) {
  622. itb.name = "东";
  623. } else if (itb.name === 135) {
  624. itb.name = "东南";
  625. } else if (itb.name === 180) {
  626. itb.name = "南";
  627. } else if (itb.name === 225) {
  628. itb.name = "西南";
  629. } else if (itb.name === 270) {
  630. itb.name = "西";
  631. } else if (itb.name === 315) {
  632. itb.name = "西北";
  633. }
  634. });
  635. that.getRadar(radar, serise);
  636. }
  637. const gaugeData = [{
  638. title: {
  639. offsetCenter: ["-40%", "85%"],
  640. },
  641. detail: {
  642. offsetCenter: ["-40%", "110%"],
  643. },
  644. },
  645. {
  646. title: {
  647. offsetCenter: ["40%", "85%"],
  648. },
  649. detail: {
  650. offsetCenter: ["40%", "110%"],
  651. },
  652. },
  653. ];
  654. jsonData.meteorologicalElementsData.dataFormatList.forEach((item) => {
  655. gaugeData[0].name = "实际" + item.name;
  656. gaugeData[0].value = Math.ceil(item.data[1]);
  657. gaugeData[1].name = "预测" + item.name;
  658. gaugeData[1].value = Math.ceil(item.data[0]);
  659. if (item.name === "温度") {
  660. that.getGaugeX("guageChart", gaugeData);
  661. } else if (item.name === "湿度") {
  662. that.getGaugeX("guageChart1", gaugeData);
  663. } else {
  664. that.getGaugeX("guageChart2", gaugeData);
  665. }
  666. });
  667. that.statusData.forEach((item) => {
  668. for (let it in jsonData.unitStatusInfoByStationNoData) {
  669. if (item.nameEn === it) {
  670. item.number = jsonData.unitStatusInfoByStationNoData[it];
  671. }
  672. }
  673. });
  674. that.statusDataW.forEach((item) => {
  675. for (let it in jsonData.unitStatusInfoByStationNoData) {
  676. if (item.nameEn === it) {
  677. item.number = jsonData.unitStatusInfoByStationNoData[it];
  678. }
  679. }
  680. });
  681. },
  682. statusSty(item) {
  683. return `border: 1px solid ${item.borderSty};background: ${item.backSty}`;
  684. },
  685. statusNumSty(item) {
  686. return `border: 1px solid ${item.borderSty};background:${item.numBack}`;
  687. },
  688. doubleclick(name) {
  689. let title = "";
  690. this.stationData.forEach((item) => {
  691. if (item.no === this.windTurbines) {
  692. title = item.stationName;
  693. }
  694. });
  695. this.$refs.prediction.dialogVisible = true;
  696. this.$refs.prediction.isPower = false;
  697. this.$refs.prediction.tableData = [];
  698. this.$refs.prediction.dateType = 1;
  699. this.$refs.prediction.title = title + name;
  700. this.$refs.prediction.loading = true;
  701. this.$refs.prediction.pickerTime = this.pickerTimeDia;
  702. this.$refs.prediction.windTurbines = this.windTurbines;
  703. this.$refs.prediction.windTurbinesVal = this.itemVal;
  704. this.$nextTick(() => {
  705. const myChart1 = this.$echarts.init(
  706. document.getElementById("powerChart"),
  707. this.echartsTheme
  708. );
  709. const myChart2 = this.$echarts.init(
  710. document.getElementById("windChart"),
  711. this.echartsTheme
  712. );
  713. myChart1.dispatchAction({
  714. type: "hideTip",
  715. });
  716. myChart2.dispatchAction({
  717. type: "hideTip",
  718. });
  719. if (name === "功率预测") {
  720. this.$refs.prediction.isPower = true;
  721. this.$refs.prediction.getChartsData();
  722. this.$refs.prediction.getTableData();
  723. } else {
  724. this.$refs.prediction.isPower = false;
  725. this.$refs.prediction.getwindChartsData();
  726. this.$refs.prediction.getwindTableData();
  727. }
  728. });
  729. },
  730. getStationData() {
  731. apiGetStationGL().then((datas) => {
  732. this.stationData = datas.data.list;
  733. this.stationData[0].showBac = true;
  734. this.windTurbines = datas.data.list[0].no;
  735. this.itemVal = datas.data.list[0].itemVal;
  736. this.getPowerPrediction();
  737. this.getWindSpeed();
  738. this.getCapacity();
  739. this.getAssessmentScore();
  740. this.getIrradiance();
  741. this.getwindRosetteChart();
  742. this.getUnitStatus();
  743. });
  744. },
  745. // 根据场站编号获取机组状态信息
  746. getUnitStatus() {
  747. let that = this;
  748. let params = {
  749. stationNo: that.windTurbines,
  750. };
  751. apiGetUnitStatusInfoByStationNo(params).then((datas) => {
  752. if (datas) {
  753. if (datas.data) {
  754. that.statusData.forEach((item) => {
  755. for (let it in datas.data) {
  756. if (item.nameEn === it) {
  757. item.number = datas.data[it];
  758. }
  759. }
  760. });
  761. that.statusDataW.forEach((item) => {
  762. for (let it in datas.data) {
  763. if (item.nameEn === it) {
  764. item.number = datas.data[it];
  765. }
  766. }
  767. });
  768. }
  769. }
  770. });
  771. },
  772. changeStation(val) {
  773. this.windTurbines = val;
  774. this.stationData.forEach((item) => {
  775. if (item.no === val) {
  776. this.itemVal = item.itemVal;
  777. item.showBac = true;
  778. } else {
  779. item.showBac = false;
  780. }
  781. });
  782. this.seachData();
  783. },
  784. statusIcon(type) {
  785. let picture = "";
  786. if (type === "1") {
  787. picture = "yunxingPic";
  788. } else if (type === "2") {
  789. picture = "daijiPic";
  790. } else if (type === "3") {
  791. picture = "weihuPic";
  792. } else if (type === "4") {
  793. picture = "tingjiPic";
  794. } else if (type === "5") {
  795. picture = "xiandianPic";
  796. } else if (type === "6") {
  797. picture = "lixianPic";
  798. } else if (type === "7") {
  799. picture = "jianxiuPic";
  800. }
  801. return picture;
  802. },
  803. seachData() {
  804. this.getPowerPrediction();
  805. this.getWindSpeed();
  806. this.getCapacity();
  807. this.getAssessmentScore();
  808. this.getwindRosetteChart();
  809. this.getIrradiance();
  810. this.getUnitStatus();
  811. },
  812. // 今日功率预测
  813. getPowerPrediction() {
  814. let pickStartTime = this.$utils.getTime(this.pickerTime[0]);
  815. let pickEndTime = this.$utils.getTime(this.pickerTime[1]);
  816. let type;
  817. if (
  818. new Date(pickEndTime).getTime() - new Date(pickStartTime).getTime() <=
  819. 10 * 86400000
  820. ) {
  821. type = 1;
  822. } else {
  823. type = 2;
  824. }
  825. let params = {
  826. beginDataTime: pickStartTime,
  827. endDataTime: pickEndTime,
  828. stationNumber: this.windTurbines,
  829. timeType: type,
  830. // itemVal: this.itemVal,
  831. itemVal: 0,
  832. leadTime: 0
  833. };
  834. apiGetglobalPowerCharts(params).then((datas) => {
  835. if (datas && datas.data) {
  836. let xAxis = [];
  837. let series = [];
  838. let legend = [];
  839. if (datas.data.dateList.length > 0) {
  840. datas.data.dateList.forEach((item) => {
  841. xAxis.push(item.substring(item.indexOf(" ") + 1));
  842. });
  843. }
  844. if (datas.data.dataFormatList.length > 0) {
  845. datas.data.dataFormatList.forEach((iten) => {
  846. if (iten.name !== "短期") {
  847. legend.push(iten.name);
  848. let seriesObj = {
  849. name: iten.name,
  850. type: "line",
  851. data: iten.data.map((it) => {
  852. return this.$utils.isHasNum(it);
  853. }),
  854. symbol: "none",
  855. };
  856. series.push(seriesObj);
  857. }
  858. });
  859. }
  860. this.getPowerLine("powerChart", "功率预测", xAxis, legend, series);
  861. }
  862. });
  863. },
  864. // 今日风速预测
  865. getWindSpeed() {
  866. let pickStartTime = this.$utils.getTime(this.pickerTime[0]);
  867. let pickEndTime = this.$utils.getTime(this.pickerTime[1]);
  868. let type;
  869. if (
  870. new Date(pickEndTime).getTime() - new Date(pickStartTime).getTime() <=
  871. 10 * 86400000
  872. ) {
  873. type = 1;
  874. } else {
  875. type = 2;
  876. }
  877. let params = {
  878. beginDataTime: pickStartTime,
  879. endDataTime: pickEndTime,
  880. stationNumber: this.windTurbines,
  881. timeType: type,
  882. };
  883. apiGetglobalWindSpeedCharts(params).then((datas) => {
  884. if (datas && datas.data) {
  885. let xAxis = [];
  886. let series = [];
  887. let legend = [];
  888. if (datas.data.dateList.length > 0) {
  889. datas.data.dateList.forEach((item) => {
  890. xAxis.push(item.substring(item.indexOf(" ") + 1));
  891. });
  892. }
  893. if (datas.data.dataFormatList.length > 0) {
  894. datas.data.dataFormatList.forEach((iten) => {
  895. legend.push(iten.name);
  896. let seriesObj = {
  897. name: iten.name,
  898. type: "line",
  899. data: iten.data.map((it) => {
  900. return this.$utils.isHasNum(it);
  901. }),
  902. symbol: "none",
  903. };
  904. series.push(seriesObj);
  905. });
  906. }
  907. this.getPowerLine("windChart", "风速预测", xAxis, legend, series);
  908. }
  909. });
  910. },
  911. getPowerLine(name, title, xAxis, legend, series) {
  912. let option = {
  913. backgroundColor: "",
  914. title: {
  915. text: title,
  916. textStyle: {
  917. fontSize: "16",
  918. fontWeight: "bold",
  919. },
  920. },
  921. tooltip: {
  922. trigger: "axis",
  923. formatter: name === "powerChart" ?
  924. (item) => {
  925. let str =
  926. `<span style="display:inline-block;margin-bottom: 5px">${item[0].axisValue}</span></br>`;
  927. let strMsg = "";
  928. item.forEach((it, index) => {
  929. if (index !== 3) {
  930. strMsg = `<div style="margin-bottom: 5px">
  931. <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${it.color};\"></span>&nbsp;
  932. <span style="display:inline-block;">${it.seriesName}:</span>&nbsp;&nbsp;<span>${it.value}</span>
  933. </div>`;
  934. this.showpowerLegend[index].name = it.seriesName;
  935. this.showpowerLegend[index].color = it.color;
  936. } else {
  937. if (it.axisValue === "00:15:00") {
  938. it.color = "#e96366";
  939. }
  940. strMsg = `<div style="margin-bottom: 5px">
  941. <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${
  942. it.color
  943. };\"></span>&nbsp;
  944. <span style="display:inline-block;">${
  945. it.color === "#e96366" ? "超短期" : "短期"
  946. }:</span>&nbsp;&nbsp;<span>${
  947. it.value
  948. }</span>
  949. </div>`;
  950. if (it.color === "#e96366") {
  951. this.showpowerLegend[index].name = "超短期";
  952. } else {
  953. this.showpowerLegend[index].name = "短期";
  954. }
  955. this.showpowerLegend[index].color = it.color;
  956. }
  957. str = str + strMsg;
  958. });
  959. return str;
  960. } : "",
  961. },
  962. legend: {
  963. // width: '380',
  964. right: "20",
  965. data: legend,
  966. // show: name === 'powerChart' ? false : true
  967. show: false,
  968. },
  969. grid: {
  970. left: "5%",
  971. right: "5%",
  972. bottom: "3%",
  973. containLabel: true,
  974. },
  975. xAxis: {
  976. type: "category",
  977. boundaryGap: false,
  978. data: xAxis,
  979. },
  980. yAxis: {
  981. type: "value",
  982. name: title === "功率预测" ? "兆瓦(Mw)" : "m/s",
  983. },
  984. series: series,
  985. };
  986. if (name === "powerChart") {
  987. let hour = new Date().getHours() + 6;
  988. let min = new Date().getMinutes();
  989. let allTime = "";
  990. let num = 0;
  991. if (0 <= min && min < 15) {
  992. allTime = hour + ":00:00";
  993. } else if (15 <= min && min < 30) {
  994. allTime = hour + ":15:00";
  995. } else if (30 <= min && min < 45) {
  996. allTime = hour + ":30:00";
  997. } else if (45 <= min && min < 60) {
  998. allTime = hour + ":45:00";
  999. }
  1000. xAxis.forEach((item, index) => {
  1001. if (item === allTime) {
  1002. num = index;
  1003. }
  1004. });
  1005. if (num > 0) {
  1006. option.visualMap = {
  1007. show: false,
  1008. dimension: 0,
  1009. seriesIndex: 3,
  1010. pieces: [{
  1011. gt: 0,
  1012. lte: num,
  1013. color: "#e96366",
  1014. },
  1015. {
  1016. gt: num,
  1017. color: "#39ccd9",
  1018. },
  1019. ],
  1020. };
  1021. }
  1022. } else {
  1023. option.legend.show = true;
  1024. option.data = legend;
  1025. option.right = "20";
  1026. }
  1027. // 基于准备好的dom,初始化echarts实例
  1028. let dom = document.getElementById(name);
  1029. dom.removeAttribute("_echarts_instance_") ?
  1030. dom.removeAttribute("_echarts_instance_") :
  1031. "";
  1032. let myChart = this.$echarts.init(dom, this.echartsTheme);
  1033. myChart.setOption(option);
  1034. myChart.on("mousemove", this.setTooltip("powerChart", "windChart", 0));
  1035. myChart.on("mouseover", function (params) {
  1036. console.log("myChart1=====>>>>>", params);
  1037. });
  1038. window.addEventListener("resize", function () {
  1039. myChart.resize();
  1040. });
  1041. },
  1042. setTooltip(name1, name2, num) {
  1043. const myChart1 = this.$echarts.init(
  1044. document.getElementById(name1),
  1045. this.echartsTheme
  1046. );
  1047. const myChart2 = this.$echarts.init(
  1048. document.getElementById(name2),
  1049. this.echartsTheme
  1050. );
  1051. this.$utils.setTooltip(myChart1, myChart2, num);
  1052. },
  1053. // 装机,并网,实时,可用电量
  1054. getCapacity() {
  1055. let params = {
  1056. stationNumber: this.windTurbines,
  1057. // itemVal: this.itemVal
  1058. itemVal: 0,
  1059. };
  1060. apiGetinstalledCapacity(params).then((datas) => {
  1061. if (datas && datas.data) {
  1062. let xAxis = [];
  1063. let series = [];
  1064. let legend = [];
  1065. if (datas.data.name.length > 0) {
  1066. datas.data.name.forEach((item) => {
  1067. xAxis.push(item);
  1068. });
  1069. }
  1070. if (datas.data.dataFormatList.length > 0) {
  1071. datas.data.dataFormatList.forEach((iten, index) => {
  1072. legend.push(iten.name);
  1073. let seriesObj = {
  1074. name: iten.name,
  1075. type: "bar",
  1076. barGap: 0,
  1077. emphasis: {
  1078. focus: "series",
  1079. },
  1080. data: iten.data.map((it) => {
  1081. return this.$utils.isHasNum(it);
  1082. }),
  1083. };
  1084. series.push(seriesObj);
  1085. });
  1086. }
  1087. this.getPowerBar("installChart", "功率统计", xAxis, legend, series);
  1088. }
  1089. });
  1090. },
  1091. // 预测考核分数
  1092. getAssessmentScore() {
  1093. let params = {
  1094. stationNumber: this.windTurbines,
  1095. };
  1096. apiGetpredictedAssessmentScores(params).then((datas) => {
  1097. if (datas && datas.data) {
  1098. let xAxis = [];
  1099. let series = [];
  1100. let legend = [];
  1101. if (datas.data.name.length > 0) {
  1102. datas.data.name.forEach((item) => {
  1103. xAxis.push(item);
  1104. });
  1105. }
  1106. if (datas.data.dataFormatList.length > 0) {
  1107. datas.data.dataFormatList.forEach((iten, index) => {
  1108. legend.push(iten.name);
  1109. let seriesObj = {
  1110. name: iten.name,
  1111. type: "bar",
  1112. barGap: 0,
  1113. emphasis: {
  1114. focus: "series",
  1115. },
  1116. data: iten.data.map((it) => {
  1117. return this.$utils.isHasNum(it);
  1118. }),
  1119. };
  1120. series.push(seriesObj);
  1121. });
  1122. }
  1123. this.getPowerBar(
  1124. "assessmentChart",
  1125. "预测考核分数",
  1126. xAxis,
  1127. legend,
  1128. series
  1129. );
  1130. }
  1131. });
  1132. },
  1133. getPowerBar(name, title, xAxis, legend, series) {
  1134. let option = {
  1135. backgroundColor: "",
  1136. title: {
  1137. text: title,
  1138. textStyle: {
  1139. fontSize: "16",
  1140. fontWeight: "bold",
  1141. },
  1142. },
  1143. tooltip: {
  1144. trigger: "axis",
  1145. axisPointer: {
  1146. type: "shadow",
  1147. },
  1148. },
  1149. grid: {
  1150. left: "5%",
  1151. right: "5%",
  1152. bottom: "3%",
  1153. containLabel: true,
  1154. },
  1155. legend: {
  1156. // bottom: bott,
  1157. right: "20",
  1158. data: legend,
  1159. },
  1160. xAxis: [{
  1161. type: "category",
  1162. axisTick: {
  1163. show: false,
  1164. },
  1165. data: xAxis,
  1166. }, ],
  1167. yAxis: [{
  1168. type: "value",
  1169. name: title === "预测考核分数" ? "分" : "兆瓦(M/w)",
  1170. }, ],
  1171. series: series,
  1172. };
  1173. // 基于准备好的dom,初始化echarts实例
  1174. let dom = document.getElementById(name);
  1175. dom.removeAttribute("_echarts_instance_") ?
  1176. dom.removeAttribute("_echarts_instance_") :
  1177. "";
  1178. let myChart = this.$echarts.init(dom, this.echartsTheme);
  1179. myChart.setOption(option);
  1180. window.addEventListener("resize", function () {
  1181. myChart.resize();
  1182. });
  1183. },
  1184. // 仪表盘,玫瑰图
  1185. getIrradiance() {
  1186. let params = {
  1187. dateTime: this.getPowerTime(new Date()),
  1188. stationNumber: this.windTurbines,
  1189. };
  1190. apiGetmeteorologicalElements(params).then((datas) => {
  1191. if (datas.data && datas.data.dataFormatList.length > 0) {
  1192. const gaugeData = [{
  1193. title: {
  1194. offsetCenter: ["-40%", "85%"],
  1195. },
  1196. detail: {
  1197. offsetCenter: ["-40%", "110%"],
  1198. },
  1199. },
  1200. {
  1201. title: {
  1202. offsetCenter: ["40%", "85%"],
  1203. },
  1204. detail: {
  1205. offsetCenter: ["40%", "110%"],
  1206. },
  1207. },
  1208. ];
  1209. datas.data.dataFormatList.forEach((item) => {
  1210. gaugeData[0].name = "实际" + item.name;
  1211. gaugeData[0].value = Math.ceil(item.data[1]);
  1212. gaugeData[1].name = "预测" + item.name;
  1213. gaugeData[1].value = Math.ceil(item.data[0]);
  1214. if (item.name === "温度") {
  1215. this.getGaugeX("guageChart", gaugeData);
  1216. } else if (item.name === "湿度") {
  1217. this.getGaugeX("guageChart1", gaugeData);
  1218. } else {
  1219. this.getGaugeX("guageChart2", gaugeData);
  1220. }
  1221. });
  1222. }
  1223. });
  1224. },
  1225. //转换时间
  1226. getPowerTime(date) {
  1227. var y = date.getFullYear();
  1228. var m = date.getMonth() + 1;
  1229. m = m < 10 ? "0" + m : m;
  1230. var d = date.getDate();
  1231. d = d < 10 ? "0" + d : d;
  1232. var h = date.getHours();
  1233. h = h < 10 ? "0" + h : h;
  1234. var minute = date.getMinutes();
  1235. minute = minute < 10 ? "0" + minute : minute;
  1236. // var second=date.getSeconds();
  1237. // second=second < 10 ? ('0' + second) : second;
  1238. // return y + '-' + m + '-' + d+' '+h+':'+minute+':'+second;
  1239. let timeF = "";
  1240. timeF = y + "-" + m + "-" + d + " " + h + ":" + minute;
  1241. return this.$utils.changePowerPickDate(timeF);
  1242. },
  1243. getGaugeX(name, servies) {
  1244. let formatVal = "";
  1245. let maxNum = null;
  1246. let minNum = null;
  1247. if (name === "guageChart") {
  1248. formatVal = "{value}℃";
  1249. maxNum = 50;
  1250. minNum = -50;
  1251. } else if (name === "guageChart1") {
  1252. formatVal = "{value}%";
  1253. maxNum = 100;
  1254. minNum = 0;
  1255. } else {
  1256. formatVal = "{value}Pa";
  1257. maxNum = 1500;
  1258. minNum = 0;
  1259. }
  1260. let option = {
  1261. series: [{
  1262. type: "gauge",
  1263. min: minNum,
  1264. max: maxNum,
  1265. anchor: {
  1266. show: true,
  1267. showAbove: true,
  1268. size: 18,
  1269. itemStyle: {
  1270. color: "#FAC858",
  1271. },
  1272. },
  1273. pointer: {
  1274. icon: "path://M2.9,0.7L2.9,0.7c1.4,0,2.6,1.2,2.6,2.6v115c0,1.4-1.2,2.6-2.6,2.6l0,0c-1.4,0-2.6-1.2-2.6-2.6V3.3C0.3,1.9,1.4,0.7,2.9,0.7z",
  1275. width: 8,
  1276. length: "80%",
  1277. offsetCenter: [0, "8%"],
  1278. },
  1279. progress: {
  1280. show: true,
  1281. overlap: true,
  1282. roundCap: true,
  1283. },
  1284. axisLine: {
  1285. roundCap: true,
  1286. },
  1287. data: servies,
  1288. title: {
  1289. fontSize: 14,
  1290. },
  1291. detail: {
  1292. width: 40,
  1293. height: 14,
  1294. fontSize: 14,
  1295. color: "#fff",
  1296. backgroundColor: "auto",
  1297. borderRadius: 3,
  1298. formatter: formatVal,
  1299. },
  1300. }, ],
  1301. };
  1302. if (!this.theme) {
  1303. option.backgroundColor = "";
  1304. }
  1305. // 基于准备好的dom,初始化echarts实例
  1306. let dom = document.getElementById(name);
  1307. dom.removeAttribute("_echarts_instance_") ?
  1308. dom.removeAttribute("_echarts_instance_") :
  1309. "";
  1310. let myChart = this.$echarts.init(dom, this.echartsTheme);
  1311. // let that = this
  1312. // setInterval(function () {
  1313. // that.getIrradiance()
  1314. // }, 2000);
  1315. myChart.setOption(option);
  1316. window.addEventListener("resize", function () {
  1317. myChart.resize();
  1318. });
  1319. },
  1320. //风向玫瑰图
  1321. getwindRosetteChart() {
  1322. let params = {
  1323. stationNumber: this.windTurbines,
  1324. };
  1325. apiGetwindRosetteChart(params).then((datas) => {
  1326. if (datas && datas.data) {
  1327. let radar = [];
  1328. let radaxr = [0, 45, 90, 135, 180, 225, 270, 315, 360];
  1329. let serise = [{
  1330. value: [],
  1331. name: "实际风向",
  1332. },
  1333. {
  1334. value: [],
  1335. name: "预测风向",
  1336. },
  1337. ];
  1338. datas.data.dataFormatList[0].data.forEach((item, index) => {
  1339. if (radaxr.indexOf((index + 1) * 5) !== -1) {
  1340. let obj = {
  1341. name: (index + 1) * 5,
  1342. };
  1343. radar.unshift(obj);
  1344. }
  1345. });
  1346. datas.data.dataFormatList.forEach((itn) => {
  1347. let ser1 = [];
  1348. let ser2 = [];
  1349. if (itn.name === "预测风速") {
  1350. itn.data.forEach((it, index) => {
  1351. if (radaxr.indexOf((index + 1) * 5) !== -1) {
  1352. ser1.unshift(it && it !== 0 ? it.toFixed(1) : 0);
  1353. }
  1354. });
  1355. serise[1].value = ser1;
  1356. } else {
  1357. itn.data.forEach((it, index) => {
  1358. if (radaxr.indexOf((index + 1) * 5) !== -1) {
  1359. ser2.unshift(it && it !== 0 ? it.toFixed(1) : 0);
  1360. }
  1361. });
  1362. serise[0].value = ser2;
  1363. }
  1364. });
  1365. radar.forEach((itb) => {
  1366. if (itb.name === 360) {
  1367. itb.name = "北";
  1368. } else if (itb.name === 45) {
  1369. itb.name = "东北";
  1370. } else if (itb.name === 90) {
  1371. itb.name = "东";
  1372. } else if (itb.name === 135) {
  1373. itb.name = "东南";
  1374. } else if (itb.name === 180) {
  1375. itb.name = "南";
  1376. } else if (itb.name === 225) {
  1377. itb.name = "西南";
  1378. } else if (itb.name === 270) {
  1379. itb.name = "西";
  1380. } else if (itb.name === 315) {
  1381. itb.name = "西北";
  1382. }
  1383. });
  1384. this.getRadar(radar, serise);
  1385. }
  1386. });
  1387. },
  1388. getRadar(radar, serise) {
  1389. let option = {
  1390. backgroundColor: "",
  1391. legend: {
  1392. bottom: "-5",
  1393. data: ["实际", "预测"],
  1394. },
  1395. tooltip: {
  1396. trigger: "item",
  1397. formatter: (item) => {
  1398. let str =
  1399. `<span style="display:inline-block;margin-bottom:5px;">${item.name}(风向: 风速)</span></br>`;
  1400. let strMsg = "";
  1401. radar.forEach((it, index) => {
  1402. strMsg = `<div>
  1403. <span style="display:inline-block;margin-right:4px;margin-top:3px;border-radius:10px;width:10px;height:10px;background-color:${item.color};\"></span>&nbsp;
  1404. <span style="display:inline-block;width: 55%">${it.name}:</span>&nbsp;&nbsp;<span>${item.data.value[index]}</span>
  1405. </div>`;
  1406. str = str + strMsg;
  1407. });
  1408. return str;
  1409. },
  1410. },
  1411. radar: {
  1412. // shape: 'circle',
  1413. indicator: radar,
  1414. },
  1415. series: [{
  1416. type: "radar",
  1417. data: serise,
  1418. }, ],
  1419. };
  1420. // 基于准备好的dom,初始化echarts实例
  1421. let dom = document.getElementById("radarChart");
  1422. dom.removeAttribute("_echarts_instance_") ?
  1423. dom.removeAttribute("_echarts_instance_") :
  1424. "";
  1425. let myChart = this.$echarts.init(dom, this.echartsTheme);
  1426. myChart.setOption(option);
  1427. window.addEventListener("resize", function () {
  1428. myChart.resize();
  1429. });
  1430. },
  1431. },
  1432. };
  1433. </script>
  1434. <style lang="less" scoped>
  1435. @import "../../viewsCss/powerPredictionPageLess.less";
  1436. .themeDark {
  1437. .windStstus {
  1438. background: #040c0b;
  1439. }
  1440. .lineMain {
  1441. background: #040c0b;
  1442. .lineStyle,
  1443. .lineStyle1 {
  1444. background: #161f1e;
  1445. .chart-name {
  1446. display: flex;
  1447. align-items: center;
  1448. position: absolute;
  1449. top: 0;
  1450. height: 39px;
  1451. width: 96%;
  1452. border-bottom: 1px solid rgba(153, 153, 153, 0.5);
  1453. .point {
  1454. width: 6px;
  1455. height: 1px;
  1456. background-color: #ffffff;
  1457. position: absolute;
  1458. &.point-left {
  1459. left: 0;
  1460. }
  1461. &.point-right {
  1462. right: 0;
  1463. }
  1464. &.top {
  1465. top: -1px;
  1466. }
  1467. &.bottom {
  1468. bottom: -1px;
  1469. }
  1470. }
  1471. }
  1472. }
  1473. }
  1474. }
  1475. .themeLight {
  1476. .windStstus {
  1477. // background: linear-gradient(0deg, transparent, #373590);
  1478. }
  1479. .lineMain {
  1480. background: #edeffb;
  1481. .lineStyle,
  1482. .lineStyle1 {
  1483. background: #fff;
  1484. }
  1485. }
  1486. }
  1487. </style>