fix: les datas ne sont pas attachées à this

This commit is contained in:
Christophe 2023-01-20 16:56:30 +01:00
parent 3921ce0709
commit 73d9a47160
3 changed files with 11 additions and 4 deletions

File diff suppressed because one or more lines are too long

2
dist/manifest.json vendored
View file

@ -1,6 +1,6 @@
{ {
"gamutable.js": { "gamutable.js": {
"file": "assets/gamutable.43aa3660.js", "file": "assets/gamutable.fc8c39d9.js",
"src": "gamutable.js", "src": "gamutable.js",
"isEntry": true, "isEntry": true,
"imports": [ "imports": [

View file

@ -959,7 +959,11 @@ function selectLigne(id, col) {
} }
function genererPDF(quoi = "tableau") { function genererPDF(quoi = "tableau") {
let $tableau = []; let $tableau = [];
Object.values(this[quoi]).forEach((d) => { let surQuoi = tableau.value;
if (quoi === "table") {
surQuoi = table.value;
}
Object.values(surQuoi).forEach((d) => {
$tableau.push(d.html); $tableau.push(d.html);
}); });
@ -987,8 +991,12 @@ function exportCSV(quoi = "tableau") {
let $csv = []; let $csv = [];
let $header = []; let $header = [];
let $tableau = []; let $tableau = [];
let surQuoi = tableau.value;
if (quoi === "table") {
surQuoi = table.value;
}
Object.keys(header.value).forEach((k) => $header.push(k)); Object.keys(header.value).forEach((k) => $header.push(k));
$tableau = this[quoi].reduce((acc, ligne) => { $tableau = surQuoi.reduce((acc, ligne) => {
let $uneLigne = []; let $uneLigne = [];
Object.values(ligne[props.champcsv]).forEach((l) => $uneLigne.push(l)); Object.values(ligne[props.champcsv]).forEach((l) => $uneLigne.push(l));
return [...acc, [...$uneLigne]]; return [...acc, [...$uneLigne]];