propertBenchmarkParticulars.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. import * as echarts from "echarts";
  2. export default {
  3. data() {
  4. return {
  5. pickerOptions: {
  6. disabledDate(time) {
  7. return time.getTime() > Date.now();
  8. },
  9. },
  10. tb2: false,
  11. loading:true,
  12. loading2:true,
  13. tableData: [],
  14. options: [],
  15. fc: "",
  16. fc2: "",
  17. pj: "",
  18. pj2: "",
  19. timedate: [],
  20. multipleSelection: [],
  21. multipleSelection1: [],
  22. multipleSelection2: [],
  23. orderByColumn: "",
  24. isAsc: "asc",
  25. fdcLineData: [],
  26. fdcLineData2: [],
  27. currentPage2: 1,
  28. pagesize: 10,
  29. wpId: "",
  30. pjId: "",
  31. beginDate: "",
  32. endDate: "",
  33. dialogTableVisible: false,
  34. sortInOrder: [],
  35. sortInOrderTop: [],
  36. pjName1: "",
  37. pjName2: "",
  38. sortInOrde2: [],
  39. getTableData: [],
  40. fdcND: [],
  41. fdcND1: "",
  42. fdcND2: "",
  43. wp_n_1: {},
  44. wp_n_2: {},
  45. wpIdslist: {
  46. name: "",
  47. id: "",
  48. },
  49. projectlist: {
  50. name: "",
  51. id: "",
  52. },
  53. projectlist2: {
  54. name: "",
  55. id: "",
  56. },
  57. };
  58. },
  59. filters: {
  60. rounding(fc) {
  61. return fc.toFixed(2);
  62. },
  63. },
  64. created() {
  65. this.timedate[0] = this.$route.query.beginDate;
  66. this.timedate[1] = this.$route.query.endDate;
  67. this.fc = this.$route.query.wpId;
  68. this.query_xml();
  69. this.query_wpid();
  70. this.YardTableData();
  71. },
  72. methods: {
  73. /**
  74. * 查询风机列表信息
  75. */
  76. queryApData() {
  77. this.YardTableData();
  78. if (this.fc2 != null || this.fc2 != undefined) {
  79. this.tb2 = true;
  80. if (this.timedate == "") {
  81. this.beginDate = this.$route.query.beginDate;
  82. this.endDate = this.$route.query.endDate;
  83. } else {
  84. this.beginDate = this.timedate[0];
  85. this.endDate = this.timedate[1];
  86. }
  87. var guilty = new URLSearchParams();
  88. guilty.append("pageNum", this.currentPage2);
  89. guilty.append("pageSize", this.pagesize);
  90. guilty.append("orderByColumn", this.orderByColumn);
  91. guilty.append("isAsc", this.isAsc);
  92. guilty.append("wpId", this.fc2);
  93. guilty.append("wtId", this.pj2);
  94. guilty.append("beginDate", this.beginDate);
  95. guilty.append("endDate", this.endDate);
  96. this.API.post("/contrast/benchmarkWtList", guilty).then((res) => {
  97. this.fdcLineData2 = res.data;
  98. this.loading2 = false;
  99. }).catch(error =>{
  100. this.$message.error('获取数据失败');
  101. });
  102. }
  103. },
  104. /**
  105. * 查询检查
  106. */
  107. querycheck(){
  108. if(this.multipleSelection1.length + this.multipleSelection2.length ==2){
  109. this.queryApDataMx();
  110. }else{
  111. this.$message({
  112. message:"请选择两个项目!",
  113. type:'error'
  114. });
  115. return
  116. }
  117. },
  118. /**
  119. * 判断是否选择两项 改变数据格式
  120. */
  121. queryApDataMx() {
  122. this.dialogTableVisible = true;
  123. this.wp_n_1 = {};
  124. this.wp_n_2 = {};
  125. this.getTableData = [];
  126. if (
  127. this.multipleSelection1.length + this.multipleSelection2.length ==
  128. 2
  129. ) {
  130. this.multipleSelection = this.multipleSelection1.concat(
  131. this.multipleSelection2
  132. );
  133. } else {
  134. this.$message.error("请选两个风场!");
  135. return;
  136. }
  137. if (this.multipleSelection.length == 2) {
  138. this.wp_n_1 = this.multipleSelection[0];
  139. this.wp_n_2 = this.multipleSelection[1];
  140. this.pjName1 = this.multipleSelection[0].wtName;
  141. this.pjName2 = this.multipleSelection[1].wtName;
  142. this.fdcND1 =
  143. this.multipleSelection[0].wtName +
  144. "" +
  145. this.BASE.getBzDate(new Date(this.multipleSelection[0].recordDate),0);
  146. this.fdcND2 =
  147. this.multipleSelection[1].wtName +
  148. "" +
  149. this.BASE.getBzDate(new Date(this.multipleSelection[1].recordDate),0);
  150. this.fdcND.push(this.fdcND1, this.fdcND2);
  151. this.sortInOrder.push(
  152. this.multipleSelection[0].fnlyl,
  153. this.multipleSelection[0].xqjsl,
  154. this.multipleSelection[0].ztzhjsl,
  155. this.multipleSelection[0].fwjsl,
  156. this.multipleSelection[0].slssl,
  157. this.multipleSelection[0].xnssl,
  158. this.multipleSelection[0].qfl,
  159. this.multipleSelection[0].jxssl,
  160. this.multipleSelection[0].gzssl
  161. );
  162. this.sortInOrderTop.push(
  163. this.multipleSelection[1].fnlyl,
  164. this.multipleSelection[1].xqjsl,
  165. this.multipleSelection[1].ztzhjsl,
  166. this.multipleSelection[1].fwjsl,
  167. this.multipleSelection[1].slssl,
  168. this.multipleSelection[1].xnssl,
  169. this.multipleSelection[1].qfl,
  170. this.multipleSelection[1].jxssl,
  171. this.multipleSelection[1].gzssl
  172. );
  173. // for (let i = 0; i < this.multipleSelection.length; i++) {
  174. // this.sortInOrde2.push({
  175. // product: this.multipleSelection[i].wtName+" "+this.BASE.getBzDate(this.multipleSelection[i].recordDate,0),
  176. // "限电损失电量单位:万KWh": this.multipleSelection[i].xdss,
  177. // "故障损失电量单位:万KWh": this.multipleSelection[i].gzss,
  178. // "检修损失电量单位:万KWh": this.multipleSelection[i].jxssl,
  179. // "性能损失电量单位:万KWh": this.multipleSelection[i].xnssl,
  180. // "受累损失电量单位:万KWh": this.multipleSelection[i].slss,
  181. // });
  182. // }
  183. this.getTableData.push({
  184. index: "发电量",
  185. data1: this.multipleSelection[0].scadafdl,
  186. data2: this.multipleSelection[1].scadafdl,
  187. });
  188. this.getTableData.push({
  189. index: "故障损失电量",
  190. data1: this.multipleSelection[0].gzss,
  191. data2: this.multipleSelection[1].gzss,
  192. });
  193. this.getTableData.push({
  194. index: "检修损失电量",
  195. data1: this.multipleSelection[0].jxssl,
  196. data2: this.multipleSelection[1].jxssl,
  197. });
  198. this.getTableData.push({
  199. index: "性能未达标损失电量",
  200. data1: this.multipleSelection[0].xnsslfraction,
  201. data2: this.multipleSelection[1].xnsslfraction,
  202. });
  203. this.getTableData.push({
  204. index: "受累损失电量",
  205. data1: this.multipleSelection[0].slss,
  206. data2: this.multipleSelection[1].slss,
  207. });
  208. this.getTableData.push({
  209. index: "风能利用率",
  210. data1: this.multipleSelection[0].fnlyl,
  211. data2: this.multipleSelection[1].fnlyl,
  212. });
  213. this.getTableData.push({
  214. index: "故障损失率",
  215. data1: this.multipleSelection[0].gzssl,
  216. data2: this.multipleSelection[1].gzssl,
  217. });
  218. this.getTableData.push({
  219. index: "检修损失率",
  220. data1: this.multipleSelection[0].jxssl,
  221. data2: this.multipleSelection[1].jxssl,
  222. });
  223. this.getTableData.push({
  224. index: "弃风率",
  225. data1: this.multipleSelection[0].qfl,
  226. data2: this.multipleSelection[1].qfl,
  227. });
  228. this.getTableData.push({
  229. index: "性能损失率",
  230. data1: this.multipleSelection[0].xnssl,
  231. data2: this.multipleSelection[1].xnssl,
  232. });
  233. this.getTableData.push({
  234. index: "受累损失率",
  235. data1: this.multipleSelection[0].slssl,
  236. data2: this.multipleSelection[1].slssl,
  237. });
  238. this.getTableData.push({
  239. index: "复位及时率",
  240. data1: this.multipleSelection[0].fwjsl,
  241. data2: this.multipleSelection[1].fwjsl,
  242. });
  243. this.getTableData.push({
  244. index: "消缺及时率",
  245. data1: this.multipleSelection[0].xqjsl,
  246. data2: this.multipleSelection[1].xqjsl,
  247. });
  248. this.getTableData.push({
  249. index: "状态转换率",
  250. data1: this.multipleSelection[0].ztzhjsl,
  251. data2: this.multipleSelection[1].ztzhjsl,
  252. });
  253. }
  254. this.$nextTick(function () {
  255. this.ECZM.leida_tc("leiDaTu3" , this.sortInOrder,this.pjName1,this.sortInOrderTop,this.pjName2);
  256. this.ECZM.bar_tc("leiDaTu4" , this.wp_n_1 , this.wp_n_2 ,this.wp_n_1.wtId , this.wp_n_2.wtId);
  257. });
  258. },
  259. /**
  260. * 保留两位小数
  261. */
  262. filter_fdl(cellValue) {
  263. return parseFloat(cellValue.scadafdl).toFixed(2);
  264. },
  265. /**
  266. * 查询风机列表信息
  267. */
  268. YardTableData() {
  269. this.API.get("/powercompare/windfarmAjax").then((res) => {
  270. this.options = res.data;
  271. }).catch(error =>{
  272. this.$message.error('获取数据失败');
  273. });
  274. this.wpId = this.$route.query.wpId;
  275. if (this.timedate == "") {
  276. this.beginDate = this.$route.query.beginDate;
  277. this.endDate = this.$route.query.endDate;
  278. } else {
  279. this.beginDate = this.timedate[0];
  280. this.endDate = this.timedate[1];
  281. }
  282. var guilty = new URLSearchParams();
  283. guilty.append("pageNum", this.currentPage2);
  284. guilty.append("pageSize", this.pagesize);
  285. guilty.append("orderByColumn", this.orderByColumn);
  286. guilty.append("isAsc", this.isAsc);
  287. if (this.fc == "") {
  288. guilty.append("wpId", this.wpId);
  289. } else {
  290. guilty.append("wpId", this.fc);
  291. }
  292. if (this.pj == "") {
  293. guilty.append("wtId", this.pjId);
  294. } else {
  295. guilty.append("wtId", this.pj);
  296. }
  297. guilty.append("beginDate", this.beginDate);
  298. guilty.append("endDate", this.endDate);
  299. this.API.post("/contrast/benchmarkWtList", guilty).then((res) => {
  300. this.fdcLineData = res.data;
  301. this.loading = false;
  302. }).catch(error =>{
  303. this.$message.error('获取数据失败');
  304. });
  305. },
  306. /**
  307. * 获取项目
  308. */
  309. query_xml() {
  310. this.pj = "";
  311. this.xl = "";
  312. this.pj2 = "";
  313. this.xl2 = "";
  314. this.API
  315. .get("powercompare/windturbineAjax?wpId=" + this.fc)
  316. .then((res) => {
  317. this.projectlist = res.data;
  318. }).catch(error =>{
  319. this.$message.error('获取数据失败');
  320. });
  321. },
  322. query_xml2() {
  323. this.pj = "";
  324. this.xl = "";
  325. this.API
  326. .get("powercompare/windturbineAjax?wpId=" + this.fc2)
  327. .then((res) => {
  328. this.projectlist2 = res.data;
  329. });
  330. },
  331. /**
  332. * 查询风场
  333. */
  334. query_wpid() {
  335. this.API.get("powercompare/windfarmAjax?").then((res) => {
  336. this.wpIdslist = res.data;
  337. }).catch(error =>{
  338. this.$message.error('获取数据失败');
  339. });
  340. },
  341. headStyle() {
  342. return "text-align:left";
  343. },
  344. handleSelectionChange(val) {
  345. this.sortInOrder = [];
  346. this.sortInOrderTop = [];
  347. this.getTableData = [];
  348. this.sortInOrde2 = [];
  349. this.multipleSelection1 = [];
  350. this.multipleSelection1 = val;
  351. },
  352. handleSelectionChange2(val) {
  353. this.sortInOrder = [];
  354. this.sortInOrderTop = [];
  355. this.getTableData = [];
  356. this.sortInOrde2 = [];
  357. this.multipleSelection2 = [];
  358. this.multipleSelection2 = val;
  359. },
  360. changeTableSort(column) {
  361. this.orderByColumn = column.prop;
  362. if (column.order == "descending") {
  363. this.isAsc = "desc";
  364. } else if (column.order == "ascending") {
  365. this.isAsc = "asc";
  366. }
  367. this.YardTableData();
  368. },
  369. filter_date(cellValue) {
  370. let date = new Date(cellValue.recordDate);
  371. return this.BASE.getBzDate(date,0);
  372. },
  373. drawPie2() {
  374. var charts2;
  375. if (charts2 != null && charts2 != "" && charts2 != undefined) {
  376. charts2.dispose();
  377. }
  378. charts2 = this.$echarts.init(document.getElementById("leiDaTu4"));
  379. let option2 = {
  380. legend: {
  381. orient: "vertical",
  382. left: "right",
  383. },
  384. tooltip: {},
  385. dataset: {
  386. dimensions: [
  387. "product",
  388. "限电损失电量单位:万KWh",
  389. "故障损失电量单位:万KWh",
  390. "检修损失电量单位:万KWh",
  391. "性能损失电量单位:万KWh",
  392. "受累损失电量单位:万KWh",
  393. ],
  394. source: this.sortInOrde2,
  395. },
  396. xAxis: {
  397. type: "category",
  398. date: this.fdcND,
  399. axisPointer: {
  400. type: "shadow",
  401. },
  402. },
  403. yAxis: { type: "category" },
  404. series: [
  405. {
  406. // barGap:'100%',/*多个并排柱子设置柱子之间的间距*/
  407. type: "bar",
  408. barWidth: 30,
  409. itemStyle: {
  410. normal: {
  411. color: "#D201D8",
  412. },
  413. },
  414. },
  415. {
  416. type: "bar",
  417. barWidth: 30,
  418. itemStyle: {
  419. normal: {
  420. color: "#FD0100",
  421. },
  422. },
  423. },
  424. {
  425. type: "bar",
  426. barWidth: 30,
  427. itemStyle: {
  428. normal: {
  429. color: "#FF7B16",
  430. },
  431. },
  432. },
  433. {
  434. type: "bar",
  435. barWidth: 30,
  436. itemStyle: {
  437. normal: {
  438. color: "#8085E9",
  439. },
  440. },
  441. },
  442. {
  443. type: "bar",
  444. barWidth: 30,
  445. itemStyle: {
  446. normal: {
  447. color: "#A6A6A6",
  448. },
  449. },
  450. },
  451. ],
  452. };
  453. charts2.clear();
  454. charts2.setOption(option2);
  455. },
  456. /**
  457. * 返回
  458. */
  459. goReturn() {
  460. this.$router.push("/benchmark_property");
  461. },
  462. toExcel() {},
  463. },
  464. };