<el-date-picker
v-model="form.timeData"
type="datetimerange"
:range-separator="$t('至')"
:start-placeholder="$t('开始日期')"
:end-placeholder="$t('截止日期')"
@change="handleTimeChange"
/>
const getDefaultDate = () => {
const today = new Date();
const startOfDay = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
0,
0,
0
); // 今天的 00:00:00
const endOfDay = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
23,
59,
59
); // 今天的 23:59:59
dateTime.value = [startOfDay, endOfDay];
};
//当月
const getDefaultDate = () => {
const today = new Date();
const firstDayOfMonth = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
0,
0,
0
);
const endOfDay = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
23,
59,
59
); // 今天的 23:59:59
console.log(firstDayOfMonth, endOfDay,'firstDayOfMonth, endOfDay')
dateTime.value = [firstDayOfMonth, endOfDay]; // 今天的 23:59:59];
};
onMounted(() => {
getDefaultDate();
// getTbaleData();
});