chore: i18n
This commit is contained in:
parent
93f9388f96
commit
29d1e38843
@ -9,6 +9,7 @@ import { useRouter } from 'vue-router';
|
|||||||
import { useAccess } from '@vben/access';
|
import { useAccess } from '@vben/access';
|
||||||
import { DEFAULT_HOME_PATH } from '@vben/constants';
|
import { DEFAULT_HOME_PATH } from '@vben/constants';
|
||||||
import { useTabs } from '@vben/hooks';
|
import { useTabs } from '@vben/hooks';
|
||||||
|
import { $t } from '@vben/locales';
|
||||||
|
|
||||||
import { message, Select } from 'ant-design-vue';
|
import { message, Select } from 'ant-design-vue';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
@ -64,7 +65,9 @@ const onSelected: SelectHandler = async (tenantId: string, option: any) => {
|
|||||||
}
|
}
|
||||||
await tenantDynamicToggle(tenantId);
|
await tenantDynamicToggle(tenantId);
|
||||||
lastSelected.value = tenantId;
|
lastSelected.value = tenantId;
|
||||||
message.success(`切换当前租户为: ${option.companyName}`);
|
message.success(
|
||||||
|
`${$t('component.tenantToggle.switch')} ${option.companyName}`,
|
||||||
|
);
|
||||||
close(true);
|
close(true);
|
||||||
// 需要放在宏队列处理 直接清空页面由于没有字典会有样式问题(标签变成unknown)
|
// 需要放在宏队列处理 直接清空页面由于没有字典会有样式问题(标签变成unknown)
|
||||||
setTimeout(() => dictStore.resetCache());
|
setTimeout(() => dictStore.resetCache());
|
||||||
@ -73,7 +76,7 @@ const onSelected: SelectHandler = async (tenantId: string, option: any) => {
|
|||||||
async function onDeselect() {
|
async function onDeselect() {
|
||||||
await tenantDynamicClear();
|
await tenantDynamicClear();
|
||||||
dictStore.resetCache();
|
dictStore.resetCache();
|
||||||
message.success('还原为默认租户');
|
message.success($t('component.tenantToggle.reset'));
|
||||||
lastSelected.value = '';
|
lastSelected.value = '';
|
||||||
close(false);
|
close(false);
|
||||||
// 需要放在宏队列处理 直接清空页面由于没有字典会有样式问题(标签变成unknown)
|
// 需要放在宏队列处理 直接清空页面由于没有字典会有样式问题(标签变成unknown)
|
||||||
@ -97,9 +100,9 @@ function filterOption(input: string, option: TenantOption) {
|
|||||||
:field-names="{ label: 'companyName', value: 'tenantId' }"
|
:field-names="{ label: 'companyName', value: 'tenantId' }"
|
||||||
:filter-option="filterOption"
|
:filter-option="filterOption"
|
||||||
:options="tenantList"
|
:options="tenantList"
|
||||||
|
:placeholder="$t('component.tenantToggle.placeholder')"
|
||||||
allow-clear
|
allow-clear
|
||||||
class="w-60"
|
class="w-60"
|
||||||
placeholder="选择租户"
|
|
||||||
show-search
|
show-search
|
||||||
@deselect="onDeselect"
|
@deselect="onDeselect"
|
||||||
@select="onSelected"
|
@select="onSelected"
|
||||||
|
@ -20,6 +20,11 @@
|
|||||||
"btn_zoom_in": "Zoom in",
|
"btn_zoom_in": "Zoom in",
|
||||||
"btn_zoom_out": "Zoom out",
|
"btn_zoom_out": "Zoom out",
|
||||||
"preview": "Preview"
|
"preview": "Preview"
|
||||||
|
},
|
||||||
|
"tenantToggle": {
|
||||||
|
"placeholder": "Please select a tenant",
|
||||||
|
"switch": "Switch to tenant: ",
|
||||||
|
"reset": "Reset to default tenant"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
|
@ -20,6 +20,11 @@
|
|||||||
"btn_zoom_in": "放大",
|
"btn_zoom_in": "放大",
|
||||||
"btn_zoom_out": "缩小",
|
"btn_zoom_out": "缩小",
|
||||||
"preview": "预览"
|
"preview": "预览"
|
||||||
|
},
|
||||||
|
"tenantToggle": {
|
||||||
|
"placeholder": "选择租户",
|
||||||
|
"switch": "切换当前租户为: ",
|
||||||
|
"reset": "还原为默认租户"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pages": {
|
"pages": {
|
||||||
|
Loading…
Reference in New Issue
Block a user