index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <template>
  2. <div style="width: 100%;height:100%;padding: 10px;">
  3. <div class="operationHome" v-if="$route.path === '/economicsOperation'">
  4. <!-- <tab @select="selectionItemClick" /> -->
  5. <div class="homeMain">
  6. <div class="homeLeaf">
  7. <Row type="flex" class="plan" style="height:21%">
  8. <Col :span="24">
  9. <com-panel title="发电量" sub-title="单位:万kWh" bodyPadd="50px"
  10. style="position: relative;height: 100%">
  11. <div v-for="it in ForecastPower" :key="it" class="powerName">
  12. <span :style="{top: it.top}">{{it.name}}</span>
  13. <span :style="{top: it.top1}">{{it.value}}</span>
  14. <span :style="{top: it.top2}">{{it.bfb}}%</span>
  15. <span :style="{top: it.top3}">理论发电量 {{it.total}}</span>
  16. </div>
  17. <list-bar-chart-2 :list="ForecastPower" height="15vh" />
  18. </com-panel>
  19. </Col>
  20. </Row>
  21. <Row type="flex" class="plan" style="height:79%">
  22. <Col :span="24">
  23. <com-panel title="主要经济指标同期对比" sub-title="单位:万kWh" style="position: relative;height: 100%">
  24. <operationTable :data="zbtqdb" height="100%"></operationTable>
  25. </com-panel>
  26. </Col>
  27. </Row>
  28. </div>
  29. <div class="homeCenter">
  30. <Row type="flex" style="height:23%;">
  31. <Col :span="24" style="background: #142446 !important;">
  32. <com-panel title="发电量完成率" sub-title="单位:万kWh" style="position: relative;height: 100%">
  33. <power-plan :data="planData" :title="planBtnName" />
  34. </com-panel>
  35. </Col>
  36. </Row>
  37. <Row type="flex" style="height:25%">
  38. <Col :span="24">
  39. <com-panel title="限电" style="position: relative;height: 100%">
  40. <multiple-y-line-chart-normal height="100%" :list="Powertrend" :yAxises="PowertrendYAxises"
  41. :showLegend="true" :hoverType="'axis'" />
  42. </com-panel>
  43. </Col>
  44. </Row>
  45. <Row type="flex" style="height:25%">
  46. <Col :span="24">
  47. <com-panel title="损失电量" style="position: relative;height: 100%">
  48. <multiple-y-line-chart-normal height="100%" :list="Powerloss" :yAxises="PowerlossYAxises"
  49. :showLegend="true" :hoverType="'axis'" />
  50. </com-panel>
  51. </Col>
  52. </Row>
  53. <Row type="flex" style="height:26%">
  54. <Col :span="24">
  55. <com-panel title="发电量" style="position: relative;height: 100%">
  56. <!-- <marker-line-chart :height="'100%'" :list="Powersend" myUnit='MW' :showLegend="true" /> -->
  57. <multiple-bar-chart :list="Powersend" :units="['电量(万kwh)']" height="100%"
  58. :showLegend="true" />
  59. </com-panel>
  60. </Col>
  61. </Row>
  62. </div>
  63. <div class="homeRight">
  64. <div class="tabs">
  65. <div class="tab-item" v-for="(item, index) of tabData" :key="item"
  66. :class="{ active: activeIndex == index }"
  67. @click="selectTab(index, item)">
  68. {{ item.text }}
  69. </div>
  70. </div>
  71. <Row type="flex" class="rightplan" v-for="it in rightTableData" :key="it.name" style="height:50%">
  72. <Col :span="24">
  73. <com-panel :title="it.name" style="position: relative;height: 100%">
  74. <operationTable :data="it.data" height="100%"></operationTable>
  75. </com-panel>
  76. </Col>
  77. </Row>
  78. </div>
  79. </div>
  80. </div>
  81. <router-view v-else />
  82. </div>
  83. </template>
  84. <script>
  85. import {
  86. generatingcapacity,
  87. homeright,
  88. homemiddle
  89. } from "@/api/economicIndex";
  90. import Row from "@com/coms/grid/row.vue";
  91. import Col from "@com/coms/grid/col.vue";
  92. import ComPanel from "@com/coms/panel/panel";
  93. import ListBarChart2 from "@com/chart/bar/list-bar-chart2.vue";
  94. import forecastBarComponent from "./component/forecastBarComponent.vue";
  95. import Tab from "@com/coms/tabs/tab.vue";
  96. import operationTable from "./component/operationTable.vue";
  97. import PowerPlan from "./component/power-plan.vue";
  98. import dataJson from "./component/dataJJJson.json"
  99. import MultipleYLineChartNormal from "./component/multiple-y-line-chart-normal.vue";
  100. import MultipleBarChart from "./component/multiple-bar-chart.vue";
  101. export default {
  102. name: "economicsOperation",
  103. components: {
  104. Row,
  105. Col,
  106. ComPanel,
  107. ListBarChart2,
  108. Tab,
  109. forecastBarComponent,
  110. operationTable,
  111. PowerPlan,
  112. MultipleYLineChartNormal,
  113. MultipleBarChart
  114. },
  115. data() {
  116. return {
  117. activeIndex: 0,
  118. tabData: [{
  119. id: "year",
  120. text: "年",
  121. }, {
  122. id: "month",
  123. text: "月",
  124. }, {
  125. id: "week",
  126. text: "周",
  127. }, ],
  128. rightTableData: [{
  129. name: '风能利用率年排名',
  130. data: []
  131. },
  132. {
  133. name: '设备可利用率年排名',
  134. data: []
  135. }
  136. ],
  137. ForecastPower: [],
  138. fnlyl: dataJson.data.fnlyl,
  139. zbtqdb: {},
  140. sbklyl: {},
  141. lgxzkh: {},
  142. planData: {},
  143. planBtnName: "全部",
  144. Powertrend: [],
  145. PowertrendYAxises: [{
  146. name: "限电量",
  147. min: 0,
  148. max: null,
  149. unit: "(万kWh)",
  150. position: "left",
  151. },
  152. {
  153. name: "限电率",
  154. min: 0,
  155. max: 10,
  156. unit: "(%)",
  157. position: "right",
  158. },
  159. ],
  160. Powerloss: [],
  161. PowerlossYAxises: [{
  162. name: "损失电量",
  163. min: 0,
  164. max: null,
  165. unit: "(万kWh)",
  166. position: "left",
  167. },
  168. {
  169. name: "限电率",
  170. min: 0,
  171. max: 10,
  172. unit: "(%)",
  173. position: "right",
  174. },
  175. ],
  176. Powersend: [],
  177. timmer: null, // 定时器开关
  178. }
  179. },
  180. mounted() {
  181. this.getGeneratingcapacity()
  182. this.timmer = setInterval(() => {
  183. this.getGeneratingcapacity();
  184. }, 10000);
  185. },
  186. unmounted() {
  187. clearInterval(this.timmer);
  188. this.timmer = null;
  189. },
  190. methods: {
  191. selectTab(index, item) {
  192. console.log("ind===>>>", index)
  193. this.activeIndex = index;
  194. this.changeRightData()
  195. },
  196. changeRightData() {
  197. let that = this
  198. homeright({
  199. periodType: this.activeIndex === 0 ? "year" : this.activeIndex === 1 ? "month" : "week"
  200. }).then(res =>{
  201. if (res.data) {
  202. that.rightTableData = [{
  203. name: '风能利用率年排名',
  204. data: res.data.fnlyl
  205. },
  206. {
  207. name: '设备可利用率年排名',
  208. data: res.data.sbklyl
  209. },
  210. // {
  211. // name: '两个细则考核',
  212. // data: res.data.lgxzkh
  213. // },
  214. ]
  215. }
  216. })
  217. // .catch(e => {
  218. // that.rightTableData = [{
  219. // name: '风能利用率年排名',
  220. // data: dataJson.data.fnlyl
  221. // },
  222. // {
  223. // name: '设备可利用率年排名',
  224. // data: dataJson.data.sbklyl
  225. // },
  226. // ]
  227. // })
  228. },
  229. //获取发电量和主要经济指标同期对比
  230. getGeneratingcapacity() {
  231. let that = this
  232. generatingcapacity().then(res => {
  233. if (res.data) {
  234. if (res.data.fdl?.length>0) {
  235. res.data.fdl.forEach(it => {
  236. dataJson.data.fdl.forEach(iv =>{
  237. if (it.name === iv.name) {
  238. iv.bfb = it.bfb === 0 ? 1 : it.bfb
  239. iv.total = it.total === 0 ? 1 : it.total
  240. iv.value = it.value === 0 ? 0 : it.value
  241. }
  242. })
  243. })
  244. that.ForecastPower = dataJson.data.fdl
  245. }
  246. that.zbtqdb = res.data.zbtqdb
  247. }
  248. })
  249. // .catch(e => {
  250. // that.zbtqdb = dataJson.data.zbtqdb
  251. // })
  252. homemiddle().then(res =>{
  253. if (res.data) {
  254. that.planData = res.data.planData
  255. that.Powertrend = res.data.Powertrend
  256. that.Powersend = res.data.Powersend
  257. that.Powerloss = res.data.Powerloss
  258. }
  259. })
  260. // .catch(e => {
  261. // that.planData = dataJson.data.planData
  262. // that.Powertrend = dataJson.data.Powertrend
  263. // that.Powersend = dataJson.data.Powersend
  264. // that.Powerloss = dataJson.data.Powerloss
  265. // })
  266. this.changeRightData()
  267. },
  268. },
  269. watch: {
  270. $route: {
  271. handler(val) {
  272. // debugger
  273. if (val.path !== "/economicsOperation") {
  274. clearInterval(this.timmer);
  275. this.timmer = null;
  276. } else {
  277. this.timmer = setInterval(() => {
  278. this.getGeneratingcapacity();
  279. }, 10000);
  280. }
  281. },
  282. },
  283. },
  284. };
  285. </script>
  286. <style lang="less">
  287. .operationHome {
  288. width: 100%;
  289. height: 100%;
  290. .homeMain {
  291. width: 100%;
  292. height: calc(100% - 25px);
  293. display: flex;
  294. justify-content: space-between;
  295. .homeLeaf {
  296. width: 25%;
  297. height: 100%;
  298. .powerName {
  299. span {
  300. position: absolute;
  301. &:nth-child(1) {
  302. font-size: 12px;
  303. left: 30px;
  304. }
  305. &:nth-child(2) {
  306. font-size: 16px;
  307. left: 85px;
  308. }
  309. &:nth-child(3) {
  310. font-size: 12px;
  311. right: 10px;
  312. }
  313. &:nth-child(4) {
  314. font-size: 12px;
  315. right: 50px;
  316. }
  317. }
  318. }
  319. }
  320. .homeCenter {
  321. width: 48%;
  322. height: 100%;
  323. }
  324. .homeRight {
  325. width: 25%;
  326. height: 100%;
  327. position: relative;
  328. .rightplan {
  329. margin-bottom: 15px;
  330. }
  331. .tabs {
  332. position: absolute;
  333. right: 0;
  334. z-index: 11111;
  335. display: flex;
  336. color: #fff;
  337. margin-bottom: 1.111vh;
  338. font-size: 12px;
  339. display: flex;
  340. justify-content: end;
  341. .tab-item {
  342. padding: 0.37vh 1.852vh;
  343. cursor: pointer;
  344. &.active {
  345. color: #fff;
  346. position: relative;
  347. background-image: linear-gradient(to top, fade(#2169c3, 50%), fade(#2169c3, 0));
  348. &::after {
  349. content: "";
  350. position: absolute;
  351. width: 100%;
  352. height: 0.463vh;
  353. border: 0.093vh solid #2169c3;
  354. border-top: 0;
  355. left: 0;
  356. bottom: 0;
  357. box-sizing: border-box;
  358. }
  359. }
  360. }
  361. }
  362. }
  363. }
  364. }
  365. </style>