mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-22 09:16:44 +08:00
把third合并过来
This commit is contained in:
@@ -146,7 +146,7 @@
|
||||
</div>
|
||||
<!-- <div style="margin-top: 10px" v-if="isUpload"><el-button type="primary" size="mini" @click="isUploadHandle()">选择文件并上传</el-button></div> -->
|
||||
<div style="margin-top: 10px">
|
||||
<file-upload dir="files" :beforeMsg="needOrg" :showList="true" :value="imageShowUrl" :limit="5" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
|
||||
<file-upload scorm="zip" dir="files" :beforeMsg="needOrg" :showList="true" :value="imageShowUrl" :limit="5" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
@@ -160,7 +160,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="duration" label="时长(秒)" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input type="number" size="small" v-model="scope.row.duration"></el-input>
|
||||
<el-input type="number" size="small" v-model="scope.row.minute"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="可见性" width="100">
|
||||
@@ -190,7 +190,7 @@
|
||||
</el-dialog>
|
||||
<el-dialog title="预览课件" :close-on-click-modal="false" width="800px" :visible.sync="coursewareShow" custom-class="g-dialog">
|
||||
<div>
|
||||
<div class="courseware-title">{{ fileInfo.fileName }}</div>
|
||||
<div class="courseware-title">{{ fileInfo.name }}</div>
|
||||
<div class="courseware-icon">
|
||||
<div v-if="fileInfo.resType == 10" style="position: relative;">
|
||||
<videoPlayer
|
||||
@@ -231,12 +231,13 @@
|
||||
<el-cascader v-model="projectOwnership1" :options="resOwnerListMap" :props="defaultProps" @change="handleChange"></el-cascader>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="编号">{{}}</el-form-item> -->
|
||||
<el-form-item label="资源归属">{{ form.orgName }}</el-form-item>
|
||||
<el-form-item label="文件名称">{{ form.fileName }}</el-form-item>
|
||||
<el-form-item label="课件名称"><el-input v-model="form.name" maxlength="50" show-word-limit></el-input></el-form-item>
|
||||
<el-form-item label="课件类型">{{ getType(form.resType) }}</el-form-item>
|
||||
<el-form-item label="时长(分)">
|
||||
<!-- <el-input v-model="form.duration"></el-input> -->
|
||||
<el-input type="number" placeholder="请输入数字" :maxlength="32" show-word-limit v-model="form.duration"></el-input>
|
||||
<el-input type="number" placeholder="请输入数字" :maxlength="32" show-word-limit v-model="form.minute"></el-input>
|
||||
<!-- <el-input-number max="" v-model="form.duration" controls-position="right"></el-input-number> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="可见性">
|
||||
@@ -255,7 +256,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import coueseFile from '../../api/modules/courseFile';
|
||||
import coueseFile from '@/api/modules/courseFile';
|
||||
import FileUpload from '@/components/FileUpload/index.vue';
|
||||
import { getType, deepCopy, toContentType } from '../../utils/tools.js';
|
||||
import pdfPreview from '@/components/PdfPreview/index.vue';
|
||||
@@ -263,6 +264,7 @@ import { mapGetters, mapActions } from 'vuex';
|
||||
import videoPlayer from '@/components/VideoPlayer/index.vue';
|
||||
import audioPlayer from '@/components/AudioPlayer/index.vue';
|
||||
import chooseOrg from '@/components/System/chooseOrg.vue';
|
||||
import apiUserBasic from '@/api/boe/userbasic.js';
|
||||
export default {
|
||||
components: { FileUpload, pdfPreview, videoPlayer, audioPlayer,chooseOrg},
|
||||
computed: {
|
||||
@@ -305,10 +307,8 @@ export default {
|
||||
{ value: 10, label: '视频' },
|
||||
{ value: 20, label: '音频' },
|
||||
{ value: 30, label: '图片' },
|
||||
{ value: 40, label: '文档' }
|
||||
// { value: 41, label: "图文" },
|
||||
// { value: 50, label: "scrom包" },
|
||||
// { value: 90, label: "其他" }
|
||||
{ value: 40, label: '文档' },
|
||||
{ value: 50, label: "scrom" }
|
||||
],
|
||||
form: {
|
||||
id:'',
|
||||
@@ -363,7 +363,8 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.upload.orgId==this.userInfo.departId;
|
||||
this.upload.orgId=this.userInfo.departId;
|
||||
//console.log(this.upload.orgId,'this.upload.orgId')
|
||||
if(this.upload.orgId){
|
||||
apiUserBasic.getOrgInfo(this.upload.orgId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
@@ -532,6 +533,11 @@ export default {
|
||||
if (status === 200) {
|
||||
result.device1 = true;
|
||||
result.device2 = true;
|
||||
result.minute='';
|
||||
if(result.duration){
|
||||
result.minute=Math.round(result.duration/60); //四舍五入
|
||||
}
|
||||
|
||||
this.fileList.push(result);
|
||||
} else {
|
||||
this.$message.error(error);
|
||||
@@ -554,6 +560,11 @@ export default {
|
||||
} else if (item.device2 === true) {
|
||||
item.device = 2;
|
||||
}
|
||||
//转化为秒
|
||||
if(item.minute){
|
||||
result.duration=parseFloat(result.minute)*60;
|
||||
}
|
||||
|
||||
});
|
||||
this.loading = true;
|
||||
coueseFile.batchUpdate(this.fileList).then(rs => {
|
||||
@@ -575,6 +586,9 @@ export default {
|
||||
this.params.pageIndex = this.page.pageIndex;
|
||||
const { result, error, status } = await coueseFile.pageList(this.params, this.page);
|
||||
if (status === 200) {
|
||||
result.list.forEach(item=>{
|
||||
item.minute=Math.round(item.duration/60);//转化为分钟
|
||||
})
|
||||
this.tableData = result.list;
|
||||
this.page.count = result.count;
|
||||
this.page.pageSize = result.pageSize;
|
||||
@@ -588,22 +602,34 @@ export default {
|
||||
editFile(row) {
|
||||
coueseFile.detail(row.id).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.form = res.result;
|
||||
if (res.result.resOwner3 == '') {
|
||||
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2];
|
||||
} else {
|
||||
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2, res.result.resOwner3];
|
||||
}
|
||||
if (res.result.device === 1) {
|
||||
this.form.device1 = true;
|
||||
} else if (res.result.device === 2) {
|
||||
this.form.device2 = true;
|
||||
} else if (res.result.device === 3) {
|
||||
this.form.device1 = true;
|
||||
this.form.device2 = true;
|
||||
}
|
||||
this.form = res.result;
|
||||
if(this.form.duration){
|
||||
this.form.minute=Math.round(res.result.duration/60);//转化为分钟
|
||||
}else{
|
||||
this.form.minute=0;
|
||||
}
|
||||
})
|
||||
if (res.result.resOwner3 == '') {
|
||||
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2];
|
||||
} else {
|
||||
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2, res.result.resOwner3];
|
||||
}
|
||||
if (res.result.device === 1) {
|
||||
this.form.device1 = true;
|
||||
} else if (res.result.device === 2) {
|
||||
this.form.device2 = true;
|
||||
} else if (res.result.device === 3) {
|
||||
this.form.device1 = true;
|
||||
this.form.device2 = true;
|
||||
}
|
||||
if(!res.result.orgName && res.result.orgId){
|
||||
apiUserBasic.getOrgInfo(res.result.orgId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.form.orgName=rs.result.name;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
this.editCoursewareShow = true;
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
@@ -685,11 +711,11 @@ export default {
|
||||
//scorm课件的内容,取第一个sco
|
||||
var scorm=JSON.parse(row.content);
|
||||
//console.log(scorm,'scorm')
|
||||
if(scorm.index){
|
||||
if(scorm){
|
||||
//这里需要提取的到配置文件中,实际中只需要传 rowId就可以了
|
||||
this.scormUrl='http://localhost:9083/scorm-player?scormId='+row.id;//播放的首页
|
||||
this.scormUrl=process.env.VUE_APP_SCORM_URL+'?mode=preview&scormId='+row.id;//播放的首页
|
||||
}else{
|
||||
this.scormUrl='http://localhost:9083/scorm-player?scormId='+row.id;//播放的首页
|
||||
this.$message({type: 'error',message: 'SCORM包解析失败'});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
25
src/views/study/StudyProject.vue
Normal file
25
src/views/study/StudyProject.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<!--学习项目-->
|
||||
<div class="box">
|
||||
<iframe id="studyPathFrame" src="/fe-student/projectManage" style="width: 100%;height: 800px;" frameborder="0"></iframe>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
mounted() {
|
||||
const oIframe = document.getElementById('studyPathFrame');
|
||||
//const deviceWidth = document.documentElement.clientWidth;
|
||||
const deviceHeight = document.documentElement.clientHeight;
|
||||
//oIframe.style.width = (Number(deviceWidth)-220) + 'px'; //数字是页面布局宽度差值
|
||||
//oIframe.style.height = (Number(deviceHeight)-300) + 'px'; //数字是页面布局高度差
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.box{
|
||||
// width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -85,6 +85,9 @@
|
||||
<div v-if="resType == 41">
|
||||
<div style="padding: 20px;" v-html="contentData.content"></div>
|
||||
</div>
|
||||
<div v-if="resType == 50" style="min-height: 500px;">
|
||||
<iframe v-if="scormUrl" :src="scormUrl" frameborder="0" scrolling="no" border="0px" style="width:100%;height:500px;border:0px;overflow:hidden;"></iframe>
|
||||
</div>
|
||||
<div v-if="resType == 52">
|
||||
<div v-if="contentData.content != ''">
|
||||
<div class="hyper-link" v-if="conLink.openType == 2">
|
||||
@@ -317,6 +320,7 @@
|
||||
data() {
|
||||
return {
|
||||
cutOrgNamePath,
|
||||
scormUrl:'',//当前播放的scormUrl
|
||||
loading:false,
|
||||
controlHeight:400,//左边控制区域的内容高度
|
||||
timer: '',
|
||||
@@ -436,9 +440,8 @@
|
||||
this.$router.push({path:this.$xpage.getHomePath(tea.teacherId)})
|
||||
},
|
||||
noteChange(){
|
||||
//视频点定位,直接到播放的视频位置
|
||||
//视频点定位,直接到播放的视频位置
|
||||
this.timer = new Date().getTime()
|
||||
|
||||
},
|
||||
//非音视频课学习时长的增加,每一分钟保存一次
|
||||
appendStudyOtherTime() {
|
||||
@@ -592,7 +595,25 @@
|
||||
}
|
||||
});
|
||||
// }
|
||||
} else if (r.contentType == 52) {
|
||||
}else if(r.contentType==50){ //scorm
|
||||
this.scormUrl='';
|
||||
apiCourseFile.detail(r.contentRefId).then(cfrs => {
|
||||
if(cfrs.status==200){
|
||||
this.curCFile = cfrs.result;
|
||||
//this.scormUrl=cfrs
|
||||
let pars='?mode=normal&r='+Math.random();
|
||||
pars+='&scormId='+this.curCFile.id;
|
||||
pars+='&courseId='+this.courseId;
|
||||
pars+='&contentId='+r.id;
|
||||
pars+='&studentId='+this.userInfo.aid;
|
||||
pars+='&studentName='+encodeURIComponent(this.userInfo.name);
|
||||
pars+='&lmsId='+this.studyId;
|
||||
pars+='&scoId=';//不指定,scorm模块自动根据学习记录定位
|
||||
this.scormUrl=process.env.VUE_APP_SCORM_URL+pars;//播放的首页
|
||||
}
|
||||
});
|
||||
|
||||
}else if (r.contentType == 52) {
|
||||
this.isAppendTime = false;
|
||||
if (r.content.startsWith('\{')) {
|
||||
this.conLink = JSON.parse(r.content);
|
||||
@@ -617,6 +638,7 @@
|
||||
if (this.contentData.status < 2) {
|
||||
this.contentData.status = 2; //进行中
|
||||
}
|
||||
//以下是学习记录
|
||||
if (this.contentData.contentType > 20) { //非视频类的
|
||||
//用户的学习时长,非音视频课程学习,单独的处理
|
||||
this.isAppendTime = false;
|
||||
@@ -625,9 +647,15 @@
|
||||
$this.appendStudyOtherTime();
|
||||
}, 1000*60*2); //非音视频课程学习,2分钟后记录,因为一次记录是60秒
|
||||
//this.appendStudyTime();
|
||||
this.handleTimeout = setTimeout(function() {
|
||||
$this.saveStudyInfo();
|
||||
}, 5000); //5秒后记录学习完成
|
||||
if (this.contentData.contentType != 50) {
|
||||
this.handleTimeout = setTimeout(function(){
|
||||
$this.saveStudyInfo();
|
||||
}, 5000); //5秒后记录学习完成
|
||||
}else{
|
||||
//scorm课件不记录完成情况,由播放回调记录完成情况
|
||||
//当前先保存学习记录,未学习状态
|
||||
this.saveScormStudy();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1229,6 +1257,34 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
saveScormStudy() {
|
||||
//只记录SCORM课件的学习
|
||||
if (this.contentData.contentType != 50) {
|
||||
return;
|
||||
}
|
||||
if (this.contentData.status == 9) {
|
||||
//已学习完的,不会再记录
|
||||
return;
|
||||
}
|
||||
let params = {
|
||||
studyId: this.studyId, //学习id,
|
||||
courseId: this.courseId, //课程id,
|
||||
contentId: this.contentData.id, //内容id,
|
||||
contentType: this.contentData.contentType,
|
||||
contentName: this.contentData.contentName, //内容名称
|
||||
progress: 0,
|
||||
status: 1,
|
||||
contentTotal: this.totalContent
|
||||
};
|
||||
apiStudy.studyContent(params).then(res => {
|
||||
if (res.status == 200) {
|
||||
this.contentData.status = 2; //进行中
|
||||
this.contentData.studyItemId = res.result; //学习记录id
|
||||
} else {
|
||||
console.log('记录学习失败:' + res.message + ',' + res.error);
|
||||
}
|
||||
});
|
||||
},
|
||||
saveStudyInfo() {
|
||||
//记录课件学习信息
|
||||
if (this.contentData.contentType >= 60) {
|
||||
|
||||
@@ -24,22 +24,21 @@
|
||||
<div v-if="Edittearch">
|
||||
<div class="tearchimg">
|
||||
<h3>教师职业照</h3>
|
||||
<img :src="BaseUrl + teachtext.photo" alt="">
|
||||
<img :src="fileBaseUrl + teachform.photo" alt="">
|
||||
</div>
|
||||
<div class="tearchexperi">
|
||||
<h3>工作经历</h3>
|
||||
<span>{{ teachtext.workExperience }}</span>
|
||||
<span>{{ teachform.workExperience }}</span>
|
||||
</div>
|
||||
<div class="teachphoto" style="height:70px">
|
||||
<div class="tearchexperi" style="height:70px">
|
||||
<h3>擅长课程</h3>
|
||||
<div class="teachexcel">
|
||||
{{ teachtext.courses }}
|
||||
</div>
|
||||
<span>{{ teachform.courses }}</span>
|
||||
|
||||
</div>
|
||||
<div class="teachphoto" style="height:70px">
|
||||
<h3>专长</h3>
|
||||
<div class="teachexcel">
|
||||
{{ teachtext.expertise }}
|
||||
<div v-for="(item,idx) in workname" :key="idx" class="teachexcel">
|
||||
{{ item }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -80,21 +79,12 @@
|
||||
<div class="tearchexperi">
|
||||
<h3 >教师专长</h3>
|
||||
<div style="float:left;margin-top:10px;">
|
||||
<!-- <el-cascader
|
||||
placeholder="请选择,最多可选择五个"
|
||||
:options="options"
|
||||
:props="props"
|
||||
clearable></el-cascader> -->
|
||||
<!-- <div class="interest" v-show="!interestIsEdit">
|
||||
<ul class="interest-ul">
|
||||
<li class="interest-li" v-for="int in interestList" :key="int.id">{{int.name}}</li>
|
||||
</ul>
|
||||
</div> -->
|
||||
<div >
|
||||
<div class="interest" v-for="(sys,index) in sysTypeListMap" :key="sys.id">
|
||||
|
||||
<div>
|
||||
<div class="interest" v-for="(sys,index) in sysTypeListtear" :key="sys.id">
|
||||
<span class="interest-title">{{sys.name}}</span>
|
||||
<div style="width:100%">
|
||||
<el-checkbox-group v-model="checkboxGroup" v-if="sys.children.length > 0">
|
||||
<el-checkbox-group v-model="checkboxtearGroup" v-if="sys.children.length > 0">
|
||||
<el-checkbox size="medium" border v-for="ch in sys.children" :label="ch.id" :key="ch.id">{{ch.name}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
@@ -106,7 +96,7 @@
|
||||
<div>
|
||||
<div style="text-align: center;margin-top:56px">
|
||||
<el-button @click="Edittearch = true">取消</el-button>
|
||||
<el-button type="primary" @click="teacherUpdata">保存</el-button>
|
||||
<el-button type="primary" @click="teacherUpdata()">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -297,6 +287,8 @@
|
||||
}
|
||||
};
|
||||
return {
|
||||
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
||||
sysTypeListtear:[],
|
||||
teaechswich:false,
|
||||
props: { multiple: true },
|
||||
options: [{
|
||||
@@ -357,11 +349,13 @@
|
||||
hideHome:false,// 是否隐藏个人主页
|
||||
cities: cityOptions,
|
||||
checkboxGroup: [],
|
||||
checkboxtearGroup: [],
|
||||
radio: '1',
|
||||
form:{
|
||||
account:{}
|
||||
},
|
||||
teachform:{
|
||||
id:'',
|
||||
photo:'',
|
||||
courses:'',//擅长课程
|
||||
workExperience:'', //工作经历
|
||||
@@ -383,6 +377,8 @@
|
||||
sysTypeListMap:[],
|
||||
interestList:[],//已有兴趣爱好列表
|
||||
interestIsEdit:false,
|
||||
childData:[],
|
||||
workname:[],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -415,10 +411,14 @@
|
||||
}
|
||||
},
|
||||
|
||||
Edittearch(){
|
||||
this.gettearch();
|
||||
},
|
||||
// 监听"编辑按钮"事件变化
|
||||
interestIsEdit(){
|
||||
this.load();
|
||||
this.getInfo();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -430,21 +430,39 @@
|
||||
this.hideHome = !this.userInfo.showHome;
|
||||
this.load();
|
||||
this.getInfo();
|
||||
this.gettearch();
|
||||
this.getSysTypeTree().then(rs => {
|
||||
this.sysTypeListMap = rs;
|
||||
// console.log(rs);
|
||||
this.sysTypeListtear = rs;
|
||||
});
|
||||
this.Teacherprofile();
|
||||
this.Teacherinfo();
|
||||
},
|
||||
methods:{
|
||||
teacherUpdata(){
|
||||
apiTeach.update(this.teachform).then(res =>{
|
||||
console.log('编辑成功')
|
||||
})
|
||||
gettearch(){
|
||||
// console.log(this.checkboxtearGroup,'lmj');
|
||||
},
|
||||
|
||||
Teacherinfo(){
|
||||
apiTeach.detailTeacher(this.userInfo.aid).then(res =>{
|
||||
this.teachtext = res.result;
|
||||
this.teachform.courses = res.result.courses;
|
||||
this.teachform.workExperience = res.result.workExperience;
|
||||
this.tearchUrl = this.fileBaseUrl + res.result.photo;
|
||||
this.teachform.expertise = res.result.expertise.split( ',' );
|
||||
this.sysTypeListtear.forEach(nm =>{
|
||||
nm.children.forEach(lk =>{
|
||||
this.childData.push(lk);
|
||||
})
|
||||
})
|
||||
this.teachform.expertise.forEach(item =>{
|
||||
this.childData.forEach(it =>{
|
||||
if(item == it.id){
|
||||
this.workname.push(it.name);
|
||||
console.log(this.workname)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
Teacherprofile(){
|
||||
@@ -516,6 +534,7 @@
|
||||
this.checkboxGroup.push(item.refId);
|
||||
item.name = this.sysTypeName(item.refId)
|
||||
})
|
||||
// console.log(res.result);
|
||||
this.interestList = res.result;
|
||||
}
|
||||
})
|
||||
@@ -525,6 +544,23 @@
|
||||
return this.sysTypeMap.get(code);
|
||||
},
|
||||
|
||||
teacherUpdata(){
|
||||
if(this.checkboxtearGroup.length <3 && this.checkboxtearGroup.length>=1) {
|
||||
this.$message.error('至少选择三个专长!')
|
||||
return;
|
||||
}
|
||||
console.log(this.checkboxtearGroup);
|
||||
this.teachform.expertise = this.checkboxtearGroup.toString();
|
||||
console.log(this.teachform.expertise);
|
||||
this.teachform.id = this.userInfo.aid;
|
||||
apiTeach.updateTeacher(this.teachform).then(res =>{
|
||||
console.log('编辑成功')
|
||||
})
|
||||
this.Edittearch = true;
|
||||
this.Teacherinfo();
|
||||
|
||||
},
|
||||
|
||||
// 更新用户与偏好数据
|
||||
saveHobby(){
|
||||
let data = []
|
||||
@@ -677,6 +713,7 @@
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
h4{
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
font-weight: 400;
|
||||
margin: 0;
|
||||
|
||||
Reference in New Issue
Block a user