From d0ab57b1b503019c888c1fe370336ded3934880f Mon Sep 17 00:00:00 2001 From: louispaulb Date: Thu, 4 Jun 2026 21:01:42 -0400 Subject: [PATCH] =?UTF-8?q?Garde:=20s=C3=A9quence=20de=20rotation=20=C3=A9?= =?UTF-8?q?ditable=20=E2=80=94=20doublons=20permis=20+=20remplacer=20un=20?= =?UTF-8?q?tech=20par=20position?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le multi-select est remplacé par un constructeur de SUITE ordonnée : « Ajouter un tech à la suite » (push, doublons autorisés → tours inégaux ex. A,A,B,C) ; chaque position a un select pour REMPLACER le tech, + ↑/↓ pour réordonner, + ✕ pour retirer. Couvre rotations inégales et substitutions. Co-Authored-By: Claude Opus 4.8 (1M context) --- apps/ops/src/pages/PlanificationPage.vue | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/apps/ops/src/pages/PlanificationPage.vue b/apps/ops/src/pages/PlanificationPage.vue index dc32b68..bf18eb1 100644 --- a/apps/ops/src/pages/PlanificationPage.vue +++ b/apps/ops/src/pages/PlanificationPage.vue @@ -290,14 +290,18 @@ - +
+ + +
-
Ordre de rotation :
-
- {{ i + 1 }}. - {{ techName(id) }} - - +
Séquence de rotation ({{ newGardeRule.techs.length }} positions — doublons permis pour des tours inégaux) :
+
+ {{ i + 1 }}. + + Monter + Descendre + Retirer
@@ -603,8 +607,8 @@ function loadLS () { try { demand.value = JSON.parse(localStorage.getItem(LS_DEM const GARDE_EPOCH = '2026-01-05' // lundi de référence pour l'index de semaine const gardeTemplateOptions = computed(() => templates.value.slice().sort((a, b) => (b.on_call ? 1 : 0) - (a.on_call ? 1 : 0)).map(t => ({ label: t.template_name + (t.on_call ? ' 🛡️' : ''), value: t.name }))) const groupNames = computed(() => [...new Set(techs.value.map(t => t.group).filter(Boolean))].sort()) -const editingGardeId = ref(null) -function techName (id) { const t = techs.value.find(x => x.id === id); return t ? t.name : id } +const editingGardeId = ref(null); const gardePick = ref(null) +function addTechToSeq () { if (gardePick.value) { newGardeRule.techs.push(gardePick.value); gardePick.value = null } } // doublons permis (tours inégaux) function moveTech (i, dir) { const a = newGardeRule.techs; const j = i + dir; if (j < 0 || j >= a.length) return; const x = a[i]; a.splice(i, 1); a.splice(j, 0, x) } function editGardeRule (r) { Object.assign(newGardeRule, { dept: r.dept || '', shift: r.shift, weekdays: [...r.weekdays], periodWeeks: r.periodWeeks || 1, techs: [...r.techs] }); editingGardeId.value = r.id } function d2ms (iso) { const a = iso.split('-').map(Number); return Date.UTC(a[0], a[1] - 1, a[2]) }