Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
micnori committed Sep 12, 2024
2 parents ed01e02 + ebabb00 commit f4df151
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export default {
},
zoom: 10,
dragging: false,
markerClick:false
};
},
Expand All @@ -118,18 +119,19 @@ export default {
}, 250);
},
disableMap() {
this.$refs.map.mapObject.invalidateSize();
this.markerClick = false;
this.$refs.map.mapObject.invalidateSize();
this.$refs.map.mapObject.dragging.disable();
this.$refs.map.mapObject.touchZoom.disable();
this.$refs.map.mapObject.doubleClickZoom.disable();
this.$refs.map.mapObject.scrollWheelZoom.disable();
this.$refs.map.mapObject.boxZoom.disable();
this.$refs.map.mapObject.keyboard.disable();
if (this.$refs.map.mapObject.tap) this.$refs.map.mapObject.tap.disable();
if (this.$refs.map.mapObject.tap) this.$refs.map.mapObject.tap.disable();
},
enableMap() {
this.markerClick=true;
this.$refs.map.mapObject.dragging.enable();
this.$refs.map.mapObject.touchZoom.enable();
this.$refs.map.mapObject.doubleClickZoom.enable();
Expand Down Expand Up @@ -194,7 +196,7 @@ if (this.$refs.map.mapObject.tap) this.$refs.map.mapObject.tap.disable();
},
async onMapClick(value) {
console.log('this.addresIsValid',this.addresIsValid);
if (!this.addresIsValid) return;
if (!this.addresIsValid || !this.markerClick) return;
this.position = value.latlng;
},
onSearch(value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,14 @@
<v-tab
key="1"
class="text-none"
@click="setTab(1)"
>
In automatico
</v-tab>
<v-tab
key="2"
class="text-none"
@click="setTab(2)"
>
A mano
</v-tab>
Expand Down Expand Up @@ -280,7 +282,7 @@
<v-btn
color="primary"
@click="manualPosition()"
:disabled="$v.invalid"
:disabled="$v.$invalid"
>Imposta manualmente</v-btn
>
</div>
Expand Down Expand Up @@ -353,7 +355,13 @@
</v-row>
</v-col>
</v-row>

<v-row v-if="latitude && longitude">
<v-col cols="12">
<v-divider></v-divider>
<p class="text-subtitle-1 mt-5">ATTENZIONE!!! La posizione sarà utilizzata per la validazione dei viaggi dei dipendenti. Saranno validi solo i viaggi che iniziano o finiscono all'interno della zona delimitata dal cerchio rosso.
</p>
</v-col>
</v-row>
<v-row>
<v-col cols="4" class="mt-3">
<v-form>
Expand Down Expand Up @@ -702,6 +710,23 @@ export default {
}
}
},
setTab(value) {
if (value == 1) {
this.$refs.geolocationSelector.disableMap();
if (!this.$v.$invalid) {
if (this.geoResults.length > 0) {
this.addresIsValid = true;
this.showErrorLocation=false;
} else {
this.showErrorLocation=true;
this.addresIsValid = false;
}
}
} else {
this.$refs.geolocationSelector.enableMap();
}
},
autoPosition() {
if (this.geoResults.length > 0) {
console.log("AutoPosition", this.geoResults[0]);
Expand Down
45 changes: 29 additions & 16 deletions console_aziendale/src/pages/locations/Locations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
color="secondary"
rounded
elevation="6"
@click="[selectActualLocation(null), openModal({type:'locationFormAdd', object:null})]"
@click="
[
selectActualLocation(null),
openModal({ type: 'locationFormAdd', object: null }),
]
"
class="mr-4"
>
<v-icon left>mdi-plus</v-icon>
Expand All @@ -18,7 +23,7 @@
color="secondary"
rounded
elevation="6"
@click="openModal({type:'locationImport', object:null})"
@click="openModal({ type: 'locationImport', object: null })"
>
<v-icon left>mdi-file-import</v-icon>
Aggiungi da file
Expand All @@ -39,9 +44,8 @@
<div v-else class="empty-list">Non ci sono Sedi</div>
</v-col>
<!-- PROFILO LOCATION -->
<profilo-location v-if="actualLocation && actualLocation.item"/>
<profilo-location v-if="actualLocation && actualLocation.item" />
</v-row>

</div>
</template>

Expand All @@ -56,7 +60,13 @@ export default {
components: { ProfiloLocation, GenericTable },
data: function () {
return {
headerColumns: [{text:"Identificativo", value:"id"}, {text:"Cittá", value:"city"}, {text:"Indirizzo", value:"address"}, {text:"Numero", value:"streetNumber"}],
headerColumns: [
{ text: "Identificativo", value: "id" },
{ text: "Nome", value: "name" },
{ text: "Cittá", value: "city" },
{ text: "Indirizzo", value: "address" },
{ text: "Numero", value: "streetNumber" },
],
tableTitle: "Sedi",
newLocation: false,
location: null,
Expand All @@ -69,12 +79,12 @@ export default {
submitStatus: null,
// fileUploaded: null,
inDragArea: false,
oldLocation:null
oldLocation: null,
};
},
methods: {
...mapActions("modal", {openModal:'openModal'}),
...mapActions("modal", { openModal: "openModal" }),
...mapActions("location", {
getAllLocations: "getAllLocations",
selectActualLocation: "selectActualLocation",
Expand Down Expand Up @@ -103,7 +113,7 @@ export default {
this.selectActualLocation(location);
//this.actualLocation = location;
}
}else{
} else {
this.selectActualLocation(location);
//this.actualLocation = location;
}
Expand All @@ -125,9 +135,9 @@ export default {
this.deleteModalVisible = false;
},
closeImportModal() {
this.modalImportLocationsOpen = false
this.modalImportLocationsOpen = false;
},
deleteConfirm() {
this.deleteModalVisible = false;
this.deleteLocation({
Expand All @@ -152,10 +162,14 @@ export default {
// fileName() {
// return this.fileUploaded.item(0).name;
// },
nColsTable_calculator: function() {
if(this.actualLocation != null && this.actualLocation != undefined && this.actualLocation.item != null){
nColsTable_calculator: function () {
if (
this.actualLocation != null &&
this.actualLocation != undefined &&
this.actualLocation.item != null
) {
return 8;
} else{
} else {
return 12;
}
},
Expand All @@ -164,12 +178,11 @@ export default {
created() {
this.loadLocations();
},
mounted() {
this.changePage({ title: "Lista sedi", route: "/GestioneSedi" });
},
};
</script>

<style>
</style>
<style></style>

0 comments on commit f4df151

Please sign in to comment.