|
@@ -300,7 +300,7 @@
|
|
|
created() {
|
|
|
this.initLogInfo();
|
|
|
this.getZhibiaoCollect()
|
|
|
- this.setNowDate()
|
|
|
+ this.setNowDate('month')
|
|
|
},
|
|
|
methods: {
|
|
|
getZhibiaoCollect(){
|
|
@@ -330,18 +330,25 @@
|
|
|
this.loading = false
|
|
|
})
|
|
|
},
|
|
|
- setNowDate(){
|
|
|
+ setNowDate(type){
|
|
|
const now = new Date()
|
|
|
const year = now.getFullYear(); // 年
|
|
|
const month = now.getMonth() + 1; // 月
|
|
|
const beginDate = `${year}-01`
|
|
|
const endDate = `${year}-${month}`
|
|
|
- console.log(month)
|
|
|
this.dateValue = [beginDate, endDate]
|
|
|
- this.searchParams = {
|
|
|
- time: 'month',
|
|
|
- beginDate: beginDate,
|
|
|
- endDate: endDate,
|
|
|
+ if(type === 'month'){
|
|
|
+ this.searchParams = {
|
|
|
+ time: 'month',
|
|
|
+ beginDate: beginDate,
|
|
|
+ endDate: endDate,
|
|
|
+ }
|
|
|
+ } else if (type === 'year') {
|
|
|
+ this.searchParams = {
|
|
|
+ time: 'year',
|
|
|
+ beginDate: year - 1,
|
|
|
+ endDate: year,
|
|
|
+ }
|
|
|
}
|
|
|
this.getDataByDate()
|
|
|
},
|
|
@@ -422,11 +429,13 @@
|
|
|
},
|
|
|
// 查询类型选择:按年、按月
|
|
|
searchTypeChange(type){
|
|
|
+ // this.resetParams()
|
|
|
this.searchTypeMonth = type === 'month' ? 'primary' : 'link'
|
|
|
this.searchTypeYear = type === 'year' ? 'primary' : 'link'
|
|
|
this.searchFormat = type === 'month' ? 'YYYY-MM' : 'YYYY'
|
|
|
this.searchPlaceholder = type === 'month' ? ['开始月份', '结束月份'] : ['开始年份', '结束年份']
|
|
|
this.searchMode = [type, type]
|
|
|
+ this.setNowDate(type)
|
|
|
},
|
|
|
handlePanelChange(value, mode) {
|
|
|
// console.log(value, this.searchMode)
|