fiveLossRates.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. import FiveLossRatesPieChart from '@views/lossBenchmarking/fiveLossRatesPieChart';
  2. import FiveLossRatesHistogramChart from '@views/lossBenchmarking/fiveLossRatesHistogramChart.vue';
  3. export default {
  4. data() {
  5. return {
  6. formInline: {
  7. windfarm: "",
  8. project: "",
  9. line: "",
  10. },
  11. timedate: [
  12. // {beginDate:'2021-01-01'},
  13. // {endDate:'2021-01-04'}
  14. ],
  15. isAsc: 'asc',
  16. beginDate: '',
  17. endDate: '',
  18. gridData: [],
  19. multipleSelection: [],
  20. sortInOrder: [],
  21. sortInOrderTop: [],
  22. sortInOrde2: [],
  23. getTableData: [],
  24. sortInOrderTop2: [],
  25. fdcName1: '',
  26. fdcName2: '',
  27. currentPage2: 1,
  28. pagesize: 10,
  29. fdcLineData: '',
  30. classification: [{
  31. id: 'qf',
  32. label: '弃风率'
  33. }, {
  34. id: 'gz',
  35. label: '故障损失率'
  36. },
  37. {
  38. id: 'jx',
  39. label: '检修损失率'
  40. },
  41. {
  42. id: 'xn',
  43. label: '性能损失率'
  44. },
  45. {
  46. id: 'sl',
  47. label: '受累损失率'
  48. }],
  49. options: [{
  50. value: 'MHS_FDC',
  51. label: '麻黄山风电场'
  52. }, {
  53. value: 'NSS_FDC',
  54. label: '牛首山风电场'
  55. },
  56. {
  57. value: 'SBQ_FDC',
  58. label: '石板泉风电场'
  59. },
  60. {
  61. value: 'QS_FDC',
  62. label: '青山风电场'
  63. },
  64. {
  65. value: 'XS_FDC',
  66. label: '香山风电场'
  67. }],
  68. value: '',
  69. value2: 'gz',
  70. wpId: [],
  71. wpName: [],
  72. updateTime1: '',
  73. updateTime: '',
  74. orderByColumn: '',
  75. dialogTableVisible: false,
  76. lineDataOption: [],
  77. tableData: [{
  78. date: '2016-05-02',
  79. name: '王小虎',
  80. address: '上海市普陀区金沙江路 1518 弄'
  81. }, {
  82. date: '2016-05-04',
  83. name: '王小虎',
  84. address: '上海市普陀区金沙江路 1517 弄'
  85. }, {
  86. date: '2016-05-01',
  87. name: '王小虎',
  88. address: '上海市普陀区金沙江路 1519 弄'
  89. }, {
  90. date: '2016-05-03',
  91. name: '王小虎',
  92. address: '上海市普陀区金沙江路 1516 弄'
  93. },
  94. {
  95. date: '2016-05-03',
  96. name: '王小虎',
  97. address: '上海市普陀区金沙江路 1516 弄'
  98. },
  99. {
  100. date: '2016-05-03',
  101. name: '王小虎',
  102. address: '上海市普陀区金沙江路 1516 弄'
  103. }]
  104. }
  105. },
  106. components: {
  107. FiveLossRatesPieChart: FiveLossRatesPieChart,
  108. FiveLossRatesHistogramChart: FiveLossRatesHistogramChart
  109. },
  110. created() {
  111. this.API.get('/powercompare/windfarmAjax').then((res) => {
  112. this.options = res.data;
  113. })
  114. this.FiveLossInformation();
  115. },
  116. methods: {
  117. headStyle() {
  118. return "text-align:center"
  119. },
  120. onSubmit() {
  121. console.log("submit!");
  122. },
  123. handleClick() { },
  124. deleteRow(index, rows) {
  125. rows.splice(index, 1);
  126. },
  127. queryApData() {
  128. this.FiveLossInformation();
  129. },
  130. handleEdit(a, b) {
  131. this.wpId = [];
  132. this.lineDataOption = [];
  133. if (this.multipleSelection.length == 2) {
  134. for (let i = 0; i < this.multipleSelection.length; i++) {
  135. this.wpId.push(this.multipleSelection[i].wpId)
  136. this.wpName.push(this.multipleSelection[i].wpName)
  137. this.lineDataOption.push({ id: this.multipleSelection[i].wpId, name: this.multipleSelection[i].wpName })
  138. }
  139. console.log(this.lineDataOption)
  140. this.$router.push({
  141. path: '/fiveLossLineTable',
  142. query: {
  143. wpId: this.wpId,
  144. beginDate: this.beginDate,
  145. endDate: this.endDate,
  146. wpName: this.wpName,
  147. select: this.lineDataOption
  148. }
  149. })
  150. } else {
  151. console.log(b)
  152. this.lineDataOption.push({ id: b.wpId, name: b.wpName })
  153. console.log(this.lineDataOption)
  154. this.$router.push({
  155. path: '/fiveLossLineTable',
  156. query: {
  157. wpId: b.wpId,
  158. beginDate: this.beginDate,
  159. endDate: this.endDate,
  160. wpName: b.wpName,
  161. select: this.lineDataOption
  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. queryApDataMx() {
  183. this.dialogTableVisible = true;
  184. this.$nextTick(function () {
  185. this.drawPie('leiDaTu')
  186. })
  187. this.$nextTick(function () {
  188. this.drawPie2('leiDaTu2')
  189. })
  190. },
  191. handleSelectionChange(val) {
  192. this.sortInOrder = [];
  193. this.sortInOrderTop = [];
  194. this.getTableData = [];
  195. this.sortInOrde2 = [];
  196. this.multipleSelection = val;
  197. if (this.multipleSelection.length == 2) {
  198. this.fdcName1 = this.multipleSelection[0].wpName;
  199. this.fdcName2 = this.multipleSelection[1].wpName;
  200. this.sortInOrder.push(this.multipleSelection[0].fnlyl, this.multipleSelection[0].xqjsl,
  201. this.multipleSelection[0].ztzhjsl, this.multipleSelection[0].fwjsl, this.multipleSelection[0].slssl,
  202. this.multipleSelection[0].xnssl, this.multipleSelection[0].qfl, this.multipleSelection[0].jxssl,
  203. this.multipleSelection[0].gzssl);
  204. this.sortInOrderTop.push(this.multipleSelection[1].fnlyl, this.multipleSelection[1].xqjsl,
  205. this.multipleSelection[1].ztzhjsl, this.multipleSelection[1].fwjsl, this.multipleSelection[1].slssl,
  206. this.multipleSelection[1].xnssl, this.multipleSelection[1].qfl, this.multipleSelection[1].jxssl,
  207. this.multipleSelection[1].gzssl);
  208. for (let i = 0; i < this.multipleSelection.length; i++) {
  209. this.sortInOrde2.push({
  210. product: this.multipleSelection[i].wpName, '限电损失电量单位:万KWh': this.multipleSelection[i].xdss,
  211. '故障损失电量单位:万KWh': this.multipleSelection[i].gzss, '检修损失电量单位:万KWh': this.multipleSelection[i].jxssl,
  212. '性能损失电量单位:万KWh': this.multipleSelection[i].xnssl, '受累损失电量单位:万KWh': this.multipleSelection[i].slss
  213. });
  214. }
  215. this.getTableData.push({ index: '发电量', data1: this.multipleSelection[0].fdl, data2: this.multipleSelection[1].fdl });
  216. this.getTableData.push({ index: '故障损失电量', data1: this.multipleSelection[0].gzss, data2: this.multipleSelection[1].gzss });
  217. this.getTableData.push({ index: '检修损失电量', data1: this.multipleSelection[0].jxssl, data2: this.multipleSelection[1].jxssl });
  218. this.getTableData.push({ index: '性能未达标损失电量', data1: this.multipleSelection[0].xnsslfraction, data2: this.multipleSelection[1].xnsslfraction });
  219. this.getTableData.push({ index: '受累损失电量', data1: this.multipleSelection[0].slss, data2: this.multipleSelection[1].slss });
  220. this.getTableData.push({ index: '风能利用率', data1: this.multipleSelection[0].fnlyl, data2: this.multipleSelection[1].fnlyl });
  221. this.getTableData.push({ index: '故障损失率', data1: this.multipleSelection[0].gzssl, data2: this.multipleSelection[1].gzssl });
  222. this.getTableData.push({ index: '检修损失率', data1: this.multipleSelection[0].jxssl, data2: this.multipleSelection[1].jxssl });
  223. this.getTableData.push({ index: '弃风率', data1: this.multipleSelection[0].qfl, data2: this.multipleSelection[1].qfl });
  224. this.getTableData.push({ index: '性能损失率', data1: this.multipleSelection[0].xnssl, data2: this.multipleSelection[1].xnssl });
  225. this.getTableData.push({ index: '受累损失率', data1: this.multipleSelection[0].slssl, data2: this.multipleSelection[1].slssl });
  226. this.getTableData.push({ index: '复位及时率', data1: this.multipleSelection[0].fwjsl, data2: this.multipleSelection[1].fwjsl });
  227. this.getTableData.push({ index: '消缺及时率', data1: this.multipleSelection[0].xqjsl, data2: this.multipleSelection[1].xqjsl });
  228. this.getTableData.push({ index: '状态转换率', data1: this.multipleSelection[0].ztzhjsl, data2: this.multipleSelection[1].ztzhjsl });
  229. }
  230. },
  231. handleCurrentChange(val) {
  232. // console.log(`当前页: ${val}`);
  233. },
  234. handleSizeChange(val) {
  235. console.log(`每页 ${val} 条`);
  236. this.pagesize = val;
  237. },
  238. changeTableSort(column) {
  239. this.orderByColumn = column.prop;
  240. if (column.order == "descending") {
  241. this.isAsc = 'desc';
  242. } else if (column.order == "ascending") {
  243. this.isAsc = "asc";
  244. }
  245. this.FiveLossInformation();
  246. },
  247. FiveLossInformation() {
  248. let that = this;
  249. const nowDate = new Date();
  250. const date = {
  251. year: nowDate.getFullYear(),
  252. month: nowDate.getMonth() + 1,
  253. date: nowDate.getDate(),
  254. }
  255. const newmonth = date.month > 10 ? date.month : '0' + date.month
  256. const day = date.date > 10 ? date.date : '0' + date.date
  257. const day1 = date.date > 10 ? date.date - 1 : '0' + date.date
  258. this.updateTime = date.year + '-' + newmonth + '-' + day
  259. this.updateTime1 = date.year + '-' + newmonth + '-' + day1
  260. if (this.timedate == '') {
  261. this.timedate[0] = this.updateTime1;
  262. this.timedate[1] = this.updateTime;
  263. this.beginDate = this.timedate[0];
  264. this.endDate = this.timedate[1];
  265. } else {
  266. this.beginDate = this.timedate[0];
  267. this.endDate = this.timedate[1];
  268. }
  269. var fiveLossData = new URLSearchParams();
  270. fiveLossData.append('pageNum', this.currentPage2);
  271. fiveLossData.append('pageSize', this.pagesize);
  272. fiveLossData.append('orderByColumn', this.orderByColumn);
  273. fiveLossData.append('isAsc', this.isAsc);
  274. fiveLossData.append('wpId', this.value);
  275. fiveLossData.append('beginDate', this.beginDate);
  276. fiveLossData.append('endDate', this.endDate);
  277. this.API.post('/contrast/benchmarkLossList', fiveLossData).then((res) => {
  278. that.gridData = res.data;
  279. that.$refs.FiveLossRatesPieChart.getPackageData(that.gridData,that.value2);
  280. that.$refs.FiveLossRatesHistogramChart.getPackageData2(that.gridData);
  281. })
  282. },
  283. drawPie() {
  284. var charts;
  285. if (charts != null && charts != "" && charts != undefined) {
  286. charts.dispose();
  287. }
  288. charts = this.$echarts.init(document.getElementById('leiDaTu'));
  289. let option = {
  290. title: {
  291. // text: '对标排名分析',
  292. left: 'center'
  293. },
  294. tooltip: {},
  295. // legend: {
  296. // data: ['预算分配(Allocated Budget)', '实际开销(Actual Spending)'],
  297. // left: 'right'
  298. // },
  299. radar: {
  300. // shape: 'circle',
  301. name: {
  302. textStyle: {
  303. color: '#fff',
  304. backgroundColor: '#999',
  305. borderRadius: 3,
  306. padding: [3, 5]
  307. }
  308. },
  309. indicator: [
  310. { name: '风能利用率', max: 150 },
  311. { name: '消缺及时率', max: 150 },
  312. { name: '状态转换率', max: 150 },
  313. { name: '复位及时率', max: 150 },
  314. { name: '受累损失率', max: 150 },
  315. { name: '性能损失率', max: 150 },
  316. { name: '弃风率', max: 150 },
  317. { name: '检修损失率', max: 150 },
  318. { name: '故障损失率', max: 150 },
  319. ]
  320. },
  321. series: [{
  322. name: '预算 vs 开销(Budget vs spending)',
  323. type: 'radar',
  324. // areaStyle: {normal: {}},
  325. data: [
  326. {
  327. value: this.sortInOrder,
  328. name: this.fdcName1
  329. },
  330. {
  331. value: this.sortInOrderTop,
  332. name: this.fdcName2
  333. }
  334. ]
  335. }]
  336. }
  337. charts.clear();
  338. charts.setOption(option);
  339. },
  340. drawPie2() {
  341. var charts2;
  342. if (charts2 != null && charts2 != "" && charts2 != undefined) {
  343. charts2.dispose();
  344. }
  345. charts2 = this.$echarts.init(document.getElementById('leiDaTu2'));
  346. let option2 = {
  347. legend: {
  348. orient: 'vertical',
  349. left: 'right'
  350. },
  351. tooltip: {},
  352. dataset: {
  353. dimensions: ['product', '限电损失电量单位:万KWh', '故障损失电量单位:万KWh', '检修损失电量单位:万KWh', '性能损失电量单位:万KWh', '受累损失电量单位:万KWh'],
  354. source: this.sortInOrde2
  355. },
  356. xAxis: { type: 'category' },
  357. yAxis: {},
  358. // Declare several bar series, each will be mapped
  359. // to a column of dataset.source by default.
  360. series: [
  361. {
  362. // barGap:'100%',/*多个并排柱子设置柱子之间的间距*/
  363. type: 'bar',
  364. barWidth: 30,
  365. itemStyle: {
  366. normal: {
  367. color: '#D201D8'
  368. }
  369. }
  370. },
  371. {
  372. type: 'bar',
  373. barWidth: 30,
  374. itemStyle: {
  375. normal: {
  376. color: '#FD0100'
  377. }
  378. }
  379. },
  380. {
  381. type: 'bar',
  382. barWidth: 30,
  383. itemStyle: {
  384. normal: {
  385. color: '#FF7B16'
  386. }
  387. }
  388. },
  389. {
  390. type: 'bar',
  391. barWidth: 30,
  392. itemStyle: {
  393. normal: {
  394. color: '#8085E9'
  395. }
  396. }
  397. },
  398. {
  399. type: 'bar',
  400. barWidth: 30,
  401. itemStyle: {
  402. normal: {
  403. color: '#A6A6A6'
  404. }
  405. }
  406. },
  407. ]
  408. }
  409. charts2.clear();
  410. charts2.setOption(option2);
  411. },
  412. toExcel() { }
  413. },
  414. }