phdffx.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091
  1. <template>
  2. <div id="phdffx">
  3. <div class="query mg-b-8">
  4. <div class="query-items">
  5. <div class="query-item">
  6. <div class="lable">场站:</div>
  7. <div class="search-input">
  8. <el-select
  9. v-model="wpId"
  10. clearable
  11. placeholder="请选择"
  12. popper-class="select"
  13. @change="
  14. (wpId) => {
  15. getTurbines();
  16. }
  17. "
  18. >
  19. <el-option
  20. v-for="item in wpList"
  21. :key="item.id"
  22. :value="item.id"
  23. :label="item.name"
  24. ></el-option>
  25. </el-select>
  26. </div>
  27. </div>
  28. <div class="query-item">
  29. <div class="lable">机组:</div>
  30. <div class="search-input">
  31. <el-select
  32. v-model="wtId"
  33. placeholder="请选择"
  34. popper-class="select"
  35. >
  36. <el-option
  37. v-for="item in wtList"
  38. :key="item.id"
  39. :label="item.nemCode"
  40. :value="item.id"
  41. ></el-option>
  42. </el-select>
  43. </div>
  44. </div>
  45. <div class="query-item">
  46. <div class="lable">开始日期:</div>
  47. <div class="search-input">
  48. <el-date-picker
  49. v-model="startDate"
  50. type="date"
  51. placeholder="开始日期"
  52. popper-class="date-select"
  53. value-format="YYYY-MM-DD"
  54. ></el-date-picker>
  55. </div>
  56. </div>
  57. <div class="query-item">
  58. <div class="lable">结束日期:</div>
  59. <div class="search-input">
  60. <el-date-picker
  61. v-model="endDate"
  62. type="date"
  63. placeholder="开始日期"
  64. popper-class="date-select"
  65. value-format="YYYY-MM-DD"
  66. ></el-date-picker>
  67. </div>
  68. </div>
  69. <div class="query-actions">
  70. <button class="btn green" @click="getCharts()">查询</button>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="mg-b-16">
  75. <panel :title="'偏航对风风速分析'" :showLine="false">
  76. <!-- <LineChart :list="statusData" :units="['']" :height="'220px'" /> -->
  77. <div class="chart" id="linechart1"></div>
  78. </panel>
  79. </div>
  80. <div class="mg-b-16">
  81. <panel :title="'偏航对风功率分析'" :showLine="false">
  82. <div class="chart" id="linechart2"></div>
  83. </panel>
  84. </div>
  85. <div class="mg-b-16">
  86. <panel :title="'偏航对风分析'" :showLine="false">
  87. <div class="chart" id="linechart3"></div>
  88. </panel>
  89. </div>
  90. <el-dialog
  91. :title="'偏航对风分析明细'"
  92. v-model="dialogShow"
  93. width="80%"
  94. top="10vh"
  95. custom-class="modal dBody"
  96. :close-on-click-modal="true"
  97. >
  98. <div class="chart" id="linechartDialog"></div>
  99. </el-dialog>
  100. </div>
  101. </template>
  102. <script>
  103. import LineChart from "../../components/chart/line/normal-line-chart.vue";
  104. import Panel from "../../components/coms/panel/panel.vue";
  105. import util from "@/helper/util.js";
  106. import partten from "@/helper/partten.js";
  107. import * as echarts from "echarts";
  108. import api1 from "@api/economic/index.js";
  109. import api from "@api/wisdomOverhaul/energy/index.js";
  110. export default {
  111. name: "phdffx",
  112. components: { LineChart, Panel },
  113. data() {
  114. return {
  115. wpList: [],
  116. wpId: "GJY_FDC",
  117. wtList: [],
  118. wtId: "GJY01_001",
  119. startDate: "",
  120. endDate: "",
  121. line1XData: [],
  122. line2XData: [],
  123. dialogShow: false,
  124. };
  125. },
  126. created() {
  127. this.getStations();
  128. this.getTurbines();
  129. let end = new Date();
  130. let start = new Date();
  131. start.setDate(1);
  132. this.endDate = end.formatDate("yyyy-MM-dd");
  133. this.startDate = start.formatDate("yyyy-MM-dd");
  134. this.getCharts();
  135. },
  136. updated() {
  137. this.getCharts();
  138. },
  139. methods: {
  140. // 场站
  141. getStations() {
  142. api1
  143. .getWpList({
  144. type: "-1",
  145. })
  146. .then((res) => {
  147. if (res.data.code === 200) {
  148. this.wpList = res.data.data;
  149. this.wpId = res.data.data[0].id;
  150. this.getTurbines();
  151. }
  152. });
  153. },
  154. getTurbines() {
  155. api1
  156. .getWtList({
  157. wpId: this.wpId,
  158. })
  159. .then((res) => {
  160. if (res.code === 200) {
  161. this.wtList = res.data;
  162. this.wtId = res.data[0].id;
  163. }
  164. });
  165. },
  166. getCharts() {
  167. this.$nextTick(() => {
  168. this.getChart1();
  169. // this.getChart2();
  170. // this.getChart3();
  171. });
  172. },
  173. getChart1() {
  174. api
  175. .yawGetPassRate({
  176. wtId: this.wtId,
  177. beginDate: this.startDate,
  178. endDate: this.endDate,
  179. type: 2,
  180. })
  181. .then((res) => {
  182. if (res && res.data && res.data.data) {
  183. const xData = [];
  184. const lData = [];
  185. res.data.data.forEach((e) => {
  186. xData.push(e.speed);
  187. lData.push(e.passrate);
  188. });
  189. this.line1XData = xData;
  190. let option = {
  191. color: ["#05bb4c", "#4b55ae", "#fa8c16", "#f8de5b"],
  192. tooltip: {
  193. trigger: "axis",
  194. backgroundColor: "rgba(0,0,0,0.4)",
  195. borderColor: partten.getColor("gray"),
  196. textStyle: {
  197. color: "#fff",
  198. fontSize: util.vh(16),
  199. },
  200. },
  201. legend: {
  202. show: false,
  203. data: ["合格率(%)"],
  204. right: 56,
  205. icon: "circle",
  206. itemWidth: 6,
  207. inactiveColor: "#606769",
  208. textStyle: {
  209. color: partten.getColor("grayl"),
  210. fontSize: 12,
  211. },
  212. },
  213. grid: {
  214. top: util.vh(40),
  215. left: util.vh(60),
  216. right: util.vh(100),
  217. bottom: util.vh(24),
  218. },
  219. xAxis: [
  220. {
  221. name: "风速(m/s)",
  222. type: "category",
  223. boundaryGap: false,
  224. axisLabel: {
  225. formatter: "{value}",
  226. fontSize: util.vh(14),
  227. textStyle: {
  228. color: partten.getColor("gray"),
  229. },
  230. },
  231. data: xData,
  232. },
  233. ],
  234. yAxis: [
  235. {
  236. type: "value",
  237. name: "合格率(%)",
  238. axisLabel: {
  239. formatter: "{value}",
  240. fontSize: util.vh(14),
  241. },
  242. splitLine: {
  243. lineStyle: {
  244. color: partten.getColor("gray") + 55,
  245. type: "dashed",
  246. },
  247. },
  248. },
  249. ],
  250. series: [
  251. {
  252. name: "合格率",
  253. type: "line",
  254. smooth: true,
  255. zlevel: 0,
  256. lineStyle: {
  257. normal: {
  258. color: "#05bb4c",
  259. width: 1,
  260. },
  261. },
  262. yAxisIndex: 0,
  263. data: lData,
  264. },
  265. ],
  266. };
  267. const chart = echarts.init(document.getElementById("linechart1"));
  268. chart.clear();
  269. chart.setOption(option);
  270. this.resize = function () {
  271. chart.resize();
  272. };
  273. chart.getZr().off("click");
  274. chart.getZr().on("click", (params) => {
  275. const pointInPixel = [params.offsetX, params.offsetY];
  276. if (chart.containPixel("grid", pointInPixel)) {
  277. let xIndex = chart.convertFromPixel({ seriesIndex: 0 }, [
  278. params.offsetX,
  279. params.offsetY,
  280. ])[0];
  281. // 图标点击事件
  282. this.showDetail("2", this.line1XData[xIndex]);
  283. }
  284. });
  285. window.addEventListener("resize", this.resize);
  286. }
  287. });
  288. // const res = await this.API.requestData({
  289. // method: "POST",
  290. // subUrl: "yaw/getPassRate",
  291. // data: {
  292. // wtId: this.wtId,
  293. // beginDate: this.startDate,
  294. // endDate: this.endDate,
  295. // type: 2,
  296. // },
  297. // });
  298. // if (res && res.data && res.data.data) {
  299. // const xData = [];
  300. // const lData = [];
  301. // res.data.data.forEach((e) => {
  302. // xData.push(e.speed);
  303. // lData.push(e.passrate);
  304. // });
  305. // this.line1XData = xData;
  306. // let option = {
  307. // color: ["#05bb4c", "#4b55ae", "#fa8c16", "#f8de5b"],
  308. // tooltip: {
  309. // trigger: "axis",
  310. // backgroundColor: "rgba(0,0,0,0.4)",
  311. // borderColor: partten.getColor("gray"),
  312. // textStyle: {
  313. // color: "#fff",
  314. // fontSize: util.vh(16),
  315. // },
  316. // },
  317. // legend: {
  318. // show: false,
  319. // data: ["合格率(%)"],
  320. // right: 56,
  321. // icon: "circle",
  322. // itemWidth: 6,
  323. // inactiveColor: "#606769",
  324. // textStyle: {
  325. // color: partten.getColor("grayl"),
  326. // fontSize: 12,
  327. // },
  328. // },
  329. // grid: {
  330. // top: util.vh(40),
  331. // left: util.vh(60),
  332. // right: util.vh(100),
  333. // bottom: util.vh(24),
  334. // },
  335. // xAxis: [
  336. // {
  337. // name: "风速(m/s)",
  338. // type: "category",
  339. // boundaryGap: false,
  340. // axisLabel: {
  341. // formatter: "{value}",
  342. // fontSize: util.vh(14),
  343. // textStyle: {
  344. // color: partten.getColor("gray"),
  345. // },
  346. // },
  347. // data: xData,
  348. // },
  349. // ],
  350. // yAxis: [
  351. // {
  352. // type: "value",
  353. // name: "合格率(%)",
  354. // axisLabel: {
  355. // formatter: "{value}",
  356. // fontSize: util.vh(14),
  357. // },
  358. // splitLine: {
  359. // lineStyle: {
  360. // color: partten.getColor("gray") + 55,
  361. // type: "dashed",
  362. // },
  363. // },
  364. // },
  365. // ],
  366. // series: [
  367. // {
  368. // name: "合格率",
  369. // type: "line",
  370. // smooth: true,
  371. // zlevel: 0,
  372. // lineStyle: {
  373. // normal: {
  374. // color: "#05bb4c",
  375. // width: 1,
  376. // },
  377. // },
  378. // yAxisIndex: 0,
  379. // data: lData,
  380. // },
  381. // ],
  382. // };
  383. // const chart = echarts.init(document.getElementById("linechart1"));
  384. // chart.clear();
  385. // chart.setOption(option);
  386. // this.resize = function () {
  387. // chart.resize();
  388. // };
  389. // chart.getZr().off("click");
  390. // chart.getZr().on("click", (params) => {
  391. // const pointInPixel = [params.offsetX, params.offsetY];
  392. // if (chart.containPixel("grid", pointInPixel)) {
  393. // let xIndex = chart.convertFromPixel({ seriesIndex: 0 }, [
  394. // params.offsetX,
  395. // params.offsetY,
  396. // ])[0];
  397. // // 图标点击事件
  398. // this.showDetail("2", this.line1XData[xIndex]);
  399. // }
  400. // });
  401. // window.addEventListener("resize", this.resize);
  402. // }
  403. },
  404. getChart2() {
  405. api
  406. .yawGetPassRate({
  407. wtId: this.wtId,
  408. beginDate: this.startDate,
  409. endDate: this.endDate,
  410. type: 1,
  411. })
  412. .then((res) => {
  413. if (res && res.data && res.data.data) {
  414. const xData = [];
  415. const lData = [];
  416. res.data.data.forEach((e) => {
  417. xData.push(e.power);
  418. lData.push(e.passrate);
  419. });
  420. this.line2XData = xData;
  421. let option = {
  422. color: ["#05bb4c", "#4b55ae", "#fa8c16", "#f8de5b"],
  423. tooltip: {
  424. trigger: "axis",
  425. backgroundColor: "rgba(0,0,0,0.4)",
  426. borderColor: partten.getColor("gray"),
  427. textStyle: {
  428. color: "#fff",
  429. fontSize: util.vh(16),
  430. },
  431. },
  432. legend: {
  433. show: false,
  434. data: ["合格率(%)"],
  435. right: 56,
  436. icon: "circle",
  437. itemWidth: 6,
  438. inactiveColor: "#606769",
  439. textStyle: {
  440. color: partten.getColor("grayl"),
  441. fontSize: 12,
  442. },
  443. },
  444. grid: {
  445. top: util.vh(40),
  446. left: util.vh(60),
  447. right: util.vh(100),
  448. bottom: util.vh(24),
  449. },
  450. xAxis: [
  451. {
  452. name: "功率(kW)",
  453. type: "category",
  454. boundaryGap: false,
  455. axisLabel: {
  456. formatter: "{value}",
  457. fontSize: util.vh(14),
  458. textStyle: {
  459. color: partten.getColor("gray"),
  460. },
  461. },
  462. data: xData,
  463. },
  464. ],
  465. yAxis: [
  466. {
  467. type: "value",
  468. name: "合格率(%)",
  469. axisLabel: {
  470. formatter: "{value}",
  471. fontSize: util.vh(14),
  472. },
  473. splitLine: {
  474. lineStyle: {
  475. color: partten.getColor("gray") + 55,
  476. type: "dashed",
  477. },
  478. },
  479. },
  480. ],
  481. series: [
  482. {
  483. name: "合格率",
  484. type: "line",
  485. smooth: true,
  486. zlevel: 0,
  487. lineStyle: {
  488. normal: {
  489. color: "#05bb4c",
  490. width: 1,
  491. },
  492. },
  493. yAxisIndex: 0,
  494. data: lData,
  495. },
  496. ],
  497. };
  498. const chart = echarts.init(document.getElementById("linechart2"));
  499. chart.clear();
  500. chart.setOption(option);
  501. this.resize = function () {
  502. chart.resize();
  503. };
  504. chart.getZr().off("click");
  505. chart.getZr().on("click", (params) => {
  506. const pointInPixel = [params.offsetX, params.offsetY];
  507. if (chart.containPixel("grid", pointInPixel)) {
  508. let xIndex = chart.convertFromPixel({ seriesIndex: 0 }, [
  509. params.offsetX,
  510. params.offsetY,
  511. ])[0];
  512. this.showDetail("1", this.line2XData[xIndex] / 100);
  513. }
  514. });
  515. window.addEventListener("resize", this.resize);
  516. }
  517. });
  518. // const res = await this.API.requestData({
  519. // method: "POST",
  520. // subUrl: "yaw/getPassRate",
  521. // data: {
  522. // wtId: this.wtId,
  523. // beginDate: this.startDate,
  524. // endDate: this.endDate,
  525. // type: 1,
  526. // },
  527. // });
  528. // if (res && res.data && res.data.data) {
  529. // const xData = [];
  530. // const lData = [];
  531. // res.data.data.forEach((e) => {
  532. // xData.push(e.power);
  533. // lData.push(e.passrate);
  534. // });
  535. // this.line2XData = xData;
  536. // let option = {
  537. // color: ["#05bb4c", "#4b55ae", "#fa8c16", "#f8de5b"],
  538. // tooltip: {
  539. // trigger: "axis",
  540. // backgroundColor: "rgba(0,0,0,0.4)",
  541. // borderColor: partten.getColor("gray"),
  542. // textStyle: {
  543. // color: "#fff",
  544. // fontSize: util.vh(16),
  545. // },
  546. // },
  547. // legend: {
  548. // show: false,
  549. // data: ["合格率(%)"],
  550. // right: 56,
  551. // icon: "circle",
  552. // itemWidth: 6,
  553. // inactiveColor: "#606769",
  554. // textStyle: {
  555. // color: partten.getColor("grayl"),
  556. // fontSize: 12,
  557. // },
  558. // },
  559. // grid: {
  560. // top: util.vh(40),
  561. // left: util.vh(60),
  562. // right: util.vh(100),
  563. // bottom: util.vh(24),
  564. // },
  565. // xAxis: [
  566. // {
  567. // name: "功率(kW)",
  568. // type: "category",
  569. // boundaryGap: false,
  570. // axisLabel: {
  571. // formatter: "{value}",
  572. // fontSize: util.vh(14),
  573. // textStyle: {
  574. // color: partten.getColor("gray"),
  575. // },
  576. // },
  577. // data: xData,
  578. // },
  579. // ],
  580. // yAxis: [
  581. // {
  582. // type: "value",
  583. // name: "合格率(%)",
  584. // axisLabel: {
  585. // formatter: "{value}",
  586. // fontSize: util.vh(14),
  587. // },
  588. // splitLine: {
  589. // lineStyle: {
  590. // color: partten.getColor("gray") + 55,
  591. // type: "dashed",
  592. // },
  593. // },
  594. // },
  595. // ],
  596. // series: [
  597. // {
  598. // name: "合格率",
  599. // type: "line",
  600. // smooth: true,
  601. // zlevel: 0,
  602. // lineStyle: {
  603. // normal: {
  604. // color: "#05bb4c",
  605. // width: 1,
  606. // },
  607. // },
  608. // yAxisIndex: 0,
  609. // data: lData,
  610. // },
  611. // ],
  612. // };
  613. // const chart = echarts.init(document.getElementById("linechart2"));
  614. // chart.clear();
  615. // chart.setOption(option);
  616. // this.resize = function () {
  617. // chart.resize();
  618. // };
  619. // chart.getZr().off("click");
  620. // chart.getZr().on("click", (params) => {
  621. // const pointInPixel = [params.offsetX, params.offsetY];
  622. // if (chart.containPixel("grid", pointInPixel)) {
  623. // let xIndex = chart.convertFromPixel({ seriesIndex: 0 }, [
  624. // params.offsetX,
  625. // params.offsetY,
  626. // ])[0];
  627. // this.showDetail("1", this.line2XData[xIndex] / 100);
  628. // }
  629. // });
  630. // window.addEventListener("resize", this.resize);
  631. // }
  632. },
  633. getChart3() {
  634. api
  635. .yawGetTotalRanges({
  636. wtId: this.wtId,
  637. beginDate: this.startDate,
  638. endDate: this.endDate,
  639. type: 1,
  640. })
  641. .then((res) => {
  642. if (res && res.data && res.data.data) {
  643. const xData = [];
  644. const lData = [];
  645. const dataMap = res.data.data;
  646. for (let key in dataMap) {
  647. let tmpKey = key.replace(/r/, "");
  648. tmpKey = tmpKey.replace(/_/, "-");
  649. if (tmpKey < 100) {
  650. xData.push(tmpKey);
  651. lData.push(dataMap[key]);
  652. }
  653. }
  654. this.line3Data = lData;
  655. let option = {
  656. color: ["#05bb4c", "#4b55ae", "#fa8c16", "#f8de5b"],
  657. tooltip: {
  658. trigger: "axis",
  659. backgroundColor: "rgba(0,0,0,0.4)",
  660. borderColor: partten.getColor("gray"),
  661. textStyle: {
  662. color: "#fff",
  663. fontSize: util.vh(16),
  664. },
  665. },
  666. legend: {
  667. show: false,
  668. data: ["偏航次数"],
  669. right: 56,
  670. icon: "circle",
  671. itemWidth: 6,
  672. inactiveColor: "#606769",
  673. textStyle: {
  674. color: partten.getColor("grayl"),
  675. fontSize: 12,
  676. },
  677. },
  678. grid: {
  679. top: util.vh(40),
  680. left: util.vh(60),
  681. right: util.vh(130),
  682. bottom: util.vh(24),
  683. },
  684. xAxis: [
  685. {
  686. name: "对风偏差(度)",
  687. type: "category",
  688. boundaryGap: false,
  689. axisLabel: {
  690. formatter: "{value}",
  691. fontSize: util.vh(14),
  692. textStyle: {
  693. color: partten.getColor("gray"),
  694. },
  695. },
  696. data: xData,
  697. },
  698. ],
  699. yAxis: [
  700. {
  701. type: "value",
  702. name: "数量",
  703. axisLabel: {
  704. formatter: "{value}",
  705. fontSize: util.vh(14),
  706. },
  707. splitLine: {
  708. lineStyle: {
  709. color: partten.getColor("gray") + 55,
  710. type: "dashed",
  711. },
  712. },
  713. },
  714. ],
  715. series: [
  716. {
  717. name: "数量",
  718. type: "line",
  719. smooth: true,
  720. zlevel: 0,
  721. lineStyle: {
  722. normal: {
  723. color: "#05bb4c",
  724. width: 1,
  725. },
  726. },
  727. yAxisIndex: 0,
  728. data: lData,
  729. },
  730. ],
  731. };
  732. const chart = echarts.init(document.getElementById("linechart3"));
  733. chart.clear();
  734. chart.setOption(option);
  735. this.resize = function () {
  736. chart.resize();
  737. };
  738. window.addEventListener("resize", this.resize);
  739. }
  740. });
  741. // const res = await this.API.requestData({
  742. // method: "POST",
  743. // subUrl: "yaw/getTotalRanges",
  744. // data: {
  745. // wtId: this.wtId,
  746. // beginDate: this.startDate,
  747. // endDate: this.endDate,
  748. // type: 1,
  749. // },
  750. // });
  751. // if (res && res.data && res.data.data) {
  752. // const xData = [];
  753. // const lData = [];
  754. // const dataMap = res.data.data;
  755. // for (let key in dataMap) {
  756. // let tmpKey = key.replace(/r/, "");
  757. // tmpKey = tmpKey.replace(/_/, "-");
  758. // if (tmpKey < 100) {
  759. // xData.push(tmpKey);
  760. // lData.push(dataMap[key]);
  761. // }
  762. // }
  763. // this.line3Data = lData;
  764. // let option = {
  765. // color: ["#05bb4c", "#4b55ae", "#fa8c16", "#f8de5b"],
  766. // tooltip: {
  767. // trigger: "axis",
  768. // backgroundColor: "rgba(0,0,0,0.4)",
  769. // borderColor: partten.getColor("gray"),
  770. // textStyle: {
  771. // color: "#fff",
  772. // fontSize: util.vh(16),
  773. // },
  774. // },
  775. // legend: {
  776. // show: false,
  777. // data: ["偏航次数"],
  778. // right: 56,
  779. // icon: "circle",
  780. // itemWidth: 6,
  781. // inactiveColor: "#606769",
  782. // textStyle: {
  783. // color: partten.getColor("grayl"),
  784. // fontSize: 12,
  785. // },
  786. // },
  787. // grid: {
  788. // top: util.vh(40),
  789. // left: util.vh(60),
  790. // right: util.vh(130),
  791. // bottom: util.vh(24),
  792. // },
  793. // xAxis: [
  794. // {
  795. // name: "对风偏差(度)",
  796. // type: "category",
  797. // boundaryGap: false,
  798. // axisLabel: {
  799. // formatter: "{value}",
  800. // fontSize: util.vh(14),
  801. // textStyle: {
  802. // color: partten.getColor("gray"),
  803. // },
  804. // },
  805. // data: xData,
  806. // },
  807. // ],
  808. // yAxis: [
  809. // {
  810. // type: "value",
  811. // name: "数量",
  812. // axisLabel: {
  813. // formatter: "{value}",
  814. // fontSize: util.vh(14),
  815. // },
  816. // splitLine: {
  817. // lineStyle: {
  818. // color: partten.getColor("gray") + 55,
  819. // type: "dashed",
  820. // },
  821. // },
  822. // },
  823. // ],
  824. // series: [
  825. // {
  826. // name: "数量",
  827. // type: "line",
  828. // smooth: true,
  829. // zlevel: 0,
  830. // lineStyle: {
  831. // normal: {
  832. // color: "#05bb4c",
  833. // width: 1,
  834. // },
  835. // },
  836. // yAxisIndex: 0,
  837. // data: lData,
  838. // },
  839. // ],
  840. // };
  841. // const chart = echarts.init(document.getElementById("linechart3"));
  842. // chart.clear();
  843. // chart.setOption(option);
  844. // this.resize = function () {
  845. // chart.resize();
  846. // };
  847. // window.addEventListener("resize", this.resize);
  848. // }
  849. },
  850. showDetail(type, value) {
  851. this.dialogShow = true;
  852. api
  853. .yawGetRanges({
  854. wtId: this.wtId,
  855. beginDate: this.startDate,
  856. endDate: this.endDate,
  857. type: type,
  858. value: value,
  859. })
  860. .then((res) => {
  861. if (res && res.data && res.data.data) {
  862. const xData = [];
  863. const lData = [];
  864. const dataMap = res.data.data;
  865. for (let key in dataMap) {
  866. let tmpKey = key.replace(/r/, "");
  867. tmpKey = tmpKey.replace(/_/, "-");
  868. if (tmpKey < 100) {
  869. xData.push(tmpKey);
  870. lData.push(dataMap[key]);
  871. }
  872. }
  873. let option = {
  874. color: ["#05bb4c", "#4b55ae", "#fa8c16", "#f8de5b"],
  875. tooltip: {
  876. trigger: "axis",
  877. backgroundColor: "rgba(0,0,0,0.4)",
  878. borderColor: partten.getColor("gray"),
  879. textStyle: {
  880. color: "#fff",
  881. fontSize: util.vh(16),
  882. },
  883. },
  884. legend: {
  885. show: false,
  886. data: ["偏航次数"],
  887. right: 56,
  888. icon: "circle",
  889. itemWidth: 6,
  890. inactiveColor: "#606769",
  891. textStyle: {
  892. color: partten.getColor("grayl"),
  893. fontSize: 12,
  894. },
  895. },
  896. grid: {
  897. top: util.vh(40),
  898. left: util.vh(60),
  899. right: util.vh(130),
  900. bottom: util.vh(24),
  901. },
  902. xAxis: [
  903. {
  904. name: "对风偏差(度)",
  905. type: "category",
  906. boundaryGap: false,
  907. axisLabel: {
  908. formatter: "{value}",
  909. fontSize: util.vh(14),
  910. textStyle: {
  911. color: partten.getColor("gray"),
  912. },
  913. },
  914. data: xData,
  915. },
  916. ],
  917. yAxis: [
  918. {
  919. type: "value",
  920. name: "数量",
  921. axisLabel: {
  922. formatter: "{value}",
  923. fontSize: util.vh(14),
  924. },
  925. splitLine: {
  926. lineStyle: {
  927. color: partten.getColor("gray") + 55,
  928. type: "dashed",
  929. },
  930. },
  931. },
  932. ],
  933. series: [
  934. {
  935. name: "数量",
  936. type: "line",
  937. smooth: true,
  938. zlevel: 0,
  939. lineStyle: {
  940. normal: {
  941. color: "#05bb4c",
  942. width: 1,
  943. },
  944. },
  945. yAxisIndex: 0,
  946. data: lData,
  947. },
  948. ],
  949. };
  950. const chart = echarts.init(
  951. document.getElementById("linechartDialog")
  952. );
  953. chart.clear();
  954. chart.setOption(option);
  955. this.resize = function () {
  956. chart.resize();
  957. };
  958. }
  959. });
  960. // const res = await this.API.requestData({
  961. // method: "POST",
  962. // subUrl: "yaw/getRanges",
  963. // data: {
  964. // wtId: this.wtId,
  965. // beginDate: this.startDate,
  966. // endDate: this.endDate,
  967. // type: type,
  968. // value: value,
  969. // },
  970. // });
  971. // if (res && res.data && res.data.data) {
  972. // const xData = [];
  973. // const lData = [];
  974. // const dataMap = res.data.data;
  975. // for (let key in dataMap) {
  976. // let tmpKey = key.replace(/r/, "");
  977. // tmpKey = tmpKey.replace(/_/, "-");
  978. // if (tmpKey < 100) {
  979. // xData.push(tmpKey);
  980. // lData.push(dataMap[key]);
  981. // }
  982. // }
  983. // let option = {
  984. // color: ["#05bb4c", "#4b55ae", "#fa8c16", "#f8de5b"],
  985. // tooltip: {
  986. // trigger: "axis",
  987. // backgroundColor: "rgba(0,0,0,0.4)",
  988. // borderColor: partten.getColor("gray"),
  989. // textStyle: {
  990. // color: "#fff",
  991. // fontSize: util.vh(16),
  992. // },
  993. // },
  994. // legend: {
  995. // show: false,
  996. // data: ["偏航次数"],
  997. // right: 56,
  998. // icon: "circle",
  999. // itemWidth: 6,
  1000. // inactiveColor: "#606769",
  1001. // textStyle: {
  1002. // color: partten.getColor("grayl"),
  1003. // fontSize: 12,
  1004. // },
  1005. // },
  1006. // grid: {
  1007. // top: util.vh(40),
  1008. // left: util.vh(60),
  1009. // right: util.vh(130),
  1010. // bottom: util.vh(24),
  1011. // },
  1012. // xAxis: [
  1013. // {
  1014. // name: "对风偏差(度)",
  1015. // type: "category",
  1016. // boundaryGap: false,
  1017. // axisLabel: {
  1018. // formatter: "{value}",
  1019. // fontSize: util.vh(14),
  1020. // textStyle: {
  1021. // color: partten.getColor("gray"),
  1022. // },
  1023. // },
  1024. // data: xData,
  1025. // },
  1026. // ],
  1027. // yAxis: [
  1028. // {
  1029. // type: "value",
  1030. // name: "数量",
  1031. // axisLabel: {
  1032. // formatter: "{value}",
  1033. // fontSize: util.vh(14),
  1034. // },
  1035. // splitLine: {
  1036. // lineStyle: {
  1037. // color: partten.getColor("gray") + 55,
  1038. // type: "dashed",
  1039. // },
  1040. // },
  1041. // },
  1042. // ],
  1043. // series: [
  1044. // {
  1045. // name: "数量",
  1046. // type: "line",
  1047. // smooth: true,
  1048. // zlevel: 0,
  1049. // lineStyle: {
  1050. // normal: {
  1051. // color: "#05bb4c",
  1052. // width: 1,
  1053. // },
  1054. // },
  1055. // yAxisIndex: 0,
  1056. // data: lData,
  1057. // },
  1058. // ],
  1059. // };
  1060. // const chart = echarts.init(document.getElementById("linechartDialog"));
  1061. // chart.clear();
  1062. // chart.setOption(option);
  1063. // this.resize = function () {
  1064. // chart.resize();
  1065. // };
  1066. // }
  1067. },
  1068. },
  1069. };
  1070. </script>
  1071. <style lang="less">
  1072. #phdffx {
  1073. .chart {
  1074. width: 100%;
  1075. height: 220px;
  1076. display: block;
  1077. margin: auto;
  1078. }
  1079. }
  1080. </style>