Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature][UI Next] Add charts i18n. #7568

Merged
merged 2 commits into from
Dec 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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