|
@@ -85,7 +85,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, reactive, onMounted } from 'vue';
|
|
|
|
|
|
|
+import { ref, reactive, onMounted, watch } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
|
import { Message } from '@arco-design/web-vue';
|
|
import { Message } from '@arco-design/web-vue';
|
|
|
import DataTable from '../../../views/permission/DataTable.vue';
|
|
import DataTable from '../../../views/permission/DataTable.vue';
|
|
@@ -109,7 +109,10 @@ import {
|
|
|
} from '../../../apis/permission/account';
|
|
} from '../../../apis/permission/account';
|
|
|
import { asycData } from '../../../apis/login.js';
|
|
import { asycData } from '../../../apis/login.js';
|
|
|
import { QueryAllRoleList, QueryDeptTree } from '../../../apis/permission/common';
|
|
import { QueryAllRoleList, QueryDeptTree } from '../../../apis/permission/common';
|
|
|
|
|
+import { useI18n } from 'vue-i18n';
|
|
|
|
|
+
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
|
|
+const { t, locale } = useI18n();
|
|
|
|
|
|
|
|
const keywords = ref('');
|
|
const keywords = ref('');
|
|
|
// 表格相关
|
|
// 表格相关
|
|
@@ -117,11 +120,17 @@ const accountForm = ref(null);
|
|
|
const delete_visible = ref(false);
|
|
const delete_visible = ref(false);
|
|
|
const table_data = ref([]);
|
|
const table_data = ref([]);
|
|
|
const table_columns = ref([
|
|
const table_columns = ref([
|
|
|
- { title: '序号', width: 80, fixed: 'left', slotName: 'index' },
|
|
|
|
|
- { title: '用户名', dataIndex: 'userName', fixed: 'left', width: 100, titleSlotName: 'userName' },
|
|
|
|
|
- { title: '姓名', dataIndex: 'loginName', width: 100, titleSlotName: 'loginName' },
|
|
|
|
|
|
|
+ { title: t('permission.group.serial_number'), width: 130, fixed: 'left', slotName: 'index' },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: t('permission.account.username'),
|
|
|
|
|
+ dataIndex: 'userName',
|
|
|
|
|
+ fixed: 'left',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ titleSlotName: 'userName'
|
|
|
|
|
+ },
|
|
|
|
|
+ { title: t('permission.account.name'), dataIndex: 'loginName', width: 100, titleSlotName: 'loginName' },
|
|
|
{
|
|
{
|
|
|
- title: '角色',
|
|
|
|
|
|
|
+ title: t('permission.account.roles'),
|
|
|
dataIndex: 'roleName',
|
|
dataIndex: 'roleName',
|
|
|
width: 300,
|
|
width: 300,
|
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
@@ -129,17 +138,17 @@ const table_columns = ref([
|
|
|
titleSlotName: 'roleName'
|
|
titleSlotName: 'roleName'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: '所属部门',
|
|
|
|
|
|
|
+ title: t('permission.account.user_department'),
|
|
|
dataIndex: 'deptName',
|
|
dataIndex: 'deptName',
|
|
|
width: 400,
|
|
width: 400,
|
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
|
tooltip: { position: 'top' },
|
|
tooltip: { position: 'top' },
|
|
|
titleSlotName: 'deptName'
|
|
titleSlotName: 'deptName'
|
|
|
},
|
|
},
|
|
|
- { title: '手机号', dataIndex: 'phone', width: 150, titleSlotName: 'phone' },
|
|
|
|
|
- { title: '邮箱', dataIndex: 'email', width: 250, titleSlotName: 'email' },
|
|
|
|
|
- { title: '状态', dataIndex: 'status', width: 100, slotName: 'status' },
|
|
|
|
|
- { title: '操作', dataIndex: 'operation', width: 350, fixed: 'right', slotName: 'operationSlot' }
|
|
|
|
|
|
|
+ { title: t('permission.account.phone'), dataIndex: 'phone', width: 150, titleSlotName: 'phone' },
|
|
|
|
|
+ { title: t('permission.account.email'), dataIndex: 'email', width: 250, titleSlotName: 'email' },
|
|
|
|
|
+ { title: t('permission.group.status'), dataIndex: 'status', width: 100, slotName: 'status' },
|
|
|
|
|
+ { title: t('permission.group.action'), dataIndex: 'operation', fixed: 'right', slotName: 'operationSlot' }
|
|
|
]);
|
|
]);
|
|
|
const pagination_props = ref({
|
|
const pagination_props = ref({
|
|
|
total: 10,
|
|
total: 10,
|
|
@@ -154,7 +163,7 @@ const edit_visible = ref(false);
|
|
|
const is_edit_mode = ref(false);
|
|
const is_edit_mode = ref(false);
|
|
|
const edit_form = reactive({
|
|
const edit_form = reactive({
|
|
|
userName: '',
|
|
userName: '',
|
|
|
- userName: '',
|
|
|
|
|
|
|
+ loginName: '',
|
|
|
phone: '',
|
|
phone: '',
|
|
|
email: '',
|
|
email: '',
|
|
|
pwd: '',
|
|
pwd: '',
|
|
@@ -250,8 +259,7 @@ const statusChange = async (record) => {
|
|
|
const { code } = await UserStatusSwitch(params);
|
|
const { code } = await UserStatusSwitch(params);
|
|
|
if (code === 200) {
|
|
if (code === 200) {
|
|
|
Message.success({
|
|
Message.success({
|
|
|
- title: '成功',
|
|
|
|
|
- content: '状态切换成功'
|
|
|
|
|
|
|
+ content: t('permission.status_switch_success')
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -260,8 +268,7 @@ const handleResetPassword = async (record) => {
|
|
|
const { code } = await ResetPassword(record.userId);
|
|
const { code } = await ResetPassword(record.userId);
|
|
|
if (code === 200) {
|
|
if (code === 200) {
|
|
|
Message.success({
|
|
Message.success({
|
|
|
- title: '重置密码',
|
|
|
|
|
- content: '该用户密码重置为000000'
|
|
|
|
|
|
|
+ content: t('permission.account.reset_password_success')
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -328,8 +335,7 @@ const handleDeptConfigSave = async (checked_keys) => {
|
|
|
const { code } = await UpdateUserDept(data);
|
|
const { code } = await UpdateUserDept(data);
|
|
|
if (code === 200) {
|
|
if (code === 200) {
|
|
|
Message.success({
|
|
Message.success({
|
|
|
- title: '部门配置',
|
|
|
|
|
- content: '部门配置成功'
|
|
|
|
|
|
|
+ content: t('permission.account.dept_config_success')
|
|
|
});
|
|
});
|
|
|
getUserList();
|
|
getUserList();
|
|
|
}
|
|
}
|
|
@@ -339,8 +345,7 @@ const handleDelete = async (userId) => {
|
|
|
const { code } = await DeleteUser(userId);
|
|
const { code } = await DeleteUser(userId);
|
|
|
if (code === 200) {
|
|
if (code === 200) {
|
|
|
Message.success({
|
|
Message.success({
|
|
|
- title: '删除用户',
|
|
|
|
|
- content: '删除成功'
|
|
|
|
|
|
|
+ content: t('permission.account.delete_success')
|
|
|
});
|
|
});
|
|
|
getUserList();
|
|
getUserList();
|
|
|
}
|
|
}
|
|
@@ -360,10 +365,9 @@ const modalSave = async () => {
|
|
|
data: { userFlag }
|
|
data: { userFlag }
|
|
|
} = await apiCall(data);
|
|
} = await apiCall(data);
|
|
|
if (code === 200) {
|
|
if (code === 200) {
|
|
|
- const action = is_edit_mode.value ? '编辑' : '新增';
|
|
|
|
|
|
|
+ const action = is_edit_mode.value ? t('permission.edit') : t('permission.add');
|
|
|
Message.success({
|
|
Message.success({
|
|
|
- title: `${action}用户`,
|
|
|
|
|
- content: `${action}成功`
|
|
|
|
|
|
|
+ content: `${action}${t('permission.success')}`
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// 如果是新增用户,同步数据
|
|
// 如果是新增用户,同步数据
|
|
@@ -418,6 +422,49 @@ const deleteModalOk = () => {
|
|
|
delete_visible.value = false;
|
|
delete_visible.value = false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// 监听语言变化
|
|
|
|
|
+watch(
|
|
|
|
|
+ () => locale.value,
|
|
|
|
|
+ () => {
|
|
|
|
|
+ table_columns.value = [
|
|
|
|
|
+ { title: t('permission.group.serial_number'), width: 130, fixed: 'left', slotName: 'index' },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: t('permission.account.username'),
|
|
|
|
|
+ dataIndex: 'userName',
|
|
|
|
|
+ fixed: 'left',
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ titleSlotName: 'userName'
|
|
|
|
|
+ },
|
|
|
|
|
+ { title: t('permission.account.name'), dataIndex: 'loginName', width: 100, titleSlotName: 'loginName' },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: t('permission.account.roles'),
|
|
|
|
|
+ dataIndex: 'roleName',
|
|
|
|
|
+ width: 300,
|
|
|
|
|
+ ellipsis: true,
|
|
|
|
|
+ tooltip: { position: 'top' },
|
|
|
|
|
+ titleSlotName: 'roleName'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: t('permission.account.user_department'),
|
|
|
|
|
+ dataIndex: 'deptName',
|
|
|
|
|
+ width: 400,
|
|
|
|
|
+ ellipsis: true,
|
|
|
|
|
+ tooltip: { position: 'top' },
|
|
|
|
|
+ titleSlotName: 'deptName'
|
|
|
|
|
+ },
|
|
|
|
|
+ { title: t('permission.account.phone'), dataIndex: 'phone', width: 150, titleSlotName: 'phone' },
|
|
|
|
|
+ { title: t('permission.account.email'), dataIndex: 'email', width: 250, titleSlotName: 'email' },
|
|
|
|
|
+ { title: t('permission.group.status'), dataIndex: 'status', width: 100, slotName: 'status' },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: t('permission.group.action'),
|
|
|
|
|
+ dataIndex: 'operation',
|
|
|
|
|
+ fixed: 'right',
|
|
|
|
|
+ slotName: 'operationSlot'
|
|
|
|
|
+ }
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+);
|
|
|
|
|
+
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
if (hasPermission('system:user:list')) {
|
|
if (hasPermission('system:user:list')) {
|
|
|
getUserList();
|
|
getUserList();
|