refactor: agencies role check
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s
This commit is contained in:
parent
2d7b0189ee
commit
5e76c4d50d
2 changed files with 8 additions and 2 deletions
|
|
@ -62,6 +62,7 @@ const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
isEdit?: boolean;
|
isEdit?: boolean;
|
||||||
|
hideAction?: boolean;
|
||||||
|
|
||||||
dataId?: string;
|
dataId?: string;
|
||||||
}>(),
|
}>(),
|
||||||
|
|
@ -411,6 +412,7 @@ watch(
|
||||||
:prefix="data.name"
|
:prefix="data.name"
|
||||||
hide-fade
|
hide-fade
|
||||||
use-toggle
|
use-toggle
|
||||||
|
:readonly="hideAction"
|
||||||
:active="data.status !== 'INACTIVE'"
|
:active="data.status !== 'INACTIVE'"
|
||||||
:toggle-title="$t('status.title')"
|
:toggle-title="$t('status.title')"
|
||||||
:icon="'ph-building-office'"
|
:icon="'ph-building-office'"
|
||||||
|
|
@ -450,7 +452,7 @@ watch(
|
||||||
style="position: absolute; z-index: 999; top: 0; right: 0"
|
style="position: absolute; z-index: 999; top: 0; right: 0"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="data.status !== 'INACTIVE'"
|
v-if="data.status !== 'INACTIVE' && !hideAction"
|
||||||
class="surface-1 row rounded"
|
class="surface-1 row rounded"
|
||||||
>
|
>
|
||||||
<UndoButton
|
<UndoButton
|
||||||
|
|
@ -597,6 +599,7 @@ watch(
|
||||||
v-model:on-create-data-list="imageListOnCreate"
|
v-model:on-create-data-list="imageListOnCreate"
|
||||||
v-model:image-url="imageState.imageUrl"
|
v-model:image-url="imageState.imageUrl"
|
||||||
v-model:data-list="imageList"
|
v-model:data-list="imageList"
|
||||||
|
:changeDisabled="hideAction"
|
||||||
:on-create="model"
|
:on-create="model"
|
||||||
:hiddenFooter="!imageState.isImageEdit"
|
:hiddenFooter="!imageState.isImageEdit"
|
||||||
@add-image="addImage"
|
@add-image="addImage"
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { Icon } from '@iconify/vue/dist/iconify.js';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
|
||||||
import { baseUrl } from 'src/stores/utils';
|
import { baseUrl, canAccess } from 'src/stores/utils';
|
||||||
import { useNavigator } from 'src/stores/navigator';
|
import { useNavigator } from 'src/stores/navigator';
|
||||||
import { useInstitution } from 'src/stores/institution';
|
import { useInstitution } from 'src/stores/institution';
|
||||||
import { Institution, InstitutionPayload } from 'src/stores/institution/types';
|
import { Institution, InstitutionPayload } from 'src/stores/institution/types';
|
||||||
|
|
@ -750,6 +750,7 @@ watch(
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<KebabAction
|
<KebabAction
|
||||||
|
v-if="canAccess('agencies', 'edit')"
|
||||||
:id-name="props.row.name"
|
:id-name="props.row.name"
|
||||||
:status="props.row.status"
|
:status="props.row.status"
|
||||||
@view="
|
@view="
|
||||||
|
|
@ -833,6 +834,7 @@ watch(
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
<KebabAction
|
<KebabAction
|
||||||
|
v-if="canAccess('agencies', 'edit')"
|
||||||
:id-name="props.row.id"
|
:id-name="props.row.id"
|
||||||
:status="props.row.status"
|
:status="props.row.status"
|
||||||
@view="
|
@view="
|
||||||
|
|
@ -973,6 +975,7 @@ watch(
|
||||||
@change-status="triggerChangeStatus"
|
@change-status="triggerChangeStatus"
|
||||||
:readonly="!pageState.isDrawerEdit"
|
:readonly="!pageState.isDrawerEdit"
|
||||||
:isEdit="pageState.isDrawerEdit"
|
:isEdit="pageState.isDrawerEdit"
|
||||||
|
:hide-action="!canAccess('agencies', 'edit')"
|
||||||
v-model="pageState.addModal"
|
v-model="pageState.addModal"
|
||||||
v-model:drawer-model="pageState.viewDrawer"
|
v-model:drawer-model="pageState.viewDrawer"
|
||||||
v-model:data="formData"
|
v-model:data="formData"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue