长页设置优化

master
yujialong 1 year ago
parent 8ebd3422dc
commit dbe5b0d2f9
  1. 45
      src/components/modules/module.vue
  2. 7
      src/const/modules.js
  3. 1
      src/mixins/page/index.js
  4. 11
      src/pages/article/add/index.vue

@ -1,7 +1,7 @@
<template>
<div>
<!--
模块type: banner | introduce | form | forms | column | columns | history | customList
模块type: introduce | form | forms | column | columns | history | customList
-->
<el-dialog title="模块管理"
:visible.sync="visible"
@ -9,7 +9,7 @@
custom-class="module"
:close-on-click-modal="false"
:before-close="close">
<template v-if="data.type === 'banner' || data.type === 'introduce' || data.type === 'label' || data.type === 'customList'">
<template v-if="data.type === 'introduce' || data.type === 'label' || data.type === 'customList'">
<el-table v-if="data.type === 'label'"
class="module-table"
:data="data.list"
@ -81,32 +81,11 @@
width="60"
label="序号"
align="center"></el-table-column>
<el-table-column v-if="!data.notPic"
<el-table-column v-if="data.forms.find(e => e.type === 'upload')"
label="图片"
min-width="140"
align="center">
<template slot-scope="scope">
<el-upload v-if="data.type === 'banner'"
class="uploader"
accept=".jpg,.png,.jpeg"
:on-success="res => uploadSuccess(res, scope.row)"
:show-file-list="false"
:headers="headers"
:action="api.upload">
<img v-if="scope.row.pic"
:src="scope.row.pic"
class="avatar">
<div class="uploader-default"
v-else>
<i class="el-icon-plus"></i>
<p>上传图片</p>
</div>
<div slot="tip"
class="el-upload__tip">
<p>只支持.jpg,.png格式</p>
</div>
</el-upload>
<template v-else>
<img v-if="scope.row.pic"
:src="scope.row.pic"
class="upload-pic">
@ -115,24 +94,18 @@
<i class="el-icon-picture-outline"></i>
</div>
</template>
</template>
</el-table-column>
<el-table-column v-if="data.type === 'introduce'"
prop="title"
<el-table-column prop="title"
label="标题"
min-width="140"
align="center"></el-table-column>
<el-table-column label="链接"
<el-table-column v-if="data.forms.find(e => e.type === 'link')"
label="链接"
min-width="140"
align="center">
<template slot-scope="scope">
<div class="link-wrap">
<span>{{ scope.row.link.linkName }}</span>
<el-button v-if="data.type === 'banner'"
class="set-link"
type="primary"
size="mini"
@click="toLink(scope.row, scope.$index)">设置链接</el-button>
</div>
</template>
</el-table-column>
@ -145,8 +118,7 @@
:active-value="1"
:inactive-value="0">
</el-switch>
<i v-if="data.type === 'introduce'"
class="el-icon-edit-outline del"
<i class="el-icon-edit-outline del"
@click="editIntro(scope.row, scope.$index)"></i>
<i class="el-icon-delete del"
@click="delRow(data.list, scope.$index)"></i>
@ -473,6 +445,7 @@ export default {
this.articleNums = nums
}
form && form.site && this.siteChange(form.site)
console.log(333, this.data)
},
//
siteChange (siteId) {
@ -507,7 +480,7 @@ export default {
//
addRow () {
const { type } = this.data
if (type === 'banner' || type === 'label' || type === 'customList') {
if (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)))

@ -8609,7 +8609,6 @@ export default {
}
}
],
notPic: true
},
{
type: 'column',
@ -8813,11 +8812,6 @@ export default {
label: '图片',
required: true
},
{
type: 'link',
prop: 'link',
label: '链接'
},
],
form: {
title: '标题',
@ -9873,7 +9867,6 @@ export default {
isEnable: 1
}
],
notPic: true
},
],
}

@ -89,6 +89,7 @@ export default {
toSet(i, listIndex) {
this.curModule = i
this.curData = JSON.parse(JSON.stringify(this.modules[i]))
const { type } = this.curData
if (type === 'columns' || type === 'forms') {
this.curListIndex = listIndex

@ -466,13 +466,13 @@
label="正文">
<!-- <div id="editor"
style="height:120px;"></div> -->
<vue-ueditor-wrap class="editor"
<!-- <vue-ueditor-wrap class="editor"
v-model="form.mainBody"
:config="myConfig"
@ready="ready"></vue-ueditor-wrap>
<!-- <Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'
@ready="ready"></vue-ueditor-wrap> -->
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'
v-model="form.mainBody"
:init="editorConfig" /> -->
:init="editorConfig" />
</el-form-item>
<template v-if="isJournal || isPublication">
<el-form-item prop="publicationTypeId"
@ -849,9 +849,6 @@ export default {
classificationId: [
{ required: false, message: '请选择所属分类', trigger: 'change' }
],
keynoteSpeaker: [
{ required: true, message: '请输入主讲人', trigger: 'blur' }
],
eventProfile: [
{ required: true, message: '请输入活动简介', trigger: 'blur' }
],

Loading…
Cancel
Save