fix: added dialog in globalStore to use in script setup

This commit is contained in:
Shariq Ansari 2023-12-28 18:00:34 +05:30
parent 74b134fe28
commit 42f5cf193f
5 changed files with 20 additions and 0 deletions

View File

@ -229,6 +229,7 @@ import {
timeAgo,
formatNumberIntoCurrency,
} from '@/utils'
import { globalStore } from '@/stores/global.js'
import { usersStore } from '@/stores/users.js'
import { contactsStore } from '@/stores/contacts.js'
import { organizationsStore } from '@/stores/organizations.js'
@ -236,6 +237,8 @@ import { statusesStore } from '@/stores/statuses'
import { ref, computed, h } from 'vue'
import { useRouter } from 'vue-router'
const { $dialog } = globalStore()
const { getContactByName, contacts } = contactsStore()
const { getUser } = usersStore()
const { getOrganization } = organizationsStore()

View File

@ -294,6 +294,7 @@ import {
setupAssignees,
setupCustomActions,
} from '@/utils'
import { globalStore } from '@/stores/global'
import { contactsStore } from '@/stores/contacts'
import { organizationsStore } from '@/stores/organizations'
import { statusesStore } from '@/stores/statuses'
@ -311,6 +312,7 @@ import {
import { ref, computed, h } from 'vue'
import { useRouter } from 'vue-router'
const { $dialog } = globalStore()
const { getContactByName, contacts } = contactsStore()
const { organizations, getOrganization } = organizationsStore()
const { statusOptions, getDealStatus } = statusesStore()

View File

@ -200,6 +200,7 @@ import {
setupAssignees,
setupCustomActions,
} from '@/utils'
import { globalStore } from '@/stores/global'
import { contactsStore } from '@/stores/contacts'
import { organizationsStore } from '@/stores/organizations'
import { statusesStore } from '@/stores/statuses'
@ -218,6 +219,7 @@ import {
import { ref, computed } from 'vue'
import { useRouter } from 'vue-router'
const { $dialog } = globalStore()
const { contacts } = contactsStore()
const { organizations, getOrganization } = organizationsStore()
const { statusOptions, getLeadStatus } = statusesStore()

View File

@ -248,6 +248,7 @@ import CameraIcon from '@/components/Icons/CameraIcon.vue'
import LeadsIcon from '@/components/Icons/LeadsIcon.vue'
import DealsIcon from '@/components/Icons/DealsIcon.vue'
import ContactsIcon from '@/components/Icons/ContactsIcon.vue'
import { globalStore } from '@/stores/global'
import { usersStore } from '@/stores/users'
import { organizationsStore } from '@/stores/organizations.js'
import { statusesStore } from '@/stores/statuses'
@ -267,6 +268,7 @@ const props = defineProps({
},
})
const { $dialog } = globalStore()
const { organizations, getOrganization } = organizationsStore()
const { getLeadStatus, getDealStatus } = statusesStore()
const showOrganizationModal = ref(false)

View File

@ -0,0 +1,11 @@
import { defineStore } from 'pinia'
import { getCurrentInstance } from 'vue'
export const globalStore = defineStore('crm-global', () => {
const app = getCurrentInstance()
const { $dialog } = app.appContext.config.globalProperties
return {
$dialog,
}
})