index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. <template>
  2. <div class="maintenance">
  3. <div class="maintenance_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="maintenance_title clearfix">
  54. <div class="leftContent floatLeft"><span>检修KPI</span></div>
  55. </div>
  56. <div class="economicTable1">
  57. <el-table
  58. :data="maintenanceData"
  59. stripe
  60. size="mini"
  61. height="calc(100% - 40px - 20px)"
  62. ref="maintenance_table"
  63. style="width: 100%"
  64. border
  65. >
  66. <el-table-column
  67. prop="station"
  68. label="场站"
  69. align="center"
  70. show-overflow-tooltip
  71. />
  72. <el-table-column
  73. prop="yxbz"
  74. label="检修班组"
  75. align="center"
  76. width="60px"
  77. show-overflow-tooltip
  78. />
  79. <el-table-column
  80. prop="year"
  81. label="年份"
  82. align="center"
  83. width="60px"
  84. show-overflow-tooltip
  85. />
  86. <el-table-column
  87. prop="month"
  88. label="月份"
  89. align="center"
  90. width="60px"
  91. show-overflow-tooltip
  92. />
  93. <el-table-column
  94. v-for="(item, index) in tableHeader"
  95. :key="index"
  96. :label="item.title"
  97. align="center"
  98. >
  99. <el-table-column
  100. v-for="(subItem, subIndex) in item.children"
  101. :key="subIndex"
  102. :prop="subItem.code"
  103. :label="subItem.title"
  104. align="center"
  105. show-overflow-tooltip
  106. >
  107. <el-table-column
  108. v-for="(thiItem, thiIndex) in subItem.children"
  109. :key="thiIndex"
  110. sortable
  111. width="63"
  112. :prop="thiItem.code"
  113. :label="thiItem.title"
  114. align="center"
  115. show-overflow-tooltip
  116. >
  117. </el-table-column>
  118. </el-table-column>
  119. </el-table-column>
  120. <el-table-column
  121. prop="score"
  122. label="总评分"
  123. align="center"
  124. width="40px"
  125. show-overflow-tooltip
  126. />
  127. </el-table>
  128. <el-pagination
  129. @size-change="handleSizeChange"
  130. @current-change="handleCurrentChange"
  131. :current-page="page.currentPage"
  132. :page-size="page.pagesize"
  133. layout="total, prev, pager, next, jumper"
  134. :total="page.total"
  135. >
  136. </el-pagination>
  137. </div>
  138. </div>
  139. </div>
  140. </template>
  141. <script>
  142. import {
  143. getApicompanyslist,
  144. getApiwpByCplistlist,
  145. getApioutputSpeedlist,
  146. } from "@/api/monthlyPerformanceAnalysis";
  147. import utils from "@/utills/downXlsx";
  148. import dayjs from "dayjs";
  149. import { GetStationByCompany } from "@/api/factoryMonitor/index.js";
  150. export default {
  151. name: "maintenance", //检修KPI
  152. components: {},
  153. data() {
  154. return {
  155. stationVal: "",
  156. stationOptions: [],
  157. pickerTime: "",
  158. maintenanceData: [...new Array(15)].fill({
  159. id: 1,
  160. station: "右玉小五台风电场",
  161. yxbz: "1组",
  162. year: "2023",
  163. month: "09",
  164. fnlylValue: 1,
  165. fnlylrank: 1,
  166. xdsslValue: 1,
  167. xdsslRank: 1,
  168. xnsslValue: 1,
  169. xnsslRank: 1,
  170. fwjsl: 1,
  171. ztzhl: 1,
  172. qxxd: 1,
  173. qxys: 1,
  174. pjxf: 1,
  175. mttf: 1,
  176. sblyxs: 1,
  177. zhcydl: 1,
  178. yhfxzql: 1,
  179. score: 12,
  180. }),
  181. tabIndex: -1,
  182. tabOptions: [
  183. { id: -1, name: "风电" },
  184. { id: -2, name: "光伏" },
  185. ],
  186. tableHeader: [
  187. {
  188. title: "生产效率指标",
  189. children: [
  190. {
  191. title: "风能利用率",
  192. children: [
  193. { title: "值(%)", code: "fnlylValue" },
  194. { title: "评分", code: "fnlylrank" },
  195. ],
  196. },
  197. {
  198. title: "计划检修损失率",
  199. children: [
  200. { title: "值(%)", code: "xdsslValue" },
  201. { title: "评分", code: "xdsslRank" },
  202. ],
  203. },
  204. {
  205. title: "非计划检修损失率",
  206. children: [
  207. { title: "值(%)", code: "xnsslValue" },
  208. { title: "评分", code: "xnsslRank" },
  209. ],
  210. },
  211. {
  212. title: "缺陷单接单及时率",
  213. children: [
  214. { title: "值(%)", code: "fwjsl" },
  215. { title: "评分", code: "fwjsl" },
  216. ],
  217. },
  218. {
  219. title: "到达消缺地点及时率",
  220. children: [
  221. { title: "值(%)", code: "ztzhl" },
  222. { title: "评分", code: "ztzhl" },
  223. ],
  224. },
  225. {
  226. title: "真实消缺及时率",
  227. children: [
  228. { title: "值(%)", code: "qxxd" },
  229. { title: "评分", code: "qxxd" },
  230. ],
  231. },
  232. {
  233. title: "MTBF",
  234. children: [
  235. { title: "值(小时)", code: "qxys" },
  236. { title: "评分", code: "qxys" },
  237. ],
  238. },
  239. {
  240. title: "MTTR",
  241. children: [
  242. { title: "值(小时)", code: "mttf" },
  243. { title: "评分", code: "mttf" },
  244. ],
  245. },
  246. ],
  247. },
  248. {
  249. title: "综合分析指标",
  250. children: [
  251. {
  252. title: "设备利用小时",
  253. children: [
  254. { title: "值(小时)", code: "sblyxs" },
  255. { title: "评分", code: "sblyxs" },
  256. ],
  257. },
  258. {
  259. title: "设备可利用率",
  260. children: [
  261. { title: "值(%)", code: "zhcydl" },
  262. { title: "评分", code: "zhcydl" },
  263. ],
  264. },
  265. {
  266. title: "等效可用系数",
  267. children: [
  268. { title: "值(%)", code: "yhfxzql" },
  269. { title: "评分", code: "yhfxzql" },
  270. ],
  271. },
  272. {
  273. title: "隐患发现准确率",
  274. children: [
  275. { title: "值(%)", code: "yhfxzql" },
  276. { title: "评分", code: "yhfxzql" },
  277. ],
  278. },
  279. ],
  280. },
  281. ],
  282. page: {
  283. pagesize: 21,
  284. currentPage: 1,
  285. total: 0,
  286. },
  287. };
  288. },
  289. created() {
  290. this.pickerTime = dayjs().format("YYYY-MM");
  291. },
  292. mounted() {},
  293. computed: {},
  294. methods: {
  295. handleSizeChange(val) {
  296. this.page.pagesize = val;
  297. this.getTableData();
  298. },
  299. handleCurrentChange(val) {
  300. this.page.currentPage = val;
  301. this.getTableData();
  302. },
  303. getTableData() {},
  304. downXlsxFn() {
  305. let header = [];
  306. this.tableHeader.forEach((it) => {
  307. if (it.title !== "操作") {
  308. header.push(it.title);
  309. }
  310. });
  311. if (this.maintenanceData.length > 0) {
  312. utils.exportExcel(
  313. this.$refs["maintenance_table"].$el,
  314. header,
  315. `${this.pickerTime}检修评价KPI`
  316. );
  317. }
  318. },
  319. },
  320. };
  321. </script>
  322. <style lang="less" scoped>
  323. .maintenance {
  324. padding: 0 20px;
  325. height: 100%;
  326. .maintenance_title {
  327. .leftContent {
  328. width: 242px;
  329. height: 41px;
  330. line-height: 41px;
  331. background: url("~@/assets/imgs/title_left_bg1.png") no-repeat;
  332. span {
  333. font-size: 16px;
  334. font-family: Microsoft YaHei;
  335. font-weight: 400;
  336. color: #05bb4c;
  337. margin-left: 25px;
  338. }
  339. }
  340. }
  341. .clearfix::after {
  342. content: "";
  343. clear: both;
  344. height: 0;
  345. line-height: 0;
  346. visibility: hidden;
  347. display: block;
  348. }
  349. .clearfix {
  350. zoom: 1;
  351. }
  352. .maintenance_top {
  353. display: flex;
  354. flex-direction: row;
  355. align-items: center;
  356. margin-top: 10px;
  357. margin-bottom: 10px;
  358. .station {
  359. display: flex;
  360. flex-direction: row;
  361. align-items: center;
  362. font-size: 14px;
  363. font-family: Microsoft YaHei;
  364. font-weight: 400;
  365. color: #b3b3b3;
  366. margin-right: 10px;
  367. margin-left: 10px;
  368. }
  369. .tabCut {
  370. display: inline-block;
  371. margin: 0 10px;
  372. div {
  373. display: inline-block;
  374. width: 60px;
  375. height: 27px;
  376. border: 1px solid #274934;
  377. text-align: center;
  378. line-height: 25px;
  379. cursor: pointer;
  380. }
  381. div:nth-child(1) {
  382. border-radius: 13px 0px 0px 13px;
  383. }
  384. div:nth-child(2) {
  385. border-radius: 0px 13px 13px 0px;
  386. cursor: not-allowed;
  387. }
  388. .active {
  389. background-color: rgba(5, 187, 76, 0.9);
  390. color: #fff;
  391. }
  392. }
  393. .search-input {
  394. margin-left: 10px;
  395. .el-input__inner {
  396. width: 175px;
  397. }
  398. .el-input__suffix {
  399. right: -50px;
  400. }
  401. }
  402. .but {
  403. display: flex;
  404. flex-direction: row;
  405. align-content: center;
  406. margin-left: 20px;
  407. .buttons:nth-child(1) {
  408. background: rgba(5, 187, 76, 0.6);
  409. border: 1px solid #3b6c53;
  410. border-radius: 13px;
  411. color: #fff;
  412. &:hover {
  413. background: rgba(5, 187, 76, 0.9);
  414. border-radius: 13px;
  415. color: #fff;
  416. }
  417. }
  418. .buttons:nth-child(2) {
  419. background: rgba(67, 81, 107, 0.3);
  420. border: 1px solid #3b6c53;
  421. border-radius: 13px;
  422. font-size: 14px;
  423. color: #b3b3b3;
  424. }
  425. }
  426. }
  427. .economicTable1 {
  428. height: calc(100% - 42px);
  429. .el-table ::v-deep {
  430. .el-table__header {
  431. border-collapse: collapse;
  432. }
  433. .el-table__body-wrapper {
  434. .el-table__body {
  435. font-size: 13px;
  436. // border: 1px solid #eceef5;
  437. // border-collapse: collapse;
  438. }
  439. }
  440. th {
  441. height: 20px;
  442. line-height: 20px;
  443. font-size: 14px;
  444. &.el-table__cell {
  445. border: 1px solid rgba(255, 255, 255, 0.8) !important;
  446. &:nth-child(1) {
  447. border-left-width: 0 !important;
  448. // border-left-width: 0 !important;
  449. }
  450. &.is-leaf {
  451. // border-bottom-width: 1px !important;
  452. }
  453. }
  454. }
  455. td {
  456. height: 25px;
  457. line-height: 25px;
  458. font-size: 14px;
  459. &.el-table__cell {
  460. border-bottom: 1px solid #434141 !important;
  461. &:nth-child(1) {
  462. border-left-width: 0 !important;
  463. // border-left-width: 0 !important;
  464. }
  465. &.is-leaf {
  466. // border-bottom-width: 1px !important;
  467. }
  468. }
  469. }
  470. }
  471. .el-pagination {
  472. display: flex;
  473. justify-content: flex-end;
  474. padding-right: 40px;
  475. padding-top: 20px;
  476. .el-pagination__total,
  477. .el-pagination__jump {
  478. color: #fff;
  479. }
  480. }
  481. .el-table__fixed,
  482. .el-table__fixed-right {
  483. background: rgba(0, 0, 0, 1);
  484. border-left: 2px solid #000;
  485. height: calc(100% - 15px) !important;
  486. }
  487. .el-table__fixed::before {
  488. background-color: #2a2a2a;
  489. }
  490. .el-table__fixed-right::before {
  491. background-color: #2a2a2a;
  492. }
  493. }
  494. .el-overlay {
  495. .el-overlay-dialog {
  496. overflow-y: hidden !important;
  497. .el-dialog {
  498. margin-top: 0 !important;
  499. .el-dialog__body {
  500. height: calc(100% - 51px - 32px);
  501. }
  502. }
  503. }
  504. }
  505. .el-picker__popper .el-date-range-picker__header .el-picker-panel__icon-btn {
  506. color: #fff;
  507. }
  508. .el-picker__popper .el-date-table .in-range div {
  509. background: #43516b;
  510. }
  511. }
  512. .historyBtn1 {
  513. cursor: pointer;
  514. color: #05bb4c;
  515. }
  516. </style>