assessindex.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. <template>
  2. <div>
  3. <div class="query mg-b-8">
  4. <div class="query-items">
  5. <div
  6. class="newspan"
  7. v-for="(item, index) of optionData"
  8. :key="index"
  9. :class="{ active: cur == index }"
  10. @click="handleOpen(item, index)"
  11. >
  12. {{ item }}
  13. </div>
  14. </div>
  15. </div>
  16. <div class="query mg-b-8">
  17. <div class="query-items">
  18. <div class="query-item">
  19. <div class="lable">场站:</div>
  20. <div class="search-input">
  21. <el-select
  22. v-model="value1"
  23. clearable
  24. placeholder="请选择"
  25. popper-class="select"
  26. >
  27. <el-option
  28. v-for="item in ChangZhan"
  29. :key="item.id"
  30. :value="item.id"
  31. :label="item.name"
  32. ></el-option>
  33. </el-select>
  34. </div>
  35. </div>
  36. <div class="query-item" v-if="shows == 'd'">
  37. <div class="lable">日期:</div>
  38. <div class="search-input">
  39. <el-date-picker
  40. v-model="date"
  41. type="date"
  42. placeholder="选择日期"
  43. popper-class="date-select"
  44. value-format="YYYY-MM-DD"
  45. ></el-date-picker>
  46. </div>
  47. </div>
  48. <div class="query-item" v-if="shows == 'm'">
  49. <div class="lable">年月:</div>
  50. <div class="search-input">
  51. <el-date-picker
  52. v-model="date"
  53. type="month"
  54. placeholder="选择年月"
  55. popper-class="date-select"
  56. value-format="YYYY-MM"
  57. ></el-date-picker>
  58. </div>
  59. </div>
  60. <div class="query-item" v-if="shows == 'y'">
  61. <div class="lable">年:</div>
  62. <div class="search-input">
  63. <el-date-picker
  64. v-model="date"
  65. type="year"
  66. placeholder="选择年"
  67. popper-class="date-select"
  68. value-format="YYYY"
  69. ></el-date-picker>
  70. </div>
  71. </div>
  72. <div class="query-actions">
  73. <button class="btn green" @click="handleSubmit">查询</button>
  74. <button class="btn green" @click="contrast">对比</button>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="table-box">
  79. <div class="title">{{ showTitle }}</div>
  80. <ComTable
  81. ref="curRef"
  82. :data="tableData"
  83. :pageSize="20"
  84. :pageable="false"
  85. height="73vh"
  86. v-loading="tableLoading"
  87. element-loading-text="拼命加载中.."
  88. element-loading-background="rgba(0, 0, 0, 0.8)"
  89. ></ComTable>
  90. </div>
  91. <el-dialog
  92. :title="dialogTitle"
  93. v-model="dialogVisible"
  94. width="70%"
  95. top="10vh"
  96. custom-class="modal"
  97. >
  98. <dayinfo :gridDatas="dialogData1" :chartDatas="dialogData2" />
  99. </el-dialog>
  100. <el-dialog
  101. :title="'历史数据查询>>' + hisDialogTitle"
  102. v-model="hisDialogVisible"
  103. width="70%"
  104. top="10vh"
  105. custom-class="modal"
  106. >
  107. <gradeHistory :option="hisOption" ref="gradeHistory" />
  108. </el-dialog>
  109. </div>
  110. </template>
  111. <script>
  112. import ComTable from "@/components/coms/table/table-unpage.vue";
  113. import Dayinfo from "../dayinfo.vue";
  114. import GradeHistory from "../gradeHistory.vue";
  115. import api1 from "@api/economic/index.js";
  116. import api from "@api/wisdomOverhaul/grade/index.js";
  117. import { registerLoading } from "echarts";
  118. export default {
  119. name: "gradeassessment",
  120. components: { ComTable, Dayinfo, GradeHistory },
  121. data() {
  122. let that = this;
  123. return {
  124. cur: 0,
  125. optionData: [
  126. "风机日信息量化评级管理",
  127. "风机月信息量化评级管理",
  128. "风机年信息量化评级管理",
  129. ],
  130. dialogTitle: "日信息对比",
  131. dialogVisible: false,
  132. hisDialogVisible: false,
  133. hisDialogTitle: "",
  134. ChangZhan: [],
  135. value1: "CL_FDC",
  136. date: "",
  137. shows: "d",
  138. showTitle: "风机日信息量化评级管理",
  139. tableLoading: true,
  140. dataIds: new Set(),
  141. dialogData1: [],
  142. dialogData2: [],
  143. hisOption: {},
  144. tableData: {
  145. column: [
  146. {
  147. name: "",
  148. field: "fj",
  149. is_num: false,
  150. is_light: false,
  151. sortable: false,
  152. template: () => {
  153. return "<input class='check curCheckBox checkItem' type='CheckBox'/>";
  154. },
  155. click: function (event, data) {
  156. if (event.target.checked == false) {
  157. that.dataIds.delete(data.id);
  158. }
  159. if (event.target.checked) {
  160. if (that.dataIds.size < 2) {
  161. that.dataIds.add(data.id);
  162. } else {
  163. event.target.checked = false;
  164. }
  165. }
  166. },
  167. },
  168. {
  169. name: "风机编号",
  170. field: "windturbineid",
  171. is_num: false,
  172. is_light: false,
  173. sortable: true,
  174. id: "id",
  175. },
  176. {
  177. name: "等級",
  178. field: "level",
  179. is_num: false,
  180. is_light: false,
  181. sortable: true,
  182. id: "id",
  183. },
  184. {
  185. name: "综合排名",
  186. field: "rank",
  187. is_num: false,
  188. is_light: false,
  189. sortable: true,
  190. id: "id",
  191. },
  192. {
  193. name: "发电量(kWh)",
  194. field: "dayfdl",
  195. is_num: false,
  196. is_light: false,
  197. sortable: true,
  198. id: "id",
  199. },
  200. {
  201. name: "理论发电量(kWh)",
  202. field: "dayllfdl",
  203. is_num: false,
  204. is_light: false,
  205. sortable: true,
  206. id: "id",
  207. },
  208. {
  209. name: "平均风速(m/s)",
  210. field: "dayfs",
  211. is_num: false,
  212. is_light: false,
  213. sortable: true,
  214. id: "id",
  215. },
  216. {
  217. name: "平均功率(kW)",
  218. field: "daygl",
  219. is_num: false,
  220. is_light: false,
  221. sortable: true,
  222. id: "id",
  223. },
  224. {
  225. name: "故障损失电量(kWh)",
  226. field: "daygzssdl",
  227. is_num: false,
  228. is_light: false,
  229. sortable: true,
  230. id: "id",
  231. },
  232. {
  233. name: "限电损失电量(kWh)",
  234. field: "dayxdssdl",
  235. is_num: false,
  236. is_light: false,
  237. sortable: true,
  238. id: "id",
  239. },
  240. {
  241. name: "检修损失电量(kWh)",
  242. field: "daywhssdl",
  243. is_num: false,
  244. is_light: false,
  245. sortable: true,
  246. id: "id",
  247. },
  248. {
  249. name: "性能损失电量(kWh)",
  250. field: "dayxnssdl",
  251. is_num: false,
  252. is_light: false,
  253. sortable: true,
  254. id: "id",
  255. },
  256. {
  257. name: "利用小时数(h)",
  258. field: "daylyxs",
  259. is_num: false,
  260. is_light: false,
  261. sortable: true,
  262. id: "id",
  263. },
  264. {
  265. name: "拟合优度(%)",
  266. field: "daynhyd",
  267. is_num: false,
  268. is_light: false,
  269. sortable: true,
  270. id: "id",
  271. },
  272. {
  273. name: "设备可利用率(%)",
  274. field: "daysbklyl",
  275. is_num: false,
  276. is_light: false,
  277. sortable: true,
  278. id: "id",
  279. },
  280. {
  281. name: "等效可用系数(%)",
  282. field: "daydxkyxs",
  283. is_num: false,
  284. is_light: false,
  285. sortable: true,
  286. id: "id",
  287. },
  288. {
  289. name: "有效风时数(h)",
  290. field: "dayyxfss",
  291. is_num: false,
  292. is_light: false,
  293. sortable: true,
  294. id: "id",
  295. },
  296. {
  297. name: "平均切入风速(m/s)",
  298. field: "dayxfqr",
  299. is_num: false,
  300. is_light: false,
  301. sortable: true,
  302. id: "id",
  303. },
  304. {
  305. name: "静风频率(%)",
  306. field: "dayjfpl",
  307. is_num: false,
  308. is_light: false,
  309. sortable: true,
  310. id: "id",
  311. },
  312. {
  313. name: "功率一致性系数(%)",
  314. field: "dayglyzxxs",
  315. is_num: false,
  316. is_light: false,
  317. sortable: true,
  318. id: "id",
  319. },
  320. // {
  321. // name: "操作",
  322. // field: "sjbz",
  323. // is_num: false,
  324. // is_light: false,
  325. // sortable: true,
  326. // id: "id",
  327. // template: () => {
  328. // return "<el-button type='text' style='cursor: pointer;' value='xq'>详情</el-button>&nbsp;<el-button type='text' style='cursor: pointer;' value='ls'>历史</el-button>";
  329. // },
  330. // click: function (event, data) {
  331. // if ("xq" == event.target.getAttribute("value")) {
  332. // that.dialogVisible = true;
  333. // that.dialogData1 = [data];
  334. // const service1 = {
  335. // name: data.windturbineid,
  336. // value: [
  337. // data["yearxfqr"],
  338. // data["yearxnssdl"],
  339. // data["yearnhyd"],
  340. // data["yearglyzxxs"],
  341. // data["yearlyxs"],
  342. // data["yearsbklyl"],
  343. // data["yeardxkyxs"],
  344. // data["yearyxfss"],
  345. // data["yearfs"],
  346. // data["yearjfpl"],
  347. // ],
  348. // };
  349. // const chartData = [
  350. // {
  351. // indicator: [
  352. // "平均切入风速",
  353. // "性能损失电量",
  354. // "拟合优度",
  355. // "功率一致性系数",
  356. // "利用小时",
  357. // "设备可利用率",
  358. // "等效可利用系数",
  359. // "有效风时数",
  360. // "平均风速",
  361. // "静风频率",
  362. // ],
  363. // data: [service1],
  364. // },
  365. // ];
  366. // that.dialogData2 = chartData;
  367. // }
  368. // if ("ls" == event.target.getAttribute("value")) {
  369. // that.hisOption["shows"] = that.shows;
  370. // that.hisOption["date"] = that.date;
  371. // that.hisOption["windturbineid"] = data.windturbineid;
  372. // that.hisDialogTitle = data.windturbineid;
  373. // that.hisDialogVisible = true;
  374. // that.$refs.gradeHistory.getTable();
  375. // }
  376. // },
  377. // },
  378. ],
  379. data: [],
  380. },
  381. tableId: "",
  382. };
  383. },
  384. created() {
  385. this.ChangZhanVal();
  386. this.date = this.getDate(0);
  387. this.getTable(this.date);
  388. },
  389. methods: {
  390. clearCheckBox() {
  391. this.$refs.curRef.clearCheckBox();
  392. this.dataIds = new Set();
  393. },
  394. // 获取表格数据
  395. getTable(date) {
  396. // let that = this;
  397. let subUrl = "";
  398. const data = {
  399. isAsc: "",
  400. wpId: this.value1,
  401. orderby: "",
  402. };
  403. if ("d" == this.shows) {
  404. data["recorddate"] = date;
  405. data["type"] = 1;
  406. }
  407. if ("m" == this.shows) {
  408. data["recorddate"] = date;
  409. data["type"] = 2;
  410. }
  411. if ("y" == this.shows) {
  412. data["recorddate"] = date;
  413. data["type"] = 3;
  414. }
  415. this.tableLoading = true;
  416. api.levelAssessmentList(data).then((res) => {
  417. this.tableLoading = false;
  418. if (res.code === 200) {
  419. var data = [];
  420. this.tableData.data = res.data;
  421. }
  422. });
  423. },
  424. // tab
  425. handleOpen(vl, index) {
  426. this.$nextTick(() => {
  427. this.cur = index;
  428. this.showTitle = vl;
  429. if (index == 0) {
  430. this.date = this.getDate(0);
  431. this.shows = "d";
  432. this.dialogTitle = "日信息对比";
  433. }
  434. if (index == 1) {
  435. this.date = this.getDate(1);
  436. this.shows = "m";
  437. this.dialogTitle = "月信息对比";
  438. }
  439. if (index == 2) {
  440. this.date = this.getDate(2);
  441. this.shows = "y";
  442. this.dialogTitle = "年信息对比";
  443. }
  444. this.getTable(this.date);
  445. });
  446. },
  447. // 场站
  448. ChangZhanVal() {
  449. api1.getWpList({ type: "-1" }).then((res) => {
  450. this.ChangZhan = res.data?.data || [];
  451. this.value1 = res.data?.data?.[0]?.id || "";
  452. });
  453. },
  454. // 查询
  455. handleSubmit() {
  456. this.clearCheckBox();
  457. this.getTable(this.date);
  458. },
  459. // 日信息对比
  460. contrast() {
  461. if (this.dataIds.size == 2) {
  462. this.dialogVisible = true;
  463. const tmpArr = Array.from(this.dataIds);
  464. const data = {
  465. gaid1: tmpArr[0],
  466. gaid2: tmpArr[1],
  467. };
  468. api.levelAssessmentComparison(data).then((res) => {
  469. this.dialogData1 = res.data.data;
  470. // 图表
  471. let index = 0;
  472. let data1 = [];
  473. let data2 = [];
  474. for (const key in res.data.charts) {
  475. switch (index) {
  476. case 0:
  477. data1 = this.getChartData(key, res.data.charts);
  478. index++;
  479. break;
  480. case 1:
  481. data2 = this.getChartData(key, res.data.charts);
  482. break;
  483. }
  484. }
  485. const chartData = [
  486. {
  487. indicator: [
  488. "平均切入风速",
  489. "性能损失电量",
  490. "拟合优度",
  491. "功率一致性系数",
  492. "利用小时",
  493. "设备可利用率",
  494. "等效可利用系数",
  495. "有效风时数",
  496. "平均风速",
  497. "静风频率",
  498. ],
  499. data: [],
  500. },
  501. ];
  502. if (data1) {
  503. chartData[0].data.push(data1);
  504. }
  505. if (data2) {
  506. chartData[0].data.push(data2);
  507. }
  508. this.dialogData2 = chartData;
  509. });
  510. }
  511. this.clearCheckBox();
  512. },
  513. getChartData(key, data) {
  514. const chartData = {};
  515. const rowMap = {};
  516. let resData = data[key];
  517. resData.forEach(function (rowData, index) {
  518. rowMap[rowData["target"]] = rowData["data"];
  519. });
  520. chartData["name"] = key;
  521. chartData["value"] = [];
  522. chartData["value"].push(rowMap["平均切入风速"]);
  523. chartData["value"].push(rowMap["性能损失电量"]);
  524. chartData["value"].push(rowMap["拟合优度"]);
  525. chartData["value"].push(rowMap["功率一致性系数"]);
  526. chartData["value"].push(rowMap["利用小时"]);
  527. chartData["value"].push(rowMap["设备可利用率"]);
  528. chartData["value"].push(rowMap["等效可利用系数"]);
  529. chartData["value"].push(rowMap["有效风时数"]);
  530. chartData["value"].push(rowMap["平均风速"]);
  531. chartData["value"].push(rowMap["静风频率"]);
  532. return chartData;
  533. },
  534. // 获取日期
  535. getDate(vl) {
  536. var date = new Date();
  537. var year = date.getFullYear(),
  538. month = date.getMonth() + 1,
  539. day = date.getDate() - 1;
  540. month >= 1 && month <= 9 ? (month = "0" + month) : "";
  541. day >= 0 && day <= 9 ? (day = "0" + day) : "";
  542. if (vl == 0) {
  543. return year + "-" + month + "-" + day;
  544. }
  545. if (vl == 1) {
  546. return year + "-" + month;
  547. }
  548. if (vl == 2) {
  549. return year + "";
  550. }
  551. },
  552. },
  553. };
  554. </script>
  555. <style scoped>
  556. .newsDiv {
  557. color: rgba(255, 255, 255, 0.75);
  558. background-color: rgba(255, 255, 255, 0.1);
  559. margin-bottom: 8px;
  560. line-height: 3.4259vh;
  561. padding: 0 15px;
  562. }
  563. .newspan {
  564. line-height: 30px;
  565. cursor: pointer;
  566. padding: 0 1vw;
  567. margin: 0 2px;
  568. color: #9ca5a8;
  569. transition: color 0.2s ease-in-out;
  570. position: relative;
  571. }
  572. .newspan:hover {
  573. background: linear-gradient(
  574. to top,
  575. rgba(5, 187, 76, 0.5),
  576. rgba(5, 187, 76, 0)
  577. );
  578. color: white;
  579. position: relative;
  580. }
  581. .newspan:hover::after {
  582. content: "";
  583. position: absolute;
  584. width: 100%;
  585. height: 0.463vh;
  586. border: 0.093vh solid #05bb4c;
  587. border-top: 0;
  588. left: 0;
  589. bottom: 0;
  590. box-sizing: border-box;
  591. }
  592. .active {
  593. background: linear-gradient(
  594. to top,
  595. rgba(5, 187, 76, 0.5),
  596. rgba(5, 187, 76, 0)
  597. );
  598. color: white;
  599. position: relative;
  600. }
  601. .active::after {
  602. content: "";
  603. position: absolute;
  604. width: 100%;
  605. height: 0.463vh;
  606. border: 0.093vh solid #05bb4c;
  607. border-top: 0;
  608. left: 0;
  609. bottom: 0;
  610. box-sizing: border-box;
  611. }
  612. .title {
  613. background: rgba(255, 255, 255, 0.1);
  614. margin-bottom: 8px;
  615. padding: 1vh;
  616. }
  617. </style>
  618. <style lang="less">
  619. .decision-page-2 {
  620. .content .project-table {
  621. tbody {
  622. height: calc(100vh - 24.5vh);
  623. }
  624. }
  625. .project-table {
  626. overflow: auto;
  627. tbody {
  628. height: 239px;
  629. }
  630. th,
  631. td {
  632. color: #b2bdc0;
  633. &:nth-child(1) {
  634. width: 50px;
  635. }
  636. &:nth-child(2) {
  637. width: 50px;
  638. }
  639. }
  640. }
  641. .action {
  642. text-decoration: underline;
  643. color: @green;
  644. cursor: pointer;
  645. }
  646. }
  647. </style>