From b1918e8b1586505fe788c80c72f900d31b66cbd4 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Thu, 30 Sep 2021 14:45:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=A0=E9=99=A4=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=89=8D=E7=9A=84=E7=A1=AE=E8=AE=A4=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/renderer/lang/en-us/view/list.json | 2 ++ src/renderer/lang/zh-cn/view/list.json | 2 ++ src/renderer/lang/zh-tw/view/list.json | 2 ++ src/renderer/plugins/Dialog/Dialog.vue | 3 ++- src/renderer/plugins/Dialog/index.js | 6 +++++- src/renderer/views/List.vue | 8 +++++++- 7 files changed, 21 insertions(+), 3 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 80f8988d..a5f13772 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -2,6 +2,7 @@ - 新增歌词简体中文转繁体中文,当软件语言被设置为繁体中文后,播放歌曲的歌词也将自动转成繁体中文显示 - 为方便分享歌曲列表,新增单个列表导入/导出功能,可在右击“我的列表”里的列表名后弹出的菜单中使用 +- 为防止误删列表,新增删除列表前的确认弹窗 ### 修复 diff --git a/src/renderer/lang/en-us/view/list.json b/src/renderer/lang/en-us/view/list.json index 29c4a70d..b6ca422f 100644 --- a/src/renderer/lang/en-us/view/list.json +++ b/src/renderer/lang/en-us/view/list.json @@ -24,6 +24,8 @@ "lists_new_list_btn": "Create list", "lists_new_list_input": "New list...", "lists_remove": "Remove", + "lists_remove_tip": "Do you really want to remove {name}?", + "lists_remove_tip_button": "Yes, that's right", "lists_rename": "Rename", "lists_sync": "Update", "loding_list": "Loading...", diff --git a/src/renderer/lang/zh-cn/view/list.json b/src/renderer/lang/zh-cn/view/list.json index 835e51b4..59dd1ffa 100644 --- a/src/renderer/lang/zh-cn/view/list.json +++ b/src/renderer/lang/zh-cn/view/list.json @@ -24,6 +24,8 @@ "lists_new_list_btn": "新建列表", "lists_new_list_input": "新列表...", "lists_remove": "删除", + "lists_remove_tip": "你真的想要移除 {name} 吗?", + "lists_remove_tip_button": "是的 没错", "lists_rename": "重命名", "lists_sync": "更新", "loding_list": "加载中...", diff --git a/src/renderer/lang/zh-tw/view/list.json b/src/renderer/lang/zh-tw/view/list.json index 55cb5b36..47c8986e 100644 --- a/src/renderer/lang/zh-tw/view/list.json +++ b/src/renderer/lang/zh-tw/view/list.json @@ -24,6 +24,8 @@ "lists_new_list_btn": "新建列表", "lists_new_list_input": "新列表...", "lists_remove": "刪除", + "lists_remove_tip": "你真的想要移除 {name} 嗎?", + "lists_remove_tip_button": "是的 沒錯", "lists_rename": "重命名", "lists_sync": "更新", "loding_list": "加載中...", diff --git a/src/renderer/plugins/Dialog/Dialog.vue b/src/renderer/plugins/Dialog/Dialog.vue index 561b9e7e..1d061d44 100644 --- a/src/renderer/plugins/Dialog/Dialog.vue +++ b/src/renderer/plugins/Dialog/Dialog.vue @@ -55,10 +55,11 @@ export default { .main { flex: auto; - min-height: 50px; + min-height: 40px; padding: 15px; font-size: 14px; max-width: 320px; + min-width: 220px; line-height: 1.5; } diff --git a/src/renderer/plugins/Dialog/index.js b/src/renderer/plugins/Dialog/index.js index d470596a..49dabfeb 100644 --- a/src/renderer/plugins/Dialog/index.js +++ b/src/renderer/plugins/Dialog/index.js @@ -41,7 +41,11 @@ const dialog = { } }) } - dialog.confirm = options => dialog({ ...options, showCancel: true }) + dialog.confirm = options => dialog( + typeof options == 'string' + ? { message: options, showCancel: true } + : { ...options, showCancel: true }, + ) Vue.prototype.$dialog = dialog }, diff --git a/src/renderer/views/List.vue b/src/renderer/views/List.vue index bd5df148..4f115766 100644 --- a/src/renderer/views/List.vue +++ b/src/renderer/views/List.vue @@ -818,7 +818,13 @@ export default { this.movedownUserList({ id: this.userList[index].id }) break case 'remove': - this.removeUserList({ id: this.userList[index].id }) + this.$dialog.confirm({ + message: this.$t('view.list.lists_remove_tip', { name: this.userList[index].name }), + confirmButtonText: this.$t('view.list.lists_remove_tip_button'), + }).then(isRemove => { + if (!isRemove) return + this.removeUserList({ id: this.userList[index].id }) + }) break } },