yujialong 4 months ago
parent c1867b0064
commit 122ca4c6ce
  1. 1
      src/api/index.js
  2. 1
      src/components/modules/content.vue
  3. 86
      src/components/modules/history.vue
  4. 9
      src/components/modules/module.vue
  5. 6
      src/const/modules.js
  6. 205
      src/libs/util.js
  7. 7
      src/mixins/page/index.js
  8. 178
      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`, deleteArticle: `/iasf/sysContent/batchDeletion`,
findArticle: `/iasf/sysContent/findById`, findArticle: `/iasf/sysContent/findById`,
queryArticle: `/iasf/sysContent/pagingQuery`, queryArticle: `/iasf/sysContent/pagingQuery`,
queryArticlesByColumnType: `/iasf/sysColumn/queryArticlesByColumnType`,
articleEnableOrDisable: `/iasf/sysContent/articleEnableOrDisable`, articleEnableOrDisable: `/iasf/sysContent/articleEnableOrDisable`,
saveArticle: `/iasf/sysContent/save`, saveArticle: `/iasf/sysContent/save`,
updateArticle: `/iasf/sysContent/update`, updateArticle: `/iasf/sysContent/update`,

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

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

@ -63,7 +63,8 @@
<el-upload v-if="item.type === 'upload'" class="uploader" accept=".jpg,.png,.jpeg,.gif" <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" :on-change="res => changeFile(res, data.form)" :show-file-list="false" :headers="headers"
:action="api.upload"> :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> <div class="uploader-default" v-else>
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<p>上传图片</p> <p>上传图片</p>
@ -94,13 +95,14 @@
<source :src="data.form[item.prop]" type="video/mp4"> <source :src="data.form[item.prop]" type="video/mp4">
您的浏览器不支持 video 标签 您的浏览器不支持 video 标签
</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> </div>
<i v-if="!item.required" class="el-icon-delete del" @click="data.form[item.prop] = ''"></i> <i v-if="!item.required" class="el-icon-delete del" @click="data.form[item.prop] = ''"></i>
</div> </div>
<div v-if="item.type === 'link'" class="flex"> <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> <el-button @click="toLink(data.form)">设置链接</el-button>
</div> </div>
<Editor v-if="item.type === 'editor'" api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' <Editor v-if="item.type === 'editor'" api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'
@ -553,6 +555,7 @@ export default {
}, },
// //
moduleSubmit () { moduleSubmit () {
this.$emit('update:visible', false)
this.$emit('moduleSubmit') this.$emit('moduleSubmit')
}, },
} }

@ -1540,8 +1540,8 @@ export default {
list: [ list: [
{ {
pic: 'https://huorantech.com/images/about/6.png', pic: 'https://huorantech.com/images/about/6.png',
title: 'Sun Dongbai', title: 'Sun',
subTitle: 'Founder and 1st PRESIDENT OF THE INSTITUTE OF ADVANCED SCIENCE FACILITIES, SHENZHEN', subTitle: 'Personal Introduction',
link: { link: {
linkName: '无', linkName: '无',
connectionType: 1, connectionType: 1,
@ -1553,7 +1553,7 @@ export default {
otherArticleId: '', otherArticleId: '',
isOpen: 1 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 isEnable: 1
}, },
{ {

@ -10,102 +10,115 @@ const exts = {
doc: 'doc,docx,txt,xls,xlsx,csv,xml,ppt,pptx' doc: 'doc,docx,txt,xls,xlsx,csv,xml,ppt,pptx'
} }
const util = { const util = {
local: _local, local: _local,
// 筛选出有权限的站点 // 筛选出有权限的站点
getSite(list) { getSite (list) {
const result = [] const result = []
const auth = store.state.auth.btns const auth = store.state.auth.btns
list.map(e => { list.map(e => {
auth.find(n => n.includes(e.siteName)) && result.push(e) auth.find(n => n.includes(e.siteName)) && result.push(e)
}) })
return result return result
}, },
//返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss" //返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss"
formatDate(fmt, date) { formatDate (fmt, date) {
var date = date ? date : new Date(); var date = date ? date : new Date();
var o = { var o = {
"M+": date.getMonth() + 1, //月份 "M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日 "d+": date.getDate(), //日
"h+": date.getHours(), //小时 "h+": date.getHours(), //小时
"m+": date.getMinutes(), //分 "m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒 "s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度 "q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒 "S": date.getMilliseconds() //毫秒
}; };
if (/(y+)/.test(fmt)) { if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length)); fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
} }
for (var k in o) { for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) { if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
} }
} }
return fmt; return fmt;
}, },
// 传入文件后缀判断是否是视频 // 传入文件后缀判断是否是视频
isVideo(ext) { isVideo (ext) {
if (exts.video.includes(ext)) return true; if (exts.video.includes(ext)) return true;
return false; return false;
}, },
// 传入文件后缀判断是否是音频 // 传入文件后缀判断是否是音频
isAudio(ext) { isAudio (ext) {
if (exts.audio.includes(ext)) return true; if (exts.audio.includes(ext)) return true;
return false; return false;
}, },
// 传入文件后缀判断是否是图片 // 传入文件后缀判断是否是图片
isImg(ext) { isImg (ext) {
if (exts.img.includes(ext.toLowerCase())) return true; if (exts.img.includes(ext.toLowerCase())) return true;
return false; return false;
}, },
// 传入文件后缀判断是否是pdf以外的文档 // 传入文件后缀判断是否是pdf以外的文档
isDoc(ext) { isDoc (ext) {
if (exts.doc.includes(ext)) return true; if (exts.doc.includes(ext)) return true;
return false; return false;
}, },
// 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域 // 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域
downloadFile(fileName, url) { downloadFile (fileName, url) {
var x = new XMLHttpRequest(); var x = new XMLHttpRequest();
x.open("GET", url, true); x.open("GET", url, true);
x.responseType = "blob"; x.responseType = "blob";
x.onload = function(e) { x.onload = function (e) {
var url = window.URL.createObjectURL(x.response); var url = window.URL.createObjectURL(x.response);
var a = document.createElement("a"); var a = document.createElement("a");
a.href = url; a.href = url;
a.download = fileName; a.download = fileName;
a.click(); a.click();
}; };
x.send(); x.send();
}, },
// 传入文件名和数据,下载文件 // 传入文件名和数据,下载文件
downloadFileDirect(fileName, data) { downloadFileDirect (fileName, data) {
if ("download" in document.createElement("a")) { // 非IE下载 if ("download" in document.createElement("a")) { // 非IE下载
const elink = document.createElement("a"); const elink = document.createElement("a");
elink.download = fileName; elink.download = fileName;
elink.style.display = "none"; elink.style.display = "none";
elink.href = URL.createObjectURL(data); elink.href = URL.createObjectURL(data);
document.body.appendChild(elink); document.body.appendChild(elink);
elink.click(); elink.click();
URL.revokeObjectURL(elink.href); // 释放URL 对象 URL.revokeObjectURL(elink.href); // 释放URL 对象
document.body.removeChild(elink); document.body.removeChild(elink);
} else { // IE10+下载 } else { // IE10+下载
navigator.msSaveBlob(data, fileName); navigator.msSaveBlob(data, fileName);
} }
}, },
// 成功提示 // 成功提示
successMsg(message, duration = 3000) { successMsg (message, duration = 3000) {
Message.closeAll(); Message.closeAll();
return Message.success({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration }); return Message.success({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration });
}, },
// 警告提示 // 警告提示
warningMsg(message, duration = 3000) { warningMsg (message, duration = 3000) {
Message.closeAll(); Message.closeAll();
return Message.warning({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration }); return Message.warning({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration });
}, },
// 错误提示 // 错误提示
errorMsg(message, duration = 3000) { errorMsg (message, duration = 3000) {
Message.closeAll(); Message.closeAll();
return Message.error({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration }); 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; export default util;

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

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

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

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

Loading…
Cancel
Save