[UI] prevent change domain in /chartflow and loading
This commit is contained in:
@@ -1,12 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<q-btn-dropdown
|
<q-btn-dropdown
|
||||||
color="primay"
|
class="customized-disabled-btn"
|
||||||
push
|
push
|
||||||
flat
|
flat
|
||||||
no-caps
|
no-caps
|
||||||
icon="share"
|
icon="share"
|
||||||
size="md"
|
size="md"
|
||||||
:label="userStore.currentDomain.domainName"
|
:label="userStore.currentDomain.domainName"
|
||||||
|
:disable-dropdown="isUnclickable"
|
||||||
|
:dropdown-icon="isUnclickable ? 'none' : ''"
|
||||||
|
:disable="isUnclickable"
|
||||||
>
|
>
|
||||||
<q-list>
|
<q-list>
|
||||||
<q-item v-for="domain in domains" :key="domain.domainName"
|
<q-item v-for="domain in domains" :key="domain.domainName"
|
||||||
@@ -26,18 +29,32 @@
|
|||||||
<script setup lang="ts" >
|
<script setup lang="ts" >
|
||||||
import { IDomainInfo } from 'src/types/ActionTypes';
|
import { IDomainInfo } from 'src/types/ActionTypes';
|
||||||
import { useAuthStore,IUserState } from 'stores/useAuthStore';
|
import { useAuthStore,IUserState } from 'stores/useAuthStore';
|
||||||
import { ref } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
const userStore = useAuthStore();
|
const userStore = useAuthStore();
|
||||||
|
const route = useRoute()
|
||||||
const domains = ref<IDomainInfo[]>([]);
|
const domains = ref<IDomainInfo[]>([]);
|
||||||
(async ()=>{
|
(async ()=>{
|
||||||
domains.value = await userStore.getUserDomains();
|
domains.value = await userStore.getUserDomains();
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
const isUnclickable = computed(()=>{
|
||||||
|
return route.path.startsWith('/FlowChart/') || domains.value === undefined || domains.value.length === 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
const onItemClick=(domain:IDomainInfo)=>{
|
const onItemClick=(domain:IDomainInfo)=>{
|
||||||
console.log(domain);
|
console.log(domain);
|
||||||
userStore.setCurrentDomain(domain);
|
userStore.setCurrentDomain(domain);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
.q-btn.disabled.customized-disabled-btn {
|
||||||
|
opacity: 1 !important;
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-btn.disabled.customized-disabled-btn * {
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user