未验证 提交 6e6407cb 编写于 作者: D Devosend 提交者: GitHub

[Fix][UI Next][V1.0.0-Alpha] Home white screen bug (#9161)

* fix timezone label bug

* modify default timezone

* support filter for timimg modal
上级 327a60ef
...@@ -36,11 +36,11 @@ const Timezone = defineComponent({ ...@@ -36,11 +36,11 @@ const Timezone = defineComponent({
const { t } = useI18n() const { t } = useI18n()
const reload: any = inject('reload') const reload: any = inject('reload')
const timezoneStore = useTimezoneStore() const timezoneStore = useTimezoneStore()
const chooseVal = ref( const currentTime =
props.timezoneOptions.filter( props.timezoneOptions.filter(
(item: { value: string }) => item.value === timezoneStore.getTimezone (item: { value: string }) => item.value === timezoneStore.getTimezone
)[0].label )[0] || {}
) const chooseVal = ref(currentTime.label)
const currentTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone const currentTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone
const options = [ const options = [
......
...@@ -400,7 +400,6 @@ export const timezoneList = [ ...@@ -400,7 +400,6 @@ export const timezoneList = [
'Chile/EasterIsland', 'Chile/EasterIsland',
'Cuba', 'Cuba',
'EET', 'EET',
'EST',
'EST5EDT', 'EST5EDT',
'Egypt', 'Egypt',
'Eire', 'Eire',
...@@ -505,11 +504,8 @@ export const timezoneList = [ ...@@ -505,11 +504,8 @@ export const timezoneList = [
'GB', 'GB',
'GB-Eire', 'GB-Eire',
'GMT', 'GMT',
'GMT+0',
'GMT-0',
'GMT0', 'GMT0',
'Greenwich', 'Greenwich',
'HST',
'Hongkong', 'Hongkong',
'Iceland', 'Iceland',
'Indian/Antananarivo', 'Indian/Antananarivo',
...@@ -530,7 +526,6 @@ export const timezoneList = [ ...@@ -530,7 +526,6 @@ export const timezoneList = [
'Kwajalein', 'Kwajalein',
'Libya', 'Libya',
'MET', 'MET',
'MST',
'MST7MDT', 'MST7MDT',
'Mexico/BajaNorte', 'Mexico/BajaNorte',
'Mexico/BajaSur', 'Mexico/BajaSur',
...@@ -585,9 +580,21 @@ export const timezoneList = [ ...@@ -585,9 +580,21 @@ export const timezoneList = [
'Pacific/Yap', 'Pacific/Yap',
'Poland', 'Poland',
'Portugal', 'Portugal',
'ROC',
'ROK', 'ROK',
'Singapore', 'Singapore',
'SystemV/AST4',
'SystemV/AST4ADT',
'SystemV/CST6',
'SystemV/CST6CDT',
'SystemV/EST5',
'SystemV/EST5EDT',
'SystemV/HST10',
'SystemV/MST7',
'SystemV/MST7MDT',
'SystemV/PST8',
'SystemV/PST8PDT',
'SystemV/YST9',
'SystemV/YST9YDT',
'Turkey', 'Turkey',
'UCT', 'UCT',
'US/Alaska', 'US/Alaska',
...@@ -607,5 +614,33 @@ export const timezoneList = [ ...@@ -607,5 +614,33 @@ export const timezoneList = [
'Universal', 'Universal',
'W-SU', 'W-SU',
'WET', 'WET',
'Zulu' 'Zulu',
'EST',
'HST',
'MST',
'ACT',
'AET',
'AGT',
'ART',
'AST',
'BET',
'BST',
'CAT',
'CNT',
'CST',
'CTT',
'EAT',
'ECT',
'IET',
'IST',
'JST',
'MIT',
'NET',
'NST',
'PLT',
'PNT',
'PRT',
'PST',
'SST',
'VST'
] ]
...@@ -40,9 +40,7 @@ export function useLogin(state: any) { ...@@ -40,9 +40,7 @@ export function useLogin(state: any) {
const userInfoRes: UserInfoRes = await getUserInfo() const userInfoRes: UserInfoRes = await getUserInfo()
await userStore.setUserInfo(userInfoRes) await userStore.setUserInfo(userInfoRes)
const timezone = userInfoRes.timeZone const timezone = userInfoRes.timeZone ? userInfoRes.timeZone : 'UTC'
? userInfoRes.timeZone
: Intl.DateTimeFormat().resolvedOptions().timeZone
await timezoneStore.setTimezone(timezone) await timezoneStore.setTimezone(timezone)
const path = routeStore.lastRoute const path = routeStore.lastRoute
......
...@@ -305,6 +305,7 @@ export default defineComponent({ ...@@ -305,6 +305,7 @@ export default defineComponent({
<NSelect <NSelect
v-model:value={this.timingForm.timezoneId} v-model:value={this.timingForm.timezoneId}
options={this.timezoneOptions()} options={this.timezoneOptions()}
filterable
/> />
</NFormItem> </NFormItem>
<NFormItem label=' ' showFeedback={false}> <NFormItem label=' ' showFeedback={false}>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册