| | |
| | | :key="index" |
| | | class="event-item" |
| | | :class="event.type" |
| | | @click="jumpcalendar(event,data.day)" |
| | | > |
| | | <span></span> |
| | | {{ event.name }}{{ event.value }} |
| | |
| | | <script setup> |
| | | import dayjs from 'dayjs'; |
| | | import { jobEventBar, getCalen } from '@/api/home/index'; |
| | | import { useRouter } from 'vue-router' |
| | | const router = useRouter() |
| | | // 日历事件数据 |
| | | // 格式: 'YYYY-MM-DD': [...events] |
| | | const events = ref({ |
| | | '2025-05-01': [ |
| | | { type: 'work-order', content: '工单26' }, |
| | | { type: 'task', content: '任务26' }, |
| | | ], |
| | | '2025-05-04': [ |
| | | { type: 'task', content: '任务26' }, |
| | | { type: 'work-order', content: '工单26' }, |
| | | ], |
| | | }); |
| | | const events = ref({}); |
| | | const params = ref({ |
| | | end_date: undefined, |
| | | start_date: undefined, |
| | |
| | | // console.log('日历', res.data.data); |
| | | }); |
| | | }; |
| | | const jumpcalendar=(event)=>{ |
| | | console.log('eee',event); |
| | | if(event.name ==='工单'){ |
| | | router.push({ |
| | | path: '/tickets/ticket', |
| | | }) |
| | | } |
| | | |
| | | |
| | | } |
| | | onMounted(() => { |
| | | getJobEventBar(); |
| | | }); |