refactor(统计模型): 更新感恩次数和对象的字段命名及数据结构
将objCount改为gratitude_count,objName改为gratitude_people数组 更新模板中对应的字段引用
Showing
1 changed file
with
6 additions
and
7 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-12-11 17:26:25 | 2 | * @Date: 2025-12-11 17:26:25 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-12-11 20:49:09 | 4 | + * @LastEditTime: 2025-12-16 11:22:13 |
| 5 | * @FilePath: /mlaj/src/components/count/postCountModel.vue | 5 | * @FilePath: /mlaj/src/components/count/postCountModel.vue |
| 6 | - * @Description: 发布作业统计模型 | 6 | + * @Description: 发布作业统计模型(包括感恩次数和感恩对象) |
| 7 | --> | 7 | --> |
| 8 | <template> | 8 | <template> |
| 9 | <div class="post-count-model"> | 9 | <div class="post-count-model"> |
| 10 | - <!-- TODO 感恩模块还没有做 --> | ||
| 11 | <div class="flex justify-between items-center mb-2"> | 10 | <div class="flex justify-between items-center mb-2"> |
| 12 | <div class="text-gray-500">感恩次数: </div> | 11 | <div class="text-gray-500">感恩次数: </div> |
| 13 | - <div class="font-bold">{{ countData.objCount }} 次</div> | 12 | + <div class="font-bold">{{ countData.gratitude_count }} 次</div> |
| 14 | </div> | 13 | </div> |
| 15 | <div class="flex justify-between items-center"> | 14 | <div class="flex justify-between items-center"> |
| 16 | <div class="text-gray-500">感恩对象: </div> | 15 | <div class="text-gray-500">感恩对象: </div> |
| 17 | - <div class="font-bold">{{ countData.objName.join('、') }}</div> | 16 | + <div class="font-bold">{{ countData.gratitude_people.map(item => item.name).join('、') }}</div> |
| 18 | </div> | 17 | </div> |
| 19 | </div> | 18 | </div> |
| 20 | </template> | 19 | </template> |
| ... | @@ -32,8 +31,8 @@ const props = defineProps({ | ... | @@ -32,8 +31,8 @@ const props = defineProps({ |
| 32 | 31 | ||
| 33 | // mock count data | 32 | // mock count data |
| 34 | const countData = ref({ | 33 | const countData = ref({ |
| 35 | - objCount: 3, | 34 | + gratitude_count: 3, |
| 36 | - objName: ['张三', '李四', '王五'] | 35 | + gratitude_people: [{id: 1, name: '张三'}, {id: 2, name: '李四'}, {id: 3, name: '王五'}] |
| 37 | }) | 36 | }) |
| 38 | </script> | 37 | </script> |
| 39 | 38 | ... | ... |
-
Please register or login to post a comment