Skip to content

Commit 581b301

Browse files
author
puhui999
committed
update: 修复角色管理系列问题,解决页面打不开按钮功能失效等问题!!
1 parent e08dcc9 commit 581b301

File tree

5 files changed

+20
-15
lines changed

5 files changed

+20
-15
lines changed

src/api/system/role/index.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface UpdateStatusReqVO {
2323
}
2424

2525
// 查询角色列表
26-
export const getRolePageApi = async (params: RolePageReqVO) => {
26+
export const getRolePage = async (params: RolePageReqVO) => {
2727
return await request.get({ url: '/system/role/page', params })
2828
}
2929

@@ -33,26 +33,33 @@ export const getSimpleRoleList = async (): Promise<RoleVO[]> => {
3333
}
3434

3535
// 查询角色详情
36-
export const getRoleApi = async (id: number) => {
36+
export const getRole = async (id: number) => {
3737
return await request.get({ url: '/system/role/get?id=' + id })
3838
}
3939

4040
// 新增角色
41-
export const createRoleApi = async (data: RoleVO) => {
41+
export const createRole = async (data: RoleVO) => {
4242
return await request.post({ url: '/system/role/create', data })
4343
}
4444

4545
// 修改角色
46-
export const updateRoleApi = async (data: RoleVO) => {
46+
export const updateRole = async (data: RoleVO) => {
4747
return await request.put({ url: '/system/role/update', data })
4848
}
4949

5050
// 修改角色状态
51-
export const updateRoleStatusApi = async (data: UpdateStatusReqVO) => {
51+
export const updateRoleStatus = async (data: UpdateStatusReqVO) => {
5252
return await request.put({ url: '/system/role/update-status', data })
5353
}
5454

5555
// 删除角色
56-
export const deleteRoleApi = async (id: number) => {
56+
export const deleteRole = async (id: number) => {
5757
return await request.delete({ url: '/system/role/delete?id=' + id })
5858
}
59+
// 导出角色
60+
export const exportRole = (params) => {
61+
return request.download({
62+
url: '/system/role/export-excel',
63+
params
64+
})
65+
}

src/types/auto-components.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ declare module '@vue/runtime-core' {
5252
ElForm: typeof import('element-plus/es')['ElForm']
5353
ElFormItem: typeof import('element-plus/es')['ElFormItem']
5454
ElIcon: typeof import('element-plus/es')['ElIcon']
55-
ElImage: typeof import('element-plus/es')['ElImage']
5655
ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
5756
ElInput: typeof import('element-plus/es')['ElInput']
5857
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
@@ -100,7 +99,6 @@ declare module '@vue/runtime-core' {
10099
ScriptTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue')['default']
101100
Search: typeof import('./../components/Search/src/Search.vue')['default']
102101
SignalAndMessage: typeof import('./../components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue')['default']
103-
Src: typeof import('./../components/RightToolbar/src/index.vue')['default']
104102
Sticky: typeof import('./../components/Sticky/src/Sticky.vue')['default']
105103
Table: typeof import('./../components/Table/src/Table.vue')['default']
106104
Tooltip: typeof import('./../components/Tooltip/src/Tooltip.vue')['default']

src/views/system/role/MenuPermissionForm.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ import type { FormExpose } from '@/components/Form'
9696
import { handleTree, defaultProps } from '@/utils/tree'
9797
import { SystemDataScopeEnum } from '@/utils/constants'
9898
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
99-
import { listSimpleMenusApi } from '@/api/system/menu'
100-
import { listSimpleDeptApi } from '@/api/system/dept'
99+
import * as MenuApi from '@/api/system/menu'
100+
import * as DeptApi from '@/api/system/dept'
101101
import * as PermissionApi from '@/api/system/permission'
102102
// ========== CRUD 相关 ==========
103103
const actionLoading = ref(false) // 遮罩层
@@ -131,7 +131,7 @@ const openModal = async (type: string, row: RoleApi.RoleVO) => {
131131
actionScopeType.value = type
132132
dialogScopeVisible.value = true
133133
if (type === 'menu') {
134-
const menuRes = await listSimpleMenusApi()
134+
const menuRes = await MenuApi.getSimpleMenusList()
135135
treeOptions.value = handleTree(menuRes)
136136
const role = await PermissionApi.listRoleMenusApi(row.id)
137137
if (role) {
@@ -140,7 +140,7 @@ const openModal = async (type: string, row: RoleApi.RoleVO) => {
140140
})
141141
}
142142
} else if (type === 'data') {
143-
const deptRes = await listSimpleDeptApi()
143+
const deptRes = await DeptApi.getSimpleDeptList()
144144
treeOptions.value = handleTree(deptRes)
145145
const role = await RoleApi.getRole(row.id)
146146
dataScopeForm.dataScope = role.dataScope

src/views/system/role/RoleForm.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@
4444
<script setup lang="ts">
4545
import { getDictOptions } from '@/utils/dict'
4646
import { CommonStatusEnum } from '@/utils/constants'
47-
import type { FormExpose } from '@/components/Form'
4847
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
4948
import * as RoleApi from '@/api/system/role'
5049
// ========== CRUD 相关 ==========
5150
const dialogTitle = ref('edit') // 弹出层标题
52-
const formRef = ref<FormExpose>() // 表单 Ref
51+
const formRef = ref() // 表单 Ref
5352
const { t } = useI18n() // 国际化
5453
const dataScopeDictDatas = ref()
5554
const message = useMessage() // 消息弹窗
@@ -97,6 +96,7 @@ const resetForm = () => {
9796
formData.value = {
9897
id: undefined,
9998
name: '',
99+
type: '',
100100
code: '',
101101
sort: undefined,
102102
status: CommonStatusEnum.ENABLE,

src/views/system/role/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ const handleExport = async () => {
228228
await message.exportConfirm()
229229
// 发起导出
230230
exportLoading.value = true
231-
const data = await RoleApi.exportPostApi(queryParams)
231+
const data = await RoleApi.exportRole(queryParams)
232232
download.excel(data, '角色列表.xls')
233233
} catch {
234234
} finally {

0 commit comments

Comments
 (0)