Revert assign role in same dialog
This commit is contained in:
@@ -22,8 +22,7 @@
|
|||||||
:display-value="canSharedUserFilter?`${canSharedUserFilter.fullName} (${canSharedUserFilter.email})`:''">
|
:display-value="canSharedUserFilter?`${canSharedUserFilter.fullName} (${canSharedUserFilter.email})`:''">
|
||||||
|
|
||||||
<template v-slot:after>
|
<template v-slot:after>
|
||||||
<!-- <q-select class="q-mr-sm" v-model="canSharedRole" :options="roleOptions" /> -->
|
<q-btn :disable="!canSharedUserFilter" :loading="addLoading" label="付与" color="primary" @click="shareTo(canSharedUserFilter as IUserDisplay)" />
|
||||||
<q-btn :disable="!canSharedUserFilter" :loading="addLoading" label="付与" color="primary" @click="shareTo(canSharedUserFilter as IUserDisplayWithShareRole)" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:option="scope">
|
<template v-slot:option="scope">
|
||||||
@@ -36,13 +35,7 @@
|
|||||||
</q-select>
|
</q-select>
|
||||||
<sharing-user-list class="q-mt-md" style="height: 330px" :users="sharedUsers" :loading="loading" title="ドメイン利用権限を持つユーザー">
|
<sharing-user-list class="q-mt-md" style="height: 330px" :users="sharedUsers" :loading="loading" title="ドメイン利用権限を持つユーザー">
|
||||||
<template v-slot:actions="{ row }">
|
<template v-slot:actions="{ row }">
|
||||||
<div class="row no-wrap justify-end items-center">
|
<q-btn title="解除" flat color="primary" padding="xs" size="1em" :loading="row.id == removingUser?.id" icon="person_off" @click="removeShareTo(row)" />
|
||||||
<!-- <q-select class="col-auto" :options="roleOptions" emit-value map-options v-model="row.role" borderless dense options-dense hide-bottom-space
|
|
||||||
@update:model-value="updateSharedRole(row, $event)"/> -->
|
|
||||||
<div class="col-auto">
|
|
||||||
<q-btn round title="解除" flat color="primary" padding="xs" size="1em" :loading="row.id == removingUser?.id" icon="person_off" @click="removeShareTo(row)" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</sharing-user-list>
|
</sharing-user-list>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
@@ -91,11 +84,6 @@ const sharedUsersIdSet = new Set<number>();
|
|||||||
const canSharedUsers = ref<IUserDisplayWithShareRole[]>([]);
|
const canSharedUsers = ref<IUserDisplayWithShareRole[]>([]);
|
||||||
const canSharedUserFilter = ref<IUserDisplayWithShareRole>();
|
const canSharedUserFilter = ref<IUserDisplayWithShareRole>();
|
||||||
const canSharedUserFilteredOptions = ref<IUserDisplayWithShareRole[]>([]);
|
const canSharedUserFilteredOptions = ref<IUserDisplayWithShareRole[]>([]);
|
||||||
const roleOptions = [
|
|
||||||
{ value: 0, label: '利用者' },
|
|
||||||
{ value: 1, label: '管理者' },
|
|
||||||
]
|
|
||||||
const canSharedRole = ref<{value: number, label: string}>(roleOptions[0]);
|
|
||||||
|
|
||||||
const filterFn = (val:string, update: (cb: () => void) => void) => {
|
const filterFn = (val:string, update: (cb: () => void) => void) => {
|
||||||
update(() => {
|
update(() => {
|
||||||
@@ -115,7 +103,6 @@ watch(
|
|||||||
visible.value = newValue;
|
visible.value = newValue;
|
||||||
sharedUsers.value = [];
|
sharedUsers.value = [];
|
||||||
canSharedUserFilter.value = undefined
|
canSharedUserFilter.value = undefined
|
||||||
canSharedRole.value = roleOptions[0];
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
addLoading.value = false;
|
addLoading.value = false;
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
@@ -166,7 +153,6 @@ const shareTo = async (user: IUserDisplayWithShareRole) => {
|
|||||||
})
|
})
|
||||||
await loadShared();
|
await loadShared();
|
||||||
canSharedUserFilter.value = undefined;
|
canSharedUserFilter.value = undefined;
|
||||||
canSharedRole.value = roleOptions[0];
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
addLoading.value = false;
|
addLoading.value = false;
|
||||||
}
|
}
|
||||||
@@ -180,25 +166,6 @@ const removeShareTo = async (user: IUserDisplayWithShareRole) => {
|
|||||||
removingUser.value = undefined;
|
removingUser.value = undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateSharedRole = async (user: IUserDisplayWithShareRole, role: number) => {
|
|
||||||
Dialog.create({
|
|
||||||
message: roleOptions[role].label + 'に切り替えますか?',
|
|
||||||
persistent: true,
|
|
||||||
ok: {
|
|
||||||
color: 'primary',
|
|
||||||
label: 'はい'
|
|
||||||
},
|
|
||||||
cancel: 'いいえ',
|
|
||||||
}).onCancel(() => {
|
|
||||||
user.role = role == 0 ? 1 : 0;
|
|
||||||
}).onOk(async () => {
|
|
||||||
loading.value = true;
|
|
||||||
// TODO
|
|
||||||
// await
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const loadShared = async () => {
|
const loadShared = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
sharedUsersIdSet.clear();
|
sharedUsersIdSet.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user