yujialong 4 months ago
parent c1867b0064
commit 122ca4c6ce
  1. 1
      src/api/index.js
  2. 1
      src/components/modules/content.vue
  3. 72
      src/components/modules/history.vue
  4. 9
      src/components/modules/module.vue
  5. 6
      src/const/modules.js
  6. 13
      src/libs/util.js
  7. 7
      src/mixins/page/index.js
  8. 170
      src/pages/column/page/iasf.vue
  9. 2
      src/pages/column/page/research.vue
  10. 5
      src/styles/page/page.scss

@ -52,6 +52,7 @@ export default {
deleteArticle: `/iasf/sysContent/batchDeletion`,
findArticle: `/iasf/sysContent/findById`,
queryArticle: `/iasf/sysContent/pagingQuery`,
queryArticlesByColumnType: `/iasf/sysColumn/queryArticlesByColumnType`,
articleEnableOrDisable: `/iasf/sysContent/articleEnableOrDisable`,
saveArticle: `/iasf/sysContent/save`,
updateArticle: `/iasf/sysContent/update`,

@ -54,6 +54,7 @@
</template>
<div v-if="item.type === 'link'" class="flex">
<el-input class="m-r-10" v-model="data.form.link.linkName" disabled></el-input>
<el-button type="danger" size="small" @click="data.form.link.linkName = '无'">清除</el-button>
<el-button @click="toLink(data.form)">设置链接</el-button>
</div>
</el-form-item>

@ -1,87 +1,52 @@
<template>
<!-- sfel-概况-发展历程 or 产业光源-概况-大事记 -->
<div>
<el-dialog title="编辑内容"
:visible.sync="visible"
width="70%"
custom-class="module"
:close-on-click-modal="false"
<el-dialog title="编辑内容" :visible.sync="visible" width="70%" custom-class="module" :close-on-click-modal="false"
:before-close="close">
<el-table class="module-table"
:data="list"
header-align="center"
row-key="id">
<el-table-column type="index"
width="60"
label="序号"
align="center"></el-table-column>
<el-table-column label="图片"
min-width="140"
align="center">
<el-table class="module-table" :data="list" header-align="center" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column label="图片" min-width="140" align="center">
<template slot-scope="scope">
<img v-if="scope.row.pic"
:src="scope.row.pic"
class="upload-pic">
<div class="upload-none"
v-else>
<img v-if="scope.row.pic" :src="scope.row.pic" class="upload-pic">
<div class="upload-none" v-else>
<i class="el-icon-picture-outline"></i>
</div>
</template>
</el-table-column>
<el-table-column prop="title"
label="标题"
min-width="140"
align="center"></el-table-column>
<el-table-column label="链接"
min-width="140"
align="center">
<el-table-column prop="title" label="标题" min-width="140" align="center"></el-table-column>
<el-table-column label="链接" min-width="140" align="center">
<template slot-scope="scope">
<div class="link-wrap">
<span>{{ scope.row.link.linkName }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="des"
label="描述"
min-width="240"
align="center">
<el-table-column prop="des" label="描述" min-width="240" align="center">
<template slot-scope="scope">
<div v-html="scope.row.des"></div>
</template>
</el-table-column>
<el-table-column label="操作"
width="100"
align="center">
<el-table-column label="操作" width="100" align="center">
<template slot-scope="scope">
<div class="flex a-center">
<el-switch v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0">
<el-switch v-model="scope.row.isEnable" :active-value="1" :inactive-value="0">
</el-switch>
<i class="el-icon-edit-outline del"
@click="editHistory(scope.row, scope.$index)"></i>
<i class="el-icon-delete del"
@click="delRow(list, scope.$index)"></i>
<i class="el-icon-edit-outline del" @click="editHistory(scope.row, scope.$index)"></i>
<i class="el-icon-delete del" @click="delRow(list, scope.$index)"></i>
</div>
</template>
</el-table-column>
</el-table>
<div v-if="!data.disableAdd"
class="plus">
<i class="el-icon-circle-plus-outline"
@click="editHistory(data.originForm, -1)"></i>
<div v-if="!data.disableAdd" class="plus">
<i class="el-icon-circle-plus-outline" @click="editHistory(data.originForm, -1)"></i>
</div>
<span slot="footer"
class="dialog-footer">
<span slot="footer" class="dialog-footer">
<el-button @click="$emit('update:visible', false)">取消</el-button>
<el-button type="primary"
@click="historySubmit">确定</el-button>
<el-button type="primary" @click="historySubmit">确定</el-button>
</span>
</el-dialog>
<Content :data.sync="data"
:visible.sync="contentVisible"
@contentSubmit="contentSubmit" />
<Content :data.sync="data" :visible.sync="contentVisible" @contentSubmit="contentSubmit" />
</div>
</template>
@ -161,6 +126,7 @@ export default {
.radio-wrap {
display: flex;
align-items: center;
.el-input {
width: 200px;
margin-left: -40px;

@ -63,7 +63,8 @@
<el-upload v-if="item.type === 'upload'" class="uploader" accept=".jpg,.png,.jpeg,.gif"
:on-change="res => changeFile(res, data.form)" :show-file-list="false" :headers="headers"
:action="api.upload">
<img v-if="data.form.pic && !isVideo(data.form.mediaType)" :src="data.form.pic" class="avatar">
<img v-if="data.form[item.prop] && !isVideo(data.form.mediaType)" :src="data.form[item.prop]"
class="avatar">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传图片</p>
@ -94,13 +95,14 @@
<source :src="data.form[item.prop]" type="video/mp4">
您的浏览器不支持 video 标签
</video>
<img v-else class="preview-media" :src="data.form[item.prop]" alt="">
<!-- <img v-else class="preview-media" :src="data.form[item.prop]" alt=""> -->
</div>
<i v-if="!item.required" class="el-icon-delete del" @click="data.form[item.prop] = ''"></i>
</div>
<div v-if="item.type === 'link'" class="flex">
<el-input class="m-r-10" v-model="data.form.link.linkName" disabled></el-input>
<el-input class="m-r-10" v-model="data.form.link.linkName" disabled clearable />
<el-button type="danger" size="small" @click="data.form.link.linkName = '无'">清除</el-button>
<el-button @click="toLink(data.form)">设置链接</el-button>
</div>
<Editor v-if="item.type === 'editor'" api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'
@ -553,6 +555,7 @@ export default {
},
//
moduleSubmit () {
this.$emit('update:visible', false)
this.$emit('moduleSubmit')
},
}

@ -1540,8 +1540,8 @@ export default {
list: [
{
pic: 'https://huorantech.com/images/about/6.png',
title: 'Sun Dongbai',
subTitle: 'Founder and 1st PRESIDENT OF THE INSTITUTE OF ADVANCED SCIENCE FACILITIES, SHENZHEN',
title: 'Sun',
subTitle: 'Personal Introduction',
link: {
linkName: '无',
connectionType: 1,
@ -1553,7 +1553,7 @@ export default {
otherArticleId: '',
isOpen: 1
},
des: 'Dr. Sun was the executive vice president of Sun Yat- and vice president of the University of Science and Technology Beijing (2008-2017). One of the most widely well-known material scientists aation',
des: 'Details Description',
isEnable: 1
},
{

@ -106,6 +106,19 @@ const util = {
Message.closeAll();
return Message.error({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration });
},
// 去掉html里的标签及空格
removeTag (list, prop = 'mainBody') {
list.map(e => {
// 有摘要取摘要,没有摘要就去掉正文里的标签空格(也可以通过正则去除html标签,不过富文本里会有插入IE注释的情况下,直接创建一个元素取text比较简单)
const text = e.summary || e[prop].replace(/(<p class="img-des">[^>]+<\/p>)|((&nbsp;)+)/g, '')
const el = document.createElement('div')
el.innerHTML = text
// e.mainBody = e.summary || e[prop].replace(/(<p class="img-des">[^>]+<\/p>)|(<\!--[^-->]+-->)|(<[^>]+>)|((&nbsp;)+)/g , '')
e.mainBody = el.innerText
e.releaseTime = e.releaseTime.split(' ')[0]
})
return list
},
};
export default util;

@ -83,7 +83,8 @@ export default {
}
})
this.originModules = JSON.stringify(this.modules) // 原始json,用以页面离开的时候判断是否需要提示保存
console.log("🚀 ~ file: index.js:85 ~ this.$post ~ list:", this.modules)
this.getArticles && this.getArticles()
console.log("🚀 ~ file: index.js:85 ~ this.$post ~ list:", this.modules, this.getArticles)
}
}).catch(err => { })
} else {
@ -184,6 +185,10 @@ export default {
leave || this.$router.back()
}).catch(err => { })
},
// 关联栏目专用,获取栏目标题
getColumnTitle (form) {
return form.columnTitle == 1 ? form.columnName : form.columnTitleCustom
},
// 返回
back () {
this.pass = true

@ -62,77 +62,70 @@
<div class="cover" @click="toSet(4)">点击更换标题与描述</div>
</div>
<div class="c-wrap">
<div class="news-banner">
<img style="width: 50%;height: 410px;overflow: hidden;" width="100%" height="480"
src="https://huorantech.com/images/about/5.png" alt="">
<div v-if="articles.length" class="news-banner">
<img class="pic" width="100%" height="100%" :src="articles[0].titleImg" alt="">
<div class="right">
<h6>IASF is driven to serve the Science and industry, and solve grand challenges through research and
innovation. We are open and creative</h6>
<div class="des">Innovation centers are distributed in the bay areas, such as the San Francisco Bay
area, the
New York Bay area, and the Tokyo Bay area in Japan. And the Guangdong-Hong Kong-Macao Greater Bay
</div>
<p class="meta">2022-07-24 | Research</p>
<h6>{{ articles[0].title }}</h6>
<div class="des" v-html="articles[0].mainBody"></div>
<p class="meta">{{ articles[0].releaseTime }} {{ articles[0].classificationName && ' | ' +
articles[0].classificationName }}</p>
</div>
</div>
<ul class="news">
<li>
<img class="pic" src="https://huorantech.com/images/about/5.png" alt="">
<div class="texts">
<p class="meta">2022-07-24 | 综合新闻</p>
<div class="des">X射线自由电子激光已经成为了化学生物物理等领域不可或缺的研究手段</div>
<img class="arrow" src="@/assets/images/arrow.png" alt="">
<template v-for="(item, i) in articles">
<li v-if="i" :key="i">
<div class="pic-wrap">
<img class="pic" :src="item.titleImg" alt="">
<div class="pic-cover"></div>
</div>
</li>
<li>
<img class="pic" src="https://huorantech.com/images/about/5.png" alt="">
<div class="texts">
<p class="meta">2022-07-24 | 建设进展</p>
<div class="des">自由电子激光装置调试及运行过程中提供稳定可靠的单发辐射脉冲纵向信息</div>
<img class="arrow" src="@/assets/images/arrow.png" alt="">
</div>
</li>
<li>
<img class="pic" src="https://huorantech.com/images/about/5.png" alt="">
<div class="texts">
<p class="meta">2022-07-24 | 学术动态</p>
<div class="des">基于上海软X射线自由电子激光试验装置科研人员对这一方法进行了实验验证</div>
<img class="arrow" src="@/assets/images/arrow.png" alt="">
<h6>{{ item.title }}</h6>
<div class="des" v-html="item.mainBody"></div>
<p class="meta">{{ item.releaseTime }} {{ item.classificationName && ' | ' +
item.classificationName
}}</p>
</div>
</li>
</template>
</ul>
<div class="cover" @click="toSet(5)">关联栏目</div>
</div>
<ul class="news-carousel">
<li>
<img class="pic" src="https://huorantech.com/images/about/5.png" alt="">
<li v-if="articles1.length">
<img class="pic" src="https://huorantech.com/images/iasf/8.png" alt="">
<div class="texts">
<h6>媒体关注</h6>
<p class="meta">来源人民日报</p>
<div class="des">进深圳规划中的深圳中能高重复频率X射线自由电子激光项目和大连极紫外自由电子</div>
<p class="date">2022-07-24</p>
<h6>{{ getColumnTitle(modules[6].form) }}</h6>
<div class="des-wrap">
<p class="meta">{{ articles1[0].source }}</p>
<div class="des">{{ articles1[0].title }}</div>
</div>
<p class="date">{{ articles1[0].releaseTime }}</p>
</div>
<div class="cover" @click="toSet(6)">关联栏目</div>
</li>
<li>
<img class="pic" src="https://huorantech.com/images/about/5.png" alt="">
<li v-if="articles2.length">
<img class="pic" src="https://huorantech.com/images/iasf/9.png" alt="">
<div class="texts">
<h6>媒体关注</h6>
<p class="meta">来源人民日报</p>
<div class="des">进深圳规划中的深圳中能高重复频率X射线自由电子激光项目和大连极紫外自由电子</div>
<p class="date">2022-07-24</p>
<h6>{{ getColumnTitle(modules[7].form) }}</h6>
<div class="des-wrap">
<p class="meta">{{ articles2[0].source }}</p>
<div class="des">{{ articles2[0].title }}</div>
</div>
<p class="date">{{ articles2[0].releaseTime }}</p>
</div>
<div class="cover" @click="toSet(7)">关联栏目</div>
</li>
<li>
<img class="pic" src="https://huorantech.com/images/about/5.png" alt="">
<li v-if="articles3.length">
<img class="pic" src="https://huorantech.com/images/iasf/10.png" alt="">
<div class="texts">
<h6>媒体关注</h6>
<p class="meta">来源人民日报</p>
<div class="des">进深圳规划中的深圳中能高重复频率X射线自由电子激光项目和大连极紫外自由电子</div>
<p class="date">2022-07-24</p>
<h6>{{ getColumnTitle(modules[8].form) }}</h6>
<div class="des-wrap">
<p class="meta">{{ articles3[0].source }}</p>
<div class="des">{{ articles3[0].title }}</div>
</div>
<p class="date">{{ articles3[0].releaseTime }}</p>
</div>
<div class="cover" @click="toSet(8)">关联栏目</div>
</li>
@ -257,18 +250,58 @@
</template>
<script>
import Util from '@/libs/util'
import mixins from '@/mixins/page'
import Modules from '@/const/modules'
export default {
mixins: [mixins],
data () {
return {
modules: Modules.iasf
modules: Modules.iasf,
articles: [],
articles1: [],
articles2: [],
articles3: [],
articles4: [],
}
},
mounted () { },
methods: {
//
async getArticles () {
const json = this.modules
if (json[5].form.column.length) {
const { column, articleNum } = json[5].form
const { data } = await this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`)
this.articles = Util.removeTag(data.slice(0, articleNum || 4))
}
if (json[6].form.column.length) {
const { column, articleNum } = json[6].form
const { data } = await this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`)
this.articles1 = Util.removeTag(data.slice(0, articleNum || 4))
}
if (json[7].form.column.length) {
const { column, articleNum } = json[7].form
const { data } = await this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`)
this.articles2 = Util.removeTag(data.slice(0, articleNum || 4))
}
if (json[8].form.column.length) {
const { column, articleNum } = json[8].form
const { data } = await this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`)
this.articles3 = Util.removeTag(data.slice(0, articleNum || 4))
}
if (json[10].form.column.length) {
const { column, articleNum } = json[10].form
const { data } = await this.$post(`${this.api.queryArticlesByColumnType}?columnId=${column[column.length - 1]}`)
this.articles4 = Util.removeTag(data.slice(0, articleNum || 3))
}
},
moduleSubmit () {
console.log(33, this.modules)
this.getArticles()
}
}
};
</script>
@ -393,6 +426,7 @@ export default {
cursor: pointer;
.pic {
width: 50%;
transition: 0.5s;
&:hover {
@ -412,7 +446,8 @@ export default {
}
.des {
font-size: 1.02rem;
font-size: 18px;
line-height: 32px;
}
.meta {
@ -457,6 +492,7 @@ export default {
li {
width: calc((100% - 18px) / 3);
margin-right: 9px;
background-color: #fff;
&:nth-child(3n) {
margin-right: 0;
@ -492,9 +528,11 @@ export default {
li {
position: relative;
width: calc((100% - 18px) / 3);
height: 320px;
margin-right: 9px;
width: calc((100% - 40px) / 3);
height: 284px;
margin-right: 20px;
overflow: hidden;
box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.06);
&:nth-child(3n) {
margin-right: 0;
@ -504,36 +542,46 @@ export default {
.pic {
width: 100%;
height: 100%;
transition: 0.5s;
object-fit: cover;
}
.texts {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding: 50px 30px;
color: #fff;
background-color: rgba(0, 0, 0, 0.3);
}
h6 {
font-size: 1.2rem;
font-family: PingFangSC-Medium, PingFang SC;
font-size: 24px;
cursor: pointer;
}
.des-wrap {
height: 101px;
margin: 11px 0 25px;
}
.meta {
margin: 8px 0;
font-size: 0.9rem;
margin-bottom: 16px;
font-size: 18px;
color: rgba(255, 255, 255, 0.86);
}
.des {
margin-bottom: 8px;
font-size: 1rem;
font-family: PingFangSC-Medium, PingFang SC;
font-size: 20px;
-webkit-line-clamp: 2;
line-height: 30px;
cursor: pointer;
}
.date {
font-size: 0.8rem;
font-size: 16px;
}
}

@ -45,7 +45,7 @@
</div>
<div class="block">
<div class="inner">
<div class="inner" style="width: 1400px;">
<div class="c-wrap">
<h2 class="b-title">{{ modules[3].form.title }}</h2>
<p class="intro">{{ modules[3].form.des }}</p>

@ -30,7 +30,7 @@
}
}
.inner {
width: 1400px;
width: 1200px;
margin: 0 auto;
&.lg {
width: 1505px;
@ -104,6 +104,9 @@
background-color: rgba(0, 0, 0, .7);
}
}
.des {
@include mul-ellipsis(3);
}
/deep/.module {
.el-table.module-table td {
.cell {

Loading…
Cancel
Save