Merge branch 'dev'

This commit is contained in:
daihh
2022-07-15 22:01:33 +08:00
10 changed files with 185 additions and 43 deletions

Binary file not shown.

View File

@@ -97,25 +97,14 @@ const delReply=function(data){
return ajax.post('/xboe/m/comment/delete-reply',data);
}
/**
* @我的全部
* @pageIndex 页数
* @paramSize 每页展示行数
* @uname 根据人员姓名搜索
* */
const queryAll=function (query){
return ajax.post('/xboe/m/comment/queryAll',query);
}
export default{
del,
update,
add,
pagelist,
pageQuery,
reply,
replyList,
userReplyList,
delReply,
queryAll
reply,
replyList,
userReplyList,
delReply,
}

View File

@@ -0,0 +1,113 @@
<template>
<div class="choice">
<el-tag type="info"
closable
v-for="(item,index) in teacherValueList"
:key="item.teacherId"
@close="handleClose(item,index)">{{item.teacherName}}</el-tag>
<el-select
style="width: 100%;"
v-model="teacherValues"
filterable
remote
clearable
value-key="teacherId"
ref="elSelect"
reserve-keyword
placeholder="请输入授课教师姓名"
@change="changeTeachers"
:remote-method="remoteFindTeacher"
:loading="loading">
<el-option v-for="item in teacherDownList" :key="item.teacherId" :label="item.teacherName + item.teacherCode" :value="item"></el-option>
</el-select>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import apiTeacher from '../../api/modules/teacher.js';
export default{
name: 'choice',
computed: {
...mapGetters(['userInfo'])
},
props: {
teacherValue:{
type:Array,
},
},
data(){
return {
teacherValueList:[],
teacherValues:{},
loading:false,
teacherDownList:[],
}
},
watch:{
teacherValue(val) {
this.teacherValueList = val;
}
},
mounted(){
},
methods:{
handleClose(item,index){
this.teacherValueList.splice(index, 1);
this.$emit('getTeacherList',this.teacherValueList);
},
changeTeachers(t) {
if(t) {
let isCan = this.teacherValueList.some(it=>it.teacherId == t.teacherId);
if(isCan){
this.teacherValues = {};
this.teacherDownList = [];
this.$message.warning('教师重复,请重新选择!')
return;
}
this.teacherValueList.push(t);
this.teacherDownList = [];
this.teacherValues = {};
this.$emit('getTeacherList',this.teacherValueList);
}
},
// 教师列标,远程查询
async remoteFindTeacher(query) {
if (query) {
this.loading = true;
try {
const { result, message, status } = await apiTeacher.findByName(query);
this.loading = false;
if (status === 200) {
let list = [];
result.forEach(item => {
list.push({
teacherId: item.id,
teacherName: item.name,
teacherCode: item.code
});
});
this.teacherDownList = list;
} else {
this.$message.error('查询教师信息失败:' + message);
}
} catch (err) {
this.loading = false;
}
} else {
this.teacherDownList = [];
}
},
}
}
</script>
<style lang="scss">
.choice{
.el-tag--info{
height: 22px;
line-height: 22px;
}
}
</style>

View File

@@ -90,7 +90,7 @@
</el-form-item>
<el-form-item label="授课教师" required>
<!--授课老师默认是当前操作人-->
<el-select
<!-- <el-select
style="width: 100%;"
v-model="teacherValues"
multiple
@@ -104,7 +104,8 @@
:remote-method="remoteFindTeacher"
:loading="loading">
<el-option v-for="item in teacherDownList" :key="item.teacherId" :label="item.teacherName + item.teacherCode" :value="item"></el-option>
</el-select>
</el-select> -->
<choice :teacherValue="teacherValues" @getTeacherList="getTeacherList"></choice>
</el-form-item>
<el-form-item label="目标人群" required>
<el-input maxlength="50" v-model="courseInfo.forUsers" show-word-limit placeholder="目标人群(限50字以内)"></el-input>
@@ -234,7 +235,7 @@
</el-form-item>
<el-form-item label="授课教师" required>
<!--授课老师默认是当前操作人-->
<el-select
<!-- <el-select
style="width: 100%;"
v-model="teacherValues"
multiple
@@ -248,7 +249,8 @@
:remote-method="remoteFindTeacher"
:loading="loading">
<el-option v-for="item in teacherDownList" :key="item.teacherId" :label="item.teacherName + item.teacherCode" :value="item"></el-option>
</el-select>
</el-select> -->
<choice :teacherValue="teacherValues" @getTeacherList="getTeacherList"></choice>
</el-form-item>
</el-col>
</el-form-item>
@@ -379,7 +381,8 @@
</div>
</template>
<script>
import agreement from '@/components/Portal/agreement.vue'
import choice from '@/components/Course/choice.vue';
import agreement from '@/components/Portal/agreement.vue';
import weikeContent from '@/components/Course/weikeContent.vue';
import catalogCourseware from '@/components/Course/catalogCourseware.vue';
import imageUpload from '@/components/ImageUpload/index.vue';
@@ -396,7 +399,7 @@ import { mapGetters, mapActions } from 'vuex';
import filecloud from '@/components/FileCloud/index.vue';
export default {
props: {},
components: { weikeContent, catalogCourseware, imageUpload, WxEditor, catalogSort,agreement,filecloud},
components: { weikeContent, catalogCourseware, imageUpload, WxEditor, catalogSort,agreement,filecloud,choice},
data() {
return {
checked:false,
@@ -530,6 +533,9 @@ export default {
this.loadUserGroup();
},
methods: {
getTeacherList(res) {
this.teacherValues = res;
},
chooseFile(){
this.dlgFileChoose.show=true;
},

View File

@@ -8,7 +8,7 @@
<div style="padding: 10px 22px 10px 23px;">
<el-select v-model="dataList.type" style="margin-right: 10px" placeholder="类型">
<!-- <el-option label="全部" :value="0"></el-option> -->
<el-option label="全部" :value="null"></el-option>
<el-option label="文章" :value="2"></el-option>
<!-- <el-option label="课程" :value="1"></el-option> -->
<el-option label="案例" :value="3"></el-option>
@@ -42,13 +42,11 @@
<span style="font-size: 16px; color: #666666; line-height:30px">
<!-- <i class="el-icon-time"> -->
{{item.sysCreateBy}}@
</span>
<span style="margin-left:5px; font-size: 16px; color: #666666; line-height:25px ">
{{ item.content }}
</span>
</div>
<!-- <el-button type="primary" v-if="!item.isread" size="mini">标记已读</el-button> -->
</div>
<div style="margin-top:10px; position: relative;">
@@ -121,7 +119,7 @@ export default {
type:0,
dataList: {
pageIndex:1,
type:4,
type:'',
pageSize:10,
count:0,
list:[],
@@ -149,13 +147,13 @@ export default {
// let routeData = this.$router.resolve({ path:'/article/detail?id='+item.objId}); // , query: { id: 1 }
// window.open(routeData.href, '_blank');
// this.$router.push({path:'/article/detail',query:{id:item.objId}})
if(this.dataList.type == 2){
if(item.objType == 2){
this.$router.push({path:'/article/detail',query:{id:item.objId}})
}else if(this.dataList.type == 1){
}else if(item.objType == 1){
}else if(this.dataList.type == 4){
}else if(item.objType == 4){
this.$router.push({ path: '/qa/answer', query: { id: item.objId } });
} else if(this.dataList.type == 3){
} else if(item.objType == 3){
this.$router.push({ path: '/case/detail', query: { id: item.objId } });
}
},
@@ -189,9 +187,10 @@ export default {
this.$message.error("数据搜索失败")
})
},
reset(){
reset(){
this.dataList.pageIndex = 1;
this.dataList.send = '',
this.dataList.type = '',
this.type = 0;
this.getData();
this.isSearh = false;

View File

@@ -383,12 +383,12 @@ export default {
},
methods: {
downloadTemplate(){
let fileName = "试题导入模板.xlsx";
let fileName = "试题导入模板.xls";
let link = document.createElement('a'); //创建a标签
link.style.display = 'none'; //使其隐藏
link.download = this.webBaseUrl+'/template/test-question-template.xlsx';
link.download = this.webBaseUrl+'/template/test-question-template.xls';
link.setAttribute('target', '_blank');
link.href = this.webBaseUrl+'/template/test-question-template.xlsx'; //赋予文件下载地址
link.href = this.webBaseUrl+'/template/test-question-template.xls'; //赋予文件下载地址
link.setAttribute('download', fileName); //设置下载属性 以及文件名
document.body.appendChild(link); //a标签插至页面中
link.click(); //强制触发a标签事件

View File

@@ -33,11 +33,14 @@
<div v-if="examStatus==2" style="text-align: center;color:#6d6d6d; ">考试已结束</div>
</div>
<div v-else class="no-text">
<span>您没有需要的考试</span>
<span v-if="noExam">您没有需要的考试</span>
</div>
<div class="re-list" v-if="canExam">
<p>历史记录</p>
<el-table :data="tableData" style="width: 100%">
<div style="height:300px" v-if="loading == 1" v-loading="loading == 1">
</div>
<el-table :data="tableData" style="width: 100%" v-if="loading == 2">
<el-table-column prop="startTime" label="完成时间" width="180"></el-table-column>
<el-table-column prop="score" align="center" label="成绩">
<template slot-scope="scope">
@@ -235,11 +238,13 @@ import { formatSeconds } from '@/utils/datetime.js'
export default {
data() {
return {
loading:0,
toScoreTow,
examId:'',//考试的id
taskId:'',//考试任务的id
lastId:'',//最后一次提交的答卷
canExam:false,//能否参加考试
noExam:false,//不能参加考试
tipText:'',//提示信息
examStatus:0,//0表无1表考试中2表已结束
btnText:'开始考试',
@@ -301,6 +306,9 @@ export default {
apiTestPaper.getTestInfo(this.examId).then(res=>{
if(res.status==200){
this.canExam = res.result.hasTask;
if(!this.canExam) {
this.noExam = true;
}
this.examStatus=res.result.examStatus;
this.testPaper = res.result.exam;
this.taskId=res.result.taskId;
@@ -400,8 +408,10 @@ export default {
})
},
testAnswers(){ //获取当前考试的历史记录
this.loading = 1;
apiTestPaper.myTestAnswers(this.examId).then(res=>{
if(res.status ==200) {
this.loading = 2;
this.tableData = res.result;
let len=res.result.length;
let times=this.testPaper.times? this.testPaper.times:0;
@@ -410,6 +420,7 @@ export default {
this.tipText='已达到允许考试次数上限';
}
}else{
this.loading = 2;
this.$message.error('加载考试记录失败');
}
})

View File

@@ -653,8 +653,9 @@ export default {
});
});
//如果没有,就定位第一项内容
if (playIndex == -1) {
this.showRes(this.contentList[0]);
if (playIndex === -1) {
// this.showRes(this.contentList[0]);
this.showRes(this.catalogTree[0].children[0])
} else {
this.showRes(this.contentList[playIndex]);
}
@@ -790,8 +791,9 @@ export default {
//console.log(e);
},
showRes(r,i,index) {//i:子节下标index:章下标
if(i!=undefined && index!=undefined) {
if(i!=undefined && index!=undefined && r.status<9) {
if(this.courseInfo.orderStudy) {
//判断上个是否学完
if(i == 0) {
if(index > 0) { //第一章 第一节
let preCatalog=this.catalogTree[index-1];
@@ -806,11 +808,28 @@ export default {
if(pre.status!=9){
this.$message.warning('请按顺序学习');
return;
} else {
if(this.completed.indexOf(pre.id) > 0) {
this.$message.warning('请按顺序学习');
return;
}
}
}
//判断是否是第一个未学完的
let isAllow=false;
let has=this.catalogTree.some(treeNode=>{
let hasNo=treeNode.children.some(child=>{
if(child.status<9){
if(child.id==r.id){
isAllow=true;
}
return true;
}else{
return false;
}
});
return hasNo;
});
if(has){
if(!isAllow){
this.$message.warning('请按顺序学习');
return;
}
}
}

View File

@@ -26,6 +26,11 @@
}
},
mounted(){
let protocol=window.location.protocol;
let idx=this.fileBaseUrl.indexOf('://');
if(!this.fileBaseUrl.startsWith(protocol)){
this.fileBaseUrl=protocol+this.fileBaseUrl.substring(idx+1);
}
this.loadData();
},
methods:{