|
|
|
@ -5,20 +5,23 @@ |
|
|
|
|
<div class="center-wrap"> |
|
|
|
|
<div class="nav"> |
|
|
|
|
<p class="column-name">{{ $route.query.name }}</p> |
|
|
|
|
<el-menu |
|
|
|
|
v-if="menuList.length" |
|
|
|
|
<el-menu v-if="menuList.length" |
|
|
|
|
unique-opened |
|
|
|
|
:default-active="defaultIndex" |
|
|
|
|
@select="initData"> |
|
|
|
|
<menuTree v-if="menuRefresh" :menuList="menuList"></menuTree> |
|
|
|
|
<menuTree v-if="menuRefresh" |
|
|
|
|
:menuList="menuList"></menuTree> |
|
|
|
|
</el-menu> |
|
|
|
|
</div> |
|
|
|
|
<div class="list-wrap"> |
|
|
|
|
<div class="list"> |
|
|
|
|
<template v-if="listData.length"> |
|
|
|
|
<ul> |
|
|
|
|
<li v-for="(item,index) in listData" :key="index" @click="toArticle(item.id)"> |
|
|
|
|
<img :src="item.coverUrl" alt=""> |
|
|
|
|
<li v-for="(item,index) in listData" |
|
|
|
|
:key="index" |
|
|
|
|
@click="toArticle(item.id)"> |
|
|
|
|
<img :src="item.coverUrl" |
|
|
|
|
alt=""> |
|
|
|
|
<div class="text"> |
|
|
|
|
<div class="title">{{item.title}}</div> |
|
|
|
|
<div class="metas"> |
|
|
|
@ -28,20 +31,27 @@ |
|
|
|
|
<i class="spe">|</i> |
|
|
|
|
<span>浏览量:{{item.viewCount}}</span> |
|
|
|
|
</div> |
|
|
|
|
<div class="desc" :class="{ie: core.isIE() || core.isEdge(),firefox: core.isFirefox() || core.isEdge()}" v-html="item.content"></div> |
|
|
|
|
<div class="desc" |
|
|
|
|
:class="{ie: core.isIE() || core.isEdge(),firefox: core.isFirefox() || core.isEdge()}" |
|
|
|
|
v-html="item.content"></div> |
|
|
|
|
<a class="detail">查看详情 ></a> |
|
|
|
|
</div> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
<div class="pagination"> |
|
|
|
|
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="page"> |
|
|
|
|
<el-pagination background |
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
:total="totals" |
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
:current-page="page"> |
|
|
|
|
</el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<div class="empty"> |
|
|
|
|
<div> |
|
|
|
|
<img src="@/assets/img/none.png" alt=""> |
|
|
|
|
<img src="@/assets/img/none.png" |
|
|
|
|
alt=""> |
|
|
|
|
<p>暂无资讯</p> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -59,13 +69,12 @@ import menuTree from '@/components/menuTree' |
|
|
|
|
import { mapActions } from "vuex"; |
|
|
|
|
export default { |
|
|
|
|
name: 'information', |
|
|
|
|
data() { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
keyword: '', |
|
|
|
|
historyId: this.$store.state.info.columnId, |
|
|
|
|
defaultIndex: '', |
|
|
|
|
menuList: [], |
|
|
|
|
page: 1, |
|
|
|
|
page: +this.$route.query.page || 1, |
|
|
|
|
pageSize: 10, |
|
|
|
|
totals: 0, |
|
|
|
|
listData: [], |
|
|
|
@ -80,24 +89,18 @@ export default { |
|
|
|
|
menuTree |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
keyword: function(val) { |
|
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.getData() |
|
|
|
|
},500) |
|
|
|
|
}, |
|
|
|
|
$route() { |
|
|
|
|
$route () { |
|
|
|
|
this.getData() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
mounted () { |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
...mapActions("info", [ |
|
|
|
|
"setColumnId" |
|
|
|
|
]), |
|
|
|
|
async getData() { |
|
|
|
|
async getData () { |
|
|
|
|
this.deepId = '' |
|
|
|
|
const { parentId } = this.$route.query |
|
|
|
|
this.setColumnId('') |
|
|
|
@ -148,7 +151,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 获取最深的层级的id |
|
|
|
|
getDeepId(data) { |
|
|
|
|
getDeepId (data) { |
|
|
|
|
data.map(e => { |
|
|
|
|
if (e.children.length) { |
|
|
|
|
this.getDeepId(e.children) |
|
|
|
@ -158,15 +161,15 @@ export default { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
initData(index,indexPath){ |
|
|
|
|
initData (index, indexPath) { |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getContent(index,indexPath) |
|
|
|
|
this.getContent(index, indexPath) |
|
|
|
|
}, |
|
|
|
|
getContent(index,indexPath){ |
|
|
|
|
if(indexPath) this.loadIns = Loading.service() |
|
|
|
|
getContent (index, indexPath) { |
|
|
|
|
if (indexPath) this.loadIns = Loading.service() |
|
|
|
|
this.columnId = index |
|
|
|
|
this.$get(`${this.api.queryArticleByCondition}/${this.page}/${this.pageSize}`, { |
|
|
|
|
name: this.keyword, |
|
|
|
|
name: '', |
|
|
|
|
columnId: index, |
|
|
|
|
port: 0, |
|
|
|
|
school: this.$route.query.parentId ? '' : 0 |
|
|
|
@ -174,24 +177,23 @@ export default { |
|
|
|
|
this.listData = res.articleList |
|
|
|
|
this.totals = res.total |
|
|
|
|
this.listData.map(n => { |
|
|
|
|
n.content = n.content.replace(/<img.*?(?:>|\/>)/gi,'') |
|
|
|
|
n.content = n.content.replace(/<img.*?(?:>|\/>)/gi, '') |
|
|
|
|
}) |
|
|
|
|
this.loadIns.close() |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.loadIns.close() |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange(val) { |
|
|
|
|
handleCurrentChange (val) { |
|
|
|
|
this.page = val; |
|
|
|
|
this.getContent(this.columnId); |
|
|
|
|
}, |
|
|
|
|
// 获取该文章所属的所有栏目名称 |
|
|
|
|
getColumnName(data, names = []) { |
|
|
|
|
getColumnName (data, names = []) { |
|
|
|
|
for (let i = 0; i < data.length; i++) { |
|
|
|
|
const e = data[i] |
|
|
|
|
names.push(e.name) |
|
|
|
|
if (e.id == this.columnId) { |
|
|
|
|
console.log("🚀 ~ file: index.vue ~ line 188 ~ getColumnName ~ this.defaultIndex", this.defaultIndex) |
|
|
|
|
this.columnNames = JSON.parse(JSON.stringify(names)) |
|
|
|
|
break |
|
|
|
|
} else { |
|
|
|
@ -200,12 +202,11 @@ export default { |
|
|
|
|
names = [] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
toArticle(id) { |
|
|
|
|
toArticle (id) { |
|
|
|
|
const columnId = this.columnId |
|
|
|
|
this.setColumnId(columnId) |
|
|
|
|
this.getColumnName(this.menuList, []) |
|
|
|
|
console.log("🚀 ~ file: index.vue ~ line 199 ~ toArticle ~ menuList", this.columnNames) |
|
|
|
|
this.$router.push(`/${this.$route.path === '/info/list' ? 'info' : 'preInfo'}/details?parentId=${this.$route.query.parentId}&name=${this.$route.query.name}&id=${id}&columnNames=${this.columnNames}`) |
|
|
|
|
this.$router.push(`/${this.$route.path === '/info/list' ? 'info' : 'preInfo'}/details?parentId=${this.$route.query.parentId}&name=${this.$route.query.name}&id=${id}&columnNames=${this.columnNames}&page=${this.page}`) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
@ -216,21 +217,20 @@ export default { |
|
|
|
|
.banner { |
|
|
|
|
height: 350px; |
|
|
|
|
padding: 100px 0 0 180px; |
|
|
|
|
background: url(../../../assets/img/info-bg6.png) (0 0)/auto no-repeat, |
|
|
|
|
background: url(../../../assets/img/info-bg6.png) (0 0) / auto no-repeat, |
|
|
|
|
url(../../../assets/img/info-bg7.png) (25% 110px)/400px auto no-repeat, |
|
|
|
|
url(../../../assets/img/info-bg4.png) (top right)/auto no-repeat, |
|
|
|
|
url(../../../assets/img/info-bg5.png) (80% 20px)/auto no-repeat, |
|
|
|
|
url(../../../assets/img/info-bg3.png) 0 0/100% 100% no-repeat; |
|
|
|
|
url(../../../assets/img/info-bg4.png) (top right) / auto no-repeat, |
|
|
|
|
url(../../../assets/img/info-bg5.png) (80% 20px) / auto no-repeat, url(../../../assets/img/info-bg3.png) 0 0/100% 100% no-repeat; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.main{ |
|
|
|
|
.main { |
|
|
|
|
min-height: calc(100vh - 524px); |
|
|
|
|
background: url(../../../assets/img/info-bg1.png) (0px 179px)/(190px 171px) no-repeat, |
|
|
|
|
url(../../../assets/img/info-bg2.png) (bottom right)/(407px 273px) no-repeat; |
|
|
|
|
background: url(../../../assets/img/info-bg1.png) (0px 179px)/ (190px 171px) no-repeat, |
|
|
|
|
url(../../../assets/img/info-bg2.png) (bottom right)/ (407px 273px) no-repeat; |
|
|
|
|
.center-wrap { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: center; |
|
|
|
|
align-items:flex-start; |
|
|
|
|
align-items: flex-start; |
|
|
|
|
} |
|
|
|
|
.column-name { |
|
|
|
|
padding: 14px 0; |
|
|
|
@ -241,7 +241,7 @@ export default { |
|
|
|
|
background-color: #007eff; |
|
|
|
|
border-radius: 8px; |
|
|
|
|
} |
|
|
|
|
.nav{ |
|
|
|
|
.nav { |
|
|
|
|
width: 156px; |
|
|
|
|
overflow: hidden; |
|
|
|
|
.el-menu { |
|
|
|
@ -284,11 +284,11 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.list-wrap{ |
|
|
|
|
.list-wrap { |
|
|
|
|
width: calc(100% - 180px); |
|
|
|
|
margin-left: 24px; |
|
|
|
|
.list{ |
|
|
|
|
li{ |
|
|
|
|
.list { |
|
|
|
|
li { |
|
|
|
|
display: flex; |
|
|
|
|
margin-bottom: 12px; |
|
|
|
|
cursor: pointer; |
|
|
|
@ -297,52 +297,52 @@ export default { |
|
|
|
|
border-radius: 6px; |
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
|
|
img{ |
|
|
|
|
img { |
|
|
|
|
width: 260px; |
|
|
|
|
height: 195px; |
|
|
|
|
border: 0; |
|
|
|
|
} |
|
|
|
|
.text{ |
|
|
|
|
.text { |
|
|
|
|
position: relative; |
|
|
|
|
width: calc(100% - 260px); |
|
|
|
|
padding: 20px 24px; |
|
|
|
|
.title{ |
|
|
|
|
.title { |
|
|
|
|
font-size: 20px; |
|
|
|
|
color: #0B1D30; |
|
|
|
|
color: #0b1d30; |
|
|
|
|
font-weight: 500; |
|
|
|
|
overflow: hidden; |
|
|
|
|
text-overflow:ellipsis; |
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
white-space: nowrap; |
|
|
|
|
} |
|
|
|
|
.metas{ |
|
|
|
|
.metas { |
|
|
|
|
display: inline-flex; |
|
|
|
|
align-items: center; |
|
|
|
|
width: 100%; |
|
|
|
|
margin: 10px 0; |
|
|
|
|
font-size: 12px; |
|
|
|
|
color: rgba(0,0,0,.45); |
|
|
|
|
color: rgba(0, 0, 0, 0.45); |
|
|
|
|
.spe { |
|
|
|
|
margin: 0 10px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.desc{ |
|
|
|
|
.desc { |
|
|
|
|
font-size: 14px; |
|
|
|
|
color: #333; |
|
|
|
|
line-height: 24px; |
|
|
|
|
display: -webkit-box; |
|
|
|
|
display:-moz-box; |
|
|
|
|
display: -moz-box; |
|
|
|
|
-webkit-box-orient: vertical; |
|
|
|
|
-moz-box-orient: vertical; |
|
|
|
|
-webkit-line-clamp: 2; |
|
|
|
|
-moz-line-clamp: 2; |
|
|
|
|
overflow: hidden; |
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
&.ie{ |
|
|
|
|
&.ie { |
|
|
|
|
height: 80px; |
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
white-space: nowrap; |
|
|
|
|
} |
|
|
|
|
&.firefox{ |
|
|
|
|
&.firefox { |
|
|
|
|
height: 76px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|