power-benchmarking.vue 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126
  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 :summary="true" :customClass="'table'" :data="eltableData" :height="'310px'" :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="'310px'" :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 - 680px)'" :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/coms/table/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.level == 1) {
  500. console.log(param); // 点击一级标题事件
  501. }
  502. if (param.col.field != undefined && param.col.name != "区域公司") {
  503. this.setRank(param.col.field, param.col.name);
  504. this.echartData(param.col.field, param.col.name);
  505. }
  506. if (param.col.name == "基础指标")
  507. this.$router.push("/decision/decision1");
  508. },
  509. rightBtnClick(index) {
  510. this.btnIndex = index;
  511. },
  512. // 表格数据
  513. requestDataTable(timetype){
  514. let that = this;
  515. this.API.requestData({
  516. method: "GET",
  517. baseURL: "http://10.155.32.4:9001/",
  518. subUrl: "benchmarking/dbmainbottom",
  519. data: {
  520. timetype: timetype,
  521. foreigntype: '风电'
  522. },
  523. success(res) {
  524. if (res.code == 200) {
  525. res.data.forEach(item => {
  526. if (item.foreignkeyid === 'SBQ_FDC')
  527. item.name = "石板泉风电场";
  528. if (item.foreignkeyid === 'MHS_FDC')
  529. item.name = "麻黄山风电场";
  530. if (item.foreignkeyid === 'NSS_FDC')
  531. item.name = "牛首山风电场";
  532. if (item.foreignkeyid === 'XS_FDC')
  533. item.name = "香山风电场";
  534. if (item.foreignkeyid === 'QS_FDC')
  535. item.name = "青山风电场";
  536. item.mark = that.filter(item.mark);
  537. item.theoreticalpower = that.filter(item.theoreticalpower);
  538. item.actualpower = that.filter(item.actualpower);
  539. item.daynhgzssdl = that.filter(item.daynhgzssdl);
  540. item.daynhwhssdl = that.filter(item.daynhwhssdl);
  541. item.daynhxdssdl = that.filter(item.daynhxdssdl);
  542. item.daynhcfdl = that.filter(item.daynhcfdl);
  543. item.daynhqfdl = that.filter(item.daynhqfdl);
  544. item.windenergy = that.filter(item.windenergy);
  545. item.powerlossrate = that.filter(item.powerlossrate);
  546. item.performancelossrate = that.filter(item.performancelossrate);
  547. item.comprehensiverate = that.filter(Math.random() * 3);
  548. item.utilizationhours = that.filter(item.utilizationhours);
  549. item.windpoweraccuracy = that.filter(item.windpoweraccuracy);
  550. item.agccurvefollowing = that.filter(item.agccurvefollowing);
  551. item.mtbf = that.filter(item.mtbf);
  552. item.mttf = that.filter(item.mttf);
  553. item.availability = that.filter(item.availability);
  554. item.availabilityfactor = that.filter(item.availabilityfactor);
  555. item.failurelossrate = that.filter(item.failurelossrate);
  556. item.mainlossrate = that.filter(item.mainlossrate);
  557. item.mttr = that.filter(item.mttr);
  558. item.hiddentimely = that.filter(item.hiddentimely);
  559. item.resettimelyrate = that.filter(item.resettimelyrate);
  560. item.statetransitionrate = that.filter(item.statetransitionrate);
  561. item.eliminationrate = that.filter(item.eliminationrate);
  562. })
  563. that.eltableData.data = res.data;
  564. that.setRank();
  565. that.echartData();
  566. }
  567. },
  568. });
  569. },
  570. // 顶部数据
  571. requestDataTop(timetype){
  572. let that = this;
  573. this.API.requestData({
  574. method: "GET",
  575. baseURL: "http://10.155.32.4:9001/",
  576. subUrl: "benchmarking/dbmaintop",
  577. data: {
  578. timetype: timetype,
  579. foreigntype: '风电'
  580. },
  581. success(res) {
  582. if(res.code == 200) that.calculate(res.data)
  583. },
  584. });
  585. },
  586. // 左边的排序
  587. setRank(column, name) {
  588. if (column == undefined) {
  589. column = "actualpower";
  590. name = "实际发电量";
  591. }
  592. this.greenTable.data = [];
  593. let datas = Object.assign([], this.eltableData.data);
  594. let array = datas.sort(this.compare(column));
  595. for (var i = 0; i < array.length; i++) {
  596. let obj = {
  597. rank: i + 1,
  598. name: array[i].name,
  599. v1: array[i][column],
  600. };
  601. this.greenTable.data[i] = obj;
  602. }
  603. this.greenTable.column[2].child[0].name = name;
  604. },
  605. // 下面的echart图
  606. echartData(column, name) {
  607. if (column == undefined) {
  608. column = "actualpower";
  609. name = "实际发电量";
  610. }
  611. let barData = [
  612. {
  613. title: name,
  614. value: [],
  615. },
  616. ];
  617. this.barData = barData;
  618. let count = this.eltableData.data.length;
  619. for (var i = 0; i < count; i++) {
  620. let obj = {
  621. text: this.eltableData.data[i].name,
  622. value: this.eltableData.data[i][column],
  623. };
  624. this.barData[0].value.push(obj);
  625. }
  626. this.barData[0].title = name;
  627. },
  628. // 对象排序
  629. compare(prop) {
  630. return function (obj1, obj2) {
  631. var val1 = obj1[prop];
  632. var val2 = obj2[prop];
  633. if (!isNaN(Number(val1)) && !isNaN(Number(val2))) {
  634. val1 = Number(val1);
  635. val2 = Number(val2);
  636. }
  637. return val1 > val2 ? -1 : val1 < val2 ? 1 : 0;
  638. };
  639. },
  640. // 同比环比计算
  641. calculate(array){
  642. let shiji = {};
  643. let huanbi = {};
  644. let tongbi = {};
  645. let jizhun = {};
  646. array.forEach(item => {
  647. if (item.foreignkeyid === '实际')
  648. shiji = item;
  649. if (item.foreignkeyid === '环比')
  650. huanbi = item;
  651. if (item.foreignkeyid === '同比')
  652. tongbi = item;
  653. if (item.foreignkeyid === '基准')
  654. jizhun = item;
  655. })
  656. this.increasescapacity = Math.abs(this.filter(jizhun.actualpower - shiji.actualpower));
  657. // 理论电量平衡分析
  658. for (let item of this.analyselist){
  659. let key = item.label;
  660. item.actual = this.filter(shiji[key]),
  661. item.mom = this.filter(shiji[key] - huanbi[key]), //环比
  662. item.yoy = this.filter(shiji[key] - tongbi[key]), //同比
  663. item.expect = this.filter(shiji[key] - jizhun[key])
  664. }
  665. // 管理效率指标
  666. for (let item of this.managelist){
  667. let key = item.label;
  668. item.actual = this.filter(shiji[key]),
  669. item.mom = this.filter(shiji[key] - huanbi[key]), //环比
  670. item.yoy = this.filter(shiji[key] - tongbi[key]), //同比
  671. item.expect = this.filter(shiji[key] - jizhun[key])
  672. }
  673. // 经济指标
  674. for (let item of this.economiclist){
  675. let key = item.label;
  676. if (key === 'comprehensiverate')
  677. {
  678. item.actual = this.filter(Math.random() * 3)
  679. item.mom = this.filter(Math.random() * 3), //环比
  680. item.yoy = this.filter(Math.random() * 3), //同比
  681. item.expect = this.filter(Math.random() * 3)
  682. }else{
  683. item.actual = this.filter(shiji[key]),
  684. item.mom = this.filter(shiji[key] - huanbi[key]), //环比
  685. item.yoy = this.filter(shiji[key] - tongbi[key]), //同比
  686. item.expect = this.filter(shiji[key] - jizhun[key])
  687. }
  688. }
  689. },
  690. // 保留小数位
  691. filter(num){
  692. return num%1 === 0 ? num : num.toFixed(1);
  693. }
  694. },
  695. };
  696. </script>
  697. <style lang="less">
  698. .power-benchmarking-page {
  699. .static {
  700. display: flex;
  701. height: 162px;
  702. margin-bottom: 8px;
  703. .static-main {
  704. position: relative;
  705. flex: 0 0 150px;
  706. height: 162px;
  707. border: 1px solid fade(@green, 60);
  708. padding: 8px;
  709. background: fade(@gray, 20);
  710. margin-right: 8px;
  711. .dot {
  712. position: absolute;
  713. width: 3px;
  714. height: 3px;
  715. background: @green;
  716. &.top-left {
  717. top: 5px;
  718. left: 5px;
  719. }
  720. &.bottom-left {
  721. bottom: 5px;
  722. left: 5px;
  723. }
  724. &.top-rignt {
  725. top: 5px;
  726. right: 5px;
  727. }
  728. &.bottom-right {
  729. bottom: 5px;
  730. right: 5px;
  731. }
  732. }
  733. .icon {
  734. height: 40px;
  735. margin: 8px 0;
  736. display: flex;
  737. justify-content: center;
  738. i {
  739. width: 36px;
  740. height: 36px;
  741. padding: 2px;
  742. background: @green;
  743. border-radius: 100%;
  744. border: 4px solid @gray;
  745. svg {
  746. width: 24px;
  747. height: 24px;
  748. use {
  749. fill: #000;
  750. }
  751. }
  752. }
  753. }
  754. .info {
  755. text-align: center;
  756. .title {
  757. font-size: 18px;
  758. margin-bottom: 12px;
  759. }
  760. .value {
  761. font-size: 18px;
  762. color: @green;
  763. margin-bottom: 4px;
  764. }
  765. .unit {
  766. padding: 0 8px;
  767. text-align: right;
  768. }
  769. }
  770. }
  771. .static-items {
  772. border: 1px solid fade(@gray, 60);
  773. margin-right: 8px;
  774. .static-items-title {
  775. text-align: center;
  776. line-height: 27px;
  777. height: 27px;
  778. display: flex;
  779. justify-content: center;
  780. align-items: center;
  781. color: @green;
  782. }
  783. .items {
  784. display: flex;
  785. justify-content: space-between;
  786. .item {
  787. // flex: 0 0 138px;
  788. width: 136px;
  789. height: 133px;
  790. margin-left: 8px;
  791. background: fade(@gray, 20);
  792. text-align: center;
  793. padding: 8px;
  794. & > .title {
  795. font-size: 14px;
  796. color: @gray-l;
  797. }
  798. & > .value {
  799. font-family: @font-family-num;
  800. margin: 8px 0;
  801. }
  802. & > .up-down {
  803. display: flex;
  804. justify-content: space-around;
  805. margin: 15px 0;
  806. font-size: xx-small;
  807. .up-down-item {
  808. flex: 1 0 auto;
  809. display: flex;
  810. align-items: center;
  811. justify-content: space-around;
  812. }
  813. }
  814. & > .percent {
  815. display: flex;
  816. .percent-box {
  817. position: relative;
  818. height: 10px;
  819. border: 1px solid @gray;
  820. margin-right: 8px;
  821. width: calc(100% - 38px);
  822. padding: 2px;
  823. margin-top: 2px;
  824. font-size: xx-small;
  825. .percent-bar {
  826. height: 4px;
  827. }
  828. .sj {
  829. // position: absolute;
  830. border-style: solid;
  831. border-width: 5px 3px 5px 3px;
  832. border-color: transparent transparent @green transparent;
  833. width: 0px;
  834. height: 0px;
  835. top: 8px;
  836. }
  837. .yj {
  838. // position: absolute;
  839. border-style: solid;
  840. border-width: 5px 3px 5px 3px;
  841. border-color: transparent transparent @yellow transparent;
  842. width: 0px;
  843. height: 0px;
  844. top: 8px;
  845. }
  846. }
  847. }
  848. &:first-child {
  849. margin-left: 0px;
  850. }
  851. }
  852. }
  853. &:last-child {
  854. margin-right: 0px;
  855. }
  856. }
  857. }
  858. .top {
  859. display: flex;
  860. margin-bottom: 16px;
  861. .top-left {
  862. flex: 1 0 auto;
  863. .top-left-header {
  864. display: flex;
  865. justify-content: space-between;
  866. margin-bottom: 16px;
  867. .header-left {
  868. display: flex;
  869. .selecttion {
  870. flex: 1 0 250px;
  871. width: 250px;
  872. display: flex;
  873. .item {
  874. flex: 0 0 44px;
  875. height: 28px;
  876. line-height: 28px;
  877. text-align: center;
  878. border: 1px solid @gray;
  879. margin-right: 8px;
  880. font-size: 14px;
  881. color: @gray;
  882. cursor: pointer;
  883. &.active,
  884. &:hover {
  885. background: fade(@purple, 60);
  886. color: @white;
  887. }
  888. }
  889. }
  890. }
  891. .header-right {
  892. display: flex;
  893. margin-right: 12px;
  894. & > div {
  895. width: 84px;
  896. height: 28px;
  897. line-height: 28px;
  898. border: 1px solid @gray;
  899. text-align: center;
  900. color: @gray;
  901. font-size: 14px;
  902. cursor: pointer;
  903. &:first-child {
  904. border-top-left-radius: 16px;
  905. border-bottom-left-radius: 16px;
  906. }
  907. &:last-child {
  908. border-top-right-radius: 16px;
  909. border-bottom-right-radius: 16px;
  910. }
  911. &.active,
  912. &:hover {
  913. background: fade(@green, 20);
  914. border-color: @green;
  915. color: @green;
  916. }
  917. }
  918. & > span {
  919. width: 84px;
  920. height: 28px;
  921. line-height: 28px;
  922. border: 1px solid @gray;
  923. text-align: center;
  924. color: @gray;
  925. font-size: 14px;
  926. cursor: no-drop;
  927. &:first-child {
  928. border-top-left-radius: 16px;
  929. border-bottom-left-radius: 16px;
  930. }
  931. &:last-child {
  932. border-top-right-radius: 16px;
  933. border-bottom-right-radius: 16px;
  934. }
  935. }
  936. }
  937. }
  938. .table {
  939. &.el-table thead tr:first-child th {
  940. background: fade(@gray, 40);
  941. border-bottom: 1px solid #0b1010;
  942. border-right: 1px solid #0b1010;
  943. }
  944. &.el-table thead tr:last-child th {
  945. background: fade(@gray, 20);
  946. .cell {
  947. height: 116px;
  948. padding: 12px 6px;
  949. border-right: 1px solid #0b1010;
  950. }
  951. }
  952. }
  953. }
  954. .top-right {
  955. flex: 0 0 200px;
  956. margin-left: 8px;
  957. .rank-title {
  958. position: relative;
  959. height: 28px;
  960. line-height: 28px;
  961. border: 1px solid fade(@green, 40);
  962. text-align: center;
  963. color: @green;
  964. font-size: 14px;
  965. .border {
  966. position: absolute;
  967. width: 8px;
  968. height: 8px;
  969. border: 2px solid fade(@green, 60);
  970. &.top-left {
  971. left: -1px;
  972. top: -1px;
  973. border-right: 0px;
  974. border-bottom: 0px;
  975. }
  976. &.top-right {
  977. top: -1px;
  978. right: -1px;
  979. border-left: 0px;
  980. border-bottom: 0px;
  981. }
  982. &.bottom-left {
  983. bottom: -1px;
  984. left: -1px;
  985. border-right: 0px;
  986. border-top: 0px;
  987. }
  988. &.bottom-right {
  989. bottom: -1px;
  990. right: -1px;
  991. border-left: 0px;
  992. border-top: 0px;
  993. }
  994. }
  995. &::before {
  996. content: " ";
  997. position: absolute;
  998. width: 100%;
  999. height: 100%;
  1000. left: 0;
  1001. background: linear-gradient(135deg, rgba(5, 187, 76, 0.4), transparent, transparent, transparent, rgba(5, 187, 76, 0.4));
  1002. }
  1003. }
  1004. .rank-block {
  1005. height: 8px;
  1006. width: 100%;
  1007. border: 1px solid fade(@green, 40);
  1008. border-left: 0px;
  1009. border-right: 0px;
  1010. background: fade(@green, 20);
  1011. margin: 4px 0;
  1012. opacity: 0.5;
  1013. }
  1014. .rank-table {
  1015. border: 1px solid fade(@green, 40);
  1016. &.el-table.el-table--striped .el-table__body tr.el-table__row--striped td {
  1017. background: fade(@green, 10);
  1018. }
  1019. &.el-table.el-table--striped .el-table__body tr.el-table__row--striped:hover td {
  1020. background: fade(@green, 10) !important;
  1021. }
  1022. .rank-index {
  1023. height: 20px;
  1024. width: 20px;
  1025. line-height: 20px;
  1026. text-align: center;
  1027. margin: auto;
  1028. &.index-1 {
  1029. background: fade(@purple, 60);
  1030. color: #fff;
  1031. border: 1px solid @purple;
  1032. }
  1033. &.index-2 {
  1034. background: fade(#2d6e76, 60);
  1035. color: #fff;
  1036. border: 1px solid #2d6e76;
  1037. }
  1038. &.index-3 {
  1039. background: fade(#366626, 60);
  1040. color: #fff;
  1041. border: 1px solid #366626;
  1042. }
  1043. }
  1044. &.el-table thead tr th {
  1045. background: fade(@green, 10);
  1046. border-bottom: 1px solid #0b1010;
  1047. border-right: 1px solid #0b1010;
  1048. height: 116px;
  1049. }
  1050. &.el-table thead tr:first-child th:last-child {
  1051. background: fade(@green, 20);
  1052. border-bottom: 1px solid #0b1010;
  1053. border-right: 1px solid #0b1010;
  1054. height: 30px;
  1055. }
  1056. }
  1057. }
  1058. }
  1059. .bottom {
  1060. height: 400px;
  1061. }
  1062. }
  1063. </style>