修改下划线分隔的字段

This commit is contained in:
2026-03-21 01:26:06 +08:00
parent 499951f9da
commit a0e49ceda6
17 changed files with 83 additions and 83 deletions
+2 -2
View File
@@ -38,9 +38,9 @@
<el-table-column prop="from" label="来自" width="180"/>
<el-table-column prop="creator" label="作者" width="180"/>
<el-table-column prop="number" label="编号" width="70"/>
<el-table-column prop="created_at" label="创建时间" width="180">
<el-table-column prop="createdAt" label="创建时间" width="180">
<template #default="scope">
{{ datetimeFormat(scope.row.created_at) }}
{{ datetimeFormat(scope.row.createdAt) }}
</template>
</el-table-column>
</el-table>
+18 -18
View File
@@ -5,7 +5,7 @@
<el-input v-model="search.name" />
</el-form-item>
<el-form-item label="所属歌单">
<el-select v-model="search.lib_id" multiple collapse-tags>
<el-select v-model="search.libId" multiple collapse-tags>
<el-option v-for="musicLib in musicLibs" :key="musicLib._id" :value="musicLib._id" :label="musicLib.name" />
</el-select>
</el-form-item>
@@ -45,25 +45,25 @@
<el-table-column prop="title" label="标题" show-overflow-tooltip />
<el-table-column prop="album" label="唱片集" />
<el-table-column prop="artist" label="艺术家" />
<el-table-column prop="lib_id" label="所属歌单" >
<el-table-column prop="libId" label="所属歌单" >
<template #default="scope">
<template v-if="scope.row.isEditing && currentRow">
<el-select v-model="currentRow.lib_id">
<el-select v-model="currentRow.libId">
<el-option v-for="musicLib in musicLibs" :key="musicLib._id" :value="musicLib._id" :label="musicLib.name" />
</el-select>
<el-button link icon="Check" type="primary" @click="saveMusicLib(scope.row)"></el-button>
<el-button link icon="Close" type="primary" @click="scope.row.isEditing = false"></el-button>
</template>
<template v-else>
{{ findMusicLib(scope.row.lib_id) }}
{{ findMusicLib(scope.row.libId) }}
<el-button link icon="Edit" type="primary" @click="updateLib(scope.row)"></el-button>
</template>
</template>
</el-table-column>
<el-table-column prop="lyric_id" label="歌词" width="120" >
<el-table-column prop="lyricId" label="歌词" width="120" >
<template #default="scope">
<div style="width: 18px">
<Check v-if="scope.row.lyric_id" />
<Check v-if="scope.row.lyricId" />
<Close v-else/>
</div>
</template>
@@ -89,8 +89,8 @@
</div>
<el-dialog v-model="modifyLyricModal" title="编辑歌词" :width="600" >
<el-form ref="lyricForm" :model="lyricFormData" :rules="lyricRuleValidate" :label-width="120">
<el-form-item label="网易云ID" prop="cloud_id">
<el-input v-model="lyricFormData.cloud_id" />
<el-form-item label="网易云ID" prop="cloudId">
<el-input v-model="lyricFormData.cloudId" />
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="lyricFormData.name" />
@@ -166,7 +166,7 @@ class MusicPage extends Page {
title?: string
album?: string
artist?: string
lib_id?: string[] = []
libId?: string[] = []
reset() {
super.reset()
this.name = undefined
@@ -174,7 +174,7 @@ class MusicPage extends Page {
this.title = undefined
this.album = undefined
this.artist = undefined
this.lib_id = []
this.libId = []
}
}
@@ -197,7 +197,7 @@ const musicUpload = ref<UploadInstance>()
const player = ref<any>()
const lyricRuleValidate = {
cloud_id: [
cloudId: [
{ required: true, message: '请输入网易云ID', trigger: 'blur' }
],
name: [
@@ -239,8 +239,8 @@ async function playMusic() {
src: `/api/v2/common/music/load/${item._id}`,
pic: `/api/v2/common/music/album/${item._id}`,
}
if (item.lyric_id) {
musicItem.lrc = `${location.origin}/api/v2/common/music/lyric/${item.lyric_id}`
if (item.lyricId) {
musicItem.lrc = `${location.origin}/api/v2/common/music/lyric/${item.lyricId}`
}
return musicItem
})
@@ -272,9 +272,9 @@ function remove(row: MusicModel) {
async function updateLyric(row: MusicModel) {
currentRow.value = { ...row }
modifyLyricModal.value = true
if (row.lyric_id) {
const data = (await http.get<any, any>('/api/v2/music/lyric/get', {params: {lyricId: row.lyric_id}}))
data.cloud_id = data.cloud_id ? data.cloud_id.toString() : null
if (row.lyricId) {
const data = (await http.get<any, any>('/api/v2/music/lyric/get', {params: {lyricId: row.lyricId}}))
data.cloudId = data.cloudId ? data.cloudId.toString() : null
lyricFormData.value = data
} else {
lyricFormData.value = {}
@@ -294,9 +294,9 @@ async function saveLyric() {
}
async function saveMusicLib(row: MusicModel) {
if (!currentRow.value) return
const data = await http.post<{id: string, libId: string}, any>('/api/v2/music/updateLib', {id: currentRow.value._id, libId: currentRow.value.lib_id})
const data = await http.post<{id: string, libId: string}, any>('/api/v2/music/updateLib', {id: currentRow.value._id, libId: currentRow.value.libId})
ElMessage.success(data.message)
row.lib_id = currentRow.value.lib_id
row.libId = currentRow.value.libId
row.isEditing = false
}
function openUploadModal() {
+2 -2
View File
@@ -35,9 +35,9 @@
<el-tag v-for="label in scope.row.label" :key="label" effect="plain">{{label}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="created_at" label="上传时间" >
<el-table-column prop="createdAt" label="上传时间" >
<template #default="scope">
{{ datetimeFormat(scope.row.created_at) }}
{{ datetimeFormat(scope.row.createdAt) }}
</template>
</el-table-column>
<el-table-column label="操作" >