Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
mlaj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-10-14 12:00:20 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
935762bfdbb62608ae44a3c36394250383afb355
935762bf
1 parent
682e5bb5
fix(CheckinDetailPage): 修复附件类型映射处理逻辑
处理附件类型数据时增加类型检查,支持数组和对象两种格式 添加类型映射转换,将英文类型转换为中文显示
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletions
src/views/checkin/CheckinDetailPage.vue
src/views/checkin/CheckinDetailPage.vue
View file @
935762b
...
...
@@ -316,11 +316,28 @@ const getTaskDetail = async (month) => {
taskDetail.value = data
// 获取作品类型数据
if (data.attachment_type.length) {
if (data.attachment_type && data.attachment_type.length) {
// 创建类型映射
const typeMap = {
'text': '文本',
'image': '图片',
'audio': '音频',
'video': '视频'
}
// 如果是数组格式,转换为对象格式
if (Array.isArray(data.attachment_type)) {
attachmentTypeOptions.value = data.attachment_type.map(key => ({
key,
value: typeMap[key] || key
}))
} else {
// 如果是对象格式,直接使用
attachmentTypeOptions.value = Object.entries(data.attachment_type).map(([key, value]) => ({
key,
value
}))
}
} else {
// 显示4种类型
attachmentTypeOptions.value = [
...
...
Please
register
or
login
to post a comment