|
@ -142,6 +142,12 @@ |
|
|
> |
|
|
> |
|
|
<i class="el-icon-plus" /> |
|
|
<i class="el-icon-plus" /> |
|
|
</el-upload> |
|
|
</el-upload> |
|
|
|
|
|
<div |
|
|
|
|
|
v-if="validation === false" |
|
|
|
|
|
style="padding-left: 10px; color: red" |
|
|
|
|
|
> |
|
|
|
|
|
{{ dislabel_cover.msg }} |
|
|
|
|
|
</div> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
<el-form-item label="banner" prop="image" required> |
|
|
<el-form-item label="banner" prop="image" required> |
|
@ -163,6 +169,12 @@ |
|
|
> |
|
|
> |
|
|
<i class="el-icon-plus" /> |
|
|
<i class="el-icon-plus" /> |
|
|
</el-upload> |
|
|
</el-upload> |
|
|
|
|
|
<div |
|
|
|
|
|
v-if="validation_banner === false" |
|
|
|
|
|
style="padding-left: 10px; color: red" |
|
|
|
|
|
> |
|
|
|
|
|
{{ dislabel_banner.msg }} |
|
|
|
|
|
</div> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div class="drawer__footer"> |
|
|
<div class="drawer__footer"> |
|
@ -222,22 +234,36 @@ export default { |
|
|
searchArticleLoading: false, |
|
|
searchArticleLoading: false, |
|
|
articles: [], |
|
|
articles: [], |
|
|
validation: true, |
|
|
validation: true, |
|
|
|
|
|
validation_banner: true, |
|
|
|
|
|
dislabel_banner: {}, |
|
|
|
|
|
dislabel_cover: {}, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
this.getList(); |
|
|
this.getList(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
watch: { |
|
|
|
|
|
dialogFormVisible(newVal) { |
|
|
|
|
|
if (newVal === false) { |
|
|
|
|
|
this.validation = true; |
|
|
|
|
|
this.validation_banner = true; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 验证图片宽高 |
|
|
// 验证图片宽高 |
|
|
async validationImg(file) { |
|
|
async validationImg(file) { |
|
|
let res = await this.$getImgWidth(file, "subjectCover"); |
|
|
let res = await this.$getImgWidth(file, "subjectCover"); |
|
|
this.validation = res; |
|
|
|
|
|
return res; |
|
|
|
|
|
|
|
|
this.validation = res.validation; |
|
|
|
|
|
console.log(res); |
|
|
|
|
|
this.dislabel_cover = res; |
|
|
|
|
|
return res.validation; |
|
|
}, |
|
|
}, |
|
|
async validationImages(file) { |
|
|
async validationImages(file) { |
|
|
let res = await this.$getImgWidth(file, "subjectBanner"); |
|
|
let res = await this.$getImgWidth(file, "subjectBanner"); |
|
|
this.validation = res; |
|
|
|
|
|
return res; |
|
|
|
|
|
|
|
|
this.validation_banner = res.validation; |
|
|
|
|
|
this.dislabel_banner = res; |
|
|
|
|
|
return res.validation; |
|
|
}, |
|
|
}, |
|
|
getList() { |
|
|
getList() { |
|
|
this.listLoading = true; |
|
|
this.listLoading = true; |
|
@ -361,7 +387,7 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
uploadSuccess(response, file) { |
|
|
uploadSuccess(response, file) { |
|
|
if (this.validation && response.state == "SUCCESS") { |
|
|
|
|
|
|
|
|
if (this.validation_banner && response.state == "SUCCESS") { |
|
|
this.temp.image = response.url; |
|
|
this.temp.image = response.url; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|