index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. <template>
  2. <div class="monthMachine">
  3. <div class="monthMachine_top">
  4. <el-select
  5. size="mini"
  6. v-model="companyVal"
  7. placeholder="请选择"
  8. @change="changeCompan"
  9. >
  10. <el-option
  11. v-for="item in companyOptions"
  12. :key="item.id"
  13. :label="item.aname"
  14. :value="item.id"
  15. >
  16. </el-option>
  17. </el-select>
  18. <!-- <div class="tabCut">
  19. <div
  20. @click="changeBtnsd(val.id)"
  21. :class="tabIndex === val.id ? 'active' : ''"
  22. v-for="val in tabOptions"
  23. :key="val.id"
  24. >
  25. <span>{{ val.name }}</span>
  26. </div>
  27. </div> -->
  28. <div class="station">
  29. 场站:
  30. <el-select
  31. size="mini"
  32. v-model="stationVal"
  33. placeholder="请选择"
  34. clearable
  35. @change="changeStation"
  36. >
  37. <el-option
  38. v-for="item in stationOptions"
  39. :key="item.id"
  40. :label="item.name"
  41. :value="item.id"
  42. >
  43. </el-option>
  44. </el-select>
  45. </div>
  46. <div class="station">
  47. 时间
  48. <div>
  49. <el-date-picker
  50. v-model="pickerTimer"
  51. type="month"
  52. value-format="YYYY-MM"
  53. placeholder="选择日期"
  54. popper-class="date-select"
  55. >
  56. </el-date-picker>
  57. </div>
  58. </div>
  59. <div class="but">
  60. <el-button round size="mini" class="buttons" @click="seachData"
  61. >搜索</el-button
  62. >
  63. <el-button round size="mini" class="buttons" @click="downXlsxFn"
  64. >导出</el-button
  65. >
  66. </div>
  67. </div>
  68. <div
  69. style="
  70. background: rgba(0, 0, 0, 0.4);
  71. height: calc(100% - 48px);
  72. padding-bottom: 15px;
  73. "
  74. >
  75. <div class="monthMachine_title clearfix">
  76. <div class="leftContent floatLeft"><span>单机月度分析</span></div>
  77. </div>
  78. <div class="economicTable1">
  79. <el-table
  80. :data="monthMachineData"
  81. stripe
  82. size="mini"
  83. height="calc(100% - 40px)"
  84. ref="month_table"
  85. style="width: 100%"
  86. >
  87. <el-table-column align="center" label="机组名称" width="60">
  88. <template #default="scope">
  89. <span
  90. @click="reportDialogFn(scope.row)"
  91. style="cursor: pointer; color: #05bb4c"
  92. >{{ scope.row.windturbineName }}</span
  93. >
  94. </template>
  95. </el-table-column>
  96. <el-table-column
  97. v-for="(item, index) in tableHeader"
  98. :key="index"
  99. sortable
  100. :prop="item.code"
  101. :label="item.title"
  102. align="center"
  103. >
  104. <template #header="scope">
  105. <div>
  106. {{
  107. scope.column.label.slice(0, scope.column.label.indexOf("("))
  108. }}
  109. </div>
  110. <div>
  111. {{ scope.column.label.slice(scope.column.label.indexOf("(")) }}
  112. </div>
  113. </template>
  114. </el-table-column>
  115. </el-table>
  116. <el-pagination
  117. @size-change="handleSizeChange"
  118. @current-change="handleCurrentChange"
  119. :current-page="page.currentPage"
  120. :page-size="page.pagesize"
  121. layout="total, prev, pager, next, jumper"
  122. :total="page.total"
  123. >
  124. </el-pagination>
  125. </div>
  126. </div>
  127. <el-dialog
  128. v-model="dialogVisible"
  129. width="70%"
  130. top="40px"
  131. custom-class="modal"
  132. :close-on-click-modal="false"
  133. >
  134. <template #title>
  135. <div class="dialog-title">
  136. <div class="title">运行指标性能分析报告</div>
  137. </div>
  138. </template>
  139. <div class="body" :style="pageHeight">
  140. <report-dialog ref="reportDia"></report-dialog>
  141. </div>
  142. </el-dialog>
  143. </div>
  144. </template>
  145. <script>
  146. import {
  147. getApicompanyslist,
  148. getApiwpByCplistlist,
  149. getApisingleanalysisMainlist,
  150. } from "@/api/monthlyPerformanceAnalysis";
  151. import ReportDialog from "./reportDialog.vue";
  152. import utils from "@/utills/downXlsx";
  153. export default {
  154. name: "monthlyAnalysis", //单机月度分析
  155. components: {
  156. ReportDialog,
  157. },
  158. data() {
  159. return {
  160. companyVal: "",
  161. companyOptions: [],
  162. stationVal: "",
  163. stationOptions: [],
  164. pickerTimer: "",
  165. pickerTimerYear: "",
  166. pickerTimerMonth: "",
  167. monthMachineData: [],
  168. showBtn: true,
  169. tabIndex: -1,
  170. // tabOptions: [
  171. // { id: -1, name: "风电" },
  172. // { id: -2, name: "光伏" },
  173. // ],
  174. tableHeader: [
  175. { title: "实际发电量(万kWh)", code: "fdl" },
  176. { title: "理论发电量(万kWh)", code: "llfdl" },
  177. { title: "设备利用小时数(小时)", code: "lyxs" },
  178. { title: "等效可用系数(%)", code: "dxklyxs" },
  179. { title: "平均风速(m/s)", code: "fs" },
  180. { title: "小风切入风速(m/s)", code: "xfqr" },
  181. { title: "有效风时数(小时)", code: "yxfss" },
  182. { title: "故障损失电量(万kWh)", code: "gzss" },
  183. { title: "调度限电损失(万kWh)", code: "xdss" },
  184. { title: "计划检修损失(万kWh)", code: "jxss" },
  185. { title: "性能未达标损失(万kWh)", code: "xnss" },
  186. { title: "受累损失电量(万kWh)", code: "slss" },
  187. { title: "故障停用时间(小时)", code: "gzxs" },
  188. { title: "检修停用时间(小时)", code: "jxxs" },
  189. { title: "机组功率一致性(%)", code: "glyzxxs" },
  190. ],
  191. tableHeaderGf: [
  192. { title: "实际发电量(万kWh)", code: "fdl" },
  193. { title: "理论发电量(万kWh)", code: "llfdl" },
  194. { title: "设备利用小时数(小时)", code: "lyxs" },
  195. { title: "等效可用系数(%)", code: "dxklyxs" },
  196. { title: "平均光照度(m/s)", code: "fs" },
  197. { title: "有效光时数(小时)", code: "yxfss" },
  198. { title: "故障损失电量(万kWh)", code: "gzss" },
  199. { title: "调度限电损失(万kWh)", code: "xdss" },
  200. { title: "计划检修损失(万kWh)", code: "jxss" },
  201. { title: "性能未达标损失(万kWh)", code: "xnss" },
  202. { title: "受累损失电量(万kWh)", code: "slss" },
  203. { title: "故障停用时间(小时)", code: "gzxs" },
  204. { title: "检修停用时间(小时)", code: "jxxs" },
  205. { title: "机组功率一致性(%)", code: "glyzxxs" },
  206. ],
  207. page: {
  208. pagesize: 21,
  209. currentPage: 1,
  210. total: 0,
  211. },
  212. dialogTitle: "",
  213. dialogVisible: false,
  214. isFullScreen: false,
  215. };
  216. },
  217. created() {
  218. const clientHeight =
  219. document.documentElement.clientHeight || document.body.clientHeight;
  220. if (clientHeight === 1080) {
  221. this.isFullScreen = true;
  222. } else {
  223. this.isFullScreen = false;
  224. }
  225. this.getCompanyData();
  226. },
  227. mounted() {
  228. window.onresize = () => {
  229. const clientHeight =
  230. document.documentElement.clientHeight || document.body.clientHeight;
  231. this.isFullScreen = window.screen.height == clientHeight;
  232. this.getTableData();
  233. };
  234. },
  235. methods: {
  236. // 获取公司列表
  237. async getCompanyData() {
  238. this.companyOptions = [];
  239. this.pickerTimer = this.getchangeTime(new Date());
  240. const { data: datas } = await getApicompanyslist();
  241. this.companyOptions = datas.data;
  242. this.companyVal = datas.data[0]?.id;
  243. this.getStationData(this.companyVal);
  244. },
  245. // changeBtnsd(id) {
  246. // this.tabIndex = id;
  247. // this.stationVal = "";
  248. // this.stationOptions = [];
  249. // this.getStationData();
  250. // },
  251. changeCompan(val) {
  252. this.companyVal = val;
  253. this.getStationData();
  254. },
  255. async getStationData() {
  256. let params = {
  257. type: this.tabIndex,
  258. companyid: this.companyVal,
  259. };
  260. const { data: datas } = await getApiwpByCplistlist(params);
  261. this.stationOptions = datas.data;
  262. this.stationVal = datas.data[0].id;
  263. this.getTableData();
  264. },
  265. changeStation(val) {
  266. this.stationVal = val;
  267. this.getTableData();
  268. },
  269. seachData() {
  270. this.getTableData();
  271. },
  272. async getTableData() {
  273. let params = {
  274. cmId: this.companyVal,
  275. type: this.tabIndex,
  276. pageNum: this.page.currentPage,
  277. pageSize: this.page.pagesize,
  278. year: this.pickerTimer.slice(0, this.pickerTimer.indexOf("-")),
  279. month: this.pickerTimer.slice(this.pickerTimer.indexOf("-") + 1),
  280. wpId: this.stationVal,
  281. };
  282. const { data: datas } = await getApisingleanalysisMainlist(params);
  283. this.monthMachineData = datas.data.values;
  284. this.page.total = datas.data.total;
  285. },
  286. handleSizeChange(val) {
  287. this.page.pagesize = val;
  288. this.getTableData();
  289. },
  290. handleCurrentChange(val) {
  291. this.page.currentPage = val;
  292. this.getTableData();
  293. },
  294. //转换时间
  295. getchangeTime(date) {
  296. var y = date.getFullYear();
  297. var m = date.getMonth() + 1;
  298. m = m < 10 ? "0" + m : m;
  299. return y + "-" + m;
  300. },
  301. reportDialogFn(row) {
  302. this.dialogVisible = true;
  303. this.dialogTitle = row.wtcode;
  304. this.pickerTimerYear = this.pickerTimer.substring(
  305. 0,
  306. this.pickerTimer.indexOf("-")
  307. );
  308. this.pickerTimerMonth = this.pickerTimer.substring(
  309. this.pickerTimer.indexOf("-") + 1
  310. );
  311. this.$nextTick(() => {
  312. this.$refs.reportDia.pickerTimerYear = this.pickerTimerYear;
  313. this.$refs.reportDia.pickerTimerMonth = this.pickerTimerMonth;
  314. this.$refs.reportDia.dialogTitle = this.dialogTitle;
  315. this.$refs.reportDia.init(row);
  316. });
  317. },
  318. downXlsxFn() {
  319. let header = [];
  320. this.tableHeader.forEach((it) => {
  321. if (it.title !== "操作") {
  322. header.push(it.title);
  323. }
  324. });
  325. if (this.monthMachineData.length > 0) {
  326. utils.exportExcel(
  327. this.$refs["month_table"].$el,
  328. header,
  329. "单机月度分析"
  330. );
  331. }
  332. },
  333. },
  334. };
  335. </script>
  336. <style lang="less">
  337. .monthMachine {
  338. padding: 0 20px;
  339. height: 100%;
  340. .monthMachine_title {
  341. .leftContent {
  342. width: 242px;
  343. height: 41px;
  344. line-height: 41px;
  345. background: url("~@/assets/imgs/title_left_bg1.png") no-repeat;
  346. span {
  347. font-size: 16px;
  348. font-weight: 400;
  349. color: #05bb4c;
  350. margin-left: 25px;
  351. }
  352. }
  353. .floatLeft {
  354. float: left;
  355. }
  356. .floatRight {
  357. float: right;
  358. }
  359. .rightContent {
  360. width: 212px;
  361. height: 28px;
  362. margin-top: 13px;
  363. background: url("../../../../assets/imgs/title_right_bg.png");
  364. }
  365. }
  366. .clearfix::after {
  367. content: "";
  368. clear: both;
  369. height: 0;
  370. line-height: 0;
  371. visibility: hidden;
  372. display: block;
  373. }
  374. .clearfix {
  375. zoom: 1;
  376. }
  377. .monthMachine_top {
  378. display: flex;
  379. flex-direction: row;
  380. align-items: center;
  381. padding-top: 5px;
  382. padding-bottom: 5px;
  383. .station {
  384. display: flex;
  385. flex-direction: row;
  386. align-items: center;
  387. font-size: 14px;
  388. font-family: Microsoft YaHei;
  389. font-weight: 400;
  390. color: #b3b3b3;
  391. margin-right: 10px;
  392. margin-left: 10px;
  393. }
  394. .tabCut {
  395. display: inline-block;
  396. margin: 0 10px;
  397. div {
  398. display: inline-block;
  399. width: 60px;
  400. height: 27px;
  401. border: 1px solid #274934;
  402. text-align: center;
  403. line-height: 25px;
  404. cursor: pointer;
  405. }
  406. div:nth-child(1) {
  407. border-radius: 13px 0px 0px 13px;
  408. }
  409. div:nth-child(2) {
  410. border-radius: 0px 13px 13px 0px;
  411. }
  412. .active {
  413. background-color: rgba(5, 187, 76, 0.9);
  414. color: #fff;
  415. }
  416. }
  417. .search-input {
  418. margin-left: 10px;
  419. .el-input__inner {
  420. width: 175px;
  421. }
  422. .el-input__suffix {
  423. right: -50px;
  424. }
  425. }
  426. .but {
  427. display: flex;
  428. flex-direction: row;
  429. align-content: center;
  430. margin-left: 20px;
  431. .buttons:nth-child(1) {
  432. background: rgba(5, 187, 76, 0.6);
  433. border: 1px solid #3b6c53;
  434. border-radius: 13px;
  435. color: #fff;
  436. &:hover {
  437. background: rgba(5, 187, 76, 0.9);
  438. border-radius: 13px;
  439. color: #fff;
  440. }
  441. }
  442. .buttons:nth-child(2) {
  443. background: rgba(67, 81, 107, 0.3);
  444. border: 1px solid #3b6c53;
  445. border-radius: 13px;
  446. font-size: 14px;
  447. color: #b3b3b3;
  448. }
  449. }
  450. }
  451. .economicTable1 {
  452. height: calc(100% - 40px);
  453. .el-pagination {
  454. padding-top: 5px;
  455. display: flex;
  456. justify-content: flex-end;
  457. }
  458. }
  459. }
  460. </style>