feat: increase support for multiple time zones
This commit is contained in:
@@ -22,6 +22,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
|
||||
"enableCheckUpdates": true,
|
||||
"enablePreferences": true,
|
||||
"enableRefreshToken": false,
|
||||
"enableStickyPreferencesNavigationBar": true,
|
||||
"isMobile": false,
|
||||
"layout": "sidebar-nav",
|
||||
"locale": "zh-CN",
|
||||
@@ -29,6 +30,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
|
||||
"name": "Vben Admin",
|
||||
"preferencesButtonPosition": "auto",
|
||||
"watermark": false,
|
||||
"watermarkContent": "",
|
||||
"zIndex": 200,
|
||||
},
|
||||
"breadcrumb": {
|
||||
@@ -131,6 +133,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
|
||||
"refresh": true,
|
||||
"sidebarToggle": true,
|
||||
"themeToggle": true,
|
||||
"timezone": true,
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -16,8 +16,8 @@ import {
|
||||
interface Props {
|
||||
timezoneOptions: string[];
|
||||
okHandler?: (
|
||||
timezone: string,
|
||||
modalApi: ExtendedModalApi,
|
||||
modalApi?: ExtendedModalApi,
|
||||
timezone?: string,
|
||||
) => Promise<void> | void;
|
||||
timezone?: string;
|
||||
}
|
||||
@@ -34,7 +34,7 @@ const TimezoneIcon = createIconifyIcon('fluent-mdl2:world-clock');
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
fullscreenButton: false,
|
||||
onConfirm: () => {
|
||||
props.okHandler?.(unref(timezoneValue), modalApi);
|
||||
props.okHandler?.(modalApi, unref(timezoneValue));
|
||||
},
|
||||
});
|
||||
|
||||
@@ -42,11 +42,11 @@ const handleClick = () => {
|
||||
modalApi.open();
|
||||
};
|
||||
|
||||
const timezoneValue = ref(props.timezone);
|
||||
const timezoneValue = ref<string | undefined>(unref(props.timezone));
|
||||
watch(
|
||||
() => props.timezone,
|
||||
(newTimezone) => {
|
||||
timezoneValue.value = newTimezone;
|
||||
timezoneValue.value = unref(newTimezone);
|
||||
},
|
||||
);
|
||||
const handleClickItem = (timezone: string) => {
|
||||
|
||||
@@ -69,7 +69,7 @@ function useEcharts(chartRef: Ref<EchartsUIType>) {
|
||||
|
||||
const renderEcharts = (
|
||||
options: EChartsOption,
|
||||
clear = true
|
||||
clear = true,
|
||||
): Promise<Nullable<echarts.ECharts>> => {
|
||||
cacheOptions = options;
|
||||
const currentOptions = {
|
||||
|
||||
Reference in New Issue
Block a user