| | |
| | | startDateTxt: "", |
| | | endDateTxt: "", |
| | | |
| | | // 保存从路由获取的时间参数,用于切换tab时保留 |
| | | routeStartTime: null, |
| | | routeEndTime: null, |
| | | |
| | | // 下拉选项 |
| | | projectList: [], // 项目列表 |
| | | reformedOptions: [], // 整改状态选项 |
| | |
| | | this.searchForm.startTime = moment(newVal).format( |
| | | "YYYY-MM-DD HH:mm:ss" |
| | | ); |
| | | // 更新保存的路由时间 |
| | | this.routeStartTime = this.searchForm.startTime; |
| | | // 选择时间后自动请求 |
| | | this.handleSelectChange(); |
| | | } else { |
| | |
| | | this.searchForm.endTime = moment(newVal).format( |
| | | "YYYY-MM-DD HH:mm:ss" |
| | | ); |
| | | // 更新保存的路由时间 |
| | | this.routeEndTime = this.searchForm.endTime; |
| | | // 选择时间后自动请求 |
| | | this.handleSelectChange(); |
| | | } else { |
| | |
| | | |
| | | // 接收从 home 页面传递过来的时间参数并回填 |
| | | if (this.$route.query.startTime) { |
| | | this.routeStartTime = this.$route.query.startTime; |
| | | this.startDateTime = new Date(this.$route.query.startTime); |
| | | this.searchForm.startTime = this.$route.query.startTime; |
| | | } |
| | | if (this.$route.query.endTime) { |
| | | this.routeEndTime = this.$route.query.endTime; |
| | | this.endDateTime = new Date(this.$route.query.endTime); |
| | | this.searchForm.endTime = this.$route.query.endTime; |
| | | } |
| | |
| | | reformed: null, |
| | | type: this.currentType, |
| | | level: null, |
| | | startTime: null, |
| | | endTime: null, |
| | | startTime: this.routeStartTime || null, // 保留路由传递的开始时间 |
| | | endTime: this.routeEndTime || null, // 保留路由传递的结束时间 |
| | | content: "", |
| | | }; |
| | | this.startDateTime = null; |
| | | this.endDateTime = null; |
| | | |
| | | // 保留时间选择器的值 |
| | | if (this.routeStartTime) { |
| | | this.startDateTime = new Date(this.routeStartTime); |
| | | } else { |
| | | this.startDateTime = null; |
| | | } |
| | | |
| | | if (this.routeEndTime) { |
| | | this.endDateTime = new Date(this.routeEndTime); |
| | | } else { |
| | | this.endDateTime = null; |
| | | } |
| | | }, |
| | | |
| | | // 加载项目列表 |
| | |
| | | this.startDateTime = null; |
| | | this.startDateTxt = ""; |
| | | this.searchForm.startTime = null; |
| | | this.routeStartTime = null; // 清除保存的路由时间 |
| | | } else { |
| | | this.endDateTime = null; |
| | | this.endDateTxt = ""; |
| | | this.searchForm.endTime = null; |
| | | this.routeEndTime = null; // 清除保存的路由时间 |
| | | } |
| | | this.handleSelectChange(); |
| | | }, |