|
@@ -14,9 +14,9 @@
|
|
|
:data="loadData"
|
|
|
bordered>
|
|
|
<!-- 广告图位置 -->
|
|
|
- <span slot="position" slot-scope="text,record">
|
|
|
+ <!-- <span slot="position" slot-scope="text,record">
|
|
|
{{ $refs.position.getNameByCode(text) }}
|
|
|
- </span>
|
|
|
+ </span> -->
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
<template>
|
|
|
<a-icon type="eye" :style="{ fontSize: '20px', color: '#e29e14', padding: '0 10px' }" @click="handleEdit(record, 1)" />
|
|
@@ -50,7 +50,7 @@
|
|
|
:disabled="disabled"
|
|
|
placeholder="请输入轮播图名称32个字以内" />
|
|
|
</a-form-item>
|
|
|
- <a-form-item required label="广告图位置" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
+ <!-- <a-form-item required label="广告图位置" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<v-select
|
|
|
ref="position"
|
|
|
code="ADVERT_POSITION"
|
|
@@ -58,7 +58,7 @@
|
|
|
allowClear
|
|
|
placeholder="请选择广告图位置"
|
|
|
:disabled="disabled"></v-select>
|
|
|
- </a-form-item>
|
|
|
+ </a-form-item> -->
|
|
|
<a-form-item label="跳转链接" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
<a-input
|
|
|
v-decorator="['formData.url', { initialValue:formData.url,rules: [{ required: false, message: '请填写跳转链接!' }] }]"
|
|
@@ -83,13 +83,13 @@
|
|
|
</a-radio-group>
|
|
|
</a-form-item>
|
|
|
<a-form-item label="上传图片" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
- <div style="border: 1px solid #eee;overflow: hidden;padding: 8px 8px 0;">
|
|
|
+ <div style="border: 1px solid #eee;overflow: hidden;padding: 8px;">
|
|
|
<Upload
|
|
|
v-if="title != '查看详情'"
|
|
|
v-decorator="[
|
|
|
- 'formData.photo',
|
|
|
+ 'photo',
|
|
|
{
|
|
|
- initialValue: formData.photo,
|
|
|
+ initialValue: photo,
|
|
|
rules: [{required: true,message: '请上传轮播图!'}]
|
|
|
}]"
|
|
|
ref="bannerImage"
|
|
@@ -99,7 +99,7 @@
|
|
|
listType="picture-card"
|
|
|
upText="上传图片">
|
|
|
</Upload>
|
|
|
- <img v-else :src="formData.photo" style="width:100px ;height: auto; margin-bottom: 8px;" />
|
|
|
+ <img v-else :src="photo" style="width:100px ;height: auto;" />
|
|
|
</div>
|
|
|
</a-form-item>
|
|
|
<a-form-item :wrapper-col="{ span: 12, offset: 5 }" style="text-align: center;">
|
|
@@ -144,33 +144,15 @@ export default {
|
|
|
minWidth: '40',
|
|
|
align: 'center'
|
|
|
},
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- // dataIndex: 'action',
|
|
|
- minWidth: '100',
|
|
|
- align: 'center',
|
|
|
- scopedSlots: {
|
|
|
- customRender: 'action'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '状态',
|
|
|
- minWidth: '100',
|
|
|
- dataIndex: 'status',
|
|
|
- align: 'center',
|
|
|
- scopedSlots: {
|
|
|
- customRender: 'status'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '广告图位置',
|
|
|
- minWidth: '100',
|
|
|
- dataIndex: 'position',
|
|
|
- align: 'center',
|
|
|
- scopedSlots: {
|
|
|
- customRender: 'position'
|
|
|
- }
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // title: '广告图位置',
|
|
|
+ // minWidth: '100',
|
|
|
+ // dataIndex: 'position',
|
|
|
+ // align: 'center',
|
|
|
+ // scopedSlots: {
|
|
|
+ // customRender: 'position'
|
|
|
+ // }
|
|
|
+ // },
|
|
|
{
|
|
|
title: '名称',
|
|
|
minWidth: '100',
|
|
@@ -188,13 +170,29 @@ export default {
|
|
|
minWidth: '200',
|
|
|
dataIndex: 'url',
|
|
|
align: 'center'
|
|
|
- }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '状态',
|
|
|
+ minWidth: '100',
|
|
|
+ dataIndex: 'status',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: 'status'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ // dataIndex: 'action',
|
|
|
+ minWidth: '100',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: 'action'
|
|
|
+ }
|
|
|
+ }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
- return getBannerSettingList({
|
|
|
- bannerType: 'app'
|
|
|
- })
|
|
|
+ return getBannerSettingList()
|
|
|
.then(res => {
|
|
|
// console.log(res, '1111')
|
|
|
const no = 0
|
|
@@ -224,12 +222,12 @@ export default {
|
|
|
},
|
|
|
formData: {
|
|
|
title: '', // 标题
|
|
|
- photo: '', // banner图片
|
|
|
url: '', // 图片路径
|
|
|
status: '', // 状态
|
|
|
- sort: '', // 排序
|
|
|
- position: '' // 广告图位置
|
|
|
+ sort: '' // 排序
|
|
|
+ // position: '' // 广告图位置
|
|
|
},
|
|
|
+ photo: '', // banner图片
|
|
|
bannerType: 'app',
|
|
|
disabled: false,
|
|
|
value: '',
|
|
@@ -251,7 +249,7 @@ export default {
|
|
|
this.hideRequiredMark = false
|
|
|
},
|
|
|
getbannerImage (data) {
|
|
|
- this.formData.photo = data
|
|
|
+ this.photo = data
|
|
|
},
|
|
|
// 点击保存;
|
|
|
handleSubmit (e) {
|
|
@@ -260,9 +258,8 @@ export default {
|
|
|
this.form.validateFields((err, values) => {
|
|
|
if (!err) {
|
|
|
console.log('Received values of form: ', values, this.formData)
|
|
|
- const formData = Object.assign({}, this.formData, values.formData, {
|
|
|
- bannerType: 'app'
|
|
|
- })
|
|
|
+
|
|
|
+ const formData = Object.assign({}, this.formData, values.formData)
|
|
|
console.log(formData, _this.radioGroup)
|
|
|
saveItem(formData, _this.radioGroup).then(res => {
|
|
|
console.log(res, 'rrrrrrrrr')
|
|
@@ -280,7 +277,7 @@ export default {
|
|
|
close () {
|
|
|
this.visible = false
|
|
|
this.formData.title = ''
|
|
|
- this.formData.photo = ''
|
|
|
+ this.photo = ''
|
|
|
this.formData.url = ''
|
|
|
this.formData.status = ''
|
|
|
this.formData.sort = ''
|
|
@@ -293,7 +290,10 @@ export default {
|
|
|
assignment (row) {
|
|
|
this.formData.id = row.id
|
|
|
this.formData.title = row.title
|
|
|
- this.formData.photo = row.photo
|
|
|
+ this.photo = row.photoBasePath + row.photoPath
|
|
|
+ console.log(this.photo)
|
|
|
+ // this.formData.photoBasePath = row.photoBasePath
|
|
|
+ // this.formData.photoBasePath = row.photoPath
|
|
|
this.formData.url = row.url
|
|
|
this.formData.status = row.status
|
|
|
this.formData.sort = row.sort
|
|
@@ -302,7 +302,6 @@ export default {
|
|
|
// 0 修改,1 查看详情
|
|
|
handleEdit (row, type) {
|
|
|
console.log(row)
|
|
|
- const _this = this
|
|
|
if (type == 1) {
|
|
|
this.title = '查看详情'
|
|
|
this.hideRequiredMark = true
|
|
@@ -313,9 +312,8 @@ export default {
|
|
|
this.assignment(row)
|
|
|
this.disabled = type == 1
|
|
|
this.visible = true
|
|
|
- console.log(this.formData.photo)
|
|
|
setTimeout(() => {
|
|
|
- _this.$refs.bannerImage.setFileList(this.formData.photo)
|
|
|
+ this.$refs.bannerImage.setFileList(this.photo)
|
|
|
}, 500)
|
|
|
},
|
|
|
// 删除
|