Merge pull request '이벤트 배너 수정 - 링크 지우기 추가' (#68) from test into main
Reviewed-on: #68
This commit is contained in:
commit
99d70cc8f7
|
@ -77,7 +77,7 @@
|
||||||
class="datepicker"
|
class="datepicker"
|
||||||
format="YYYY-MM-DD H:i"
|
format="YYYY-MM-DD H:i"
|
||||||
/>
|
/>
|
||||||
<div> ~ </div>
|
<div> ~</div>
|
||||||
<datetime
|
<datetime
|
||||||
v-model="event.endDate"
|
v-model="event.endDate"
|
||||||
class="datepicker"
|
class="datepicker"
|
||||||
|
@ -281,16 +281,17 @@ import datetime from 'vuejs-datetimepicker';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "EventView",
|
name: "EventView",
|
||||||
components: { datetime },
|
components: {datetime},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
is_loading: false,
|
is_loading: false,
|
||||||
is_modify: false,
|
is_modify: false,
|
||||||
events: [],
|
events: [],
|
||||||
event: { isAdult: '' },
|
event: {isAdult: ''},
|
||||||
show_write_dialog: false,
|
show_write_dialog: false,
|
||||||
show_delete_confirm_dialog: false,
|
show_delete_confirm_dialog: false,
|
||||||
|
selected_event: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -361,6 +362,7 @@ export default {
|
||||||
|
|
||||||
clickEvent(item) {
|
clickEvent(item) {
|
||||||
this.is_modify = true
|
this.is_modify = true
|
||||||
|
this.selected_event = item
|
||||||
this.event.id = item.id
|
this.event.id = item.id
|
||||||
this.event.thumbnailImageUrl = item.thumbnailImageUrl
|
this.event.thumbnailImageUrl = item.thumbnailImageUrl
|
||||||
this.event.detailImageUrl = item.detailImageUrl
|
this.event.detailImageUrl = item.detailImageUrl
|
||||||
|
@ -376,7 +378,8 @@ export default {
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
this.is_modify = false
|
this.is_modify = false
|
||||||
this.event = { isAdult: '' }
|
this.event = {isAdult: ''}
|
||||||
|
this.selected_event = {}
|
||||||
this.show_write_dialog = false
|
this.show_write_dialog = false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -440,7 +443,7 @@ export default {
|
||||||
this.notifySuccess('등록되었습니다.')
|
this.notifySuccess('등록되었습니다.')
|
||||||
this.page = 1
|
this.page = 1
|
||||||
await this.getEvents()
|
await this.getEvents()
|
||||||
this.event = { isAdult: '' }
|
this.event = {isAdult: ''}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||||
|
@ -457,7 +460,11 @@ export default {
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append("id", this.event.id)
|
formData.append("id", this.event.id)
|
||||||
|
|
||||||
if (this.event.title != null && this.event.title.trim().length > 0) {
|
if (
|
||||||
|
this.event.title != null &&
|
||||||
|
this.event.title.trim().length > 0 &&
|
||||||
|
this.selected_event.title !== this.event.title
|
||||||
|
) {
|
||||||
formData.append("title", this.event.title)
|
formData.append("title", this.event.title)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -477,7 +484,7 @@ export default {
|
||||||
formData.append("isPopup", this.event.isPopup)
|
formData.append("isPopup", this.event.isPopup)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.event.link != null && this.event.link.trim().length > 0) {
|
if (this.selected_event.link !== this.event.link) {
|
||||||
formData.append("link", this.event.link)
|
formData.append("link", this.event.link)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -485,11 +492,11 @@ export default {
|
||||||
formData.append("isAdult", JSON.parse(this.event.isAdult))
|
formData.append("isAdult", JSON.parse(this.event.isAdult))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.event.startDate != null) {
|
if (this.event.startDate != null && this.event.startDate !== this.selected_event.startDate) {
|
||||||
formData.append("startDate", this.event.startDate)
|
formData.append("startDate", this.event.startDate)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.event.endDate != null) {
|
if (this.event.endDate != null && this.event.endDate !== this.selected_event.endDate) {
|
||||||
formData.append("endDate", this.event.endDate)
|
formData.append("endDate", this.event.endDate)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,7 +506,7 @@ export default {
|
||||||
this.notifySuccess('수정되었습니다.')
|
this.notifySuccess('수정되었습니다.')
|
||||||
this.page = 1
|
this.page = 1
|
||||||
await this.getEvents()
|
await this.getEvents()
|
||||||
this.event = { isAdult: '' }
|
this.event = {isAdult: ''}
|
||||||
this.is_modify = false
|
this.is_modify = false
|
||||||
} else {
|
} else {
|
||||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||||
|
|
Loading…
Reference in New Issue