fix: types

This commit is contained in:
xingyu 2023-10-31 14:26:17 +08:00
parent 52755b38a9
commit 10483577b7
3 changed files with 9 additions and 10 deletions

View File

@ -1,20 +1,19 @@
<script lang="ts" setup> <script setup lang="ts">
import { provide, computed, watch, onMounted } from 'vue'
import { propTypes } from '@/utils/propTypes' import { propTypes } from '@/utils/propTypes'
import { ComponentSize, ElConfigProvider } from 'element-plus'
import { useLocaleStore } from '@/store/modules/locale' import { useLocaleStore } from '@/store/modules/locale'
import { useWindowSize } from '@vueuse/core'
import { useAppStore } from '@/store/modules/app' import { useAppStore } from '@/store/modules/app'
import { setCssVar } from '@/utils' import { setCssVar } from '@/utils'
import { useDesign } from '@/hooks/web/useDesign' import { useDesign } from '@/hooks/web/useDesign'
import { ElementPlusSize } from '@/types/elementPlus'
import { useWindowSize } from '@vueuse/core'
defineOptions({ name: 'ConfigGlobal' })
const { variables } = useDesign() const { variables } = useDesign()
const appStore = useAppStore() const appStore = useAppStore()
const props = defineProps({ const props = defineProps({
size: propTypes.oneOf<ElementPlusSize>(['default', 'small', 'large']).def('default') size: propTypes.oneOf<ComponentSize>(['default', 'small', 'large']).def('default')
}) })
provide('configGlobal', props) provide('configGlobal', props)
@ -53,9 +52,9 @@ const currentLocale = computed(() => localeStore.currentLocale)
<template> <template>
<ElConfigProvider <ElConfigProvider
:namespace="variables.elNamespace"
:locale="currentLocale.elLocale" :locale="currentLocale.elLocale"
:message="{ max: 1 }" :message="{ max: 1 }"
:namespace="variables.elNamespace"
:size="size" :size="size"
> >
<slot></slot> <slot></slot>

View File

@ -27,7 +27,7 @@ import * as DateUtil from '@/utils/formatTime'
defineOptions({ name: 'ShortcutDateRangePicker' }) defineOptions({ name: 'ShortcutDateRangePicker' })
const shortcutDays = ref(7) // , 7 const shortcutDays = ref(7) // , 7
const times = ref<[dayjs.ConfigType, dayjs.ConfigType]>(['', '']) // const times = ref<[string, string]>(['', '']) //
defineExpose({ times }) // defineExpose({ times }) //
/** 日期快捷选择 */ /** 日期快捷选择 */
const shortcuts = [ const shortcuts = [

View File

@ -334,6 +334,6 @@ export function getLast1Year(): [dayjs.ConfigType, dayjs.ConfigType] {
export function getDateRange( export function getDateRange(
beginDate: dayjs.ConfigType, beginDate: dayjs.ConfigType,
endDate: dayjs.ConfigType endDate: dayjs.ConfigType
): [dayjs.ConfigType, dayjs.ConfigType] { ): [string, string] {
return [dayjs(beginDate).startOf('d'), dayjs(endDate).endOf('d')] return [dayjs(beginDate).startOf('d').toString(), dayjs(endDate).endOf('d').toString()]
} }