提交 ce50ac97 authored 作者: lihuihui's avatar lihuihui

update

上级 eea3a471
...@@ -92,8 +92,7 @@ export default { ...@@ -92,8 +92,7 @@ export default {
] ]
} }
}, },
created() { created() {},
},
mounted() { mounted() {
if (Object.keys(this.data).length) { if (Object.keys(this.data).length) {
this.dataEcho() this.dataEcho()
...@@ -156,6 +155,7 @@ export default { ...@@ -156,6 +155,7 @@ export default {
}, },
// 传回父组件需要提交缓存的数据 // 传回父组件需要提交缓存的数据
makePreview() { makePreview() {
let flag = true
const params = { const params = {
titleParams: this.titleParams, titleParams: this.titleParams,
imgParams: this.imgParams, imgParams: this.imgParams,
...@@ -163,16 +163,31 @@ export default { ...@@ -163,16 +163,31 @@ export default {
btnParams: this.btnParams btnParams: this.btnParams
} }
for (const data in params) { for (const data in params) {
console.log(params[data], '123') if (params[data].show !== false) {
if (params[data].show !== false || params[data].textValue === '') { flag = false
} else {
if (!params.titleParams.textValue || !params.describeParams.textValue || !params.btnParams.textValue) {
flag = false
} else {
if (
params.titleParams.textValue === '' ||
params.describeParams.textValue === '' ||
params.btnParams.textValue === ''
) {
flag = false
}
}
}
}
if (flag) {
return params
} else {
this.$message({ this.$message({
message: '请编辑主题', message: '请编辑主题',
type: 'warning' type: 'warning'
}) })
return false return false
} }
}
return params
}, },
// 上传图片 // 上传图片
uploadImg() { uploadImg() {
......
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
}) })
} else if (this.data.index === 0) { } else if (this.data.index === 0) {
console.log(this.data) console.log(this.data)
if (this.data.date === '' || this.data.time === '' || this.data.time === null) { if (this.data.date === '' || this.data.date === null || this.data.time === '' || this.data.time === null) {
flag = false flag = false
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论