hookehuyr

fix(router): 修复周期选择判断逻辑,增加page_type参数检查

只有当page_type为add或未设置时才进行周期判断,避免在非新增场景下误触发周期选择
...@@ -48,22 +48,27 @@ const checkCycleSelection = async (to) => { ...@@ -48,22 +48,27 @@ const checkCycleSelection = async (to) => {
48 if (to.path === '/cycle-selection') { 48 if (to.path === '/cycle-selection') {
49 return false; 49 return false;
50 } 50 }
51 - 51 +
52 + // 只有在page_type=add或者没有page_type参数时才进行周期判断
53 + if (to.query.page_type && to.query.page_type !== 'add') {
54 + return false;
55 + }
56 +
52 // 如果没有表单代码,不需要周期选择 57 // 如果没有表单代码,不需要周期选择
53 if (!to.query.code) { 58 if (!to.query.code) {
54 return false; 59 return false;
55 } 60 }
56 - 61 +
57 // 如果用户已经选择过周期,不需要再选择 62 // 如果用户已经选择过周期,不需要再选择
58 if (to.query.cycle_selected === '1') { 63 if (to.query.cycle_selected === '1') {
59 return false; 64 return false;
60 } 65 }
61 - 66 +
62 // 如果是预览模式,不需要周期选择 67 // 如果是预览模式,不需要周期选择
63 if (to.query.model === 'preview') { 68 if (to.query.model === 'preview') {
64 return false; 69 return false;
65 } 70 }
66 - 71 +
67 try { 72 try {
68 const { data } = await getCycleListAPI({ form_code: to.query.code }); 73 const { data } = await getCycleListAPI({ form_code: to.query.code });
69 // 如果需要周期选择且有周期列表 74 // 如果需要周期选择且有周期列表
......