2025-02-03 17:18:33 +01:00
|
|
|
import { defineStore } from 'pinia'
|
|
|
|
|
|
2025-03-01 14:14:43 +01:00
|
|
|
import type {
|
|
|
|
|
ICatalogState
|
|
|
|
|
} from '@src/model';
|
2025-02-03 17:18:33 +01:00
|
|
|
import {
|
|
|
|
|
IAccount,
|
2025-03-01 14:14:43 +01:00
|
|
|
ICircuit, ICatalog, IGlobalState, IGroupShort, IMyCircuit, IMyGroup, IUserFields
|
2025-02-03 17:18:33 +01:00
|
|
|
} from '@src/model'
|
2025-03-01 14:14:43 +01:00
|
|
|
import { tools } from '@tools'
|
2025-02-03 17:18:33 +01:00
|
|
|
import translate from '@src/globalroutines/util'
|
|
|
|
|
|
|
|
|
|
import * as Types from '@src/store/Api/ApiTypes'
|
|
|
|
|
import { useGlobalStore } from '@store/globalStore'
|
|
|
|
|
import { serv_constants } from '@store/Modules/serv_constants'
|
|
|
|
|
import { Api } from '@api'
|
|
|
|
|
import { toolsext } from '@store/Modules/toolsext'
|
|
|
|
|
import { static_data } from '@src/db/static_data'
|
|
|
|
|
|
|
|
|
|
|
2025-03-01 14:14:43 +01:00
|
|
|
import { shared_consts } from '@src/common/shared_vuejs'
|
2025-02-03 17:18:33 +01:00
|
|
|
import { costanti } from '@costanti'
|
|
|
|
|
|
|
|
|
|
import globalroutines from '../globalroutines/index'
|
|
|
|
|
|
|
|
|
|
export const useCatalogStore = defineStore('CatalogStore', {
|
|
|
|
|
state: (): ICatalogState => ({
|
2025-03-01 14:14:43 +01:00
|
|
|
catalogs: [{ _id: '', idapp: '', title: '' }]
|
2025-02-03 17:18:33 +01:00
|
|
|
}),
|
|
|
|
|
|
2025-05-14 15:02:14 +02:00
|
|
|
getters: {
|
|
|
|
|
getCatalogById: (state) => (id: string) => {
|
|
|
|
|
return state.catalogs.find((cat: ICatalog) => cat._id === id);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
},
|
2025-02-03 17:18:33 +01:00
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
})
|