---用户管理,网元管理等中英文

This commit is contained in:
lai
2023-11-08 11:21:39 +08:00
parent 8e467b95a2
commit 1bc9358d30
37 changed files with 582 additions and 404 deletions

View File

@@ -256,7 +256,7 @@ function fnModalVisibleByEdit(configId?: string | number) {
modalState.visibleByEdit = true;
} else {
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
getConfig(configId).then(res => {
modalState.confirmLoading = false;
@@ -284,7 +284,7 @@ function fnModalOk() {
const from = toRaw(modalState.from);
const config = from.configId ? updateConfig(from) : addConfig(from);
const key = 'config';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
config
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
@@ -332,11 +332,11 @@ function fnRecordDelete(configId: string = '0') {
configId = tableState.selectedRowKeys.join(',');
}
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认删除参数编号为 【${configId}】 的数据项?`,
onOk() {
const key = 'delConfig';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
delConfig(configId).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
@@ -360,11 +360,11 @@ function fnRecordDelete(configId: string = '0') {
/**列表导出 */
function fnExportList() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认根据搜索条件导出xlsx表格文件吗?`,
onOk() {
const key = 'exportConfig';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
exportConfig(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
@@ -390,11 +390,11 @@ function fnExportList() {
*/
function fnRefreshCache() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确定要刷新参数配置缓存吗?`,
onOk() {
const key = 'refreshCache';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
refreshCache().then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({

View File

@@ -211,7 +211,7 @@ function fnModalVisibleByVive(deptId: string | number) {
return;
}
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
getDept(deptId).then(res => {
modalState.confirmLoading = false;
@@ -252,7 +252,7 @@ function fnModalVisibleByEdit(
modalState.visibleByEdit = true;
} else {
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
// 获取部门信息同时查询部门列表(排除节点)
Promise.all([getDept(deptId), listDeptExcludeChild(deptId)])
@@ -295,7 +295,7 @@ function fnModalOk() {
modalState.confirmLoading = true;
const from = toRaw(modalState.from);
const dept = from.deptId ? updateDept(from) : addDept(from);
const hide = message.loading('请稍等...', 0);
const hide = message.loading(t('common.loading'), 0);
dept
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
@@ -343,10 +343,10 @@ function fnModalCancel() {
*/
function fnRecordDelete(deptId: string | number) {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认删除部门编号为 【${deptId}】 的数据项?`,
onOk() {
const hide = message.loading('请稍等...', 0);
const hide = message.loading(t('common.loading'), 0);
delDept(deptId).then(res => {
hide();
if (res.code === RESULT_CODE_SUCCESS) {

View File

@@ -282,7 +282,7 @@ function fnModalVisibleByEdit(dictCode?: string | number) {
modalState.visibleByEdit = true;
} else {
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
getData(dictCode).then(res => {
modalState.confirmLoading = false;
@@ -310,7 +310,7 @@ function fnModalOk() {
const from = toRaw(modalState.from);
const dictData = from.dictCode ? updateData(from) : addData(from);
const key = 'dictData';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
dictData
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
@@ -358,11 +358,11 @@ function fnRecordDelete(dictCode: string = '0') {
dictCode = tableState.selectedRowKeys.join(',');
}
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认删除字典数据代码为 【${dictCode}】 的数据项?`,
onOk() {
const key = 'delData';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
delData(dictCode).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
@@ -386,11 +386,11 @@ function fnRecordDelete(dictCode: string = '0') {
/**列表导出 */
function fnExportList() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认根据搜索条件导出xlsx表格文件吗?`,
onOk() {
const key = 'exportData';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
exportData(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({

View File

@@ -231,7 +231,7 @@ function fnModalVisibleByVive(dictId: string | number) {
return;
}
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
getType(dictId).then(res => {
modalState.confirmLoading = false;
@@ -257,7 +257,7 @@ function fnModalVisibleByEdit(dictId?: string | number) {
modalState.visibleByEdit = true;
} else {
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
getType(dictId).then(res => {
modalState.confirmLoading = false;
@@ -285,7 +285,7 @@ function fnModalOk() {
const from = toRaw(modalState.from);
const dictType = from.dictId ? updateType(from) : addType(from);
const key = 'dictType';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
dictType
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
@@ -333,11 +333,11 @@ function fnRecordDelete(dictId: string = '0') {
dictId = tableState.selectedRowKeys.join(',');
}
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认删除参数编号为 【${dictId}】 的数据项?`,
onOk() {
const key = 'delType';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
delType(dictId).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
@@ -361,11 +361,11 @@ function fnRecordDelete(dictId: string = '0') {
/**列表导出 */
function fnExportList() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认根据搜索条件导出xlsx表格文件吗?`,
onOk() {
const key = 'exportType';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
exportType(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
@@ -391,11 +391,11 @@ function fnExportList() {
*/
function fnRefreshCache() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确定要刷新字典数据缓存吗?`,
onOk() {
const key = 'refreshCache';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
refreshCache().then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({

View File

@@ -203,11 +203,11 @@ function fnTableSelectedRows(
function fnRecordDelete() {
const ids = tableState.selectedRowKeys.join(',');
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认删除访问编号为 【${ids}】 的数据项吗?`,
onOk() {
const key = 'delSysLogLogin';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
delSysLogLogin(ids).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
@@ -231,11 +231,11 @@ function fnRecordDelete() {
/**列表清空 */
function fnCleanList() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认清空所有登录日志数据项?`,
onOk() {
const key = 'cleanSysLogLogin';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
cleanSysLogLogin().then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
@@ -260,10 +260,10 @@ function fnCleanList() {
function fnUnlock() {
const username = tableState.selectedUserName;
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认解锁用户 【${username}】 数据项?`,
onOk() {
const hide = message.loading('请稍等...', 0);
const hide = message.loading(t('common.loading'), 0);
unlock(username).then(res => {
hide();
if (res.code === RESULT_CODE_SUCCESS) {
@@ -285,11 +285,11 @@ function fnUnlock() {
/**列表导出 */
function fnExportList() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认根据搜索条件导出xlsx表格文件吗?`,
onOk() {
const key = 'exportSysLogLogin';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
exportSysLogLogin(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({

View File

@@ -256,11 +256,11 @@ function fnModalCancel() {
function fnRecordDelete() {
const ids = tableState.selectedRowKeys.join(',');
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认删除访问编号为 【${ids}】 的数据项吗?`,
onOk() {
const key = 'delSysLogOperate';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
delSysLogOperate(ids).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
@@ -284,11 +284,11 @@ function fnRecordDelete() {
/**列表清空 */
function fnCleanList() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认清空所有登录日志数据项?`,
onOk() {
const key = 'cleanSysLogOperate';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
cleanSysLogOperate().then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
@@ -312,11 +312,11 @@ function fnCleanList() {
/**列表导出 */
function fnExportList() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认根据搜索条件导出xlsx表格文件吗?`,
onOk() {
const key = 'exportSysLogOperate';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
exportSysLogOperate(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({

View File

@@ -265,7 +265,7 @@ function fnModalVisibleByVive(menuId: string | number) {
return;
}
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
modalState.treeData = treeDataAll;
getMenu(menuId).then(res => {
@@ -302,7 +302,7 @@ function fnModalVisibleByEdit(
modalState.visibleByEdit = true;
} else {
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
getMenu(menuId).then(res => {
modalState.confirmLoading = false;
@@ -342,7 +342,7 @@ function fnModalOk() {
const from = toRaw(modalState.from);
const menu = from.menuId ? updateMenu(from) : addMenu(from);
const key = 'menu';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
menu
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
@@ -388,11 +388,11 @@ function fnModalCancel() {
*/
function fnRecordDelete(menuId: string | number) {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认删除菜单编号为 【${menuId}】 的数据项?`,
onOk() {
const key = 'delMenu';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
delMenu(menuId).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({

View File

@@ -222,7 +222,7 @@ function fnModalVisibleByVive(postId: string | number) {
return;
}
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
getPost(postId).then(res => {
modalState.confirmLoading = false;
@@ -248,7 +248,7 @@ function fnModalVisibleByEdit(postId?: string | number) {
modalState.visibleByEdit = true;
} else {
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
getPost(postId).then(res => {
modalState.confirmLoading = false;
@@ -276,7 +276,7 @@ function fnModalOk() {
const from = toRaw(modalState.from);
const post = from.postId ? updatePost(from) : addPost(from);
const key = 'notice';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
post
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
@@ -324,11 +324,11 @@ function fnRecordDelete(postId: string = '0') {
postId = tableState.selectedRowKeys.join(',');
}
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认删除岗位编号为 【${postId}】 的数据项?`,
onOk() {
const key = 'delPost';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
delPost(postId).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
@@ -352,11 +352,11 @@ function fnRecordDelete(postId: string = '0') {
/**列表导出 */
function fnExportList() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认根据搜索条件导出xlsx表格文件吗?`,
onOk() {
const key = 'exportPost';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
exportPost(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({

View File

@@ -210,7 +210,7 @@ function fnModalOk(userIds: string[] | number[]) {
return;
}
const key = 'authUserChecked';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
authUserChecked({
checked: true,
userIds: userIds.join(','),
@@ -243,11 +243,11 @@ function fnRecordDelete(userId: string | number) {
userId = tableState.selectedRowKeys.join(',');
}
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认取消用户编号为 【${userId}】 的数据项授权?`,
onOk() {
const key = 'authUserChecked';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
authUserChecked({ checked: false, userIds: userId, roleId: roleId }).then(
res => {
if (res.code === RESULT_CODE_SUCCESS) {

View File

@@ -298,7 +298,7 @@ function fnModalVisibleByVive(roleId: string | number) {
return;
}
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
// 查询角色详细同时根据角色ID查询菜单下拉树结构
Promise.all([getRole(roleId), roleMenuTreeSelect(roleId)]).then(resArr => {
@@ -336,7 +336,7 @@ function fnModalVisibleByEdit(roleId?: string | number) {
modalState.visibleByEdit = true;
} else {
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
// 查询菜单下拉树结构
menuTreeSelect().then(res => {
@@ -354,7 +354,7 @@ function fnModalVisibleByEdit(roleId?: string | number) {
}
} else {
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
// 查询角色详细同时根据角色ID查询菜单下拉树结构
Promise.all([getRole(roleId), roleMenuTreeSelect(roleId)]).then(resArr => {
@@ -392,7 +392,7 @@ function fnModalOk() {
const from = toRaw(modalState.from);
const role = from.roleId ? updateRole(from) : addRole(from);
const key = 'role';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
role
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
@@ -499,7 +499,7 @@ function fnModalCheckStrictly(checked: boolean, type: 'menu' | 'dept') {
function fnModalOkDataScope() {
if (modalState.confirmLoading) return;
modalState.confirmLoading = true;
const hide = message.loading('请稍等...', 0);
const hide = message.loading(t('common.loading'), 0);
const fromInfo = toRaw(modalState.from);
if (fromInfo.dataScope !== '2') {
fromInfo.deptIds = [];
@@ -536,7 +536,7 @@ function fnRecordDataScope(roleId: string | number) {
return;
}
if (modalState.confirmLoading) return;
const hide = message.loading('正在打开...', 0);
const hide = message.loading(t('common.loading'), 0);
modalState.confirmLoading = true;
// 查询角色详细同时根据角色ID查询部门树结构
Promise.all([getRole(roleId), roleDeptTreeSelect(roleId)])
@@ -584,10 +584,10 @@ function fnRecordAuthUser(row: Record<string, string>) {
function fnRecordStatus(row: Record<string, string>) {
const text = row.status === '1' ? '启用' : '停用';
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确定要${text} ${row.roleName} 角色吗?`,
onOk() {
const hide = message.loading('请稍等...', 0);
const hide = message.loading(t('common.loading'), 0);
changeRoleStatus(row.roleId, row.status).then(res => {
hide();
if (res.code === RESULT_CODE_SUCCESS) {
@@ -619,11 +619,11 @@ function fnRecordDelete(roleId: string = '0') {
roleId = tableState.selectedRowKeys.join(',');
}
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认删除角色编号为 【${roleId}】 的数据项?`,
onOk() {
const key = 'delRole';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
delRole(roleId).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
@@ -647,11 +647,11 @@ function fnRecordDelete(roleId: string = '0') {
/**列表导出 */
function fnExportList() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认根据搜索条件导出xlsx表格文件吗?`,
onOk() {
const key = 'exportRole';
message.loading({ content: '请稍等...', key });
message.loading({ content: t('common.loading'), key });
exportRole(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({

View File

@@ -34,11 +34,11 @@ function fnEdit(v: boolean) {
/**提交保存 */
function fnSave() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认要提交当前变更的版权声明吗?`,
onOk() {
// 发送请求
const hide = message.loading('请稍等...', 0);
const hide = message.loading(t('common.loading'), 0);
state.loading = true;
changeValue({ key: 'sys.copyright', value: state.copyright }).then(
res => {

View File

@@ -48,11 +48,11 @@ function fnBeforeUpload(file: FileType) {
/**上传变更 */
function fnUpload(up: UploadRequestOption) {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认要上传登录界面背景文件吗?`,
onOk() {
// 发送请求
const hide = message.loading('请稍等...', 0);
const hide = message.loading(t('common.loading'), 0);
state.loading = true;
let formData = new FormData();
formData.append('file', up.file);
@@ -88,11 +88,11 @@ function fnEdit(v: boolean) {
/**提交保存 */
function fnSave() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认要提交当前变更的登录界面背景吗?`,
onOk() {
// 发送请求
const hide = message.loading('请稍等...', 0);
const hide = message.loading(t('common.loading'), 0);
state.loading = true;
changeValue({ key: 'sys.loginBackground', value: state.filePath }).then(
res => {
@@ -114,11 +114,11 @@ function fnSave() {
/**还原初始背景 */
function fnRevert() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认要将背景图还原到系统初始默认的背景吗?`,
onOk() {
// 发送请求
const hide = message.loading('请稍等...', 0);
const hide = message.loading(t('common.loading'), 0);
state.loading = true;
state.filePath = '#';
changeValue({ key: 'sys.loginBackground', value: state.filePath }).then(

View File

@@ -50,11 +50,11 @@ function fnBeforeUpload(file: FileType) {
/**上传变更 */
function fnUpload(up: UploadRequestOption) {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认要上传LOGO文件吗?`,
onOk() {
// 发送请求
const hide = message.loading('请稍等...', 0);
const hide = message.loading(t('common.loading'), 0);
state.loading = true;
let formData = new FormData();
formData.append('file', up.file);
@@ -100,7 +100,7 @@ function fnEdit(v: boolean) {
/**提交保存 */
function fnSave() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认要提交当前变更的LOGO文件吗?`,
onOk() {
const reqArr = [];
@@ -120,7 +120,7 @@ function fnSave() {
}
// 发送请求
const hide = message.loading('请稍等...', 0);
const hide = message.loading(t('common.loading'), 0);
state.loading = true;
Promise.all(reqArr).then(resArr => {
state.loading = false;

View File

@@ -34,11 +34,11 @@ function fnEdit(v: boolean) {
/**提交保存 */
function fnSave() {
Modal.confirm({
title: '提示',
title: t('common.tipTitle'),
content: `确认要提交当前变更的系统名称吗?`,
onOk() {
// 发送请求
const hide = message.loading('请稍等...', 0);
const hide = message.loading(t('common.loading'), 0);
state.loading = true;
changeValue({ key: 'sys.title', value: state.title }).then(res => {
state.loading = false;

View File

@@ -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>