From e52f7221d27b644b7e4265585a8e2b52884076a0 Mon Sep 17 00:00:00 2001 From: RainSun Date: Sun, 8 Mar 2020 15:26:55 +0800 Subject: [PATCH] add reset dialog --- src/utils/language.js | 28 ++++++++++++++++++++ src/views/Settings/Settings.vue | 46 ++++++++++++++++++++++++++++++--- 2 files changed, 70 insertions(+), 4 deletions(-) diff --git a/src/utils/language.js b/src/utils/language.js index 3028c78..82f5456 100644 --- a/src/utils/language.js +++ b/src/utils/language.js @@ -59,6 +59,12 @@ export function lang() { reset_settings: '恭喜! 个性化设置成功', reset_pwd_failed: '密码不能为空', reset_pwd_successful: '恭喜! 新的密码已经应用' + }, + reset_dialog: { + title: '警告', + content: '该操作不可复原,是否继续', + confirm: '继续', + cancel: '取消' } }, EN: { @@ -79,6 +85,12 @@ export function lang() { reset_settings: 'Congratulations! Reset settings completed', reset_pwd_failed: 'Password can not be none', reset_pwd_successful: 'Congratulations! New password set up successfully' + }, + reset_dialog: { + title: 'Warning', + content: 'This operation cannot be undone, whether to continue', + confirm: 'Continue', + cancel: 'Cancel' } } }, @@ -282,6 +294,14 @@ export function lang() { CHS:{ title: '更新日志', timeline: [ + { + label: '设置中的重置功能优化', + tag:'功能更新', + content: [ + '所有重置操作之前会进行弹窗提醒,防止误操作', + '2020-03-08' + ] + }, { label: '设置中的重置主密码功能启用', tag:'功能更新', @@ -383,6 +403,14 @@ export function lang() { EN:{ title: 'Update Log', timeline: [ + { + label: 'Optimization of reset function in settings', + tag:'Feature update', + content: [ + 'Pop-up window reminder before all reset operations to prevent misoperation', + '2020-03-08' + ] + }, { label: 'The reset master password function is enabled in the settings', tag:'Feature update', diff --git a/src/views/Settings/Settings.vue b/src/views/Settings/Settings.vue index 779e609..59752d2 100644 --- a/src/views/Settings/Settings.vue +++ b/src/views/Settings/Settings.vue @@ -13,19 +13,19 @@
{{ lang.subheader[0] }} - + person {{ lang.reset_list[0] }} - + format_align_left {{ lang.reset_list[1] }} - + layers {{ lang.reset_list[2] }} @@ -74,6 +74,16 @@ :md-cancel-text="lang.dialog.cancel" @md-confirm="resetPwd" /> + + {{ snakebar_msg }} @@ -114,7 +124,10 @@ export default { // 初始化完成状态 has_init: false, lang: '', - clientHeight: '' + clientHeight: '', + // 重置确认 + reset_confirm: false, + reset_type: '' }; }, computed: { @@ -313,6 +326,31 @@ export default { this.setRowPwd([row_pwd, this]); this.snakebar_msg = this.lang.snakebar_msg.reset_pwd_successful; this.show_snackbar = true; + }, + + // 打开重置的警告提醒 + openResetDialog(type) { + this.reset_confirm = true; + this.reset_type = type + }, + + // 提醒完成点击确定 + resetStart() { + console.log('用户点击继续,重置开始') + switch(this.reset_type) { + case 'account': + this.resetAccount(); + break + case 'codebook': + this.resetCodebook(); + break + case 'application': + this.resetApplication(); + break + default: + return + } + this.reset_type = '' } }, created() {