---用户管理,网元管理等中英文
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
} from '@/api/system/user';
|
||||
import { deptTreeSelect } from '@/api/system/dept';
|
||||
import { saveAs } from 'file-saver';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import {
|
||||
regExpPasswd,
|
||||
@@ -34,6 +35,7 @@ import { DataNode } from 'ant-design-vue/lib/tree';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const { getDict } = useDictStore();
|
||||
const userStore = useUserStore();
|
||||
const { t } = useI18n();
|
||||
|
||||
/**字典数据 */
|
||||
let dict: {
|
||||
@@ -116,39 +118,39 @@ let tableState: TabeStateType = reactive({
|
||||
/**表格字段列 */
|
||||
let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: '用户编号',
|
||||
title: t('views.system.user.userNum'),
|
||||
dataIndex: 'userId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '登录账号',
|
||||
title: t('views.system.user.account'),
|
||||
dataIndex: 'userName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '用户昵称',
|
||||
title: t('views.system.user.userName'),
|
||||
dataIndex: 'nickName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '用户权限',
|
||||
title: t('views.system.user.permission'),
|
||||
key: 'roles',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '部门名称',
|
||||
title: t('views.system.user.className'),
|
||||
dataIndex: 'deptId',
|
||||
key: 'deptId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '登录地址',
|
||||
title: t('views.system.user.loginIp'),
|
||||
dataIndex: 'loginIp',
|
||||
key: 'loginIp',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '登录时间',
|
||||
title: t('views.system.user.loginTime'),
|
||||
dataIndex: 'loginDate',
|
||||
align: 'center',
|
||||
customRender(opt) {
|
||||
@@ -157,13 +159,13 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '用户状态',
|
||||
title: t('views.system.user.status'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
title: t('common.operate'),
|
||||
key: 'userId',
|
||||
align: 'center',
|
||||
},
|
||||
@@ -187,7 +189,8 @@ let tablePagination = reactive({
|
||||
showSizeChanger: true,
|
||||
/**数据总数 */
|
||||
total: 0,
|
||||
showTotal: (total: number) => `总共 ${total} 条`,
|
||||
showTotal: (total: number) =>
|
||||
t('common.tablePaginationTotal', { total: total }),
|
||||
onChange: (page: number, pageSize: number) => {
|
||||
tablePagination.current = page;
|
||||
tablePagination.pageSize = pageSize;
|
||||
@@ -275,35 +278,35 @@ const modalStateFrom = Form.useForm(
|
||||
{
|
||||
required: true,
|
||||
pattern: regExpUserName,
|
||||
message: '账号不能以数字开头,可包含大写小写字母,数字,且不少于5位',
|
||||
message: t('views.system.user.userNameTip'),
|
||||
},
|
||||
],
|
||||
password: [
|
||||
{
|
||||
required: true,
|
||||
pattern: regExpPasswd,
|
||||
message: '密码至少包含大小写字母、数字、特殊符号,且不少于6位',
|
||||
message: t('views.system.user.userNameTip'),
|
||||
},
|
||||
],
|
||||
nickName: [
|
||||
{
|
||||
required: true,
|
||||
pattern: regExpNick,
|
||||
message: '昵称只能包含字母、数字、中文和下划线,且不少于2位',
|
||||
message: t('views.system.user.nickNameTip'),
|
||||
},
|
||||
],
|
||||
email: [
|
||||
{
|
||||
required: false,
|
||||
pattern: regExpEmail,
|
||||
message: '请输入正确的邮箱地址',
|
||||
message: t('views.system.user.emailTip'),
|
||||
},
|
||||
],
|
||||
phonenumber: [
|
||||
{
|
||||
required: false,
|
||||
pattern: regExpMobile,
|
||||
message: '请输入正确的手机号码',
|
||||
message: t('views.system.user.phoneTip'),
|
||||
},
|
||||
],
|
||||
})
|
||||
@@ -319,7 +322,7 @@ function fnModalVisibleByVive(userId: string | number) {
|
||||
return;
|
||||
}
|
||||
if (modalState.confirmLoading) return;
|
||||
const hide = message.loading('正在打开...', 0);
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
getUser(userId).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
@@ -343,7 +346,7 @@ function fnModalVisibleByVive(userId: string | number) {
|
||||
modalState.from.postIds = postIds;
|
||||
// 头像解析
|
||||
modalState.from.avatar = userStore.fnAvatar(modalState.from.avatar);
|
||||
modalState.title = '用户信息';
|
||||
modalState.title = t('views.system.user.userInfo');
|
||||
modalState.visibleByView = true;
|
||||
} else {
|
||||
message.error('获取用户信息失败', 2);
|
||||
@@ -359,7 +362,7 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
||||
if (!userId) {
|
||||
modalStateFrom.resetFields();
|
||||
if (modalState.confirmLoading) return;
|
||||
const hide = message.loading('正在打开...', 0);
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
// 查询用户详细获取岗位和角色列表
|
||||
getUser().then(res => {
|
||||
@@ -382,7 +385,8 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
||||
modalState.from = Object.assign(modalState.from, user);
|
||||
modalState.from.roleIds = roleIds;
|
||||
modalState.from.postIds = postIds;
|
||||
modalState.title = '添加用户信息';
|
||||
modalState.title =
|
||||
t('common.addText') + t('views.system.user.userInfo');
|
||||
modalState.visibleByEdit = true;
|
||||
} else {
|
||||
message.error('获取用户信息失败', 2);
|
||||
@@ -390,7 +394,7 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
||||
});
|
||||
} else {
|
||||
if (modalState.confirmLoading) return;
|
||||
const hide = message.loading('正在打开...', 0);
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
getUser(userId).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
@@ -412,7 +416,8 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
||||
modalState.from = Object.assign(modalState.from, user);
|
||||
modalState.from.roleIds = roleIds;
|
||||
modalState.from.postIds = postIds;
|
||||
modalState.title = '修改用户信息';
|
||||
modalState.title =
|
||||
t('common.editText') + t('views.system.user.userInfo');
|
||||
modalState.visibleByEdit = true;
|
||||
} else {
|
||||
message.error(`获取用户信息失败`, 2);
|
||||
@@ -430,6 +435,7 @@ function fnModalOk() {
|
||||
if (!modalState.from.userId) {
|
||||
validateName.push('userName', 'password');
|
||||
}
|
||||
console.log(validateName);
|
||||
modalStateFrom
|
||||
.validate(validateName)
|
||||
.then(() => {
|
||||
@@ -437,12 +443,12 @@ function fnModalOk() {
|
||||
const from = toRaw(modalState.from);
|
||||
const user = from.userId ? updateUser(from) : addUser(from);
|
||||
const key = 'user';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
user
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `${modalState.title}成功`,
|
||||
content: t('common.msgSuccess', { msg: modalState.title }),
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
@@ -462,7 +468,7 @@ function fnModalOk() {
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
message.error(`请正确填写 ${e.errorFields.length} 处必填信息!`, 2);
|
||||
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -489,12 +495,12 @@ function fnModalOkResetPwd() {
|
||||
.then(() => {
|
||||
modalState.confirmLoading = true;
|
||||
const key = 'user';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
resetUserPwd(modalState.from.userId, modalState.from.password)
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `${modalState.title}成功`,
|
||||
content: t('common.msgSuccess', { msg: modalState.title }),
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
@@ -513,7 +519,7 @@ function fnModalOkResetPwd() {
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
message.error(`请正确填写 ${e.errorFields.length} 处必填信息!`, 2);
|
||||
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -525,7 +531,7 @@ function fnRecordResetPwd(row: Record<string, string>) {
|
||||
modalStateFrom.resetFields();
|
||||
modalState.from.userId = row.userId;
|
||||
modalState.from.userName = row.userName;
|
||||
modalState.title = '重置密码';
|
||||
modalState.title = t('views.system.user.resetPwd');
|
||||
modalState.visibleByResetPwd = true;
|
||||
}
|
||||
|
||||
@@ -534,17 +540,23 @@ function fnRecordResetPwd(row: Record<string, string>) {
|
||||
* @param row 用户记录对象
|
||||
*/
|
||||
function fnRecordStatus(row: Record<string, string>) {
|
||||
const text = row.status === '1' ? '启用' : '停用';
|
||||
const text =
|
||||
row.status === '1'
|
||||
? t('views.system.user.start')
|
||||
: t('views.system.user.stop');
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: `确定要${text} ${row.userName} 用户吗?`,
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.system.user.sureTip', {
|
||||
text: text,
|
||||
userName: row.userName,
|
||||
}),
|
||||
onOk() {
|
||||
const key = 'changeUserStatus';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
changeUserStatus(row.userId, row.status).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `${row.userName} ${text}成功`,
|
||||
content: `${row.userName} ${t('common.msgSuccess', { msg: text })}`,
|
||||
key: key,
|
||||
duration: 2,
|
||||
});
|
||||
@@ -573,15 +585,15 @@ function fnRecordDelete(userId: string = '0') {
|
||||
userId = tableState.selectedRowKeys.join(',');
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: `确认删除用户编号为 【${userId}】 的数据项?`,
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.system.user.delSure', { userId: userId }),
|
||||
onOk() {
|
||||
const key = 'delUser';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
delUser(userId).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `删除成功`,
|
||||
content: t('views.system.user.delSuss'),
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
@@ -601,15 +613,17 @@ function fnRecordDelete(userId: string = '0') {
|
||||
/**列表导出 */
|
||||
function fnExportList() {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: `确认根据搜索条件导出xlsx表格文件吗?`,
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.system.user.exportSure'),
|
||||
onOk() {
|
||||
const key = 'exportUser';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
exportUser(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `已完成导出`,
|
||||
content: t('common.msgSuccess', {
|
||||
msg: t('views.system.user.export'),
|
||||
}),
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
@@ -666,7 +680,7 @@ function fnModalUploadImportClose() {
|
||||
|
||||
/**对话框表格信息导入上传 */
|
||||
function fnModalUploadImportUpload(file: File) {
|
||||
const hide = message.loading('正在上传并解析数据...', 0);
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
uploadImportState.loading = true;
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
@@ -676,7 +690,7 @@ function fnModalUploadImportUpload(file: File) {
|
||||
uploadImportState.msg = res.msg?.replaceAll(/<br\/>+/g, '\r');
|
||||
})
|
||||
.catch((err: { code: number; msg: string }) => {
|
||||
message.error(`上传失败 ${err.msg}`);
|
||||
message.error(` ${err.msg}`);
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
@@ -688,7 +702,7 @@ function fnModalUploadImportUpload(file: File) {
|
||||
function fnModalUploadImportExportTemplate() {
|
||||
if (uploadImportState.templateDownload) return;
|
||||
uploadImportState.templateDownload = true;
|
||||
const hide = message.loading('正在下载...', 0);
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
importTemplate()
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
@@ -714,7 +728,7 @@ function fnModalUploadImportExportTemplate() {
|
||||
function fnGetList(pageNum?: number) {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
if(pageNum){
|
||||
if (pageNum) {
|
||||
queryParams.pageNum = pageNum;
|
||||
}
|
||||
if (!queryRangePicker.value) {
|
||||
@@ -779,10 +793,12 @@ onMounted(() => {
|
||||
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="18" :md="12" :xs="24">
|
||||
<a-form-item label="部门名称" name="deptId">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.className')"
|
||||
name="deptId"
|
||||
>
|
||||
<a-tree-select
|
||||
v-model:value="queryParams.deptId"
|
||||
placeholder="部门名称"
|
||||
show-search
|
||||
tree-default-expand-all
|
||||
:tree-data="deptTreeData"
|
||||
@@ -804,11 +820,11 @@ onMounted(() => {
|
||||
<a-space :size="8">
|
||||
<a-button type="primary" @click.prevent="fnGetList(1)">
|
||||
<template #icon><SearchOutlined /></template>
|
||||
搜索
|
||||
{{ t('common.search') }}
|
||||
</a-button>
|
||||
<a-button type="default" @click.prevent="fnQueryReset">
|
||||
<template #icon><ClearOutlined /></template>
|
||||
重置
|
||||
{{ t('common.reset') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
@@ -816,44 +832,49 @@ onMounted(() => {
|
||||
</a-row>
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="登录账号" name="userName">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.account')"
|
||||
name="userName"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="queryParams.userName"
|
||||
allow-clear
|
||||
:maxlength="30"
|
||||
placeholder="请输入登录账号"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="手机号码" name="phonenumber">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.phone')"
|
||||
name="phonenumber"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="queryParams.phonenumber"
|
||||
allow-clear
|
||||
:maxlength="11"
|
||||
placeholder="请输入手机号码"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="4" :md="12" :xs="24">
|
||||
<a-form-item label="用户状态" name="status">
|
||||
<a-form-item :label="t('views.system.user.status')" name="status">
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
allow-clear
|
||||
placeholder="请选择"
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8" :md="12" :xs="24">
|
||||
<a-form-item label="登录时间" name="queryRangePicker">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.loginTime')"
|
||||
name="queryRangePicker"
|
||||
>
|
||||
<a-range-picker
|
||||
v-model:value="queryRangePicker"
|
||||
allow-clear
|
||||
bordered
|
||||
value-format="YYYY-MM-DD"
|
||||
:placeholder="['登录开始', '登录结束']"
|
||||
style="width: 100%"
|
||||
></a-range-picker>
|
||||
</a-form-item>
|
||||
@@ -872,7 +893,7 @@ onMounted(() => {
|
||||
v-perms:has="['system:user:add']"
|
||||
>
|
||||
<template #icon><PlusOutlined /></template>
|
||||
新建
|
||||
{{ t('common.addText') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="default"
|
||||
@@ -882,7 +903,7 @@ onMounted(() => {
|
||||
v-perms:has="['system:user:remove']"
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
删除
|
||||
{{ t('common.deleteText') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="dashed"
|
||||
@@ -890,7 +911,7 @@ onMounted(() => {
|
||||
v-perms:has="['system:user:import']"
|
||||
>
|
||||
<template #icon><ImportOutlined /></template>
|
||||
导入
|
||||
{{ t('views.system.user.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="dashed"
|
||||
@@ -898,7 +919,7 @@ onMounted(() => {
|
||||
v-perms:has="['system:user:export']"
|
||||
>
|
||||
<template #icon><ExportOutlined /></template>
|
||||
导出
|
||||
{{ t('views.system.user.import') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
@@ -907,15 +928,15 @@ onMounted(() => {
|
||||
<template #extra>
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>搜索栏</template>
|
||||
<template #title>{{ t('common.searchBarText') }}</template>
|
||||
<a-switch
|
||||
v-model:checked="tableState.seached"
|
||||
checked-children="显"
|
||||
un-checked-children="隐"
|
||||
:checked-children="t('common.switch.show')"
|
||||
:un-checked-children="t('common.switch.hide')"
|
||||
size="small"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<!-- <a-tooltip>
|
||||
<template #title>表格斑马纹</template>
|
||||
<a-switch
|
||||
v-model:checked="tableState.striped"
|
||||
@@ -923,15 +944,15 @@ onMounted(() => {
|
||||
un-checked-children="关"
|
||||
size="small"
|
||||
/>
|
||||
</a-tooltip>
|
||||
</a-tooltip> -->
|
||||
<a-tooltip>
|
||||
<template #title>刷新</template>
|
||||
<template #title>{{ t('common.reloadText') }}</template>
|
||||
<a-button type="text" @click.prevent="fnGetList(1)">
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<template #title>{{ t('common.sizeText') }}</template>
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
@@ -941,9 +962,15 @@ onMounted(() => {
|
||||
:selected-keys="[tableState.size as string]"
|
||||
@click="fnTableSize"
|
||||
>
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
<a-menu-item key="default">{{
|
||||
t('common.size.default')
|
||||
}}</a-menu-item>
|
||||
<a-menu-item key="middle">{{
|
||||
t('common.size.middle')
|
||||
}}</a-menu-item>
|
||||
<a-menu-item key="small">{{
|
||||
t('common.size.small')
|
||||
}}</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
@@ -1000,7 +1027,7 @@ onMounted(() => {
|
||||
<template v-if="column.key === 'userId'">
|
||||
<a-space :size="8" align="center" v-if="record.userId !== '1'">
|
||||
<a-tooltip>
|
||||
<template #title>查看详情</template>
|
||||
<template #title>{{ t('common.viewText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByVive(record.userId)"
|
||||
@@ -1010,7 +1037,7 @@ onMounted(() => {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>编辑</template>
|
||||
<template #title>{{ t('common.editText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByEdit(record.userId)"
|
||||
@@ -1020,7 +1047,7 @@ onMounted(() => {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>删除</template>
|
||||
<template #title>{{ t('common.deleteText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnRecordDelete(record.userId)"
|
||||
@@ -1030,7 +1057,9 @@ onMounted(() => {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>重置密码</template>
|
||||
<template #title>{{
|
||||
t('views.system.user.resetPwd')
|
||||
}}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnRecordResetPwd(record)"
|
||||
@@ -1055,12 +1084,15 @@ onMounted(() => {
|
||||
<a-form layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="用户编号" name="userId">
|
||||
<a-form-item :label="t('views.system.user.userNum')" name="userId">
|
||||
{{ modalState.from.userId }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="创建时间" name="createTime">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.createTime')"
|
||||
name="createTime"
|
||||
>
|
||||
<span v-if="+modalState.from.createTime > 0">
|
||||
{{ parseDateToStr(+modalState.from.createTime) }}
|
||||
</span>
|
||||
@@ -1069,12 +1101,15 @@ onMounted(() => {
|
||||
</a-row>
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="登录地址" name="loginIp">
|
||||
<a-form-item :label="t('views.system.user.loginIp')" name="loginIp">
|
||||
{{ modalState.from.loginIp }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="登录时间" name="loginDate">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.loginTime')"
|
||||
name="loginDate"
|
||||
>
|
||||
<span v-if="+modalState.from.loginDate > 0">
|
||||
{{ parseDateToStr(+modalState.from.loginDate) }}
|
||||
</span>
|
||||
@@ -1083,7 +1118,7 @@ onMounted(() => {
|
||||
</a-row>
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="用户头像" name="avatar">
|
||||
<a-form-item :label="t('views.system.user.userTop')" name="avatar">
|
||||
<a-avatar
|
||||
shape="circle"
|
||||
size="default"
|
||||
@@ -1093,19 +1128,25 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="登录账号" name="userName">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.account')"
|
||||
name="userName"
|
||||
>
|
||||
{{ modalState.from.userName }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="用户昵称" name="nickName">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.userName')"
|
||||
name="nickName"
|
||||
>
|
||||
{{ modalState.from.nickName }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="用户性别" name="sex">
|
||||
<a-form-item :label="t('views.system.user.sex')" name="sex">
|
||||
<DictTag
|
||||
:options="dict.sysUserSex"
|
||||
:value="modalState.from.sex"
|
||||
@@ -1113,7 +1154,7 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="用户状态" name="status">
|
||||
<a-form-item :label="t('views.system.user.status')" name="status">
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="modalState.from.status"
|
||||
@@ -1124,21 +1165,23 @@ onMounted(() => {
|
||||
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="手机号码" name="phonenumber">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.phone')"
|
||||
name="phonenumber"
|
||||
>
|
||||
{{ modalState.from.phonenumber }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="电子邮箱" name="email">
|
||||
<a-form-item :label="t('views.system.user.email')" name="email">
|
||||
{{ modalState.from.email }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="归属部门" name="deptId">
|
||||
<a-form-item :label="t('views.system.user.fromClass')" name="deptId">
|
||||
<a-tree-select
|
||||
:value="modalState.from.deptId"
|
||||
placeholder="归属部门"
|
||||
disabled
|
||||
:tree-data="deptTreeData"
|
||||
:field-names="{
|
||||
@@ -1156,7 +1199,10 @@ onMounted(() => {
|
||||
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="用户岗位" name="postIds">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.userWork')"
|
||||
name="postIds"
|
||||
>
|
||||
<a-select
|
||||
:value="modalState.from.postIds"
|
||||
disabled
|
||||
@@ -1170,12 +1216,14 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="用户权限" name="roleIds">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.permission')"
|
||||
name="roleIds"
|
||||
>
|
||||
<a-select
|
||||
:value="modalState.from.roleIds"
|
||||
disabled
|
||||
mode="multiple"
|
||||
placeholder="请选择用户权限"
|
||||
option-label-prop="roleName"
|
||||
:options="modalState.options.roles"
|
||||
:field-names="{ label: 'roleName', value: 'roleId' }"
|
||||
@@ -1185,12 +1233,14 @@ onMounted(() => {
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="用户说明" name="remark">
|
||||
<a-form-item :label="t('views.system.user.userTip')" name="remark">
|
||||
{{ modalState.from.remark }}
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<template #footer>
|
||||
<a-button key="cancel" @click="fnModalCancel">关闭</a-button>
|
||||
<a-button key="cancel" @click="fnModalCancel">{{
|
||||
t('common.close')
|
||||
}}</a-button>
|
||||
</template>
|
||||
</a-modal>
|
||||
|
||||
@@ -1209,7 +1259,7 @@ onMounted(() => {
|
||||
<a-row :gutter="16" v-if="!modalState.from.userId">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
label="登录账号"
|
||||
:label="t('views.system.user.account')"
|
||||
name="userName"
|
||||
v-bind="modalStateFrom.validateInfos.userName"
|
||||
>
|
||||
@@ -1217,7 +1267,6 @@ onMounted(() => {
|
||||
v-model:value="modalState.from.userName"
|
||||
allow-clear
|
||||
:maxlength="30"
|
||||
placeholder="请输入登录账号"
|
||||
>
|
||||
<template #prefix>
|
||||
<UserOutlined />
|
||||
@@ -1227,13 +1276,12 @@ onMounted(() => {
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
label="登录密码"
|
||||
:label="t('views.system.user.loginPwd')"
|
||||
name="password"
|
||||
v-bind="modalStateFrom.validateInfos.password"
|
||||
>
|
||||
<a-input-password
|
||||
v-model:value="modalState.from.password"
|
||||
placeholder="登录密码"
|
||||
:maxlength="26"
|
||||
>
|
||||
<template #prefix>
|
||||
@@ -1247,7 +1295,7 @@ onMounted(() => {
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
label="用户昵称"
|
||||
:label="t('views.system.user.userName')"
|
||||
name="nickName"
|
||||
v-bind="modalStateFrom.validateInfos.nickName"
|
||||
>
|
||||
@@ -1255,27 +1303,24 @@ onMounted(() => {
|
||||
v-model:value="modalState.from.nickName"
|
||||
allow-clear
|
||||
:maxlength="30"
|
||||
placeholder="请输入用户昵称"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="用户性别" name="sex">
|
||||
<a-form-item :label="t('views.system.user.sex')" name="sex">
|
||||
<a-select
|
||||
v-model:value="modalState.from.sex"
|
||||
default-value="1"
|
||||
placeholder="用户性别"
|
||||
:options="dict.sysUserSex"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="用户状态" name="status">
|
||||
<a-form-item :label="t('views.system.user.status')" name="status">
|
||||
<a-select
|
||||
v-model:value="modalState.from.status"
|
||||
default-value="0"
|
||||
placeholder="用户状态"
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
</a-select>
|
||||
@@ -1286,7 +1331,7 @@ onMounted(() => {
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
label="手机号码"
|
||||
:label="t('views.system.user.phone')"
|
||||
name="phonenumber"
|
||||
v-bind="modalStateFrom.validateInfos.phonenumber"
|
||||
>
|
||||
@@ -1294,13 +1339,12 @@ onMounted(() => {
|
||||
v-model:value="modalState.from.phonenumber"
|
||||
allow-clear
|
||||
:maxlength="11"
|
||||
placeholder="请输入手机号码"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
label="电子邮箱"
|
||||
:label="t('views.system.user.email')"
|
||||
name="email"
|
||||
v-bind="modalStateFrom.validateInfos.email"
|
||||
>
|
||||
@@ -1308,16 +1352,14 @@ onMounted(() => {
|
||||
v-model:value="modalState.from.email"
|
||||
allow-clear
|
||||
:maxlength="40"
|
||||
placeholder="请输入电子邮箱"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="归属部门" name="deptId">
|
||||
<a-form-item :label="t('views.system.user.fromClass')" name="deptId">
|
||||
<a-tree-select
|
||||
v-model:value="modalState.from.deptId"
|
||||
placeholder="归属部门"
|
||||
show-search
|
||||
tree-default-expand-all
|
||||
:tree-data="deptTreeData"
|
||||
@@ -1336,12 +1378,11 @@ onMounted(() => {
|
||||
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="用户岗位" name="postIds">
|
||||
<a-form-item :label="t('views.system.user.userWork')" name="postIds">
|
||||
<a-select
|
||||
v-model:value="modalState.from.postIds"
|
||||
allow-clear
|
||||
mode="multiple"
|
||||
placeholder="请选择用户岗位"
|
||||
show-search
|
||||
option-filter-prop="postName"
|
||||
option-label-prop="postName"
|
||||
@@ -1352,12 +1393,11 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="用户权限" name="roleIds">
|
||||
<a-form-item :label="t('views.system.user.permission')" name="roleIds">
|
||||
<a-select
|
||||
v-model:value="modalState.from.roleIds"
|
||||
:allow-clear="false"
|
||||
mode="multiple"
|
||||
placeholder="请选择用户权限"
|
||||
show-search
|
||||
option-filter-prop="roleName"
|
||||
option-label-prop="roleName"
|
||||
@@ -1369,13 +1409,12 @@ onMounted(() => {
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="用户说明" name="remark">
|
||||
<a-form-item :label="t('views.system.user.userTip')" name="remark">
|
||||
<a-textarea
|
||||
v-model:value="modalState.from.remark"
|
||||
:auto-size="{ minRows: 4, maxRows: 6 }"
|
||||
:maxlength="450"
|
||||
:show-count="true"
|
||||
placeholder="请输入用户说明"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
@@ -1394,7 +1433,7 @@ onMounted(() => {
|
||||
>
|
||||
<a-form name="modalStateFromByResetPwd" layout="horizontal">
|
||||
<a-form-item
|
||||
label="登录账号"
|
||||
:label="t('views.system.user.account')"
|
||||
name="userName"
|
||||
v-bind="modalStateFrom.validateInfos.userName"
|
||||
>
|
||||
@@ -1402,7 +1441,6 @@ onMounted(() => {
|
||||
:value="modalState.from.userName"
|
||||
disabled
|
||||
:maxlength="30"
|
||||
placeholder="登录账号"
|
||||
>
|
||||
<template #prefix>
|
||||
<UserOutlined />
|
||||
@@ -1410,13 +1448,12 @@ onMounted(() => {
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="登录密码"
|
||||
:label="t('views.system.user.loginPwd')"
|
||||
name="password"
|
||||
v-bind="modalStateFrom.validateInfos.password"
|
||||
>
|
||||
<a-input-password
|
||||
v-model:value="modalState.from.password"
|
||||
placeholder="登录密码"
|
||||
:maxlength="26"
|
||||
>
|
||||
<template #prefix>
|
||||
@@ -1441,16 +1478,16 @@ onMounted(() => {
|
||||
<a-row :gutter="18" justify="space-between" align="middle">
|
||||
<a-col :span="12">
|
||||
<a-checkbox v-model:checked="uploadImportState.updateSupport">
|
||||
是否更新已经存在的数据
|
||||
{{t('views.system.user.updateSure')}}
|
||||
</a-checkbox>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-button
|
||||
type="link"
|
||||
title="下载模板"
|
||||
:title="t('views.system.user.downloadObj')"
|
||||
@click.prevent="fnModalUploadImportExportTemplate"
|
||||
>
|
||||
下载模板
|
||||
{{t('views.system.user.downloadObj')}}
|
||||
</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
Reference in New Issue
Block a user