Showing
1 changed file
with
9 additions
and
2 deletions
| ... | ... | @@ -6,8 +6,10 @@ |
| 6 | 6 | import OrganizationDrawer from '/@/views/system/organization/OrganizationDrawer.vue'; |
| 7 | 7 | import { useDrawer } from '/@/components/Drawer'; |
| 8 | 8 | import { OrganizationListItem } from '/@/api/system/model/systemModel'; |
| 9 | + import { useRole } from '/@/hooks/business/useRole'; | |
| 9 | 10 | |
| 10 | 11 | const [registerDrawer, { openDrawer }] = useDrawer(); |
| 12 | + const { isCustomerUser } = useRole(); | |
| 11 | 13 | |
| 12 | 14 | const props = withDefaults( |
| 13 | 15 | defineProps<{ |
| ... | ... | @@ -60,6 +62,11 @@ |
| 60 | 62 | }; |
| 61 | 63 | }); |
| 62 | 64 | |
| 65 | + const getShowCreate = computed(() => { | |
| 66 | + const { showCreate } = props; | |
| 67 | + return unref(isCustomerUser) ? false : showCreate; | |
| 68 | + }); | |
| 69 | + | |
| 63 | 70 | const handleReload = () => { |
| 64 | 71 | needReload.value = true; |
| 65 | 72 | timespan.value = Date.now(); |
| ... | ... | @@ -69,7 +76,7 @@ |
| 69 | 76 | <template> |
| 70 | 77 | <section class="flex"> |
| 71 | 78 | <ApiTreeSelect v-bind="getBindProps" /> |
| 72 | - <Button v-if="showCreate" type="link" @click="handleOpenCreate">新增组织</Button> | |
| 73 | - <OrganizationDrawer v-if="showCreate" @register="registerDrawer" @success="handleReload" /> | |
| 79 | + <Button v-if="getShowCreate" type="link" @click="handleOpenCreate">新增组织</Button> | |
| 80 | + <OrganizationDrawer v-if="getShowCreate" @register="registerDrawer" @success="handleReload" /> | |
| 74 | 81 | </section> |
| 75 | 82 | </template> | ... | ... |