mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
fix songlist export
This commit is contained in:
10
.eslintrc.js
10
.eslintrc.js
@@ -2,12 +2,16 @@ module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
node: true,
|
||||
'vite/config': true, // 添加Vite环境支持
|
||||
},
|
||||
extends: ['@vue/typescript/recommended', 'plugin:vue/vue3-essential', 'prettier', '@vue/eslint-config-typescript'],
|
||||
parser: '@babel/eslint-parser',
|
||||
extends: [
|
||||
'@vue/typescript/recommended',
|
||||
'plugin:vue/vue3-essential',
|
||||
'prettier',
|
||||
'@vue/eslint-config-typescript',
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
requireConfigFile: false,
|
||||
},
|
||||
rules: {
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
|
||||
45
.yarnclean
Normal file
45
.yarnclean
Normal file
@@ -0,0 +1,45 @@
|
||||
# test directories
|
||||
__tests__
|
||||
test
|
||||
tests
|
||||
powered-test
|
||||
|
||||
# asset directories
|
||||
docs
|
||||
doc
|
||||
website
|
||||
images
|
||||
assets
|
||||
|
||||
# examples
|
||||
example
|
||||
examples
|
||||
|
||||
# code coverage directories
|
||||
coverage
|
||||
.nyc_output
|
||||
|
||||
# build scripts
|
||||
Makefile
|
||||
Gulpfile.js
|
||||
Gruntfile.js
|
||||
|
||||
# configs
|
||||
appveyor.yml
|
||||
circle.yml
|
||||
codeship-services.yml
|
||||
codeship-steps.yml
|
||||
wercker.yml
|
||||
.tern-project
|
||||
.gitattributes
|
||||
.editorconfig
|
||||
.*ignore
|
||||
.eslintrc
|
||||
.jshintrc
|
||||
.flowconfig
|
||||
.documentup.json
|
||||
.yarn-metadata.json
|
||||
.travis.yml
|
||||
|
||||
# misc
|
||||
*.md
|
||||
@@ -1,3 +0,0 @@
|
||||
export const presets = [
|
||||
'@vue/cli-plugin-babel/preset',
|
||||
];
|
||||
@@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
'*.{js,jsx,vue,ts,tsx}': 'vue-cli-service lint',
|
||||
};
|
||||
20
package.json
20
package.json
@@ -10,58 +10,48 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "^20.10.5",
|
||||
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
||||
"@vicons/fluent": "^0.12.0",
|
||||
"@vitejs/plugin-vue": "^4.2.3",
|
||||
"@vueuse/core": "^10.1.2",
|
||||
"@vueuse/integrations": "^10.1.2",
|
||||
"@vueuse/router": "^10.1.2",
|
||||
"core-js": "^3.8.3",
|
||||
"date-fns": "^2.30.0",
|
||||
"easy-speech": "^2.2.0",
|
||||
"echarts": "^5.4.3",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"fast-xml-parser": "^4.3.2",
|
||||
"file-saver": "^2.0.5",
|
||||
"grapheme-splitter": "^1.0.4",
|
||||
"html2canvas": "^1.4.1",
|
||||
"linqts": "^1.15.0",
|
||||
"mitt": "^3.0.1",
|
||||
"prettier": "^3.1.1",
|
||||
"qrcode.vue": "^3.4.1",
|
||||
"queue-typescript": "^1.0.1",
|
||||
"universal-cookie": "^6.1.1",
|
||||
"vite": "^5.0.10",
|
||||
"vite-svg-loader": "^5.1.0",
|
||||
"vue": "^3.3.12",
|
||||
"vue-echarts": "^6.6.5",
|
||||
"vue-meta": "^3.0.0-alpha.10",
|
||||
"vue-request": "^2.0.3",
|
||||
"vue-router": "4",
|
||||
"vue-turnstile": "^1.0.6",
|
||||
"vue3-aplayer": "^1.7.3",
|
||||
"vue3-marquee": "^4.1.0",
|
||||
"vueuc": "^0.4.51",
|
||||
"vuex": "^4.0.0",
|
||||
"worker-timers": "^7.0.78"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/eslint-parser": "^7.21.3",
|
||||
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
||||
"@typescript-eslint/parser": "^6.14.0",
|
||||
"@vicons/ionicons5": "^0.12.0",
|
||||
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
||||
"@vue/cli-plugin-babel": "^5.0.8",
|
||||
"@vue/eslint-config-airbnb": "^7.0.1",
|
||||
"@vue/eslint-config-typescript": "^12.0.0",
|
||||
"eslint": "^8.39.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-import": "^2.25.3",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"eslint-plugin-vue": "^9.11.0",
|
||||
"eslint-plugin-vuejs-accessibility": "^2.2.0",
|
||||
"lint-staged": "^15.2.0",
|
||||
"naive-ui": "^2.34.3",
|
||||
"prettier": "^3.1.1",
|
||||
"stylus": "^0.62.0",
|
||||
"typescript": "~5.3.3",
|
||||
"vite-plugin-mkcert": "^1.16.0"
|
||||
"typescript": "~5.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@ import {
|
||||
NInputGroup,
|
||||
NInputGroupLabel,
|
||||
NInputNumber,
|
||||
NList,
|
||||
NListItem,
|
||||
NModal,
|
||||
NPopconfirm,
|
||||
NSelect,
|
||||
@@ -38,8 +36,7 @@ import {
|
||||
NTooltip,
|
||||
useMessage,
|
||||
} from 'naive-ui'
|
||||
import { onMounted, h, ref, watch, computed, reactive, VNodeChild } from 'vue'
|
||||
import APlayer from 'vue3-aplayer'
|
||||
import { onMounted, h, ref, watch, computed, VNodeChild } from 'vue'
|
||||
import { NotepadEdit20Filled, Delete24Filled, Play24Filled, SquareArrowForward24Filled, Info24Filled } from '@vicons/fluent'
|
||||
import NeteaseIcon from '@/svgs/netease.svg'
|
||||
import FiveSingIcon from '@/svgs/fivesing.svg'
|
||||
|
||||
@@ -187,8 +187,9 @@ async function ChangeBili() {
|
||||
注册
|
||||
</NText>
|
||||
</NSpace>
|
||||
|
||||
<NDivider />
|
||||
<NDivider>
|
||||
<NText depth="3" style="font-size: 18px"> {{ accountInfo?.id }} </NText>
|
||||
</NDivider>
|
||||
<NSpace vertical>
|
||||
<NCard size="small">
|
||||
<NSpace :size="5">
|
||||
|
||||
@@ -51,10 +51,10 @@ const neteaseSongListId = computed(() => {
|
||||
const url = new URL(neteaseIdInput.value)
|
||||
console.log(url)
|
||||
if (url.host == 'music.163.com') {
|
||||
let regex = /id=(\d+)/
|
||||
const regex = /id=(\d+)/
|
||||
|
||||
// 使用exec方法在链接中查找匹配项
|
||||
let match = regex.exec(neteaseIdInput.value)
|
||||
const match = regex.exec(neteaseIdInput.value)
|
||||
|
||||
// 如果找到了匹配项,那么match[1]就是分组1的值,也就是id的值
|
||||
if (match) {
|
||||
@@ -233,7 +233,7 @@ async function addSongs(songsShoudAdd: SongsInfo[], from: SongFrom) {
|
||||
Author: s.author,
|
||||
Url: s.url,
|
||||
Description: s.description,
|
||||
}))
|
||||
})),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -345,6 +345,16 @@ async function getSongs() {
|
||||
})
|
||||
}
|
||||
function exportData() {
|
||||
const from = (f: SongFrom) => {
|
||||
switch (f) {
|
||||
case SongFrom.Custom:
|
||||
return '手动添加'
|
||||
case SongFrom.Netease:
|
||||
return '网易云'
|
||||
case SongFrom.FiveSing:
|
||||
return '5sing'
|
||||
}
|
||||
}
|
||||
const text = objectsToCSV(
|
||||
songs.value.map((s) => ({
|
||||
id: s.id,
|
||||
@@ -358,19 +368,12 @@ function exportData() {
|
||||
语言: s.language.map((l) => songSelectOption.find((o) => o.value == l)?.label).join(','),
|
||||
标签: s.tags?.join(',') ?? '',
|
||||
链接: s.url,
|
||||
}))
|
||||
})),
|
||||
)
|
||||
const from = (f: SongFrom) => {
|
||||
switch (f) {
|
||||
case SongFrom.Custom:
|
||||
return '手动添加'
|
||||
case SongFrom.Netease:
|
||||
return '网易云'
|
||||
case SongFrom.FiveSing:
|
||||
return '5sing'
|
||||
}
|
||||
}
|
||||
saveAs(new Blob([text], { type: 'text/plain;charset=utf-8' }), `歌单_${format(Date.now(), 'yyyy-MM-dd HH:mm:ss')}_${accountInfo.value?.name}_.csv`)
|
||||
const BOM = new Uint8Array([0xef, 0xbb, 0xbf])
|
||||
const utf8encoder = new TextEncoder()
|
||||
const utf8array = utf8encoder.encode(text)
|
||||
saveAs(new Blob([BOM, utf8array], { type: 'text/csv;charset=utf-8;' }), `歌单_${format(Date.now(), 'yyyy-MM-dd HH:mm:ss')}_${accountInfo.value?.name}_.csv`)
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
@@ -433,11 +436,17 @@ onMounted(async () => {
|
||||
<NSpace vertical>
|
||||
<NCheckbox
|
||||
:checked="addSongModel.options != undefined"
|
||||
@update:checked="(checked: boolean) => {addSongModel.options = checked ? {
|
||||
@update:checked="
|
||||
(checked: boolean) => {
|
||||
addSongModel.options = checked
|
||||
? ({
|
||||
needJianzhang: false,
|
||||
needTidu: false,
|
||||
needZongdu: false
|
||||
} as SongRequestOption : undefined}"
|
||||
needZongdu: false,
|
||||
} as SongRequestOption)
|
||||
: undefined
|
||||
}
|
||||
"
|
||||
>
|
||||
是否启用
|
||||
</NCheckbox>
|
||||
@@ -450,7 +459,11 @@ onMounted(async () => {
|
||||
<NSpace align="center">
|
||||
<NCheckbox
|
||||
:checked="addSongModel.options.scMinPrice != undefined"
|
||||
@update:checked="(checked: boolean) => {if(addSongModel.options) addSongModel.options.scMinPrice = checked ? 30 : undefined}"
|
||||
@update:checked="
|
||||
(checked: boolean) => {
|
||||
if (addSongModel.options) addSongModel.options.scMinPrice = checked ? 30 : undefined
|
||||
}
|
||||
"
|
||||
>
|
||||
需要SC
|
||||
</NCheckbox>
|
||||
@@ -462,7 +475,11 @@ onMounted(async () => {
|
||||
<NSpace align="center">
|
||||
<NCheckbox
|
||||
:checked="addSongModel.options.fanMedalMinLevel != undefined"
|
||||
@update:checked="(checked: boolean) => {if(addSongModel.options) addSongModel.options.fanMedalMinLevel = checked ? 5 : undefined}"
|
||||
@update:checked="
|
||||
(checked: boolean) => {
|
||||
if (addSongModel.options) addSongModel.options.fanMedalMinLevel = checked ? 5 : undefined
|
||||
}
|
||||
"
|
||||
>
|
||||
需要粉丝牌
|
||||
<NTooltip>
|
||||
|
||||
Reference in New Issue
Block a user