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

Merge branch 'dev' into bluestar-dev

...@@ -76,7 +76,7 @@ export default class API { ...@@ -76,7 +76,7 @@ export default class API {
// _vIn.$router.push({ // _vIn.$router.push({
// path: '/login/index?rd=' + encodeURIComponent(href.replace(/.*?\/\/.*?\//gi, '/')) // path: '/login/index?rd=' + encodeURIComponent(href.replace(/.*?\/\/.*?\//gi, '/'))
// }) // })
window.location.href = `${webConf.others.loginUrl}'?rd=${encodeURIComponent(window.location.href)}` window.location.href = `${webConf.others.loginUrl}?rd=${encodeURIComponent(window.location.href)}`
} }
} }
......
...@@ -6,7 +6,7 @@ export default class Before { ...@@ -6,7 +6,7 @@ export default class Before {
this.opt = opt || {} this.opt = opt || {}
// 免登录列表 // 免登录列表
this.whiteList = ['login-normal', 'login-code', 'login-forget', 'studentHelp', 'teacherHelp'] this.whiteList = ['login-normal', 'login-code', 'login-forget', 'studentHelp', 'teacherHelp']
this.isMobile = /android|iphone|ipad|ipod/i.test(UA) this.isMobile = /iphone/i.test(UA) || (/android/i.test(UA) && /mobile/i.test(UA))
} }
async update(to, from, next) { async update(to, from, next) {
......
...@@ -10,7 +10,7 @@ export default { ...@@ -10,7 +10,7 @@ export default {
name: 'VEditor', name: 'VEditor',
props: { props: {
value: { type: String }, value: { type: String },
disabled: { type: Boolean, default: null } disabled: { type: Boolean, default: false }
}, },
data() { data() {
return { return {
...@@ -49,16 +49,7 @@ export default { ...@@ -49,16 +49,7 @@ export default {
'/', '/',
{ {
name: 'basicstyles', name: 'basicstyles',
items: [ items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']
'Bold',
'Italic',
'Underline',
'Strike',
'Subscript',
'Superscript',
'-',
'RemoveFormat'
]
}, },
{ {
name: 'paragraph', name: 'paragraph',
...@@ -86,14 +77,12 @@ export default { ...@@ -86,14 +77,12 @@ export default {
] ]
} }
if (this.disabled !== null) { // if (this.disabled !== null) {
config.readOnly = this.disabled // console.log(this.disabled)
} // config.readOnly = this.disabled
// }
const editor = (this.ckEditor = CKEDITOR.replace( const editor = (this.ckEditor = CKEDITOR.replace(this.textareaElementId, config))
this.textareaElementId,
config
))
editor.on('instanceReady', () => { editor.on('instanceReady', () => {
const data = this.value const data = this.value
editor.fire('lockSnapshot') editor.fire('lockSnapshot')
...@@ -118,6 +107,7 @@ export default { ...@@ -118,6 +107,7 @@ export default {
editor.fire('unlockSnapshot') editor.fire('unlockSnapshot')
} }
}) })
editor.setReadOnly(this.disabled)
}) })
}, },
bindEvent() { bindEvent() {
......
...@@ -10,7 +10,7 @@ export default { ...@@ -10,7 +10,7 @@ export default {
name: 'VEditor', name: 'VEditor',
props: { props: {
value: { type: String }, value: { type: String },
disabled: { type: Boolean, default: null } disabled: { type: Boolean, default: false }
}, },
data() { data() {
return { return {
...@@ -49,16 +49,7 @@ export default { ...@@ -49,16 +49,7 @@ export default {
'/', '/',
{ {
name: 'basicstyles', name: 'basicstyles',
items: [ items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']
'Bold',
'Italic',
'Underline',
'Strike',
'Subscript',
'Superscript',
'-',
'RemoveFormat'
]
}, },
{ {
name: 'paragraph', name: 'paragraph',
...@@ -85,14 +76,13 @@ export default { ...@@ -85,14 +76,13 @@ export default {
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule'] } { name: 'insert', items: ['Image', 'Table', 'HorizontalRule'] }
] ]
} }
if (this.disabled !== null) {
config.readOnly = this.disabled
}
const editor = (this.ckEditor = CKEDITOR.replace( // if (this.disabled !== null) {
this.textareaElementId, // console.log(this.disabled)
config // config.readOnly = this.disabled
)) // }
const editor = (this.ckEditor = CKEDITOR.replace(this.textareaElementId, config))
editor.on('instanceReady', () => { editor.on('instanceReady', () => {
const data = this.value const data = this.value
editor.fire('lockSnapshot') editor.fire('lockSnapshot')
...@@ -117,6 +107,7 @@ export default { ...@@ -117,6 +107,7 @@ export default {
editor.fire('unlockSnapshot') editor.fire('unlockSnapshot')
} }
}) })
editor.setReadOnly(this.disabled)
}) })
}, },
bindEvent() { bindEvent() {
......
...@@ -10,23 +10,18 @@ ...@@ -10,23 +10,18 @@
</template> </template>
</el-upload> </el-upload>
<div class="file-list" v-if="fileList.length"> <div class="file-list" v-if="fileList.length">
<div class="file-list-item" v-for="(fileUrl, index) in fileList" :key="index"> <div class="file-list-item" v-for="(item, index) in fileList" :key="index">
<a :href="fileUrl" target="_blank"> <a :href="item.url" :download="item.name" target="_blank">
<i class="el-icon-document"></i> <i class="el-icon-document"></i>
{{ fileUrl | fileName }} {{ item.name }}
</a> </a>
<div> <div>
<a <a href="javascript:;" @click="handleRemove(index)" style="margin-right: 10px" v-if="!disabled">
href="javascript:;"
@click="handleRemove(index)"
style="margin-right:10px;"
v-if="!disabled"
>
<el-tooltip effect="dark" content="删除"> <el-tooltip effect="dark" content="删除">
<i class="el-icon-delete"></i> <i class="el-icon-delete"></i>
</el-tooltip> </el-tooltip>
</a> </a>
<a :href="fileUrl" :download="fileUrl | fileName" target="_blank"> <a :href="item.url" :download="item.name" target="_blank">
<el-tooltip effect="dark" content="下载"> <el-tooltip effect="dark" content="下载">
<i class="el-icon-download"></i> <i class="el-icon-download"></i>
</el-tooltip> </el-tooltip>
...@@ -55,36 +50,39 @@ export default { ...@@ -55,36 +50,39 @@ export default {
value: { value: {
immediate: true, immediate: true,
handler(value) { handler(value) {
if (value) { if (!value) {
if (Array.isArray(value)) { return
this.fileList = value.map(item => { }
return item.url || item let fileList = []
}) if (Array.isArray(value)) {
} else { fileList = value.map(item => {
this.fileList = [value] return { name: item.name || item, url: item.url || item }
} })
} else {
fileList.push({ name: '附件下载', url: value })
} }
this.fileList = fileList
} }
} }
}, },
filters: {
fileName(value) {
return value ? value.split('/').pop() : ''
}
},
methods: { methods: {
httpRequest(xhr) { httpRequest(xhr) {
api.uploadFile({ file: xhr.file }).then(response => { api
if (response.success) { .uploadFile({ file: xhr.file })
if (Array.isArray(this.value)) { .then(response => {
this.fileList.push(response.url) if (response.success) {
this.$emit('input', this.fileList) if (Array.isArray(this.value)) {
} else { this.fileList.push({ name: xhr.file.name, url: response.url })
this.fileList = [response.url] this.$emit('input', this.fileList)
this.$emit('input', response.url) } else {
this.fileList = [response.url]
this.$emit('input', response.url)
}
} }
} })
}) .catch(error => {
this.$message.error(error.message)
})
}, },
handleRemove(index) { handleRemove(index) {
this.fileList.splice(index, 1) this.fileList.splice(index, 1)
......
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
const live = this.live const live = this.live
if (this.isLiveEnd && this.hasRecord) { if (this.isLiveEnd && this.hasRecord) {
// 查看回放 // 查看回放
return live.record_url return live.record_url.replace(/^http:|^https:/, '')
} else { } else {
// 直播 // 直播
live.user_name = live.user_name || this.nickName live.user_name = live.user_name || this.nickName
......
...@@ -224,6 +224,7 @@ export default { ...@@ -224,6 +224,7 @@ export default {
// 提交参数 // 提交参数
const params = { answers: JSON.stringify(answers), type: 1 } const params = { answers: JSON.stringify(answers), type: 1 }
// 请求接口 // 请求接口
this.submitLoading = true
this.handleSubmitRequest(params) this.handleSubmitRequest(params)
}, },
// 自动提交 // 自动提交
...@@ -236,7 +237,7 @@ export default { ...@@ -236,7 +237,7 @@ export default {
const params = { answers: JSON.stringify(answers), type: 0 } const params = { answers: JSON.stringify(answers), type: 0 }
// 请求接口 // 请求接口
this.handleSubmitRequest(params) this.handleSubmitRequest(params)
}, 10000) }, 3000)
}, },
// 处理请求接口答案数据 // 处理请求接口答案数据
handleSubmitData() { handleSubmitData() {
...@@ -266,7 +267,6 @@ export default { ...@@ -266,7 +267,6 @@ 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)
......
...@@ -171,16 +171,16 @@ export default { ...@@ -171,16 +171,16 @@ export default {
}, },
methods: { methods: {
// 初始化 // 初始化
init() { async init() {
this.clearTimer() this.clearTimer()
// 自动获取考试状态 // 自动获取考试状态
this.autoCheckExamStatus() await this.autoCheckExamStatus()
// 获取试题 // 获取试题
this.getExam() this.getExam()
}, },
// 获取考试状态 // 获取考试状态
getExamStatus() { async getExamStatus() {
api.getCourseExamStatus(this.sid, this.cid, this.pid).then(response => { await api.getCourseExamStatus(this.sid, this.cid, this.pid).then(response => {
this.status = response this.status = response
if (this.isSubmited || response.examination_status === '90') { if (this.isSubmited || response.examination_status === '90') {
this.checkStatusTimer && clearInterval(this.checkStatusTimer) this.checkStatusTimer && clearInterval(this.checkStatusTimer)
...@@ -188,9 +188,9 @@ export default { ...@@ -188,9 +188,9 @@ export default {
}) })
}, },
// 自动获取考试状态 // 自动获取考试状态
autoCheckExamStatus() { async autoCheckExamStatus() {
// 获取试题状态 // 获取试题状态
this.getExamStatus() await this.getExamStatus()
this.checkStatusTimer && clearInterval(this.checkStatusTimer) this.checkStatusTimer && clearInterval(this.checkStatusTimer)
this.checkStatusTimer = setInterval(this.getExamStatus, 5000) this.checkStatusTimer = setInterval(this.getExamStatus, 5000)
}, },
...@@ -276,6 +276,7 @@ export default { ...@@ -276,6 +276,7 @@ export default {
// 提交参数 // 提交参数
const params = { answers: JSON.stringify(answers), type: 1 } const params = { answers: JSON.stringify(answers), type: 1 }
// 请求接口 // 请求接口
this.submitLoading = true
this.handleSubmitRequest(params) this.handleSubmitRequest(params)
}, },
// 自动提交 // 自动提交
...@@ -288,7 +289,7 @@ export default { ...@@ -288,7 +289,7 @@ export default {
const params = { answers: JSON.stringify(answers), type: 0 } const params = { answers: JSON.stringify(answers), type: 0 }
// 请求接口 // 请求接口
this.handleSubmitRequest(params) this.handleSubmitRequest(params)
}, 10000) }, 3000)
}, },
// 处理请求接口答案数据 // 处理请求接口答案数据
handleSubmitData() { handleSubmitData() {
...@@ -318,7 +319,6 @@ export default { ...@@ -318,7 +319,6 @@ export default {
}, },
// 请求提交接口 // 请求提交接口
handleSubmitRequest(params) { handleSubmitRequest(params) {
this.submitLoading = true
params.offset = this.offset params.offset = this.offset
api api
.submitCourseExam(this.sid, this.cid, this.pid, params) .submitCourseExam(this.sid, this.cid, this.pid, params)
......
...@@ -12,13 +12,17 @@ ...@@ -12,13 +12,17 @@
<!-- 单选 --> <!-- 单选 -->
<el-radio-group v-model="currentValue.user_answer" v-if="type === 1"> <el-radio-group v-model="currentValue.user_answer" v-if="type === 1">
<div class="q-option-item" v-for="item in currentOptions" :key="item.id"> <div class="q-option-item" v-for="item in currentOptions" :key="item.id">
<el-radio :class="genClass(item)" :label="item.id"><span v-html="item.abc_option"></span></el-radio> <el-radio :class="genClass(item)" :label="item.id">
<div class="q-option-item__answer" v-html="item.abc_option"></div>
</el-radio>
</div> </div>
</el-radio-group> </el-radio-group>
<!-- 多选 --> <!-- 多选 -->
<el-checkbox-group v-model="currentValue.user_answer" v-if="type === 2"> <el-checkbox-group v-model="currentValue.user_answer" v-if="type === 2">
<div class="q-option-item" v-for="item in currentOptions" :key="item.id"> <div class="q-option-item" v-for="item in currentOptions" :key="item.id">
<el-checkbox :class="genClass(item)" :label="item.id"><span v-html="item.abc_option"></span></el-checkbox> <el-checkbox :class="genClass(item)" :label="item.id">
<div class="q-option-item__answer" v-html="item.abc_option"></div>
</el-checkbox>
</div> </div>
</el-checkbox-group> </el-checkbox-group>
<!-- 简答题 --> <!-- 简答题 -->
...@@ -224,6 +228,12 @@ export default { ...@@ -224,6 +228,12 @@ export default {
padding-left: 20px; padding-left: 20px;
margin-bottom: 14px; margin-bottom: 14px;
} }
.q-option-item__answer {
display: inline;
::v-deep * {
display: inline;
}
}
.is-success { .is-success {
color: #090; color: #090;
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<!-- <el-button class="rbtn" type="primary" size="medium" icon="el-icon-self-cc-book icon" @click="goCourseAll">{{ $t('pages.learn.course.changeCourse') }}</el-button> --> <!-- <el-button class="rbtn" type="primary" size="medium" icon="el-icon-self-cc-book icon" @click="goCourseAll">{{ $t('pages.learn.course.changeCourse') }}</el-button> -->
</div> </div>
<div class="con-box"> <div class="con-box" v-loading="loading">
<ul class="course-list"> <ul class="course-list">
<template v-for="(item, index) in homeList"> <template v-for="(item, index) in homeList">
<li v-bind:key="index" class="item"> <li v-bind:key="index" class="item">
...@@ -99,7 +99,8 @@ export default { ...@@ -99,7 +99,8 @@ export default {
homeList: [], // 从后台请求 homeList: [], // 从后台请求
param: {}, param: {},
timeInterval: null, timeInterval: null,
newLiveMsg: {} newLiveMsg: {},
loading: false
} }
}, },
mounted () { mounted () {
...@@ -112,11 +113,10 @@ export default { ...@@ -112,11 +113,10 @@ export default {
// 定时获取最新直播 // 定时获取最新直播
this.timeInterval = setInterval(this.getLatestLive, 10000) this.timeInterval = setInterval(this.getLatestLive, 10000)
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 => {
this.find[0].arrItem = data this.find[0].arrItem = data
this.getAjaxList(true, this.$t('pages.learn.course.goCourseAllStr')) this.getAjaxList(true, this.$t('pages.learn.course.goCourseAllStr'))
}).catch(e => { this.$message.error(e.message) }).finally(() => { loading.close() }) }).catch(e => { this.$message.error(e.message) }).finally(() => { })
}, },
destroyed () { destroyed () {
if (this.timeInterval) { if (this.timeInterval) {
...@@ -134,12 +134,15 @@ export default { ...@@ -134,12 +134,15 @@ export default {
this.$router.push({ path: `/app/learn/course-detail/${sid}/${cid}` }) this.$router.push({ path: `/app/learn/course-detail/${sid}/${cid}` })
}, },
getAjaxList (bool, str) { getAjaxList (bool, str) {
this.loading = true
cAction.Course.getCourseList(bool, this.param).then(json => { cAction.Course.getCourseList(bool, this.param).then(json => {
this.homeList = json this.homeList = json
if (!json.length) { if (!json.length) {
this.$message(str) this.$message(str)
} }
}).catch(e => { this.$message.error(e.message) }).finally(() => {}) }).catch(e => { this.$message.error(e.message) }).finally(() => {
this.loading = false
})
}, },
/** /**
* 分类选择 - 选中某一项 * 分类选择 - 选中某一项
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<template v-for="(item, index) in msgList"> <template v-for="(item, index) in msgList">
<el-collapse-item v-bind:key="index" :name="index"> <el-collapse-item v-bind:key="index" :name="index">
<template slot="title"> <template slot="title">
<el-badge :is-dot="!item.isShow" class="item">{{ item.title }}</el-badge> <el-badge :is-dot="!item.isShow" class="item">{{ item.title || '系统通知' }}</el-badge>
</template> </template>
<div v-html="item.text"></div> <div v-html="item.text"></div>
</el-collapse-item> </el-collapse-item>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论