1
0

index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. <template>
  2. <div class="stationControl">
  3. <div class="stationControl_top">
  4. <el-select
  5. size="mini"
  6. v-model="tabIndex"
  7. placeholder="请选择"
  8. clearable
  9. @change="getTableData"
  10. >
  11. <el-option
  12. v-for="item in tabOptions"
  13. :key="item.id"
  14. :label="item.name"
  15. :value="item.id"
  16. >
  17. </el-option>
  18. </el-select>
  19. <div class="station">
  20. 时间:
  21. <div class="">
  22. <el-date-picker
  23. size="mini"
  24. v-model="pickerTime"
  25. type="month"
  26. value-format="YYYY-MM"
  27. placeholder="选择年月"
  28. popper-class="date-select"
  29. >
  30. </el-date-picker>
  31. </div>
  32. </div>
  33. <div class="but">
  34. <el-button
  35. round
  36. size="mini"
  37. class="buttons sousuo"
  38. @click="getTableData"
  39. >搜索</el-button
  40. >
  41. <el-button round size="mini" class="buttons" @click="downXlsxFn"
  42. >导出</el-button
  43. >
  44. </div>
  45. </div>
  46. <div
  47. style="
  48. background: rgba(0, 0, 0, 0.4);
  49. height: calc(100% - 43px);
  50. padding-bottom: 15px;
  51. "
  52. >
  53. <div class="stationControl_title clearfix">
  54. <div class="leftContent floatLeft">
  55. <span>{{ tabIndex == -1 ? "风场" : "电站" }}管控KPI</span>
  56. </div>
  57. </div>
  58. <div class="economicTable1">
  59. <el-table
  60. :data="stationControlData"
  61. stripe
  62. size="mini"
  63. height="calc(100% - 40px - 20px)"
  64. ref="stationControl_table"
  65. style="width: 100%"
  66. border
  67. >
  68. <el-table-column
  69. prop="stationName"
  70. label="场站"
  71. align="center"
  72. show-overflow-tooltip
  73. />
  74. <el-table-column
  75. prop="years"
  76. label="年份"
  77. align="center"
  78. width="58"
  79. show-overflow-tooltip
  80. />
  81. <el-table-column
  82. prop="month"
  83. label="月份"
  84. align="center"
  85. width="58"
  86. show-overflow-tooltip
  87. />
  88. <el-table-column
  89. v-for="(item, index) in tableHeader"
  90. :key="index"
  91. :label="item.title"
  92. align="center"
  93. >
  94. <el-table-column
  95. v-for="(subItem, subIndex) in tabIndex == -1 ? item.children : item.childrenG ? item.childrenG : item.children"
  96. :key="subIndex"
  97. :prop="subItem.code"
  98. :label="subItem.title"
  99. align="center"
  100. show-overflow-tooltip
  101. >
  102. <el-table-column
  103. v-for="(thiItem, thiIndex) in subItem.children"
  104. :key="thiIndex"
  105. sortable
  106. width="45"
  107. :prop="thiItem.code"
  108. :label="thiItem.title"
  109. align="center"
  110. show-overflow-tooltip
  111. >
  112. </el-table-column>
  113. </el-table-column>
  114. </el-table-column>
  115. <el-table-column
  116. prop="remark"
  117. label="总评分"
  118. align="center"
  119. width="40"
  120. show-overflow-tooltip
  121. />
  122. </el-table>
  123. <el-pagination
  124. @size-change="handleSizeChange"
  125. @current-change="handleCurrentChange"
  126. :current-page="page.currentPage"
  127. :page-size="page.pagesize"
  128. layout="total, prev, pager, next, jumper"
  129. :total="page.total"
  130. >
  131. </el-pagination>
  132. </div>
  133. </div>
  134. </div>
  135. </template>
  136. <script>
  137. import utils from "@/utills/downXlsx";
  138. import dayjs from "dayjs";
  139. import { stationKPI, stationXklKPI } from "@/api/kpiApi/index.js";
  140. export default {
  141. name: "stationControl", //场站管控KPI
  142. components: {},
  143. data() {
  144. return {
  145. stationVal: "",
  146. stationOptions: [],
  147. pickerTime: "",
  148. stationControlData: [],
  149. tabIndex: -1,
  150. tabOptions: [
  151. { id: -1, name: "风电" },
  152. { id: -2, name: "光伏" },
  153. ],
  154. tableHeader: [
  155. {
  156. title: "安全指标",
  157. children: [
  158. {
  159. title: "人身、设备事故",
  160. children: [
  161. { title: "值(次)", code: "rssbsg_value" },
  162. { title: "评分", code: "rssbsg_mark" },
  163. ],
  164. },
  165. {
  166. title: "设备一类障碍",
  167. children: [
  168. { title: "值(次)", code: "sbylza_value" },
  169. { title: "评分", code: "sbylza_mark" },
  170. ],
  171. },
  172. ],
  173. },
  174. {
  175. title: "生产效率指标",
  176. children: [
  177. {
  178. title: "风能利用率",
  179. children: [
  180. { title: "值(%)", code: "fnlyl_value" },
  181. { title: "评分", code: "fnlyl_mark" },
  182. ],
  183. },
  184. {
  185. title: "计划检修损失率",
  186. children: [
  187. { title: "值(%)", code: "jhjxssl_value" },
  188. { title: "评分", code: "jhjxssl_mark" },
  189. ],
  190. },
  191. {
  192. title: "非计划检修损失率",
  193. children: [
  194. { title: "值(%)", code: "fjhjxssl_value" },
  195. { title: "评分", code: "fjhjxssl_mark" },
  196. ],
  197. },
  198. {
  199. title: "限电损失率",
  200. children: [
  201. { title: "值(%)", code: "xdssl_value" },
  202. { title: "评分", code: "xdssl_mark" },
  203. ],
  204. },
  205. {
  206. title: "性能损失率",
  207. children: [
  208. { title: "值(%)", code: "xnssl_value" },
  209. { title: "评分", code: "xnssl_mark" },
  210. ],
  211. },
  212. {
  213. title: "复位及时率",
  214. children: [
  215. { title: "值(%)", code: "fwjsl_value" },
  216. { title: "评分", code: "fwjsl_mark" },
  217. ],
  218. },
  219. {
  220. title: "状态转换及时率",
  221. children: [
  222. { title: "值(%)", code: "ztzhjsl_value" },
  223. { title: "评分", code: "ztzhjsl_mark" },
  224. ],
  225. },
  226. {
  227. title: "故障处理及时率",
  228. children: [
  229. { title: "值(%)", code: "gzcljsl_value" },
  230. { title: "评分", code: "gzcljsl_mark" },
  231. ],
  232. },
  233. {
  234. title: "MTBF",
  235. children: [
  236. { title: "值(小时)", code: "mtbf_value" },
  237. { title: "评分", code: "mtbf_mark" },
  238. ],
  239. },
  240. {
  241. title: "MTTF",
  242. children: [
  243. { title: "值(小时)", code: "mttf_value" },
  244. { title: "评分", code: "mttf_mark" },
  245. ],
  246. },
  247. {
  248. title: "MTTR",
  249. children: [
  250. { title: "值(小时)", code: "mttr_value" },
  251. { title: "评分", code: "mttr_mark" },
  252. ],
  253. },
  254. ],
  255. childrenG: [
  256. {
  257. title: "光能利用率",
  258. children: [
  259. { title: "值(%)", code: "gnlyl_value" },
  260. { title: "评分", code: "gnlyl_mark" },
  261. ],
  262. },
  263. {
  264. title: "计划检修损失率",
  265. children: [
  266. { title: "值(%)", code: "jhjxssl_value" },
  267. { title: "评分", code: "jhjxssl_mark" },
  268. ],
  269. },
  270. {
  271. title: "非计划检修损失率",
  272. children: [
  273. { title: "值(%)", code: "fjhjxssl_value" },
  274. { title: "评分", code: "fjhjxssl_mark" },
  275. ],
  276. },
  277. {
  278. title: "限电损失率",
  279. children: [
  280. { title: "值(%)", code: "xdssl_value" },
  281. { title: "评分", code: "xdssl_mark" },
  282. ],
  283. },
  284. {
  285. title: "性能损失率",
  286. children: [
  287. { title: "值(%)", code: "xnssl_value" },
  288. { title: "评分", code: "xnssl_mark" },
  289. ],
  290. },
  291. {
  292. title: "复位及时率",
  293. children: [
  294. { title: "值(%)", code: "fwjsl_value" },
  295. { title: "评分", code: "fwjsl_mark" },
  296. ],
  297. },
  298. {
  299. title: "状态转换及时率",
  300. children: [
  301. { title: "值(%)", code: "ztzhjsl_value" },
  302. { title: "评分", code: "ztzhjsl_mark" },
  303. ],
  304. },
  305. {
  306. title: "故障处理及时率",
  307. children: [
  308. { title: "值(%)", code: "gzcljsl_value" },
  309. { title: "评分", code: "gzcljsl_mark" },
  310. ],
  311. },
  312. {
  313. title: "MTBF",
  314. children: [
  315. { title: "值(小时)", code: "mtbf_value" },
  316. { title: "评分", code: "mtbf_mark" },
  317. ],
  318. },
  319. {
  320. title: "MTTF",
  321. children: [
  322. { title: "值(小时)", code: "mttf_value" },
  323. { title: "评分", code: "mttf_mark" },
  324. ],
  325. },
  326. {
  327. title: "MTTR",
  328. children: [
  329. { title: "值(小时)", code: "mttr_value" },
  330. { title: "评分", code: "mttr_mark" },
  331. ],
  332. },
  333. ],
  334. },
  335. {
  336. title: "综合分析指标",
  337. children: [
  338. {
  339. title: "设备利用小时",
  340. children: [
  341. { title: "值(小时)", code: "sblyxs_value" },
  342. { title: "评分", code: "sblyxs_mark" },
  343. ],
  344. },
  345. {
  346. title: "综合厂用电率",
  347. children: [
  348. { title: "值(%)", code: "zhcydl_value" },
  349. { title: "评分", code: "zhcydl_mark" },
  350. ],
  351. },
  352. {
  353. title: "设备可利用率",
  354. children: [
  355. { title: "值(%)", code: "sbklyl_value" },
  356. { title: "评分", code: "sbklyl_mark" },
  357. ],
  358. },
  359. {
  360. title: "等效可用系数",
  361. children: [
  362. { title: "值(%)", code: "dxkyxs_value" },
  363. { title: "评分", code: "dxkyxs_mark" },
  364. ],
  365. },
  366. {
  367. title: "隐患发现准确率",
  368. children: [
  369. { title: "值(%)", code: "yhfxzql_value" },
  370. { title: "评分", code: "yhfxzql_mark" },
  371. ],
  372. },
  373. {
  374. title: "风功率预测准确率",
  375. children: [
  376. { title: "值(%)", code: "fglyczql_value" },
  377. { title: "评分", code: "fglyczql_mark" },
  378. ],
  379. },
  380. ],
  381. childrenG: [
  382. {
  383. title: "设备利用小时",
  384. children: [
  385. { title: "值(小时)", code: "sblyxs_value" },
  386. { title: "评分", code: "sblyxs_mark" },
  387. ],
  388. },
  389. {
  390. title: "综合厂用电率",
  391. children: [
  392. { title: "值(%)", code: "zhcydl_value" },
  393. { title: "评分", code: "zhcydl_mark" },
  394. ],
  395. },
  396. {
  397. title: "设备可利用率",
  398. children: [
  399. { title: "值(%)", code: "sbklyl_value" },
  400. { title: "评分", code: "sbklyl_mark" },
  401. ],
  402. },
  403. {
  404. title: "等效可用系数",
  405. children: [
  406. { title: "值(%)", code: "dxkyxs_value" },
  407. { title: "评分", code: "dxkyxs_mark" },
  408. ],
  409. },
  410. {
  411. title: "隐患发现准确率",
  412. children: [
  413. { title: "值(%)", code: "yhfxzql_value" },
  414. { title: "评分", code: "yhfxzql_mark" },
  415. ],
  416. },
  417. {
  418. title: "光功率预测准确率",
  419. children: [
  420. { title: "值(%)", code: "gglyczql_value" },
  421. { title: "评分", code: "gglyczql_mark" },
  422. ],
  423. },
  424. ],
  425. },
  426. {
  427. title: "自然环境影响指标",
  428. children: [
  429. {
  430. title: "平均风速",
  431. children: [
  432. { title: "值(m/s)", code: "pjfs_value" },
  433. { title: "评分", code: "pjfs_mark" },
  434. ],
  435. },
  436. {
  437. title: "静风频率",
  438. children: [
  439. { title: "值(%)", code: "jfpl_value" },
  440. { title: "评分", code: "jfpl_mark" },
  441. ],
  442. },
  443. {
  444. title: "有效风时率",
  445. children: [
  446. { title: "值(%)", code: "yxfsl_value" },
  447. { title: "评分", code: "yxfsl_mark" },
  448. ],
  449. },
  450. ],
  451. childrenG: [
  452. {
  453. title: "累计辐射总量",
  454. children: [
  455. { title: "值(兆焦/平米)", code: "ljfszl_value" },
  456. { title: "评分", code: "ljfszl_mark" },
  457. ],
  458. },
  459. ],
  460. },
  461. ],
  462. page: {
  463. pagesize: 21,
  464. currentPage: 1,
  465. total: 0,
  466. },
  467. };
  468. },
  469. created() {
  470. this.pickerTime = dayjs().format("YYYY-MM");
  471. },
  472. mounted() {},
  473. computed: {},
  474. methods: {
  475. handleSizeChange(val) {
  476. this.page.pagesize = val;
  477. this.getTableData();
  478. },
  479. handleCurrentChange(val) {
  480. this.page.currentPage = val;
  481. this.getTableData();
  482. },
  483. getTableData() {
  484. let that = this
  485. let params = {
  486. pageNum: that.page.currentPage,
  487. pageSize: that.page.pagesize,
  488. years: that.pickerTime ? this.pickerTime.substring(0, this.pickerTime.indexOf('-'))*1 : null,
  489. month: that.pickerTime ? this.pickerTime.substring(this.pickerTime.indexOf('-')+1, this.pickerTime.length)*1 : null
  490. }
  491. if (that.tabIndex == -1) {
  492. stationKPI(params).then(res =>{
  493. if (res) {
  494. that.stationControlData = res.data.records
  495. that.page.total = res.data.total
  496. }
  497. })
  498. } else {
  499. stationXklKPI(params).then(res =>{
  500. if (res) {
  501. that.stationControlData = res.data.records
  502. that.page.total = res.data.total
  503. }
  504. })
  505. }
  506. },
  507. downXlsxFn() {
  508. let header = [];
  509. this.tableHeader.forEach((it) => {
  510. if (it.title !== "操作") {
  511. header.push(it.title);
  512. }
  513. });
  514. if (this.stationControlData.length > 0) {
  515. utils.exportExcel(
  516. this.$refs["stationControl_table"].$el,
  517. header,
  518. `${this.pickerTime}${
  519. this.tabIndex == -1 ? "风场" : "电站"
  520. }综合评价KPI`
  521. );
  522. }
  523. },
  524. },
  525. };
  526. </script>
  527. <style lang="less" scoped>
  528. .stationControl {
  529. padding: 0 20px;
  530. height: 100%;
  531. .stationControl_title {
  532. .leftContent {
  533. width: 242px;
  534. height: 41px;
  535. line-height: 41px;
  536. background: url("~@/assets/imgs/title_left_bg1.png") no-repeat;
  537. span {
  538. font-size: 16px;
  539. font-family: Microsoft YaHei;
  540. font-weight: 400;
  541. color: #05bb4c;
  542. margin-left: 25px;
  543. }
  544. }
  545. .floatLeft {
  546. float: left;
  547. }
  548. .floatRight {
  549. float: right;
  550. }
  551. .rightContent {
  552. width: 212px;
  553. height: 28px;
  554. margin-top: 13px;
  555. background: url("../../../../assets/imgs/title_right_bg.png");
  556. }
  557. }
  558. .clearfix::after {
  559. content: "";
  560. clear: both;
  561. height: 0;
  562. line-height: 0;
  563. visibility: hidden;
  564. display: block;
  565. }
  566. .clearfix {
  567. zoom: 1;
  568. }
  569. .stationControl_top {
  570. display: flex;
  571. flex-direction: row;
  572. align-items: center;
  573. margin-top: 10px;
  574. margin-bottom: 10px;
  575. .station {
  576. display: flex;
  577. flex-direction: row;
  578. align-items: center;
  579. font-size: 14px;
  580. font-family: Microsoft YaHei;
  581. font-weight: 400;
  582. color: #b3b3b3;
  583. margin-right: 10px;
  584. margin-left: 10px;
  585. }
  586. .tabCut {
  587. display: inline-block;
  588. margin: 0 10px;
  589. div {
  590. display: inline-block;
  591. width: 60px;
  592. height: 27px;
  593. border: 1px solid #274934;
  594. text-align: center;
  595. line-height: 25px;
  596. cursor: pointer;
  597. }
  598. div:nth-child(1) {
  599. border-radius: 13px 0px 0px 13px;
  600. }
  601. div:nth-child(2) {
  602. border-radius: 0px 13px 13px 0px;
  603. cursor: not-allowed;
  604. }
  605. .active {
  606. background-color: rgba(5, 187, 76, 0.9);
  607. color: #fff;
  608. }
  609. }
  610. .search-input {
  611. margin-left: 10px;
  612. .el-input__inner {
  613. width: 175px;
  614. }
  615. .el-input__suffix {
  616. right: -50px;
  617. }
  618. }
  619. .but {
  620. display: flex;
  621. flex-direction: row;
  622. align-content: center;
  623. margin-left: 20px;
  624. .buttons:nth-child(1) {
  625. background: rgba(5, 187, 76, 0.6);
  626. border: 1px solid #3b6c53;
  627. border-radius: 13px;
  628. color: #fff;
  629. &:hover {
  630. background: rgba(5, 187, 76, 0.9);
  631. border-radius: 13px;
  632. color: #fff;
  633. }
  634. }
  635. .buttons:nth-child(2) {
  636. background: rgba(67, 81, 107, 0.3);
  637. border: 1px solid #3b6c53;
  638. border-radius: 13px;
  639. font-size: 14px;
  640. color: #b3b3b3;
  641. }
  642. }
  643. }
  644. .economicTable1 {
  645. height: calc(100% - 42px);
  646. .el-table ::v-deep {
  647. .el-table__header {
  648. border-collapse: collapse;
  649. }
  650. .el-table__body-wrapper {
  651. .el-table__body {
  652. font-size: 13px;
  653. // border: 1px solid #eceef5;
  654. // border-collapse: collapse;
  655. }
  656. }
  657. th {
  658. height: 20px;
  659. line-height: 20px;
  660. font-size: 14px;
  661. &.el-table__cell {
  662. border: 1px solid rgba(255, 255, 255, 0.8) !important;
  663. &:nth-child(1) {
  664. border-left-width: 0 !important;
  665. // border-left-width: 0 !important;
  666. }
  667. &.is-leaf {
  668. // border-bottom-width: 1px !important;
  669. }
  670. }
  671. }
  672. td {
  673. height: 25px;
  674. line-height: 25px;
  675. font-size: 14px;
  676. &.el-table__cell {
  677. border-bottom: 1px solid #434141 !important;
  678. &:nth-child(1) {
  679. border-left-width: 0 !important;
  680. // border-left-width: 0 !important;
  681. }
  682. &.is-leaf {
  683. // border-bottom-width: 1px !important;
  684. }
  685. }
  686. }
  687. }
  688. .el-pagination {
  689. display: flex;
  690. justify-content: flex-end;
  691. padding-right: 40px;
  692. padding-top: 20px;
  693. .el-pagination__total,
  694. .el-pagination__jump {
  695. color: #fff;
  696. }
  697. }
  698. .el-table__fixed,
  699. .el-table__fixed-right {
  700. background: rgba(0, 0, 0, 1);
  701. border-left: 2px solid #000;
  702. height: calc(100% - 15px) !important;
  703. }
  704. .el-table__fixed::before {
  705. background-color: #2a2a2a;
  706. }
  707. .el-table__fixed-right::before {
  708. background-color: #2a2a2a;
  709. }
  710. }
  711. .el-overlay {
  712. .el-overlay-dialog {
  713. overflow-y: hidden !important;
  714. .el-dialog {
  715. margin-top: 0 !important;
  716. .el-dialog__body {
  717. height: calc(100% - 51px - 32px);
  718. }
  719. }
  720. }
  721. }
  722. .el-picker__popper .el-date-range-picker__header .el-picker-panel__icon-btn {
  723. color: #fff;
  724. }
  725. .el-picker__popper .el-date-table .in-range div {
  726. background: #43516b;
  727. }
  728. }
  729. .historyBtn1 {
  730. cursor: pointer;
  731. color: #05bb4c;
  732. }
  733. </style>