hookehuyr

fix(router): 在x_project功能下屏蔽未完成表单检查逻辑

1 /* 1 /*
2 * @Date: 2022-05-26 13:57:28 2 * @Date: 2022-05-26 13:57:28
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-09-11 17:13:53 4 + * @LastEditTime: 2025-09-25 18:29:36
5 * @FilePath: /data-table/src/router.js 5 * @FilePath: /data-table/src/router.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -145,7 +145,8 @@ router.beforeEach((to, from, next) => { ...@@ -145,7 +145,8 @@ router.beforeEach((to, from, next) => {
145 // 直接执行表单检查逻辑,跳过周期检查 145 // 直接执行表单检查逻辑,跳过周期检查
146 if (to.query.page_type === 'add' || to.query.page_type === undefined) { 146 if (to.query.page_type === 'add' || to.query.page_type === undefined) {
147 const existingCookie = Cookies.get(to.query.code); 147 const existingCookie = Cookies.get(to.query.code);
148 - if (existingCookie && to.query.force_back !== '1') { 148 + // 在x_project功能下屏蔽未完成表单功能
149 + if (existingCookie && to.query.force_back !== '1' && !to.query.x_project) {
149 showUnfinishedFormDialog( 150 showUnfinishedFormDialog(
150 () => { 151 () => {
151 // 用户选择继续,跳转到目标页面 152 // 用户选择继续,跳转到目标页面
...@@ -194,7 +195,8 @@ router.beforeEach((to, from, next) => { ...@@ -194,7 +195,8 @@ router.beforeEach((to, from, next) => {
194 // 只有在不需要周期选择时,才执行表单检查逻辑 195 // 只有在不需要周期选择时,才执行表单检查逻辑
195 if (to.query.page_type === 'add' || to.query.page_type === undefined) { 196 if (to.query.page_type === 'add' || to.query.page_type === undefined) {
196 const existingCookie = Cookies.get(to.query.code); 197 const existingCookie = Cookies.get(to.query.code);
197 - if (existingCookie && to.query.force_back !== '1') { 198 + // 在x_project功能下屏蔽未完成表单功能
199 + if (existingCookie && to.query.force_back !== '1' && !to.query.x_project) {
198 showUnfinishedFormDialog( 200 showUnfinishedFormDialog(
199 () => { 201 () => {
200 // 用户选择继续,跳转到目标页面 202 // 用户选择继续,跳转到目标页面
...@@ -218,7 +220,8 @@ router.beforeEach((to, from, next) => { ...@@ -218,7 +220,8 @@ router.beforeEach((to, from, next) => {
218 // 检查失败时,继续执行表单检查逻辑 220 // 检查失败时,继续执行表单检查逻辑
219 if (to.query.page_type === 'add' || to.query.page_type === undefined) { 221 if (to.query.page_type === 'add' || to.query.page_type === undefined) {
220 const existingCookie = Cookies.get(to.query.code); 222 const existingCookie = Cookies.get(to.query.code);
221 - if (existingCookie && to.query.force_back !== '1') { 223 + // 在x_project功能下屏蔽未完成表单功能
224 + if (existingCookie && to.query.force_back !== '1' && !to.query.x_project) {
222 showConfirmDialog({ 225 showConfirmDialog({
223 title: '温馨提示', 226 title: '温馨提示',
224 message: '您还未完成的表单,是否继续?', 227 message: '您还未完成的表单,是否继续?',
......