提交 c474baf0 authored 作者: 王鹏飞's avatar 王鹏飞

Merge branch 'master' into sofia

This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -73,7 +73,8 @@
"webpack-merge": "^4.2.2"
},
"dependencies": {
"@ckeditor/ckeditor5-build-classic": "^25.0.0",
"@ckeditor/ckeditor5-build-classic": "^27.0.0",
"@ckeditor/ckeditor5-build-decoupled-document": "^27.0.0",
"@ckeditor/ckeditor5-vue2": "^1.0.5",
"@ezijing/web-message-sdk": "^0.2.1",
"axios": "^0.21.1",
......
......@@ -184,7 +184,7 @@ export default class CourseAction extends BaseACTION {
}
})
}
json.tabs1ChapterList.course.push({
cur.curriculum.curriculum_essay && json.tabs1ChapterList.course.push({
title: _vIn.$t('action.courseAction.courseWork'),
isUp: true,
chapters: [],
......
import BaseAPI from '@/api/base_api'
const httpRequest = new BaseAPI(webConf)
/**
* 获取课程详情
* @param {string} semesterId 学期ID
* @param {string} courseId 课程ID
*/
export function getCourse(semesterId, courseId) {
return httpRequest.get(`/api/lms/v2/education/courses/${semesterId}/${courseId}`)
}
/**
* 课程考核
* @param {string} semesterId 学期ID
* @param {string} courseId 课程ID
*/
export function getCourseAssess(semesterId, courseId) {
return httpRequest.get(`/api/lms/v2/analytics/courses/${semesterId}/${courseId}/evaluation`).then(res => {
// 视频数据组装
let videoList = Object.values(res.video_evaluation)
videoList = videoList.map(item => {
item.sections = Object.values(item.sections)
return item
})
res.video_evaluation = videoList
// 作业数据组装
let homeworkList = Object.values(res.homework_evaluation)
homeworkList = homeworkList.map(item => {
item.sections = Object.values(item.sections)
return item
})
res.homework_evaluation = homeworkList
return res
})
}
import BaseAPI from '@/api/base_api'
const httpRequest = new BaseAPI(webConf)
/**
* 获取课程详情
* @param {string} semesterId 学期ID
* @param {string} courseId 课程ID
*/
export function getCourse(semesterId, courseId) {
return httpRequest.get(`/api/lms/v2/education/courses/${semesterId}/${courseId}`)
}
/**
* 获取讨论题目列表,“我提出的问题”和“我参与的问题”信息
* dataJson.limit - 获取数量
* dataJson.offset - 偏移量
* @param {[string]} path
* @param {[object]} dataJson
*/
export function getDiscussList(qid, params) {
return httpRequest.get(`/api/lms/v2/qa/questions/${qid}`, params)
}
/**
* 获取讨论题目列表,“课程的问题”信息
* dataJson.limit - 获取数量
* dataJson.offset - 偏移量
* dataJson.sort - 排序类型
* @param {[string]} cid
* @param {[string]} sid
* @param {[object]} dataJson
*/
export function getCourseDiscussList(sid, cid, params) {
return httpRequest.get(`/api/lms/v2/qa/questions/course/${sid}/${cid}`, { params })
}
/**
* 获取问题详情
* @param {[string]} qid
*/
export function getDiscussDetail(qid) {
return httpRequest.get(`/api/lms/v2/qa/questions/${qid}`, {})
}
/**
* 删除提问
* @param {[string]} qid
*/
export function deleteDiscuss(qid) {
return httpRequest.delete(`/api/lms/v2/qa/questions/${qid}`, {})
}
/**
* 提出问题
* @param {[object]} param
*/
export function publishQues(param) {
return httpRequest.post('/api/lms/v2/qa/questions', param, { headers: { 'Content-Type': 'application/json' } })
}
/**
* 回答问题
* @param {[object]} param
*/
export function answerQues(param) {
return httpRequest.post('/api/lms/v2/qa/answers', param, { headers: { 'Content-Type': 'application/json' } })
}
/**
* 删除回答
* @param {[string]} aid
*/
export function deleteAnswer(aid) {
return httpRequest.delete(`/api/lms/v2/qa/answers/${aid}`, {})
}
/**
* 回复评论
* @param {[object]} param
*/
export function callbackComment(param) {
return httpRequest.post('/api/lms/v2/qa/comments', param, { headers: { 'Content-Type': 'application/json' } })
}
/**
* 删除评论
* @param {[string]} cid
*/
export function deleteComment(cid) {
return httpRequest.delete(`/api/lms/v2/qa/comments/${cid}`)
}
/**
* 点赞
* @param {[object]} param
*/
export function like(param) {
return httpRequest.post('/api/lms/v2/qa/tags', param, { headers: { 'Content-Type': 'application/json' } })
}
/**
* 取消点赞
* @param {[string]} tagid
*/
export function unlike(tagid) {
return httpRequest.delete(`/api/lms/v2/qa/tags/${tagid}`, {})
}
<template>
<div class="app-container">
<div class="app-container-hd" v-if="title">
<div class="app-container-hd__title">{{ title }}</div>
<div class="app-container-hd__right">
<slot name="header-right"></slot>
</div>
</div>
<div class="app-container-bd">
<slot></slot>
</div>
<slot name="footer"></slot>
</div>
</template>
<script>
export default {
name: 'AppContainer',
props: { title: { type: String } }
}
</script>
<style lang="scss">
.app-container {
clear: both;
}
.app-container-hd {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30px;
margin-bottom: 20px;
border-bottom: 1px solid #ccc;
}
.app-container-hd__title {
font-size: 16px;
line-height: 45px;
}
.app-container-bd {
margin: 0.3rem;
}
.app-container-ft {
background-color: #fff;
position: sticky;
bottom: 0;
padding-top: 30px;
border-top: 1px solid #ccc;
}
</style>
......@@ -13,8 +13,13 @@
<script>
import CKEditor from '@ckeditor/ckeditor5-vue2'
import ClassicEditor from '@ckeditor/ckeditor5-build-classic'
import '@ckeditor/ckeditor5-build-classic/build/translations/zh-cn'
import DecoupledEditor from '@ckeditor/ckeditor5-build-decoupled-document'
import '@ckeditor/ckeditor5-build-decoupled-document/build/translations/zh-cn'
// import ClassicEditor from '@ckeditor/ckeditor5-build-classic'
// import '@ckeditor/ckeditor5-build-classic/build/translations/zh-cn'
import MyUploadAdapter from './MyUploadAdapter'
export default {
......@@ -27,14 +32,20 @@ export default {
},
data() {
return {
editor: ClassicEditor,
editor: DecoupledEditor,
editorConfig: {
language: this.$i18n.locale.toLocaleLowerCase()
language: this.$i18n.locale.toLocaleLowerCase(),
fontFamily: { options: ['default', '宋体', 'Times New Roman'] },
fontSize: { options: ['12px', '14px', '16px', '18px', '20px', '24px', '36px'] }
}
}
},
methods: {
onEditorReady(editor) {
editor.ui
.getEditableElement()
.parentElement.insertBefore(editor.ui.view.toolbar.element, editor.ui.getEditableElement())
const FileRepository = editor.plugins.get('FileRepository')
// 自定义上传图片插件
FileRepository.createUploadAdapter = loader => {
......@@ -43,6 +54,22 @@ export default {
},
onEditorInput(value) {
this.$emit('input', value)
this.dispatch('ElFormItem', 'el.form.change', value)
},
dispatch(componentName, eventName, params) {
var parent = this.$parent || this.$root
var name = parent.$options.componentName
while (parent && (!name || name !== componentName)) {
parent = parent.$parent
if (parent) {
name = parent.$options.componentName
}
}
if (parent) {
parent.$emit.apply(parent, [eventName].concat(params))
}
}
}
}
......@@ -53,6 +80,8 @@ export default {
min-height: 300px;
max-height: 500px;
word-break: break-word;
background: var(--ck-color-base-background);
border: 1px solid var(--ck-color-toolbar-border) !important;
}
.ck-sticky-panel__content {
position: unset !important;
......
......@@ -6,10 +6,10 @@
</div>
<div class="nav-right">
<div class="nav-message"></div>
<!-- <div class="notify" @click="goNotify()">
<div class="notify" @click="goNotify()">
{{ $t('components.learnSysLayout.navigation.tip') }}
<div class="num" v-if="this.$store.getters.myMsg != 0">{{ this.$store.getters.myMsg }}</div>
</div> -->
</div>
<!-- <language-switch /> -->
</div>
</div>
......@@ -17,8 +17,8 @@
<script>
import LanguageSwitch from '@/components/languageSwitch/index.vue'
// import cAction from '../../action'
import Message from '@ezijing/web-message-sdk'
import cAction from '../../action'
// import Message from '@ezijing/web-message-sdk'
export default {
components: { LanguageSwitch },
data() {
......@@ -27,15 +27,15 @@ export default {
}
},
mounted() {
// cAction.Other.getNavMsg()
// .then(data => {
// this.$store.commit('myMsg', data.num)
// })
// .catch(e => {
// this.$message.error(e.message)
// })
cAction.Other.getNavMsg()
.then(data => {
this.$store.commit('myMsg', data.num)
})
.catch(e => {
this.$message.error(e.message)
})
// 新版通知
Message({ container: '.nav-message', source: 'SOFIA_WEB', baseURL: webConf.others.messageBaseURL })
// Message({ container: '.nav-message', source: 'SOFIA_WEB', baseURL: webConf.others.messageBaseURL })
},
methods: {
goNotify() {
......
<template>
<div>
<div ref="box" :class="classes">
<slot></slot>
</div>
<div class="block-control" @click="toggle" v-if="hasMore">
<template v-if="isOpen"> <i class="el-icon-caret-top"></i><span>收起</span> </template>
<template v-else> <i class="el-icon-caret-bottom"></i><span>展开</span> </template>
</div>
</div>
</template>
<script>
export default {
data() {
return {
max: 300,
hasMore: false,
isOpen: false
}
},
computed: {
classes() {
return {
'has-more': this.hasMore && !this.isOpen
}
}
},
methods: {
init() {
const height = this.$refs.box.offsetHeight
this.hasMore = height > this.max
},
toggle() {
this.isOpen = !this.isOpen
}
},
mounted() {
this.init()
}
}
</script>
<style lang="scss">
.block-control {
height: 20px;
display: flex;
align-items: center;
justify-content: center;
margin-top: 10px;
padding-top: 5px;
color: #d3dce6;
cursor: pointer;
border-top: 1px solid #eaeefb;
i {
font-size: 16px;
}
span {
display: none;
padding-left: 5px;
font-size: 12px;
}
&:hover {
color: #1f2f3d;
span {
display: block;
}
}
}
.has-more {
max-height: 300px;
overflow: hidden;
}
</style>
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论