|
|
|
@ -12,7 +12,7 @@ |
|
|
|
|
<div class="item"> |
|
|
|
|
<span class="label">所属分类:</span> |
|
|
|
|
<el-select v-model="form.classificationId" @change="filter"> |
|
|
|
|
<el-option label="不限" value=""></el-option> |
|
|
|
|
<el-option label="不限" :value="null"></el-option> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in classifications" |
|
|
|
|
:key="item.id" |
|
|
|
@ -41,41 +41,41 @@ |
|
|
|
|
</div> |
|
|
|
|
<!-- 会议活动:筛选+会议活动列表 --> |
|
|
|
|
<div v-if="info.listStyleId === 15" class="forms"> |
|
|
|
|
<ul class="switch"> |
|
|
|
|
<li v-for="(item, i) in convokeTypes" :key="i" :class="{active: item.id === form.convokeType}" @click="switchChange(item)">{{ item.name }}</li> |
|
|
|
|
</ul> |
|
|
|
|
<div class="item"> |
|
|
|
|
<span class="label">类型:</span> |
|
|
|
|
<el-select v-model="form.classificationId"> |
|
|
|
|
<el-option label="不限" value=""></el-option> |
|
|
|
|
<el-select v-model="form.classificationId" @change="filter"> |
|
|
|
|
<el-option label="不限" :value="null"></el-option> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in classifications" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.labelName" |
|
|
|
|
:label="item.classificationName" |
|
|
|
|
:value="item.id"> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="contents"> |
|
|
|
|
<ul v-if="columns.length > 2 && !isFilter && showNav" class="columns"> |
|
|
|
|
<li v-if="all.columnName" class="all" :class="{active: curColumn === 0 }" @click="toArticle(0, 1)">{{ all.columnName }}</li> |
|
|
|
|
<template v-for="(item, i) in columns"> |
|
|
|
|
<li v-if="i" :key="i" :class="{active: i === curColumn}" @click="toArticle(i)">{{ item.columnName }}</li> |
|
|
|
|
</template> |
|
|
|
|
</ul> |
|
|
|
|
<el-tree v-if="!isFilter && showNav" class="columns" ref="leftColumn" :data="columns" highlight-current :expand-on-click-node="false" default-expand-all :props="defaultProps" node-key="id" @node-click="columnClick"></el-tree> |
|
|
|
|
|
|
|
|
|
<div style="width: 1113px"> |
|
|
|
|
<ul class="articles"> |
|
|
|
|
<li v-for="(item, i) in articles" :key="i" @click="toArtice(item)"> |
|
|
|
|
<div class="texts"> |
|
|
|
|
<p v-if="info.listStyleId === 10 && item.classificationName" class="type">{{ item.classificationName }}</p> |
|
|
|
|
<p v-if="(item.listStyleId === 10 || item.listStyleId === 15) && item.classificationName" class="type">{{ item.classificationName }}</p> |
|
|
|
|
<h6>{{ item.title }}</h6> |
|
|
|
|
<template v-if="info.listStyleId === 11"> |
|
|
|
|
<template v-if="item.listStyleId === 11"> |
|
|
|
|
<span class="meta">{{ item.updateTime }}</span> |
|
|
|
|
<div class="des" v-html="item.mainBody"></div> |
|
|
|
|
</template> |
|
|
|
|
<span v-if="info.listStyleId === 10" class="meta">{{ item.updateTime }} {{ item.labelName && ' | ' + item.labelName }}</span> |
|
|
|
|
<template v-if="info.listStyleId === 15 || info.listStyleId === 16"> |
|
|
|
|
<span v-if="item.listStyleId === 10" class="meta">{{ item.updateTime }} {{ item.labelName && ' | ' + item.labelName }}</span> |
|
|
|
|
<template v-if="item.listStyleId === 15 || item.listStyleId === 16"> |
|
|
|
|
<div v-if="item.keynoteSpeaker" class="meta m-b-10"><i class="el-icon-user"></i> {{ item.keynoteSpeaker }}</div> |
|
|
|
|
<div v-if="item.activityStartTime" class="meta m-b-10"><i class="el-icon-alarm-clock"></i> {{ item.activityStartTime + '~' + item.activityEndTime }}</div> |
|
|
|
|
<div v-if="item.offlineLocation" class="meta"><i class="el-icon-location-outline"></i> {{ item.offlineLocation }}</div> |
|
|
|
|
<div v-if="item.activityStartTime" class="meta m-b-10"><i class="el-icon-alarm-clock"></i> {{ item.activityStartTime + ' ~ ' + item.activityEndTime }}</div> |
|
|
|
|
<div v-if="item.offlineLocation" class="meta m-b-10"><i class="el-icon-location-outline"></i> {{ item.offlineLocation }}</div> |
|
|
|
|
<div v-if="item.onlineLocation" class="meta"><i class="el-icon-position"></i> {{ item.onlineLocation }}</div> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
<img class="pic" :src="item.titleImg" alt=""> |
|
|
|
@ -131,9 +131,24 @@ export default { |
|
|
|
|
info: {}, |
|
|
|
|
searchTimer: null, |
|
|
|
|
lableId: [], |
|
|
|
|
convokeTypes: [ |
|
|
|
|
{ |
|
|
|
|
id: null, |
|
|
|
|
name: '全部' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: '即将召开' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 2, |
|
|
|
|
name: '已经召开' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
form: { |
|
|
|
|
classificationId: '', |
|
|
|
|
title: '' |
|
|
|
|
classificationId: null, |
|
|
|
|
title: '', |
|
|
|
|
convokeType: null |
|
|
|
|
}, |
|
|
|
|
classifications: [], |
|
|
|
|
labels: [], |
|
|
|
@ -188,9 +203,16 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 获取所属分类 |
|
|
|
|
getClassification() { |
|
|
|
|
this.$post(`${this.api.getTheFullArticleByColumn}?id=${this.id}`).then(({ data }) => { |
|
|
|
|
this.classifications = data |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
if (this.info.templateId === 7) { |
|
|
|
|
this.$post(`${this.api.queryClassif}?siteId=${this.site}&templateId=${7}`).then(({ data }) => { |
|
|
|
|
this.classifications = data |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
} else { |
|
|
|
|
this.$post(`${this.api.getTheFullArticleByColumn}?id=${this.id}`).then(({ data }) => { |
|
|
|
|
this.classifications = data |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// 获取标签 |
|
|
|
|
getLabel() { |
|
|
|
@ -201,17 +223,17 @@ export default { |
|
|
|
|
// 左边栏目 |
|
|
|
|
getLeftColumn() { |
|
|
|
|
this.$post(`${this.api.getsTheSubColumn}?id=${this.id}`).then(({ data }) => { |
|
|
|
|
if (data.length > 1 && !data.find(e => e.listStyleId !== data[0].listStyleId)) { |
|
|
|
|
this.all = data[0] |
|
|
|
|
this.getArticle(data.map(e => e.id)) |
|
|
|
|
} else { |
|
|
|
|
this.all = null |
|
|
|
|
this.getArticle([data[data.length > 1 ? 1 : 0].id]) |
|
|
|
|
data = data.slice(1) |
|
|
|
|
} |
|
|
|
|
// if (data.length > 1 && !data.find(e => e.listStyleId !== data[0].listStyleId)) { |
|
|
|
|
// this.all = data[0] |
|
|
|
|
// this.getArticle(data.map(e => e.id)) |
|
|
|
|
// } else { |
|
|
|
|
// this.all = null |
|
|
|
|
// this.getArticle([data[data.length > 1 ? 1 : 0].id]) |
|
|
|
|
// // data = data.slice(1) |
|
|
|
|
// } |
|
|
|
|
data.length && this.getArticle([data[0].id]) |
|
|
|
|
this.curColumn = 0 |
|
|
|
|
this.columns = data |
|
|
|
|
console.log("🚀 ~ file: index.vue ~ line 212 ~ this.$post ~ columns", columns) |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
// 右边资讯 |
|
|
|
@ -236,20 +258,28 @@ export default { |
|
|
|
|
this.news = data.records |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
// 会议时间筛选回调 |
|
|
|
|
switchChange(item) { |
|
|
|
|
this.form.convokeType = item.id |
|
|
|
|
this.filter() |
|
|
|
|
}, |
|
|
|
|
// 点击栏目回调 |
|
|
|
|
toArticle(i, all) { |
|
|
|
|
this.curColumn = i |
|
|
|
|
columnClick(data) { |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getArticle(all ? this.columns.map(e => e.id) : [this.columns[i].id]) |
|
|
|
|
this.getArticle([data.id]) |
|
|
|
|
}, |
|
|
|
|
// 查询文章列表 |
|
|
|
|
getArticle(columnIds) { |
|
|
|
|
const labelName = [] |
|
|
|
|
this.labels.map(e => { |
|
|
|
|
if (this.lableId.includes(e.id)) labelName.push(e.labelName) |
|
|
|
|
}) |
|
|
|
|
this.$post(this.api.newlyPublishedArticles, { |
|
|
|
|
siteId: this.$route.query.siteId || this.site, |
|
|
|
|
columnIds, |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
labelId: this.lableId.join(), |
|
|
|
|
labelName, |
|
|
|
|
...this.form |
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
const list = data.records |
|
|
|
@ -260,13 +290,23 @@ export default { |
|
|
|
|
this.total = +data.total |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
// 递归获取栏目所有id |
|
|
|
|
getIds(data, ids) { |
|
|
|
|
data.map(e => { |
|
|
|
|
ids.push(e.id) |
|
|
|
|
this.getIds(e.children, ids) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 筛选 |
|
|
|
|
filter() { |
|
|
|
|
this.page = 1 |
|
|
|
|
this.isFilter = !!(this.form.classificationId || this.form.title || this.lableId.length) |
|
|
|
|
const id = (this.isFilter || this.all) ? |
|
|
|
|
this.columns.map(e => e.id) : |
|
|
|
|
[this.columns[0].id] |
|
|
|
|
this.isFilter = !!(this.form.classificationId || this.form.title || this.form.convokeType || this.lableId.length) |
|
|
|
|
let id = [] |
|
|
|
|
if (this.isFilter || this.all) { |
|
|
|
|
this.getIds(this.columns, id) |
|
|
|
|
} else if (this.columns.length) { |
|
|
|
|
id = [this.columns[0].id] |
|
|
|
|
} |
|
|
|
|
this.curColumn = 0 |
|
|
|
|
this.getArticle(id) |
|
|
|
|
}, |
|
|
|
@ -306,6 +346,24 @@ export default { |
|
|
|
|
.left { |
|
|
|
|
width: 1295px; |
|
|
|
|
} |
|
|
|
|
.switch { |
|
|
|
|
display: inline-flex; |
|
|
|
|
align-items: center; |
|
|
|
|
margin-right: 50px; |
|
|
|
|
li { |
|
|
|
|
padding: 0 15px; |
|
|
|
|
margin-right: 10px; |
|
|
|
|
line-height: 32px; |
|
|
|
|
font-size: 14px; |
|
|
|
|
color: #333; |
|
|
|
|
border-radius: 4px; |
|
|
|
|
cursor: pointer; |
|
|
|
|
} |
|
|
|
|
.active { |
|
|
|
|
color: #fff; |
|
|
|
|
background-color: #1fa7ff; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.forms { |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|