hookehuyr

refactor: 移除调试用的console日志并修复潜在的空数组访问问题

...@@ -70,14 +70,9 @@ const localFields = ref([]) ...@@ -70,14 +70,9 @@ const localFields = ref([])
70 // 监听弹窗显示状态、字段配置和初始值的变化 70 // 监听弹窗显示状态、字段配置和初始值的变化
71 watch([() => props.show, () => props.fields, () => props.initialValues], ([showVal, fieldsVal, initialValuesVal]) => { 71 watch([() => props.show, () => props.fields, () => props.initialValues], ([showVal, fieldsVal, initialValuesVal]) => {
72 if (showVal) { 72 if (showVal) {
73 - console.log('AddTargetDialog open:', {
74 - fields: fieldsVal,
75 - initialValues: initialValuesVal
76 - })
77 // 初始化字段,添加 value 属性 73 // 初始化字段,添加 value 属性
78 localFields.value = fieldsVal.map(field => { 74 localFields.value = fieldsVal.map(field => {
79 const val = (initialValuesVal && initialValuesVal[field.id]); 75 const val = (initialValuesVal && initialValuesVal[field.id]);
80 - console.log(`Field ${field.id} init value:`, val);
81 return { 76 return {
82 ...field, 77 ...field,
83 value: val || '' 78 value: val || ''
......
...@@ -1008,9 +1008,6 @@ onMounted(async () => { ...@@ -1008,9 +1008,6 @@ onMounted(async () => {
1008 countValue.value = val 1008 countValue.value = val
1009 } 1009 }
1010 }) 1010 })
1011 -
1012 - console.warn(selectedTaskValue.value);
1013 - console.warn(selectedTargets.value);
1014 }) 1011 })
1015 </script> 1012 </script>
1016 1013
......
1 <!-- 1 <!--
2 * @Date: 2025-05-29 15:34:17 2 * @Date: 2025-05-29 15:34:17
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-12-17 14:45:25 4 + * @LastEditTime: 2025-12-18 09:51:27
5 * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue 5 * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -558,7 +558,7 @@ const getTaskDetail = async (month) => { ...@@ -558,7 +558,7 @@ const getTaskDetail = async (month) => {
558 taskDetail.value = data; 558 taskDetail.value = data;
559 progress1.value = ((data.checkin_number/data.target_number)*100).toFixed(1); // 计算进度条百分比 559 progress1.value = ((data.checkin_number/data.target_number)*100).toFixed(1); // 计算进度条百分比
560 showProgress.value = !isNaN(progress1.value); // 如果是NaN,就不显示进度条 560 showProgress.value = !isNaN(progress1.value); // 如果是NaN,就不显示进度条
561 - teamAvatars.value = taskDetail.value.checkin_avatars.length > 8 ? taskDetail.value.checkin_avatars.splice(0, 8) : taskDetail.value.checkin_avatars; 561 + teamAvatars.value = taskDetail.value.checkin_avatars?.length > 8 ? taskDetail.value.checkin_avatars.splice(0, 8) : taskDetail.value.checkin_avatars;
562 // 获取当前用户的打卡日期 562 // 获取当前用户的打卡日期
563 myCheckinDates.value = data.my_checkin_dates; 563 myCheckinDates.value = data.my_checkin_dates;
564 // 获取当前用户的补卡日期 564 // 获取当前用户的补卡日期
......