|
|
|
|
@ -1,9 +1,30 @@
|
|
|
|
|
<template>
|
|
|
|
|
|
|
|
|
|
<div style="width:100%;">
|
|
|
|
|
<div class="header-container">
|
|
|
|
|
<div class="switch-button-container">
|
|
|
|
|
<div class="switch-button" @click="prevMonth">
|
|
|
|
|
<LeftOutlined />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="switch-button" @click="nextMonth">
|
|
|
|
|
<RightOutlined />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="switch-button" style="flex:auto;" @click="goToday">
|
|
|
|
|
今天
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="current-month">
|
|
|
|
|
{{ formatMonthYear() }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<a-calendar
|
|
|
|
|
v-model:value="value"
|
|
|
|
|
@panelChange="panelChange"
|
|
|
|
|
:header-render="customHeader"
|
|
|
|
|
size="small"
|
|
|
|
|
fullscreen="false"
|
|
|
|
|
>
|
|
|
|
|
@ -23,9 +44,12 @@
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { ref,onMounted,defineProps,watch} from 'vue';
|
|
|
|
|
import { Dayjs } from 'dayjs';
|
|
|
|
|
import { LeftOutlined,RightOutlined } from '@ant-design/icons-vue'
|
|
|
|
|
import dayjs,{ Dayjs } from 'dayjs';
|
|
|
|
|
import { getTaskHistoryList } from '@/api/sys/workplan';
|
|
|
|
|
const value = ref<Dayjs>();
|
|
|
|
|
const value = ref<Dayjs>(dayjs());
|
|
|
|
|
|
|
|
|
|
console.log("formatMonthYear",value.value);
|
|
|
|
|
|
|
|
|
|
const props = defineProps(["taskId"])
|
|
|
|
|
|
|
|
|
|
@ -40,6 +64,11 @@ onMounted(()=>{
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const customHeader = ({ value, onChange, type, onTypeChange }) => {
|
|
|
|
|
// 这里只返回 null 或者你自定义的内容
|
|
|
|
|
// 比如只显示当前年月,不提供下拉菜单
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const panelChange = (e)=>{
|
|
|
|
|
|
|
|
|
|
@ -142,6 +171,31 @@ const dateFullCellRender = (date) => {
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const prevMonth = ()=> {
|
|
|
|
|
value.value = value.value.subtract(1, 'month')
|
|
|
|
|
|
|
|
|
|
panelChange(value.value);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const nextMonth = ()=> {
|
|
|
|
|
value.value = value.value.add(1, 'month')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
panelChange(value.value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const formatMonthYear = ()=> {
|
|
|
|
|
return `${value.value.year()}年${value.value.month() + 1}月`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function goToday() {
|
|
|
|
|
value.value = dayjs()
|
|
|
|
|
|
|
|
|
|
panelChange(value.value);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
|
::v-deep .ant-picker-calendar-date-content{
|
|
|
|
|
@ -195,7 +249,7 @@ const dateFullCellRender = (date) => {
|
|
|
|
|
|
|
|
|
|
::v-deep .ant-picker-calendar.ant-picker-calendar-full .ant-picker-panel .ant-picker-body td{
|
|
|
|
|
border: 1px solid rgba(255,255,255,0.1);
|
|
|
|
|
padding:5px 0px;
|
|
|
|
|
padding:0px 0px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mark{
|
|
|
|
|
@ -209,7 +263,42 @@ const dateFullCellRender = (date) => {
|
|
|
|
|
display:none!important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .ant-picker-calendar.ant-picker-calendar-full .ant-picker-calendar-date-value{
|
|
|
|
|
line-height:16px!important;
|
|
|
|
|
color:#ccc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .ant-picker-calendar .ant-picker-calendar-header{
|
|
|
|
|
justify-content:flex-start;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .header-container{
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .current-month{
|
|
|
|
|
flex:auto;
|
|
|
|
|
color:#fff;
|
|
|
|
|
font-size:14px;
|
|
|
|
|
line-height:30px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
::v-deep .switch-button-container{
|
|
|
|
|
width:150px;
|
|
|
|
|
height:30px;
|
|
|
|
|
gap:10px;
|
|
|
|
|
color:#fff;
|
|
|
|
|
display:flex;
|
|
|
|
|
margin-bottom:12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .switch-button{
|
|
|
|
|
padding:0px 10px;
|
|
|
|
|
background:#364167;
|
|
|
|
|
text-align: center;
|
|
|
|
|
line-height:30px;
|
|
|
|
|
cursor:pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|