|
|
@ -77,7 +77,7 @@ |
|
|
|
<img v-if="(item.img_path|| item.imgPath) || (item.material_type == 1 || item.type == 1)" :src="(item.img_path||item.imgPath)" :onerror="defaultImg" alt /> |
|
|
|
<div v-if="(!item.img_path|| !item.imgPath) && (item.material_type == 2|| item.type == 2)" class="radio_img"></div> |
|
|
|
<div class="item_format"> |
|
|
|
<span class="item_type">{{ materialPostfix[index] }}</span> |
|
|
|
<span class="item_type">{{ (item.deposit_url || item.depositUrl) | getFileFormat }}</span> |
|
|
|
<span v-if="item.material_type != '0' || item.type != '0'" class="item_time">{{ item.duration | getSeconds }}</span> |
|
|
|
</div> |
|
|
|
<div class="file_name">{{ item.material_name || item.name }}</div> |
|
|
@ -122,8 +122,8 @@ |
|
|
|
<el-button round class="delt_btn" @click="clearDevice()">清空</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-tag v-for="tag in deviceTags" :key="tag.device_id" closable :disable-transitions="true" :hit="false" color="#cbe3ff" @close="deltTags(tag)"> |
|
|
|
{{ tag.device_name }} |
|
|
|
<el-tag v-for="tag in deviceTags" :key="(tag.device_id || tag.deviceId)" closable :disable-transitions="true" :hit="false" color="#cbe3ff" @close="deltTags(tag)"> |
|
|
|
{{ tag.device_name || tag.deviceName }} |
|
|
|
</el-tag> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
@ -168,18 +168,20 @@ |
|
|
|
</div> |
|
|
|
<div v-for="(item, index) in selectedEditData" :key="index" class="edit_material"> |
|
|
|
<div class="edit_img"> |
|
|
|
<img v-if="item.img_path || item.material_type == 1" :src="item.img_path" :onerror="defaultImg" alt /> |
|
|
|
<div v-if="!item.img_path && item.material_type == 2" class="radio_img"></div> |
|
|
|
<!-- <img v-if="item.img_path || item.material_type == 1" :src="item.img_path" :onerror="defaultImg" alt /> |
|
|
|
<div v-if="!item.img_path && item.material_type == 2" class="radio_img"></div> --> |
|
|
|
<img v-if="(item.img_path|| item.imgPath) || (item.material_type == 1 || item.type == 1)" :src="(item.img_path||item.imgPath)" :onerror="defaultImg" alt /> |
|
|
|
<div v-if="(!item.img_path|| !item.imgPath) && (item.material_type == 2|| item.type == 2)" class="radio_img"></div> |
|
|
|
<span class="">{{ index+1 }}</span> |
|
|
|
</div> |
|
|
|
<div class="edit_cont"> |
|
|
|
<div class="edit_cont_base"> |
|
|
|
<p>{{ item.material_name }}</p> |
|
|
|
<span>{{ materialPostfix[index] }}</span> |
|
|
|
<span>{{ item.file_size | formatBytes }}</span> |
|
|
|
<p>{{ item.material_name || item.name }}</p> |
|
|
|
<span>{{ (item.deposit_url || item.depositUrl) | getFileFormat }}</span> |
|
|
|
<span>{{ (item.file_size||item.fileSize) | formatBytes }}</span> |
|
|
|
</div> |
|
|
|
<!-- <div v-if="item.material_type == 0" class="edit_cont_set"> --> |
|
|
|
<el-form v-if="item.material_type == 0" :ref="setMaterialForm" :model="setMaterialForm.form" class="edit_cont_set" size="small"> |
|
|
|
<el-form v-if="item.material_type == 0 || item.type == 0" :ref="setMaterialForm" :model="setMaterialForm.form" class="edit_cont_set" size="small"> |
|
|
|
<div class="set_time"> |
|
|
|
<span>展示时长</span> |
|
|
|
<el-form-item :prop="'form.'+index+'.showTime'" style="width: 100px"> |
|
|
@ -262,7 +264,7 @@ import MaterialList from '../components/MaterialCompontentList.vue' |
|
|
|
import { getMaterialByType, FetchFindMaterialById } from '@/api/material/material' |
|
|
|
import { ReqDeviceList } from '@/api/device/deviceList.js' |
|
|
|
import { FetchSaveRelease, FetchGetReleaseDetailsById } from '@/api/release/release.js' |
|
|
|
import { getSeconds, formatBytes, parseTime } from '@/utils/index.js' |
|
|
|
import { getSeconds, formatBytes, parseTime, getFileFormat } from '@/utils/index.js' |
|
|
|
export default { |
|
|
|
name: 'ImmediateRelease', |
|
|
|
components: { |
|
|
@ -276,13 +278,15 @@ export default { |
|
|
|
}, |
|
|
|
formatBytes(bytes, decimals) { |
|
|
|
return formatBytes(bytes, decimals) |
|
|
|
}, |
|
|
|
getFileFormat(str) { |
|
|
|
return getFileFormat(str) |
|
|
|
} |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
orga_id: '133221333123111', |
|
|
|
selectedMaterial: [], // 从其他页面选择带过来的素材 |
|
|
|
materialPostfix: [], |
|
|
|
publishType: 0, // 判断是定时发布还是即时发布页面 |
|
|
|
themeType: null, |
|
|
|
page: 1, |
|
|
@ -309,17 +313,6 @@ export default { |
|
|
|
release_deviceDTOs: [], // {"device_id": "设备id"} |
|
|
|
release_end: '', // “发布结束时间 yyyy-MM-dd HH:mm:ss” |
|
|
|
release_id: null, // 发布id 为null则为新增 |
|
|
|
// { |
|
|
|
// "duration": 时长(s), |
|
|
|
// "effect": 切换动效, |
|
|
|
// "material_id": "素材id", |
|
|
|
// "material_name": "素材名称", |
|
|
|
// "img_path","显示图片路径", |
|
|
|
// "bgm_path":"背景音乐", |
|
|
|
// "file_size":"文件大小", |
|
|
|
// "ranking": 排序, |
|
|
|
// "rm_id": "关联id 新增则为null" |
|
|
|
// } |
|
|
|
release_materialDTOs: [], |
|
|
|
release_start: null, // 发布开始时间 yyyy-MM-dd HH:mm:ss |
|
|
|
release_type: '' // 发布类型 |
|
|
@ -397,7 +390,10 @@ export default { |
|
|
|
} |
|
|
|
], |
|
|
|
activeIndex: 0, |
|
|
|
activeItemIndex: 0 |
|
|
|
activeItemIndex: 0, |
|
|
|
release_id: null, |
|
|
|
releaseInfo: null, |
|
|
|
isEditMaterial: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -411,15 +407,6 @@ export default { |
|
|
|
created() { |
|
|
|
this.selectedMaterial = [] |
|
|
|
this.selectedMaterial = JSON.parse(localStorage.getItem('selectedMaterial')) |
|
|
|
// 素材类型格式处理 |
|
|
|
if (this.selectedMaterial) { |
|
|
|
this.selectedMaterial.forEach((item, key) => { |
|
|
|
this.materialPostfix[key] = item.deposit_url.substring( |
|
|
|
item.deposit_url.lastIndexOf('.') + 1, |
|
|
|
item.deposit_url.length |
|
|
|
) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
if (this.$route.path === '/release') { |
|
|
@ -437,22 +424,23 @@ export default { |
|
|
|
methods: { |
|
|
|
editRelease() { |
|
|
|
const release_id = JSON.parse(localStorage.getItem('releaseId')) |
|
|
|
this.release_id = release_id |
|
|
|
const params = { |
|
|
|
release_id: release_id |
|
|
|
} |
|
|
|
FetchGetReleaseDetailsById(params).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
console.log(res.data) |
|
|
|
const releaseInfo = res.data.release |
|
|
|
this.releaseInfo = releaseInfo |
|
|
|
this.form.orga_id = releaseInfo.orgaId |
|
|
|
this.form.relaase_name = releaseInfo.relaaseName |
|
|
|
this.form.release_cycle = releaseInfo.releaseCycle |
|
|
|
if (this.form.release_cycle == 2) { |
|
|
|
this.selectWeekly = releaseInfo.releaseWeekly.split(',') |
|
|
|
if (releaseInfo.releaseWeekly) { |
|
|
|
this.selectWeekly = releaseInfo.releaseWeekly.split(',') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.form.is_topping = releaseInfo.isTopping |
|
|
|
this.form.release_device = releaseInfo.releaseDevice |
|
|
|
if (releaseInfo.releaseType == 1) { |
|
|
|
const arr = [] |
|
|
|
arr.push(parseTime(releaseInfo.releaseStart)) |
|
|
@ -461,13 +449,12 @@ export default { |
|
|
|
} else { |
|
|
|
this.form.release_start = parseTime(releaseInfo.releaseStart) |
|
|
|
} |
|
|
|
if (releaseInfo.actualEnd) { |
|
|
|
this.form.actual_end = releaseInfo.actualEnd |
|
|
|
} |
|
|
|
|
|
|
|
this.form.bgm_main = releaseInfo.bgmMain |
|
|
|
this.form.release_deviceDTOs = res.data.release_devices |
|
|
|
// 获取素材list |
|
|
|
const materialIds = [] |
|
|
|
this.isEditMaterial = res.data.release_materials |
|
|
|
res.data.release_materials.map((item) => { |
|
|
|
materialIds.push(item.materialId) |
|
|
|
}) |
|
|
@ -476,10 +463,12 @@ export default { |
|
|
|
} |
|
|
|
FetchFindMaterialById(params).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
console.log(res.data) |
|
|
|
this.selectedMaterial = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
// 设备list |
|
|
|
this.form.release_device = releaseInfo.releaseDevice |
|
|
|
this.deviceTags = res.data.release_devices |
|
|
|
} else { |
|
|
|
this.$message.error(res.msg) |
|
|
|
} |
|
|
@ -492,8 +481,16 @@ export default { |
|
|
|
this.form.orga_id = this.orga_id |
|
|
|
// 发布类型 |
|
|
|
this.form.release_type = this.publishType |
|
|
|
// 先判断编辑还是新增 |
|
|
|
this.form.actual_end = this.publishType == 0 ? null : '' |
|
|
|
// 实际结束时间 |
|
|
|
if (this.release_id) { |
|
|
|
if (this.releaseInfo.actualEnd) { |
|
|
|
this.form.actual_end = this.releaseInfo.actualEnd |
|
|
|
} |
|
|
|
this.form.release_id = this.release_id |
|
|
|
} else { |
|
|
|
this.form.actual_end = null |
|
|
|
this.form.release_id = null |
|
|
|
} |
|
|
|
// 设备选择判断 |
|
|
|
if (this.form.release_device) { |
|
|
|
if (this.form.release_device == 1) { |
|
|
@ -505,7 +502,7 @@ export default { |
|
|
|
} |
|
|
|
this.form.release_deviceDTOs = this.deviceTags.map(item => { |
|
|
|
const json = {} |
|
|
|
json.device_id = item.device_id |
|
|
|
json.device_id = item.device_id || item.deviceId |
|
|
|
return json |
|
|
|
}) |
|
|
|
} |
|
|
@ -528,7 +525,7 @@ export default { |
|
|
|
if (this.selectedMaterial) { |
|
|
|
this.form.release_materialDTOs = this.selectedMaterial.map((item, index) => { |
|
|
|
const json = {} |
|
|
|
if (item.material_type == 0) { |
|
|
|
if (item.material_type == 0 || item.type == 0) { |
|
|
|
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 |
|
|
@ -537,17 +534,21 @@ export default { |
|
|
|
json.effect = 0 |
|
|
|
json.bgm_path = null |
|
|
|
} |
|
|
|
json.material_id = item.material_id |
|
|
|
json.material_name = item.material_name |
|
|
|
json.img_path = item.img_path |
|
|
|
json.file_size = item.file_size |
|
|
|
json.rm_id = null |
|
|
|
json.material_id = item.material_id || item.id |
|
|
|
json.material_name = item.material_name || item.name |
|
|
|
json.img_path = item.img_path || item.imgPath |
|
|
|
json.file_size = item.file_size || item.fileSize |
|
|
|
if (this.release_id) { |
|
|
|
json.rm_id = this.isEditMaterial[index].id |
|
|
|
} else { |
|
|
|
json.rm_id = null |
|
|
|
} |
|
|
|
json.ranking = index + 1 |
|
|
|
return json |
|
|
|
}) |
|
|
|
// 判断最外层是否有bgm |
|
|
|
const isBgm = this.selectedMaterial.find(item => { |
|
|
|
return item.material_type == 2 |
|
|
|
return item.material_type == 2 || item.type == 2 |
|
|
|
}) |
|
|
|
if (isBgm) { |
|
|
|
this.form.bgm_main = isBgm.deposit_url |
|
|
@ -599,7 +600,7 @@ export default { |
|
|
|
this.deviceTags.push(tag) |
|
|
|
} else { |
|
|
|
const result = this.deviceTags.find((item) => { |
|
|
|
return item == tag |
|
|
|
return (item.device_id || item.deviceId) == tag.device_id |
|
|
|
}) |
|
|
|
if (!result) { |
|
|
|
this.deviceTags.push(tag) |
|
|
@ -629,13 +630,6 @@ export default { |
|
|
|
getMaterialByType(params).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.audioListData = res.data.content |
|
|
|
// 素材类型格式处理 |
|
|
|
this.audioListData.forEach((item, key) => { |
|
|
|
this.materialPostfix[key] = item.deposit_url.substring( |
|
|
|
item.deposit_url.lastIndexOf('.') + 1, |
|
|
|
item.deposit_url.length |
|
|
|
) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
message: res.msg, |
|
|
@ -712,7 +706,7 @@ export default { |
|
|
|
if (!this.isMainBgm) { |
|
|
|
this.audioListData[index].material_type = 2 |
|
|
|
const resultIndex = this.selectedMaterial.findIndex((item, key) => { |
|
|
|
return item.material_type == 2 |
|
|
|
return item.material_type == 2 || item.type == 2 |
|
|
|
}) |
|
|
|
if (resultIndex == -1) { |
|
|
|
this.selectedMaterial.push(this.audioListData[index]) |
|
|
@ -751,7 +745,6 @@ export default { |
|
|
|
// 子菜单-tab |
|
|
|
tabItem(index) { |
|
|
|
this.activeItemIndex = index |
|
|
|
console.log(this.activeItemIndex) |
|
|
|
}, |
|
|
|
// 多选btn |
|
|
|
multiSelectBtn(type) { |
|
|
@ -777,13 +770,6 @@ export default { |
|
|
|
this.selectContVisible = false |
|
|
|
this.selectedMaterial = [] |
|
|
|
this.selectedMaterial = this.$refs.MaterialList.selectedMaterial |
|
|
|
// 素材类型格式处理 |
|
|
|
this.selectedMaterial.forEach((item, key) => { |
|
|
|
this.materialPostfix[key] = item.deposit_url.substring( |
|
|
|
item.deposit_url.lastIndexOf('.') + 1, |
|
|
|
item.deposit_url.length |
|
|
|
) |
|
|
|
}) |
|
|
|
localStorage.setItem('selectedMaterial', JSON.stringify(this.selectedMaterial)) |
|
|
|
this.mulitText = '多选' |
|
|
|
}, |
|
|
|