PerformanceList.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026
  1. <template>
  2. <el-container>
  3. <el-header>
  4. <el-row>
  5. <el-col :span="24">
  6. <el-card style="height: 30px">
  7. <div class="grid-content bg-purple-dark">
  8. <span>电量绩效榜</span>
  9. </div>
  10. </el-card>
  11. </el-col>
  12. </el-row>
  13. </el-header>
  14. <el-main>
  15. <el-card>
  16. <el-form :inline="true" :model="formInline" class="demo-form-inline">
  17. <el-row :gutter="1">
  18. <el-form-item label="风场">
  19. <el-input
  20. v-model="formInline.wpIds"
  21. id="windfarm"
  22. placeholder="风场"
  23. ></el-input>
  24. </el-form-item>
  25. <el-form-item label="项目">
  26. <el-input
  27. v-model="formInline.project"
  28. id="project"
  29. placeholder="项目"
  30. @focus="checkwindfarm"
  31. ></el-input>
  32. </el-form-item>
  33. <el-form-item label="线路">
  34. <el-input
  35. v-model="formInline.line"
  36. id="line"
  37. placeholder="线路"
  38. @focus="checkproject"
  39. ></el-input>
  40. </el-form-item>
  41. <el-form-item label="开始时间">
  42. <el-date-picker
  43. v-model="beginDate"
  44. type="date"
  45. placeholder="选择日期"
  46. >
  47. </el-date-picker>
  48. </el-form-item>
  49. <el-form-item label="结束时间">
  50. <el-date-picker
  51. v-model="endDate"
  52. type="date"
  53. placeholder="选择日期"
  54. >
  55. </el-date-picker>
  56. </el-form-item>
  57. <el-form-item>
  58. <el-button type="primary" @click="queryPowerAll" :plain="true"
  59. >查询</el-button
  60. >
  61. </el-form-item>
  62. <el-form-item>
  63. <el-button type="primary" @click="queryApDataMx"
  64. >明细信息</el-button
  65. >
  66. </el-form-item>
  67. <el-form-item>
  68. <el-button type="primary" @click="toExcel">导出</el-button>
  69. </el-form-item>
  70. </el-row>
  71. </el-form>
  72. <el-tabs
  73. v-model="activeName"
  74. type="card"
  75. @tab-click="handleClick"
  76. style="height: 100%; width: 100%"
  77. >
  78. <el-tab-pane label="风场" name="first" id="fc">
  79. <el-row
  80. style="
  81. width: 100%;
  82. height: 100%;
  83. display: flex;
  84. justify-content: space-between;
  85. "
  86. >
  87. <el-card
  88. shadow="always"
  89. ref="fc_zzt_card"
  90. style="
  91. height: 440px;
  92. width: 45%;
  93. display: table-cell;
  94. vertical-align: middle;
  95. "
  96. >
  97. <div
  98. id="histogram_fc"
  99. ref="fc_zzt"
  100. style="width: 800px; height: 400px; margin: auto"
  101. ></div>
  102. </el-card>
  103. <el-card
  104. shadow="always"
  105. style="width: 45%"
  106. height="400px"
  107. id="moban"
  108. >
  109. <el-table
  110. id="fc_table"
  111. :data="fc_date"
  112. style="width: 100%"
  113. max-height="400px"
  114. >
  115. <el-table-column label="项目列表">
  116. <el-table-column fixed type="index" width="45">
  117. </el-table-column>
  118. <el-table-column prop="wtName" label="名称" width="150">
  119. </el-table-column>
  120. <el-table-column
  121. prop="total"
  122. label="理论发电量"
  123. width="120"
  124. >
  125. </el-table-column>
  126. <el-table-column
  127. prop="daydl2"
  128. label="SCADA发电量"
  129. width="120"
  130. >
  131. </el-table-column>
  132. <el-table-column prop="dayspeed" label="风速" width="120">
  133. </el-table-column>
  134. <el-table-column
  135. prop="daynhgzssdl"
  136. label="非计划检修"
  137. width="300"
  138. >
  139. </el-table-column>
  140. <el-table-column
  141. prop="daynhwhssdl"
  142. label="计划检修"
  143. width="120"
  144. >
  145. </el-table-column>
  146. <el-table-column prop="daynhcfdl" label="受累" width="120">
  147. </el-table-column>
  148. <el-table-column
  149. prop="daynhxdssdl"
  150. label="限电"
  151. width="120"
  152. >
  153. </el-table-column>
  154. <el-table-column
  155. prop="daynhxdssdl"
  156. label="性能"
  157. width="120"
  158. >
  159. </el-table-column>
  160. <el-table-column prop="lyl" label="风能利用率%" width="120">
  161. </el-table-column>
  162. </el-table-column>
  163. </el-table>
  164. </el-card>
  165. </el-row>
  166. </el-tab-pane>
  167. <el-tab-pane label="项目" name="second" id="xm">
  168. <el-row
  169. style="
  170. width: 100%;
  171. height: 100%;
  172. display: flex;
  173. justify-content: space-between;
  174. "
  175. >
  176. <el-card
  177. shadow="always"
  178. style="
  179. height: 440px;
  180. width: 45%;
  181. display: table-cell;
  182. vertical-align: middle;
  183. "
  184. >
  185. <div
  186. id="histogram_xm"
  187. style="width: 800px; height: 400px; margin: auto"
  188. ></div>
  189. </el-card>
  190. <el-card
  191. shadow="always"
  192. style="width: 45%"
  193. height="400px"
  194. id="moban"
  195. >
  196. <el-table
  197. id="pj_table"
  198. :data="pj_date"
  199. style="width: 100%"
  200. max-height="400px"
  201. >
  202. <el-table-column label="项目列表">
  203. <el-table-column fixed type="index" width="45">
  204. </el-table-column>
  205. <el-table-column prop="wtName" label="名称" width="150">
  206. </el-table-column>
  207. <el-table-column
  208. prop="total"
  209. label="理论发电量"
  210. width="120"
  211. >
  212. </el-table-column>
  213. <el-table-column
  214. prop="daydl2"
  215. label="SCADA发电量"
  216. width="120"
  217. >
  218. </el-table-column>
  219. <el-table-column prop="dayspeed" label="风速" width="120">
  220. </el-table-column>
  221. <el-table-column
  222. prop="daynhgzssdl"
  223. label="非计划检修"
  224. width="300"
  225. >
  226. </el-table-column>
  227. <el-table-column
  228. prop="daynhwhssdl"
  229. label="计划检修"
  230. width="120"
  231. >
  232. </el-table-column>
  233. <el-table-column prop="daynhcfdl" label="受累" width="120">
  234. </el-table-column>
  235. <el-table-column
  236. prop="daynhxdssdl"
  237. label="限电"
  238. width="120"
  239. >
  240. </el-table-column>
  241. <el-table-column
  242. prop="daynhxdssdl"
  243. label="性能"
  244. width="120"
  245. >
  246. </el-table-column>
  247. <el-table-column prop="lyl" label="风能利用率%" width="120">
  248. </el-table-column>
  249. </el-table-column>
  250. </el-table>
  251. </el-card>
  252. </el-row>
  253. </el-tab-pane>
  254. <el-tab-pane label="集电线路" name="jdxl" id="jdxl">
  255. <el-row
  256. style="
  257. width: 100%;
  258. height: 100%;
  259. display: flex;
  260. justify-content: space-between;
  261. "
  262. >
  263. <el-card
  264. shadow="always"
  265. style="
  266. width: 45%;
  267. display: table-cell;
  268. vertical-align: middle;
  269. "
  270. >
  271. <div
  272. id="histogram_jdxl"
  273. style="width: 800px; margin: auto"
  274. :style="{height : judge === true ? '1200px' : '600px'}"
  275. ></div>
  276. </el-card>
  277. <el-card
  278. shadow="always"
  279. style="width: 45%"
  280. height="400px"
  281. id="moban"
  282. >
  283. <el-table
  284. id="xl_table"
  285. :data="xl_date"
  286. style="width: 100%"
  287. max-height="600px"
  288. >
  289. <el-table-column label="项目列表">
  290. <el-table-column fixed type="index" width="45">
  291. </el-table-column>
  292. <el-table-column prop="wtName" label="名称" width="150">
  293. </el-table-column>
  294. <el-table-column
  295. prop="total"
  296. label="理论发电量"
  297. width="120"
  298. >
  299. </el-table-column>
  300. <el-table-column
  301. prop="daydl2"
  302. label="SCADA发电量"
  303. width="120"
  304. >
  305. </el-table-column>
  306. <el-table-column prop="dayspeed" label="风速" width="120">
  307. </el-table-column>
  308. <el-table-column
  309. prop="daynhgzssdl"
  310. label="非计划检修"
  311. width="300"
  312. >
  313. </el-table-column>
  314. <el-table-column
  315. prop="daynhwhssdl"
  316. label="计划检修"
  317. width="120"
  318. >
  319. </el-table-column>
  320. <el-table-column prop="daynhcfdl" label="受累" width="120">
  321. </el-table-column>
  322. <el-table-column
  323. prop="daynhxdssdl"
  324. label="限电"
  325. width="120"
  326. >
  327. </el-table-column>
  328. <el-table-column
  329. prop="daynhxdssdl"
  330. label="性能"
  331. width="120"
  332. >
  333. </el-table-column>
  334. <el-table-column prop="lyl" label="风能利用率%" width="120">
  335. </el-table-column>
  336. </el-table-column>
  337. </el-table>
  338. </el-card>
  339. </el-row>
  340. </el-tab-pane>
  341. </el-tabs>
  342. </el-card>
  343. </el-main>
  344. </el-container>
  345. </template>
  346. <script>
  347. import * as echarts from "echarts";
  348. import excelHelper from "@/utils/excelHelper";
  349. export default {
  350. data() {
  351. return {
  352. judge:true,
  353. autoHeight:1200,
  354. formInline: {
  355. wpIds: "NSS_FDC",
  356. project: "NSS01_GC",
  357. line: "NSS01_XL",
  358. },
  359. fc_date: [],
  360. pj_date: [],
  361. xl_date: [],
  362. beginDate: "2021-01-01",
  363. endDate: "2021-01-02",
  364. activeName: "first",
  365. tableid: "fc",
  366. celname: [],
  367. histogram_fc: {},
  368. histogram_xm: {},
  369. histogram_jdxl: {},
  370. table_fc: {},
  371. table_xm: {},
  372. table_jdxl: {},
  373. queryAll_querybutton: {},
  374. };
  375. },
  376. methods: {
  377. onSubmit() {
  378. console.log("submit!");
  379. },
  380. handleClick(tab) {
  381. if (tab.name === "first") {
  382. this.tableid = "fc";
  383. this.query();
  384. } else if (tab.name === "second") {
  385. this.tableid = "pj";
  386. this.query();
  387. } else if (tab.name === "jdxl") {
  388. this.tableid = "xl";
  389. this.query();
  390. }
  391. },
  392. deleteRow(index, rows) {
  393. rows.splice(index, 1);
  394. },
  395. query() {
  396. this.fc_date = "";
  397. this.xl_date = "";
  398. this.pj_date = "";
  399. this.$http
  400. .get(
  401. "powercompare/queryPowerAll?wpIds=" +
  402. this.formInline.wpIds +
  403. "&beginDate=" +
  404. this.beginDate +
  405. "&endDate=" +
  406. this.endDate +
  407. "&queryType=" +
  408. this.tableid
  409. )
  410. .then((res) => {
  411. let that = this;
  412. if (this.tableid === "fc") {
  413. that.drawhistogram_fc(res.data.data);
  414. } else if (this.tableid === "pj") {
  415. that.drawhistogram_pj(res.data.data);
  416. } else if (this.tableid === "xl") {
  417. this.autoHeight = 1200;
  418. that.drawhistogram_xl(res.data.data);
  419. }
  420. });
  421. //表格数据获取
  422. this.$http
  423. .get(
  424. "powercompare/powerAjaxAll?wpIds=" +
  425. this.formInline.wpIds +
  426. "&beginDate=" +
  427. this.beginDate +
  428. "&endDate=" +
  429. this.endDate +
  430. "&queryType=" +
  431. this.tableid +
  432. "&sortName=" +
  433. this.formInline.wpIds +
  434. "&sortOrder=" +
  435. "Asc"
  436. )
  437. .then((res) => {
  438. let that = this;
  439. console.log(res);
  440. let queryAll_table = res.data.data;
  441. if (this.tableid === "fc") {
  442. that.fc_date = queryAll_table;
  443. } else if (this.tableid === "pj") {
  444. that.pj_date = queryAll_table;
  445. } else if (this.tableid === "xl") {
  446. that.xl_date = queryAll_table;
  447. }
  448. });
  449. },
  450. async queryPowerAll() {
  451. this.judge = false;
  452. this.autoHeight = 600;
  453. let that = this;
  454. if (this.beginDate == "" || this.endDate == "" || this.beginDate == undefined || this.endDate == undefined) {
  455. this.beginDate = "2021-01-01";
  456. that.endDate = "2021-01-02";
  457. that.$message.error("请选时间!");
  458. return;
  459. }
  460. this.fc_date = "";
  461. this.xl_date = "";
  462. this.pj_date = "";
  463. if (
  464. that.formInline.wpIds == "" ||
  465. that.formInline.wpIds == null ||
  466. that.formInline.wpIds == undefined
  467. ) {
  468. that.query();
  469. } else {
  470. this.$http
  471. .get(
  472. "powercompare/queryPower?wpIds=" +
  473. this.formInline.wpIds +
  474. "&pjIds=" +
  475. this.formInline.project +
  476. "&lineIds=" +
  477. this.formInline.line +
  478. "&beginDate=" +
  479. this.beginDate +
  480. "&endDate=" +
  481. this.endDate
  482. )
  483. .then((res) => {
  484. let that = this;
  485. let queryAll = res.data.data;
  486. if (this.tableid === "fc") {
  487. that.drawhistogram_fc(queryAll);
  488. } else if (this.tableid === "pj") {
  489. that.drawhistogram_pj(queryAll);
  490. } else if (this.tableid === "xl") {
  491. that.drawhistogram_xl(queryAll);
  492. }
  493. });
  494. this.$http
  495. .get(
  496. "powercompare/powerAjax?wpIds=" +
  497. this.formInline.wpIds +
  498. "&pjIds=" +
  499. this.formInline.project +
  500. "&lineIds=" +
  501. this.formInline.line +
  502. "&beginDate=" +
  503. this.beginDate +
  504. "&endDate=" +
  505. this.endDate +
  506. "&sortName=" +
  507. this.formInline.wpIds +
  508. "&sortOrder=" +
  509. "Asc"
  510. )
  511. .then((res) => {
  512. let that = this;
  513. let queryAll_table = res.data.data;
  514. if (this.tableid === "fc") {
  515. that.fc_date = queryAll_table;
  516. } else if (this.tableid === "pj") {
  517. that.pj_date = queryAll_table;
  518. } else if (this.tableid === "xl") {
  519. that.xl_date = queryAll_table;
  520. }
  521. });
  522. }
  523. },
  524. checkwindfarm() {
  525. if (this.formInline.windfarm == "") {
  526. this.$message.error("请选择风场!");
  527. return;
  528. }
  529. },
  530. checkproject() {
  531. if (this.formInline.project == "") {
  532. this.$message.error("请选择项目!");
  533. return;
  534. }
  535. if (new Date(this.timedate) == null) {
  536. this.$message.error("请选择时间");
  537. return;
  538. }
  539. },
  540. checktime() {
  541. if (new Date(this.timedate) == null) {
  542. this.$message.error("请选择时间");
  543. return;
  544. }
  545. },
  546. queryApDataMx() {
  547. this.$router.push({ path: "/new_performanceList_fan" });
  548. },
  549. toExcel() {
  550. let that = this;
  551. if (this.tableid === "fc") {
  552. excelHelper.exportExcel("fc_table","fc数据",".xls",true);
  553. } else if (this.tableid === "pj") {
  554. excelHelper.exportExcel("pj_table","pj数据",".xls",true);
  555. } else if (this.tableid === "xl") {
  556. excelHelper.exportExcel("xl_table","xl数据",".xls",true);
  557. }
  558. },
  559. drawhistogram_fc(date) {
  560. this.chartLine = echarts.init(document.getElementById("histogram_fc"));
  561. var option;
  562. option = {
  563. title: {
  564. text: "风机绩效榜单",
  565. left: 300,
  566. top: -5,
  567. textStyle: {
  568. fontSize: 13,
  569. },
  570. },
  571. tooltip: {
  572. trigger: "axis",
  573. axisPointer: {
  574. // Use axis to trigger tooltip
  575. type: "shadow", // 'shadow' as default; can also be 'line' or 'shadow'
  576. },
  577. },
  578. legend: {
  579. left: 15,
  580. top: 30,
  581. data: [
  582. "实发电量",
  583. "计划检修损失",
  584. "非计划检修损失",
  585. "限电损失",
  586. "受累损失",
  587. "性能损失",
  588. "总和",
  589. ],
  590. },
  591. grid: {
  592. left: "3%",
  593. right: "4%",
  594. bottom: "3%",
  595. containLabel: true,
  596. },
  597. xAxis: {
  598. type: "value",
  599. },
  600. yAxis: {
  601. type: "category",
  602. data: date.names,
  603. },
  604. series: [
  605. {
  606. name: "实发电量",
  607. type: "bar",
  608. stack: "total",
  609. label: {
  610. show: true,
  611. },
  612. emphasis: {
  613. focus: "series",
  614. },
  615. data: date.sfdl,
  616. },
  617. {
  618. name: "计划检修损失",
  619. type: "bar",
  620. stack: "total",
  621. label: {
  622. show: true,
  623. },
  624. emphasis: {
  625. focus: "series",
  626. },
  627. data: date.whdl,
  628. },
  629. {
  630. name: "非计划检修损失",
  631. type: "bar",
  632. stack: "total",
  633. label: {
  634. show: true,
  635. },
  636. emphasis: {
  637. focus: "series",
  638. },
  639. data: date.gzdl,
  640. },
  641. {
  642. name: "限电损失",
  643. type: "bar",
  644. stack: "total",
  645. label: {
  646. show: true,
  647. },
  648. emphasis: {
  649. focus: "series",
  650. },
  651. data: date.xddl,
  652. },
  653. {
  654. name: "受累损失",
  655. type: "bar",
  656. stack: "total",
  657. label: {
  658. show: true,
  659. },
  660. emphasis: {
  661. focus: "series",
  662. },
  663. data: date.sldl,
  664. },
  665. {
  666. name: "性能损失",
  667. type: "bar",
  668. stack: "total",
  669. label: {
  670. show: date.qfdl,
  671. },
  672. emphasis: {
  673. focus: "series",
  674. },
  675. data: date.qfdl,
  676. },
  677. //曲线
  678. {
  679. name: "总和",
  680. data: date.yfdl,
  681. type: "line",
  682. symbol: "circle",
  683. symbolSize: 20,
  684. lineStyle: {
  685. color: "#5470C6",
  686. width: 4,
  687. type: "dashed",
  688. },
  689. itemStyle: {
  690. borderWidth: 3,
  691. borderColor: "#EE6666",
  692. color: "yellow",
  693. },
  694. },
  695. ],
  696. };
  697. this.chartLine.setOption(option);
  698. },
  699. drawhistogram_pj(date) {
  700. this.chartLine = echarts.init(document.getElementById("histogram_xm"));
  701. var option;
  702. var option;
  703. option = {
  704. title: {
  705. text: "风机绩效榜单",
  706. left: 300,
  707. top: -5,
  708. textStyle: {
  709. fontSize: 13,
  710. },
  711. },
  712. tooltip: {
  713. trigger: "axis",
  714. axisPointer: {
  715. // Use axis to trigger tooltip
  716. type: "shadow", // 'shadow' as default; can also be 'line' or 'shadow'
  717. },
  718. },
  719. legend: {
  720. left: 15,
  721. top: 30,
  722. data: [
  723. "实发电量",
  724. "计划检修损失",
  725. "非计划检修损失",
  726. "限电损失",
  727. "受累损失",
  728. "性能损失",
  729. "总和",
  730. ],
  731. },
  732. grid: {
  733. left: "3%",
  734. right: "4%",
  735. bottom: "3%",
  736. containLabel: true,
  737. },
  738. xAxis: {
  739. type: "value",
  740. },
  741. yAxis: {
  742. type: "category",
  743. data: date.names,
  744. },
  745. series: [
  746. {
  747. name: "实发电量",
  748. type: "bar",
  749. stack: "total",
  750. label: {
  751. show: true,
  752. },
  753. emphasis: {
  754. focus: "series",
  755. },
  756. data: date.sfdl,
  757. },
  758. {
  759. name: "计划检修损失",
  760. type: "bar",
  761. stack: "total",
  762. label: {
  763. show: true,
  764. },
  765. emphasis: {
  766. focus: "series",
  767. },
  768. data: date.whdl,
  769. },
  770. {
  771. name: "非计划检修损失",
  772. type: "bar",
  773. stack: "total",
  774. label: {
  775. show: true,
  776. },
  777. emphasis: {
  778. focus: "series",
  779. },
  780. data: date.gzdl,
  781. },
  782. {
  783. name: "限电损失",
  784. type: "bar",
  785. stack: "total",
  786. label: {
  787. show: true,
  788. },
  789. emphasis: {
  790. focus: "series",
  791. },
  792. data: date.xddl,
  793. },
  794. {
  795. name: "受累损失",
  796. type: "bar",
  797. stack: "total",
  798. label: {
  799. show: true,
  800. },
  801. emphasis: {
  802. focus: "series",
  803. },
  804. data: date.sldl,
  805. },
  806. {
  807. name: "性能损失",
  808. type: "bar",
  809. stack: "total",
  810. label: {
  811. show: date.qfdl,
  812. },
  813. emphasis: {
  814. focus: "series",
  815. },
  816. data: date.qfdl,
  817. },
  818. //曲线
  819. {
  820. name: "总和",
  821. data: date.yfdl,
  822. type: "line",
  823. symbol: "circle",
  824. symbolSize: 20,
  825. lineStyle: {
  826. color: "#5470C6",
  827. width: 4,
  828. type: "dashed",
  829. },
  830. itemStyle: {
  831. borderWidth: 3,
  832. borderColor: "#EE6666",
  833. color: "yellow",
  834. },
  835. },
  836. ],
  837. };
  838. this.chartLine.setOption(option);
  839. },
  840. drawhistogram_xl(date) {
  841. this.chartLine = echarts.init(document.getElementById("histogram_jdxl"));
  842. this.chartLine.clear();
  843. this.chartLine.resize({height: this.autoHeight})
  844. var option;
  845. var option;
  846. option = {
  847. title: {
  848. text: "风机绩效榜单",
  849. left: 300,
  850. top: -5,
  851. textStyle: {
  852. fontSize: 13,
  853. },
  854. },
  855. tooltip: {
  856. trigger: "axis",
  857. axisPointer: {
  858. // Use axis to trigger tooltip
  859. type: "shadow", // 'shadow' as default; can also be 'line' or 'shadow'
  860. },
  861. },
  862. legend: {
  863. left: 15,
  864. top: 30,
  865. data: [
  866. "实发电量",
  867. "计划检修损失",
  868. "非计划检修损失",
  869. "限电损失",
  870. "受累损失",
  871. "性能损失",
  872. "总和",
  873. ],
  874. },
  875. grid: {
  876. left: "3%",
  877. right: "4%",
  878. bottom: "3%",
  879. containLabel: true,
  880. },
  881. xAxis: {
  882. type: "value",
  883. },
  884. yAxis: {
  885. type: "category",
  886. data: date.names,
  887. },
  888. series: [
  889. {
  890. name: "实发电量",
  891. type: "bar",
  892. stack: "total",
  893. label: {
  894. show: true,
  895. },
  896. emphasis: {
  897. focus: "series",
  898. },
  899. data: date.sfdl,
  900. },
  901. {
  902. name: "计划检修损失",
  903. type: "bar",
  904. stack: "total",
  905. label: {
  906. show: true,
  907. },
  908. emphasis: {
  909. focus: "series",
  910. },
  911. data: date.whdl,
  912. },
  913. {
  914. name: "非计划检修损失",
  915. type: "bar",
  916. stack: "total",
  917. label: {
  918. show: true,
  919. },
  920. emphasis: {
  921. focus: "series",
  922. },
  923. data: date.gzdl,
  924. },
  925. {
  926. name: "限电损失",
  927. type: "bar",
  928. stack: "total",
  929. label: {
  930. show: true,
  931. },
  932. emphasis: {
  933. focus: "series",
  934. },
  935. data: date.xddl,
  936. },
  937. {
  938. name: "受累损失",
  939. type: "bar",
  940. stack: "total",
  941. label: {
  942. show: true,
  943. },
  944. emphasis: {
  945. focus: "series",
  946. },
  947. data: date.sldl,
  948. },
  949. {
  950. name: "性能损失",
  951. type: "bar",
  952. stack: "total",
  953. label: {
  954. show: date.qfdl,
  955. },
  956. emphasis: {
  957. focus: "series",
  958. },
  959. data: date.qfdl,
  960. },
  961. //曲线
  962. {
  963. name: "总和",
  964. data: date.yfdl,
  965. type: "line",
  966. symbol: "circle",
  967. symbolSize: 20,
  968. lineStyle: {
  969. color: "#5470C6",
  970. width: 4,
  971. type: "dashed",
  972. },
  973. itemStyle: {
  974. borderWidth: 3,
  975. borderColor: "#EE6666",
  976. color: "yellow",
  977. },
  978. },
  979. ],
  980. };
  981. this.chartLine.setOption(option);
  982. },
  983. },
  984. mounted() {
  985. this.query();
  986. },
  987. };
  988. </script>
  989. <style scoped>
  990. .bg-purple-dark {
  991. background: #fff;
  992. }
  993. .grid-content {
  994. border-radius: 2px;
  995. min-height: 36px;
  996. margin-top: -15px;
  997. }
  998. .item {
  999. margin-top: 10px;
  1000. margin-right: 40px;
  1001. }
  1002. .el-row {
  1003. margin: 10px;
  1004. }
  1005. </style>