From 1d4db90b1e1e0f368b221ae923326e4877025d08 Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Fri, 10 Nov 2023 15:57:49 +0800 Subject: [PATCH] =?UTF-8?q?--=E6=96=B0=E5=A2=9E=E5=B2=97=E4=BD=8D=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/locales/en-US.ts | 15 ++- src/i18n/locales/zh-CN.ts | 13 +++ src/views/system/post/index.vue | 179 ++++++++++++++++++++------------ 3 files changed, 140 insertions(+), 67 deletions(-) diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 4f34d92a..e8dd728b 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -699,7 +699,7 @@ export default { dataPer:'Data permission', }, dept:{ - classInfo:'Department information', + classInfo:' Department information', className:'Department name', classId:'Department Number', classSort:'Department sorting', @@ -717,6 +717,19 @@ export default { admin:'Principal', phone:'Contact number', email:'Mail', + }, + post:{ + positionInfo:'Position information', + positionId:'Position number', + positionCode:'Position code', + positionName:'Position name', + positionSort:'Position sorting', + positionStatus:'Position status', + positionMark:'Position description', + createTime:'Creation time', + codeTip:'Please enter the position code correctly', + nameTip:'Please enter the position name correctly', + delSure:'Confirm to delete the data item with post number [{postId}]?', } }, }, diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 5ca60a7a..1fc64d70 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -718,6 +718,19 @@ export default { phone:'联系电话', email:'邮箱', }, + post:{ + positionInfo:'岗位信息', + positionId:'岗位编号', + positionCode:'岗位编码', + positionName:'岗位名称', + positionSort:'岗位排序', + positionStatus:'岗位状态', + positionMark:'岗位说明', + createTime:'创建时间', + codeTip:'请正确输入岗位编码', + nameTip:'请正确输入岗位名称', + delSure:'确认删除岗位编号为 【{postId}】 的数据项?', + } }, }, }; diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue index daf3f99f..a414a5d1 100644 --- a/src/views/system/post/index.vue +++ b/src/views/system/post/index.vue @@ -86,33 +86,33 @@ let tableState: TabeStateType = reactive({ /**表格字段列 */ let tableColumns: ColumnsType = [ { - title: '岗位编号', + title: t('views.system.post.positionId'), dataIndex: 'postId', align: 'center', }, { - title: '岗位编码', + title: t('views.system.post.positionCode'), dataIndex: 'postCode', align: 'center', }, { - title: '岗位名称', + title: t('views.system.post.positionName'), dataIndex: 'postName', align: 'center', }, { - title: '岗位排序', + title: t('views.system.post.positionSort'), dataIndex: 'postSort', align: 'center', }, { - title: '岗位状态', + title: t('views.system.post.positionStatus'), dataIndex: 'status', key: 'status', align: 'center', }, { - title: '创建时间', + title: t('views.system.post.createTime'), dataIndex: 'createTime', align: 'center', customRender(opt) { @@ -121,7 +121,7 @@ let tableColumns: ColumnsType = [ }, }, { - title: '操作', + title: t('common.operate'), key: 'postId', align: 'center', }, @@ -145,7 +145,7 @@ let tablePagination = reactive({ showSizeChanger: true, /**数据总数 */ total: 0, - showTotal: (total: number) => `总共 ${total} 条`, + showTotal: (total: number) => t('common.tablePaginationTotal', { total }), onChange: (page: number, pageSize: number) => { tablePagination.current = page; tablePagination.pageSize = pageSize; @@ -206,10 +206,20 @@ const modalStateFrom = Form.useForm( modalState.from, reactive({ postName: [ - { required: true, min: 1, max: 50, message: '请正确输入岗位编码' }, + { + required: true, + min: 1, + max: 50, + message: t('views.system.post.codeTip'), + }, ], postCode: [ - { required: true, min: 1, max: 50, message: '请正确输入岗位名称' }, + { + required: true, + min: 1, + max: 50, + message: t('views.system.post.nameTip'), + }, ], }) ); @@ -220,7 +230,7 @@ const modalStateFrom = Form.useForm( */ function fnModalVisibleByVive(postId: string | number) { if (!postId) { - message.error(`岗位记录存在错误`, 2); + message.error(t('common.getInfoFail'), 2); return; } if (modalState.confirmLoading) return; @@ -231,10 +241,10 @@ function fnModalVisibleByVive(postId: string | number) { hide(); if (res.code === RESULT_CODE_SUCCESS && res.data) { modalState.from = Object.assign(modalState.from, res.data); - modalState.title = '岗位信息'; + modalState.title = t('views.system.post.positionInfo'); modalState.visibleByView = true; } else { - message.error(`获取岗位信息失败`, 2); + message.error(t('common.getInfoFail'), 2); } }); } @@ -246,7 +256,8 @@ function fnModalVisibleByVive(postId: string | number) { function fnModalVisibleByEdit(postId?: string | number) { if (!postId) { modalStateFrom.resetFields(); - modalState.title = '添加岗位信息'; + modalState.title = + t('common.addText') + t('views.system.post.positionInfo'); modalState.visibleByEdit = true; } else { if (modalState.confirmLoading) return; @@ -257,10 +268,11 @@ function fnModalVisibleByEdit(postId?: string | number) { hide(); if (res.code === RESULT_CODE_SUCCESS && res.data) { modalState.from = Object.assign(modalState.from, res.data); - modalState.title = '修改岗位信息'; + modalState.title = + t('common.editText') + t('views.system.post.positionInfo'); modalState.visibleByEdit = true; } else { - message.error(`获取岗位信息失败`, 2); + message.error(t('common.getInfoFail'), 2); } }); } @@ -283,7 +295,7 @@ function fnModalOk() { .then(res => { if (res.code === RESULT_CODE_SUCCESS) { message.success({ - content: `${modalState.title}成功`, + content: t('common.msgSuccess', { msg: modalState.title }), key, duration: 2, }); @@ -303,7 +315,7 @@ function fnModalOk() { }); }) .catch(e => { - message.error(`请正确填写 ${e.errorFields.length} 处必填信息!`, 2); + message.error(t('common.errorFields', { num: e.errorFields.length }), 2); }); } @@ -327,14 +339,14 @@ function fnRecordDelete(postId: string = '0') { } Modal.confirm({ title: t('common.tipTitle'), - content: `确认删除岗位编号为 【${postId}】 的数据项?`, + content: t('views.system.post.delSure', { postId: postId }), onOk() { const key = 'delPost'; message.loading({ content: t('common.loading'), key }); delPost(postId).then(res => { if (res.code === RESULT_CODE_SUCCESS) { message.success({ - content: `删除成功`, + content: t('common.msgSuccess', { msg: t('common.deleteText ') }), key, duration: 2, }); @@ -355,14 +367,16 @@ function fnRecordDelete(postId: string = '0') { function fnExportList() { Modal.confirm({ title: t('common.tipTitle'), - content: `确认根据搜索条件导出xlsx表格文件吗?`, + content: t('views.system.user.exportSure'), onOk() { const key = 'exportPost'; message.loading({ content: t('common.loading'), key }); exportPost(toRaw(queryParams)).then(res => { if (res.code === RESULT_CODE_SUCCESS) { message.success({ - content: `已完成导出`, + content: t('common.msgSuccess', { + msg: t('views.system.user.export'), + }), key, duration: 2, }); @@ -383,7 +397,7 @@ function fnExportList() { function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; - if(pageNum){ + if (pageNum) { queryParams.pageNum = pageNum; } listPost(toRaw(queryParams)).then(res => { @@ -422,29 +436,35 @@ onMounted(() => { - + - + - + @@ -455,11 +475,11 @@ onMounted(() => { - 搜索 - 重置 @@ -478,7 +498,7 @@ onMounted(() => { v-perms:has="['system:post:add']" > - 新建 + {{ t('common.addText') }} { v-perms:has="['system:post:remove']" > - 删除 + {{ t('common.deleteText') }} { v-perms:has="['system:post:export']" > - 导出 + {{ t('common.export') }} @@ -505,31 +525,31 @@ onMounted(() => { @@ -573,7 +599,7 @@ onMounted(() => {