mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-21 00:36:44 +08:00
Merge branch 'preview' of codeup.aliyun.com:6265f483e4166464dc2f9c14/boeu/portal into online
This commit is contained in:
BIN
public/ad/dlg(1).png
Normal file
BIN
public/ad/dlg(1).png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 302 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 302 KiB After Width: | Height: | Size: 412 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 26 KiB |
@@ -40,8 +40,8 @@ const pageList = function(query) {
|
||||
* 课程的详细信息
|
||||
* @param {String} id
|
||||
*/
|
||||
const detail = function(id) {
|
||||
return ajax.get('/xboe/m/course/portal/detail?id=' + id);
|
||||
const detail = function(id,preview) {
|
||||
return ajax.get(`/xboe/m/course/portal/detail?id=${id}&preview=${preview}`);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,7 +78,9 @@ const getTeacherByCourseIDs = function(ids){
|
||||
const studyCounts=function(num){
|
||||
return ajax.get('/xboe/school/study/course/studyCounts?num='+num);
|
||||
}
|
||||
|
||||
const courseSearch=function(query){
|
||||
return ajax.post('/xboe/m/course/fulltext/search',query);
|
||||
}
|
||||
export default {
|
||||
list,
|
||||
pageList,
|
||||
@@ -86,5 +88,6 @@ export default {
|
||||
ranking,
|
||||
scorelist,
|
||||
getTeacherByCourseIDs,
|
||||
studyCounts
|
||||
studyCounts,
|
||||
courseSearch
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ export default {
|
||||
},
|
||||
getDetail() {
|
||||
let $this = this;
|
||||
apiCoursePortal.detail(this.id).then(rs => {
|
||||
apiCoursePortal.detail(this.id,true).then(rs => {
|
||||
if (rs.status == 200) {
|
||||
this.courseInfo = rs.result.course;
|
||||
this.teacherList = rs.result.teachers;
|
||||
|
||||
@@ -607,7 +607,7 @@ export default {
|
||||
this.courseInfo.coverImg = "";
|
||||
},
|
||||
getDetail() {
|
||||
apiCoursePortal.detail(this.id).then(rs => {
|
||||
apiCoursePortal.detail(this.id,true).then(rs => {
|
||||
if (rs.status == 200) {
|
||||
this.courseInfo = rs.result.course;
|
||||
if(rs.result.course.coverImg !== '') {
|
||||
|
||||
@@ -326,7 +326,7 @@
|
||||
import courseHomework from '@/components/Course/courseHomework.vue'
|
||||
import courseExam from '@/components/Course/courseExam.vue'
|
||||
import simplePaper from "@/components/Course/simpleTestPaper.vue";
|
||||
import WxEditor from "@/components/Editor/index.vue";
|
||||
import WxEditor from "@/components/Editor/indexCourse.vue";
|
||||
import fileUpload from '@/components/FileUpload/index.vue';
|
||||
import apiCourse from '../../api/modules/course.js';
|
||||
import apiCourseFile from '../../api/modules/courseFile.js';
|
||||
|
||||
@@ -5,7 +5,18 @@
|
||||
v-for="(item,index) in teacherValueList"
|
||||
:key="item.teacherId"
|
||||
@close="handleClose(item,index)">{{item.teacherName}}</el-tag>
|
||||
<el-select
|
||||
<el-input
|
||||
placeholder="请输入授课教师姓名"
|
||||
v-model="teacherValues"
|
||||
clearable>
|
||||
<el-button :loading="loading" slot="append" icon="el-icon-search" @click="remoteFindTeacher()"></el-button>
|
||||
</el-input>
|
||||
<div class="choice-box" v-if="teacherDownList.length>0">
|
||||
<ul>
|
||||
<li v-for="te in teacherDownList" :key="te.key" @click="changeTeachers(te)">{{te.teacherName + te.teacherCode}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- <el-select
|
||||
style="width: 100%;"
|
||||
v-model="teacherValues"
|
||||
filterable
|
||||
@@ -19,7 +30,7 @@
|
||||
: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> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -39,7 +50,7 @@
|
||||
data(){
|
||||
return {
|
||||
teacherValueList:[],
|
||||
teacherValues:{},
|
||||
teacherValues:'',
|
||||
loading:false,
|
||||
teacherDownList:[],
|
||||
}
|
||||
@@ -60,23 +71,24 @@
|
||||
if(t) {
|
||||
let isCan = this.teacherValueList.some(it=>it.teacherId == t.teacherId);
|
||||
if(isCan){
|
||||
this.teacherValues = {};
|
||||
this.teacherValues = '';
|
||||
this.teacherDownList = [];
|
||||
this.$message.warning('教师重复,请重新选择!')
|
||||
return;
|
||||
}
|
||||
this.teacherValueList.push(t);
|
||||
this.teacherDownList = [];
|
||||
this.teacherValues = {};
|
||||
this.teacherValues = '';
|
||||
this.$emit('getTeacherList',this.teacherValueList);
|
||||
}
|
||||
},
|
||||
// 教师列标,远程查询
|
||||
async remoteFindTeacher(query) {
|
||||
if (query) {
|
||||
async remoteFindTeacher() {
|
||||
console.log("2222");
|
||||
if (this.teacherValues !== '') {
|
||||
this.loading = true;
|
||||
try {
|
||||
const { result, message, status } = await apiTeacher.findByName(query);
|
||||
const { result, message, status } = await apiTeacher.findByName(this.teacherValues);
|
||||
this.loading = false;
|
||||
if (status === 200) {
|
||||
let list = [];
|
||||
@@ -104,10 +116,28 @@
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.choice{
|
||||
position: relative;
|
||||
.el-tag--info{
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.choice-box{
|
||||
position: absolute;
|
||||
// top: 40px;
|
||||
width: 280px;
|
||||
z-index: 999;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #eee;
|
||||
box-shadow: 3px 3px 3px 3px #eee;
|
||||
ul{
|
||||
margin: 0;
|
||||
padding:0 10px;
|
||||
}
|
||||
li{
|
||||
list-style: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -521,7 +521,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import WxEditor from "@/components/Editor/index.vue";
|
||||
import WxEditor from "@/components/Editor/indexCourse.vue";
|
||||
import simplePaper from "@/components/Course/simpleTestPaper.vue";
|
||||
import FileUpload from '@/components/FileUpload/index.vue';
|
||||
import pdfPreview from "@/components/PdfPreview/index.vue";
|
||||
|
||||
420
src/components/Editor/indexCourse.vue
Normal file
420
src/components/Editor/indexCourse.vue
Normal file
@@ -0,0 +1,420 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="editor" ref="editor" :style="styles"></div>
|
||||
<input type="file" @change="change" id="upload" style="display:none;" />
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="dialogVisible"
|
||||
width="700px">
|
||||
<div style="padding-top: 10px;min-height: 500px;">
|
||||
<div style="display: flex;justify-content: flex-start;">
|
||||
<div>
|
||||
<el-input maxlength="50" v-model="hasCWare.keyword" placeholder="名称"></el-input>
|
||||
</div>
|
||||
<div style="padding-left: 10px;">
|
||||
<el-button @click="findCWare()" type="primary">搜索</el-button>
|
||||
<el-button @click="closeCWareFind()" type="primary">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: center;padding-top: 10px;">
|
||||
<el-table style="100%" :data="hasCWare.list" border stripe>
|
||||
<el-table-column label="类型" width="60" prop="author"><template slot-scope="scope">{{getType(scope.row.resType)}}</template></el-table-column>
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="创建" prop="sysCreateBy" width="100"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="sysCreateTime" width="160"></el-table-column>
|
||||
<el-table-column label="选择" width="70" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" @click="chooseHasCWare(scope.row)" type="primary">选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="text-align: center">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="hasCWare.pageIndex"
|
||||
:page-sizes="[5, 10]"
|
||||
:page-size="hasCWare.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="hasCWare.count"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import apiCourseFile from '../../api/modules/courseFile.js';
|
||||
import {getType} from '../../utils/tools.js';
|
||||
import { upload } from "@/api/tools.js"; //上传接口
|
||||
import Quill from "quill";
|
||||
import "quill/dist/quill.core.css";
|
||||
import "quill/dist/quill.snow.css";
|
||||
import "quill/dist/quill.bubble.css";
|
||||
import { ImageDrop } from 'quill-image-drop-module' // 图片拖动组件引用
|
||||
import ImageResize from 'quill-image-resize-module' // 图片缩放组件引用
|
||||
Quill.register('modules/imageDrop', ImageDrop) // 注册
|
||||
Quill.register('modules/imageResize', ImageResize) // 注册
|
||||
const Size = Quill.import('attributors/style/size')
|
||||
Size.whitelist = ['15px', '18px']
|
||||
Quill.register(Size, true);
|
||||
const Parchment = Quill.import("parchment");
|
||||
class lineHeightAttributor extends Parchment.Attributor.Style { }
|
||||
const lineHeightStyle = new lineHeightAttributor("lineHeight", "line-height", {
|
||||
scope: Parchment.Scope.INLINE,
|
||||
whitelist: ["1", "1.5", "2", "3", "4"]
|
||||
});
|
||||
const toolbarOptions = [
|
||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
||||
["blockquote", "code-block"], // 引用 代码块
|
||||
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
|
||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||
[{ size: [false,"18px"] }], // 字体大小
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||
[{ align: [] }], // 对齐方式
|
||||
[{ lineheight: ['initial', '1', '1.5', '2', '3', '4'] }],
|
||||
["clean"], // 清除文本格式
|
||||
["link", "image"],
|
||||
["selectPicture"],
|
||||
]
|
||||
Quill.register({ 'formats/lineHeight': lineHeightStyle }, true)
|
||||
export default {
|
||||
name: "Editor",
|
||||
props: {
|
||||
/* 编辑器的内容 */
|
||||
value: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
toobar:{
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "请输入长度大于100个字符的内容",
|
||||
},
|
||||
/* 高度 */
|
||||
height: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
/* 最小高度 */
|
||||
minHeight: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
getType,
|
||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
hasCWare:{
|
||||
list:[],
|
||||
keyword:'',
|
||||
pageSize:10,
|
||||
pageIndex:1,
|
||||
count:0,
|
||||
},
|
||||
dialogVisible:false,
|
||||
QuillObj: null,
|
||||
currentValue: "",
|
||||
options: {
|
||||
theme: "snow",
|
||||
bounds: document.body,
|
||||
debug: "warn",
|
||||
modules: {
|
||||
imageDrop: true, //图片拖拽
|
||||
imageResize: { //放大缩小
|
||||
displayStyles: {
|
||||
backgroundColor: "black",
|
||||
border: "none",
|
||||
color: "white"
|
||||
},
|
||||
modules: ["Resize", "DisplaySize", "Toolbar"]
|
||||
},
|
||||
// 工具栏配置
|
||||
toolbar: {
|
||||
container:this.toobar? toolbarOptions:[],
|
||||
handlers: {
|
||||
image: function(value) {
|
||||
if (value) {
|
||||
document.querySelector('#upload').click() // 劫持原来的图片点击按钮事件
|
||||
} else {
|
||||
this.QuillObj.format('image', false)
|
||||
}
|
||||
},
|
||||
lineheight: (value) => {
|
||||
if (value) {
|
||||
this.QuillObj.format("lineHeight", value)
|
||||
}
|
||||
},
|
||||
selectPicture: this.showHandle
|
||||
}
|
||||
}
|
||||
},
|
||||
placeholder: this.placeholder,
|
||||
readOnly: false,
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
styles() {
|
||||
let style = {};
|
||||
if (this.minHeight) {
|
||||
style.minHeight = `${this.minHeight}px`;
|
||||
}
|
||||
if (this.height) {
|
||||
style.height = `${this.height}px`;
|
||||
}
|
||||
return style;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
handler(val) {
|
||||
if (val !== this.currentValue) {
|
||||
this.currentValue = val === null ? "" : val;
|
||||
if (this.QuillObj) {
|
||||
this.QuillObj.pasteHTML(this.currentValue);
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.QuillObj = null;
|
||||
},
|
||||
methods: {
|
||||
closeCWareFind(){
|
||||
this.hasCWare.keyword = '';
|
||||
this.hasCWare.pageIndex = 1;
|
||||
this.getCoursewareList();
|
||||
},
|
||||
chooseHasCWare(row){// 选中图片
|
||||
let length = this.QuillObj.getSelection().index//光标位置
|
||||
// 插入图片 图片地址
|
||||
this.QuillObj.insertEmbed(length, 'image', this.fileBaseUrl + row.filePath)
|
||||
// 调整光标到最后
|
||||
this.QuillObj.setSelection(length + 1)//光标后移一位
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
showHandle(){
|
||||
this.getCoursewareList();
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
initButton(){
|
||||
const editorButton = document.querySelector('.ql-selectPicture')
|
||||
// editorButton.innerHTML = '<i class="el-icon-picture-outline" style="font-size:16px;height:14px"></i>'
|
||||
editorButton.innerHTML = '选择已有图片'
|
||||
|
||||
},
|
||||
getCoursewareList() {
|
||||
// resType: 文件类型,10视频,20音频,30图片, 40 文档,41表图文,50表scrom包,90表其它 图文41,连接52,作业60,考试61,评估62
|
||||
let data = {
|
||||
name: this.hasCWare.keyword,
|
||||
resType:30,
|
||||
pageSize: this.hasCWare.pageSize,
|
||||
pageIndex: this.hasCWare.pageIndex,
|
||||
self:true
|
||||
}
|
||||
apiCourseFile.pageList(data).then(res=>{
|
||||
if(res.status === 200) {
|
||||
this.hasCWare.list = res.result.list;
|
||||
this.hasCWare.count = res.result.count;
|
||||
if(res.result.count==0){
|
||||
this.$message.error("未找到符合条件的数据");
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.hasCWare.pageSize = val;
|
||||
this.hasCWare.pageIndex = 1;
|
||||
this.getCoursewareList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.hasCWare.pageIndex = val;
|
||||
this.getCoursewareList();
|
||||
},
|
||||
init() {
|
||||
const editor = this.$refs.editor;
|
||||
this.QuillObj = new Quill(editor, this.options);
|
||||
this.QuillObj.pasteHTML(this.currentValue);
|
||||
this.QuillObj.on("text-change", (delta, oldDelta, source) => {
|
||||
const html = this.$refs.editor.children[0].innerHTML;
|
||||
const text = this.QuillObj.getText();
|
||||
const quill = this.QuillObj;
|
||||
this.currentValue = html;
|
||||
this.$emit("input", html);
|
||||
this.$emit("on-change", { html, text, quill });
|
||||
});
|
||||
this.QuillObj.on("text-change", (delta, oldDelta, source) => {
|
||||
this.$emit("on-text-change", delta, oldDelta, source);
|
||||
});
|
||||
this.QuillObj.on("selection-change", (range, oldRange, source) => {
|
||||
this.$emit("on-selection-change", range, oldRange, source);
|
||||
});
|
||||
this.QuillObj.on("editor-change", (eventName, ...args) => {
|
||||
this.$emit("on-editor-change", eventName, ...args);
|
||||
});
|
||||
this.initButton();
|
||||
},
|
||||
change(e) {
|
||||
let file = e.target.files[0]
|
||||
const formData = new FormData()
|
||||
formData.append('file', file)
|
||||
upload(formData)
|
||||
.then(res => {
|
||||
if (res.status === 200) {
|
||||
// const formdata = _.extend({}, this.formdata)
|
||||
let length = this.QuillObj.getSelection().index//光标位置
|
||||
// 插入图片 图片地址
|
||||
this.QuillObj.insertEmbed(length, 'image', res.result.httpPath)
|
||||
// 调整光标到最后
|
||||
this.QuillObj.setSelection(length + 1)//光标后移一位
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err)
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.editor{
|
||||
min-height: 250px !important;
|
||||
}
|
||||
.ql-editor{
|
||||
min-height: 250px !important;
|
||||
}
|
||||
.ql-selectPicture{
|
||||
width:90px !important;
|
||||
background:#ecf5ff !important;
|
||||
color:#588afc !important;
|
||||
font-size:12px !important;
|
||||
border-radius: 4px !important;
|
||||
}
|
||||
.ql-container{
|
||||
font-size: 15px;
|
||||
}
|
||||
.editor, .ql-toolbar {
|
||||
white-space: pre-wrap!important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
.quill-img {
|
||||
display: none;
|
||||
}
|
||||
.ql-snow .ql-tooltip[data-mode="link"]::before {
|
||||
content: "请输入链接地址:";
|
||||
}
|
||||
.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
|
||||
border-right: 0px;
|
||||
content: "保存";
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
.ql-snow .ql-tooltip[data-mode="video"]::before {
|
||||
content: "请输入视频地址:";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
|
||||
content: "15px";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="15px"]::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="15px"]::before {
|
||||
content:"15px";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="18px"]::before,
|
||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="18px"]::before {
|
||||
content: "18px";
|
||||
}
|
||||
|
||||
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item::before {
|
||||
content: "文本";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
|
||||
content: "标题1";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
|
||||
content: "标题2";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
|
||||
content: "标题3";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
|
||||
content: "标题4";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
|
||||
content: "标题5";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
|
||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
|
||||
content: "标题6";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
|
||||
content: "标准字体";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
|
||||
content: "衬线字体";
|
||||
}
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
|
||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
|
||||
content: "等宽字体";
|
||||
}
|
||||
|
||||
.ql-snow .ql-picker.ql-lineheight .ql-picker-label::before {
|
||||
content: '行高';
|
||||
font-size: 12px;
|
||||
width: 80px;
|
||||
}
|
||||
.ql-snow .ql-picker.ql-lineheight .ql-picker-label[data-value="1"]::before,
|
||||
.ql-snow .ql-picker.ql-lineheight .ql-picker-item[data-value="1"]::before {
|
||||
content: '1';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-lineheight .ql-picker-label[data-value="1.5"]::before,
|
||||
.ql-snow .ql-picker.ql-lineheight .ql-picker-item[data-value='1.5']::before {
|
||||
content: '1.5';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-lineheight .ql-picker-label[data-value="2"]::before,
|
||||
.ql-snow .ql-picker.ql-lineheight .ql-picker-item[data-value='2']::before {
|
||||
content: '2';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-lineheight .ql-picker-label[data-value="3"]::before,
|
||||
.ql-snow .ql-picker.ql-lineheight .ql-picker-item[data-value='3']::before {
|
||||
content: '3';
|
||||
}
|
||||
.ql-snow .ql-picker.ql-lineheight .ql-picker-label[data-value="4"]::before,
|
||||
.ql-snow .ql-picker.ql-lineheight .ql-picker-item[data-value='4']::before {
|
||||
content: '4';
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
@@ -443,7 +443,7 @@ export default {
|
||||
}
|
||||
},
|
||||
getDetail() {
|
||||
apiCoursePortal.detail(this.manageStudyData.id).then(rs => {
|
||||
apiCoursePortal.detail(this.manageStudyData.id,true).then(rs => {
|
||||
if (rs.status == 200) {
|
||||
let treeList = [];
|
||||
if (rs.result.sections.length > 0) {
|
||||
@@ -523,7 +523,7 @@ export default {
|
||||
});
|
||||
},
|
||||
getRecordDetail(id) {
|
||||
apiCoursePortal.detail(id).then(rs => {
|
||||
apiCoursePortal.detail(id,true).then(rs => {
|
||||
if (rs.status == 200) {
|
||||
let treeList = [];
|
||||
if (rs.result.sections.length > 0) {
|
||||
|
||||
@@ -81,7 +81,7 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||
mounted() {
|
||||
this.sex = this.userInfo.sex;
|
||||
// 判断路由是进入的学员默认页面就重置setCurIdentity
|
||||
if(this.$route.path == '/study/index'){
|
||||
if(this.$route.path == '/uc/study/task' || this.$route.path == '/study/index'){
|
||||
this.setCurIdentity(1);
|
||||
}
|
||||
//let testName='京东方科技集团股份有限公司/北京中祥英科技有限公司/技术中心';
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
:default-active="activeMenu"
|
||||
router
|
||||
active-text-color="#00aaff"
|
||||
:default-openeds="['manageTodo','manageFinish','teacherTodo','teacherFinish','myqa', 'mystudy', 'course', 'exam', 'u001', 'u002', 'u003', 'u004','u009','u008']"
|
||||
:default-openeds="['manageTodo','manageFinish','teacherTodo','teacherFinish','myqa', 'mystudy', 'course', 'exam', 'u001', 'u002', 'u003', 'u004']"
|
||||
class="el-menu-vertical"
|
||||
@open="handleOpen"
|
||||
@close="handleClose"
|
||||
@@ -93,16 +93,14 @@
|
||||
<svg-icon icon-class="interlocution"></svg-icon>
|
||||
<span slot="title">问答管理</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item v-show="curIdentity == 3" index="u008">
|
||||
<el-menu-item v-show="curIdentity == 3">
|
||||
<template slot="title">
|
||||
<!-- <i class="el-icon-s-grid"></i> -->
|
||||
<svg-icon icon-class="administrator" style="font-size:17px"></svg-icon>
|
||||
<span><a href="/resource/index.html" target="_blank">旧版管理员界面</a></span>
|
||||
<!-- <span>我的学习</span> -->
|
||||
</template>
|
||||
<!-- <i class="el-icon-menu"></i> -->
|
||||
</el-menu-item>
|
||||
<el-menu-item v-show="curIdentity == 3" index="u009">
|
||||
<el-menu-item v-show="curIdentity == 3">
|
||||
<template slot="title">
|
||||
<svg-icon icon-class="management" style="font-size:16px"></svg-icon>
|
||||
<span><a href="https://u.boe.com/train/manager/index.html" target="_blank">业务支援读书会管理</a></span>
|
||||
|
||||
@@ -127,7 +127,7 @@ export default {
|
||||
mounted() {
|
||||
//控制弹出窗口的代码
|
||||
let now = new Date() //当前时间
|
||||
let end = new Date('2022/06/29 00:00:00') //对比时间
|
||||
let end = new Date('2022/08/07 00:00:00') //对比时间
|
||||
if(now.getTime() < end.getTime()){
|
||||
let times = localStorage.getItem(this.signLocalTimesKey);
|
||||
let isNewLogin=localStorage.getItem(this.$Constants.newLoginKey);
|
||||
@@ -137,9 +137,8 @@ export default {
|
||||
this.signInShow = true;//显示
|
||||
localStorage.setItem(this.signLocalTimesKey,1);
|
||||
}else{
|
||||
//console.log(times,'times');
|
||||
let intTimes=parseInt(times);
|
||||
if(intTimes<3){
|
||||
if(intTimes<2){
|
||||
this.signInShow = true;//显示
|
||||
intTimes++;
|
||||
localStorage.setItem(this.signLocalTimesKey,intTimes);
|
||||
|
||||
@@ -21,7 +21,7 @@ router.beforeEach((to, from, next) => {
|
||||
}else{
|
||||
constants.fileBaseUrl = window.location.protocol+'//'+window.location.host+configPath;
|
||||
}
|
||||
|
||||
|
||||
|
||||
NProgress.start();
|
||||
|
||||
@@ -66,7 +66,12 @@ router.beforeEach((to, from, next) => {
|
||||
}else{
|
||||
|
||||
//next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
location.href=process.env.VUE_APP_LOGIN_URL;
|
||||
//设置之前的路径
|
||||
//store.commit('portal/SetBackUrl',location.href);
|
||||
//console.log(location.href,'location.href');
|
||||
//let urlPre=window.location.protocol+'//'+window.location.host;
|
||||
//let backUrl=location.href.substring(urlPre.length);
|
||||
location.href=process.env.VUE_APP_LOGIN_URL+"?returnUrl="+location.href;
|
||||
NProgress.done()
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ const getters = {
|
||||
sidebarRouters: state => state.permission.sidebarRouters,
|
||||
portalCase: state => state.portal.case,
|
||||
portalLoginRememberMe: state => state.portal.loginRememberMe,
|
||||
portalBackUrl: state => state.portal.backUrl,
|
||||
resOwnerMap:state => state.resOwner.resOwnerMap,
|
||||
sysTypeMap:state => state.sysType.sysTypeMap,
|
||||
userMsg:state => state.user.msg,
|
||||
|
||||
@@ -2,7 +2,8 @@ const state = {
|
||||
case: {
|
||||
readProtocol: sessionStorage.getItem("readProtocol") == null ? false : JSON.parse(sessionStorage.getItem("readProtocol"))
|
||||
},
|
||||
loginRememberMe: sessionStorage.getItem("loginRememberMe") == null ? {} : JSON.parse(sessionStorage.getItem("loginRememberMe"))
|
||||
loginRememberMe: sessionStorage.getItem("loginRememberMe") == null ? {} : JSON.parse(sessionStorage.getItem("loginRememberMe")),
|
||||
backUrl:''
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
@@ -13,7 +14,10 @@ const mutations = {
|
||||
SET_LoginRememberMe: (state, iden) => {
|
||||
state.loginRememberMe = iden;
|
||||
sessionStorage.setItem("loginRememberMe", JSON.stringify(iden));
|
||||
}
|
||||
},
|
||||
SET_BackUrl: (state, u) => {
|
||||
state.backUrl = u;
|
||||
},
|
||||
}
|
||||
|
||||
const actions = {
|
||||
@@ -34,6 +38,13 @@ const actions = {
|
||||
commit('SET_LoginRememberMe', iden);
|
||||
resolve();
|
||||
})
|
||||
},
|
||||
//设置登录返回的地址
|
||||
SetBackUrl({commit}, url) {
|
||||
return new Promise((resolve) => {
|
||||
commit('SET_BackUrl', url);
|
||||
resolve();
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -692,12 +692,12 @@ export default {
|
||||
margin-bottom:8px;
|
||||
}
|
||||
.case-text{
|
||||
height: 55px;
|
||||
height: 57px;
|
||||
font-size: 14px;
|
||||
overflow: hidden;
|
||||
color: #888888;
|
||||
// line-height: 18px;
|
||||
margin-bottom:10px;
|
||||
margin-bottom:8px;
|
||||
}
|
||||
::v-deep .case-inter{
|
||||
width: 100%;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
import loginApi from "@/api/login";
|
||||
export default {
|
||||
computed: {
|
||||
...mapGetters(['portalLoginRememberMe'])
|
||||
...mapGetters(['portalLoginRememberMe','portalBackUrl'])
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</el-col> -->
|
||||
<!-- </el-row> -->
|
||||
<el-row :gutter="20">
|
||||
|
||||
|
||||
<!-- <el-col :span="6">
|
||||
<div class="grid-content bg-purple">
|
||||
<el-cascader style="margin-left: 0px" placeholder="资源归属" :options="resOwnerListMap" :props="defaultProps" v-model="resOwner" clearable></el-cascader>
|
||||
@@ -36,10 +36,10 @@
|
||||
<el-button type="primary" style="margin-left: 0px" @click="search()" icon="el-icon-search">搜索</el-button>
|
||||
<el-button @click="reset()" style="margin-left: 20pxpx" type="primary" icon="el-icon-refresh-right">重置</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-row :gutter="20" style="margin-top:15px;margin-bottom:15px">
|
||||
<el-col :span="4" style="margin-left:0%;">
|
||||
<div class="grid-content bg-purple">
|
||||
@@ -51,11 +51,11 @@
|
||||
<el-checkbox v-model="params.self" @change="getSearch()">仅显示我上传的</el-checkbox>
|
||||
<!-- <el-checkbox v-model="params.self" label="只看自己" border></el-checkbox> -->
|
||||
</div>
|
||||
</el-col>
|
||||
</el-col>
|
||||
<!-- <el-col :span="6">
|
||||
|
||||
|
||||
</el-col> -->
|
||||
|
||||
|
||||
</el-row>
|
||||
<!-- <div><el-button @click="addFile()" type="primary">上传课件</el-button></div> -->
|
||||
<!-- <el-cascader style="margin-left: 10px" placeholder="资源归属" :options="resOwnerList" :props="defaultProps" v-model="resOwner" clearable></el-cascader> -->
|
||||
@@ -346,18 +346,17 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getSearch();
|
||||
},
|
||||
mounted() {
|
||||
this.loadResOwners();
|
||||
this.getResOwnerTree().then(rs => {
|
||||
this.resOwnerListMap = rs;
|
||||
});
|
||||
this.search();
|
||||
},
|
||||
methods: {
|
||||
search(){
|
||||
this.params.pageIndex = 1;
|
||||
//this.params.pageIndex = 1;
|
||||
this.page.pageIndex=1;
|
||||
this.getSearch();
|
||||
},
|
||||
reset() {
|
||||
@@ -369,7 +368,8 @@ export default {
|
||||
this.params.resOwner1 = '';
|
||||
this.params.resOwner2 = '';
|
||||
this.params.resOwner3 = '';
|
||||
this.params.pageIndex = 1;
|
||||
//this.params.pageIndex = 1;
|
||||
this.page.pageIndex=1;
|
||||
this.getSearch();
|
||||
},
|
||||
...mapActions({
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<div>
|
||||
<div class="content"><img src="@/assets/images/icon/remark-iocn.png" alt="" srcset="">目标人群:<div class="content-text">{{courseInfo.forUsers}}</div></div>
|
||||
<div class="content"><img src="@/assets/images/icon/remark-iocn.png" alt="" srcset="">课程价值:<div class="content-text">{{courseInfo.value}}</div></div>
|
||||
<div class="content"><img src="@/assets/images/icon/remark-iocn.png" alt="" srcset="">详细介绍:<div class="content-text" v-html="courseInfo.overview"></div></div>
|
||||
<div class="content"><img src="@/assets/images/icon/remark-iocn.png" alt="" srcset="">详细介绍:<div class="content-text" v-html="courseInfo.summary"></div></div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="大纲" name="second">
|
||||
@@ -173,7 +173,7 @@ export default {
|
||||
|
||||
let $this=this;
|
||||
//页面只支取一次,所以先直接写在这里面
|
||||
apiCoursePortal.detail(id).then(rs=>{
|
||||
apiCoursePortal.detail(id,false).then(rs=>{
|
||||
if(rs.status==200){
|
||||
if(rs.result.teachers && rs.result.teachers.length > 0){
|
||||
let userIds=[];
|
||||
@@ -213,6 +213,9 @@ export default {
|
||||
this.showQrimage();
|
||||
this.isSignUp();
|
||||
}else{
|
||||
if(rs.status==204){ //无查看此课程的权限
|
||||
this.courseInfo.name=rs.result.course.name;
|
||||
}
|
||||
this.$message.error(rs.message);
|
||||
}
|
||||
})
|
||||
|
||||
1401
src/views/portal/course/Index(1).vue
Normal file
1401
src/views/portal/course/Index(1).vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -85,16 +85,14 @@
|
||||
<span v-if="cinfo.type=='face-course'" class="course-type-title course-type">线下课</span>
|
||||
<span v-if="cinfo.type=='project'" class="course-type-title course-type">学习项目</span>
|
||||
</div>
|
||||
<!-- <el-tooltip class="item" :content="cinfo.couretitle" placement="bottom-start" effect="light" :visible-arrow="false" popper-class="text-tooltip" > -->
|
||||
<div :title="cinfo.name" class="course-title title-line-ellipsis" v-html="$keywordActiveShow(cinfo.name,keyword)">
|
||||
</div>
|
||||
<!-- </el-tooltip> -->
|
||||
<div :title="cinfo.title" class="course-title title-line-ellipsis" v-html="cinfo.name">
|
||||
</div>
|
||||
<div class="course-author">
|
||||
<div class="course-author-left" v-if="cinfo.authorInfo">
|
||||
{{cinfo.authorInfo.name}}
|
||||
<div class="course-author-left" v-if="cinfo.teacher">
|
||||
{{cinfo.teacher}}
|
||||
</div>
|
||||
<div style="flex:1;text-align: center;">
|
||||
<span class="study-num">{{cinfo.studys}}人学习</span>
|
||||
<span class="study-num">{{cinfo.studies}}人学习</span>
|
||||
</div>
|
||||
<div style="padding-left:15px">
|
||||
<div v-if="cinfo.score">
|
||||
@@ -136,7 +134,7 @@
|
||||
<span style="margin-left: 10px" v-if="index!=2&&index!=0&&index!=1">{{index+1}}</span>
|
||||
</el-col>
|
||||
<!-- <el-tooltip :enterable="false" @click.native="jumpRouter(item)" effect="light" :content="item.name" placement="bottom" :visible-arrow="false" popper-class="text-tooltip"> -->
|
||||
<div :title="item.name" @click="jumpRouter(item)">
|
||||
<div v-bind:title="item.name" @click="jumpRouter(item)">
|
||||
<el-col :span="15" style="cursor: pointer;" class="title-line-ellipsis"> {{ item.name }}</el-col>
|
||||
</div>
|
||||
|
||||
@@ -218,10 +216,9 @@ import apiUser from "@/api/system/user.js";
|
||||
import scene from "@/api/modules/scene.js";
|
||||
import interactBar from "@/components/Portal/interactBar.vue";
|
||||
import courseImage from "@/components/Course/courseImage.vue";
|
||||
import { courseType, getType, toScore } from "@/utils/tools.js";
|
||||
import { courseType, getType, toScore,formatDate } from "@/utils/tools.js";
|
||||
import { deepClone, param } from "../../../utils";
|
||||
import apiSearchterm from "@/api/modules/searchterm.js";
|
||||
import { Promise } from "q";
|
||||
export default {
|
||||
name: "index",
|
||||
components: {
|
||||
@@ -239,6 +236,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formatDate,
|
||||
couretitle: "",
|
||||
toScore,
|
||||
noPageList: true, //判断接口是否还有数据
|
||||
@@ -294,8 +292,7 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let screenWidth = window.screen.availHeight;
|
||||
//console.log("screenWidth", screenWidth);
|
||||
let screenWidth = window.screen.availWidth;
|
||||
if (screenWidth < 1280) {
|
||||
this.course.pageSize = 9;
|
||||
this.columns = 3;
|
||||
@@ -306,8 +303,6 @@ export default {
|
||||
this.course.pageSize = 15;
|
||||
this.columns = 5;
|
||||
}
|
||||
//var hasNum=12;
|
||||
//console.log(parseInt(hasNum/this.columns)*this.columns,'this.columns');
|
||||
|
||||
let el_top = document.querySelector("#searchbar");
|
||||
let el_search = document.querySelector("#searchbar");
|
||||
@@ -400,10 +395,8 @@ export default {
|
||||
});
|
||||
},
|
||||
toCourseDetail(item) {
|
||||
if (isNaN(item.type)) {
|
||||
return `${this.webBaseUrl}/course/boeframe?id=${item.id}&type=${
|
||||
item.type
|
||||
}`;
|
||||
if (item.source == 1) {
|
||||
return `${this.webBaseUrl}/course/boeframe?id=${item.id}&type=${item.type}`;
|
||||
//此处使用window.open有问题
|
||||
//window.open(`${this.webBaseUrl}/course/boeframe?id=${item.id}&type=${item.type}`);
|
||||
} else {
|
||||
@@ -442,7 +435,7 @@ export default {
|
||||
this.category = "";
|
||||
this.categorySub = "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.searchTags.splice(index, 1);
|
||||
if(i === 'type') {
|
||||
@@ -519,23 +512,22 @@ export default {
|
||||
this.course.pageIndex += 1;
|
||||
this.search();
|
||||
},
|
||||
// 高亮搜索词
|
||||
brightenKeyword(val, keyword) {
|
||||
const Reg = new RegExp(keyword, 'i');
|
||||
let res = '';
|
||||
if (val) {
|
||||
res = val.replace(Reg, `<span style="color: #3e7fff;">${keyword}</span>`);
|
||||
return res;
|
||||
}
|
||||
},
|
||||
async search() {
|
||||
let that = this;
|
||||
if (this.course.keyword) {
|
||||
apiSearchterm.save({ keyword: this.course.keyword, type: 1 });
|
||||
}
|
||||
this.isFind = true;
|
||||
if (this.category === 0) {
|
||||
this.course.type = null;
|
||||
} else if (this.category === 2) {
|
||||
// if (this.categorySub === "") {
|
||||
// this.course.type = "20";
|
||||
// } else {
|
||||
// this.course.type = this.categorySub;
|
||||
// }
|
||||
} else {
|
||||
this.course.type = this.category;
|
||||
}
|
||||
this.isFind = true;
|
||||
this.course.type = this.category;
|
||||
if (this.types.sysTypes == 0 || this.types.sysTypes == null) {
|
||||
this.course.sysType1 = "";
|
||||
this.course.sysType2 = "";
|
||||
@@ -553,230 +545,39 @@ export default {
|
||||
}
|
||||
this.course.device = 1;
|
||||
this.getTags();
|
||||
//从新课程库中取10条,从老库中取10条
|
||||
let oldPageIndex = 0;
|
||||
let oldCateName = "";
|
||||
let oldParamsType = "";
|
||||
if (this.course.sysType1) {
|
||||
//cateName
|
||||
let courseSysType = this.course.sysType1;
|
||||
let curName = this.optionsList.find(item => {
|
||||
return item.id === courseSysType;
|
||||
});
|
||||
if (curName) {
|
||||
oldCateName = curName.name;
|
||||
}
|
||||
}
|
||||
if (this.category == 20) {
|
||||
oldParamsType = "online-course";
|
||||
} else if (this.category == 30) {
|
||||
oldParamsType = "face-course";
|
||||
} else if (this.category == 40) {
|
||||
oldParamsType = "project";
|
||||
}
|
||||
//if(oldParamsType == '' && oldCateName == '' && this.course.keyword == '') {
|
||||
if (this.searchTags.length == 0) {
|
||||
oldPageIndex = this.course.pageIndex - 3;
|
||||
} else {
|
||||
oldPageIndex = this.course.pageIndex;
|
||||
}
|
||||
// if(this.course.pageIndex == 1) {
|
||||
// this.courseList = [];
|
||||
// }
|
||||
|
||||
let oldParams = {
|
||||
type: oldParamsType,
|
||||
page: oldPageIndex,
|
||||
size: this.course.pageSize,
|
||||
keyword: this.course.keyword,
|
||||
sort: "new",
|
||||
cateName: oldCateName
|
||||
};
|
||||
if (this.course.orderField == "id") {
|
||||
//最新
|
||||
oldParams.sort = "new";
|
||||
}
|
||||
if (this.course.orderField == "studys") {
|
||||
//最热
|
||||
oldParams.sort = "hot";
|
||||
}
|
||||
let data = [];
|
||||
let isTopList = [];
|
||||
|
||||
if (this.course.pageIndex > this.totalPages) {
|
||||
//console.log(this.course.pageIndex, this.totalPages, "1");
|
||||
this.noDataList = true;
|
||||
if (this.searchTags.length == 0) {
|
||||
oldParams.page = this.course.pageIndex - this.totalPages;
|
||||
}
|
||||
} else {
|
||||
//console.log(this.course.pageIndex, this.totalPages, "2");
|
||||
if (this.searchTags.length == 0) {
|
||||
if (this.totalPages > 3) {
|
||||
if (this.course.pageIndex <= 3) {
|
||||
this.noDataList = false;
|
||||
} else {
|
||||
this.noDataList = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// if(this.totalPages == 1 && this.course.pageIndex ==1){
|
||||
// this.noDataList = true;
|
||||
// }
|
||||
}
|
||||
if (this.course.type == 30 || this.course.type == 40) {
|
||||
this.noPageList = false;
|
||||
}
|
||||
//console.log(this.noDataList, this.totalPages, "this.noDataList");
|
||||
// 隐藏loadMore
|
||||
this.moreState = 2;
|
||||
this.noDataList &&
|
||||
(await apiOldCourse
|
||||
.courseList(oldParams)
|
||||
.then(oldRs => {
|
||||
if (oldRs.status == 200 && oldRs.result.dataList.length > 0) {
|
||||
let list = that.filterConversion(oldRs.result.dataList);
|
||||
//list.name = list.name.replace(/<[^>]+>|&[^>]+;/g,"").trim();
|
||||
data.push(...list);
|
||||
that.moreState = 1;
|
||||
} else {
|
||||
that.noDataList = false;
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
that.noDataList = false;
|
||||
}));
|
||||
|
||||
this.noPageList &&
|
||||
(await apiCoursePortal
|
||||
.pageList(this.course)
|
||||
await apiCoursePortal
|
||||
.courseSearch(this.course)
|
||||
.then(res => {
|
||||
if (res.status == 200 && res.result.list.length > 0) {
|
||||
this.totalPages = res.result.totalPages;
|
||||
let courseIds = [];
|
||||
res.result.list.forEach(item => {
|
||||
item.name = this.$keywordActiveShow(
|
||||
item.name,
|
||||
this.course.keyword
|
||||
);
|
||||
item.couretitle = this.$keywordActiveShow(
|
||||
item.name,
|
||||
this.course.keyword
|
||||
)
|
||||
.replace(/<[^>]+>|&[^>]+;/g, "")
|
||||
.trim(); //去掉所有的html标签和 之类的特殊符合
|
||||
item.authorInfo = {
|
||||
aid: "",
|
||||
name: "",
|
||||
orgInfo: "",
|
||||
avatar: "",
|
||||
code: ""
|
||||
};
|
||||
courseIds.push(item.id);
|
||||
if (item.isTop) {
|
||||
isTopList.push(item);
|
||||
} else {
|
||||
data.push(item);
|
||||
//转化标红显示
|
||||
item.title=item.name;
|
||||
if(that.course.keyword){
|
||||
item.name=that.brightenKeyword(item.name,that.course.keyword);
|
||||
}else{
|
||||
item.name=item.name;
|
||||
}
|
||||
|
||||
});
|
||||
that.loadCouserTeacher(res.result.list, courseIds);
|
||||
// data.push(...res.result.list);
|
||||
that.moreState = 1;
|
||||
|
||||
this.courseList.push(...res.result.list);
|
||||
this.moreState = 1;
|
||||
} else {
|
||||
that.noPageList = false;
|
||||
this.moreState = 3;
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
that.noPageList = false;
|
||||
}));
|
||||
if (this.course.orderField == "id") {
|
||||
//最新
|
||||
data.sort(this.pcompare("publishTime", false));
|
||||
}
|
||||
if (this.course.orderField == "studys") {
|
||||
//最热
|
||||
data.sort(this.pcompare("studys", false));
|
||||
}
|
||||
this.courseList.push(...isTopList, ...data);
|
||||
if (this.noDataList == false && this.noPageList == false) {
|
||||
this.moreState = 3;
|
||||
}
|
||||
},
|
||||
pcompare(prop, rev) {
|
||||
if (rev === undefined) {
|
||||
rev = 1;
|
||||
} else {
|
||||
rev = rev ? 1 : -1;
|
||||
}
|
||||
return function(obj1, obj2) {
|
||||
let val1 = obj1[prop],
|
||||
val2 = obj2[prop];
|
||||
return val1 < val2 ? rev * -1 : rev * 1;
|
||||
};
|
||||
},
|
||||
filterConversion(data) {
|
||||
let list = [];
|
||||
data.forEach((item, index) => {
|
||||
list.push({
|
||||
coverImg: item.cover[0].url,
|
||||
name: item.title,
|
||||
type: item.type,
|
||||
id: item.id,
|
||||
studys: Number(item.enrollSuccess), // Number(), //学习人数
|
||||
score: item.score,
|
||||
publishTime: item.releaseDate,
|
||||
authorInfo: {
|
||||
avatar: "",
|
||||
name: ""
|
||||
}
|
||||
});
|
||||
});
|
||||
return list;
|
||||
},
|
||||
loadCouserTeacher(list, ids) {
|
||||
let that = this;
|
||||
// 先查课程关联教师iD
|
||||
apiCourse.getTeacherByCourseIDs(ids).then(cres => {
|
||||
if (cres.status == 200) {
|
||||
let userIds = [];
|
||||
list.forEach((item, index) => {
|
||||
cres.result.some(courseTeahcer => {
|
||||
if (courseTeahcer.courseId == item.id) {
|
||||
if (courseTeahcer.teacherIds) {
|
||||
userIds.push(courseTeahcer.teacherIds[0]);
|
||||
item.authorInfo.aid = courseTeahcer.teacherIds[0];
|
||||
item.authorInfo.name = courseTeahcer.names[0];
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
this.moreState = 3;
|
||||
});
|
||||
//that.loadCourseAuthorInfo(list,userIds);
|
||||
}
|
||||
});
|
||||
},
|
||||
loadCourseAuthorInfo(list, ids) {
|
||||
//加载作者信息,头像,机构信息
|
||||
if (ids.length == 0) {
|
||||
return;
|
||||
}
|
||||
const noReapetIds = [...new Set(ids)];
|
||||
apiUser.getByIds(ids).then(res => {
|
||||
if (res.status == 200) {
|
||||
list.forEach((item, index) => {
|
||||
res.result.some(author => {
|
||||
if (author.aid == item.authorInfo.aid) {
|
||||
item.authorInfo = author;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
console.log("加载课程信息失败:" + res.error);
|
||||
//this.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
getTags() {
|
||||
this.searchTags = [];
|
||||
@@ -854,7 +655,7 @@ export default {
|
||||
});
|
||||
},
|
||||
jumpRouter(item) {
|
||||
console.log(item.type, "item.type");
|
||||
//console.log(item.type, "item.type");
|
||||
// return console.log(id,type,"fihkj1")
|
||||
if (item.type == 20) {
|
||||
//录播课
|
||||
|
||||
@@ -363,7 +363,7 @@ export default {
|
||||
this.loadResOwners();
|
||||
let $this = this;
|
||||
//页面只支取一次,所以先直接写在这里面
|
||||
apiCoursePortal.detail(id).then(rs => {
|
||||
apiCoursePortal.detail(id,false).then(rs => {
|
||||
if (rs.status == 200) {
|
||||
this.courseInfo = rs.result.course;
|
||||
if(rs.result.course.tags != '') this.tags = rs.result.course.tags.split(",");
|
||||
@@ -447,6 +447,9 @@ export default {
|
||||
//study info
|
||||
this.loadStudyInfo();
|
||||
} else {
|
||||
if(rs.status==204){ //无查看此课程的权限
|
||||
this.courseInfo.name=rs.result.course.name;
|
||||
}
|
||||
this.$message.error(rs.message);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -484,7 +484,7 @@ export default {
|
||||
this.showQrimage();
|
||||
let $this = this;
|
||||
//页面只支取一次,所以先直接写在这里面
|
||||
apiCoursePortal.detail(id).then(rs => {
|
||||
apiCoursePortal.detail(id,true).then(rs => {
|
||||
if (rs.status == 200) {
|
||||
console.log(rs,'2')
|
||||
this.courseInfo = rs.result.course;
|
||||
|
||||
@@ -300,7 +300,7 @@ export default {
|
||||
//console.log("播放结束");
|
||||
},
|
||||
loadData() {
|
||||
apiCoursePortal.detail(this.courseId).then(rs=>{
|
||||
apiCoursePortal.detail(this.courseId,true).then(rs=>{
|
||||
if(rs.status==200){
|
||||
//设置必须的字段
|
||||
rs.result.sections.forEach(sec=>{
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
|
||||
|
||||
<!-- 标题 -->
|
||||
<div style="flex:1;line-height:20px" class="mltit">
|
||||
<div style="flex:1;line-height:21px" class="mltit">
|
||||
<el-tooltip class="item" effect="light" :content="item.section.name" placement="top-start">
|
||||
<span style="font-size:16px;font-weight: 700;color: #343434;margin-left: 15px;">
|
||||
{{ item.section.name }}</span>
|
||||
@@ -300,7 +300,7 @@ export default {
|
||||
getType: getType,
|
||||
ctabName: 'catalog',
|
||||
resType: null,
|
||||
activeNames: [0, 1, 2, 3, 4],
|
||||
activeNames: [0, 1, 2, 3, 4,5,6,7,8,9],
|
||||
scoreInfo: {
|
||||
dlgShow: false,
|
||||
score: 5,
|
||||
@@ -580,10 +580,9 @@ export default {
|
||||
if(this.contentData.status<9){
|
||||
this.finishStudyItem();
|
||||
}
|
||||
|
||||
},
|
||||
loadData() {
|
||||
apiCoursePortal.detail(this.courseId).then(rs => {
|
||||
apiCoursePortal.detail(this.courseId,false).then(rs => {
|
||||
if (rs.status == 200) {
|
||||
//设置必须的字段
|
||||
rs.result.sections.forEach(sec => {
|
||||
|
||||
Reference in New Issue
Block a user