feat:role

This commit is contained in:
wangzenghua 2025-04-09 10:25:06 +01:00
parent 6fbef2cbe1
commit 8f67589328
7 changed files with 194 additions and 14 deletions

View File

@ -2,7 +2,8 @@
<el-dialog
v-model="state.visible"
draggable
title="文件导入"
append-to-body
:title="title"
width="50%"
:close-on-click-modal="false"
:close-on-press-escape="false"
@ -16,7 +17,7 @@
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">将文件放在此处或单击上传</div>
<template #tip>
<div class="el-upload__tip">excel文件大小小于500kb</div>
<div class="el-upload__tip">仅允许导入xlsxlsx格式文件excel文件大小小于500kb</div>
</template>
</el-upload>
<template #footer>
@ -29,6 +30,10 @@
import { reactive, ref, shallowRef } from 'vue';
import { isEmpty } from '@/utils';
const props = defineProps({
title: {
type: String,
default: '文件导入',
},
tips: {
type: String,
default: '提示:导入前请先下载模板填写信息,然后再导入!',

View File

@ -1 +1,167 @@
import request from '@/utils/axios';
/**
* @Title: 列表
*/
export function GetEntityList(params = {}) {
return request('/system/user/list', {
method: 'GET',
params,
});
}
/**
* @Title: 新增
*/
export function AddEntity(data = {}) {
return request('/system/user', {
method: 'POST',
data,
});
}
/**
* @Title: 修改
*/
export function UpdateEntity(data = {}) {
return request('/system/user', {
method: 'PUT',
data,
});
}
/**
* @Title: 删除
*/
export function DeleteEntity(params = {}) {
return request(`/system/user/${params.id}`, {
method: 'DELETE',
});
}
/**
* @Title: 导入
*/
export function ImportEntity(data = {}) {
return request('/system/user/importData', {
method: 'POST',
headers: { 'Content-Type': 'multipart/form-data' },
data,
});
}
/**
* @Title: 导出
*/
export function ExportEntity(params = {}) {
return request('/system/user/export', {
method: 'POST',
params,
responseType: 'blob',
});
}
/**
* @Title: 状态修改
*/
export function UpdateStatus(data = {}) {
return request('/system/user/changeStatus', {
method: 'PUT',
data,
});
}
/**
* @Title: 信息
*/
export function GetUser(id) {
return request(`/system/user/${id}`, {
method: 'GET',
});
}
/**
* @Title: 用户密码重置
*/
export function ResetUserPwd(data = {}) {
return request(`/system/user/resetPwd`, {
method: 'PUT',
data,
});
}
/**
* @Title: 查询用户个人信息
*/
export function GetUserProfile() {
return request(`/system/user/profile`, {
method: 'GET',
});
}
/**
* @Title: 修改用户个人信息
*/
export function UpdateUserProfile(data = {}) {
return request(`/system/user/profile`, {
method: 'PUT',
data,
});
}
/**
* @Title: 用户密码重置
*/
export function UpdateUserPwd(data = {}) {
return request(`/system/user/profile/updatePwd`, {
method: 'PUT',
data,
});
}
/**
* @Title: 用户头像上传
*/
export function UploadAvatar(data = {}) {
return request(`/system/user/profile/avatar`, {
method: 'POST',
data,
});
}
/**
* @Title: 查询授权角色
*/
export function GetAuthRole(id) {
return request(`/system/user/authRole/${id}`, {
method: 'GET',
});
}
/**
* @Title: 保存授权角色
*/
export function UpdateAuthRole(params = {}) {
return request('/system/user/authRole', {
method: 'PUT',
params,
});
}
/**
* @Title: 查询部门
*/
export function GetDeptList() {
return request('/system/dept/list', {
method: 'GET',
});
}
/**
* @Title: 查询部门下拉树结构
*/
export function GetDeptTreeSelect() {
return request('/system/user/deptTree', {
method: 'GET',
});
}

View File

@ -20,6 +20,12 @@ export default [
name: 'system-dict',
meta: { title: '字典管理', icon: 'Document' },
},
{
path: '/sub-government-affairs-service/system-menu',
component: () => import('@/views/system/menu/index.vue'),
name: 'system-menu',
meta: { title: '菜单管理', icon: 'Document' },
},
{
path: '/sub-government-affairs-service/system-role',
component: () => import('@/views/system/role/index.vue'),
@ -34,10 +40,10 @@ export default [
hidden: true,
},
{
path: '/sub-government-affairs-service/system-menu',
component: () => import('@/views/system/menu/index.vue'),
name: 'system-menu',
meta: { title: '菜单管理', icon: 'Document' },
path: '/sub-government-affairs-service/system-user',
component: () => import('@/views/system/user/index.vue'),
name: 'system-user',
meta: { title: '用户管理', icon: 'Document' },
},
],
},

View File

@ -3,9 +3,9 @@
* @Author: zenghua.wang
* @Date: 2022-02-23 21:12:37
* @LastEditors: zenghua.wang
* @LastEditTime: 2025-04-02 14:21:56
* @LastEditTime: 2025-04-09 09:53:18
*/
import lodash from 'lodash';
import lodash, { deburr } from 'lodash';
import dayjs from 'dayjs';
import { Base64 } from 'js-base64';
@ -303,6 +303,7 @@ export const getTree = (data, id = 'id', parentId = 'parentId', children = 'chil
* @returns
*/
export const getParentIds = (treeData, targetId, id = 'id', children = 'children') => {
if (isEmpty(targetId)) return [];
const parentMap = {};
function buildParentMap(node, parentId = null) {
if (node[id]) {

View File

@ -59,7 +59,7 @@ const state = reactive({
rowKey: 'userId',
column: [
{
label: '用户名称',
label: '登录名',
prop: 'userName',
search: true,
rules: {
@ -69,7 +69,7 @@ const state = reactive({
},
},
{
label: '用户称',
label: '用户称',
prop: 'nickName',
rules: {
required: true,
@ -99,7 +99,7 @@ const state = reactive({
},
},
{
label: '手机',
label: '手机',
prop: 'phonenumber',
search: true,
rules: {
@ -111,6 +111,7 @@ const state = reactive({
{
label: '邮箱',
prop: 'email',
hide: true,
rules: {
required: true,
message: '请输入',

View File

@ -71,7 +71,7 @@ const state = reactive({
rowKey: 'userId',
column: [
{
label: '用户名称',
label: '登录名',
prop: 'userName',
search: true,
rules: {
@ -81,7 +81,7 @@ const state = reactive({
},
},
{
label: '用户称',
label: '用户称',
prop: 'nickName',
rules: {
required: true,
@ -111,7 +111,7 @@ const state = reactive({
},
},
{
label: '手机',
label: '手机',
prop: 'phonenumber',
search: true,
rules: {
@ -123,6 +123,7 @@ const state = reactive({
{
label: '邮箱',
prop: 'email',
hide: true,
rules: {
required: true,
message: '请输入',