|
|
@ -123,8 +123,9 @@ export default { |
|
|
|
newsImageUrl: '', |
|
|
|
sectionCode: '', |
|
|
|
allDeptIdsShow: [], |
|
|
|
newsUpDownState: '0' |
|
|
|
newsUpDownState: '' |
|
|
|
}, |
|
|
|
newsUpDownStateOld: '', |
|
|
|
time: [], |
|
|
|
options: [], |
|
|
|
categorys: [], |
|
|
@ -217,6 +218,10 @@ export default { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.dataForm = { ...this.dataForm, ...res.data } |
|
|
|
this.newsUpDownStateOld = this.dataForm.newsUpDownState |
|
|
|
if (new Date(this.dataForm.newsReleaseEndTime) < new Date()) { |
|
|
|
this.dataForm.newsUpDownState = '1' |
|
|
|
} |
|
|
|
this.getListCategory(this.dataForm.sectionCode) |
|
|
|
this.resetRegistTime() |
|
|
|
this.quillEditor.root.innerHTML = res.data.newsContent |
|
|
@ -281,6 +286,11 @@ export default { |
|
|
|
setRegistTime () { |
|
|
|
this.dataForm.newsReleaseStartTime = this.time[0] |
|
|
|
this.dataForm.newsReleaseEndTime = this.time[1] |
|
|
|
if (new Date(this.dataForm.newsReleaseEndTime) < new Date()) { |
|
|
|
this.dataForm.newsUpDownState = '1' |
|
|
|
} else if (this.newsUpDownStateOld == '0'){ |
|
|
|
this.dataForm.newsUpDownState = '0' |
|
|
|
} |
|
|
|
}, |
|
|
|
resetRegistTime () { |
|
|
|
this.time = [this.dataForm.newsReleaseStartTime.substr(0, 10), this.dataForm.newsReleaseEndTime.substr(0, 10)] |
|
|
|