Merge remote-tracking branch 'aly/master'

This commit is contained in:
于继存
2022-08-09 18:08:01 +08:00
68 changed files with 3848 additions and 2306 deletions

BIN
public/ad/dlg(1).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 KiB

BIN
public/ad/dlg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 93 KiB

BIN
public/images/bgimg/wfl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -4,6 +4,9 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="pragram" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="expires" content="0">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">

Binary file not shown.

View File

@@ -61,10 +61,20 @@ const delLearning = function(ms_timeline_kid) {
return ajax.post('/b1/system/user/ms-timeline-delete',{ms_timeline_kid});
}
/**
* 根据用户的kid获取用户的受众权限
*
* @param {Object} kid
*/
const audience = function(kid) {
return ajax.get('/b1/system/user/audience-by-user?userId='+kid);
}
export default {
myLearning,
cmtaskList,
reportList,
courseList,
delLearning
delLearning,
audience
}

View File

@@ -93,6 +93,22 @@ const queryComments=function(pageSize){
return ajax.get(`/xboe/m/boe/cases/query-comments?pageSize=${pageSize}`);
}
/**
* 专业分类
* */
const majorTypes=function (){
return ajax.get('/xboe/m/boe/cases/majorTypes');
}
/**
* 详情新*/
const details = function (id, addView) {
let pars = 'id=' + id;
if (addView) {
pars += '&addView=' + addView
}
return ajax.get('/xboe/m/boe/cases/details?' + pars);
}
export default {
indexList,
queryList,
@@ -104,5 +120,7 @@ export default {
query,
usernameList,
queryPraises,
queryComments
queryComments,
majorTypes,
details
}

View File

@@ -97,7 +97,6 @@ const delReply=function(data){
return ajax.post('/xboe/m/comment/delete-reply',data);
}
export default{
del,
update,
@@ -107,5 +106,5 @@ export default{
reply,
replyList,
userReplyList,
delReply
delReply,
}

View File

@@ -5,7 +5,7 @@
import ajax from '@/utils/xajax.js'
/**
* 查询指定条数的课程,用于首页提取
* post 请求 查询指定条数的课程,用于首页提取
* @param {Object} query
* num多少条记录
* orderType排序方式1表最新3表最热
@@ -33,15 +33,15 @@ const list = function(query) {
topOrder:true,置顶排序
*/
const pageList = function(query) {
return ajax.post('/xboe/m/course/portal/pagelist', query);
return ajax.post('/xboe/m/course/portal/pagelist-new', 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
}

View File

@@ -129,6 +129,11 @@ const downloadTemplate=function(){
return ajax.get(requestParam);
}
const userGroupIds=function() {
return ajax.get('/xboe/usergroup/user-group-ids');
}
export default{
list,
findByName,
@@ -139,5 +144,6 @@ export default{
publish,
del,
downloadTemplate,
userOrgs
userOrgs,
userGroupIds
}

View File

@@ -10,7 +10,7 @@
<div class="article-info-summary two-line-ellipsis">{{ item.summary || item.content}}</div>
<div class="article-info-tools">
<authorInfo :avatar="item.avatar" :name="item.name" :info="item.orgInfo" :sex="item.sex"> </authorInfo>
<span>发布时间{{ item.sysCreateTime || item.publishTime | timeFilter }}</span>
<span>发布时间{{ item.sysCreateTime || item.publishTime || item.favoritesTime | timeFilter }}</span>
<span>收藏时间{{ item.time || item.favoritesTime | timeFilter }}</span>
<el-button @click.stop="delItem(item)" type="text" style="color: #8590A6" icon="el-icon-remove">取消收藏</el-button>
</div>

View File

@@ -89,6 +89,8 @@ export default {
apiArticle.detail(id,false).then(res => {
if (res.status == 200) {
this.addForm = res.result;
// this.addForm.content = res.result.content.trim();
// console.log(this.addForm.content)
if(this.addForm.coverurl){
this.converImage = this.fileBaseUrl + this.addForm.coverurl;
}
@@ -137,6 +139,15 @@ export default {
}
this.loading=true;
this.addForm.status = 2;
// let content= this.addForm.content.replace(/<.*?>/ig,"");
// let content= this.addForm.content.replace(/[^\u4E00-\u9FA5|\d|\a-zA-Z|\r\n\s,.?!,。?!<>…—&$=()-+/*{}[\]]|\r\n\s/g,"");
if(this.addForm.content.trim() == ''){
this.$message('您输入的内容为空,无法发布')
type: 'warning'
this.loading=false
return
}
this.addForm.content=this.addForm.content.trim()
apiArticle.save(this.addForm).then(res => {
if (res.status == 200) {
if(res.message=='服务处理成功'){

View File

@@ -41,7 +41,7 @@
</div>
</div>
<div class="article-info-date" v-if="item.enabled == true">
<div class="article-info-date">
<el-button class="edit" @click.stop="editItem(item.id)" type="text" icon="el-icon-edit">编辑</el-button>
<el-button class="del" @click.stop="delItem(item)" type="text" icon="el-icon-delete">删除</el-button>
</div>
@@ -78,12 +78,14 @@ export default {
}
};
},
filters:{
sysCreateTimeFilter(item){
return item.split(' ')[0]
}
},
mounted() {
console.log(this.items)
},
methods: {
classFilter(status){

View File

@@ -15,7 +15,7 @@
<router-link :to="'/case/detail?id='+item.cases.id" > {{item.cases.summary}}</router-link>
</div>
<div class="article-info-tools">
<authorInfo :avatar="item.avatar" :name="item.name" :info="item.orgInfo"></authorInfo>
<authorInfo :avatar="item.avatar" :name="item.name" :info="item.orgInfo" :sex="item.sex"></authorInfo>
<span style="margin-top:2px">发布时间{{ item.cases.sysCreateTime || item.publishTime | timeFilter }}</span>
<span style="margin-top:2px">收藏时间{{ item.time || item.favoritesTime | timeFilter }}</span>
<!-- <interactBar :type="0" :data="item.cases" :shares="false" :views="false"></interactBar> -->

View File

@@ -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;

View File

@@ -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 !== '') {

View File

@@ -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';
@@ -547,7 +547,7 @@
apiCourse.updateContentName({id:this.content.id,name:value}).then(rs=>{
if(rs.status!=200){
console.log('更新名称失败:'+rs.message);
}saveData
}
})
},
// 作业上传

View File

@@ -0,0 +1,143 @@
<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-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
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() {
console.log("2222");
if (this.teacherValues !== '') {
this.loading = true;
try {
const { result, message, status } = await apiTeacher.findByName(this.teacherValues);
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{
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>

View File

@@ -90,20 +90,22 @@
</el-form-item>
<el-form-item label="授课教师" required>
<!--授课老师默认是当前操作人-->
<el-select
<!-- <el-select
style="width: 100%;"
v-model="teacherValues"
multiple
filterable
remote
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>
</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>
@@ -233,20 +235,22 @@
</el-form-item>
<el-form-item label="授课教师" required>
<!--授课老师默认是当前操作人-->
<el-select
<!-- <el-select
style="width: 100%;"
v-model="teacherValues"
multiple
filterable
remote
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>
</el-select> -->
<choice :teacherValue="teacherValues" @getTeacherList="getTeacherList"></choice>
</el-form-item>
</el-col>
</el-form-item>
@@ -377,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';
@@ -394,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,
@@ -528,6 +533,9 @@ export default {
this.loadUserGroup();
},
methods: {
getTeacherList(res) {
this.teacherValues = res;
},
chooseFile(){
this.dlgFileChoose.show=true;
},
@@ -538,7 +546,6 @@ export default {
if(!img.path){
return;
}
//console.log(img);
this.dlgFileChoose.show=false;
this.courseInfo.coverImg = img.path;
this.courseCoverurl = this.fileUrl+img.path;
@@ -800,8 +807,8 @@ export default {
},
changeTeachers(t) {
//用于监听教师列表的选择变化
//console.log(t);
this.requireSaveCourse = true;
this.$refs.elSelect.query = '';
},
formartTeacher() {},
addNewSection() {
@@ -1205,7 +1212,8 @@ export default {
if (index == -1) {
this.contentInfo.list.push(cc);
} else {
this.contentInfo.list[index] = cc;
// this.contentInfo.list[index] = cc;
this.contentInfo.list.splice(index,1,cc);
}
//计算顺序值
},

View File

@@ -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";

View File

@@ -164,6 +164,7 @@ export default {
change(e) {
let file = e.target.files[0]
const formData = new FormData()
console.log(file,'file');
formData.append('file', file)
upload(formData)
.then(res => {
@@ -185,6 +186,12 @@ export default {
</script>
<style>
.editor{
min-height: 250px !important;
}
.ql-editor{
min-height: 250px !important;
}
.ql-container{
font-size: 15px;
}

View 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="getCoursewareList()" 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>

View File

@@ -1,5 +1,5 @@
<template><!--pdf连接分页处理-->
<div class="pdf-perView" id="pdf-perView">
<div class="pdf-perView" id="pdf-perView" v-loading="loading" element-loading-text="加载中">
<div class="pdf-box">
<transition name="progress">
<el-progress v-if="showProgress" :percentage="Math.floor(loadedRatio * 100)" :text-inside="true" :show-text="false"></el-progress>
@@ -26,23 +26,10 @@
@link-clicked="currentPage = $event">
</pdf> -->
</div>
<div v-if="totalPages>initNum" class="pdf-footer pagination-div" >
<!-- <el-button icon="el-icon-arrow-left" @click="prePage('footer')" :disabled="loadedRatio !== 1"></el-button>
<span v-if="loadedRatio !== 1" style="margin:0 10px;">0 / 0</span>
<span v-else style="margin:0 10px;">{{ currentPage }} / {{ pageCount }}</span>
<el-button @click="nextPage('footer')" :disabled="loadedRatio !== 1" icon="el-icon-arrow-right"></el-button> -->
<el-button type="primary" @click="clickMore()" v-if="moreState == 1">加载更多</el-button>
<div v-if="totalPages>initNum && moreState == 1" class="pagination-div" style="margin-bottom: 20px;">
<!-- <el-button type="primary" @click="clickMore()" >加载更多</el-button> -->
<span class="pag-text" @click="clickMore()" style="cursor: pointer;">加载更多</span>
</div>
<!-- <div v-if="likeBox" class="xcontent postfixt-bot">
<div class="postfixt-bot-box">
<div style="display:inline-block">
<interactBar :data="data" :type="3" :comments="false" :shares="true"></interactBar>
</div>
<div style="display:inline-block;margin: 0 20px;">
<el-button type="primary" @click="goTop()">返回顶部</el-button>
</div>
</div>
</div> -->
</div>
</template>
@@ -67,6 +54,7 @@ export default {
},
data() {
return {
loading:false,
src: "",
showPages: undefined,
totalPages:0,
@@ -82,6 +70,7 @@ export default {
mounted() {
// /case/demo.pdf
if(this.filePath){
this.loading = true;
this.loadInitPdf(this.filePath);
}
window.addEventListener(
@@ -132,6 +121,7 @@ export default {
let loadingTask = pdf.createLoadingTask(url);
this.src=loadingTask;
loadingTask.promise.then((pdf) =>{
this.loading = false;
this.totalPages=pdf.numPages;
if(pdf.numPages>this.initNum){
this.showPages = this.initNum;
@@ -139,6 +129,7 @@ export default {
this.showPages =pdf.numPages;
}
}).catch((err) =>{
this.loading = false;
this.$message.error("加载内容失败,请联系管理员");
});
},
@@ -160,15 +151,7 @@ export default {
if(this.isscroll){
this.showPages++
this.moreState = 2;
// this.debounce(this.loadInitPdf($this.filePath),5000);
// this.debounce(,200000);
}
// if(scrollTop > 400) {
// document.querySelector('#articleAnking').style.cssText = "position: fixed;top: 0;width:242.5px";
// } else {
// document.querySelector('#articleAnking').style.cssText = "position: static";
// }
},
debounce(func, wait) {// 非立即执行
let timeout;
@@ -254,7 +237,7 @@ export default {
//border: 1px solid #dfdfdf;
//background: #dfdfdf;
text-align: center;
line-height: 40px;
}
/* ------------------- 进度条 ------------------- */
//类名:隐藏到显示过程所需要的时间

View File

@@ -15,14 +15,11 @@
<div v-if="!onlyAvatar" style="padding-left: 5px;padding-top: 6px;font-size: 14px;color: #666666;">
<span>{{userName}}</span>
<span class="author-text" v-if="userInfo && userInfo!=''">({{userInfo}})</span>
</div>
</div>
</template>
<script>
import {
userAvatarText
} from "@/utils/tools.js";
import { userAvatarText } from "@/utils/tools.js";
export default {
props:{
avatar:{

View File

@@ -36,8 +36,7 @@
class="reference-tag"
v-for="item in toUsers"
:key="item.aid"
:label="item.aid">{{ item.name }}</el-radio-button
>
:label="item.aid">{{ item.name }}</el-radio-button>
</el-radio-group>
</div>
@@ -68,7 +67,7 @@
type="textarea"
class="hideControl"
show-word-limit
v-model.trim="inputValue"
v-model="inputValue"
maxlength="800"
placeholder="写下您的评论(800字以内),可以@案主哦~"
></el-input>
@@ -97,7 +96,7 @@
<div class="comment-body" >
<div class="comment-info" @mouseover="showButtons(com.id)" @mouseout="hideButtons()">
<div class="comment-content" @click="cancelReply()">
{{displayAll(com)}}
<span style="color: #303133" v-html="displayAll(com)"></span>
<span v-if="com.content.length>170" @click="changeIsAll(com)">
{{com.isAll?'收起':'全文'}}
</span>
@@ -138,7 +137,7 @@
<div class="comment-body" @mouseover="showButtons(reply.id)" @mouseout="hideButtons()">
<div class="comment-info" >
<div class="comment-content" @click="cancelReply()">
{{displayAll(reply)}}
<span style="color: #303133" v-html="displayAll(reply)"></span>
<span v-if="reply.content.length>170" @click="changeIsAll(reply)">
{{reply.isAll?'收起':'全文'}}
</span>
@@ -488,7 +487,7 @@
objType:this.objType,
objId:this.objId,
parentId:'-1',
content:this.inputValue,
content:this.inputValue.trim(),
clevel:1,
toAid:'',
toAname:'',
@@ -533,7 +532,9 @@
},
//展示全部
displayAll(item) {
//console.log(item,'item');
let content = '';
content = item.content.replace(/(\n){2,}/,'<br>');
item.content = content;
if(!item.isAll && item.content && item.content.length > 170) {
return item.content.slice(0, 170) + "...";
}
@@ -554,6 +555,7 @@
this.replyInfo.parentId='';
},
submitReply(comment){
this.replyInfo.content = this.replyInfo.content.trim();
if(this.replyInfo.content==''){
return;
}
@@ -660,6 +662,7 @@
this.replyShow=true;
},
submitDlgReply(){
this.replyInfo.content = this.replyInfo.content.trim();
if(this.replyInfo.content==''){
return;
}

View File

@@ -7,33 +7,33 @@
</div>
<div v-show="theme==1" class="interact-bar-btns" :style="{'justify-content':showAlign}">
<div v-if="answers" @click="addAnswers()" :style="`min-width: ${nodeWidth};`" class="interact-bar-btn" :class="{cursor:!readonly || clickAnswer}">
<el-tooltip effect="light" content="回答" placement="left">
<el-tooltip effect="light" content="回答" placement="left" :visible-arrow="false" popper-class="text-tooltip">
<!-- <svg-icon style="margin-right: 0;" icon-class="comment"></svg-icon> -->
<img style="width:16px;height:16px;vertical-align: middle;" :src="require('@/assets/images/icon/answers.png')">
</el-tooltip>
<span class="interact-bar-value"> {{ data.answers}}</span>
</div>
<div v-if="comments" class="interact-bar-btn" :style="`min-width: ${nodeWidth};`" :class="{cursor:!readonly}">
<el-tooltip effect="light" content="评论" placement="left">
<el-tooltip effect="light" content="评论" placement="left" :visible-arrow="false" popper-class="text-tooltip">
<svg-icon style="margin-right: 0;font-size: 16px;" icon-class="comment"></svg-icon>
</el-tooltip>
<span class="interact-bar-value"> {{data.comments}}</span>
</div>
<div v-if="shares" @click="addShare()" :style="`min-width: ${nodeWidth};`" class="interact-bar-btn" :class="{cursor:!readonly}">
<el-tooltip effect="light" content="分享" placement="top">
<el-tooltip effect="light" content="分享" placement="top" :visible-arrow="false" popper-class="text-tooltip">
<svg-icon icon-class="share" style="margin-right: 0;font-size: 16px;"></svg-icon>
</el-tooltip>
<span class="interact-bar-value"> {{data.shares}}</span>
</div>
<div v-if="praises" @click="addPraise()" :style="`min-width: ${nodeWidth};`" class="interact-bar-btn" :class="{cursor:!readonly}">
<el-tooltip effect="light" content="点赞" placement="top">
<el-tooltip effect="light" content="点赞" placement="top" :visible-arrow="false" popper-class="text-tooltip">
<svg-icon style="margin-right: 0;font-size: 20px;" :icon-class="isPraise?'praised':'like'"></svg-icon>
</el-tooltip>
<span class="interact-bar-value"> {{ data.praises}}</span>
</div>
<div v-if="favorites" @click="addFavorite()" :style="`min-width: ${nodeWidth};`" class="interact-bar-btn" :class="{cursor:!readonly}">
<el-tooltip effect="light" content="收藏" placement="top">
<el-tooltip effect="light" content="收藏" placement="top" :visible-arrow="false" popper-class="text-tooltip">
<svg-icon style="font-size: 16px;margin-right: 0;" :icon-class="isFavorite?'collected':'collection'"></svg-icon>
<!-- <svg-icon :icon-class="isFavorite?'collected':'dropdown_collected'"></svg-icon> -->
<!-- dropdown_collected -->
@@ -42,7 +42,7 @@
</div>
<div v-if="views" style="cursor: default;" :style="`min-width: ${nodeWidth};`" class="interact-bar-btn" :class="{cursor:!readonly}">
<el-tooltip effect="light" content="浏览量" placement="top">
<el-tooltip effect="light" content="浏览量" placement="top" :visible-arrow="false" popper-class="text-tooltip">
<svg-icon style="margin-right: 0;font-size:20.5px;" icon-class="eyes"></svg-icon>
</el-tooltip>
<span class="interact-bar-value"> {{ data.views}}</span>
@@ -181,10 +181,9 @@ export default {
this.isFavorite = newVal;
},
data(newVal,oldVal){
// console.log(newVal,'newVal');
// if(newVal && newVal.id!=''){
// this.checkHas();
// }
if(newVal && newVal.id!=''){
this.checkHas();
}
}
},
created(){
@@ -459,7 +458,6 @@ export default {
}
},
submitShare(){
if(this.shareUsers.length==0){
this.$message.error('请选择分享人');
return;
@@ -472,7 +470,7 @@ export default {
let postData={
objType:this.type,
objId:this.data.id,
content:'',
content:this.data.title,
isRead:false,
toAid:'',
toAname:'',

View File

@@ -7,7 +7,7 @@
<div style="display: flex;justify-content: space-around;margin-left: 20px;">
<div class="top-nav" :class="current == 'index' ? 'current-nav' : ''"><router-link to="/index">首页</router-link></div>
<div class="top-nav" :class="current == 'course' ? 'current-nav' : ''"><router-link to="/course">课程</router-link></div>
<div class="top-nav" v-if="caseShow" :class="current == 'case' ? 'current-nav' : ''"><router-link to="/case">案例</router-link></div>
<div class="top-nav" :class="current == 'case' ? 'current-nav' : ''"><router-link to="/case">案例</router-link></div>
<div class="top-nav" :class="current == 'article' ? 'current-nav' : ''"><router-link to="/article">文章</router-link></div>
<div class="top-nav" :class="current == 'qa' ? 'current-nav' : ''"><router-link to="/qa">问答</router-link></div>
<div class="top-nav">
@@ -26,10 +26,10 @@
</div>
<div style="display: flex;justify-content: flex-end;align-items: center;">
<div v-if="goSearch !=10">
<el-input v-show="!hideSearch" placeholder="请输入标题搜索" style="width: 260px;" @keyup.enter.native="searchJump()" clearable maxlength="20" v-model="keyword" class="input-with-select">
<el-input v-show="!hideSearch" placeholder="请输入标题搜索" style="width: 260px;" @keyup.enter.native="searchJump()" clearable maxlength="50" v-model="keyword" class="input-with-select">
<el-select v-if="current == 'index'" v-model="findType" style="width: 75px;" slot="prepend" placeholder="请选择">
<el-option label="课程" value="1"></el-option>
<el-option v-if="caseShow" label="案例" value="2"></el-option>
<el-option label="案例" value="2"></el-option>
<el-option label="文章" value="3"></el-option>
<el-option label="问答" value="4"></el-option>
<!-- <el-option label="专区" value="5"></el-option> -->
@@ -41,7 +41,7 @@
<div class="person-action" >
<!-- 消息 -->
<el-badge :value="userMsg" :hidden="userMsg == 0" class="message-count">
<el-tooltip content="消息" placement="bottom" effect="light">
<el-tooltip content="消息" placement="bottom" effect="light" :visible-arrow="false" popper-class="text-tooltip">
<el-link type="primary" :href="`${webBaseUrl}/message`" icon="el-icon-bell" :underline="false"></el-link>
</el-tooltip>
</el-badge>
@@ -51,39 +51,12 @@
<div v-else class="uavatar">
<div v-if="sex === 1 "><img src="../../public/images/Avatarman.png" alt=""></div>
<div v-else><img src="../../public/images/Avatarwoman.png" alt=""></div>
</div>
</a>
</div>
<el-link type="primary" style="margin-right:10px;" :href="`${webBaseUrl}${isTiao ? '/uc/study/task' : '/uc/study/courses'}`" :underline="false">个人中心</el-link>
<!-- <el-button @click="logout()" type="text" icon="el-icon-switch-button">退出</el-button> -->
<el-link type="primary" @click="logout()" icon="el-icon-switch-button" :underline="false">退出</el-link>
</div>
<!-- <div style="margin-left: 60px;margin-right: 30px"> -->
<!-- <el-badge :value="userMsg" :hidden="userMsg == 0" class="message-count"> -->
<!-- <el-link type="primary" :href="`${webBaseUrl}/message`" icon="el-icon-bell" :underline="false">消息</el-link> -->
<!-- <el-link type="primary" :href="`${webBaseUrl}/message`" icon="el-icon-bell" :underline="false"></el-link> -->
<!-- </el-badge> -->
<!-- </div> -->
<!-- <div style="margin-left: 20px;"><el-avatar :src="userInfo.avatar" style="vertical-align: middle;width:28px;height:28px;margin-right:2px;"></el-avatar></div> -->
<!-- <div style="margin-left: 5px;"> -->
<!-- <el-dropdown @command="handleUcCommand">
<span class="el-dropdown-link">
{{ userInfo.name }}
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="uc">个人中心</el-dropdown-item>
<el-dropdown-item command="logout" divided>退出</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
<!--管理员-->
<!-- <el-link type="primary" :href="`${webBaseUrl}/course/manage`" :underline="false">个人中心</el-link> -->
<!--学员-->
<!-- <el-link type="primary" :href="`${webBaseUrl}${isTiao ? '/uc/study/task' : '/uc/study/courses'}`" :underline="false">个人中心</el-link> -->
<!-- </div> -->
<!-- <div style="margin-left: 20px;"><el-button @click="logout()" type="text" icon="el-icon-switch-button">退出</el-button></div> -->
</div>
</div>
</div>
@@ -113,7 +86,7 @@ export default {
},
computed: {
...mapGetters(['userInfo', 'userMsg','caseShow']),
...mapGetters(['userInfo', 'userMsg']),
avatarText(){
return userAvatarText(this.userInfo.name);
@@ -145,14 +118,11 @@ export default {
// cmtask_name:this.cmtask_name,
};
apiBoeCourse.cmtaskList(params).then(res => {
if (res.result.count > 0) {
if (res.status == 200 && res.result.count > 0) {
this.isTiao = true;
// this.$router.push('/uc/study/task');// 学习任务
} else {
this.isTiao = false;
// this.$router.push('/uc/study/courses')// 自主学习
}
// this.pageData.list = res.result.list;
});
},
handleCommand(val) {
@@ -356,20 +326,15 @@ export default {
border-radius: 50%;
img{
border-radius: 50%;
width: 40px;
height: 40px;
}
}
// border: 1px solid #73adfe;
// color: #73adfe;
// text-align: center;
width: 40px;
height: 40px;
line-height: 40px;
font-size: 14px;
margin-right: 8px;
border-radius: 50%;
// background: #d9e9ff;
}
</style>

View File

@@ -4,7 +4,7 @@
<el-form-item label="回答内容">
<el-input
type="textarea"
v-model.trim="editData.content"
v-model="editData.content"
placeholder="请输入详细描述"
rows="8"
minlength="1"
@@ -45,6 +45,7 @@
type: 'warning'
});
}
this.editData.content = this.editData.content.trim();
// if(this.editData.content.length<0||this.editData.content.length>255){
// return this.$message({
// message: '回复内容为0-800个字',

View File

@@ -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) {

View File

@@ -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='京东方科技集团股份有限公司/北京中祥英科技有限公司/技术中心';

View File

@@ -54,7 +54,6 @@
<span slot="title" class="textl">课件管理</span>
</el-menu-item>
</el-submenu>
<el-submenu index="exam" v-show="curIdentity == 3">
<template slot="title">
<svg-icon icon-class="exam" style="font-size:14px"></svg-icon>
@@ -96,10 +95,8 @@
</el-menu-item>
<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>
@@ -320,7 +317,7 @@
<span v-if="lastStudy.contentType=='face-course'" class="course-type-title course-type">线下课</span>
<span v-if="lastStudy.contentType=='project'" class="course-type-title course-type">学习项目</span>
</div>
<el-tooltip :content="lastStudy.courseName" placement="bottom-start" effect="light">
<el-tooltip :content="lastStudy.courseName" placement="bottom-start" effect="light" :visible-arrow="false" popper-class="text-tooltip">
<div class="course-title two-line-ellipsis">{{lastStudy.courseName}}
</div>
</el-tooltip>
@@ -345,6 +342,9 @@ export default {
activeMenu() {
const route = this.$route;
const { meta, path } = route;
if(meta.title == '添加受众' || meta.title == '查看受众'){
meta.activeMenu = '/manage/ugroups'
}
if (meta.activeMenu) {
return meta.activeMenu;
}

View File

@@ -9,7 +9,7 @@
<div class="xtop-nav">
<div><a :href="`${webBaseUrl}/index`">首页</a></div>
<div><a :href="`${webBaseUrl}/course`">课程</a></div>
<div v-if="caseShow"><a :href="`${webBaseUrl}/case`">案例</a></div>
<div><a :href="`${webBaseUrl}/case`">案例</a></div>
<div><a :href="`${webBaseUrl}/article`">文章</a></div>
<div><a :href="`${webBaseUrl}/qa`">问答</a></div>
<div>
@@ -79,32 +79,15 @@
<el-button type="primary" @click="submitPwd">提交修改</el-button>
</span>
</el-dialog>
<el-dialog
class="dialog-signin"
:show-close="false"
:visible.sync="signInShow"
:close-on-click-modal="false"
width="30%">
<!-- <span>这是一段信息</span> -->
<div style="background-color: #99beff;padding-bottom: 20px;">
<div class="signin-bg">
<img style="width:100%" :src="`${this.webBaseUrl}/images/newtip/bg.png`" alt="" srcset="">
<i @click="toExperience()" class="el-icon-close" style="cursor: pointer;"></i>
</div>
<!-- <div class="signin-box">
<p class="signin-text"><span>更多彩蛋</span> <span class="ti-yan" @click="toExperience()">即刻体验>>> </span></p>
<p class="signin-a"><span><a href="https://u.boe.com/upload/video/originfile/50/50d84b41d7e4c29b20e73215b5117fb5.mp4" target="_blank">点击小视频了解更多</a></span></p>
<p class="signin-b"><el-checkbox v-model="checked"></el-checkbox> <span>一天之内不再提示</span></p>
</div> -->
<div class="signin-box2">
<div class="signin-checkbox"><el-checkbox v-model="checked"></el-checkbox>一天之内不再提示</div>
<!-- <div class="signin-text" @click="toExperience()">点击小视频了解更多</div> -->
</div>
</div>
<div slot="footer" class="dialog-footer dialog-footer-signin">
<!-- <el-checkbox v-model="checked">一天之内不在提示</el-checkbox> -->
<!-- <el-button type="primary" @click="toExperience()">去体验</el-button> -->
<el-dialog custom-class="dialog-signin" :show-close="false" :visible.sync="signInShow" :close-on-click-modal="false" width="520px" top="8vh">
<div>
<img usemap="#HotMap" src="/pc/ad/dlg.png" style="width:416px;height: 576px;">
<map name="HotMap" id="HotMap">
<area shape="circle" name="link1" coords="380,40,30" @click="closeSignDlg" href="javascript:;" />
<area shape="rectangle" name="link2" coords="150,400,300,500" target="_blank" href="https://boehrsurvey.wjx.cn/vm/PmreuFN.aspx" />
</map>
</div>
</el-dialog>
</div>
</template>
@@ -118,23 +101,19 @@ export default {
return {
checked:true,
signInShow: false,
signLocalTimesKey:'xboe_sign_dlg_times',
keyword: '',
findType: '1',
mouseIndex: 0,
activeIndex: '',
oneSignIn:'boe_new',
msg: {
num: 0
},
user: {
name: ''
},
msg: { num: 0 },
user: { name: '' },
pwdDlg: { show: false, newPwd: '', nowPwd: '', rePwd: '' },
current:1
};
},
computed: {
...mapGetters(['userInfo', 'userMsg','caseShow']),
...mapGetters(['userInfo', 'userMsg']),
showName: function() {
//console.log('name='+this.name);
//console.log('loginName='+this.loginName);
@@ -146,48 +125,51 @@ export default {
}
},
mounted() {
if(this.getCookies() == null) {
this.signInShow = true;
//控制弹出窗口的代码
let now = new Date() //当前时间
let end = new Date('2022/08/14 00:00:00') //对比时间
if(now.getTime() < end.getTime()){
let times = localStorage.getItem(this.signLocalTimesKey);
let isNewLogin=localStorage.getItem(this.$Constants.newLoginKey);
//let isNewLogin='1';
if(isNewLogin && isNewLogin=='1'){
if(!times){
this.signInShow = true;//显示
localStorage.setItem(this.signLocalTimesKey,1);
}else{
let intTimes=parseInt(times);
if(intTimes<2){
this.signInShow = true;//显示
intTimes++;
localStorage.setItem(this.signLocalTimesKey,intTimes);
}
}
localStorage.setItem(this.$Constants.newLoginKey,0);
}
}
this.$store.dispatch('refrashMsg');
},
methods: {
getCookies() {
return Cookies.get(this.oneSignIn)
closeSignDlg(){
this.signInShow=false;
},
setCookies(token,expiresTime) {
//console.log(token,expiresTime,'token,expiresTime');
return Cookies.set(this.oneSignIn, token,expiresTime)
},
removeCookies(){
return Cookies.remove(this.oneSignIn)
},
toExperience() {
this.signInShow = false;
if(this.checked) {
this.setCookies('new',60*60*24)
} else {
this.removeCookies();
}
},
// searchJump() {
// if(this.findType == '1') {// 课程
// window.open(`/course?keyword=${this.keyword}`);
// } else if(this.findType == '2'){ // 案例
// window.open(`/case?keyword=${this.keyword}`);
// } else if(this.findType == '3'){ //文章
// window.open(`/article?keyword=${this.keyword}`);
// } else if(this.findType == '4'){ // 问答
// window.open(`/qa?keyword=${this.keyword}`);
// }
// },
handleCommand(val) {
// let obj = {
// one: process.env.VUE_APP_BOE_WEB_URL+'/web/teacherLesson',
// two: process.env.VUE_APP_BOE_WEB_URL+'/grow180/login',
// three: this.webBaseUrl + '/study/index',
// four: 'https://m.qingxuetang.com/x/?appId=qxtcorp306130',
// five: process.env.VUE_APP_BOE_WEB_URL+'/boe/new-employee/index.html'
// };
let urlPre=window.location.protocol+'//'+window.location.host;
// process.env.VUE_APP_BOE_WEB_URL
let obj = {
one: process.env.VUE_APP_BOE_WEB_URL+'/web/teacherLesson',
two: process.env.VUE_APP_BOE_WEB_URL+'/grow180/login',
three: this.webBaseUrl + '/study/index',
one: urlPre+'/web/teacherLesson',
two: urlPre+'/grow180/login',
three: this.webBaseUrl + '/study/index?study=1',
four: 'https://m.qingxuetang.com/x/?appId=qxtcorp306130',
five: process.env.VUE_APP_BOE_WEB_URL+'/boe/new-employee/index.html'
five: urlPre+'/boe/new-employee/index.html'
};
window.open(obj[val]);
},
@@ -238,6 +220,8 @@ export default {
<style lang="scss" scoped>
::v-deep .dialog-signin{
background: transparent;
box-shadow:none;
.el-dialog__header{
padding: 0;
}

View File

@@ -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()
}

View File

@@ -7,7 +7,6 @@ const getters = {
cachedViews: state => state.tagsView.cachedViews,
avatar: state => state.user.info.avatar,
userInfo: state => state.user.info,
caseShow: state => state.user.caseShow,
newslist: state => state.user.newslist,
orgId: state => state.user.orgId,
permissions: state => state.user.permissions,
@@ -17,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,

View File

@@ -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();
})
}
}

View File

@@ -5,7 +5,6 @@ import apiMessage from '@/api/system/message.js'
import apiCourse from "@/api/modules/course.js";
import apiBoeCourse from "@/api/boe/course.js";
import apiBoeLogout from "@/api/boe/login.js";
import caseUser from "@/utils/caseShow.js"
const user = {
state: {
@@ -16,7 +15,6 @@ const user = {
studyTaskCount:0,//学习任务数
curIdentity: sessionStorage.getItem("curIdentity") == null ? 1 : sessionStorage.getItem("curIdentity"), // 用户当前选择的身份 1学员 2教师 3管理员
permissions: [],
caseShow:false,
},
mutations: {
SET_Identity: (state, iden) => {
@@ -41,9 +39,6 @@ const user = {
SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions
},
SET_caseShow:(state, iden) => {
state.caseShow = iden
},
},
actions: {
refrashMsg({ commit }) {
@@ -133,13 +128,6 @@ const user = {
dfn = res.result.departFullName;
}
}
if (res.result.userNo != '') {
for(let key in caseUser){
if(res.result.userNo == key) {
commit('SET_caseShow',true);
}
}
}
const user = {
aid: res.result.aid,
sysId:res.result.sysId,

View File

@@ -1,16 +0,0 @@
/**页面设置的一些常量*/
const caseUser={
'00004409': '李玉冰',
'101215': '徐涛',
'00005011': '邱炜玮',
'107863': '苗怡',
'00004928': '夏辉',
'110858': '毛继禹',
'10726944': '王芮',
'boeutest': '测试小助手',
'boeuadmin': '运营小助手',
'10181457': '董瑞华',
}
export default caseUser;

View File

@@ -1,6 +1,7 @@
/**页面设置的一些常量*/
const constants={
fileBaseUrl:'http://127.0.0.1/pc/cdn/upload'
fileBaseUrl:'http://127.0.0.1/pc/cdn/upload',
newLoginKey:'boe_new_login'
}
export default constants

View File

@@ -31,9 +31,9 @@
<el-image class="course-image" style="height: 130px;" :src="this.webBaseUrl+'/ad/index_course.png'" fit="fit"></el-image>
<span class="course-type">录播课</span>
</div>
<el-tooltip class="item" content="高效谈判系列课" placement="bottom" effect="light">
<div class="course-title one-line-ellipsis">高效谈判系列课</div>
</el-tooltip>
<!-- <el-tooltip class="item" content="高效谈判系列课" placement="bottom" effect="light" :visible-arrow="false" popper-class="text-tooltip"> -->
<div title="高效谈判系列课" class="course-title one-line-ellipsis">高效谈判系列课</div>
<!-- </el-tooltip> -->
<div class="course-author">
<div class="course-author-left" > </div>
<div style="flex:1; text-align: center; ">
@@ -62,9 +62,9 @@
<span v-if="course.type == 20 || 10" class="course-type">录播课</span>
</div>
<el-tooltip class="item" :content="course.name" placement="bottom" effect="light">
<div class="course-title one-line-ellipsis" >{{ course.name }}</div>
</el-tooltip>
<!-- <el-tooltip class="item" :content="course.name" placement="bottom" effect="light" :visible-arrow="false" popper-class="text-tooltip"> -->
<div :title="course.name" class="course-title one-line-ellipsis" >{{ course.name }}</div>
<!-- </el-tooltip> -->
<div class="course-author">
<!-- <div class="course-author-left"><authorInfo :avatar="course.authorInfo.avatar" :name="course.authorInfo.name"></authorInfo></div> -->
@@ -107,7 +107,7 @@
</div>
</div>
<!-- 推荐案例2版 -->
<div class="modules" v-if="caseShow">
<div class="modules">
<div class="modules-title">
<span class="modules-text">推荐案例</span>
@@ -117,7 +117,7 @@
</span>
<span class="more"><router-link to="/case">更多&nbsp;></router-link></span>
</div>
<div class="modules-list xrow" style="height: 235px;overflow: hidden;">
<div class="modules-list xrow" style="height: 255px;overflow: hidden;">
<div class="index-course xrow-course" v-for="ca in caseList.list" :key="ca.id">
<div class="casetwo" :body-style="{ padding: '0px' }">
<!-- <div class="case-top"></div> -->
@@ -126,9 +126,12 @@
{{ca.sysCreateTime.substring(0,10)}}
</div> -->
<a :href="'case/detail?id='+ca.id" >
<span class="case-title one-line-ellipsis">
<!-- <el-tooltip class="item" :content="ca.title" placement="bottom" effect="light" :visible-arrow="false" popper-class="text-tooltip"> -->
<span :title="ca.title" class="case-title one-line-ellipsis">
{{ca.title}}
</span>
<!-- </el-tooltip> -->
<div class="case-text three-line-ellipsis">
{{ca.summary}}
</div>
@@ -136,7 +139,7 @@
<div class="case-inter">
<interactBar :type="3" :readonly="true" :data="ca" :shares="false" :views="false"></interactBar>
</div>
<div style="height:40px;margin-top:10px">
<div class="case-orginfo" style="margin-top:18px">
<authorInfo :avatar="ca.authorInfo.avatar" :info="ca.authorInfo.orgInfo" :name="ca.authorInfo.name" :sex="ca.authorInfo.sex"></authorInfo></div>
</div>
</div>
@@ -336,7 +339,7 @@ export default {
name: 'index',
components: { portalHeader,ad, portalFooter, articleImage, portalFloatTools, authorInfo, interactRowBar, interactBar, courseImage },
computed: {
...mapGetters(['userInfo','caseShow'])
...mapGetters(['userInfo'])
},
data() {
return {
@@ -369,7 +372,6 @@ export default {
};
},
mounted() {
//console.log(this.$Constants.fileBaseUrl,'fileBaseUrl地址');
this.getCourseData(1);
this.getCaseData();
this.getArticleData();
@@ -380,7 +382,6 @@ export default {
window.open('https://m.qingxuetang.com/x/?appId=qxtcorp306130','_blank');
},
toCourseDetail(item) {
if (item.type == 10) {
return this.webBaseUrl + '/course/micro?id=' + item.id;
} else if (item.type == 20) {
@@ -579,6 +580,9 @@ export default {
userIds.push(courseTeahcer.teacherIds[0]);
item.authorInfo.aid = courseTeahcer.teacherIds[0];
item.authorInfo.name = courseTeahcer.names[0];
if(item.authorInfo.name=='BOE教师'){
item.authorInfo.name='';
}
}
return true;
} else {
@@ -648,6 +652,10 @@ export default {
</script>
<style scoped lang="scss">
.case-orginfo{
// line-height: 25px;
height: 45px;
}
.three-line-ellipsis {
overflow: hidden;
text-overflow: ellipsis;
@@ -660,7 +668,7 @@ export default {
.casetwo{
border: 1px solid #F0F0F0;
width: 100%;
height: 220px;
height: 245px;
margin-bottom:15px;
position: relative;
background-color: #fff;
@@ -671,12 +679,9 @@ export default {
.case-conent{
width: 100%;
height: 100%;
// box-shadow: 1px 1px 15px #ccc;
// position: absolute;
// top: 5%;
background-color: #fff;
// left: 4%;
padding: 16px;
padding: 15px;
.case-time{
font-size: 12px;
color: #999999;
@@ -684,17 +689,18 @@ export default {
}
.case-title{
margin-top: 10px;
font-size: 16px;
font-size: 20px;
color: #333;
font-weight: bold;
margin-bottom:10px;
margin-bottom:8px;
}
.case-text{
height: 55px;
height: 57px;
font-size: 14px;
overflow: hidden;
color: #888888;
line-height: 18px;
margin-bottom:12px;
// line-height: 18px;
margin-bottom:8px;
}
::v-deep .case-inter{
width: 100%;

View File

@@ -41,6 +41,7 @@
apiLogin.boeLogin(this.curToken).then(rs=>{
if(rs.status==200){
//setToken(rs.result.access_token);
localStorage.setItem(this.$Constants.newLoginKey,1);
if(this.toUrl){
location.href=this.toUrl;
}else{

View File

@@ -37,7 +37,7 @@
import loginApi from "@/api/login";
export default {
computed: {
...mapGetters(['portalLoginRememberMe'])
...mapGetters(['portalLoginRememberMe','portalBackUrl'])
},
data(){
return {
@@ -99,6 +99,7 @@
this.$store.dispatch("Login", this.form).then(rs => {
if(rs.status == 200){
// 记住密码
localStorage.setItem(this.$Constants.newLoginKey,1);
if(this.rememberMe){
let rememberMeOjb = {rememberMe:true,loginName:this.form.loginName,password:this.form.password};
this.$store.dispatch("portal/SetLoginRememberMe", rememberMeOjb)

View File

@@ -96,8 +96,8 @@ export default {
},
saveSuccess(data){
this.diagSync=false;
this.articleList.pageIndex = 1;
this.articleList.list = [];
this.pageData.pageIndex = 1;
this.pageData.list = [];
this.getArticleList();
},
//获取文章列表数据

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 } });
}
},
@@ -192,6 +190,7 @@ export default {
reset(){
this.dataList.pageIndex = 1;
this.dataList.send = '',
this.dataList.type = '',
this.type = 0;
this.getData();
this.isSearh = false;

View File

@@ -351,7 +351,7 @@ export default {
};
},
viewTopic(data) {
window.open(this.webBaseUrl+'/case/detail?id='+data.id, '_blank');
this.$router.push({path:'/case/detail',query:{id:data.id}})
}
}
};

View File

@@ -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({

View File

@@ -203,8 +203,8 @@
<el-dialog title="二维码" center :visible.sync="qrcodeShow" @close="closeCode" width="500px">
<div style="height:250px;display: flex;flex-direction:column;justify-content: space-evenly;align-items: center;">
<div id="qrcode" ref="qrcode"></div>
<el-input v-model="qrcode"></el-input>
<el-button type="primary" size="mini">复制链接</el-button>
<el-input v-model="pcDetailUrl" id="text"></el-input>
<el-button type="primary" size="mini" @click="myCopy()">复制链接</el-button>
</div>
<span slot="footer" class="dialog-footer">
@@ -330,6 +330,7 @@ export default {
manageStudyData: {},
expandDetails: true,
qrcode: '',
pcDetailUrl:'',
isExamine: 1,
auditInfo: {
pass: true,
@@ -397,6 +398,11 @@ export default {
},
methods: {
myCopy(){
var ele = document.getElementById("text");
ele.select();
document.execCommand("Copy");
},
inputOn() {
this.$forceUpdate();
},
@@ -663,9 +669,16 @@ export default {
this.qrcodeShow = true;
let urlPre=window.location.protocol+'//'+window.location.host;
this.qrcode = urlPre+'/mobile/pages/resource/microDetail?id='+row.id;
//动态的地址
//urlPre=urlPre+'/m?returnUrl='+urlPre+'/mobile/pages/login/loading?returnUrl=';
//固定的地址
let mobilePre='https://u.boe.com/m?returnUrl=https://u.boe.com/mobile/pages/login/loading?returnUrl=';
this.qrcode = mobilePre+'/pages/resource/microDetail?id='+row.id;
this.pcDetailUrl=urlPre+this.webBaseUrl+'/course/micro?id='+row.id;
if(row.type==20){
this.qrcode = urlPre+'/mobile/pages/resource/courseDetail?id='+row.id;
this.qrcode = mobilePre+'/pages/resource/courseDetail?id='+row.id;
this.pcDetailUrl=urlPre+this.webBaseUrl+'/course/detail?id='+row.id;
}
// 使用$nextTick确保数据渲染

View File

@@ -173,7 +173,7 @@
</div>
</div>
</div>
<div style="border-top: 1px solid #eee; background-color: #eee; padding: 10px 20px;margin-top: 10px;">
<div v-if="audit.length > 0" style="border-top: 1px solid #eee; background-color: #eee; padding: 10px 20px;margin-top: 10px;">
<div style="line-height: 36px;">
<div style="display:flex;">
<div style="flex:1;"><span class="audit-text">邀请人</span>{{audit.sysCreateBy}}</div>
@@ -444,7 +444,9 @@ export default {
this.dialogVisible = true;
apiCourse.getAuditInfo({courseId:row.id}).then(res=>{
if(res.status == 200) {
if(res.result.length > 0) {
this.audit = res.result[0];
}
} else {
this.$message.error(res.message);
}

View File

@@ -713,7 +713,7 @@ export default {
isEdit: false,
viewUserPapereShow: false,
viewResultsShow: false,
params: { pageIndex: 1, pageSize: 10 },
params: {published:null,keyWord:'', pageIndex: 1, pageSize: 10 },
// data: resourceAttribution,
pageData: {
list: [],
@@ -1057,7 +1057,9 @@ export default {
this.$refs.qrcode.innerHTML = ''
},
viewExamInfo(data) {
this.examInfoShow = true
if(this.questDirOptions.length==0){
this.findPapers();
}
apiTest.detail(data.id).then(res=>{
if (res.status === 200) {
this.detailInfo = res.result;
@@ -1065,6 +1067,7 @@ export default {
this.$message.error(res.message);
}
})
this.examInfoShow = true
},
loadData() {
this.params.resOwner1 = this.ownership[0]

View File

@@ -28,12 +28,12 @@
placeholder="题干"
clearable></el-input>
</el-col>
<el-col :span="14">
<el-col :span="17" style="display:flex;justify-content: space-between;">
<div style="flex: 1;">
<el-button type="primary" @click="getsearch(1)" style="margin-left: 20px" icon="el-icon-search" >搜索</el-button>
<el-button icon="el-icon-refresh-right" type="primary" @click="reset"> 重置 </el-button>
<el-button type="primary" @click="addQuestion(1)" style="margin-left: 10px" icon="el-icon-plus"> 添加 </el-button>
<div style="display: inline-block;margin-left: 10px;">
<file-upload
dir="files"
text="导入"
@@ -45,6 +45,8 @@
@remove="removeFile" >
</file-upload>
</div>
</div>
<div style="display: inline-block;margin-top: 10px;"><el-link @click="downloadTemplate">下载模板文件</el-link></div>
</el-col>
</el-row>
</el-header>
@@ -380,6 +382,18 @@ export default {
});
},
methods: {
downloadTemplate(){
let fileName = "试题导入模板.xls";
let link = document.createElement('a'); //创建a标签
link.style.display = 'none'; //使其隐藏
link.download = this.webBaseUrl+'/template/test-question-template.xls';
link.setAttribute('target', '_blank');
link.href = this.webBaseUrl+'/template/test-question-template.xls'; //赋予文件下载地址
link.setAttribute('download', fileName); //设置下载属性 以及文件名
document.body.appendChild(link); //a标签插至页面中
link.click(); //强制触发a标签事件
document.body.removeChild(link);
},
uploadFile(file) {
this.loadData(1);
setTimeout(this.$message.warning('请耐心等待片刻,正在导入'), 2000 );

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('加载考试记录失败');
}
})
@@ -498,7 +509,7 @@ export default {
data.arrange = this.testPaper.arrange;
data.passLine = this.testPaper.passLine;
data.ucode = this.userInfo.userNo;
data.paperJson = JSON.stringify(this.paperQuestion);
data.paperJson = this.clearPagerJson();
data.answerJson=strAnswer;
data.totalScore=total;
//计算出当前的成绩
@@ -513,6 +524,20 @@ export default {
}
})
},
clearPagerJson(){
let paperJson = [];
this.paperQuestion.forEach((item,index) => {
let option = {
id:item.id,
optionList:[]
};
item.optionList.forEach(it=>{
option.optionList.push({id:it.id})
})
paperJson.push(option);
})
return JSON.stringify(paperJson);
},
countScore(){
let total=0;
if(this.judge.length > 0){
@@ -673,7 +698,9 @@ export default {
stopReckon:function(){
window.clearInterval(this.reckonTimeer)
},
// 开始提交答案
/**
* 开始提交答案
*/
startUpdateAnswer:function(){
if(this.paperQuestion.length==0){
return;
@@ -684,7 +711,7 @@ export default {
let that = this;
this.updateAnswerTimeer =window.setInterval(function(){
that.updateAnswer();
},60000);//测试时可以修改的变小了
},10000);//测试时可以修改的变小了
},
// 停止提交答案
stopUpdateAnswer(){

View File

@@ -170,7 +170,7 @@
</div>
</div>
<div class="paper-box">
<div v-for="(item, idx) in paper.data" :key="idx">
<div v-if="paper.data.length>0" v-for="(item,idx) in paper.data" :key="idx">
<div v-if="item.type < 900">
<div style="display: flex;justify-content: space-between;background-color: #dcf1ff;padding: 5px;">
<div>
@@ -182,10 +182,8 @@
<!-- <span style="padding-left: 5px;">知识点[{{item.analysis}}]</span> -->
</div>
<div>
<el-input style="width: 120px;" size="mini" v-model="item.defaultScore" placeholder="分数" @blur="paperCalculation()">
<template slot="append">
</template>
<el-input @input="changeInput($event)" v-model="item.defaultScore" style="width: 120px;" size="mini" placeholder="分数" @blur="paperCalculation()">
<template slot="append"></template>
</el-input>
<el-button icon="el-icon-delete" @click="checkDelete(idx)" size="mini"></el-button>
</div>
@@ -341,7 +339,7 @@ export default {
value: [1, 4],
type: '',
defaultProps: { children: 'children', label: 'label' },
params: {pageIndex:1,pageSize: 10 },
params: {keyWord:'',pageIndex:1,pageSize: 10 },
typeList: [],
pageData: {
count: 0,
@@ -413,6 +411,9 @@ export default {
// }
},
methods: {
changeInput(e){
this.$forceUpdate();
},
currentChange(val) {
this.qlib.pageIndex = val;
this.questionList();
@@ -459,7 +460,7 @@ export default {
this.qlib.type= '';
this.qlib.title= '';
this.paperLength=0;
this.question.all =
this.question.all = false;
this.question.list =[];
this.question.checkQuest = [];
},
@@ -725,6 +726,11 @@ export default {
</script>
<style lang="scss" scoped>
.el-input{
.el-input__inner{
padding: 0px 5px;
}
}
.test-input {
width: 60px;
margin: 0 5px;

View File

@@ -69,7 +69,7 @@
</span>
</el-dialog>
<el-dialog center custom-class="g-dialog" title="导入人员数据" :close-on-click-modal="false" :visible.sync="importUserShow">
<div style="padding: 10px 0px;color: #009ae7; ">单个导入文件受众成员请勿超过200条记录以员工号为准必须是本系统人员</div>
<div style="padding: 10px 0px;color: #009ae7; ">单个导入文件受众成员请勿超过5000条记录以员工号为准必须是本系统人员</div>
<el-row type="flex" align="middle" justify="start" style="margin-bottom: 10px;">
文件名称<el-input style="width: 200px;" disabled v-model="selectFile"></el-input>
<el-upload

View File

@@ -146,6 +146,7 @@
},
viewDetail(row){
this.$router.push({path:'/manage/viewugroup', query: {id: row.id}})
// this.$router.push({path:'/manage/addaudiences', query: {id: row.id}})
},
jumpRouter(type){
if(type==1){

View File

@@ -25,9 +25,10 @@
</div> -->
<!-- <div class="case-summary"><span>{{ caseDetail.summary }}</span></div> -->
<div class="btn-div clearfix" >
<div style="color:#666" v-if="caseDetail.orgDomain" class="item">{{ orgDomainTranslate(caseDetail.orgDomain) }}</div>
<div style="color:#666" class="item" v-if="caseDetail.orgDomain == '' && caseDetail.orgDomainParent">{{ orgDomainTranslate(caseDetail.orgDomainParent) }}</div>
<div style="color:#666" v-if="caseDetail.majorType" class="item">{{ majorTypeTranslate(caseDetail.majorType) }}</div>
<div style="color:#2974D6;font-weight: 450;" v-if="caseDetail.orgDomain" class="item">{{ orgDomainTranslate(caseDetail.orgDomain) }}</div>
<div style="color:#2974D6;font-weight: 450;" class="item" v-if="caseDetail.orgDomain == '' && caseDetail.orgDomainParent">{{ orgDomainTranslate(caseDetail.orgDomainParent) }}</div>
<!-- <div style="color:#2974D6;font-weight: 450;" v-if="caseDetail.majorType" class="item">{{ majorTypeTranslate(caseDetail.majorType) }}</div> -->
<div class="item" style="color:#2974D6;font-weight: 450;" v-for="item,idx in caseDetail.majorType" :key="idx" >{{ majorTypeTranslate(item) }}</div>
<div v-if="caseDetail.keyword1" class="item">{{ caseDetail.keyword1 }}</div>
<div v-if="caseDetail.keyword2" class="item">{{ caseDetail.keyword2 }}</div>
<div v-if="caseDetail.keyword3" class="item">{{ caseDetail.keyword3 }}</div>
@@ -43,12 +44,28 @@
<interactBar :data="caseDetail" :type="3" :comments="false" :shares="true" :unicom="true"></interactBar>
</div>
</el-card>
<el-card :body-style="{ padding: '0px' }" class="jianjie" id="pdfPreview">
<el-card v-if="Internet == 1" :body-style="{ padding: '0px' }" class="jianjie" id="pdfPreview">
<!-- <div class="content">
{{ caseDetail.content }}
</div> -->
<pdfPreview v-if="pdfPath" :filePath="pdfPath"></pdfPreview>
</el-card>
<el-card v-if="Internet == 2" style="background-color:#eee" class="jianjie pdftext" id="pdfPreview">
<div style="margin-top:40px">
<span>十分抱歉您当前的网络环境不符合观看要求<br/>
为了保障案例信息的安全您需要接入公司内网才能观看</span>
</div>
<div style="margin-top:20px" @click="retest">
<el-button type="primary">重新检测</el-button>
</div>
</el-card>
<el-card v-else-if="Internet == 3" style="background-color:#eee" class="jianjie pdftext" id="pdfPreview">
<div style="margin-top:40px">
<span>网络安全检测中...</span>
</div>
</el-card>
<div class="postfixt-bot">
<div class="postfixt-bot-box" id="pdfTopBox">
<div style="display: flex;justify-content: space-between;">
@@ -82,14 +99,12 @@
<div style="width: 245px;margin-left: 5px;" :class="zoomShow?'':'fixd-box-show'">
<div>
<div id="fixd-box">
<el-card class="ranking-card" >
<!-- <el-card class="ranking-card" >
<div slot="header">
<span style="font-size: 14px;font-weight: 600;color: #333333;">贡献榜</span>
</div>
<div style="padding-bottom:10px">
<el-row class="ranking-title">
<!-- <el-col :span="15" style="color: #333333;font-size: 14px;">名称</el-col> -->
<!-- <el-col :offset="4" :span="5" class="center" style="color: #333333;font-size: 14px;">分数</el-col> -->
</el-row>
<el-row class="ranking-title bacolor" v-for="(item, index) in ankingList" :key="index" >
<el-col :span="6" style="height:34px">
@@ -98,14 +113,11 @@
<img v-if="index===2" :src="`${webBaseUrl}/images/third.png`"/>
<span style="margin-left: 10px" v-if="index!=2&&index!=0&&index!=1">{{index+1}}</span>
</el-col>
<el-tooltip :enterable="false" effect="light" :content="item.sysCreateUname" placement="bottom" :visible-arrow="false" popper-class="text-tooltip">
<el-col :span="15" class="title-line-ellipsis"> {{ item.sysCreateUname }}</el-col>
</el-tooltip>
<!-- <el-col class="center" style="color: #FF8E00;" :span="5">{{ item.score }}</el-col> -->
</el-row>
</div>
</el-card>
<div style="height: 10px;"></div>
</el-card> -->
<!-- <div style="height: 10px;"></div> -->
<el-card class="ranking-card" >
<div slot="header">
<span style="font-size: 14px;font-weight: 600;color: #333333;">人气榜</span>
@@ -120,11 +132,15 @@
<img v-if="index===0" :src="`${webBaseUrl}/images/first.png`"/>
<img v-if="index===1" :src="`${webBaseUrl}/images/second.png`"/>
<img v-if="index===2" :src="`${webBaseUrl}/images/third.png`"/>
<div v-if="item.title">
<span style="margin-left: 10px" v-if="index!=2&&index!=0&&index!=1">{{index+1}}</span>
</div>
</el-col>
<el-tooltip :enterable="false" @click.native="jumpRouter(item)" effect="light" :content="item.title" placement="bottom" :visible-arrow="false" popper-class="text-tooltip">
<!-- <el-tooltip :enterable="false" @click.native="jumpRouter(item)" effect="light" :content="item.title + '' + item.authorName+ ')'" placement="bottom" :visible-arrow="false" popper-class="text-tooltip"> -->
<div :title="item.title + '' + item.authorName+ ')'" @click="jumpRouter(item)">
<el-col :span="15" style="cursor: pointer;" class="title-line-ellipsis"> {{ item.title }}</el-col>
</el-tooltip>
</div>
<!-- </el-tooltip> -->
<!-- <el-col class="center" style="color: #FF8E00;" :span="5">{{ item.score }}</el-col> -->
</el-row>
</div>
@@ -144,11 +160,16 @@
<img v-if="index===0" :src="`${webBaseUrl}/images/first.png`"/>
<img v-if="index===1" :src="`${webBaseUrl}/images/second.png`"/>
<img v-if="index===2" :src="`${webBaseUrl}/images/third.png`"/>
<div v-if="item.title">
<span style="margin-left: 10px" v-if="index!=2&&index!=0&&index!=1">{{index+1}}</span>
</div>
</el-col>
<el-tooltip :enterable="false" @click.native="jumpRouter(item)" effect="light" :content="item.title" placement="bottom" :visible-arrow="false" popper-class="text-tooltip">
<!-- <el-tooltip :enterable="false" @click.native="jumpRouter(item)" effect="light" :content="item.title + '' + item.authorName+ ')'" placement="bottom" :visible-arrow="false" popper-class="text-tooltip"> -->
<div :title="item.title + '' + item.authorName+ ')'" @click="jumpRouter(item)">
<el-col :span="15" style="cursor: pointer;" class="title-line-ellipsis"> {{ item.title }}</el-col>
</el-tooltip>
</div>
<!-- </el-tooltip> -->
<!-- <el-col class="center" style="color: #FF8E00;" :span="5">{{ item.score }}</el-col> -->
</el-row>
</div>
@@ -187,6 +208,7 @@ export default {
},
data() {
return {
Internet:3,//1是成功 2是是失败 3是检测中
noData:true,
zoomShow:true,
isTopBoxShow:true,
@@ -209,7 +231,10 @@ export default {
};
},
mounted() {
//this.pdfPath=this.basePath+'/case/demo1.pdf';
let $this = this;
this.Intsucc();
this.retest();
this.resolveId = this.$route.query.id;
this.$watermark.set(this.userInfo.name+this.userInfo.loginName);
if (this.resolveId) {
@@ -226,6 +251,53 @@ export default {
);
},
methods: {
retest(){
this.Internet=3;
let $this=this;
let xmlhttp=this.getXmlHttpRequest();
let timedOut = false;
let timer = setTimeout(function(){
timedOut = true;
xmlhttp.abort();
}, 5000);
xmlhttp.open("HEAD", window.location.protocol+"//uapi.boe.com.cn",true);
xmlhttp.send();
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
if (xmlhttp.status==200){
clearTimeout(timer);
$this.Internet = 1;
}else{
clearTimeout(timer);
$this.Internet = 2;
}
}else{
if(timedOut) return;//忽略中止请求
clearTimeout(timer);//取消等待的超时
}
}
},
getXmlHttpRequest() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
}
else if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
},
Intsucc(){
const loading = this.$loading({
lock: true,
text: '正在进行安全检测',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
setTimeout(() => {
loading.close();
}, 2000);
},
getdomain() {
let key = "org_domain";
apiDict.items(key).then(res => {
@@ -242,6 +314,7 @@ export default {
apiDict.items(key).then(res => {
if (res.status == 200) {
this.Profess = res.result;
// this.Profess = this.Profess.split(",")
}
});
},
@@ -325,7 +398,7 @@ export default {
}
if(scrollTop > 630) {
this.isTopBoxShow = true;
document.querySelector('#fixd-box').style.cssText = "position: fixed;top: -500px;width:245.5px";
document.querySelector('#fixd-box').style.cssText = "position: fixed;top: -250px;width:245.5px";
} else {
document.querySelector('#fixd-box').style.cssText = "position: static";
}
@@ -341,22 +414,47 @@ export default {
getPopularity(){
apiCase.queryPraises(5).then(res=>{
if(res.status==200){
this.Popularity=res.result
this.Popularity=res.result;
if(res.result.length < 5){
for(let i=0;i=(5-res.result.length);i++){
this.Popularity.push({
authorName:'',
count:1,
id:'',
title:'',
})
}
}
}
})
},
getPositive(){
apiCase.queryComments(5).then(res=>{
if(res.status==200){
this.Positive=res.result
this.Positive=res.result;
if(res.result.length < 5){
for(let i=0;i=(5-res.result.length);i++){
this.Positive.push({
authorName:'',
count:1,
id:'',
title:'',
})
}
}
// console.log(this.Positive);
}
})
},
getCaseData() {
apiCase.detail(this.resolveId,true).then(res => {
apiCase.details(this.resolveId,true).then(res => {
if (res.status == 200) {
if (JSON.stringify(res.result) != '{}') {
this.caseDetail = res.result;
this.caseDetail = res.result.case;
this.caseDetail.majorType = this.caseDetail.majorType.split(",")
this.getCaseUserDetail();
if(this.caseDetail.filePath){
//this.pdfPath=this.basePath+this.caseDetail.filePath;
@@ -406,6 +504,17 @@ export default {
</script>
<style scoped lang="scss">
.pdftext{
// padding: 0 20px;
span{
font-size: 22px;
color: #ccc;
font-weight: bold;
line-height: 40px;
padding: 0 20px;
}
text-align: center;
}
.fixd-box-show{
display: none;
}
@@ -419,7 +528,7 @@ export default {
}
.postfixt-bot{
height: 60px;
margin-top: 10px;
//margin-top: 10px;
line-height: 60px;
// background-color: #fff;
// border: 1px solid #eee;
@@ -523,15 +632,15 @@ export default {
.item {
float: left;
margin: 7px 10px 0px 0px;
border: 1px solid #c2c3c8;
border: 1px solid #2974D6;
padding: 0px 10px;
line-height: 24px;
text-align: center;
height: 24px;
box-sizing: border-box;
border-radius: 2px;
border-radius: 10px;
font-size: 14px;
color: #9c9c9c;
color: #2974D6;
}
.item-right {
float: right;
@@ -542,7 +651,7 @@ export default {
// margin: 15px 0;
background-color: #f5f7fa;
min-height: 300px;
padding: 0px 0px 10px 0px;
padding: 0px 0px 0px 0px;
.content {
padding: 10px 0;
line-height: 25px;

View File

@@ -25,13 +25,14 @@
<el-row class="search-item">
<el-col :span="24">
<div style="margin-top:10px; display: flex;">
<div style="line-height: 25px;padding-right: 5px;">
<div style="line-height: 25px;padding-right: 10px;">
<span class="item-title" style="padding-right: 5px;">组织领域</span>
<span class="item-line"></span>
</div>
<div style="flex:1;">
<el-radio-group v-model="queryCondition.orgDomain" size="mini" @change="search()">
<el-radio-button :label="null">全部</el-radio-button>
<el-radio-button v-for="item in domain" :key="item.code" :label="item.code"> {{ item.name}}</el-radio-button>
</el-radio-group>
</div>
@@ -40,16 +41,18 @@
</el-row>
<div class="search-div-collapse">
<el-row class="search-item">
<el-col :span="24">
<el-col :span="24" >
<div style="margin-top:10px; display: flex;">
<div style="line-height: 25px;padding-right: 5px;">
<div style="line-height: 25px;padding-right: 10px;">
<span class="item-title" style="padding-right: 5px;">专业分类</span>
<span class="item-line"></span>
</div>
<div style="flex:1" id="searchBox">
<el-radio-group v-model="queryCondition.majorType" size="mini" @change="search()">
<el-radio-group style="display:flex;" v-model="queryCondition.majorType" size="mini" @change="search()">
<el-radio-button :label="null">全部</el-radio-button>
<el-radio-button v-for="item in Profess" :key="item.code" :label="item.code" > {{ item.name }} </el-radio-button>
<div>
<el-radio-button v-for="item in speciData" :key="item.code" :label="item.code" > {{ item.name }} </el-radio-button>
</div>
</el-radio-group>
</div>
</div>
@@ -67,7 +70,7 @@
</el-row>
<el-row class="order-div" style="border: 1px solid #EBEEF5;border-bottom:none">
<span class="quyer-tag">
<el-button type="text" class="order-class" @click="searchData('comments')" :class="{ actice: queryCondition.orderField == 'comments' }">最热</el-button>
<el-button type="text" class="order-class" @click="searchData('views')" :class="{ actice: queryCondition.orderField == 'views' }">最热</el-button>
<el-button type="text" class="order-class" @click="searchData('')" :class="{ actice: queryCondition.orderField == '' }">最新</el-button>
<!-- <el-button type="text" class="order-class" @click="queryCondition.breCommend = queryCondition.breCommend == ture ? true : null" :class="{ actice: queryCondition.breCommend == true }">组织推荐</el-button> -->
</span>
@@ -86,13 +89,14 @@
</div>
</div>
</div>
<div style="height:32px; ">
<div style="height:40px;padding-top:5px ">
<author :avatar="item.authorInfo.avatar" :name="item.authorInfo.name" :info="item.authorInfo.orgInfo" :sex="item.authorInfo.sex"></author>
</div>
<div class="keyword-text clearfix">
<div style="color:#666" v-if="item.orgDomain">{{ orgDomainTranslate(item.orgDomain) }}</div>
<div style="color:#666" v-if="item.orgDomain == '' && item.orgDomainParent">{{ orgDomainTranslate(item.orgDomainParent) }}</div>
<div style="color:#666" v-if="item.majorType">{{ majorTypeTranslate(item.majorType) }}</div>
<div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain">{{ orgDomainTranslate(item.orgDomain) }}</div>
<div style="color:#2974D6;font-weight: 450;" v-if="item.orgDomain == '' && item.orgDomainParent">{{ orgDomainTranslate(item.orgDomainParent) }}</div>
<div style="color:#2974D6;font-weight: 450;" v-for="item,idx in item.majorType" :key="idx" >{{ majorTypeTranslate(item) }}</div>
<div v-if="item.keyword1">{{ item.keyword1 }}</div>
<div v-if="item.keyword2">{{ item.keyword2 }}</div>
<div v-if="item.keyword3">{{ item.keyword3 }}</div>
@@ -131,15 +135,12 @@
<div style="width: 245px;margin-left: 5px;">
<div>
<div id="fixd-box">
<el-card class="ranking-card" >
<!-- <el-card class="ranking-card" >
<div slot="header">
<span style="font-size: 14px;font-weight: 600;color: #333333;">贡献榜</span>
</div>
<div style="padding-bottom:10px">
<el-row class="ranking-title">
<!-- <el-col :span="15" style="color: #333333;font-size: 14px;">名称</el-col> -->
<!-- <el-col :offset="4" :span="5" class="center" style="color: #333333;font-size: 14px;">分数</el-col> -->
</el-row>
<el-row class="ranking-title"> </el-row>
<el-row class="ranking-title bacolor" v-for="(item, index) in ankingList" :key="index" >
<el-col :span="6" style="height:34px">
<img v-if="index===0" :src="`${webBaseUrl}/images/first.png`"/>
@@ -147,14 +148,11 @@
<img v-if="index===2" :src="`${webBaseUrl}/images/third.png`"/>
<span style="margin-left: 10px" v-if="index!=2&&index!=0&&index!=1">{{index+1}}</span>
</el-col>
<el-tooltip :enterable="false" effect="light" :content="item.sysCreateUname" :visible-arrow="false" popper-class="text-tooltip" placement="bottom">
<el-col :span="15" class="title-line-ellipsis"> {{ item.sysCreateUname }}</el-col>
</el-tooltip>
<!-- <el-col class="center" style="color: #FF8E00;" :span="5">{{ item.score }}</el-col> -->
</el-row>
</div>
</el-card>
<div style="height: 10px;"></div>
</el-card> -->
<!-- <div style="height: 10px;"></div> -->
<el-card class="ranking-card" >
<div slot="header">
<span style="font-size: 14px;font-weight: 600;color: #333333;">人气榜</span>
@@ -169,11 +167,15 @@
<img v-if="index===0" :src="`${webBaseUrl}/images/first.png`"/>
<img v-if="index===1" :src="`${webBaseUrl}/images/second.png`"/>
<img v-if="index===2" :src="`${webBaseUrl}/images/third.png`"/>
<div v-if="item.title">
<span style="margin-left: 10px" v-if="index!=2&&index!=0&&index!=1">{{index+1}}</span>
</div>
</el-col>
<el-tooltip :enterable="false" @click.native="jumpRouter(item)" effect="light" :content="item.title" placement="bottom" :visible-arrow="false" popper-class="text-tooltip">
<!-- <el-tooltip :enterable="false" @click.native="jumpRouter(item)" effect="light" :content="item.title + '' + item.authorName+ ')'" placement="bottom" :visible-arrow="false" popper-class="text-tooltip"> -->
<div :title="item.title + '' + item.authorName+ ')'" @click="jumpRouter(item)">
<el-col :span="15" style="cursor: pointer;" class="title-line-ellipsis"> {{ item.title }}</el-col>
</el-tooltip>
</div>
<!-- </el-tooltip> -->
<!-- <el-col class="center" style="color: #FF8E00;" :span="5">{{ item.score }}</el-col> -->
</el-row>
</div>
@@ -193,11 +195,16 @@
<img v-if="index===0" :src="`${webBaseUrl}/images/first.png`"/>
<img v-if="index===1" :src="`${webBaseUrl}/images/second.png`"/>
<img v-if="index===2" :src="`${webBaseUrl}/images/third.png`"/>
<div v-if="item.title">
<span style="margin-left: 10px" v-if="index!=2&&index!=0&&index!=1">{{index+1}}</span>
</div>
</el-col>
<el-tooltip :enterable="false" @click.native="jumpRouter(item)" effect="light" :content="item.title" placement="bottom" :visible-arrow="false" popper-class="text-tooltip">
<!-- <el-tooltip :enterable="false" @click.native="jumpRouter(item)" effect="light" :content="item.title + '' + item.authorName+ ')'" placement="bottom" :visible-arrow="false" popper-class="text-tooltip"> -->
<div :title="item.title+ '' + item.authorName+ ')'" @click="jumpRouter(item)">
<el-col :span="15" style="cursor: pointer;" class="title-line-ellipsis"> {{ item.title }}</el-col>
</el-tooltip>
</div>
<!-- </el-tooltip> -->
<!-- <el-col class="center" style="color: #FF8E00;" :span="5">{{ item.score }}</el-col> -->
</el-row>
</div>
@@ -209,7 +216,7 @@
<el-row :gutter="10">
</el-row>
<div style="height: 50px;"></div>
<el-dialog class="protocol" :visible.sync="protocolDialogVisible" width="30%" :show-close="false">
<el-dialog class="protocol" :close-on-click-modal="false" :visible.sync="protocolDialogVisible" width="30%" :show-close="false">
<div class="protocol-title">案例查阅及使用用户协议</div>
<div class="protocol-content">
&emsp;&emsp;本专区内案例为BOE各组织沉淀的通用案例 组织案例卓越绩效案例管理案例 职级晋升案例企业文化案例等 案例内容记录作者亲历的真实的已完成的
@@ -272,10 +279,12 @@ export default {
},
data() {
return {
speciData:[],
moreState: 1, // 1 加载更多 2 加载中 3无数据
isSeach: false,
searchwd: true,
searchwd: false,
showAll: true, //是否展开全部
initHeight:40,//原始 高度
searchRecords: [],
caseList: {
count: 0,
@@ -293,11 +302,11 @@ export default {
pageIndex: 1,
pageSize: 10,
isTop: true,
orderField: "comments",
orderField: "views",
// breCommend:null,
keyWord: "",
majorType: "", //专业分类
orgDomain: "", // 组织领域
majorType:null, //专业分类
orgDomain: null, // 组织领域
orderAsc: false
},
keyWord: "",
@@ -313,9 +322,14 @@ export default {
},
mounted() {
this.$nextTick(function() {
this.closeSearch();
});
if(this.searchTags.length == 0){
this.queryCondition.majorType = null;
this.queryCondition.orgDomain = null;
};
this.specialized();
// this.$nextTick(function() {
// this.closeSearch();
// });
if (!this.portalCase.readProtocol) {
this.protocolDialogVisible = true;
}
@@ -332,6 +346,7 @@ export default {
// this.getCaseData();
this.search();
window.addEventListener("scroll", this.handleScroll);
},
watch: {
@@ -347,6 +362,20 @@ export default {
window.removeEventListener("scroll", this.handleScroll);
},
methods: {
specialized(){
let $this=this;
apiCase.majorTypes().then(res =>{
if(res.status == 200){
this.speciData = res.result;
this.$nextTick(function() {
$this.initHeight = document.getElementById("searchBox").offsetHeight;
$this.closeSearch();
});
}
})
},
jumcasedet(item) {
this.$router.push({path:'/case/detail',query:{id:item.id}});
@@ -376,17 +405,18 @@ export default {
closeSearch() {
this.showAll = !this.showAll;
var searchBoxHeght = document.getElementById("searchBox");
var searchBoxWidth = document.getElementById("searchBox");
if (searchBoxWidth.clientWidth > 950) {
this.searchwd = false;
//console.log(this.initHeight,'this.initHeight');
if(this.initHeight>80){
this.searchwd = true;
}
if (this.showAll == false) {
searchBoxHeght.style.height = 70 + "px";
} else {
searchBoxHeght.style.height = "auto";
//console.log(het,'het');
if(this.showAll){
//searchBoxHeght.style.height = "auto";
searchBoxHeght.style.maxHeight = this.initHeight + "px";
}else{
searchBoxHeght.style.maxHeight = 70 + "px";
}
},
getAnkingData() {
apiCase.usernameList(5).then(res => {
if (res.status == 200) {
@@ -487,7 +517,7 @@ export default {
}
if (scrollTop > 630) {
document.querySelector("#fixd-box").style.cssText =
"position: fixed;top: -500px;width:245.5px";
"position: fixed;top: -250px;width:245.5px";
} else {
document.querySelector("#fixd-box").style.cssText = "position: static";
}
@@ -529,6 +559,14 @@ export default {
if (this.keyWord != this.queryCondition.keyWord) {
this.queryCondition.keyWord = this.keyWord;
}
if(this.queryCondition.orgDomain == 0){
this.queryCondition.orgDomain = null
}
if(this.queryCondition.majorType == 0){
this.queryCondition.majorType = null
}
this.getCaseData();
},
async getCaseData() {
@@ -543,7 +581,9 @@ export default {
if (res.status == 200) {
if (res.result.list.length > 0) {
this.isSeach = false;
console.log(res.result.list)
res.result.list.forEach(item => {
item.majorType = item.majorType.split(",");
item.isAll = false;
item.authorInfo = {
aid: "",
@@ -601,13 +641,15 @@ export default {
}
},
tagsClose(tag, index) {
for (let i in this.queryCondition) {
if (tag.type === i) {
if (i == "majorType") {
this.queryCondition.majorType = null;
this.queryCondition.majorType = '';
}
if (i == "orgDomain") {
this.queryCondition.orgDomain = null;
this.queryCondition.orgDomain = '';
}
if (i == "keyWord") {
this.queryCondition.keyWord = "";
@@ -615,9 +657,17 @@ export default {
}
this.queryCondition[i] = "";
this.searchTags.splice(index, 1);
if (i == "majorType") {
this.queryCondition.majorType = null;
}
if (i == "orgDomain") {
this.queryCondition.orgDomain = null;
}
this.getCaseData();
}
}
},
getCaseUserData(caseList) {
let ids = caseList.map((item, index) => {
@@ -646,6 +696,17 @@ export default {
apiCase.queryPraises(5).then(res => {
if (res.status == 200) {
this.Popularity = res.result;
if(res.result.length < 5){
for(let i=0;i=(5-res.result.length);i++){
this.Popularity.push({
authorName:'',
count:1,
id:'',
title:'',
})
}
}
}
});
},
@@ -653,6 +714,17 @@ export default {
apiCase.queryComments(5).then(res => {
if (res.status == 200) {
this.Positive = res.result;
if(res.result.length < 5){
for(let i=0;i=(5-res.result.length);i++){
this.Positive.push({
authorName:'',
count:1,
id:'',
title:'',
})
}
}
}
});
},
@@ -666,11 +738,23 @@ export default {
</script>
<style scoped lang="scss">
::v-deep .el-checkbox{
.el-checkbox__input{
.el-checkbox__inner{
border: 1px solid #3e3c3c;
}
}
}
::v-deep .el-radio-button{
margin-right:-5px;
}
::v-deep .el-button {
border-radius: 0px;
}
.case-titdiv {
line-height: 30px;
display: flex;
.case-tittext {
@@ -699,15 +783,14 @@ export default {
.keyword-text {
div {
padding:0px 7px;
margin-top: 5px;
float: left;
height: 19px;
line-height: 19px;
font-size: 12px;
color: #9c9c9c;
border: 1px solid #c2c3c8;
padding: 0px 5px;
border-radius: 2px;
line-height: 22px;
font-size: 14px;
color: #2974D6;
border: 1px solid #2974D6;
border-radius: 10px;
margin-right: 8px;
}
}
@@ -717,6 +800,7 @@ export default {
}
#searchBox {
overflow: hidden;
}
.ranking-title {
line-height: 34px;
@@ -900,7 +984,7 @@ export default {
}
}
.case-info-summary {
margin-top:3px;
margin-top:8px;
cursor: pointer;
margin-bottom: 5px;
word-break: break-all;

View File

@@ -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">
@@ -165,15 +165,15 @@ export default {
};
},
mounted() {
let id = this.$route.query.id;
this.courseInfo.id=id;
this.$watermark.set(this.userInfo.name+this.userInfo.loginName);
//this.stuStusts=0;
this.loadResOwners();
let id = this.$route.query.id;
this.courseInfo.id=id;
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);
}
})
@@ -231,18 +234,20 @@ export default {
showQrimage(){
let urlPre=window.location.protocol+'//'+window.location.host;
// this.qrcode = this.webBaseUrl+'/mobile/pages/resource/courseDetail?id='+this.courseInfo.id;
this.qrcode = urlPre+'/mobile/pages/resource/courseDetail?id='+this.courseInfo.id;
console.log(this.qrcode,'qrcode');
urlPre='https://u.boe.com/m?returnUrl=https://u.boe.com/mobile/pages/login/loading?returnUrl=';
this.qrcode = urlPre+'/pages/resource/courseDetail?id='+this.courseInfo.id;
//console.log(this.qrcode,'qrcode');
this.$nextTick(() => {
this.crateQrcode();
});
},
crateQrcode(){
this.qr = new QRCode('qrcode', {
width: 80,
height: 80, // 高度
width: 150,
height: 150, // 高度
text: this.qrcode // 二维码内容
});
this.qr._el.title = '';
},
showCommentsTotal(total){
this.commentsTtoal=total;
@@ -370,7 +375,7 @@ export default {
}
.course-title{
height: 115px;
height: 90px;
display: flex;
justify-content: space-between;
.title {
@@ -408,8 +413,8 @@ export default {
}
.label-div {
margin: 0px 0;
// height: 80px;
margin: 5px 0;
min-height: 20px;
.label-item {
padding: 0 7px;
margin-right: 8px;
@@ -464,8 +469,8 @@ export default {
vertical-align:bottom;
}
.qrcode{
width: 80px;
height: 80px;
width: 150px;
height: 150px;
display: inline-block;
margin: 1px;
img {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,6 @@
<div>
<div class="courseware-div" v-if="enrollStutas == 1" style="max-height: 400px;">
<course-image :course="courseInfo" class="courseware-img"></course-image>
<!-- <el-button type="warning" @click="submitEnroll" class="courseware-enroll-btn">报名后即可开始学习</el-button> -->
</div>
<div class="courseware-div" v-else>
<div v-if="coursewareInfo.content.contentType == 10" style="position: relative;">
@@ -29,19 +28,16 @@
@onFullscreen="onFullscreen"
@onPlayerEnded="onPlayerEnded">
</videoPlayer>
<!-- v-if="playerBoxShow" -->
<div class="player-box" v-if="playerBoxShow">
<div class="player-praise">
<div @click="praiseContent" style="cursor: pointer;">
<img class="icon-small" v-if="isPraise" :src="require('@/assets/images/icon/praise-active.png')" />
<img class="icon-small" v-else :src="require('@/assets/images/icon/zhan.png')" />
<!-- {{ courseInfo.praises }} -->
<div style="color:#fff;cursor: pointer;"></div>
</div>
<div style="margin-left: 15px;cursor: pointer;" @click="treadContent">
<img class="icon-small" v-if="isTrample" :src="require('@/assets/images/icon/trample-active.png')" />
<img class="icon-small" v-else :src="require('@/assets/images/icon/cai.png')" />
<!-- {{ courseInfo.trampleCount }} -->
<div style="color:#fff;cursor: pointer;"></div>
</div>
</div>
@@ -112,7 +108,6 @@
</el-tabs>
<div style="display: flex;justify-content: space-between;padding: 10px;align-items: center;">
<div class="score">
<!-- <el-rate disabled v-model="courseInfo.score" :max="5" :allow-half="true" show-score score-template="{value}"></el-rate> -->
<div v-if="enrollStutas == 1 && !scoreInfo.has">
<div v-if="courseInfo.score">
<el-rate disabled v-model="courseInfo.score"></el-rate>
@@ -135,14 +130,14 @@
</div>
<div style="display: flex;align-items: center;padding-top: 15px;">
<div @click="praiseContent" style="cursor: pointer;">
<el-tooltip class="item" effect="light" :content="isPraise?'取消点赞':'点赞'" placement="top-start">
<el-tooltip class="item" effect="light" :content="isPraise?'取消点赞':'点赞'" placement="top-start" :visible-arrow="false" popper-class="text-tooltip">
<img class="icon-small" v-if="isPraise" :src="require('@/assets/images/icon/praise-active.png')">
<img class="icon-small" v-else :src="require('@/assets/images/icon/praise.png')">
</el-tooltip>
<span style="margin-left: 5px;color: #666666;font-size: 18px;">{{courseInfo.praises}}</span>
</div>
<div style="margin-left: 15px;cursor: pointer;" @click="treadContent">
<el-tooltip class="item" effect="light" :content="isTrample?'取消踩':'踩'" placement="top-start">
<el-tooltip class="item" effect="light" :content="isTrample?'取消踩':'踩'" placement="top-start" :visible-arrow="false" popper-class="text-tooltip">
<img class="icon-small" v-if="isTrample" :src="require('@/assets/images/icon/trample-active.png')">
<img class="icon-small" v-else :src="require('@/assets/images/icon/trample.png')">
</el-tooltip>
@@ -155,47 +150,22 @@
<interactBar :readonly="enrollStutas==1" :type="1" :data="courseInfo" :views="false" :praises="false" :comments="false"></interactBar>
<div class="title title-index">{{courseInfo.name}}</div>
<div class="study-count"><span class="num">{{courseInfo.studys}}人学习</span></div>
<!-- <div class="course-info-tools-btns">
<span style="color: #f8a114;font-size: 36px;">{{toScore(courseInfo.score)}}</span>
<span style="font-size: 14px;color: #787878;"></span>
</div> -->
<!-- <div class="label"><el-tag class="label-item" effect="plain">了解公司</el-tag></div> -->
<div class="label"><el-tag class="label-item" effect="plain">录播课</el-tag></div>
<div class="label" v-if="tags.length >0">
<el-tag class="label-item" effect="plain" v-for="(item, index) in tags" :key="index">{{item}}</el-tag>
<!-- <el-tag class="label-item" effect="plain">中心长</el-tag> -->
</div>
<div v-if="enrollStutas != 2" class="score" style="padding-top: 135px;justify-content: flex-start;">
<!-- <el-rate style="display: inline-block; " disabled v-model="courseInfo.score" score-template="{value}" show-score text-color="#ff8e00"></el-rate>
<span style="font-size: 14px;color: #f7ba2a;"></span> -->
<div v-if="courseInfo.score">
<el-rate disabled v-model="courseInfo.score"></el-rate>
<span class="score-text">{{toScore(courseInfo.score)}}<span style="font-size: 14px;"></span></span>
</div>
<div v-else class="score-no">未评分</div>
<!-- <el-rate style="display: inline-block; " disabled v-model="courseInfo.score" text-color="#ff8e00"></el-rate>
<span style="font-size: 14px;color: #f7ba2a;">{{courseInfo.score}}</span> -->
</div>
<!-- <div class="keyword"><el-tag class="label-item" effect="plain">质量</el-tag></div> -->
<!--资源归属是一共有三级这里只显示三级-->
<!-- <div class="study-count">资源归属{{courseInfo.resOwner}}</div> -->
<!-- <div class="btn-div" style="padding-top: 70px;">
<el-button class="btn" type="primary" v-if="enrollStutas == 1" @click="submitEnroll">立即报名</el-button>
</div> -->
<!-- 二维码 -->
<!-- <div class="qr-code" style="padding-top: 10px;">
<div id="qrcode" ref="qrcode" class="qrcode" ></div>
<div>手机扫码观看</div>
</div> -->
<!-- <div style="width: 100px;height:300px" v-if="courseInfo.device == 2 || courseInfo.device == 3"> -->
<img class="detail-img" v-show="!showQrcode && (courseInfo.device == 2 || courseInfo.device == 3)" @click="showQrcode = true" src="../../../assets/images/qr.png" alt="" srcset="">
<div class="qr-code" v-show="showQrcode && ((courseInfo.device == 2 || courseInfo.device == 3))" style="padding-top: 10px;">
<div id="qrcode" ref="qrcode" class="qrcode" @click="showQrcode = false"></div>
<!-- <div style="margin-left: 27px">手机扫码观看</div> -->
</div>
<!-- </div> -->
</el-col>
<!-- 11 -->
</el-row>
</el-card>
<el-row :gutter="10">
@@ -233,12 +203,9 @@
<div class="teacher" v-for="(item, idx) in teachers" :key="idx" >
<div class="teacher-avator">
<el-avatar v-if="item.avatar !== ''" :src="item.avatar" shape="circle" :size="50"></el-avatar>
<!-- <div class="teacher-text" v-if="item.avatar !== '' "></div> -->
<!-- <el-avatar v-if="item.avatar && item.avatar!=''" icon="el-icon-user" shape="square" :size="50"></el-avatar> -->
<div class="teacher-text" v-else>
<div v-if="sex === 1 "><img src="../../../../public/images/Avatarman.png" alt=""></div>
<div v-else><img src="../../../../public/images/Avatarwoman.png" alt=""></div>
</div>
</div>
<div class="teacher-info">
@@ -264,23 +231,13 @@ import portalHeader from "@/components/PortalHeader.vue";
import comments from "@/components/Portal/comments.vue";
import portalFooter from "@/components/PortalFooter.vue";
import interactBar from "@/components/Portal/interactBar.vue";
import apiCourse from "@/api/modules/course.js";
import apiCourseFile from "@/api/modules/courseFile.js";
import apiCoursePortal from "@/api/modules/coursePortal.js";
import apiUser from '@/api/system/user.js';
import exam from '@/components/Course/exam';
import homework from '@/components/Course/homework';
import assess from '@/components/Course/assess';
import {
formatDate,
resListMap,
toScore,
courseType,
getType,
numberToLetter,
correctJudgment,
userAvatarText
} from "@/utils/tools.js";
import {toScore,courseType, getType, numberToLetter, correctJudgment,userAvatarText} from "@/utils/tools.js";
import apicourseStudy from "@/api/modules/courseStudy.js";
import apiVideoStudy from "@/api/modules/videoStudy.js";
import apiCourseGrade from "@/api/modules/courseGrade.js";
@@ -288,7 +245,6 @@ import apiPraises from "@/api/modules/praises.js";
import apiTrample from "@/api/modules/trample.js";
import FileUpload from "@/components/FileUpload/index.vue";
import pdfPreview from "@/components/PdfPreview/index.vue";
// import {resOwnerIndexName} from '@/utils/type.js';
import { setTimeout } from "timers";
import videoPlayer from '@/components/VideoPlayer/index.vue';
import audioPlayer from '@/components/AudioPlayer/index.vue';
@@ -330,7 +286,6 @@ export default {
studyId: "",
tags: [],
numberToLetter: numberToLetter,
// resOwnerListMap: resOwnerIndexName,
fileBaseUrl: this.$Constants.fileBaseUrl,
blobUrl:'',//播放的文件地址新添加采用blob方式
getType: getType,
@@ -401,20 +356,18 @@ export default {
};
},
mounted() {
let id = this.$route.query.id;
this.courseInfo.id = id;
this.showQrimage();
this.$watermark.set(this.userInfo.name+this.userInfo.loginName);
this.loadResOwners();
let id = this.$route.query.id;
this.courseInfo.id = id;
let $this = this;
//页面只支取一次,所以先直接写在这里面
apiCoursePortal.detail(id).then(rs => {
apiCoursePortal.detail(id,false).then(rs => {
if (rs.status == 200) {
this.courseInfo = rs.result.course;
// this.courseInfo.score = this.toScore(rs.result.course.score);
if(rs.result.course.tags != '') this.tags = rs.result.course.tags.split(",");
this.teachers = rs.result.teachers;
if(rs.result.teachers && rs.result.teachers.length > 0){
let userIds=[];
let ctoUsers=[];
@@ -447,7 +400,6 @@ export default {
}
//对url进行加密处理
$this.createPlayUrl(con.contentRefId,this.curriculumData.url);
} else if (con.contentType == 40) {
//需要读取pdf的路径
apiCourseFile.detail($this.coursewareInfo.content.contentRefId).then(cfrs=>{
@@ -460,12 +412,10 @@ export default {
$this.coursewareInfo.content.content=cfrs.result.filePath;
$this.curCFile=2;
}
}else{
$this.$message.error('加载pdf课件文件失败');
}
});
//let url = this.fileBaseUrl + r.content;
}else if(con.contentType ==52){
if(con.content.startsWith('\{')){
this.conLink=JSON.parse(con.content);
@@ -497,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);
}
});
@@ -506,9 +459,7 @@ export default {
let nowDate=new Date();
let ctime=parseInt(nowDate.getTime()/1000);
let beforeUrl=parseInt(nowDate.getTime()/1000)+'/'+fid;
//console.log(beforeUrl,'beforeUrl');
let urlSign=encodeURIComponent(encrypt(beforeUrl));
//console.log(urlSign,'urlSign');
cookies.set('PLAYSIGN_TIME', ctime);//写客户端的cookie保存
//以下判断是为了区分本地环境和服务器环境
if(process.env.NODE_ENV == 'development'){
@@ -521,21 +472,22 @@ export default {
let urlPre=window.location.protocol+'//'+window.location.host;
// https://u.boe.com/mobile/pages/resource/microDetail?id=963456709515939840
// this.qrcode = this.webBaseUrl+'/mobile/pages/resource/microDetail?id='+this.courseInfo.id;
this.qrcode =urlPre+ '/mobile/pages/resource/microDetail?id='+this.courseInfo.id;
//console.log(this.qrcode,'qrcode');
urlPre='https://u.boe.com/m?returnUrl=https://u.boe.com/mobile/pages/login/loading?returnUrl=';
this.qrcode =urlPre+ '/pages/resource/microDetail?id='+this.courseInfo.id;
this.$nextTick(() => {
this.crateQrcode();
});
},
crateQrcode(){
this.qr = new QRCode('qrcode', {
width: 80,
height: 80, // 高度
width: 150,
height: 150, // 高度
text: this.qrcode // 二维码内容
// render: 'canvas' // 设置渲染方式(有两种方式 table和canvas默认是canvas
// background: '#f0f'
// foreground: '#ff0'
});
this.qr._el.title = '';
},
...mapActions({
getResOwnerTree:'resOwner/getResOwnerTree',
@@ -630,11 +582,9 @@ export default {
this.playerBoxShow = false;
//console.log("开始播放");
this.isAppendTime=false;
//视频类的内容,开始播放时才会记录完成情况
//2022-05-24修改判断播放的
let $this=this;
//console.log(this.curriculumData,'this.curriculumData');
//完成类型 completeSetup 0表默认打开后5秒算学完1表按进度2表按时间
//完成值(非默认情况下起作用) setupTage
if(!$this.coursewareInfo.finish){
@@ -673,7 +623,6 @@ export default {
if(!completeSecond){
completeSecond=5;//如果没有就采用默认的时间了
}
if(completeType>0 && !this.coursewareInfo.finish){ //因为1按进度2按时长都是计算时间所以这里直接大于0处理
if(completeType==1){
let finishPercent=this.curriculumData.setupTage;
@@ -687,7 +636,6 @@ export default {
this.finishStudyItem();
}
}
}
//以下是每10秒记录一次学习时长
let saveTime=Math.floor(intTime%10);
@@ -708,14 +656,12 @@ export default {
},
audioPlaying(item,currentTime){
let intTime=parseInt(currentTime);//秒
//console.log("当前播放时间="+item+',currentTime='+intTime);
//判断是否完成
let completeType=this.curriculumData.completeSetup;
let completeSecond=this.curriculumData.second;
if(!completeSecond){
completeSecond=5;//如果没有就采用默认的时间了
}
if(completeType>0 && !this.coursewareInfo.finish){ //因为1按进度2按时长都是计算时间所以这里直接大于0处理
if(completeType==1){
let finishPercent=this.curriculumData.setupTage;
@@ -767,7 +713,6 @@ export default {
},
audioEnd(){
// this.playerBoxShow = true;
//console.log("播放结束");
if(!this.coursewareInfo.finish){
this.finishStudyItem();
}
@@ -879,7 +824,6 @@ export default {
//首先从本地读取
let duration=studyUtil.getStudyDuration();
//追加学习时间
let $this = this;
if(this.appendStartTime == null) {
@@ -890,14 +834,10 @@ export default {
}
return;
}
//当前进行的时间
let now = new Date();
let m = now.getTime() - this.appendStartTime.getTime(); //相差的毫秒数
let sen = parseInt(m / 1000); //计算秒数
//console.log(duration,'duration')
//console.log(sen,'sen')
duration=duration+sen;
if(flag){
//这个时候才进行存储 ,否则只能是存储在本地
@@ -940,14 +880,12 @@ export default {
if(res.result.signup) {
//this.bootTabActive = 'commnets';//系统自动报名,这里不进行切换了
this.studyId = res.result.studyId; //设置学习id
//需要判断此内容是否已学习完成,如果已学习完成,不需要再请不说了
res.result.contents.forEach(con => {
if (con.contentId == $this.coursewareInfo.content.id) {
$this.coursewareInfo.studyItemId=con.id;
$this.coursewareInfo.status=con.status;
$this.coursewareInfo.progress=con.progress;
if(con.contentType==10 || con.contentType==20){
if(con.progress==100 || con.status==9){
$this.coursewareInfo.finish = true;
@@ -957,7 +895,6 @@ export default {
}else{
$this.coursewareInfo.finish = true; //课件已学习
}
if(con.lastStudyTime){
//如果上次课件已经播放完成,此处应该是$this.coursewareInfo.content.duration
//也就是从头开开始
@@ -1025,7 +962,6 @@ export default {
if (rs.status == 200 && rs.result) {
this.scoreInfo.has = true;
}
//console.log(rs.result,'rs.result');
});
//}
apiPraises.has(1, this.courseInfo.id).then(rs => {
@@ -1180,12 +1116,8 @@ export default {
background: none;
border: none;
}
.player-box{
position: absolute;
// top: 62px;
// left: 184px;
width: 300px;
left: 50%;
top: 50%;
@@ -1207,46 +1139,23 @@ export default {
}
}
::v-deep .el-tabs__nav-wrap::after {
// content: "";
// position: absolute;
// left: 0;
// bottom: 0;
// width: 100%;
// height: 2px;
background-color: #fff;
// z-index: 1;
}
::v-deep .el-tabs__nav-wrap::after {
// content: "";
// position: absolute;
// left: 0;
// bottom: 0;
// width: 100%;
// height: 2px;
background-color: #fff;
// z-index: 1;
}
.qrcode{
display: inline-block;
img {
width: 132px;
height: 132px;
width: 200px;
height: 200px;
background-color: #fff; //设置白色背景色
padding: 6px; // 利用padding的特性挤出白边
box-sizing: border-box;
}
}
.ref-score{
// background: #e4e4e4;
// width: 64px;
// height: 32px;
// border-radius: 17px;
// line-height: 32px;
// // opacity: 0.24;
// color: #000;
// font-size: 14px;
// border: none;
// text-align: center;
}
.portal-content ::v-deep .el-rate__icon{
font-size: 24px !important;
@@ -1389,13 +1298,6 @@ export default {
transform: rotate(180deg);
}
}
// margin-bottom: 50px;
// line-height: 20px;
// .el-link{
// font-size: 30px;
// color: #70a5f4;
// margin: 0 30px;
// }
}
}
}
@@ -1413,9 +1315,7 @@ export default {
color: #FFB30F ;
font-family: "Arial";
margin-left: 23px;
// font-weight: 600;
}
// margin-bottom: 19px;
.score-no{
color: #FFB30F;
padding: 5px 0;

View File

@@ -96,13 +96,10 @@
<div v-if="homeworkInfo.info.submitMode==1 || homeworkInfo.info.submitMode==3">
<div class="homework-title">上传作业</div>
<div class="homework-content">
<div v-if="homeworkInfo.filePath!=''">
<el-tag closable type="success" @close="removeHomeworkFile">作业附件</el-tag><span style="margin-left: 10px;">请点击下面的提交</span>
</div>
<div v-else >
<!-- <div v-else >
<el-button type="primary">选择文件并上传</el-button>
<!-- <file-upload dir="files" :isShowTip="false" @success="uploadHomeworkFile" @remove="removeHomeworkFile"></file-upload> -->
</div>
</div> -->
</div>
</div>
<!-- <div style="text-align: center;padding-bottom: 10px;">
@@ -208,7 +205,6 @@
</div>
</div>
<!-- <div style="text-align: center; margin-bottom: 15px" v-if="assessInfo.allowSubmit"><el-button type="primary" @click="assessSubmitFun">提交</el-button></div> -->
</div>
<!-- <div v-else style="text-align: center;padding-top: 20px;color: red;">此课程无评估</div> -->
</div>
@@ -481,13 +477,14 @@ export default {
};
},
mounted() {
this.showQrimage();
this.loadResOwners();
let id = this.$route.query.id;
this.courseInfo.id = id;
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;
@@ -550,8 +547,7 @@ export default {
$this.loadAssessInfo();
}
});
//study info
// this.loadStudyInfo();
} else {
this.$message.error(rs.message);
}
@@ -561,7 +557,7 @@ export default {
showQrimage(row){
this.qrcode = this.webBaseUrl+'/mobile/pages/resource/microDetail?id='+this.courseInfo.id;
this.$nextTick(() => {
this.crateQrcode();
//this.crateQrcode();
});
},
crateQrcode(){
@@ -605,21 +601,6 @@ export default {
//console.log("当前播放11"+itme);
let intTime=parseInt(itme);
this.videoPlayingTime=intTime;
let saveTime=Math.floor(intTime%10);
if(intTime>10 && saveTime==0 && this.coursewareInfo.studyItemId!=''){
//记录播放时间
//console.log('记录播放时间:'+intTime);
let postData={
itemId:this.coursewareInfo.studyItemId,
videoTime:intTime
}
apicourseStudy.studyVideoTime(postData).then(rs=>{
if(rs.status!=200){
console.log('记录播放时间错误');
}
})
}
},
audioPlaying(item){
//console.log("当前播放22"+item);
@@ -651,11 +632,7 @@ export default {
studyId: this.studyId,
contentId: this.homeworkInfo.content.id
};
// apicourseStudy.myHomeworkList(params).then(rs => {
// if (rs.status == 200) {
// this.homeworkInfo.records = rs.result;
// }
// });
}
} else if (tab.name == "test") {
if (this.examInfo.records.length == 0) {
@@ -663,17 +640,6 @@ export default {
studyId: this.studyId,
contentId: this.examInfo.content.id
};
apicourseStudy.myExamList2(params).then(examRs => {
if (examRs.status == 200) {
this.examInfo.records = examRs.result;
let len = examRs.result.length;
if (this.examInfo.info.times > len) {
this.examInfo.allowSubmit = true;
} else {
this.examInfo.allowSubmit = false;
}
}
});
}
} else if (tab.name == "assess") {
//console.log('加载评估信息');,评估只会有一个,所以主直接取
@@ -681,22 +647,8 @@ export default {
studyId: this.studyId,
contentId: this.assessInfo.content.id
};
// apicourseStudy.myAssessList(params).then(res => {
// if (res.status == 200) {
// if (res.result.length > 0) {
// this.assessInfo.allowSubmit = false;
// this.assessInfo.info = JSON.parse(res.result[0].asContent);
// }
// } else {
// this.$message.error(res.message);
// }
// });
} else {
//在课件页面,记录开始时间
//console.log('记录课件学习信息');
if(!this.coursewareInfo.finish){
setTimeout(() => {$this.saveStudyInfo();}, 5000);
}
}
},
saveStudyInfo() {
@@ -708,102 +660,20 @@ export default {
if (this.coursewareInfo.finish) {
return;
}
// let params = {
// studyId: this.studyId, //学习id,
// courseId: this.coursewareInfo.content.courseId, //课程id,
// contentId: this.coursewareInfo.content.id, //内容id,
// contentName: this.coursewareInfo.content.contentName, //内容名称
// progress: 100,
// contentTotal: this.totalContent
// };
// apicourseStudy.studyContent(params).then(res => {
// if (res.status == 200) {
// this.coursewareInfo.finish = true; //课件内容已学习,记录状态
// } else {
// console.log("记录学习失败:" + res.message + "" + res.error);
// }
// });
},
startTest() {
this.examInfo.startTime = new Date();
this.testStart = true;
},
countTest() {
//计算课程的分数
let scoreNum = null;
this.examInfo.paper.items.forEach(item => {
let isFind = true;
if (item.type != 102) {
item.options.forEach(it => {
if (it.answer == true && item.userAnswer == it.id) {
scoreNum += item.score;
}
});
} else {
item.options.forEach(it => {
if (it.answer == false && it.isCheck && it.isCheck == true) {
isFind = false;
}
if (it.answer == true && it.isCheck && it.isCheck == true) {
if (isFind) {
scoreNum += item.score;
}
}
});
}
});
if (scoreNum === null) scoreNum = 0;
return scoreNum;
},
// 提交考试
submitTest() {
let now = new Date();
let testScore = this.countTest();
let postData = {
studyId: this.studyId, //这个哪传来的?
studyItemId: this.examInfo.studyItemId, //前面已经给了
courseId: this.examInfo.info.courseId,
contentId: this.examInfo.info.contentId,
testId: this.examInfo.info.id,
testName: this.courseInfo.name, //应该是课程的名称 + 内容的名称
testDuration: 0,
score: testScore,
arrange: this.examInfo.info.arrange,
passLine: this.examInfo.info.passLine,
randomMode: this.examInfo.info.randomMode,
paperJson: JSON.stringify({ items: this.examInfo.paper.items }) //原来是对象,这里要也要对象
//startTime:formatDate(this.examInfo.startTime),//此时间需要格式化,格式化时间可以放在util中
//endTime:formatDate(now),
};
//计划考试的时长
var dateDiff = now.getTime() - this.examInfo.startTime.getTime(); //时间差的毫秒数
var minutes = Math.floor(dateDiff / 1000); //计算相差秒数,原来是分钟不行
postData.testDuration = minutes;
apicourseStudy.saveExam(postData).then(res => {
if (res.status == 200) {
this.examInfo.records.push(res.result);
this.examInfo.studyItemId = res.result.studyItemId; //设置考试的学习记录id
this.testStart = false;
let len = this.examInfo.records.length;
if (this.examInfo.info.times > len) {
this.examInfo.allowSubmit = true;
} else {
this.examInfo.allowSubmit = false;
}
} else {
this.$message.error(res.message);
}
});
},
showExamAnswer(item) {
//显示试卷的答卷信息
this.examInfo.detailShow=true;
apicourseStudy.myExamPaper(item.id).then(rs=>{
if(rs.status==200){
this.examInfo.detailItems=JSON.parse(rs.result.paper).items
}
});
},
testType(type) {
//此方法移到tools中
@@ -826,145 +696,9 @@ export default {
this.homeworkInfo.filePath = res.result.filePath;
},
removeHomeworkFile() {
this.$confirm("您确定要删除已上传的附件吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.homeworkInfo.filePath = "";
//从服务器端删除
this.$message({ type: "success", message: "删除成功!" });
});
},
submitHomework() {
//提交作业
if (this.homeworkInfo.content.submitMode == 1) {
if (this.homeworkInfo.filePath == "") {
this.$message.error("请上传作业内容");
return;
}
} else if (this.homeworkInfo.content.submitMode == 2) {
if (this.homeworkInfo.answer == "") {
this.$message.error("请先填写作业内容");
return;
}
} else {
if (
this.homeworkInfo.answer == "" &&
this.homeworkInfo.filePath == ""
) {
this.$message.error("请填写或上传作业");
return;
}
}
let pamars = {
studyItemId: this.homeworkInfo.studyItemId, //学习内容记录id,
studyId: this.studyId, //学习id,
courseId: this.courseInfo.id, //课程id,
contentId: this.homeworkInfo.content.id, //内容id,
hwId: this.homeworkInfo.info.id, //作业的id
hwName: this.homeworkInfo.info.name, //作业的名称
//hwContent: this.homeworkInfo.info.content,//作业的内容,先不要此字段了
filePath: this.homeworkInfo.filePath, //文件的路径,可以为空,
hwAnswer: this.homeworkInfo.answer, //文本提交的信息
score: 0
};
apicourseStudy.saveHomework(pamars).then(res => {
if (res.status == 200) {
this.$message.success("作业已提交");
this.homeworkInfo.filePath = "";
this.homeworkInfo.answer = "";
this.homeworkInfo.records.push(res.result);
} else {
this.$message.error(res.message);
}
});
},
appendStudyTime() {
if(this.studyId==''){
return;
}
//追加学习时间
let $this = this;
if (this.appendStartTime == null) {
this.appendStartTime = new Date();
setTimeout(function() {
$this.appendStudyTime();
}, 60000);
return;
}
let now = new Date();
let m = now.getTime() - this.appendStartTime.getTime(); //相差的毫秒数
let sen = parseInt(m / 1000); //计算秒数
if (sen > 0) {
let postData = {
studyId: this.studyId,
courseId: this.courseInfo.id,
contentId: this.coursewareInfo.content.id,
studyInfo:
this.courseInfo.name +
"-" +
this.coursewareInfo.content.contentName,
duration: sen
};
apicourseStudy.appendStudyTime(postData).then(rs => {
if (rs.status == 200) {
$this.appendStartTime = new Date(); //重置开始时间10秒后再记录一次
setTimeout(function() {
$this.appendStudyTime();
}, 60000);
} else {
console.log(rs.message);
}
});
} else {
setTimeout(function() {
$this.appendStudyTime();
}, 60000);
}
},
loadStudyInfo() {
//获取学习信息
let $this = this;
this.loadScorePraiseAndTrample();
apicourseStudy.studyInfo(this.courseInfo.id).then(res => {
if (res.status == 200) {
res.result.signup ? (this.enrollStutas = 2) : (this.enrollStutas = 1);
if(res.result.signup) {
//this.loadScorePraiseAndTrample();
this.appendStudyTime();
this.studyId = res.result.studyId; //设置学习id
//需要判断此内容是否已学习完成,如果已学习完成,不需要再请不说了
res.result.contents.forEach(con => {
if (con.contentId == $this.coursewareInfo.content.id) {
$this.coursewareInfo.finish = true; //课件已学习
$this.coursewareInfo.studyItemId=con.id;
if(con.lastStudyTime!='' && con.lastStudyTime>0){
//当前视频学习的时间
$this.videoPlayingTime=con.lastStudyTime;
//如果视频已经播放完了
}
//console.log()
}else if (con.contentId == $this.homeworkInfo.content.id) {
$this.homeworkInfo.studyItemId = con.id;
}else if (con.contentId ==$this.examInfo.content.id) {
$this.examInfo.studyItemId = con.id;
}else if (con.contentId == $this.assessInfo.content.id) {
$this.assessInfo.studyItemId = con.id;
}
});
if (!$this.coursewareInfo.finish) {
setTimeout(() => {
$this.saveStudyInfo();
}, 5000); //5秒后记录学习
}
}
} else {
this.$message.error(res.message);
}
});
},
loadHomeworkInfo() {
apiCourse.getHomework(this.homeworkInfo.content.id).then(res => {
@@ -1018,137 +752,19 @@ export default {
signType: 1,
signInfo: ""
};
let $this = this;
// apicourseStudy.signup(pamars).then(res => {
// if (res.status == 200) {
// this.$message({ type: "success", message: "报名成功" });
// this.enrollStutas = 2;
// this.appendStudyTime(); //报名成功记录开始时间
// //报名成功后就直接记录课件学习情况5秋后
// setTimeout(() => {
// $this.saveStudyInfo();
// }, 5000);
// } else {
// this.$message.error(res.message);
// }
// });
},
assessSubmitFun() {
let dataJson = JSON.stringify(this.assessInfo.info);
//计算评估得分
let countStr = this.assessInfo.info.resultCount;
let countScore = 0;
let pass = true;
this.assessInfo.info.items.forEach((item, idx) => {
if (item.qType == 1) {
if (item.answer == 0) {
pass = false;
}
var str = "[q" + (idx + 1) + "]";
countStr = countStr.replace(str, item.answer);
}
});
if (!pass) {
this.$message.error("请填写完整再提交");
return;
}
//console.log(countStr);
countScore = eval(countStr);
//console.log(countScore,"countScore");
let pamars = {
studyItemId: this.assessInfo.studyItemId, //学习内容记录id,
studyId: this.studyId, //学习id,
courseId: this.courseInfo.id, //课程id,
contentId: this.assessInfo.content.id, //内容id,
asContent: dataJson, //内容
asScore: countScore //评估得分
};
apicourseStudy.saveAssess(pamars).then(res => {
if (res.status == 200) {
this.assessInfo.allowSubmit = false;
this.$message.success("提交成功,谢谢您的评估");
} else {
this.$message.error(res.message);
}
});
this.enrollStutas = 2;
},
loadScorePraiseAndTrample() {
//加载是否打过分
//if(this.enrollStutas>1){
apiCourseGrade.has(this.courseInfo.id).then(rs => {
if (rs.status == 200 && rs.result) {
this.scoreInfo.has = true;
}
});
//}
apiPraises.has(1, this.courseInfo.id).then(rs => {
if (rs.status == 200 && rs.result) {
this.isPraise = true;
}
});
apiTrample.has(this.courseInfo.id).then(rs => {
if (rs.status == 200 && rs.result) {
this.isTrample = true;
}
});
},
addScore() {
let postData = {
courseId: this.courseInfo.id,
studyId: this.studyId,
score: this.scoreInfo.score
};
if (this.scoreInfo.score > 0) {
apiCourseGrade.grade(postData).then(rs => {
if (rs.status == 200) {
this.$message.success("打分成功,谢谢您的打分");
this.scoreInfo.has = true;
} else {
this.$message.error("打分处理失败,请稍后再试");
}
});
}
},
praiseContent() {
if(this.enrollStutas==1){
this.$message.error("报名学习之后才可以点赞");
return;
}
if(this.isTrample){
this.$message.error("您已踩过了,不能再赞了");
return;
}
let postData = {
objType: 1,
objId: this.courseInfo.id,
title: this.courseInfo.name
};
apiPraises.save(postData).then(rs => {
if (rs.status == 200) {
this.$message.success("点赞成功");
this.isPraise = true;
} else {
this.$message.error("点赞失败,请稍后再试");
}
});
},
treadContent() {
if(this.enrollStutas==1){
this.$message.error("只有报名学习后才可以踩");
return;
}
if(this.isPraise){
this.$message.error("您已赞过了,不能再踩了");
return;
}
apiTrample.trample(this.courseInfo.id).then(rs => {
if (rs.status == 200) {
this.$message.success("已踩");
this.isTrample = true;
} else {
this.$message.error("踩失败,请稍后再试");
}
});
},
loadAuthorInfo(list,ids){ //加载作者信息,头像,机构信息
if(ids.length==0){

View File

@@ -265,26 +265,26 @@ export default {
//console.log("播放结束");
},
onPlayerPlaying(itme){
//console.log("当前播放"+itme);
//console.log("当前播放11"+itme);
if(this.contentData.contentType && this.contentData.contentType==10){
let intTime=parseInt(itme);
this.contentData.lastStudyTime=intTime;
let saveTime=Math.floor(intTime%10);
if(intTime>10 && saveTime==0 && this.contentData.studyItemId!=''){
//记录播放时间
//console.log('记录播放时间:'+intTime);
let postData={
itemId:this.contentData.studyItemId,
videoTime:intTime
}
apiStudy.studyVideoTime(postData).then(rs=>{
if(rs.status!=200){
console.log('记录播放时间错误');
}
})
}
}
// //console.log("当前播放"+itme);
// //console.log("当前播放11"+itme);
// if(this.contentData.contentType && this.contentData.contentType==10){
// let intTime=parseInt(itme);
// this.contentData.lastStudyTime=intTime;
// let saveTime=Math.floor(intTime%10);
// if(intTime>10 && saveTime==0 && this.contentData.studyItemId!=''){
// //记录播放时间
// //console.log('记录播放时间:'+intTime);
// let postData={
// itemId:this.contentData.studyItemId,
// videoTime:intTime
// }
// apiStudy.studyVideoTime(postData).then(rs=>{
// if(rs.status!=200){
// console.log('记录播放时间错误');
// }
// })
// }
// }
},
audioPlaying(item){
@@ -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=>{
@@ -327,88 +327,12 @@ export default {
}
this.contentList=rs.result.contents;
this.totalContent=rs.result.contents.length;
//加载学习的数据
this.loadStudyData();
}else{
this.$message.error(rs.message);
}
})
},
loadStudyData() {
let $this=this;
apiStudy.studyInfo(this.courseId).then(res=>{
if(res.status == 200) {
if(res.result.signup){
// this.loadScorePraiseAndTrample();
this.studyId = res.result.studyId;
//对已学习的内容进行比对,重要的字段, 学习内容id在后缀的
let playIndex=-1;
this.contentList.forEach((con,conIdx)=>{
res.result.contents.forEach((scon,sconIdx)=>{
if(scon.contentId==con.id){
//定位显示的内容
if($this.initContentId!='' && $this.initContentId==scon.contentId){
//定位当前学习的内容,是上一次学习的内容
playIndex=conIdx;
}else{
if(sconIdx==0 && con.contentType<52){
playIndex=conIdx;
}
}
//console.log(scon.contentId,con.id);
con.lastStudyTime=scon.lastStudyTime;
con.status=9;//因为现在是只要有学习过的就代表已学习完成,所以直接设置学习完成状态,
con.studyItemId=scon.id;//这个就是学习内容条目的id
//console.log(scon.id,"scon.id");
//console.log(con,"scon.id");
}
})
});
//如果没有就定位第一项内容
if(playIndex==-1){
this.showRes(this.contentList[0]);
}else{
this.showRes(this.contentList[playIndex]);
}
}else{
// this.$message.error('您还未报名');
// if(this.courseInfo.type==10){
// location.href = this.webBaseUrl + "/course/micro?id="+this.courseId;
// }else{
// location.href = this.webBaseUrl + "/course/detail?id="+this.courseId;
// }
}
} else {
this.$message.error(res.message);
}
})
},
saveStudyInfo() { //记录课件学习信息
if(this.contentData.contentType>=60){
//只有在课件页面停留超过5秒才会记录
return;
}
if(this.contentData.status==9){
//已学习完的,不用再添加
return;
}
let params ={
studyId: this.studyId,//学习id,
courseId: this.courseId,//课程id,
contentId: this.contentData.id,//内容id,
contentName: this.contentData.contentName,//内容名称
progress: 100,
contentTotal:this.totalContent
}
apiStudy.studyContent(params).then(res=>{
if(res.status == 200) {
this.contentData.status=9;//完成
this.contentData.studyItemId=res.result;//学习记录id
}else{
console.log('记录学习失败:'+res.message+''+res.error);
}
})
},
ctabChange(e) {
console.log(e);
},
@@ -439,91 +363,21 @@ export default {
}
}
// else if(r.contentType == 61) {// 考试
// }else if(r.contentType == 60) {// 作业
// }else if(r.contentType == 62) {// 评估
// //评估不需要查找因为内容就是content中
// console.log('评估处理');
// }
this.contentData = r;
// setTimeout(function(){$this.saveStudyInfo();},5000);//5秒后记录学习完成
},
videoEnd() {
//视频播放完成后的处理
},
handleChange(val) {
console.log(val);
},
// loadScorePraiseAndTrample(){
// //加载是否请过分
// apiCourseGrade.has(this.courseId).then(rs=>{
// if(rs.status==200 && rs.result){
// this.scoreInfo.has=true;
// }
// });
// apiPraises.has(1,this.courseId).then(rs=>{
// if(rs.status==200 && rs.result){
// this.isPraise=true;
// }
// });
// apiTrample.has(this.courseId).then(rs=>{
// if(rs.status==200 && rs.result){
// this.isTrample=true;
// }
// });
// },
addScore(){
let postData={
courseId:this.courseInfo.id,
studyId:this.studyId,
score:this.scoreInfo.score
}
if(this.scoreInfo.score>0){
apiCourseGrade.grade(postData).then(rs=>{
if(rs.status==200){
this.$message.success('打分成功,谢谢您的打分');
this.scoreInfo.has=true;
}else{
this.$message.error('打分处理失败,请稍后再试');
}
});
}
},
praiseContent(){
if(this.isTrample){
this.$message.error("您已踩过了不能再赞了");
return;
}
let postData={
objType:1,
objId:this.courseId,
title:this.courseInfo.name
}
apiPraises.save(postData).then(rs=>{
if(rs.status==200){
this.$message.success('点赞成功');
this.isPraise=true;
}else{
this.$message.error('点赞失败,请稍后再试');
}
})
},
treadContent(){
if(this.isPraise){
this.$message.error("您已赞过了,不能再踩了");
return;
}
apiTrample.trample(this.courseId).then(rs=>{
if(rs.status==200){
this.$message.success('已踩');
this.isTrample=true;
}else{
this.$message.error('踩失败,请稍后再试');
}
})
},
loadAuthorInfo(list,ids){ //加载作者信息,头像,机构信息
if(ids.length==0){

View File

@@ -1,7 +1,7 @@
<template>
<div id="answer-detail">
<portal-header current="qa" :goSearch="4"></portal-header>
<div class="portal-content xcontent" >
<div class="portal-content xcontent">
<el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb-nav">
<el-breadcrumb-item :to="{ path: '/qa' }">问答列表</el-breadcrumb-item>
<el-breadcrumb-item>问答详情</el-breadcrumb-item>
@@ -10,44 +10,52 @@
<div style="flex: 1;">
<el-row v-if="noData">
<el-card :body-style="{ padding: '0px' }" class="detail">
<div class="title" >
<div class="title">
<span class="qa-basic" :class="detailData.isResolve ? 'qa-solve' : 'qa-unSolve'">
{{ detailData.isResolve === true ? '【已解决】' : detailData.isResolve === false ? '【待解决】' : '' }}
</span>
{{ detailData.title }}
</div>
<div class="label" style="display: flex;margin: 9px 0 14px 0;justify-content: space-between;align-items: center;font-size: 12px;">
<div class="label"
style="display: flex;margin: 9px 0 14px 0;justify-content: space-between;align-items: center;font-size: 12px;">
<!-- <img :src="detailData.avatar || '/temp/index/male.jpg'" /> -->
<author width="24px" height="24px" :avatar="detailData.avatar" :name="detailData.name" :sex="detailData.sex"></author>
<author width="24px" height="24px" :avatar="detailData.avatar" :name="detailData.name"
:sex="detailData.sex"></author>
<!-- <author :avatar="detailData.avatar" :info="detailData.orgInfo" :name="detailData.name"></author> -->
<time-show :time="detailData.sysCreateTime"></time-show>
</div>
<div class="content">
<div style="word-break:break-all;">{{ detailData.content }}</div>
<div v-if="detailData.images" style="margin: 10px 0px;"><el-image :src="fileUrl + detailData.images" fit="scaleDown" /></div>
<div v-if="detailData.images" style="margin: 10px 0px;">
<el-image :src="fileUrl + detailData.images" fit="scaleDown" />
</div>
</div>
<div class="btn-div">
<div class="write-btn" @click="answerShow=true">
<div class="write-btn" @click="answerShow = true">
<el-button type="text" icon="el-icon-edit">写回答</el-button>
</div>
<span class="answer-total">共计{{detailData.answers}}条回答</span>
<interactBar v-if="detailData.id" :type="4" :comments="false" :data="detailData" :views="false"></interactBar>
<span class="answer-total">共计{{ detailData.answers }}条回答</span>
<interactBar v-if="detailData.id" :type="4" :comments="false" :data="detailData" :views="false">
</interactBar>
</div>
</el-card>
<div v-if="answerShow">
<el-card :body-style="{ padding: '0px' }" style="padding: 20px;">
<div>
<el-input type="textarea" rows="5" placeholder="写下您的答案(800字以内),可以@提问者哦~" minlength="1" maxlength="800" v-model="content"></el-input>
<el-input type="textarea" rows="5" placeholder="写下您的答案(800字以内),可以@提问者哦~" minlength="1" maxlength="800"
v-model="content"></el-input>
</div>
<div style="padding-top: 10px;">
<el-button type="primary" :disabled="!checked" class="dian-btn" @click="publishAnswer">发布</el-button>
<!-- <el-checkbox style="margin-left:20px" v-model="checked"></el-checkbox><span style="margin-left:10px" @click="qaFormCheckedShow = true">我已阅读并遵守平台内容发布要求</span> -->
<el-checkbox style="margin-left:20px" v-model="checked"></el-checkbox><span style="font-size:14px;color:#787878;margin-left:10px">我已阅读并遵守<span style="color:#588afc;cursor: pointer;" @click="qaFormCheckedShow = true">平台内容发布要求</span></span>
<el-checkbox style="margin-left:20px" v-model="checked"></el-checkbox><span
style="font-size:14px;color:#787878;margin-left:10px">我已阅读并遵守<span
style="color:#588afc;cursor: pointer;" @click="qaFormCheckedShow = true">平台内容发布要求</span></span>
</div>
</el-card>
</div>
<el-card class="box-card" v-if="answerList.length ==0&&!answerShow" :body-style="{ padding: '0px' }">
<el-card class="box-card" v-if="answerList.length == 0 && !answerShow" :body-style="{ padding: '0px' }">
<div>
<div style="height:50px;margin-top: 50px;">
<img style="width:50px" src="../../../assets/images/icon/anser.png" alt="" srcset="">
@@ -65,29 +73,49 @@
<el-button type="primary" class="dian-btn" @click="publishAnswer">发布</el-button>
</el-card> -->
<el-card :body-style="{ padding: '0px' }" class="answer-reply-box">
<div class="answer" v-for="(item, index) of answerList" :key="item.id" :style="index === answerList.length - 1 ? 'border-bottom:none;' : ''">
<div class="answer" v-for="(item, index) of answerList" :key="item.id"
:style="index === answerList.length - 1 ? 'border-bottom:none;' : ''">
<div class="answer-top">
<div><author :avatar="item.avatar" :name="item.sysCreateBy" :sex="item.sex"></author></div>
<div>
<span v-if="detailData.isResolve&&item.isBest" style="color: #ffb30f">最佳答案</span>
<el-button type="primary" v-if="!detailData.isResolve && detailData.sysCreateAid == userInfo.aid" class="zuijia" @click="editAnsweBest(item)">设为最佳答案</el-button>
<author :avatar="item.avatar" :name="item.sysCreateBy" :sex="item.sex"></author>
</div>
<div>
<span v-if="detailData.isResolve && item.isBest" style="color: #ffb30f">最佳答案</span>
<el-button type="primary"
v-if="!detailData.isResolve && detailData.sysCreateAid == userInfo.aid" class="zuijia"
@click="editAnsweBest(item)">设为最佳答案</el-button>
</div>
</div>
<div class="answer-body">
<div @mouseover="showButtons(item.id)" @mouseout="hideButtons()"><!--在这一层上加事件-->
<div class="answer-text">{{ displayAll(item) }}
<span v-if="item.content.length>170" @click="changeIsAll(item)">{{item.isAll?'收起':'全文'}}</span>
<div @mouseover="showButtons(item.id)" @mouseout="hideButtons()">
<!--在这一层上加事件-->
<div class="answer-text">
<span style="color: #303133" v-html="displayAll(item)"></span>
<span v-if="item.content.length > 170" @click="changeIsAll(item)">{{ item.isAll ? '收起' : '全文'
}}</span>
</div>
<div class="answer-time">
<div>回答于 <time-show :time="item.sysCreateTime"></time-show></div>
<div style="margin-right: 10px;"><interactBar :type="5" :comments="false" :favorites="false" :data="item" :shares="false" :views="false"></interactBar></div>
<div>回答于 <time-show :time="item.sysCreateTime"></time-show>
</div>
<div style="margin-right: 10px;">
<interactBar :type="5" :comments="false" :favorites="false" :data="item" :shares="false"
:views="false"></interactBar>
</div>
</div>
<div class="answer-boot">
<div class="answer-boot-btns">
<div v-show="btnsShowRowId==item.id">
<a @click="showRowInput(item,{})"><svg-icon icon-class="comment" style="margin-right: 0px;font-size: 16px;"></svg-icon><span>回复</span></a>
<a v-if="item.sysCreateAid == userInfo.aid" @click="editAnswer(item)"> <i class="el-icon-edit" style="margin-right:10px;font-size: 15px;color: #8590A6; ">编辑</i></a>
<a v-if="item.sysCreateAid == userInfo.aid" @click="delAnswer(item)"><svg-icon icon-class="remove" style="margin-right: 0px;font-size: 16px;"></svg-icon><span>删除</span></a>
<div v-show="btnsShowRowId == item.id">
<a @click="showRowInput(item, {})">
<svg-icon icon-class="comment" style="margin-right: 0px;font-size: 16px;"></svg-icon>
<span>回复</span>
</a>
<a v-if="item.sysCreateAid == userInfo.aid" @click="editAnswer(item)"> <i
class="el-icon-edit"
style="margin-right:10px;font-size: 15px;color: #8590A6; ">编辑</i></a>
<a v-if="item.sysCreateAid == userInfo.aid" @click="delAnswer(item)">
<svg-icon icon-class="remove" style="margin-right: 0px;font-size: 16px;"></svg-icon>
<span>删除</span>
</a>
<!-- <a v-if="item.answers && item.answers.length==5" @click="showMoreReply(item)" ><svg-icon icon-class="all" style="margin-right: 0px;font-size: 16px;"></svg-icon><span>全部回复</span></a> -->
</div>
<!-- <i class="el-icon-chat-line-round" @click="showRowInput(item,{})" style="margin-right:10px;"></i>
@@ -96,54 +124,64 @@
</div>
</div>
<!---->
<div v-show="curParentId==item.id" class="answer-reply">
<el-input type="textarea" v-model="replyContent" show-word-limit maxlength="800" placeholder="回复内容"></el-input>
<el-button type="primary" @click="replyContentMethod(item,{})">发布回复</el-button>
<div v-show="curParentId == item.id" class="answer-reply">
<el-input type="textarea" v-model="replyContent" show-word-limit maxlength="800"
placeholder="回复内容"></el-input>
<el-button type="primary" @click="replyContentMethod(item, {})">发布回复</el-button>
</div>
</div>
<!--一级评论二级数据-->
<div v-if="item.answers && item.answers.length!=0">
<div class="comment" v-for="(con,i) in item.answers" :key="i" :class="i===item.answers.length-1 ? 'comment-last' : ''">
<div v-if="item.answers && item.answers.length != 0">
<div class="comment" v-for="(con, i) in item.answers" :key="i"
:class="i === item.answers.length - 1 ? 'comment-last' : ''">
<div class="comment-top">
<div class="comment-author">
<author :avatar="con.avatar" :name="con.sysCreateBy" :sex="con.sex"></author>
<span class="comment-author-text">回复</span>
<span style="margin-left: 10px; font-size:14px">{{con.replayName}}</span>
<span style="margin-left: 10px; font-size:14px">{{ con.replayName }}</span>
</div>
<div class="comment-time">
<time-show :time="con.sysCreateTime"></time-show>
</div>
</div>
<div class="comment-body" >
<div class="comment-body">
<div class="comment-info" @mouseover="showButtons(con.id)" @mouseout="hideButtons()">
<div class="comment-content">
{{ displayAll(con) }}
<span v-if="con.content.length>170" @click="changeIsAll(con)">
{{con.isAll?'收起':'全文'}}
<span style="color: #303133" v-html="displayAll(con)"></span>
<span v-if="con.content.length > 170" @click="changeIsAll(con)">
{{ con.isAll ? '收起' : '全文' }}
</span>
</div>
<div class="comment-btns">
<div v-show="btnsShowRowId==con.id">
<a @click="showRowInput(con,item)"><svg-icon icon-class="comment" style="margin-right: 0px;font-size: 16px;"></svg-icon><span>回复</span></a>
<a v-if="con.sysCreateAid == userInfo.aid" @click="delAnswer(con)"><svg-icon icon-class="remove" style="margin-right: 0px;font-size: 16px;"></svg-icon><span>删除</span></a>
<div v-show="btnsShowRowId == con.id">
<a @click="showRowInput(con, item)">
<svg-icon icon-class="comment" style="margin-right: 0px;font-size: 16px;">
</svg-icon><span>回复</span>
</a>
<a v-if="con.sysCreateAid == userInfo.aid" @click="delAnswer(con)">
<svg-icon icon-class="remove" style="margin-right: 0px;font-size: 16px;"></svg-icon>
<span>删除</span>
</a>
</div>
<!-- <i class="el-icon-chat-line-round" @click="showRowInput(con,item)" style="margin-right:10px;"></i>
<i class="el-icon-edit" style="margin-right:10px;" v-if="con.sysCreateAid == userInfo.aid" @click="editAnswer(con)"></i>
<i class="el-icon-delete" v-if="detailData.sysCreateAid == userInfo.aid||con.sysCreateAid == userInfo.aid" @click="delAnswer(con)"></i> -->
</div>
<div class="comment-reply" v-show="curParentId==con.id">
<el-input type="textarea" v-model="replyContent" placeholder="回复内容" show-word-limit maxlength="100"></el-input>
<el-button type="primary" @click="replyContentMethod(con,item)">发布回复</el-button>
<div class="comment-reply" v-show="curParentId == con.id">
<el-input type="textarea" v-model="replyContent" placeholder="回复内容" show-word-limit
maxlength="100"></el-input>
<el-button type="primary" @click="replyContentMethod(con, item)">发布回复</el-button>
</div>
</div>
<!--三级数据-->
<div v-if="con.answers && con.answers.length>0">
<div class="comment" v-for="(row,rowIdx) in con.answers" :key="rowIdx" :class="rowIdx===con.answers.length-1 ? 'comment-last' : ''">
<div v-if="con.answers && con.answers.length > 0">
<div class="comment" v-for="(row, rowIdx) in con.answers" :key="rowIdx"
:class="rowIdx === con.answers.length - 1 ? 'comment-last' : ''">
<div class="comment-top">
<div class="comment-author">
<author :avatar="row.avatar" :name="row.sysCreateBy" :sex="row.sex"></author>
<span class="comment-author-text">回复</span>
<span style="margin-left: 10px; font-size:14px">{{row.replayName}}</span>
<span style="margin-left: 10px; font-size:14px">{{ row.replayName }}</span>
</div>
<div class="comment-time">
<time-show :time="row.sysCreateTime"></time-show>
@@ -152,15 +190,21 @@
<div class="comment-body">
<div class="comment-info" @mouseover="showButtons(row.id)" @mouseout="hideButtons()">
<div class="comment-content">
{{ displayAll(row) }}
<span v-if="row.content.length>170" @click="changeIsAll(row)">
{{row.isAll?'收起':'全文'}}
<span style="color: #303133" v-html="displayAll(row)"></span>
<span v-if="row.content.length > 170" @click="changeIsAll(row)">
{{ row.isAll ? '收起' : '全文' }}
</span>
</div>
<div class="comment-btns">
<div v-show="btnsShowRowId==row.id">
<a @click="showRowInput(row,con)"><svg-icon icon-class="comment" style="margin-right: 0px;font-size: 16px;"></svg-icon><span>回复</span></a>
<a v-if="row.sysCreateAid == userInfo.aid" @click="delAnswer(row)"><svg-icon icon-class="remove" style="margin-right: 0px;font-size: 16px;"></svg-icon><span>删除</span></a>
<div v-show="btnsShowRowId == row.id">
<a @click="showRowInput(row, con)">
<svg-icon icon-class="comment" style="margin-right: 0px;font-size: 16px;">
</svg-icon><span>回复</span>
</a>
<a v-if="row.sysCreateAid == userInfo.aid" @click="delAnswer(row)">
<svg-icon icon-class="remove" style="margin-right: 0px;font-size: 16px;">
</svg-icon><span>删除</span>
</a>
</div>
<!-- <i class="el-icon-thumb" style="margin-right:10px;"></i> -->
<!-- <i class="el-icon-chat-line-round" @click="showRowInput(row,con)" style="margin-right:10px;"></i>
@@ -168,16 +212,18 @@
<i class="el-icon-delete" v-if="detailData.sysCreateAid == userInfo.aid||row.sysCreateAid == userInfo.aid" @click="delAnswer(row)"></i> -->
</div>
</div>
<div class="comment-reply" v-show="curParentId==row.id">
<el-input type="textarea" v-model="replyContent" show-word-limit maxlength="100" placeholder="回复内容"></el-input>
<el-button type="primary" @click="replyContentMethod(row,con)">发布回复</el-button>
<div class="comment-reply" v-show="curParentId == row.id">
<el-input type="textarea" v-model="replyContent" show-word-limit maxlength="100"
placeholder="回复内容"></el-input>
<el-button type="primary" @click="replyContentMethod(row, con)">发布回复</el-button>
</div>
</div>
</div>
</div>
</div><!--二级数据结束-->
</div>
<!--二级数据结束-->
</div>
</div>
</div>
@@ -185,7 +231,8 @@
</el-card>
<div class="pagination-div">
<span class="pag-text" @click="loadMore()" v-if="moreState == 1">加载更多</span>
<span class="pag-text-msg" style="font-size:14px;color: #444444;" v-else-if="moreState == 3">没有更多数据了</span>
<span class="pag-text-msg" style="font-size:14px;color: #444444;"
v-else-if="moreState == 3">没有更多数据了</span>
</div>
</div>
</div>
@@ -196,13 +243,14 @@
</div>
<div style="width: 245px;margin-left: 5px;">
<el-row>
<div class="qa-ranking" >
<div class="qa-ranking">
<div style="margin-bottom:15px;padding: 0">
<el-button style="height: 100%;height: 37px;border-radius: 0; width: 100%;" @click="$refs.addQuestion.askQuestionDialog = true" type="primary">提问题</el-button>
<el-button style="height: 100%;height: 37px;border-radius: 0; width: 100%;"
@click="$refs.addQuestion.askQuestionDialog = true" type="primary">提问题</el-button>
</div>
<div :span="24" style="padding:0">
<el-card class="ranking-card">
<div slot="header" >
<div slot="header">
<span style="font-size: 14px;font-weight: 600;color: #333333;">贡献排行榜</span>
<!-- <el-radio-group v-model="anking" size="mini" style="float: right">
<el-radio-button label="年"></el-radio-button>
@@ -212,12 +260,13 @@
</div>
<div style="padding-bottom:10px">
<el-row class="ranking-title bacolor" v-for="(item, index) in ankingList" :key="index" >
<el-col :span="6" style="height:34px;" >
<img style="margin-top: 5px;" v-if="index===0" :src="`${webBaseUrl}/images/first.png`"/>
<img style="margin-top: 5px;" v-if="index===1" :src="`${webBaseUrl}/images/second.png`"/>
<img style="margin-top: 5px;" v-if="index===2" :src="`${webBaseUrl}/images/third.png`"/>
<span style="margin-left: 10px" v-if="index!=2&&index!=0&&index!=1">{{index+1}}</span>
<el-row class="ranking-title bacolor" v-for="(item, index) in ankingList" :key="index">
<el-col :span="6" style="height:34px;">
<img style="margin-top: 5px;" v-if="index === 0" :src="`${webBaseUrl}/images/first.png`" />
<img style="margin-top: 5px;" v-if="index === 1" :src="`${webBaseUrl}/images/second.png`" />
<img style="margin-top: 5px;" v-if="index === 2" :src="`${webBaseUrl}/images/third.png`" />
<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="top-start"> -->
<el-col :span="18" class="one-line-ellipsis"> {{ item.sysCreateUname }}</el-col>
@@ -243,7 +292,8 @@
</div>
<addQuestion ref="addQuestion" @sure="toDetail"></addQuestion>
<editQuestion ref="editQuestion" @enSure="enSure" :editData="editData"></editQuestion>
<el-dialog class="checked-show" :visible.sync="qaFormCheckedShow" width="800px" top="14vh" :show-close="false" :modal="false">
<el-dialog class="checked-show" :visible.sync="qaFormCheckedShow" width="800px" top="14vh" :show-close="false"
:modal="false">
<agreement></agreement>
<span slot="footer" class="dialog-footer">
<!-- <el-button @click="qaFormCheckedShow = false"> </el-button> -->
@@ -290,7 +340,7 @@ export default {
},
data() {
return {
noData:true,
noData: true,
qaFormCheckedShow: false,
checked: false,
// sex:null,
@@ -311,19 +361,19 @@ export default {
anking: 2, //排行榜
ankingList: [],
controlListNew: [], //用来控制回复输入框的显示与否
curParent:{},//当前输入的上级的对象用于往answers中追加回复的内容
curParentId:'',//当前回复的内容的id
replyContent: "" ,//回复的内容
readonly:false,//是否只读,用于预览
btnsShowRowId:'',//显示的button的条目id
replyDiaglog:{
show:false,
pageIndex:1,
pageSize:8,
pages:1,
count:0,
commentId:'',
list:[]
curParent: {},//当前输入的上级的对象用于往answers中追加回复的内容
curParentId: '',//当前回复的内容的id
replyContent: "",//回复的内容
readonly: false,//是否只读,用于预览
btnsShowRowId: '',//显示的button的条目id
replyDiaglog: {
show: false,
pageIndex: 1,
pageSize: 8,
pages: 1,
count: 0,
commentId: '',
list: []
}
};
},
@@ -386,10 +436,10 @@ export default {
},
messageSave(type) {
let content;
if(type == "set") {
if (type == "set") {
content = this.userInfo.name + "设置了我的回答为" + "-" + this.detailData.title + "为最佳答案";
}
if(type == "send") {
if (type == "send") {
content = this.userInfo.name + "回答了我的问答" + "-" + this.detailData.title;
}
let message = {
@@ -411,13 +461,13 @@ export default {
this.editData = {};
this.loadAnswer();
},
showRowInput(row,parent){ //显示行输框
if(this.curParentId){
this.curParentId='';
this.curParent={};
}else{
this.curParentId=row.id;
this.curParent=parent;
showRowInput(row, parent) { //显示行输框
if (this.curParentId) {
this.curParentId = '';
this.curParent = {};
} else {
this.curParentId = row.id;
this.curParent = parent;
}
},
//获取问题详细信息
@@ -433,7 +483,7 @@ export default {
if (JSON.stringify(this.detailData) != "{}") {
this.getQaUserData(this.detailData);
}
}else{
} else {
this.noData = false;
this.$message.error(res.message);
}
@@ -446,7 +496,7 @@ export default {
this.answerList = [];
}
this.moreState = 2;
if(this.pageIndex == 1) {
if (this.pageIndex == 1) {
// 重置数据
this.answerList = [];
}
@@ -459,15 +509,15 @@ export default {
if (res.status == 200) {
let allList = [];
let ids = [];
let level3ParentIds=[];
let level3ParentIds = [];
if (res.result.list.length != 0) {
res.result.list.forEach(item => {
item.avatar = "";
item.sex = null;
item.isAll=false;//字数过大时,显示隐藏控制
item.isAll = false;//字数过大时,显示隐藏控制
allList.push(item);
ids.push(item.sysCreateAid);
if(item.answers && item.answers.length != 0) {
if (item.answers && item.answers.length != 0) {
item.answers.forEach(answers => {
answers.avatar = "";
answers.sex = null;
@@ -482,9 +532,9 @@ export default {
this.answerList.push(...res.result.list);
this.loadLevel3Data(level3ParentIds);
}
if(res.result.totalPages>this.pageIndex){
if (res.result.totalPages > this.pageIndex) {
that.moreState = 1;
}else{
} else {
that.moreState = 3;
}
} else {
@@ -495,26 +545,26 @@ export default {
});
},
//加载第三级的数据
loadLevel3Data(commentIdArray){
let $this=this;
if(commentIdArray && commentIdArray.length>0){
apiQa.replayClevel3(commentIdArray).then(rs=>{
if(rs.status==200){
loadLevel3Data(commentIdArray) {
let $this = this;
if (commentIdArray && commentIdArray.length > 0) {
apiQa.replayClevel3(commentIdArray).then(rs => {
if (rs.status == 200) {
//先处理头像
let aids=[];
rs.result.forEach(item=>{
let aids = [];
rs.result.forEach(item => {
item.avatar = "";
item.sex=null;
item.isAll=false;
item.sex = null;
item.isAll = false;
aids.push(item.sysCreateAid);
});
$this.getUserInfoList(rs.result,aids);
$this.answerList.forEach(one1=>{
if(one1.answers.length>0){
one1.answers.forEach(one2=>{
one2.answers=one2.answers? one2.answers:[];
rs.result.forEach(rsRow=>{
if(rsRow.commentId==one2.id){
$this.getUserInfoList(rs.result, aids);
$this.answerList.forEach(one1 => {
if (one1.answers.length > 0) {
one1.answers.forEach(one2 => {
one2.answers = one2.answers ? one2.answers : [];
rs.result.forEach(rsRow => {
if (rsRow.commentId == one2.id) {
one2.answers.push(rsRow);
}
})
@@ -572,10 +622,10 @@ export default {
// if(this.content.indexOf('@'+this.detailData.name)!=-1){
// content=this.content.slice(this.detailData.name.length+1)
// }
if(this.content.length < 1 || this.content.trim() == "@" + this.detailData.name) {
if (this.content.length < 1 || this.content.trim() == "@" + this.detailData.name) {
return this.$message.warning("请输入回答");
}else {
content = this.content;
} else {
content = this.content.trim();
}
apiQa.saveAnswer({
qid: this.$route.query.id,
@@ -583,16 +633,16 @@ export default {
}).then(res => {
if (res.status == 200) {
this.messageSave("send");
this.$message({message: "发布回答成功",type: "success"});
this.$message({ message: "发布回答成功", type: "success" });
this.answerShow = false;
this.getQuestionDetail();
this.loadAnswer();
this.content = "";
} else {
this.$message({message: res.message,type: "error"});
this.$message({ message: res.message, type: "error" });
}
}).catch(err => {
this.$message({message: "发布失败",type: "error"});
this.$message({ message: "发布失败", type: "error" });
});
},
//编辑回答
@@ -629,7 +679,7 @@ export default {
type: "error"
});
});
}).catch(() => {});
}).catch(() => { });
},
//设置为最佳答案
editAnsweBest(data) {
@@ -655,68 +705,71 @@ export default {
this.loadAnswer();
this.$off("ensure");
},
showButtons(id){
if(!this.readonly){
this.btnsShowRowId=id;
showButtons(id) {
if (!this.readonly) {
this.btnsShowRowId = id;
}
},
hideButtons(){
this.btnsShowRowId='';
hideButtons() {
this.btnsShowRowId = '';
},
//展示全部
displayAll(item) {
if(!item.isAll && item.content.length > 170) {
let content = '';
content = item.content.replace(/(\n){2,}/,'<br>');
item.content = content;
if (!item.isAll && item.content.length > 170) {
return item.content.slice(0, 170) + "...";
}
return item.content;
},
changeIsAll(item) {
item.isAll=!item.isAll;
item.isAll = !item.isAll;
},
openAnswer() {
this.answerShow = true;
},
replyContentMethod(data,parent) {
replyContentMethod(data, parent) {
if (!this.replyContent) {
return this.$message.error("回复内容不能为空");
}
//默认是一级评论2级数据
let replyData={
let replyData = {
replayAid: data.sysCreateAid,
replayName: data.sysCreateBy,
content: this.replyContent,
content: this.replyContent.trim(),
parentId: data.id,
commentId: "",
clevel: 2
}
//console.log(data,'data');
if(data.clevel==2){ //当前是一级评论
replyData.commentId=data.id;
replyData.clevel=3;
}else if(data.clevel>2){
replyData.commentId=data.commentId;
replyData.clevel=3;
if (data.clevel == 2) { //当前是一级评论
replyData.commentId = data.id;
replyData.clevel = 3;
} else if (data.clevel > 2) {
replyData.commentId = data.commentId;
replyData.clevel = 3;
}
apiQa.saveComment(replyData).then(res => {
if(res.status == 200) {
if (res.status == 200) {
res.result.avatar = "";
res.result.sex = null;
res.result.isAll = false;
this.$message.success("回复成功");
this.getUserInfoList([res.result], [res.result.sysCreateAid]);
this.curParentId='';
this.curParent={};
this.replyContent='';
this.curParentId = '';
this.curParent = {};
this.replyContent = '';
//添加到页面中
if(data.clevel<3){
if(data.answers){
if (data.clevel < 3) {
if (data.answers) {
data.answers.push(res.result);
}else{
data.answers=[];
} else {
data.answers = [];
data.answers.push(res.result);
}
}else{
} else {
parent.answers.push(res.result);
}
@@ -725,26 +778,26 @@ export default {
}
});
},
showMoreReply(comment){
this.replyDiaglog.pages=1;
this.replyDiaglog.count=0;
this.replyDiaglog.pageIndex=1;
this.replyDiaglog.list=[];
this.replyDiaglog.show=true;
this.replyDiaglog.commentId=comment.id;
showMoreReply(comment) {
this.replyDiaglog.pages = 1;
this.replyDiaglog.count = 0;
this.replyDiaglog.pageIndex = 1;
this.replyDiaglog.list = [];
this.replyDiaglog.show = true;
this.replyDiaglog.commentId = comment.id;
this.loadAllReplyData(false);
},
loadMoreReply(){
loadMoreReply() {
this.replyDiaglog.pageIndex++;
this.loadAllReplyData(true);
},
loadAllReplyData(append){
let params={
pageIndex:this.replyDiaglog.pageIndex,
pageSize:this.replyDiaglog.pageSize,
commentId:this.replyDiaglog.commentId
loadAllReplyData(append) {
let params = {
pageIndex: this.replyDiaglog.pageIndex,
pageSize: this.replyDiaglog.pageSize,
commentId: this.replyDiaglog.commentId
}
let $this=this;
let $this = this;
// apiComment.replyList(params).then(rs=>{
// if(rs.status==200){
// $this.replyDiaglog.count=rs.result.count;
@@ -774,22 +827,26 @@ export default {
</script>
<style scoped lang="scss">
::v-deep .checked-show{
.el-dialog__header{
padding:0;
::v-deep .checked-show {
.el-dialog__header {
padding: 0;
}
}
::v-deep .el-card__body {
padding: 0;
}
::v-deep .bacolor:nth-child(odd) {
background-color: #fff;
padding: 0 5px;
}
::v-deep .bacolor:nth-child(even) {
background-color: #f6f6f6;
padding: 0 5px;
}
.write-btn {
width: 80px;
// height: 50px;
@@ -806,67 +863,82 @@ export default {
line-height: 34px;
font-size: 15px;
color: #333333;
.center-titlt {
font-size: 15px;
color: #333333;
}
.center {
text-align: right;
}
img {
margin-top: 5px;
}
}
.detail {
background-color: #fff;
padding: 5px 20px 10px 20px;
.title {
margin-top: 20px;
font-size: 22px;
line-height: 30px;
word-break: break-all;
.resolve {
// padding: 3px;
color: #08a890;
margin-left: -10px;
}
.unResolve {
// padding:3px;
color: #588afc;
margin-left: -10px;
}
}
.label {
font-size: 15px;
color: #999999;
}
.content {
line-height: 21px;
margin: 14px 0 16px 0;
font-size: 15px;
color: #666666;
}
.btn-div {
display: flex;
align-items: center;
margin-bottom: 9px;
.answer-total {
font-size: 14px;
margin: 0 10px;
}
::v-deep .interact-bar-btns {
justify-content: flex-start !important;
}
}
.dian-btn {
margin-top: 50px;
width: 60%;
}
}
.answer {
margin-top: 14px;
background-color: #fff;
border-bottom: 1px solid #dddddd;
// padding: 5px 20px 20px 20px;
.answer-top {
font-size: 16px;
@@ -874,6 +946,7 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
img {
margin-right: 10px;
width: 30px;
@@ -881,6 +954,7 @@ export default {
border-radius: 50%;
vertical-align: middle;
}
.zuijia {
width: 106px;
height: 42px;
@@ -895,35 +969,42 @@ export default {
text-align: center;
}
}
.answer-body{
.answer-body {
padding-left: 40px;
.answer-text{
.answer-text {
margin: 20px 0 15px;
line-height: 24px;
white-space: pre-wrap;
word-break: break-all;
span {
color: #409eff;
cursor: pointer;
margin-left: 5px;
}
}
.answer-time{
.answer-time {
font-size: 14px;
color: #8590a6;
display: flex;
justify-content: space-between;
align-items: center;
}
.answer-boot{
.answer-boot {
height: 35px;
line-height: 35px;
display: flex;
justify-content: space-between;
.answer-boot-btns{
a{
margin-right:15px;
span{
.answer-boot-btns {
a {
margin-right: 15px;
span {
margin-left: 6px;
color: #8590A6;
font-size: 14px;
@@ -932,88 +1013,109 @@ export default {
}
}
.answer-reply {
display: flex;
margin-bottom: 10px;
.el-button {
margin-left: 10px;
}
}
}
// .bottom {
// text-align: right;
// }
}
.comment{
.comment {
margin-top: 10px;
background-color: #FFFFFF;
border-bottom: 1px solid #dddddd;
.comment-top{
.comment-top {
display: flex;
justify-content: space-between;
padding-bottom:10px;
padding-bottom: 10px;
font-weight: 500;
line-height: 30px;
font-size: 1.1em;
.comment-author{
.comment-author {
display: flex;
align-items: center;
height: 30px;
line-height: 30px;
.comment-author-text{
.comment-author-text {
margin-left: 10px;
color: #8590A6;
font-size:14px;
font-size: 14px;
}
}
.comment-time{
.comment-time {
color: #666666;
font-size: 12px;
}
}
.comment-body{
.comment-body {
padding-left: 40px;
.comment-content{
.comment-content {
padding-bottom: 0px;
word-break:break-all;
span{
white-space: pre-wrap;
word-break: break-all;
span {
cursor: pointer;
color: #409EFF
}
}
.comment-btns{
.comment-btns {
// padding: 5px 10px 10px 0px;
height: 35px;
line-height: 35px;
a{
margin-right:15px;
span{
a {
margin-right: 15px;
span {
margin-left: 6px;
color: #8590A6;
font-size: 14px;
}
}
}
.comment-reply {
display: flex;
margin-bottom: 10px;
.el-button {
margin-left: 10px;
}
}
}
.comment-replys{
.comment-replys {
padding-left: 40px;
}
}
.comment-last{
}
.comment-last {
border-bottom: none;
}
.answer-reply-box {
margin-top: 10px;
background-color: #fff;
padding: 5px 20px 10px 20px;
}
// ::v-deep .publishAnswer {
// padding: 24px 20px;
// .el-card__body {
@@ -1040,6 +1142,7 @@ export default {
margin-bottom: -24px;
height: 190px;
line-height: 40px;
.el-link {
line-height: 1;
}

View File

@@ -252,7 +252,7 @@ export default {
apiQa
.saveAnswer({
qid: this.answer.id,
content: this.answer.inputValue
content: this.answer.inputValue.trim()
})
.then(res => {
if (res.status == 200) {

View File

@@ -132,14 +132,14 @@
</div>
<div style="display: flex;justify-content: flex-end;cursor: pointer;">
<div @click="praiseContent">
<el-tooltip class="item" effect="light" :content="isPraise?'取消点赞':'点赞'" placement="top-start">
<el-tooltip class="item" effect="light" :content="isPraise?'取消点赞':'点赞'" placement="top-start" :visible-arrow="false" popper-class="text-tooltip">
<img class="icon-small" v-if="isPraise" :src="require('@/assets/images/icon/praise-active.png')" />
<img class="icon-small" v-else :src="require('@/assets/images/icon/praise.png')" />
</el-tooltip>
{{ courseInfo.praises }}
</div>
<div style="margin-left: 15px;" @click="treadContent">
<el-tooltip class="item" effect="light" :content="isTrample?'取消踩':'踩'" placement="top-start">
<el-tooltip class="item" effect="light" :content="isTrample?'取消踩':'踩'" placement="top-start" :visible-arrow="false" popper-class="text-tooltip">
<img class="icon-small" v-if="isTrample" :src="require('@/assets/images/icon/trample-active.png')" />
<img class="icon-small" v-else :src="require('@/assets/images/icon/trample.png')" />
</el-tooltip>
@@ -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,
@@ -313,7 +313,8 @@ export default {
isAppendTime:false,//是否追加学习时长
appentId:'',//当前追加的学习时长的id
appentInterval:30000,//追加学习时间的间隔 30秒加一次
handleTimeout:null
handleTimeout:null,
completed:[],
};
},
mounted() {
@@ -325,6 +326,7 @@ export default {
...mapGetters(['userInfo']),
catalogTree() {
let treeList = [];
this.completed = [];
let $this = this;
$this.sectionList.forEach(sec => {
let treeNode = { section: sec, children: [] };
@@ -338,6 +340,9 @@ export default {
finishCount++;
}
}
if(c.status == 9) {
$this.completed.push(c.id);
}
treeNode.children.push(c);
}
});
@@ -364,7 +369,7 @@ export default {
}else{
this.blobUrl=process.env.VUE_APP_BASE_API+'/xboe/m/course/cware/resource?sign='+urlSign;
}
console.log(this.blobUrl,'this.blobUrl');
//console.log(this.blobUrl,'this.blobUrl');
},
widthOpen(url) {
window.open(url, '_blank');
@@ -449,17 +454,17 @@ export default {
this.playerBoxShow = false;
let $this=this;
//console.log(this.contentData.status,'this.contentData.status');
if(this.contentData.status<9){
let completeType=this.curriculumData.completeSetup;
//console.log(completeType,'completeType');
if(completeType==0){
//默认5秒后学习完成.
$this.handleTimeout= setTimeout(function() {$this.saveStudyInfo();}, 5000); //5秒后记录学习完成
}else{
//先记录进行中的学习内容
this.saveStudyItem();
}
}
// if(this.contentData.status<9){
// let completeType=this.curriculumData.completeSetup;
// //console.log(completeType,'completeType');
// if(completeType==0){
// //默认5秒后学习完成.
// $this.handleTimeout= setTimeout(function() {$this.saveStudyInfo();}, 5000); //5秒后记录学习完成
// }else{
// //先记录进行中的学习内容
// this.saveStudyItem();
// }
// }
},
onPlayerPause() {
//console.log("暂停");
@@ -475,15 +480,15 @@ export default {
this.appendStartTime=null;
//console.log("当前播放"+itme);
//console.log("当前播放11"+itme);
if (this.contentData.contentType && this.contentData.contentType == 10) {
if (this.contentData.contentType && this.contentData.contentType == 10){
let intTime = parseInt(itme);
//判断是否完成
let completeType=this.curriculumData.completeSetup;
let completeSecond=this.curriculumData.second;
if(!completeSecond){
if(!completeSecond || completeType==0){
completeSecond=5;//如果没有就采用默认的时间了
}
if(completeType>0 && this.contentData.status<9){ //因为1按进度2按时长都是计算时间所以这里直接大于0处理
if(this.contentData.status<9){ //因为1按进度2按时长都是计算时间所以这里直接大于0处理
if(completeType==1){
let finishPercent=this.curriculumData.setupTage;
let videDuration=this.contentData.duration;
@@ -491,7 +496,7 @@ export default {
if(percent>=finishPercent){
this.finishStudyItem();
}
}else if(completeType==2){
}else{
if(intTime>=completeSecond){
this.finishStudyItem();
}
@@ -520,10 +525,10 @@ export default {
//判断是否完成
let completeType=this.curriculumData.completeSetup;
let completeSecond=this.curriculumData.second;
if(!completeSecond){
if(!completeSecond || completeType==0){
completeSecond=5;//如果没有就采用默认的时间了
}
if(completeType>0 && this.contentData.status<9){ //因为1按进度2按时长都是计算时间所以这里直接大于0处理
if(this.contentData.status<9){ //因为1按进度2按时长都是计算时间所以这里直接大于0处理
if(completeType==1){
let finishPercent=this.curriculumData.setupTage;
let videDuration=this.contentData.duration;
@@ -531,7 +536,7 @@ export default {
if(percent>=finishPercent){
this.finishStudyItem();
}
}else if(completeType==2){
}else{
if(intTime>=completeSecond){
this.finishStudyItem();
}
@@ -556,16 +561,16 @@ export default {
audioPlay() {
//console.log("开始播放");
let $this=this;
if(this.contentData.status!=9){
let completeType=this.curriculumData.completeSetup;
if(completeType==0){
//默认5秒后学习完成.
$this.handleTimeout= setTimeout(function() {$this.saveStudyInfo();}, 5000); //5秒后记录学习完成
}else{
//先记录进行中的学习内容
this.saveStudyItem();
}
}
// if(this.contentData.status!=9){
// let completeType=this.curriculumData.completeSetup;
// if(completeType==0){
// //默认5秒后学习完成.
// $this.handleTimeout= setTimeout(function() {$this.saveStudyInfo();}, 5000); //5秒后记录学习完成
// }else{
// //先记录进行中的学习内容
// this.saveStudyItem();
// }
// }
},
audioPause() {
//console.log("暂停");
@@ -575,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 => {
@@ -648,8 +652,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]);
}
@@ -785,8 +790,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];
@@ -803,6 +809,28 @@ export default {
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:{

View File

@@ -511,6 +511,9 @@ export default {
return author.aid == item.question.sysCreateAid;
});
item = Object.assign(item, obj);
if(item.orgInfo){
item.orgInfo=cutFullName(obj.orgInfo,1);
}
return item;
});
} else {
@@ -597,6 +600,9 @@ export default {
return author.aid == item.cases.authorId;
});
item = Object.assign(item, obj);
if(item.orgInfo){
item.orgInfo=cutFullName(obj.orgInfo,1);
}
return item;
});
} else {
@@ -636,6 +642,9 @@ export default {
return author.aid == item.sysCreateAid;
});
item = Object.assign(item, obj);
if(item.orgInfo){
item.orgInfo=cutFullName(obj.orgInfo,1);
}
return item;
});
} else {