yujialong 2 years ago
parent a80a307666
commit 5298d2feaf
  1. 3
      src/api/index.js
  2. 2
      src/components/breadcrumb/index.vue
  3. 1
      src/layouts/navbar/index.vue
  4. 19
      src/libs/util.js
  5. 22
      src/mixins/page/index.js
  6. 25
      src/pages/article/activity.vue
  7. 28
      src/pages/article/index.vue
  8. 136
      src/pages/column/index.vue
  9. 41
      src/pages/news/index.vue
  10. 2
      src/plugins/requests/index.js
  11. 2
      src/router/routes.js

@ -9,7 +9,8 @@ export default {
theAttachmentUnderTheQueryColumn: `iasf/content/file/theAttachmentUnderTheQueryColumn`,
findColumn: `iasf/sysColumn/findById`,
queryClassif: `iasf/content/classification/allTheQuery`,
getTheFullArticleByColumn: `iasf/sysColumn/getTheFullArticleByColumn`,
queryLabel: `iasf/content/label/queryAllArticleSubjectTags`,
getsTheSubColumn: `iasf/sysColumn/getsTheSubColumn`,
getTheFullArticleByColumn: `iasf/sysColumn/getTheFullArticleByColumn`,
articlePreview: `iasf/sysContent/articlePreview`,
}

@ -40,7 +40,7 @@ export default {
};
},
methods: {
update(data){
update(data) {
this.pages = data.split('/')
}
}

@ -70,6 +70,7 @@ export default {
},
//
jump(id) {
console.log("🚀 ~ file: index.vue ~ line 73 ~ jump ~ id", id)
this.getPath(this.menus ,id)
const to = this.toItem
const { typeId } = to

@ -162,25 +162,6 @@ const util = {
showClose: true,
duration
});
},
// 登录互踢
getToken() {
if (process.env.NODE_ENV == "production") {
if (store.state.user.dataTime && !logout) {
axios.get(`${api.queryToken}?token=${_local.get(Setting.tokenKey)}`).then(res => {
if (store.state.user.dataTime && (res.data.message != store.state.user.dataTime)) {
logout || Message.error("您已在另一台设备登录,本次登录已下线!");
logout = true;
setTimeout(() => {
_local.remove(Setting.storeKey);
_local.remove(Setting.tokenKey);
location.reload();
}, 1500);
}
}).catch(err => {
});
}
}
}
};

@ -15,22 +15,34 @@ export default {
},
methods: {
// 打开链接
openLink(item) {
async openLink(item) {
const { link } = item
if (link.linkName === '无') return false
console.log("🚀 ~ file: index.js ~ line 19 ~ openLink ~ link", link)
let href = link.linkAddress
const type = link.connectionType
if (type === 1) {
if (type === 1) { // 站内链接
if (link.articleId) { // 文章
href = '/article?id=' + link.articleId
// 查询文章详情。禁用的文章要提示
const data = await this.$post(`${this.api.findArticle}?id=${link.articleId}`)
if (data.data.isDisable) {
return Util.errorMsg('该文章已禁用!')
} else {
href = '/article?id=' + link.articleId
}
} else { // 栏目
href = '/column?id=' + link.columnId[link.columnId.length - 1]
}
href = this.$router.resolve(href + '&siteId=' + (this.$route.query.siteId || this.site)).href
} else if (type === 3) {
} else if (type === 3) { // 站外链接
if (link.otherArticleId) { // 文章
href = '/article?id=' + link.otherArticleId
// 查询文章详情。禁用的文章要提示
const data = await this.$post(`${this.api.findArticle}?id=${link.otherArticleId}`)
if (data.data.isDisable) {
return Util.errorMsg('该文章已禁用!')
} else {
href = '/article?id=' + link.otherArticleId
}
} else { // 栏目
href = '/column?id=' + link.otherColumnId[link.otherColumnId.length - 1]
}

@ -1,14 +1,14 @@
<template>
<div class="wrap">
<div class="content" style="width: 1400px;">
<Breadcrumb ref="breadcrumb" :data="'装置概况/' + form.title"/>
<Breadcrumb ref="breadcrumb" :data="'装置概况/' + form.title" route="column" :query.sync="query"/>
<div class="article">
<div class="left">
<h2>{{ form.title }}</h2>
<div class="meta">日期{{ form.activityStartTime + ' ~ ' + form.activityEndTime }}</div>
<div class="meta">地址{{ form.offlineLocation }}</div>
<div class="meta">线上{{ form.onlineLocation }}</div>
<div class="meta">主讲人{{ form.keynoteSpeaker }}</div>
<div v-if="form.offlineLocation" class="meta">地址{{ form.offlineLocation }}</div>
<div v-if="form.onlineLocation" class="meta">线上{{ form.onlineLocation }}</div>
<div v-if="form.keynoteSpeaker" class="meta">主讲人{{ form.keynoteSpeaker }}</div>
<h6>内容介绍</h6>
<div v-html="form.mainBody"></div>
@ -54,6 +54,7 @@ export default {
return {
id: this.$route.query.id,
columnId: '',
query: {},
form: {},
columnBanner: '',
columns: [],
@ -62,7 +63,6 @@ export default {
label: 'columnName'
},
news: [],
files: []
}
},
components: {
@ -77,7 +77,6 @@ export default {
mounted() {
this.getColumn()
this.getArticle()
this.getFile()
},
methods: {
//
@ -85,10 +84,16 @@ export default {
this.$post(`${this.api.findArticle}?id=${this.id}`).then(({ data }) => {
this.form = data
this.columnId = data.columnId
this.$refs.breadcrumb.update('装置概况/' + data.title)
this.query = {
id: data.columnId
}
this.$refs.breadcrumb.update(data.columnName + '/' + data.title)
data.bannerImg || this.getBanner(this.columns)
if (this.columnBanner) this.form.bannerImg = this.columnBanner
}).catch(err => {})
// +1
this.$post(`${this.api.articlePreview}?contentId=${this.id}`).then(({ data }) => {}).catch(err => {})
},
// banner
getBanner(data) {
@ -102,12 +107,6 @@ export default {
}
}
},
//
getFile() {
this.$post(`${this.api.theAttachmentUnderTheQueryColumn}?contentId=${this.id}`).then(({ data }) => {
this.files = data
}).catch(err => {})
},
//
getColumn() {
this.$post(this.api.listWithTree, {

@ -4,7 +4,7 @@
{{ form.columnName }}
</div>
<div class="content" style="width: 1400px;">
<Breadcrumb ref="breadcrumb" :data="'装置概况/' + form.title"/>
<Breadcrumb ref="breadcrumb" :data="'装置概况/' + form.title" route="column" :query.sync="query"/>
<div class="article">
<div class="left">
<h2>{{ form.title }}</h2>
@ -12,10 +12,10 @@
<div class="meta">{{ form.edit && '编辑:' + form.edit }} {{ form.audit && ' | 审核:' + form.audit }} {{ form.label && ' | 标签:' + form.label }}</div>
<p class="brief">{{ form.summary }}</p>
<div v-html="form.mainBody"></div>
<div v-if="files.length" class="annex">
<div v-if="form.fileList && form.fileList.length" class="annex">
<h6>附件下载</h6>
<ul class="files">
<li v-for="(file, i) in files" :key="i">
<li v-for="(file, i) in form.fileList" :key="i">
<span class="name">{{ file.fileName }}</span>
<span class="download" @click="download(file)">下载</span>
</li>
@ -61,8 +61,10 @@ import Breadcrumb from '@/components/breadcrumb'
export default {
data() {
return {
site: this.$store.state.content.site,
loaded: false,
id: this.$route.query.id,
query: {},
columnId: '',
form: {},
columnBanner: '',
@ -72,7 +74,6 @@ export default {
label: 'columnName'
},
news: [],
files: []
}
},
components: {
@ -87,27 +88,32 @@ export default {
mounted() {
this.getColumn()
this.getArticle()
this.getFile()
},
methods: {
//
getInfo() {
this.$post(`${this.api.findArticle}?id=${this.id}`).then(({ data }) => {
this.$refs.breadcrumb.update(data.columnName + '/' + data.title)
if (data.isDisable) {
this.$router.back()
} else {
if (data.articleTemplate === 10) {
this.$router.replace(`/article/activity?id=${this.id}&siteId=${this.$route.query.siteId}`)
if (data.articleTemplate === 25) { //
this.$router.replace(`/article/activity?id=${this.id}&siteId=${this.$route.query.siteId || this.site}`)
} else {
this.query = {
id: data.columnId
}
this.form = data
this.columnId = data.columnId
this.$refs.breadcrumb.update('装置概况/' + data.title)
data.bannerImg || this.getBanner(this.columns)
if (this.columnBanner) this.form.bannerImg = this.columnBanner
this.loaded = true
}
}
}).catch(err => {})
// +1
this.$post(`${this.api.articlePreview}?contentId=${this.id}`).then(({ data }) => {}).catch(err => {})
},
// banner
getBanner(data) {
@ -121,12 +127,6 @@ export default {
}
}
},
//
getFile() {
this.$post(`${this.api.theAttachmentUnderTheQueryColumn}?contentId=${this.id}`).then(({ data }) => {
this.files = data
}).catch(err => {})
},
//
getColumn() {
this.$post(this.api.listWithTree, {

@ -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;

@ -19,17 +19,24 @@
<div class="block">
<div class="inner" v-if="modules[1].list[this.curColumn].articles.length">
<div class="banner">
<img width="50%" height="480" :src="modules[1].list[this.curColumn].articles[0].titleImg" alt="">
<div class="right">
<h6>{{ modules[1].list[this.curColumn].articles[0].title }}</h6>
<div class="des" v-html="modules[1].list[this.curColumn].articles[0].mainBody"></div>
<p class="meta">{{ modules[1].list[this.curColumn].articles[0].createTime }} {{ modules[1].list[this.curColumn].articles[0].author && ' | ' + modules[1].list[this.curColumn].articles[0].author }}</p>
</div>
</div>
<el-carousel class="articles" height="410px" arrow="never">
<template v-for="(item, i) in modules[1].list[this.curColumn].articles">
<el-carousel-item v-if="i < 3" :key="i">
<div class="banner" @click="toArtice(item)">
<img width="50%" height="480" :src="item.titleImg" alt="">
<div class="right">
<h6>{{ item.title }}</h6>
<div class="des" v-html="item.mainBody"></div>
<p class="meta">{{ item.createTime }} {{ item.author && ' | ' + item.author }}</p>
</div>
</div>
</el-carousel-item>
</template>
</el-carousel>
<ul class="card">
<template v-for="(item, i) in modules[1].list[this.curColumn].articles">
<li v-if="i" :key="i">
<li v-if="i > 3" :key="i" @click="toArtice(item)">
<img class="pic" :src="item.titleImg" alt="">
<div class="texts">
<p class="meta">{{ item.createTime }} {{ item.author && ' | ' + item.author }}</p>
@ -39,7 +46,7 @@
</li>
</template>
</ul>
<div class="more">More news ></div>
<div class="more" @click="toMore">More news ></div>
</div>
</div>
@ -169,7 +176,7 @@ export default {
siteId: e.site,
columnIds: [id],
pageNum: 1,
pageSize: e.articleNum || 4
pageSize: e.articleNum || 6
}).then(({ data }) => {
this.$set(e, 'articles', data.records)
}).catch(err => {})
@ -248,6 +255,11 @@ export default {
} else {
this.curColumn = i
}
},
// more
toMore() {
const { column } = this.modules[1].list[this.curColumn]
column.length && this.$router.push(`/column?id=${column[column.length - 1]}`)
}
}
};
@ -273,6 +285,12 @@ export default {
}
}
}
/deep/.articles {
.el-carousel__indicators--horizontal {
bottom: 20px;
left: 804px;
}
}
.banner {
display: flex;
cursor: pointer;
@ -307,6 +325,7 @@ export default {
margin-right: 28px;
box-shadow: 0px 0px 20px 0px rgba(176,176,176,0.21);
border-radius: 6px;
cursor: pointer;
&:last-child {
margin-right: 0;
}

@ -3,7 +3,6 @@ import util from "@/libs/util";
import router from "@/router";
import Setting from "@/setting";
import { Message } from "element-ui";
const service = axios.create({
baseURL: Setting.apiBaseURL,
timeout: 10000000
@ -14,7 +13,6 @@ service.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8"
// 请求拦截器
service.interceptors.request.use(config => {
util.getToken();
let token = util.local.get(Setting.tokenKey);
if (token) config.headers.token = token;
return config;

@ -10,7 +10,7 @@ requireModule.keys().forEach(fileName => {
const frameIn = [
{
path: "/",
redirect: "/channel"
redirect: "/home"
},
...modules
];

Loading…
Cancel
Save