Skip to content

Commit

Permalink
[Feature][UI Next] Add charts i18n. (apache#7568)
Browse files Browse the repository at this point in the history
  • Loading branch information
songjianet authored and aaronlinv committed Dec 28, 2021
1 parent 321ebe3 commit 31a6695
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 637 deletions.
17 changes: 16 additions & 1 deletion dolphinscheduler-ui-next/src/components/chart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@
* limitations under the License.
*/

import { getCurrentInstance, onMounted, onBeforeUnmount, watch } from 'vue'
import {
getCurrentInstance,
onMounted,
onBeforeUnmount,
watch,
} from 'vue'
import { useThemeStore } from '@/store/theme/theme'
import { throttle } from 'echarts'
import { useI18n } from 'vue-i18n'
import type { Ref } from 'vue'
import type { ECharts } from 'echarts'
import type { ECBasicOption } from 'echarts/types/dist/shared'
Expand All @@ -28,6 +34,7 @@ function initChart<Opt extends ECBasicOption>(
): ECharts | null {
let chart: ECharts | null = null
const themeStore = useThemeStore()
const { locale } = useI18n()
const globalProperties =
getCurrentInstance()?.appContext.config.globalProperties

Expand All @@ -51,6 +58,14 @@ function initChart<Opt extends ECBasicOption>(
}
)

watch(
() => locale.value,
() => {
chart?.dispose()
init()
}
)

onMounted(() => {
init()
addEventListener('resize', resize)
Expand Down

This file was deleted.

106 changes: 0 additions & 106 deletions dolphinscheduler-ui-next/src/layouts/basic/components/header/index.tsx

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 31a6695

Please sign in to comment.