Skip to content

Commit

Permalink
fix: chips in markers
Browse files Browse the repository at this point in the history
  • Loading branch information
blackbirdem committed May 10, 2024
1 parent 9822675 commit 43900c8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<v-icon style="margin-right: 5px;">map</v-icon>
{{ content.fromMap }}
</v-btn>
<v-alert v-if="editData.length > content.maxLength" :value="true" type="warning" style="color:black" >
{{ content.maxWarning }}
</v-alert>
<v-card @click="editId = i+1" elevation="3" style="margin: 5px;cursor: pointer" v-for="(d, i) in editData" :key="i">
<v-card-title style="padding-bottom: 0;">
<div v-if="jobsBox"><b>Job {{ d.id }} - {{ d.location ? d.location[0].toPrecision(8) + ',' + d.location[1].toPrecision(8) : 'please add Location'}}</b></div>
Expand Down Expand Up @@ -102,9 +105,6 @@
</div>
</v-card-text>
</v-card>
<v-alert v-if="editData.length > content.maxLength" :value="true" type="warning" style="color:black" >
{{ content.maxWarning }}
</v-alert>
<v-layout row :wrap="$lowResolution">
<v-flex v-if="data.length" text-xs-left xs12 sm5 md7 :class="{'ml-2': $vuetify.breakpoint.smAndDown, 'mb-2': $lowResolution}">
<v-btn :block="$lowResolution" color="primary" :title="$t('settings.restoreDefaults')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,20 @@
{{marker.label}}
<template v-if="modeIsOptimization">
<div style="width: 100%; height: auto" v-for="(j, i) in marker.job" :key="i">
<div v-if="['amount','service','skills','time_window','amount'].includes(i)">
<v-chip v-if="j && j.length && i !== 'skills'">{{i}}: {{j}}</v-chip>
<v-chip v-if="j && j.length && i === 'skills'">{{i}}: {{ skillIds(j) }}</v-chip>
<div v-if="['delivery','pickup','skills','time_window','service'].includes(i)">
<v-chip v-if="j && j.length === 'service'" style="flex: auto">{{ $t(`optimization.${i}`) }}: {{ j }}</v-chip>
<v-chip v-else-if="j && j.length && i !== 'skills' && j[0] !== 0" style="flex: auto">{{ $t(`optimization.${i}`) }}: {{ j[0] }}</v-chip>
<v-chip v-else-if="j && j.length && i === 'skills'" style="flex: auto">
{{ $t(`optimization.${i}`) }}: {{ skillIds(j) }}
</v-chip>
</div>
</div>
<div style="width: 100%; height: auto" v-for="(v, i) in marker.vehicle" :key="i">
<div v-if="['amount','service','skills','time_window','profile','capacity', 'description'].includes(i)">
<v-chip v-if="v && v.length && i !== 'skills'">{{i}}: {{v}}</v-chip>
<v-chip v-if="v && v.length && i === 'skills'">{{i}}: {{ skillIds(v) }}</v-chip>
<v-chip v-if="v && v.length && i === 'time_window' && v[0] > 0 " style="flex: auto">{{ $t(`optimization.${i}`) }}: {{ v[0] }} - {{ v[1] }}</v-chip>
<v-chip v-else-if="v && v.length && i === 'capacity'">{{ $t(`optimization.${i}`) }}: {{ v[0] }}</v-chip>
<v-chip v-else-if="v && v.length && i === 'skills'">{{ $t(`optimization.${i}`) }}: {{ skillIds(v) }}</v-chip>
<v-chip v-else-if="v && v.length">{{i}}: {{v}}</v-chip>
</div>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,13 @@ export default {
},

skillIds(skills) {
const ids = []
let ids = ''
for (const skill of skills) {
ids.push(skill.id)
if(ids === ''){
ids = skill.id
} else {
ids = ids + ', ' + skill.id
}
}
return ids
}
Expand Down

0 comments on commit 43900c8

Please sign in to comment.