refactor: check role
This commit is contained in:
parent
a5dd047ee5
commit
de8df46aef
3 changed files with 9 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { BranchWithChildren } from 'stores/branch/types';
|
import { BranchWithChildren } from 'stores/branch/types';
|
||||||
import KebabAction from './shared/KebabAction.vue';
|
import KebabAction from './shared/KebabAction.vue';
|
||||||
|
import { isRoleInclude } from 'stores/utils';
|
||||||
|
|
||||||
const nodes = defineModel<(any | BranchWithChildren)[]>('nodes', {
|
const nodes = defineModel<(any | BranchWithChildren)[]>('nodes', {
|
||||||
default: [],
|
default: [],
|
||||||
|
|
@ -119,7 +120,11 @@ defineEmits<{
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="node.isHeadOffice && typeTree === 'branch'"
|
v-if="
|
||||||
|
node.isHeadOffice &&
|
||||||
|
typeTree === 'branch' &&
|
||||||
|
isRoleInclude(['head_of_admin', 'admin', 'system'])
|
||||||
|
"
|
||||||
:id="`create-sub-branch-btn-${node.name}`"
|
:id="`create-sub-branch-btn-${node.name}`"
|
||||||
@click.stop="$emit('create', node)"
|
@click.stop="$emit('create', node)"
|
||||||
icon="mdi-file-plus-outline"
|
icon="mdi-file-plus-outline"
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import type { QTableProps } from 'quasar';
|
||||||
import { resetScrollBar } from 'src/stores/utils';
|
import { resetScrollBar } from 'src/stores/utils';
|
||||||
import useBranchStore from 'stores/branch';
|
import useBranchStore from 'stores/branch';
|
||||||
import useFlowStore from 'stores/flow';
|
import useFlowStore from 'stores/flow';
|
||||||
|
import { isRoleInclude } from 'stores/utils';
|
||||||
import {
|
import {
|
||||||
BranchWithChildren,
|
BranchWithChildren,
|
||||||
BranchCreate,
|
BranchCreate,
|
||||||
|
|
@ -1040,6 +1041,7 @@ watch(currentHq, () => {
|
||||||
{{ $t('branch.allBranch') }}
|
{{ $t('branch.allBranch') }}
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="isRoleInclude(['head_of_admin', 'admin', 'system'])"
|
||||||
round
|
round
|
||||||
flat
|
flat
|
||||||
size="md"
|
size="md"
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ const routes: RouteRecordRaw[] = [
|
||||||
'head_of_account',
|
'head_of_account',
|
||||||
'system',
|
'system',
|
||||||
'owner',
|
'owner',
|
||||||
|
'branch_manager',
|
||||||
])
|
])
|
||||||
) {
|
) {
|
||||||
next();
|
next();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue