propertBenchmark.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. import * as echarts from "echarts";
  2. //import FiveLossRatesHistogramChart from "../../views/benchMarking/FiveLossRatesHistogramChart.vue";
  3. export default {
  4. data() {
  5. return {
  6. pickerOptions: {
  7. disabledDate(time) {
  8. return time.getTime() > Date.now();
  9. },
  10. },
  11. formInline: {
  12. windfarm: "",
  13. project: "",
  14. line: "",
  15. },
  16. timedate: [],
  17. isAsc: "asc",
  18. beginDate: "",
  19. endDate: "",
  20. gridData: [],
  21. multipleSelection: [],
  22. sortInOrder: [],
  23. sortInOrderTop: [],
  24. sortInOrde2: [],
  25. getTableData: [],
  26. sortInOrderTop2: [],
  27. fdcName1: "",
  28. fdcName2: "",
  29. wp_n_1: {},
  30. wp_n_2: {},
  31. currentPage2: 1,
  32. pagesize: 10,
  33. classification: [
  34. {
  35. id: "qf",
  36. label: "弃风率",
  37. },
  38. {
  39. id: "gz",
  40. label: "故障损失率",
  41. },
  42. {
  43. id: "jx",
  44. label: "检修损失率",
  45. },
  46. {
  47. id: "xn",
  48. label: "性能损失率",
  49. },
  50. {
  51. id: "sl",
  52. label: "受累损失率",
  53. },
  54. ],
  55. options: [
  56. {
  57. value: "MHS_FDC",
  58. label: "麻黄山风电场",
  59. },
  60. {
  61. value: "NSS_FDC",
  62. label: "牛首山风电场",
  63. },
  64. {
  65. value: "SBQ_FDC",
  66. label: "石板泉风电场",
  67. },
  68. {
  69. value: "QS_FDC",
  70. label: "青山风电场",
  71. },
  72. {
  73. value: "XS_FDC",
  74. label: "香山风电场",
  75. },
  76. ],
  77. value: "",
  78. value2: "gz",
  79. wpId: [],
  80. wpName: [],
  81. orderByColumn: "",
  82. dialogTableVisible: false,
  83. lineDataOption: [],
  84. getChartDataValue: [],
  85. getChartDataValue2: [],
  86. chartsAName2: "",
  87. selectrowdate: {},
  88. };
  89. },
  90. // components: {
  91. // FiveLossRatesHistogramChart: FiveLossRatesHistogramChart,
  92. // },
  93. created() {
  94. this.FiveLossInformation();
  95. },
  96. methods: {
  97. headStyle() {
  98. return "text-align:center";
  99. },
  100. onSubmit() {
  101. },
  102. handleClick() {},
  103. deleteRow(index, rows) {
  104. rows.splice(index, 1);
  105. },
  106. queryApData() {
  107. this.FiveLossInformation();
  108. },
  109. /**
  110. *
  111. * 检查是否选择两个项目
  112. */
  113. querycheck(){
  114. if(this.selectrowdate.length == 2){
  115. this.queryApDataMx();
  116. }else{
  117. this.$message({
  118. message:"请选择两个项目!",
  119. type:'error'
  120. });
  121. return
  122. }
  123. },
  124. /**
  125. * 获取表格数据
  126. */
  127. handleEdit(a, b) {
  128. this.wpId = [];
  129. this.lineDataOption = [];
  130. if (this.multipleSelection.length == 2) {
  131. for (let i = 0; i < this.multipleSelection.length; i++) {
  132. this.wpId.push(this.multipleSelection[i].wpId);
  133. this.wpName.push(this.multipleSelection[i].wpName);
  134. this.lineDataOption.push({
  135. id: this.multipleSelection[i].wpId,
  136. name: this.multipleSelection[i].wpName,
  137. });
  138. }
  139. this.$router.push({
  140. path: "/propertBenchmarkParticulars",
  141. query: {
  142. wpId: this.wpId,
  143. beginDate: this.beginDate,
  144. endDate: this.endDate,
  145. wpName: this.wpName,
  146. select: this.lineDataOption,
  147. },
  148. });
  149. } else {
  150. this.lineDataOption.push({ id: b.wpId, name: b.wpName });
  151. this.$router.push({
  152. path: "/propertBenchmarkParticulars",
  153. query: {
  154. wpId: b.wpId,
  155. beginDate: this.beginDate,
  156. endDate: this.endDate,
  157. wpName: b.wpName,
  158. select: this.lineDataOption,
  159. },
  160. });
  161. }
  162. },
  163. /**
  164. * 查询检查
  165. */
  166. checkwindfarm() {
  167. if (this.formInline.windfarm == "") {
  168. this.$message.error("请选择风场!");
  169. return;
  170. }
  171. },
  172. checkproject() {
  173. if (this.formInline.project == "") {
  174. this.$message.error("请选择项目!");
  175. return;
  176. }
  177. if (new Date(this.timedate) == null) {
  178. this.$message.error("请选择时间");
  179. return;
  180. }
  181. },
  182. /**
  183. * 弹出控制
  184. */
  185. queryApDataMx() {
  186. this.dialogTableVisible = true;
  187. this.check_wpid();
  188. this.$nextTick(function () {
  189. this.ECZM.bar_tc("leiDaTu8" , this.wp_n_1 , this.wp_n_2 , this.wp_n_1.wpId , this.wp_n_2.wpId);
  190. this.ECZM.leida_tc("leiDatu6" , this.sortInOrder,this.fdcName1,this.sortInOrderTop,this.fdcName2);
  191. });
  192. },
  193. handleSelectionChange(val) {
  194. this.selectrowdate = val;
  195. },
  196. /**
  197. * 数据转换
  198. */
  199. check_wpid() {
  200. this.wp_n_1 = {};
  201. this.wp_n_2 = {};
  202. this.sortInOrder = [];
  203. this.sortInOrderTop = [];
  204. this.getTableData = [];
  205. this.sortInOrde2 = [];
  206. this.fdcName1 = "";
  207. this.fdcName2 = "";
  208. this.wp_n_1 = this.selectrowdate[0];
  209. this.wp_n_2 = this.selectrowdate[1];
  210. this.fdcName1 = this.selectrowdate[0].wpName;
  211. this.fdcName2 = this.selectrowdate[1].wpName;
  212. this.sortInOrder.push(
  213. this.selectrowdate[0].fnlyl,
  214. this.selectrowdate[0].xqjsl,
  215. this.selectrowdate[0].ztzhjsl,
  216. this.selectrowdate[0].fwjsl,
  217. this.selectrowdate[0].slssl,
  218. this.selectrowdate[0].xnssl,
  219. this.selectrowdate[0].qfl,
  220. this.selectrowdate[0].jxssl,
  221. this.selectrowdate[0].gzssl
  222. );
  223. this.sortInOrderTop.push(
  224. this.selectrowdate[1].fnlyl,
  225. this.selectrowdate[1].xqjsl,
  226. this.selectrowdate[1].ztzhjsl,
  227. this.selectrowdate[1].fwjsl,
  228. this.selectrowdate[1].slssl,
  229. this.selectrowdate[1].xnssl,
  230. this.selectrowdate[1].qfl,
  231. this.selectrowdate[1].jxssl,
  232. this.selectrowdate[1].gzssl
  233. );
  234. // for (let i = 0; i < this.multipleSelection.length; i++) {
  235. // this.sortInOrde2.push({
  236. // product: this.multipleSelection[i].wpName,
  237. // "限电损失电量单位:万KWh": this.multipleSelection[i].xdss,
  238. // "故障损失电量单位:万KWh": this.multipleSelection[i].gzss,
  239. // "检修损失电量单位:万KWh": this.multipleSelection[i].jxssl,
  240. // "性能损失电量单位:万KWh": this.multipleSelection[i].xnssl,
  241. // "受累损失电量单位:万KWh": this.multipleSelection[i].slss,
  242. // });
  243. // }
  244. this.getTableData.push({
  245. index: "发电量",
  246. data1: this.selectrowdate[0].fdl,
  247. data2: this.selectrowdate[1].fdl,
  248. });
  249. this.getTableData.push({
  250. index: "故障损失电量",
  251. data1: this.selectrowdate[0].gzss,
  252. data2: this.selectrowdate[1].gzss,
  253. });
  254. this.getTableData.push({
  255. index: "检修损失电量",
  256. data1: this.selectrowdate[0].jxssl,
  257. data2: this.selectrowdate[1].jxssl,
  258. });
  259. this.getTableData.push({
  260. index: "性能未达标损失电量",
  261. data1: this.selectrowdate[0].xnsslfraction,
  262. data2: this.selectrowdate[1].xnsslfraction,
  263. });
  264. this.getTableData.push({
  265. index: "受累损失电量",
  266. data1: this.selectrowdate[0].slss,
  267. data2: this.selectrowdate[1].slss,
  268. });
  269. this.getTableData.push({
  270. index: "风能利用率",
  271. data1: this.selectrowdate[0].fnlyl,
  272. data2: this.selectrowdate[1].fnlyl,
  273. });
  274. this.getTableData.push({
  275. index: "故障损失率",
  276. data1: this.selectrowdate[0].gzssl,
  277. data2: this.selectrowdate[1].gzssl,
  278. });
  279. this.getTableData.push({
  280. index: "检修损失率",
  281. data1: this.selectrowdate[0].jxssl,
  282. data2: this.selectrowdate[1].jxssl,
  283. });
  284. this.getTableData.push({
  285. index: "弃风率",
  286. data1: this.selectrowdate[0].qfl,
  287. data2: this.selectrowdate[1].qfl,
  288. });
  289. this.getTableData.push({
  290. index: "性能损失率",
  291. data1: this.selectrowdate[0].xnssl,
  292. data2: this.selectrowdate[1].xnssl,
  293. });
  294. this.getTableData.push({
  295. index: "受累损失率",
  296. data1: this.selectrowdate[0].slssl,
  297. data2: this.selectrowdate[1].slssl,
  298. });
  299. this.getTableData.push({
  300. index: "复位及时率",
  301. data1: this.selectrowdate[0].fwjsl,
  302. data2: this.selectrowdate[1].fwjsl,
  303. });
  304. this.getTableData.push({
  305. index: "消缺及时率",
  306. data1: this.selectrowdate[0].xqjsl,
  307. data2: this.selectrowdate[1].xqjsl,
  308. });
  309. this.getTableData.push({
  310. index: "状态转换率",
  311. data1: this.selectrowdate[0].ztzhjsl,
  312. data2: this.selectrowdate[1].ztzhjsl,
  313. });
  314. },
  315. handleSizeChange(val) {
  316. this.pagesize = val;
  317. },
  318. changeTableSort(column) {
  319. this.orderByColumn = column.prop;
  320. if (column.order == "descending") {
  321. this.isAsc = "desc";
  322. } else if (column.order == "ascending") {
  323. this.isAsc = "asc";
  324. }
  325. this.FiveLossInformation();
  326. },
  327. /**
  328. * 查询风机列表信息
  329. */
  330. FiveLossInformation() {
  331. var newData = new Date();
  332. this.timedate[0] = this.BASE.getBzDate(newData.getTime(),-1);
  333. this.timedate[1] = this.BASE.getBzDate(newData.getTime(),0);
  334. let that = this;
  335. this.API.get("/powercompare/windfarmAjax").then((res) => {
  336. that.options = res.data;
  337. }).catch(error =>{
  338. this.$message.error('获取数据失败');
  339. });
  340. if (this.timedate == "") {
  341. this.beginDate = this.timedate[0];
  342. this.endDate = this.timedate[1];
  343. } else {
  344. this.beginDate = this.timedate[0];
  345. this.endDate = this.timedate[1];
  346. }
  347. var fiveLossData = new URLSearchParams();
  348. fiveLossData.append("pageNum", this.currentPage2);
  349. fiveLossData.append("pageSize", this.pagesize);
  350. fiveLossData.append("orderByColumn", this.orderByColumn);
  351. fiveLossData.append("isAsc", this.isAsc);
  352. fiveLossData.append("wpId", this.value);
  353. fiveLossData.append("beginDate", this.beginDate);
  354. fiveLossData.append("endDate", this.endDate);
  355. this.API
  356. .post("/contrast/benchmarkLossList", fiveLossData)
  357. .then((res) => {
  358. that.gridData = res.data;
  359. that.getPackageData(that.gridData, that.value2);
  360. }).catch(error =>{
  361. this.$message.error('获取数据失败');
  362. });
  363. },
  364. getPackageData(gridData, value2) {
  365. for (let i = 0; i < gridData.length; i++) {
  366. this.getChartDataValue.push({
  367. value: gridData[i].fdl,
  368. name: gridData[i].wpName,
  369. });
  370. if (value2 == "gz") {
  371. this.chartsAName2 = "故障损失占比";
  372. this.getChartDataValue2.push({
  373. value: gridData[i].gzss,
  374. name: gridData[i].wpName,
  375. });
  376. } else if (value2 == "xn") {
  377. this.chartsAName2 = "性能损失占比";
  378. this.getChartDataValue2.push({
  379. value: gridData[i].qfss,
  380. name: gridData[i].wpName,
  381. });
  382. } else if (value2 == "qf") {
  383. this.chartsAName2 = "弃风率占比";
  384. this.getChartDataValue2.push({
  385. value: gridData[i].qfl,
  386. name: gridData[i].wpName,
  387. });
  388. } else if (value2 == "jx") {
  389. this.chartsAName2 = "检修损失占比";
  390. this.getChartDataValue2.push({
  391. value: gridData[i].whss,
  392. name: gridData[i].wpName,
  393. });
  394. } else if (value2 == "sl") {
  395. this.chartsAName2 = "受累损失占比";
  396. this.getChartDataValue2.push({
  397. value: gridData[i].slss,
  398. name: gridData[i].wpName,
  399. });
  400. }
  401. }
  402. this.getChartDataImport();
  403. this.getChartDataValue = [];
  404. this.getChartDataValue2 = [];
  405. },
  406. /**
  407. * 判断当前分类
  408. */
  409. getChartDataImport() {
  410. var charts = echarts.init(document.getElementById("chartPie"));
  411. let option = {
  412. title: {
  413. text: "发电量占比",
  414. left: "center",
  415. },
  416. color: ["#90ED7D", "#F7A35C", "#7CB5EC", "#434348", "#8085E9"],
  417. tooltip: {
  418. trigger: "item",
  419. },
  420. legend: {
  421. orient: "vertical",
  422. left: "left",
  423. },
  424. series: [
  425. {
  426. type: "pie",
  427. radius: "50%",
  428. data: this.getChartDataValue,
  429. emphasis: {
  430. itemStyle: {
  431. shadowBlur: 10,
  432. shadowOffsetX: 0,
  433. shadowColor: "rgba(0, 0, 0, 0.5)",
  434. },
  435. },
  436. },
  437. ],
  438. };
  439. charts.setOption(option);
  440. var charts2 = echarts.init(document.getElementById("chartPieRight"));
  441. let option2 = {
  442. title: {
  443. text: this.chartsAName2,
  444. left: "center",
  445. },
  446. color: ["#90ED7D", "#F7A35C", "#7CB5EC", "#434348", "#8085E9"],
  447. tooltip: {
  448. trigger: "item",
  449. },
  450. legend: {
  451. orient: "vertical",
  452. left: "left",
  453. },
  454. series: [
  455. {
  456. type: "pie",
  457. radius: "50%",
  458. data: this.getChartDataValue2,
  459. emphasis: {
  460. itemStyle: {
  461. shadowBlur: 10,
  462. shadowOffsetX: 0,
  463. shadowColor: "rgba(0, 0, 0, 0.5)",
  464. },
  465. },
  466. },
  467. ],
  468. };
  469. charts2.setOption(option2);
  470. },
  471. },
  472. };