@gingkoo/base-server 0.4.29 → 0.4.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -28,6 +28,13 @@ const tableHeaderStyle = {
|
|
|
28
28
|
const normalizeColor = (color) => {
|
|
29
29
|
if (!color) return null;
|
|
30
30
|
let hex = color.replace('#', '');
|
|
31
|
+
// 兼容 3 位简写色值,如 #ff4 -> #ffff44
|
|
32
|
+
if (hex.length === 3) {
|
|
33
|
+
hex = hex
|
|
34
|
+
.split('')
|
|
35
|
+
.map((char) => char + char)
|
|
36
|
+
.join('');
|
|
37
|
+
}
|
|
31
38
|
// 如果是 6 位色值,补上 FF(完全不透明)
|
|
32
39
|
if (hex.length === 6) {
|
|
33
40
|
hex = 'FF' + hex;
|
|
@@ -216,7 +223,7 @@ async function setSheetData(workbook, sheetdata, options = {}) {
|
|
|
216
223
|
|
|
217
224
|
let headerRow = worksheet.getRow(1);
|
|
218
225
|
headerRow.eachCell((cell, colNumber) => {
|
|
219
|
-
cell.style = tableHeaderStyle;
|
|
226
|
+
cell.style = _.cloneDeep(tableHeaderStyle);
|
|
220
227
|
|
|
221
228
|
// 应用 cols 中定义的样式
|
|
222
229
|
const col = cols[colNumber - 1];
|