|
@@ -19,7 +19,7 @@ const current = ref(Date.now())
|
|
const { data: list, run: setList } = useRequest(
|
|
const { data: list, run: setList } = useRequest(
|
|
() =>
|
|
() =>
|
|
getTodos({
|
|
getTodos({
|
|
- brokerId: String(userInfo.value.userId)
|
|
|
|
|
|
+ brokerId: String(userInfo.value.userId),
|
|
}),
|
|
}),
|
|
{
|
|
{
|
|
initialData: [],
|
|
initialData: [],
|
|
@@ -73,6 +73,7 @@ const handleDelete = async (todo: Todo) => {
|
|
console.log('删除')
|
|
console.log('删除')
|
|
await requestToast(() => deleteTodo(todo.id), { success: true, successTitle: '删除成功' })
|
|
await requestToast(() => deleteTodo(todo.id), { success: true, successTitle: '删除成功' })
|
|
await setData()
|
|
await setData()
|
|
|
|
+ await setList()
|
|
}
|
|
}
|
|
const handleClick = async ({ value }: { value: boolean }, todo: Todo) => {
|
|
const handleClick = async ({ value }: { value: boolean }, todo: Todo) => {
|
|
await updateTodo({ id: todo.id, status: value ? 1 : 0 })
|
|
await updateTodo({ id: todo.id, status: value ? 1 : 0 })
|
|
@@ -98,8 +99,19 @@ onMounted(async () => {
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
<template>
|
|
<template>
|
|
|
|
+ <div v-if="!list" v-for="(it, i) in list" :key="i" />
|
|
<div class="flex-grow">
|
|
<div class="flex-grow">
|
|
- <wd-calendar-view v-model="current" @change="handleCalendarChange" :formatter="formatter" />
|
|
|
|
|
|
+ <wd-calendar-view v-model="current" @change="handleCalendarChange" :formatter="(day: any) => {
|
|
|
|
+ let date = dayjs(new Date(day.date)).format('YYYY-MM-DD')
|
|
|
|
+ console.log('--------', list)
|
|
|
|
+ for(const {executionTime} of list) {
|
|
|
|
+ let date2 = dayjs(new Date(executionTime)).format('YYYY-MM-DD')
|
|
|
|
+ if (date === date2) {
|
|
|
|
+ day.bottomInfo = '•'
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return day
|
|
|
|
+ }" />
|
|
<wd-floating-panel v-if="!addSheetVisible" :anchors="[260, 490]" :custom-class="'h-auto'">
|
|
<wd-floating-panel v-if="!addSheetVisible" :anchors="[260, 490]" :custom-class="'h-auto'">
|
|
<div class="box-border p-4 flex flex-col gap-3.5">
|
|
<div class="box-border p-4 flex flex-col gap-3.5">
|
|
<div class="flex items-center gap-2.5">
|
|
<div class="flex items-center gap-2.5">
|