From b8190bd640e66b8104b915d862f6b0d85bce45c9 Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Fri, 10 Nov 2023 16:37:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=85=8D=E7=94=A8=E6=88=B7=E5=9B=BD?= =?UTF-8?q?=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 | 12 +++ src/i18n/locales/zh-CN.ts | 16 ++- src/views/system/role/auth-user.vue | 101 ++++++++++-------- .../role/components/auth-user-select.vue | 43 +++++--- 4 files changed, 110 insertions(+), 62 deletions(-) diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index e8dd728b..921006d0 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -697,6 +697,18 @@ export default { stop:'Pause', preScope:'Scope of authority', dataPer:'Data permission', + userId:'User number', + account:'Login account', + userName:'User nickname', + phone:'Phone', + email:'Email', + userStaus:'User status', + selectPls:'Please select the user to be assigned', + suss:'{oper}success', + giveUser:'Authorized user', + cancelGive:'Cancel authorization', + cancelSure:'Confirm to cancel the authorization of the data item with user number [{userId}]?', + batchCancel:'Batch cancellation of authorization', }, dept:{ classInfo:' Department information', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 1fc64d70..9e1e2878 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -132,7 +132,7 @@ export default { ttile: '没有访问权限', subTitle:'请不要进行非法操作,您可以返回主页面或返回', backHome: '返回首页', - back: '返回', + back: '返回', }, err404: { ttile: '找不到匹配页面', @@ -440,7 +440,7 @@ export default { }, }, faultManage: { - activeAlarm: { + activeAlarm: { all:'所有', neType: '告警设备类型', neName: '告警网元名称', @@ -697,6 +697,18 @@ export default { stop:'暂停', preScope:'权限范围', dataPer:'数据权限', + userId:'用户编号', + account:'登录账号', + userName:'用户昵称', + phone:'手机号码', + email:'电子邮箱', + userStaus:'用户状态', + selectPls:'请选择要分配的用户', + suss:'{oper}成功', + giveUser:'授权用户', + cancelGive:'取消授权', + cancelSure:'确认取消用户编号为 【{userId}】 的数据项授权?', + batchCancel:'批量取消授权', }, dept:{ classInfo:'部门信息', diff --git a/src/views/system/role/auth-user.vue b/src/views/system/role/auth-user.vue index db8ae3e9..a4e4f3d4 100644 --- a/src/views/system/role/auth-user.vue +++ b/src/views/system/role/auth-user.vue @@ -92,38 +92,38 @@ let tableState: TabeStateType = reactive({ /**表格字段列 */ let tableColumns: ColumnsType = [ { - title: '用户编号', + title: t('views.system.role.userId'), dataIndex: 'userId', align: 'center', }, { - title: '登录账号', + title: t('views.system.role.account'), dataIndex: 'userName', align: 'center', }, { - title: '用户昵称', + title: t('views.system.role.userName'), dataIndex: 'nickName', align: 'center', }, { - title: '手机号码', + title: t('views.system.role.phone'), dataIndex: 'phonenumber', align: 'center', }, { - title: '电子邮箱', + title: t('views.system.role.email'), dataIndex: 'email', align: 'center', }, { - title: '用户状态', + title: t('views.system.role.userStaus'), dataIndex: 'status', key: 'status', align: 'center', }, { - title: '创建时间', + title: t('views.system.role.createTime'), dataIndex: 'createTime', align: 'center', customRender(opt) { @@ -132,7 +132,7 @@ let tableColumns: ColumnsType = [ }, }, { - title: '操作', + title: t('common.operate'), key: 'userId', align: 'center', }, @@ -156,7 +156,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; @@ -208,7 +208,7 @@ function fnModalVisibleBySelectUser() { */ function fnModalOk(userIds: string[] | number[]) { if (userIds.length <= 0) { - message.error(`请选择要分配的用户`, 2); + message.error(t('views.system.role.selectPls'), 2); return; } const key = 'authUserChecked'; @@ -221,7 +221,9 @@ function fnModalOk(userIds: string[] | number[]) { if (res.code === RESULT_CODE_SUCCESS) { modalState.visibleBySelectUser = false; message.success({ - content: `授权用户添加成功`, + content: t('views.system.role.suss', { + oper: t('views.system.role.giveUser'), + }), key, duration: 3, }); @@ -246,7 +248,7 @@ function fnRecordDelete(userId: string | number) { } Modal.confirm({ title: t('common.tipTitle'), - content: `确认取消用户编号为 【${userId}】 的数据项授权?`, + content: t('views.system.role.cancelSure', { userId: userId }), onOk() { const key = 'authUserChecked'; message.loading({ content: t('common.loading'), key }); @@ -254,7 +256,9 @@ function fnRecordDelete(userId: string | number) { res => { if (res.code === RESULT_CODE_SUCCESS) { message.success({ - content: `取消授权成功`, + content: t('views.system.role.suss', { + oper: t('views.system.role.cancelGive'), + }), key, duration: 3, }); @@ -286,7 +290,7 @@ function fnClose() { function fnGetList(pageNum?: number) { if (tableState.loading) return; tableState.loading = true; - if(pageNum){ + if (pageNum) { queryParams.pageNum = pageNum; } authUserAllocatedList(toRaw(queryParams)).then(res => { @@ -325,40 +329,45 @@ onMounted(() => { - - + + - + - + - + @@ -369,11 +378,11 @@ onMounted(() => { - 搜索 - 重置 @@ -388,7 +397,7 @@ onMounted(() => { - 关闭 + {{ t('common.cancel') }} { v-perms:has="['system:role:add']" > - 分配用户 + {{ t('views.system.role.distributeUser') }} { v-perms:has="['system:role:remove']" > - 批量取消授权 + {{ t('views.system.role.batchCancel') }} @@ -415,31 +424,31 @@ onMounted(() => { @@ -483,7 +498,7 @@ onMounted(() => {