Browse Source

发布3

dev
xuhuajiao 3 years ago
parent
commit
ee6adc2249
  1. 56
      src/views/immediateRelease/index.vue
  2. 18
      src/views/materialContent/materialList/index.vue

56
src/views/immediateRelease/index.vue

@ -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 = '选择'

18
src/views/materialContent/materialList/index.vue

@ -345,14 +345,25 @@ export default {
},
// - to /
publishHandle(index) {
localStorage.removeItem('selectedMaterial')
localStorage.removeItem('releaseId')
localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial))
//
const resultAudio = []
this.selectedMaterial.map(item => {
if (item.material_type == 2) {
resultAudio.push(item)
}
})
if (resultAudio.length > 1) {
this.$message.error('音频类型的文件只可选择1个')
return
}
this.$router.push(
{
path: '/release', query: { tag: index }
}
)
localStorage.removeItem('selectedMaterial')
localStorage.removeItem('releaseId')
localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial))
},
// -
editContent() {
@ -378,7 +389,6 @@ export default {
//
saveMaterial() {
if (!this.isEditMaterial) {
console.log('新增')
console.log(this.$refs.uploadMaterial.fileSize)
const formatType = this.$refs.uploadMaterial.formatType
this.uploadFileUrl = this.$refs.uploadMaterial.uploadFileUrl

Loading…
Cancel
Save