fix: 用户管理页面
This commit is contained in:
@@ -47,7 +47,7 @@ export function exportUser(query: Record<string, any>) {
|
|||||||
*/
|
*/
|
||||||
export function listUser(query: Record<string, any>) {
|
export function listUser(query: Record<string, any>) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/list',
|
url: '/userManage/v1/users',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query,
|
params: query,
|
||||||
});
|
});
|
||||||
@@ -60,7 +60,7 @@ export function listUser(query: Record<string, any>) {
|
|||||||
*/
|
*/
|
||||||
export function getUser(userId: string | number = '0') {
|
export function getUser(userId: string | number = '0') {
|
||||||
return request({
|
return request({
|
||||||
url: `/system/user/${userId}`,
|
url: `/userManage/v1/user/${userId}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ export function getUser(userId: string | number = '0') {
|
|||||||
*/
|
*/
|
||||||
export function addUser(data: Record<string, any>) {
|
export function addUser(data: Record<string, any>) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user',
|
url: '/userManage/v1/user',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
@@ -85,7 +85,7 @@ export function addUser(data: Record<string, any>) {
|
|||||||
*/
|
*/
|
||||||
export function updateUser(data: Record<string, any>) {
|
export function updateUser(data: Record<string, any>) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user',
|
url: '/userManage/v1/user',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
@@ -98,7 +98,7 @@ export function updateUser(data: Record<string, any>) {
|
|||||||
*/
|
*/
|
||||||
export function delUser(userId: string | number) {
|
export function delUser(userId: string | number) {
|
||||||
return request({
|
return request({
|
||||||
url: `/system/user/${userId}`,
|
url: `/userManage/v1/user/${userId}`,
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ export function delUser(userId: string | number) {
|
|||||||
*/
|
*/
|
||||||
export function resetUserPwd(userId: string | number, password: string) {
|
export function resetUserPwd(userId: string | number, password: string) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/resetPwd',
|
url: '/userManage/v1/user/resetPwd',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: {
|
data: {
|
||||||
userId,
|
userId,
|
||||||
@@ -131,7 +131,7 @@ export function changeUserStatus(
|
|||||||
status: string | number
|
status: string | number
|
||||||
) {
|
) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/changeStatus',
|
url: '/userManage/v1/user/changeStatus',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: {
|
data: {
|
||||||
userId,
|
userId,
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ const useUserStore = defineStore('user', {
|
|||||||
// 登录
|
// 登录
|
||||||
async fnLogin(loginBody: Record<string, string>) {
|
async fnLogin(loginBody: Record<string, string>) {
|
||||||
const res = await login(loginBody);
|
const res = await login(loginBody);
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 1 && res.data) {
|
||||||
const token = res.data[TOKEN_RESPONSE_FIELD];
|
const token = res.data[TOKEN_RESPONSE_FIELD];
|
||||||
setToken(token);
|
setToken(token);
|
||||||
this.token = token;
|
this.token = token;
|
||||||
@@ -117,17 +117,17 @@ const useUserStore = defineStore('user', {
|
|||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
async fnGetInfo() {
|
async fnGetInfo() {
|
||||||
const res = await getInfo();
|
const res = await getInfo();
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 1 && res.data) {
|
||||||
const { user, roles, permissions } = res.data;
|
const { user, roles, permissions } = res.data;
|
||||||
// 登录账号
|
// 登录账号
|
||||||
this.userName = user.userName;
|
this.userName = user.accountId;
|
||||||
// 用户头像
|
// 用户头像
|
||||||
this.avatar = user.avatar;
|
this.avatar = user.avatar;
|
||||||
// 基础信息
|
// 基础信息
|
||||||
this.nickName = user.nickName;
|
this.nickName = user.name;
|
||||||
this.phonenumber = user.phonenumber;
|
this.phonenumber = user.phone;
|
||||||
this.email = user.email;
|
this.email = user.email;
|
||||||
this.sex = user.sex;
|
this.sex = user.gender;
|
||||||
|
|
||||||
// 验证返回的roles是否是一个非空数组
|
// 验证返回的roles是否是一个非空数组
|
||||||
if (Array.isArray(roles) && roles.length > 0) {
|
if (Array.isArray(roles) && roles.length > 0) {
|
||||||
@@ -139,14 +139,14 @@ const useUserStore = defineStore('user', {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 水印文字信息=用户昵称 手机号
|
// 水印文字信息=用户昵称 手机号
|
||||||
let waterMarkContent = this.nickName;
|
let waterMarkContent = this.userName;
|
||||||
if (this.phonenumber) {
|
if (this.phonenumber) {
|
||||||
waterMarkContent = `${this.nickName} ${this.phonenumber}`;
|
waterMarkContent = `${this.userName} ${this.phonenumber}`;
|
||||||
}
|
}
|
||||||
useLayoutStore().changeWaterMark(waterMarkContent);
|
useLayoutStore().changeWaterMark(waterMarkContent);
|
||||||
}
|
}
|
||||||
// 网络错误时退出登录状态
|
// 网络错误时退出登录状态
|
||||||
if (res.code === 500) {
|
if (res.code === 0) {
|
||||||
removeToken();
|
removeToken();
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,8 +59,6 @@ let queryParams = reactive({
|
|||||||
userName: '',
|
userName: '',
|
||||||
/**手机号 */
|
/**手机号 */
|
||||||
phonenumber: '',
|
phonenumber: '',
|
||||||
/**部门ID */
|
|
||||||
deptId: '',
|
|
||||||
/**用户状态 */
|
/**用户状态 */
|
||||||
status: undefined,
|
status: undefined,
|
||||||
/**记录开始时间 */
|
/**记录开始时间 */
|
||||||
@@ -78,7 +76,6 @@ function fnQueryReset() {
|
|||||||
queryParams = Object.assign(queryParams, {
|
queryParams = Object.assign(queryParams, {
|
||||||
userName: '',
|
userName: '',
|
||||||
phonenumber: '',
|
phonenumber: '',
|
||||||
deptId: '',
|
|
||||||
status: undefined,
|
status: undefined,
|
||||||
beginTime: '',
|
beginTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
@@ -121,43 +118,37 @@ let tableState: TabeStateType = reactive({
|
|||||||
let tableColumns: ColumnsType = [
|
let tableColumns: ColumnsType = [
|
||||||
{
|
{
|
||||||
title: '用户编号',
|
title: '用户编号',
|
||||||
dataIndex: 'userId',
|
dataIndex: 'id',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '登录账号',
|
title: '登录账号',
|
||||||
dataIndex: 'userName',
|
dataIndex: 'accountId',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '用户昵称',
|
title: '用户名',
|
||||||
dataIndex: 'nickName',
|
dataIndex: 'name',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '手机号码',
|
title: '手机号码',
|
||||||
dataIndex: 'phonenumber',
|
dataIndex: 'phone',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '部门名称',
|
title: '用户类型',
|
||||||
dataIndex: 'deptId',
|
dataIndex: 'groupName',
|
||||||
key: 'deptId',
|
key: 'groupName',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '登录地址',
|
title: '创建时间',
|
||||||
dataIndex: 'loginIp',
|
dataIndex: 'createTime',
|
||||||
key: 'loginIp',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '登录时间',
|
|
||||||
dataIndex: 'loginDate',
|
|
||||||
align: 'center',
|
align: 'center',
|
||||||
customRender(opt) {
|
customRender(opt) {
|
||||||
if (+opt.value <= 0) return '';
|
if (!opt.value) return '';
|
||||||
return parseDateToStr(+opt.value);
|
return parseDateToStr(opt.value);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -168,7 +159,7 @@ let tableColumns: ColumnsType = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'userId',
|
key: 'id',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -217,15 +208,12 @@ function fnTableSelectedRowKeys(keys: (string | number)[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type OptionsType = {
|
type OptionsType = {
|
||||||
/**岗位选择列表 */
|
|
||||||
posts: Record<string, any>[];
|
|
||||||
/**角色选择列表 */
|
/**角色选择列表 */
|
||||||
roles: Record<string, any>[];
|
roles: Record<string, any>[];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**初始用户选择列表 */
|
/**初始用户选择列表 */
|
||||||
let options: OptionsType = {
|
let options: OptionsType = {
|
||||||
posts: [],
|
|
||||||
roles: [],
|
roles: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -272,7 +260,6 @@ let modalState: ModalStateType = reactive({
|
|||||||
},
|
},
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
options: {
|
options: {
|
||||||
posts: [],
|
|
||||||
roles: [],
|
roles: [],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -334,19 +321,13 @@ function fnModalVisibleByVive(userId: string | number) {
|
|||||||
getUser(userId).then(res => {
|
getUser(userId).then(res => {
|
||||||
modalState.confirmLoading = false;
|
modalState.confirmLoading = false;
|
||||||
hide();
|
hide();
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 1 && res.data) {
|
||||||
const roles = res.data.roles.map((m: Record<string, any>) => {
|
const roles = res.data.roles.map((m: Record<string, any>) => {
|
||||||
const disabled = m.status === '0';
|
const disabled = m.status === '0';
|
||||||
Reflect.set(m, 'disabled', disabled);
|
Reflect.set(m, 'disabled', disabled);
|
||||||
return m;
|
return m;
|
||||||
});
|
});
|
||||||
const posts = res.data.posts.map((m: Record<string, any>) => {
|
|
||||||
const disabled = m.status === '0';
|
|
||||||
Reflect.set(m, 'disabled', disabled);
|
|
||||||
return m;
|
|
||||||
});
|
|
||||||
modalState.options.roles = roles;
|
modalState.options.roles = roles;
|
||||||
modalState.options.posts = posts;
|
|
||||||
const { user, roleIds, postIds } = res.data;
|
const { user, roleIds, postIds } = res.data;
|
||||||
modalState.from = Object.assign(modalState.from, user);
|
modalState.from = Object.assign(modalState.from, user);
|
||||||
modalState.from.roleIds = roleIds;
|
modalState.from.roleIds = roleIds;
|
||||||
@@ -370,7 +351,6 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
|||||||
modalStateFrom.resetFields();
|
modalStateFrom.resetFields();
|
||||||
if (options.roles.length > 0) {
|
if (options.roles.length > 0) {
|
||||||
modalState.options.roles = options.roles;
|
modalState.options.roles = options.roles;
|
||||||
modalState.options.posts = options.posts;
|
|
||||||
modalState.title = '添加用户信息';
|
modalState.title = '添加用户信息';
|
||||||
modalState.visibleByEdit = true;
|
modalState.visibleByEdit = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -381,21 +361,14 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
|||||||
getUser().then(res => {
|
getUser().then(res => {
|
||||||
modalState.confirmLoading = false;
|
modalState.confirmLoading = false;
|
||||||
hide();
|
hide();
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 1 && res.data) {
|
||||||
const roles = res.data.roles.map((m: Record<string, any>) => {
|
const roles = res.data.roles.map((m: Record<string, any>) => {
|
||||||
const disabled = m.status === '0';
|
const disabled = m.status === '0';
|
||||||
Reflect.set(m, 'disabled', disabled);
|
Reflect.set(m, 'disabled', disabled);
|
||||||
return m;
|
return m;
|
||||||
});
|
});
|
||||||
const posts = res.data.posts.map((m: Record<string, any>) => {
|
|
||||||
const disabled = m.status === '0';
|
|
||||||
Reflect.set(m, 'disabled', disabled);
|
|
||||||
return m;
|
|
||||||
});
|
|
||||||
options.roles = roles;
|
options.roles = roles;
|
||||||
options.posts = posts;
|
|
||||||
modalState.options.roles = roles;
|
modalState.options.roles = roles;
|
||||||
modalState.options.posts = posts;
|
|
||||||
const { user, roleIds, postIds } = res.data;
|
const { user, roleIds, postIds } = res.data;
|
||||||
modalState.from = Object.assign(modalState.from, user);
|
modalState.from = Object.assign(modalState.from, user);
|
||||||
modalState.from.roleIds = roleIds;
|
modalState.from.roleIds = roleIds;
|
||||||
@@ -414,19 +387,13 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
|||||||
getUser(userId).then(res => {
|
getUser(userId).then(res => {
|
||||||
modalState.confirmLoading = false;
|
modalState.confirmLoading = false;
|
||||||
hide();
|
hide();
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 1 && res.data) {
|
||||||
const roles = res.data.roles.map((m: Record<string, any>) => {
|
const roles = res.data.roles.map((m: Record<string, any>) => {
|
||||||
const disabled = m.status === '0';
|
const disabled = m.status === '0';
|
||||||
Reflect.set(m, 'disabled', disabled);
|
Reflect.set(m, 'disabled', disabled);
|
||||||
return m;
|
return m;
|
||||||
});
|
});
|
||||||
const posts = res.data.posts.map((m: Record<string, any>) => {
|
|
||||||
const disabled = m.status === '0';
|
|
||||||
Reflect.set(m, 'disabled', disabled);
|
|
||||||
return m;
|
|
||||||
});
|
|
||||||
modalState.options.roles = roles;
|
modalState.options.roles = roles;
|
||||||
modalState.options.posts = posts;
|
|
||||||
const { user, roleIds, postIds } = res.data;
|
const { user, roleIds, postIds } = res.data;
|
||||||
modalState.from = Object.assign(modalState.from, user);
|
modalState.from = Object.assign(modalState.from, user);
|
||||||
modalState.from.roleIds = roleIds;
|
modalState.from.roleIds = roleIds;
|
||||||
@@ -459,7 +426,7 @@ function fnModalOk() {
|
|||||||
message.loading({ content: '请稍等...', key });
|
message.loading({ content: '请稍等...', key });
|
||||||
user
|
user
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
message.success({
|
message.success({
|
||||||
content: `${modalState.title}成功`,
|
content: `${modalState.title}成功`,
|
||||||
key,
|
key,
|
||||||
@@ -495,7 +462,6 @@ function fnModalCancel() {
|
|||||||
modalState.visibleByResetPwd = false;
|
modalState.visibleByResetPwd = false;
|
||||||
modalStateFrom.resetFields();
|
modalStateFrom.resetFields();
|
||||||
modalState.options.roles = [];
|
modalState.options.roles = [];
|
||||||
modalState.options.posts = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -511,7 +477,7 @@ function fnModalOkResetPwd() {
|
|||||||
message.loading({ content: '请稍等...', key });
|
message.loading({ content: '请稍等...', key });
|
||||||
resetUserPwd(modalState.from.userId, modalState.from.password)
|
resetUserPwd(modalState.from.userId, modalState.from.password)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
message.success({
|
message.success({
|
||||||
content: `${modalState.title}成功`,
|
content: `${modalState.title}成功`,
|
||||||
key,
|
key,
|
||||||
@@ -561,7 +527,7 @@ function fnRecordStatus(row: Record<string, string>) {
|
|||||||
const key = 'changeUserStatus';
|
const key = 'changeUserStatus';
|
||||||
message.loading({ content: '请稍等...', key });
|
message.loading({ content: '请稍等...', key });
|
||||||
changeUserStatus(row.userId, row.status).then(res => {
|
changeUserStatus(row.userId, row.status).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
message.success({
|
message.success({
|
||||||
content: `${row.userName} ${text}成功`,
|
content: `${row.userName} ${text}成功`,
|
||||||
key: key,
|
key: key,
|
||||||
@@ -598,7 +564,7 @@ function fnRecordDelete(userId: string = '0') {
|
|||||||
const key = 'delUser';
|
const key = 'delUser';
|
||||||
message.loading({ content: '请稍等...', key });
|
message.loading({ content: '请稍等...', key });
|
||||||
delUser(userId).then(res => {
|
delUser(userId).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
message.success({
|
message.success({
|
||||||
content: `删除成功`,
|
content: `删除成功`,
|
||||||
key,
|
key,
|
||||||
@@ -626,7 +592,7 @@ function fnExportList() {
|
|||||||
const key = 'exportUser';
|
const key = 'exportUser';
|
||||||
message.loading({ content: '请稍等...', key });
|
message.loading({ content: '请稍等...', key });
|
||||||
exportUser(toRaw(queryParams)).then(res => {
|
exportUser(toRaw(queryParams)).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
message.success({
|
message.success({
|
||||||
content: `已完成导出`,
|
content: `已完成导出`,
|
||||||
key,
|
key,
|
||||||
@@ -684,7 +650,7 @@ function fnModalUploadXlsxImportExportTemplate() {
|
|||||||
const hide = message.loading('正在下载...', 0);
|
const hide = message.loading('正在下载...', 0);
|
||||||
importTemplate()
|
importTemplate()
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 1) {
|
||||||
message.success({
|
message.success({
|
||||||
content: `成功读取并下载导入模板`,
|
content: `成功读取并下载导入模板`,
|
||||||
duration: 2,
|
duration: 2,
|
||||||
@@ -710,7 +676,7 @@ function fnGetList() {
|
|||||||
queryParams.beginTime = queryRangePicker.value[0];
|
queryParams.beginTime = queryRangePicker.value[0];
|
||||||
queryParams.endTime = queryRangePicker.value[1];
|
queryParams.endTime = queryRangePicker.value[1];
|
||||||
listUser(toRaw(queryParams)).then(res => {
|
listUser(toRaw(queryParams)).then(res => {
|
||||||
if (res.code === 200 && Array.isArray(res.rows)) {
|
if (res.code === 1 && Array.isArray(res.rows)) {
|
||||||
// 取消勾选
|
// 取消勾选
|
||||||
if (tableState.selectedRowKeys.length > 0) {
|
if (tableState.selectedRowKeys.length > 0) {
|
||||||
tableState.selectedRowKeys = [];
|
tableState.selectedRowKeys = [];
|
||||||
@@ -729,7 +695,7 @@ let deptTreeData = ref<DataNode[]>([]);
|
|||||||
function fnGetDeptTree() {
|
function fnGetDeptTree() {
|
||||||
if (deptTreeData.value.length > 0) return;
|
if (deptTreeData.value.length > 0) return;
|
||||||
deptTreeSelect().then(res => {
|
deptTreeSelect().then(res => {
|
||||||
if (res.code === 200 && Array.isArray(res.data)) {
|
if (res.code === 1 && Array.isArray(res.data)) {
|
||||||
deptTreeData.value = res.data;
|
deptTreeData.value = res.data;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -768,43 +734,6 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<!-- 表格搜索栏 -->
|
<!-- 表格搜索栏 -->
|
||||||
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
<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-tree-select
|
|
||||||
v-model:value="queryParams.deptId"
|
|
||||||
placeholder="部门名称"
|
|
||||||
show-search
|
|
||||||
tree-default-expand-all
|
|
||||||
:tree-data="deptTreeData"
|
|
||||||
:field-names="{
|
|
||||||
children: 'children',
|
|
||||||
label: 'label',
|
|
||||||
value: 'id',
|
|
||||||
}"
|
|
||||||
tree-node-label-prop="label"
|
|
||||||
tree-node-filter-prop="label"
|
|
||||||
style="width: 100%"
|
|
||||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
|
||||||
>
|
|
||||||
</a-tree-select>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :lg="6" :md="12" :xs="24">
|
|
||||||
<a-form-item>
|
|
||||||
<a-space :size="8">
|
|
||||||
<a-button type="primary" @click.prevent="fnGetList">
|
|
||||||
<template #icon><SearchOutlined /></template>
|
|
||||||
搜索
|
|
||||||
</a-button>
|
|
||||||
<a-button type="default" @click.prevent="fnQueryReset">
|
|
||||||
<template #icon><ClearOutlined /></template>
|
|
||||||
重置
|
|
||||||
</a-button>
|
|
||||||
</a-space>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col :lg="6" :md="12" :xs="24">
|
<a-col :lg="6" :md="12" :xs="24">
|
||||||
<a-form-item label="登录账号" name="userName">
|
<a-form-item label="登录账号" name="userName">
|
||||||
@@ -816,16 +745,6 @@ onMounted(() => {
|
|||||||
></a-input>
|
></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="6" :md="12" :xs="24">
|
|
||||||
<a-form-item label="手机号码" 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-col :lg="4" :md="12" :xs="24">
|
||||||
<a-form-item label="用户状态" name="status">
|
<a-form-item label="用户状态" name="status">
|
||||||
<a-select
|
<a-select
|
||||||
@@ -837,16 +756,18 @@ onMounted(() => {
|
|||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="8" :md="12" :xs="24">
|
<a-col :lg="6" :md="12" :xs="24">
|
||||||
<a-form-item label="登录时间" name="queryRangePicker">
|
<a-form-item>
|
||||||
<a-range-picker
|
<a-space :size="8">
|
||||||
v-model:value="queryRangePicker"
|
<a-button type="primary" @click.prevent="fnGetList">
|
||||||
allow-clear
|
<template #icon><SearchOutlined /></template>
|
||||||
bordered
|
搜索
|
||||||
value-format="YYYY-MM-DD"
|
</a-button>
|
||||||
:placeholder="['登录开始', '登录结束']"
|
<a-button type="default" @click.prevent="fnQueryReset">
|
||||||
style="width: 100%"
|
<template #icon><ClearOutlined /></template>
|
||||||
></a-range-picker>
|
重置
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@@ -875,7 +796,7 @@ onMounted(() => {
|
|||||||
<template #icon><DeleteOutlined /></template>
|
<template #icon><DeleteOutlined /></template>
|
||||||
删除
|
删除
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button
|
<!-- <a-button
|
||||||
type="dashed"
|
type="dashed"
|
||||||
@click.prevent="fnModalUploadXlsxImportOpen()"
|
@click.prevent="fnModalUploadXlsxImportOpen()"
|
||||||
v-perms:has="['system:user:import']"
|
v-perms:has="['system:user:import']"
|
||||||
@@ -890,7 +811,7 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<template #icon><ExportOutlined /></template>
|
<template #icon><ExportOutlined /></template>
|
||||||
导出
|
导出
|
||||||
</a-button>
|
</a-button> -->
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -945,7 +866,7 @@ onMounted(() => {
|
|||||||
<!-- 表格列表 -->
|
<!-- 表格列表 -->
|
||||||
<a-table
|
<a-table
|
||||||
class="table"
|
class="table"
|
||||||
row-key="userId"
|
row-key="id"
|
||||||
:columns="tableColumns"
|
:columns="tableColumns"
|
||||||
:loading="tableState.loading"
|
:loading="tableState.loading"
|
||||||
:data-source="tableState.data"
|
:data-source="tableState.data"
|
||||||
@@ -959,10 +880,10 @@ onMounted(() => {
|
|||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'deptId'">
|
<!-- <template v-if="column.key === 'deptId'">
|
||||||
{{ record.dept?.deptName }}
|
{{ record.dept?.deptName }}
|
||||||
</template>
|
</template> -->
|
||||||
<template v-if="column.key === 'status'">
|
<!-- <template v-if="column.key === 'status'">
|
||||||
<a-switch
|
<a-switch
|
||||||
v-if="record.userId !== '1'"
|
v-if="record.userId !== '1'"
|
||||||
v-perms:has="['system:user:edit']"
|
v-perms:has="['system:user:edit']"
|
||||||
@@ -979,14 +900,14 @@ onMounted(() => {
|
|||||||
:options="dict.sysNormalDisable"
|
:options="dict.sysNormalDisable"
|
||||||
:value="record.status"
|
:value="record.status"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template> -->
|
||||||
<template v-if="column.key === 'userId'">
|
<template v-if="column.key === 'id'">
|
||||||
<a-space :size="8" align="center" v-if="record.userId !== '1'">
|
<a-space :size="8" align="center" v-if="record.id !== '1'">
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template #title>查看详情</template>
|
<template #title>查看详情</template>
|
||||||
<a-button
|
<a-button
|
||||||
type="link"
|
type="link"
|
||||||
@click.prevent="fnModalVisibleByVive(record.userId)"
|
@click.prevent="fnModalVisibleByVive(record.id)"
|
||||||
v-perms:has="['system:user:query']"
|
v-perms:has="['system:user:query']"
|
||||||
>
|
>
|
||||||
<template #icon><ProfileOutlined /></template>
|
<template #icon><ProfileOutlined /></template>
|
||||||
@@ -996,7 +917,7 @@ onMounted(() => {
|
|||||||
<template #title>编辑</template>
|
<template #title>编辑</template>
|
||||||
<a-button
|
<a-button
|
||||||
type="link"
|
type="link"
|
||||||
@click.prevent="fnModalVisibleByEdit(record.userId)"
|
@click.prevent="fnModalVisibleByEdit(record.id)"
|
||||||
v-perms:has="['system:user:edit']"
|
v-perms:has="['system:user:edit']"
|
||||||
>
|
>
|
||||||
<template #icon><FormOutlined /></template>
|
<template #icon><FormOutlined /></template>
|
||||||
@@ -1006,13 +927,13 @@ onMounted(() => {
|
|||||||
<template #title>删除</template>
|
<template #title>删除</template>
|
||||||
<a-button
|
<a-button
|
||||||
type="link"
|
type="link"
|
||||||
@click.prevent="fnRecordDelete(record.userId)"
|
@click.prevent="fnRecordDelete(record.id)"
|
||||||
v-perms:has="['system:user:remove']"
|
v-perms:has="['system:user:remove']"
|
||||||
>
|
>
|
||||||
<template #icon><DeleteOutlined /></template>
|
<template #icon><DeleteOutlined /></template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<a-tooltip>
|
<!-- <a-tooltip>
|
||||||
<template #title>重置密码</template>
|
<template #title>重置密码</template>
|
||||||
<a-button
|
<a-button
|
||||||
type="link"
|
type="link"
|
||||||
@@ -1021,7 +942,7 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<template #icon><SecurityScanOutlined /></template>
|
<template #icon><SecurityScanOutlined /></template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-tooltip>
|
</a-tooltip> -->
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@@ -1138,21 +1059,7 @@ onMounted(() => {
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
<a-col :lg="24" :md="24" :xs="24">
|
||||||
<a-form-item label="用户岗位" name="postIds">
|
|
||||||
<a-select
|
|
||||||
:value="modalState.from.postIds"
|
|
||||||
disabled
|
|
||||||
mode="multiple"
|
|
||||||
placeholder="请选择用户岗位"
|
|
||||||
option-label-prop="postName"
|
|
||||||
:options="modalState.options.posts"
|
|
||||||
:field-names="{ label: 'postName', value: 'postId' }"
|
|
||||||
>
|
|
||||||
</a-select>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
|
||||||
<a-form-item label="用户角色" name="roleIds">
|
<a-form-item label="用户角色" name="roleIds">
|
||||||
<a-select
|
<a-select
|
||||||
:value="modalState.from.roleIds"
|
:value="modalState.from.roleIds"
|
||||||
@@ -1318,23 +1225,7 @@ onMounted(() => {
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
<a-col :lg="24" :md="24" :xs="24">
|
||||||
<a-form-item label="用户岗位" 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"
|
|
||||||
:options="modalState.options.posts"
|
|
||||||
:field-names="{ label: 'postName', value: 'postId' }"
|
|
||||||
>
|
|
||||||
</a-select>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :lg="12" :md="12" :xs="24">
|
|
||||||
<a-form-item label="用户角色" name="roleIds">
|
<a-form-item label="用户角色" name="roleIds">
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="modalState.from.roleIds"
|
v-model:value="modalState.from.roleIds"
|
||||||
@@ -1411,14 +1302,14 @@ onMounted(() => {
|
|||||||
</a-modal>
|
</a-modal>
|
||||||
|
|
||||||
<!-- 上传导入表格数据文件框 -->
|
<!-- 上传导入表格数据文件框 -->
|
||||||
<UploadXlsxImport
|
<!-- <UploadXlsxImport
|
||||||
:title="modalUploadXlsxImportState.title"
|
:title="modalUploadXlsxImportState.title"
|
||||||
v-model:visible="modalUploadXlsxImportState.visible"
|
v-model:visible="modalUploadXlsxImportState.visible"
|
||||||
:show-update-support="true"
|
:show-update-support="true"
|
||||||
:upload-file-method="importData"
|
:upload-file-method="importData"
|
||||||
:download-template-method="fnModalUploadXlsxImportExportTemplate"
|
:download-template-method="fnModalUploadXlsxImportExportTemplate"
|
||||||
@close="fnModalUploadXlsxImportClose"
|
@close="fnModalUploadXlsxImportClose"
|
||||||
/>
|
/> -->
|
||||||
</PageContainer>
|
</PageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user