power-benchmarking.vue 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123
  1. <template>
  2. <div class="power-benchmarking-page">
  3. <div class="static">
  4. <div class="static-main">
  5. <span class="dot top-left"></span>
  6. <span class="dot bottom-left"></span>
  7. <span class="dot top-rignt"></span>
  8. <span class="dot bottom-right"></span>
  9. <div class="icon">
  10. <i class="svg-icon svg-icon-balck">
  11. <svg-icon :svgid="'svg-flash'" />
  12. </i>
  13. </div>
  14. <div class="info">
  15. <div class="title">累计增发电量</div>
  16. <div class="value">{{increasescapacity}}</div>
  17. <div class="unit">万kWh</div>
  18. </div>
  19. </div>
  20. <div class="static-items" style="flex:0 0 860px;">
  21. <div class="static-items-title">
  22. <i class="svg-icon svg-icon-green">
  23. <svg-icon :svgid="'svg-flash'" />
  24. </i>
  25. 理论电量平衡分析法
  26. </div>
  27. <div class="items">
  28. <div class="item" v-for="(item, index) of analyselist" :key="index">
  29. <div class="title">{{item.name}}</div>
  30. <div class="value">{{item.actual}}%</div>
  31. <div class="up-down">
  32. <div class="up-down-item">
  33. <span class="name">环</span>
  34. <span class="icon">
  35. <i class="svg-icon svg-icon-sm" :class="item.mom >= 0 ? 'svg-icon-green' : 'svg-icon-yellow'">
  36. <svg-icon :svgid="item.mom >= 0 ? 'svg-arrow-up-1' : 'svg-arrow-dpwn-1'" />
  37. </i>
  38. </span>
  39. <span class="value">{{item.mom}}%</span>
  40. </div>
  41. <div class="up-down-item">
  42. <span class="name">同</span>
  43. <span class="icon">
  44. <i class="svg-icon svg-icon-sm " :class="item.yoy >= 0 ? 'svg-icon-green' : 'svg-icon-yellow'">
  45. <svg-icon :svgid="item.yoy >= 0 ? 'svg-arrow-up-1' : 'svg-arrow-dpwn-1'" />
  46. </i>
  47. </span>
  48. <span class="value">{{item.yoy}}%</span>
  49. </div>
  50. </div>
  51. <div class="percent">
  52. <div class="percent-box">
  53. <div class="percent-bar" :style="{width:Math.abs(item.expect)+'%'}" :class="item.expect >= 0 ? 'bg-green' : 'bg-yellow'"></div>
  54. <div class="sj" :style="{'margin-left': Math.abs(item.expect)-4 + '%'}" :class="item.expect >= 0 ? 'sj' : 'yj'"></div>
  55. </div>
  56. <div class="value">{{item.expect}}%</div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="static-items" style="flex:0 0 430px;">
  62. <div class="static-items-title">
  63. <i class="svg-icon svg-icon-green">
  64. <svg-icon :svgid="'svg-flash'" />
  65. </i>
  66. 管理效率指标
  67. </div>
  68. <div class="items">
  69. <div class="item" v-for="(item, index) of managelist" :key="index">
  70. <div class="title">{{item.name}}</div>
  71. <div class="value">{{item.actual}}%</div>
  72. <div class="up-down">
  73. <div class="up-down-item">
  74. <span class="name">环</span>
  75. <span class="icon">
  76. <i class="svg-icon svg-icon-sm" :class="item.mom >= 0 ? 'svg-icon-green' : 'svg-icon-yellow'">
  77. <svg-icon :svgid="item.mom >= 0 ? 'svg-arrow-up-1' : 'svg-arrow-dpwn-1'" />
  78. </i>
  79. </span>
  80. <span class="value">{{item.mom}}%</span>
  81. </div>
  82. <div class="up-down-item">
  83. <span class="name">同</span>
  84. <span class="icon">
  85. <i class="svg-icon svg-icon-sm " :class="item.yoy >= 0 ? 'svg-icon-green' : 'svg-icon-yellow'">
  86. <svg-icon :svgid="item.yoy >= 0 ? 'svg-arrow-up-1' : 'svg-arrow-dpwn-1'" />
  87. </i>
  88. </span>
  89. <span class="value">{{item.yoy}}%</span>
  90. </div>
  91. </div>
  92. <div class="percent">
  93. <div class="percent-box">
  94. <div class="percent-bar" :style="{width:Math.abs(item.expect)+'%'}" :class="item.expect >= 0 ? 'bg-green' : 'bg-yellow'"></div>
  95. <div class="sj" :style="{'margin-left': Math.abs(item.expect)-4 + '%'}" :class="item.expect >= 0 ? 'sj' : 'yj'"></div>
  96. </div>
  97. <div class="value">{{item.expect}}%</div>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. <div class="static-items" style="flex:0 0 430px;">
  103. <div class="static-items-title">
  104. <i class="svg-icon svg-icon-green">
  105. <svg-icon :svgid="'svg-flash'" />
  106. </i>
  107. 其它经济性指标
  108. </div>
  109. <div class="items">
  110. <div class="item" v-for="(item, index) of economiclist" :key="index">
  111. <div class="title">{{item.name}}</div>
  112. <div class="value">{{item.actual}}%</div>
  113. <div class="up-down">
  114. <div class="up-down-item">
  115. <span class="name">环</span>
  116. <span class="icon">
  117. <i class="svg-icon svg-icon-sm" :class="item.mom >= 0 ? 'svg-icon-green' : 'svg-icon-yellow'">
  118. <svg-icon :svgid="item.mom >= 0 ? 'svg-arrow-up-1' : 'svg-arrow-dpwn-1'" />
  119. </i>
  120. </span>
  121. <span class="value">{{item.mom}}%</span>
  122. </div>
  123. <div class="up-down-item">
  124. <span class="name">同</span>
  125. <span class="icon">
  126. <i class="svg-icon svg-icon-sm " :class="item.yoy >= 0 ? 'svg-icon-green' : 'svg-icon-yellow'">
  127. <svg-icon :svgid="item.yoy >= 0 ? 'svg-arrow-up-1' : 'svg-arrow-dpwn-1'" />
  128. </i>
  129. </span>
  130. <span class="value">{{item.yoy}}%</span>
  131. </div>
  132. </div>
  133. <div class="percent">
  134. <div class="percent-box">
  135. <div class="percent-bar" :style="{width:Math.abs(item.expect)+'%'}" :class="item.expect >= 0 ? 'bg-green' : 'bg-yellow'"></div>
  136. <div class="sj" :style="{'margin-left': Math.abs(item.expect)-4 + '%'}" :class="item.expect >= 0 ? 'sj' : 'yj'"></div>
  137. </div>
  138. <div class="value">{{item.expect}}%</div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="top">
  145. <div class="top-left">
  146. <div class="top-left-header">
  147. <div class="header-left">
  148. <div class="selecttion">
  149. <div class="item" :class="{ active: selecttionIndex == 0 }" @click="selectionClick(0)">日</div>
  150. <div class="item" :class="{ active: selecttionIndex == 1 }" @click="selectionClick(1)">周</div>
  151. <div class="item" :class="{ active: selecttionIndex == 2 }" @click="selectionClick(2)">月</div>
  152. <div class="item" :class="{ active: selecttionIndex == 3 }" @click="selectionClick(3)">季</div>
  153. <div class="item" :class="{ active: selecttionIndex == 4 }" @click="selectionClick(4)">年</div>
  154. </div>
  155. <!-- <div class="query">
  156. <div class="query-items">
  157. <div class="query-item">
  158. <div class="lable">风场:</div>
  159. <div class="search-input">
  160. <el-cascader :options="cascader.options" :props="cascader.props" collapse-tags clearable></el-cascader>
  161. </div>
  162. </div>
  163. </div>
  164. <div class="query-items">
  165. <div class="query-item">
  166. <div class="lable">风场:</div>
  167. <div class="search-input">
  168. <el-cascader :options="cascader.options" :props="cascader.props" collapse-tags clearable></el-cascader>
  169. </div>
  170. </div>
  171. </div>
  172. </div> -->
  173. </div>
  174. <div class="header-right">
  175. <div class="right-btn" :class="{ active: btnIndex == 0 }" @click="rightBtnClick(0)">风电</div>
  176. <!-- <div class="right-btn" :class="{ active: btnIndex == 1 }" @click="rightBtnClick(1)">光伏</div> -->
  177. <span class="right-btn">光伏</span>
  178. </div>
  179. </div>
  180. <group-table :customClass="'table'" :data="eltableData" :height="'290px'" :elPaggingProps='null' @headerClick="headerClick"></group-table>
  181. </div>
  182. <div class="top-right">
  183. <div class="rank-title">
  184. <div class="border top-left"></div>
  185. <div class="border top-right"></div>
  186. <div class="border bottom-left"></div>
  187. <div class="border bottom-right"></div>
  188. 排行榜
  189. </div>
  190. <div class="rank-block"></div>
  191. <group-table :customClass="'rank-table'" :data="greenTable" :height="'290px'" :elPaggingProps='null'>
  192. <template v-slot:rank="scope">
  193. <div class="rank-index" :class="'index-' + scope.row.rank">
  194. {{ scope.row.rank }}
  195. </div>
  196. </template>
  197. </group-table>
  198. </div>
  199. </div>
  200. <div class="bottom">
  201. <panel :title="'指标分析'">
  202. <multiple-bar-chart :list="barData" :height="'calc(100vh - 660px)'" :units="['']" />
  203. </panel>
  204. </div>
  205. </div>
  206. </template>
  207. <script>
  208. import MultipleBarChart from "../../components/chart/bar/multiple-bar-chart.vue";
  209. import SvgIcon from "../../components/coms/icon/svg-icon.vue";
  210. import Panel from "../../components/coms/panel/panel.vue";
  211. import groupTable from "./components/group-table.vue";
  212. export default {
  213. components: { groupTable, Panel, MultipleBarChart, SvgIcon },
  214. data() {
  215. return {
  216. selecttionIndex: 2,
  217. btnIndex: 0,
  218. increasescapacity: 0, //增发电量
  219. analyselist: [ //理论平衡分析法
  220. {name: '风能利用率', label: 'windenergy'},
  221. {name: '非计划检修损失率', label: 'failurelossrate'},
  222. {name: '计划检修损失率', label: 'mainlossrate'},
  223. {name: '限电损失率', label: 'powerlossrate'},
  224. {name: '受累损失率', label: 'daynhcfdl'},
  225. {name: '性能损失率', label: 'performancelossrate'}
  226. ],
  227. managelist: [ //管理效率指标
  228. {name: '复位及时率', label: 'resettimelyrate'},
  229. {name: '状态转换率', label: 'statetransitionrate'},
  230. {name: '消缺及时率', label: 'eliminationrate'},
  231. ],
  232. economiclist: [ //经济指标
  233. {name: '综合厂用电率', label: 'comprehensiverate'},
  234. {name: 'AGC曲线追随率', label: 'agccurvefollowing'},
  235. {name: '风功率预测准确率', label: 'windpoweraccuracy'}
  236. ],
  237. eltableData: {
  238. column: [
  239. {
  240. name: "",
  241. child: [
  242. {
  243. name: "区域公司",
  244. field: "name",
  245. width: 95,
  246. },
  247. {
  248. name: "评分",
  249. field: "mark",
  250. width: 55,
  251. },
  252. ],
  253. },
  254. {
  255. name: "基础指标",
  256. child: [
  257. {
  258. name: "装机容量(MW)",
  259. field: "capacity",
  260. width: 55,
  261. },
  262. {
  263. name: "在运台数(台)",
  264. field: "units",
  265. width: 55,
  266. },
  267. {
  268. name: "理论电量(万kWh)",
  269. field: "theoreticalpower",
  270. width: 70,
  271. },
  272. {
  273. name: "实际发电量(万kWh)",
  274. field: "actualpower",
  275. width: 70,
  276. },
  277. {
  278. name: "故障损失电量(万kWh)",
  279. field: "daynhgzssdl",
  280. width: 65,
  281. },
  282. {
  283. name: "维护损失电量(万kWh)",
  284. field: "daynhwhssdl",
  285. width: 55,
  286. },
  287. {
  288. name: "限电损失电量(万kWh)",
  289. field: "daynhxdssdl",
  290. width: 65,
  291. },
  292. {
  293. name: "受累损失电量(万kWh)",
  294. field: "daynhcfdl",
  295. width: 55,
  296. },
  297. {
  298. name: "性能损失电量(万kWh)",
  299. field: "daynhqfdl",
  300. width: 65,
  301. },
  302. ],
  303. },
  304. {
  305. name: "经济指标",
  306. child: [
  307. {
  308. name: "风能利用率(%)",
  309. field: "windenergy",
  310. width: 55,
  311. },
  312. {
  313. name: "限电损失率(%)",
  314. field: "powerlossrate",
  315. width: 55,
  316. },
  317. {
  318. name: "性能损失率(%)",
  319. field: "performancelossrate",
  320. width: 55,
  321. },
  322. {
  323. name: "综合厂用电率(%)",
  324. field: "comprehensiverate",
  325. width: 55,
  326. },
  327. {
  328. name: "设备利用小时(小时)",
  329. field: "utilizationhours",
  330. width: 55,
  331. },
  332. {
  333. name: "风功率预测准确率(%)",
  334. field: "windpoweraccuracy",
  335. width: 55,
  336. },
  337. {
  338. name: "AGC曲线跟随率(%)",
  339. field: "agccurvefollowing",
  340. width: 55,
  341. },
  342. ],
  343. },
  344. {
  345. name: "设备指标",
  346. child: [
  347. {
  348. name: "MTBF(小时)",
  349. field: "mtbf",
  350. width: 55,
  351. },
  352. {
  353. name: "MTTF(小时)",
  354. field: "mttf",
  355. width: 55,
  356. },
  357. {
  358. name: "设备可利用率 (%)",
  359. field: "availability",
  360. width: 55,
  361. },
  362. {
  363. name: "等效可用系数 (%)",
  364. field: "availabilityfactor",
  365. width: 55,
  366. },
  367. {
  368. name: "非计划检修损失率(%)",
  369. field: "failurelossrate",
  370. width: 55,
  371. }
  372. ],
  373. },
  374. {
  375. name: "管理效率指标",
  376. child: [
  377. {
  378. name: "计划检修损失率(%)",
  379. field: "mainlossrate",
  380. width: 53,
  381. },
  382. {
  383. name: "MTTR(小时)",
  384. field: "mttr",
  385. width: 53,
  386. },
  387. {
  388. name: "隐患发现准确率(%)",
  389. field: "hiddentimely",
  390. width: 53,
  391. },
  392. {
  393. name: "复位及时率(%)",
  394. field: "resettimelyrate",
  395. width: 53,
  396. },
  397. {
  398. name: "状态转换率(%)",
  399. field: "statetransitionrate",
  400. width: 53,
  401. },
  402. {
  403. name: "消缺及时率(%)",
  404. field: "eliminationrate",
  405. width: 53,
  406. },
  407. ],
  408. },
  409. ],
  410. data: [
  411. ],
  412. },
  413. greenTable: {
  414. column: [
  415. {
  416. name: "排名",
  417. field: "rank",
  418. width: 50,
  419. slot: true,
  420. },
  421. {
  422. name: "名称",
  423. field: "name",
  424. width: 85,
  425. },
  426. {
  427. name: "指标项",
  428. child: [
  429. {
  430. name: "风能利用率(%)",
  431. field: "v1",
  432. width: 60,
  433. },
  434. ],
  435. },
  436. ],
  437. data: [],
  438. },
  439. barData: [
  440. {
  441. title: "日发电量",
  442. value: [
  443. {
  444. text: "石板泉风电场",
  445. value: 1000,
  446. },
  447. {
  448. text: "牛首山风电场",
  449. value: 1200,
  450. },
  451. {
  452. text: "麻黄山风电场",
  453. value: 1200,
  454. },
  455. {
  456. text: "香山风电场",
  457. value: 1200,
  458. },
  459. {
  460. text: "青山风电场",
  461. value: 1200,
  462. },
  463. ],
  464. },
  465. ],
  466. };
  467. },
  468. created() {
  469. this.requestDataTable('月')
  470. this.requestDataTop('月')
  471. },
  472. methods: {
  473. selectionClick(index) {
  474. this.selecttionIndex = index;
  475. switch(index){
  476. case 0:
  477. this.requestDataTable('日')
  478. this.requestDataTop('日')
  479. break;
  480. case 1:
  481. this.requestDataTable('周')
  482. this.requestDataTop('周')
  483. break;
  484. case 2:
  485. this.requestDataTable('月')
  486. this.requestDataTop('月')
  487. break;
  488. case 3:
  489. this.requestDataTable('季')
  490. this.requestDataTop('季')
  491. break;
  492. case 4:
  493. this.requestDataTable('年')
  494. this.requestDataTop('年')
  495. break;
  496. }
  497. },
  498. headerClick(param) {
  499. if (param.col.field != undefined && param.col.name != "区域公司") {
  500. this.setRank(param.col.field, param.col.name);
  501. this.echartData(param.col.field, param.col.name);
  502. }
  503. if (param.col.name == "基础指标")
  504. this.$router.push("/decision/decision1");
  505. },
  506. rightBtnClick(index) {
  507. this.btnIndex = index;
  508. },
  509. // 表格数据
  510. requestDataTable(timetype){
  511. let that = this;
  512. this.API.requestData({
  513. method: "GET",
  514. baseURL: "http://10.155.32.4:9001/",
  515. subUrl: "benchmarking/dbmainbottom",
  516. data: {
  517. timetype: timetype,
  518. foreigntype: '风电'
  519. },
  520. success(res) {
  521. if (res.code == 200) {
  522. res.data.forEach(item => {
  523. if (item.foreignkeyid === 'SBQ_FDC')
  524. item.name = "石板泉风电场";
  525. if (item.foreignkeyid === 'MHS_FDC')
  526. item.name = "麻黄山风电场";
  527. if (item.foreignkeyid === 'NSS_FDC')
  528. item.name = "牛首山风电场";
  529. if (item.foreignkeyid === 'XS_FDC')
  530. item.name = "香山风电场";
  531. if (item.foreignkeyid === 'QS_FDC')
  532. item.name = "青山风电场";
  533. item.mark = that.filter(item.mark);
  534. item.theoreticalpower = that.filter(item.theoreticalpower);
  535. item.actualpower = that.filter(item.actualpower);
  536. item.daynhgzssdl = that.filter(item.daynhgzssdl);
  537. item.daynhwhssdl = that.filter(item.daynhwhssdl);
  538. item.daynhxdssdl = that.filter(item.daynhxdssdl);
  539. item.daynhcfdl = that.filter(item.daynhcfdl);
  540. item.daynhqfdl = that.filter(item.daynhqfdl);
  541. item.windenergy = that.filter(item.windenergy);
  542. item.powerlossrate = that.filter(item.powerlossrate);
  543. item.performancelossrate = that.filter(item.performancelossrate);
  544. item.comprehensiverate = that.filter(Math.random() * 3);
  545. item.utilizationhours = that.filter(item.utilizationhours);
  546. item.windpoweraccuracy = that.filter(item.windpoweraccuracy);
  547. item.agccurvefollowing = that.filter(item.agccurvefollowing);
  548. item.mtbf = that.filter(item.mtbf);
  549. item.mttf = that.filter(item.mttf);
  550. item.availability = that.filter(item.availability);
  551. item.availabilityfactor = that.filter(item.availabilityfactor);
  552. item.failurelossrate = that.filter(item.failurelossrate);
  553. item.mainlossrate = that.filter(item.mainlossrate);
  554. item.mttr = that.filter(item.mttr);
  555. item.hiddentimely = that.filter(item.hiddentimely);
  556. item.resettimelyrate = that.filter(item.resettimelyrate);
  557. item.statetransitionrate = that.filter(item.statetransitionrate);
  558. item.eliminationrate = that.filter(item.eliminationrate);
  559. })
  560. that.eltableData.data = res.data;
  561. that.setRank();
  562. that.echartData();
  563. }
  564. },
  565. });
  566. },
  567. // 顶部数据
  568. requestDataTop(timetype){
  569. let that = this;
  570. this.API.requestData({
  571. method: "GET",
  572. baseURL: "http://10.155.32.4:9001/",
  573. subUrl: "benchmarking/dbmaintop",
  574. data: {
  575. timetype: timetype,
  576. foreigntype: '风电'
  577. },
  578. success(res) {
  579. if(res.code == 200) that.calculate(res.data)
  580. },
  581. });
  582. },
  583. // 左边的排序
  584. setRank(column, name) {
  585. if (column == undefined) {
  586. column = "actualpower";
  587. name = "实际发电量";
  588. }
  589. this.greenTable.data = [];
  590. let datas = Object.assign([], this.eltableData.data);
  591. let array = datas.sort(this.compare(column));
  592. for (var i = 0; i < array.length; i++) {
  593. let obj = {
  594. rank: i + 1,
  595. name: array[i].name,
  596. v1: array[i][column],
  597. };
  598. this.greenTable.data[i] = obj;
  599. }
  600. this.greenTable.column[2].child[0].name = name;
  601. },
  602. // 下面的echart图
  603. echartData(column, name) {
  604. if (column == undefined) {
  605. column = "actualpower";
  606. name = "实际发电量";
  607. }
  608. let barData = [
  609. {
  610. title: name,
  611. value: [],
  612. },
  613. ];
  614. this.barData = barData;
  615. let count = this.eltableData.data.length;
  616. for (var i = 0; i < count; i++) {
  617. let obj = {
  618. text: this.eltableData.data[i].name,
  619. value: this.eltableData.data[i][column],
  620. };
  621. this.barData[0].value.push(obj);
  622. }
  623. this.barData[0].title = name;
  624. },
  625. // 对象排序
  626. compare(prop) {
  627. return function (obj1, obj2) {
  628. var val1 = obj1[prop];
  629. var val2 = obj2[prop];
  630. if (!isNaN(Number(val1)) && !isNaN(Number(val2))) {
  631. val1 = Number(val1);
  632. val2 = Number(val2);
  633. }
  634. return val1 > val2 ? -1 : val1 < val2 ? 1 : 0;
  635. };
  636. },
  637. // 同比环比计算
  638. calculate(array){
  639. let shiji = {};
  640. let huanbi = {};
  641. let tongbi = {};
  642. let jizhun = {};
  643. array.forEach(item => {
  644. if (item.foreignkeyid === '实际')
  645. shiji = item;
  646. if (item.foreignkeyid === '环比')
  647. huanbi = item;
  648. if (item.foreignkeyid === '同比')
  649. tongbi = item;
  650. if (item.foreignkeyid === '基准')
  651. jizhun = item;
  652. })
  653. this.increasescapacity = Math.abs(this.filter(jizhun.actualpower - shiji.actualpower));
  654. // 理论电量平衡分析
  655. for (let item of this.analyselist){
  656. let key = item.label;
  657. item.actual = this.filter(shiji[key]),
  658. item.mom = this.filter(shiji[key] - huanbi[key]), //环比
  659. item.yoy = this.filter(shiji[key] - tongbi[key]), //同比
  660. item.expect = this.filter(shiji[key] - jizhun[key])
  661. }
  662. // 管理效率指标
  663. for (let item of this.managelist){
  664. let key = item.label;
  665. item.actual = this.filter(shiji[key]),
  666. item.mom = this.filter(shiji[key] - huanbi[key]), //环比
  667. item.yoy = this.filter(shiji[key] - tongbi[key]), //同比
  668. item.expect = this.filter(shiji[key] - jizhun[key])
  669. }
  670. // 经济指标
  671. for (let item of this.economiclist){
  672. let key = item.label;
  673. if (key === 'comprehensiverate')
  674. {
  675. item.actual = this.filter(Math.random() * 3)
  676. item.mom = this.filter(Math.random() * 3), //环比
  677. item.yoy = this.filter(Math.random() * 3), //同比
  678. item.expect = this.filter(Math.random() * 3)
  679. }else{
  680. item.actual = this.filter(shiji[key]),
  681. item.mom = this.filter(shiji[key] - huanbi[key]), //环比
  682. item.yoy = this.filter(shiji[key] - tongbi[key]), //同比
  683. item.expect = this.filter(shiji[key] - jizhun[key])
  684. }
  685. }
  686. },
  687. // 保留小数位
  688. filter(num){
  689. return num%1 === 0 ? num : num.toFixed(1);
  690. }
  691. },
  692. };
  693. </script>
  694. <style lang="less">
  695. .power-benchmarking-page {
  696. .static {
  697. display: flex;
  698. height: 162px;
  699. margin-bottom: 8px;
  700. .static-main {
  701. position: relative;
  702. flex: 0 0 150px;
  703. height: 162px;
  704. border: 1px solid fade(@green, 60);
  705. padding: 8px;
  706. background: fade(@gray, 20);
  707. margin-right: 8px;
  708. .dot {
  709. position: absolute;
  710. width: 3px;
  711. height: 3px;
  712. background: @green;
  713. &.top-left {
  714. top: 5px;
  715. left: 5px;
  716. }
  717. &.bottom-left {
  718. bottom: 5px;
  719. left: 5px;
  720. }
  721. &.top-rignt {
  722. top: 5px;
  723. right: 5px;
  724. }
  725. &.bottom-right {
  726. bottom: 5px;
  727. right: 5px;
  728. }
  729. }
  730. .icon {
  731. height: 40px;
  732. margin: 8px 0;
  733. display: flex;
  734. justify-content: center;
  735. i {
  736. width: 36px;
  737. height: 36px;
  738. padding: 2px;
  739. background: @green;
  740. border-radius: 100%;
  741. border: 4px solid @gray;
  742. svg {
  743. width: 24px;
  744. height: 24px;
  745. use {
  746. fill: #000;
  747. }
  748. }
  749. }
  750. }
  751. .info {
  752. text-align: center;
  753. .title {
  754. font-size: 18px;
  755. margin-bottom: 12px;
  756. }
  757. .value {
  758. font-size: 18px;
  759. color: @green;
  760. margin-bottom: 4px;
  761. }
  762. .unit {
  763. padding: 0 8px;
  764. text-align: right;
  765. }
  766. }
  767. }
  768. .static-items {
  769. border: 1px solid fade(@gray, 60);
  770. margin-right: 8px;
  771. .static-items-title {
  772. text-align: center;
  773. line-height: 27px;
  774. height: 27px;
  775. display: flex;
  776. justify-content: center;
  777. align-items: center;
  778. color: @green;
  779. }
  780. .items {
  781. display: flex;
  782. justify-content: space-between;
  783. .item {
  784. // flex: 0 0 138px;
  785. width: 136px;
  786. height: 133px;
  787. margin-left: 8px;
  788. background: fade(@gray, 20);
  789. text-align: center;
  790. padding: 8px;
  791. & > .title {
  792. font-size: 14px;
  793. color: @gray-l;
  794. }
  795. & > .value {
  796. font-family: @font-family-num;
  797. margin: 8px 0;
  798. }
  799. & > .up-down {
  800. display: flex;
  801. justify-content: space-around;
  802. margin: 15px 0;
  803. font-size: xx-small;
  804. .up-down-item {
  805. flex: 1 0 auto;
  806. display: flex;
  807. align-items: center;
  808. justify-content: space-around;
  809. }
  810. }
  811. & > .percent {
  812. display: flex;
  813. .percent-box {
  814. position: relative;
  815. height: 10px;
  816. border: 1px solid @gray;
  817. margin-right: 8px;
  818. width: calc(100% - 38px);
  819. padding: 2px;
  820. margin-top: 2px;
  821. font-size: xx-small;
  822. .percent-bar {
  823. height: 4px;
  824. }
  825. .sj {
  826. // position: absolute;
  827. border-style: solid;
  828. border-width: 5px 3px 5px 3px;
  829. border-color: transparent transparent @green transparent;
  830. width: 0px;
  831. height: 0px;
  832. top: 8px;
  833. }
  834. .yj {
  835. // position: absolute;
  836. border-style: solid;
  837. border-width: 5px 3px 5px 3px;
  838. border-color: transparent transparent @yellow transparent;
  839. width: 0px;
  840. height: 0px;
  841. top: 8px;
  842. }
  843. }
  844. }
  845. &:first-child {
  846. margin-left: 0px;
  847. }
  848. }
  849. }
  850. &:last-child {
  851. margin-right: 0px;
  852. }
  853. }
  854. }
  855. .top {
  856. display: flex;
  857. margin-bottom: 16px;
  858. .top-left {
  859. flex: 1 0 auto;
  860. .top-left-header {
  861. display: flex;
  862. justify-content: space-between;
  863. margin-bottom: 16px;
  864. .header-left {
  865. display: flex;
  866. .selecttion {
  867. flex: 1 0 250px;
  868. width: 250px;
  869. display: flex;
  870. .item {
  871. flex: 0 0 44px;
  872. height: 28px;
  873. line-height: 28px;
  874. text-align: center;
  875. border: 1px solid @gray;
  876. margin-right: 8px;
  877. font-size: 14px;
  878. color: @gray;
  879. cursor: pointer;
  880. &.active,
  881. &:hover {
  882. background: fade(@purple, 60);
  883. color: @white;
  884. }
  885. }
  886. }
  887. }
  888. .header-right {
  889. display: flex;
  890. margin-right: 12px;
  891. & > div {
  892. width: 84px;
  893. height: 28px;
  894. line-height: 28px;
  895. border: 1px solid @gray;
  896. text-align: center;
  897. color: @gray;
  898. font-size: 14px;
  899. cursor: pointer;
  900. &:first-child {
  901. border-top-left-radius: 16px;
  902. border-bottom-left-radius: 16px;
  903. }
  904. &:last-child {
  905. border-top-right-radius: 16px;
  906. border-bottom-right-radius: 16px;
  907. }
  908. &.active,
  909. &:hover {
  910. background: fade(@green, 20);
  911. border-color: @green;
  912. color: @green;
  913. }
  914. }
  915. & > span {
  916. width: 84px;
  917. height: 28px;
  918. line-height: 28px;
  919. border: 1px solid @gray;
  920. text-align: center;
  921. color: @gray;
  922. font-size: 14px;
  923. cursor: no-drop;
  924. &:first-child {
  925. border-top-left-radius: 16px;
  926. border-bottom-left-radius: 16px;
  927. }
  928. &:last-child {
  929. border-top-right-radius: 16px;
  930. border-bottom-right-radius: 16px;
  931. }
  932. }
  933. }
  934. }
  935. .table {
  936. &.el-table thead tr:first-child th {
  937. background: fade(@gray, 40);
  938. border-bottom: 1px solid #0b1010;
  939. border-right: 1px solid #0b1010;
  940. }
  941. &.el-table thead tr:last-child th {
  942. background: fade(@gray, 20);
  943. .cell {
  944. height: 116px;
  945. padding: 12px 6px;
  946. border-right: 1px solid #0b1010;
  947. }
  948. }
  949. }
  950. }
  951. .top-right {
  952. flex: 0 0 200px;
  953. margin-left: 8px;
  954. .rank-title {
  955. position: relative;
  956. height: 28px;
  957. line-height: 28px;
  958. border: 1px solid fade(@green, 40);
  959. text-align: center;
  960. color: @green;
  961. font-size: 14px;
  962. .border {
  963. position: absolute;
  964. width: 8px;
  965. height: 8px;
  966. border: 2px solid fade(@green, 60);
  967. &.top-left {
  968. left: -1px;
  969. top: -1px;
  970. border-right: 0px;
  971. border-bottom: 0px;
  972. }
  973. &.top-right {
  974. top: -1px;
  975. right: -1px;
  976. border-left: 0px;
  977. border-bottom: 0px;
  978. }
  979. &.bottom-left {
  980. bottom: -1px;
  981. left: -1px;
  982. border-right: 0px;
  983. border-top: 0px;
  984. }
  985. &.bottom-right {
  986. bottom: -1px;
  987. right: -1px;
  988. border-left: 0px;
  989. border-top: 0px;
  990. }
  991. }
  992. &::before {
  993. content: " ";
  994. position: absolute;
  995. width: 100%;
  996. height: 100%;
  997. left: 0;
  998. background: linear-gradient(135deg, rgba(5, 187, 76, 0.4), transparent, transparent, transparent, rgba(5, 187, 76, 0.4));
  999. }
  1000. }
  1001. .rank-block {
  1002. height: 8px;
  1003. width: 100%;
  1004. border: 1px solid fade(@green, 40);
  1005. border-left: 0px;
  1006. border-right: 0px;
  1007. background: fade(@green, 20);
  1008. margin: 4px 0;
  1009. opacity: 0.5;
  1010. }
  1011. .rank-table {
  1012. border: 1px solid fade(@green, 40);
  1013. &.el-table.el-table--striped .el-table__body tr.el-table__row--striped td {
  1014. background: fade(@green, 10);
  1015. }
  1016. &.el-table.el-table--striped .el-table__body tr.el-table__row--striped:hover td {
  1017. background: fade(@green, 10) !important;
  1018. }
  1019. .rank-index {
  1020. height: 20px;
  1021. width: 20px;
  1022. line-height: 20px;
  1023. text-align: center;
  1024. margin: auto;
  1025. &.index-1 {
  1026. background: fade(@purple, 60);
  1027. color: #fff;
  1028. border: 1px solid @purple;
  1029. }
  1030. &.index-2 {
  1031. background: fade(#2d6e76, 60);
  1032. color: #fff;
  1033. border: 1px solid #2d6e76;
  1034. }
  1035. &.index-3 {
  1036. background: fade(#366626, 60);
  1037. color: #fff;
  1038. border: 1px solid #366626;
  1039. }
  1040. }
  1041. &.el-table thead tr th {
  1042. background: fade(@green, 10);
  1043. border-bottom: 1px solid #0b1010;
  1044. border-right: 1px solid #0b1010;
  1045. height: 116px;
  1046. }
  1047. &.el-table thead tr:first-child th:last-child {
  1048. background: fade(@green, 20);
  1049. border-bottom: 1px solid #0b1010;
  1050. border-right: 1px solid #0b1010;
  1051. height: 30px;
  1052. }
  1053. }
  1054. }
  1055. }
  1056. .bottom {
  1057. height: 400px;
  1058. }
  1059. }
  1060. </style>