Circuit table...
This commit is contained in:
54
src/store/CircuitStore.ts
Executable file
54
src/store/CircuitStore.ts
Executable file
@@ -0,0 +1,54 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import {
|
||||
ICircuit,
|
||||
} from '@src/model'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
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'
|
||||
|
||||
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
import globalroutines from '../globalroutines/index'
|
||||
|
||||
export const useCircuitStore = defineStore('CircuitStore', {
|
||||
state: () => ({
|
||||
listcircuits: []
|
||||
}),
|
||||
|
||||
getters: {
|
||||
|
||||
|
||||
},
|
||||
|
||||
actions: {
|
||||
getImgByCircuit(circ: ICircuit): string {
|
||||
|
||||
try {
|
||||
return costanti.DIR_UPLOAD + 'circuits/' + circ.img_logo
|
||||
} catch (e) {
|
||||
}
|
||||
return 'images/noimg.png'
|
||||
},
|
||||
|
||||
|
||||
async loadCircuits() {
|
||||
return Api.SendReq('/users/circuits', 'POST', null)
|
||||
.then((res) => {
|
||||
return res.data
|
||||
}).catch((error) => {
|
||||
return {}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user