页面设置:about

master
yujialong 2 years ago
parent 4140318af6
commit 82c56b36a6
  1. BIN
      src/assets/images/about/1.png
  2. BIN
      src/assets/images/about/10.png
  3. BIN
      src/assets/images/about/11.png
  4. BIN
      src/assets/images/about/12.png
  5. BIN
      src/assets/images/about/2.png
  6. BIN
      src/assets/images/about/3.png
  7. BIN
      src/assets/images/about/4.png
  8. BIN
      src/assets/images/about/5.png
  9. BIN
      src/assets/images/about/6.png
  10. BIN
      src/assets/images/about/7.png
  11. BIN
      src/assets/images/about/8.png
  12. BIN
      src/assets/images/about/9.png
  13. BIN
      src/assets/images/arrow-white.png
  14. 0
      src/assets/images/arrow.png
  15. BIN
      src/assets/images/page/about.png
  16. BIN
      src/assets/images/page/careers.png
  17. BIN
      src/assets/images/page/home.png
  18. 26
      src/components/modules/content.vue
  19. 42
      src/components/modules/link.vue
  20. 33
      src/components/modules/module.vue
  21. 18
      src/const/column.js
  22. 7
      src/mixins/app.js
  23. 92
      src/mixins/page/index.js
  24. 8
      src/mixins/setBackground/index.js
  25. 30
      src/pages/column/add/index.vue
  26. 6
      src/pages/column/list/index.vue
  27. 1142
      src/pages/column/page/about.vue
  28. 272
      src/pages/column/page/home.vue
  29. 58
      src/router/modules/column.js
  30. 29
      src/router/modules/page.js
  31. 157
      src/styles/page/page.scss

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 883 B

Before

Width:  |  Height:  |  Size: 804 B

After

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 KiB

@ -39,12 +39,13 @@
<el-button type="primary" @click="contentSubmit">确定</el-button> <el-button type="primary" @click="contentSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<Link ref="link" :diaVisible.sync="linkVisible" :data.sync="linkForm" @linkSubmit="linkSubmit" /> <Link ref="link" :visible.sync="linkVisible" :data.sync="linkForm" @linkSubmit="linkSubmit" />
</div> </div>
</template> </template>
<script> <script>
import Link from '@/components/modules/link' import Link from '@/components/modules/link'
import Util from '@/libs/util'
export default { export default {
props: ['data', 'visible'], props: ['data', 'visible'],
components: { components: {
@ -104,26 +105,23 @@ export default {
}, },
// //
linkSubmit() { linkSubmit() {
// return console.log(3, this.$refs.link.data)
const el = this.$refs.link const el = this.$refs.link
const { data, links, article, otherLink, otherArticle } = el const data = this.data.form ? this.data.form.link : this.data.list[this.curIndex].link
let linkEle = null const linkEle = data.connectionType === 1 ?
el.$refs.column :
data.connectionType === 3 ?
el.$refs.otherColumn :
null
if (data.connectionType !== 2) { if (data.connectionType !== 2) {
if (data.connectionType === 1) { if (data.connectionType === 1) {
linkEle = el.$refs.links if (!data.columnId.length) return Util.errorMsg('请选择站内链接')
if (!links.length) return util.errorMsg('请选择站内链接')
data.linkAddress = links.join()
if (article) data.linkAddress += '-' + article
} }
if (data.connectionType === 3) { if (data.connectionType === 3) {
linkEle = el.$refs.otherLink if (!data.otherColumnId.length) return Util.errorMsg('请选择栏目')
if (!otherLink.length) return util.errorMsg('请选择栏目')
data.linkAddress = otherLink.join()
if (otherArticle) data.linkAddress += '-' + otherArticle
} }
} }
data.linkName = data.connectionType === 1 ? linkEle.getCheckedNodes()[0].pathLabels.join('/') : data.linkAddress data.linkName = linkEle ? linkEle.getCheckedNodes()[0].pathLabels.join('/') : data.linkAddress
this.data.list[this.curIndex].link = data console.log("🚀 ~ file: module.vue ~ line 296 ~ linkSubmit ~ data", this.data)
this.linkVisible = false this.linkVisible = false
}, },
// //

@ -1,7 +1,7 @@
<template> <template>
<!-- 设置链接 --> <!-- 设置链接 -->
<div> <div>
<el-dialog title="设置链接地址" :visible.sync="diaVisible" width="500px" :close-on-click-modal="false"> <el-dialog title="设置链接地址" :visible.sync="visible" width="500px" :close-on-click-modal="false">
<el-form :model="data" class="model" label-width="120px"> <el-form :model="data" class="model" label-width="120px">
<el-form-item prop="connectionType" label="连接类型"> <el-form-item prop="connectionType" label="连接类型">
<el-radio-group v-model="data.connectionType"> <el-radio-group v-model="data.connectionType">
@ -14,15 +14,15 @@
<template v-if="data.connectionType === 1"> <template v-if="data.connectionType === 1">
<el-form-item label="站内链接"> <el-form-item label="站内链接">
<el-cascader <el-cascader
ref="links" ref="column"
v-model="links" v-model="data.columnId"
:options="columns" :options="columns"
:props="columnProps" :props="columnProps"
clearable clearable
@change="getArticle"></el-cascader> @change="columnChange"></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="文章"> <el-form-item label="文章">
<el-select v-model="article"> <el-select v-model="data.articleId">
<el-option <el-option
v-for="item in articles" v-for="item in articles"
:key="item.id" :key="item.id"
@ -52,15 +52,15 @@
</el-form-item> </el-form-item>
<el-form-item label="栏目"> <el-form-item label="栏目">
<el-cascader <el-cascader
ref="otherLink" ref="otherColumn"
v-model="otherLink" v-model="data.otherColumnId"
:options="columns" :options="columns"
:props="columnProps" :props="columnProps"
clearable clearable
@change="getArticle"></el-cascader> @change="columnChange"></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="文章"> <el-form-item label="文章">
<el-select v-model="otherArticle"> <el-select v-model="data.otherArticleId">
<el-option <el-option
v-for="item in articles" v-for="item in articles"
:key="item.id" :key="item.id"
@ -79,7 +79,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="$emit('update:diaVisible', false)">取消</el-button> <el-button @click="$emit('update:visible', false)">取消</el-button>
<el-button type="primary" @click="linkSubmit">确定</el-button> <el-button type="primary" @click="linkSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -92,7 +92,7 @@ export default {
data: { data: {
required: true required: true
}, },
diaVisible: { visible: {
type: Boolean, type: Boolean,
required: true required: true
} }
@ -108,12 +108,16 @@ export default {
value: 'id', value: 'id',
label: 'columnName' label: 'columnName'
}, },
links: [],
article: '',
otherLink: [],
otherArticle: '',
}; };
}, },
watch: {
visible(open) {
//
if (open) {
this.data.connectionType !== 2 && this.getArticle()
}
}
},
mounted() { mounted() {
this.getList() this.getList()
this.getSite() this.getSite()
@ -135,6 +139,7 @@ export default {
} else { } else {
this.loaded = true this.loaded = true
} }
this.data.connectionType !== 2 && this.getArticle()
}).catch(err => {}) }).catch(err => {})
}, },
// disabled // disabled
@ -144,10 +149,15 @@ export default {
e.children.length ? this.handleId(e.children) : delete e.children e.children.length ? this.handleId(e.children) : delete e.children
}) })
}, },
//
columnChange() {
this.data.articleId = ''
this.getArticle()
},
// //
getArticle() { getArticle() {
// / // /
const id = this.data.connectionType === 1 ? this.links[this.links.length - 1] : this.otherLink[this.otherLink.length - 1] const id = this.data.connectionType === 1 ? this.data.columnId[this.data.columnId.length - 1] : this.data.otherColumnId[this.data.otherColumnId.length - 1]
this.$post(this.api.queryArticle, { this.$post(this.api.queryArticle, {
siteId: this.site.id, siteId: this.site.id,
columnIds: [id], columnIds: [id],

@ -127,7 +127,7 @@
<el-button type="primary" @click="moduleSubmit">确定</el-button> <el-button type="primary" @click="moduleSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<Link ref="link" :diaVisible.sync="linkVisible" :data.sync="linkForm" @linkSubmit="linkSubmit" /> <Link ref="link" :data.sync="linkForm" :visible.sync="linkVisible" @linkSubmit="linkSubmit" />
<Content :data.sync="data" :visible.sync="contentVisible" @contentSubmit="contentSubmit" /> <Content :data.sync="data" :visible.sync="contentVisible" @contentSubmit="contentSubmit" />
</div> </div>
</template> </template>
@ -135,13 +135,16 @@
<script> <script>
import Link from '@/components/modules/link' import Link from '@/components/modules/link'
import Content from '@/components/modules/content' import Content from '@/components/modules/content'
import Editor from '@tinymce/tinymce-vue'
import Util from '@/libs/util'
import editorConfig from '@/components/editor' import editorConfig from '@/components/editor'
export default { export default {
name: 'module', name: 'module',
props: ['data', 'visible'], props: ['data', 'visible'],
components: { components: {
Link, Link,
Content Content,
Editor
}, },
data() { data() {
return { return {
@ -253,9 +256,9 @@ export default {
}, },
// //
toLink(row, i = 0) { toLink(row, i = 0) {
this.linkVisible = true
this.curIndex = i this.curIndex = i
this.linkForm = row.link this.linkForm = row.link
this.linkVisible = true
}, },
// //
editIntro(row, i = 0) { editIntro(row, i = 0) {
@ -272,30 +275,26 @@ export default {
} }
this.data.form = JSON.parse(JSON.stringify(this.data.originForm)) this.data.form = JSON.parse(JSON.stringify(this.data.originForm))
console.log("🚀 ~ file: module.vue ~ line 267 ~ contentSubmit ~ list", this.data) console.log("🚀 ~ file: module.vue ~ line 267 ~ contentSubmit ~ list", this.data)
}, },
// //
linkSubmit() { linkSubmit() {
// return console.log(3, this.$refs.link.data)
const el = this.$refs.link const el = this.$refs.link
const { data, links, article, otherLink, otherArticle } = el const data = this.data.form ? this.data.form.link : this.data.list[this.curIndex].link
let linkEle = null const linkEle = data.connectionType === 1 ?
el.$refs.column :
data.connectionType === 3 ?
el.$refs.otherColumn :
null
if (data.connectionType !== 2) { if (data.connectionType !== 2) {
if (data.connectionType === 1) { if (data.connectionType === 1) {
linkEle = el.$refs.links if (!data.columnId.length) return Util.errorMsg('请选择站内链接')
if (!links.length) return util.errorMsg('请选择站内链接')
data.linkAddress = links.join()
if (article) data.linkAddress += '-' + article
} }
if (data.connectionType === 3) { if (data.connectionType === 3) {
linkEle = el.$refs.otherLink if (!data.otherColumnId.length) return Util.errorMsg('请选择栏目')
if (!otherLink.length) return util.errorMsg('请选择栏目')
data.linkAddress = otherLink.join()
if (otherArticle) data.linkAddress += '-' + otherArticle
} }
} }
data.linkName = data.connectionType === 1 ? linkEle.getCheckedNodes()[0].pathLabels.join('/') : data.linkAddress data.linkName = linkEle ? linkEle.getCheckedNodes()[0].pathLabels.join('/') : data.linkAddress
this.data.list[this.curIndex].link = data console.log("🚀 ~ file: module.vue ~ line 296 ~ linkSubmit ~ data", this.data)
this.linkVisible = false this.linkVisible = false
}, },
// //

@ -63,4 +63,22 @@ export default {
name: '链接' name: '链接'
} }
], ],
// 长页样式
pageStyle: [
{
id: 1,
path: 'home',
name: 'HOME'
},
{
id: 2,
path: 'about',
name: 'ABOUT'
},
{
id: 3,
path: 'careers',
name: 'CAREERS'
}
],
} }

@ -2,10 +2,7 @@
* 通用混合 * 通用混合
* */ * */
export default { export default {
methods: { methods: {
// 当 $route 更新时触发
appRouteChange(to, from) {
} }
}
}; };

@ -0,0 +1,92 @@
import Module from '@/components/modules/module'
import Setting from '@/setting'
import Util from '@/libs/util'
export default {
data() {
return {
userId: +this.$store.state.user.userId,
site: this.$store.state.content.site,
id: '',
columnId: +this.$route.query.id,
diaVisible: false,
curModule: 0,
curData: {},
}
},
components: {
Module,
},
mounted() {
this.getInfo()
},
methods: {
// 获取详情
getInfo() {
this.modules.map(e => {
const { type } = e
// 克隆一个原始row,方便添加
if (type === 'banner' || type === 'introduce') {
const data = JSON.parse(JSON.stringify(e.list[0]))
data.pic = ''
e.originForm = data
}
})
// 查询页面详情
this.$post(`${this.api.findPage}?columnId=${this.columnId}`).then(({ data }) => {
if (data.length) {
const json = data[0]
this.id = json.id
this.modules = JSON.parse(json[json.state ? 'theEditedJson' : 'jsonBeforeEditing'])
}
}).catch(err => {})
},
// 展开模块设置
toSet(i) {
this.curModule = i
this.curData = JSON.parse(JSON.stringify(this.modules[i]))
this.diaVisible = true
},
// 模块设置提交
moduleSubmit() {
this.diaVisible = false
this.modules[this.curModule] = this.curData
console.log("🚀 ~ file: index.vue ~ line 520 ~ moduleSubmit ~ this.modules[this.curModule]", this.modules[this.curModule])
},
// 处理预览和保存的json
handleJson() {
// const list = JSON.parse(JSON.stringify(this.modules))
// list.map(e => {
// if (e.type === 'form') delete e.forms
// })
return JSON.stringify(this.modules)
},
// 预览
preview() {
this.$post(this.api.saveRedisPage, {
columnId: this.columnId,
json: this.handleJson()
}).then(({ data }) => {
}).catch(err => {})
},
// 保存
save(state) {
const json = this.handleJson()
const data = {
id: this.id,
columnId: this.columnId,
state,
sort: 1,
founderId: this.userId,
editorId: this.userId,
jsonBeforeEditing: json
}
if (state) data.theEditedJson = json
this.$post(this.api[this.id ? 'updatePage' : 'savePage'], data).then(res => {
Util.successMsg((state ? '发布' : '保存') + '成功')
this.$router.back()
}).catch(err => {})
}
}
};

@ -1,8 +0,0 @@
export default {
beforeCreate() {
document.querySelector("body").setAttribute("style", "background-color:#fff");
},
beforeDestroy() {
document.body.removeAttribute("style");
}
};

@ -186,32 +186,18 @@
<el-form-item prop="templateId" label="栏目模板"> <el-form-item prop="templateId" label="栏目模板">
<el-select v-model="form.templateId"> <el-select v-model="form.templateId">
<el-option <el-option
v-for="item in templates" label="长页模板"
:key="item.id" :value="1">
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="listStyleId" label="列表样式"> <el-form-item prop="listStyleId" label="列表样式">
<ul class="styles"> <ul class="styles">
<li> <li v-for="(item, i) in pageStyle" :key="i">
<div class="review">
<img src="@/assets/images/list1.png" alt="">
</div>
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio>
</li>
<li>
<div class="review"> <div class="review">
<img src="@/assets/images/list2.png" alt=""> <img :src="require('@/assets/images/page/' + item.path + '.png')" alt="">
</div> </div>
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio> <el-radio v-model="form.listStyleId" :label="item.id">{{ item.name }}</el-radio>
</li>
<li>
<div class="review">
<img src="@/assets/images/list2.png" alt="">
</div>
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio>
</li> </li>
</ul> </ul>
</el-form-item> </el-form-item>
@ -256,6 +242,7 @@ export default {
detailStyle: ColumnConst.detailStyle, detailStyle: ColumnConst.detailStyle,
types: ColumnConst.types, types: ColumnConst.types,
templates: ColumnConst.templates, templates: ColumnConst.templates,
pageStyle: ColumnConst.pageStyle,
sites: [], sites: [],
columns: [], columns: [],
articles: [], articles: [],
@ -579,7 +566,7 @@ export default {
} }
} }
// //
this.$post(this.api.updateFile, { this.fileId && this.$post(this.api.updateFile, {
id: this.fileId, id: this.fileId,
isRelease: 1, isRelease: 1,
quote: this.form.columnName quote: this.form.columnName
@ -693,6 +680,9 @@ $upload-lg-height: 102px;
margin-bottom: 10px; margin-bottom: 10px;
border: 1px solid #DCDEE0; border: 1px solid #DCDEE0;
border-radius: 2px; border-radius: 2px;
img {
width: 50px;
}
} }
} }
/deep/.input-form .auto .el-input { /deep/.input-form .auto .el-input {

@ -275,11 +275,13 @@ export default {
}, },
// //
preview(row) { preview(row) {
window.open(`http://192.168.31.${Setting.isDev ? 126 : 136}:8095/#/channel?id=` + row.id) const item = ColumnConst.pageStyle.find(e => e.id == row.listStyleId)
window.open(`http://192.168.31.${Setting.isDev ? 126 : 136}:8095/#/${item ? item.path : 'home'}?id=${row.id}`)
}, },
// //
page(row) { page(row) {
this.$router.push(`page?id=${row.id}`) const item = ColumnConst.pageStyle.find(e => e.id == row.listStyleId)
this.$router.push(`${item ? item.path : 'home'}?id=${row.id}`)
}, },
// //
batchDel() { batchDel() {

File diff suppressed because it is too large Load Diff

@ -31,7 +31,7 @@
<div class="texts"> <div class="texts">
<h6>{{ modules[2].form.title || 'Shenzhen Innovation Lightsource Facility ' }}</h6> <h6>{{ modules[2].form.title || 'Shenzhen Innovation Lightsource Facility ' }}</h6>
<p class="des">{{ modules[2].form.des || 'The Shenzhen synchrotron radiation facility has a fourth-generation diffraction-limited storage ring with an electron energy of 3 GeV at a low emittance of 50-150 pm·rad, and it provides photons with broad range energy from 4 meV to 160 keV.' }}</p> <p class="des">{{ modules[2].form.des || 'The Shenzhen synchrotron radiation facility has a fourth-generation diffraction-limited storage ring with an electron energy of 3 GeV at a low emittance of 50-150 pm·rad, and it provides photons with broad range energy from 4 meV to 160 keV.' }}</p>
<img class="arrow" src="@/assets/images/channel/arrow.png" alt=""> <img class="arrow" src="@/assets/images/arrow.png" alt="">
</div> </div>
<div class="cover" @click="toSet(2)">点击更改图片标题概述与链接</div> <div class="cover" @click="toSet(2)">点击更改图片标题概述与链接</div>
</li> </li>
@ -40,7 +40,7 @@
<div class="texts"> <div class="texts">
<h6>{{ modules[3].form.title || 'Shenzhen Innovation Lightsource Facility ' }}</h6> <h6>{{ modules[3].form.title || 'Shenzhen Innovation Lightsource Facility ' }}</h6>
<p class="des">{{ modules[3].form.des || 'The Shenzhen synchrotron radiation facility has a fourth-generation diffraction-limited storage ring with an electron energy of 3 GeV at a low emittance of 50-150 pm·rad, and it provides photons with broad range energy from 4 meV to 160 keV.' }}</p> <p class="des">{{ modules[3].form.des || 'The Shenzhen synchrotron radiation facility has a fourth-generation diffraction-limited storage ring with an electron energy of 3 GeV at a low emittance of 50-150 pm·rad, and it provides photons with broad range energy from 4 meV to 160 keV.' }}</p>
<img class="arrow" src="@/assets/images/channel/arrow.png" alt=""> <img class="arrow" src="@/assets/images/arrow.png" alt="">
</div> </div>
<div class="cover" @click="toSet(3)">点击更改图片标题概述与链接</div> <div class="cover" @click="toSet(3)">点击更改图片标题概述与链接</div>
</li> </li>
@ -122,7 +122,7 @@
<div class="texts"> <div class="texts">
<h6>{{ item.title || 'Shenzhen Innovation Lightsource Facility ' }}</h6> <h6>{{ item.title || 'Shenzhen Innovation Lightsource Facility ' }}</h6>
<p class="des">{{ item.des || 'The Shenzhen synchrotron radiation facility has a fourth-generation diffraction-limited storage ring with an electron energy of 3 GeV at a low emittance of 50-150 pm·rad, and it provides photons with broad range energy from 4 meV to 160 keV.' }}</p> <p class="des">{{ item.des || 'The Shenzhen synchrotron radiation facility has a fourth-generation diffraction-limited storage ring with an electron energy of 3 GeV at a low emittance of 50-150 pm·rad, and it provides photons with broad range energy from 4 meV to 160 keV.' }}</p>
<img class="arrow" src="@/assets/images/channel/arrow.png" alt=""> <img class="arrow" src="@/assets/images/arrow.png" alt="">
</div> </div>
</li> </li>
<div class="cover" @click="toSet(7)">点击更改图片标题概述与链接</div> <div class="cover" @click="toSet(7)">点击更改图片标题概述与链接</div>
@ -186,16 +186,11 @@
</template> </template>
<script> <script>
import Setting from '@/setting' import mixins from '@/mixins/page'
import Util from '@/libs/util'
import Module from '@/components/modules/module'
export default { export default {
mixins: [mixins],
data() { data() {
return { return {
userId: +this.$store.state.user.userId,
site: this.$store.state.content.site,
id: '',
columnId: +this.$route.query.id,
modules: [ modules: [
{ {
type: 'banner', type: 'banner',
@ -205,7 +200,12 @@ export default {
link: { link: {
linkName: '无', linkName: '无',
connectionType: 1, connectionType: 1,
columnId: [],
articleId: '',
linkAddress : '', linkAddress : '',
siteSelection: '',
otherColumnId: [],
otherArticleId: '',
isOpen: 1 isOpen: 1
}, },
isEnable: 1 isEnable: 1
@ -264,7 +264,13 @@ export default {
link: { link: {
linkName: '无', linkName: '无',
connectionType: 1, connectionType: 1,
columnId: [],
articleId: '',
linkAddress : '', linkAddress : '',
siteSelection: '',
otherColumnId: [],
otherArticleId: '',
isOpen: 1
}, },
des: '' des: ''
} }
@ -301,7 +307,13 @@ export default {
link: { link: {
linkName: '无', linkName: '无',
connectionType: 1, connectionType: 1,
columnId: [],
articleId: '',
linkAddress : '', linkAddress : '',
siteSelection: '',
otherColumnId: [],
otherArticleId: '',
isOpen: 1
}, },
des: '' des: ''
} }
@ -394,7 +406,13 @@ export default {
link: { link: {
linkName: '无', linkName: '无',
connectionType: 1, connectionType: 1,
columnId: [],
articleId: '',
linkAddress : '', linkAddress : '',
siteSelection: '',
otherColumnId: [],
otherArticleId: '',
isOpen: 1
}, },
des: '' des: ''
}, },
@ -406,7 +424,12 @@ export default {
link: { link: {
linkName: '无', linkName: '无',
connectionType: 1, connectionType: 1,
columnId: [],
articleId: '',
linkAddress : '', linkAddress : '',
siteSelection: '',
otherColumnId: [],
otherArticleId: '',
isOpen: 1 isOpen: 1
}, },
isEnable: 1 isEnable: 1
@ -439,7 +462,13 @@ export default {
link: { link: {
linkName: '无', linkName: '无',
connectionType: 1, connectionType: 1,
columnId: [],
articleId: '',
linkAddress : '', linkAddress : '',
siteSelection: '',
otherColumnId: [],
otherArticleId: '',
isOpen: 1
}, },
des: '' des: ''
} }
@ -585,124 +614,20 @@ export default {
} }
}, },
], ],
diaVisible: false,
curModule: 0,
curData: {},
edited: false
} }
}, },
components: {
Module,
},
mounted() { mounted() {
this.getInfo()
}, },
methods: { methods: {
//
getInfo() {
this.modules.map(e => {
const { type } = e
// row便
if (type === 'banner' || type === 'introduce') {
const data = JSON.parse(JSON.stringify(e.list[0]))
data.pic = ''
e.originForm = data
}
})
this.$post(`${this.api.findPage}?columnId=${this.columnId}`).then(({ data }) => {
if (data.length) {
this.id = data[0].id
this.edited = true
}
}).catch(err => {})
},
//
toSet(i) {
this.curModule = i
this.curData = JSON.parse(JSON.stringify(this.modules[i]))
this.diaVisible = true
},
//
moduleSubmit() {
this.diaVisible = false
this.modules[this.curModule] = this.curData
console.log("🚀 ~ file: index.vue ~ line 520 ~ moduleSubmit ~ this.modules[this.curModule]", this.modules[this.curModule])
},
// json
handleJson() {
const list = JSON.parse(JSON.stringify(this.modules))
list.map(e => {
if (e.type === 'form') delete e.forms
})
return JSON.stringify(list)
},
//
preview() {
this.$post(this.api.saveRedisPage, {
columnId: this.columnId,
json: this.handleJson()
}).then(({ data }) => {
}).catch(err => {})
},
//
save(state) {
const json = this.handleJson()
const data = {
id: this.id,
columnId: this.columnId,
state,
sort: 1,
founderId: this.userId,
editorId: this.userId,
jsonBeforeEditing: json
}
debugger
if (state) data.theEditedJson = json
this.$post(this.api[this.edited ? 'updatePage' : 'savePage'], data).then(({ data }) => {
}).catch(err => {})
}
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.actions { @import "../../../styles/page/page.scss";
margin-bottom: 20px;
text-align: right;
}
.c-wrap {
position: relative;
}
.block { .block {
padding: 118px 0;
.b-title {
position: relative;
margin-bottom: 50px;
font-size: 50px;
line-height: 59px;
text-align: center;
color: #1F1F1F;
&:after {
content: '';
position: absolute;
top: 70px;
left: 50%;
width: 136px;
height: 4px;
transform: translateX(-50%);
background: #1583FF;
}
}
.intro {
margin-bottom: 80px;
font-size: 30px;
text-align: center;
color: #5B5B5E;
line-height: 40px;
}
.card { .card {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -825,10 +750,6 @@ export default {
} }
} }
} }
.inner {
width: 1400px;
margin: 0 auto;
}
.about { .about {
position: relative; position: relative;
padding: 77px 0 198px; padding: 77px 0 198px;
@ -861,115 +782,4 @@ export default {
border-radius: 17px; border-radius: 17px;
} }
} }
.cover {
z-index: 2;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
background-color: rgba(0, 0, 0, .5);
cursor: pointer;
&:hover {
background-color: rgba(0, 0, 0, .7);
}
}
/deep/.module {
.el-table.module-table td {
.cell {
padding-top: 10px;
}
.link-wrap {
display: flex;
justify-content: space-between;
align-items: center;
}
.set-link {
margin-left: 10px;
}
.del {
margin-left: 5px;
font-size: 18px;
color: #333;
cursor: pointer;
}
}
.plus {
margin-top: 10px;
font-size: 20px;
text-align: center;
color: $main-color;
cursor: pointer;
}
}
$avatar-width: 140px;
$avatar-height: 80px;
/deep/.upload-pic, /deep/.upload-none {
width: $avatar-width;
height: $avatar-height;
margin-bottom: 10px;
}
/deep/.upload-none {
display: flex;
justify-content: center;
align-items: center;
background-color: rgba(0, 0, 0, 0.04);
i {
font-size: 20px;
color: #8c939d;
}
}
/deep/ .uploader {
.el-upload {
position: relative;
width: $avatar-width;
border: 1px dashed #d9d9d9;
border-radius: 2px;
cursor: pointer;
overflow: hidden;
&:hover {
border-color: #409EFF;
}
.uploader-default {
display: flex;
flex-direction: column;
justify-content: center;
width: $avatar-width !important;
height: $avatar-height;
text-align: center;
background: rgba(0, 0, 0, 0.04);
i {
font-size: 20px;
font-weight: bold;
color: #8c939d;
}
p {
margin-top: 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 1;
}
}
.avatar {
display: block;
width: $avatar-width;
height: $avatar-height;
}
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 1;
&:first-child {
margin-bottom: 5px;
}
}
}
}
</style> </style>

@ -5,31 +5,37 @@ const meta = {}
const pre = 'column-' const pre = 'column-'
export default { export default {
path: '/column', path: '/column',
name: 'column', name: 'column',
redirect: { redirect: {
name: `${pre}list` name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/column/list'),
meta: { title: '栏目管理' }
}, },
meta, {
component: BasicLayout, name: `${pre}add`,
children: [ path: `add`,
{ component: () => import('@/pages/column/add'),
name: `${pre}list`, meta: { title: '添加栏目' }
path: `list`, },
component: () => import('@/pages/column/list'), {
meta: { title: '栏目管理' } name: `${pre}home`,
}, path: `home`,
{ component: () => import('@/pages/column/page/home'),
name: `${pre}add`, meta: { title: 'HOME' }
path: `add`, },
component: () => import('@/pages/column/add/index.vue'), {
meta: { title: '添加栏目' } name: `${pre}about`,
}, path: `about`,
{ component: () => import('@/pages/column/page/about'),
name: `${pre}page`, meta: { title: 'ABOUT' }
path: `page`, }
component: () => import('@/pages/column/page/index.vue'), ]
meta: { title: '页面管理' }
}
]
} }

@ -1,29 +0,0 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'page-'
export default {
path: '/page',
name: 'page',
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/page/list'),
meta: { title: '页面管理' }
},
{
name: `${pre}add`,
path: `add`,
component: () => import('@/pages/page/add/index.vue'),
meta: { title: '添加页面' }
}
]
}

@ -0,0 +1,157 @@
.block {
padding: 118px 0;
.b-title {
position: relative;
margin-bottom: 50px;
font-size: 50px;
line-height: 59px;
text-align: center;
color: #1F1F1F;
&:after {
content: '';
position: absolute;
top: 70px;
left: 50%;
width: 136px;
height: 4px;
transform: translateX(-50%);
background: #1583FF;
}
}
.intro {
margin-bottom: 80px;
font-size: 30px;
text-align: center;
color: #5B5B5E;
line-height: 40px;
}
}
.inner {
width: 1400px;
margin: 0 auto;
&.lg {
width: 1505px;
}
}
.gray {
background-color: #F2F6F8;
}
.actions {
margin-bottom: 20px;
text-align: right;
}
.c-wrap {
position: relative;
}
.cover {
z-index: 2;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
background-color: rgba(0, 0, 0, .5);
cursor: pointer;
&:hover {
background-color: rgba(0, 0, 0, .7);
}
}
/deep/.module {
.el-table.module-table td {
.cell {
padding-top: 10px;
}
.link-wrap {
display: flex;
justify-content: space-between;
align-items: center;
}
.set-link {
margin-left: 10px;
}
.del {
margin-left: 5px;
font-size: 18px;
color: #333;
cursor: pointer;
}
}
.plus {
margin-top: 10px;
font-size: 20px;
text-align: center;
color: $main-color;
cursor: pointer;
}
}
$avatar-width: 140px;
$avatar-height: 80px;
/deep/.upload-pic, /deep/.upload-none {
width: $avatar-width;
height: $avatar-height;
margin-bottom: 10px;
}
/deep/.upload-none {
display: flex;
justify-content: center;
align-items: center;
background-color: rgba(0, 0, 0, 0.04);
i {
font-size: 20px;
color: #8c939d;
}
}
/deep/ .uploader {
.el-upload {
position: relative;
width: $avatar-width;
border: 1px dashed #d9d9d9;
border-radius: 2px;
cursor: pointer;
overflow: hidden;
&:hover {
border-color: #409EFF;
}
.uploader-default {
display: flex;
flex-direction: column;
justify-content: center;
width: $avatar-width !important;
height: $avatar-height;
text-align: center;
background: rgba(0, 0, 0, 0.04);
i {
font-size: 20px;
font-weight: bold;
color: #8c939d;
}
p {
margin-top: 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 1;
}
}
.avatar {
display: block;
width: $avatar-width;
height: $avatar-height;
}
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 1;
&:first-child {
margin-bottom: 5px;
}
}
}
}
Loading…
Cancel
Save