为CSV格式添加头部
parent
27ce62dd4f
commit
e15518cd51
|
@ -303,8 +303,7 @@ export default {
|
||||||
.listsContent {
|
.listsContent {
|
||||||
flex: auto;
|
flex: auto;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll !important;
|
||||||
overflow-x: hidden;
|
|
||||||
// border-right: 1px solid rgba(0, 0, 0, 0.12);
|
// border-right: 1px solid rgba(0, 0, 0, 0.12);
|
||||||
}
|
}
|
||||||
.listsItem {
|
.listsItem {
|
||||||
|
|
|
@ -473,8 +473,7 @@ export default {
|
||||||
.listsContent {
|
.listsContent {
|
||||||
flex: auto;
|
flex: auto;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll !important;
|
||||||
overflow-x: hidden;
|
|
||||||
// border-right: 1px solid rgba(0, 0, 0, 0.12);
|
// border-right: 1px solid rgba(0, 0, 0, 0.12);
|
||||||
}
|
}
|
||||||
.listsItem {
|
.listsItem {
|
||||||
|
|
|
@ -288,11 +288,12 @@ export default {
|
||||||
if (/,/.test(str)) str = `"${str}"`
|
if (/,/.test(str)) str = `"${str}"`
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
|
const header = '歌曲名,艺术家,专辑名\n'
|
||||||
if (isMerge) {
|
if (isMerge) {
|
||||||
saveStrToFile(savePath, iconv.encode(lists.map(l => l.list.map(m => `${filterStr(m.name)},${filterStr(m.singer)},${filterStr(m.albumName)}`).join('\n')).join('\n'), 'utf8', { addBOM: true }))
|
saveStrToFile(savePath, iconv.encode(header + lists.map(l => l.list.map(m => `${filterStr(m.name)},${filterStr(m.singer)},${filterStr(m.albumName)}`).join('\n')).join('\n'), 'utf8', { addBOM: true }))
|
||||||
} else {
|
} else {
|
||||||
for await (const list of lists) {
|
for await (const list of lists) {
|
||||||
await saveStrToFile(path.join(savePath, `lx_list_${filterFileName(list.name)}.csv`), iconv.encode(list.list.map(m => `${filterStr(m.name)},${filterStr(m.singer)},${filterStr(m.albumName)}`).join('\n'), 'utf8', { addBOM: true }))
|
await saveStrToFile(path.join(savePath, `lx_list_${filterFileName(list.name)}.csv`), iconv.encode(header + list.list.map(m => `${filterStr(m.name)},${filterStr(m.singer)},${filterStr(m.albumName)}`).join('\n'), 'utf8', { addBOM: true }))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue