diff --git a/frontend/src/boot/axios.ts b/frontend/src/boot/axios.ts index 8548a4d..9627c21 100644 --- a/frontend/src/boot/axios.ts +++ b/frontend/src/boot/axios.ts @@ -1,6 +1,7 @@ import { boot } from 'quasar/wrappers'; -import axios, { AxiosInstance } from 'axios'; +import axios, { AxiosInstance, AxiosResponse } from 'axios'; import {router} from 'src/router'; +import { IResponse } from 'src/types/BaseTypes'; declare module '@vue/runtime-core' { diff --git a/frontend/src/pages/RoleManagement.vue b/frontend/src/pages/RoleManagement.vue index ab7ecfe..ab5352c 100644 --- a/frontend/src/pages/RoleManagement.vue +++ b/frontend/src/pages/RoleManagement.vue @@ -14,7 +14,7 @@ 読み込み中... - + {{ item.label }} @@ -28,7 +28,7 @@ :pagination="pagination" > - + @@ -153,7 +153,12 @@ const roleClicked = async (role) => { selected.value = role; } -const rows = computed(() => allRows.value.filter((item) => item.roles?.includes(selected.value.id) )); +const rows = computed(() => allRows.value.filter((item) => { + if (selected.value.id == -2) { + return !item.roles || item.roles.length == 0; + } + return item.roles?.includes(selected.value.id); +})); const rowIds = computed(() => new Set(rows.value?.map((item) => item.id))); const getUsers = async (filter = () => true) => { @@ -170,7 +175,7 @@ const getRoles = async () => { const result = await api.get(`api/v1/roles`); roles.value = result.data.data.map((item) => { return { id: item.id, label: item.description } - }) + }).concat({ id: -2, label: 'ロールなし' }) selected.value = roles.value[0]; } diff --git a/frontend/src/pages/UserManagement.vue b/frontend/src/pages/UserManagement.vue index bd0a517..da9ff83 100644 --- a/frontend/src/pages/UserManagement.vue +++ b/frontend/src/pages/UserManagement.vue @@ -35,9 +35,9 @@ - - {{ props.row.roles.map(r => r.description).join('、') }} + {{ (props.row as IUserRolesDisplay).roles.map(r => r.name).join('、') }} @@ -46,7 +46,7 @@ {{ p.col.label }} - @@ -186,9 +186,13 @@