修复研究院提出的问题

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

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

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

@ -1,6 +1,6 @@
<template>
<div v-show="loaded" v-loading="loading"
:class="['wrap', { activity: info.listStyleId === 15, party: info.listStyleId === 68 }]">
<div :class="['wrap', { activity: info.listStyleId === 15, party: info.listStyleId === 68 }]">
<div v-show="loaded" v-loading="loading">
<div class="banner">
<img width="100%" height="280" :src="info.columnBanner" alt="" />
<div class="texts">
@ -25,7 +25,8 @@
<div class="item">
<span class="label">{{ $t('column.label') }}</span>
<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>
</div>
<div class="search">
@ -50,7 +51,8 @@
<div class="item">
<span class="label">{{ $t('column.label') }}</span>
<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>
</div>
<div class="search">
@ -346,6 +348,7 @@
</div>
</div>
</div>
</div>
</template>
<script>

File diff suppressed because it is too large Load Diff

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

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

Loading…
Cancel
Save