historyDetail.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <template>
  2. <div class="historysingleMachine">
  3. <div class="historysingleMachine_top">
  4. <div class="stationsv">
  5. <span class="timeaa">时间</span>
  6. <el-date-picker
  7. v-model="pickerTimer"
  8. type="daterange"
  9. range-separator="To"
  10. start-placeholder="开始时间"
  11. end-placeholder="结束时间"
  12. :size="size"
  13. format="YYYY/MM/DD"
  14. value-format="YYYY-MM-DD"
  15. />
  16. </div>
  17. <div class="but">
  18. <el-button round size="mini" class="buttons" @click="seachData"
  19. >搜索</el-button
  20. >
  21. <el-button round size="mini" class="buttons" @click="downXlsxFn"
  22. >导出</el-button
  23. >
  24. </div>
  25. </div>
  26. <div class="cutInAndOutAnalysis_Table">
  27. <el-table
  28. :data="historysingleMachineData"
  29. stripe
  30. size="mini"
  31. height="80vh"
  32. ref="historysingleTable"
  33. style="width: 100%"
  34. >
  35. <el-table-column align="center" label="逆变器" width="130" fixed="left">
  36. <template #default="{ row }">
  37. <span>{{ tabIndex === -1 ? row.wtcode : row.wtname }}</span>
  38. </template>
  39. </el-table-column>
  40. <el-table-column
  41. align="center"
  42. prop="recordDate"
  43. label="日期"
  44. width="150"
  45. fixed="left"
  46. >
  47. <template #default="scope">
  48. <span>{{ dateTimeFn(scope.row) }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column
  52. v-for="(item, index) in tableHeaderGf"
  53. :key="index"
  54. sortable
  55. :prop="item.code"
  56. :label="item.title"
  57. align="center"
  58. :width="item.title === '操作' ? '200' : ''"
  59. >
  60. <template #header="scope">
  61. <div v-if="scope.column.label.indexOf('(') > 0">
  62. <div>
  63. {{
  64. scope.column.label.slice(0, scope.column.label.indexOf("("))
  65. }}
  66. </div>
  67. <div>
  68. {{ scope.column.label.slice(scope.column.label.indexOf("(")) }}
  69. </div>
  70. </div>
  71. <div v-else>{{ scope.column.label }}</div>
  72. </template>
  73. <template #default="scope" v-if="item.title === '操作'">
  74. <!-- <span class="historyBtn" @click="seachDetail(scope.row)">详情</span> -->
  75. <span class="historyBtn" @click="seachHistoryData(scope.row)"
  76. >历史</span
  77. >
  78. </template>
  79. </el-table-column>
  80. </el-table>
  81. <!-- <el-pagination
  82. @size-change="handleSizeChange"
  83. @current-change="handleCurrentChange"
  84. :current-page="page.currentPage"
  85. :page-size="page.pagesize"
  86. layout="total, prev, pager, next, jumper"
  87. :total="page.total"
  88. >
  89. </el-pagination> -->
  90. </div>
  91. </div>
  92. </template>
  93. <script>
  94. import {
  95. getApihistorywindturbinegoodnesslist,
  96. getApihistorywindturbinegoodnesslistGf,
  97. getApiequipmentListByWp,
  98. } from "@/api/monthlyPerformanceAnalysis";
  99. import utils from "@/utils/downXlsx";
  100. export default {
  101. props: {
  102. // historyCompanyOptions: {
  103. // type: Array,
  104. // default: () => [],
  105. // },
  106. tabIndex: { type: Number, required: true },
  107. historyStationOptions: {
  108. type: Array,
  109. default: () => [],
  110. },
  111. },
  112. data() {
  113. return {
  114. // hiscompanyVal: "",
  115. hisstationVal: "",
  116. hiswindVal: "",
  117. pickerTimer: [],
  118. historysingleMachineData: [],
  119. hisWindOptions: [],
  120. showBtn: true,
  121. tableHeaderGf: [
  122. { title: "型号", code: "model" },
  123. { title: "日系统效率", code: "rxtxl" },
  124. { title: "日离散率", code: "rlsl" },
  125. { title: "日转换效率", code: "rzhxl" },
  126. { title: "月系统效率", code: "yxtxl" },
  127. { title: "月离散率", code: "ylsl" },
  128. { title: "月转换效率", code: "yzhxl" },
  129. { title: "年系统效率", code: "nxtxl" },
  130. { title: "年离散率", code: "nlsl" },
  131. { title: "年转换效率", code: "nzhxl" },
  132. ],
  133. };
  134. },
  135. methods: {
  136. init(row) {
  137. this.hisstationVal = row.windtpowerstationId;
  138. this.hiswindVal = row.windturbineId || row.wtid;
  139. this.getTableData();
  140. },
  141. dateTimeFn(row) {
  142. return row.recordDate
  143. ? row.recordDate.substring(0, row.recordDate.indexOf("T"))
  144. : row.date.substring(0, row.date.indexOf("T"));
  145. },
  146. headerArr(label) {
  147. let arr = label.split("");
  148. let Newarr = [];
  149. let num = 0;
  150. let str = "";
  151. arr.forEach((it, index) => {
  152. num++;
  153. str += it;
  154. if (label.indexOf(it) + 1 !== label.length) {
  155. if (num % 2 === 0) {
  156. Newarr.push(str);
  157. str = "";
  158. }
  159. } else {
  160. Newarr.push(str);
  161. }
  162. });
  163. return Newarr;
  164. },
  165. seachData() {
  166. this.getTableData();
  167. },
  168. async getTableData() {
  169. let params = {
  170. type: this.tabIndex,
  171. beginDate: this.pickerTimer[0],
  172. endDate: this.pickerTimer[1],
  173. wpId: this.hisstationVal,
  174. wtId: this.hiswindVal,
  175. };
  176. let datas = await getApihistorywindturbinegoodnesslistGf(params);
  177. this.historysingleMachineData = datas.data;
  178. },
  179. handleSizeChange(val) {
  180. this.page.pagesize = val;
  181. this.getTableData();
  182. },
  183. handleCurrentChange(val) {
  184. this.page.currentPage = val;
  185. this.getTableData();
  186. },
  187. //转换时间
  188. getchangeTime(date) {
  189. var y = date.getFullYear();
  190. var m = date.getMonth() + 1;
  191. m = m < 10 ? "0" + m : m;
  192. var d = date.getDate();
  193. d = d < 10 ? "0" + d : d;
  194. return y + "-" + m + "-" + d;
  195. },
  196. downXlsxFn() {
  197. let header = ["逆变器", "日期"];
  198. this.tableHeaderGf.forEach((it) => {
  199. header.push(it.title);
  200. });
  201. utils.exportExcel(
  202. this.$refs["historysingleTable"].$el,
  203. header,
  204. "单机性能历史分析数据"
  205. );
  206. },
  207. },
  208. };
  209. </script>
  210. <style lang="less">
  211. .historysingleMachine {
  212. padding: 0 23px;
  213. .historysingleMachine_top {
  214. display: flex;
  215. flex-direction: row;
  216. align-items: center;
  217. margin-top: 10px;
  218. margin-bottom: 10px;
  219. .station {
  220. display: flex;
  221. flex-direction: row;
  222. align-items: center;
  223. font-size: 14px;
  224. font-family: Microsoft YaHei;
  225. font-weight: 400;
  226. color: #b3b3b3;
  227. margin-right: 10px;
  228. margin-left: 10px;
  229. }
  230. .stationsv {
  231. .timeaa {
  232. font-size: 14px;
  233. font-family: Microsoft YaHei;
  234. font-weight: 400;
  235. color: #b3b3b3;
  236. margin-right: 10px;
  237. margin-left: 10px;
  238. }
  239. }
  240. .tabCut {
  241. display: inline-block;
  242. margin: 0 10px;
  243. div {
  244. display: inline-block;
  245. width: 60px;
  246. height: 27px;
  247. border: 1px solid #354460;
  248. text-align: center;
  249. line-height: 25px;
  250. cursor: pointer;
  251. }
  252. div:nth-child(1) {
  253. border-radius: 13px 0px 0px 13px;
  254. }
  255. div:nth-child(2) {
  256. border-radius: 0px 13px 13px 0px;
  257. }
  258. .active {
  259. background-color: #0c3378;
  260. color: #fff;
  261. }
  262. }
  263. .search-input {
  264. margin-left: 10px;
  265. .el-input__inner {
  266. width: 175px;
  267. }
  268. .el-input__suffix {
  269. right: -50px;
  270. }
  271. }
  272. .but {
  273. display: flex;
  274. flex-direction: row;
  275. align-content: center;
  276. margin-left: 20px;
  277. .buttons:nth-child(1) {
  278. background: rgba(0, 70, 199, 0.6);
  279. border: 1px solid #1f51ae;
  280. border-radius: 13px;
  281. color: #fff;
  282. &:hover {
  283. background: rgba(14, 90, 229, 0.9);
  284. border-radius: 13px;
  285. color: #fff;
  286. }
  287. }
  288. .buttons:nth-child(2) {
  289. background: rgba(67, 81, 107, 0.3);
  290. border: 1px solid #3b4c6c;
  291. border-radius: 13px;
  292. font-size: 14px;
  293. color: #b3b3b3;
  294. }
  295. }
  296. .el-date-editor--daterange {
  297. background: transparent;
  298. border: 1px solid #2a374f;
  299. border-radius: 30px;
  300. height: 25px;
  301. .el-range-input {
  302. background: transparent;
  303. color: #fff;
  304. }
  305. .el-range-separator {
  306. width: 10%;
  307. color: #fff;
  308. position: relative;
  309. top: -7px;
  310. }
  311. }
  312. }
  313. .historysingleMachine_Table {
  314. padding: 5px;
  315. padding-bottom: 10px;
  316. background: rgba(0, 0, 0, 0.4);
  317. .el-table--mini {
  318. margin: 5px;
  319. .el-table__header-wrapper {
  320. tr {
  321. background: rgba(83, 89, 104, 0.3) !important;
  322. th {
  323. vertical-align: top !important;
  324. }
  325. .cell {
  326. color: #b3b3b3;
  327. font-family: MicrosoftYaHei;
  328. font-size: 14px;
  329. }
  330. }
  331. }
  332. .el-table__body-wrapper {
  333. tr {
  334. &:nth-child(2n) {
  335. background: rgba(83, 89, 104, 0.05) !important;
  336. }
  337. .cell {
  338. color: #d8d8d9;
  339. font-family: ArialMT;
  340. font-size: 13px;
  341. height: 25px !important;
  342. }
  343. }
  344. }
  345. }
  346. }
  347. }
  348. .el-pagination {
  349. display: flex;
  350. justify-content: flex-end;
  351. margin-right: 40px;
  352. margin-top: 20px;
  353. .btn-prev,
  354. .btn-next,
  355. .btn-quickprev,
  356. .btn-quicknext,
  357. .el-pager,
  358. .number {
  359. background: rgba(58, 63, 75, 0.4) !important;
  360. color: #fff;
  361. border-radius: 2px;
  362. }
  363. .el-pager .active {
  364. background: #083c94;
  365. color: #fff;
  366. border-radius: 2px;
  367. }
  368. .el-pagination__total,
  369. .el-pagination__jump {
  370. color: #fff;
  371. .el-input__inner {
  372. background: rgba(58, 63, 75, 0.2);
  373. border: 1px solid #3e4349;
  374. color: #fff;
  375. border-radius: 2px;
  376. }
  377. }
  378. }
  379. .historyBtn {
  380. background: #43516b;
  381. border-radius: 15px;
  382. margin-top: 5px;
  383. border: 1px solid #43516b;
  384. span {
  385. color: #fff;
  386. }
  387. }
  388. </style>