This commit is contained in:
daihh
2022-06-07 19:25:30 +08:00
22 changed files with 1078 additions and 254 deletions

View File

@@ -105,6 +105,47 @@
</el-card>
</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 class="modules">
@@ -153,6 +194,7 @@
</el-col>
</el-row>
</div> -->
<!-- 推荐文章 -->
<div class="modules">
<!--内容块-->
@@ -313,7 +355,7 @@ export default {
list: []
},
caseList: {
num: 4,
num: 6,
orderType: 2,
list: []
},
@@ -430,6 +472,7 @@ export default {
let userIds = [];
res.result.forEach(item => {
item.authorInfo = { aid: '', name: '', orgInfo: '', avatar: '', code: '',sex:null };
if (item.authorId && item.authorId != '') {
userIds.push(item.authorId);
}
@@ -583,6 +626,61 @@ export default {
</script>
<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{
// color: #5da1ff;
// }

View File

@@ -11,7 +11,7 @@
<!-- <el-option label="全部" :value="0"></el-option> -->
<el-option label="文章" :value="2"></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-select>
<!-- <el-input style="width: 200px;margin-right: 10px" placeholder="请选择来源"></el-input> -->
@@ -155,6 +155,8 @@ export default {
}else if(this.dataList.type == 4){
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,
parentRead:true
}
if(this.dataList.type == 2) {
apiComment.reply(replayInfo).then(res=>{
if(this.dataList.type == 2 || this.dataList.type == 3) {
apiComment.reply(replayInfo).then(res=>{
if(res.status==200){
this.$message.success("回复成功");
this.shareShow = false;
//this.getData();
if(!this.replyItem.replys){
this.replyItem.replys=[];
}

View File

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

View File

@@ -1,65 +1,124 @@
<template>
<div>
<div id="case-list-content">
<portal-header current="case" :goSearch="2"></portal-header>
<div class="portal-content xcontent" style="margin-top: 30px;">
<el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb-nav">
<el-breadcrumb-item :to="{ path: '/case' }">案例列表</el-breadcrumb-item>
<el-breadcrumb-item>案例详情</el-breadcrumb-item>
</el-breadcrumb>
<div class="xrow" style="display: flex;justify-content: space-between;">
<div class="xrow" style="display: flex;justify-content: space-between;">
<div style="flex: 1;">
<el-row :gutter="10">
<el-col :span="24">
<el-card :body-style="{ padding: '0px' }" class="detail">
<div class="title">{{ caseDetail.title }}</div>
<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.code }}</span>
<span>部门{{ authorInfo.orgInfo }}</span>
<span>案例编号{{ caseDetail.id }}</span>
<span>发布时间{{ caseDetail.sysCreateTime }}</span>
<interactBar :views="false" :data="caseDetail" :type="3" :comments="false" :shares="false"></interactBar>
<!-- <span>案例编号{{ caseDetail.id }}</span> -->
<span v-if="caseDetail.sysCreateTime">{{ caseDetail.sysCreateTime.substring(0,10) }}</span>
<interactBar :data="caseDetail" :type="3" :comments="false" :shares="true"></interactBar>
</div>
<div class="btn-div">
<span class="item">角色认知</span>
<span class="item">角色转变</span>
<span class="item">团队管理</span>
<div class="case-summary"><span>{{ caseDetail.summary }}</span></div>
<div class="btn-div" >
<span v-if="caseDetail.orgDomain" class="item">{{ caseDetail.orgDomain }}</span>
<span v-if="caseDetail.majorType" class="item">{{ caseDetail.majorType }}</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>
</el-card>
<el-card :body-style="{ padding: '0px' }" class="jianjie">
<!-- <div class="content">
{{ caseDetail.content }}
</div> -->
<pdfPreview :filePath="basePath+caseDetail.filePath"></pdfPreview>
<pdfPreview v-if="pdfPath" :filePath="pdfPath"></pdfPreview>
</el-card>
<!-- :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-row>
</div>
<div style="width: 245px;margin-left: 10px;"><!--排行榜-->
<div id="fixd-box">
<el-card class="ranking-card">
<div slot="header">
<span>排行榜</span>
</div>
<div>
<el-row class="ranking-title" v-for="(item,index) in ankingList" :key="index">
<el-col :span="6">
<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`"/>
</el-col>
<el-col class="center" :span="18">{{item.sysCreateUname}}</el-col>
<!-- <el-col class="center" :span="7">{{''}}</el-col>
<el-col class="center" :span="7">{{item.counts}}</el-col> -->
</el-row>
</div>
</el-card>
</div>
</div>
<div style="width: 245px;margin-left: 5px;">
<div>
<div id="fixd-box">
<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">
<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.sysCreateUname" placement="top-start">
<el-col :span="15" style="cursor: pointer;" 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 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>
</div>
</el-card>
</div>
</div>
</div>
</div>
</div>
<portal-footer></portal-footer>
@@ -77,7 +136,8 @@ import comments from '@/components/Portal/comments.vue';
import apiCase from '@/api/modules/cases.js';
import apiUser from '@/api/system/user.js';
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 {
name: 'atticle',
components: { portalHeader, portalFooter, interactBar, author, comments,pdfPreview },
@@ -86,29 +146,76 @@ export default {
},
data() {
return {
toUsers:[],
ankingList:[],
Popularity:[],
Positive:[],
resolveId: '',
basePath:process.env.VUE_APP_FILE_BASE_URL,
pdfPath:'',
caseDetail: {
id:'',
filePath:''
},
ankingList:[],
authorInfo:{ aid: '', name: '', orgInfo: '', avatar: '', code: '' }
authorInfo:{ aid: '', name: '', orgInfo: '', avatar: '', code: '',sex:null}
};
},
mounted() {
//this.pdfPath=this.basePath+'/case/demo1.pdf';
this.resolveId = this.$route.query.id;
if (this.resolveId) {
this.getCaseData();
}
this.getAnkingData();
this.getPopularity();
this.getPositive();
window.addEventListener(
"scroll",
this.handleScroll
);
},
methods: {
getAnkingData(){
apiCase.usernameList(10).then(res=>{
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(){
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)
}
})
},
@@ -118,14 +225,24 @@ export default {
if (JSON.stringify(res.result) != '{}') {
this.caseDetail = res.result;
this.getCaseUserDetail();
if(this.caseDetail.filePath){
this.pdfPath=this.basePath+this.caseDetail.filePath;
}else{
this.$message.error('内容文件不存在或已被删除,请与管理员联系');
}
}
}
});
},
getCaseUserDetail() {
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.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>
<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 {
margin-bottom: 10px;
}
@@ -182,7 +341,7 @@ export default {
padding-bottom: 10px;
color: #666;
.item {
margin: 0 8px 0 15px;
margin: 0 10px 0 0px;
border: 1px solid #9e9e9e;
padding: 3px 10px;
border-radius: 8px;
@@ -195,7 +354,7 @@ export default {
.jianjie {
margin: 15px 0;
background-color: #fff;
padding: 0px 2px 10px 2px;
padding: 0px 0px 10px 0px;
.content {
padding: 10px 0;
line-height: 25px;

View File

@@ -7,43 +7,37 @@
<el-col :span="24">
<el-card :body-style="{ padding: '0px' }" class="left-div">
<el-row class="search-div">
<el-row>
<!-- <el-row>
<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> -->
<!-- <div class="tip">热门搜索词物联网 教师 辅导 绩效</div> -->
<!-- <div class="tip" style="font-size: 14px;">
<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" 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>
</div> -->
</div>
</el-col>
</el-row>
</el-row> -->
<div class="searchbar" v-if="searchTags.length > 0">
<div style="line-height: 30px;">
<span class="item-title">搜索条件</span>
<el-tag closable>显示事业</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>
<el-tag closable v-for="(tag, tagIdx) in searchTags" :key="tagIdx" @close="tagsClose(tag,tagIdx)">{{ tag }}</el-tag>
</div>
</div>
<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;">
<div style="line-height: 25px;padding-right: 5px;">
<span class="item-title" style="padding-right: 5px;">组织领域</span>
<span class="item-line"></span>
</div>
<div>
<el-radio-group v-model="category" size="mini" @change="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>
<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.name"> {{ item.name}}</el-radio-button>
</el-radio-group>
</div>
</div>
</el-col>
</el-row>
<div class="search-div-collapse">
@@ -51,63 +45,37 @@
<el-col :span="24">
<!-- <div class="item-title">专业领域</div> -->
<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-line"></span>
</div>
<div>
<el-radio-group v-model="type2" size="mini" @change="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-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>
<div style="flex:1" id="searchBox">
<el-radio-group 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.name" > {{ item.name }} </el-radio-button>
</el-radio-group>
</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>
</el-col>
</el-row>
</div>
<!-- <el-row class="search-div-more">
<el-col :span="24">
<el-button type="text" @click="queryExpand = true" v-if="!queryExpand">收起</el-button>
<el-button type="text" v-else @click="queryExpand = false">更多</el-button>
</el-col>
</el-row> -->
<div class="searBox" v-if="searchwd">
<el-button type="text" id="closeSearchBtn" @click="closeSearch">
{{word}}
<i :class="showAll ? 'el-icon-arrow-up ': 'el-icon-arrow-down'"></i>
</el-button>
</div>
</el-row>
<el-row class="order-div">
<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('praises')" :class="{ actice: queryCondition.orderField == 'praises' }">热度最高</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('')" :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>
<!-- <span v-if="isFind" style="padding-left:10px;">本次搜索出 {{caseList.count}} 条结果</span> -->
<!-- <span class="more"></span> -->
</el-row>
<el-row class="data-content">
<el-col :span="24" v-for="item in caseList.list" :key="item.id" class="case-list">
@@ -116,34 +84,60 @@
<div class="case-info-title">
<router-link :to="'/case/detail?id='+item.id">
<!-- <span v-if="i % 2 == 0" style="color:red;margin-right:5px">[组织推荐]</span> -->
<span v-html="item.title"></span>
<div class="case-info-date">
<div>
<span class="" v-html="item.title"></span>
<div class="case-info-date">
<i class="el-icon-time"></i>
<time-show :time="item.sysCreateTime"></time-show>
</div>
</div>
</router-link>
</div>
<div style="height:35px">
<author :avatar="item.authorInfo.avatar" :name="item.authorInfo.name" :info="item.authorInfo.orgInfo" :sex="item.authorInfo.sex"></author>
</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>
</router-link>
</div>
<div class="case-info-summary" >
{{item.content}}
</div>
<div class="exp-but" @click="expandeClick" v-else>收起</div>
</div> -->
<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>
</el-col>
</el-row>
<div class="pagination-div">
<span class="pag-text" @click="loadMore()" v-if="moreState == 1">加载更多</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 v-if="isSeach" style="height:382px">
</div>
</el-card>
<div class="pagination-div">
<span class="pag-text" v-if="isMore" @click="loadMore()">加载更多</span>
<span class="pag-text" v-else>没有更多数据了</span>
</div>
</el-col>
</el-row>
</div>
<div style="width: 245px;margin-left: 5px;">
<div style="width: 245px;margin-left: 5px;">
<div>
<div id="fixd-box">
<el-card class="ranking-card" >
@@ -196,7 +190,7 @@
<div style="height: 10px;"></div>
<el-card class="ranking-card" >
<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 style="padding-bottom:10px">
<el-row class="ranking-title">
@@ -217,19 +211,10 @@
</el-row>
</div>
</el-card>
</div>
</div>
</div>
<el-row :gutter="10">
</el-row>
<div style="height: 50px;"></div>
@@ -263,12 +248,21 @@ import author from '@/components/Portal/authorInfo.vue';
import apiCase from '@/api/modules/cases.js';
import apiUser from '@/api/system/user.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 {
name: 'index',
components: { portalHeader, portalFooter, portalFloatTools, interactBar,timeShow ,author},
computed: {
...mapGetters(['userInfo','portalCase']),
word: function() {
if (this.showAll == false) {
//对文字进行处理
return "展开";
} else {
return "收起";
}
},
isMore() {
let isOk = true;
if(this.caseList.list.length === this.caseList.count) {
@@ -279,6 +273,10 @@ export default {
},
data() {
return {
moreState:1,// 1 加载更多 2 加载中 3无数据
isSeach:false,
searchwd:true,
showAll:true,//是否展开全部
searchRecords:[],
caseList:{
count:0,
@@ -287,14 +285,20 @@ export default {
ankingList:[],
Popularity:[],
Positive:[],
domain:[],
Profess:[],
optionsList: [], //分类数据
protocolDialogVisible: false,
protocolConfirmButton:true,
queryCondition:{
pageIndex:1,
pageSize:10,
orderField:'',
breCommend:null,
keyWord:''
orderField:'comments',
// breCommend:null,
keyWord:'',
majorType:null,//专业分类
orgDomain:null,// 组织领域
orderAsc: false
},
keyWord:'',
anking: 2,
@@ -306,21 +310,32 @@ export default {
searchTags: []
};
},
mounted() {
this.$nextTick(function() {
this.closeSearch();
});
if(!this.portalCase.readProtocol){
this.protocolDialogVisible = true;
}
this.keyWord = this.$route.query.keyword;
this.getAnkingData()
this.getPopularity()
this.searchterm()
this.getPositive()
this.getCaseData();
if(this.keyWord != '') {
this.isSeach = true;
}
this.getAnkingData();
this.getPopularity();
this.searchterm();
this.getPositive();
this.getProfess();
this.getdomain();
// this.getCaseData();
this.search();
window.addEventListener(
"scroll",
this.handleScroll
);
},
watch:{
// queryCondition:{
// handler(newValue,oldValue){
@@ -330,12 +345,81 @@ export default {
// immediate:true
// }
},
beforeDestroy(){
beforeDestroy(){
window.removeEventListener("scroll",this.handleScroll);
},
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) {
this.keyWord=val;
this.isSeach =true;
this.queryCondition.pageIndex = 1
this.search()
},
searchData(num) {
@@ -346,13 +430,13 @@ export default {
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 > 100) {
document.querySelector('#fixd-box').style.cssText = "position: fixed;top: 0;width:245px";
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";
}
@@ -397,12 +481,19 @@ export default {
this.getCaseData();
},
async getCaseData(){
this.getTags();
let isTopList = [];
let caseList = [];
if(this.queryCondition.pageIndex == 1) {
this.caseList.list =[];
}
this.moreState = 2;
await apiCase.queryList(this.queryCondition).then(res=>{
if(res.status==200){
if(res.result.list.length>0){
this.isSeach =false;
res.result.list.forEach(item=>{
item.isAll=false;
item.authorInfo={aid:'',name:'',orgInfo:'',avatar:'',sex:null};
if(item.isTop) {
isTopList.push(item);
@@ -410,12 +501,17 @@ export default {
caseList.push(item)
}
})
if(this.queryCondition.pageIndex == 1) {
this.caseList.list =[];
}
this.caseList.list.push(...isTopList,...caseList);
this.caseList.count=res.result.count;
this.getCaseUserData(res.result.list)
this.moreState = 1;
if(res.result.count === res.result.list.length) {
this.moreState = 3;
}
} else {
this.moreState = 3;
}
}else{
this.$message.error(res.message);
@@ -423,6 +519,43 @@ export default {
}).catch(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){
let ids=caseList.map((item,index)=>{
@@ -447,18 +580,19 @@ export default {
});
},
getAnkingData(){
apiCase.usernameList(5).then(res=>{
apiCase.usernameList(10).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)
}
})
},
@@ -466,7 +600,7 @@ export default {
apiCase.queryComments(5).then(res=>{
if(res.status==200){
this.Positive=res.result
console.log(res)
}
})
},
@@ -475,13 +609,18 @@ export default {
this.$router.push(`/case/detail?id=${item.id}`);
}
}
};
</script>
<style scoped lang="scss">
.searBox{
text-align: center;
margin: 0px auto 0 auto;
}
#searchBox {
overflow: hidden;
}
.ranking-title {
line-height: 34px;
font-size: 15px;
@@ -511,17 +650,18 @@ export default {
padding: 0;
}
::v-deep .bacolor:nth-child(odd){
background-color: #fff;
background-color: #f6f6f6;
padding: 0 5px;
}
::v-deep .bacolor:nth-child(even){
background-color: #f6f6f6;
background-color: #fff;
padding: 0 5px;
}
::v-deep .el-card{
border: none;
border-radius: 0px;
border: 1px solid #EBEEF5;
}
::v-deep .el-radio-button__inner, .el-radio-group {
vertical-align: top;
@@ -546,7 +686,7 @@ export default {
.item-line{
padding-left: 2px;
height: 20px;
background: #ddd;
}
@@ -613,6 +753,9 @@ export default {
.pagination-div {
text-align: center;
padding: 10px 0;
.pag-text{
}
}
.order-div {
padding: 12px 15px;
@@ -656,7 +799,8 @@ export default {
}
}
.case-info-summary {
height: 45px;
height: 60px;
line-height: 30px;
font-size: 15px;
color: #444444;
@@ -718,18 +862,19 @@ export default {
}
}
.right-box {
line-height: 25px;
.ranking-card {
margin-bottom: 10px;
.el-col{
margin-bottom: 10px;
}
.ranking-card {
.center{
text-align: center;
}
}
.right-box {
line-height: 25px;
.ranking-title {
}
.aligh-title{
font-size: 14px;
color: #333333;

View File

@@ -48,6 +48,29 @@
</div>
</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">
<div style="min-height: 500px;">
<article-items @confirm="confirm" :items="articleList.list"></article-items>
@@ -109,9 +132,10 @@
import qaItems from '@/components/Qa/shareList.vue'
import apiShares from '@/api/modules/shares.js';
import apiUser from '@/api/system/user.js';
import caseItems from '@/components/Case/caseItems.vue'
export default {
name: 'myShareIndex',
components:{articleItems,courseItems,qaItems},
components:{articleItems,courseItems,qaItems,caseItems},
data(){
return {
isRead: '',
@@ -156,12 +180,16 @@
if (this.tabName == 'qa') {
this.findQa();
}
if (this.tabName == 'case') {
this.findCase();
}
if (this.tabName == 'article') {
this.findArticle();
}
if (this.tabName == 'course') {
this.findCourse();
}
},
resData() {
this.qaList.pageIndex = 1;
@@ -196,6 +224,10 @@
if (tab.name == 'course') {
this.findCourse();
}
console.log(tab.name,'tab.name');
if (tab.name == 'case') {
this.findCase();
}
},
//分页点击事件
handleSizeChange(value) {
@@ -211,6 +243,10 @@
this.courseList.pageSize = value;
this.findCourse();
}
if (this.tabName == 'case') {
this.caseList.pageSize = value;
this.findCase();
}
},
//分页点击事件
handleCurrentChange(value) {
@@ -226,6 +262,24 @@
this.courseList.pageIndex = value;
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() {
@@ -324,6 +378,9 @@
if (this.tabName == 'course') {
this.findCourse();
}
if (this.tabName == 'case') {
this.findCase();
}
}else{
this.$message.error('撤回失败');
}

View File

@@ -64,6 +64,30 @@
</div>
</div>
</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">
<div style="min-height: 500px;">
<article-items :keyword="keyword" type="toMy" @confirm="confirm" :items="articleList.list"></article-items>
@@ -118,6 +142,7 @@
</template>
<script>
import caseItems from '@/components/Case/caseItems.vue'
import articleItems from '@/components/Article/shareItems.vue';
import courseItems from '@/components/Course/shareItem.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';
export default {
name: 'myShareIndex',
components: { articleItems, courseItems, qaItems },
components: { articleItems, courseItems, qaItems,caseItems },
data() {
return {
isSearh:false,
@@ -183,6 +208,9 @@ export default {
if (this.tabName == 'course') {
this.findCourse();
}
if (this.tabName == 'case') {
this.findCase();
}
},
resData() {
@@ -218,6 +246,9 @@ export default {
if (tab.name == 'course') {
this.findCourse();
}
if (tab.name == 'case') {
this.findCase();
}
},
//分页点击事件
handleSizeChange(value) {
@@ -233,7 +264,10 @@ export default {
this.courseList.pageSize = value;
this.findCourse();
}
if (this.tabName == 'case') {
this.caseList.pageSize = value;
this.findCase()
}
},
//分页点击事件
handleCurrentChange(value) {
@@ -249,8 +283,25 @@ export default {
this.courseList.pageIndex = value;
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() {
let { pageIndex, pageSize } = this.qaList;

View File

@@ -98,18 +98,14 @@
</div>
</div>
</el-tab-pane>
<!-- <el-tab-pane label="案例" name="case">
<el-tab-pane label="案例" name="case">
<div>
<div style="padding-bottom: 10px;">
<div style="display: flex;justify-content:flex-start;">
<div style="padding: 0px 5px;"><el-input placeholder="关键词查询" v-model="caseList.title"></el-input></div>
<div style="padding: 0px 5px;"><el-button @click="findCase" icon="el-icon-search" type="primary" size="small">查询</el-button></div>
</div>
</div>
<case-items @confirm="confirm" :items="caseList.list"></case-items>
</div>
<div style="text-align: center;" v-if="caseList.count>caseList.pageSize">
<div style="text-align: center;margin-top:50px;" v-if="caseList.list.length > 0
">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="caseList.pageIndex"
@@ -118,8 +114,15 @@
layout="total, sizes, prev, pager, next, jumper"
:total="caseList.count"
></el-pagination>
</div>
</el-tab-pane> -->
<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>
</el-tab-pane>
<el-tab-pane label="文章" name="article">
<div>
<!-- <div style="padding-bottom: 10px;">
@@ -195,7 +198,7 @@
<script>
import articleItems from '@/components/Article/collectList.vue';
import courseItems from '@/components/Course/collectItem.vue';
// import caseItems from '@/components/Case/collectList.vue';
import caseItems from '@/components/Case/collectList.vue';
import qaItems from '@/components/Qa/favoritesQaList.vue';
import apiFavorite from '@/api/modules/favorites.js';
import apiUser from '@/api/system/user.js';
@@ -203,7 +206,7 @@ import apiCourse from "@/api/modules/coursePortal.js";
import courseImage from '@/components/Course/courseImage.vue';
export default {
name: 'myShareIndex',
components: { articleItems, courseItems, qaItems, courseImage },
components: { articleItems, courseItems, qaItems, courseImage,caseItems },
data() {
return {
isSearh:false,
@@ -391,6 +394,7 @@ export default {
item.avatar=''
item.name=''
item.orgInfo=''
item.sex= null
courseIds.push(item.objId);
})
this.loadCouserTeacher(res.result.list,courseIds);
@@ -490,14 +494,16 @@ export default {
findCase() {
let { pageIndex, pageSize } = this.caseList;
let query = { pageIndex, pageSize };
if (this.caseList.title) {
// if (this.caseList.cases.title) {
query.keyword = this.keyword.trim();
}
// }
query.resolve = this.isRead;
apiFavorite.casePageList(query).then(res => {
if (res.status == 200) {
this.caseList.count = res.result.count;
this.caseList.list = res.result.list;
console.log(this.caseList)
if (this.caseList.list.length != 0) {
this.getCaseUserData(res.result.list);
}