yujialong 5 months ago
parent ccc30e06ad
commit 831b4a1cd8
  1. 2
      src/api/index.js
  2. BIN
      src/assets/images/page/shop.png
  3. 59
      src/components/modules/content.vue
  4. 10
      src/components/modules/module.vue
  5. 164
      src/const/modules.js
  6. 2
      src/layouts/header/index.vue
  7. 4
      src/layouts/navbar/index.vue
  8. 73
      src/pages/article/add/product.vue
  9. 4
      src/pages/article/list/index.vue
  10. 50
      src/pages/column/page/aboutUs.vue
  11. 139
      src/pages/column/page/application.vue
  12. 40
      src/pages/column/page/index.vue
  13. 131
      src/pages/column/page/shop.vue
  14. 2
      src/pages/floatingFrame/index.vue
  15. 2
      src/pages/footer/index.vue
  16. 105
      src/pages/logo/index.vue
  17. 4
      src/pages/seo/index.vue
  18. 30
      src/plugins/requests/index.js
  19. 5
      src/router/modules/column.js
  20. 16
      src/router/modules/logo.js
  21. 5
      src/setting.js

@ -91,6 +91,8 @@ export default {
delSeo: `/iasf/seo/delete`, delSeo: `/iasf/seo/delete`,
seoList: `/iasf/seo/list`, seoList: `/iasf/seo/list`,
updateSeo: `/iasf/seo/update`, updateSeo: `/iasf/seo/update`,
saveLogo: `/iasf/LogoService/Logo/saveOrUpdate`,
findLogo: `/iasf/LogoService/Logo/findById`,
batchDeletionFloating: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/batchDeletion`, batchDeletionFloating: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/batchDeletion`,
findFloating: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/findById`, findFloating: `/iasf/SysFloatingColumnSchemeService/SysFloatingColumnScheme/findById`,

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 KiB

@ -12,7 +12,7 @@
<Editor v-if="item.type === 'editor'" api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' <Editor v-if="item.type === 'editor'" api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'
v-model="data.form[item.prop]" :init="editorConfig" /> v-model="data.form[item.prop]" :init="editorConfig" />
<el-upload v-if="item.type === 'upload' && item.width" class="uploader" accept=".jpg,.png,.jpeg,.gif" <el-upload v-if="item.type === 'upload' && item.width" class="uploader" accept=".jpg,.png,.jpeg,.gif"
:on-change="res => changeFile(res, data.form)" :show-file-list="false" :action="api.upload" :on-change="res => changeFile(res, data.form, item)" :show-file-list="false" :action="api.upload"
:auto-upload="false"> :auto-upload="false">
<img v-if="data.form[item.prop]" :src="data.form[item.prop]" class="avatar"> <img v-if="data.form[item.prop]" :src="data.form[item.prop]" class="avatar">
<div class="uploader-default" v-else> <div class="uploader-default" v-else>
@ -35,6 +35,17 @@
<p>只支持.jpg,.png格式</p> <p>只支持.jpg,.png格式</p>
</div> </div>
</el-upload> </el-upload>
<!-- 图片视频都可上传 -->
<template v-if="item.type === 'media'">
<el-upload :on-success="res => uploadSuccess(res, data.form, item)" :before-remove="beforeRemove"
:on-remove="(file, fileList) => handleRemove(file, fileList, data.form, item.prop)" :file-list="fileList"
:headers="headers" :action="api.upload">
<el-button>上传资源</el-button>
</el-upload>
<i v-if="!item.required" class="el-icon-delete del" @click="data.form[item.prop] = ''"></i>
</template>
<template v-if="item.type === 'pic'"> <template v-if="item.type === 'pic'">
<img v-if="data.form[item.prop]" :src="data.form[item.prop]" class="avatar"> <img v-if="data.form[item.prop]" :src="data.form[item.prop]" class="avatar">
<div class="uploader-default" v-else> <div class="uploader-default" v-else>
@ -92,10 +103,12 @@ export default {
isUpload: false, isUpload: false,
file: {}, // file: {}, //
curForm: {}, curForm: {},
curItem: {},
fixed: false, fixed: false,
fixedNumber: [0.88, 1], fixedNumber: [0.88, 1],
autoCropWidth: 480, autoCropWidth: 480,
autoCropHeight: 124, autoCropHeight: 124,
fileList: [],
}; };
}, },
watch: { watch: {
@ -110,16 +123,28 @@ export default {
methods: { methods: {
// form // form
handleForm () { handleForm () {
const { forms, type } = this.data const { forms, form, type } = this.data
this.fixed = false this.fixed = false
// //
if (forms) { if (forms) {
forms.map(e => { forms.map(e => {
if (e.type === 'upload' && e.width) { if (e.type === 'upload') {
if (e.width) {
this.autoCropWidth = e.width this.autoCropWidth = e.width
this.autoCropHeight = e.height this.autoCropHeight = e.height
this.fixed = true this.fixed = true
this.fixedNumber = [e.width / e.height, 1] this.fixedNumber = [e.width / e.height, 1]
} else {
this.fixed = false
}
}
if (e.type === 'media' && form.fileName) {
this.fileList = [
{
name: form.fileName,
url: form.video || e.pic
}
]
} }
if (e.required) { if (e.required) {
this.rules[e.prop] = [ this.rules[e.prop] = [
@ -161,14 +186,14 @@ export default {
}, 1000); }, 1000);
return false return false
} }
this.$set(this.curForm, 'pic', data.url) this.$set(this.curForm, this.curItem.prop, data.url)
}).catch(res => { }) }).catch(res => { })
this.$refs.cropper.isDisabled = false this.$refs.cropper.isDisabled = false
this.isUpload = false this.isUpload = false
this.cropperModel = false this.cropperModel = false
}, },
// //
changeFile (file, form) { changeFile (file, form, item) {
const { size, name } = file const { size, name } = file
const ext = name.substring(name.lastIndexOf('.') + 1) const ext = name.substring(name.lastIndexOf('.') + 1)
if (!Util.isImg(ext)) { if (!Util.isImg(ext)) {
@ -181,6 +206,7 @@ export default {
} }
this.file = file this.file = file
this.curForm = form this.curForm = form
this.curItem = item
this.cropperModel = true this.cropperModel = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.cropper.updateImg({ this.$refs.cropper.updateImg({
@ -189,9 +215,28 @@ export default {
}) })
}) })
}, },
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove (file, fileList, form, prop) {
form[prop] = ''
form.fileName = ''
},
// //
uploadSuccess (res, row) { uploadSuccess (res, row, item) {
this.$set(row, 'pic', res.url) console.log("🚀 ~ file: content.vue:270 ~ uploadSuccess ~ item:", res, row, item)
this.$set(row, item.prop, res.url)
if (item.type === 'media') {
this.fileList = [
{
name: res.original,
url: res.url
}
]
}
this.$set(row, 'mediaType', res.original.substr(res.original.lastIndexOf('.') + 1))
this.$set(row, 'fileName', res.original)
// console.log("🚀 ~ file: content.vue:273 ~ uploadSuccess ~ row:", row)
}, },
// //
toLink (row, i = 0) { toLink (row, i = 0) {

@ -17,13 +17,13 @@
</div> </div>
<template v-else-if="item.type === 'upload'"> <template v-else-if="item.type === 'upload'">
<img v-if="scope.row.pic" :src="scope.row.pic" class="upload-pic"> <img v-if="scope.row[item.prop]" :src="scope.row[item.prop]" class="upload-pic">
<div class="upload-none" v-else> <div class="upload-none" v-else>
<i class="el-icon-picture-outline"></i> <i class="el-icon-picture-outline"></i>
</div> </div>
</template> </template>
<div v-else-if="item.type === 'editor'" v-html="scope.row[item.prop]"></div> <div v-else-if="item.type === 'editor'" v-html="scope.row[item.prop]"></div>
<p v-else>{{ scope.row[item.prop] }}</p> <div v-else v-html="scope.row[item.prop]"></div>
</template> </template>
</el-table-column> </el-table-column>
@ -64,7 +64,7 @@
<p>上传图片</p> <p>上传图片</p>
</div> </div>
<div slot="tip" class="el-upload__tip"> <div slot="tip" class="el-upload__tip">
<p>只支持.jpg,.png格式</p> <p>只支持.jpg,.png,.mp4格式</p>
</div> </div>
</el-upload> </el-upload>
<el-upload v-if="item.type === 'video'" accept=".mp4,.mov,.avi" <el-upload v-if="item.type === 'video'" accept=".mp4,.mov,.avi"
@ -192,6 +192,7 @@ export default {
}, },
isVideo: Util.isVideo, isVideo: Util.isVideo,
dialogWidth: '800px', dialogWidth: '800px',
labelWidth: '70px',
rules: {}, rules: {},
linkVisible: false, linkVisible: false,
linkForm: {}, linkForm: {},
@ -263,7 +264,7 @@ export default {
]), ]),
// form // form
handleForm () { handleForm () {
const { type, forms, form, dialogWidth } = this.data const { type, forms, form, dialogWidth, labelWidth } = this.data
if (!this.data.labelWidth) this.data.labelWidth = '70px' if (!this.data.labelWidth) this.data.labelWidth = '70px'
this.fixed = false this.fixed = false
if (type === 'form' || type === 'forms') { if (type === 'form' || type === 'forms') {
@ -311,6 +312,7 @@ export default {
} }
form && form.site && this.siteChange(form.site) form && form.site && this.siteChange(form.site)
this.dialogWidth = dialogWidth || '1000px' this.dialogWidth = dialogWidth || '1000px'
if (labelWidth) this.labelWidth = labelWidth
}, },
// //
siteChange (siteId) { siteChange (siteId) {

@ -167,6 +167,170 @@ export default {
dialogWidth: '1200px', dialogWidth: '1200px',
}, },
], ],
shop: [
{
type: 'introduce',
forms: [
{
type: 'upload',
prop: 'pic',
label: '图片',
required: true,
crop: false
},
{
type: 'input',
prop: 'title',
label: '标题',
required: true
},
{
type: 'link',
prop: 'link',
label: '链接'
},
{
type: 'textarea',
prop: 'des',
label: '描述'
}
],
form: {
pic: '',
title: '',
link: {
linkName: '无',
connectionType: 1,
columnId: [],
articleId: '',
linkAddress: '',
site: '',
otherColumnId: [],
otherArticleId: '',
isOpen: 1
},
des: '',
isEnable: 1
},
list: [
{
pic: 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20230904/png/1698579017697353728.png',
title: '最全,最新的实验教学产品中心',
link: {
linkName: '无',
connectionType: 1,
columnId: [],
articleId: '',
linkAddress: '',
site: '',
otherColumnId: [],
otherArticleId: '',
isOpen: 1
},
des: '稳定高效的在线实验教学与学习系统',
isEnable: 1
}
]
},
{
type: 'introduce',
forms: [
{
type: 'upload',
prop: 'pic',
label: '图片',
required: true,
},
{
type: 'input',
prop: 'title',
label: '标题',
required: true
},
{
type: 'link',
prop: 'link',
label: '链接'
},
{
type: 'textarea',
prop: 'des',
label: '描述'
}
],
form: {
pic: '',
title: '',
link: {
linkName: '无',
connectionType: 1,
columnId: [],
articleId: '',
linkAddress: '',
site: '',
otherColumnId: [],
otherArticleId: '',
isOpen: 1
},
des: '',
isEnable: 1
},
list: [
{
pic: 'https://occupationlab.com/images/index/1.png',
title: '职站',
link: {
linkName: '无',
connectionType: 1,
columnId: [],
articleId: '',
linkAddress: '',
site: '',
otherColumnId: [],
otherArticleId: '',
isOpen: 1
},
des: '教、学、练、考实验教学平台',
isEnable: 1
},
{
pic: 'https://occupationlab.com/images/index/2.png',
title: 'Dataforward数据前瞻',
link: {
linkName: '无',
connectionType: 1,
columnId: [],
articleId: '',
linkAddress: '',
site: '',
otherColumnId: [],
otherArticleId: '',
isOpen: 1
},
des: '准确海量的数据平台',
isEnable: 1
},
{
pic: 'https://occupationlab.com/images/index/3.png',
title: '大赛平台',
link: {
linkName: '无',
connectionType: 1,
columnId: [],
articleId: '',
linkAddress: '',
site: '',
otherColumnId: [],
otherArticleId: '',
isOpen: 1
},
des: '技能实践的大赛平台',
isEnable: 1
},
],
dialogWidth: '1200px',
},
],
member: [ member: [
{ {
type: 'introduce', type: 'introduce',

@ -44,7 +44,7 @@ export default {
sites: [], sites: [],
crumbRefresh: true, crumbRefresh: true,
inContent: false, // inContent: false, //
sitePath: ['/page', '/column', '/article', '/seo', '/floatingFrame'] sitePath: ['/page', '/column', '/article', '/seo', '/floatingFrame', '/footer', '/logo']
}; };
}, },
components: { components: {

@ -159,6 +159,10 @@ export default {
{ {
index: '/footer', index: '/footer',
title: '页脚设置' title: '页脚设置'
},
{
index: '/logo',
title: '网站logo设置'
} }
] ]
} }

@ -28,8 +28,8 @@
</el-form-item> </el-form-item>
<div class="item-line"> <div class="item-line">
<el-form-item label="类"> <el-form-item label="类">
<el-select style="width: 234px;" v-model="getModelData" clearable> <el-select style="width: 234px;" v-model="classification" clearable>
<template v-for="item in classifications"> <template v-for="item in classifications">
<el-option v-if="item.categoryId" :key="item.categoryId" :label="item.name" :value="item.categoryId"> <el-option v-if="item.categoryId" :key="item.categoryId" :label="item.name" :value="item.categoryId">
</el-option> </el-option>
@ -37,7 +37,7 @@
</el-select> </el-select>
<el-button class="set-btn" type="primary" @click="setClass">设置</el-button> <el-button class="set-btn" type="primary" @click="setClass">设置</el-button>
</el-form-item> </el-form-item>
<el-form-item prop="author" label="类"> <el-form-item prop="author" label="标签/分类">
<el-select style="width: 234px;" v-model="form.categoryId" multiple> <el-select style="width: 234px;" v-model="form.categoryId" multiple>
<template v-for="item in categories"> <template v-for="item in categories">
<el-option v-if="item.categoryId" :key="item.categoryId" :label="item.name" :value="item.categoryId"> <el-option v-if="item.categoryId" :key="item.categoryId" :label="item.name" :value="item.categoryId">
@ -47,6 +47,12 @@
<el-button class="set-btn" type="primary" @click="setLabel">设置</el-button> <el-button class="set-btn" type="primary" @click="setLabel">设置</el-button>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item label="是否免费" prop="courseType">
<el-radio-group v-model="form.courseType">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="subjectSpecialtyList" label="适用学科专业"> <el-form-item prop="subjectSpecialtyList" label="适用学科专业">
<div class="subject-wrap"> <div class="subject-wrap">
<div class="subject"> <div class="subject">
@ -110,14 +116,14 @@
<el-form-item label="来源" prop="source" style="margin-right: 40px;"> <el-form-item label="来源" prop="source" style="margin-right: 40px;">
<el-input placeholder="请输入来源" v-model="form.source" maxlength="50"></el-input> <el-input placeholder="请输入来源" v-model="form.source" maxlength="50"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="按钮跳转链接"> <el-form-item v-if="form.articleTemplate === 79" label="按钮跳转链接">
<el-input class="m-r-10" style="width: 150px;" placeholder="请设置按钮名称" v-model="form.jumpButtonName" <el-input class="m-r-10" style="width: 150px;" placeholder="请设置按钮名称" v-model="form.jumpButtonName"
maxlength="10"></el-input> maxlength="10"></el-input>
<el-input placeholder="请设置跳转链接" v-model="form.jumpLinkUrl"></el-input> <el-input placeholder="请设置跳转链接" v-model="form.jumpLinkUrl"></el-input>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item label="简介" prop="introduction"> <el-form-item label="简介" prop="introduction">
<el-input style="width: 940px;" v-model="form.introduction" type="textarea" maxlength="200"></el-input> <el-input style="width: 940px;" v-model="form.introduction" type="textarea" rows="5" maxlength="500"></el-input>
</el-form-item> </el-form-item>
<!-- 模板选择了链接才显示这块 --> <!-- 模板选择了链接才显示这块 -->
@ -185,16 +191,16 @@
@upload="customUpload" /> @upload="customUpload" />
</el-dialog> </el-dialog>
<el-dialog title="类设置" :visible.sync="classVisible" width="500px" :close-on-click-modal="false" class="manage-dia" <el-dialog title="类设置" :visible.sync="classVisible" width="500px" :close-on-click-modal="false" class="manage-dia"
:before-close="closeClass"> :before-close="closeClass">
<div class="plus"> <div class="plus">
<i class="el-icon-circle-plus-outline" @click="addClass"></i> <i class="el-icon-circle-plus-outline" @click="addClass"></i>
</div> </div>
<el-table :data="classifications" ref="table" header-align="center" row-key="id" :max-height="400"> <el-table :data="classifications" ref="table" header-align="center" row-key="categoryId" :max-height="400">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="name" label="类名称" align="center" min-width="130"> <el-table-column prop="name" label="类名称" align="center" min-width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="scope.row.edit" placeholder="请输入类名称" v-model="scope.row.name" clearable <el-input v-if="scope.row.edit" placeholder="请输入类名称" v-model="scope.row.name" clearable autofocus
maxlength="30"></el-input> maxlength="30"></el-input>
<span v-else>{{ scope.row.name }}</span> <span v-else>{{ scope.row.name }}</span>
</template> </template>
@ -212,16 +218,16 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="类设置" :visible.sync="labelVisible" width="500px" :close-on-click-modal="false" class="manage-dia" <el-dialog title="标签/分类设置" :visible.sync="labelVisible" width="500px" :close-on-click-modal="false"
:before-close="closeLabel"> class="manage-dia" :before-close="closeLabel">
<div class="plus"> <div class="plus">
<i class="el-icon-circle-plus-outline" @click="addLabel"></i> <i class="el-icon-circle-plus-outline" @click="addLabel"></i>
</div> </div>
<el-table :data="categories" ref="table" header-align="center" row-key="id" :max-height="400"> <el-table :data="categories" ref="table" header-align="center" row-key="categoryId" :max-height="400">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="name" label="类" align="center" min-width="130"> <el-table-column prop="name" label="标签/分类" align="center" min-width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="scope.row.edit" placeholder="请输入类" v-model="scope.row.name" clearable <el-input v-if="scope.row.edit" placeholder="请输入标签/分类" v-model="scope.row.name" clearable autofocus
maxlength="30"></el-input> maxlength="30"></el-input>
<span v-else>{{ scope.row.name }}</span> <span v-else>{{ scope.row.name }}</span>
</template> </template>
@ -307,6 +313,7 @@ export default {
detailedDescription: '', detailedDescription: '',
source: '平台官方', source: '平台官方',
coverImageUrl: '', coverImageUrl: '',
courseType: '',
subjectSpecialtyList: [ subjectSpecialtyList: [
{ {
professionalClassList: [], professionalClassList: [],
@ -367,7 +374,7 @@ export default {
...mapState('content', [ ...mapState('content', [
'column' 'column'
]), ]),
getModelData: { classification: {
get () { get () {
const data = this.classifications.find(item => item.categoryId === this.form.classificationTagId) const data = this.classifications.find(item => item.categoryId === this.form.classificationTagId)
return data ? data.categoryId : '' return data ? data.categoryId : ''
@ -445,6 +452,8 @@ export default {
const { data } = await this.$post(`${this.api.productDetailsFind}?id=${this.form.id}`) const { data } = await this.$post(`${this.api.productDetailsFind}?id=${this.form.id}`)
data.categoryId = data.categoryId ? data.categoryId.split(',').map(e => +e) : [] data.categoryId = data.categoryId ? data.categoryId.split(',').map(e => +e) : []
if (data.classificationTagId) data.classificationTagId = +data.classificationTagId if (data.classificationTagId) data.classificationTagId = +data.classificationTagId
if (data.courseType) data.courseType = +data.courseType
this.originalName = data.name this.originalName = data.name
this.getColumnDetail() this.getColumnDetail()
// //
@ -624,6 +633,7 @@ export default {
// //
setClass () { setClass () {
this.classVisible = true this.classVisible = true
this.getClassification()
}, },
// //
addClass () { addClass () {
@ -632,6 +642,10 @@ export default {
categoryId: '', categoryId: '',
name: '' name: ''
}) })
this.$nextTick(() => {
const el = document.querySelector('.el-table__body-wrapper')
if (el) el.scrollTop = el.scrollHeight
})
}, },
// //
editClass (row) { editClass (row) {
@ -654,8 +668,7 @@ export default {
}, },
// //
submitClass (row, showMsg = 1) { submitClass (row, showMsg = 1) {
if (!row.name) return Util.errorMsg('请输入分类') if (!row.name) return Util.errorMsg('请输入类型')
// this.$post(`${this.api.checkClassif}?name=${row.name}&siteId=${this.site.id}&classificationTagId=${row.id}`).then(res => {
this.$post(this.api.categorySave, { this.$post(this.api.categorySave, {
type: 0, type: 0,
name: row.name, name: row.name,
@ -663,11 +676,12 @@ export default {
siteId: this.site.id, siteId: this.site.id,
editorId: this.userId, editorId: this.userId,
founderId: this.userId founderId: this.userId
}).then(res => { }).then(({ data }) => {
showMsg && Util.successMsg((row.categoryId ? '修改' : '新增') + '成功') showMsg && Util.successMsg((row.categoryId ? '修改' : '新增') + '成功')
this.getClassification() // id
row.categoryId = data
row.edit = false
}).catch(res => { }) }).catch(res => { })
// }).catch(res => { })
}, },
// //
closeClass () { closeClass () {
@ -698,14 +712,19 @@ export default {
// //
setLabel () { setLabel () {
this.labelVisible = true this.labelVisible = true
this.getLabel()
}, },
// //
addLabel () { addLabel () {
this.categories.push({ this.categories.push({
edit: true, edit: true,
id: '', categoryId: '',
name: '' name: ''
}) })
this.$nextTick(() => {
const el = document.querySelector('.el-table__body-wrapper')
if (el) el.scrollTop = el.scrollHeight
})
}, },
// //
editLabel (row) { editLabel (row) {
@ -728,8 +747,7 @@ export default {
}, },
// //
submitLabel (row, showMsg = 1) { submitLabel (row, showMsg = 1) {
if (!row.name) return Util.errorMsg('请输入类型') if (!row.name) return Util.errorMsg('请输入标签/分类')
// this.$post(`${this.api.checkLabel}?name=${row.name}&siteId=${this.site.id}&labelId=${row.id}`).then(res => {
this.$post(this.api.categorySave, { this.$post(this.api.categorySave, {
type: 1, type: 1,
name: row.name, name: row.name,
@ -737,11 +755,12 @@ export default {
siteId: this.site.id, siteId: this.site.id,
editorId: this.userId, editorId: this.userId,
founderId: this.userId founderId: this.userId
}).then(res => { }).then(({ data }) => {
showMsg && Util.successMsg((row.categoryId ? '修改' : '新增') + '成功') showMsg && Util.successMsg((row.categoryId ? '修改' : '新增') + '成功')
this.getLabel() // id
row.categoryId = data
row.edit = false
}).catch(res => { }) }).catch(res => { })
// }).catch(res => { })
}, },
// //
closeLabel () { closeLabel () {
@ -876,7 +895,7 @@ export default {
}, },
// //
preview () { preview () {
window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/article?articleId=${this.form.id}&siteId=${this.form.siteId}&id=${this.form.columnId}`) window.open((Setting.isDev ? `http://${location.hostname}:8097` : this.$store.state.content.site.domainName) + `#/index/show?articleId=${this.form.id}&siteId=${this.form.siteId}&id=${this.form.columnId}`)
}, },
// //
back () { back () {

@ -421,12 +421,12 @@ export default {
// //
sticky (row) { sticky (row) {
this.$post(`${this.api[this.isCourseProduct ? 'productDetailsTop' : 'articleTopOperation']}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => { this.$post(`${this.api[this.isCourseProduct ? 'productDetailsTop' : 'articleTopOperation']}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
this.initData() this.getData()
}).catch(res => { }) }).catch(res => { })
}, },
// //
preview (row) { preview (row) {
window.open((Setting.isDev ? `http://${location.hostname}:8097` : this.$store.state.content.site.domainName) + `#/article?articleId=${row.id}&siteId=${this.$refs.column.getCurrentNode().siteId}&id=${row.columnId}`) window.open((Setting.isDev ? `http://${location.hostname}:8097` : this.$store.state.content.site.domainName) + `#/${this.isCourseProduct ? 'index/show' : 'article'}?articleId=${row.id}&siteId=${this.$refs.column.getCurrentNode().siteId}&id=${row.columnId}`)
}, },
// //
edit (row) { edit (row) {

@ -169,56 +169,6 @@
</div> </div>
</div> </div>
<div class="contact">
<div class="inner">
<div class="title c-wrap">
<h6>{{ modules[10].form.title }}</h6>
<p class="text">{{ modules[10].form.des }}</p>
<div class="cover" @click="toSet(10)">点击更改标题与描述</div>
</div>
<div class="region">
<img class="dot" src="https://huorantech.com/images/about/dot.png" alt="">
<p class="name">深圳</p>
</div>
<div class="info">
<img class="logo" :src="modules[11].form.pic" alt="">
<div class="texts c-wrap">
<div class="item">
<div class="line">
<img class="icon" src="https://huorantech.com/images/about/site.png" alt="">
{{ modules[11].form.siteName }}
</div>
<div class="line">
<img class="icon" src="https://huorantech.com/images/about/address.png" alt="">
{{ modules[11].form.address }}
</div>
</div>
<div class="item">
<div class="line">
<img class="icon" src="https://huorantech.com/images/about/phone.png" alt="">
{{ modules[11].form.phone }}
</div>
<div class="line">
<img class="icon" src="https://huorantech.com/images/about/mail.png" alt="">
{{ modules[11].form.mail }}
</div>
</div>
<div class="cover" style="width: 800px" @click="toSet(11)">点击更改信息</div>
<div class="qrcode c-wrap">
<img width="103" :src="modules[12].form.pic" alt="">
<p class="text">{{ modules[12].form.title }}</p>
<div class="cover" @click="toSet(12)">点击更改信息</div>
</div>
<div class="qrcode c-wrap m-l-30">
<img width="103" :src="modules[13].form.pic" alt="">
<p class="text">{{ modules[13].form.title }}</p>
<div class="cover" @click="toSet(13)">点击更改信息</div>
</div>
</div>
</div>
</div>
</div>
<Module ref="module" :data.sync="curData" :visible.sync="diaVisible" @moduleSubmit="moduleSubmit" /> <Module ref="module" :data.sync="curData" :visible.sync="diaVisible" @moduleSubmit="moduleSubmit" />
</div> </div>

@ -3,11 +3,9 @@
<div class="actions"> <div class="actions">
<p class="page-name">页面设置/APPLICATION</p> <p class="page-name">页面设置/APPLICATION</p>
<div> <div>
<el-button type="primary" <el-button type="primary" @click="preview">预览</el-button>
@click="preview">预览</el-button>
<el-button @click="save(0)">保存为草稿</el-button> <el-button @click="save(0)">保存为草稿</el-button>
<el-button type="primary" <el-button type="primary" @click="save(1)">发布</el-button>
@click="save(1)">发布</el-button>
<el-button @click="back">放弃编辑</el-button> <el-button @click="back">放弃编辑</el-button>
</div> </div>
</div> </div>
@ -17,17 +15,12 @@
<el-carousel height="480px" <el-carousel height="480px"
:indicator-position="modules[0].list.filter(e => e.isEnable).length > 1 ? '' : 'none'"> :indicator-position="modules[0].list.filter(e => e.isEnable).length > 1 ? '' : 'none'">
<template v-for="(item, i) in modules[0].list"> <template v-for="(item, i) in modules[0].list">
<el-carousel-item v-if="item.pic && item.isEnable" <el-carousel-item v-if="item.pic && item.isEnable" :key="i">
:key="i"> <img width="100%" height="100%" :src="item.pic" alt="">
<img width="100%"
height="100%"
:src="item.pic"
alt="">
</el-carousel-item> </el-carousel-item>
</template> </template>
</el-carousel> </el-carousel>
<div class="cover" <div class="cover" @click="toSet(0)">点击更换banner与链接</div>
@click="toSet(0)">点击更换banner与链接</div>
</div> </div>
<div class="block history gray"> <div class="block history gray">
@ -39,38 +32,25 @@
<div class="line"></div> <div class="line"></div>
<div class="des">{{ modules[1].form.des }}</div> <div class="des">{{ modules[1].form.des }}</div>
</div> </div>
<img class="bg" <img class="bg" width="562" height="506" :src="modules[1].form.pic" alt="">
width="562"
height="506"
:src="modules[1].form.pic"
alt="">
</div> </div>
<div class="cover" <div class="cover" @click="toSet(1)">点击更改图片标题概述与链接</div>
@click="toSet(1)">点击更改图片标题概述与链接</div>
</div> </div>
</div> </div>
<div class="block"> <div class="block">
<div class="inner" <div class="inner" style="width: 1558px">
style="width: 1558px">
<div class="c-wrap"> <div class="c-wrap">
<h2 class="b-title">{{ modules[2].form.title }}</h2> <h2 class="b-title">{{ modules[2].form.title }}</h2>
<p class="intro">{{ modules[2].form.des }}</p> <p class="intro">{{ modules[2].form.des }}</p>
<div class="cover" <div class="cover" @click="toSet(2)">点击更换标题与描述</div>
@click="toSet(2)">点击更换标题与描述</div>
</div> </div>
<ul class="app"> <ul class="app">
<li v-for="(item, i) in modules[3].list" <li v-for="(item, i) in modules[3].list" :key="i">
:key="i"> <img class="bg" :src="require('@/assets/images/application/app' + (i + 1) + '.png')" alt="">
<img class="bg" <img class="icon" :src="require('@/assets/images/application/app' + (i + 1) + '-1.png')" alt="">
:src="require('@/assets/images/application/app' + (i + 1) + '.png')"
alt="">
<img class="icon"
:src="require('@/assets/images/application/app' + (i + 1) + '-1.png')"
alt="">
<p class="text">{{ item.title }}</p> <p class="text">{{ item.title }}</p>
<div class="cover" <div class="cover" @click="toSet(3, i)">点击更标题与链接</div>
@click="toSet(3, i)">点击更标题与链接</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -81,17 +61,13 @@
<div class="c-wrap"> <div class="c-wrap">
<h2 class="b-title">{{ modules[4].form.title }}</h2> <h2 class="b-title">{{ modules[4].form.title }}</h2>
<p class="intro">{{ modules[4].form.des }}</p> <p class="intro">{{ modules[4].form.des }}</p>
<div class="cover" <div class="cover" @click="toSet(4)">点击更换标题与描述</div>
@click="toSet(4)">点击更换标题与描述</div>
</div> </div>
<ul class="group"> <ul class="group">
<li v-for="(item, i) in modules[5].list" <li v-for="(item, i) in modules[5].list" :key="i">
:key="i"> <img :src="item.pic" alt="">
<img :src="item.pic"
alt="">
<p class="text">{{ item.title }}</p> <p class="text">{{ item.title }}</p>
<div class="cover" <div class="cover" @click="toSet(5, i)">点击更改图片标题与链接</div>
@click="toSet(5, i)">点击更改图片标题与链接</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -102,75 +78,76 @@
<div class="c-wrap"> <div class="c-wrap">
<h2 class="b-title">{{ modules[6].form.title }}</h2> <h2 class="b-title">{{ modules[6].form.title }}</h2>
<p class="intro">{{ modules[6].form.des }}</p> <p class="intro">{{ modules[6].form.des }}</p>
<div class="cover" <div class="cover" @click="toSet(6)">点击更换标题与描述</div>
@click="toSet(6)">点击更换标题与描述</div>
</div> </div>
<ul class="news"> <ul class="news">
<li> <li>
<img src="https://huorantech.com/images/home/3.png" <img src="https://huorantech.com/images/home/3.png" alt="">
alt="">
<div class="texts"> <div class="texts">
<h6>2022 New Year Message from President Sun Dongbai</h6> <h6>2022 New Year Message from President Sun Dongbai</h6>
<p class="des">2021 is another challenging year for the Institute of Advanced Science Facilities, Shenzhen (IASF)</p> <p class="des">2021 is another challenging year for the Institute of Advanced Science Facilities,
Shenzhen
(IASF)</p>
<span class="meta">2022.08.12</span> <span class="meta">2022.08.12</span>
</div> </div>
</li> </li>
<li> <li>
<img src="https://huorantech.com/images/home/3.png" <img src="https://huorantech.com/images/home/3.png" alt="">
alt="">
<div class="texts"> <div class="texts">
<h6>2022 New Year Message from President Sun Dongbai</h6> <h6>2022 New Year Message from President Sun Dongbai</h6>
<p class="des">2021 is another challenging year for the Institute of Advanced Science Facilities, Shenzhen (IASF)</p> <p class="des">2021 is another challenging year for the Institute of Advanced Science Facilities,
Shenzhen
(IASF)</p>
<span class="meta">2022.08.12</span> <span class="meta">2022.08.12</span>
</div> </div>
</li> </li>
<li> <li>
<img src="https://huorantech.com/images/home/3.png" <img src="https://huorantech.com/images/home/3.png" alt="">
alt="">
<div class="texts"> <div class="texts">
<h6>2022 New Year Message from President Sun Dongbai</h6> <h6>2022 New Year Message from President Sun Dongbai</h6>
<p class="des">2021 is another challenging year for the Institute of Advanced Science Facilities, Shenzhen (IASF)</p> <p class="des">2021 is another challenging year for the Institute of Advanced Science Facilities,
Shenzhen
(IASF)</p>
<span class="meta">2022.08.12</span> <span class="meta">2022.08.12</span>
</div> </div>
</li> </li>
<li> <li>
<img src="https://huorantech.com/images/home/3.png" <img src="https://huorantech.com/images/home/3.png" alt="">
alt="">
<div class="texts"> <div class="texts">
<h6>2022 New Year Message from President Sun Dongbai</h6> <h6>2022 New Year Message from President Sun Dongbai</h6>
<p class="des">2021 is another challenging year for the Institute of Advanced Science Facilities, Shenzhen (IASF)</p> <p class="des">2021 is another challenging year for the Institute of Advanced Science Facilities,
Shenzhen
(IASF)</p>
<span class="meta">2022.08.12</span> <span class="meta">2022.08.12</span>
</div> </div>
</li> </li>
<li> <li>
<img src="https://huorantech.com/images/home/3.png" <img src="https://huorantech.com/images/home/3.png" alt="">
alt="">
<div class="texts"> <div class="texts">
<h6>2022 New Year Message from President Sun Dongbai</h6> <h6>2022 New Year Message from President Sun Dongbai</h6>
<p class="des">2021 is another challenging year for the Institute of Advanced Science Facilities, Shenzhen (IASF)</p> <p class="des">2021 is another challenging year for the Institute of Advanced Science Facilities,
Shenzhen
(IASF)</p>
<span class="meta">2022.08.12</span> <span class="meta">2022.08.12</span>
</div> </div>
</li> </li>
<li> <li>
<img src="https://huorantech.com/images/home/3.png" <img src="https://huorantech.com/images/home/3.png" alt="">
alt="">
<div class="texts"> <div class="texts">
<h6>2022 New Year Message from President Sun Dongbai</h6> <h6>2022 New Year Message from President Sun Dongbai</h6>
<p class="des">2021 is another challenging year for the Institute of Advanced Science Facilities, Shenzhen (IASF)</p> <p class="des">2021 is another challenging year for the Institute of Advanced Science Facilities,
Shenzhen
(IASF)</p>
<span class="meta">2022.08.12</span> <span class="meta">2022.08.12</span>
</div> </div>
</li> </li>
<div class="cover" <div class="cover" @click="toSet(7)">点击更换标题与描述</div>
@click="toSet(7)">点击更换标题与描述</div>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
<Module ref="module" <Module ref="module" :data.sync="curData" :visible.sync="diaVisible" @moduleSubmit="moduleSubmit" />
:data.sync="curData"
:visible.sync="diaVisible"
@moduleSubmit="moduleSubmit" />
</div> </div>
</template> </template>
@ -211,11 +188,13 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../../styles/page/page.scss'; @import '../../../styles/page/page.scss';
.history { .history {
h2 { h2 {
font-size: 30px; font-size: 30px;
color: #333; color: #333;
} }
.texts { .texts {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -224,22 +203,27 @@ export default {
background-color: #fff; background-color: #fff;
border-radius: 100px 0px 0px 0px; border-radius: 100px 0px 0px 0px;
} }
.left { .left {
width: 695px; width: 695px;
} }
.des { .des {
margin: 20px 0; margin: 20px 0;
font-size: 22px; font-size: 22px;
color: #181818; color: #181818;
line-height: 31px; line-height: 31px;
} }
.bg { .bg {
margin: -122px 0 0 0; margin: -122px 0 0 0;
} }
} }
.app { .app {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
li { li {
position: relative; position: relative;
display: flex; display: flex;
@ -249,21 +233,26 @@ export default {
width: 368px; width: 368px;
height: 252px; height: 252px;
margin: 0 14px 14px 0; margin: 0 14px 14px 0;
&:first-child { &:first-child {
width: 750px; width: 750px;
} }
&:nth-child(3), &:nth-child(3),
&:nth-child(7), &:nth-child(7),
&:nth-child(10) { &:nth-child(10) {
margin-right: 0; margin-right: 0;
} }
&:nth-child(9) { &:nth-child(9) {
width: 563px; width: 563px;
} }
&:nth-child(10) { &:nth-child(10) {
width: 555px; width: 555px;
} }
} }
.bg { .bg {
position: absolute; position: absolute;
top: 0; top: 0;
@ -271,9 +260,11 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.icon { .icon {
position: relative; position: relative;
} }
.text { .text {
position: relative; position: relative;
margin-top: 20px; margin-top: 20px;
@ -281,21 +272,26 @@ export default {
color: #fff; color: #fff;
} }
} }
.group { .group {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
li { li {
position: relative; position: relative;
width: 448px; width: 448px;
margin: 0 28px 39px 0; margin: 0 28px 39px 0;
&:nth-child(3n) { &:nth-child(3n) {
margin-right: 0; margin-right: 0;
} }
} }
img { img {
width: 100%; width: 100%;
height: 353px; height: 353px;
} }
.text { .text {
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -310,40 +306,49 @@ export default {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
} }
.news-block { .news-block {
background: url(../../../assets/images/info-bg.png) 0 0/100% 100% no-repeat; background: url(../../../assets/images/info-bg.png) 0 0/100% 100% no-repeat;
} }
.news { .news {
position: relative; position: relative;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
li { li {
display: inline-flex; display: inline-flex;
width: 686px; width: 686px;
padding: 34px; padding: 34px;
margin-bottom: 28px; margin-bottom: 28px;
background-color: #fff; background-color: #fff;
&:nth-child(odd) { &:nth-child(odd) {
margin-right: 28px; margin-right: 28px;
} }
} }
img { img {
width: 237px; width: 237px;
height: 167px; height: 167px;
} }
.texts { .texts {
margin-left: 34px; margin-left: 34px;
} }
h6 { h6 {
font-size: 18px; font-size: 18px;
color: #0648a8; color: #0648a8;
} }
.des { .des {
margin: 14px 0; margin: 14px 0;
font-size: 16px; font-size: 16px;
color: #333; color: #333;
line-height: 22px; line-height: 22px;
} }
.meta { .meta {
font-size: 16px; font-size: 16px;
color: #999; color: #999;

@ -3,11 +3,9 @@
<div class="actions"> <div class="actions">
<p class="page-name">页面设置/首页</p> <p class="page-name">页面设置/首页</p>
<div> <div>
<el-button type="primary" <el-button type="primary" @click="preview">预览</el-button>
@click="preview">预览</el-button>
<el-button @click="save(0)">保存为草稿</el-button> <el-button @click="save(0)">保存为草稿</el-button>
<el-button type="primary" <el-button type="primary" @click="save(1)">发布</el-button>
@click="save(1)">发布</el-button>
<el-button @click="back">放弃编辑</el-button> <el-button @click="back">放弃编辑</el-button>
</div> </div>
</div> </div>
@ -17,40 +15,29 @@
<el-carousel height="500px" <el-carousel height="500px"
:indicator-position="modules[0].list.filter(e => e.isEnable).length > 1 ? '' : 'none'"> :indicator-position="modules[0].list.filter(e => e.isEnable).length > 1 ? '' : 'none'">
<template v-for="(item, i) in modules[0].list"> <template v-for="(item, i) in modules[0].list">
<el-carousel-item v-if="item.pic && item.isEnable" <el-carousel-item v-if="item.pic && item.isEnable" :key="i">
:key="i"> <img width="100%" height="100%" :src="item.pic" alt="">
<img width="100%"
height="100%"
:src="item.pic"
alt="">
</el-carousel-item> </el-carousel-item>
</template> </template>
</el-carousel> </el-carousel>
<div class="cover" <div class="cover" @click="toSet(0)">点击更换banner与链接</div>
@click="toSet(0)">点击更换banner与链接</div>
</div> </div>
<ul class="intro c-wrap m-t-20"> <ul class="intro c-wrap m-t-20">
<template v-for="(item, i) in modules[1].list"> <template v-for="(item, i) in modules[1].list">
<li v-if="item.isEnable" <li v-if="item.isEnable" :key="i">
:key="i"> <img :src="item.pic" alt="">
<img :src="item.pic"
alt="">
<div class="text"> <div class="text">
<h6>{{ item.title }}</h6> <h6>{{ item.title }}</h6>
<p class="desc">{{ item.des }}</p> <p class="desc">{{ item.des }}</p>
</div> </div>
</li> </li>
</template> </template>
<div class="cover" <div class="cover" @click="toSet(1)">点击更改图片标题链接与描述</div>
@click="toSet(1)">点击更改图片标题链接与描述</div>
</ul> </ul>
</div> </div>
<Module ref="module" <Module ref="module" :data.sync="curData" :visible.sync="diaVisible" @moduleSubmit="moduleSubmit" />
:data.sync="curData"
:visible.sync="diaVisible"
@moduleSubmit="moduleSubmit" />
</div> </div>
</template> </template>
@ -91,41 +78,50 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../../styles/page/page.scss'; @import '../../../styles/page/page.scss';
.intro { .intro {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 43px 0; padding: 43px 0;
background-color: #fff; background-color: #fff;
li { li {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
transition: 0.3s; transition: 0.3s;
&.active { &.active {
h6, h6,
.desc { .desc {
color: #006eff; color: #006eff;
} }
} }
&:hover { &:hover {
margin-top: -15px; margin-top: -15px;
h6, h6,
.desc { .desc {
color: #006eff; color: #006eff;
} }
} }
} }
img { img {
width: 50px; width: 50px;
margin-right: 15px; margin-right: 15px;
} }
h6 { h6 {
margin-bottom: 5px; margin-bottom: 5px;
font-size: 16px; font-size: 16px;
color: #0b1d30; color: #0b1d30;
transition: 0.5s; transition: 0.5s;
} }
.desc { .desc {
font-size: 13px; font-size: 13px;
color: #757f92; color: #757f92;

@ -0,0 +1,131 @@
<template>
<div class="wrap">
<div class="actions">
<p class="page-name">页面设置/首页</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">
<el-carousel height="500px"
:indicator-position="modules[0].list.filter(e => e.isEnable).length > 1 ? '' : 'none'">
<template v-for="(item, i) in modules[0].list">
<el-carousel-item v-if="item.pic && item.isEnable" :key="i">
<img width="100%" height="100%" :src="item.pic" alt="">
</el-carousel-item>
</template>
</el-carousel>
<div class="cover" @click="toSet(0)">点击更换banner与链接</div>
</div>
<ul class="intro c-wrap m-t-20">
<template v-for="(item, i) in modules[1].list">
<li v-if="item.isEnable" :key="i">
<img :src="item.pic" alt="">
<div class="text">
<h6>{{ item.title }}</h6>
<p class="desc">{{ item.des }}</p>
</div>
</li>
</template>
<div class="cover" @click="toSet(1)">点击更改图片标题链接与描述</div>
</ul>
</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.shop
}
},
mounted () {
this.$store.commit('user/setCrumbs', [
{
name: '站点管理',
route: '/site'
},
{
name: '内容管理',
route: '/column'
},
{
name: '栏目管理',
route: '/column'
},
{
name: '产品中心'
}
])
},
methods: {
}
};
</script>
<style lang="scss" scoped>
@import '../../../styles/page/page.scss';
.intro {
display: flex;
justify-content: space-between;
align-items: center;
padding: 43px 0;
background-color: #fff;
li {
display: inline-flex;
align-items: center;
cursor: pointer;
transition: 0.3s;
&.active {
h6,
.desc {
color: #006eff;
}
}
&:hover {
margin-top: -15px;
h6,
.desc {
color: #006eff;
}
}
}
img {
width: 50px;
margin-right: 15px;
}
h6 {
margin-bottom: 5px;
font-size: 16px;
color: #0b1d30;
transition: 0.5s;
}
.desc {
font-size: 13px;
color: #757f92;
transition: 0.5s;
}
}
</style>

@ -366,7 +366,7 @@ export default {
applicationScopeId: 0 applicationScopeId: 0
}] }]
} }
form.isDisable = 1 // form.isDisable = 1
if (!form.floatingBarSchemeId) form.founderId = form.editorId // if (!form.floatingBarSchemeId) form.founderId = form.editorId //
try { try {
await this.$post(this.api.saveFloating, form) await this.$post(this.api.saveFloating, form)

@ -351,7 +351,7 @@ export default {
}] }]
} }
form.footerContent = JSON.stringify(this.modules) form.footerContent = JSON.stringify(this.modules)
form.isDisable = 1 // form.isDisable = 1
if (!form.footerId) form.founderId = form.editorId // if (!form.footerId) form.founderId = form.editorId //
try { try {
await this.$post(this.api.saveFooter, form) await this.$post(this.api.saveFooter, form)

@ -0,0 +1,105 @@
<template>
<div class="page">
<el-form ref="form" label-width="100px">
<el-form-item label="标题">
<el-input v-model="form.title" ref="account" placeholder="请输入标题" style="width: 400px"></el-input>
</el-form-item>
<el-form-item label="图标">
<el-upload accept=".jpg,.png,.jpeg" :action="this.api.upload" :on-remove="handleRemove" :on-error="uploadError"
:before-remove="beforeRemove" :headers="headers" :show-file-list="false" :on-success="uploadSuccess">
<div style="text-align: left;">
<el-button size="small" type="primary">上传logo</el-button>
<div class="m-t-10">
<img v-if="form.logoUrl" :src="form.logoUrl" class="logo">
</div>
</div>
<div slot="tip" class="el-upload__tip">
<p>只能上传jpg/png文件请上传120*40左右的logo</p>
</div>
</el-upload>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="save">{{ form.id ? "更新" : "创建" }}</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import Util from "@/libs/util"
import Setting from "@/setting"
export default {
data () {
return {
siteId: this.$store.state.content.site.id,
headers: {
token: Util.local.get(Setting.tokenKey)
},
coverUrl: '',
uploadList: [],
form: {
id: '',
title: '',
logoUrl: '',
siteId: this.$store.state.content.site.id,
}
}
},
mounted () {
this.getData()
},
methods: {
async getData () {
const res = await this.$post(`${this.api.findLogo}?siteId=${this.siteId}`)
if (res.data) {
this.form = res.data
this.uploadList.push({
name: 'logo.jpg',
url: res.data.logoUrl
})
}
},
handleExceed () { //
Util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!")
},
//
uploadSuccess (data) {
if (data.code === 401) {
Util.errorMsg("登录过期,请重新登录")
setTimeout(() => {
this.$store.dispatch('user/logout')
}, 1000)
return false
}
this.form.logoUrl = data.url
},
uploadError (err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove () {
this.coverUrl = ''
},
async save () {
const { form } = this
if (!form.logoUrl) return Util.errorMsg('请上传logo!')
await this.$post(this.api.saveLogo, this.form)
Util.successMsg('更新成功')
this.getData()
}
}
};
</script>
<style lang="scss" scoped>
.logo {
max-height: 50px;
}
</style>

@ -63,7 +63,7 @@ export default {
this.$get(this.api.seoList, { this.$get(this.api.seoList, {
siteId: this.siteId, siteId: this.siteId,
}).then(({ data }) => { }).then(({ data }) => {
this.form = data[0] if (data.length) this.form = data[0]
}).catch(err => { }) }).catch(err => { })
}, },
// //
@ -72,7 +72,7 @@ export default {
if (valid) { if (valid) {
if (this.submiting) return false if (this.submiting) return false
this.submiting = true this.submiting = true
this.$post(this.api.updateSeo, this.form).then(res => { this.$post(this.api[this.form.id ? 'updateSeo' : 'addSeo'], this.form).then(res => {
Util.successMsg('保存成功!') Util.successMsg('保存成功!')
this.submiting = false this.submiting = false
}).catch(res => { }).catch(res => {

@ -2,6 +2,7 @@ import axios from 'axios'
import Util from '@/libs/util' import Util from '@/libs/util'
import Setting from '@/setting' import Setting from '@/setting'
import store from '@/store' import store from '@/store'
import Router from '@/router'
const service = axios.create({ const service = axios.create({
baseURL: Setting.apiBaseURL, baseURL: Setting.apiBaseURL,
@ -51,37 +52,42 @@ service.interceptors.response.use(
error => { error => {
if (error.response.status) { if (error.response.status) {
const { msg, code } = error.response.data const { msg, code } = error.response.data
// 站点id为空
if (error.response.status === 405) {
Router.replace('/site')
} else {
switch (code) { switch (code) {
// 401: 未登录 // 401: 未登录
case 401: case 401:
Util.errorMsg("登录过期,请重新登录"); Util.errorMsg("登录过期,请重新登录")
setTimeout(() => { setTimeout(() => {
store.dispatch('user/logout') store.dispatch('user/logout')
}, 1000); }, 1000)
break; break
// 403 token过期 // 403 token过期
case 403: case 403:
Util.errorMsg("登录过期,请重新登录"); Util.errorMsg("登录过期,请重新登录")
setTimeout(() => { setTimeout(() => {
store.dispatch('user/logout') store.dispatch('user/logout')
}, 1000); }, 1000)
break; break
// 其他错误,直接抛出错误提示 // 其他错误,直接抛出错误提示
default: default:
Util.errorMsg(msg); Util.errorMsg(msg)
Promise.reject(error.response.data); Promise.reject(error.response.data)
} }
return Promise.reject(error.response); return Promise.reject(error.response)
} }
} }
); }
)
function get (url, params) { function get (url, params) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
service.get(url, { params: params }).then(res => { service.get(url, { params: params }).then(res => {
resolve(res); resolve(res)
}).catch(err => { }).catch(err => {
reject(err); reject(err)
}); });
}); });
} }

@ -267,5 +267,10 @@ export default {
component: () => import('@/pages/column/page/aboutUs'), component: () => import('@/pages/column/page/aboutUs'),
meta: { title: '关于我们' } meta: { title: '关于我们' }
}, },
{
path: `shop`,
component: () => import('@/pages/column/page/shop'),
meta: { title: '产品中心' }
},
] ]
} }

@ -0,0 +1,16 @@
import BasicLayout from '@/layouts/home'
const meta = {}
export default {
path: '/logo',
meta,
component: BasicLayout,
children: [
{
path: `/logo`,
component: () => import('@/pages/logo'),
meta: { title: '网站logo设置' }
},
]
}

@ -5,7 +5,7 @@ const isDev = process.env.NODE_ENV === 'development' // 开发环境
let host = location.origin let host = location.origin
if (isDev) { if (isDev) {
host = 'https://huorantech.com' host = 'https://huorantech.com'
// host = 'http://192.168.31.217:10000' host = 'http://192.168.31.217:10000'
} }
const Setting = { const Setting = {
@ -16,8 +16,7 @@ const Setting = {
routerMode: "hash", // 路由模式,可选值为 history 或 hash routerMode: "hash", // 路由模式,可选值为 history 或 hash
showProgressBar: true, // 页面切换时,是否显示模拟的进度条 showProgressBar: true, // 页面切换时,是否显示模拟的进度条
apiBaseURL: host, // 接口请求地址 apiBaseURL: host, // 接口请求地址
// huoranApi: `https://occupationlab.com`, huoranApi: `https://occupationlab.com`,
huoranApi: `http://121.37.12.51`,
autoLogoutTime: 1000 * 60 * 60 * 3, // 长时间未操作,自动退出登录时间 autoLogoutTime: 1000 * 60 * 60 * 3, // 长时间未操作,自动退出登录时间
modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒 modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒
errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice

Loading…
Cancel
Save