Commit 10483577 by xingyu

fix: types

parent 52755b38
<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) ...@@ -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>
......
...@@ -27,7 +27,7 @@ import * as DateUtil from '@/utils/formatTime' ...@@ -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 = [
......
...@@ -334,6 +334,6 @@ export function getLast1Year(): [dayjs.ConfigType, dayjs.ConfigType] { ...@@ -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()]
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment