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

bug修改

parent 78f673a5
......@@ -172,6 +172,7 @@ export default {
},
data() {
return {
uploadSucess: false,
videoShow: false,
isDelFile: false,
fileList: [],
......@@ -330,12 +331,14 @@ export default {
})
},
handleUploadVideo(file) {
this.uploadSucess = false
const formData = new FormData()
formData.append('file', file.file)
formData.append('temp', 'videoInformation')
uploadPublic(formData).then(res => {
console.log('handleUploadVideo', res)
this.$message.success('上传成功')
this.uploadSucess = true
this.videoUrl = res.data.businessId
this.form.videoUrlId = res.data.businessId
this.fileList = []
......@@ -496,54 +499,61 @@ export default {
},
// 发布方法
publish() {
// 拷贝form
const form = JSON.parse(JSON.stringify(this.form))
// 转换时间格式
this.pubLoading = true
this.$refs.deviceFormRef.validate(valid => {
if (valid) {
if (this.form.businessId !== undefined) {
// 编辑
form.videoType = '1'
form.unitId = this.$route.query.unitId
updateSysContentNewsInformation(form).then(res => {
if (res.code === 200) {
this.$message({
message: '保存成功',
type: 'success'
})
if (this.uploadSucess === true) {
// 拷贝form
const form = JSON.parse(JSON.stringify(this.form))
console.log('11111', this.form.videoUrlId)
// 转换时间格式
this.pubLoading = true
this.$refs.deviceFormRef.validate(valid => {
if (valid) {
if (this.form.businessId !== undefined) {
// 编辑
form.videoType = '1'
form.unitId = this.$route.query.unitId
updateSysContentNewsInformation(form).then(res => {
if (res.code === 200) {
this.$message({
message: '保存成功',
type: 'success'
})
this.pubLoading = false
this.$router.push({
path: '/contentManagement/videoInformation/index'
})
}
}).catch(() => {
this.pubLoading = false
this.$router.push({
path: '/contentManagement/videoInformation/index'
})
}
}).catch(() => {
this.pubLoading = false
})
} else {
form.videoType = '1'
form.tenant = this.userId
form.unitId = this.$route.query.unitId
addSysContentNewsInformation(form).then(res => {
if (res.code === 200) {
this.$message({
message: '保存成功',
type: 'success'
})
})
} else {
form.videoType = '1'
form.tenant = this.userId
form.unitId = this.$route.query.unitId
addSysContentNewsInformation(form).then(res => {
if (res.code === 200) {
this.$message({
message: '保存成功',
type: 'success'
})
this.pubLoading = false
this.$router.push({
path: '/contentManagement/videoInformation/index'
})
}
}).catch(() => {
this.pubLoading = false
this.$router.push({
path: '/contentManagement/videoInformation/index'
})
}
}).catch(() => {
this.pubLoading = false
})
})
}
} else {
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