Added Logo
Added Document Download Added zipjs
This commit is contained in:
@@ -28,6 +28,7 @@ export const useDataStore = defineStore('data', {
|
||||
products: [] as any[],
|
||||
movements: [] as any[],
|
||||
forms: [] as any[],
|
||||
jobs: [] as any[],
|
||||
formSubmits: [] as any[],
|
||||
contacts: [] as any[],
|
||||
vehicles: [] as any[],
|
||||
@@ -47,6 +48,7 @@ export const useDataStore = defineStore('data', {
|
||||
await this.fetchDocuments()
|
||||
await this.fetchMovements()
|
||||
await this.fetchTimes()
|
||||
await this.fetchJobs()
|
||||
await this.fetchSpaces()
|
||||
await this.fetchVehicles()
|
||||
this.loaded = true
|
||||
@@ -108,6 +110,10 @@ export const useDataStore = defineStore('data', {
|
||||
// @ts-ignore
|
||||
this.times = (await supabase.from("times").select()).data
|
||||
},
|
||||
async fetchJobs() {
|
||||
// @ts-ignore
|
||||
this.jobs = (await supabase.from("jobs").select()).data
|
||||
},
|
||||
async fetchDocuments() {
|
||||
// @ts-ignore
|
||||
this.documents = (await supabase.from("documents").select()).data
|
||||
@@ -119,6 +125,7 @@ export const useDataStore = defineStore('data', {
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
getProfileById: (state) => (userUid:string) => state.profiles.find(profile => profile.id === userUid),
|
||||
getOpenTasksCount: (state) => state.tasks.filter(task => task.categorie != "Erledigt").length,
|
||||
movementsBySpace: (state) => (spaceId:number) => state.movements.filter(move => move.spaceId === spaceId),
|
||||
getProductById: (state) => (productId:number) => state.products.find(product => product.id === productId),
|
||||
@@ -136,6 +143,7 @@ export const useDataStore = defineStore('data', {
|
||||
|
||||
},
|
||||
getCustomerById: (state) => (customerId:number) => state.customers.find(customer => customer.id === customerId),
|
||||
getJobById: (state) => (jobId:number) => state.jobs.find(job => job.id === jobId),
|
||||
getTimesByProjectId: (state) => (projectId:number) => {
|
||||
let times = state.times.filter(time => time.projectId === projectId)
|
||||
console.log(times.length)
|
||||
@@ -171,11 +179,16 @@ export const useDataStore = defineStore('data', {
|
||||
]
|
||||
},
|
||||
getEvents: (state) => {
|
||||
|
||||
return [
|
||||
...state.events.map(event => {
|
||||
let eventColor = state.ownTenant.calendarConfig.eventTypes.find(type => type.label === event.type).color
|
||||
|
||||
return {
|
||||
...event,
|
||||
backgroundColor: state.ownTenant.calendarConfig.eventTypes.find(type => type.label === event.type).color
|
||||
borderColor: eventColor,
|
||||
textColor: eventColor,
|
||||
backgroundColor: "black"
|
||||
}
|
||||
}),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user