Skip to content
Snippets Groups Projects
Commit f9ef60d3 authored by Jonathan Foucher's avatar Jonathan Foucher
Browse files

lint

parent e8db0c97
No related branches found
No related tags found
No related merge requests found
Pipeline #31198 failed
......@@ -326,7 +326,6 @@ public function getActionTerritoryGraphData(): array
public function getOrganizationData(int|null $territory_id = null)
{
$orgQuery = Organization::where('active', true);
if ($territory_id) {
......@@ -337,7 +336,7 @@ public function getOrganizationData(int|null $territory_id = null)
$count = $orgs->count();
if ($count === 0) {
if (0 === $count) {
return [
'maturity' => 0, // Nombre de structures évaluées
'count' => 0, // Indice de maturité moyen des structures actives
......
......@@ -6,27 +6,28 @@
<option value="">Tous les territoires</option>
<option v-for="t in selectTerritories" :key="t.id" :value="t.id">{{t.name}}</option>
</select>
<div v-if="favoriteMeasures && favoriteMeasures.length" v-for="(measure, i) in favoriteMeasures" :key="measure.measure_id" class="card flex-row">
<div class="col-2 bg-primary font-weight-bold">
<span style="font-size: 50px;">{{ i + 1 }}</span>
</div>
<div class="card-body col-10 py-2">
<div class="card-text">
{{ measure.short_name }}
<div class="small font-weight-bold">Niveau {{ measure.max_levels[0] }}</div>
<div v-if="favoriteMeasures && favoriteMeasures.length">
<div v-for="(measure, i) in favoriteMeasures" :key="measure.measure_id" class="card flex-row">
<div class="col-2 bg-primary font-weight-bold">
<span style="font-size: 50px;">{{ i + 1 }}</span>
</div>
<div class="progress progress-xs my-1">
<div
class="progress-bar"
:class="measure.max_levels[0] === 1 ? 'bg-danger' : measure.max_levels[0] === 2 ? 'bg-info' : measure.max_levels[0] === 3 ? 'bg-success' : 'black'"
role="progressbar"
:style="{width: measure.max_levels[0] === 1 ? '33%' : measure.max_levels[0] === 2 ? '66%' : measure.max_levels[0] === 3 ? '100%' : '0%'}"
aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div v-if="organizationsNumber" class="card-text">
<!-- if float -> tofixed(2) -->
{{ measure.percentage.toFixed(2) }} % des structures
<div class="card-body col-10 py-2">
<div class="card-text">
{{ measure.short_name }}
<div class="small font-weight-bold">Niveau {{ measure.max_levels[0] }}</div>
</div>
<div class="progress progress-xs my-1">
<div
class="progress-bar"
:class="measure.max_levels[0] === 1 ? 'bg-danger' : measure.max_levels[0] === 2 ? 'bg-info' : measure.max_levels[0] === 3 ? 'bg-success' : 'black'"
role="progressbar"
:style="{width: measure.max_levels[0] === 1 ? '33%' : measure.max_levels[0] === 2 ? '66%' : measure.max_levels[0] === 3 ? '100%' : '0%'}"
aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div v-if="organizationsNumber" class="card-text">
<!-- if float -> tofixed(2) -->
{{ measure.percentage.toFixed(2) }} % des structures
</div>
</div>
</div>
</div>
......@@ -37,8 +38,6 @@
<script>
/* nombre de niveau de mesures de sécurité mis en œuvre /30)*100 */
import axios from "axios";
export default {
name: 'MeasureCard',
props : [],
......@@ -47,9 +46,6 @@ export default {
chooseTerritoryId : "",
}
},
mounted() {
this.$store.dispatch('getOrganizationData', {territory_id: null})
},
computed: {
measures () {
return this.$store.state.measures.all
......@@ -71,8 +67,11 @@ export default {
},
watch: {
chooseTerritoryId(newValue) {
this.$store.dispatch('getOrganizationData', {territory_id: newValue})
this.$store.dispatch('getOrganizationData', {territoryId: newValue})
}
},
mounted() {
this.$store.dispatch('getOrganizationData', {territoryId: null})
}
}
</script>
......
......@@ -19,8 +19,8 @@ export default {
}
},
actions: {
async getOrganizationData({commit}, {territory_id}) {
const req = await axios.get(`/api/graphs/organizations/${territory_id ? territory_id : ''}`)
async getOrganizationData({commit}, {territoryId}) {
const req = await axios.get(`/api/graphs/organizations/${territoryId || ''}`)
commit('setGraphData', { name: 'organization', data: req.data, id: 'organization' })
return req.data
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment