From 60d43c077c22f0660ed82c62d5908b88762f51de Mon Sep 17 00:00:00 2001 From: xingyuv <xingyu4j@vip.qq.com> Date: Wed, 22 Mar 2023 11:33:11 +0800 Subject: [PATCH] feat: i18n --- README.md | 5 +-- src/locales/lang/en/action.ts | 5 ++- src/locales/lang/en/common.ts | 3 ++ src/locales/lang/zh-CN/action.ts | 5 ++- src/locales/lang/zh-CN/common.ts | 3 ++ src/views/system/dept/index.vue | 46 ++++++++++------------- src/views/system/dict/DictData.vue | 36 ++++++++---------- src/views/system/dict/index.vue | 33 +++++++--------- src/views/system/errorCode/index.vue | 26 ++++++------- src/views/system/loginlog/index.vue | 10 ++--- src/views/system/mail/account/index.vue | 20 +++++----- src/views/system/mail/template/index.vue | 20 +++++----- src/views/system/menu/index.vue | 26 +++++++------ src/views/system/notice/index.vue | 20 +++++----- src/views/system/oauth2/client/index.vue | 20 +++++----- src/views/system/oauth2/token/index.vue | 6 ++- src/views/system/operatelog/index.vue | 6 +-- src/views/system/post/index.vue | 27 ++++++------- src/views/system/role/index.vue | 26 ++++++------- src/views/system/sensitiveWord/index.vue | 18 ++++----- src/views/system/sms/SmsTemplateModel.vue | 2 +- src/views/system/sms/smsLog.vue | 6 +-- src/views/system/sms/smsTemplate.vue | 20 +++++----- src/views/system/tenant/index.vue | 18 ++++----- src/views/system/tenantPackage/index.vue | 20 +++++----- src/views/system/user/index.vue | 24 ++++++------ 26 files changed, 230 insertions(+), 221 deletions(-) diff --git a/README.md b/README.md index 21dddef5..ac911943 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,8 @@ ## 开发进度 - axios token刷新 未完成 -- router 增加基础首页 未完成 -- 系统管理 页面适配 进行中 -- 基础设施 页面适配 进行中 +- 系统管理 页面适配 80% +- 基础设施 页面适配 30% - 支付管理 页面适配 未完成 - 工作流 页面适配 未完成 diff --git a/src/locales/lang/en/action.ts b/src/locales/lang/en/action.ts index 4307a74a..faa11d57 100644 --- a/src/locales/lang/en/action.ts +++ b/src/locales/lang/en/action.ts @@ -1,6 +1,9 @@ export default { create: 'Create', edit: 'Edit', + test: 'Test', delete: 'Delete', - detail: 'Detail' + detail: 'Detail', + export: 'Export', + import: 'Import' } diff --git a/src/locales/lang/en/common.ts b/src/locales/lang/en/common.ts index 12c04a29..fa00a512 100644 --- a/src/locales/lang/en/common.ts +++ b/src/locales/lang/en/common.ts @@ -7,7 +7,10 @@ export default { loadingText: 'Loading...', saveText: 'Save', delText: 'Delete', + delMessage: 'Do you want to delete data?', delSuccessText: 'Delete success', + exportTitle: 'Export', + exportMessage: 'Do you want to export data?', exportSuccessText: 'Export success', resetText: 'Reset', searchText: 'Search', diff --git a/src/locales/lang/zh-CN/action.ts b/src/locales/lang/zh-CN/action.ts index a895f4c1..62d5a21e 100644 --- a/src/locales/lang/zh-CN/action.ts +++ b/src/locales/lang/zh-CN/action.ts @@ -1,6 +1,9 @@ export default { create: '新增', edit: '修改', + test: '测试', delete: '删除', - detail: '详情' + detail: '详情', + export: '导出', + import: '导入' } diff --git a/src/locales/lang/zh-CN/common.ts b/src/locales/lang/zh-CN/common.ts index f85de400..01daabd9 100644 --- a/src/locales/lang/zh-CN/common.ts +++ b/src/locales/lang/zh-CN/common.ts @@ -7,7 +7,10 @@ export default { loadingText: '加载中...', saveText: '保存', delText: '删除', + delMessage: '是否要删除数据?', delSuccessText: '删除成功', + exportTitle: '导出', + exportMessage: '是否要导出数据?', exportSuccessText: '导出成功', resetText: '重置', searchText: '搜索', diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 68d4dbcd..8f77990d 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -2,9 +2,9 @@ <div> <BasicTable @register="register" @fetch-success="onFetchSuccess"> <template #toolbar> - <a-button type="primary" @click="handleCreate"> 新增 </a-button> - <a-button type="info" @click="expandAll">展开全部</a-button> - <a-button type="info" @click="collapseAll">折叠全部</a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> + <a-button type="info" @click="expandAll">{{ t('component.tree.expandAll') }}</a-button> + <a-button type="info" @click="collapseAll">{{ t('component.tree.unExpandAll') }}</a-button> </template> <template #leader="{ text }"> <span> {{ userNicknameFormat(text) }} </span> @@ -15,13 +15,15 @@ :actions="[ { icon: 'clarity:note-edit-line', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -35,18 +37,19 @@ </div> </template> <script lang="ts" setup name="Dept"> -import { BasicTable, useTable, TableAction } from '@/components/Table' -import { deleteDeptApi, getDeptPageApi } from '@/api/system/dept' -import { columns, searchFormSchema } from './dept.data' +import { nextTick, ref, onMounted } from 'vue' +import { handleTree } from '@/utils/tree' +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { useModal } from '@/components/Modal' import DeptModel from './DeptModel.vue' -import { useMessage } from '@/hooks/web/useMessage' -import { handleTree } from '@/utils/tree' -import { nextTick, ref } from 'vue' +import { BasicTable, useTable, TableAction } from '@/components/Table' import { getListSimpleUsersApi } from '@/api/system/user' -import { onMounted } from 'vue' +import { deleteDeptApi, getDeptPageApi } from '@/api/system/dept' +import { columns, searchFormSchema } from './dept.data' -const { createConfirm, createMessage } = useMessage() +const { t } = useI18n() +const { createMessage } = useMessage() const [registerModal, { openModal }] = useModal() const [register, { expandAll, collapseAll, getForm, reload }] = useTable({ @@ -67,8 +70,8 @@ const [register, { expandAll, collapseAll, getForm, reload }] = useTable({ showIndexColumn: false, canResize: false, actionColumn: { - width: 120, - title: '操作', + width: 160, + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -87,7 +90,6 @@ async function getUserList() { } function userNicknameFormat(row) { - console.info(row) if (!row.leaderUserId) { return '未设置' } @@ -113,20 +115,12 @@ function handleEdit(record: Recordable) { } async function handleDelete(record: Recordable) { - createConfirm({ - title: '删除', - iconType: 'warning', - content: '是否要删除数据?', - async onOk() { - await deleteDeptApi(record.id) - createMessage.success('删除成功') - reload() - } - }) + await deleteDeptApi(record.id) + createMessage.success(t('common.delSuccessText')) + reload() } function onFetchSuccess() { - // 演示默认展开所有表项 nextTick(expandAll) } diff --git a/src/views/system/dict/DictData.vue b/src/views/system/dict/DictData.vue index 64a64b4c..4d82d6d8 100644 --- a/src/views/system/dict/DictData.vue +++ b/src/views/system/dict/DictData.vue @@ -2,7 +2,7 @@ <div> <BasicTable @register="registerTable" :searchInfo="searchInfo"> <template #toolbar> - <a-button type="primary" @click="handleCreate">新增字典数据</a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }}</a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -10,15 +10,15 @@ :actions="[ { icon: 'clarity:note-edit-line', - tooltip: '编辑字典数据', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - tooltip: '删除字典数据', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -33,12 +33,13 @@ </template> <script lang="ts" setup name="DictData"> import { watch } from 'vue' -import { BasicTable, useTable, TableAction } from '@/components/Table' +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { useModal } from '@/components/Modal' import DictDataModel from './DictDataModel.vue' +import { BasicTable, useTable, TableAction } from '@/components/Table' import { dataColumns, dataSearchFormSchema } from './dict.data' import { deleteDictDataApi, getDictDataPageApi } from '@/api/system/dict/data' -import { useMessage } from '@/hooks/web/useMessage' const props = defineProps({ searchInfo: { @@ -47,9 +48,9 @@ const props = defineProps({ } }) -const { createConfirm, createMessage } = useMessage() +const { t } = useI18n() +const { createMessage } = useMessage() const [registerModal, { openModal }] = useModal() -// const searchInfo = reactive<Recordable>({}) const [registerTable, { reload }] = useTable({ title: '字典数据列表', @@ -64,8 +65,8 @@ const [registerTable, { reload }] = useTable({ showTableSetting: true, showIndexColumn: false, actionColumn: { - width: 120, - title: '操作', + width: 160, + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -85,17 +86,10 @@ function handleEdit(record: Recordable) { }) } -function handleDelete(record: Recordable) { - createConfirm({ - title: '删除', - iconType: 'warning', - content: '是否要删除数据?', - async onOk() { - await deleteDictDataApi(record.id) - createMessage.success('删除成功') - reload() - } - }) +async function handleDelete(record: Recordable) { + await deleteDictDataApi(record.id) + createMessage.success(t('common.delSuccessText')) + reload() } watch( diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 94ee634c..af49eaa6 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -2,7 +2,7 @@ <div class="flex"> <BasicTable @register="registerTable" class="w-1/2 xl:w-1/2" @row-click="handleRowClick"> <template #toolbar> - <a-button type="primary" @click="handleCreate">新增字典类型</a-button> + <a-button type="primary" @click="handleCreate">{{ t('action.create') }}</a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -10,15 +10,15 @@ :actions="[ { icon: 'clarity:note-edit-line', - tooltip: '编辑字典分类', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - tooltip: '删除字典分类', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -34,15 +34,17 @@ </template> <script lang="ts" setup name="Dict"> import { reactive } from 'vue' -import { BasicTable, useTable, TableAction } from '@/components/Table' +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { useModal } from '@/components/Modal' import DictData from './DictData.vue' import DictTypeModel from './DictTypeModel.vue' +import { BasicTable, useTable, TableAction } from '@/components/Table' import { typeColumns, typeSearchFormSchema } from './dict.type' import { deleteDictTypeApi, getDictTypePageApi } from '@/api/system/dict/type' -import { useMessage } from '@/hooks/web/useMessage' -const { createConfirm, createMessage } = useMessage() +const { t } = useI18n() +const { createMessage } = useMessage() const [registerModal, { openModal }] = useModal() const searchInfo = reactive<Recordable>({}) @@ -58,8 +60,8 @@ const [registerTable, { reload }] = useTable({ showTableSetting: true, showIndexColumn: false, actionColumn: { - width: 120, - title: '操作', + width: 160, + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -84,15 +86,8 @@ function handleEdit(record: Recordable) { } async function handleDelete(record: Recordable) { - createConfirm({ - title: '删除', - iconType: 'warning', - content: '是否要删除数据?', - async onOk() { - await deleteDictTypeApi(record.id) - createMessage.success('删除成功') - reload() - } - }) + await deleteDictTypeApi(record.id) + createMessage.success(t('common.delSuccessText')) + reload() } </script> diff --git a/src/views/system/errorCode/index.vue b/src/views/system/errorCode/index.vue index 45acd72a..1cb13146 100644 --- a/src/views/system/errorCode/index.vue +++ b/src/views/system/errorCode/index.vue @@ -2,8 +2,8 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="primary" @click="handleCreate"> 新增 </a-button> - <a-button type="warning" @click="handleExport"> 导出 </a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> + <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -11,15 +11,15 @@ :actions="[ { icon: 'clarity:note-edit-line', - label: '修改', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - label: '删除', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -33,13 +33,13 @@ </div> </template> <script lang="ts" setup name="ErrorCode"> -import { BasicTable, useTable, TableAction } from '@/components/Table' -import { ErrorCodePageReqVO, deleteErrorCodeApi, excelErrorCodeApi, getErrorCodePageApi } from '@/api/system/errorCode' +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { useModal } from '@/components/Modal' import ErrorCodeModel from './ErrorCodeModel.vue' +import { BasicTable, useTable, TableAction } from '@/components/Table' +import { ErrorCodePageReqVO, deleteErrorCodeApi, excelErrorCodeApi, getErrorCodePageApi } from '@/api/system/errorCode' import { columns, searchFormSchema } from './errorCode.data' -import { useI18n } from '@/hooks/web/useI18n' -import { useMessage } from '@/hooks/web/useMessage' const { t } = useI18n() const { createConfirm, createMessage } = useMessage() @@ -57,7 +57,7 @@ const [registerTable, { getForm, reload }] = useTable({ showIndexColumn: false, actionColumn: { width: 160, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -78,9 +78,9 @@ function handleEdit(record: Recordable) { async function handleExport() { createConfirm({ - title: '导出', + title: t('common.exportTitle'), iconType: 'warning', - content: '是否要导出数据?', + content: t('common.exportMessage'), async onOk() { await excelErrorCodeApi(getForm().getFieldsValue() as ErrorCodePageReqVO) createMessage.success(t('common.exportSuccessText')) @@ -90,7 +90,7 @@ async function handleExport() { async function handleDelete(record: Recordable) { await deleteErrorCodeApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() } </script> diff --git a/src/views/system/loginlog/index.vue b/src/views/system/loginlog/index.vue index 06946a16..f2d1297e 100644 --- a/src/views/system/loginlog/index.vue +++ b/src/views/system/loginlog/index.vue @@ -2,17 +2,17 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="warning" @click="handleExport"> 导出 </a-button> + <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button> </template> </BasicTable> </div> </template> <script lang="ts" setup name="LoginLog"> +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { BasicTable, useTable } from '@/components/Table' import { LoginLogReqVO, exportLoginLogApi, getLoginLogPageApi } from '@/api/system/loginLog' import { columns, searchFormSchema } from './loginLog.data' -import { useI18n } from '@/hooks/web/useI18n' -import { useMessage } from '@/hooks/web/useMessage' const { t } = useI18n() const { createConfirm, createMessage } = useMessage() @@ -31,9 +31,9 @@ const [registerTable, { getForm }] = useTable({ async function handleExport() { createConfirm({ - title: '导出', + title: t('common.exportTitle'), iconType: 'warning', - content: '是否要导出数据?', + content: t('common.exportMessage'), async onOk() { await exportLoginLogApi(getForm().getFieldsValue() as LoginLogReqVO) createMessage.success(t('common.exportSuccessText')) diff --git a/src/views/system/mail/account/index.vue b/src/views/system/mail/account/index.vue index cd327d09..029750ee 100644 --- a/src/views/system/mail/account/index.vue +++ b/src/views/system/mail/account/index.vue @@ -2,7 +2,7 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="primary" @click="handleCreate"> 新增 </a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -10,15 +10,15 @@ :actions="[ { icon: 'clarity:note-edit-line', - label: '修改', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - label: '删除', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -32,13 +32,15 @@ </div> </template> <script lang="ts" setup name="MailAccount"> -import { BasicTable, useTable, TableAction } from '@/components/Table' -import { deleteMailAccountApi, getMailAccountPageApi } from '@/api/system/mail/account' +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { useModal } from '@/components/Modal' import AccountModel from './AccountModel.vue' +import { BasicTable, useTable, TableAction } from '@/components/Table' +import { deleteMailAccountApi, getMailAccountPageApi } from '@/api/system/mail/account' import { columns, searchFormSchema } from './account.data' -import { useMessage } from '@/hooks/web/useMessage' +const { t } = useI18n() const { createMessage } = useMessage() const [registerModal, { openModal }] = useModal() const [registerTable, { reload }] = useTable({ @@ -54,7 +56,7 @@ const [registerTable, { reload }] = useTable({ showIndexColumn: false, actionColumn: { width: 160, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -75,7 +77,7 @@ function handleEdit(record: Recordable) { async function handleDelete(record: Recordable) { await deleteMailAccountApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() } </script> diff --git a/src/views/system/mail/template/index.vue b/src/views/system/mail/template/index.vue index c8baa4b8..189592a5 100644 --- a/src/views/system/mail/template/index.vue +++ b/src/views/system/mail/template/index.vue @@ -2,7 +2,7 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="primary" @click="handleCreate"> 新增 </a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -10,15 +10,15 @@ :actions="[ { icon: 'clarity:note-edit-line', - label: '修改', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - label: '删除', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -32,13 +32,15 @@ </div> </template> <script lang="ts" setup name="MailTemplate"> -import { BasicTable, useTable, TableAction } from '@/components/Table' -import { deleteMailTemplateApi, getMailTemplatePageApi } from '@/api/system/mail/template' +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { useModal } from '@/components/Modal' import TemplateModel from './TemplateModel.vue' +import { BasicTable, useTable, TableAction } from '@/components/Table' +import { deleteMailTemplateApi, getMailTemplatePageApi } from '@/api/system/mail/template' import { columns, searchFormSchema } from './template.data' -import { useMessage } from '@/hooks/web/useMessage' +const { t } = useI18n() const { createMessage } = useMessage() const [registerModal, { openModal }] = useModal() const [registerTable, { reload }] = useTable({ @@ -54,7 +56,7 @@ const [registerTable, { reload }] = useTable({ showIndexColumn: false, actionColumn: { width: 160, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -75,7 +77,7 @@ function handleEdit(record: Recordable) { async function handleDelete(record: Recordable) { await deleteMailTemplateApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() } </script> diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index 9ea52a7c..9f25028c 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -2,9 +2,9 @@ <div> <BasicTable @register="register"> <template #toolbar> - <a-button type="primary" @click="handleCreate"> 新增 </a-button> - <a-button type="info" @click="expandAll">展开全部</a-button> - <a-button type="info" @click="collapseAll">折叠全部</a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> + <a-button type="info" @click="expandAll">{{ t('component.tree.expandAll') }}</a-button> + <a-button type="info" @click="collapseAll">{{ t('component.tree.unExpandAll') }}</a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -12,15 +12,15 @@ :actions="[ { icon: 'clarity:note-edit-line', - label: '修改', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - label: '删除', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -34,14 +34,16 @@ </div> </template> <script lang="ts" setup name="Menu"> +import { handleTree } from '@/utils/tree' +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' +import { useModal } from '@/components/Modal' +import DeptModel from './MenuModel.vue' import { BasicTable, useTable, TableAction } from '@/components/Table' import { deleteMenuApi, getMenuListApi } from '@/api/system/menu' import { columns, searchFormSchema } from './menu.data' -import { useModal } from '@/components/Modal' -import DeptModel from './MenuModel.vue' -import { useMessage } from '@/hooks/web/useMessage' -import { handleTree } from '@/utils/tree' +const { t } = useI18n() const { createMessage } = useMessage() const [registerModal, { openModal }] = useModal() @@ -64,7 +66,7 @@ const [register, { expandAll, collapseAll, getForm, reload }] = useTable({ canResize: false, actionColumn: { width: 160, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -89,7 +91,7 @@ function handleEdit(record: Recordable) { async function handleDelete(record: Recordable) { await deleteMenuApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() } </script> diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index a15e2ea1..bd2d1cbe 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -2,7 +2,7 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="primary" @click="handleCreate"> 新增 </a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -10,15 +10,15 @@ :actions="[ { icon: 'clarity:note-edit-line', - label: '修改', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - label: '删除', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -32,13 +32,15 @@ </div> </template> <script lang="ts" setup name="Notice"> -import { BasicTable, useTable, TableAction } from '@/components/Table' -import { deleteNoticeApi, getNoticePageApi } from '@/api/system/notice' +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { useModal } from '@/components/Modal' import NoticeModal from './NoticeModel.vue' +import { BasicTable, useTable, TableAction } from '@/components/Table' +import { deleteNoticeApi, getNoticePageApi } from '@/api/system/notice' import { columns, searchFormSchema } from './notice.data' -import { useMessage } from '@/hooks/web/useMessage' +const { t } = useI18n() const { createMessage } = useMessage() const [registerModal, { openModal }] = useModal() const [registerTable, { reload }] = useTable({ @@ -54,7 +56,7 @@ const [registerTable, { reload }] = useTable({ showIndexColumn: false, actionColumn: { width: 160, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -75,7 +77,7 @@ function handleEdit(record: Recordable) { async function handleDelete(record: Recordable) { await deleteNoticeApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() } </script> diff --git a/src/views/system/oauth2/client/index.vue b/src/views/system/oauth2/client/index.vue index b1659b75..0c027ee0 100644 --- a/src/views/system/oauth2/client/index.vue +++ b/src/views/system/oauth2/client/index.vue @@ -2,7 +2,7 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="primary" @click="handleCreate"> 新增 </a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -10,15 +10,15 @@ :actions="[ { icon: 'clarity:note-edit-line', - label: '修改', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - label: '删除', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -32,13 +32,15 @@ </div> </template> <script lang="ts" setup name="Client"> -import { BasicTable, useTable, TableAction } from '@/components/Table' -import { deleteOAuth2ClientApi, getOAuth2ClientPageApi } from '@/api/system/oauth2/client' +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { useModal } from '@/components/Modal' import ClientModel from './ClientModel.vue' +import { BasicTable, useTable, TableAction } from '@/components/Table' +import { deleteOAuth2ClientApi, getOAuth2ClientPageApi } from '@/api/system/oauth2/client' import { columns, searchFormSchema } from './client.data' -import { useMessage } from '@/hooks/web/useMessage' +const { t } = useI18n() const { createMessage } = useMessage() const [registerModal, { openModal }] = useModal() const [registerTable, { reload }] = useTable({ @@ -54,7 +56,7 @@ const [registerTable, { reload }] = useTable({ showIndexColumn: false, actionColumn: { width: 160, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -75,7 +77,7 @@ function handleEdit(record: Recordable) { async function handleDelete(record: Recordable) { await deleteOAuth2ClientApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() } </script> diff --git a/src/views/system/oauth2/token/index.vue b/src/views/system/oauth2/token/index.vue index 5d1813c3..05748544 100644 --- a/src/views/system/oauth2/token/index.vue +++ b/src/views/system/oauth2/token/index.vue @@ -23,11 +23,13 @@ </div> </template> <script lang="ts" setup name="Token"> +import { useI18n } from '@/hooks/web/useI18n' import { BasicTable, useTable, TableAction } from '@/components/Table' import { deleteAccessTokenApi, getAccessTokenPageApi } from '@/api/system/oauth2/token' import { columns, searchFormSchema } from './token.data' import { useMessage } from '@/hooks/web/useMessage' +const { t } = useI18n() const { createMessage } = useMessage() const [registerTable, { reload }] = useTable({ title: 'Token列表', @@ -42,7 +44,7 @@ const [registerTable, { reload }] = useTable({ showIndexColumn: false, actionColumn: { width: 100, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -50,7 +52,7 @@ const [registerTable, { reload }] = useTable({ async function handleDelete(record: Recordable) { await deleteAccessTokenApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() } </script> diff --git a/src/views/system/operatelog/index.vue b/src/views/system/operatelog/index.vue index 088955ab..a62ad46c 100644 --- a/src/views/system/operatelog/index.vue +++ b/src/views/system/operatelog/index.vue @@ -2,7 +2,7 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="warning" @click="handleExport"> 导出 </a-button> + <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button> </template> </BasicTable> </div> @@ -31,9 +31,9 @@ const [registerTable, { getForm }] = useTable({ async function handleExport() { createConfirm({ - title: '导出', + title: t('common.exportTitle'), iconType: 'warning', - content: '是否要导出数据?', + content: t('common.exportMessage'), async onOk() { await exportOperateLogApi(getForm().getFieldsValue() as OperateLogPageReqVO) createMessage.success(t('common.exportSuccessText')) diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue index 797cb5eb..32a46514 100644 --- a/src/views/system/post/index.vue +++ b/src/views/system/post/index.vue @@ -2,8 +2,8 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="primary" @click="handleCreate"> 新增 </a-button> - <a-button type="warning" @click="handleExport"> 导出 </a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> + <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -11,15 +11,15 @@ :actions="[ { icon: 'clarity:note-edit-line', - label: '修改', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - label: '删除', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -33,17 +33,18 @@ </div> </template> <script lang="ts" setup name="Post"> -import { BasicTable, useTable, TableAction } from '@/components/Table' -import { PostExportReqVO, deletePostApi, exportPostApi, getPostPageApi } from '@/api/system/post' +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { useModal } from '@/components/Modal' import PostModel from './PostModel.vue' +import { BasicTable, useTable, TableAction } from '@/components/Table' +import { PostExportReqVO, deletePostApi, exportPostApi, getPostPageApi } from '@/api/system/post' import { columns, searchFormSchema } from './post.data' -import { useI18n } from '@/hooks/web/useI18n' -import { useMessage } from '@/hooks/web/useMessage' const { t } = useI18n() const { createConfirm, createMessage } = useMessage() const [registerModal, { openModal }] = useModal() + const [registerTable, { getForm, reload }] = useTable({ title: '岗位列表', api: getPostPageApi, @@ -57,7 +58,7 @@ const [registerTable, { getForm, reload }] = useTable({ showIndexColumn: false, actionColumn: { width: 160, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -78,9 +79,9 @@ function handleEdit(record: Recordable) { async function handleExport() { createConfirm({ - title: '导出', + title: t('common.exportTitle'), iconType: 'warning', - content: '是否要导出数据?', + content: t('common.exportMessage'), async onOk() { await exportPostApi(getForm().getFieldsValue() as PostExportReqVO) createMessage.success(t('common.exportSuccessText')) @@ -90,7 +91,7 @@ async function handleExport() { async function handleDelete(record: Recordable) { await deletePostApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() } </script> diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index e553b3b5..572c93b8 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -2,8 +2,8 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="primary" @click="handleCreate"> 新增 </a-button> - <a-button type="warning" @click="handleExport"> 导出 </a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> + <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -11,7 +11,7 @@ :actions="[ { icon: 'clarity:note-edit-line', - label: '修改', + label: t('action.edit'), onClick: handleEdit.bind(null, record) } ]" @@ -28,10 +28,10 @@ }, { icon: 'ant-design:delete-outlined', - label: '删除', color: 'error', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -45,13 +45,13 @@ </div> </template> <script lang="ts" setup name="Role"> -import { BasicTable, useTable, TableAction } from '@/components/Table' -import { RoleExportReqVO, deleteRoleApi, exportRoleApi, getRolePageApi } from '@/api/system/role' +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { useModal } from '@/components/Modal' import RoleModel from './RoleModel.vue' +import { BasicTable, useTable, TableAction } from '@/components/Table' +import { RoleExportReqVO, deleteRoleApi, exportRoleApi, getRolePageApi } from '@/api/system/role' import { columns, searchFormSchema } from './role.data' -import { useI18n } from '@/hooks/web/useI18n' -import { useMessage } from '@/hooks/web/useMessage' const { t } = useI18n() const { createConfirm, createMessage } = useMessage() @@ -69,7 +69,7 @@ const [registerTable, { getForm, reload }] = useTable({ showIndexColumn: false, actionColumn: { width: 160, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -90,9 +90,9 @@ function handleEdit(record: Recordable) { async function handleExport() { createConfirm({ - title: '导出', + title: t('common.exportTitle'), iconType: 'warning', - content: '是否要导出数据?', + content: t('common.exportMessage'), async onOk() { await exportRoleApi(getForm().getFieldsValue() as RoleExportReqVO) createMessage.success(t('common.exportSuccessText')) @@ -102,7 +102,7 @@ async function handleExport() { async function handleDelete(record: Recordable) { await deleteRoleApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() } </script> diff --git a/src/views/system/sensitiveWord/index.vue b/src/views/system/sensitiveWord/index.vue index b6066321..a6703330 100644 --- a/src/views/system/sensitiveWord/index.vue +++ b/src/views/system/sensitiveWord/index.vue @@ -2,8 +2,8 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="primary" @click="handleCreate"> 新增 </a-button> - <a-button type="warning" @click="handleExport"> 导出 </a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> + <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -11,15 +11,15 @@ :actions="[ { icon: 'clarity:note-edit-line', - label: '修改', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - label: '删除', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -62,7 +62,7 @@ const [registerTable, { getForm, reload }] = useTable({ showIndexColumn: false, actionColumn: { width: 160, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -83,9 +83,9 @@ function handleEdit(record: Recordable) { async function handleExport() { createConfirm({ - title: '导出', + title: t('common.exportTitle'), iconType: 'warning', - content: '是否要导出数据?', + content: t('common.exportMessage'), async onOk() { await exportSensitiveWordApi(getForm().getFieldsValue() as SensitiveWordExportReqVO) createMessage.success(t('common.exportSuccessText')) @@ -95,7 +95,7 @@ async function handleExport() { async function handleDelete(record: Recordable) { await deleteSensitiveWordApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() } </script> diff --git a/src/views/system/sms/SmsTemplateModel.vue b/src/views/system/sms/SmsTemplateModel.vue index d4717d0a..0740c045 100644 --- a/src/views/system/sms/SmsTemplateModel.vue +++ b/src/views/system/sms/SmsTemplateModel.vue @@ -38,7 +38,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data } }) -const getTitle = computed(() => (!unref(isUpdate) ? '新增岗位' : '编辑岗位')) +const getTitle = computed(() => (!unref(isUpdate) ? '新增短信模版' : '编辑短信模版')) async function handleSubmit() { try { diff --git a/src/views/system/sms/smsLog.vue b/src/views/system/sms/smsLog.vue index e947079f..07d9650f 100644 --- a/src/views/system/sms/smsLog.vue +++ b/src/views/system/sms/smsLog.vue @@ -2,7 +2,7 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="warning" @click="handleExport"> 导出 </a-button> + <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button> </template> </BasicTable> </div> @@ -31,9 +31,9 @@ const [registerTable, { getForm }] = useTable({ async function handleExport() { createConfirm({ - title: '导出', + title: t('common.exportTitle'), iconType: 'warning', - content: '是否要导出数据?', + content: t('common.exportMessage'), async onOk() { await exportSmsLogApi(getForm().getFieldsValue() as SmsLogExportReqVO) createMessage.success(t('common.exportSuccessText')) diff --git a/src/views/system/sms/smsTemplate.vue b/src/views/system/sms/smsTemplate.vue index fdf1a729..7342187a 100644 --- a/src/views/system/sms/smsTemplate.vue +++ b/src/views/system/sms/smsTemplate.vue @@ -2,8 +2,8 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="primary" @click="handleCreate"> 新增 </a-button> - <a-button type="warning" @click="handleExport"> 导出 </a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> + <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -11,20 +11,20 @@ :actions="[ { icon: 'clarity:note-edit-line', - label: '测试', + label: t('action.test'), onClick: handleSendSms.bind(null, record) }, { icon: 'clarity:note-edit-line', - label: '修改', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - label: '删除', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -62,7 +62,7 @@ const [registerTable, { getForm, reload }] = useTable({ showIndexColumn: false, actionColumn: { width: 240, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -87,9 +87,9 @@ function handleEdit(record: Recordable) { async function handleExport() { createConfirm({ - title: '导出', + title: t('common.exportTitle'), iconType: 'warning', - content: '是否要导出数据?', + content: t('common.exportMessage'), async onOk() { await exportSmsTemplateApi(getForm().getFieldsValue() as SmsTemplateExportReqVO) createMessage.success(t('common.exportSuccessText')) @@ -99,7 +99,7 @@ async function handleExport() { async function handleDelete(record: Recordable) { await deleteSmsTemplateApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() } </script> diff --git a/src/views/system/tenant/index.vue b/src/views/system/tenant/index.vue index 913c63af..d71d1591 100644 --- a/src/views/system/tenant/index.vue +++ b/src/views/system/tenant/index.vue @@ -2,8 +2,8 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="primary" @click="handleCreate"> 新增 </a-button> - <a-button type="warning" @click="handleExport"> 导出 </a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> + <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -11,15 +11,15 @@ :actions="[ { icon: 'clarity:note-edit-line', - label: '修改', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - label: '删除', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -57,7 +57,7 @@ const [registerTable, { getForm, reload }] = useTable({ showIndexColumn: false, actionColumn: { width: 160, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -78,9 +78,9 @@ function handleEdit(record: Recordable) { async function handleExport() { createConfirm({ - title: '导出', + title: t('common.exportTitle'), iconType: 'warning', - content: '是否要导出数据?', + content: t('common.exportMessage'), async onOk() { await exportTenantApi(getForm().getFieldsValue() as TenantExportReqVO) createMessage.success(t('common.exportSuccessText')) @@ -90,7 +90,7 @@ async function handleExport() { async function handleDelete(record: Recordable) { await deleteTenantApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() } </script> diff --git a/src/views/system/tenantPackage/index.vue b/src/views/system/tenantPackage/index.vue index 0c38e02f..952b434c 100644 --- a/src/views/system/tenantPackage/index.vue +++ b/src/views/system/tenantPackage/index.vue @@ -2,7 +2,7 @@ <div> <BasicTable @register="registerTable"> <template #toolbar> - <a-button type="primary" @click="handleCreate"> 新增 </a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -10,15 +10,15 @@ :actions="[ { icon: 'clarity:note-edit-line', - label: '修改', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - label: '删除', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -32,13 +32,15 @@ </div> </template> <script lang="ts" setup name="TenantPackage"> -import { BasicTable, useTable, TableAction } from '@/components/Table' -import { deleteTenantPackageApi, getTenantPackagePageApi } from '@/api/system/tenantPackage' +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { useModal } from '@/components/Modal' import TenantPackageModel from './TenantPackageModel.vue' +import { BasicTable, useTable, TableAction } from '@/components/Table' +import { deleteTenantPackageApi, getTenantPackagePageApi } from '@/api/system/tenantPackage' import { columns, searchFormSchema } from './tenantPackage.data' -import { useMessage } from '@/hooks/web/useMessage' +const { t } = useI18n() const { createMessage } = useMessage() const [registerModal, { openModal }] = useModal() const [registerTable, { reload }] = useTable({ @@ -54,7 +56,7 @@ const [registerTable, { reload }] = useTable({ showIndexColumn: false, actionColumn: { width: 160, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -75,7 +77,7 @@ function handleEdit(record: Recordable) { async function handleDelete(record: Recordable) { await deleteTenantPackageApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() } </script> diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 56b01bf6..e44f2e62 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -3,8 +3,8 @@ <DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" /> <BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo"> <template #toolbar> - <a-button type="primary" @click="handleCreate">新增账号</a-button> - <a-button type="warning" @click="handleExport"> 导出 </a-button> + <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button> + <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button> </template> <template #bodyCell="{ column, record }"> <template v-if="column.key === 'action'"> @@ -12,15 +12,15 @@ :actions="[ { icon: 'clarity:note-edit-line', - label: '编辑', + label: t('action.edit'), onClick: handleEdit.bind(null, record) }, { icon: 'ant-design:delete-outlined', color: 'error', - label: '删除', + label: t('action.delete'), popConfirm: { - title: '是否确认删除', + title: t('common.delMessage'), placement: 'left', confirm: handleDelete.bind(null, record) } @@ -35,14 +35,14 @@ </template> <script lang="ts" setup name="User"> import { reactive } from 'vue' -import { BasicTable, useTable, TableAction } from '@/components/Table' +import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { useModal } from '@/components/Modal' import UserModel from './UserModel.vue' import DeptTree from './DeptTree.vue' +import { BasicTable, useTable, TableAction } from '@/components/Table' import { columns, searchFormSchema } from './user.data' import { UserExportReqVO, deleteUserApi, exportUserApi, getUserPageApi } from '@/api/system/user' -import { useI18n } from '@/hooks/web/useI18n' -import { useMessage } from '@/hooks/web/useMessage' const { t } = useI18n() const { createConfirm, createMessage } = useMessage() @@ -63,7 +63,7 @@ const [registerTable, { getForm, reload }] = useTable({ showIndexColumn: false, actionColumn: { width: 160, - title: '操作', + title: t('common.action'), dataIndex: 'action', fixed: 'right' } @@ -77,9 +77,9 @@ function handleCreate() { async function handleExport() { createConfirm({ - title: '导出', + title: t('common.exportTitle'), iconType: 'warning', - content: '是否要导出数据?', + content: t('common.exportMessage'), async onOk() { await exportUserApi(getForm().getFieldsValue() as UserExportReqVO) createMessage.success(t('common.exportSuccessText')) @@ -96,7 +96,7 @@ function handleEdit(record: Recordable) { async function handleDelete(record: Recordable) { await deleteUserApi(record.id) - createMessage.success('删除成功') + createMessage.success(t('common.delSuccessText')) reload() }