2022-04-26 13:51:46 +08:00
|
|
|
|
<template>
|
2022-07-05 14:56:18 +08:00
|
|
|
|
<div style="background-color: #f7f7f7;">
|
2022-04-26 13:51:46 +08:00
|
|
|
|
<headerView/>
|
2022-05-06 17:33:21 +08:00
|
|
|
|
|
2022-04-29 14:19:19 +08:00
|
|
|
|
<div class="weizhibox">
|
|
|
|
|
<div class="weizhi">
|
|
|
|
|
<span><img src="img/shouye.png" style="width: 16px;margin: 11px 4px 0 0;"></span>
|
|
|
|
|
<span>当前位置:</span>
|
2022-05-07 11:06:25 +08:00
|
|
|
|
<a href="javascript:void(0);" @click="$to('home')">首页></a>
|
2022-07-20 08:33:12 +08:00
|
|
|
|
<a href="javascript:void(0);" v-show="parentData.name!='首页' && parentData.name!='其他' && parentData.name!=thisColumn.name" @click="$to('listPage',{pid:thisColumn.parent?thisColumn.parent:thisColumn.id,id:thisColumn.parent?thisColumn.id:null})">{{parentData.name}} > </a>
|
|
|
|
|
<a href="javascript:void(0);" @click="$to('listPage',{pid:thisColumn.parent?thisColumn.parent:thisColumn.id,id:thisColumn.parent?thisColumn.id:null})">{{thisColumn.name}}</a>
|
2022-04-29 14:19:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="er_contant clearfloat">
|
2022-07-05 14:56:18 +08:00
|
|
|
|
<div class="cyh_contr " style="width:100%;">
|
2022-04-29 14:19:19 +08:00
|
|
|
|
<div class="xqer_cont">
|
|
|
|
|
<h3>{{articleData.title}}</h3>
|
|
|
|
|
<div class="xqer_date">
|
|
|
|
|
<span>发布日期:<span>{{articleData.updateTime || articleData.createTime}}</span></span>
|
2022-07-05 14:56:18 +08:00
|
|
|
|
<span v-show="articleData.author"> 作者:<span>{{articleData.author}}</span></span>
|
2022-04-29 14:19:19 +08:00
|
|
|
|
</div>
|
2022-07-05 14:56:18 +08:00
|
|
|
|
<p v-html="linkOpenToNewPage(articleData.content)"></p>
|
2024-03-18 14:29:38 +08:00
|
|
|
|
<div v-if="articleData.files" style="cursor:pointer;">
|
|
|
|
|
<span>附件:</span>
|
|
|
|
|
<div v-if="articleData.files.indexOf(',')>-1">
|
|
|
|
|
<div v-for="(fj,index) in articleData.files.split(',')" :key="index">
|
|
|
|
|
<span @click="downloadFile(fj)">{{fujian(fj)}}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
<span @click="downloadFile(articleData.files)">{{fujian(articleData.files)}}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-04-29 14:19:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-04-26 13:51:46 +08:00
|
|
|
|
<footerView/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getwayMixin } from '@/views/gateway/mixins/getwayMixin'
|
|
|
|
|
import { getAction } from '@/api/manage'
|
|
|
|
|
import headerView from '@/views/gateway/common/header'
|
|
|
|
|
import footerView from '@/views/gateway/common/footer'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
mixins:[getwayMixin],
|
|
|
|
|
components:{
|
|
|
|
|
headerView,
|
|
|
|
|
footerView
|
|
|
|
|
},
|
|
|
|
|
props:{
|
|
|
|
|
},
|
|
|
|
|
data(){
|
|
|
|
|
return {
|
|
|
|
|
parentData:{},
|
|
|
|
|
thisColumn:{},
|
|
|
|
|
columnList:[],
|
|
|
|
|
articleList: [],
|
|
|
|
|
articleData:{},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed:{
|
|
|
|
|
id(){
|
|
|
|
|
return this.$route.query.id || '-1';
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted(){
|
|
|
|
|
this.loadData();
|
|
|
|
|
},
|
|
|
|
|
watch:{
|
|
|
|
|
id(){
|
|
|
|
|
this.loadData();
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
updated(){
|
|
|
|
|
},
|
|
|
|
|
methods:{
|
2022-07-05 14:56:18 +08:00
|
|
|
|
fujian(record){
|
|
|
|
|
var arr = record.split("/");
|
|
|
|
|
return arr[1];
|
|
|
|
|
},
|
|
|
|
|
linkOpenToNewPage(v){
|
2022-07-20 08:33:12 +08:00
|
|
|
|
if(v && v.indexOf("<a ")>-1){
|
2022-07-05 14:56:18 +08:00
|
|
|
|
v = v.replaceAll("<a ",'<a target="_blank"')
|
|
|
|
|
}
|
|
|
|
|
return v;
|
|
|
|
|
},
|
2022-04-26 13:51:46 +08:00
|
|
|
|
loadData(){
|
|
|
|
|
//查询栏目(包含当前的和候选的)
|
|
|
|
|
getAction('/gateway/gatewayArticle/queryArticleById',{id:this.id}).then((res)=>{
|
|
|
|
|
if(res.success){
|
|
|
|
|
console.log('res =>',res.result);
|
|
|
|
|
let data = res.result;
|
|
|
|
|
this.articleData = data;
|
|
|
|
|
this.thisColumn = data.currentGatewayColumn
|
2022-05-06 17:33:21 +08:00
|
|
|
|
//查出根节点
|
|
|
|
|
if(data.parentGatewayColumn){
|
|
|
|
|
this.parentData = data.parentGatewayColumn
|
|
|
|
|
}else{
|
|
|
|
|
this.parentData = data.currentGatewayColumn
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(data.gatewayColumnList && data.gatewayColumnList.length > 0){
|
|
|
|
|
this.columnList = data.gatewayColumnList
|
|
|
|
|
}else{
|
|
|
|
|
this.columnList = [];
|
|
|
|
|
this.columnList.push(data.currentGatewayColumn);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-29 14:19:19 +08:00
|
|
|
|
console.log('columnList', this.columnList );
|
2022-04-26 13:51:46 +08:00
|
|
|
|
|
|
|
|
|
// if(!this.columnId){
|
|
|
|
|
// let firstColumn = this.columnList[0]
|
|
|
|
|
// if(firstColumn){
|
|
|
|
|
// //this.$to('listPage',{pid:firstColumn.parent,id:firstColumn.id},true)
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
//如果没有ID自动选中一个
|
|
|
|
|
// if(this.id){
|
|
|
|
|
// //查询文章列表
|
|
|
|
|
// getAction('/gateway/gatewayArticle/list',{pageSize:-1,isRelease:'Y',columnId:this.id}).then((res)=>{
|
|
|
|
|
// if(res.success){
|
|
|
|
|
// let list = res.result.records||res.result;
|
|
|
|
|
// this.articleList = list;
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
getFileName(url){
|
|
|
|
|
if(!url) return '';
|
|
|
|
|
let filePaths = url.split('/');
|
|
|
|
|
let fileAllName = filePaths[filePaths.length-1]
|
|
|
|
|
return fileAllName.substring(0,fileAllName.lastIndexOf('_'));
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2024-03-18 14:29:38 +08:00
|
|
|
|
<style scoped lang="less">
|
|
|
|
|
/deep/ img{
|
|
|
|
|
width: auto !important;
|
|
|
|
|
}
|
2022-04-26 13:51:46 +08:00
|
|
|
|
</style>
|