mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 19:29:04 +08:00
feat: support vscode i18n-ally plugin
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<BasicModal :width="800" :title="t('tableActionDesc')" v-bind="$attrs">
|
||||
<BasicModal :width="800" :title="t('sys.errorLog.tableActionDesc')" v-bind="$attrs">
|
||||
<Description :data="info" @register="register" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
@@ -23,7 +23,7 @@
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
const { t } = useI18n('sys.errorLog');
|
||||
const { t } = useI18n();
|
||||
const [register] = useDescription({
|
||||
column: 2,
|
||||
schema: getDescSchema(),
|
||||
|
@@ -3,13 +3,13 @@ import { BasicColumn } from '/@/components/Table/index';
|
||||
import { ErrorTypeEnum } from '/@/enums/exceptionEnum';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
|
||||
const { t } = useI18n('sys.errorLog');
|
||||
const { t } = useI18n();
|
||||
|
||||
export function getColumns(): BasicColumn[] {
|
||||
return [
|
||||
{
|
||||
dataIndex: 'type',
|
||||
title: t('tableColumnType'),
|
||||
title: t('sys.errorLog.tableColumnType'),
|
||||
width: 80,
|
||||
customRender: ({ text }) => {
|
||||
const color =
|
||||
@@ -32,12 +32,12 @@ export function getColumns(): BasicColumn[] {
|
||||
},
|
||||
{
|
||||
dataIndex: 'time',
|
||||
title: t('tableColumnDate'),
|
||||
title: t('sys.errorLog.tableColumnDate'),
|
||||
width: 160,
|
||||
},
|
||||
{
|
||||
dataIndex: 'file',
|
||||
title: t('tableColumnFile'),
|
||||
title: t('sys.errorLog.tableColumnFile'),
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
@@ -47,12 +47,12 @@ export function getColumns(): BasicColumn[] {
|
||||
},
|
||||
{
|
||||
dataIndex: 'message',
|
||||
title: t('tableColumnMsg'),
|
||||
title: t('sys.errorLog.tableColumnMsg'),
|
||||
width: 300,
|
||||
},
|
||||
{
|
||||
dataIndex: 'stack',
|
||||
title: t('tableColumnStackMsg'),
|
||||
title: t('sys.errorLog.tableColumnStackMsg'),
|
||||
width: 300,
|
||||
},
|
||||
];
|
||||
|
@@ -53,7 +53,7 @@
|
||||
const rowInfoRef = ref<ErrorInfo>();
|
||||
const imgListRef = ref<string[]>([]);
|
||||
|
||||
const { t } = useI18n('sys.errorLog');
|
||||
const { t } = useI18n();
|
||||
|
||||
const [register, { setTableData }] = useTable({
|
||||
title: t('sys.errorLog.tableTitle'),
|
||||
@@ -80,7 +80,7 @@
|
||||
);
|
||||
const { createMessage } = useMessage();
|
||||
if (isDevMode()) {
|
||||
createMessage.info(t('enableMessage'));
|
||||
createMessage.info(t('sys.errorLog.enableMessage'));
|
||||
}
|
||||
// 查看详情
|
||||
function handleDetail(row: ErrorInfo) {
|
||||
|
@@ -53,7 +53,7 @@ export default defineComponent({
|
||||
const { query } = useRoute();
|
||||
const go = useGo();
|
||||
const redo = useRedo();
|
||||
const { t } = useI18n('sys.exception');
|
||||
const { t } = useI18n();
|
||||
|
||||
const getStatus = computed(() => {
|
||||
const { status: routeStatus } = query;
|
||||
@@ -67,13 +67,13 @@ export default defineComponent({
|
||||
}
|
||||
);
|
||||
|
||||
const backLoginI18n = t('backLogin');
|
||||
const backHomeI18n = t('backHome');
|
||||
const backLoginI18n = t('sys.exception.backLogin');
|
||||
const backHomeI18n = t('sys.exception.backHome');
|
||||
|
||||
unref(statusMapRef).set(ExceptionEnum.PAGE_NOT_ACCESS, {
|
||||
title: '403',
|
||||
status: `${ExceptionEnum.PAGE_NOT_ACCESS}`,
|
||||
subTitle: t('subTitle403'),
|
||||
subTitle: t('sys.exception.subTitle403'),
|
||||
btnText: props.full ? backLoginI18n : backHomeI18n,
|
||||
handler: () => (props.full ? go(PageEnum.BASE_LOGIN) : go()),
|
||||
});
|
||||
@@ -81,7 +81,7 @@ export default defineComponent({
|
||||
unref(statusMapRef).set(ExceptionEnum.PAGE_NOT_FOUND, {
|
||||
title: '404',
|
||||
status: `${ExceptionEnum.PAGE_NOT_FOUND}`,
|
||||
subTitle: t('subTitle404'),
|
||||
subTitle: t('sys.exception.subTitle404'),
|
||||
btnText: props.full ? backLoginI18n : backHomeI18n,
|
||||
handler: () => (props.full ? go(PageEnum.BASE_LOGIN) : go()),
|
||||
});
|
||||
@@ -89,22 +89,22 @@ export default defineComponent({
|
||||
unref(statusMapRef).set(ExceptionEnum.ERROR, {
|
||||
title: '500',
|
||||
status: `${ExceptionEnum.ERROR}`,
|
||||
subTitle: t('subTitle500'),
|
||||
subTitle: t('sys.exception.subTitle500'),
|
||||
btnText: backHomeI18n,
|
||||
handler: () => go(),
|
||||
});
|
||||
|
||||
unref(statusMapRef).set(ExceptionEnum.PAGE_NOT_DATA, {
|
||||
title: t('noDataTitle'),
|
||||
title: t('sys.exception.noDataTitle'),
|
||||
subTitle: '',
|
||||
btnText: t('redo'),
|
||||
btnText: t('sys.exception.redo'),
|
||||
handler: () => redo(),
|
||||
icon: notDataImg,
|
||||
});
|
||||
|
||||
unref(statusMapRef).set(ExceptionEnum.NET_WORK_ERROR, {
|
||||
title: t('networkErrorTitle'),
|
||||
subTitle: t('networkErrorSubTitle'),
|
||||
title: t('sys.exception.networkErrorTitle'),
|
||||
subTitle: t('sys.exception.networkErrorSubTitle'),
|
||||
btnText: 'Refresh',
|
||||
handler: () => redo(),
|
||||
icon: netWorkImg,
|
||||
|
@@ -36,7 +36,7 @@
|
||||
const loadingRef = ref(false);
|
||||
const errMsgRef = ref(false);
|
||||
|
||||
const { t } = useI18n('sys.lock');
|
||||
const { t } = useI18n();
|
||||
const [register, { validateFields }] = useForm({
|
||||
showActionButtonGroup: false,
|
||||
schemas: [
|
||||
@@ -46,7 +46,7 @@
|
||||
component: 'InputPassword',
|
||||
componentProps: {
|
||||
style: { width: '100%' },
|
||||
placeholder: t('placeholder'),
|
||||
placeholder: t('sys.lock.placeholder'),
|
||||
},
|
||||
rules: [{ required: true }],
|
||||
},
|
||||
|
@@ -90,7 +90,7 @@
|
||||
const globSetting = useGlobSetting();
|
||||
const { locale } = useProjectSetting();
|
||||
const { notification } = useMessage();
|
||||
const { t } = useI18n('sys.login');
|
||||
const { t } = useI18n();
|
||||
|
||||
// const openLoginVerifyRef = computed(() => appStore.getProjectConfig.openLoginVerify);
|
||||
|
||||
@@ -104,8 +104,10 @@
|
||||
});
|
||||
|
||||
const formRules = reactive({
|
||||
account: [{ required: true, message: t('accountPlaceholder'), trigger: 'blur' }],
|
||||
password: [{ required: true, message: t('passwordPlaceholder'), trigger: 'blur' }],
|
||||
account: [{ required: true, message: t('sys.login.accountPlaceholder'), trigger: 'blur' }],
|
||||
password: [
|
||||
{ required: true, message: t('sys.login.passwordPlaceholder'), trigger: 'blur' },
|
||||
],
|
||||
// verify: unref(openLoginVerifyRef) ? [{ required: true, message: '请通过验证码校验' }] : [],
|
||||
});
|
||||
|
||||
@@ -130,8 +132,8 @@
|
||||
);
|
||||
if (userInfo) {
|
||||
notification.success({
|
||||
message: t('loginSuccessTitle'),
|
||||
description: `${t('loginSuccessDesc')}: ${userInfo.realName}`,
|
||||
message: t('sys.login.loginSuccessTitle'),
|
||||
description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realName}`,
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user