index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. <template>
  2. <div style="width: 100%; height: 100%; padding: 10px; background: #030713">
  3. <el-tabs v-model="tabActiveName" class="jjyxTabs" v-if="false">
  4. <el-tab-pane label="运行指标" name="yxzb">
  5. <iframe
  6. :src="
  7. iframeUrl +
  8. '/index.html/#/runtime/b0d3f1f4-3e5d-429b-af81-2661e7099caa/862c8272-8cf8-435c-b3fc-b28936b4bfe0?instanceId=82546b6b-59a3-7a1b-fbd4-b2d4516cf991'
  9. "
  10. class="yxzbBox"
  11. ></iframe>
  12. </el-tab-pane>
  13. <el-tab-pane label="经济分析" name="jjfx">
  14. <div class="operationHome">
  15. <!-- <tab @select="selectionItemClick" /> -->
  16. <div class="homeMain">
  17. <div class="homeLeaf">
  18. <Row type="flex" class="plan" style="height: 21%">
  19. <Col :span="24">
  20. <com-panel
  21. title="发电量"
  22. sub-title="单位:万kWh"
  23. bodyPadd="50px"
  24. style="position: relative; height: 100%"
  25. >
  26. <div
  27. v-for="it in ForecastPower"
  28. :key="it"
  29. class="powerName"
  30. >
  31. <span :style="{ top: it.top }">{{ it.name }}</span>
  32. <span :style="{ top: it.top1 }">{{ it.value }}</span>
  33. <span :style="{ top: it.top2 }">{{ it.bfb }}%</span>
  34. <span :style="{ top: it.top3 }"
  35. >理论发电量 {{ it.total }}</span
  36. >
  37. </div>
  38. <list-bar-chart-2 :list="ForecastPower" height="15vh" />
  39. </com-panel>
  40. </Col>
  41. </Row>
  42. <Row type="flex" class="plan" style="height: 79%">
  43. <Col :span="24">
  44. <com-panel
  45. title="主要经济指标同期对比"
  46. sub-title="单位:万kWh"
  47. style="position: relative; height: 100%"
  48. >
  49. <operationTable
  50. :data="zbtqdb"
  51. height="100%"
  52. ></operationTable>
  53. </com-panel>
  54. </Col>
  55. </Row>
  56. </div>
  57. <div class="homeCenter">
  58. <Row type="flex" style="height: 23%">
  59. <Col :span="24" style="background: #142446 !important">
  60. <com-panel
  61. title="发电量完成率"
  62. sub-title="单位:万kWh"
  63. style="position: relative; height: 100%"
  64. >
  65. <power-plan :data="planData" :title="planBtnName" />
  66. </com-panel>
  67. </Col>
  68. </Row>
  69. <Row type="flex" style="height: 25%">
  70. <Col :span="24">
  71. <com-panel
  72. title="限电"
  73. style="position: relative; height: 100%"
  74. >
  75. <multiple-y-line-chart-normal
  76. height="100%"
  77. :list="Powertrend"
  78. :yAxises="PowertrendYAxises"
  79. :showLegend="true"
  80. :hoverType="'axis'"
  81. />
  82. </com-panel>
  83. </Col>
  84. </Row>
  85. <Row type="flex" style="height: 25%">
  86. <Col :span="24">
  87. <com-panel
  88. title="损失电量"
  89. style="position: relative; height: 100%"
  90. >
  91. <multiple-y-line-chart-normal
  92. height="100%"
  93. :list="Powerloss"
  94. :yAxises="PowerlossYAxises"
  95. :showLegend="true"
  96. :hoverType="'axis'"
  97. />
  98. </com-panel>
  99. </Col>
  100. </Row>
  101. <Row type="flex" style="height: 26%">
  102. <Col :span="24">
  103. <com-panel
  104. title="发电量"
  105. style="position: relative; height: 100%"
  106. >
  107. <!-- <marker-line-chart :height="'100%'" :list="Powersend" myUnit='MW' :showLegend="true" /> -->
  108. <multiple-bar-chart
  109. :list="Powersend"
  110. :units="['电量(万kwh)']"
  111. height="100%"
  112. :showLegend="true"
  113. />
  114. </com-panel>
  115. </Col>
  116. </Row>
  117. </div>
  118. <div class="homeRight">
  119. <div class="tabs">
  120. <div
  121. class="tab-item"
  122. v-for="(item, index) of tabData"
  123. :key="item"
  124. :class="{ active: activeIndex == index }"
  125. @click="selectTab(index, item)"
  126. >
  127. {{ item.text }}
  128. </div>
  129. </div>
  130. <Row
  131. type="flex"
  132. class="rightplan"
  133. v-for="it in rightTableData"
  134. :key="it.name"
  135. style="height: 50%"
  136. >
  137. <Col :span="24">
  138. <com-panel
  139. :title="it.name + tabData[activeIndex].text + '排名'"
  140. style="position: relative; height: 100%"
  141. >
  142. <operationTable
  143. :data="it.data"
  144. height="100%"
  145. ></operationTable>
  146. </com-panel>
  147. </Col>
  148. </Row>
  149. </div>
  150. </div>
  151. </div>
  152. </el-tab-pane>
  153. </el-tabs>
  154. <div
  155. class="operationHome"
  156. :style="`height:${
  157. switchTabShow() ? '100%' : 'calc(100% - 20px);margin-top:20px;'
  158. }`"
  159. v-if="$route.path === '/economicsOperation'"
  160. >
  161. <!-- <tab @select="selectionItemClick" /> -->
  162. <div class="homeMain">
  163. <div class="homeLeaf">
  164. <Row type="flex" class="plan" style="height: 21%">
  165. <Col :span="24">
  166. <com-panel
  167. title="发电量"
  168. sub-title="单位:万kWh"
  169. bodyPadd="50px"
  170. style="position: relative; height: 100%"
  171. >
  172. <div v-for="it in ForecastPower" :key="it" class="powerName">
  173. <span :style="{ top: it.top }">{{ it.name }}</span>
  174. <span :style="{ top: it.top1 }">{{ it.value }}</span>
  175. <span :style="{ top: it.top2 }">{{ it.bfb }}%</span>
  176. <span :style="{ top: it.top3 }"
  177. >理论发电量 {{ it.total }}</span
  178. >
  179. </div>
  180. <list-bar-chart-2 :list="ForecastPower" height="15vh" />
  181. </com-panel>
  182. </Col>
  183. </Row>
  184. <Row type="flex" class="plan" style="height: 79%">
  185. <Col :span="24">
  186. <com-panel
  187. title="主要经济指标同期对比"
  188. sub-title="单位:万kWh"
  189. style="position: relative; height: 100%"
  190. >
  191. <operationTable :data="zbtqdb" height="100%"></operationTable>
  192. </com-panel>
  193. </Col>
  194. </Row>
  195. </div>
  196. <div class="homeCenter">
  197. <Row type="flex" style="height: 23%">
  198. <Col :span="24" style="background: #142446 !important">
  199. <com-panel
  200. title="发电量完成率"
  201. sub-title="单位:万kWh"
  202. style="position: relative; height: 100%"
  203. >
  204. <power-plan :data="planData" :title="planBtnName" />
  205. </com-panel>
  206. </Col>
  207. </Row>
  208. <Row type="flex" style="height: 25%">
  209. <Col :span="24">
  210. <com-panel title="限电" style="position: relative; height: 100%">
  211. <multiple-y-line-chart-normal
  212. height="100%"
  213. :list="Powertrend"
  214. :yAxises="PowertrendYAxises"
  215. :showLegend="true"
  216. :hoverType="'axis'"
  217. />
  218. </com-panel>
  219. </Col>
  220. </Row>
  221. <Row type="flex" style="height: 25%">
  222. <Col :span="24">
  223. <com-panel
  224. title="损失电量"
  225. style="position: relative; height: 100%"
  226. >
  227. <multiple-y-line-chart-normal
  228. height="100%"
  229. :list="Powerloss"
  230. :yAxises="PowerlossYAxises"
  231. :showLegend="true"
  232. :hoverType="'axis'"
  233. />
  234. </com-panel>
  235. </Col>
  236. </Row>
  237. <Row type="flex" style="height: 26%">
  238. <Col :span="24">
  239. <com-panel
  240. title="发电量"
  241. style="position: relative; height: 100%"
  242. >
  243. <!-- <marker-line-chart :height="'100%'" :list="Powersend" myUnit='MW' :showLegend="true" /> -->
  244. <multiple-bar-chart
  245. :list="Powersend"
  246. :units="['电量(万kwh)']"
  247. height="100%"
  248. :showLegend="true"
  249. />
  250. </com-panel>
  251. </Col>
  252. </Row>
  253. </div>
  254. <div class="homeRight">
  255. <div class="tabs">
  256. <div
  257. class="tab-item"
  258. v-for="(item, index) of tabData"
  259. :key="item"
  260. :class="{ active: activeIndex == index }"
  261. @click="selectTab(index, item)"
  262. >
  263. {{ item.text }}
  264. </div>
  265. </div>
  266. <Row
  267. type="flex"
  268. class="rightplan"
  269. v-for="it in rightTableData"
  270. :key="it.name"
  271. style="height: 50%"
  272. >
  273. <Col :span="24">
  274. <com-panel
  275. :title="it.name + tabData[activeIndex].text + '排名'"
  276. style="position: relative; height: 100%"
  277. >
  278. <operationTable :data="it.data" height="100%"></operationTable>
  279. </com-panel>
  280. </Col>
  281. </Row>
  282. </div>
  283. </div>
  284. </div>
  285. <router-view v-else />
  286. </div>
  287. </template>
  288. <script>
  289. import { generatingcapacity, homeright, homemiddle } from "@/api/economicIndex";
  290. import Row from "@com/coms/grid/row.vue";
  291. import Col from "@com/coms/grid/col.vue";
  292. import ComPanel from "@com/coms/panel/panel";
  293. import ListBarChart2 from "@com/chart/bar/list-bar-chart2.vue";
  294. import forecastBarComponent from "./component/forecastBarComponent.vue";
  295. import Tab from "@com/coms/tabs/tab.vue";
  296. import operationTable from "./component/operationTable.vue";
  297. import PowerPlan from "./component/power-plan.vue";
  298. import dataJson from "./component/dataJJJson.json";
  299. import MultipleYLineChartNormal from "./component/multiple-y-line-chart-normal.vue";
  300. import MultipleBarChart from "./component/multiple-bar-chart.vue";
  301. export default {
  302. name: "economicsOperation",
  303. components: {
  304. Row,
  305. Col,
  306. ComPanel,
  307. ListBarChart2,
  308. Tab,
  309. forecastBarComponent,
  310. operationTable,
  311. PowerPlan,
  312. MultipleYLineChartNormal,
  313. MultipleBarChart,
  314. },
  315. data() {
  316. return {
  317. tabActiveName: "jjfx",
  318. activeIndex: 0,
  319. iframeUrl: "",
  320. tabData: [
  321. {
  322. id: "year",
  323. text: "年",
  324. },
  325. {
  326. id: "month",
  327. text: "月",
  328. },
  329. {
  330. id: "week",
  331. text: "周",
  332. },
  333. ],
  334. rightTableData: [
  335. {
  336. name: "风能利用率",
  337. data: [],
  338. },
  339. {
  340. name: "设备可利用率",
  341. data: [],
  342. },
  343. ],
  344. ForecastPower: [],
  345. fnlyl: dataJson.data.fnlyl,
  346. zbtqdb: {},
  347. sbklyl: {},
  348. lgxzkh: {},
  349. planData: {},
  350. planBtnName: "全部",
  351. Powertrend: [],
  352. PowertrendYAxises: [
  353. {
  354. name: "限电量",
  355. min: 0,
  356. max: null,
  357. unit: "(万kWh)",
  358. position: "left",
  359. },
  360. {
  361. name: "限电率",
  362. min: 0,
  363. max: 10,
  364. unit: "(%)",
  365. position: "right",
  366. },
  367. ],
  368. Powerloss: [],
  369. PowerlossYAxises: [
  370. {
  371. name: "损失电量",
  372. min: 0,
  373. max: null,
  374. unit: "(万kWh)",
  375. position: "left",
  376. },
  377. {
  378. name: "限电率",
  379. min: 0,
  380. max: 10,
  381. unit: "(%)",
  382. position: "right",
  383. },
  384. ],
  385. Powersend: [],
  386. timmer: null, // 定时器开关
  387. };
  388. },
  389. created() {
  390. this.iframeUrl = process.env.VUE_APP_URL;
  391. },
  392. mounted() {
  393. this.getGeneratingcapacity();
  394. this.timmer = setInterval(() => {
  395. this.getGeneratingcapacity();
  396. }, 10000);
  397. },
  398. unmounted() {
  399. clearInterval(this.timmer);
  400. this.timmer = null;
  401. },
  402. methods: {
  403. switchTabShow() {
  404. return (
  405. window.location.href.indexOf("#/integratedAlarm") === -1 &&
  406. window.location.href.indexOf("#/nxreport") === -1
  407. );
  408. },
  409. selectTab(index, item) {
  410. console.log("ind===>>>", index);
  411. this.activeIndex = index;
  412. this.changeRightData();
  413. },
  414. changeRightData() {
  415. let that = this;
  416. homeright({
  417. periodType:
  418. this.activeIndex === 0
  419. ? "year"
  420. : this.activeIndex === 1
  421. ? "month"
  422. : "week",
  423. }).then((res) => {
  424. if (res.data) {
  425. that.rightTableData = [
  426. {
  427. name: "风能利用率",
  428. data: res.data.fnlyl,
  429. },
  430. {
  431. name: "设备可利用率",
  432. data: res.data.sbklyl,
  433. },
  434. // {
  435. // name: '两个细则考核',
  436. // data: res.data.lgxzkh
  437. // },
  438. ];
  439. }
  440. });
  441. // .catch(e => {
  442. // that.rightTableData = [{
  443. // name: '风能利用率年排名',
  444. // data: dataJson.data.fnlyl
  445. // },
  446. // {
  447. // name: '设备可利用率年排名',
  448. // data: dataJson.data.sbklyl
  449. // },
  450. // ]
  451. // })
  452. },
  453. //获取发电量和主要经济指标同期对比
  454. getGeneratingcapacity() {
  455. let that = this;
  456. generatingcapacity().then((res) => {
  457. if (res.data) {
  458. if (res.data.fdl?.length > 0) {
  459. res.data.fdl.forEach((it) => {
  460. dataJson.data.fdl.forEach((iv) => {
  461. if (it.name === iv.name) {
  462. iv.bfb = it.bfb === 0 ? 1 : it.bfb;
  463. iv.total = it.total === 0 ? 1 : it.total;
  464. iv.value = it.value === 0 ? 0 : it.value;
  465. }
  466. });
  467. });
  468. that.ForecastPower = dataJson.data.fdl;
  469. }
  470. that.zbtqdb = res.data.zbtqdb;
  471. }
  472. });
  473. // .catch(e => {
  474. // that.zbtqdb = dataJson.data.zbtqdb
  475. // })
  476. homemiddle().then((res) => {
  477. if (res.data) {
  478. that.planData = res.data.planData;
  479. that.Powertrend = res.data.Powertrend;
  480. that.Powersend = res.data.Powersend;
  481. that.Powerloss = res.data.Powerloss;
  482. }
  483. });
  484. // .catch(e => {
  485. // that.planData = dataJson.data.planData
  486. // that.Powertrend = dataJson.data.Powertrend
  487. // that.Powersend = dataJson.data.Powersend
  488. // that.Powerloss = dataJson.data.Powerloss
  489. // })
  490. this.changeRightData();
  491. },
  492. },
  493. watch: {
  494. $route: {
  495. handler(val) {
  496. // debugger
  497. if (val.path !== "/economicsOperation") {
  498. clearInterval(this.timmer);
  499. this.timmer = null;
  500. } else {
  501. this.timmer = setInterval(() => {
  502. this.getGeneratingcapacity();
  503. }, 10000);
  504. }
  505. },
  506. },
  507. },
  508. };
  509. </script>
  510. <style lang="less">
  511. .jjyxTabs {
  512. width: 100%;
  513. height: calc(100% - 40px);
  514. .el-tabs__header {
  515. margin-bottom: 8px;
  516. }
  517. .el-tabs__content,
  518. .el-tab-pane {
  519. width: 100%;
  520. height: 100%;
  521. }
  522. .yxzbBox {
  523. width: 100%;
  524. height: 100%;
  525. border: 0;
  526. padding: 0;
  527. margin: 0;
  528. outline: 0;
  529. }
  530. }
  531. .operationHome {
  532. width: 100%;
  533. height: 100%;
  534. .homeMain {
  535. width: 100%;
  536. height: calc(100% - 25px);
  537. display: flex;
  538. justify-content: space-between;
  539. .homeLeaf {
  540. width: 25%;
  541. height: 100%;
  542. .powerName {
  543. span {
  544. position: absolute;
  545. &:nth-child(1) {
  546. font-size: 12px;
  547. left: 30px;
  548. }
  549. &:nth-child(2) {
  550. font-size: 16px;
  551. left: 85px;
  552. }
  553. &:nth-child(3) {
  554. font-size: 12px;
  555. right: 10px;
  556. }
  557. &:nth-child(4) {
  558. font-size: 12px;
  559. right: 50px;
  560. }
  561. }
  562. }
  563. }
  564. .homeCenter {
  565. width: 48%;
  566. height: 100%;
  567. }
  568. .homeRight {
  569. width: 25%;
  570. height: 100%;
  571. position: relative;
  572. .rightplan {
  573. margin-bottom: 15px;
  574. }
  575. .tabs {
  576. position: absolute;
  577. right: 0;
  578. z-index: 11111;
  579. display: flex;
  580. color: #fff;
  581. margin-bottom: 1.111vh;
  582. font-size: 12px;
  583. display: flex;
  584. justify-content: end;
  585. .tab-item {
  586. padding: 0.37vh 1.852vh;
  587. cursor: pointer;
  588. &.active {
  589. color: #fff;
  590. position: relative;
  591. background-image: linear-gradient(
  592. to top,
  593. fade(#2169c3, 50%),
  594. fade(#2169c3, 0)
  595. );
  596. &::after {
  597. content: "";
  598. position: absolute;
  599. width: 100%;
  600. height: 0.463vh;
  601. border: 0.093vh solid #2169c3;
  602. border-top: 0;
  603. left: 0;
  604. bottom: 0;
  605. box-sizing: border-box;
  606. }
  607. }
  608. }
  609. }
  610. }
  611. }
  612. }
  613. </style>