index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. <template>
  2. <div class="comprehensiveEvaluation">
  3. <div class="Evaluation_topall">
  4. <div class="Evaluation_top">
  5. <el-select
  6. size="mini"
  7. v-model="companyVal"
  8. placeholder="请选择"
  9. @change="changeCompan"
  10. >
  11. <el-option
  12. v-for="item in companyOptions"
  13. :key="item.id"
  14. :label="item.aname"
  15. :value="item.id"
  16. >
  17. </el-option>
  18. </el-select>
  19. <div class="tabCut">
  20. <div
  21. @click="changeBtn(val.id)"
  22. :class="tabEvent === val.id ? 'active' : ''"
  23. v-for="val in tabOptions"
  24. :key="val.id"
  25. >
  26. <span>{{ val.name }}</span>
  27. </div>
  28. </div>
  29. <div class="station">
  30. 场站:
  31. <el-select
  32. size="mini"
  33. v-model="stationVal"
  34. placeholder="请选择"
  35. clearable
  36. @change="changeStation"
  37. >
  38. <el-option
  39. v-for="item in stationOptions"
  40. :key="item.id"
  41. :label="item.aname"
  42. :value="item.id"
  43. >
  44. </el-option>
  45. </el-select>
  46. </div>
  47. <div class="station">
  48. 时间
  49. <div class="">
  50. <el-date-picker
  51. v-if="tabIndex == 0"
  52. size="mini"
  53. v-model="pickerTimer"
  54. type="date"
  55. value-format="YYYY-MM-DD"
  56. placeholder="选择日期"
  57. popper-class="date-select"
  58. @change="historyTimer = pickerTimer"
  59. >
  60. </el-date-picker>
  61. <el-date-picker
  62. v-if="tabIndex == 1"
  63. size="mini"
  64. v-model="pickerTimer"
  65. type="month"
  66. value-format="YYYY-MM"
  67. placeholder="选择月份"
  68. popper-class="date-select"
  69. >
  70. </el-date-picker>
  71. <el-date-picker
  72. v-if="tabIndex == 2"
  73. size="mini"
  74. v-model="pickerTimer"
  75. type="year"
  76. value-format="YYYY"
  77. placeholder="选择年份"
  78. popper-class="date-select"
  79. >
  80. </el-date-picker>
  81. </div>
  82. </div>
  83. <div class="but">
  84. <el-button round size="mini" class="buttons" @click="seachData"
  85. >搜索</el-button
  86. >
  87. <el-button
  88. round
  89. size="mini"
  90. class="buttons"
  91. @click="contrastFn"
  92. :disabled="chooseList.length === 2 ? false : true"
  93. >信息对比</el-button
  94. >
  95. </div>
  96. </div>
  97. <div class="selections">
  98. <div
  99. class="selections_btn"
  100. @click="tabSelect(0)"
  101. :class="{ active: tabIndex == 0 }"
  102. >
  103. </div>
  104. <div
  105. class="selections_btn"
  106. @click="tabSelect(1)"
  107. :class="{ active: tabIndex == 1 }"
  108. >
  109. </div>
  110. <div
  111. class="selections_btn"
  112. @click="tabSelect(2)"
  113. :class="{ active: tabIndex == 2 }"
  114. >
  115. </div>
  116. </div>
  117. </div>
  118. <div
  119. style="
  120. background: rgba(0, 0, 0, 0.4);
  121. height: calc(100% - 39px);
  122. padding-bottom: 15px;
  123. "
  124. >
  125. <div class="Evaluation_title clearfix">
  126. <div class="leftContent floatLeft"><span>性能等级评估</span></div>
  127. </div>
  128. <div class="economicTable1">
  129. <el-table
  130. :data="EvaluationData"
  131. stripe
  132. @selection-change="handleCurrentChange"
  133. size="mini"
  134. height="calc(100% - 40px)"
  135. ref="Eval_table"
  136. style="width: 100%"
  137. >
  138. <el-table-column type="selection" width="60" align="center">
  139. </el-table-column>
  140. <el-table-column prop="nemCode" label="设备编号" align="center">
  141. </el-table-column>
  142. <el-table-column prop="dayLevel" label="等级" align="center">
  143. </el-table-column>
  144. <el-table-column prop="dayRank" label="综合排名" align="center">
  145. </el-table-column>
  146. <el-table-column
  147. v-for="(item, index) in tabEvent === -1
  148. ? tableHeader
  149. : tableHeaderGf"
  150. :key="index"
  151. sortable
  152. :prop="item.code"
  153. :label="item.title"
  154. align="center"
  155. >
  156. <template #header="scope">
  157. <div>
  158. {{
  159. scope.column.label.slice(0, scope.column.label.indexOf("("))
  160. }}
  161. </div>
  162. <div>
  163. {{ scope.column.label.slice(scope.column.label.indexOf("(")) }}
  164. </div>
  165. </template>
  166. </el-table-column>
  167. <el-table-column label="操作" align="center">
  168. <template #default="scope">
  169. <span
  170. @click="seachHistoryData(scope.row)"
  171. style="cursor: pointer; color: #05bb4c"
  172. >历史</span
  173. >
  174. </template>
  175. </el-table-column>
  176. </el-table>
  177. <div style="text-align: right">
  178. <el-pagination
  179. @current-change="handlePageChange"
  180. :current-page="page.currentPage"
  181. :page-size="page.pagesize"
  182. layout="total, prev, pager, next, jumper"
  183. :total="page.total"
  184. >
  185. </el-pagination>
  186. </div>
  187. </div>
  188. </div>
  189. <el-dialog
  190. v-model="dialogVisible"
  191. width="100%"
  192. custom-class="EvaluationhistoryModel"
  193. :close-on-click-modal="false"
  194. fullscreen
  195. >
  196. <template #title>
  197. <div class="dialog-title">
  198. <div class="title">{{ dialogTitle }}</div>
  199. </div>
  200. </template>
  201. <div style="height: 100%">
  202. <history-detail ref="windhistoryDetail"> </history-detail>
  203. </div>
  204. </el-dialog>
  205. <el-dialog
  206. v-model="contrastVisible"
  207. width="70%"
  208. top="120px"
  209. custom-class="contrastModal"
  210. :close-on-click-modal="false"
  211. >
  212. <template #title>
  213. <div class="dialog-title">
  214. <div class="title">信息对比</div>
  215. </div>
  216. </template>
  217. <div class="dialog-body">
  218. <img class="dialog-img" src="@assets/imgs/dialog.png" />
  219. <day-detail-info
  220. :chooseList="chooseList"
  221. :tabEvent="tabEvent"
  222. ref="MessageContrast"
  223. ></day-detail-info>
  224. </div>
  225. </el-dialog>
  226. </div>
  227. </template>
  228. <script>
  229. import {
  230. getApicompanyslist,
  231. getApiwpByCplistlist,
  232. getApiequipmentinfoDayList,
  233. } from "@/api/monthlyPerformanceAnalysis";
  234. import historyDetail from "./historyDetail.vue";
  235. import dayDetailInfo from "./dayDetailInfo.vue";
  236. import dayjs from "dayjs";
  237. export default {
  238. name: "performanceAssess",
  239. components: {
  240. historyDetail,
  241. dayDetailInfo,
  242. },
  243. data() {
  244. return {
  245. tabIndex: 0,
  246. companyVal: "",
  247. companyOptions: [],
  248. stationVal: "",
  249. stationOptions: [],
  250. pickerTimer: "",
  251. EvaluationData: [],
  252. tableHeader: [
  253. { title: "发电量(kWh)", code: "dayfdl" },
  254. { title: "理论发电量(kWh)", code: "dayllfdl" },
  255. { title: "平均风速(m/s)", code: "dayfs" },
  256. { title: "平均功率(KW)", code: "daygl" },
  257. { title: "故障损失(kWh)", code: "daygzssdl" },
  258. { title: "限电损失(kWh)", code: "dayxdssdl" },
  259. { title: "维护损失(kWh)", code: "daywhssdl" },
  260. { title: "性能损失(kWh)", code: "dayxnssdl" },
  261. { title: "利用小时数(h)", code: "daylyxs" },
  262. { title: "拟合优度(%)", code: "daynhyd" },
  263. { title: "可利用率(%)", code: "daysbklyl" },
  264. { title: "可用系数(%)", code: "daydxkyxs" },
  265. { title: "有效风时数(h)", code: "dayyxfss" },
  266. { title: "平均切入(m/s)", code: "dayxfqr" },
  267. { title: "静风频率(%)", code: "dayjfpl" },
  268. { title: "功率一致性(%)", code: "dayglyzxxs" },
  269. ],
  270. tableHeaderGf: [
  271. { title: "发电量(kWh)", code: "dayfdl" },
  272. { title: "理论发电量(kWh)", code: "dayllfdl" },
  273. { title: "光照强度(W/㎡)", code: "dayfs" },
  274. { title: "平均功率(KW)", code: "daygl" },
  275. { title: "故障损失(kWh)", code: "daygzssdl" },
  276. { title: "限电损失(kWh)", code: "dayxdssdl" },
  277. { title: "维护损失(kWh)", code: "daywhssdl" },
  278. { title: "性能损失(kWh)", code: "dayxnssdl" },
  279. { title: "利用小时数(h)", code: "daylyxs" },
  280. { title: "拟合优度(%)", code: "daynhyd" },
  281. { title: "可利用率(%)", code: "daysbklyl" },
  282. { title: "可用系数(%)", code: "daydxkyxs" },
  283. { title: "有效光时数(h)", code: "dayyxfss" },
  284. { title: "功率一致性(%)", code: "dayglyzxxs" },
  285. ],
  286. dialogVisible: false,
  287. dialogTitle: "",
  288. chooseList: [],
  289. contrastVisible: false,
  290. tabEvent: -1,
  291. tabOptions: [
  292. { id: -1, name: "风电" },
  293. { id: -2, name: "光伏" },
  294. ],
  295. page: {
  296. currentPage: 1,
  297. pagesize: 21,
  298. total: 0,
  299. },
  300. historyTimer: "",
  301. };
  302. },
  303. created() {
  304. this.getCompanyData();
  305. },
  306. computed: {
  307. pageHeight() {
  308. return {
  309. height: document.documentElement.clientHeight - 130 + "px",
  310. };
  311. },
  312. },
  313. methods: {
  314. handlePageChange(val) {
  315. this.page.currentPage = val;
  316. this.seachData();
  317. },
  318. // 切换tab
  319. tabSelect(index) {
  320. this.tabIndex = index;
  321. if (this.tabIndex == 0) {
  322. this.pickerTimer = dayjs().format("YYYY-MM-DD");
  323. } else if (this.tabIndex == 1) {
  324. this.pickerTimer = dayjs().format("YYYY-MM");
  325. } else if (this.tabIndex == 2) {
  326. this.pickerTimer = dayjs().format("YYYY");
  327. }
  328. this.historyTimer = dayjs().format("YYYY-MM-DD");
  329. this.page.currentPage = 1;
  330. this.seachData();
  331. },
  332. changeBtn(id) {
  333. this.tabEvent = id;
  334. this.stationVal = "";
  335. this.stationOptions = [];
  336. this.getStationData();
  337. this.seachData();
  338. },
  339. // 获取公司列表
  340. async getCompanyData() {
  341. this.companyOptions = [];
  342. this.pickerTimer = this.getchangeTime(new Date());
  343. this.historyTimer = this.getchangeTime(new Date());
  344. const { data: datas } = await getApicompanyslist();
  345. this.companyOptions = datas.data;
  346. this.companyVal = datas.data[0]?.id;
  347. this.getStationData();
  348. },
  349. changeCompan(val) {
  350. this.companyVal = val;
  351. this.stationOptions = [];
  352. this.stationVal = "";
  353. this.getStationData();
  354. },
  355. // 获取场站列表
  356. async getStationData() {
  357. this.stationOptions = [];
  358. let params = {
  359. type: this.tabEvent,
  360. companyid: this.companyVal,
  361. };
  362. const { data: datas } = await getApiwpByCplistlist(params);
  363. this.stationOptions = datas.data;
  364. this.stationVal = datas.data[0].id;
  365. this.getTableData();
  366. },
  367. changeStation(val) {
  368. this.stationVal = val;
  369. this.getTableData();
  370. },
  371. seachData() {
  372. this.getTableData();
  373. },
  374. async getTableData() {
  375. let params = {
  376. companyId: this.companyVal,
  377. date: this.pickerTimer,
  378. staType: -1,
  379. types: this.tabIndex * 1 + 1,
  380. wpId: this.stationVal,
  381. type: this.tabEvent,
  382. pageNum: this.page.currentPage,
  383. pageSize: this.page.pagesize,
  384. };
  385. const { data: datas } = await getApiequipmentinfoDayList(params);
  386. this.EvaluationData = datas.data.records;
  387. this.page.total = datas.data.total;
  388. },
  389. handleCurrentChange(val) {
  390. if (val.length > 2) {
  391. let del_row = val.shift();
  392. this.$refs.Eval_table.toggleRowSelection(del_row, false);
  393. }
  394. let arr = [];
  395. val.forEach((item, index) => {
  396. if (index < 2) {
  397. arr.push(item);
  398. }
  399. });
  400. this.chooseList = arr;
  401. },
  402. //转换时间
  403. getchangeTime(date) {
  404. var y = date.getFullYear();
  405. var m = date.getMonth() + 1;
  406. m = m < 10 ? "0" + m : m;
  407. var d = date.getDate();
  408. d = d < 10 ? "0" + d : d;
  409. return y + "-" + m + "-" + d;
  410. },
  411. seachHistoryData(row) {
  412. this.dialogVisible = true;
  413. this.dialogTitle = "历史数据查询";
  414. this.$nextTick(() => {
  415. let startT =
  416. new Date(this.historyTimer).getTime() - 10 * 24 * 60 * 60 * 1000;
  417. this.$refs.windhistoryDetail.pickerTimer = [
  418. this.getchangeTime(new Date(startT)),
  419. this.historyTimer,
  420. ];
  421. this.$refs.windhistoryDetail.tabIndex = this.tabIndex * 1 + 1;
  422. this.$refs.windhistoryDetail.tabEvent = this.tabEvent;
  423. this.$refs.windhistoryDetail.init(row);
  424. });
  425. },
  426. contrastFn() {
  427. this.contrastVisible = true;
  428. this.$nextTick(() => {
  429. this.$refs.MessageContrast.tabIndex = this.tabIndex * 1 + 1;
  430. this.$refs.MessageContrast.init();
  431. });
  432. },
  433. },
  434. };
  435. </script>
  436. <style lang="less">
  437. .comprehensiveEvaluation {
  438. padding: 0 20px;
  439. height: 100%;
  440. .Evaluation_title {
  441. .leftContent {
  442. width: 242px;
  443. height: 41px;
  444. line-height: 41px;
  445. background: url("~@/assets/imgs/title_left_bg1.png") no-repeat;
  446. span {
  447. font-size: 16px;
  448. font-family: Microsoft YaHei;
  449. font-weight: 400;
  450. color: #05bb4c;
  451. margin-left: 25px;
  452. }
  453. }
  454. .floatLeft {
  455. float: left;
  456. }
  457. .floatRight {
  458. float: right;
  459. }
  460. .rightContent {
  461. width: 212px;
  462. height: 28px;
  463. margin-top: 13px;
  464. background: url("../../../../assets/imgs/title_right_bg.png");
  465. }
  466. }
  467. .clearfix::after {
  468. content: "";
  469. clear: both;
  470. height: 0;
  471. line-height: 0;
  472. visibility: hidden;
  473. display: block;
  474. }
  475. .clearfix {
  476. zoom: 1;
  477. }
  478. .Evaluation_topall {
  479. display: flex;
  480. justify-content: space-between;
  481. .selections {
  482. position: relative;
  483. right: 120px;
  484. display: flex;
  485. margin-top: 10px;
  486. .selections_btn {
  487. flex: 0 0 55px;
  488. text-align: center;
  489. height: 33px;
  490. line-height: 33px;
  491. margin-right: 8px;
  492. color: #b9b9b9;
  493. font-size: 1.296vh;
  494. background: fade(#606769, 20);
  495. border: 1px solid fade(#606769, 20);
  496. border-radius: 20px;
  497. &:hover,
  498. &.active {
  499. background: fade(#05bb4c, 80);
  500. border: 1px solid #05bb4c;
  501. color: #fff;
  502. cursor: pointer;
  503. }
  504. }
  505. }
  506. .Evaluation_top {
  507. display: flex;
  508. flex-direction: row;
  509. align-items: center;
  510. padding-top: 10px;
  511. padding-bottom: 10px;
  512. .station {
  513. display: flex;
  514. flex-direction: row;
  515. align-items: center;
  516. font-size: 14px;
  517. font-family: Microsoft YaHei;
  518. font-weight: 400;
  519. color: #b3b3b3;
  520. margin-right: 10px;
  521. margin-left: 10px;
  522. }
  523. .search-input {
  524. margin-left: 10px;
  525. .el-input__inner {
  526. width: 175px;
  527. }
  528. .el-input__suffix {
  529. right: -50px;
  530. }
  531. }
  532. .tabCut {
  533. display: inline-block;
  534. margin: 0 10px;
  535. div {
  536. display: inline-block;
  537. width: 60px;
  538. height: 27px;
  539. border: 1px solid #274934;
  540. text-align: center;
  541. line-height: 25px;
  542. cursor: pointer;
  543. }
  544. div:nth-child(1) {
  545. border-radius: 13px 0px 0px 13px;
  546. border-right-width: 0;
  547. }
  548. div:nth-child(2) {
  549. border-radius: 0px 13px 13px 0px;
  550. }
  551. .active {
  552. background-color: rgba(5, 187, 76, 0.9);
  553. color: #fff;
  554. }
  555. }
  556. .but {
  557. display: flex;
  558. flex-direction: row;
  559. align-content: center;
  560. margin-left: 20px;
  561. .buttons:nth-child(1) {
  562. background: rgba(5, 187, 76, 0.6);
  563. border: 1px solid #3b6c53;
  564. border-radius: 13px;
  565. color: #fff;
  566. &:hover {
  567. background: rgba(5, 187, 76, 0.9);
  568. border-radius: 13px;
  569. color: #fff;
  570. }
  571. }
  572. .buttons:nth-child(2) {
  573. background: rgba(67, 81, 107, 0.3);
  574. border: 1px solid #3b6c53;
  575. border-radius: 13px;
  576. font-size: 14px;
  577. color: #b3b3b3;
  578. }
  579. }
  580. }
  581. }
  582. .economicTable1 {
  583. height: calc(100% - 40px);
  584. .el-table--mini {
  585. .el-table__header-wrapper {
  586. .el-checkbox {
  587. display: none;
  588. }
  589. }
  590. .el-table__body-wrapper {
  591. .el-checkbox {
  592. .el-checkbox__input {
  593. display: block;
  594. }
  595. }
  596. }
  597. }
  598. .historyBtn {
  599. background: #43516b;
  600. border-radius: 15px;
  601. margin-top: 5px;
  602. border: 1px solid #43516b;
  603. span {
  604. color: #fff;
  605. }
  606. }
  607. }
  608. .el-overlay {
  609. .el-overlay-dialog {
  610. overflow-y: hidden !important;
  611. .EvaluationhistoryModel {
  612. margin-top: 0 !important;
  613. .el-dialog__body {
  614. height: calc(100% - 51px - 50px);
  615. }
  616. }
  617. .contrastModal {
  618. .el-dialog__header {
  619. border: none;
  620. }
  621. .el-dialog__body {
  622. padding-top: 10px;
  623. }
  624. }
  625. }
  626. }
  627. .el-picker__popper .el-date-range-picker__header .el-picker-panel__icon-btn {
  628. color: #fff;
  629. }
  630. .el-picker__popper .el-date-table .in-range div {
  631. background: #43516b;
  632. }
  633. }
  634. </style>