From 442e63380095f08cd23bbf2599bbdcd548c81a6d Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 11 Dec 2021 14:46:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E6=AD=8C=E6=9B=B2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/index.dev.js | 2 +- src/renderer/components/common/ListAddModal.vue | 10 +++++----- .../components/common/ListAddMultipleModal.vue | 10 +++++----- src/renderer/store/modules/list.js | 8 ++++---- src/renderer/views/list/components/MusicList/index.vue | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/index.dev.js b/src/main/index.dev.js index 79a2a276..8952eae9 100644 --- a/src/main/index.dev.js +++ b/src/main/index.dev.js @@ -12,7 +12,7 @@ electronDebug({ showDevTools: true, devToolsMode: 'undocked', }) -console.log(VUEJS3_DEVTOOLS) + // Install `vue-devtools` electron.app.on('ready', () => { installExtension(VUEJS3_DEVTOOLS) diff --git a/src/renderer/components/common/ListAddModal.vue b/src/renderer/components/common/ListAddModal.vue index 08f23fed..5a5f6904 100644 --- a/src/renderer/components/common/ListAddModal.vue +++ b/src/renderer/components/common/ListAddModal.vue @@ -41,10 +41,10 @@ export default { return [] }, }, - listName: { - type: String, - default: '', - }, + // listName: { + // type: String, + // default: '', + // }, fromListId: { type: String, default: null, @@ -96,7 +96,7 @@ export default { }, handleEditing(event) { if (this.isEditing) return - if (!this.newListName) this.newListName = this.listName + // if (!this.newListName) this.newListName = this.listName this.isEditing = true this.$nextTick(() => event.currentTarget.querySelector('.' + this.$style.newListInput).focus()) }, diff --git a/src/renderer/components/common/ListAddMultipleModal.vue b/src/renderer/components/common/ListAddMultipleModal.vue index 77a28731..079c3aeb 100644 --- a/src/renderer/components/common/ListAddMultipleModal.vue +++ b/src/renderer/components/common/ListAddMultipleModal.vue @@ -43,10 +43,10 @@ export default { return [] }, }, - listName: { - type: String, - default: '', - }, + // listName: { + // type: String, + // default: '', + // }, fromListId: { type: String, default: null, @@ -98,7 +98,7 @@ export default { }, handleEditing(event) { if (this.isEditing) return - if (!this.newListName) this.newListName = this.listName + // if (!this.newListName) this.newListName = this.listName this.isEditing = true this.$nextTick(() => event.currentTarget.querySelector('.' + this.$style.newListInput).focus()) }, diff --git a/src/renderer/store/modules/list.js b/src/renderer/store/modules/list.js index 1a24a212..6c9865ea 100644 --- a/src/renderer/store/modules/list.js +++ b/src/renderer/store/modules/list.js @@ -153,16 +153,16 @@ const mutations = { const fromList = allList[fromId] const toList = allList[toId] if (!fromList || !toList) return - fromList.list.splice(fromList.list.findIndex(s => s.songmid === musicInfo.songmid), 1) - let index = toList.list.findIndex(s => s.songmid === musicInfo.songmid) + fromList.splice(fromList.findIndex(s => s.songmid === musicInfo.songmid), 1) + let index = toList.findIndex(s => s.songmid === musicInfo.songmid) if (index < 0) { switch (this.state.setting.list.addMusicLocationType) { case 'top': - toList.list.unshift(musicInfo) + toList.unshift(musicInfo) break case 'bottom': default: - toList.list.push(musicInfo) + toList.push(musicInfo) break } } diff --git a/src/renderer/views/list/components/MusicList/index.vue b/src/renderer/views/list/components/MusicList/index.vue index 0e639888..382f479e 100644 --- a/src/renderer/views/list/components/MusicList/index.vue +++ b/src/renderer/views/list/components/MusicList/index.vue @@ -34,8 +34,8 @@ div(:class="$style.list") //- material-flow-btn(:show="isShowEditBtn && assertApiSupport(source)" :remove-btn="false" @btn-click="handleFlowBtnClick") common-download-modal(v-model:show="isShowDownload" :musicInfo="selectedDownloadMusicInfo" teleport="#view") common-download-multiple-modal(v-model:show="isShowDownloadMultiple" :list="selectedList" @confirm="removeAllSelect" teleport="#view") - common-list-add-modal(v-model:show="isShowListAdd" :is-move="isMove" :musicInfo="selectedAddMusicInfo" :exclude-list-id="excludeListIds" teleport="#view") - common-list-add-multiple-modal(v-model:show="isShowListAddMultiple" :is-move="isMoveMultiple" :musicList="selectedList" @confirm="removeAllSelect" :exclude-list-id="excludeListIds" teleport="#view") + common-list-add-modal(v-model:show="isShowListAdd" :is-move="isMove" :from-list-id="listId" :musicInfo="selectedAddMusicInfo" :exclude-list-id="excludeListIds" teleport="#view") + common-list-add-multiple-modal(v-model:show="isShowListAddMultiple" :from-list-id="listId" :is-move="isMoveMultiple" :musicList="selectedList" @confirm="removeAllSelect" :exclude-list-id="excludeListIds" teleport="#view") search-list(:list="list" @action="handleMusicSearchAction" :visible="isShowSearchBar") music-sort-modal(v-model:show="isShowMusicSortModal" :music-info="selectedSortMusicInfo" :selected-num="selectedNum" @confirm="sortMusic") base-menu(:menus="menus" :location="menuLocation" item-name="name" :isShow="isShowItemMenu" @menu-click="handleMenuClick")