refactor(AppAccountManage): 优化账号删除功能
- 修改 handleDelete 方法,使其接收 row 参数 - 根据账号认证和配置状态,动态显示删除确认提示 - 提升用户体验,减少误操作风险
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
<el-button type="text" @click="changeEnable(row)">{{ row.status == 1 ? '禁用' : '启用' }}</el-button>
|
<el-button type="text" @click="changeEnable(row)">{{ row.status == 1 ? '禁用' : '启用' }}</el-button>
|
||||||
<el-button type="text" @click="appAllot(row)">编辑</el-button>
|
<el-button type="text" @click="appAllot(row)">编辑</el-button>
|
||||||
<el-button type="text" @click="resetPassword(row.id)">重置密码</el-button>
|
<el-button type="text" @click="resetPassword(row.id)">重置密码</el-button>
|
||||||
<el-button type="text" @click="handleDelete(row.id)">删除</el-button>
|
<el-button type="text" @click="handleDelete(row)">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -193,8 +193,13 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDelete(ids) {
|
handleDelete(row) {
|
||||||
this.$confirm("是否要删除该账号?").then(() => {
|
const {id: ids, authStatus, configStatus} = row
|
||||||
|
let text = "是否要删除该账号?"
|
||||||
|
if (authStatus == 1) {
|
||||||
|
text = configStatus == 1 ? "该账户已经认证,是否确认删除该账户?" : "该账户已经认证及配置,是否确认删除该账户?"
|
||||||
|
}
|
||||||
|
this.$confirm(text).then(() => {
|
||||||
this.instance.post("/admin/user/del", null, {
|
this.instance.post("/admin/user/del", null, {
|
||||||
params: {ids}
|
params: {ids}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|||||||
Reference in New Issue
Block a user