hookehuyr

fix: 屏蔽未完成表单弹框功能并优化代码格式

移除未完成表单弹框的相关逻辑,避免在特定场景下显示干扰用户
优化代码格式,统一缩进和换行风格
/*
* @Date: 2022-05-26 13:57:28
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-11-06 10:45:17
* @LastEditTime: 2025-11-06 10:58:08
* @FilePath: /data-table/src/router.js
* @Description: 文件描述
*/
......@@ -91,6 +91,7 @@ router.beforeEach((to, from, next) => {
resetDialogState();
}
// TAG: 屏蔽未完成弹框功能
// 新增:在显示未完成表单弹框之前,对 leader 来源进行特殊处理
// 如果是新增页面或未指定类型,并且来源为 leader,则提前清理未完成表单的 Cookie,避免弹框
// 这样可以确保不会触发 showUnfinishedFormDialog 或包含“您还未完成的表单,是否继续?”的提示
......
<template>
<van-config-provider :theme-vars="themeVars">
<van-popup
v-model:show="showPopup"
position="center"
<van-popup
v-model:show="showPopup"
position="center"
:style="{ width: '85vw', maxWidth: '500px', borderRadius: '12px' }"
:close-on-click-overlay="false"
>
......@@ -35,11 +35,11 @@
</van-radio-group>
</div>
<div class="popup-footer">
<van-button
type="primary"
block
<van-button
type="primary"
block
round
@click="confirmCycleSelection"
@click="confirmCycleSelection"
:disabled="!selectedCycle"
>
确认选择
......@@ -110,11 +110,11 @@ const getCycleList = async (form_code) => {
// 检查是否需要显示未完成表单弹框
checkUnfinishedForm(route);
} else {
$router.replace({
path: '/',
query: {
...$route.query
}
$router.replace({
path: '/',
query: {
...$route.query
}
});
}
}
......@@ -168,6 +168,7 @@ const confirmCycleSelection = () => {
* @param {Object} route 目标路由对象
*/
const checkUnfinishedForm = (route) => {
// TAG: 屏蔽未完成弹框功能
// 新增:在显示未完成表单弹框之前,对 leader 来源进行特殊处理
// 如果是新增页面或未指定类型,并且来源为 leader,则提前清理未完成表单的 Cookie,避免弹框
if ((route.query.page_type === 'add' || route.query.page_type === undefined) && (route.query.volunteer_source === 'leader')) {
......@@ -188,13 +189,13 @@ const checkUnfinishedForm = (route) => {
() => {
// 用户选择删除,删除cookie并跳转到首页
Cookies.remove(route.query.code);
$router.replace({
path: '/',
query: {
$router.replace({
path: '/',
query: {
...route.query,
x_cycle: selectedCycle.value,
cycle_selected: '1'
}
x_cycle: selectedCycle.value,
cycle_selected: '1'
}
});
},
route.query.code
......@@ -225,7 +226,7 @@ onMounted(() => {
display: flex;
flex-direction: column;
max-height: 70vh;
.popup-header {
padding: 20px;
text-align: center;
......