日历优化
This commit is contained in:
parent
6cd778c5d3
commit
ac3d70f44f
@ -153,6 +153,7 @@ const formDataCaln = ref({
|
|||||||
// const data = await CalendarApi.createCalendar(dda)
|
// const data = await CalendarApi.createCalendar(dda)
|
||||||
// console.log(data)
|
// console.log(data)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
//判断是否渲染当前日期更改组件
|
//判断是否渲染当前日期更改组件
|
||||||
const isCurrentMonth = (date:any,index:number) => {
|
const isCurrentMonth = (date:any,index:number) => {
|
||||||
const SelectDate = date.date;
|
const SelectDate = date.date;
|
||||||
@ -252,6 +253,7 @@ const submitForm = async (date:any)=> {
|
|||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
updatedHoliday.visible = false;
|
updatedHoliday.visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const closePopover = async (date:any)=> {
|
const closePopover = async (date:any)=> {
|
||||||
// 判断更改是否符合
|
// 判断更改是否符合
|
||||||
await getDate(date);
|
await getDate(date);
|
||||||
@ -260,6 +262,7 @@ const closePopover = async (date:any)=> {
|
|||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
updatedHoliday.visible = false;
|
updatedHoliday.visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取日期时间 年月日
|
// 获取日期时间 年月日
|
||||||
function formatDate2(dat: number|Date) {
|
function formatDate2(dat: number|Date) {
|
||||||
const date = new Date(dat)
|
const date = new Date(dat)
|
||||||
@ -268,6 +271,7 @@ function formatDate2(dat: number|Date) {
|
|||||||
const day = String(date.getDate()).padStart(2, '0');
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
return `${year}-${month}-${day}`;
|
return `${year}-${month}-${day}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
//更具不同按钮传递不同的值 来处理展示的 年份
|
//更具不同按钮传递不同的值 来处理展示的 年份
|
||||||
const selectDate = (val:number) => {
|
const selectDate = (val:number) => {
|
||||||
if (!val){
|
if (!val){
|
||||||
@ -275,15 +279,19 @@ const selectDate = (val:number) => {
|
|||||||
}
|
}
|
||||||
currentYear.value += val
|
currentYear.value += val
|
||||||
}
|
}
|
||||||
|
|
||||||
//toYear Button change data go to year
|
//toYear Button change data go to year
|
||||||
const toYear = () => {
|
const toYear = () => {
|
||||||
currentYear.value = new Date().getFullYear()
|
currentYear.value = new Date().getFullYear()
|
||||||
}
|
}
|
||||||
|
|
||||||
//打开获取数据处理数据来渲染
|
//打开获取数据处理数据来渲染
|
||||||
onMounted( async ()=> {
|
onMounted( async ()=> {
|
||||||
await getListDate()
|
await getListDate()
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- 样式很重要 -->
|
<!-- 样式很重要 -->
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.close-But {
|
.close-But {
|
||||||
|
Loading…
Reference in New Issue
Block a user