feat: add i18n
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
getChatConversationMyList,
|
||||
updateChatConversationMy,
|
||||
} from '#/api/ai/chat/conversation';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import RoleRepository from '../role/RoleRepository.vue';
|
||||
|
||||
@@ -249,7 +250,7 @@ async function handleClearConversation() {
|
||||
try {
|
||||
await confirm('确认后对话会全部清空,置顶的对话除外。');
|
||||
await deleteChatConversationMyByUnpinned();
|
||||
message.success('操作成功!');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
// 清空 对话 和 对话内容
|
||||
activeConversationId.value = null;
|
||||
// 获取 对话列表
|
||||
|
||||
@@ -44,6 +44,7 @@ import {
|
||||
import * as TaskApi from '#/api/bpm/task';
|
||||
import * as UserApi from '#/api/system/user';
|
||||
import { setConfAndFields2 } from '#/components/form-create';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import Signature from './signature.vue';
|
||||
import ProcessInstanceTimeline from './time-line.vue';
|
||||
@@ -426,7 +427,7 @@ async function handleCopy() {
|
||||
await TaskApi.copyTask(data);
|
||||
copyFormRef.value.resetFields();
|
||||
popOverVisible.value.copy = false;
|
||||
message.success('操作成功');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
} finally {
|
||||
formLoading.value = false;
|
||||
}
|
||||
@@ -448,7 +449,7 @@ async function handleTransfer() {
|
||||
await TaskApi.transferTask(data);
|
||||
transferFormRef.value.resetFields();
|
||||
popOverVisible.value.transfer = false;
|
||||
message.success('操作成功');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
// 2. 加载最新数据
|
||||
reload();
|
||||
} finally {
|
||||
@@ -473,7 +474,7 @@ async function handleDelegate() {
|
||||
await TaskApi.delegateTask(data);
|
||||
popOverVisible.value.delegate = false;
|
||||
delegateFormRef.value.resetFields();
|
||||
message.success('操作成功');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
// 2. 加载最新数据
|
||||
reload();
|
||||
} finally {
|
||||
@@ -496,7 +497,7 @@ async function handlerAddSign(type: string) {
|
||||
userIds: addSignForm.addSignUserIds,
|
||||
};
|
||||
await TaskApi.signCreateTask(data);
|
||||
message.success('操作成功');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
addSignFormRef.value.resetFields();
|
||||
popOverVisible.value.addSign = false;
|
||||
// 2 加载最新数据
|
||||
@@ -523,7 +524,7 @@ async function handleReturn() {
|
||||
await TaskApi.returnTask(data);
|
||||
popOverVisible.value.return = false;
|
||||
returnFormRef.value.resetFields();
|
||||
message.success('操作成功');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
// 2 重新加载数据
|
||||
reload();
|
||||
} finally {
|
||||
@@ -544,7 +545,7 @@ async function handleCancel() {
|
||||
cancelForm.cancelReason,
|
||||
);
|
||||
popOverVisible.value.return = false;
|
||||
message.success('操作成功');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
cancelFormRef.value.resetFields();
|
||||
// 2 重新加载数据
|
||||
reload();
|
||||
|
||||
@@ -7,6 +7,7 @@ import { downloadFileFromBlobPart } from '@vben/utils';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { importDeviceTemplate } from '#/api/iot/device/device';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useImportFormSchema } from '../data';
|
||||
|
||||
@@ -64,7 +65,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
const result = await response.json();
|
||||
|
||||
if (result.code !== 0) {
|
||||
message.error(result.msg || '导入失败');
|
||||
message.error(result.msg || $t('ui.actionMessage.operationFailed'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -94,7 +95,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
await modalApi.close();
|
||||
emit('success');
|
||||
} catch (error: any) {
|
||||
message.error(error.message || '导入失败');
|
||||
message.error(error.message || $t('ui.actionMessage.operationFailed'));
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ async function handleStatusChange(
|
||||
message.success(`${text}成功`);
|
||||
resolve(true);
|
||||
} else {
|
||||
reject(new Error('操作失败'));
|
||||
reject(new Error($t('ui.actionMessage.operationFailed')));
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
@@ -155,7 +155,7 @@ async function handleStatusChange(
|
||||
message.success(`${text}成功`);
|
||||
resolve(true);
|
||||
} else {
|
||||
reject(new Error('操作失败'));
|
||||
reject(new Error($t('ui.actionMessage.operationFailed')));
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
@@ -97,7 +97,7 @@ const showInput = async (index: number) => {
|
||||
const handleInputConfirm = async (index: number, propertyId: number) => {
|
||||
// 从数组中取最后一个输入的值(tags 模式下 inputValue 是数组)
|
||||
const currentValue = inputValue.value?.[inputValue.value.length - 1]?.trim();
|
||||
|
||||
|
||||
if (currentValue) {
|
||||
// 1. 重复添加校验
|
||||
if (
|
||||
@@ -136,10 +136,10 @@ const handleInputConfirm = async (index: number, propertyId: number) => {
|
||||
id,
|
||||
name: currentValue,
|
||||
});
|
||||
message.success($t('common.createSuccess'));
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
emit('success', attributeList.value);
|
||||
} catch {
|
||||
message.error('添加失败,请重试');
|
||||
message.error($t('ui.actionMessage.operationFailed'));
|
||||
}
|
||||
}
|
||||
attributeIndex.value = null;
|
||||
|
||||
@@ -73,7 +73,7 @@ async function handleStatusChange(
|
||||
message.success(`${text}成功`);
|
||||
resolve(true);
|
||||
} else {
|
||||
reject(new Error('操作失败'));
|
||||
reject(new Error($t('ui.actionMessage.operationFailed')));
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
@@ -125,7 +125,7 @@ async function handleExport() {
|
||||
<template #icon>
|
||||
<IconifyIcon icon="lucide:download" />
|
||||
</template>
|
||||
导出
|
||||
{{ $t('page.action.export') }}
|
||||
</Button>
|
||||
</ShortcutDateRangePicker>
|
||||
</div>
|
||||
|
||||
@@ -80,7 +80,7 @@ async function handleStatusChange(
|
||||
ElMessage.success(`${text}成功`);
|
||||
resolve(true);
|
||||
} else {
|
||||
reject(new Error('操作失败'));
|
||||
reject(new Error($t('ui.actionMessage.operationFailed')));
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
@@ -145,7 +145,7 @@ async function handleStatusChange(
|
||||
ElMessage.success(`${text}成功`);
|
||||
resolve(true);
|
||||
} else {
|
||||
reject(new Error('操作失败'));
|
||||
reject(new Error($t('ui.actionMessage.operationFailed')));
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
@@ -70,7 +70,7 @@ async function handleStatusChange(
|
||||
ElMessage.success(`${text}成功`);
|
||||
resolve(true);
|
||||
} else {
|
||||
reject(new Error('操作失败'));
|
||||
reject(new Error($t('ui.actionMessage.operationFailed')));
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
@@ -133,7 +133,7 @@ async function handleExport() {
|
||||
<template #icon>
|
||||
<IconifyIcon icon="lucide:download" />
|
||||
</template>
|
||||
导出
|
||||
{{ $t('page.action.export') }}
|
||||
</ElButton>
|
||||
</ShortcutDateRangePicker>
|
||||
</div>
|
||||
|
||||
@@ -18,8 +18,8 @@ import {
|
||||
isSameDay,
|
||||
} from '@vben/utils';
|
||||
|
||||
import { ElButton, ElCard, ElCol, ElRow } from 'element-plus';
|
||||
import dayjs from 'dayjs';
|
||||
import { ElButton, ElCard, ElCol, ElRow } from 'element-plus';
|
||||
|
||||
import * as TradeStatisticsApi from '#/api/mall/statistics/trade';
|
||||
import ShortcutDateRangePicker from '#/components/shortcut-date-range-picker/shortcut-date-range-picker.vue';
|
||||
@@ -123,7 +123,11 @@ async function handleExport() {
|
||||
<!-- 查询条件 -->
|
||||
<div class="flex items-center gap-2">
|
||||
<ShortcutDateRangePicker @change="handleDateRangeChange">
|
||||
<ElButton class="ml-4" @click="handleExport" :loading="exportLoading">
|
||||
<ElButton
|
||||
class="ml-4"
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
>
|
||||
<template #icon>
|
||||
<IconifyIcon icon="lucide:download" />
|
||||
</template>
|
||||
@@ -279,4 +283,3 @@ async function handleExport() {
|
||||
</div>
|
||||
</ElCard>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user