长页设置优化

master
yujialong 1 year ago
parent 8ebd3422dc
commit dbe5b0d2f9
  1. 59
      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> <template>
<div> <div>
<!-- <!--
模块type: banner | introduce | form | forms | column | columns | history | customList 模块type: introduce | form | forms | column | columns | history | customList
--> -->
<el-dialog title="模块管理" <el-dialog title="模块管理"
:visible.sync="visible" :visible.sync="visible"
@ -9,7 +9,7 @@
custom-class="module" custom-class="module"
:close-on-click-modal="false" :close-on-click-modal="false"
:before-close="close"> :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'" <el-table v-if="data.type === 'label'"
class="module-table" class="module-table"
:data="data.list" :data="data.list"
@ -81,58 +81,31 @@
width="60" width="60"
label="序号" label="序号"
align="center"></el-table-column> 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="图片" label="图片"
min-width="140" min-width="140"
align="center"> align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-upload v-if="data.type === 'banner'" <img v-if="scope.row.pic"
class="uploader" :src="scope.row.pic"
accept=".jpg,.png,.jpeg" class="upload-pic">
:on-success="res => uploadSuccess(res, scope.row)" <div class="upload-none"
:show-file-list="false" v-else>
:headers="headers" <i class="el-icon-picture-outline"></i>
:action="api.upload"> </div>
<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">
<div class="upload-none"
v-else>
<i class="el-icon-picture-outline"></i>
</div>
</template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="data.type === 'introduce'" <el-table-column prop="title"
prop="title"
label="标题" label="标题"
min-width="140" min-width="140"
align="center"></el-table-column> 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" min-width="140"
align="center"> align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="link-wrap"> <div class="link-wrap">
<span>{{ scope.row.link.linkName }}</span> <span>{{ scope.row.link.linkName }}</span>
<el-button v-if="data.type === 'banner'"
class="set-link"
type="primary"
size="mini"
@click="toLink(scope.row, scope.$index)">设置链接</el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -145,8 +118,7 @@
:active-value="1" :active-value="1"
:inactive-value="0"> :inactive-value="0">
</el-switch> </el-switch>
<i v-if="data.type === 'introduce'" <i class="el-icon-edit-outline del"
class="el-icon-edit-outline del"
@click="editIntro(scope.row, scope.$index)"></i> @click="editIntro(scope.row, scope.$index)"></i>
<i class="el-icon-delete del" <i class="el-icon-delete del"
@click="delRow(data.list, scope.$index)"></i> @click="delRow(data.list, scope.$index)"></i>
@ -473,6 +445,7 @@ export default {
this.articleNums = nums this.articleNums = nums
} }
form && form.site && this.siteChange(form.site) form && form.site && this.siteChange(form.site)
console.log(333, this.data)
}, },
// //
siteChange (siteId) { siteChange (siteId) {
@ -507,7 +480,7 @@ export default {
// //
addRow () { addRow () {
const { type } = this.data 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))) this.data.list.push(JSON.parse(JSON.stringify(this.data.originForm)))
} else if (type === 'history') { } else if (type === 'history') {
this.data.list.push(JSON.parse(JSON.stringify(this.data.historyForm))) this.data.list.push(JSON.parse(JSON.stringify(this.data.historyForm)))

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

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

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

Loading…
Cancel
Save