diff --git a/src/api/role/index.ts b/src/api/role/index.ts index f900a7d0a981628e460630eb4635d600327ff90c..68ab349b1da41d2ef43f9e05256d47a26d05ab39 100644 --- a/src/api/role/index.ts +++ b/src/api/role/index.ts @@ -65,7 +65,7 @@ export function updateRoleMenus( * * @param id */ -export function getRoleFormDetail(id: number): AxiosPromise { +export function getRoleDetail(id: number): AxiosPromise { return request({ url: '/api/v1/roles/' + id, method: 'get' diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index edf882891e6d22c2b38e13478256171cc2195f91..887f0366a7aef525353fa43cf095064f7b012ef3 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -9,7 +9,7 @@ import { onMounted, reactive, ref, toRefs } from 'vue'; import { listRolePages, updateRole, - getRoleFormDetail, + getRoleDetail, addRole, deleteRoles, getRoleMenuIds, @@ -49,10 +49,8 @@ const state = reactive({ }, menuDialogVisible: false, resourceOptions: [] as OptionType[], - btnPerms: {} as any, // 勾选的菜单ID checkedMenuIds: new Set([]), - allPermIds: [] as string[], // 选中的角色 checkedRole: { id: '', @@ -78,12 +76,11 @@ const { * 查询 */ function handleQuery() { - emit('roleClick', {}); - state.loading = true; + loading.value = true; listRolePages(state.queryParams).then(({ data }) => { - state.roleList = data.list; - state.total = data.total; - state.loading = false; + roleList.value = data.list; + total.value = data.total; + loading.value = false; }); } /** @@ -115,8 +112,8 @@ function handleUpdate(row: any) { visible: true }; const roleId = row.id || state.ids; - getRoleFormDetail(roleId).then(({ data }) => { - state.formData = data; + getRoleDetail(roleId).then(({ data }) => { + formData.value = data; }); } @@ -230,7 +227,7 @@ onMounted(() => {