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

Merge branch 'dev' into bluestar

...@@ -16,4 +16,6 @@ export default class AffairsAction extends BaseACTION { ...@@ -16,4 +16,6 @@ export default class AffairsAction extends BaseACTION {
updateAffairs (rid, obj) { return Affairs.updateAffairs(rid, obj).then(res => res) } updateAffairs (rid, obj) { return Affairs.updateAffairs(rid, obj).then(res => res) }
/* 重修图片上传 */ /* 重修图片上传 */
uploadFile (obj) { return Affairs.uploadFile(obj).then(res => res) } uploadFile (obj) { return Affairs.uploadFile(obj).then(res => res) }
/* 获取成绩 */
obtainReport (obj) { return Affairs.obtainReport(obj).then(res => res) }
} }
...@@ -136,6 +136,7 @@ export default class CourseAction extends BaseACTION { ...@@ -136,6 +136,7 @@ export default class CourseAction extends BaseACTION {
_homework.semester_id = data.semester_id _homework.semester_id = data.semester_id
} }
if (__.live && __.live.id) { if (__.live && __.live.id) {
__.live.live_status = parseInt(__.live.live_status)
let str = '' let str = ''
switch (__.live.live_status) { switch (__.live.live_status) {
case 0: str = '直播未开始'; break case 0: str = '直播未开始'; break
......
...@@ -88,6 +88,7 @@ export default class PlayerAction extends BaseACTION { ...@@ -88,6 +88,7 @@ export default class PlayerAction extends BaseACTION {
} }
} }
if (__.live && __.live.id) { if (__.live && __.live.id) {
__.live.live_status = parseInt(__.live.live_status)
let str = '' let str = ''
switch (__.live.live_status) { switch (__.live.live_status) {
case 0: str = '直播未开始'; break case 0: str = '直播未开始'; break
......
...@@ -29,4 +29,6 @@ export default class AffairsAPI extends BaseAPI { ...@@ -29,4 +29,6 @@ export default class AffairsAPI extends BaseAPI {
updateAffairs = (rid, obj = {}) => this.post(`/api/lms/v2/lobby/processes/${rid}`, obj, { headers: { 'Content-Type': 'multipart/form-data' } }) updateAffairs = (rid, obj = {}) => this.post(`/api/lms/v2/lobby/processes/${rid}`, obj, { headers: { 'Content-Type': 'multipart/form-data' } })
/* 重修图片提交 */ /* 重修图片提交 */
uploadFile = (obj = {}) => this.post('/api/lms/v2/lobby/tools/upload', obj, { headers: { 'Content-Type': 'multipart/form-data' } }) uploadFile = (obj = {}) => this.post('/api/lms/v2/lobby/tools/upload', obj, { headers: { 'Content-Type': 'multipart/form-data' } })
/* 获取成绩单 */
obtainReport = (type) => this.get(`/api/lms/v2/lobby/havereport?type=${type}`, {})
} }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<li class="tabs-hd">{{item.name}}</li> <li class="tabs-hd">{{item.name}}</li>
<template v-for="(item1, index1) in item.arrItem"> <template v-for="(item1, index1) in item.arrItem">
<li v-bind:key="index1"> <li v-bind:key="index1">
<div :class="['tab', (item.selectIndex == index1 ? 'on' : '')]" @click="selFindSelect" :data-index='index1' :data-i="index" :data-key='item.key' :data-val='item1.val'>{{item1.name}}</div> <div :class="['tab', (item.selectIndex == index1 ? 'on' : '')]" @click="selFindSelect($event, item1)" :data-index='index1' :data-i="index" :data-key='item.key' :data-val='item1.val'>{{item1.name}}</div>
</li> </li>
</template> </template>
</ul> </ul>
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
} }
}, },
methods: { methods: {
selFindSelect (e) { selFindSelect (e, item) {
const _data = e.currentTarget.dataset const _data = e.currentTarget.dataset
const index = _data.index const index = _data.index
const json = this.tapParam const json = this.tapParam
...@@ -48,7 +48,8 @@ export default { ...@@ -48,7 +48,8 @@ export default {
// json[i].isShow = false // json[i].isShow = false
const param = { const param = {
index: index, index: index,
id: _data.val id: _data.val,
name: item.name
} }
this.$emit('tapParam', param) this.$emit('tapParam', param)
} }
......
...@@ -35,7 +35,8 @@ export default { ...@@ -35,7 +35,8 @@ export default {
const config = { const config = {
height: 400, height: 400,
uiColor: '#eeeeee', uiColor: '#eeeeee',
filebrowserImageUploadUrl: '/api/ckeditor/img/upload', filebrowserImageUploadUrl: '/api/ck/form/ckeditor-upload',
fileTools_requestHeaders: { tenant: 'sofia' },
// resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true, // resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true,
toolbar: [ toolbar: [
// { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] }, // { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] },
......
<template>
<div class="hall-form">
<el-radio v-model="schoolReport" @change="changeReport" label="elreport" border size="small">电子成绩单</el-radio>
<el-radio v-model="schoolReport" @change="changeReport" label="pareport" border size="small">纸质成绩单</el-radio>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" size="small" label-position="top" class="hall-form-body">
<el-form-item label="姓名" prop="personal_name" >
<el-input v-model="ruleForm.personal_name" :disabled="Number(ruleForm.submit) === 1"></el-input>
</el-form-item>
<el-form-item label="班级" prop="class_name">
<el-input v-model="ruleForm.class_name" :disabled="Number(ruleForm.submit) === 1"></el-input>
</el-form-item>
<el-form-item label="Sofia ID" prop="sofia_id" key="sofia_id">
<el-input v-model="ruleForm.sofia_id" type="number" :disabled="Number(ruleForm.submit) === 1"></el-input>
</el-form-item>
<el-form-item label="电话" prop="telephone" key="telephone" v-if="schoolReport === 'pareport'">
<el-input v-model="ruleForm.telephone" :disabled="Number(ruleForm.submit) === 1"></el-input>
</el-form-item>
<el-form-item label="邮寄地址" prop="email">
<el-input v-model="ruleForm.email" :disabled="Number(ruleForm.submit) === 1"></el-input>
</el-form-item>
<el-form-item label="需打印的份数" prop="number" key="number" v-if="schoolReport === 'pareport'">
<el-input v-model.number="ruleForm.number" type="number" :disabled="Number(ruleForm.submit) === 1"></el-input>
</el-form-item>
<el-form-item class="ts-width">
<el-button type="primary" :disabled="Number(ruleForm.submit) === 1" @click="submitForm('ruleForm')">{{Number(ruleForm.submit) === 1 ? '已提交' : '提交'}}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
name: 'hall-form',
props: {
formData: {
type: Object
}
},
watch: {
formData: {
immediate: true,
handler(value) {
this.ruleForm = Object.assign({}, value)
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
}
}
},
data() {
return {
ruleForm: {
personal_name: '',
class_name: '',
sofia_id: '',
telephone: '',
email: '',
number: null,
submit: 0
},
rules: {
personal_name: [
{ required: true, message: '请输入姓名', trigger: 'blur' }
],
class_name: [
{ required: true, message: '请输入班级', trigger: 'blur' }
],
sofia_id: [
{ required: true, message: '请输入Sofia ID', trigger: 'blur' }
],
telephone: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{ pattern: /^1[3456789]\d{9}$/, message: '手机号码格式错误' }
],
email: [
{ required: true, message: '请输入email', trigger: 'blur' }
],
number: [
{ required: true, message: '请输入打印份数', trigger: 'blur' }
]
},
schoolReport: 'elreport'
}
},
methods: {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$emit('submit', this.ruleForm, this.schoolReport)
} else {
return false
}
})
},
changeReport() {
this.$emit('submitType', this.schoolReport)
}
}
}
</script>
<style lang="scss" scoped>
.hall-form {
width: 100%;
.hall-form-body {
padding: 15px 10px 20px 10px;
}
}
::v-deep .el-form-item__label {
padding: 0 0 5px 0;
}
::v-deep .el-form-item {
margin-bottom: 12px;
}
::v-deep .el-input {
width: 25%;
}
::v-deep .el-button {
width: 25%;
margin-top: 20px;
}
</style>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/common/runtime.js"></script> <script type="text/javascript" src="https://zws-imgs-pub.ezijing.com/static/build/learn-mba/static/common/runtime.js"></script>
<!-- 直接引入aliyun播放插件 JS --> <!-- 直接引入aliyun播放插件 JS -->
<script type="text/javascript" charset="utf-8" src="https://g.alicdn.com/de/prismplayer/2.8.8/aliplayer-min.js"></script> <script type="text/javascript" charset="utf-8" src="https://g.alicdn.com/de/prismplayer/2.8.8/aliplayer-min.js"></script>
<!-- 解决iframe嵌套,CC视频在safri中打开免登陆兼容问题 --> <script type="text/javascript" charset="utf-8" src="https://player.alicdn.com/aliplayer/presentation/js/aliplayercomponents.min.js"></script> <!-- 解决iframe嵌套,CC视频在safri中打开免登陆兼容问题 -->
<script src="//view.csslcloud.net/js/_fix_.js"></script> <script src="//view.csslcloud.net/js/_fix_.js"></script>
<script src="//view.csslcloud.net/js/jquery-1.9.0.min.js" type="text/javascript"></script> <script src="//view.csslcloud.net/js/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="//view.csslcloud.net/js/sdk/3.1.0/liveSDK.js" type="text/javascript"></script> <script src="//view.csslcloud.net/js/sdk/3.1.0/liveSDK.js" type="text/javascript"></script>
......
<template> <template>
<div class="course-viewer-aside"> <aside class="course-viewer-aside">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane label="章节" name="0"> <el-tab-pane label="章节" name="0">
<div class="tab-pane"> <div class="tab-pane">
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </aside>
</template> </template>
<script> <script>
......
...@@ -35,7 +35,8 @@ export default { ...@@ -35,7 +35,8 @@ export default {
const config = { const config = {
height: 400, height: 400,
uiColor: '#eeeeee', uiColor: '#eeeeee',
filebrowserImageUploadUrl: '/api/ckeditor/img/upload', filebrowserImageUploadUrl: '/api/ck/form/ckeditor-upload',
fileTools_requestHeaders: { tenant: 'sofia' },
// resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true, // resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true,
toolbar: [ toolbar: [
// { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] }, // { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] },
......
...@@ -39,6 +39,7 @@ export default { ...@@ -39,6 +39,7 @@ export default {
}, },
iframeUrl() { iframeUrl() {
const live = this.chapter.live const live = this.chapter.live
live.live_status = parseInt(live.live_status)
if ( if (
live.live_status === 2 && live.live_status === 2 &&
live.enable_record === 1 && live.enable_record === 1 &&
......
...@@ -48,6 +48,8 @@ export default { ...@@ -48,6 +48,8 @@ export default {
props: { props: {
// 当前章节 // 当前章节
chapter: { type: Object }, chapter: { type: Object },
// 是否是PPT播放跳转
isSeek: { type: Boolean, default: false },
// PPT当前选中的索引 // PPT当前选中的索引
pptIndex: { type: Number, default: 0 } pptIndex: { type: Number, default: 0 }
}, },
...@@ -64,19 +66,18 @@ export default { ...@@ -64,19 +66,18 @@ export default {
throttleWait: 5, // 秒 throttleWait: 5, // 秒
progress: { progress: {
cpt: 0, // 当前播放时间 cpt: 0, // 当前播放时间
mpt: 0, // 视频时长 mpt: 0, // 当前播放最大时间
progress: 0, // 进度 progress: 0, // 进度
pt: 0 // 累计播放时间 pt: 0 // 累计观看时间
}, },
player: null, player: null,
watchedTimePoint: [], // 视频观看的时间点 watchedTime: 0,
timer: null, watchedTimePoint: [] // 视频观看的时间点
isPlaying: false
} }
}, },
watch: { watch: {
pptIndex(index) { pptIndex(index) {
this.updateVideoCurrentTime(index) this.isSeek && this.updateVideoCurrentTime(index)
} }
}, },
computed: { computed: {
...@@ -146,12 +147,10 @@ export default { ...@@ -146,12 +147,10 @@ export default {
if (this.progress.cpt) { if (this.progress.cpt) {
this.player.seek(this.progress.cpt) this.player.seek(this.progress.cpt)
} }
// 更新视频观看总时长
this.updateWatchTime()
}, },
// 当前播放时间更新 // 当前播放时间更新
onTimeupdate(time) { onTimeupdate(time) {
this.isPlaying = true time = Math.floor(time)
const ppts = this.chatperResources.ppts || [] const ppts = this.chatperResources.ppts || []
let index = this.chatperResources.ppts.findIndex( let index = this.chatperResources.ppts.findIndex(
item => item.ppt_point > time item => item.ppt_point > time
...@@ -159,14 +158,16 @@ export default { ...@@ -159,14 +158,16 @@ export default {
index = index !== -1 ? index - 1 : ppts.length - 1 index = index !== -1 ? index - 1 : ppts.length - 1
this.$emit('change-ppt', index) this.$emit('change-ppt', index)
const durations = this.player.getDuration() const durations = this.player.getDuration()
// 更新视频时间 // 更新当前播放时间
this.progress.cpt = parseInt(time) this.progress.cpt = time
// 更新视频时长 // 观看的最大点
this.progress.mpt = parseInt(durations) this.progress.mpt = Math.max(time, this.progress.mpt)
const hasTimePoint = this.watchedTimePoint.includes(this.progress.cpt) const hasTimePoint = this.watchedTimePoint.includes(this.progress.cpt)
if (!hasTimePoint) { if (!hasTimePoint) {
this.watchedTimePoint.push(this.progress.cpt) this.watchedTimePoint.push(this.progress.cpt)
} }
// 更新视频观看总时长
this.updateWatchTime(time)
// 更新视频进度,10秒更新一次 // 更新视频进度,10秒更新一次
if (this.throttled) { if (this.throttled) {
this.throttled(time, durations) this.throttled(time, durations)
...@@ -226,7 +227,6 @@ export default { ...@@ -226,7 +227,6 @@ export default {
}, },
// 更新章节视频进度 // 更新章节视频进度
updateChapterVideoProgress(time, durations) { updateChapterVideoProgress(time, durations) {
// this.progress.pt += this.throttleWait
// 登录用户信息 // 登录用户信息
const user = window.G.UserInfo const user = window.G.UserInfo
const params = { const params = {
...@@ -247,24 +247,18 @@ export default { ...@@ -247,24 +247,18 @@ export default {
this.watchedTimePoint = [] this.watchedTimePoint = []
}, },
// 更新观看总时长 // 更新观看总时长
updateWatchTime() { updateWatchTime(time) {
this.timer && clearInterval(this.timer) if (time === this.watchedTime) {
return
}
this.watchedTime = time
// 增加跳过片头时间 // 增加跳过片头时间
if (this.isSkip && !this.progress.pt) { if (this.isSkip && !this.progress.pt) {
this.progress.pt = this.skipTime + this.throttleWait this.progress.pt = this.skipTime + 20
} }
// 默认增加时间 // 默认增加时间
this.progress.pt = this.progress.pt || this.throttleWait this.progress.pt = this.progress.pt || 20
this.timer = setInterval(() => { this.progress.pt++
// safair 浏览器下有bug
// const status = this.player.getStatus()
if (this.isPlaying) {
// 播放倍速
const speed = this.player._originalPlaybackRate || 1
this.progress.pt = this.progress.pt + 1 * speed
}
this.isPlaying = false
}, 1000)
} }
}, },
beforeMount() { beforeMount() {
...@@ -272,9 +266,6 @@ export default { ...@@ -272,9 +266,6 @@ export default {
this.getChapterVideo() this.getChapterVideo()
// 获取视频进度 // 获取视频进度
this.getChapterVideoProgress() this.getChapterVideoProgress()
},
destroyed() {
this.timer && clearInterval(this.timer)
} }
} }
</script> </script>
......
...@@ -5,7 +5,11 @@ ...@@ -5,7 +5,11 @@
<script> <script>
export default { export default {
name: 'VideoPlayer', name: 'VideoPlayer',
props: { isSkip: Boolean, video: Object }, props: {
isSkip: Boolean,
video: Object,
autoplay: { type: Boolean, default: true }
},
data() { data() {
return { player: null } return { player: null }
}, },
...@@ -28,12 +32,11 @@ export default { ...@@ -28,12 +32,11 @@ export default {
source: JSON.stringify({ FD, LD, SD }), source: JSON.stringify({ FD, LD, SD }),
width: '100%', width: '100%',
height: '100%', height: '100%',
autoplay: false, autoplay: this.autoplay,
isLive: false, isLive: false,
preload: true,
useH5Prism: true,
controlBarVisibility: 'always', controlBarVisibility: 'always',
defaultDefinition: 'SD', definition: 'FD,LD,SD',
defaultDefinition: 'LD',
useHlsPluginForSafari: true useHlsPluginForSafari: true
}, },
function(player) { function(player) {
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</template> </template>
<div class="exam-buttons"> <div class="exam-buttons">
<el-tooltip effect="dark" content="提交之后就不能修改了哦" placement="right"> <el-tooltip effect="dark" content="提交之后就不能修改了哦" placement="right">
<el-button type="primary" @click="onSubmit">{{submitText}}</el-button> <el-button type="primary" :loading="submitLoading" @click="onSubmit">{{submitText}}</el-button>
</el-tooltip> </el-tooltip>
</div> </div>
</el-form> </el-form>
...@@ -78,7 +78,8 @@ export default { ...@@ -78,7 +78,8 @@ export default {
messageInstance: null, messageInstance: null,
exam: {}, exam: {},
isStartExam: false, // 是否开始考试 isStartExam: false, // 是否开始考试
autoSubmitTimer: null // 自动提交定时器 autoSubmitTimer: null, // 自动提交定时器
submitLoading: false
} }
}, },
watch: { watch: {
...@@ -265,6 +266,7 @@ export default { ...@@ -265,6 +266,7 @@ export default {
}, },
// 请求提交接口 // 请求提交接口
handleSubmitRequest(params) { handleSubmitRequest(params) {
this.submitLoading = true
params.paper_type = 0 params.paper_type = 0
api api
.submitCourseExam(this.sid, this.cid, this.pid, params) .submitCourseExam(this.sid, this.cid, this.pid, params)
...@@ -284,6 +286,9 @@ export default { ...@@ -284,6 +286,9 @@ export default {
.catch(error => { .catch(error => {
this.$message.error(error.message) this.$message.error(error.message)
}) })
.finally(() => {
this.submitLoading = false
})
} }
}, },
beforeMount() { beforeMount() {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
></exam-item> ></exam-item>
<div class="exam-buttons"> <div class="exam-buttons">
<el-tooltip effect="dark" content="提交之后就不能修改了哦" placement="right"> <el-tooltip effect="dark" content="提交之后就不能修改了哦" placement="right">
<el-button type="primary" @click="onSubmit">{{submitText}}</el-button> <el-button type="primary" :loading="submitLoading" @click="onSubmit">{{submitText}}</el-button>
</el-tooltip> </el-tooltip>
</div> </div>
</el-form> </el-form>
...@@ -52,7 +52,8 @@ export default { ...@@ -52,7 +52,8 @@ export default {
detail: null, detail: null,
questions: [], // 问题列表 questions: [], // 问题列表
startTime: new Date().getTime(), // 进入时间 startTime: new Date().getTime(), // 进入时间
messageInstance: null messageInstance: null,
submitLoading: false
} }
}, },
watch: { watch: {
...@@ -247,6 +248,7 @@ export default { ...@@ -247,6 +248,7 @@ export default {
}, },
// 请求提交接口 // 请求提交接口
handleSubmitRequest(params) { handleSubmitRequest(params) {
this.submitLoading = true
api api
.sbumitChapterHomework(params) .sbumitChapterHomework(params)
.then(response => { .then(response => {
...@@ -259,6 +261,9 @@ export default { ...@@ -259,6 +261,9 @@ export default {
.catch(error => { .catch(error => {
this.$message.error(error.message) this.$message.error(error.message)
}) })
.finally(() => {
this.submitLoading = false
})
} }
}, },
beforeMount() { beforeMount() {
......
...@@ -69,8 +69,9 @@ ...@@ -69,8 +69,9 @@
<el-tooltip content="在获老师批改之前,可以多次提交,将以最后一次提交为准" placement="right"> <el-tooltip content="在获老师批改之前,可以多次提交,将以最后一次提交为准" placement="right">
<el-button <el-button
type="primary" type="primary"
@click="onSubmit"
:disabled="disabled || !isWorkTime" :disabled="disabled || !isWorkTime"
:loading="submitLoading"
@click="onSubmit"
>{{ submitText }}</el-button> >{{ submitText }}</el-button>
</el-tooltip> </el-tooltip>
</div> </div>
...@@ -115,7 +116,8 @@ export default { ...@@ -115,7 +116,8 @@ export default {
startTime: new Date().getTime(), // 进入时间 startTime: new Date().getTime(), // 进入时间
messageInstance: null, messageInstance: null,
deadline: '', // 截止时间 deadline: '', // 截止时间
disabled: false disabled: false,
submitLoading: false
} }
}, },
watch: { watch: {
...@@ -295,6 +297,7 @@ export default { ...@@ -295,6 +297,7 @@ export default {
}, },
// 请求提交接口 // 请求提交接口
handleSubmitRequest(params) { handleSubmitRequest(params) {
this.submitLoading = true
api api
.sbumitChapterHomework(params) .sbumitChapterHomework(params)
.then(response => { .then(response => {
...@@ -308,6 +311,9 @@ export default { ...@@ -308,6 +311,9 @@ export default {
.catch(error => { .catch(error => {
this.$message.error(error.message) this.$message.error(error.message)
}) })
.finally(() => {
this.submitLoading = false
})
}, },
// 重新编辑 // 重新编辑
onReEdit() { onReEdit() {
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</template> </template>
<div class="exam-buttons"> <div class="exam-buttons">
<el-tooltip effect="dark" content="提交之后就不能修改了哦" placement="right"> <el-tooltip effect="dark" content="提交之后就不能修改了哦" placement="right">
<el-button type="primary" @click="onSubmit">{{submitText}}</el-button> <el-button type="primary" :loading="submitLoading" @click="onSubmit">{{submitText}}</el-button>
</el-tooltip> </el-tooltip>
</div> </div>
</el-form> </el-form>
...@@ -83,7 +83,8 @@ export default { ...@@ -83,7 +83,8 @@ export default {
exam: {}, exam: {},
isStartExam: false, // 是否开始考试 isStartExam: false, // 是否开始考试
autoSubmitTimer: null, // 自动提交定时器 autoSubmitTimer: null, // 自动提交定时器
checkStatusTimer: null // 考试状态定时器 checkStatusTimer: null, // 考试状态定时器
submitLoading: false
} }
}, },
computed: { computed: {
...@@ -287,6 +288,7 @@ export default { ...@@ -287,6 +288,7 @@ export default {
}, },
// 请求提交接口 // 请求提交接口
handleSubmitRequest(params) { handleSubmitRequest(params) {
this.submitLoading = true
api api
.submitCourseExam(this.sid, this.cid, this.pid, params) .submitCourseExam(this.sid, this.cid, this.pid, params)
.then(response => { .then(response => {
...@@ -305,6 +307,9 @@ export default { ...@@ -305,6 +307,9 @@ export default {
.catch(error => { .catch(error => {
this.$message.error(error.message) this.$message.error(error.message)
}) })
.finally(() => {
this.submitLoading = false
})
} }
}, },
beforeMount() { beforeMount() {
......
...@@ -62,7 +62,12 @@ ...@@ -62,7 +62,12 @@
</div> </div>
<div class="buttons"> <div class="buttons">
<el-tooltip content="在获老师批改之前,可以多次提交,将以最后一次提交为准" placement="right"> <el-tooltip content="在获老师批改之前,可以多次提交,将以最后一次提交为准" placement="right">
<el-button type="primary" @click="onSubmit" :disabled="isRevised">{{submitText}}</el-button> <el-button
type="primary"
:disabled="isRevised"
:loading="submitLoading"
@click="onSubmit"
>{{submitText}}</el-button>
</el-tooltip> </el-tooltip>
</div> </div>
</template> </template>
...@@ -117,7 +122,8 @@ export default { ...@@ -117,7 +122,8 @@ export default {
}, },
detail: null, detail: null,
loading: false, loading: false,
messageInstance: null messageInstance: null,
submitLoading: false
} }
}, },
computed: { computed: {
...@@ -179,6 +185,7 @@ export default { ...@@ -179,6 +185,7 @@ export default {
}, },
// 请求提交接口 // 请求提交接口
handleSubmitRequest(params) { handleSubmitRequest(params) {
this.submitLoading = true
api api
.updateCourseWork(this.sid, this.cid, params) .updateCourseWork(this.sid, this.cid, params)
.then(response => { .then(response => {
...@@ -192,6 +199,9 @@ export default { ...@@ -192,6 +199,9 @@ export default {
.catch(error => { .catch(error => {
this.$message.error(error.message) this.$message.error(error.message)
}) })
.finally(() => {
this.submitLoading = false
})
} }
}, },
beforeMount() { beforeMount() {
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
</el-tooltip> </el-tooltip>
</router-link> </router-link>
</template> </template>
<div class="course-menu" @click="menuVisible = !menuVisible">
<i class="el-icon-s-unfold" v-if="menuVisible"></i>
<i class="el-icon-s-fold" v-else></i>
</div>
</div> </div>
<!-- 主体区域 --> <!-- 主体区域 -->
<div class="course-viewer-main-bd"> <div class="course-viewer-main-bd">
...@@ -27,9 +31,10 @@ ...@@ -27,9 +31,10 @@
:data="detail" :data="detail"
:chapter="activeChapter" :chapter="activeChapter"
:pptIndex="pptIndex" :pptIndex="pptIndex"
:isSeek="isSeek"
:key="pid" :key="pid"
@pptupdate="handlePPTupdate" @pptupdate="handlePPTupdate"
@change-ppt="handleChangePPT" @change-ppt="handleChangePPT(...arguments, false)"
/> />
</div> </div>
</div> </div>
...@@ -40,9 +45,9 @@ ...@@ -40,9 +45,9 @@
:active="activeChapter" :active="activeChapter"
:ppts="ppts" :ppts="ppts"
:pptIndex="pptIndex" :pptIndex="pptIndex"
@change-ppt="handleChangePPT" @change-ppt="handleChangePPT(...arguments, true)"
v-if="detail.chapters" v-if="detail.chapters"
v-show="!isLive && !isCourseExam" v-show="menuVisible"
></v-aside> ></v-aside>
</div> </div>
</template> </template>
...@@ -60,13 +65,25 @@ export default { ...@@ -60,13 +65,25 @@ export default {
return { return {
detail: {}, detail: {},
ppts: [], ppts: [],
pptIndex: 0 pptIndex: 0,
isSeek: false,
menuVisible: true
} }
}, },
watch: { watch: {
activeChapter() { activeChapter() {
this.ppts = [] this.ppts = []
this.pptIndex = 0 this.pptIndex = 0
},
isLive(value) {
if (value) {
this.menuVisible = false
}
},
isCourseExam(value) {
if (value) {
this.menuVisible = false
}
} }
}, },
computed: { computed: {
...@@ -149,8 +166,9 @@ export default { ...@@ -149,8 +166,9 @@ export default {
this.ppts = list this.ppts = list
}, },
// 右侧菜单选中的PPT修改 // 右侧菜单选中的PPT修改
handleChangePPT(index) { handleChangePPT(index, isSeek) {
this.pptIndex = index this.pptIndex = index
this.isSeek = isSeek
} }
}, },
beforeMount() { beforeMount() {
...@@ -238,4 +256,17 @@ export default { ...@@ -238,4 +256,17 @@ export default {
font-size: 18px; font-size: 18px;
// border-bottom: 3px solid #707070; // border-bottom: 3px solid #707070;
} }
.course-menu {
width: 24px;
height: 24px;
padding: 12px;
margin-right: 10px;
color: #fff;
text-align: center;
border-radius: 50%;
cursor: pointer;
&:hover {
background-color: rgba(255, 255, 255, 0.08);
}
}
</style> </style>
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
@click="golearningAdd('/app/affairs-hall/again-add/-1')" @click="golearningAdd('/app/affairs-hall/again-add/-1')"
>申请重修</el-button> >申请重修</el-button>
<div style="width: 100%; height: 0.2rem;"></div> <div style="width: 100%; height: 0.2rem;"></div>
<table-list :key="affairId" v-bind="tableOption" v-if="affairId" ref="tableList"></table-list> <table-list :key="affairId" v-bind="tableOption" v-if="affairId && resultName !== '成绩单'" ref="tableList"></table-list>
<hall-form v-if="resultName === '成绩单'" :formData="formData" @submit="submit" @submitType="obtainReport"></hall-form>
</div> </div>
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%"> <el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
<span>确定删除?</span> <span>确定删除?</span>
...@@ -37,6 +38,7 @@ ...@@ -37,6 +38,7 @@
import Tap from '../../components/comTable/tap.vue' import Tap from '../../components/comTable/tap.vue'
import mPage from '../../components/comTable/mPage.vue' import mPage from '../../components/comTable/mPage.vue'
import TableList from '../../components/comTable/tableList.vue' import TableList from '../../components/comTable/tableList.vue'
import HallForm from '../../components/hall-form.vue'
import cAction from '@action' import cAction from '@action'
const status = { const status = {
'-1': '待审核', '-1': '待审核',
...@@ -49,6 +51,7 @@ const status = { ...@@ -49,6 +51,7 @@ const status = {
export default { export default {
components: { components: {
Tap, Tap,
HallForm,
mPage, mPage,
TableList TableList
}, },
...@@ -223,6 +226,8 @@ export default { ...@@ -223,6 +226,8 @@ export default {
} }
}, },
affairList: [], affairList: [],
formData: {},
resultName: '',
affairId: null affairId: null
} }
}, },
...@@ -237,6 +242,29 @@ export default { ...@@ -237,6 +242,29 @@ export default {
} }
}, },
methods: { methods: {
submit(row, type) {
const params = Object.assign({
type: type,
affair_id: this.affairList.find(k => k.form_name === type).id
}, row)
cAction.Affairs.submitLearning(params)
.then(() => {
this.$message({ type: 'success', message: '已提交成功!' })
this.obtainReport(type)
})
.catch(e => {
this.$message.error(e.message)
})
},
obtainReport(type = 'elreport') {
cAction.Affairs.obtainReport(type)
.then(data => {
this.formData = data
})
.catch(e => {
this.$message.error(e.message)
})
},
confirmDeletion(row) { confirmDeletion(row) {
/* 删除 */ /* 删除 */
const loading = this.$loading({ const loading = this.$loading({
...@@ -262,6 +290,7 @@ export default { ...@@ -262,6 +290,7 @@ export default {
this.dialogVisible = false this.dialogVisible = false
}, },
tapIndexs(data) { tapIndexs(data) {
this.resultName = data.name
this.tapIndex = data.index this.tapIndex = data.index
this.affairId = data.id this.affairId = data.id
}, },
...@@ -270,8 +299,11 @@ export default { ...@@ -270,8 +299,11 @@ export default {
cAction.Affairs.getAffairsType() cAction.Affairs.getAffairsType()
.then(data => { .then(data => {
this.tapParam[0].arrItem = data.map(item => { this.tapParam[0].arrItem = data.map(item => {
return { val: item.id, name: item.affair_name } if (item.form_name === 'elreport') {
}) item.affair_name = '成绩单'
}
return { val: item.id, name: item.affair_name, form_name: item.form_name }
}).filter(k => k.form_name !== 'pareport')
const [first] = data const [first] = data
const datas = data[this.$route.query.index] || first const datas = data[this.$route.query.index] || first
this.affairId = datas.id this.affairId = datas.id
...@@ -294,6 +326,7 @@ export default { ...@@ -294,6 +326,7 @@ export default {
} }
}, },
created() { created() {
this.obtainReport()
this.getTapData() this.getTapData()
} }
} }
......
...@@ -144,7 +144,8 @@ export default { ...@@ -144,7 +144,8 @@ export default {
!this.ckeditor && (this.ckeditor = CKEDITOR.replace('editor', { !this.ckeditor && (this.ckeditor = CKEDITOR.replace('editor', {
height: 300, height: 300,
uiColor: '#eeeeee', uiColor: '#eeeeee',
filebrowserImageUploadUrl: '/api/ckeditor/img/upload', filebrowserImageUploadUrl: '/api/ck/form/ckeditor-upload',
fileTools_requestHeaders: { tenant: 'sofia' },
// resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true, // resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true,
toolbar: [ toolbar: [
// { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] }, // { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] },
......
...@@ -107,13 +107,10 @@ export default { ...@@ -107,13 +107,10 @@ export default {
clearInterval(this.timeInterval) clearInterval(this.timeInterval)
this.timeInterval = null this.timeInterval = null
} }
this.timeInterval = setInterval(() => { // 获取最新直播
cAction.Player.getNewLiveMsg().then(json => { this.getLatestLive()
if (json.status === 200) { // 定时获取最新直播
this.newLiveMsg = json.data this.timeInterval = setInterval(this.getLatestLive, 10000)
}
}).catch(e => { this.$message.error(e.message) }).finally(() => { })
}, 3000)
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' }) const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.Course.getLearnFind().then(data => { cAction.Course.getLearnFind().then(data => {
...@@ -194,6 +191,14 @@ export default { ...@@ -194,6 +191,14 @@ export default {
/* 直接进直播 */ /* 直接进直播 */
goLive () { goLive () {
this.$router.push({ name: 'viewerCourseChapter', params: { sid: this.newLiveMsg.semester_id, cid: this.newLiveMsg.course_id, id: this.newLiveMsg.chapter_id } }) this.$router.push({ name: 'viewerCourseChapter', params: { sid: this.newLiveMsg.semester_id, cid: this.newLiveMsg.course_id, id: this.newLiveMsg.chapter_id } })
},
// 获取最新直播
getLatestLive() {
cAction.Player.getNewLiveMsg().then(json => {
if (json.status === 200) {
this.newLiveMsg = json.data
}
}).catch(e => { this.$message.error(e.message) })
} }
} }
} }
......
...@@ -393,9 +393,7 @@ export default { ...@@ -393,9 +393,7 @@ export default {
window.addEventListener('resize', this.resizeRoot.bind(this), false) window.addEventListener('resize', this.resizeRoot.bind(this), false)
/* 实时刷新数据 */ /* 实时刷新数据 */
if (this.timeHeart) { clearInterval(this.timeHeart); this.timeHeart = null } if (this.timeHeart) { clearInterval(this.timeHeart); this.timeHeart = null }
this.timeHeart = setInterval(() => { // this.timeHeart = setInterval(this.updatePages(), 3000)
this.updatePages()
}, 3000)
this.arrFn = this.initBindKeyfn() this.arrFn = this.initBindKeyfn()
}, },
destroyed () { destroyed () {
...@@ -426,7 +424,8 @@ export default { ...@@ -426,7 +424,8 @@ export default {
!this.ckeditor && (this.ckeditor = CKEDITOR.replace('editor', { !this.ckeditor && (this.ckeditor = CKEDITOR.replace('editor', {
height: 300, height: 300,
uiColor: '#eeeeee', uiColor: '#eeeeee',
filebrowserImageUploadUrl: '/api/ckeditor/img/upload', filebrowserImageUploadUrl: '/api/ck/form/ckeditor-upload',
fileTools_requestHeaders: { tenant: 'sofia' },
// resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true, // resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true,
toolbar: [ toolbar: [
// { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] }, // { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] },
......
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
}) })
}, },
dealRender: () => { dealRender: () => {
;(function(win, doc) { ;(function (win, doc) {
const wWidth = const wWidth =
win.screen.width > 0 win.screen.width > 0
? win.innerWidth >= win.screen.width || win.innerWidth === 0 ? win.innerWidth >= win.screen.width || win.innerWidth === 0
...@@ -126,6 +126,7 @@ export default { ...@@ -126,6 +126,7 @@ export default {
})(window, document) })(window, document)
}, },
onClick(data) { onClick(data) {
data.live_status = parseInt(data.live_status)
const { const {
live_status: liveStatus, live_status: liveStatus,
live_type: liveType = 'live', live_type: liveType = 'live',
......
...@@ -194,7 +194,8 @@ export default { ...@@ -194,7 +194,8 @@ export default {
!this.ckeditor && (this.ckeditor = CKEDITOR.replace('editor-courseWork', { !this.ckeditor && (this.ckeditor = CKEDITOR.replace('editor-courseWork', {
height: 600, height: 600,
uiColor: '#eeeeee', uiColor: '#eeeeee',
filebrowserImageUploadUrl: '/api/ckeditor/img/upload', filebrowserImageUploadUrl: '/api/ck/form/ckeditor-upload',
fileTools_requestHeaders: { tenant: 'sofia' },
// resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true, // resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true,
toolbar: [ toolbar: [
// { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] }, // { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] },
......
export default {
title: '紫荆教育MBA学习系统',
tenant: 'sofia'
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论