diff --git a/resources/assets/js/pages/manage/calendar.vue b/resources/assets/js/pages/manage/calendar.vue index 28562c1d..f47f0668 100644 --- a/resources/assets/js/pages/manage/calendar.vue +++ b/resources/assets/js/pages/manage/calendar.vue @@ -28,7 +28,8 @@ :schedules="calendarTasks" @beforeCreateSchedule="onBeforeCreateSchedule" @beforeClickSchedule="onBeforeClickSchedule" - @beforeUpdateSchedule="onBeforeUpdateSchedule"/> + @beforeUpdateSchedule="onBeforeUpdateSchedule" + disable-click/> @@ -145,9 +146,7 @@ export default { time }).then(({data}) => { this.scheduleLoad--; - data.data.some((task) => { - this.$store.dispatch("saveCalendarTask", task) - }); + this.$store.dispatch("saveCalendarTask", data.data) }).catch(() => { this.scheduleLoad--; }) diff --git a/resources/assets/js/pages/manage/components/ProjectList.vue b/resources/assets/js/pages/manage/components/ProjectList.vue index 49a15f50..30a5f8b7 100644 --- a/resources/assets/js/pages/manage/components/ProjectList.vue +++ b/resources/assets/js/pages/manage/components/ProjectList.vue @@ -294,7 +294,7 @@ maxWidth: '640px' }" :mask-closable="false"> - +
@@ -641,6 +641,10 @@ export default { }, onAddTask() { + if (!this.addData.name) { + $A.messageError("任务描述不能为空"); + return; + } this.taskLoad++; this.$store.dispatch("taskAdd", this.addData).then(({msg}) => { $A.messageSuccess(msg); @@ -676,6 +680,9 @@ export default { } this.$refs.add.defaultPriority(); this.addShow = true; + this.$nextTick(() => { + this.$refs.add.$refs.input.focus(); + }) }, addColumnOpen() { diff --git a/resources/assets/js/pages/manage/components/TaskAdd.vue b/resources/assets/js/pages/manage/components/TaskAdd.vue index 6058b8d0..0077175a 100644 --- a/resources/assets/js/pages/manage/components/TaskAdd.vue +++ b/resources/assets/js/pages/manage/components/TaskAdd.vue @@ -4,11 +4,13 @@ + :placeholder="$L('必填')" + @on-keydown="onKeydown"/> { + dispatch("saveCalendarTask", task) + }); + return; + } let task = { id: data.id, calendarId: String(data.project_id), @@ -431,6 +438,9 @@ export default { task.bgColor = "#fef0f0" task.priority+= '' + $A.L('超期未完成') + ''; } + if (!task.borderColor) { + task.borderColor = task.bgColor; + } let index = state.calendarTask.findIndex(({id}) => id === data.id); if (index > -1) { state.calendarTask.splice(index, 1, Object.assign(state.calendarTask[index], task)) @@ -504,7 +514,7 @@ export default { const {content} = result.data; state.projectTaskContent[task_id] = content; if (task_id == state.projectOpenTask.id) { - state.projectOpenTask = Object.assign({}, state.projectOpenTask, {content: content}); + state.projectOpenTask = Object.assign({}, state.projectOpenTask, {content: content || ''}); } resolve(result) }).catch(result => { @@ -628,7 +638,7 @@ export default { } } } - dispatch("saveCalendarTask", task); + dispatch("saveTask", task); dispatch("getProjectOne", task.project_id); resolve(result) }).catch(result => { diff --git a/resources/assets/sass/pages/components/project-list.scss b/resources/assets/sass/pages/components/project-list.scss index b0f31c08..f5547148 100644 --- a/resources/assets/sass/pages/components/project-list.scss +++ b/resources/assets/sass/pages/components/project-list.scss @@ -11,7 +11,7 @@ display: flex; align-items: flex-start; justify-content: space-between; - margin-bottom: 36px; + margin-bottom: 24px; .project-title { display: flex; align-items: center; @@ -81,8 +81,8 @@ width: 100%; color: #999999; line-height: 24px; - margin-top: -18px; - margin-bottom: 6px; + margin-top: -6px; + margin-bottom: -18px; padding-right: 260px; } .project-switch {