日历优化一次字典数据
This commit is contained in:
parent
ac3d70f44f
commit
1178f84422
@ -46,13 +46,13 @@
|
|||||||
<template #reference>
|
<template #reference>
|
||||||
<div @click="handleSelect(data)" :class="{ 'holidayWork': holidayDate[data.day]?.isWorkday }">
|
<div @click="handleSelect(data)" :class="{ 'holidayWork': holidayDate[data.day]?.isWorkday }">
|
||||||
<span style="font-size: 12px">
|
<span style="font-size: 12px">
|
||||||
{{ formatDate2(data.date) === current? data.date.getDate()+'(今天)':data.date.getDate() }}
|
{{ formatDate2(data.date) === current? `${data.date.getDate()}(今天)`:data.date.getDate() }}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
v-if="holidayDate[data.day]?.content !== ''&&holidayDate[data.day]?.content !== null&&holidayDate[data.day]?.content !== undefined"
|
v-if="holidayDate[data.day]?.content !== ''&&holidayDate[data.day]?.content !== null&&holidayDate[data.day]?.content !== undefined"
|
||||||
style="font-size: 12px"
|
style="font-size: 12px"
|
||||||
>
|
>
|
||||||
{{'('+getIntDictOptions(DICT_TYPE.CALENDAR_CONTENT)[holidayDate[data.day]?.content].label+')'}}
|
({{dictData[holidayDate[data.day]?.content].label}})
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -107,7 +107,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {CalendarInstance} from "element-plus";
|
import {CalendarInstance} from "element-plus";
|
||||||
import {CalendarApi, CalendarVO} from "@/api/home/calendar";
|
import {CalendarApi, CalendarVO} from "@/api/home/calendar";
|
||||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
import {getIntDictOptions, DICT_TYPE, NumberDictDataType} from '@/utils/dict'
|
||||||
import {Close} from "@element-plus/icons-vue";
|
import {Close} from "@element-plus/icons-vue";
|
||||||
|
|
||||||
defineOptions({ name: 'CalendarAgendaIndex' })
|
defineOptions({ name: 'CalendarAgendaIndex' })
|
||||||
@ -285,8 +285,16 @@ const toYear = () => {
|
|||||||
currentYear.value = new Date().getFullYear()
|
currentYear.value = new Date().getFullYear()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//字典数据
|
||||||
|
let dictData:NumberDictDataType[] = [];
|
||||||
|
//获取字典数据
|
||||||
|
const getDict = async ()=> {
|
||||||
|
dictData = getIntDictOptions(DICT_TYPE.CALENDAR_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
//打开获取数据处理数据来渲染
|
//打开获取数据处理数据来渲染
|
||||||
onMounted( async ()=> {
|
onMounted( async ()=> {
|
||||||
|
await getDict()
|
||||||
await getListDate()
|
await getListDate()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user