|
|
@ -183,7 +183,7 @@ |
|
|
|
<div class="set_time"> |
|
|
|
<span>展示时长</span> |
|
|
|
<el-form-item :prop="'form.'+index+'.showTime'" style="width: 100px"> |
|
|
|
<el-input v-model="item.showTime" type="text" placeholder="15" style="width: 66px" /> |
|
|
|
<el-input v-model="item.showTime" type="text" placeholder="15" style="width: 66px" @input="$forceUpdate()" /> |
|
|
|
</el-form-item> |
|
|
|
<em>秒</em> |
|
|
|
</div> |
|
|
@ -309,6 +309,7 @@ export default { |
|
|
|
release_weekly: '', // 发布每周 如果设置为每天则为空 |
|
|
|
release_device: '', // 发布设备 1.全部 2.部分 |
|
|
|
release_deviceDTOs: [], // {"device_id": "设备id"} |
|
|
|
del_rmids: [], // 删除绑定素材关联集合id |
|
|
|
release_end: '', // “发布结束时间 yyyy-MM-dd HH:mm:ss” |
|
|
|
release_id: null, // 发布id 为null则为新增 |
|
|
|
release_materialDTOs: [], |
|
|
@ -464,6 +465,16 @@ export default { |
|
|
|
FetchFindMaterialById(params).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.selectedMaterial = res.data |
|
|
|
// 获取图片设置的animation |
|
|
|
this.selectedMaterial.forEach((item, index) => { |
|
|
|
if (item.material_type == 0) { |
|
|
|
item.showTime = this.isEditMaterial[index].duration |
|
|
|
item.showAnimation = this.isEditMaterial[index].effect |
|
|
|
item.showAnimationName = this.animationData[item.showAnimation].name |
|
|
|
item.showAudioUrl = this.isEditMaterial[index].bgm_path |
|
|
|
item.showAudioName = this.isEditMaterial[index].bgm_name |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
// 设备list |
|
|
@ -531,10 +542,12 @@ export default { |
|
|
|
json.duration = (item.showTime || item.showAnimationName || item.showAnimation) ? item.showTime : 15 |
|
|
|
json.effect = (item.showTime || item.showAnimationName || item.showAnimation) ? item.showAnimation : 0 |
|
|
|
json.bgm_path = (item.showAudioName || item.showAudioUrl) ? item.showAudioUrl : null |
|
|
|
json.bgm_name = (item.showAudioName || item.showAudioUrl) ? item.showAudioName : null |
|
|
|
} else { |
|
|
|
json.duration = 0 |
|
|
|
json.effect = 0 |
|
|
|
json.bgm_path = null |
|
|
|
json.bgm_name = null |
|
|
|
} |
|
|
|
json.material_id = item.material_id |
|
|
|
json.material_name = item.material_name |
|
|
@ -565,6 +578,7 @@ export default { |
|
|
|
} else { |
|
|
|
this.form.bgm_main = null |
|
|
|
} |
|
|
|
console.log(this.form) |
|
|
|
// 保存提交 |
|
|
|
FetchSaveRelease(this.form).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
@ -656,6 +670,15 @@ export default { |
|
|
|
this.contentIds.splice(index, 1) |
|
|
|
this.selectedEditData.splice(index, 1) |
|
|
|
this.selectedMaterial.splice(i, 1) |
|
|
|
|
|
|
|
// 编辑的情况下 |
|
|
|
if (this.release_id) { |
|
|
|
this.isEditMaterial.find(item => { |
|
|
|
if (item.material_id == id) { |
|
|
|
this.form.del_rmids.push(item.id) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
// localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial)) |
|
|
|
}, |
|
|
|
// 选中可编辑的 |
|
|
@ -675,16 +698,16 @@ export default { |
|
|
|
// 编辑-已选择的 |
|
|
|
selectEdit() { |
|
|
|
this.listEditVisible = true |
|
|
|
const form = { |
|
|
|
showTime: '15', |
|
|
|
showAnimation: '', |
|
|
|
showAnimationName: '' |
|
|
|
} |
|
|
|
this.selectedEditData.map((item, index) => { |
|
|
|
if (item.material_type == 0) { |
|
|
|
this.setMaterialForm.push(form) |
|
|
|
} |
|
|
|
}) |
|
|
|
// const form = { |
|
|
|
// showTime: '15', |
|
|
|
// showAnimation: '', |
|
|
|
// showAnimationName: '' |
|
|
|
// } |
|
|
|
// this.selectedEditData.map((item, index) => { |
|
|
|
// if (item.material_type == 0) { |
|
|
|
// this.setMaterialForm.push(form) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
}, |
|
|
|
dragEnd() { |
|
|
|
// console.log(this.selectedEditData) |
|
|
@ -744,6 +767,7 @@ export default { |
|
|
|
}, |
|
|
|
// 动画切换 |
|
|
|
selectAnimation(event, item) { |
|
|
|
this.$forceUpdate() |
|
|
|
item.showAnimationName = event.name |
|
|
|
item.showAnimation = event.key |
|
|
|
}, |
|
|
@ -766,10 +790,12 @@ export default { |
|
|
|
this.$refs.MaterialList.selectedListId = [] |
|
|
|
this.$refs.MaterialList.selectedMaterial = [] |
|
|
|
// 已选择的内容中-list是否包含,包含即选中状态 |
|
|
|
this.selectedMaterial.forEach(item => { |
|
|
|
this.$refs.MaterialList.selectedListId.push(item.material_id) |
|
|
|
this.$refs.MaterialList.selectedMaterial.push(item) |
|
|
|
}) |
|
|
|
if (this.selectedMaterial) { |
|
|
|
this.selectedMaterial.forEach(item => { |
|
|
|
this.$refs.MaterialList.selectedListId.push(item.material_id) |
|
|
|
this.$refs.MaterialList.selectedMaterial.push(item) |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (type == 'audio') { |
|
|
|
this.mulitText = '选择' |
|
|
|