{"version":3,"sources":["webpack:///./src/modules/PiantaSemeMarze/export.ts","webpack:///./src/modules/PiantaSemeMarze/components/PiantaSemeMarzeItem.ts","webpack:///./src/modules/PiantaSemeMarze/components/PiantaSemeMarzeItem.ts?dd9c","webpack:///./src/modules/domains/module.ts","webpack:///./src/modules/domains/sync.ts","webpack:///./src/modules/domains/index.ts","webpack:///./src/modules/Utenti/services/usersService.ts","webpack:///./src/modules/Utenti/store/users.store.ts"],"names":["exportForm","source","type","printer","pdf","utenteCreatore","getters","getAll","users","userId","user","find","f","id","toLowerCase","firstName","lastName","get","versioneId","alias","areaSpecieProvenienzaId","nome","codice","specie","undefined","specieArborea","label","tipologia","tipoPiantaSemeMarze","diametro","toFixed","altezza","attecchimento","header","data","note","format","printObj","print","PiantaSemeMarzeItem","startX","move","rowElement","buttonRowLeftWidth","buttonRowRightWidth","e","this","$refs","rowContent","buttonRowSwipeLeft","offsetWidth","buttonRowSwipeRight","touches","clientX","style","transform","$emit","JSON","parse","stringify","item","Detail","detail","specieArboree","length","default","lazy","sort","a","b","localeCompare","tipiPianteSemeMarze","init","registerModule","PREFIX","startup","composizioneVegetazionali","danniOsservati","esposizioni","feriteTroncoCicatrizzazione","feriteTroncoDimensioni","fustiFibratura","fustiNodosita","fustiSezione","fustiTipo","giaciture","governi","lettiere","origineMaterialiSelezionati","originePiantePlus","originePopolamentiForestali","pietrosita","posizioniPiantePlus","potaturePiantePlus","struttureOrizzontali","struttureVerticali","substratiPetrogenici","terreniSottostanti","tipiPiantePlus","trattamenti","ubicazioni","istat","modulename","module","sync","roles","baseUrl","api","apiServerUrl","ts","Get","applicationId","auth","client_id","username","obj","Put","Delete","roleId","baseRestService","usersService","TABLES","userInRole","UsersStore","namespaced","mutations","state","PersistentStore","result","getMaxTs","maxts","List","then","r","set","actions","setUtenti","context","payload","operation","update","create","toString","i","Set","o","n","op","publish","oldTypeId","newTypeId","remove","Remove","setRole","SetRole","removeRole","RemoveRole","usersStore"],"mappings":"qYAOO,SAAe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FE,uBAG5C,EAAKpI,QAAQC,SAH+B,gDAQ3CsJ,EAAa,mCAA6E,OAAUlC,EAAWjD","file":"chunk-3561fcf8.js","sourcesContent":["import { versioneExSituStore } from '../VersioneExSitu/store/VersioneExSitu.store';\r\nimport moment from 'moment';\r\nimport { printerHelper } from '../printer';\r\nimport { domainStore } from '../domains/store/domains.store';\r\nimport { areaSpecieProvenienzaStore } from '../AreaSpecieProvenienza/store/areaSpecieProvenienza.store';\r\nimport { usersStore } from '../Utenti/store/users.store';\r\n\r\nexport async function exportForm(source: server.PiantaSemeMarze, type: printer.type = printer.type.pdf): Promise {\r\n let utenteCreatore = [\"-- nessun creatore --\"];\r\n const users = await usersStore.getters.getAll();\r\n \r\n if (source.userId) {\r\n const user = users.find(f => f.id.toLowerCase() === source.userId.toLowerCase());\r\n if(user) utenteCreatore = [`${user.firstName} ${user.lastName}`];\r\n }\r\n\r\n const printObj = [\r\n {\r\n header: \"Dati Generali\",\r\n data: {\r\n 'Anno censimento': (await versioneExSituStore.getters.get(source.versioneId)).alias,\r\n 'Area per specie/provenienza relazionata': (await areaSpecieProvenienzaStore.getters.get(source.areaSpecieProvenienzaId)).nome,\r\n 'Codice pianta': source.codice ? source.codice : '',\r\n 'Specie': source.specie != null && source.specie != undefined ? (await domainStore.getters.specieArborea(source.specie))?.label : '',\r\n 'Tipologia': source.tipologia != null && source.tipologia != undefined ? (await domainStore.getters.tipoPiantaSemeMarze(source.tipologia))?.label : '',\r\n 'Diametro': source.diametro || source.diametro==0 ? source.diametro.toFixed(1) + ' cm' : '',\r\n 'Altezza': source.altezza || source.altezza==0 ? source.altezza.toFixed(1) + ' m' : '',\r\n 'Attecchimento': source.attecchimento ? 'si' : 'no'\r\n }\r\n }, {\r\n header: \"Altro\",\r\n data: {\r\n 'Note': source.note ? source.note : null,\r\n 'Data rilievo': source.data ? moment(source.data).format(\"DD-MM-YYYY\") : '',\r\n 'Utente creatore della pianta': utenteCreatore,\r\n }\r\n } as printer.group\r\n ];\r\n printerHelper.print(type, source.codice, 'Pianta da Seme/da Marze', printObj);\r\n}","\r\nimport Vue from 'vue';\r\nimport Component from 'vue-class-component';\r\nimport { Prop } from 'vue-property-decorator';\r\nimport { Async } from '@/utils/AsyncDecorators';\r\nimport { areaSpecieProvenienzaStore } from '@/modules/AreaSpecieProvenienza/store/areaSpecieProvenienza.store';\r\nimport moment from 'moment';\r\nimport { domainStore } from '@/modules/domains';\r\nimport { exportForm } from '../export';\r\nimport { piantaSemeMarzeService } from '../services/PiantaSemeMarzeService';\r\n\r\n@Component({})\r\nexport default class PiantaSemeMarzeItem extends Vue {\r\n\r\n @Prop()\r\n item: server.PiantaSemeMarze;\r\n\r\n @Async({ async get() { return (await (await areaSpecieProvenienzaStore.getters.get(this.item.areaSpecieProvenienzaId)).nome); }, default: [], lazy: true })\r\n areaSpeciaProvenienza: string;\r\n\r\n private startX: number = 0;\r\n private move: number = 0;\r\n private rowElement: any = null;\r\n\r\n private buttonRowLeftWidth: any = null;\r\n private buttonRowRightWidth: any = null;\r\n\r\n\r\n @Async({ async get() { return (await areaSpecieProvenienzaStore.getters.getAll()).sort((a, b) => a.nome.localeCompare(b.nome)); }, default: [], lazy: true })\r\n areeSpecieProvenienza: server.areaSpecieProvenienza[];\r\n\r\n @Async({ async get() { return await domainStore.getters.tipiPianteSemeMarze(); }, default: [], lazy: true })\r\n tipiPianteSemeMarze: domains.domini[];\r\n\r\n @Async({ async get() { return await domainStore.getters.specieArboree(); }, default: [], lazy: true })\r\n specieArboree: domains.domini[];\r\n public async start(e) {\r\n this.rowElement = this.$refs.rowContent;\r\n this.buttonRowLeftWidth = (this.$refs.buttonRowSwipeLeft as any)?.offsetWidth ? (this.$refs.buttonRowSwipeLeft as any)?.offsetWidth -20 : 0;\r\n this.buttonRowRightWidth = (this.$refs.buttonRowSwipeRight as any)?.offsetWidth ? (this.$refs.buttonRowSwipeRight as any)?.offsetWidth - 20 : 0;\r\n this.startX = e.touches[0].clientX;\r\n }\r\n\r\n get specie() {\r\n if (this.item.specie && this.specieArboree.length != 0) {\r\n return this.specieArboree.find(f => f.id === this.item.specie).label;\r\n }\r\n return null;\r\n }\r\n\r\n\r\n public onswipe(e) {\r\n (this.$refs.buttonRowSwipeLeft as any).style = \"visibility: visible;\";\r\n (this.$refs.buttonRowSwipeRight as any).style = \"visibility: visible;\";\r\n this.move = e.touches[0].clientX - this.startX;\r\n if (this.move >= 0) {\r\n \r\n (this.$refs.buttonRowSwipeRight as any).style = \"visibility: hidden\";\r\n // (this.$refs.buttonRowSwipeLeft as any).style = \"visibility: visible;\";\r\n if (this.move <= this.buttonRowLeftWidth) {\r\n this.rowElement.style.transform =\r\n \"translate(\" + this.move + \"px\" + \")\";\r\n } else {\r\n this.rowElement.style.transform = \"translate(\" + this.buttonRowLeftWidth + \"px)\";\r\n }\r\n }\r\n\r\n if (this.move < 0) {\r\n (this.$refs.buttonRowSwipeLeft as any).style = \"visibility: hidden;\";\r\n // (this.$refs.buttonRowSwipeRight as any).style = \"visibility: visible;\";\r\n if (!(-this.move >= this.buttonRowRightWidth)) {\r\n this.rowElement.style.transform =\r\n \"translate(\" + this.move + \"px\" + \")\";\r\n } else {\r\n this.rowElement.style.transform = \"translate(-\" + this.buttonRowRightWidth + \"px)\";\r\n }\r\n }\r\n }\r\n\r\n public onstop() {\r\n if (this.move >= 0) {\r\n if (this.move < this.buttonRowLeftWidth) {\r\n this.rowElement.style.transform = \"translate(0)\";\r\n }\r\n }\r\n if (this.move < 0) {\r\n if (!(-this.move >= this.buttonRowRightWidth)) {\r\n this.rowElement.style.transform = \"translate(0)\";\r\n }\r\n }\r\n }\r\n\r\n async edit()\r\n { \r\n this.$emit('edit', JSON.parse(JSON.stringify(this.item)));\r\n }\r\n\r\n async exporting(type: printer.type = printer.type.pdf) {\r\n const detail = await piantaSemeMarzeService.Detail(this.item.id, this.item.versioneId);\r\n await exportForm(detail, type); }\r\n}","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!./PiantaSemeMarzeItem.ts?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!./PiantaSemeMarzeItem.ts?vue&type=script&lang=ts&\"","import vuestore from '@/store';\r\nimport { DomainStore } from './store/domains.store';\r\nimport { IstatStore } from './store/istat.store';\r\n\r\nexport function init() {\r\n //REGISTRAZIONE DELLO STORE\r\n vuestore.registerModule(DomainStore.PREFIX, DomainStore);\r\n vuestore.registerModule(IstatStore.PREFIX, IstatStore);\r\n}","import { domainStore } from './store/domains.store';\r\nimport { istatStore } from './store/istat.store';\r\nimport { ISyncOptions } from '@/utils/ISyncOptions';\r\n\r\nexport default {\r\n\r\n startup: async (): Promise => {\r\n await domainStore.getters.composizioneVegetazionali();\r\n await domainStore.getters.danniOsservati();\r\n await domainStore.getters.esposizioni();\r\n await domainStore.getters.feriteTroncoCicatrizzazione();\r\n await domainStore.getters.feriteTroncoDimensioni();\r\n await domainStore.getters.fustiFibratura();\r\n await domainStore.getters.fustiNodosita();\r\n await domainStore.getters.fustiSezione();\r\n await domainStore.getters.fustiTipo();\r\n await domainStore.getters.giaciture();\r\n await domainStore.getters.governi();\r\n await domainStore.getters.lettiere();\r\n await domainStore.getters.origineMaterialiSelezionati();\r\n await domainStore.getters.originePiantePlus();\r\n await domainStore.getters.originePopolamentiForestali();\r\n await domainStore.getters.pietrosita();\r\n await domainStore.getters.posizioniPiantePlus();\r\n await domainStore.getters.potaturePiantePlus();\r\n await domainStore.getters.specieArboree();\r\n await domainStore.getters.struttureOrizzontali();\r\n await domainStore.getters.struttureVerticali();\r\n await domainStore.getters.substratiPetrogenici();\r\n await domainStore.getters.terreniSottostanti();\r\n await domainStore.getters.tipiPiantePlus();\r\n await domainStore.getters.trattamenti();\r\n await domainStore.getters.ubicazioni();\r\n\r\n await istatStore.getters.istat();\r\n }\r\n\r\n} as ISyncOptions;","\r\nimport * as module from \"./module\";\r\nimport * as sync from \"./sync\";\r\nimport { IModuleOptions } from '@/utils/IModuleOptions';\r\n\r\n\r\n// IMPORTANTE: Esportare le rotte e il module\r\nexport default {\r\n modulename: 'domains', module, sync, \r\n roles: [\"Amministratore\", \"Editore\", \"Visualizzatore\"]\r\n} as IModuleOptions\r\n\r\n\r\nexport { domainService } from \"./services/domainService\";\r\nexport { domainStore } from \"./store/domains.store\";\r\nexport { istatStore } from \"./store/istat.store\";","import { baseRestService } from \"@/utils/baseRestService\";\r\nimport { Config } from \"@/config\";\r\n\r\nclass UsersService extends baseRestService {\r\n\r\n constructor() {\r\n super();\r\n this.baseUrl = Config.api.apiServerUrl;\r\n }\r\n\r\n async List(ts?: number): Promise {\r\n return await this.Get(`/api/users`, { ts }) || [];\r\n }\r\n\r\n async Count(): Promise {\r\n return await this.Get(`/api/users/count`);\r\n }\r\n\r\n async GetById(userId: string): Promise {\r\n return await this.Get(`/api/users/get-by-id/${userId}`, { applicationId: Config.auth.client_id });\r\n }\r\n\r\n async GetByName(username: string): Promise {\r\n return await this.Get(`/api/users/get-by-name/${username}`, { applicationId: Config.auth.client_id });\r\n }\r\n\r\n async ToggleComplete(id: string): Promise {\r\n return await this.Get(`/api/users/${id}/toggle/complete`);\r\n }\r\n\r\n async ToggleConfirm(id: string): Promise {\r\n return await this.Get(`/api/users/${id}/toggle/email-confirm`);\r\n }\r\n\r\n async Set(obj: server.user, id: string): Promise {\r\n return await this.Put(`/api/users/${id}`, obj, { applicationId: Config.auth.client_id });\r\n }\r\n\r\n async Remove(id: string): Promise {\r\n return await this.Delete(`/api/users/${id}`);\r\n }\r\n\r\n async SetRole(obj: server.userInRole, userId: string): Promise {\r\n return await this.Put(`/api/users/${userId}/roles`, obj);\r\n }\r\n\r\n async RemoveRole(userId: string, roleId: string): Promise {\r\n return await this.Delete(`/api/users/${userId}/roles/${roleId}`);\r\n }\r\n}\r\n\r\nexport const usersService: UsersService = new UsersService();","import { GetterTree, ActionTree } from 'vuex';\r\nimport { replaceInArray } from '@/utils/Array';\r\nimport { messageService } from '@/utils/MessageService';\r\nimport { PersistentStore, saveAndSync, syncOperation } from '@/utils/PersistentStore';\r\nimport vuestore, { store } from '@/store';\r\nimport { CreateTypedStoreProxy } from 'vuex-typed-store';\r\nimport { usersService } from '../services/usersService';\r\nimport { Guid } from 'guid-typescript';\r\n\r\nexport interface UsersStoreModel { }\r\n\r\nexport interface UsersStoreActions {\r\n setUtenti(payload: server.user): Promise;\r\n remove(payload: server.user): Promise;\r\n}\r\n\r\nexport interface UsersStoreGetters {\r\n get(id: string): Promise;\r\n getAll(): Promise;\r\n}\r\n\r\nexport const TABLES = { users: 'users', userInRole: 'user-in-role' };\r\nexport const UsersStore = {\r\n PREFIX: 'users',\r\n namespaced: true,\r\n mutations: {},\r\n getters: {\r\n get: (state) => async (id): Promise => {\r\n return await PersistentStore.get(TABLES.users, id);\r\n },\r\n getAll: (state) => async (): Promise => {\r\n const result: server.user[] = await PersistentStore.getAll(TABLES.users) || [];\r\n const maxts: number = await PersistentStore.getMaxTs(TABLES.users);\r\n usersService.List(maxts).then(async (r) => {\r\n replaceInArray(r, result, (a, b) => a.id === b.id);\r\n await PersistentStore.set(TABLES.users, r);\r\n });\r\n return result;\r\n },\r\n } as GetterTree,\r\n\r\n actions: {\r\n async setUtenti(context, payload: server.user) {\r\n let operation: syncOperation = syncOperation.update;\r\n if (!payload.id) {\r\n payload.id = Guid.create().toString();\r\n operation = syncOperation.create;\r\n }\r\n await saveAndSync(payload, TABLES.users,\r\n i => operation, i => usersService.Set(i, i.id), i => usersService.Set(i, i.id),\r\n async (o, n, op) => {\r\n messageService.publish('updateMediaReference', { type: 'users', oldTypeId: o.id, newTypeId: n.id } as messages.updateMediaReference);\r\n })\r\n },\r\n async remove(context, payload: server.user) {\r\n await usersService.Remove(payload.id);\r\n await PersistentStore.remove(TABLES.users, payload);\r\n },\r\n async setRole(context, payload: server.userInRole) {\r\n const operation = payload.id > 0 ? syncOperation.update : syncOperation.create\r\n await saveAndSync(payload, TABLES.userInRole,\r\n i => operation,\r\n i => usersService.SetRole(i, i.userId),\r\n i => usersService.SetRole(i, i.userId),\r\n async (o, n, op) => {\r\n await this.getters.getAll();\r\n });\r\n },\r\n async removeRole(context, payload: server.userInRole) {\r\n await usersService.RemoveRole(payload.userId, payload.roleId);\r\n await PersistentStore.remove(TABLES.userInRole, payload);\r\n await this.getters.getAll();\r\n }\r\n } as ActionTree\r\n}\r\n\r\nexport const usersStore = CreateTypedStoreProxy(vuestore, UsersStore.PREFIX);\r\n"],"sourceRoot":""}