]> _ Git - fluidbook-html5.git/commitdiff
wip #4253 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 10 Mar 2021 18:49:31 +0000 (19:49 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 10 Mar 2021 18:49:31 +0000 (19:49 +0100)
js/libs/fluidbook/cart/fluidbook.cart.puma.js

index adb173bae90094daac19401394c347765ed27596..b475c9e2a9cddfd1286eec94615ceb47850486c1 100644 (file)
@@ -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) {