gradeassessment.vue 17 KB

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