Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-learn
Commits
65a895a2
提交
65a895a2
authored
10月 27, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(论坛): 课程论坛查看详情时修改为在当前窗口展示
上级
7ff278b3
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
56 行增加
和
7 行删除
+56
-7
PostItem.vue
src/modules/bbs/components/PostItem.vue
+8
-1
PostPinned.vue
src/modules/bbs/components/PostPinned.vue
+12
-1
Index.vue
src/modules/bbs/views/Index.vue
+18
-3
View.vue
src/modules/bbs/views/View.vue
+2
-1
CourseViewBBS.vue
src/modules/course/components/CourseViewBBS.vue
+15
-1
CourseIndex.vue
src/modules/course/views/CourseIndex.vue
+1
-0
没有找到文件。
src/modules/bbs/components/PostItem.vue
浏览文件 @
65a895a2
...
@@ -5,6 +5,7 @@ import { useMapStore } from '@/stores/map'
...
@@ -5,6 +5,7 @@ import { useMapStore } from '@/stores/map'
interface
Props
{
interface
Props
{
data
:
PostItem
data
:
PostItem
onClick
?:
(
data
:
PostItem
,
e
:
Event
)
=>
boolean
}
}
const
props
=
defineProps
<
Props
>
()
const
props
=
defineProps
<
Props
>
()
...
@@ -20,11 +21,17 @@ const username = $computed(() => {
...
@@ -20,11 +21,17 @@ const username = $computed(() => {
const
user
=
props
.
data
.
sso_user
const
user
=
props
.
data
.
sso_user
return
user
.
realname
||
user
.
nickname
||
user
.
username
return
user
.
realname
||
user
.
nickname
||
user
.
username
})
})
function
handleClick
(
data
:
PostItem
,
event
:
Event
)
{
if
(
props
.
onClick
&&
!
props
.
onClick
(
data
,
event
))
{
event
.
preventDefault
()
}
}
</
script
>
</
script
>
<
template
>
<
template
>
<section
class=
"post-item"
>
<section
class=
"post-item"
>
<router-link
:to=
"`/bbs/$
{data.id}`" target="_blank">
<router-link
:to=
"`/bbs/$
{data.id}`" target="_blank"
@click="handleClick(data, $event)"
>
<div
class=
"post-item-hd"
>
<div
class=
"post-item-hd"
>
<p
class=
"post-item__type"
:class=
"`type-$
{data.type}`">
{{
typeText
}}
</p>
<p
class=
"post-item__type"
:class=
"`type-$
{data.type}`">
{{
typeText
}}
</p>
<h2
class=
"post-item__title"
>
{{
data
.
title
}}
<span
class=
"is-hot"
v-if=
"data.is_hot"
>
热
</span></h2>
<h2
class=
"post-item__title"
>
{{
data
.
title
}}
<span
class=
"is-hot"
v-if=
"data.is_hot"
>
热
</span></h2>
...
...
src/modules/bbs/components/PostPinned.vue
浏览文件 @
65a895a2
...
@@ -5,6 +5,7 @@ import { getTopPostList } from '../api'
...
@@ -5,6 +5,7 @@ import { getTopPostList } from '../api'
interface
Props
{
interface
Props
{
courseId
?:
string
courseId
?:
string
semesterId
?:
string
semesterId
?:
string
onClick
?:
(
data
:
TopPostItem
,
e
:
Event
)
=>
boolean
}
}
const
props
=
defineProps
<
Props
>
()
const
props
=
defineProps
<
Props
>
()
...
@@ -16,12 +17,22 @@ function fetchList() {
...
@@ -16,12 +17,22 @@ function fetchList() {
})
})
}
}
onMounted
(
fetchList
)
onMounted
(
fetchList
)
function
handleClick
(
data
:
TopPostItem
,
event
:
Event
)
{
if
(
props
.
onClick
&&
!
props
.
onClick
(
data
,
event
))
{
event
.
preventDefault
()
}
}
</
script
>
</
script
>
<
template
>
<
template
>
<section
class=
"pined-post"
v-if=
"list.length"
>
<section
class=
"pined-post"
v-if=
"list.length"
>
<section
class=
"pined-post-item"
v-for=
"item in list"
:key=
"item.id"
>
<section
class=
"pined-post-item"
v-for=
"item in list"
:key=
"item.id"
>
<router-link
:to=
"`/bbs/$
{item.id}`" target="_blank" class="pined-post-item__inner">
<router-link
:to=
"`/bbs/$
{item.id}`"
target="_blank"
class="pined-post-item__inner"
@click="handleClick(item, $event)">
<p
class=
"t1"
>
置顶
</p>
<p
class=
"t1"
>
置顶
</p>
<p
class=
"t2"
>
{{
item
.
title
}}
</p>
<p
class=
"t2"
>
{{
item
.
title
}}
</p>
<p
class=
"t3"
v-if=
"!courseId"
>
<p
class=
"t3"
v-if=
"!courseId"
>
...
...
src/modules/bbs/views/Index.vue
浏览文件 @
65a895a2
...
@@ -15,6 +15,7 @@ interface Props {
...
@@ -15,6 +15,7 @@ interface Props {
const
props
=
defineProps
<
Props
>
()
const
props
=
defineProps
<
Props
>
()
const
PostForm
=
defineAsyncComponent
(()
=>
import
(
'../components/PostForm.vue'
))
const
PostForm
=
defineAsyncComponent
(()
=>
import
(
'../components/PostForm.vue'
))
const
PostView
=
defineAsyncComponent
(()
=>
import
(
'./View.vue'
))
const
{
courses
,
courseValue
,
chapters
}
=
useGetCourseList
()
const
{
courses
,
courseValue
,
chapters
}
=
useGetCourseList
()
const
courseList
=
$computed
(()
=>
{
const
courseList
=
$computed
(()
=>
{
...
@@ -88,22 +89,36 @@ function handleRefetch() {
...
@@ -88,22 +89,36 @@ function handleRefetch() {
appList
?.
refetch
()
appList
?.
refetch
()
}
}
const
postFormVisible
=
$ref
(
false
)
const
postFormVisible
=
$ref
(
false
)
const
clickRow
=
ref
()
let
viewVisible
=
$ref
(
false
)
function
handleView
(
data
:
any
)
{
clickRow
.
value
=
data
if
(
props
.
courseId
&&
props
.
semesterId
)
{
viewVisible
=
true
return
false
}
return
true
}
function
handleBack
()
{
viewVisible
=
false
}
</
script
>
</
script
>
<
template
>
<
template
>
<AppList
:filters=
"filters"
v-bind=
"listOptions"
ref=
"appList"
>
<AppList
:filters=
"filters"
v-bind=
"listOptions"
ref=
"appList"
v-show=
"!viewVisible"
>
<template
#
header-prepend
>
<template
#
header-prepend
>
<el-button
round
type=
"primary"
@
click=
"postFormVisible = true"
style=
"margin-right: 30px"
>
我要发帖
</el-button>
<el-button
round
type=
"primary"
@
click=
"postFormVisible = true"
style=
"margin-right: 30px"
>
我要发帖
</el-button>
</
template
>
</
template
>
<
template
#
body=
"{ data }"
>
<
template
#
body=
"{ data }"
>
<!-- 置顶帖子 -->
<!-- 置顶帖子 -->
<PostPinned
:courseId=
"courseId"
:semesterId=
"semesterId"
></PostPinned>
<PostPinned
:courseId=
"courseId"
:semesterId=
"semesterId"
:onClick=
"handleView"
></PostPinned>
<template
v-if=
"data.length"
>
<template
v-if=
"data.length"
>
<PostItem
:data=
"item"
v-for=
"item in data"
:key=
"item.id"
></PostItem>
<PostItem
:data=
"item"
v-for=
"item in data"
:key=
"item.id"
:onClick=
"handleView"
></PostItem>
</
template
>
</
template
>
<el-empty
description=
"暂无数据"
v-else
/>
<el-empty
description=
"暂无数据"
v-else
/>
</template>
</template>
</AppList>
</AppList>
<PostView
:id=
"clickRow.id"
:onBack=
"handleBack"
v-if=
"viewVisible && clickRow"
></PostView>
<PostForm
<PostForm
:courseId=
"courseId"
:courseId=
"courseId"
:semesterId=
"semesterId"
:semesterId=
"semesterId"
...
...
src/modules/bbs/views/View.vue
浏览文件 @
65a895a2
...
@@ -11,6 +11,7 @@ const DiscussForm = defineAsyncComponent(() => import('../components/DiscussForm
...
@@ -11,6 +11,7 @@ const DiscussForm = defineAsyncComponent(() => import('../components/DiscussForm
interface
Props
{
interface
Props
{
id
:
string
id
:
string
onBack
?:
()
=>
void
}
}
const
props
=
defineProps
<
Props
>
()
const
props
=
defineProps
<
Props
>
()
const
router
=
useRouter
()
const
router
=
useRouter
()
...
@@ -59,7 +60,7 @@ function toggleCollection() {
...
@@ -59,7 +60,7 @@ function toggleCollection() {
// 返回列表
// 返回列表
function
handleBack
()
{
function
handleBack
()
{
router
.
replace
(
'/bbs'
)
props
.
onBack
?
props
.
onBack
()
:
router
.
replace
(
'/bbs'
)
}
}
</
script
>
</
script
>
...
...
src/modules/course/components/CourseViewBBS.vue
浏览文件 @
65a895a2
...
@@ -6,7 +6,21 @@ const courseId = route.query.course_id as string
...
@@ -6,7 +6,21 @@ const courseId = route.query.course_id as string
const
semesterId
=
route
.
query
.
semester_id
as
string
const
semesterId
=
route
.
query
.
semester_id
as
string
</
script
>
</
script
>
<
template
>
<
template
>
<div
style=
"margin: 0 -20px
"
>
<div
class=
"course-bbs
"
>
<BBSIndex
:courseId=
"courseId"
:semesterId=
"semesterId"
></BBSIndex>
<BBSIndex
:courseId=
"courseId"
:semesterId=
"semesterId"
></BBSIndex>
</div>
</div>
</
template
>
</
template
>
<
style
lang=
"scss"
>
.course-bbs
{
padding-top
:
10px
;
.table-list-hd
{
padding
:
0
;
margin-bottom
:
0
;
}
.table-list-bd
{
padding
:
0
;
}
}
</
style
>
src/modules/course/views/CourseIndex.vue
浏览文件 @
65a895a2
...
@@ -74,5 +74,6 @@ log.upload({
...
@@ -74,5 +74,6 @@ log.upload({
// 右侧
// 右侧
.course-right
{
.course-right
{
flex
:
1
;
flex
:
1
;
overflow
:
hidden
;
}
}
</
style
>
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论