fix: 修复表单重置和密码重置后的跳转问题
- 在jnh/add.vue中添加表单字段重置逻辑 - 在user.vue中密码重置后清除缓存并跳转登录页 - 在jnh/index.vue中添加清空条件功能并显示部门字段
This commit is contained in:
parent
d611facf08
commit
5616afd85e
|
|
@ -215,6 +215,9 @@ async function handleRestPwd() {
|
|||
if (res.code == 200) {
|
||||
ElMessage.success('重置密码成功');
|
||||
restDialogVisible.value = false;
|
||||
|
||||
Session.clear(); // 清除浏览器全部临时缓存
|
||||
window.location.href = '/'; // 去登录页
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,10 @@ function open(data) {
|
|||
}
|
||||
function close() {
|
||||
dialogTableVisible.value = false;
|
||||
|
||||
form.name = '';
|
||||
form.mobile = '';
|
||||
form.department = '';
|
||||
emit('close');
|
||||
}
|
||||
const ruleFormRef = ref(null);
|
||||
|
|
|
|||
|
|
@ -29,14 +29,18 @@
|
|||
<el-option label="启用" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-button size="mini" @click="clearForm">清空条件</el-button>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<tableComponents :tableData="tableData">
|
||||
<el-table-column prop="name" label="姓名" align="center" />
|
||||
<el-table-column prop="mobile" label="手机号" align="center" />
|
||||
<el-table-column prop="department" label="部门" align="center" />
|
||||
<el-table-column prop="createTime" label="创建时间" align="center" />
|
||||
<el-table-column prop="updateTime" label="更新时间" align="center" />
|
||||
|
||||
<el-table-column prop="status" label="账号状态" align="center">
|
||||
<template #default="scope">
|
||||
<div style="display: flex; align-items: center; justify-content: center">
|
||||
|
|
@ -135,6 +139,14 @@ async function doUpdateStatus(row) {
|
|||
});
|
||||
}
|
||||
|
||||
function clearForm() {
|
||||
form.name = '';
|
||||
form.mobile = '';
|
||||
form.department = '';
|
||||
form.status = '';
|
||||
getData();
|
||||
}
|
||||
|
||||
// 页面加载时
|
||||
onMounted(() => {
|
||||
NextLoading.done();
|
||||
|
|
|
|||
Loading…
Reference in New Issue