广告位编辑修改
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-form-item>
|
||||
<el-form-item
|
||||
label="播放状态"
|
||||
prop="ld_property.status"
|
||||
label="关联广告位"
|
||||
prop="ld_property.related"
|
||||
v-if="!item.ld_property.is_hide"
|
||||
>
|
||||
<el-radio-group v-model="item.ld_property.status">
|
||||
<el-radio :label="0">正常</el-radio>
|
||||
<el-radio :label="1">退出时播放</el-radio>
|
||||
</el-radio-group>
|
||||
|
||||
<el-select
|
||||
v-model="item.ld_property.related"
|
||||
placeholder="关联广告位"
|
||||
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 v-if="platform_id">
|
||||
<el-button
|
||||
type="primary"
|
||||
@ -336,7 +347,6 @@ export default {
|
||||
name: '列表',
|
||||
value: 9,
|
||||
},
|
||||
|
||||
],
|
||||
modeList: [
|
||||
{
|
||||
@ -356,6 +366,13 @@ export default {
|
||||
'ld_property.title': [
|
||||
{required: true, message: '请填写广告位名称', trigger: 'blur'},
|
||||
],
|
||||
'ld_property.related': [
|
||||
{
|
||||
required: true,
|
||||
message: '若广告位非关闭时隐藏,则需选择关联广告位',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
area: [
|
||||
{required: true, message: '请选择广告投放区域', trigger: 'blur'},
|
||||
],
|
||||
@ -415,11 +432,10 @@ export default {
|
||||
has_dot: false,
|
||||
is_shake: false,
|
||||
is_hide: true,
|
||||
status: 0,
|
||||
related: '',
|
||||
},
|
||||
},
|
||||
allPos: [],
|
||||
posNumList: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@ -491,16 +507,9 @@ export default {
|
||||
has_dot: false,
|
||||
is_shake: false,
|
||||
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 => {
|
||||
@ -566,9 +575,13 @@ export default {
|
||||
async savePos(index) {
|
||||
const valid = await this.validForm(`adPos${index}`)
|
||||
if (valid) {
|
||||
// TODO: form 每条广告格式
|
||||
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) {
|
||||
// 更新
|
||||
const self = this
|
||||
@ -598,13 +611,6 @@ export default {
|
||||
console.log(err)
|
||||
})
|
||||
} else {
|
||||
// 新增
|
||||
// TODO: 判断是否重复
|
||||
// if (this.posNumList.includes(adNum)) {
|
||||
// this.$message.error('已存在相同广告位!')
|
||||
// return
|
||||
// }
|
||||
|
||||
const self = this
|
||||
|
||||
addAdPos({
|
||||
|
Loading…
x
Reference in New Issue
Block a user