From 898866c264cb9d517c807b20193998283cebe2c7 Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Thu, 18 Dec 2025 17:07:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:[=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86]=20[?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86]=20=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E7=BA=A7=E5=8F=8C=E8=AF=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lang/en.js | 10 ++- src/lang/zh.js | 18 ++++-- src/plugins/modal.js | 29 ++++----- src/views/system/menu/index.vue | 7 +-- src/views/system/role/index.vue | 134 +++++++++++++++++++++++++++------------- 5 files changed, 128 insertions(+), 70 deletions(-) diff --git a/src/lang/en.js b/src/lang/en.js index 34062ef..96edb0e 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -9,11 +9,13 @@ export default { reset: 'reset', add: 'add', export: 'export', + saveConfirm: 'confirm', confirm: 'confirm', cancel: 'cancel', operate: 'operate', placeholderInput: 'Please Enter', - placeholderSelect: 'Please Select' + placeholderSelect: 'Please Select', + confirmDelete: 'confirm delete?' }, menu: { PersonalCenter: 'Personal Center', @@ -123,7 +125,11 @@ export default { edit: 'edit', allocate: 'allocate', - detail: 'detail' + detail: 'detail', + + addRole: 'addRole', + modifyRole: 'modifyRole', + notEmpty: ' can not be empty' } } } diff --git a/src/lang/zh.js b/src/lang/zh.js index 15f83c8..6436929 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -2,18 +2,20 @@ export default { system: { title: '华西海圻管理系统', tip: '提示', - logOut: '确定注销并退出系统吗?' + logOut: '确认注销并退出系统吗?' }, form: { search: '查询', reset: '重置', add: '新增', export: '导出', - confirm: '确定', + saveConfirm: '确定', + confirm: '确认', cancel: '取消', operate: '操作', placeholderInput: '请输入', - placeholderSelect: '请选择' + placeholderSelect: '请选择', + confirmDelete: '确认删除?' }, menu: { PersonalCenter: '个人中心', @@ -104,8 +106,8 @@ export default { icon: '菜单图标', permit: '权限字符', - addMenu: '添加菜单', - modifyMenu: '修改菜单', + addMenu: '新增菜单', + modifyMenu: '编辑菜单', root: '主类目', @@ -123,7 +125,11 @@ export default { edit: '编辑', allocate: '分配用户', - detail: '详情' + detail: '详情', + + addRole: '新增角色', + modifyRole: '编辑角色', + notEmpty: '不能为空' } } } diff --git a/src/plugins/modal.js b/src/plugins/modal.js index 92bc1ef..700e65c 100644 --- a/src/plugins/modal.js +++ b/src/plugins/modal.js @@ -1,4 +1,5 @@ import { Message, MessageBox, Notification, Loading } from 'element-ui' +import i18n from '@/lang' let loadingInstance @@ -21,19 +22,19 @@ export default { }, // 弹出提示 alert(content) { - MessageBox.alert(content, "系统提示") + MessageBox.alert(content, i18n.t('system.tip')) }, // 错误提示 alertError(content) { - MessageBox.alert(content, "系统提示", { type: 'error' }) + MessageBox.alert(content, i18n.t('system.tip'), { type: 'error' }) }, // 成功提示 alertSuccess(content) { - MessageBox.alert(content, "系统提示", { type: 'success' }) + MessageBox.alert(content, i18n.t('system.tip'), { type: 'success' }) }, // 警告提示 alertWarning(content) { - MessageBox.alert(content, "系统提示", { type: 'warning' }) + MessageBox.alert(content, i18n.t('system.tip'), { type: 'warning' }) }, // 通知提示 notify(content) { @@ -53,18 +54,18 @@ export default { }, // 确认窗体 confirm(content) { - return MessageBox.confirm(content, "系统提示", { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: "warning", + return MessageBox.confirm(content, i18n.t('system.tip'), { + confirmButtonText: i18n.t('form.confirm'), + cancelButtonText: i18n.t('form.cancel'), + type: 'warning' }) }, // 提交内容 prompt(content) { - return MessageBox.prompt(content, "系统提示", { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: "warning", + return MessageBox.prompt(content, i18n.t('system.tip'), { + confirmButtonText: i18n.t('form.confirm'), + cancelButtonText: i18n.t('form.cancel'), + type: 'warning' }) }, // 打开遮罩层 @@ -72,8 +73,8 @@ export default { loadingInstance = Loading.service({ lock: true, text: content, - spinner: "el-icon-loading", - background: "rgba(0, 0, 0, 0.7)", + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' }) }, // 关闭遮罩层 diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index efd6d41..2b2efda 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -302,8 +302,8 @@
@@ -485,11 +485,10 @@ export default { }, /** 删除按钮操作 */ handleDelete(row) { - this.$modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?').then(function() { + this.$modal.confirm(this.$t('form.confirmDelete')).then(function() { return delMenu(row.menuId) }).then(() => { this.getList() - this.$modal.msgSuccess("删除成功") }).catch(() => {}) } } diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 7fca818..8cd2544 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -26,12 +26,8 @@ clearable style="width: 240px" > -