Commit 796582f4 authored by 张伯涛's avatar 张伯涛

bug修改

parent 78f673a5
...@@ -172,6 +172,7 @@ export default { ...@@ -172,6 +172,7 @@ export default {
}, },
data() { data() {
return { return {
uploadSucess: false,
videoShow: false, videoShow: false,
isDelFile: false, isDelFile: false,
fileList: [], fileList: [],
...@@ -330,12 +331,14 @@ export default { ...@@ -330,12 +331,14 @@ export default {
}) })
}, },
handleUploadVideo(file) { handleUploadVideo(file) {
this.uploadSucess = false
const formData = new FormData() const formData = new FormData()
formData.append('file', file.file) formData.append('file', file.file)
formData.append('temp', 'videoInformation') formData.append('temp', 'videoInformation')
uploadPublic(formData).then(res => { uploadPublic(formData).then(res => {
console.log('handleUploadVideo', res) console.log('handleUploadVideo', res)
this.$message.success('上传成功') this.$message.success('上传成功')
this.uploadSucess = true
this.videoUrl = res.data.businessId this.videoUrl = res.data.businessId
this.form.videoUrlId = res.data.businessId this.form.videoUrlId = res.data.businessId
this.fileList = [] this.fileList = []
...@@ -496,54 +499,61 @@ export default { ...@@ -496,54 +499,61 @@ export default {
}, },
// 发布方法 // 发布方法
publish() { publish() {
// 拷贝form if (this.uploadSucess === true) {
const form = JSON.parse(JSON.stringify(this.form)) // 拷贝form
const form = JSON.parse(JSON.stringify(this.form))
// 转换时间格式 console.log('11111', this.form.videoUrlId)
this.pubLoading = true // 转换时间格式
this.$refs.deviceFormRef.validate(valid => { this.pubLoading = true
if (valid) { this.$refs.deviceFormRef.validate(valid => {
if (this.form.businessId !== undefined) { if (valid) {
// 编辑 if (this.form.businessId !== undefined) {
form.videoType = '1' // 编辑
form.unitId = this.$route.query.unitId form.videoType = '1'
updateSysContentNewsInformation(form).then(res => { form.unitId = this.$route.query.unitId
if (res.code === 200) { updateSysContentNewsInformation(form).then(res => {
this.$message({ if (res.code === 200) {
message: '保存成功', this.$message({
type: 'success' message: '保存成功',
}) type: 'success'
})
this.pubLoading = false
this.$router.push({
path: '/contentManagement/videoInformation/index'
})
}
}).catch(() => {
this.pubLoading = false this.pubLoading = false
this.$router.push({ })
path: '/contentManagement/videoInformation/index' } else {
}) form.videoType = '1'
} form.tenant = this.userId
}).catch(() => { form.unitId = this.$route.query.unitId
this.pubLoading = false addSysContentNewsInformation(form).then(res => {
}) if (res.code === 200) {
} else { this.$message({
form.videoType = '1' message: '保存成功',
form.tenant = this.userId type: 'success'
form.unitId = this.$route.query.unitId })
addSysContentNewsInformation(form).then(res => { this.pubLoading = false
if (res.code === 200) { this.$router.push({
this.$message({ path: '/contentManagement/videoInformation/index'
message: '保存成功', })
type: 'success' }
}) }).catch(() => {
this.pubLoading = false this.pubLoading = false
this.$router.push({ })
path: '/contentManagement/videoInformation/index' }
}) } else {
} this.pubLoading = false
}).catch(() => {
this.pubLoading = false
})
} }
} else { })
this.pubLoading = false } else {
} this.$message({
}) type: 'error',
message: '请等上传完视频再发布'
})
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment