广告位编辑修改
This commit is contained in:
parent
cba0a08f81
commit
2749f9ab99
@ -213,15 +213,26 @@
|
|||||||
<el-switch v-model="item.ld_property.is_hide"></el-switch>
|
<el-switch v-model="item.ld_property.is_hide"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="播放状态"
|
label="关联广告位"
|
||||||
prop="ld_property.status"
|
prop="ld_property.related"
|
||||||
|
v-if="!item.ld_property.is_hide"
|
||||||
>
|
>
|
||||||
<el-radio-group v-model="item.ld_property.status">
|
<el-select
|
||||||
<el-radio :label="0">正常</el-radio>
|
v-model="item.ld_property.related"
|
||||||
<el-radio :label="1">退出时播放</el-radio>
|
placeholder="关联广告位"
|
||||||
</el-radio-group>
|
style="width: 70%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="(pos,idx) in allPos"
|
||||||
|
:key="idx"
|
||||||
|
:label="pos.ld_property.title"
|
||||||
|
:value="pos.id"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<span class="ipt-tip">关联广告位需选择非自身广告位</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item v-if="platform_id">
|
<el-form-item v-if="platform_id">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -336,7 +347,6 @@ export default {
|
|||||||
name: '列表',
|
name: '列表',
|
||||||
value: 9,
|
value: 9,
|
||||||
},
|
},
|
||||||
|
|
||||||
],
|
],
|
||||||
modeList: [
|
modeList: [
|
||||||
{
|
{
|
||||||
@ -356,6 +366,13 @@ export default {
|
|||||||
'ld_property.title': [
|
'ld_property.title': [
|
||||||
{required: true, message: '请填写广告位名称', trigger: 'blur'},
|
{required: true, message: '请填写广告位名称', trigger: 'blur'},
|
||||||
],
|
],
|
||||||
|
'ld_property.related': [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '若广告位非关闭时隐藏,则需选择关联广告位',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
],
|
||||||
area: [
|
area: [
|
||||||
{required: true, message: '请选择广告投放区域', trigger: 'blur'},
|
{required: true, message: '请选择广告投放区域', trigger: 'blur'},
|
||||||
],
|
],
|
||||||
@ -415,11 +432,10 @@ export default {
|
|||||||
has_dot: false,
|
has_dot: false,
|
||||||
is_shake: false,
|
is_shake: false,
|
||||||
is_hide: true,
|
is_hide: true,
|
||||||
status: 0,
|
related: '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
allPos: [],
|
allPos: [],
|
||||||
posNumList: [],
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@ -491,16 +507,9 @@ export default {
|
|||||||
has_dot: false,
|
has_dot: false,
|
||||||
is_shake: false,
|
is_shake: false,
|
||||||
is_hide: true,
|
is_hide: true,
|
||||||
status: 0,
|
related: '',
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO:
|
|
||||||
// this.posNumList = this.allPos.map(item => {
|
|
||||||
// return `${item.area}${item.type}${item.mode}${item.coorX}${
|
|
||||||
// item.coorY
|
|
||||||
// }`
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
@ -566,9 +575,13 @@ export default {
|
|||||||
async savePos(index) {
|
async savePos(index) {
|
||||||
const valid = await this.validForm(`adPos${index}`)
|
const valid = await this.validForm(`adPos${index}`)
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// TODO: form 每条广告格式
|
|
||||||
const posInfo = JSON.parse(JSON.stringify(this.allPos[index]))
|
const posInfo = JSON.parse(JSON.stringify(this.allPos[index]))
|
||||||
|
|
||||||
|
if(posInfo.ld_property.related === posInfo.id) {
|
||||||
|
this.$message.error('关联广告位不可选则自身!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (this.allPos[index].id) {
|
if (this.allPos[index].id) {
|
||||||
// 更新
|
// 更新
|
||||||
const self = this
|
const self = this
|
||||||
@ -598,13 +611,6 @@ export default {
|
|||||||
console.log(err)
|
console.log(err)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// 新增
|
|
||||||
// TODO: 判断是否重复
|
|
||||||
// if (this.posNumList.includes(adNum)) {
|
|
||||||
// this.$message.error('已存在相同广告位!')
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
const self = this
|
const self = this
|
||||||
|
|
||||||
addAdPos({
|
addAdPos({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user