feat: pour les cellules où les crayons sont branchés sur une table annexe (= différente de la table principale qui fournit l'id de la ligne), utiliser la valeur du champ crayons pour transmettre l'id de la table annexe à éditer. Ce qui donne :

crayons : { nom_du_champ : id_table_annexe }
This commit is contained in:
Christophe 2023-01-05 13:54:07 +01:00
parent 4a0ffef53e
commit 828c892b03
3 changed files with 165 additions and 37 deletions

View file

@ -675,7 +675,8 @@ let monTableau = {
let to = page * parPage; let to = page * parPage;
return tableau.slice(from, to); return tableau.slice(from, to);
}, },
afficher_crayons(name, id) { afficher_crayons(name, l) {
let id = l.crayons !== undefined && l.crayons[name] !== undefined ? l.crayons[name] : l.html.id;
if (Object.keys(this.crayons).indexOf(name) !== -1) { if (Object.keys(this.crayons).indexOf(name) !== -1) {
return `crayon ${this.crayons[name]}-${name}-${id}`; return `crayon ${this.crayons[name]}-${name}-${id}`;
} }
@ -969,7 +970,7 @@ let monTableau = {
</thead> </thead>
<tbody> <tbody>
<tr v-for="l in tableau" :key="l.html.id" :class="selectTr.indexOf(l.html.id) !== -1 ? 'select' : ''" > <tr v-for="l in tableau" :key="l.html.id" :class="selectTr.indexOf(l.html.id) !== -1 ? 'select' : ''" >
<td v-for="(td,name, i) in l.html" :key="'td_'+i" :class="[afficher_crayons(name, l.crayons !== undefined && l.crayons[name] !== undefined ? l.crayons[name] : l.html.id), name, classes[name], l.classes !== undefined ? l.classes[name] : '']" @click="selectLigne(l.html.id,name)"> <td v-for="(td,name, i) in l.html" :key="'td_'+i" :class="[afficher_crayons(name, l), name, classes[name], l.classes !== undefined ? l.classes[name] : '']" @click="selectLigne(l.html.id,name)">
<div v-if="checkbox[name] !== undefined"> <div v-if="checkbox[name] !== undefined">
<label v-if="td.split('-')[0] === 'dataid'"> <label v-if="td.split('-')[0] === 'dataid'">
<input type='checkbox' v-model='Tcheckbox[name]' :value="td.split('-')[1]"> <input type='checkbox' v-model='Tcheckbox[name]' :value="td.split('-')[1]">

File diff suppressed because one or more lines are too long

View file

@ -4,12 +4,14 @@
"header":{ "header":{
"id": "_", "id": "_",
"titre": "titre", "titre": "titre",
"nom": "Auteur",
"texte": "texte", "texte": "texte",
"date": "date", "date": "date",
"statut": "statut" "statut": "statut"
}, },
"crayons":{ "crayons":{
"titre" : "article" "titre" : "article",
"nom": "auteur"
}, },
"ordreCol" : { "ordreCol" : {
"titre" : "desc", "titre" : "desc",
@ -40,6 +42,7 @@
"html": { "html": {
"id": #ID_ARTICLE, "id": #ID_ARTICLE,
"titre" : [(#TITRE|json_encode)], "titre" : [(#TITRE|json_encode)],
"nom" : [(#NOM|json_encode)],
"date" : [(#DATE|affdate{d/m/Y}|json_encode)], "date" : [(#DATE|affdate{d/m/Y}|json_encode)],
"texte": [(#VAL{<a class="modalbox" title="Détail" href="[(#URL_PAGE{gamutable_texte}|parametre_url{id_article,#ID_ARTICLE})]">[(#TEXTE|couper{10})]</a>}|json_encode)], "texte": [(#VAL{<a class="modalbox" title="Détail" href="[(#URL_PAGE{gamutable_texte}|parametre_url{id_article,#ID_ARTICLE})]">[(#TEXTE|couper{10})]</a>}|json_encode)],
"statut" : [(#GET{statut}|json_encode)] "statut" : [(#GET{statut}|json_encode)]
@ -47,9 +50,13 @@
"classes": { "classes": {
"texte": [(#STATUT|concat{-}|concat{#ID_ARTICLE}|json_encode)] "texte": [(#STATUT|concat{-}|concat{#ID_ARTICLE}|json_encode)]
}, },
"crayons": {
"nom": #ID_AUTEUR
},
"search": { "search": {
"id": #ID_ARTICLE, "id": #ID_ARTICLE,
"titre" : [(#TITRE|json_encode)], "titre" : [(#TITRE|json_encode)],
"nom" : [(#NOM|json_encode)],
"date" : [(#DATE|affdate{U}|json_encode)], "date" : [(#DATE|affdate{U}|json_encode)],
"texte": [(#TEXTE|couper{10}|json_encode)], "texte": [(#TEXTE|couper{10}|json_encode)],
"statut" : [(#STATUT|json_encode)] "statut" : [(#STATUT|json_encode)]