Skip to content

Commit ef29817

Browse files
authored
Merge pull request #412 from smellman/dev-370
#370 新規授業作成時に自動的に日付を入れる
2 parents 121e172 + a33512e commit ef29817

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

src/pages/edit/index.vue

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ type DataType = {
148148
classData: typeof vxm.classData
149149
editingMode: boolean
150150
editingVisibilityMode: boolean
151-
editPageValue: object
151+
editPageValue: editPageValueType
152152
editVisibilityDialogValue: object
153153
}
154154
@@ -158,6 +158,25 @@ type Computed = {
158158
lessonsGroupByPeriod: LessonsGroupedBy
159159
}
160160
161+
type editPageValueType = {
162+
isHidden: boolean
163+
lessonId: string
164+
date: string
165+
startTime: string
166+
endTime: string
167+
title: string
168+
subjectName: string
169+
subjectColor: string
170+
goal: string
171+
description: string
172+
videoUrl: string
173+
videoTitle: string
174+
videoThumbnailUrl: string
175+
pages: string
176+
materialsTitle: string
177+
materialsUrl: string
178+
}
179+
161180
const editPageValueDefault = {
162181
isHidden: false,
163182
lessonId: '',
@@ -218,6 +237,13 @@ export default Vue.extend({
218237
this.resetEditLessonScreen()
219238
},
220239
toggleScreen(): void {
240+
const date =
241+
this.editPageValue.date !== ''
242+
? this.editPageValue.date
243+
: dayjs(vxm.app.currentDate).format('YYYY-MM-DD')
244+
this.editPageValue = Object.assign({}, this.editPageValue, {
245+
date,
246+
})
221247
this.editingMode = !this.editingMode
222248
},
223249
closeModal(): void {

0 commit comments

Comments
 (0)