mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 11:56:44 +08:00
案例详情
This commit is contained in:
@@ -64,9 +64,6 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
data:{
|
|
||||||
type:Object,
|
|
||||||
},
|
|
||||||
boxShow:{
|
boxShow:{
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
|
|||||||
@@ -141,6 +141,10 @@ export default {
|
|||||||
theme:{
|
theme:{
|
||||||
type:Number,
|
type:Number,
|
||||||
default:1
|
default:1
|
||||||
|
},
|
||||||
|
unicom:{
|
||||||
|
type:Boolean,
|
||||||
|
default:false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
@@ -159,7 +163,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed:{
|
computed:{
|
||||||
...mapGetters(['userInfo']),
|
...mapGetters(['userInfo','praisesUnicom','favoritesUnicom']),
|
||||||
|
|
||||||
showAlign(){
|
showAlign(){
|
||||||
if(this.align=='left'){
|
if(this.align=='left'){
|
||||||
@@ -170,6 +174,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
|
praisesUnicom(newVal){
|
||||||
|
this.isPraise = newVal;
|
||||||
|
},
|
||||||
|
favoritesUnicom(newVal){
|
||||||
|
this.isFavorite = newVal;
|
||||||
|
},
|
||||||
data(newVal,oldVal){
|
data(newVal,oldVal){
|
||||||
// console.log(newVal,'newVal');
|
// console.log(newVal,'newVal');
|
||||||
// if(newVal && newVal.id!=''){
|
// if(newVal && newVal.id!=''){
|
||||||
@@ -178,7 +188,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created(){
|
created(){
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if(this.data && this.data.id && !this.readonly){
|
if(this.data && this.data.id && !this.readonly){
|
||||||
@@ -266,7 +275,6 @@ export default {
|
|||||||
this.shareShow=true;
|
this.shareShow=true;
|
||||||
},
|
},
|
||||||
addPraise(){
|
addPraise(){
|
||||||
|
|
||||||
if(this.type==0){
|
if(this.type==0){
|
||||||
console.log('未设置type值,1表课程,2表文章,3表案例,4表问答')
|
console.log('未设置type值,1表课程,2表文章,3表案例,4表问答')
|
||||||
return;
|
return;
|
||||||
@@ -296,6 +304,9 @@ export default {
|
|||||||
this.data.praises--;
|
this.data.praises--;
|
||||||
}
|
}
|
||||||
this.isPraise=false;
|
this.isPraise=false;
|
||||||
|
if(this.unicom) {
|
||||||
|
this.$store.dispatch("unicomPraises",false)
|
||||||
|
}
|
||||||
this.$message({message:'取消点赞',type:'success'})
|
this.$message({message:'取消点赞',type:'success'})
|
||||||
}else{
|
}else{
|
||||||
console.log('取消失败:'+res.message);
|
console.log('取消失败:'+res.message);
|
||||||
@@ -308,6 +319,9 @@ export default {
|
|||||||
if(res.result){
|
if(res.result){
|
||||||
this.data.praises++;
|
this.data.praises++;
|
||||||
}
|
}
|
||||||
|
if(this.unicom) {
|
||||||
|
this.$store.dispatch("unicomPraises",true)
|
||||||
|
}
|
||||||
if(this.type!=1&&this.type!=5){
|
if(this.type!=1&&this.type!=5){
|
||||||
this.messageSave(this.data.id,this.data.title,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'点赞了我的');
|
this.messageSave(this.data.id,this.data.title,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'点赞了我的');
|
||||||
}
|
}
|
||||||
@@ -356,6 +370,9 @@ export default {
|
|||||||
if(res.result){
|
if(res.result){
|
||||||
this.data.favorites--;
|
this.data.favorites--;
|
||||||
}
|
}
|
||||||
|
if(this.unicom) {
|
||||||
|
this.$store.dispatch("unicomFavorites",false)
|
||||||
|
}
|
||||||
this.$message({message:'已取消收藏',type:'success'});
|
this.$message({message:'已取消收藏',type:'success'});
|
||||||
//this.$emit('addFavorite',res.result);//添加收藏,如果是true代表添加成功,false代表已存在
|
//this.$emit('addFavorite',res.result);//添加收藏,如果是true代表添加成功,false代表已存在
|
||||||
}else{
|
}else{
|
||||||
@@ -370,6 +387,9 @@ export default {
|
|||||||
if(res.result){
|
if(res.result){
|
||||||
this.data.favorites++;
|
this.data.favorites++;
|
||||||
}
|
}
|
||||||
|
if(this.unicom) {
|
||||||
|
this.$store.dispatch("unicomFavorites",true)
|
||||||
|
}
|
||||||
if(this.type===2||this.type===4){
|
if(this.type===2||this.type===4){
|
||||||
this.messageSave(this.data.id,this.data.title,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'收藏了我发布的');
|
this.messageSave(this.data.id,this.data.title,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'收藏了我发布的');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,5 +21,7 @@ const getters = {
|
|||||||
userMsg:state => state.user.msg,
|
userMsg:state => state.user.msg,
|
||||||
messagesBeReviewed:state => state.user.messagesBeReviewed,
|
messagesBeReviewed:state => state.user.messagesBeReviewed,
|
||||||
studyTaskCount:state => state.user.studyTaskCount,
|
studyTaskCount:state => state.user.studyTaskCount,
|
||||||
|
praisesUnicom:state =>state.pdf.praisesUnicom,
|
||||||
|
favoritesUnicom:state =>state.pdf.favoritesUnicom,
|
||||||
}
|
}
|
||||||
export default getters
|
export default getters
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import portal from './modules/portal'
|
|||||||
import getters from './getters'
|
import getters from './getters'
|
||||||
import sysType from './modules/sysType'
|
import sysType from './modules/sysType'
|
||||||
import resOwner from './modules/resOwner'
|
import resOwner from './modules/resOwner'
|
||||||
|
import pdf from './modules/pdf'
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
|
|
||||||
@@ -21,7 +22,8 @@ const store = new Vuex.Store({
|
|||||||
settings,
|
settings,
|
||||||
portal,
|
portal,
|
||||||
sysType,
|
sysType,
|
||||||
resOwner
|
resOwner,
|
||||||
|
pdf
|
||||||
},
|
},
|
||||||
getters
|
getters
|
||||||
})
|
})
|
||||||
|
|||||||
30
src/store/modules/pdf.js
Normal file
30
src/store/modules/pdf.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
const state = {
|
||||||
|
praisesUnicom: false,
|
||||||
|
favoritesUnicom: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
const mutations = {
|
||||||
|
SET_praisesUnicom: (state, iden) => {
|
||||||
|
state.praisesUnicom = iden
|
||||||
|
},
|
||||||
|
SET_favoritesUnicom: (state, iden) => {
|
||||||
|
state.favoritesUnicom = iden
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const actions = {
|
||||||
|
unicomPraises({ commit }, data) {
|
||||||
|
commit('SET_praisesUnicom', data)
|
||||||
|
},
|
||||||
|
unicomFavorites({ commit }, data) {
|
||||||
|
commit('SET_favoritesUnicom', data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
state,
|
||||||
|
mutations,
|
||||||
|
actions
|
||||||
|
}
|
||||||
|
|
||||||
@@ -39,19 +39,19 @@
|
|||||||
<div class="case-summary"><span>{{ caseDetail.summary }}</span></div>
|
<div class="case-summary"><span>{{ caseDetail.summary }}</span></div>
|
||||||
<div class="label" style="margin-top:10px">
|
<div class="label" style="margin-top:10px">
|
||||||
<!-- <span style="margin-left:0px;" v-if="caseDetail.sysCreateTime">{{ caseDetail.sysCreateTime.substring(0,10) }}</span> -->
|
<!-- <span style="margin-left:0px;" v-if="caseDetail.sysCreateTime">{{ caseDetail.sysCreateTime.substring(0,10) }}</span> -->
|
||||||
<interactBar :data="caseDetail" :type="3" :comments="false" :shares="true"></interactBar>
|
<interactBar :data="caseDetail" :type="3" :comments="false" :shares="true" :unicom="true"></interactBar>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card :body-style="{ padding: '0px' }" class="jianjie" id="pdfPreview">
|
<el-card :body-style="{ padding: '0px' }" class="jianjie" id="pdfPreview">
|
||||||
<!-- <div class="content">
|
<!-- <div class="content">
|
||||||
{{ caseDetail.content }}
|
{{ caseDetail.content }}
|
||||||
</div> -->
|
</div> -->
|
||||||
<pdfPreview v-if="pdfPath" :filePath="pdfPath" :data="caseDetail"></pdfPreview>
|
<pdfPreview v-if="pdfPath" :filePath="pdfPath"></pdfPreview>
|
||||||
</el-card>
|
</el-card>
|
||||||
<div class="postfixt-bot">
|
<div class="postfixt-bot">
|
||||||
<div class="postfixt-bot-box" id="pdfTopBox">
|
<div class="postfixt-bot-box" id="pdfTopBox">
|
||||||
<div style="display:inline-block;">
|
<div style="display:inline-block;">
|
||||||
<interactBar :data="caseDetail" :type="3" :comments="false" :shares="false"></interactBar>
|
<interactBar :data="caseDetail" :type="3" :comments="false" :shares="true" :unicom="true"></interactBar>
|
||||||
</div>
|
</div>
|
||||||
<div style="display:inline-block;margin: 0 20px;">
|
<div style="display:inline-block;margin: 0 20px;">
|
||||||
<el-button type="primary" @click="goTop()">返回顶部</el-button>
|
<el-button type="primary" @click="goTop()">返回顶部</el-button>
|
||||||
@@ -352,7 +352,7 @@ export default {
|
|||||||
.case-summary{
|
.case-summary{
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
color: #121212;
|
color: #454545;
|
||||||
word-break:break-all;
|
word-break:break-all;
|
||||||
line-height: 25px;
|
line-height: 25px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user