diff --git a/src/locales/en.ts b/src/locales/en.ts index a0fce48..3dc58b5 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -55,7 +55,11 @@ export default { copy: 'Copy', copySuccess: 'Copy Success', copyError: 'Copy Error', - perPage: 'Number page' + perPage: 'Per Page', + selectAll: 'Select All / Unselect All', + expandAll: 'Expand All / Collapse All', + treeParent: 'Parent-Child Linkage', + loadingText: 'Loading, please wait' }, lock: { lockScreen: 'Lock screen', @@ -165,7 +169,10 @@ export default { BigBrotherManage: 'BigBrotherManage', BigBrotherDataManage: 'BigBrotherDataManage', BigBrotherList: 'BigBrotherList', - staffBigBrotherManage: 'StaffBigBrotherManage' + staffBigBrotherManage: 'StaffBigBrotherManage', + systemAdministration: 'System Administration', + userManagement: 'User Management', + roleManagement: 'Role Management', }, analysis: { newUser: 'New user', @@ -635,5 +642,53 @@ export default { deletePage: 'Delete Page', placeNegotiation: 'Please select negotiation status', allocationAlert: 'The number of successful allocations may be less than selected. Hosts with the same ID cannot be allocated repeatedly.' + }, + system: { + user: { + username: 'Username', + nickname: 'Nickname', + mobile: 'Mobile', + dept: 'Department', + email: 'Email', + status: 'Status', + sex: 'Gender', + post: 'Post', + password: 'Password', + id: 'User ID', + remark: 'Remark', + deptDesc: 'Department', + assignRole: 'Assign Role', + role: 'Role', + importTip: 'Update existing user data', + importTitle: 'Import Users', + import: { + fileRequired: 'Please upload a file', + fileLimit: 'Only one file can be uploaded!', + uploadError: 'Upload failed, please upload again!', + templateName: 'User Import Template.xls', + createSuccess: 'Create Success Count: ', + updateSuccess: 'Update Success Count: ', + failure: 'Failure Count: ' + } + }, + role: { + name: 'Role Name', + code: 'Role Code', + type: 'Role Type', + sort: 'Sort', + status: 'Status', + remark: 'Remark', + id: 'Role ID', + menuPermission: 'Menu Permission', + dataPermission: 'Data Permission', + dataScope: 'Permission Scope', + deptScope: 'Department Scope' + } + }, + home: { + today: 'Today', + last7Days: 'Last 7 Days', + todayAnchorCount: "Today's Anchor Contact Count", + todayBigBrotherCount: "Today's Big Brother Contact Count" } } diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 0ce84de..c58ee55 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -59,7 +59,12 @@ export default { copy: '复制', copySuccess: '复制成功', copyError: '复制失败', - perPage: '每页' + + perPage: '每页', + selectAll: '全选/全不选', + expandAll: '全部展开/折叠', + treeParent: '父子联动', + loadingText: '加载中,请稍候' }, lock: { lockScreen: '锁定屏幕', @@ -171,7 +176,11 @@ export default { BigBrotherManage: '粉丝助手', BigBrotherDataManage: '大哥数据管理(管理)', BigBrotherList: '大哥列表(员工)', - staffBigBrotherManage: '员工大哥管理(管理)' + staffBigBrotherManage: '员工大哥管理(管理)', + systemAdministration: '系统管理', + userManagement: '用户管理', + roleManagement: '角色管理', + }, analysis: { newUser: '新增用户', @@ -634,5 +643,53 @@ export default { deletePage: '删除本页', placeNegotiation: '请选择是否洽谈', allocationAlert: '分配成功数量可能会小于选择数量,同id主播无法被重复分配' + }, + system: { + user: { + username: '用户名称', + nickname: '用户昵称', + mobile: '手机号码', + dept: '部门', + email: '邮箱', + status: '状态', + sex: '用户性别', + post: '岗位', + password: '用户密码', + id: '用户编号', + remark: '备注', + deptDesc: '归属部门', + assignRole: '分配角色', + role: '角色', + importTip: '是否更新已经存在的用户数据', + importTitle: '用户导入', + import: { + fileRequired: '请上传文件', + fileLimit: '最多只能上传一个文件!', + uploadError: '上传失败,请您重新上传!', + templateName: '用户导入模版.xls', + createSuccess: '上传成功数量:', + updateSuccess: '更新成功数量:', + failure: '更新失败数量:' + } + }, + role: { + name: '角色名称', + code: '角色标识', + type: '角色类型', + sort: '显示顺序', + status: '状态', + remark: '备注', + id: '角色编号', + menuPermission: '菜单权限', + dataPermission: '数据权限', + dataScope: '权限范围', + deptScope: '部门范围' + } + }, + home: { + today: '当日', + last7Days: '近7日', + todayAnchorCount: '当日建联主播数量', + todayBigBrotherCount: '当日建联大哥数量' } } diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue index 6a18a4f..e90f025 100644 --- a/src/views/Home/Index.vue +++ b/src/views/Home/Index.vue @@ -97,8 +97,8 @@ :xl="20" :lg="20" :md="24" :sm="24" :xs="24"> - 当日 - 近7日 + {{ t('home.today') }} + {{ t('home.last7Days') }} @@ -108,7 +108,7 @@ -
当日建联主播数量
+
{{ t('home.todayAnchorCount') }}
{{ HostsOperationNum }}
@@ -125,9 +125,9 @@ :xl="20" :lg="20" :md="24" :sm="24" :xs="24"> - 当日 + {{ t('home.today') }} - 近7日 + {{ t('home.last7Days') }} @@ -138,7 +138,7 @@ -
当日建联大哥数量
+
{{ t('home.todayBigBrotherCount') }}
{{ HostsOperationNumDsec }}
diff --git a/src/views/system/role/RoleAssignMenuForm.vue b/src/views/system/role/RoleAssignMenuForm.vue index 7c81ef7..c282974 100644 --- a/src/views/system/role/RoleAssignMenuForm.vue +++ b/src/views/system/role/RoleAssignMenuForm.vue @@ -1,46 +1,30 @@ diff --git a/src/views/system/role/RoleDataPermissionForm.vue b/src/views/system/role/RoleDataPermissionForm.vue index 1243435..6205cef 100644 --- a/src/views/system/role/RoleDataPermissionForm.vue +++ b/src/views/system/role/RoleDataPermissionForm.vue @@ -1,64 +1,39 @@ diff --git a/src/views/system/role/RoleForm.vue b/src/views/system/role/RoleForm.vue index 161b757..7e71a36 100644 --- a/src/views/system/role/RoleForm.vue +++ b/src/views/system/role/RoleForm.vue @@ -1,38 +1,28 @@ @@ -59,11 +49,11 @@ const formData = ref({ remark: '' }) const formRules = reactive({ - name: [{ required: true, message: '角色名称不能为空', trigger: 'blur' }], - code: [{ required: true, message: '角色标识不能为空', trigger: 'change' }], - sort: [{ required: true, message: '显示顺序不能为空', trigger: 'change' }], - status: [{ required: true, message: '状态不能为空', trigger: 'change' }], - remark: [{ required: false, message: '备注不能为空', trigger: 'blur' }] + name: [{ required: true, message: t('common.required'), trigger: 'blur' }], + code: [{ required: true, message: t('common.required'), trigger: 'change' }], + sort: [{ required: true, message: t('common.required'), trigger: 'change' }], + status: [{ required: true, message: t('common.required'), trigger: 'change' }], + remark: [{ required: false, message: t('common.required'), trigger: 'blur' }] }) const formRef = ref() // 表单 Ref diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 07ada23..8959478 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -4,89 +4,50 @@ - - - + + + - - + + - - - + + + - - + + - 搜索 + {{ t('common.query') }} - 重置 + {{ t('common.reset') }} - + - 新增 + {{ t('action.add') }} - + - 导出 + {{ t('action.export') }} - + - 批量删除 + {{ t('common.delDataMessage') }} @@ -96,76 +57,45 @@ - - - + + + - - - - + + + + - - + + - + @@ -255,7 +185,7 @@ const handleDelete = async (id: number) => { message.success(t('common.delSuccess')) // 刷新列表 await getList() - } catch {} + } catch { } } /** 批量删除按钮操作 */ @@ -273,7 +203,7 @@ const handleDeleteBatch = async () => { message.success(t('common.delSuccess')) // 刷新列表 await getList() - } catch {} + } catch { } } /** 导出按钮操作 */ diff --git a/src/views/system/user/DeptTree.vue b/src/views/system/user/DeptTree.vue index 71ed6cd..d845c2a 100644 --- a/src/views/system/user/DeptTree.vue +++ b/src/views/system/user/DeptTree.vue @@ -1,23 +1,14 @@ @@ -28,6 +19,8 @@ import { defaultProps, handleTree } from '@/utils/tree' defineOptions({ name: 'SystemUserDeptTree' }) +const { t } = useI18n() // 国际化 + const deptName = ref('') const deptList = ref([]) // 树形结构 const treeRef = ref>() diff --git a/src/views/system/user/UserAssignRoleForm.vue b/src/views/system/user/UserAssignRoleForm.vue index 67a5ddb..6d0a4af 100644 --- a/src/views/system/user/UserAssignRoleForm.vue +++ b/src/views/system/user/UserAssignRoleForm.vue @@ -1,21 +1,21 @@ diff --git a/src/views/system/user/UserForm.vue b/src/views/system/user/UserForm.vue index 630688a..d04a0a7 100644 --- a/src/views/system/user/UserForm.vue +++ b/src/views/system/user/UserForm.vue @@ -1,97 +1,75 @@ @@ -128,20 +106,20 @@ const formData = ref({ roleIds: [] }) const formRules = reactive({ - username: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }], - nickname: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }], - password: [{ required: true, message: '用户密码不能为空', trigger: 'blur' }], + username: [{ required: true, message: t('common.required'), trigger: 'blur' }], + nickname: [{ required: true, message: t('common.required'), trigger: 'blur' }], + password: [{ required: true, message: t('common.required'), trigger: 'blur' }], email: [ { type: 'email', - message: '请输入正确的邮箱地址', + message: t('common.required'), trigger: ['blur', 'change'] } ], mobile: [ { pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/, - message: '请输入正确的手机号码', + message: t('common.required'), trigger: 'blur' } ] diff --git a/src/views/system/user/UserImportForm.vue b/src/views/system/user/UserImportForm.vue index 8447b28..672c4a8 100644 --- a/src/views/system/user/UserImportForm.vue +++ b/src/views/system/user/UserImportForm.vue @@ -1,42 +1,27 @@ @@ -47,6 +32,7 @@ import download from '@/utils/download' defineOptions({ name: 'SystemUserImportForm' }) +const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 const dialogVisible = ref(false) // 弹窗的是否展示 @@ -70,7 +56,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ const submitForm = async () => { if (fileList.value.length == 0) { - message.error('请上传文件') + message.error(t('system.user.import.fileRequired')) return } // 提交请求 @@ -92,15 +78,15 @@ const submitFormSuccess = (response: any) => { } // 拼接提示语 const data = response.data - let text = '上传成功数量:' + data.createUsernames.length + ';' + let text = t('system.user.import.createSuccess') + data.createUsernames.length + ';' for (let username of data.createUsernames) { text += '< ' + username + ' >' } - text += '更新成功数量:' + data.updateUsernames.length + ';' + text += t('system.user.import.updateSuccess') + data.updateUsernames.length + ';' for (const username of data.updateUsernames) { text += '< ' + username + ' >' } - text += '更新失败数量:' + Object.keys(data.failureUsernames).length + ';' + text += t('system.user.import.failure') + Object.keys(data.failureUsernames).length + ';' for (const username in data.failureUsernames) { text += '< ' + username + ': ' + data.failureUsernames[username] + ' >' } @@ -113,7 +99,7 @@ const submitFormSuccess = (response: any) => { /** 上传错误提示 */ const submitFormError = (): void => { - message.error('上传失败,请您重新上传!') + message.error(t('system.user.import.uploadError')) formLoading.value = false } @@ -127,12 +113,12 @@ const resetForm = async (): Promise => { /** 文件数超出提示 */ const handleExceed = (): void => { - message.error('最多只能上传一个文件!') + message.error(t('system.user.import.fileLimit')) } /** 下载模板操作 */ const importTemplate = async () => { const res = await UserApi.importUserTemplate() - download.excel(res, '用户导入模版.xls') + download.excel(res, t('system.user.import.templateName')) } diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 1ff0ece..a7c49c3 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -13,45 +13,47 @@ - - - + + + - - + + - - + + - + + :start-placeholder="t('common.startTimeText')" :end-placeholder="t('common.endTimeText')" + class="!w-240px" /> - 搜索 + {{ t('common.query') }} - 重置 + {{ t('common.reset') }} - 新增 + {{ t('action.add') }} - 导入 + {{ t('action.import') }} - 导出 + {{ t('action.export') }} - 批量删除 + {{ t('common.delDataMessage') }} @@ -59,24 +61,28 @@ - - - - - - + + + + + + - - + +