Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporateCulture-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
王立鹏
corporateCulture-qd
Commits
6d62a17d
Commit
6d62a17d
authored
Jan 30, 2026
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
】
parent
16dcab51
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
94 additions
and
24 deletions
+94
-24
types.ts
src/api/article/types.ts
+9
-1
index.vue
src/components/common/ArticleContent/index.vue
+42
-5
enums.ts
src/constants/enums.ts
+8
-0
useUploadImg.ts
src/hooks/useUploadImg.ts
+1
-1
index.vue
src/views/homePage/index.vue
+7
-7
index.vue
src/views/publishLongArticle/index.vue
+9
-8
index.vue
src/views/questionDetail/index.vue
+1
-1
index.vue
src/views/userPage/index.vue
+17
-1
No files found.
src/api/article/types.ts
View file @
6d62a17d
import
{
ArticleTypeEnum
,
ReleaseStatusTypeEnum
,
BooleanFlag
,
SendTypeEnum
}
from
'@/constants'
import
{
ArticleTypeEnum
,
ReleaseStatusTypeEnum
,
BooleanFlag
,
SendTypeEnum
,
VideoPositionEnum
,
}
from
'@/constants'
import
type
{
PageSearchParams
}
from
'@/utils/request/types'
/**
...
...
@@ -193,6 +199,8 @@ export interface ArticleItemDto {
sendTime
:
string
tagIdList
:
number
[]
pushList
:
{
valueId
:
string
;
valueType
:
number
;
valueName
:
string
}[]
videoLocation
:
VideoPositionEnum
articleVideoUrl
:
string
}
/**
...
...
src/components/common/ArticleContent/index.vue
View file @
6d62a17d
...
...
@@ -73,7 +73,15 @@
<h1
class=
"text-2xl font-bold text-gray-900 mb-4 leading-tight"
>
{{
articleDetail
?.
title
}}
</h1>
<!-- 顶部添加的视频 剧中固定宽度 -->
<div
v-if=
"showTopVideo"
class=
"flex justify-center"
>
<video
:src=
"articleDetail.articleVideoUrl"
controls
class=
"w-80% aspect-video"
:poster=
"`$
{articleDetail.articleVideoUrl}?x-oss-process=video/snapshot,t_1000,f_jpg`"
/>
</div>
<!-- 文章内容 -->
<div
v-if=
"!isHtml"
class=
"prose prose-lg max-w-none"
>
<div
class=
"text-gray-700 leading-relaxed space-y-4 whitespace-pre-line text-17px"
>
...
...
@@ -95,13 +103,23 @@
:preview-teleported=
"true"
/>
</div>
<div
v-if=
"articleDetail.type === ArticleTypeEnum.VIDEO"
>
<video
:src=
"articleDetail.videoUrl"
controls
/>
<div
v-if=
"articleDetail.type === ArticleTypeEnum.VIDEO"
class=
"flex justify-center"
>
<video
:src=
"articleDetail.videoUrl"
controls
class=
"w-80% aspect-video"
/>
</div>
</div>
<div
v-else
v-html=
"articleDetail.content"
class=
"html-content"
v-image-preview
=
"1111"
/>
<div
v-else
v-html=
"articleDetail.content"
class=
"html-content"
v-image-preview
/>
<!-- 底部添加的视频 -->
<div
v-if=
"showBottomVideo"
class=
"flex justify-center"
>
<!-- 长宽 1/1 -->
<video
:src=
"articleDetail.articleVideoUrl"
controls
class=
"w-80% aspect-video"
:poster=
"`$
{articleDetail.articleVideoUrl}?x-oss-process=video/snapshot,t_1000,f_jpg`"
/>
</div>
<!-- 标签 -->
<div
class=
"flex flex-wrap gap-2 mt-6"
>
<span
...
...
@@ -128,7 +146,7 @@
<
script
setup
lang=
"ts"
>
import
dayjs
from
'dayjs'
import
type
{
ArticleItemDto
}
from
'@/api'
import
{
articleTypeListOptions
,
ArticleTypeEnum
}
from
'@/constants'
import
{
articleTypeListOptions
,
ArticleTypeEnum
,
VideoPositionEnum
}
from
'@/constants'
import
ActionMore
from
'@/components/common/ActionMore/index.vue'
import
{
jumpToUserHomePage
}
from
'@/utils'
import
{
useUserStore
}
from
'@/stores/user'
...
...
@@ -159,6 +177,25 @@ const isHtml = computed(() => {
)
})
const
isInterviewOrColumn
=
computed
(
()
=>
articleDetail
.
type
===
ArticleTypeEnum
.
INTERVIEW
||
articleDetail
.
type
===
ArticleTypeEnum
.
COLUMN
,
)
const
showTopVideo
=
computed
(
()
=>
isInterviewOrColumn
.
value
&&
articleDetail
.
videoLocation
===
VideoPositionEnum
.
TOP
&&
articleDetail
.
articleVideoUrl
,
)
const
showBottomVideo
=
computed
(
()
=>
isInterviewOrColumn
.
value
&&
articleDetail
.
videoLocation
===
VideoPositionEnum
.
BOTTOM
&&
articleDetail
.
articleVideoUrl
,
)
const
showPreview
=
ref
(
false
)
const
currentPreviewIndex
=
ref
(
0
)
const
srcList
=
ref
<
string
[]
>
([])
...
...
src/constants/enums.ts
View file @
6d62a17d
...
...
@@ -97,3 +97,11 @@ export enum UsageStatusEnum {
// 已使用
USED
=
1
,
}
// 视频位置枚举
export
enum
VideoPositionEnum
{
// 顶部
TOP
=
1
,
// 底部
BOTTOM
=
2
,
}
src/hooks/useUploadImg.ts
View file @
6d62a17d
...
...
@@ -18,7 +18,7 @@ export const useUploadImg = (imgList: Ref<string[]> = ref([])) => {
},
})
const
data
=
await
promise
imgList
.
value
.
push
(
data
.
filePath
)
imgList
.
value
=
[...
imgList
.
value
,
data
.
filePath
]
}
catch
(
error
)
{
console
.
error
(
'上传失败:'
,
error
)
}
finally
{
...
...
src/views/homePage/index.vue
View file @
6d62a17d
...
...
@@ -47,7 +47,7 @@
>
<div
class=
"content-wrapper p-6"
>
<router-view
v-slot=
"
{ Component, route }">
<transition
name=
"fade"
mode=
"out-in"
>
<transition
name=
"fade
-home
"
mode=
"out-in"
>
<keep-alive>
<component
:is=
"Component"
:key=
"getThirdLevelKey(route)"
/>
</keep-alive>
...
...
@@ -519,22 +519,22 @@ provide(TABS_REF_KEY, tabsRef)
}
}
.fade-enter-from
,
.fade-leave-to
{
.fade-
home-
enter-from
,
.fade-
home-
leave-to
{
opacity
:
0
;
transform
:
translateX
(
30px
);
filter
:
blur
(
4px
);
}
.fade-enter-to
,
.fade-leave-from
{
.fade-
home-
enter-to
,
.fade-
home-
leave-from
{
opacity
:
1
;
transform
:
translateX
(
0
);
filter
:
blur
(
0
);
}
.fade-enter-active
,
.fade-leave-active
{
.fade-
home-
enter-active
,
.fade-
home-
leave-active
{
transition
:
all
0.3s
ease
;
}
</
style
>
src/views/publishLongArticle/index.vue
View file @
6d62a17d
...
...
@@ -190,15 +190,15 @@
</el-form-item>
<!-- 插入视频 顶部或者底部 radio -->
<el-form-item
label=
"插入视频"
prop=
"
insertVideo
"
>
<el-radio-group
v-model=
"form.
insertVideo
"
>
<el-radio
:value=
"
BooleanFlag.YES
"
>
顶部
</el-radio>
<el-radio
:value=
"
BooleanFlag.NO
"
>
底部
</el-radio>
<el-form-item
label=
"插入视频"
prop=
"
videoLocation
"
>
<el-radio-group
v-model=
"form.
videoLocation
"
>
<el-radio
:value=
"
VideoPositionEnum.TOP
"
>
顶部
</el-radio>
<el-radio
:value=
"
VideoPositionEnum.BOTTOM
"
>
底部
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"视频"
prop=
"
v
ideoUrl"
>
<UploadVideo
v-model=
"form.
v
ideoUrl"
btnClass=
"flex-col"
/>
<el-form-item
label=
"视频"
prop=
"
articleV
ideoUrl"
>
<UploadVideo
v-model=
"form.
articleV
ideoUrl"
btnClass=
"flex-col"
/>
</el-form-item>
</
template
>
</div>
...
...
@@ -254,6 +254,7 @@ import {
BooleanFlag
,
ReleaseStatusTypeEnum
,
articleTypeListOptions
,
VideoPositionEnum
,
}
from
'@/constants'
import
UploadFile
from
'@/components/common/UploadFile/index.vue'
import
UploadVideo
from
'@/components/common/UploadVideo/index.vue'
...
...
@@ -314,8 +315,8 @@ const [form, resetForm] = useResetData({
pushList
:
[],
// 视频
video
Url
:
''
,
insertVideo
:
BooleanFlag
.
NO
,
video
Location
:
VideoPositionEnum
.
TOP
,
articleVideoUrl
:
''
,
})
const
rules
:
Record
<
string
,
FormItemRule
[]
>
=
{
...
...
src/views/questionDetail/index.vue
View file @
6d62a17d
...
...
@@ -236,7 +236,7 @@
>
<el-icon
class=
"text-base"
><IEpChatRound
/></el-icon>
<span>
{{
answer
.
childrenNum
?
`${answer.childrenNum
}
条评论`
:
'
添加评论
'
}}
{{
answer
.
childrenNum
?
`${answer.childrenNum
}
条评论`
:
'
回复
'
}}
<
/span
>
<
/button
>
<
/div
>
...
...
src/views/userPage/index.vue
View file @
6d62a17d
...
...
@@ -138,7 +138,7 @@
<div
class=
"flex-1 min-w-0"
>
<div
class=
"bg-white rounded-lg shadow-sm min-h-500px"
>
<router-view
v-slot=
"
{ Component, route }">
<transition
name=
"fade
"
mode=
"in-out
"
>
<transition
name=
"fade
-user"
mode=
"out-in
"
>
<keep-alive>
<component
:is=
"Component"
:key=
"getThirdLevelKey(route)"
ref=
"componentRef"
/>
</keep-alive>
...
...
@@ -471,4 +471,20 @@ onMounted(() => {
transform
:
translateY
(
-20px
)
rotateY
(
10deg
)
translateZ
(
200px
)
scale
(
0.9
);
filter
:
blur
(
6px
);
}
.fade-user-enter-from
,
.fade-user-leave-to
{
opacity
:
0
;
transform
:
translateX
(
10px
);
filter
:
blur
(
4px
);
}
.fade-user-enter-to
,
.fade-user-leave-from
{
opacity
:
1
;
transform
:
translateX
(
0
);
filter
:
blur
(
0
);
}
.fade-user-enter-active
,
.fade-user-leave-active
{
transition
:
all
0.3s
ease
;
}
</
style
>
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