index.vue 13 KB

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