docs: update readme

Signed-off-by: yovinchen <gzh298255@gmail.com>
This commit is contained in:
yovinchen 2023-06-10 10:40:28 +08:00
parent 535a5dd1b5
commit 6de594bebc
5 changed files with 132 additions and 16 deletions

69
src/api/system/sysMenu.js Normal file
View File

@ -0,0 +1,69 @@
import request from '@/utils/request'
/**
* 菜单管理相关的API请求函数
*
* @type {string}
*/
const api_name = '/admin/system/sysMenu'
export default {
/**
* 获取权限(菜单/功能)列表
*
* @returns {AxiosPromise}
*/
findNodes() {
return request({
url: `${api_name}/findNodes`,
method: 'get'
})
},
/**
* 删除一个权限项
*
* @param id
* @returns {AxiosPromise}
*/
removeById(id) {
return request({
url: `${api_name}/remove/${id}`,
method: 'delete'
})
},
/**
* 保存一个权限项
*
* @param sysMenu
* @returns {AxiosPromise}
*/
save(sysMenu) {
return request({
url: `${api_name}/save`,
method: 'post',
data: sysMenu
})
},
/**
* 更新一个权限项
*
* @param sysMenu
* @returns {AxiosPromise}
*/
updateById(sysMenu) {
return request({
url: `${api_name}/update`,
method: 'put',
data: sysMenu
})
}
}

View File

@ -1,8 +1,10 @@
/*
角色管理相关的API请求函数
*/
import request from '@/utils/request'
/**
* 角色管理相关的API请求函数
*
* @type {string}
*/
const api_name = '/admin/system/sysRole'
export default {

View File

@ -1,9 +1,21 @@
import request from '@/utils/request'
/**
* 用户管理相关的API请求函数
*
* @type {string}
*/
const api_name = '/admin/system/sysUser'
export default {
/**
* 用户条件分页查询
*
* @param page
* @param limit
* @param searchObj
* @returns {AxiosPromise}
*/
getPageList(page, limit, searchObj) {
return request({
url: `${api_name}/${page}/${limit}`,
@ -11,13 +23,24 @@ export default {
params: searchObj // url查询字符串或表单键值对
})
},
/**
* 获取用户
*
* @param id
* @returns {AxiosPromise}
*/
getById(id) {
return request({
url: `${api_name}/get/${id}`,
method: 'get'
})
},
/**
* 保存用户
*
* @param role
* @returns {AxiosPromise}
*/
save(role) {
return request({
url: `${api_name}/save`,
@ -25,7 +48,12 @@ export default {
data: role
})
},
/**
* 更新用户
*
* @param role
* @returns {AxiosPromise}
*/
updateById(role) {
return request({
url: `${api_name}/update`,
@ -33,13 +61,25 @@ export default {
data: role
})
},
/**
* 删除用户
*
* @param id
* @returns {AxiosPromise}
*/
removeById(id) {
return request({
url: `${api_name}/remove/${id}`,
method: 'delete'
})
},
/**
* 更新用户状态
*
* @param id
* @param status
* @returns {AxiosPromise}
*/
updateStatus(id, status) {
return request({
url: `${api_name}/updateStatus/${id}/${status}`,

View File

@ -78,6 +78,15 @@ export const constantRoutes = [
title: '角色管理',
icon: 'el-icon-s-help'
}
},
{
name: 'sysMenu',
path: 'sysMenu',
component: () => import('@/views/system/sysMenu/list'),
meta: {
title: '菜单管理',
icon: 'el-icon-s-unfold'
}
}
]
},

View File

@ -27,15 +27,14 @@
<el-button :loading="loading" icon="el-icon-search" size="mini" type="primary" @click="fetchData()">搜索
</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetData">重置</el-button>
<!-- 工具条 -->
<!-- <div class="tools-div">-->
<el-button icon="el-icon-plus" size="mini" type="success" @click="add"> </el-button>
<!-- </div>-->
</el-row>
</el-form>
</div>
<!-- 工具条 -->
<div class="tools-div">
<el-button icon="el-icon-plus" size="mini" type="success" @click="add"> </el-button>
</div>
<!-- 列表 -->
<el-table
v-loading="listLoading"
@ -67,10 +66,7 @@
</el-table-column>
<el-table-column label="状态" width="80">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status === 1"
@change="switchStatus(scope.row)"
/>
<el-switch v-model="scope.row.status === 1" @change="switchStatus(scope.row)" />
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createTime" width="160" />