|
|
@ -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,32 +81,11 @@ |
|
|
|
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'" |
|
|
|
|
|
|
|
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" |
|
|
|
<img v-if="scope.row.pic" |
|
|
|
:src="scope.row.pic" |
|
|
|
:src="scope.row.pic" |
|
|
|
class="upload-pic"> |
|
|
|
class="upload-pic"> |
|
|
@ -115,24 +94,18 @@ |
|
|
|
<i class="el-icon-picture-outline"></i> |
|
|
|
<i class="el-icon-picture-outline"></i> |
|
|
|
</div> |
|
|
|
</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))) |
|
|
|