diff --git a/dbm-ui/frontend/src/components/time-zone-picker/index.vue b/dbm-ui/frontend/src/components/time-zone-picker/index.vue
index 3d4347e69b..e71ba23713 100644
--- a/dbm-ui/frontend/src/components/time-zone-picker/index.vue
+++ b/dbm-ui/frontend/src/components/time-zone-picker/index.vue
@@ -7,7 +7,6 @@
:model-value="localValue"
:no-match-text="t('无匹配数据')"
:placeholder="t('请输入搜索(国家,城市,简称)')"
- :popover-options="{ 'ext-cls': '__bk-date-picker-popover__' }"
:search-placeholder="t('请输入搜索(国家,城市,简称)')"
@change="handleChange">
@@ -94,7 +93,7 @@
import { shallowRef } from 'vue';
import { useI18n } from 'vue-i18n';
- import { useTimeZone } from '@stores';
+ import { useTimeZoneFormat } from '@hooks';
import { encodeRegexp } from '@utils';
@@ -1642,7 +1641,7 @@
};
const { t } = useI18n();
- const timeZoneStore = useTimeZone();
+ const { timeZone } = useTimeZoneFormat();
const timezoneDetails = getTimezoneDetails();
@@ -1659,7 +1658,11 @@
(val) => {
const info = getTimezoneInfoByValue(val);
selected.value = info;
- timeZoneStore.update(info);
+ timeZone.value = {
+ ...info,
+ utc: info.utc.substring(3),
+ };
+
emits('change', val, info);
},
{
diff --git a/dbm-ui/frontend/src/hooks/useTimeZoneFormat.ts b/dbm-ui/frontend/src/hooks/useTimeZoneFormat.ts
index dd6526383f..63b7ddb0b9 100644
--- a/dbm-ui/frontend/src/hooks/useTimeZoneFormat.ts
+++ b/dbm-ui/frontend/src/hooks/useTimeZoneFormat.ts
@@ -11,19 +11,30 @@
* the specific language governing permissions and limitations under the License.
*/
import dayjs from 'dayjs';
-
-import { useTimeZone } from '@stores';
+import { ref } from 'vue';
export const useTimeZoneFormat = () => {
- const timeZoneStore = useTimeZone();
- return (date: string) => {
+ const timeZone = ref({
+ abbreviation: '',
+ country: '',
+ countryCode: '',
+ label: '',
+ utc: '',
+ });
+
+ const format = (date: string) => {
if (!date) {
return '';
}
const targetDate = dayjs(date).format('YYYY-MM-DD HH:mm:ss');
const prefixStr = targetDate.split(' ').join('T');
- const suffixStr = timeZoneStore.utc === '' ? '+00:00' : timeZoneStore.utc;
+ const suffixStr = timeZone.value.utc === '' ? '+00:00' : timeZone.value.utc;
return `${prefixStr}${suffixStr}`;
};
+
+ return {
+ timeZone,
+ format,
+ };
};
diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json
index f7a0fd90d5..56e4b52d5b 100644
--- a/dbm-ui/frontend/src/locales/zh-cn.json
+++ b/dbm-ui/frontend/src/locales/zh-cn.json
@@ -3490,5 +3490,6 @@
"库表名支持数字、字母、中划线、下划线,最大35字符": "库表名支持数字、字母、中划线、下划线,最大35字符",
"不允许输入系统库和特殊库": "不允许输入系统库和特殊库",
"不能以stage_truncate开头或dba_rollback结尾": "不能以 stage_truncate 开头或 dba_rollback 结尾",
+ "备份记录(d):预期返回 n 个 DB 的备份记录,实际返回 m 个": "备份记录({0}):预期返回 {1} 个 DB 的备份记录,实际返回 {2} 个",
"这行勿动!新增翻译请在上一行添加!": ""
}
diff --git a/dbm-ui/frontend/src/stores/index.ts b/dbm-ui/frontend/src/stores/index.ts
index 9e25238ef6..6ac8ee183a 100644
--- a/dbm-ui/frontend/src/stores/index.ts
+++ b/dbm-ui/frontend/src/stores/index.ts
@@ -17,5 +17,4 @@ export * from './useMenu';
export * from './useSqlImport';
export * from './useSQLTaskCount';
export * from './useSystemEnviron';
-export * from './useTimeZone';
export * from './useUserProfile';
diff --git a/dbm-ui/frontend/src/stores/useTimeZone.ts b/dbm-ui/frontend/src/stores/useTimeZone.ts
deleted file mode 100644
index 101b4b0f73..0000000000
--- a/dbm-ui/frontend/src/stores/useTimeZone.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available.
- *
- * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved.
- *
- * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at https://opensource.org/licenses/MIT
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
- * the specific language governing permissions and limitations under the License.
- */
-
-import { defineStore } from 'pinia';
-
-interface State {
- abbreviation: string;
- country: string;
- countryCode: string;
- label: string;
- utc: string;
-}
-
-export const useTimeZone = defineStore('useTimeZone', {
- state: (): State => ({
- abbreviation: '',
- country: '',
- countryCode: '',
- label: '',
- utc: '',
- }),
- actions: {
- update(newState: State) {
- const { abbreviation, country, countryCode, label, utc } = newState;
- this.$patch({
- abbreviation,
- country,
- countryCode,
- label,
- utc: utc.substring(3),
- });
- },
- },
-});
diff --git a/dbm-ui/frontend/src/views/db-manage/common/sql-execute/ticket-mode/Index.vue b/dbm-ui/frontend/src/views/db-manage/common/sql-execute/ticket-mode/Index.vue
index 6ddeccf902..fc24a54805 100644
--- a/dbm-ui/frontend/src/views/db-manage/common/sql-execute/ticket-mode/Index.vue
+++ b/dbm-ui/frontend/src/views/db-manage/common/sql-execute/ticket-mode/Index.vue
@@ -80,7 +80,7 @@
import TimeZonePicker from '@components/time-zone-picker/index.vue';
const { t } = useI18n();
- const formatDateToUTC = useTimeZoneFormat();
+ const { format: formatDateToUTC } = useTimeZoneFormat();
const modelValue = defineModel<{
mode: string;
diff --git a/dbm-ui/frontend/src/views/mongodb-manage/db-structure/pages/page1/components/render-target-cluster/render-table/RenderTargetTime.vue b/dbm-ui/frontend/src/views/mongodb-manage/db-structure/pages/page1/components/render-target-cluster/render-table/RenderTargetTime.vue
index fa8b2df747..0fe2019d23 100644
--- a/dbm-ui/frontend/src/views/mongodb-manage/db-structure/pages/page1/components/render-target-cluster/render-table/RenderTargetTime.vue
+++ b/dbm-ui/frontend/src/views/mongodb-manage/db-structure/pages/page1/components/render-target-cluster/render-table/RenderTargetTime.vue
@@ -33,7 +33,7 @@
const disableDate = (date: Date) => date && date.valueOf() > Date.now();
const { t } = useI18n();
- const formatDateToUTC = useTimeZoneFormat();
+ const { format: formatDateToUTC } = useTimeZoneFormat();
const timerRules = [
{
diff --git a/dbm-ui/frontend/src/views/mysql/flashback/pages/page1/components/RenderData/RenderEndTime.vue b/dbm-ui/frontend/src/views/mysql/flashback/pages/page1/components/RenderData/RenderEndTime.vue
index 5fddbc7550..55941a07c1 100644
--- a/dbm-ui/frontend/src/views/mysql/flashback/pages/page1/components/RenderData/RenderEndTime.vue
+++ b/dbm-ui/frontend/src/views/mysql/flashback/pages/page1/components/RenderData/RenderEndTime.vue
@@ -60,7 +60,7 @@
});
const { t } = useI18n();
- const formatDateToUTC = useTimeZoneFormat();
+ const { format: formatDateToUTC } = useTimeZoneFormat();
const editRef = ref();
const isNowTime = ref(false);
diff --git a/dbm-ui/frontend/src/views/mysql/flashback/pages/page1/components/RenderData/RenderStartTime.vue b/dbm-ui/frontend/src/views/mysql/flashback/pages/page1/components/RenderData/RenderStartTime.vue
index b55b24e696..672a100da0 100644
--- a/dbm-ui/frontend/src/views/mysql/flashback/pages/page1/components/RenderData/RenderStartTime.vue
+++ b/dbm-ui/frontend/src/views/mysql/flashback/pages/page1/components/RenderData/RenderStartTime.vue
@@ -36,7 +36,7 @@
});
const { t } = useI18n();
- const formatDateToUTC = useTimeZoneFormat();
+ const { format: formatDateToUTC } = useTimeZoneFormat();
const editRef = ref();
diff --git a/dbm-ui/frontend/src/views/mysql/rollback/pages/page1/components/common/render-mode/Index.vue b/dbm-ui/frontend/src/views/mysql/rollback/pages/page1/components/common/render-mode/Index.vue
index 0648b33f68..689c36a46a 100644
--- a/dbm-ui/frontend/src/views/mysql/rollback/pages/page1/components/common/render-mode/Index.vue
+++ b/dbm-ui/frontend/src/views/mysql/rollback/pages/page1/components/common/render-mode/Index.vue
@@ -81,7 +81,7 @@
const disableDate = (date: Date) => date && date.valueOf() > Date.now();
const { t } = useI18n();
- const formatDateToUTC = useTimeZoneFormat();
+ const { format: formatDateToUTC } = useTimeZoneFormat();
const rules = [
{
diff --git a/dbm-ui/frontend/src/views/mysql/rollback/pages/page1/components/common/render-mode/RecordSelector.vue b/dbm-ui/frontend/src/views/mysql/rollback/pages/page1/components/common/render-mode/RecordSelector.vue
index 3f6055a750..35d37e74e8 100644
--- a/dbm-ui/frontend/src/views/mysql/rollback/pages/page1/components/common/render-mode/RecordSelector.vue
+++ b/dbm-ui/frontend/src/views/mysql/rollback/pages/page1/components/common/render-mode/RecordSelector.vue
@@ -125,7 +125,6 @@
+
diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/common/RenderCluster.vue b/dbm-ui/frontend/src/views/sqlserver-manage/common/RenderCluster.vue
index 8e1462ed09..6660030ea5 100644
--- a/dbm-ui/frontend/src/views/sqlserver-manage/common/RenderCluster.vue
+++ b/dbm-ui/frontend/src/views/sqlserver-manage/common/RenderCluster.vue
@@ -127,8 +127,10 @@
cloudId: data[0].bk_cloud_id,
domain: data[0].master_domain,
};
+ clusterIdMemo[props.name][instanceKey] = data[0].id;
return true;
}
+ clusterIdMemo[props.name][instanceKey] = 0;
modelValue.value = undefined;
return false;
}),
diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/common/render-mode/Index.vue b/dbm-ui/frontend/src/views/sqlserver-manage/common/render-mode/Index.vue
index ac1fbb1abb..48b077eda3 100644
--- a/dbm-ui/frontend/src/views/sqlserver-manage/common/render-mode/Index.vue
+++ b/dbm-ui/frontend/src/views/sqlserver-manage/common/render-mode/Index.vue
@@ -71,7 +71,7 @@
const disableDate = (date: Date) => date && date.valueOf() > Date.now();
const { t } = useI18n();
- const formatDateToUTC = useTimeZoneFormat();
+ const { format: formatDateToUTC } = useTimeZoneFormat();
const timerRules = [
{
diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/common/render-mode/RecordSelector.vue b/dbm-ui/frontend/src/views/sqlserver-manage/common/render-mode/RecordSelector.vue
index f2ebe2ad6b..f6f8a22cb7 100644
--- a/dbm-ui/frontend/src/views/sqlserver-manage/common/render-mode/RecordSelector.vue
+++ b/dbm-ui/frontend/src/views/sqlserver-manage/common/render-mode/RecordSelector.vue
@@ -78,7 +78,43 @@
active: item.value === modelValue?.backup_id,
}"
@click="handleLogListSelect(item)">
- {{ item.label }}
+