diff --git a/publish/changeLog.md b/publish/changeLog.md index 9495d007..7b7185d4 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -3,6 +3,7 @@ - 播放详情页新增音量控制条 - 播放详情页新增桌面歌词切换按钮 - 新增将我的列表保存为TXT、CSV格式,可以去设置-备份与恢复中使用(注意:此类格式的备份目前不支持恢复到LX Music中) +- 新增根据歌曲名、歌手名等字段对列表自动排序的功能,可以在我的列表右击列表名弹出的菜单中使用 ### 优化 diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 5c14e0ad..cce9ea10 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -14,7 +14,7 @@ "comment__refresh": "Refresh comments", "comment__show": "Song comments", "comment__title": "{name} comment", - "confirm_button_text": "OK", + "confirm_button_text": "Yes", "copy_tip": " (Click to copy)", "date_format_hour": "{num} hours ago", "date_format_minute": "{num} minutes ago", @@ -91,6 +91,16 @@ "list_add__title_first_add": "Add", "list_add__title_first_move": "Move", "list_add__title_last": "to...", + "list_sort_modal_by_album": "Album name", + "list_sort_modal_by_down": "Descending", + "list_sort_modal_by_field": "Sort field", + "list_sort_modal_by_name": "Song name", + "list_sort_modal_by_singer": "Singer name", + "list_sort_modal_by_source": "Song source", + "list_sort_modal_by_time": "Duration", + "list_sort_modal_by_type": "Sort categories", + "list_sort_modal_by_up": "Ascending", + "list_sort_modal_tip_confirm": "Are you sure you want to do this?", "lists__duplicate": "Duplicate song", "lists__export": "Export", "lists__export_part_desc": "Choose where to save the list file", @@ -107,6 +117,7 @@ "lists__remove_tip": "Do you really want to remove {name}?", "lists__remove_tip_button": "Yes, that's right", "lists__rename": "Rename", + "lists__sort_list": "Sort", "lists__sync": "Update", "load_list_file_error_detail": "We have helped you back up the old list file to {path}\nIt is stored in JSON format, you can try to repair and restore it manually\n\nError details: {detail}", "load_list_file_error_title": "Error loading playlist data", @@ -119,6 +130,7 @@ "music_duplicate": "Duplicate song", "music_name": "Name", "music_singer": "Artist", + "music_sort__btn_cancel": "Cancel", "music_sort__btn_confirm": "Confirm", "music_sort__input_tip": "Please input which position you want to adjust to", "music_sort__title": "Adjust the position of {name} to:", diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index df5f99bd..50013594 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -14,7 +14,7 @@ "comment__refresh": "刷新评论", "comment__show": "歌曲评论", "comment__title": "{name} 的评论", - "confirm_button_text": "好的", + "confirm_button_text": "是的", "copy_tip": "(点击复制)", "date_format_hour": "{num}小时前", "date_format_minute": "{num}分钟前", @@ -91,6 +91,16 @@ "list_add__title_first_add": "添加", "list_add__title_first_move": "移动", "list_add__title_last": "到...", + "list_sort_modal_by_album": "专辑名", + "list_sort_modal_by_down": "降序", + "list_sort_modal_by_field": "排序字段", + "list_sort_modal_by_name": "歌曲名", + "list_sort_modal_by_singer": "歌手名", + "list_sort_modal_by_source": "歌曲源", + "list_sort_modal_by_time": "时长", + "list_sort_modal_by_type": "排序类别", + "list_sort_modal_by_up": "升序", + "list_sort_modal_tip_confirm": "你确定要这么做吗?", "lists__duplicate": "重复歌曲", "lists__export": "导出", "lists__export_part_desc": "选择列表文件保存位置", @@ -107,6 +117,7 @@ "lists__remove_tip": "你真的想要移除 {name} 吗?", "lists__remove_tip_button": "是的 没错", "lists__rename": "重命名", + "lists__sort_list": "排序", "lists__sync": "更新", "load_list_file_error_detail": "我们已经帮你把旧的列表文件备份到{path}\n它以 JSON 格式存储,你可以尝试手动修复并恢复它\n\n错误详情:{detail}", "load_list_file_error_title": "播放列表数据加载错误(建议到GitHub或加群反馈)", @@ -119,6 +130,7 @@ "music_duplicate": "重复歌曲", "music_name": "歌曲名", "music_singer": "歌手", + "music_sort__btn_cancel": "取消", "music_sort__btn_confirm": "确定", "music_sort__input_tip": "请输入要调整到第几个位置", "music_sort__title": "将 {name} 的位置调整到:", diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index 99fa5b04..b8febb69 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -14,7 +14,7 @@ "comment__refresh": "刷新評論", "comment__show": "歌曲評論", "comment__title": "{name} 的評論", - "confirm_button_text": "好的", + "confirm_button_text": "是的", "copy_tip": "(點擊複製)", "date_format_hour": "{num}小時前", "date_format_minute": "{num}分鐘前", @@ -91,6 +91,16 @@ "list_add__title_first_add": "添加", "list_add__title_first_move": "移動", "list_add__title_last": "到...", + "list_sort_modal_by_album": "專輯名", + "list_sort_modal_by_down": "降序", + "list_sort_modal_by_field": "排序字段", + "list_sort_modal_by_name": "歌曲名", + "list_sort_modal_by_singer": "歌手名", + "list_sort_modal_by_source": "歌曲源", + "list_sort_modal_by_time": "時長", + "list_sort_modal_by_type": "排序類別", + "list_sort_modal_by_up": "升序", + "list_sort_modal_tip_confirm": "你確定要這麼做嗎?", "lists__duplicate": "重複歌曲", "lists__export": "導出", "lists__export_part_desc": "選擇列表文件保存位置", @@ -107,6 +117,7 @@ "lists__remove_tip": "你真的想要移除 {name} 嗎?", "lists__remove_tip_button": "是的 沒錯", "lists__rename": "重命名", + "lists__sort_list": "排序", "lists__sync": "更新", "load_list_file_error_detail": "我們已經幫你把舊的列表文件備份到{path}\n它以 JSON 格式存儲,你可以嘗試手動修復並恢復它\n\n錯誤詳情:{detail}", "load_list_file_error_title": "播放列表數據加載錯誤", @@ -119,6 +130,7 @@ "music_duplicate": "重複歌曲", "music_name": "歌曲名", "music_singer": "歌手", + "music_sort__btn_cancel": "取消", "music_sort__btn_confirm": "確定", "music_sort__input_tip": "請輸入要調整到第幾個位置", "music_sort__title": "將 {name} 的位置調整到:", diff --git a/src/renderer/assets/styles/index.less b/src/renderer/assets/styles/index.less index 925618ac..c7eb2e4c 100644 --- a/src/renderer/assets/styles/index.less +++ b/src/renderer/assets/styles/index.less @@ -232,6 +232,22 @@ input, textarea { transition: all 0.4s ease; } } + +.gap-left { + + .gap-left { + margin-left: 20px; + } +} +.gap-top { + &.top { + margin-top: 25px; + } + + + .gap-top { + margin-top: 10px; + } +} + /* #waiting-mask { position: absolute; diff --git a/src/renderer/components/common/DownloadModal.vue b/src/renderer/components/common/DownloadModal.vue index 5647f5ae..b74b222b 100644 --- a/src/renderer/components/common/DownloadModal.vue +++ b/src/renderer/components/common/DownloadModal.vue @@ -1,5 +1,5 @@ diff --git a/src/renderer/components/material/Modal.vue b/src/renderer/components/material/Modal.vue index af8168eb..7ff8d4eb 100644 --- a/src/renderer/components/material/Modal.vue +++ b/src/renderer/components/material/Modal.vue @@ -1,14 +1,15 @@ @@ -71,29 +169,40 @@ export default { diff --git a/src/renderer/views/list/components/MyLists.vue b/src/renderer/views/list/components/MyLists.vue index a9a4a83c..1bc663c5 100644 --- a/src/renderer/views/list/components/MyLists.vue +++ b/src/renderer/views/list/components/MyLists.vue @@ -34,7 +34,8 @@ - + + @@ -43,6 +44,7 @@ import { mapMutations, mapActions } from 'vuex' import { openSaveDir, saveLxConfigFile, selectDir, readLxConfigFile, filterFileName } from '@renderer/utils' import musicSdk from '@renderer/utils/music' import DuplicateMusicModal from './DuplicateMusicModal' +import ListSortModal from './ListSortModal' import { defaultList, loveList, userLists } from '@renderer/core/share/list' import { computed } from '@renderer/utils/vueTools' import { getList } from '@renderer/core/share/utils' @@ -57,6 +59,7 @@ export default { }, components: { DuplicateMusicModal, + ListSortModal, }, setup() { const lists = computed(() => [defaultList, loveList, ...userLists]) @@ -70,13 +73,14 @@ export default { emits: ['show-menu'], data() { return { - isShowListSortModal: false, isShowDuplicateMusicModal: false, + isShowListSortModal: false, listsData: { isShowItemMenu: false, itemMenuControl: { rename: true, duplicate: true, + sort: true, import: true, export: true, sync: false, @@ -93,7 +97,8 @@ export default { isNewLeave: false, }, fetchingListStatus: {}, - selectedListInfo: {}, + selectedDuplicateListInfo: {}, + selectedSortListInfo: {}, } }, computed: { @@ -114,6 +119,11 @@ export default { action: 'duplicate', disabled: !this.listsData.itemMenuControl.duplicate, }, + { + name: this.$t('lists__sort_list'), + action: 'sort', + disabled: !this.listsData.itemMenuControl.sort, + }, { name: this.$t('lists__import'), action: 'import', @@ -145,7 +155,6 @@ export default { watch: { listId(id) { this.setPrevSelectListId(id) - this.isShowListSortModal = false }, lists(lists) { if (lists.some(l => l.id == this.listId)) return @@ -245,6 +254,7 @@ export default { this.listsData.itemMenuControl.movedown = index < userLists.length - 1 break } + this.listsData.itemMenuControl.sort = !!getList(this.getTargetListInfo(index)?.id).length this.listsData.rightClickItemIndex = index this.listsData.menuLocation.x = event.currentTarget.offsetLeft + event.offsetX this.listsData.menuLocation.y = event.currentTarget.offsetTop + event.offsetY - this.$refs.dom_lists_list.scrollTop @@ -272,9 +282,13 @@ export default { }) break case 'duplicate': - this.selectedListInfo = this.getTargetListInfo(index) + this.selectedDuplicateListInfo = this.getTargetListInfo(index) this.isShowDuplicateMusicModal = true break + case 'sort': + this.selectedSortListInfo = this.getTargetListInfo(index) + this.isShowListSortModal = true + break case 'import': this.handleImportList(index) break diff --git a/src/renderer/views/list/components/SearchList.vue b/src/renderer/views/list/components/SearchList.vue index c840afdd..e28b7d71 100644 --- a/src/renderer/views/list/components/SearchList.vue +++ b/src/renderer/views/list/components/SearchList.vue @@ -1,27 +1,28 @@