文章栏目模板联调

mobile
yujialong 2 years ago
parent 18ff1c99a7
commit a80a307666
  1. 2
      src/api/index.js
  2. 12
      src/layouts/footer/index.vue
  3. 13
      src/layouts/header/index.vue
  4. 45
      src/layouts/navbar/index.vue
  5. 7
      src/pages/about/index.vue
  6. 4
      src/pages/application/index.vue
  7. 208
      src/pages/article/activity.vue
  8. 31
      src/pages/article/index.vue
  9. 4
      src/pages/careers/index.vue
  10. 155
      src/pages/column/index.vue
  11. 4
      src/pages/edu/index.vue
  12. 8
      src/pages/home/index.vue
  13. 45
      src/pages/news/index.vue
  14. 4
      src/pages/newsPress/index.vue
  15. 4
      src/pages/newsProcurement/index.vue
  16. 4
      src/pages/research/index.vue
  17. 6
      src/router/modules/article.js
  18. 17
      src/styles/common.scss
  19. BIN
      src/styles/font/toppan.otf

@ -10,4 +10,6 @@ export default {
findColumn: `iasf/sysColumn/findById`, findColumn: `iasf/sysColumn/findById`,
queryClassif: `iasf/content/classification/allTheQuery`, queryClassif: `iasf/content/classification/allTheQuery`,
queryLabel: `iasf/content/label/queryAllArticleSubjectTags`, queryLabel: `iasf/content/label/queryAllArticleSubjectTags`,
getsTheSubColumn: `iasf/sysColumn/getsTheSubColumn`,
getTheFullArticleByColumn: `iasf/sysColumn/getTheFullArticleByColumn`,
} }

@ -21,7 +21,6 @@
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from '@/setting'
import ColumnConst from '@/const/column'
export default { export default {
data() { data() {
return { return {
@ -75,14 +74,9 @@ export default {
} else { } else {
location.href = href location.href = href
} }
} else { } else if (typeId !== 4 || (typeId === 4 && !to.children.length)) {
// column // columnpath
let path = 'column' this.$router.push(`/${typeId === 3 ? row.path : 'column'}?id=${id}`).catch(err => {})
if (typeId === 3) { //
const item = ColumnConst.pageStyle.find(e => e.id === to.listStyleId)
if (item) path = item.path
}
this.$router.push(`/${path}?id=${id}`).catch(err => {})
} }
} }
}, },

@ -58,12 +58,11 @@ $height: 90px;
height: $height; height: $height;
&:not(.channel) { &:not(.channel) {
background-color: #fff; background-color: #fff;
box-shadow: 0px 2px 9px 0px rgba(221,221,221,0.18);
} }
.logo{ .logo{
position: absolute; position: absolute;
top: 0; top: 0;
left: 167px; left: 5%;
font-size: 20px; font-size: 20px;
color: #333330; color: #333330;
line-height: $height; line-height: $height;
@ -75,7 +74,7 @@ $height: 90px;
.tools { .tools {
position: absolute; position: absolute;
top: 30px; top: 30px;
right: 240px; right: 5%;
img { img {
cursor: pointer; cursor: pointer;
} }
@ -84,13 +83,13 @@ $height: 90px;
margin-right: 43px; margin-right: 43px;
} }
} }
@media (max-width: 1430px) { @media (max-width: 1500px) {
.header { .header {
.logo { .logo {
left: 20px; left: 50px;
} }
.inner { .tools {
padding-right: 20px; right: 50px
} }
} }
} }

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-menu class="nav" ref="type" :key="menuRefresh" mode="horizontal" :background-color="bgColor" :text-color="textColor" :active-text-color="activeTextColor" @open="jump" @select="jump" :default-active="String(active)"> <el-menu :class="['nav', {home: isHome}]" ref="type" :key="menuRefresh" mode="horizontal" menu-trigger="click" :background-color="bgColor" :text-color="textColor" :active-text-color="activeTextColor" @open="jump" @select="jump" :default-active="String(active)">
<menuTree :menuList="menus"/> <menuTree :menuList="menus"/>
</el-menu> </el-menu>
</div> </div>
@ -9,12 +9,11 @@
<script> <script>
import Setting from '@/setting' import Setting from '@/setting'
import menuTree from '@/components/menuTree' import menuTree from '@/components/menuTree'
import ColumnConst from '@/const/column'
export default { export default {
data() { data() {
return { return {
site: this.$store.state.content.site, site: this.$store.state.content.site,
isChannel: this.$route.path === '/home', isHome: this.$route.path === '/home',
active: this.$route.query.id, active: this.$route.query.id,
menus: [], menus: [],
bgColor: '#fff', bgColor: '#fff',
@ -29,7 +28,7 @@ export default {
}, },
watch: { watch: {
'$route'() { '$route'() {
this.isChannel = this.$route.path === '/home' this.isHome = this.$route.path === '/home'
this.handleColor() this.handleColor()
} }
}, },
@ -53,9 +52,9 @@ export default {
}, },
// //
handleColor() { handleColor() {
const channel = this.isChannel const home = this.isHome
this.bgColor = channel ? 'transparent' : '#fff' this.bgColor = home ? 'transparent' : '#fff'
this.textColor = channel ? '#fff' : '#333' this.textColor = home ? '#fff' : '#333'
// this.menuRefresh++ // this.menuRefresh++
}, },
// //
@ -98,14 +97,9 @@ export default {
} else { } else {
location.href = href location.href = href
} }
} else { } else if (typeId !== 4 || (typeId === 4 && !to.children.length)) {
// column // columnpath
let path = 'column' this.$router.push(`/${typeId === 3 ? to.path : 'column'}?id=${id}`).catch(err => {})
if (typeId === 3) { //
const item = ColumnConst.pageStyle.find(e => e.id === to.listStyleId)
if (item) path = item.path
}
this.$router.push(`/${path}?id=${id}`).catch(err => {})
} }
} }
} }
@ -114,13 +108,11 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
$height: 90px; $height: 90px;
/deep/.nav{ /deep/.nav.el-menu--horizontal {
position: absolute; position: absolute;
top: 0; top: 0;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
}
/deep/.nav.el-menu--horizontal {
border: 0; border: 0;
.el-menu-item, .el-submenu__title { .el-menu-item, .el-submenu__title {
height: $height; height: $height;
@ -128,6 +120,12 @@ $height: 90px;
span { span {
font-size: 14px; font-size: 14px;
} }
&:hover {
background-color: transparent !important;
span {
color: #1583FF;
}
}
} }
.el-submenu__title { .el-submenu__title {
display: inline-flex; display: inline-flex;
@ -139,12 +137,15 @@ $height: 90px;
} }
.el-submenu__icon-arrow { .el-submenu__icon-arrow {
position: static; position: static;
margin: 0; margin: 0 0 0 5px;
color: inherit;
} }
} }
@media (max-width: 1430px) { @media (max-width: 1500px) {
.nav { /deep/.nav {
left: 52%; .el-menu-item {
padding: 0 8px;
}
} }
} }
</style> </style>

@ -5,7 +5,7 @@
<el-carousel-item v-if="item.pic && item.isEnable" :key="i"> <el-carousel-item v-if="item.pic && item.isEnable" :key="i">
<div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)"> <div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)">
<img :src="item.pic" alt=""> <img :src="item.pic" alt="">
<p class="banner-name">ABOUT</p> <p class="banner-name">{{ item.title }}</p>
</div> </div>
</el-carousel-item> </el-carousel-item>
</template> </template>
@ -177,7 +177,7 @@ export default {
// state1theEditedJson稿0jsonBeforeEditing // state1theEditedJson稿0jsonBeforeEditing
const json = JSON.parse(this.preview ? const json = JSON.parse(this.preview ?
data : data :
data[0][data[0].state ? 'theEditedJson' : 'jsonBeforeEditing']) data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing'])
this.modules = json this.modules = json
console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json[0]) console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json[0])
} }
@ -218,6 +218,7 @@ export default {
} }
.bg { .bg {
margin: -122px 0 0 0; margin: -122px 0 0 0;
border-top-right-radius: 40px;
} }
} }
.card { .card {
@ -248,6 +249,7 @@ export default {
h6 { h6 {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 40px; font-size: 40px;
font-family: toppan;
} }
.des { .des {
font-size: 18px; font-size: 18px;
@ -379,6 +381,7 @@ export default {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 60px; font-size: 60px;
font-weight: 800; font-weight: 800;
font-family: toppan;
color: #035CE1; color: #035CE1;
line-height: 49px; line-height: 49px;
} }

@ -5,7 +5,7 @@
<el-carousel-item v-if="item.pic && item.isEnable" :key="i"> <el-carousel-item v-if="item.pic && item.isEnable" :key="i">
<div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)"> <div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)">
<img :src="item.pic" alt=""> <img :src="item.pic" alt="">
<p class="banner-name">APPLICATION</p> <p class="banner-name">{{ item.title }}</p>
</div> </div>
</el-carousel-item> </el-carousel-item>
</template> </template>
@ -95,7 +95,7 @@ export default {
// state1theEditedJson稿0jsonBeforeEditing // state1theEditedJson稿0jsonBeforeEditing
const json = JSON.parse(this.preview ? const json = JSON.parse(this.preview ?
data : data :
data[0][data[0].state ? 'theEditedJson' : 'jsonBeforeEditing']) data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing'])
this.modules = json this.modules = json
console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json) console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json)

@ -0,0 +1,208 @@
<template>
<div class="wrap">
<div class="content" style="width: 1400px;">
<Breadcrumb ref="breadcrumb" :data="'装置概况/' + form.title"/>
<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>
<h6>内容介绍</h6>
<div v-html="form.mainBody"></div>
</div>
<div class="right">
<el-tree class="column" ref="column" :data="columns" highlight-current :expand-on-click-node="false" :props="defaultProps" node-key="id" ></el-tree>
<p class="l-title">热点内容</p>
<ul class="list">
<li>
<p class="text">喜报 | 深圳粒子研究院荣获全国科研</p>
<span class="date">2022-08-09</span>
</li>
<li>
<p class="text">喜报 | 深圳粒子研究院荣获全国科研</p>
<span class="date">2022-08-09</span>
</li>
<li>
<p class="text">喜报 | 深圳粒子研究院荣获全国科研</p>
<span class="date">2022-08-09</span>
</li>
</ul>
<p class="l-title">最新资讯</p>
<ul class="list">
<li v-for="(item, i) in news" :key="i">
<p class="text">{{ item.title }}</p>
<span class="date">{{ item.createTime }}</span>
</li>
</ul>
</div>
</div>
</div>
</div>
</template>
<script>
import Setting from '@/setting'
import Util from '@/libs/util'
import Breadcrumb from '@/components/breadcrumb'
export default {
data() {
return {
id: this.$route.query.id,
columnId: '',
form: {},
columnBanner: '',
columns: [],
defaultProps: {
value: 'id',
label: 'columnName'
},
news: [],
files: []
}
},
components: {
Breadcrumb
},
watch: {
'$route'() {
this.id = this.$route.query.id
this.getInfo()
}
},
mounted() {
this.getColumn()
this.getArticle()
this.getFile()
},
methods: {
//
getInfo() {
this.$post(`${this.api.findArticle}?id=${this.id}`).then(({ data }) => {
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
}).catch(err => {})
},
// banner
getBanner(data) {
this.columnBanner = ''
for (const e of data) {
if (e.columnBanner) this.columnBanner = e.columnBanner
if (e.id == this.columnId) {
break
} else {
this.getBanner(e.children)
}
}
},
//
getFile() {
this.$post(`${this.api.theAttachmentUnderTheQueryColumn}?contentId=${this.id}`).then(({ data }) => {
this.files = data
}).catch(err => {})
},
//
getColumn() {
this.$post(this.api.listWithTree, {
siteId: this.$route.query.siteId || this.$store.state.content.site,
columnName: '',
templateId: '',
typeId : '',
isSort: 0
}).then(({ data }) => {
this.columns = data
this.getInfo()
}).catch(err => {})
},
//
getArticle() {
this.$post(this.api.newlyPublishedArticles, {
pageNum: 1,
pageSize: 5,
siteId: this.$route.query.siteId || this.$store.state.content.site
}).then(({ data }) => {
this.news = data.records
}).catch(res => {})
},
//
download(e) {
Util.downloadFile(e.fileName, e.filePath)
}
}
};
</script>
<style lang="scss" scoped>
@import "./editor.css";
.banner {
height: 280px;
padding: 123px 0 0 243px;
font-size: 48px;
color: #fff;
background: url(../../assets/images/intro-bg.png) 0 0/100% 100% no-repeat;
}
.article {
display: flex;
justify-content: space-between;
.left {
width: 920px;
}
h2 {
margin-bottom: 20px;
font-size: 36px;
color: #1C1C1C;
}
.meta {
margin: 10px 0;
font-size: 14px;
font-weight: 600;
color: #333;
}
h6 {
margin: 30px 0 10px;
font-size: 18px;
}
.right {
width: 324px;
}
.column {
width: 100%;
margin-bottom: 25px;
}
/deep/.el-tree-node__content {
height: 60px;
background-color: #E5EDF8;
border-bottom: 2px solid #fff;
}
/deep/.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
color: #fff;
background-color: #0f5698;
}
.list {
margin-bottom: 20px;
li {
padding: 16px 0;
border-bottom: 1px solid #D8D8D8;
}
.text {
margin-bottom: 5px;
font-size: 14px;
cursor: pointer;
&:hover {
color: $main-color;
}
}
.date {
font-size: 12px;
color: #999;
}
}
}
</style>

@ -1,14 +1,14 @@
<template> <template>
<div class="wrap"> <div v-show="loaded" class="wrap">
<div class="banner" :style="{backgroundImage: form.bannerImg ? ('url(' + form.bannerImg + ')') : ''}"> <div class="banner" :style="{backgroundImage: form.bannerImg ? ('url(' + form.bannerImg + ')') : ''}">
{{ form.title }} {{ form.columnName }}
</div> </div>
<div class="content" style="width: 1400px;"> <div class="content" style="width: 1400px;">
<Breadcrumb ref="breadcrumb" :data="'装置概况/' + form.title"/> <Breadcrumb ref="breadcrumb" :data="'装置概况/' + form.title"/>
<div class="article"> <div class="article">
<div class="left"> <div class="left">
<h2>{{ form.title }}</h2> <h2>{{ form.title }}</h2>
<div class="meta">{{ form.createTime }} | {{ form.source && form.source + '|' }} {{ form.author && form.author + ' | ' }} {{ form.totalBrowsing }} 浏览</div> <div class="meta">{{ form.source && form.source + ' | ' }} {{ form.author && form.author + ' | ' }} {{ form.totalBrowsing }} 浏览 | {{ form.createTime }}</div>
<div class="meta">{{ form.edit && '编辑:' + form.edit }} {{ form.audit && ' | 审核:' + form.audit }} {{ form.label && ' | 标签:' + form.label }}</div> <div class="meta">{{ form.edit && '编辑:' + form.edit }} {{ form.audit && ' | 审核:' + form.audit }} {{ form.label && ' | 标签:' + form.label }}</div>
<p class="brief">{{ form.summary }}</p> <p class="brief">{{ form.summary }}</p>
<div v-html="form.mainBody"></div> <div v-html="form.mainBody"></div>
@ -61,9 +61,11 @@ import Breadcrumb from '@/components/breadcrumb'
export default { export default {
data() { data() {
return { return {
loaded: false,
id: this.$route.query.id, id: this.$route.query.id,
columnId: '', columnId: '',
form: {}, form: {},
columnBanner: '',
columns: [], columns: [],
defaultProps: { defaultProps: {
value: 'id', value: 'id',
@ -89,13 +91,22 @@ export default {
}, },
methods: { methods: {
// //
getInfo() { getInfo() {
this.$post(`${this.api.findArticle}?id=${this.id}`).then(({ data }) => { this.$post(`${this.api.findArticle}?id=${this.id}`).then(({ data }) => {
this.form = data if (data.isDisable) {
this.columnId = data.columnId this.$router.back()
this.$refs.breadcrumb.update('装置概况/' + data.title) } else {
data.bannerImg || this.getBanner(this.columns) if (data.articleTemplate === 10) {
if (this.columnBanner) this.form.bannerImg = this.columnBanner this.$router.replace(`/article/activity?id=${this.id}&siteId=${this.$route.query.siteId}`)
} else {
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 => {}) }).catch(err => {})
}, },
// banner // banner
@ -123,7 +134,7 @@ export default {
columnName: '', columnName: '',
templateId: '', templateId: '',
typeId : '', typeId : '',
isSort: 0 isSort: 1
}).then(({ data }) => { }).then(({ data }) => {
this.columns = data this.columns = data
this.getInfo() this.getInfo()

@ -5,7 +5,7 @@
<el-carousel-item v-if="item.pic && item.isEnable" :key="i"> <el-carousel-item v-if="item.pic && item.isEnable" :key="i">
<div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)"> <div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)">
<img :src="item.pic" alt=""> <img :src="item.pic" alt="">
<p class="banner-name">CAREERS</p> <p class="banner-name">{{ item.title }}</p>
</div> </div>
</el-carousel-item> </el-carousel-item>
</template> </template>
@ -116,7 +116,7 @@ export default {
// state1theEditedJson稿0jsonBeforeEditing // state1theEditedJson稿0jsonBeforeEditing
const json = JSON.parse(this.preview ? const json = JSON.parse(this.preview ?
data : data :
data[0][data[0].state ? 'theEditedJson' : 'jsonBeforeEditing']) data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing'])
this.modules = json this.modules = json
console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json) console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json)
} }

@ -7,10 +7,12 @@
<div class="column-wrap"> <div class="column-wrap">
<div class="article"> <div class="article">
<div class="left"> <div class="left">
<div class="forms"> <!-- 文章侧边栏+搜索+新闻列表 -->
<div v-if="info.listStyleId === 10" class="forms">
<div class="item"> <div class="item">
<span class="label">所属分类</span> <span class="label">所属分类</span>
<el-select v-model="form.typeId"> <el-select v-model="form.classificationId" @change="filter">
<el-option label="不限" value=""></el-option>
<el-option <el-option
v-for="item in classifications" v-for="item in classifications"
:key="item.id" :key="item.id"
@ -21,7 +23,7 @@
</div> </div>
<div class="item"> <div class="item">
<span class="label">主题</span> <span class="label">主题</span>
<el-select v-model="form.labelId"> <el-select v-model="lableId" multiple @change="filter">
<el-option <el-option
v-for="item in labels" v-for="item in labels"
:key="item.id" :key="item.id"
@ -37,17 +39,44 @@
</i> </i>
</div> </div>
</div> </div>
<!-- 会议活动筛选+会议活动列表 -->
<div v-if="info.listStyleId === 15" class="forms">
<div class="item">
<span class="label">类型</span>
<el-select v-model="form.classificationId">
<el-option label="不限" value=""></el-option>
<el-option
v-for="item in classifications"
:key="item.id"
:label="item.labelName"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div class="contents"> <div class="contents">
<ul class="columns"> <ul v-if="columns.length > 2 && !isFilter && showNav" class="columns">
<li v-for="(item, i) in columns" :key="i" :class="{active: i === curColumn}" @click="toArticle(i)">{{ item.columnName }}</li> <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> </ul>
<div style="width: 1113px"> <div style="width: 1113px">
<ul class="articles"> <ul class="articles">
<li v-for="(item, i) in articles" :key="i"> <li v-for="(item, i) in articles" :key="i" @click="toArtice(item)">
<div class="texts"> <div class="texts">
<p class="type">新闻类型</p> <p v-if="info.listStyleId === 10 && item.classificationName" class="type">{{ item.classificationName }}</p>
<h6>{{ item.title }}</h6> <h6>{{ item.title }}</h6>
<span class="meta">{{ item.releaseTime }} | 建设进展</span> <template v-if="info.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">
<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>
</template>
</div> </div>
<img class="pic" :src="item.titleImg" alt=""> <img class="pic" :src="item.titleImg" alt="">
</li> </li>
@ -59,7 +88,7 @@
</div> </div>
</div> </div>
<div class="right"> <div class="right">
<el-tree class="column" ref="column" :data="columns" highlight-current :expand-on-click-node="false" :props="defaultProps" node-key="id" ></el-tree> <el-tree class="column" ref="column" :data="infoColumns" highlight-current :expand-on-click-node="false" :props="defaultProps" node-key="id" ></el-tree>
<p class="l-title">热点内容</p> <p class="l-title">热点内容</p>
<ul class="list"> <ul class="list">
@ -99,18 +128,22 @@ export default {
id: this.$route.query.id, id: this.$route.query.id,
site: this.$store.state.content.site, site: this.$store.state.content.site,
columnId: '', columnId: '',
info: { info: {},
columnName: '',
columnBanner: ''
},
searchTimer: null, searchTimer: null,
lableId: [],
form: { form: {
classificationId: '',
title: '' title: ''
}, },
classifications: [], classifications: [],
labels: [], labels: [],
columns: [], columns: [],
all: null,
infoColumns: [],
curColumn: 0, curColumn: 0,
showNav: false,
showNavIds: [10, 11, 12, 16], // id
isFilter: false,
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
@ -125,33 +158,37 @@ export default {
watch: { watch: {
'$route'() { '$route'() {
this.id = this.$route.query.id this.id = this.$route.query.id
this.getInfo() this.init()
}, },
'form.title': function(val) { 'form.title': function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData() this.filter()
}, 500) }, 500)
} }
}, },
mounted() { mounted() {
this.getInfo() this.init()
this.getColumn()
this.getNews()
this.getArticle([this.id])
this.getClassification()
this.getLabel()
}, },
methods: { methods: {
init() {
this.getLeftColumn()
this.getInfo()
this.getColumn()
this.getNews()
this.getLabel()
},
// //
getInfo() { getInfo() {
this.$post(`${this.api.findColumn}?id=${this.id}`).then(({ data }) => { this.$post(`${this.api.findColumn}?id=${this.id}`).then(({ data }) => {
this.info = data this.info = data
this.showNav = this.showNavIds.includes(data.listStyleId)
this.getClassification()
}).catch(res => {}) }).catch(res => {})
}, },
// //
getClassification() { getClassification() {
this.$post(`${this.api.queryClassif}?siteId=${this.$route.query.siteId || this.site}`).then(({ data }) => { this.$post(`${this.api.getTheFullArticleByColumn}?id=${this.id}`).then(({ data }) => {
this.classifications = data this.classifications = data
}).catch(err => {}) }).catch(err => {})
}, },
@ -161,16 +198,32 @@ export default {
this.labels = data this.labels = data
}).catch(err => {}) }).catch(err => {})
}, },
// //
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)
}
this.curColumn = 0
this.columns = data
console.log("🚀 ~ file: index.vue ~ line 212 ~ this.$post ~ columns", columns)
}).catch(err => {})
},
//
getColumn() { getColumn() {
this.$post(this.api.listWithTree, { this.$post(this.api.listWithTreeMenuVisible, {
siteId: this.$route.query.siteId || this.$store.state.content.site, siteId: this.$route.query.siteId || this.$store.state.content.site,
columnName: '', columnName: '',
templateId: '', templateId: '',
typeId : '', typeId : '',
isSort: 0 isSort: 1
}).then(({ data }) => { }).then(({ data }) => {
this.columns = data this.infoColumns = data
}).catch(err => {}) }).catch(err => {})
}, },
// //
@ -183,32 +236,48 @@ export default {
this.news = data.records this.news = data.records
}).catch(res => {}) }).catch(res => {})
}, },
// //
toArticle(i) { toArticle(i, all) {
this.curColumn = i this.curColumn = i
this.initData() this.page = 1
this.getArticle(all ? this.columns.map(e => e.id) : [this.columns[i].id])
}, },
// //
getArticle(columnIds) { getArticle(columnIds) {
this.$post(this.api.queryArticle, { this.$post(this.api.newlyPublishedArticles, {
siteId: this.$route.query.siteId || this.$store.state.content.site, siteId: this.$route.query.siteId || this.site,
columnIds, columnIds,
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
labelId: this.lableId.join(),
...this.form ...this.form
}).then(({ data }) => { }).then(({ data }) => {
this.articles = data.records const list = data.records
list.map(e => {
e.mainBody = e.mainBody.replace(/<img.*?>/g , '') //
})
this.articles = list
this.total = +data.total this.total = +data.total
}).catch(res => {}) }).catch(res => {})
}, },
initData() { //
filter() {
this.page = 1 this.page = 1
this.getArticle([this.columns[this.curColumn].id]) 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.curColumn = 0
this.getArticle(id)
}, },
currentChange(val) { currentChange(val) {
this.page = val this.page = val
this.getData() // this.getData()
}, },
//
toArtice(item) {
this.$router.push(`/article?id=${item.id}&site=${this.$route.query.siteId || this.site}`)
}
} }
}; };
</script> </script>
@ -241,6 +310,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 30px; padding: 30px;
margin-bottom: 20px;
background-color: #fff; background-color: #fff;
.item { .item {
display: inline-flex; display: inline-flex;
@ -288,16 +358,16 @@ export default {
} }
.contents { .contents {
display: flex; display: flex;
margin-top: 20px;
} }
.columns { .columns {
width: 174px; width: 174px;
margin-right: 12px; margin-right: 12px;
overflow: auto;
li { li {
display: flex; display: flex;
align-items: center; align-items: center;
height: 48px; height: 48px;
padding-left: 24px; padding-left: 40px;
margin-bottom: 1px; margin-bottom: 1px;
font-size: 16px; font-size: 16px;
color: #666; color: #666;
@ -318,6 +388,9 @@ export default {
&.active { &.active {
border-right-color: #083A93; border-right-color: #083A93;
} }
&.all {
padding-left: 24px;
}
} }
} }
.articles { .articles {
@ -327,17 +400,19 @@ export default {
align-items: center; align-items: center;
margin-bottom: 20px; margin-bottom: 20px;
background-color: #fff; background-color: #fff;
cursor: pointer;
} }
.texts { .texts {
max-width: 620px; max-width: 620px;
padding-left: 30px; padding-left: 30px;
} }
.type { .type {
margin-bottom: 15px;
font-size: 18px; font-size: 18px;
color: #333; color: #333;
} }
h6 { h6 {
margin: 15px 0; margin-bottom: 15px;
font-size: 24px; font-size: 24px;
color: #000; color: #000;
line-height: 38px; line-height: 38px;
@ -347,6 +422,10 @@ export default {
font-size: 16px; font-size: 16px;
color: #666; color: #666;
} }
.des {
margin-top: 15px;
@include mul-ellipsis(2);
}
img { img {
width: 417px; width: 417px;
height: 244px; height: 244px;

@ -5,7 +5,7 @@
<el-carousel-item v-if="item.pic && item.isEnable" :key="i"> <el-carousel-item v-if="item.pic && item.isEnable" :key="i">
<div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)"> <div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)">
<img :src="item.pic" alt=""> <img :src="item.pic" alt="">
<p class="banner-name">NEWS & EVENTS</p> <p class="banner-name">{{ item.title }}</p>
</div> </div>
</el-carousel-item> </el-carousel-item>
</template> </template>
@ -71,7 +71,7 @@ export default {
// state1theEditedJson稿0jsonBeforeEditing // state1theEditedJson稿0jsonBeforeEditing
const json = JSON.parse(this.preview ? const json = JSON.parse(this.preview ?
data : data :
data[0][data[0].state ? 'theEditedJson' : 'jsonBeforeEditing']) data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing'])
this.modules = json this.modules = json
console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json) console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json)
} }

@ -39,7 +39,7 @@
<p class="intro">{{ modules[4].form.des }}</p> <p class="intro">{{ modules[4].form.des }}</p>
<ul class="news"> <ul class="news">
<li v-for="(item, i) in articles" :key="i" @click="toArtice(item)"> <li v-for="(item, i) in articles" :key="i" @click="toArtice(item)">
<img src="@/assets/images/channel1.png" alt=""> <img :src="item.titleImg" alt="">
<div class="texts"> <div class="texts">
<h6>{{ item.columnName }}</h6> <h6>{{ item.columnName }}</h6>
<div class="des" v-html="item.mainBody"></div> <div class="des" v-html="item.mainBody"></div>
@ -135,14 +135,14 @@ export default {
// state1theEditedJson稿0jsonBeforeEditing // state1theEditedJson稿0jsonBeforeEditing
const json = JSON.parse(this.preview ? const json = JSON.parse(this.preview ?
data : data :
data[0][data[0].state ? 'theEditedJson' : 'jsonBeforeEditing']) data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing'])
this.modules = json this.modules = json
console.log("🚀 ~ file: index.vue ~ line 138 ~ this.$post ~ this.modules", this.modules) console.log("🚀 ~ file: index.vue ~ line 138 ~ this.$post ~ this.modules", this.modules)
// //
const { column, site, articleNum } = json[5].form const { column, site, articleNum } = json[5].form
if (column.length) { if (column.length) {
this.$post(this.api.queryArticle, { this.$post(this.api.newlyPublishedArticles, {
siteId: site, siteId: site,
columnIds: [column[column.length - 1]], columnIds: [column[column.length - 1]],
pageNum: 1, pageNum: 1,
@ -304,6 +304,7 @@ export default {
color: #fff; color: #fff;
} }
.des { .des {
display: block;
padding: 38px 60px; padding: 38px 60px;
margin-top: 84px; margin-top: 84px;
font-size: 30px; font-size: 30px;
@ -312,6 +313,7 @@ export default {
text-align: center; text-align: center;
background: rgba(111, 69, 36, .56); background: rgba(111, 69, 36, .56);
border-radius: 17px; border-radius: 17px;
overflow: visible;
} }
} }
</style> </style>

@ -5,7 +5,7 @@
<el-carousel-item v-if="item.pic && item.isEnable" :key="i"> <el-carousel-item v-if="item.pic && item.isEnable" :key="i">
<div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)"> <div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)">
<img :src="item.pic" alt=""> <img :src="item.pic" alt="">
<p class="banner-name">NEWS & EVENTS</p> <p class="banner-name">{{ item.title }}</p>
</div> </div>
</el-carousel-item> </el-carousel-item>
</template> </template>
@ -154,7 +154,7 @@ export default {
// state1theEditedJson稿0jsonBeforeEditing // state1theEditedJson稿0jsonBeforeEditing
const json = JSON.parse(this.preview ? const json = JSON.parse(this.preview ?
data : data :
data[0][data[0].state ? 'theEditedJson' : 'jsonBeforeEditing']) data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing'])
console.log("🚀 ~ file: index.vue ~ line 138 ~ this.$post ~ this.modules", json) console.log("🚀 ~ file: index.vue ~ line 138 ~ this.$post ~ this.modules", json)
// //
@ -208,7 +208,46 @@ export default {
}, },
// tab // tab
tabChange(i) { tabChange(i) {
this.curColumn = i const { column } = this.modules[1].list[i]
if (column && column.length) {
const id = column[column.length - 1]
//
this.$post(`${this.api.findColumn}?id=${id}`).then(({ data }) => {
const { typeId } = data
//
if (typeId === 2) {
let href = data.linkAddress
const cType = data.connectionType
if (cType !== 2) { //
const ids = href.split('-') // -
// idsiteSelection
const site = cType === 1 ?
(this.$route.query.siteId || this.site) :
data.siteSelection
if (ids[1]) { //
href = '/article?id=' + ids[1]
} else { //
const columnIds = ids[0].split(',')
href = '/column?id=' + columnIds[columnIds.length - 1]
}
href = this.$router.resolve(href + '&siteId=' + site).href
}
//
if (data.isOpen) {
window.open(href)
} else {
location.href = href
}
} else if (typeId === 3) {
// path
this.$router.push(`/${data.path}?id=${id}`).catch(err => {})
} else {
this.curColumn = i
}
}).catch(err => {})
} else {
this.curColumn = i
}
} }
} }
}; };

@ -5,7 +5,7 @@
<el-carousel-item v-if="item.pic && item.isEnable" :key="i"> <el-carousel-item v-if="item.pic && item.isEnable" :key="i">
<div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)"> <div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)">
<img :src="item.pic" alt=""> <img :src="item.pic" alt="">
<p class="banner-name">NEWS & EVENTS</p> <p class="banner-name">{{ item.title }}</p>
</div> </div>
</el-carousel-item> </el-carousel-item>
</template> </template>
@ -54,7 +54,7 @@ export default {
// state1theEditedJson稿0jsonBeforeEditing // state1theEditedJson稿0jsonBeforeEditing
const json = JSON.parse(this.preview ? const json = JSON.parse(this.preview ?
data : data :
data[0][data[0].state ? 'theEditedJson' : 'jsonBeforeEditing']) data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing'])
this.modules = json this.modules = json
console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json) console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json)
} }

@ -5,7 +5,7 @@
<el-carousel-item v-if="item.pic && item.isEnable" :key="i"> <el-carousel-item v-if="item.pic && item.isEnable" :key="i">
<div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)"> <div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)">
<img :src="item.pic" alt=""> <img :src="item.pic" alt="">
<p class="banner-name">NEWS & EVENTS</p> <p class="banner-name">{{ item.title }}</p>
</div> </div>
</el-carousel-item> </el-carousel-item>
</template> </template>
@ -54,7 +54,7 @@ export default {
// state1theEditedJson稿0jsonBeforeEditing // state1theEditedJson稿0jsonBeforeEditing
const json = JSON.parse(this.preview ? const json = JSON.parse(this.preview ?
data : data :
data[0][data[0].state ? 'theEditedJson' : 'jsonBeforeEditing']) data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing'])
this.modules = json this.modules = json
console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json) console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json)
} }

@ -5,7 +5,7 @@
<el-carousel-item v-if="item.pic && item.isEnable" :key="i"> <el-carousel-item v-if="item.pic && item.isEnable" :key="i">
<div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)"> <div :class="['banner-item', {'cursor-pointer': item.link.linkName !== '无'}]" @click="openLink(item)">
<img :src="item.pic" alt=""> <img :src="item.pic" alt="">
<p class="banner-name">RESEARCH</p> <p class="banner-name">{{ item.title }}</p>
</div> </div>
</el-carousel-item> </el-carousel-item>
</template> </template>
@ -80,7 +80,7 @@ export default {
// state1theEditedJson稿0jsonBeforeEditing // state1theEditedJson稿0jsonBeforeEditing
const json = JSON.parse(this.preview ? const json = JSON.parse(this.preview ?
data : data :
data[0][data[0].state ? 'theEditedJson' : 'jsonBeforeEditing']) data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing'])
this.modules = json this.modules = json
console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json) console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json)
} }

@ -9,6 +9,12 @@ export default {
path: `/${name}`, path: `/${name}`,
component: () => import(`@/pages/${name}`), component: () => import(`@/pages/${name}`),
meta: { title: '' } meta: { title: '' }
},
{
name,
path: `/${name}/activity`,
component: () => import(`@/pages/${name}/activity`),
meta: { title: '' }
} }
] ]
}; };

@ -9,6 +9,10 @@
font-family: SFProDisplay-Bold; font-family: SFProDisplay-Bold;
src: url('font/SF-Pro-Display-Bold.otf'); src: url('font/SF-Pro-Display-Bold.otf');
} }
@font-face {
font-family: toppan;
src: url('font/toppan.otf');
}
[v-cloak] { [v-cloak] {
display: none; display: none;
@ -76,4 +80,17 @@
color: #fff !important; color: #fff !important;
background-color: $--color-primary !important; background-color: $--color-primary !important;
} }
}
.el-menu--popup {
min-width: 128px;
margin-top: 0;
text-align: center;
.el-menu-item {
height: 50px !important;
line-height: 50px !important;
}
span {
font-size: 18px;
color: #333;
}
} }

Binary file not shown.
Loading…
Cancel
Save