This commit is contained in:
‘937886381’
2026-01-06 13:48:11 +08:00
parent 20ef2b9763
commit 5605eeab06
287 changed files with 1890 additions and 1381 deletions

View File

@@ -46,7 +46,11 @@ export default {
leftMargin: {
type: [String, Number],
default: '350px' // 默认值设为350px
}
},
dateData: {
type: Object,
default: {} // 默认值设为350px
},
},
data() {
return {
@@ -75,11 +79,26 @@ export default {
this.date = undefined;
// this.emitTimeRange();
}
},
dateData: {
immediate: true, // 初始化时立即执行
handler(newVal) {
console.log('newVal', newVal);
if (newVal && (newVal.startTime || newVal.endTime)) {
// 优先使用 startTime 转换为月份格式
const timeStamp = newVal.startTime || newVal.endTime;
if (timeStamp !== 0) {
const monthStr = moment(timeStamp).format('YYYY-MM');
this.date = monthStr; // 赋值给选择器
}
}
}
}
},
mounted() {
// 初始化默认日期当前月格式yyyy-MM
console.log(this.$router);
// console.log(this.$router);
this.date = moment().format('YYYY-MM');
this.$nextTick(() => this.emitTimeRange());
},