🎨 添加友好性提示

This commit is contained in:
jmal 2022-08-09 15:16:29 +08:00
parent 114cf4f724
commit e354812501

View File

@ -27,7 +27,7 @@
</div> </div>
<span class="instruction">一般用于初始化操作, 将文件数据同步到数据库</span> <span class="instruction">一般用于初始化操作, 将文件数据同步到数据库</span>
<div class="config-itme-label">重置角色、菜单: <div class="config-itme-label">重置角色、菜单:
<el-button class="sync-button" size="mini" :loading="syncLoading" type="danger" @click="resetMenuAndRole()"><i class="el-icon-refresh-left"></i></el-button> <el-button class="sync-button" size="mini" :loading="resetLoading" type="danger" @click="resetMenuAndRole()"><i class="el-icon-refresh-left"></i></el-button>
</div> </div>
<span class="instruction">一般用于初始化角色、菜单数据</span> <span class="instruction">一般用于初始化角色、菜单数据</span>
</div> </div>
@ -44,6 +44,7 @@ export default {
return { return {
title: '网盘管理', title: '网盘管理',
syncLoading: false, syncLoading: false,
resetLoading: false,
webpEnabled: false webpEnabled: false
} }
}, },
@ -57,23 +58,37 @@ export default {
}) })
}, },
sync() { sync() {
this.syncLoading = true this.$confirm('是否开始同步? ', '提示', {
settingApi.sync({username: this.$store.state.user.name}).then(() => { confirmButtonText: '确定',
this.syncLoading = false cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.syncLoading = true
settingApi.sync({username: this.$store.state.user.name}).then(() => {
this.syncLoading = false
}).catch(() => {
this.syncLoading = false
})
}).catch(() => { }).catch(() => {
this.syncLoading = false this.syncLoading = false
}) })
}, },
// 重置角色菜单 // 重置角色菜单
resetMenuAndRole(){ resetMenuAndRole(){
this.$confirm('您确定要删除此角色、菜单吗?', '提示', { this.$confirm('您确定要删除当前角色、菜单吗? ', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.resetLoading = true
settingApi.resetMenuAndRole().then(() => { settingApi.resetMenuAndRole().then(() => {
this.$message.success("重置完成") this.$message.success("重置完成")
this.resetLoading = false
}).catch(()=> {
this.resetLoading = false
}) })
}).catch(() => {
this.resetLoading = false
}) })
}, },
webpChange(webpEnabled) { webpChange(webpEnabled) {