修复研究院提出的问题

master
yujialong 5 months ago
parent 4eb372e784
commit 89ff070859
  1. 52
      src/components/rightColumns/index.vue
  2. 32
      src/mixins/page/index.js
  3. 9
      src/pages/article/index.vue
  4. 11
      src/pages/column/index.vue
  5. 447
      src/pages/iasf/index.vue
  6. 6
      src/store/modules/content.js
  7. 2
      src/store/modules/layout.js

@ -1,44 +1,29 @@
<template> <template>
<div :class="['right', {party}]"> <div :class="['right', { party }]">
<el-tree class="column" <el-tree class="column" ref="column" :data="columns" highlight-current :expand-on-click-node="false"
ref="column" :props="defaultProps" node-key="id" @node-click="columnTo"></el-tree>
:data="columns"
highlight-current
:expand-on-click-node="false"
:props="defaultProps"
node-key="id"
@node-click="columnTo"></el-tree>
<template v-if="site == 2"> <template v-if="site == 2">
<p class="l-title">{{ $t('column.latestNews') }}</p> <p class="l-title">{{ $t('column.latestNews') }}</p>
<ul class="list"> <ul class="list">
<li v-for="(item, i) in site2News" <li v-for="(item, i) in site2News" :key="i" :title="item.title" @click="toArtice(item)">
:key="i"
:title="item.title"
@click="toArtice(item)">
<p class="text">{{ item.title }}</p> <p class="text">{{ item.title }}</p>
<span class="date">{{ item.releaseTime }}</span> <span class="date">{{ item.releaseTime }}</span>
</li> </li>
</ul> </ul>
</template> </template>
<template v-else> <template v-else>
<p class="l-title">{{$t('column.hot')}}</p> <p class="l-title">{{ $t('column.hot') }}</p>
<ul class="list"> <ul class="list">
<li v-for="(item, i) in hots" <li v-for="(item, i) in hots" :key="i" :title="item.title" @click="toArtice(item)">
:key="i"
:title="item.title"
@click="toArtice(item)">
<p class="text">{{ item.title }}</p> <p class="text">{{ item.title }}</p>
<span class="date">{{ item.releaseTime }}</span> <span class="date">{{ item.releaseTime }}</span>
</li> </li>
</ul> </ul>
<p class="l-title">{{$t('column.latestNews')}}</p> <p class="l-title">{{ $t('column.latestNews') }}</p>
<ul class="list"> <ul class="list">
<li v-for="(item, i) in news" <li v-for="(item, i) in news" :key="i" :title="item.title" @click="toArtice(item)">
:key="i"
:title="item.title"
@click="toArtice(item)">
<p class="text">{{ item.title }}</p> <p class="text">{{ item.title }}</p>
<span class="date">{{ item.releaseTime }}</span> <span class="date">{{ item.releaseTime }}</span>
</li> </li>
@ -91,7 +76,7 @@ export default {
siteId: this.site, siteId: this.site,
columnIds: [411, 412, 413], columnIds: [411, 412, 413],
pageNum: 1, pageNum: 1,
pageSize: 8, pageSize: 5,
})).then(({ data }) => { })).then(({ data }) => {
this.site2News = Util.removeTag(data.records); this.site2News = Util.removeTag(data.records);
}).catch((res) => { }); }).catch((res) => { });
@ -111,53 +96,64 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.right { .right {
width: 20%; width: 20%;
/deep/ .el-tree-node__label { /deep/ .el-tree-node__label {
font-size: 0.78rem; font-size: 0.78rem;
} }
} }
.column { .column {
width: 100%; width: 100%;
margin-bottom: 1.56rem; margin-bottom: 1.56rem;
.el-tree-node:focus > .el-tree-node__content { .el-tree-node:focus>.el-tree-node__content {
background-color: #e5edf8; background-color: #e5edf8;
} }
/deep/.el-tree-node__content { /deep/.el-tree-node__content {
height: 2.75rem; height: 2.75rem;
background-color: #e5edf8; background-color: #e5edf8;
border-bottom: 2px solid #fff; border-bottom: 2px solid #fff;
} }
/deep/.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
/deep/.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
color: #fff; color: #fff;
background-color: #0f5698; background-color: #0f5698;
} }
} }
.list { .list {
margin-bottom: 20px; margin-bottom: 20px;
li { li {
padding: 16px 0; padding: 16px 0;
border-bottom: 1px solid #d8d8d8; border-bottom: 1px solid #d8d8d8;
} }
.text { .text {
margin-bottom: 5px; margin-bottom: 5px;
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
color: $main-color; color: $main-color;
} }
} }
.date { .date {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
} }
} }
.party { .party {
.el-tree-node:focus > .el-tree-node__content,
.el-tree-node:focus>.el-tree-node__content,
/deep/.el-tree-node__content { /deep/.el-tree-node__content {
background-color: $lightPartyTheme; background-color: $lightPartyTheme;
} }
/deep/.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content { /deep/.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
background-color: $partyTheme; background-color: $partyTheme;
} }
} }

@ -1,7 +1,7 @@
import Setting from '@/setting' import Setting from '@/setting'
import Util from '@/libs/util' import Util from '@/libs/util'
export default { export default {
data() { data () {
return { return {
id: this.$route.query.id, id: this.$route.query.id,
preview: this.$route.query.preview, preview: this.$route.query.preview,
@ -10,11 +10,11 @@ export default {
} }
}, },
computed: { computed: {
site() { site () {
return this.$route.query.siteId || this.$store.state.content.site return this.$route.query.siteId || this.$store.state.content.site
} }
}, },
mounted() { mounted () {
this.getInfo && this.id && this.getColumnInfo() this.getInfo && this.id && this.getColumnInfo()
}, },
methods: { methods: {
@ -27,8 +27,12 @@ export default {
}) })
.catch((res) => { }); .catch((res) => { });
}, },
// 保存当前页面的滚动位置
saveScrollTop () {
this.$store.commit('content/setScrollTop', document.documentElement.scrollTop || document.body.scrollTop)
},
// 打开链接 // 打开链接
async openLink(item) { async openLink (item) {
const { link } = item const { link } = item
if (link.linkName === '无' || link.linkName === '') return false if (link.linkName === '无' || link.linkName === '') return false
let href = link.linkAddress let href = link.linkAddress
@ -62,24 +66,26 @@ export default {
href += '&siteId=' + link.site href += '&siteId=' + link.site
if (!link.otherArticleId) href = this.$router.resolve(href).href if (!link.otherArticleId) href = this.$router.resolve(href).href
} }
this.saveScrollTop()
// 如果是站内/站外链接,并且选择的是文章,则要获取当前长页名称传到文章详情里,面包屑点返回的时候需要返回到当前长页 // 如果是站内/站外链接,并且选择的是文章,则要获取当前长页名称传到文章详情里,面包屑点返回的时候需要返回到当前长页
if ((type === 1 && link.articleId) || (type === 3 && link.otherArticleId)) { if ((type === 1 && link.articleId) || (type === 3 && link.otherArticleId)) {
this.$post(this.api.findColumn, Util.rsa(this.id)).then(({ data }) => { this.$post(this.api.findColumn, Util.rsa(this.id)).then(({ data }) => {
href = this.$router.resolve(href + '&id=' + this.id + '&columnName=' + data.columnName + '&path=' + this.$route.path.replace('/', '')).href href = this.$router.resolve(href + '&id=' + this.id + '&columnName=' + data.columnName + '&path=' + this.$route.path.replace('/', '')).href
this.toHref(link.isOpen, href) this.toHref(link.isOpen, href)
}).catch(res => {}) }).catch(res => { })
} else { } else {
this.toHref(link.isOpen, href) this.toHref(link.isOpen, href)
} }
}, },
// 跳转地址 // 跳转地址
toHref(isOpen, href) { toHref (isOpen, href) {
if (isOpen) { if (isOpen) {
var userAgent = navigator.userAgent; var userAgent = navigator.userAgent;
var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent); var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent);
if(isSafari) { if (isSafari) {
window.location.href = href window.location.href = href
}else { } else {
window.open(href) window.open(href)
} }
} else { } else {
@ -88,7 +94,8 @@ export default {
} }
}, },
// 跳转文章页面 // 跳转文章页面
toArtice(item, form) { toArtice (item, form) {
this.saveScrollTop()
if (item.articleTemplate === 24) { // 链接 if (item.articleTemplate === 24) { // 链接
let href = item.linkAddress let href = item.linkAddress
const cType = item.connectionType const cType = item.connectionType
@ -112,15 +119,16 @@ export default {
} }
}, },
// 关联栏目的查看全部跳转 // 关联栏目的查看全部跳转
toAll(form) { toAll (form) {
this.saveScrollTop()
this.$router.push(`/column?id=${form.column[form.column.length - 1]}&siteId=${form.site}`) this.$router.push(`/column?id=${form.column[form.column.length - 1]}&siteId=${form.site}`)
}, },
// 判断是否有添加链接 // 判断是否有添加链接
isLink(linkName) { isLink (linkName) {
return linkName !== '无' && linkName !== '' return linkName !== '无' && linkName !== ''
}, },
// 关联栏目专用,获取栏目标题 // 关联栏目专用,获取栏目标题
getColumnTitle(form) { getColumnTitle (form) {
return form.columnTitle == 1 ? form.columnName : form.columnTitleCustom return form.columnTitle == 1 ? form.columnName : form.columnTitleCustom
} }
} }

@ -1,5 +1,6 @@
<template> <template>
<div v-show="loaded" class="wrap"> <div class="wrap">
<div v-show="loaded">
<!-- 人物详情不展示banner --> <!-- 人物详情不展示banner -->
<div v-if="form.articleTemplate !== 23 && !isPeople" class="banner" <div v-if="form.articleTemplate !== 23 && !isPeople" class="banner"
:style="{ backgroundImage: form.bannerImg ? ('url(' + form.bannerImg + ')') : '' }"> :style="{ backgroundImage: form.bannerImg ? ('url(' + form.bannerImg + ')') : '' }">
@ -14,7 +15,8 @@
<div class="meta">{{ form.source && form.source + ' | ' }} {{ form.author && form.author + ' | ' }} {{ <div class="meta">{{ form.source && form.source + ' | ' }} {{ form.author && form.author + ' | ' }} {{
form.releaseTime }}</div> form.releaseTime }}</div>
<div class="meta">{{ form.edit && $t('column.edit') + ':' + form.edit }} {{ form.audit && ' | ' + <div class="meta">{{ form.edit && $t('column.edit') + ':' + form.edit }} {{ form.audit && ' | ' +
$t('column.auditor') + ':' + form.audit }} {{ form.label && ' | ' + $t('column.label') + ':' + form.label $t('column.auditor') + ':' + form.audit }} {{ form.label && ' | ' + $t('column.label') + ':' +
form.label
}}</div> }}</div>
</template> </template>
<p v-if="form.summary" class="brief">{{ form.summary }}</p> <p v-if="form.summary" class="brief">{{ form.summary }}</p>
@ -33,6 +35,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -224,7 +227,7 @@ export default {
.brief { .brief {
padding-bottom: 1.5rem; padding-bottom: 1.5rem;
margin: 1rem 0; margin: 1rem 0;
font-size: 1.2rem; font-size: 0.9rem;
line-height: 1.6; line-height: 1.6;
color: #606060; color: #606060;
border-bottom: 1px solid #d8d8d8; border-bottom: 1px solid #d8d8d8;

@ -1,6 +1,6 @@
<template> <template>
<div v-show="loaded" v-loading="loading" <div :class="['wrap', { activity: info.listStyleId === 15, party: info.listStyleId === 68 }]">
:class="['wrap', { activity: info.listStyleId === 15, party: info.listStyleId === 68 }]"> <div v-show="loaded" v-loading="loading">
<div class="banner"> <div class="banner">
<img width="100%" height="280" :src="info.columnBanner" alt="" /> <img width="100%" height="280" :src="info.columnBanner" alt="" />
<div class="texts"> <div class="texts">
@ -25,7 +25,8 @@
<div class="item"> <div class="item">
<span class="label">{{ $t('column.label') }}</span> <span class="label">{{ $t('column.label') }}</span>
<el-select ref="search" v-model="lableId" multiple @change="filter"> <el-select ref="search" v-model="lableId" multiple @change="filter">
<el-option v-for="item in labels" :key="item.id" :label="item.labelName" :value="item.id"> </el-option> <el-option v-for="item in labels" :key="item.id" :label="item.labelName" :value="item.id">
</el-option>
</el-select> </el-select>
</div> </div>
<div class="search"> <div class="search">
@ -50,7 +51,8 @@
<div class="item"> <div class="item">
<span class="label">{{ $t('column.label') }}</span> <span class="label">{{ $t('column.label') }}</span>
<el-select ref="search" v-model="lableId" multiple @change="filter"> <el-select ref="search" v-model="lableId" multiple @change="filter">
<el-option v-for="item in labels" :key="item.id" :label="item.labelName" :value="item.id"> </el-option> <el-option v-for="item in labels" :key="item.id" :label="item.labelName" :value="item.id">
</el-option>
</el-select> </el-select>
</div> </div>
<div class="search"> <div class="search">
@ -346,6 +348,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>

File diff suppressed because it is too large Load Diff

@ -7,7 +7,8 @@ export default {
namespaced: true, namespaced: true,
state: { state: {
site: 2, site: 2,
keyword: '' keyword: '',
scrollTop: 0,
}, },
getters: { getters: {
site: state => { site: state => {
@ -21,6 +22,9 @@ export default {
setKeyword: (state, keyword) => { setKeyword: (state, keyword) => {
state.keyword = keyword state.keyword = keyword
}, },
setScrollTop: (state, val) => {
state.scrollTop = val
},
}, },
actions: { actions: {

@ -3,7 +3,7 @@
* */ * */
// 是否IE // 是否IE
function isIE() { function isIE () {
if (!!window.ActiveXObject || "ActiveXObject" in window) return true; if (!!window.ActiveXObject || "ActiveXObject" in window) return true;
return false; return false;
} }

Loading…
Cancel
Save