Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporate-culture-qd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王立鹏
corporate-culture-qd
Commits
cb004e1f
Commit
cb004e1f
authored
May 25, 2026
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】 refactor: 展示数据优化
parent
75d73c97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
types.ts
src/api/article/types.ts
+1
-0
index.vue
src/views/questionDetail/index.vue
+14
-6
No files found.
src/api/article/types.ts
View file @
cb004e1f
...
@@ -157,6 +157,7 @@ export interface ArticleItemDto {
...
@@ -157,6 +157,7 @@ export interface ArticleItemDto {
hasPraised
:
boolean
hasPraised
:
boolean
hasCollect
:
boolean
hasCollect
:
boolean
imgUrl
:
string
imgUrl
:
string
imgUrlList
?:
string
[]
createUserAvatar
:
string
createUserAvatar
:
string
createUserName
:
string
createUserName
:
string
showAvatar
:
string
showAvatar
:
string
...
...
src/views/questionDetail/index.vue
View file @
cb004e1f
...
@@ -168,16 +168,16 @@
...
@@ -168,16 +168,16 @@
</button>
</button>
</div>
</div>
<div
<div
v-if=
"questionDetail.imgUrl"
v-if=
"questionDetail.imgUrl
List?.length
"
class=
"mt-3 flex gap-2 flex-wrap items-center justify-start"
class=
"mt-3 flex gap-2 flex-wrap items-center justify-start"
>
>
<el-image
<el-image
v-for=
"(item, i) in questionDetail.imgUrl
.split(',')
"
v-for=
"(item, i) in questionDetail.imgUrl
List
"
:key=
"item"
:key=
"item"
:src=
"item"
:src=
"item"
fit=
"cover"
fit=
"cover"
class=
"rounded-lg w-24 h-24 hover:scale-105 transition-transform cursor-pointer"
class=
"rounded-lg w-24 h-24 hover:scale-105 transition-transform cursor-pointer"
:preview-src-list=
"questionDetail.imgUrl
.split(',')
"
:preview-src-list=
"questionDetail.imgUrl
List
"
:initial-index=
"i"
:initial-index=
"i"
:preview-teleported=
"true"
:preview-teleported=
"true"
/>
/>
...
@@ -346,7 +346,7 @@
...
@@ -346,7 +346,7 @@
<!-- 评论图片列表 -->
<!-- 评论图片列表 -->
<div
class=
"flex flex-wrap gap-3 mb-3"
>
<div
class=
"flex flex-wrap gap-3 mb-3"
>
<div
<div
v-for=
"(img, imgIndex) in answer.imgUrl
.split(',').filter(Boolean)
"
v-for=
"(img, imgIndex) in answer.imgUrl
List
"
:key=
"imgIndex"
:key=
"imgIndex"
class=
"w-24 h-24 rounded-lg overflow-hidden mb-2"
class=
"w-24 h-24 rounded-lg overflow-hidden mb-2"
>
>
...
@@ -354,7 +354,7 @@
...
@@ -354,7 +354,7 @@
:src=
"img"
:src=
"img"
:preview-teleported=
"true"
:preview-teleported=
"true"
class=
"w-full h-full object-cover"
class=
"w-full h-full object-cover"
:preview-src-list=
"answer.imgUrl
.split(',').filter(Boolean)
"
:preview-src-list=
"answer.imgUrl
List
"
:initial-index=
"imgIndex"
:initial-index=
"imgIndex"
fit=
"cover"
fit=
"cover"
/>
/>
...
@@ -503,7 +503,10 @@ const isOverThreeLine = computed(() => {
...
@@ -503,7 +503,10 @@ const isOverThreeLine = computed(() => {
})
})
const
getQuestionDetail
=
async
()
=>
{
const
getQuestionDetail
=
async
()
=>
{
const
{
data
}
=
await
getArticleDetail
(
questionId
)
const
{
data
}
=
await
getArticleDetail
(
questionId
)
questionDetail
.
value
=
data
questionDetail
.
value
=
{
...
data
,
imgUrlList
:
getImageUrlList
(
data
.
imgUrl
),
}
}
}
const
{
const
{
...
@@ -522,11 +525,16 @@ const {
...
@@ -522,11 +525,16 @@ const {
formatList
:
(
list
)
=>
formatList
:
(
list
)
=>
list
.
map
((
item
)
=>
({
list
.
map
((
item
)
=>
({
...
item
,
...
item
,
imgUrlList
:
getImageUrlList
(
item
.
imgUrl
),
showComment
:
false
,
showComment
:
false
,
isExpand
:
false
,
isExpand
:
false
,
})),
})),
})
})
const
getImageUrlList
=
(
imgUrl
?:
string
)
=>
{
return
imgUrl
?.
split
(
','
).
filter
(
Boolean
)
??
[]
}
const
answerSortOptions
=
[
const
answerSortOptions
=
[
{
label
:
'最多点赞'
,
value
:
CommentSortTypeEnum
.
MOST_LIKE
},
{
label
:
'最多点赞'
,
value
:
CommentSortTypeEnum
.
MOST_LIKE
},
{
label
:
'最多评论'
,
value
:
CommentSortTypeEnum
.
MOST_COMMENT
},
{
label
:
'最多评论'
,
value
:
CommentSortTypeEnum
.
MOST_COMMENT
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment