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