InternationalBenchmark.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924
  1. <template>
  2. <div class="box">
  3. <div class="searchBar">
  4. <el-form :inline="true" class="demo-form-inline" style="margin-left:1%">
  5. <el-row :gutter="1">
  6. <el-form-item label="风场">
  7. <el-select v-model="value" multiple placeholder="请选择">
  8. <el-option
  9. v-for="item in FClist"
  10. :key="item.name"
  11. :label="item.name"
  12. :value="item.id"
  13. >
  14. </el-option>
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item label="选择时间:">
  18. <el-date-picker
  19. v-model="timedate"
  20. value-format="yyyy-MM-dd"
  21. type="daterange"
  22. range-separator="至"
  23. start-placeholder="开始日期"
  24. end-placeholder="结束日期"
  25. >
  26. </el-date-picker>
  27. </el-form-item>
  28. <el-form-item>
  29. <el-button type="primary" @click="queryApData" :plain="true"
  30. >查询</el-button
  31. >
  32. </el-form-item>
  33. <el-form-item>
  34. <el-button type="primary" @click="queryApDataMx"
  35. >对标分析</el-button
  36. >
  37. </el-form-item>
  38. </el-row>
  39. </el-form>
  40. <el-table
  41. :data="gridData"
  42. :row-style="{ height: '10px' }"
  43. :cell-style="{ textAlign: 'center'}"
  44. :header-cell-style="headStyle"
  45. @selection-change="handleSelectionChange"
  46. @sort-change="changeTableSort"
  47. >
  48. <el-table-column type="index" width="50"> </el-table-column>
  49. <el-table-column
  50. type="selection"
  51. class="selection"
  52. @selection-change="changeFun"
  53. width="50"
  54. >
  55. </el-table-column>
  56. <el-table-column sortable prop="wpName" label="风电场名称" width="130">
  57. </el-table-column>
  58. <el-table-column sortable prop="ordernum" label="综合排名" width="130">
  59. </el-table-column>
  60. <el-table-column
  61. sortable
  62. prop="scadafdlnum"
  63. label="发电量排名"
  64. width="130"
  65. >
  66. </el-table-column>
  67. <el-table-column sortable prop="fdl" :formatter="simplification" label="发电量" width="110">
  68. </el-table-column>
  69. <el-table-column
  70. sortable
  71. prop="gzssnum"
  72. label="故障损失排名"
  73. width="130"
  74. >
  75. </el-table-column>
  76. <el-table-column sortable prop="gzss" label="故障损失电量" width="130">
  77. </el-table-column>
  78. <el-table-column
  79. sortable
  80. prop="whssnum"
  81. label="检修损失排名"
  82. width="130"
  83. >
  84. </el-table-column>
  85. <el-table-column sortable prop="whss" label="检修损失电量" width="130">
  86. </el-table-column>
  87. <el-table-column
  88. sortable
  89. prop="qfssnum"
  90. label="性能损失排名"
  91. width="130"
  92. >
  93. </el-table-column>
  94. <el-table-column sortable prop="qfss" label="性能损失电量" width="130">
  95. </el-table-column>
  96. <el-table-column
  97. sortable
  98. prop="xdssnum"
  99. label="限电损失排名"
  100. width="130"
  101. >
  102. </el-table-column>
  103. <el-table-column sortable prop="xdss" label="限电损失电量" width="130">
  104. </el-table-column>
  105. <el-table-column
  106. sortable
  107. prop="slssnum"
  108. label="受累损失排名"
  109. width="130"
  110. >
  111. </el-table-column>
  112. <el-table-column sortable prop="slss" label="受累损失电量" width="130">
  113. </el-table-column>
  114. <el-table-column
  115. sortable
  116. prop="fnlylnum"
  117. label="风能利用率排名"
  118. width="150"
  119. >
  120. </el-table-column>
  121. <el-table-column
  122. sortable
  123. prop="fnlyl"
  124. label="风能利用率(%)"
  125. width="150"
  126. >
  127. </el-table-column>
  128. <el-table-column
  129. sortable
  130. prop="gzsslnum"
  131. label="故障损失率排名"
  132. width="150"
  133. >
  134. </el-table-column>
  135. <el-table-column
  136. sortable
  137. prop="gzssl"
  138. label="故障损失率(%)"
  139. width="150"
  140. >
  141. </el-table-column>
  142. <el-table-column
  143. sortable
  144. prop="jxsslnum"
  145. label="检修损失率排名"
  146. width="150"
  147. >
  148. </el-table-column>
  149. <el-table-column
  150. sortable
  151. prop="jxssl"
  152. label="检修损失率(%)"
  153. width="150"
  154. >
  155. </el-table-column>
  156. <el-table-column sortable prop="qflnum" label="弃风率排名" width="130">
  157. </el-table-column>
  158. <el-table-column sortable prop="qfl" label="弃风率(%)" width="130">
  159. </el-table-column>
  160. <el-table-column
  161. sortable
  162. prop="xnsslnum"
  163. label="性能损失率排名"
  164. width="150"
  165. >
  166. </el-table-column>
  167. <el-table-column
  168. sortable
  169. prop="xnssl"
  170. label="性能损失率(%)"
  171. width="150"
  172. >
  173. </el-table-column>
  174. <el-table-column
  175. sortable
  176. prop="slsslnum"
  177. label="受累损失率排名"
  178. width="150"
  179. >
  180. </el-table-column>
  181. <el-table-column
  182. sortable
  183. prop="slssl"
  184. label="受累损失率(%)"
  185. width="150"
  186. >
  187. </el-table-column>
  188. <el-table-column
  189. sortable
  190. prop="fwjslnum"
  191. label="复位及时率排名"
  192. width="150"
  193. >
  194. </el-table-column>
  195. <el-table-column
  196. sortable
  197. prop="fwjsl"
  198. label="复位及时率(%)"
  199. width="150"
  200. >
  201. </el-table-column>
  202. <el-table-column
  203. sortable
  204. prop="ztzhjslnum"
  205. label="状态转换率排名"
  206. width="150"
  207. >
  208. </el-table-column>
  209. <el-table-column
  210. sortable
  211. prop="ztzhjsl"
  212. label="状态转换率(%)"
  213. width="150"
  214. >
  215. </el-table-column>
  216. <el-table-column fixed="right" prop="address" label="操作" width="70">
  217. <template slot-scope="scope">
  218. <el-button
  219. size="medium"
  220. type="text"
  221. @click="handleEdit(scope.$index, scope.row)"
  222. >详情</el-button
  223. >
  224. </template>
  225. </el-table-column>
  226. </el-table>
  227. <el-dialog
  228. class="el-dialog_body"
  229. width="60%"
  230. title="对标信息分析"
  231. :visible.sync="dialogTableVisible"
  232. append-to-body
  233. >
  234. <div class="margin">
  235. <div class="dialogLeftData">
  236. <div id="leiDaTu" class="echart"></div>
  237. <div id="leiDaTu2" class="echart"></div>
  238. </div>
  239. <div class="dialogRightData">
  240. <el-table
  241. :data="getTableData"
  242. height="618"
  243. :row-style="{ height: '10px' }"
  244. border
  245. :header-cell-style="headStyle"
  246. :cell-style="{ textAlign: 'center', padding: '7px' }"
  247. style="width: 100%; font-size: 10px"
  248. >
  249. <el-table-column prop="index" label="指标"> </el-table-column>
  250. <el-table-column prop="data1" :label="fdcName1">
  251. </el-table-column>
  252. <el-table-column prop="data2" :label="fdcName2">
  253. </el-table-column>
  254. </el-table>
  255. </div>
  256. </div>
  257. </el-dialog>
  258. <!-- <div style="text-align: center;">
  259. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="currentPage2"
  260. :page-sizes="[10, 50, 100, 1000]"
  261. :page-size="pagesize" layout="sizes, prev, pager, next" :total="1000">
  262. </el-pagination>
  263. </div> -->
  264. <el-row>
  265. <el-col :span="12"
  266. ><div
  267. id="chartPie"
  268. style="width: 800px; height: 400px; margin-top: 33px;margin-left:99px"
  269. ></div>
  270. </el-col>
  271. <el-col :span="12">
  272. <div
  273. id="chartPieRight"
  274. style="width: 800px; height: 400px; margin-top: 33px;margin-left:99px"
  275. ></div
  276. ></el-col>
  277. </el-row>
  278. <el-row>
  279. <div class="box">
  280. <div
  281. id="chartHistogram"
  282. style="width: 90%; height: 300px; margin: auto"
  283. ></div>
  284. </div>
  285. </el-row>
  286. </div>
  287. </div>
  288. </template>
  289. <script>
  290. import FiveLossRatesHistogramChart from "../../views/benchMarking/FiveLossRatesHistogramChart.vue";
  291. import formateDate from "@/utils/date";
  292. import formateDate1 from "@/utils/date_1";
  293. import * as echarts from "echarts";
  294. export default {
  295. data() {
  296. return {
  297. timedate: [],
  298. isAsc: "asc",
  299. beginDate: "",
  300. endDate: "",
  301. gridData: [],
  302. multipleSelection: [],
  303. sortInOrder: [],
  304. sortInOrderTop: [],
  305. sortInOrde2: [],
  306. getTableData: [],
  307. sortInOrderTop2: [],
  308. fdcName1: "",
  309. fdcName2: "",
  310. currentPage2: 1,
  311. pagesize: 10,
  312. FClist: {
  313. name: "",
  314. id: "",
  315. },
  316. value: "",
  317. wpId: [],
  318. wpName: [],
  319. orderByColumn: "",
  320. dialogTableVisible: false,
  321. lineDataOption: [],
  322. getChartDataValue: [],
  323. getChartDataValue2: [],
  324. getChartData:[]
  325. };
  326. },
  327. components: {
  328. },
  329. created() {
  330. this.Inquire_tableDate();
  331. },
  332. methods: {
  333. changeFun(val) {
  334. this.selectrowdate = val;
  335. },
  336. filter_date(cellValue) {
  337. let date = new Date(cellValue.recordDate);
  338. return formateDate(date / 1000);
  339. },
  340. headStyle() {
  341. return "text-align:center";
  342. },
  343. onSubmit() {
  344. },
  345. handleClick() {},
  346. deleteRow(index, rows) {
  347. rows.splice(index, 1);
  348. },
  349. queryApData() {
  350. this.Inquire_tableDate();
  351. },
  352. simplification(cellValue){
  353. return parseFloat(cellValue.fdl).toFixed(2);
  354. },
  355. handleEdit(a, b) {
  356. this.wpId = [];
  357. this.lineDataOption = [];
  358. if (this.multipleSelection.length == 2) {
  359. for (let i = 0; i < this.multipleSelection.length; i++) {
  360. this.wpId.push(this.multipleSelection[i].wpId);
  361. this.wpName.push(this.multipleSelection[i].wpName);
  362. this.lineDataOption.push({
  363. id: this.multipleSelection[i].wpId,
  364. name: this.multipleSelection[i].wpName,
  365. });
  366. }
  367. this.$router.push({
  368. path: "/NationBenchmark_particulars",
  369. query: {
  370. wpId: this.wpId,
  371. beginDate: this.beginDate,
  372. endDate: this.endDate,
  373. wpName: this.wpName,
  374. select: this.lineDataOption,
  375. },
  376. });
  377. } else {
  378. this.lineDataOption.push({ id: b.wpId, name: b.wpName });
  379. this.$router.push({
  380. path: "/NationBenchmark_particulars",
  381. query: {
  382. wpId: b.wpId,
  383. beginDate: this.beginDate,
  384. endDate: this.endDate,
  385. wpName: b.wpName,
  386. select: this.lineDataOption,
  387. },
  388. });
  389. }
  390. },
  391. queryApDataMx() {
  392. this.dialogTableVisible = true;
  393. this.$nextTick(function () {
  394. this.drawPie("leiDaTu");
  395. });
  396. this.$nextTick(function () {
  397. this.drawPie2("leiDaTu2");
  398. });
  399. },
  400. handleSelectionChange(val) {
  401. this.sortInOrder = [];
  402. this.sortInOrderTop = [];
  403. this.getTableData = [];
  404. this.sortInOrde2 = [];
  405. this.multipleSelection = val;
  406. if (this.multipleSelection.length == 2) {
  407. this.fdcName1 = this.multipleSelection[0].wpName;
  408. this.fdcName2 = this.multipleSelection[1].wpName;
  409. this.sortInOrder.push(
  410. this.multipleSelection[0].fnlyl,
  411. this.multipleSelection[0].xqjsl,
  412. this.multipleSelection[0].ztzhjsl,
  413. this.multipleSelection[0].fwjsl,
  414. this.multipleSelection[0].slssl,
  415. this.multipleSelection[0].xnssl,
  416. this.multipleSelection[0].qfl,
  417. this.multipleSelection[0].jxssl,
  418. this.multipleSelection[0].gzssl
  419. );
  420. this.sortInOrderTop.push(
  421. this.multipleSelection[1].fnlyl,
  422. this.multipleSelection[1].xqjsl,
  423. this.multipleSelection[1].ztzhjsl,
  424. this.multipleSelection[1].fwjsl,
  425. this.multipleSelection[1].slssl,
  426. this.multipleSelection[1].xnssl,
  427. this.multipleSelection[1].qfl,
  428. this.multipleSelection[1].jxssl,
  429. this.multipleSelection[1].gzssl
  430. );
  431. for (let i = 0; i < this.multipleSelection.length; i++) {
  432. this.sortInOrde2.push({
  433. product: this.multipleSelection[i].wpName,
  434. "限电损失电量单位:万KWh": this.multipleSelection[i].xdss,
  435. "故障损失电量单位:万KWh": this.multipleSelection[i].gzss,
  436. "检修损失电量单位:万KWh": this.multipleSelection[i].jxssl,
  437. "性能损失电量单位:万KWh": this.multipleSelection[i].xnssl,
  438. "受累损失电量单位:万KWh": this.multipleSelection[i].slss,
  439. });
  440. }
  441. this.getTableData.push({
  442. index: "发电量",
  443. data1: this.multipleSelection[0].fdl,
  444. data2: this.multipleSelection[1].fdl,
  445. });
  446. this.getTableData.push({
  447. index: "故障损失电量",
  448. data1: this.multipleSelection[0].gzss,
  449. data2: this.multipleSelection[1].gzss,
  450. });
  451. this.getTableData.push({
  452. index: "检修损失电量",
  453. data1: this.multipleSelection[0].jxssl,
  454. data2: this.multipleSelection[1].jxssl,
  455. });
  456. this.getTableData.push({
  457. index: "性能未达标损失电量",
  458. data1: this.multipleSelection[0].xnsslfraction,
  459. data2: this.multipleSelection[1].xnsslfraction,
  460. });
  461. this.getTableData.push({
  462. index: "受累损失电量",
  463. data1: this.multipleSelection[0].slss,
  464. data2: this.multipleSelection[1].slss,
  465. });
  466. this.getTableData.push({
  467. index: "风能利用率",
  468. data1: this.multipleSelection[0].fnlyl,
  469. data2: this.multipleSelection[1].fnlyl,
  470. });
  471. this.getTableData.push({
  472. index: "故障损失率",
  473. data1: this.multipleSelection[0].gzssl,
  474. data2: this.multipleSelection[1].gzssl,
  475. });
  476. this.getTableData.push({
  477. index: "检修损失率",
  478. data1: this.multipleSelection[0].jxssl,
  479. data2: this.multipleSelection[1].jxssl,
  480. });
  481. this.getTableData.push({
  482. index: "弃风率",
  483. data1: this.multipleSelection[0].qfl,
  484. data2: this.multipleSelection[1].qfl,
  485. });
  486. this.getTableData.push({
  487. index: "性能损失率",
  488. data1: this.multipleSelection[0].xnssl,
  489. data2: this.multipleSelection[1].xnssl,
  490. });
  491. this.getTableData.push({
  492. index: "受累损失率",
  493. data1: this.multipleSelection[0].slssl,
  494. data2: this.multipleSelection[1].slssl,
  495. });
  496. this.getTableData.push({
  497. index: "复位及时率",
  498. data1: this.multipleSelection[0].fwjsl,
  499. data2: this.multipleSelection[1].fwjsl,
  500. });
  501. this.getTableData.push({
  502. index: "消缺及时率",
  503. data1: this.multipleSelection[0].xqjsl,
  504. data2: this.multipleSelection[1].xqjsl,
  505. });
  506. this.getTableData.push({
  507. index: "状态转换率",
  508. data1: this.multipleSelection[0].ztzhjsl,
  509. data2: this.multipleSelection[1].ztzhjsl,
  510. });
  511. }
  512. },
  513. handleCurrentChange(val) {
  514. },
  515. handleSizeChange(val) {
  516. this.pagesize = val;
  517. },
  518. changeTableSort(column) {
  519. this.orderByColumn = column.prop;
  520. if (column.order == "descending") {
  521. this.isAsc = "desc";
  522. } else if (column.order == "ascending") {
  523. this.isAsc = "asc";
  524. }
  525. this.Inquire_tableDate();
  526. },
  527. Inquire_tableDate() {
  528. var newData = new Date();
  529. this.timedate[0] = formateDate1((newData.getTime()-86400000)/1000);
  530. this.timedate[1] = formateDate1(newData.getTime()/1000);
  531. let that = this;
  532. this.$http.get("/powercompare/windfarmAjax").then((res) => {
  533. that.FClist = res.data.data;
  534. });
  535. if (this.timedate == "") {
  536. this.timedate[0] = "2021-01-01";
  537. this.timedate[1] = "2021-01-01";
  538. this.beginDate = this.timedate[0];
  539. this.endDate = this.timedate[1];
  540. } else {
  541. this.beginDate = this.timedate[0];
  542. this.endDate = this.timedate[1];
  543. }
  544. var fiveLossData = new URLSearchParams();
  545. fiveLossData.append("pageNum", this.currentPage2);
  546. fiveLossData.append("pageSize", this.pagesize);
  547. fiveLossData.append("orderByColumn", this.orderByColumn);
  548. fiveLossData.append("isAsc", this.isAsc);
  549. fiveLossData.append("wpId", this.value);
  550. fiveLossData.append("beginDate", this.beginDate);
  551. fiveLossData.append("endDate", this.endDate);
  552. this.$http
  553. .post("/contrast/benchmarkWpOutList", fiveLossData)
  554. .then((res) => {
  555. that.gridData = res.data.data;
  556. that.getPackageData(that.gridData);
  557. that.getPackageData2(that.gridData);
  558. });
  559. },
  560. drawPie() {
  561. var charts;
  562. if (charts != null && charts != "" && charts != undefined) {
  563. charts.dispose();
  564. }
  565. charts = this.$echarts.init(document.getElementById("leiDaTu"));
  566. let option = {
  567. title: {
  568. // text: '对标排名分析',
  569. left: "center",
  570. },
  571. tooltip: {},
  572. // legend: {
  573. // data: ['预算分配(Allocated Budget)', '实际开销(Actual Spending)'],
  574. // left: 'right'
  575. // },
  576. radar: {
  577. // shape: 'circle',
  578. name: {
  579. textStyle: {
  580. color: "#fff",
  581. backgroundColor: "#999",
  582. borderRadius: 3,
  583. padding: [3, 5],
  584. },
  585. },
  586. indicator: [
  587. { name: "风能利用率", max: 150 },
  588. { name: "消缺及时率", max: 150 },
  589. { name: "状态转换率", max: 150 },
  590. { name: "复位及时率", max: 150 },
  591. { name: "受累损失率", max: 150 },
  592. { name: "性能损失率", max: 150 },
  593. { name: "弃风率", max: 150 },
  594. { name: "检修损失率", max: 150 },
  595. { name: "故障损失率", max: 150 },
  596. ],
  597. },
  598. series: [
  599. {
  600. name: "预算 vs 开销(Budget vs spending)",
  601. type: "radar",
  602. // areaStyle: {normal: {}},
  603. data: [
  604. {
  605. value: this.sortInOrder,
  606. name: this.fdcName1,
  607. },
  608. {
  609. value: this.sortInOrderTop,
  610. name: this.fdcName2,
  611. },
  612. ],
  613. },
  614. ],
  615. };
  616. charts.clear();
  617. charts.setOption(option);
  618. },
  619. drawPie2() {
  620. var charts2;
  621. if (charts2 != null && charts2 != "" && charts2 != undefined) {
  622. charts2.dispose();
  623. }
  624. charts2 = this.$echarts.init(document.getElementById("leiDaTu2"));
  625. let option2 = {
  626. legend: {
  627. orient: "vertical",
  628. left: "right",
  629. },
  630. tooltip: {},
  631. dataset: {
  632. dimensions: [
  633. "product",
  634. "限电损失电量单位:万KWh",
  635. "故障损失电量单位:万KWh",
  636. "检修损失电量单位:万KWh",
  637. "性能损失电量单位:万KWh",
  638. "受累损失电量单位:万KWh",
  639. ],
  640. source: this.sortInOrde2,
  641. },
  642. xAxis: { type: "category" },
  643. yAxis: {},
  644. // Declare several bar series, each will be mapped
  645. // to a column of dataset.source by default.
  646. series: [
  647. {
  648. // barGap:'100%',/*多个并排柱子设置柱子之间的间距*/
  649. type: "bar",
  650. barWidth: 30,
  651. itemStyle: {
  652. normal: {
  653. color: "#D201D8",
  654. },
  655. },
  656. },
  657. {
  658. type: "bar",
  659. barWidth: 30,
  660. itemStyle: {
  661. normal: {
  662. color: "#FD0100",
  663. },
  664. },
  665. },
  666. {
  667. type: "bar",
  668. barWidth: 30,
  669. itemStyle: {
  670. normal: {
  671. color: "#FF7B16",
  672. },
  673. },
  674. },
  675. {
  676. type: "bar",
  677. barWidth: 30,
  678. itemStyle: {
  679. normal: {
  680. color: "#8085E9",
  681. },
  682. },
  683. },
  684. {
  685. type: "bar",
  686. barWidth: 30,
  687. itemStyle: {
  688. normal: {
  689. color: "#A6A6A6",
  690. },
  691. },
  692. },
  693. ],
  694. };
  695. charts2.clear();
  696. charts2.setOption(option2);
  697. },
  698. toExcel() {},
  699. getPackageData(gridData) {
  700. for (let i = 0; i < gridData.length; i++) {
  701. this.getChartDataValue.push({
  702. value: gridData[i].fdl,
  703. name: gridData[i].wpName,
  704. });
  705. this.getChartDataValue2.push({
  706. value: gridData[i].gzss,
  707. name: gridData[i].wpName,
  708. });
  709. }
  710. this.getChartDataImport();
  711. this.getChartDataValue = [];
  712. this.getChartDataValue2 = [];
  713. },
  714. getChartDataImport() {
  715. var charts = echarts.init(document.getElementById("chartPie"));
  716. let option = {
  717. title: {
  718. text: "发电量占比",
  719. left: "center",
  720. },
  721. color: ["#90ED7D", "#F7A35C", "#7CB5EC", "#434348", "#8085E9"],
  722. tooltip: {
  723. trigger: "item",
  724. },
  725. legend: {
  726. orient: "vertical",
  727. left: "left",
  728. },
  729. series: [
  730. {
  731. type: "pie",
  732. radius: "50%",
  733. data: this.getChartDataValue,
  734. emphasis: {
  735. itemStyle: {
  736. shadowBlur: 10,
  737. shadowOffsetX: 0,
  738. shadowColor: "rgba(0, 0, 0, 0.5)",
  739. },
  740. },
  741. },
  742. ],
  743. };
  744. charts.setOption(option);
  745. var charts2 = echarts.init(document.getElementById("chartPieRight"));
  746. let option2 = {
  747. title: {
  748. text: "损失电量占比",
  749. left: "center",
  750. },
  751. color: ["#90ED7D", "#F7A35C", "#7CB5EC", "#434348", "#8085E9"],
  752. tooltip: {
  753. trigger: "item",
  754. },
  755. legend: {
  756. orient: "vertical",
  757. left: "left",
  758. },
  759. series: [
  760. {
  761. type: "pie",
  762. radius: "50%",
  763. data: this.getChartDataValue2,
  764. emphasis: {
  765. itemStyle: {
  766. shadowBlur: 10,
  767. shadowOffsetX: 0,
  768. shadowColor: "rgba(0, 0, 0, 0.5)",
  769. },
  770. },
  771. },
  772. ],
  773. };
  774. charts2.setOption(option2);
  775. },
  776. getPackageData2(gridData){
  777. this.getChartData = [];
  778. for(let i=0;i<gridData.length;i++){
  779. this.getChartData.push({product:gridData[i].wpName,'限电损失电量单位:万KWh':gridData[i].xdss,
  780. '故障损失电量单位:万KWh':gridData[i].gzss,'检修损失电量单位:万KWh':gridData[i].jxssl,
  781. '性能损失电量单位:万KWh':gridData[i].xnssl,'受累损失电量单位:万KWh':gridData[i].slss})
  782. }
  783. this.getChartDataImport2();
  784. },
  785. getChartDataImport2(){
  786. var charts =echarts.init(document.getElementById("chartHistogram"));
  787. let option = {
  788. title: {
  789. text: '损失电量分析',
  790. left: 'center'
  791. },
  792. legend: {
  793. orient: 'vertical',
  794. left: 'right'
  795. },
  796. tooltip: {},
  797. dataset: {
  798. dimensions: ['product', '限电损失电量单位:万KWh', '故障损失电量单位:万KWh', '检修损失电量单位:万KWh', '性能损失电量单位:万KWh', '受累损失电量单位:万KWh'],
  799. source: this.getChartData
  800. },
  801. xAxis: {type: 'category'},
  802. yAxis: {},
  803. // Declare several bar series, each will be mapped
  804. // to a column of dataset.source by default.
  805. series: [
  806. {
  807. // barGap:'100%',/*多个并排柱子设置柱子之间的间距*/
  808. type: 'bar',
  809. barWidth : 30,
  810. itemStyle:{
  811. normal:{
  812. color:'#D201D8'
  813. }
  814. }
  815. },
  816. {
  817. type: 'bar',
  818. barWidth : 30,
  819. itemStyle:{
  820. normal:{
  821. color:'#FD0100'
  822. }
  823. }
  824. },
  825. {
  826. type: 'bar',
  827. barWidth : 30,
  828. itemStyle:{
  829. normal:{
  830. color:'#FF7B16'
  831. }
  832. }
  833. },
  834. {
  835. type: 'bar',
  836. barWidth : 30,
  837. itemStyle:{
  838. normal:{
  839. color:'#8085E9'
  840. }
  841. }
  842. },
  843. {
  844. type: 'bar',
  845. barWidth : 30,
  846. itemStyle:{
  847. normal:{
  848. color:'#A6A6A6'
  849. }
  850. }
  851. },
  852. ]
  853. };
  854. charts.setOption(option);
  855. }
  856. },
  857. };
  858. </script>
  859. <style lang="scss" scoped>
  860. .box {
  861. width: 100%;
  862. justify-content: space-around;
  863. align-items: center;
  864. overflow: hidden;
  865. }
  866. .searchBar {
  867. margin-top: 1%;
  868. }
  869. .pieChart {
  870. margin-top: 2%;
  871. }
  872. .histogramChart {
  873. margin-bottom: 10%;
  874. }
  875. #leiDaTu {
  876. margin-left: 5%;
  877. height: 300px;
  878. width: 100%;
  879. float: left;
  880. }
  881. #leiDaTu2 {
  882. margin: 15%;
  883. height: 300px;
  884. width: 450px;
  885. float: left;
  886. }
  887. .margin {
  888. width: 100%;
  889. height: 618px;
  890. }
  891. .dialogLeftData {
  892. width: 50%;
  893. height: 650px;
  894. text-align: center;
  895. float: left;
  896. }
  897. /deep/::-webkit-scrollbar {
  898. z-index: 99999999;
  899. width: 6px;
  900. height: 13px !important;
  901. background-color: #f5f5f5;
  902. }
  903. .dialogRightData {
  904. width: 50%;
  905. height: 650px;
  906. text-align: center;
  907. float: left;
  908. }
  909. </style>