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;
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,
'Désignation': 15,
'Tarif': 3,
'PVC': 3,
- 'Image': 5,
+ 'Image': 7,
'PACK': 2
};
var fmt = {
numFmt: fmt[v],
style: {numFmt: fmt[v], alignment: {vertical: 'middle', horizontal: 'left'}},
width: widths[v] * 4,
- height: 4,
});
});
}
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) {