index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. <template>
  2. <div class="stateTransition">
  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="station">
  20. 场站:
  21. <el-select
  22. size="mini"
  23. v-model="stationVal"
  24. placeholder="请选择"
  25. clearable
  26. @change="changeStation"
  27. >
  28. <el-option
  29. v-for="item in stationOptions"
  30. :key="item.id"
  31. :label="item.aname"
  32. :value="item.id"
  33. >
  34. </el-option>
  35. </el-select>
  36. </div>
  37. <div class="station">
  38. 时间:
  39. <el-date-picker
  40. v-model="pickerTimer"
  41. type="datetimerange"
  42. start-placeholder="开始时间"
  43. end-placeholder="结束时间"
  44. format="YYYY-MM-DD HH:mm:ss"
  45. date-format="YYYY/MM/DD ddd"
  46. time-format="A hh:mm:ss"
  47. />
  48. </div>
  49. <div class="but">
  50. <el-button round size="mini" class="buttons" @click="seachData"
  51. >搜 索</el-button
  52. >
  53. </div>
  54. </div>
  55. </div>
  56. <div
  57. style="
  58. background: rgba(0, 0, 0, 0.4);
  59. height: calc(100% - 52px);
  60. padding-bottom: 15px;
  61. "
  62. >
  63. <div class="Evaluation_title clearfix">
  64. <div class="leftContent floatLeft"><span>状态时间分析</span></div>
  65. </div>
  66. <div class="economicTable1">
  67. <el-table
  68. :data="EvaluationData"
  69. stripe
  70. size="mini"
  71. height="calc(100% - 40px)"
  72. ref="Eval_table"
  73. style="width: 100%"
  74. >
  75. <el-table-column prop="deviceId" label="风机名称" align="center" />
  76. <el-table-column
  77. label="待机时间(H)"
  78. align="right"
  79. header-align="center"
  80. >
  81. <template #default="{ row }">
  82. <span>{{ row.standbyTime.toFixed(2) }}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column
  86. label="并网时间(H)"
  87. align="right"
  88. header-align="center"
  89. >
  90. <template #default="{ row }">
  91. <span>{{ row.gridConnectionTime.toFixed(2) }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column
  95. label="故障时间(H)"
  96. align="right"
  97. header-align="center"
  98. >
  99. <template #default="{ row }">
  100. <span>{{ row.faultTime.toFixed(2) }}</span>
  101. </template>
  102. </el-table-column>
  103. <el-table-column
  104. label="检修时间(H)"
  105. align="right"
  106. header-align="center"
  107. >
  108. <template #default="{ row }">
  109. <span>{{ row.maintenanceTime.toFixed(2) }}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column
  113. label="限电时间(H)"
  114. align="right"
  115. header-align="center"
  116. >
  117. <template #default="{ row }">
  118. <span>{{ row.powerLimitTime.toFixed(2) }}</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column
  122. label="受累时间(H)"
  123. align="right"
  124. header-align="center"
  125. >
  126. <template #default="{ row }">
  127. <span>{{ row.faultTime.toFixed(2) }}</span>
  128. </template>
  129. </el-table-column>
  130. <el-table-column
  131. label="离线时间(H)"
  132. align="right"
  133. header-align="center"
  134. >
  135. <template #default="{ row }">
  136. <span>{{ row.offlineTime.toFixed(2) }}</span>
  137. </template>
  138. </el-table-column>
  139. <el-table-column
  140. label="合计时间(H)"
  141. align="right"
  142. header-align="center"
  143. >
  144. <template #default="{ row }">
  145. <span>{{ row.total }}</span>
  146. </template>
  147. </el-table-column>
  148. </el-table>
  149. <div style="text-align: right">
  150. <el-pagination
  151. @size-change="handleSizeChange"
  152. :page-sizes="[20, 50, 100, 200, 500]"
  153. layout="total, sizes, prev, pager, next, jumper"
  154. @current-change="handlePageChange"
  155. :current-page="page.currentPage"
  156. :page-size="page.pagesize"
  157. :total="page.total"
  158. >
  159. </el-pagination>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. </template>
  165. <script>
  166. import {
  167. getApiphotovoltaiclist,
  168. getApicompanyslist,
  169. getApiwpByCplistlist,
  170. } from "@/api/monthlyPerformanceAnalysis";
  171. import dayjs from "dayjs";
  172. export default {
  173. name: "PerformanceAssess",
  174. data() {
  175. return {
  176. companyVal: "",
  177. companyOptions: [],
  178. stationVal: "",
  179. stationOptions: [],
  180. pickerTimer: [],
  181. EvaluationData: [],
  182. page: {
  183. currentPage: 1,
  184. pagesize: 20,
  185. total: 0,
  186. },
  187. };
  188. },
  189. mounted() {
  190. this.getCompanyData();
  191. this.pickerTimer = [
  192. new Date(
  193. new Date(new Date().getTime() - 24 * 60 * 60 * 1000).setHours(
  194. 0,
  195. 0,
  196. 0,
  197. 0
  198. )
  199. ),
  200. new Date(new Date(new Date().getTime()).setHours(0, 0, 0, 0)),
  201. ];
  202. },
  203. computed: {
  204. pageHeight() {
  205. return {
  206. height: document.documentElement.clientHeight - 130 + "px",
  207. };
  208. },
  209. },
  210. methods: {
  211. handleSizeChange(val) {
  212. this.page.currentPage = 1;
  213. this.page.pagesize = val;
  214. this.seachData();
  215. },
  216. handlePageChange(val) {
  217. this.page.currentPage = val;
  218. this.seachData();
  219. },
  220. // 获取公司列表
  221. async getCompanyData() {
  222. this.companyOptions = [];
  223. const { data: datas } = await getApicompanyslist();
  224. this.companyOptions = datas.data;
  225. this.companyVal = datas.data[0]?.id;
  226. this.getStationData();
  227. },
  228. changeCompan(val) {
  229. this.companyVal = val;
  230. this.stationOptions = [];
  231. this.stationVal = "";
  232. this.getStationData();
  233. },
  234. // 获取场站列表
  235. async getStationData() {
  236. this.stationOptions = [];
  237. let params = {
  238. type: -1,
  239. companyid: this.companyVal,
  240. };
  241. const { data: datas } = await getApiwpByCplistlist(params);
  242. this.stationOptions = datas.data;
  243. this.stationVal = datas.data[0].id;
  244. this.getTableData();
  245. },
  246. changeStation(val) {
  247. this.stationVal = val;
  248. this.getTableData();
  249. },
  250. seachData() {
  251. this.getTableData();
  252. },
  253. async getTableData() {
  254. let params = {
  255. stationId: this.stationVal,
  256. type: "WT",
  257. startTime: this.pickerTimer[0].getTime(),
  258. endTime: this.pickerTimer[1].getTime(),
  259. pageNum: this.page.currentPage,
  260. pageSize: this.page.pagesize,
  261. };
  262. const { data: datas } = await getApiphotovoltaiclist(params);
  263. this.EvaluationData = datas.data;
  264. this.page.total = datas.total;
  265. },
  266. },
  267. };
  268. </script>
  269. <style lang="less">
  270. .stateTransition {
  271. padding: 0 20px;
  272. height: 100%;
  273. .Evaluation_title {
  274. .leftContent {
  275. width: 242px;
  276. height: 41px;
  277. line-height: 41px;
  278. background: url("~@/assets/imgs/title_left_bg.png") no-repeat;
  279. span {
  280. font-size: 16px;
  281. font-family: Microsoft YaHei;
  282. font-weight: 400;
  283. color: #05bb4c;
  284. margin-left: 25px;
  285. }
  286. }
  287. .floatLeft {
  288. float: left;
  289. }
  290. .floatRight {
  291. float: right;
  292. }
  293. .rightContent {
  294. width: 212px;
  295. height: 28px;
  296. margin-top: 13px;
  297. background: url("../../../../assets/imgs/title_right_bg.png");
  298. }
  299. }
  300. .clearfix::after {
  301. content: "";
  302. clear: both;
  303. height: 0;
  304. line-height: 0;
  305. visibility: hidden;
  306. display: block;
  307. }
  308. .clearfix {
  309. zoom: 1;
  310. }
  311. .Evaluation_topall {
  312. display: flex;
  313. justify-content: space-between;
  314. .selections {
  315. position: relative;
  316. right: 120px;
  317. display: flex;
  318. margin-top: 10px;
  319. .selections_btn {
  320. flex: 0 0 55px;
  321. text-align: center;
  322. height: 33px;
  323. line-height: 33px;
  324. margin-right: 8px;
  325. color: #b9b9b9;
  326. font-size: 1.296vh;
  327. background: fade(#606769, 20);
  328. border: 1px solid fade(#606769, 20);
  329. border-radius: 20px;
  330. &:hover,
  331. &.active {
  332. background: fade(#05bb4c, 80);
  333. border: 1px solid #05bb4c;
  334. color: #fff;
  335. cursor: pointer;
  336. }
  337. }
  338. }
  339. .Evaluation_top {
  340. display: flex;
  341. flex-direction: row;
  342. align-items: center;
  343. padding-top: 10px;
  344. padding-bottom: 10px;
  345. .station {
  346. display: flex;
  347. flex-direction: row;
  348. align-items: center;
  349. font-size: 14px;
  350. font-family: Microsoft YaHei;
  351. font-weight: 400;
  352. color: #b3b3b3;
  353. margin-right: 10px;
  354. margin-left: 10px;
  355. }
  356. .search-input {
  357. margin-left: 10px;
  358. .el-input__inner {
  359. width: 175px;
  360. }
  361. .el-input__suffix {
  362. right: -50px;
  363. }
  364. }
  365. .tabCut {
  366. display: inline-block;
  367. margin: 0 10px;
  368. div {
  369. display: inline-block;
  370. width: 60px;
  371. height: 27px;
  372. border: 1px solid #274934;
  373. text-align: center;
  374. line-height: 25px;
  375. cursor: pointer;
  376. }
  377. div:nth-child(1) {
  378. border-radius: 13px 0px 0px 13px;
  379. border-right-width: 0;
  380. }
  381. div:nth-child(2) {
  382. border-radius: 0px 13px 13px 0px;
  383. }
  384. .active {
  385. background-color: rgba(5, 187, 76, 0.9);
  386. color: #fff;
  387. }
  388. }
  389. .buttons {
  390. background-color: rgba(5, 187, 76, 0.2);
  391. border: 1px solid #3b6c53;
  392. color: #b3b3b3;
  393. font-size: 14px;
  394. &:hover,
  395. &.active {
  396. background-color: rgba(5, 187, 76, 0.5);
  397. color: #ffffff;
  398. }
  399. }
  400. }
  401. }
  402. .economicTable1 {
  403. height: calc(100% - 40px);
  404. .el-table--mini {
  405. .el-table__header-wrapper {
  406. .el-checkbox {
  407. display: none;
  408. }
  409. }
  410. .el-table__body-wrapper {
  411. .el-checkbox {
  412. .el-checkbox__input {
  413. display: block;
  414. }
  415. }
  416. }
  417. }
  418. .historyBtn {
  419. background: #43516b;
  420. border-radius: 15px;
  421. margin-top: 5px;
  422. border: 1px solid #43516b;
  423. span {
  424. color: #fff;
  425. }
  426. }
  427. }
  428. .el-overlay {
  429. .el-overlay-dialog {
  430. overflow-y: hidden !important;
  431. .EvaluationhistoryModel {
  432. margin-top: 0 !important;
  433. .el-dialog__body {
  434. height: calc(100% - 51px - 50px);
  435. }
  436. }
  437. .contrastModal {
  438. .el-dialog__header {
  439. border: none;
  440. }
  441. .el-dialog__body {
  442. padding-top: 10px;
  443. }
  444. }
  445. }
  446. }
  447. .el-picker__popper .el-date-range-picker__header .el-picker-panel__icon-btn {
  448. color: #fff;
  449. }
  450. .el-picker__popper .el-date-table .in-range div {
  451. background: #43516b;
  452. }
  453. }
  454. </style>