|
@@ -2,6 +2,7 @@
|
|
|
<a-card :bordered="false">
|
|
|
<div class="add"><a-button type="primary" icon="plus" class="addBtn" @click="showModal" id="bannerSetting-showModal">新增</a-button></div>
|
|
|
<v-select ref="position" style="display: none;" code="ADVERT_TYPE"></v-select>
|
|
|
+ <v-select ref="jumpType" style="display: none;" code="ADVERT_JUMPTYPE"></v-select>
|
|
|
<!-- table列表 -->
|
|
|
<s-table
|
|
|
ref="table"
|
|
@@ -12,7 +13,8 @@
|
|
|
:data="loadData"
|
|
|
bordered>
|
|
|
<!-- 广告图位置 -->
|
|
|
- <span slot="position" slot-scope="text">{{ $refs.position.getNameByCode(text) }}</span>
|
|
|
+ <template slot="position" slot-scope="text">{{ $refs.position.getNameByCode(text) }}</template>
|
|
|
+ <template slot="jumpType" slot-scope="text">{{ $refs.jumpType.getNameByCode(text) }}</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="sort" slot-scope="text, record, index">
|
|
|
<a-icon
|
|
@@ -88,21 +90,30 @@
|
|
|
</a-form-item>
|
|
|
<a-form-item label="推广位类型" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<v-select
|
|
|
- ref="position"
|
|
|
code="ADVERT_TYPE"
|
|
|
allowClear
|
|
|
- id="bannerSetting-position"
|
|
|
+ id="bannerSetting-type"
|
|
|
placeholder="请选择推广位类型"
|
|
|
:disabled="disabled"
|
|
|
v-decorator="['formData.type', { initialValue: formData.type, rules: [{ required: true, message: '请选择推广位类型!' }] }]"
|
|
|
></v-select>
|
|
|
</a-form-item>
|
|
|
+ <a-form-item label="跳转类型" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
+ <v-select
|
|
|
+ code="ADVERT_JUMPTYPE"
|
|
|
+ allowClear
|
|
|
+ id="bannerSetting-jumpType"
|
|
|
+ placeholder="请选择跳转类型"
|
|
|
+ :disabled="disabled"
|
|
|
+ v-decorator="['formData.jumpType', { initialValue: formData.jumpType, rules: [{ required: true, message: '请选择跳转类型!' }] }]"
|
|
|
+ ></v-select>
|
|
|
+ </a-form-item>
|
|
|
<a-form-item label="跳转链接" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<a-textarea
|
|
|
:maxLength="300"
|
|
|
v-decorator="['formData.jumpUrl', { initialValue: formData.jumpUrl, rules: [{ required: false, message: '请输入跳转链接(最多300字符)!' }] }]"
|
|
|
:disabled="disabled"
|
|
|
- id="bannerSetting-url"
|
|
|
+ id="bannerSetting-jumpUrl"
|
|
|
placeholder="请输入跳转链接(最多300字符)"
|
|
|
allowClear
|
|
|
/>
|
|
@@ -137,6 +148,17 @@
|
|
|
></Upload>
|
|
|
<img v-else :src="formData.image" style="max-width:400px ;height: auto;" />
|
|
|
</a-form-item>
|
|
|
+ <a-form-item label="备注" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
+ <a-input
|
|
|
+ id="bannerSetting-remarks"
|
|
|
+ :maxLength="500"
|
|
|
+ v-decorator="['formData.remarks', { initialValue: formData.remarks }]"
|
|
|
+ :disabled="disabled"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入备注(最多500个字符)"
|
|
|
+ allowClear
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
<a-form-item :wrapper-col="{ span: 12, offset: 6}" style="text-align: center;">
|
|
|
<a-button type="primary" html-type="submit" v-if="!disabled" id="bannerSetting-submit" style="margin-right: 15px">保存</a-button>
|
|
|
<a-button @click="close()" v-if="!disabled" style="margin-left: 15px" id="bannerSetting-close">取消</a-button>
|
|
@@ -191,8 +213,17 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- title: '跳转链接',
|
|
|
+ title: '跳转类型',
|
|
|
width: 100,
|
|
|
+ dataIndex: 'jumpType',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: 'jumpType'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '跳转链接',
|
|
|
+ width: 200,
|
|
|
dataIndex: 'jumpUrl',
|
|
|
align: 'center',
|
|
|
customRender: (text) => {
|
|
@@ -246,10 +277,13 @@ export default {
|
|
|
},
|
|
|
formData: {
|
|
|
title: '', // 标题
|
|
|
- status: '', // 状态
|
|
|
- type: '', // 广告图位置
|
|
|
+ state: '', // 状态
|
|
|
+ type: '', // 广告图类型
|
|
|
image: '', // banner地址
|
|
|
- createDate: ''
|
|
|
+ createDate: '', // 创建时间
|
|
|
+ jumpType: '', // 跳转类型
|
|
|
+ jumpUrl: '', // 跳转路径
|
|
|
+ remarks: '' // 备注
|
|
|
},
|
|
|
bannerType: 'app',
|
|
|
disabled: false,
|
|
@@ -303,6 +337,8 @@ export default {
|
|
|
this.formData.state = ''
|
|
|
this.formData.type = ''
|
|
|
this.formData.image = ''
|
|
|
+ this.formData.jumpType = '' // 跳转类型
|
|
|
+ this.formData.remarks = '' // 备注
|
|
|
this.title = '新增'
|
|
|
if (this.$refs.bannerImage) {
|
|
|
this.$refs.bannerImage.setFileList('')
|
|
@@ -317,6 +353,8 @@ export default {
|
|
|
this.formData.jumpUrl = row.jumpUrl
|
|
|
this.formData.state = row.state
|
|
|
this.formData.type = row.type
|
|
|
+ this.formData.jumpType = row.jumpType
|
|
|
+ this.formData.remarks = row.remarks
|
|
|
this.formData.createDate = row.createDate
|
|
|
},
|
|
|
// 0 修改,1 查看详情
|