yujialong 1 year ago
parent a87eb4c3b6
commit d1c6ee4e4e
  1. 1
      src/libs/util.js
  2. 21
      src/pages/article/index.vue
  3. 82
      src/pages/iasf/index.vue
  4. 16
      src/pages/lightSources/index.vue

@ -150,7 +150,6 @@ const util = {
// 传入站点id,判断是否英文 // 传入站点id,判断是否英文
getLang(id) { getLang(id) {
let siteId = util.getQuery('siteId') let siteId = util.getQuery('siteId')
console.log("🚀 ~ file: main.js:42 ~ siteId:", siteId)
return Setting.enIds.includes(siteId ? +siteId : store.state.content.site) ? 'en' : 'zh' return Setting.enIds.includes(siteId ? +siteId : store.state.content.site) ? 'en' : 'zh'
}, },
}; };

@ -79,12 +79,24 @@ export default {
// //
getInfo () { getInfo () {
// //
if (this.preview) { let cache = localStorage.getItem('article')
const data = localStorage.getItem('article') if (this.preview && cache) {
this.form = data cache = JSON.parse(cache)
const temId = cache.articleTemplate
this.form = cache
this.routes = [
{
name: cache.columnName,
},
{
name: cache.title
}
]
if (temId == 69) this.isParty = 1 // articleTemplate=69class if (temId == 69) this.isParty = 1 // articleTemplate=69class
if (temId == 72) this.isPeople = 1 // articleTemplate=72 if (temId == 72) this.isPeople = 1 // articleTemplate=72
data.releaseTime = data.releaseTime.split(' ')[0] if (cache.releaseTime) cache.releaseTime = cache.releaseTime.split(' ')[0]
this.loaded = true
console.log("🚀 ~ file: index.vue:90 ~ getInfo ~ cache:", this.form, cache)
} else { } else {
this.$post(`${this.api.findArticle}?id=${this.id}`).then(async ({ data }) => { this.$post(`${this.api.findArticle}?id=${this.id}`).then(async ({ data }) => {
// //
@ -138,7 +150,6 @@ export default {
}, },
// //
getColumnInfo () { getColumnInfo () {
console.log("🚀 ~ file: index.vue:125 ~ getColumnInfo ~ this.columnId:", this.columnId)
this.columnId && this.$post(`${this.api.findColumn}?id=${this.columnId}`) this.columnId && this.$post(`${this.api.findColumn}?id=${this.columnId}`)
.then(({ data }) => { .then(({ data }) => {
if (data.detailStyleId == 69) this.isParty = 1 if (data.detailStyleId == 69) this.isParty = 1

@ -116,73 +116,88 @@
</template> </template>
<ul class="news-carousel"> <ul class="news-carousel">
<li v-if="articles1.length"> <li v-if="articles1.length">
<el-carousel :interval="5000"
height="284px"
arrow="always">
<el-carousel-item v-for="item in articles1"
:key="item">
<img class="pic" <img class="pic"
src="http://10.10.11.7/images/iasf/8.png" src="http://10.10.11.7/images/iasf/8.png"
alt=""> alt="">
<div class="texts"> <div class="texts">
<h6 @click="toAll(modules[6].form)">{{ getColumnTitle(modules[6].form) }} <i class="el-icon-arrow-right"></i></h6> <h6 @click="toAll(modules[6].form)">{{ getColumnTitle(modules[6].form) }} <i class="el-icon-arrow-right"></i></h6>
<div class="des-wrap"> <div class="des-wrap">
<p class="meta">{{ item.source }}</p> <p class="meta">{{ curArticle1.source }}</p>
<div class="des" <div class="des"
@click="toArtice(item, modules[6].form)">{{ item.title }}</div> @click="toArtice(curArticle1, modules[6].form)">{{ curArticle1.title }}</div>
</div> </div>
<p class="date">{{ item.releaseTime }}</p> <p class="date">{{ curArticle1.releaseTime }}</p>
</div>
<div class="action">
<i class="el-icon-arrow-left dir"
@click.stop="prevCarousel(1)"></i>
<ul class="inds">
<li v-for="i in articles1.length > 3 ? 4 : articles1.length"
:key="i"
:class="{active: curInd1 == i - 1}"
@click.stop="switchCarousel(1, i - 1)"></li>
</ul>
<i class="el-icon-arrow-right dir"
@click.stop="nextCarousel(1)"></i>
</div> </div>
</el-carousel-item>
</el-carousel>
</li> </li>
<li v-if="articles2.length"> <li v-if="articles2.length">
<el-carousel :interval="5000"
height="284px"
arrow="always">
<el-carousel-item v-for="item in articles2"
:key="item">
<img class="pic" <img class="pic"
src="http://10.10.11.7/images/iasf/9.png" src="http://10.10.11.7/images/iasf/9.png"
alt=""> alt="">
<div class="texts"> <div class="texts">
<h6 @click="toAll(modules[7].form)">{{ getColumnTitle(modules[7].form) }} <i class="el-icon-arrow-right"></i></h6> <h6 @click="toAll(modules[7].form)">{{ getColumnTitle(modules[7].form) }} <i class="el-icon-arrow-right"></i></h6>
<div class="des-wrap"> <div class="des-wrap">
<p class="meta">{{ item.classificationName }}</p> <p class="meta">{{ curArticle2.classificationName }}</p>
<div class="des" <div class="des"
@click="toArtice(item, modules[7].form)">{{ item.title }}</div> @click="toArtice(curArticle2, modules[7].form)">{{ curArticle2.title }}</div>
</div> </div>
<p class="date">{{ item.releaseTime }}</p> <p class="date">{{ curArticle2.releaseTime }}</p>
</div>
<div class="action">
<i class="el-icon-arrow-left dir"
@click.stop="prevCarousel(2)"></i>
<ul class="inds">
<li v-for="i in articles2.length > 3 ? 4 : articles2.length"
:key="i"
:class="{active: curInd2 == i - 1}"
@click.stop="switchCarousel(2, i - 1)"></li>
</ul>
<i class="el-icon-arrow-right dir"
@click.stop="nextCarousel(2)"></i>
</div> </div>
</el-carousel-item>
</el-carousel>
</li> </li>
<li v-if="articles3.length"> <li v-if="articles3.length">
<el-carousel :interval="5000"
height="284px"
arrow="always">
<el-carousel-item v-for="item in articles3"
:key="item">
<img class="pic" <img class="pic"
src="http://10.10.11.7/images/iasf/10.png" src="http://10.10.11.7/images/iasf/10.png"
alt=""> alt="">
<div class="texts"> <div class="texts">
<h6 @click="toAll(modules[8].form)">{{ getColumnTitle(modules[8].form) }} <i class="el-icon-arrow-right"></i></h6> <h6 @click="toAll(modules[8].form)">{{ getColumnTitle(modules[8].form) }} <i class="el-icon-arrow-right"></i></h6>
<div class="activity"> <div class="activity">
<div v-if="item.activityStartTime" <div v-if="curArticle3.activityStartTime"
class="date-y"> class="date-y">
<p class="d">{{ item.activityStartTime.split(' ')[0].split('-')[2] }}</p> <p class="d">{{ curArticle3.activityStartTime.split(' ')[0].split('-')[2] }}</p>
<p class="y">{{ item.activityStartTime.split(' ')[0].split('-')[0] + '-' + item.activityStartTime.split(' ')[0].split('-')[1] }}</p> <p class="y">{{ curArticle3.activityStartTime.split(' ')[0].split('-')[0] + '-' + curArticle3.activityStartTime.split(' ')[0].split('-')[1] }}</p>
</div> </div>
<div class="des-wrap"> <div class="des-wrap">
<p class="meta">{{ item.classificationName }}</p> <p class="meta">{{ curArticle3.classificationName }}</p>
<div class="des" <div class="des"
@click="toArtice(item, modules[8].form)">{{ item.title }}</div> @click="toArtice(curArticle3, modules[8].form)">{{ curArticle3.title }}</div>
</div> </div>
</div> </div>
</div> </div>
</el-carousel-item> <div class="action">
</el-carousel> <i class="el-icon-arrow-left dir"
@click.stop="prevCarousel(3)"></i>
<ul class="inds">
<li v-for="i in articles3.length > 3 ? 4 : articles3.length"
:key="i"
:class="{active: curInd3 == i - 1}"
@click.stop="switchCarousel(3, i - 1)"></li>
</ul>
<i class="el-icon-arrow-right dir"
@click.stop="nextCarousel(3)"></i>
</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -674,7 +689,7 @@ export default {
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 50px; padding: 50px 30px;
color: #fff; color: #fff;
background-color: rgba(0, 0, 0, 0.3); background-color: rgba(0, 0, 0, 0.3);
} }
@ -710,6 +725,7 @@ export default {
margin-bottom: 5px; margin-bottom: 5px;
} }
.des-wrap { .des-wrap {
max-width: calc(100% - 100px);
height: auto; height: auto;
margin: 0; margin: 0;
} }

@ -50,7 +50,8 @@
</tr> </tr>
</thead> </thead>
<template v-if="modules[2].list.length"> <template v-if="modules[2].list.length">
<tr v-for="(item, i) in modules[2].list" <template v-for="(item, i) in modules[2].list">
<tr v-if="item.isEnable"
:key="i"> :key="i">
<td :class="{link: isLink(item.link.linkName)}" <td :class="{link: isLink(item.link.linkName)}"
@click="openLink(item)">{{ item.name }}</td> @click="openLink(item)">{{ item.name }}</td>
@ -65,6 +66,11 @@
<td>{{ item.time }}</td> <td>{{ item.time }}</td>
</tr> </tr>
</template> </template>
</template>
<tr v-else>
<td class="none"
colspan="20">暂无数据</td>
</tr>
</table> </table>
<table v-else <table v-else
class="table"> class="table">
@ -84,7 +90,8 @@
</tr> </tr>
</thead> </thead>
<template v-if="modules[3].list.length"> <template v-if="modules[3].list.length">
<tr v-for="(item, i) in modules[3].list" <template v-for="(item, i) in modules[3].list">
<tr v-if="item.isEnable"
:key="i"> :key="i">
<td :class="{link: isLink(item.link.linkName)}" <td :class="{link: isLink(item.link.linkName)}"
@click="openLink(item)">{{ item.name }}</td> @click="openLink(item)">{{ item.name }}</td>
@ -100,9 +107,10 @@
<td>{{ item.time }}</td> <td>{{ item.time }}</td>
</tr> </tr>
</template> </template>
</template>
<tr v-else> <tr v-else>
<td class="none" <td class="none"
colspan="11">暂无数据</td> colspan="20">暂无数据</td>
</tr> </tr>
</table> </table>
<div class="copyright">全球先进光源页面所刊载内容包括图片文字数据源自相关设施官方网站宣传手册以及国际原子能机构IAEA网站公开数据由深圳综合粒子设施研究院及中国科学学与科技政策研究会科技基础设施专业委员会共同汇总整理而来相关内容供访问者学习研究如需转载或引用须声明内容来源</div> <div class="copyright">全球先进光源页面所刊载内容包括图片文字数据源自相关设施官方网站宣传手册以及国际原子能机构IAEA网站公开数据由深圳综合粒子设施研究院及中国科学学与科技政策研究会科技基础设施专业委员会共同汇总整理而来相关内容供访问者学习研究如需转载或引用须声明内容来源</div>
@ -208,7 +216,7 @@ export default {
} }
} }
.copyright { .copyright {
margin-top: 10px; margin-top: 25px;
font-size: 0.7rem; font-size: 0.7rem;
line-height: 1.6; line-height: 1.6;
color: #8d8d8d; color: #8d8d8d;

Loading…
Cancel
Save