js-downloadexcel
Advanced tools
Comparing version 0.0.3 to 0.0.4
21
index.js
@@ -50,5 +50,3 @@ // import XLSX from "js-xlsxstyle" | ||
v: v[k], | ||
position: | ||
(j > 25 ? getCharCol(j) : String.fromCharCode(65 + j)) + | ||
(i + 1) | ||
position: (j > 25 ? getCharCol(j) : String.fromCharCode(65 + j)) + (i + 1) | ||
}) | ||
@@ -65,3 +63,3 @@ )).reduce((prev, next) => prev.concat(next)) | ||
} | ||
}; | ||
@@ -151,1 +149,16 @@ if (colorSetting && colorSetting.length > 0) { | ||
} | ||
exports.getColorPosition = (json, cb, regEx) => { | ||
let temp = json[getMaxLenObj(json)], keyMap = [], newArr = [{}] | ||
for (var k in temp) { | ||
keyMap.push(k) | ||
newArr[0][k] = k | ||
} | ||
newArr = newArr.concat(json) | ||
let arr = newArr.map((v, i) => keyMap.map((k, j) => Object.assign({}, { | ||
v: v[k], | ||
position: regEx.test(v[k]) ? (j > 25 ? getCharCol(j) : String.fromCharCode(65 + j)) + (i + 1) : '', | ||
...cb(v[k]) | ||
}))).reduce((prev, next) => prev.concat(next)) | ||
return arr | ||
} |
{ | ||
"name": "js-downloadexcel", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "下载excel", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
5922
153