From 536ede0beda0381d67c953b6129c639b7d92e50a Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 10 Mar 2021 19:49:31 +0100 Subject: [PATCH] wip #4253 @0.5 --- js/libs/fluidbook/cart/fluidbook.cart.puma.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/js/libs/fluidbook/cart/fluidbook.cart.puma.js b/js/libs/fluidbook/cart/fluidbook.cart.puma.js index adb173ba..b475c9e2 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.puma.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.puma.js @@ -90,6 +90,11 @@ FluidbookCartPuma.prototype = { return ['Catalogue', 'Catégorie', 'Ligne', 'Sexe', 'Modèle', 'Couleur', 'Désignation', 'Tarif', 'PVC', 'Image', 'PACK']; }, + getExcelColumns: function () { + return ['Image', 'Catalogue', 'Catégorie', 'Ligne', 'Sexe', 'Modèle', 'Couleur', 'Désignation', 'Tarif', 'PVC', 'PACK']; + }, + + getItems: function () { var res = []; var $this = this; @@ -175,8 +180,8 @@ FluidbookCartPuma.prototype = { sheet.views = [ {state: 'frozen', xSplit: 0, ySplit: 1, topLeftCell: 'A2', activeCell: 'A2'} ]; - sheet.properties.defaultRowHeight = 60; - var columnsLabels = this.getColumns(); + sheet.properties.defaultRowHeight = 15; + var columnsLabels = this.getExcelColumns(); var columns = []; var widths = { 'Catalogue': 5, @@ -188,7 +193,7 @@ FluidbookCartPuma.prototype = { 'Désignation': 15, 'Tarif': 3, 'PVC': 3, - 'Image': 5, + 'Image': 7, 'PACK': 2 }; var fmt = { @@ -212,7 +217,6 @@ FluidbookCartPuma.prototype = { numFmt: fmt[v], style: {numFmt: fmt[v], alignment: {vertical: 'middle', horizontal: 'left'}}, width: widths[v] * 4, - height: 4, }); }); @@ -227,19 +231,19 @@ FluidbookCartPuma.prototype = { } row[v] = val; }); - sheet.addRow(row); + var r=sheet.addRow(row); + r.height=Math.round(150/$this.data[ref]['zoom_image_ratio']); }); $.each(columnsLabels, function (k, v) { sheet.getColumn(k + 1).numFmt = fmt[v]; }); // $.each(this.getItems(), function (i, ref) { - var img = workbook.addImage({ base64: 'data:image/jpeg;base64,' + $this.data[ref]['zoom_url'], extension: 'jpeg', }); - sheet.addImage(img, {tl: {col: 9, row: i + 1}, br: {col: 10, row: i + 2}, editAs: 'oneCell'}); + sheet.addImage(img, {tl: {col:0, row: i + 1}, br: {col: 1, row: i + 2}, editAs: 'twoCell'}); }); workbook.xlsx.writeBuffer().then(function (data) { -- 2.39.5