fix(survey): 优化模板市场页面操作流程
- 删除问卷后立即重置 survey 数组并重新获取数据 - 复制问卷成功后立即重置 survey 数组并重新获取数据 - 保存模板成功后直接关闭确认对话框,不执行额外操作
This commit is contained in:
@@ -197,14 +197,13 @@ const deleteItem = (item) => {
|
|||||||
showToast('删除成功!');
|
showToast('删除成功!');
|
||||||
}
|
}
|
||||||
form.value.page = 1;
|
form.value.page = 1;
|
||||||
|
survey.value = [];
|
||||||
await fetchSurveys();
|
await fetchSurveys();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
if (res.data.message) {
|
if (res.data.message) {
|
||||||
showToast(res.data.message);
|
showToast(res.data.message);
|
||||||
}
|
}
|
||||||
form.value.page = 1;
|
|
||||||
fetchSurveys();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const copyItem = (item) => {
|
const copyItem = (item) => {
|
||||||
@@ -218,6 +217,7 @@ const copyItem = (item) => {
|
|||||||
if (res.data.code === 200 || res.data.code === 201) {
|
if (res.data.code === 200 || res.data.code === 201) {
|
||||||
showSuccessToast('复制成功');
|
showSuccessToast('复制成功');
|
||||||
form.value.page = 1;
|
form.value.page = 1;
|
||||||
|
survey.value = [];
|
||||||
await fetchSurveys();
|
await fetchSurveys();
|
||||||
} else {
|
} else {
|
||||||
showFailToast(res.data);
|
showFailToast(res.data);
|
||||||
@@ -279,14 +279,7 @@ const saveTemplate = async (item) => {
|
|||||||
showConfirmDialog({
|
showConfirmDialog({
|
||||||
message: '模板保存成功,请前往模板市场查看!',
|
message: '模板保存成功,请前往模板市场查看!',
|
||||||
showCancelButton: false
|
showCancelButton: false
|
||||||
})
|
});
|
||||||
.then(() => {
|
|
||||||
form.value.page = 1;
|
|
||||||
fetchSurveys();
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// on cancel
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
showFailToast(res.data);
|
showFailToast(res.data);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user