Преглед на файлове

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

* fix timezone label bug

* modify default timezone

* support filter for timimg modal
Devosend преди 3 години
родител
ревизия
6e6407cb18

+ 3 - 3
dolphinscheduler-ui-next/src/layouts/content/components/timezone/index.tsx

@@ -36,11 +36,11 @@ const Timezone = defineComponent({
     const { t } = useI18n()
     const reload: any = inject('reload')
     const timezoneStore = useTimezoneStore()
-    const chooseVal = ref(
+    const currentTime =
       props.timezoneOptions.filter(
         (item: { value: string }) => item.value === timezoneStore.getTimezone
-      )[0].label
-    )
+      )[0] || {}
+    const chooseVal = ref(currentTime.label)
 
     const currentTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone
     const options = [

+ 42 - 7
dolphinscheduler-ui-next/src/utils/timezone.ts

@@ -400,7 +400,6 @@ export const timezoneList = [
   'Chile/EasterIsland',
   'Cuba',
   'EET',
-  'EST',
   'EST5EDT',
   'Egypt',
   'Eire',
@@ -505,11 +504,8 @@ export const timezoneList = [
   'GB',
   'GB-Eire',
   'GMT',
-  'GMT+0',
-  'GMT-0',
   'GMT0',
   'Greenwich',
-  'HST',
   'Hongkong',
   'Iceland',
   'Indian/Antananarivo',
@@ -530,7 +526,6 @@ export const timezoneList = [
   'Kwajalein',
   'Libya',
   'MET',
-  'MST',
   'MST7MDT',
   'Mexico/BajaNorte',
   'Mexico/BajaSur',
@@ -585,9 +580,21 @@ export const timezoneList = [
   'Pacific/Yap',
   'Poland',
   'Portugal',
-  'ROC',
   'ROK',
   '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',
   'UCT',
   'US/Alaska',
@@ -607,5 +614,33 @@ export const timezoneList = [
   'Universal',
   'W-SU',
   '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'
 ]

+ 1 - 3
dolphinscheduler-ui-next/src/views/login/use-login.ts

@@ -40,9 +40,7 @@ export function useLogin(state: any) {
         const userInfoRes: UserInfoRes = await getUserInfo()
         await userStore.setUserInfo(userInfoRes)
 
-        const timezone = userInfoRes.timeZone
-          ? userInfoRes.timeZone
-          : Intl.DateTimeFormat().resolvedOptions().timeZone
+        const timezone = userInfoRes.timeZone ? userInfoRes.timeZone : 'UTC'
         await timezoneStore.setTimezone(timezone)
 
         const path = routeStore.lastRoute

+ 1 - 0
dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/timing-modal.tsx

@@ -305,6 +305,7 @@ export default defineComponent({
             <NSelect
               v-model:value={this.timingForm.timezoneId}
               options={this.timezoneOptions()}
+              filterable
             />
           </NFormItem>
           <NFormItem label=' ' showFeedback={false}>