Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
10483577
authored
Oct 31, 2023
by
xingyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: types
parent
52755b38
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
src/components/ConfigGlobal/src/ConfigGlobal.vue
+6
-7
src/components/ShortcutDateRangePicker/index.vue
+1
-1
src/utils/formatTime.ts
+2
-2
No files found.
src/components/ConfigGlobal/src/ConfigGlobal.vue
View file @
10483577
<
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
<
ElementPlus
Size
>
([
'default'
,
'small'
,
'large'
]).
def
(
'default'
)
size
:
propTypes
.
oneOf
<
Component
Size
>
([
'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>
...
...
src/components/ShortcutDateRangePicker/index.vue
View file @
10483577
...
@@ -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
=
[
...
...
src/utils/formatTime.ts
View file @
10483577
...
@@ -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
(
)]
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment