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