no message

This commit is contained in:
kuaifan 2021-06-17 12:31:38 +08:00
parent 5c68caa18a
commit f626160eb5
5 changed files with 39 additions and 12 deletions

View File

@ -28,7 +28,8 @@
:schedules="calendarTasks"
@beforeCreateSchedule="onBeforeCreateSchedule"
@beforeClickSchedule="onBeforeClickSchedule"
@beforeUpdateSchedule="onBeforeUpdateSchedule"/>
@beforeUpdateSchedule="onBeforeUpdateSchedule"
disable-click/>
</div>
</div>
</template>
@ -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--;
})

View File

@ -294,7 +294,7 @@
maxWidth: '640px'
}"
:mask-closable="false">
<TaskAdd ref="add" v-model="addData"/>
<TaskAdd ref="add" v-model="addData" @on-add="onAddTask"/>
<div slot="footer">
<Button type="default" @click="addShow=false">{{$L('取消')}}</Button>
<Button type="primary" :loading="taskLoad > 0" @click="onAddTask">{{$L('添加')}}</Button>
@ -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() {

View File

@ -4,11 +4,13 @@
<FormItem :label="$L('任务描述')">
<Input
v-model="value.name"
ref="input"
type="textarea"
:rows="1"
:autosize="{ minRows: 1, maxRows: 3 }"
:maxlength="255"
:placeholder="$L('必填')"></Input>
:placeholder="$L('必填')"
@on-keydown="onKeydown"/>
</FormItem>
<FormItem :label="$L('任务详情')">
<TEditor
@ -235,6 +237,15 @@ export default {
}
}
},
onKeydown(e) {
if (e.keyCode === 13) {
if (e.shiftKey) {
return;
}
e.preventDefault();
this.$emit("on-add")
}
},
addSubTask() {
if (this.subName.trim() !== '') {
this.value.subtasks.push({

View File

@ -403,9 +403,16 @@ export default {
/**
* 保存任务信息日历任务
* @param state
* @param dispatch
* @param data
*/
saveCalendarTask({state}, data) {
saveCalendarTask({state, dispatch}, data) {
if (state.method.isArray(data)) {
data.forEach((task) => {
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+= '<span class="overdue">' + $A.L('超期未完成') + '</span>';
}
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 => {

View File

@ -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 {