添加长页

master
yujialong 2 years ago
parent 2ee0d2bac1
commit 0ac28a3237
  1. 19
      src/components/modules/module.vue
  2. 108
      src/const/modules.js
  3. 9
      src/mixins/page/index.js
  4. 9
      src/pages/column/page/industrial.vue
  5. 4
      src/pages/column/page/mission.vue
  6. 524
      src/pages/column/page/researchTeam.vue
  7. 49
      src/pages/column/page/scientific.vue
  8. 8
      src/router/modules/column.js

@ -4,7 +4,7 @@
模块type: banner | introduce | form | forms | column | columns | history
-->
<el-dialog title="模块管理" :visible.sync="visible" width="700px" custom-class="module" :close-on-click-modal="false" :before-close="close">
<template v-if="data.type === 'banner' || data.type === 'introduce' || data.type === 'label'">
<template v-if="data.type === 'banner' || data.type === 'introduce' || data.type === 'label' || data.type === 'customList'">
<el-table v-if="data.type === 'label'" class="module-table" :data="data.list" header-align="center" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="title" label="标题" min-width="140" align="center">
@ -20,6 +20,21 @@
</template>
</el-table-column>
</el-table>
<el-table v-else-if="data.type === 'customList'" class="module-table" :data="data.list" header-align="center" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column v-for="(item, i) in data.forms" :key="i" :prop="item.prop" :label="item.label" min-width="120" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row[item.prop]" :placeholder="'请输入' + item.label" maxlength="100"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="60" align="center">
<template slot-scope="scope">
<div class="flex j-center a-center">
<i class="el-icon-delete del" @click="delRow(data.list, scope.$index)"></i>
</div>
</template>
</el-table-column>
</el-table>
<el-table v-else class="module-table" :data="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">
@ -347,7 +362,7 @@ export default {
//
addRow() {
const { type } = this.data
if (type === 'banner' || type === 'label') {
if (type === 'banner' || type === 'label' || type === 'customList') {
this.data.list.push(JSON.parse(JSON.stringify(this.data.originForm)))
} else if (type === 'history') {
this.data.list.push(JSON.parse(JSON.stringify(this.data.historyForm)))

@ -6815,7 +6815,7 @@ export default {
label: '链接'
},
{
type: 'textarea',
type: 'editor',
prop: 'des',
label: '描述'
}
@ -6856,7 +6856,7 @@ export default {
label: '链接'
},
{
type: 'textarea',
type: 'editor',
prop: 'des',
label: '描述'
}
@ -7103,6 +7103,26 @@ export default {
des: `以前沿科学技术发展和核心产业需求为导向,助力解决国家重大发展需求,并特别专注于推动半导体光刻、量子材料、能源科学、生物医药、燃烧科学、大气环境、星际科学、原子分子物理等前沿科学和应用产业的持续创新发展,实现深圳战略性新兴产业技术瓶颈及其相关根源性科学问题的重大突破。`
}
},
{
type: 'form',
forms: [
{
type: 'input',
prop: 'title',
label: '标题',
required: true
},
{
type: 'textarea',
prop: 'subTitle',
label: '小标题'
},
],
form: {
title: '工程进展',
subTitle: 'PRROJECT PROGRESS',
}
},
{
type: 'column',
form: {
@ -7369,4 +7389,88 @@ export default {
}
},
],
researchTeam: [
{
type: 'form',
forms: [
{
type: 'upload',
prop: 'pic',
label: '图片',
required: true
},
{
type: 'input',
prop: 'title',
label: '标题',
required: true
},
{
type: 'link',
prop: 'link',
label: '链接'
},
],
form: {
pic: 'http://10.10.11.7/images/researchTeam/1.png',
title: '研究团队',
link: {
linkName: '无',
connectionType: 1,
columnId: [],
articleId: '',
linkAddress : '',
site: '',
otherColumnId: [],
otherArticleId: '',
isOpen: 1
}
}
},
{
type: 'customList',
forms: [
{
type: 'input',
prop: 'name',
label: '姓名',
required: false
},
{
type: 'input',
prop: 'job',
label: '岗位',
required: false
},
{
type: 'input',
prop: 'major',
label: '专业',
required: false
},
{
type: 'input',
prop: 'honor',
label: '荣誉',
required: false
},
],
form: {
name: '',
job: '',
major: '',
honor: '',
isEnable: 1
},
list: [
{
name: '',
job: '',
major: '',
honor: '',
isEnable: 1
}
]
},
],
}

@ -8,6 +8,7 @@ export default {
userId: +this.$store.state.user.userId,
site: this.$store.state.content.site,
columnId: +this.$route.query.id,
withOriginForm: ['banner', 'introduce', 'history', 'label', 'customList'], // 要添加origiinForm的模块类型
id: '',
modules: [],
originModules: '[]',
@ -47,7 +48,7 @@ export default {
this.modules.map(e => {
const { type, list, form } = e
// 克隆一个原始row,方便添加
if (type === 'banner' || type === 'introduce' || type === 'history' || type === 'label') {
if (this.withOriginForm.includes(type)) {
const data = JSON.parse(JSON.stringify(e.form || e.list[0]))
for (const i in data) {
if (typeof data[i] === 'string') data[i] = ''
@ -73,14 +74,12 @@ export default {
this.originModules = str // 原始json,用以页面离开的时候判断是否需要提示保存
list.map((e, i) => {
if ((e.type === 'banner' || e.type === 'introduce' || e.type === 'history' || e.type === 'label') && !e.originForm) {
if (this.withOriginForm.includes(e.type) && !e.originForm) {
e.originForm = modules[i].originForm
}
})
console.log("🚀 ~ file: index.js:82 ~ this.$post ~ this.modules:", list)
this.modules = list
console.log("🚀 ~ file: index.js:85 ~ this.$post ~ list:", list)
}
}).catch(err => {})
},

@ -22,7 +22,7 @@
</div>
<div class="block history gray">
<div class="inner">
<div class="inner c-wrap">
<h2 class="wow fadeInLeft" style="margin-left: 57px">{{ modules[1].form.title }}</h2>
<div class="texts wow fadeInDown" data-wow-delay="0.5s">
<div class="left">
@ -39,10 +39,10 @@
<div class="inner">
<img class="pic" :src="modules[2].form.pic" alt="">
<div class="right">
<h6>{{ modules[2].form.subTitle }}</h6>
<h6>{{ modules[2].form.title }}</h6>
<div class="text" v-html="modules[2].form.des"></div>
</div>
<div class="cover" @click="toSet(2)">点击更改图片标题概述</div>
<div class="cover" @click="toSet(2)">点击更改图片标题概述</div>
</div>
</div>
@ -88,7 +88,7 @@ export default {
mixins: [mixins],
data() {
return {
modules: Modules.mission
modules: Modules.industrial
}
},
mounted() {
@ -150,6 +150,7 @@ export default {
}
.land {
.inner {
position: relative;
display: flex;
}
.pic {

@ -28,7 +28,7 @@
<img src="@/assets/images/science/1.png" alt="" />
<div class="texts">
<h6>{{ modules[1].form.title }}</h6>
<div class="des">{{ modules[1].form.des }}</div>
<div class="des" v-html="modules[1].form.des"></div>
</div>
<div class="cover" style="left: -35px" @click="toSet(1)">点击更改标题概述与链接</div>
</div>
@ -37,7 +37,7 @@
<img src="@/assets/images/science/2.png" alt="" />
<div class="texts rightText">
<h6>{{ modules[2].form.title }}</h6>
<div class="des">{{ modules[2].form.des }}</div>
<div class="des" v-html="modules[2].form.des"></div>
</div>
<div class="cover" style="right: -35px" @click="toSet(2)">点击更改标题概述与链接</div>
</div>

@ -0,0 +1,524 @@
<template>
<div class="wrap">
<div class="actions">
<p class="page-name">页面设置/关于IASF-研究团队</p>
<div>
<el-button type="primary" @click="preview">预览</el-button>
<el-button @click="save(0)">保存为草稿</el-button>
<el-button type="primary" @click="save(1)">发布</el-button>
<el-button @click="back">放弃编辑</el-button>
</div>
</div>
<div class="modules">
<div class="relative">
<div class="single-banner single-banner-overview">
<img class="banner-img" :src="modules[0].form.pic" alt="">
<div class="texts">
<h6 class="banner-title">{{ modules[0].form.title }}</h6>
</div>
</div>
<div class="cover" @click="toSet(0)">点击更换banner与链接</div>
</div>
<div class="content">
<div class="article">
<div class="left">
<ul class="teams">
<li v-for="(item, i) in modules[1].list" :key="i">
<div class="line">
<img src="http://10.10.11.7/images/researchTeam/3.png" alt="" class="icon">
<span class="bold">{{ item.name }}</span>
<span class="val">/ {{ item.job }}</span>
</div>
<div class="line">
<img src="http://10.10.11.7/images/researchTeam/4.png" alt="" class="icon">
<span class="text">专业 {{ item.major }}</span>
</div>
<div class="line">
<img src="http://10.10.11.7/images/researchTeam/5.png" alt="" class="icon">
<span class="text">荣誉 {{ item.honor }}</span>
</div>
</li>
<div class="cover" @click="toSet(1)">点击更换banner与链接</div>
</ul>
</div>
</div>
</div>
</div>
<Module ref="module" :data.sync="curData" :visible.sync="diaVisible" @moduleSubmit="moduleSubmit" />
</div>
</template>
<script>
import mixins from '@/mixins/page'
import Modules from '@/const/modules'
export default {
mixins: [mixins],
data() {
return {
modules: Modules.researchTeam,
title: ''
}
},
mounted() {
this.$store.commit('user/setCrumbs', [
{
name: '站点管理',
route: '/site'
},
{
name: '内容管理',
route: '/column'
},
{
name: '栏目管理',
route: '/column'
},
{
name: '关于IASF-研究团队'
}
])
},
methods: {
}
};
</script>
<style lang="scss" scoped>
@import "../../../styles/page/page.scss";
.content {
width: 1400px;
margin-top: 20px;
}
.article {
display: flex;
justify-content: center;
.left {
width: 66%;
.search {
display: inline-flex;
width: 34%;
input {
width: 100%;
height: 38px;
padding: 0 15px;
font-size: 14px;
color: #333;
background: #F7F7F7;
border: 0;
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
&:focus {
outline: none;
}
}
}
}
.teams {
position: relative;
display: flex;
flex-wrap: wrap;
margin-top: 30px;
li {
position: relative;
width: calc((100% - 10px) / 2);
padding: 20px 30px;
margin: 0 10px 10px 0;
background: url(http://10.10.11.7/images/researchTeam/2.png) 0 0/cover no-repeat;
&:nth-child(even) {
margin-right: 0;
}
}
.line {
display: flex;
align-items: center;
margin-bottom: 8px;
}
.icon {
margin-right: 8px;
}
.bold {
margin-right: 5px;
font-size: 1.1rem;
color: #333;
}
.val {
font-size: 1rem;
color: #999;
}
.text {
font-size: 1rem;
color: #666;
}
}
.notice {
display: flex;
li {
position: relative;
width: calc((100% - 20px) / 2);
height: 300px;
padding: 20px;
background-color: #fff;
}
.pic {
width: 100%;
height: 100%;
}
.text {
position: absolute;
bottom: 20px;
left: 20px;
width: calc(100% - 40px);
font-size: 1.6rem;
line-height: 66px;
text-align: center;
color: #fff;
background: rgba(32,57,81,0.68);
}
}
.right {
width: 20%;
}
.column {
width: 100%;
margin-bottom: 25px;
}
/deep/.el-tree-node__content {
height: 44px;
background-color: #E5EDF8;
border-bottom: 2px solid #fff;
}
/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;
}
}
}
@media (max-width: 1200px) {
.content {
width: 98%;
}
.article {
flex-direction: column;
.left, .right {
width: 100%;
}
.left {
margin-bottom: 30px;
}
}
}
@media (min-width: 280px) and (max-width: 750px) {
.article {
.recruit {
li {
flex-direction: column;
}
.pic {
width: 100%;
margin-bottom: 10px;
}
}
.notice {
flex-direction: column;
li {
width: 100%;
}
}
}
}
@media (max-width: 1200px) {
.content {
.article {
flex-direction: column;
.left {
width: 100%;
.recruit {
li {
flex-direction: column;
.pic {
width: 100%;
}
.texts {
margin-top: .8rem;
}
}
}
.notice {
flex-direction: column;
li {
width: 100%;
}
}
}
.right{
width: 100%;
.el-tree {
display: none;
}
}
}
}
}
@media (max-width: 320px) {
.wrap {
.single-banner {
.banner-img {
height: 13rem;
}
.texts {
left: 3rem;
top: 7rem;
}
}
}
.content {
.article {
.left {
.recruit {
li {
.pic {
height: 13rem;
}
}
}
.notice {
li {
height: auto;
.pic {
height: 13rem;
}
}
}
}
}
}
}
@media (min-width: 320px) and (max-width: 375px) {
.wrap {
.single-banner {
.banner-img {
height: 15rem;
}
.texts {
left: 3rem;
top: 7rem;
}
}
}
.content {
.article {
.left {
.recruit {
li {
.pic {
height: 15rem;
}
}
}
.notice {
li {
height: auto;
.pic {
height: 15rem;
}
}
}
}
}
}
}
@media (min-width: 375px) and (max-width: 480px) {
.wrap {
.single-banner {
.banner-img {
height: 18rem;
}
.texts {
left: 3rem;
top: 10rem;
}
}
}
.content {
.article {
.left {
.recruit {
li {
.pic {
height: 18rem;
}
}
}
.notice {
li {
height: auto;
.pic {
height: 18rem;
}
}
}
}
}
}
}
@media (min-width: 480px) and (max-width: 640px) {
.wrap {
.single-banner {
.banner-img {
height: 20rem;
}
.texts {
left: 3rem;
top: 12rem;
}
}
}
.content {
.article {
.left {
.recruit {
li {
.pic {
height: 22rem;
}
}
}
.notice {
li {
height: auto;
.pic {
height: 22rem;
}
}
}
}
}
}
}
@media (min-width: 640px) and (max-width: 768px) {
.wrap {
.single-banner {
.banner-img {
height: 22rem;
}
.texts {
left: 3rem;
top: 14rem;
}
}
}
.content {
.article {
.left {
.recruit {
li {
.pic {
height: 26rem;
}
}
}
.notice {
li {
height: auto;
.pic {
height: 26rem;
}
}
}
}
}
}
}
@media (min-width: 768px) and (max-width: 980px) {
.wrap {
.single-banner {
.banner-img {
height: 26rem;
}
.texts {
left: 3rem;
top: 16rem;
}
}
}
.content {
.article {
.left {
.recruit {
li {
.pic {
height: 30rem;
}
}
}
.notice {
li {
height: auto;
.pic {
height: 30rem;
}
}
}
}
}
}
}
@media (min-width: 980px) and (max-width: 1200px) {
.wrap {
.single-banner {
.banner-img {
height: 30rem;
}
.texts {
left: 3rem;
top: 18rem;
}
}
}
.content {
.article {
.left {
.recruit {
li {
.pic {
height: 35rem;
}
}
}
.notice {
li {
height: auto;
.pic {
height: 35rem;
}
}
}
}
}
}
}
</style>

@ -1,7 +1,7 @@
<template>
<div class="wrap">
<div class="actions">
<p class="page-name">页面设置/关于IASF-组织架构</p>
<p class="page-name">页面设置/科学研究</p>
<div>
<el-button type="primary" @click="preview">预览</el-button>
<el-button @click="save(0)">保存为草稿</el-button>
@ -93,7 +93,7 @@
</div>
<img src="@/assets/images/arrow-white.png" alt="">
</div>
<div class="cover" @click="toSet(5)">点击更换标题与描述</div>
<div class="cover" @click="toSet(5)">点击更换标题描述与链接</div>
</div>
</div>
@ -126,7 +126,7 @@ export default {
route: '/column'
},
{
name: '关于IASF-组织架构'
name: '科学研究'
}
])
},
@ -181,6 +181,36 @@ export default {
}
.program {
background: #fff;
.title {
position: relative;
display: flex;
justify-content: space-between;
align-items: flex-end;
padding-bottom: 25px;
margin-bottom: 30px;
border-bottom: 1px solid #ddd;
align-items: center;
h5 {
padding-left: 16px;
font-size: 1.6rem;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
line-height: 1;
border-left: 6px solid #2B96EF;
}
.sub {
font-size: 1.1rem;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #AFB7BF;
}
.more {
font-size: .8rem;
color: #666;
cursor: pointer;
}
}
.slide {
display: flex;
margin-bottom: 14px;
@ -217,11 +247,6 @@ export default {
height: 100%;
transition: .5s;
}
&:hover {
.pic {
transform: scale(1.3);
}
}
.list {
display: flex;
li {
@ -240,9 +265,6 @@ export default {
margin-right: 0;
background-image: url(../../../assets/images/sfel/9.png);
}
&:hover {
transform: translateY(20px);
}
}
.des {
height: 90px;
@ -261,6 +283,7 @@ export default {
}
}
.about {
position: relative;
padding: 10rem 0 3rem;
text-align: center;
background: url(../../../assets/images/about-bg.png) no-repeat center center;
@ -271,10 +294,6 @@ export default {
background: rgba(111, 69, 36, .56);
border-radius: 17px;
transition: .3s;
&:hover {
background: rgba(239, 126, 10, .56);
transform: translateY(10px);
}
}
.title {
margin-bottom: 1rem;

@ -197,6 +197,10 @@ export default {
path: `overview`,
component: () => import('@/pages/column/page/overview'),
},
{
path: `mission`,
component: () => import('@/pages/column/page/mission'),
},
{
path: `scientific`,
component: () => import('@/pages/column/page/scientific'),
@ -205,5 +209,9 @@ export default {
path: `industrial`,
component: () => import('@/pages/column/page/industrial'),
},
{
path: `researchTeam`,
component: () => import('@/pages/column/page/researchTeam'),
},
]
}

Loading…
Cancel
Save