Merge branch 'case' into dev

# Conflicts:
#	.env.development
#	.gitignore
#	src/components/Course/weikeContent.vue
#	src/components/PdfPreview/view.vue
#	src/views/portal/case/Detail.vue
#	src/views/portal/case/Index.vue
This commit is contained in:
zhaofang
2022-06-07 19:03:18 +08:00
23 changed files with 1105 additions and 312 deletions

View File

@@ -14,7 +14,7 @@ VUE_APP_BOE_WEB_URL = 'https://u.boe.com'
VUE_APP_BOE_MOBILE_URL = 'http://192.168.0.10:8082/mobile' VUE_APP_BOE_MOBILE_URL = 'http://192.168.0.10:8082/mobile'
# File路径的基础url # File路径的基础url
VUE_APP_FILE_BASE_URL = 'http://localhost:8091/upload' VUE_APP_FILE_BASE_URL = 'http://192.168.0.10:9090/cdn/upload'
# File路径的基础url的相对路径加此项是为了不影响之前的路径配置 # File路径的基础url的相对路径加此项是为了不影响之前的路径配置
VUE_APP_FILE_RELATIVE_PATH = '/upload' VUE_APP_FILE_RELATIVE_PATH = '/upload'

4
.gitignore vendored
View File

@@ -1,3 +1 @@
node_modules /node_modules
node_modules
/dist

View File

@@ -95,6 +95,13 @@ const findAll=function(query){
const queryAll=function(query){ const queryAll=function(query){
return ajax.post('/xboe/m/favorite/queryAll',query); return ajax.post('/xboe/m/favorite/queryAll',query);
} }
/**
* 查看是否已收藏 批量
* @param {问答或者文章或者课程的id数组} data
* */
const isNoFavorite=function(date){
return ajax.postJson('/xboe/m/favorite/isNoFavorite',data);
}
export default{ export default{
has, has,
@@ -107,5 +114,6 @@ export default{
articlePageList, articlePageList,
coursePageList, coursePageList,
findAll, findAll,
queryAll queryAll,
isNoFavorite
} }

View File

@@ -33,7 +33,7 @@ const remove=function(objId,objType){
// toAname 分享给人的名称 // toAname 分享给人的名称
// //
const querylist=function(query){ const querylist=function(query){
return ajax.post('/xboe/m/share/list',data); return ajax.post('/xboe/m/share/list',query);
} }
// 当前用户是否已分享 // 当前用户是否已分享
// // objType点赞对象类型 1课程 2文章,3案例, 4问答 // // objType点赞对象类型 1课程 2文章,3案例, 4问答
@@ -121,6 +121,49 @@ const updateIsRead=function(id){
const deleteshares=function(id){ const deleteshares=function(id){
return ajax.get(`/xboe/m/share/delete-shares?id=${id}`); return ajax.get(`/xboe/m/share/delete-shares?id=${id}`);
} }
/**
* 我分享的全部
* @param pageIndex 第几页
* @param pageSize 每页多少行
* @param keyword 关键字搜索
* @param isRead 是否已读
* */
const findMeShare=function (query){
return ajax.post('/xboe/m/share/findMeShare',query);
}
/**
* 分享给我的全部
* @param pageIndex 第几页
* @param pageSize 每页多少行
* @param keyword 关键字搜索
* @param isRead 是否已读
* */
const findShareMe=function (query){
return ajax.post('/xboe/m/share/findShareMe',query);
}
/**
* 我分享的案例
* @param pageIndex 第几页
* @param pageSize 每页多少行
* @param isRead 是否已读
* @param keyword 关键字搜索
* */
const myCaseList=function (query){
return ajax.post('/xboe/m/share/myCaseList',query);
}
/**
* 分享给我的案例
* @param pageIndex 第几页
* @param pageSize 每页多少行
* @param isRead 是否已读
* @param keyword 关键字搜索
* */
const myMeCaseList=function (query){
return ajax.post('/xboe/m/share/myMeCaseList',query);
}
/**
* */
export default{ export default{
save, save,
has, has,
@@ -134,5 +177,9 @@ const deleteshares=function(id){
mymecourselist, mymecourselist,
mymearticlelist, mymearticlelist,
updateIsRead, updateIsRead,
deleteshares deleteshares,
findMeShare,
findShareMe,
myCaseList,
myMeCaseList
} }

View File

@@ -0,0 +1,168 @@
<template>
<div style="">
<div class="article-list" v-for="(item, idx) in items" :key="idx">
<div class="article-info" @click="jumpRouter(item)">
<div class="article-info-title">
<span v-if="item.isRead" class="readed">已查看</span>
<span class="noRead" v-else>未查看</span>
<span class="title one-line-ellipsis" v-html="$keywordActiveShow(item.cases.title,keyword)"></span>
</div>
<div v-html="$keywordActiveShow(item.cases.summary,keyword)" class="article-info-summary two-line-ellipsis">
</div>
<!-- v-html="$keywordActiveShow(item.summary,keyword)" -->
<div style="display:flex;justify-content: space-between;">
<div class="article-info-tools">
<!-- <authorInfo :avatar="item.avatar" :name="item.name" :info="item.orgInfo"></authorInfo> -->
<span style="color: #999999;">{{ item.time }}</span>
<span v-if="type=='myShare'" style="color: #999999;font-size: 14px;">分享给{{item.toAname}}</span>
<span v-else>{{item.sysCreateBy}}分享给我</span>
<!-- <interactBar ref="shareDialog" :type="0" :data="item" :shares="false" :views="false"></interactBar> -->
</div>
<div>
<el-button style="color: #8590A6;" v-if="!item.isRead&&type=='myShare'" type="text" icon="el-icon-refresh-right" @click.stop="deleteshares(item)">撤回</el-button>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import apiShares from '@/api/modules/shares.js';
export default {
name:'caseItems',
props:{
items: {
//name,
type: Array,
default: () => []
},
type:{
type:String,
default:()=>{
return 'myShare'
}
},
keyword:{
type:String,
default:()=>{
return ''
}
}
},
methods:{
jumpRouter(item){
if(this.type!='myShare'){
apiShares.updateIsRead(item.id).then(res=>{
if(res.status==200){
this.$emit('confirm',item)
}
})
}
this.$router.push({path:'/case/detail',query:{id:item.cases.id}})
// window.open(`${this.webBaseUrl}/article/detail?id=${item.objId}`)
},
deleteshares(item){
this.$emit('confirm',item)
},
},
created() {
console.log(this.items)
},
}
</script>
<style lang="scss" scoped>
.article-status1 {
padding: 3px;
border: 1px dotted #1ea0fa;
color: #1ea0fa;
}
.article-status2 {
padding: 3px;
border: 1px dotted #00aa00;
color: #00aa00;
}
.article-status3 {
padding: 3px;
border: 1px dotted #ff0000;
color: #ff0000;
}
.article-list {
border-bottom: 1px solid #dddddd;
// padding: 10px;
padding-bottom: 20px;
margin-top: 20px;
border-bottom: 1px solid #e9e9e9;
cursor: pointer;
}
.article-info {
cursor: pointer;
.article-info-title {
font-size: 16px;
font-weight: 400;
display: flex;
justify-content: flex-start;
align-items: center;
.readed{
font-size: 18px;
color: #3e7fff;
// margin-bottom: 6px;
}
.noRead{
font-size: 18px;
color:#FF3E3E;
// margin-bottom: 6px;
}
.title{
line-height: 25px;
margin-left: 10px;
font-size: 18px;
flex-shrink: 10000;
font-weight: 500;
color: #333333;
}
.el-button{
margin-left: auto;
}
// .article-info-date {
// height: 40px;
// line-height: 40px;
// float: right;
// font-weight: 200;
// color: #999999;
// i {
// margin-right: 5px;
// }
// }
}
.article-info-summary {
height: 46px;
font-weight: 200;
font-size: 16px;
line-height: 1.5;
margin:7px 0;
}
.article-info-tools {
color: #999999;
display: flex;
justify-content: flex-start;
align-items: center;
>span{
font-size: 14px;
color: #747474;
// margin-top: -2px;
}
// >span:first-of-type{
// margin-left: 10px;
// }
// >span:last-of-type{
// margin-top: -4px;
// margin-right:auto;
// }
}
}
</style>

View File

@@ -135,7 +135,7 @@ export default {
.one-line-ellipsis{ .one-line-ellipsis{
display: -webkit-box; display: -webkit-box;
white-space:pre-wrap; white-space:pre-wrap;
word-wrap: break-word; // word-wrap: break-word;
word-break:break-all; word-break:break-all;
overflow: hidden; overflow: hidden;
text-overflow:ellipsis; text-overflow:ellipsis;

View File

@@ -26,12 +26,12 @@
@link-clicked="currentPage = $event"> @link-clicked="currentPage = $event">
</pdf> --> </pdf> -->
</div> </div>
<div class="pdf-footer"> <div v-if="totalPages>initNum" class="pdf-footer" >
<!-- <el-button icon="el-icon-arrow-left" @click="prePage('footer')" :disabled="loadedRatio !== 1"></el-button> <!-- <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-if="loadedRatio !== 1" style="margin:0 10px;">0 / 0</span>
<span v-else style="margin:0 10px;">{{ currentPage }} / {{ pageCount }}</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 @click="nextPage('footer')" :disabled="loadedRatio !== 1" icon="el-icon-arrow-right"></el-button> -->
<el-button type="primary" @click="clickMore()">加载更多</el-button> <el-button type="primary" @click="clickMore()" v-if="moreState == 1">加载更多</el-button>
</div> </div>
</div> </div>
</template> </template>
@@ -59,21 +59,33 @@ export default {
src: "", src: "",
showPages: undefined, showPages: undefined,
totalPages:0, totalPages:0,
initNum:3,
scale: 100, //放大系数 scale: 100, //放大系数
loadedRatio:0,// 加载进度 loadedRatio:0,// 加载进度
showProgress:true, showProgress:true,
moreState:1,// 1 加载更多 2 加载中 3无数据
isscroll:false,
pdfpage:0,
}; };
}, },
mounted() { mounted() {
// /case/demo.pdf // /case/demo.pdf
let pdfPath=this.$Constants.fileBaseUrl+'/case/demo.pdf'; if(this.filePath){
this.loadInitPdf(pdfPath); this.loadInitPdf(this.filePath);
//this.initSrc(this.filePath); }
window.addEventListener(
"scroll",
this.handleScroll
);
},
beforeDestroy(){
window.removeEventListener("scroll",this.handleScroll);
}, },
watch:{ watch:{
filePath(newVal){ filePath(newVal){
//this.getNumPages(newVal); if(newVal){
this.initSrc(newVal); this.loadInitPdf(newVal);
}
}, },
loadedRatio(newVal){ loadedRatio(newVal){
// 直接使用loadedRatio控制进度条没有加载效果 // 直接使用loadedRatio控制进度条没有加载效果
@@ -91,6 +103,8 @@ export default {
}, },
loadedPageHandle(e){ loadedPageHandle(e){
console.log(e,'loadedPageHandle'); console.log(e,'loadedPageHandle');
this.pdfpage = e;
}, },
loadPdfHandle(e){ loadPdfHandle(e){
console.log(e,'loadPdfHandle'); console.log(e,'loadPdfHandle');
@@ -99,27 +113,72 @@ export default {
if(this.totalPages>this.showPages){ if(this.totalPages>this.showPages){
this.showPages++; this.showPages++;
} }
this.isscroll = true;
}, },
//加载页面 //加载页面
loadInitPdf(url) { loadInitPdf(url) {
if(url && url.indexOf('.pdf')>-1){ if(url && url.indexOf('.pdf')>-1){
let loadingTask = pdf.createLoadingTask(url); let loadingTask = pdf.createLoadingTask(url);
this.src=loadingTask; this.src=loadingTask;
loadingTask.promise.then((pdf) =>{ loadingTask.promise.then((pdf) =>{
console.log(pdf)
this.totalPages=pdf.numPages; this.totalPages=pdf.numPages;
if(pdf.numPages>3){
this.showPages = 3;
if(pdf.numPages>this.initNum){
this.showPages = this.initNum;
} else{ } else{
this.showPages =pdf.numPages; this.showPages =pdf.numPages;
} }
}).catch((err) =>{ }).catch((err) =>{
this.$message.error("加载内容失败,请联系管理员"); this.$message.error("加载内容失败,请联系管理员");
}); });
} }
}, },
initSrc(url){
if(url && url.indexOf('.pdf')>-1){ handleScroll() {
//this.src = url; let el_anking = document.querySelector('#case-list-content');
let innerHeight = document.querySelector('#pdf-perView').clientHeight
let outerHeight = document.documentElement.clientHeight
let scrollTop = document.documentElement.scrollTop
if(this.isscroll){
this.showPages++;
this.debounce(this.loadInitPdf(),5000);
}
// console.log(this.pdfpage,'000')
// console.log(this.totalPages,this.pdfpage)
if(this.pdfpage >= this.totalPages){
this.isscroll = false
this.moreState = 3
// console.log('hcuewhf')
}
// 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;
return function () {
let context = this;
let args = arguments;
if (timeout) clearTimeout(timeout);
timeout = setTimeout(() => {
func.apply(context, args)
}, wait);
} }
}, },
prePage(type) { prePage(type) {

View File

@@ -4,12 +4,12 @@
<div v-if="showTop" class="comments-top"> <div v-if="showTop" class="comments-top">
<div class="comments-top-left">评论 <span style="color: #797979;">{{total}}</span> <div class="comments-top-left">评论 <span style="color: #797979;">{{total}}</span>
<el-checkbox v-if="objType ==2" class="btn" v-model="value" type="primary">只看作者</el-checkbox> <el-checkbox v-if="objType ==2" class="btn" v-model="value" type="primary">只看作者</el-checkbox>
<el-checkbox v-if="objType ==3" class="btn" v-model="value" type="primary">{{value?'查看所有':'只看案主'}}</el-checkbox> <el-checkbox v-if="objType ==3" class="btn" v-model="value" type="primary">{{value?'查看所有':'只看案主 @案主可以给他发私信哦'}}</el-checkbox>
</div> </div>
<div class="comments-top-right" v-if="objType !==2"> <!-- <div class="comments-top-right" v-if="objType !==2">
<span @click="showList(false)" v-if="listShow">收起<i class="el-icon-arrow-down"></i></span> <span @click="showList(false)" v-if="listShow">收起<i class="el-icon-arrow-down"></i></span>
<span @click="showList(true)" v-else >打开<i class="el-icon-arrow-up"></i></span> <span @click="showList(true)" v-else >打开<i class="el-icon-arrow-up"></i></span>
</div> </div> -->
</div> </div>
<div class="comments-input" v-if="!readonly"> <div class="comments-input" v-if="!readonly">
<div class="grid-content bg-purple"> <div class="grid-content bg-purple">
@@ -320,6 +320,7 @@
this.loadData(); this.loadData();
}, },
inputValue(val,oldVal) { inputValue(val,oldVal) {
console.log("333333");
let fu = val.substr(-1); let fu = val.substr(-1);
if(fu == '@'&&!oldVal) { if(fu == '@'&&!oldVal) {
this.toUserId = ''; this.toUserId = '';

View File

@@ -43,7 +43,7 @@
<div v-if="views" style="cursor: default;" :style="`min-width: ${nodeWidth};`" class="interact-bar-btn" :class="{cursor:!readonly}"> <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">
<svg-icon style="margin-right: 0;font-size: 16px;" icon-class="views"></svg-icon> <svg-icon style="margin-right: 0;font-size: 16px;" icon-class="browse"></svg-icon>
</el-tooltip> </el-tooltip>
<span class="interact-bar-value"> {{ data.views}}</span> <span class="interact-bar-value"> {{ data.views}}</span>
</div> </div>
@@ -238,14 +238,8 @@ export default {
}) })
}, },
checkHas(){ checkHas(){
if(this.type>0){ if(this.type>0 && !this.readonly && this.data.id){
apiPraises.has(this.type,this.data.id).then(rs=>{ if(this.favorites){
if(rs.status==200 && rs.result){
this.isPraise=true;
}else{
this.isPraise=false;
}
});
apiFavorites.has(this.type,this.data.id).then(rs=>{ apiFavorites.has(this.type,this.data.id).then(rs=>{
if(rs.status==200 && rs.result){ if(rs.status==200 && rs.result){
this.isFavorite=true; this.isFavorite=true;
@@ -254,6 +248,16 @@ export default {
} }
}) })
} }
if(this.praises){
apiPraises.has(this.type,this.data.id).then(rs=>{
if(rs.status==200 && rs.result){
this.isPraise=true;
}else{
this.isPraise=false;
}
});
}
}
}, },
addShare(){ addShare(){
if(this.readonly){ if(this.readonly){

View File

@@ -78,10 +78,10 @@
<svg-icon icon-class="teather"></svg-icon> <svg-icon icon-class="teather"></svg-icon>
<span slot="title">教师管理</span> <span slot="title">教师管理</span>
</el-menu-item> </el-menu-item>
<!-- <el-menu-item index="/case/manage" v-show="curIdentity == 3"> <el-menu-item index="/case/manage" v-show="curIdentity == 3">
<svg-icon icon-class="case"></svg-icon> <svg-icon icon-class="case"></svg-icon>
<span slot="title">案例管理</span> <span slot="title">案例管理</span>
</el-menu-item> --> </el-menu-item>
<el-menu-item index="/manage/ugroups" v-show="curIdentity == 3"> <el-menu-item index="/manage/ugroups" v-show="curIdentity == 3">
<svg-icon icon-class="audience" style="font-size:16px"></svg-icon> <svg-icon icon-class="audience" style="font-size:16px"></svg-icon>
<span slot="title">受众管理</span> <span slot="title">受众管理</span>

1
src/icons/svg/browse.svg Normal file
View File

@@ -0,0 +1 @@
<svg t="1654588163796" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2388" width="200" height="200"><path d="M512.00085 738.377c-121.05 0-219.428-98.377-219.428-219.428S390.95085 299.52 512.00185 299.52s219.428 98.377 219.428 219.429-98.377 219.428-219.428 219.428M0.00085 517.413c0 24.502 8.923 48.53 25.636 66.486 325.779 350.647 693.614 350.501 977.225-1.316 13.934-17.189 21.139-39.132 21.139-61.294v-3.072c0-23.15-7.936-45.934-23.004-63.561C690.03085 90.88 321.72085 93.513 22.05385 455.022A98.011 98.011 0 0 0 0.00185 517.376" p-id="2389" fill="#A3B1CC"></path><path d="M658.28685 518.949c0 80.932-65.353 146.285-146.285 146.285S365.71585 599.881 365.71585 518.95s65.353-146.286 146.286-146.286 146.285 65.353 146.285 146.286" p-id="2390" fill="#A3B1CC"></path></svg>

After

Width:  |  Height:  |  Size: 819 B

View File

@@ -9,7 +9,7 @@
<div class="xtop-nav"> <div class="xtop-nav">
<div><a :href="`${webBaseUrl}/index`">首页</a></div> <div><a :href="`${webBaseUrl}/index`">首页</a></div>
<div><a :href="`${webBaseUrl}/course`">课程</a></div> <div><a :href="`${webBaseUrl}/course`">课程</a></div>
<!-- <div><a :href="`${webBaseUrl}/case`" target="_blank">案例</a></div> --> <div><a :href="`${webBaseUrl}/case`" target="_blank">案例</a></div>
<div><a :href="`${webBaseUrl}/article`">文章</a></div> <div><a :href="`${webBaseUrl}/article`">文章</a></div>
<div><a :href="`${webBaseUrl}/qa`">问答</a></div> <div><a :href="`${webBaseUrl}/qa`">问答</a></div>
<div> <div>

View File

@@ -105,6 +105,47 @@
</el-card> </el-card>
</div> </div>
</div> </div>
</div>
<!-- 推荐案例2版 -->
<div class="modules">
<div class="modules-title">
<span class="modules-text">推荐案例</span>
<span class="quyer-tag">
<a :class="caseList.orderType==2?'current':''" @click="changeCaseOrder(2)">最热</a>
<a :class="caseList.orderType==1?'current':''" @click="changeCaseOrder(1)">最新</a>
</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="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> -->
<div class="case-conent">
<div class="case-time">
{{ca.sysCreateTime.substring(0,10)}}
</div>
<a :href="'case/detail?id='+ca.id" >
<span class="case-title one-line-ellipsis">
{{ca.title}}
</span>
<div class="case-text three-line-ellipsis">
{{ca.summary}}
</div>
</a>
<div class="case-inter">
<interactBar style="width:180px" :type="3" :readonly="true" :data="ca" :shares="false" :views="false"></interactBar>
</div>
<div style="height:40px">
<authorInfo :avatar="ca.authorInfo.avatar" :name="ca.authorInfo.name" :info="ca.authorInfo.orgInfo" :sex="ca.authorInfo.sex"></authorInfo></div>
</div>
</div>
</div>
</div>
</div> </div>
<!-- 推荐案例 --> <!-- 推荐案例 -->
<!-- <div class="modules"> <!-- <div class="modules">
@@ -153,6 +194,7 @@
</el-col> </el-col>
</el-row> </el-row>
</div> --> </div> -->
<!-- 推荐文章 --> <!-- 推荐文章 -->
<div class="modules"> <div class="modules">
<!--内容块--> <!--内容块-->
@@ -313,7 +355,7 @@ export default {
list: [] list: []
}, },
caseList: { caseList: {
num: 4, num: 6,
orderType: 2, orderType: 2,
list: [] list: []
}, },
@@ -430,6 +472,7 @@ export default {
let userIds = []; let userIds = [];
res.result.forEach(item => { res.result.forEach(item => {
item.authorInfo = { aid: '', name: '', orgInfo: '', avatar: '', code: '',sex:null }; item.authorInfo = { aid: '', name: '', orgInfo: '', avatar: '', code: '',sex:null };
if (item.authorId && item.authorId != '') { if (item.authorId && item.authorId != '') {
userIds.push(item.authorId); userIds.push(item.authorId);
} }
@@ -583,6 +626,61 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.three-line-ellipsis {
overflow: hidden;
text-overflow: ellipsis;
box-sizing: border-box;
-webkit-line-clamp: 3;
word-break: break-all;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.casetwo{
border: 1px solid #F0F0F0;
width: 100%;
height: 220px;
margin-bottom:15px;
position: relative;
background-color: #fff;
.case-top{
height: 70px;
background-image: linear-gradient(to right , #b8c7e2, #d0dcf3);
}
.case-conent{
width: 100%;
height: 100%;
// box-shadow: 1px 1px 15px #ccc;
// position: absolute;
// top: 5%;
background-color: #fff;
// left: 4%;
padding: 16px;
.case-time{
font-size: 12px;
color: #999999;
text-align: right;
}
.case-title{
margin-top: 10px;
font-size: 14px;
color: #333;
font-weight: bold;
margin-bottom:10px;
}
.case-text{
height: 55px;
font-size: 14px;
color: #888888;
line-height: 18px;
margin-bottom:12px;
}
.case-inter{
width: 100%;
border-bottom: 1px solid #f3f3f3;
}
}
}
// .qa-dai{ // .qa-dai{
// color: #5da1ff; // color: #5da1ff;
// } // }

View File

@@ -11,7 +11,7 @@
<!-- <el-option label="全部" :value="0"></el-option> --> <!-- <el-option label="全部" :value="0"></el-option> -->
<el-option label="文章" :value="2"></el-option> <el-option label="文章" :value="2"></el-option>
<!-- <el-option label="课程" :value="1"></el-option> --> <!-- <el-option label="课程" :value="1"></el-option> -->
<!-- <el-option label="问答" :value="4"></el-option> --> <el-option label="案例" :value="3"></el-option>
<el-option label="问答" :value="4"></el-option> <el-option label="问答" :value="4"></el-option>
</el-select> </el-select>
<!-- <el-input style="width: 200px;margin-right: 10px" placeholder="请选择来源"></el-input> --> <!-- <el-input style="width: 200px;margin-right: 10px" placeholder="请选择来源"></el-input> -->
@@ -155,6 +155,8 @@ export default {
}else if(this.dataList.type == 4){ }else if(this.dataList.type == 4){
this.$router.push({ path: '/qa/answer', query: { id: item.objId } }); this.$router.push({ path: '/qa/answer', query: { id: item.objId } });
} else if(this.dataList.type == 3){
this.$router.push({ path: '/case/detail', query: { id: item.objId } });
} }
}, },
@@ -268,12 +270,11 @@ export default {
toAname:this.replayContent.sysCreateBy, toAname:this.replayContent.sysCreateBy,
parentRead:true parentRead:true
} }
if(this.dataList.type == 2) { if(this.dataList.type == 2 || this.dataList.type == 3) {
apiComment.reply(replayInfo).then(res=>{ apiComment.reply(replayInfo).then(res=>{
if(res.status==200){ if(res.status==200){
this.$message.success("回复成功"); this.$message.success("回复成功");
this.shareShow = false; this.shareShow = false;
//this.getData();
if(!this.replyItem.replys){ if(!this.replyItem.replys){
this.replyItem.replys=[]; this.replyItem.replys=[];
} }

View File

@@ -158,8 +158,8 @@ export default {
}, },
methods: { methods: {
reset() { reset() {
this.queryObj.isTop = '' this.queryObj.isTop = '';
this.queryObj.keyWord = '' this.queryObj.keyWord = '';
this.getData() this.getData()
}, },
//获取案例列表数据 //获取案例列表数据

View File

@@ -3,17 +3,17 @@
<div style="padding-bottom: 10px;"> <div style="padding-bottom: 10px;">
<div style="display: flex;justify-content:flex-start;"> <div style="display: flex;justify-content:flex-start;">
<div style="padding: 0px 5px;"> <div style="padding: 0px 5px;">
<el-select v-model="query.tSystemId" value-key="id" clearable @change="queryChangeSystem" placeholder="请选择教师体系"> <el-select v-model="query.tsystemId" value-key="id" clearable @change="queryChangeSystem" placeholder="请选择教师体系">
<el-option v-for="item in systemData" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in systemData" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
<!-- 要在换一个变量与新建区别开 --> <!-- 要在换一个变量与新建区别开 -->
<div style="padding: 0px 5px;"> <div style="padding: 0px 5px;">
<el-select v-model="query.tLevelId" clearable value-key="id" placeholder="请选择教师级别"> <el-select v-model="query.tlevelId" clearable value-key="id" placeholder="请选择教师级别">
<el-option v-for="item in queryLevelData" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in queryLevelData" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
<div style="padding: 0px 5px;"><el-input placeholder="请输入姓名" v-model="query.queryName" clearable></el-input></div> <div style="padding: 0px 5px;"><el-input placeholder="请输入姓名" v-model="query.name" clearable></el-input></div>
<div style="padding: 0px 5px;"> <div style="padding: 0px 5px;">
<el-select v-model="query.salaryId" clearable value-key="id" placeholder="请选择发薪地"> <el-select v-model="query.salaryId" clearable value-key="id" placeholder="请选择发薪地">
<el-option v-for="item in placeList" :key="item.value" :label="item.label" :value="item.value"></el-option> <el-option v-for="item in placeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
@@ -39,13 +39,16 @@
<!-- <el-table-column label="创建时间" sortable prop="sysCreateTime"></el-table-column> --> <!-- <el-table-column label="创建时间" sortable prop="sysCreateTime"></el-table-column> -->
<el-table-column label="修改时间" sortable width="155" prop="sysUpdateTime"></el-table-column> <el-table-column label="修改时间" sortable width="155" prop="sysUpdateTime"></el-table-column>
<el-table-column label="授课时长" prop="teaching"></el-table-column> <el-table-column label="授课时长" prop="teaching"></el-table-column>
<el-table-column label="教师体系" prop="tsystemName"></el-table-column>
<el-table-column label="教师级别" prop="tlevelName"></el-table-column>
<el-table-column label="发薪地" prop="salaryName"></el-table-column>
<el-table-column label="在职状态" width="90" :filters="[{ text: '在职', value: '0'}, { text: '离职', value: '1' }]" <el-table-column label="在职状态" width="90" :filters="[{ text: '在职', value: '0'}, { text: '离职', value: '1' }]"
:filter-method="filterWork"> :filter-method="filterWork">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.waitStatus=='0'?'在职': scope.row.waitStatus=='1' ? '离职' :''}} {{scope.row.waitStatus=='0'?'在职': scope.row.waitStatus=='1' ? '离职' :''}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="认证状态" width="90" :filters="[{ text: '未认证', value: '0'}, { text: '已认证', value: '1' }]" <el-table-column label="认证状态" width="90" :filters="[{ text: '未认证', value: 0}, { text: '已认证', value: 1 }]"
:filter-method="filterCertification"> :filter-method="filterCertification">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.certStatus==0 ?'未认证': scope.row.certStatus==1 ? '已认证' :''}} {{scope.row.certStatus==0 ?'未认证': scope.row.certStatus==1 ? '已认证' :''}}
@@ -143,7 +146,8 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="form.description" clearable type="textarea" :autosize='{ minRows: 3, maxRows: 6 }'></el-input> <!-- <el-input v-model="form.description" clearable type="textarea" :autosize='{ minRows: 3, maxRows: 6 }'></el-input> -->
<WxEditor v-model="form.description" :minHeight="50"></WxEditor>
</el-form-item> </el-form-item>
<el-form-item label="擅长课程"> <el-form-item label="擅长课程">
<el-input v-model="form.courses" clearable placeholder="请输入"></el-input> <el-input v-model="form.courses" clearable placeholder="请输入"></el-input>
@@ -154,12 +158,8 @@
<el-button :loading="saveLoading" type="primary" @click="saveHandle"> </el-button> <el-button :loading="saveLoading" type="primary" @click="saveHandle"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog <el-dialog title="教师详情" :close-on-click-modal="false" :visible.sync="showTeacherDetails" width="800px">
title="教师详情" <teacher-details v-if="teacherDetailId != ''" :id="teacherDetailsId" :newId="teacherDetailId"></teacher-details>
:close-on-click-modal="false"
:visible.sync="showTeacherDetails"
width="800px">
<teacher-details v-if="teacherDetailsId != ''" :id="teacherDetailsId" :newId="teacherDetailId"></teacher-details>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="handleCloseOne()"> </el-button> <el-button @click="handleCloseOne()"> </el-button>
<!-- <el-button type="primary" @click="showTeacherDetails = false"> </el-button> --> <!-- <el-button type="primary" @click="showTeacherDetails = false"> </el-button> -->
@@ -169,6 +169,7 @@
</template> </template>
<script> <script>
import WxEditor from '@/components/Editor/index.vue';
import teacherApi from "@/api/modules/teacher"; import teacherApi from "@/api/modules/teacher";
import teacherBoeApi from "@/api/boe/teacher"; import teacherBoeApi from "@/api/boe/teacher";
import userApi from "@/api/system/user"; import userApi from "@/api/system/user";
@@ -177,14 +178,14 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
export default { export default {
name: 'teacher', name: 'teacher',
components:{imageUpload,teacherDetails}, components:{imageUpload,teacherDetails,WxEditor},
data(){ data(){
return { return {
query:{ query:{
tSystemId:'', tsystemId:'',
tSystemIds:'', tsystemIds:'',
tLevelId:'', tlevelId:'',
queryName:'', name:'',
salaryId:'', salaryId:'',
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
@@ -227,7 +228,6 @@
] ]
}, },
selectList:[], selectList:[],
queryName:"",
dialogVisible:false, dialogVisible:false,
tableData:[], tableData:[],
searchName:null, searchName:null,
@@ -258,6 +258,7 @@
showTeacherDetails(val) { showTeacherDetails(val) {
if(!val) { if(!val) {
this.teacherDetailsId = ''; this.teacherDetailsId = '';
this.teacherDetailId = '';
} }
} }
}, },
@@ -348,10 +349,9 @@
this.loadData(1); this.loadData(1);
}, },
reset (){ reset (){
this.query.queryName = ''; this.query.name = '';
this.query.tSystemId='', this.query.tsystemId='',
this.query.tLevelId='', this.query.tlevelId='',
this.query.queryName='',
this.query.salaryId='', this.query.salaryId='',
this.query.pageIndex= 1, this.query.pageIndex= 1,
this.query.pageSize= 10, this.query.pageSize= 10,
@@ -373,6 +373,9 @@
waitStatus:0,//在职 waitStatus:0,//在职
certStatus:0,//未认证 certStatus:0,//未认证
} }
this.tSystemData = {};
this.tLevelData= {};
this.coverImage = '';
this.dialogVisible=true this.dialogVisible=true
}, },
filterWork(value,row){ filterWork(value,row){
@@ -441,8 +444,8 @@
if (res.status == 200 && res.result != null) { if (res.status == 200 && res.result != null) {
this.havaInfo = true; this.havaInfo = true;
this.form.account = res.result.account; this.form.account = res.result.account;
if(res.result.photo != '') { if(res.result.account.avatar != '') {
this.coverImage = this.fileBaseUrl+res.result.photo; this.coverImage = this.fileBaseUrl+res.result.account.avatar;
} }
this.form.user = res.result; this.form.user = res.result;
} else { } else {
@@ -585,15 +588,8 @@
}, },
loadData(pageIndex) { loadData(pageIndex) {
this.query.pageIndex = pageIndex; this.query.pageIndex = pageIndex;
this.query.tSystemIds = this.query.tSystemId || this.teacherSystemids.join(); this.query.tsystemIds = this.query.tsystemId || this.teacherSystemids.join();
teacherApi teacherApi.page(this.query).then((res) => {
.page(
this.query
// pageIndex: this.pageIndex,
// pageSize: this.pageSize,
// name: this.queryName,
)
.then((res) => {
if (res.status == 200) { if (res.status == 200) {
const result = res.result; const result = res.result;
this.tableData = result.list; this.tableData = result.list;
@@ -664,33 +660,32 @@
}) })
ids = ids.join(); ids = ids.join();
} }
//如果是勾选的那需要传id的值使用逗号分隔
//get请求
// var eleLink = document.createElement('a');
// eleLink.download = '教师列表';
// eleLink.style.display = 'none';
// eleLink.href = `${process.env.VUE_APP_BASE_API}/xboe/teacher/export?name=${this.queryName}`;
// document.body.appendChild(eleLink);
// eleLink.click();
// 然后移除
// document.body.removeChild(eleLink);
//post请求 //post请求
var eleForm=document.createElement('form'); var eleForm=document.createElement('form');
eleForm.style="display:none;"; eleForm.style="display:none;";
eleForm.method='post'; eleForm.method='post';
eleForm.action=`${process.env.VUE_APP_BASE_API}/xboe/teacher/export?name=${this.queryName}`; eleForm.action=`${process.env.VUE_APP_BASE_API}/xboe/teacher/export?name=${this.query.name}`;
//添加ids条件
var hdnFilePath = document.createElement('input'); var hdnFilePath = document.createElement('input');
hdnFilePath.type = 'hidden'; hdnFilePath.type = 'hidden';
hdnFilePath.name = 'ids'; hdnFilePath.name = 'ids';
hdnFilePath.value = ids; hdnFilePath.value = ids;
eleForm.appendChild(hdnFilePath); eleForm.appendChild(hdnFilePath);
//添加查询姓名
var hdnName = document.createElement('input');
hdnName.type = 'hidden';
hdnName.name = 'name';
hdnName.value = this.query.name;
eleForm.appendChild(hdnName);
document.body.appendChild(eleForm); document.body.appendChild(eleForm);
eleForm.submit(); eleForm.submit();
document.body.removeChild(eleForm); document.body.removeChild(eleForm);
}, },
exportCourse(row){ exportCourse(row){
if(!row.sysId){
this.$message({message:'无原系统教师关联,只导出新系统的教师课程',type:'warning'});
}
var eleLink = document.createElement('a'); var eleLink = document.createElement('a');
eleLink.download = '教师授课信息'; eleLink.download = '教师授课信息';
eleLink.style.display = 'none'; eleLink.style.display = 'none';

View File

@@ -22,21 +22,21 @@
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="讲师组织:" > <el-form-item label="讲师组织:" >
<el-col :span="12">{{form.company_name}}</el-col> <el-col :span="12">{{form.company_name? form.company_name:'--'}}</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="初始授课时长:">{{formatSeconds(form.default_teaching_time)}}</el-form-item></el-col> <el-form-item label="初始授课时长:">{{form.default_teaching_time? formatSeconds(form.default_teaching_time):'--'}}</el-form-item></el-col>
</el-form-item> </el-form-item>
<el-form-item label="讲师体系:"> <el-form-item label="讲师体系:">
<el-col :span="12">{{form.system_name}}</el-col> <el-col :span="12">{{newForm.tsystemName? newForm.tsystemName:'--'}}</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="讲师级别:"> <el-form-item label="讲师级别:">
{{form.level_name}} {{newForm.tlevelName? newForm.tlevelName:'--'}}
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="总计授课时长:"> <el-form-item label="总计授课时长:">
<el-col :span="12">{{formatSeconds(form.teaching_time)}}</el-col> <el-col :span="12">{{form.teaching_time? formatSeconds(form.teaching_time):'--'}}</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="认证状态:"> <el-form-item label="认证状态:">
{{form.is_certify == 1? '已认证':'未认证'}} {{form.is_certify == 1? '已认证':'未认证'}}
@@ -44,10 +44,11 @@
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="认证时间:"> <el-form-item label="认证时间:">
<el-col :span="12">{{formatsec(form.certify_at *1000)}}</el-col> <el-col :span="12">{{form.certify_at? formatsec(form.certify_at *1000):'--'}}</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="认证资料:"> <el-form-item label="认证资料:">
<i style="color:blue" title="点击下载" @click="downloadActioon(form.certification)" class="el-icon-download"></i> <i style="color:blue" v-if="form.certification" title="点击下载" @click="downloadActioon(form.certification)" class="el-icon-download"></i>
<span v-else>--</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form-item> </el-form-item>
@@ -57,12 +58,12 @@
<!-- <el-col :span="12">--</el-col> --> <!-- <el-col :span="12">--</el-col> -->
<!-- <el-col :span="12"> --> <!-- <el-col :span="12"> -->
<el-form-item label="讲师介绍:"> <el-form-item label="讲师介绍:">
<div v-html="form.description"></div> <div v-html="newForm.description"></div>
</el-form-item> </el-form-item>
<!-- </el-col> <!-- </el-col>
</el-form-item> --> </el-form-item> -->
<el-form-item label="讲师备注:"> <el-form-item label="讲师备注:">
{{form.remark}} {{newForm.remark}}
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
@@ -146,28 +147,11 @@
</div> --> </div> -->
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="授课资格" name="third"> <el-tab-pane label="授课资格" name="third">
<el-table height="430" <el-table height="430" :data="qualify.list" style="width: 100%">
:data="qualify.list" <el-table-column prop="courseCode" label="课程编号" width="180"> </el-table-column>
style="width: 100%"> <el-table-column prop="courseName" show-overflow-tooltip label="课程名称" width="250"> </el-table-column>
<el-table-column <el-table-column prop="dictionaryName" label="课程分类" width="180"> </el-table-column>
prop="courseCode" <el-table-column prop="courseType" label="课程类型" width="100">
label="课程编号"
width="180">
</el-table-column>
<el-table-column
prop="courseName" show-overflow-tooltip
label="课程名称"
width="250">
</el-table-column>
<el-table-column
prop="dictionaryName"
label="课程分类"
width="180">
</el-table-column>
<el-table-column
prop="courseType"
label="课程类型"
width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.courseType == '0'">录播</span> <span v-if="scope.row.courseType == '0'">录播</span>
<span v-if="scope.row.courseType == '1'">面授</span> <span v-if="scope.row.courseType == '1'">面授</span>
@@ -327,8 +311,18 @@ export default {
}; };
}, },
mounted() { mounted() {
this.getDetail(this.id);
this.getAvatar(); this.getAvatar();
if(this.id) {
this.getDetail();
}
},
watch:{
id(newVal){
if(newVal){
this.getDetail(newVal);
}
}
}, },
computed: { computed: {
...mapGetters(["userInfo"]) ...mapGetters(["userInfo"])
@@ -495,6 +489,13 @@ export default {
this.getCourseScore() this.getCourseScore()
}, },
getDetail() { getDetail() {
//应该是自己系统的教师信息呀
// teacherApi.detail(this.newId).then(rs=>{
// if(rs.status==200){
// }
// });
teacherBoeApi.teacherInfo(this.id).then(res => { teacherBoeApi.teacherInfo(this.id).then(res => {
if (res.status == 200) { if (res.status == 200) {
const result = res.result; const result = res.result;

View File

@@ -1,5 +1,5 @@
<template> <template>
<div> <div id="case-list-content">
<portal-header current="case" :goSearch="2"></portal-header> <portal-header current="case" :goSearch="2"></portal-header>
<div class="portal-content xcontent" style="margin-top: 30px;"> <div class="portal-content xcontent" style="margin-top: 30px;">
<el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb-nav"> <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb-nav">
@@ -13,52 +13,111 @@
<el-card :body-style="{ padding: '0px' }" class="detail"> <el-card :body-style="{ padding: '0px' }" class="detail">
<div class="title">{{ caseDetail.title }}</div> <div class="title">{{ caseDetail.title }}</div>
<div class="label"> <div class="label">
<author :onlyAvatar="true" :avatar="authorInfo.avatar" ></author> <author :onlyAvatar="true" :avatar="authorInfo.avatar" :sex="authorInfo.sex" ></author>
<span>作者{{ authorInfo.name }}</span> <span>作者{{ authorInfo.name }}</span>
<span>工号{{ authorInfo.code }}</span> <span>工号{{ authorInfo.code }}</span>
<span>部门{{ authorInfo.orgInfo }}</span> <span>部门{{ authorInfo.orgInfo }}</span>
<span>案例编号{{ caseDetail.id }}</span> <!-- <span>案例编号{{ caseDetail.id }}</span> -->
<span>发布时间{{ caseDetail.sysCreateTime }}</span> <span v-if="caseDetail.sysCreateTime">{{ caseDetail.sysCreateTime.substring(0,10) }}</span>
<interactBar :views="false" :data="caseDetail" :type="3" :comments="false" :shares="false"></interactBar> <interactBar :data="caseDetail" :type="3" :comments="false" :shares="true"></interactBar>
</div> </div>
<div class="case-summary"><span>{{ caseDetail.summary }}</span></div>
<div class="btn-div" > <div class="btn-div" >
<span class="item">角色认知</span> <span v-if="caseDetail.orgDomain" class="item">{{ caseDetail.orgDomain }}</span>
<span class="item">角色转变</span> <span v-if="caseDetail.majorType" class="item">{{ caseDetail.majorType }}</span>
<span class="item">团队管理</span> <span v-if="caseDetail.caseType" class="item">{{ caseDetail.caseType }}</span>
<span v-if="caseDetail.caseType1" class="item">{{ caseDetail.caseType1 }}</span>
<span v-if="caseDetail.caseType2" class="item">{{ caseDetail.caseType2 }}</span>
</div> </div>
</el-card> </el-card>
<el-card :body-style="{ padding: '0px' }" class="jianjie"> <el-card :body-style="{ padding: '0px' }" class="jianjie">
<!-- <div class="content"> <!-- <div class="content">
{{ caseDetail.content }} {{ caseDetail.content }}
</div> --> </div> -->
<pdfPreview :filePath="basePath+caseDetail.filePath"></pdfPreview> <pdfPreview v-if="pdfPath" :filePath="pdfPath"></pdfPreview>
</el-card> </el-card>
<!-- :authorId="articleDetailData.sysCreateAid" --> <!-- :authorId="articleDetailData.sysCreateAid" -->
<el-row><comments @success="success" v-if="resolveId != ''" :obj-type="3" :obj-id="resolveId" :authorId="caseDetail.sysCreateAid"></comments></el-row> <el-row><comments @success="success" v-if="resolveId != ''" :obj-type="3" :obj-id="resolveId" :authorId="caseDetail.sysCreateAid" :toUsers="toUsers"></comments></el-row>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div style="width: 245px;margin-left: 10px;"><!--排行榜--> <div style="width: 245px;margin-left: 5px;">
<div>
<div id="fixd-box"> <div id="fixd-box">
<el-card class="ranking-card" > <el-card class="ranking-card" >
<div slot="header"> <div slot="header">
<span>排行</span> <span style="font-size: 14px;font-weight: 600;color: #333333;">好评</span>
</div> </div>
<div> <div style="padding-bottom:10px">
<el-row class="ranking-title" v-for="(item,index) in ankingList" :key="index"> <el-row class="ranking-title">
<el-col :span="6"> <!-- <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">
<img v-if="index===0" :src="`${webBaseUrl}/images/first.png`"/> <img v-if="index===0" :src="`${webBaseUrl}/images/first.png`"/>
<img v-if="index===1" :src="`${webBaseUrl}/images/second.png`"/> <img v-if="index===1" :src="`${webBaseUrl}/images/second.png`"/>
<img v-if="index===2" :src="`${webBaseUrl}/images/third.png`"/> <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-col>
<el-col class="center" :span="18">{{item.sysCreateUname}}</el-col> <el-tooltip :enterable="false" @click.native="jumpRouter(item)" effect="light" :content="item.sysCreateUname" placement="top-start">
<!-- <el-col class="center" :span="7">{{''}}</el-col> <el-col :span="15" style="cursor: pointer;" class="title-line-ellipsis"> {{ item.sysCreateUname }}</el-col>
<el-col class="center" :span="7">{{item.counts}}</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 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 Popularity" :key="index" >
<el-col :span="6" style="height:34px">
<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`"/>
<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.title" placement="top-start">
<el-col :span="15" style="cursor: pointer;" class="title-line-ellipsis"> {{ item.title }}</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 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 Positive" :key="index" >
<el-col :span="6" style="height:34px">
<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`"/>
<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.title" placement="top-start">
<el-col :span="15" style="cursor: pointer;" class="title-line-ellipsis"> {{ item.title }}</el-col>
</el-tooltip>
<!-- <el-col class="center" style="color: #FF8E00;" :span="5">{{ item.score }}</el-col> -->
</el-row> </el-row>
</div> </div>
</el-card> </el-card>
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -77,7 +136,8 @@ import comments from '@/components/Portal/comments.vue';
import apiCase from '@/api/modules/cases.js'; import apiCase from '@/api/modules/cases.js';
import apiUser from '@/api/system/user.js'; import apiUser from '@/api/system/user.js';
import author from '@/components/Portal/authorInfo.vue'; import author from '@/components/Portal/authorInfo.vue';
import apiMessage from '@/api/system/message.js' import apiMessage from '@/api/system/message.js';
import apiDict from "@/api/modules/dict.js"
export default { export default {
name: 'atticle', name: 'atticle',
components: { portalHeader, portalFooter, interactBar, author, comments,pdfPreview }, components: { portalHeader, portalFooter, interactBar, author, comments,pdfPreview },
@@ -86,29 +146,76 @@ export default {
}, },
data() { data() {
return { return {
toUsers:[],
ankingList:[],
Popularity:[],
Positive:[],
resolveId: '', resolveId: '',
basePath:process.env.VUE_APP_FILE_BASE_URL, basePath:process.env.VUE_APP_FILE_BASE_URL,
pdfPath:'',
caseDetail: { caseDetail: {
id:'', id:'',
filePath:'' filePath:''
}, },
ankingList:[], ankingList:[],
authorInfo:{ aid: '', name: '', orgInfo: '', avatar: '', code: '' } authorInfo:{ aid: '', name: '', orgInfo: '', avatar: '', code: '',sex:null}
}; };
}, },
mounted() { mounted() {
//this.pdfPath=this.basePath+'/case/demo1.pdf';
this.resolveId = this.$route.query.id; this.resolveId = this.$route.query.id;
if (this.resolveId) { if (this.resolveId) {
this.getCaseData(); this.getCaseData();
} }
this.getAnkingData(); this.getAnkingData();
this.getPopularity();
this.getPositive();
window.addEventListener(
"scroll",
this.handleScroll
);
}, },
methods: { methods: {
handleScroll() {
let innerHeight = document.querySelector('#case-list-content').clientHeight
let outerHeight = document.documentElement.clientHeight
let scrollTop = document.documentElement.scrollTop
if ((outerHeight + scrollTop + 350) >= innerHeight) {
if(this.moreState == 1 && this.course.pageIndex < 4) {
this.loadMore();
}
}
if(scrollTop > 630) {
document.querySelector('#fixd-box').style.cssText = "position: fixed;top: -550px;width:245.5px";
} else {
document.querySelector('#fixd-box').style.cssText = "position: static";
}
},
getAnkingData(){ getAnkingData(){
apiCase.usernameList(10).then(res=>{ apiCase.usernameList(5).then(res=>{
if(res.status==200){ if(res.status==200){
this.ankingList=res.result this.ankingList=res.result
// console.log(res)
}
})
},
getPopularity(){
apiCase.queryPraises(5).then(res=>{
if(res.status==200){
this.Popularity=res.result
// console.log(this.Popularity)
}
})
},
getPositive(){
apiCase.queryComments(5).then(res=>{
if(res.status==200){
this.Positive=res.result
console.log(res)
} }
}) })
}, },
@@ -118,14 +225,24 @@ export default {
if (JSON.stringify(res.result) != '{}') { if (JSON.stringify(res.result) != '{}') {
this.caseDetail = res.result; this.caseDetail = res.result;
this.getCaseUserDetail(); this.getCaseUserDetail();
if(this.caseDetail.filePath){
this.pdfPath=this.basePath+this.caseDetail.filePath;
}else{
this.$message.error('内容文件不存在或已被删除,请与管理员联系');
}
} }
} }
}); });
}, },
getCaseUserDetail() { getCaseUserDetail() {
apiUser.getByIds([this.caseDetail.sysCreateAid]).then(res => { apiUser.getByIds([this.caseDetail.sysCreateAid]).then(res => {
if (res.status == 200) { if (res.status == 200 && res.result.length>0) {
this.authorInfo = res.result[0]; this.authorInfo = res.result[0];
this.toUsers = [
{name: res.result[0].name, aid:res.result[0].aid ,sex:res.result[0].sex}
];
//console.log(res.result,'res.result');
} }
}); });
}, },
@@ -150,6 +267,48 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.case-summary{
margin-top: 10px;
font-size: 16px;
color: #333;
}
::v-deep .el-card__body{
padding: 0;
}
::v-deep .bacolor:nth-child(odd){
background-color: #f6f6f6;
padding: 0 5px;
}
::v-deep .bacolor:nth-child(even){
background-color: #fff;
padding: 0 5px;
}
.ranking-title {
line-height: 34px;
font-size: 15px;
color: #333333;
.center-titlt{
font-size: 15px;
color: #333333;
}
.center{
text-align: right;
}
img{
margin-top: 5px;
}
}
::v-deep .title-line-ellipsis{
// width: 100%;
display: -webkit-box;
overflow: hidden;
text-overflow:ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
box-sizing: border-box;
word-break:break-all;
}
.nav { .nav {
margin-bottom: 10px; margin-bottom: 10px;
} }
@@ -182,7 +341,7 @@ export default {
padding-bottom: 10px; padding-bottom: 10px;
color: #666; color: #666;
.item { .item {
margin: 0 8px 0 15px; margin: 0 10px 0 0px;
border: 1px solid #9e9e9e; border: 1px solid #9e9e9e;
padding: 3px 10px; padding: 3px 10px;
border-radius: 8px; border-radius: 8px;
@@ -195,7 +354,7 @@ export default {
.jianjie { .jianjie {
margin: 15px 0; margin: 15px 0;
background-color: #fff; background-color: #fff;
padding: 0px 2px 10px 2px; padding: 0px 0px 10px 0px;
.content { .content {
padding: 10px 0; padding: 10px 0;
line-height: 25px; line-height: 25px;

View File

@@ -7,38 +7,32 @@
<el-col :span="24"> <el-col :span="24">
<el-card :body-style="{ padding: '0px' }" class="left-div"> <el-card :body-style="{ padding: '0px' }" class="left-div">
<el-row class="search-div"> <el-row class="search-div">
<el-row> <!-- <el-row>
<el-col :span="10" class="search-keyword"> <el-col :span="10" class="search-keyword">
<!-- <el-input placeholder="请输入关键词搜索" v-model="keyWord" clearable><el-button slot="append" icon="el-icon-search" @click="search"></el-button></el-input> --> <el-input placeholder="请输入关键词搜索" v-model="keyWord" clearable><el-button slot="append" icon="el-icon-search" @click="search"></el-button></el-input>
<!-- <div class="tip">热门搜索词物联网 教师 辅导 绩效</div> --> <div class="tip">热门搜索词物联网 教师 辅导 绩效</div>
<!-- <div class="tip" style="font-size: 14px;"> <div class="tip" style="font-size: 14px;">
热门搜索词<span style="cursor:pointer;font-size:15px;margin-left: 10px;" v-for="(item,index) in searchRecords" :key="index" @click="useHotword(item)">{{item.keyword}}</span> 热门搜索词<span style="cursor:pointer;font-size:15px;margin-left: 10px;" v-for="(item,index) in searchRecords" :key="index" @click="useHotword(item)">{{item.keyword}}</span>
</div> --> </div>
</el-col> </el-col>
</el-row> </el-row> -->
<div class="searchbar" v-if="searchTags.length > 0"> <div class="searchbar" v-if="searchTags.length > 0">
<div style="line-height: 30px;"> <div style="line-height: 30px;">
<span class="item-title">搜索条件</span> <span class="item-title">搜索条件</span>
<el-tag closable>显示事业</el-tag> <el-tag closable v-for="(tag, tagIdx) in searchTags" :key="tagIdx" @close="tagsClose(tag,tagIdx)">{{ tag }}</el-tag>
<el-tag closable>经营</el-tag>
<el-tag closable>业绩提升</el-tag>
<el-tag closable v-for="(tag, tagIdx) in searchTags" :key="tagIdx">{{ tag.words }}</el-tag>
</div> </div>
</div> </div>
<el-row class="search-item"> <el-row class="search-item">
<el-col :span="24"> <el-col :span="24">
<!-- <div class="item-title">组织领域</div> -->
<div style="margin-top:10px; display: flex;"> <div style="margin-top:10px; display: flex;">
<div style="line-height: 25px;"> <div style="line-height: 25px;padding-right: 5px;">
<span class="item-title" style="padding-right: 5px;">组织领域</span> <span class="item-title" style="padding-right: 5px;">组织领域</span>
<span class="item-line"></span> <span class="item-line"></span>
</div> </div>
<div> <div style="flex:1;">
<el-radio-group v-model="category" size="mini" @change="search()"> <el-radio-group v-model="queryCondition.orgDomain" size="mini" @change="search()">
<el-radio-button label="0">全部</el-radio-button> <el-radio-button :label="null">全部</el-radio-button>
<el-radio-button label="1">显示事业</el-radio-button> <el-radio-button v-for="item in domain" :key="item.code" :label="item.name"> {{ item.name}}</el-radio-button>
<el-radio-button label="2">传感器事业</el-radio-button>
<el-radio-button label="3">智慧医工事业</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
@@ -51,63 +45,37 @@
<el-col :span="24"> <el-col :span="24">
<!-- <div class="item-title">专业领域</div> --> <!-- <div class="item-title">专业领域</div> -->
<div style="margin-top:10px; display: flex;"> <div style="margin-top:10px; display: flex;">
<div style="line-height: 25px;"> <div style="line-height: 25px;padding-right: 5px;">
<span class="item-title" style="padding-right: 5px;">专业分类</span> <span class="item-title" style="padding-right: 5px;">专业分类</span>
<span class="item-line"></span> <span class="item-line"></span>
</div> </div>
<div> <div style="flex:1" id="searchBox">
<el-radio-group v-model="type2" size="mini" @change="search()"> <el-radio-group v-model="queryCondition.majorType" size="mini" @change="search()">
<el-radio-button label="0">全部</el-radio-button> <el-radio-button :label="null">全部</el-radio-button>
<el-radio-button label="1">经营</el-radio-button> <el-radio-button v-for="item in Profess" :key="item.code" :label="item.name" > {{ item.name }} </el-radio-button>
<el-radio-button label="2">领用</el-radio-button>
<el-radio-button label="3">研发</el-radio-button>
<el-radio-button label="4">营销</el-radio-button>
<el-radio-button label="5">生产技术</el-radio-button>
<el-radio-button label="6">信息技术</el-radio-button>
<el-radio-button label="7">质量</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
</div>
</el-col>
</el-row>
<el-row class="search-item">
<el-col :span="24">
<!-- <div class="item-title">应用场景</div> -->
<div style="margin-top:10px; display: flex;">
<div style="line-height: 25px;">
<span class="item-title" style="padding-right: 5px;">专业领域</span>
<span class="item-line"></span>
</div>
<div>
<el-radio-group v-model="type3" size="mini" @click="search()">
<el-radio-button label="0">全部</el-radio-button>
<el-radio-button label="1">业绩提升</el-radio-button>
<el-radio-button label="2">人才培养</el-radio-button>
<el-radio-button label="3">知识管理</el-radio-button>
</el-radio-group>
</div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<!-- <el-row class="search-div-more"> <div class="searBox" v-if="searchwd">
<el-col :span="24"> <el-button type="text" id="closeSearchBtn" @click="closeSearch">
<el-button type="text" @click="queryExpand = true" v-if="!queryExpand">收起</el-button> {{word}}
<el-button type="text" v-else @click="queryExpand = false">更多</el-button> <i :class="showAll ? 'el-icon-arrow-up ': 'el-icon-arrow-down'"></i>
</el-col> </el-button>
</el-row> --> </div>
</el-row> </el-row>
<el-row class="order-div"> <el-row class="order-div">
<span class="quyer-tag"> <span class="quyer-tag">
<el-button type="text" class="order-class" @click="searchData('')" :class="{ actice: queryCondition.orderField == '' }">时间最近</el-button> <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('praises')" :class="{ actice: queryCondition.orderField == 'praises' }">热度最高</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> --> <!-- <el-button type="text" class="order-class" @click="queryCondition.breCommend = queryCondition.breCommend == ture ? true : null" :class="{ actice: queryCondition.breCommend == true }">组织推荐</el-button> -->
</span> </span>
<!-- <span v-if="isFind" style="padding-left:10px;">本次搜索出 {{caseList.count}} 条结果</span> -->
<!-- <span class="more"></span> -->
</el-row> </el-row>
<el-row class="data-content"> <el-row class="data-content">
<el-col :span="24" v-for="item in caseList.list" :key="item.id" class="case-list"> <el-col :span="24" v-for="item in caseList.list" :key="item.id" class="case-list">
@@ -116,30 +84,56 @@
<div class="case-info-title"> <div class="case-info-title">
<router-link :to="'/case/detail?id='+item.id"> <router-link :to="'/case/detail?id='+item.id">
<!-- <span v-if="i % 2 == 0" style="color:red;margin-right:5px">[组织推荐]</span> --> <!-- <span v-if="i % 2 == 0" style="color:red;margin-right:5px">[组织推荐]</span> -->
<span v-html="item.title"></span> <div>
<span class="" v-html="item.title"></span>
<div class="case-info-date"> <div class="case-info-date">
<i class="el-icon-time"></i> <i class="el-icon-time"></i>
<time-show :time="item.sysCreateTime"></time-show> <time-show :time="item.sysCreateTime"></time-show>
</div> </div>
</div>
</router-link> </router-link>
</div> </div>
<div class="case-info-summary" > <div style="height:35px">
{{item.content}} <author :avatar="item.authorInfo.avatar" :name="item.authorInfo.name" :info="item.authorInfo.orgInfo" :sex="item.authorInfo.sex"></author>
</div> </div>
<!-- <router-link :to="'/case/detail?id='+item.id"> -->
<!-- class="case-info-summary" -->
<div>
<router-link :to="'/case/detail?id='+item.id">
<!-- {{item.summary}} -->
{{displayAll(item)}}
</router-link>
<span style="color:#588afc" v-if="item.summary.length>90" @click="changeIsAll(item)">
{{item.isAll?'收起':'全文'}}
</span>
</div>
<!-- </router-link> -->
<!-- <div class="button-wrap" v-if="needShowExpande">
<div class="exp-but" @click="expandeClick" v-if="!expande">展开
</div>
<div class="exp-but" @click="expandeClick" v-else>收起</div>
</div> -->
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
<div><author :avatar="item.authorInfo.avatar" :name="item.authorInfo.name" :info="item.authorInfo.orgInfo" :sex="item.authorInfo.sex"></author> </div>
<div><interactBar :type="0" :shares="false" :views="false" :data="item" :readonly="false"></interactBar> </div> <div>
<interactBar :type="0" :shares="false" :data="item" :readonly="false"></interactBar> </div>
</div> </div>
</div> </div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</el-card>
<div class="pagination-div"> <div class="pagination-div">
<span class="pag-text" v-if="isMore" @click="loadMore()">加载更多</span> <span class="pag-text" @click="loadMore()" v-if="moreState == 1">加载更多</span>
<span class="pag-text" v-else>没有更多数据了</span> <span class="pag-text-msg" v-else-if="moreState == 2">数据加载中</span>
<span class="pag-text-msg" v-else-if="moreState == 3 && !isSeach">没有更多数据了</span>
<span class="pag-text-msg" v-else-if="isSeach">没有查询到相关内容</span>
</div> </div>
<div v-if="isSeach" style="height:382px">
</div>
</el-card>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@@ -196,7 +190,7 @@
<div style="height: 10px;"></div> <div style="height: 10px;"></div>
<el-card class="ranking-card" > <el-card class="ranking-card" >
<div slot="header"> <div slot="header">
<span style="font-size: 14px;font-weight: 600;color: #333333;">人气</span> <span style="font-size: 14px;font-weight: 600;color: #333333;">热度</span>
</div> </div>
<div style="padding-bottom:10px"> <div style="padding-bottom:10px">
<el-row class="ranking-title"> <el-row class="ranking-title">
@@ -217,17 +211,8 @@
</el-row> </el-row>
</div> </div>
</el-card> </el-card>
</div> </div>
</div> </div>
</div> </div>
<el-row :gutter="10"> <el-row :gutter="10">
@@ -263,12 +248,21 @@ import author from '@/components/Portal/authorInfo.vue';
import apiCase from '@/api/modules/cases.js'; import apiCase from '@/api/modules/cases.js';
import apiUser from '@/api/system/user.js'; import apiUser from '@/api/system/user.js';
import apiSearchterm from "@/api/modules/searchterm.js"; import apiSearchterm from "@/api/modules/searchterm.js";
import apiDict from "@/api/modules/dict.js"; import { deepClone } from "../../../utils";
import apiDict from "@/api/modules/dict.js"
export default { export default {
name: 'index', name: 'index',
components: { portalHeader, portalFooter, portalFloatTools, interactBar,timeShow ,author}, components: { portalHeader, portalFooter, portalFloatTools, interactBar,timeShow ,author},
computed: { computed: {
...mapGetters(['userInfo','portalCase']), ...mapGetters(['userInfo','portalCase']),
word: function() {
if (this.showAll == false) {
//对文字进行处理
return "展开";
} else {
return "收起";
}
},
isMore() { isMore() {
let isOk = true; let isOk = true;
if(this.caseList.list.length === this.caseList.count) { if(this.caseList.list.length === this.caseList.count) {
@@ -279,6 +273,10 @@ export default {
}, },
data() { data() {
return { return {
moreState:1,// 1 加载更多 2 加载中 3无数据
isSeach:false,
searchwd:true,
showAll:true,//是否展开全部
searchRecords:[], searchRecords:[],
caseList:{ caseList:{
count:0, count:0,
@@ -287,14 +285,20 @@ export default {
ankingList:[], ankingList:[],
Popularity:[], Popularity:[],
Positive:[], Positive:[],
domain:[],
Profess:[],
optionsList: [], //分类数据
protocolDialogVisible: false, protocolDialogVisible: false,
protocolConfirmButton:true, protocolConfirmButton:true,
queryCondition:{ queryCondition:{
pageIndex:1, pageIndex:1,
pageSize:10, pageSize:10,
orderField:'', orderField:'comments',
breCommend:null, // breCommend:null,
keyWord:'' keyWord:'',
majorType:null,//专业分类
orgDomain:null,// 组织领域
orderAsc: false
}, },
keyWord:'', keyWord:'',
anking: 2, anking: 2,
@@ -306,21 +310,32 @@ export default {
searchTags: [] searchTags: []
}; };
}, },
mounted() { mounted() {
this.$nextTick(function() {
this.closeSearch();
});
if(!this.portalCase.readProtocol){ if(!this.portalCase.readProtocol){
this.protocolDialogVisible = true; this.protocolDialogVisible = true;
} }
this.keyWord = this.$route.query.keyword; this.keyWord = this.$route.query.keyword;
this.getAnkingData() if(this.keyWord != '') {
this.getPopularity() this.isSeach = true;
this.searchterm() }
this.getPositive() this.getAnkingData();
this.getCaseData(); this.getPopularity();
this.searchterm();
this.getPositive();
this.getProfess();
this.getdomain();
// this.getCaseData();
this.search();
window.addEventListener( window.addEventListener(
"scroll", "scroll",
this.handleScroll this.handleScroll
); );
}, },
watch:{ watch:{
// queryCondition:{ // queryCondition:{
// handler(newValue,oldValue){ // handler(newValue,oldValue){
@@ -334,8 +349,77 @@ export default {
window.removeEventListener("scroll",this.handleScroll); window.removeEventListener("scroll",this.handleScroll);
}, },
methods: { methods: {
//展示全部
displayAll(item) {
if(!item.isAll && item.summary && item.summary.length > 90) {
return item.summary.slice(0, 90) + "...";
}
return item.summary;
},
changeIsAll(item) {
item.isAll=!item.isAll;
},
closeSearch() {
this.showAll = !this.showAll;
var searchBoxHeght = document.getElementById("searchBox");
var searchBoxWidth = document.getElementById("searchBox");
if(searchBoxWidth.clientWidth > 950){
this.searchwd = false;
}
if (this.showAll == false) {
searchBoxHeght.style.height = 70 + "px";
} else {
searchBoxHeght.style.height = "auto";
}
},
getAnkingData(){
apiCase.usernameList(5).then(res=>{
if(res.status==200){
this.ankingList=res.result
// console.log(res)
}
})
},
getPopularity(){
apiCase.queryPraises(5).then(res=>{
if(res.status==200){
this.Popularity=res.result
// console.log(this.Popularity)
}
})
},
getPositive(){
apiCase.queryComments(5).then(res=>{
if(res.status==200){
this.Positive=res.result
console.log(res)
}
})
},
getdomain(){
let key ='org_domain'
apiDict.items(key).then(res =>{
if(res.status==200){
this.domain = res.result
}
})
},
getProfess(){
let key ='major_type'
apiDict.items(key).then(res =>{
if(res.status==200){
this.Profess = res.result
}
})
},
emitInput(val) { emitInput(val) {
this.keyWord=val; this.keyWord=val;
this.isSeach =true;
this.queryCondition.pageIndex = 1
this.search() this.search()
}, },
searchData(num) { searchData(num) {
@@ -346,13 +430,13 @@ export default {
let innerHeight = document.querySelector('#case-list-content').clientHeight let innerHeight = document.querySelector('#case-list-content').clientHeight
let outerHeight = document.documentElement.clientHeight let outerHeight = document.documentElement.clientHeight
let scrollTop = document.documentElement.scrollTop let scrollTop = document.documentElement.scrollTop
// if ((outerHeight + scrollTop + 350) >= innerHeight) { if ((outerHeight + scrollTop + 350) >= innerHeight) {
// if(this.moreState == 1 && this.course.pageIndex < 4) { if(this.moreState == 1 && this.course.pageIndex < 4) {
// this.loadMore(); this.loadMore();
// } }
// } }
if(scrollTop > 100) { if(scrollTop > 630) {
document.querySelector('#fixd-box').style.cssText = "position: fixed;top: 0;width:245px"; document.querySelector('#fixd-box').style.cssText = "position: fixed;top: -550px;width:245.5px";
} else { } else {
document.querySelector('#fixd-box').style.cssText = "position: static"; document.querySelector('#fixd-box').style.cssText = "position: static";
} }
@@ -397,12 +481,19 @@ export default {
this.getCaseData(); this.getCaseData();
}, },
async getCaseData(){ async getCaseData(){
this.getTags();
let isTopList = []; let isTopList = [];
let caseList = []; let caseList = [];
if(this.queryCondition.pageIndex == 1) {
this.caseList.list =[];
}
this.moreState = 2;
await apiCase.queryList(this.queryCondition).then(res=>{ await apiCase.queryList(this.queryCondition).then(res=>{
if(res.status==200){ if(res.status==200){
if(res.result.list.length>0){ if(res.result.list.length>0){
this.isSeach =false;
res.result.list.forEach(item=>{ res.result.list.forEach(item=>{
item.isAll=false;
item.authorInfo={aid:'',name:'',orgInfo:'',avatar:'',sex:null}; item.authorInfo={aid:'',name:'',orgInfo:'',avatar:'',sex:null};
if(item.isTop) { if(item.isTop) {
isTopList.push(item); isTopList.push(item);
@@ -410,12 +501,17 @@ export default {
caseList.push(item) caseList.push(item)
} }
}) })
if(this.queryCondition.pageIndex == 1) {
this.caseList.list =[];
}
this.caseList.list.push(...isTopList,...caseList); this.caseList.list.push(...isTopList,...caseList);
this.caseList.count=res.result.count; this.caseList.count=res.result.count;
this.getCaseUserData(res.result.list) this.getCaseUserData(res.result.list)
this.moreState = 1;
if(res.result.count === res.result.list.length) {
this.moreState = 3;
}
} else {
this.moreState = 3;
} }
}else{ }else{
this.$message.error(res.message); this.$message.error(res.message);
@@ -423,6 +519,43 @@ export default {
}).catch(err=>{ }).catch(err=>{
console.log(err) console.log(err)
}) })
},
getTags() {
this.searchTags = [];
let caseData = deepClone(this.queryCondition);
for (let i in caseData) {
if (
caseData[i] !== "" &&
i !== "pageIndex" &&
i !== "pageSize" &&
i !== "orderField" &&
i !== "orderAsc" &&
caseData[i] !== null &&
caseData[i] !== undefined
) {
if(caseData[i] !== '0') {
this.searchTags.push(
caseData[i]
);
}
}
}
},
tagsClose(tag, index) {
for (let i in this.queryCondition) {
if (tag === this.queryCondition[i]) {
if(i == 'majorType'){
this.queryCondition.majorType = null;
}
if(i == 'orgDomain'){
this.queryCondition.orgDomain = null;
}
this.queryCondition[i] = "";
this.searchTags.splice(index, 1);
this.getCaseData();
}
}
}, },
getCaseUserData(caseList){ getCaseUserData(caseList){
let ids=caseList.map((item,index)=>{ let ids=caseList.map((item,index)=>{
@@ -447,18 +580,19 @@ export default {
}); });
}, },
getAnkingData(){ getAnkingData(){
apiCase.usernameList(5).then(res=>{ apiCase.usernameList(10).then(res=>{
if(res.status==200){ if(res.status==200){
this.ankingList=res.result this.ankingList=res.result
// console.log(res)
} }
}) })
}, },
getPopularity(){ getPopularity(){
apiCase.queryPraises(5).then(res=>{ apiCase.queryPraises(5).then(res=>{
if(res.status==200){ if(res.status==200){
this.Popularity=res.result this.Popularity=res.result
// console.log(this.Popularity)
} }
}) })
}, },
@@ -466,7 +600,7 @@ export default {
apiCase.queryComments(5).then(res=>{ apiCase.queryComments(5).then(res=>{
if(res.status==200){ if(res.status==200){
this.Positive=res.result this.Positive=res.result
console.log(res)
} }
}) })
}, },
@@ -475,13 +609,18 @@ export default {
this.$router.push(`/case/detail?id=${item.id}`); this.$router.push(`/case/detail?id=${item.id}`);
} }
} }
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.searBox{
text-align: center;
margin: 0px auto 0 auto;
}
#searchBox {
overflow: hidden;
}
.ranking-title { .ranking-title {
line-height: 34px; line-height: 34px;
font-size: 15px; font-size: 15px;
@@ -511,17 +650,18 @@ export default {
padding: 0; padding: 0;
} }
::v-deep .bacolor:nth-child(odd){ ::v-deep .bacolor:nth-child(odd){
background-color: #fff; background-color: #f6f6f6;
padding: 0 5px; padding: 0 5px;
} }
::v-deep .bacolor:nth-child(even){ ::v-deep .bacolor:nth-child(even){
background-color: #f6f6f6; background-color: #fff;
padding: 0 5px; padding: 0 5px;
} }
::v-deep .el-card{ ::v-deep .el-card{
border: none; border: none;
border-radius: 0px; border-radius: 0px;
border: 1px solid #EBEEF5;
} }
::v-deep .el-radio-button__inner, .el-radio-group { ::v-deep .el-radio-button__inner, .el-radio-group {
vertical-align: top; vertical-align: top;
@@ -613,6 +753,9 @@ export default {
.pagination-div { .pagination-div {
text-align: center; text-align: center;
padding: 10px 0; padding: 10px 0;
.pag-text{
}
} }
.order-div { .order-div {
padding: 12px 15px; padding: 12px 15px;
@@ -656,7 +799,8 @@ export default {
} }
} }
.case-info-summary { .case-info-summary {
height: 45px; height: 60px;
line-height: 30px; line-height: 30px;
font-size: 15px; font-size: 15px;
color: #444444; color: #444444;
@@ -718,18 +862,19 @@ export default {
} }
} }
.right-box {
line-height: 25px;
.ranking-card { .ranking-card {
margin-bottom: 10px;
.el-col{
margin-bottom: 10px;
}
.center{ .center{
text-align: center; text-align: center;
} }
} }
.right-box {
line-height: 25px;
.ranking-title {
}
.aligh-title{ .aligh-title{
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;

View File

@@ -48,6 +48,29 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="案例" name="case">
<div style="min-height: 500px;">
<case-items @confirm="confirm" :items="caseList.list"></case-items>
<div v-if="caseList.list.length > 0" style="text-align: center;margin-top:57px;">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="caseList.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="articleList.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="caseList.count"
></el-pagination>
</div>
<div v-else>
<div v-if="caseList.list.length == 0">
<div v-if="isSearh" class="zan-wu">没有查询到相关内容</div>
<div v-else class="zan-wu">暂无数据</div>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="文章" name="article"> <el-tab-pane label="文章" name="article">
<div style="min-height: 500px;"> <div style="min-height: 500px;">
<article-items @confirm="confirm" :items="articleList.list"></article-items> <article-items @confirm="confirm" :items="articleList.list"></article-items>
@@ -109,9 +132,10 @@
import qaItems from '@/components/Qa/shareList.vue' import qaItems from '@/components/Qa/shareList.vue'
import apiShares from '@/api/modules/shares.js'; import apiShares from '@/api/modules/shares.js';
import apiUser from '@/api/system/user.js'; import apiUser from '@/api/system/user.js';
import caseItems from '@/components/Case/caseItems.vue'
export default { export default {
name: 'myShareIndex', name: 'myShareIndex',
components:{articleItems,courseItems,qaItems}, components:{articleItems,courseItems,qaItems,caseItems},
data(){ data(){
return { return {
isRead: '', isRead: '',
@@ -156,12 +180,16 @@
if (this.tabName == 'qa') { if (this.tabName == 'qa') {
this.findQa(); this.findQa();
} }
if (this.tabName == 'case') {
this.findCase();
}
if (this.tabName == 'article') { if (this.tabName == 'article') {
this.findArticle(); this.findArticle();
} }
if (this.tabName == 'course') { if (this.tabName == 'course') {
this.findCourse(); this.findCourse();
} }
}, },
resData() { resData() {
this.qaList.pageIndex = 1; this.qaList.pageIndex = 1;
@@ -196,6 +224,10 @@
if (tab.name == 'course') { if (tab.name == 'course') {
this.findCourse(); this.findCourse();
} }
console.log(tab.name,'tab.name');
if (tab.name == 'case') {
this.findCase();
}
}, },
//分页点击事件 //分页点击事件
handleSizeChange(value) { handleSizeChange(value) {
@@ -211,6 +243,10 @@
this.courseList.pageSize = value; this.courseList.pageSize = value;
this.findCourse(); this.findCourse();
} }
if (this.tabName == 'case') {
this.caseList.pageSize = value;
this.findCase();
}
}, },
//分页点击事件 //分页点击事件
handleCurrentChange(value) { handleCurrentChange(value) {
@@ -226,6 +262,24 @@
this.courseList.pageIndex = value; this.courseList.pageIndex = value;
this.findCourse(); this.findCourse();
} }
if (this.tabName == 'case') {
this.caseList.pageIndex = value;
this.findCase();
}
},
// 案例数据查询
findCase() {
let { pageIndex, pageSize } = this.caseList;
let query = { pageIndex, pageSize,keyword:this.keyword,isRead: this.isRead,objType:3};
apiShares.myCaseList(query).then(res=>{
console.log(res,'res');
if(res.status == 200) {
this.caseList.count = res.result.count;
this.caseList.list = res.result.list;
}else {
this.$message.error(res.message);
}
})
}, },
//问答数据查询 //问答数据查询
findQa() { findQa() {
@@ -324,6 +378,9 @@
if (this.tabName == 'course') { if (this.tabName == 'course') {
this.findCourse(); this.findCourse();
} }
if (this.tabName == 'case') {
this.findCase();
}
}else{ }else{
this.$message.error('撤回失败'); this.$message.error('撤回失败');
} }

View File

@@ -64,6 +64,30 @@
</div> </div>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="案例" name="case">
<div style="min-height: 500px;">
<case-items :keyword="keyword" type="toMy" @confirm="confirm" :items="caseList.list"></case-items>
<!-- v-if="articleList.count>articleList.pageSize" -->
<div v-if="caseList.list.length > 0" style="text-align: center; margin-top:57px">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="caseList.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="caseList.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="caseList.count"
></el-pagination>
</div>
<div v-else>
<div v-if="caseList.list.length == 0">
<div v-if="isSearh" class="zan-wu">没有查询到相关内容</div>
<div v-else class="zan-wu">暂无数据</div>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="文章" name="article"> <el-tab-pane label="文章" name="article">
<div style="min-height: 500px;"> <div style="min-height: 500px;">
<article-items :keyword="keyword" type="toMy" @confirm="confirm" :items="articleList.list"></article-items> <article-items :keyword="keyword" type="toMy" @confirm="confirm" :items="articleList.list"></article-items>
@@ -118,6 +142,7 @@
</template> </template>
<script> <script>
import caseItems from '@/components/Case/caseItems.vue'
import articleItems from '@/components/Article/shareItems.vue'; import articleItems from '@/components/Article/shareItems.vue';
import courseItems from '@/components/Course/shareItem.vue'; import courseItems from '@/components/Course/shareItem.vue';
import qaItems from '@/components/Qa/shareList.vue'; import qaItems from '@/components/Qa/shareList.vue';
@@ -125,7 +150,7 @@ import apiShares from '@/api/modules/shares.js';
import apiUser from '@/api/system/user.js'; import apiUser from '@/api/system/user.js';
export default { export default {
name: 'myShareIndex', name: 'myShareIndex',
components: { articleItems, courseItems, qaItems }, components: { articleItems, courseItems, qaItems,caseItems },
data() { data() {
return { return {
isSearh:false, isSearh:false,
@@ -183,6 +208,9 @@ export default {
if (this.tabName == 'course') { if (this.tabName == 'course') {
this.findCourse(); this.findCourse();
} }
if (this.tabName == 'case') {
this.findCase();
}
}, },
resData() { resData() {
@@ -218,6 +246,9 @@ export default {
if (tab.name == 'course') { if (tab.name == 'course') {
this.findCourse(); this.findCourse();
} }
if (tab.name == 'case') {
this.findCase();
}
}, },
//分页点击事件 //分页点击事件
handleSizeChange(value) { handleSizeChange(value) {
@@ -233,7 +264,10 @@ export default {
this.courseList.pageSize = value; this.courseList.pageSize = value;
this.findCourse(); this.findCourse();
} }
if (this.tabName == 'case') {
this.caseList.pageSize = value;
this.findCase()
}
}, },
//分页点击事件 //分页点击事件
handleCurrentChange(value) { handleCurrentChange(value) {
@@ -249,8 +283,25 @@ export default {
this.courseList.pageIndex = value; this.courseList.pageIndex = value;
this.findCourse(); this.findCourse();
} }
if (this.tabName == 'case') {
this.caseList.pageIndex = value;
this.findCase();
}
}, },
// 案例
findCase(){
let { pageIndex, pageSize } = this.caseList;
let query = { pageIndex, pageSize, keyword: this.keyword, isRead: this.isRead };
apiShares.myCaseList(query).then(res=>{
if(res.status == 200) {
this.caseList.count = res.result.count;
this.caseList.list = res.result.list;
} else {
this.$message.error(res.message);
}
})
},
//问答数据查询 //问答数据查询
findQa() { findQa() {
let { pageIndex, pageSize } = this.qaList; let { pageIndex, pageSize } = this.qaList;