Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-learn
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-learn
Commits
f3175e50
提交
f3175e50
authored
10月 25, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
e548acd9
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
50 行增加
和
33 行删除
+50
-33
DiscussForm.vue
src/modules/bbs/components/DiscussForm.vue
+6
-2
DiscussItem.vue
src/modules/bbs/components/DiscussItem.vue
+3
-1
DiscussItemCommentList.vue
src/modules/bbs/components/DiscussItemCommentList.vue
+3
-1
PostForm.vue
src/modules/bbs/components/PostForm.vue
+7
-2
Index.vue
src/modules/bbs/views/Index.vue
+27
-27
index.ts
src/utils/index.ts
+4
-0
没有找到文件。
src/modules/bbs/components/DiscussForm.vue
浏览文件 @
f3175e50
...
...
@@ -2,7 +2,6 @@
import
type
{
FormInstance
,
FormRules
}
from
'element-plus'
import
{
ElMessage
}
from
'element-plus'
import
AppUpload
from
'@/components/base/AppUpload.vue'
import
AppEditor
from
'@/components/base/AppEditor.vue'
import
{
replyToPost
}
from
'../api'
import
{
isVideo
}
from
'@/utils/index'
interface
Props
{
...
...
@@ -69,7 +68,12 @@ function beforeUpload(file: any) {
@
update:modelValue=
"$emit('update:modelValue')"
>
<el-form
ref=
"formRef"
:model=
"form"
:rules=
"rules"
hide-required-asterisk
label-position=
"top"
>
<el-form-item
prop=
"content"
>
<AppEditor
v-model=
"form.content"
:height=
"300"
/>
<el-input
type=
"textarea"
show-word-limit
:autosize=
"
{ minRows: 10, maxRows: 12 }"
:maxlength="500"
v-model="form.content">
</el-input>
</el-form-item>
<el-form-item
prop=
"files"
>
<AppUpload
v-model=
"form.files"
accept=
"image/*,video/*"
:beforeUpload=
"beforeUpload"
>
...
...
src/modules/bbs/components/DiscussItem.vue
浏览文件 @
f3175e50
...
...
@@ -5,6 +5,7 @@ import { ElMessage, ElInput } from 'element-plus'
import
DiscussItemCommentList
from
'./DiscussItemCommentList.vue'
import
FileList
from
'./FileList.vue'
import
{
replyToPost
}
from
'../api'
import
{
content2Html
}
from
'@/utils'
interface
Props
{
landlordId
:
string
...
...
@@ -91,7 +92,7 @@ function handleSubmit() {
</div>
<div
class=
"discuss-item__right"
>
<div
class=
"discuss-item__main"
>
<div
class=
"discuss-item__content"
v-html=
"
data.content
"
></div>
<div
class=
"discuss-item__content"
v-html=
"
content2Html(data.content)
"
></div>
<FileList
preview
:data=
"data.files"
v-if=
"data.files.length"
/>
</div>
<p
class=
"discuss-item__time"
>
{{ data.updated_time }}
</p>
...
...
@@ -102,6 +103,7 @@ function handleSubmit() {
<el-form-item
prop=
"content"
>
<el-input
type=
"textarea"
show-word-limit
:autosize=
"{ minRows: 6, maxRows: 6 }"
:maxlength=
"100"
v-model=
"form.content"
...
...
src/modules/bbs/components/DiscussItemCommentList.vue
浏览文件 @
f3175e50
...
...
@@ -3,6 +3,7 @@ import type { FormInstance, FormRules } from 'element-plus'
import
type
{
DiscussItem
,
DiscussCommentItem
,
User
}
from
'../types'
import
{
ElMessage
,
ElInput
}
from
'element-plus'
import
{
getCommitList
,
replyToPost
}
from
'../api'
import
{
content2Html
}
from
'@/utils'
interface
Props
{
data
:
DiscussItem
...
...
@@ -110,7 +111,7 @@ defineExpose({ refresh })
>
:
</span>
</div>
<div
class=
"discuss-comment-item-bd"
>
{{
item
.
content
}}
</div>
<div
class=
"discuss-comment-item-bd"
v-html=
"content2Html(item.content)"
>
</div>
<div
class=
"discuss-comment-item-ft"
>
<p>
来自于
{{
item
.
created_time
}}
</p>
<div
class=
"discuss-item__comment"
@
click=
"handleReply(item)"
><p>
回复
</p></div>
...
...
@@ -123,6 +124,7 @@ defineExpose({ refresh })
<el-form-item
prop=
"content"
>
<el-input
type=
"textarea"
show-word-limit
:autosize=
"
{ minRows: 6, maxRows: 6 }"
:maxlength="100"
v-model="form.content"
...
...
src/modules/bbs/components/PostForm.vue
浏览文件 @
f3175e50
...
...
@@ -2,7 +2,6 @@
import
type
{
FormInstance
,
FormRules
}
from
'element-plus'
import
{
ElMessage
}
from
'element-plus'
import
AppUpload
from
'@/components/base/AppUpload.vue'
import
AppEditor
from
'@/components/base/AppEditor.vue'
import
{
createPost
}
from
'../api'
import
{
useMapStore
}
from
'@/stores/map'
import
{
useGetCourseList
}
from
'@/composables/useGetCourseList'
...
...
@@ -43,6 +42,7 @@ const rules = ref<FormRules>({
watchEffect
(()
=>
{
courseValue
.
value
=
form
.
course_id
const
course
=
courses
.
value
.
find
(
item
=>
item
.
course_id
===
form
.
course_id
)
form
.
chapter_id
=
''
form
.
semester_id
=
course
?
course
.
semester
.
id
:
''
})
// 提交
...
...
@@ -107,7 +107,12 @@ function beforeUpload(file: any) {
<el-input
v-model=
"form.title"
/>
</el-form-item>
<el-form-item
label=
"正文内容"
prop=
"content"
>
<AppEditor
v-model=
"form.content"
:height=
"300"
/>
<el-input
type=
"textarea"
show-word-limit
:autosize=
"
{ minRows: 10, maxRows: 12 }"
:maxlength="500"
v-model="form.content">
</el-input>
</el-form-item>
<el-form-item
prop=
"files"
>
<AppUpload
v-model=
"form.files"
accept=
"image/*,video/*"
:beforeUpload=
"beforeUpload"
>
...
...
src/modules/bbs/views/Index.vue
浏览文件 @
f3175e50
...
...
@@ -41,28 +41,6 @@ const params = reactive({
})
// 列表配置
const
listOptions
=
computed
(()
=>
{
const
filters
=
[
{
type
:
'select'
,
prop
:
'chapter_id'
,
placeholder
:
'请选择'
,
options
:
chapterList
,
labelKey
:
'name'
,
valueKey
:
'id'
},
{
type
:
'select'
,
prop
:
'search_by'
,
placeholder
:
'请选择'
,
options
:
bbsSearchByList
},
{
type
:
'select'
,
prop
:
'type'
,
placeholder
:
'请选择'
,
options
:
currentTypes
},
{
type
:
'select'
,
prop
:
'order_by'
,
placeholder
:
'请选择'
,
options
:
bbsOrderByList
}
]
!
props
.
courseId
&&
filters
.
unshift
({
type
:
'select'
,
prop
:
'course_id'
,
placeholder
:
'请选择'
,
options
:
courseList
,
labelKey
:
'name'
,
valueKey
:
'course_id'
})
return
{
hasFilterButton
:
false
,
remote
:
{
...
...
@@ -72,17 +50,39 @@ const listOptions = computed(() => {
if
(
params
.
course_id
!==
requestParams
.
course_id
)
{
requestParams
.
chapter_id
=
''
}
params
.
course_id
=
requestParams
.
course_id
||
''
courseValue
.
value
=
p
arams
.
course_id
Object
.
assign
(
params
,
requestParams
)
courseValue
.
value
=
requestP
arams
.
course_id
return
requestParams
},
callback
(
res
:
{
total
:
number
;
data
:
any
})
{
return
{
total
:
res
.
total
,
list
:
res
.
data
}
}
},
filters
}
}
})
const
filters
=
$computed
(()
=>
{
return
[
!
props
.
courseId
&&
{
type
:
'select'
,
prop
:
'course_id'
,
placeholder
:
'请选择'
,
options
:
courseList
,
labelKey
:
'name'
,
valueKey
:
'course_id'
},
{
type
:
'select'
,
prop
:
'chapter_id'
,
placeholder
:
'请选择'
,
options
:
chapterList
,
labelKey
:
'name'
,
valueKey
:
'id'
},
{
type
:
'select'
,
prop
:
'search_by'
,
placeholder
:
'请选择'
,
options
:
bbsSearchByList
},
{
type
:
'select'
,
prop
:
'type'
,
placeholder
:
'请选择'
,
options
:
currentTypes
},
{
type
:
'select'
,
prop
:
'order_by'
,
placeholder
:
'请选择'
,
options
:
bbsOrderByList
}
]
})
// 刷新
function
handleRefetch
()
{
appList
?.
refetch
()
...
...
@@ -91,7 +91,7 @@ const postFormVisible = $ref(false)
</
script
>
<
template
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<AppList
:filters=
"filters"
v-bind=
"listOptions"
ref=
"appList"
>
<template
#
header-prepend
>
<el-button
round
type=
"primary"
@
click=
"postFormVisible = true"
style=
"margin-right: 30px"
>
我要发帖
</el-button>
</
template
>
...
...
src/utils/index.ts
浏览文件 @
f3175e50
...
...
@@ -21,3 +21,7 @@ export function formatQuestionType(type: QuestionType) {
export
function
isVideo
(
url
:
string
)
{
return
url
.
includes
(
'.mp4'
)
}
export
function
content2Html
(
content
:
string
)
{
return
content
.
replaceAll
(
'
\
n'
,
'<br>'
)
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论