individualHistoryinformation.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. export default {
  2. data() {
  3. return {
  4. pickerOptions: {
  5. disabledDate(time) {
  6. return time.getTime() > Date.now();
  7. },
  8. },
  9. wpIdslist: {
  10. name:"",
  11. id:"",
  12. },
  13. b:[],
  14. fc:"",
  15. fj:"",
  16. data_01:"2021-01-01",
  17. data_02:"2021-01-03",
  18. currentPage2: 1,
  19. pagesize:10,
  20. orderByColumn: "",
  21. tableData:[],
  22. }
  23. },
  24. created() {
  25. },
  26. methods: {
  27. query_table(){
  28. let that = this;
  29. var digital = new URLSearchParams();
  30. digital.append("pageNum", this.currentPage2);
  31. digital.append("pageSize", this.pagesize);
  32. digital.append("orderByColumn", this.orderByColumn);
  33. digital.append("isAsc", this.isAsc);
  34. digital.append("wtId", this.fj);
  35. digital.append("beginDate", this.data_01);
  36. digital.append("endDate", this.data_02);
  37. this.API.post("/goodness/goodhistorylist", digital).then((res) => {
  38. this.tableData = res.data;
  39. });
  40. },
  41. /**改变格式 */
  42. data_formatter(cellValue){ return this.BASE.getBzDate(new Date(cellValue.recorddate),0)},
  43. gaindate() {
  44. let _this = this;
  45. if (this.fc == null || this.fc == undefined || this.fc == "") {
  46. _this.b = JSON.parse(sessionStorage.getItem('b'));
  47. _this.fc = JSON.parse(sessionStorage.getItem('fc'));
  48. _this.fj = JSON.parse(sessionStorage.getItem('fj'));
  49. _this.data_01 = JSON.parse(sessionStorage.getItem('data_01'));
  50. _this.data_02 = JSON.parse(sessionStorage.getItem('data_02'));
  51. } else {
  52. this.b = this.$route.query.data;
  53. this.fc = this.$route.query.data.windtpowerstationid;
  54. this.fj = this.$route.query.data.windturbineid;
  55. this.data_01 = this.BASE.getBzDate(
  56. new Date(this.$route.query.data.recorddate),-1
  57. );
  58. this.data_02 = this.BASE.getBzDate(
  59. new Date(this.$route.query.data.recorddate),0
  60. );
  61. }
  62. // this.b = this.$route.query.data;
  63. // this.fc = this.$route.query.data.windtpowerstationid;
  64. // this.fj = this.$route.query.data.windturbineid;
  65. // this.data_01 = this.BASE.getBzDate(
  66. // new Date(this.$route.query.data.recorddate),0
  67. // );
  68. // this.data_02 = this.BASE.getBzDate(
  69. // new Date(this.$route.query.data.recorddate+60*60*24*1000),0
  70. // );
  71. this.query_wpid();
  72. },
  73. /**返回 */
  74. goback() {
  75. this.$router.push({
  76. path: "/individualPandectinformation"
  77. });
  78. },
  79. /**获取id */
  80. query_wpid() {
  81. this.API.get("powercompare/windfarmAjax?").then((res) => {
  82. this.wpIdslist = res.data;
  83. });
  84. },
  85. },
  86. mounted() {
  87. this.b = this.$route.query.data;
  88. this.fc = this.$route.query.data.windtpowerstationid;
  89. this.fj = this.$route.query.data.windturbineid;
  90. this.data_01 = this.BASE.getBzDate(
  91. new Date(this.$route.query.data.recorddate),0
  92. );
  93. this.data_02 = this.BASE.getBzDate(
  94. new Date(this.$route.query.data.recorddate+1),0
  95. );
  96. window.addEventListener("beforeunload", () => {
  97. sessionStorage.setItem('b', JSON.stringify(this.$route.query.data));
  98. sessionStorage.setItem('fc', JSON.stringify(this.$route.query.data.windtpowerstationid));
  99. sessionStorage.setItem('fj', JSON.stringify(this.$route.query.data.windturbineid));
  100. sessionStorage.setItem('data_01', JSON.stringify(this.BASE.getBzDate(
  101. new Date(this.$route.query.data.recorddate),-1
  102. )));
  103. sessionStorage.setItem('data_02', JSON.stringify(this.BASE.getBzDate(
  104. new Date(this.$route.query.data.recorddate),0
  105. )));
  106. });
  107. this.gaindate();
  108. this.query_table();
  109. },
  110. };