From 1c00248143f0898f9d03ca5fe120d61714ccabb4 Mon Sep 17 00:00:00 2001 From: PZ688 Date: Fri, 28 Feb 2025 18:29:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E8=81=8C=E4=BD=8D=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/system/pos/component/editPos.vue | 26 ++++----- Web/src/views/system/pos/index.vue | 57 ++++++++++--------- 2 files changed, 43 insertions(+), 40 deletions(-) diff --git a/Web/src/views/system/pos/component/editPos.vue b/Web/src/views/system/pos/component/editPos.vue index 87ff1a32..d0e9d35a 100644 --- a/Web/src/views/system/pos/component/editPos.vue +++ b/Web/src/views/system/pos/component/editPos.vue @@ -10,39 +10,39 @@ - - + + - - + + - - + + - + - 启用 - 禁用 + {{ $t('message.list.enable') }} + {{ $t('message.list.disable') }} - - + + diff --git a/Web/src/views/system/pos/index.vue b/Web/src/views/system/pos/index.vue index e981ce22..7172e100 100644 --- a/Web/src/views/system/pos/index.vue +++ b/Web/src/views/system/pos/index.vue @@ -5,12 +5,12 @@ - + - + @@ -21,8 +21,8 @@ - 查询 - 重置 + {{ $t('message.list.query') }} + {{ $t('message.list.reset') }} @@ -31,15 +31,15 @@ @@ -86,6 +86,9 @@ import ModifyRecord from '/@/components/table/modifyRecord.vue'; import { getAPI } from '/@/utils/axios-utils'; import { SysPosApi } from '/@/api-services/api'; import { PagePosOutput, PagePosInput, UpdatePosInput } from '/@/api-services/models'; +import { useI18n } from 'vue-i18n'; + +const i18n = useI18n(); const xGrid = ref(); const editPosRef = ref>(); @@ -108,18 +111,18 @@ const localPageParamKey = 'localPageParam:sysPos'; const options = useVxeTable( { id: 'sysPos', - name: '职位', + name: i18n.t('message.list.jobTitle'), columns: [ // { type: 'checkbox', width: 40, fixed: 'left' }, - { field: 'seq', type: 'seq', title: '序号', width: 60, fixed: 'left' }, - { field: 'name', title: '职位名称', minWidth: 200, showOverflow: 'tooltip' }, - { field: 'code', title: '职位编码', minWidth: 200, showOverflow: 'tooltip' }, - { field: 'userCount', title: '在职人数', width: 100, showOverflow: 'tooltip', slots: { default: 'row_userCount' } }, - { field: 'userList', title: '人员明细', width: 100, showOverflow: 'tooltip', slots: { default: 'row_userList' } }, - { field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' }, - { field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } }, - { field: 'record', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } }, - { field: 'buttons', title: '操作', fixed: 'right', width: 210, showOverflow: true, slots: { default: 'row_buttons' } }, + { field: 'seq', type: 'seq', title: i18n.t('message.list.seq'), width: 60, fixed: 'left' }, + { field: 'name', title: i18n.t('message.list.jobTitle'), minWidth: 200, showOverflow: 'tooltip' }, + { field: 'code', title: i18n.t('message.list.positionCode'), minWidth: 200, showOverflow: 'tooltip' }, + { field: 'userCount', title: i18n.t('message.list.staffCount'), width: 100, showOverflow: 'tooltip', slots: { default: 'row_userCount' } }, + { field: 'userList', title: i18n.t('message.list.staffDetails'), width: 100, showOverflow: 'tooltip', slots: { default: 'row_userList' } }, + { field: 'orderNo', title: i18n.t('message.list.orderNo'), width: 80, showOverflow: 'tooltip' }, + { field: 'status', title: i18n.t('message.list.status'), width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } }, + { field: 'record', title: i18n.t('message.list.record'), width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } }, + { field: 'buttons', title: i18n.t('message.list.operation'), fixed: 'right', width: 210, showOverflow: true, slots: { default: 'row_buttons' } }, ], }, // vxeGrid配置参数(此处可覆写任何参数),参考vxe-table官方文档 @@ -162,19 +165,19 @@ const resetQuery = async () => { // 打开新增页面 const handleAdd = () => { - state.title = '添加职位'; + state.title = i18n.t('message.list.addPosition'); editPosRef.value?.openDialog({ status: 1, orderNo: 100 }); }; // 打开编辑页面 const handleEdit = (row: any) => { - state.title = '编辑职位'; + state.title = i18n.t('message.list.editPosition'); editPosRef.value?.openDialog(row); }; // 打开复制页面 const openCopyMenu = (row: any) => { - state.title = '复制职位'; + state.title = i18n.t('message.list.copyPosition'); var copyRow = JSON.parse(JSON.stringify(row)) as UpdatePosInput; copyRow.id = 0; copyRow.name = ''; @@ -183,15 +186,15 @@ const openCopyMenu = (row: any) => { // 删除 const handleDelete = (row: any) => { - ElMessageBox.confirm(`确定删除职位:【${row.name}】?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', + ElMessageBox.confirm(i18n.t('message.list.confirmDeletePosition', { name: row.name }), i18n.t('message.list.hint'), { + confirmButtonText: i18n.t('message.list.confirmButtonText'), + cancelButtonText: i18n.t('message.list.cancelButtonText'), type: 'warning', }) .then(async () => { await getAPI(SysPosApi).apiSysPosDeletePost({ id: row.id }); handleQuery(); - ElMessage.success('删除成功'); + ElMessage.success(i18n.t('message.list.successDelete')); }) .catch(() => {}); };