no message
This commit is contained in:
parent
5c68caa18a
commit
f626160eb5
@ -28,7 +28,8 @@
|
|||||||
:schedules="calendarTasks"
|
:schedules="calendarTasks"
|
||||||
@beforeCreateSchedule="onBeforeCreateSchedule"
|
@beforeCreateSchedule="onBeforeCreateSchedule"
|
||||||
@beforeClickSchedule="onBeforeClickSchedule"
|
@beforeClickSchedule="onBeforeClickSchedule"
|
||||||
@beforeUpdateSchedule="onBeforeUpdateSchedule"/>
|
@beforeUpdateSchedule="onBeforeUpdateSchedule"
|
||||||
|
disable-click/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -145,9 +146,7 @@ export default {
|
|||||||
time
|
time
|
||||||
}).then(({data}) => {
|
}).then(({data}) => {
|
||||||
this.scheduleLoad--;
|
this.scheduleLoad--;
|
||||||
data.data.some((task) => {
|
this.$store.dispatch("saveCalendarTask", data.data)
|
||||||
this.$store.dispatch("saveCalendarTask", task)
|
|
||||||
});
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.scheduleLoad--;
|
this.scheduleLoad--;
|
||||||
})
|
})
|
||||||
|
@ -294,7 +294,7 @@
|
|||||||
maxWidth: '640px'
|
maxWidth: '640px'
|
||||||
}"
|
}"
|
||||||
:mask-closable="false">
|
:mask-closable="false">
|
||||||
<TaskAdd ref="add" v-model="addData"/>
|
<TaskAdd ref="add" v-model="addData" @on-add="onAddTask"/>
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
<Button type="default" @click="addShow=false">{{$L('取消')}}</Button>
|
<Button type="default" @click="addShow=false">{{$L('取消')}}</Button>
|
||||||
<Button type="primary" :loading="taskLoad > 0" @click="onAddTask">{{$L('添加')}}</Button>
|
<Button type="primary" :loading="taskLoad > 0" @click="onAddTask">{{$L('添加')}}</Button>
|
||||||
@ -641,6 +641,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onAddTask() {
|
onAddTask() {
|
||||||
|
if (!this.addData.name) {
|
||||||
|
$A.messageError("任务描述不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.taskLoad++;
|
this.taskLoad++;
|
||||||
this.$store.dispatch("taskAdd", this.addData).then(({msg}) => {
|
this.$store.dispatch("taskAdd", this.addData).then(({msg}) => {
|
||||||
$A.messageSuccess(msg);
|
$A.messageSuccess(msg);
|
||||||
@ -676,6 +680,9 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$refs.add.defaultPriority();
|
this.$refs.add.defaultPriority();
|
||||||
this.addShow = true;
|
this.addShow = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.add.$refs.input.focus();
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
addColumnOpen() {
|
addColumnOpen() {
|
||||||
|
@ -4,11 +4,13 @@
|
|||||||
<FormItem :label="$L('任务描述')">
|
<FormItem :label="$L('任务描述')">
|
||||||
<Input
|
<Input
|
||||||
v-model="value.name"
|
v-model="value.name"
|
||||||
|
ref="input"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:rows="1"
|
:rows="1"
|
||||||
:autosize="{ minRows: 1, maxRows: 3 }"
|
:autosize="{ minRows: 1, maxRows: 3 }"
|
||||||
:maxlength="255"
|
:maxlength="255"
|
||||||
:placeholder="$L('必填')"></Input>
|
:placeholder="$L('必填')"
|
||||||
|
@on-keydown="onKeydown"/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem :label="$L('任务详情')">
|
<FormItem :label="$L('任务详情')">
|
||||||
<TEditor
|
<TEditor
|
||||||
@ -235,6 +237,15 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onKeydown(e) {
|
||||||
|
if (e.keyCode === 13) {
|
||||||
|
if (e.shiftKey) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
e.preventDefault();
|
||||||
|
this.$emit("on-add")
|
||||||
|
}
|
||||||
|
},
|
||||||
addSubTask() {
|
addSubTask() {
|
||||||
if (this.subName.trim() !== '') {
|
if (this.subName.trim() !== '') {
|
||||||
this.value.subtasks.push({
|
this.value.subtasks.push({
|
||||||
|
16
resources/assets/js/store/actions.js
vendored
16
resources/assets/js/store/actions.js
vendored
@ -403,9 +403,16 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 保存任务信息(日历任务)
|
* 保存任务信息(日历任务)
|
||||||
* @param state
|
* @param state
|
||||||
|
* @param dispatch
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
saveCalendarTask({state}, data) {
|
saveCalendarTask({state, dispatch}, data) {
|
||||||
|
if (state.method.isArray(data)) {
|
||||||
|
data.forEach((task) => {
|
||||||
|
dispatch("saveCalendarTask", task)
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
let task = {
|
let task = {
|
||||||
id: data.id,
|
id: data.id,
|
||||||
calendarId: String(data.project_id),
|
calendarId: String(data.project_id),
|
||||||
@ -431,6 +438,9 @@ export default {
|
|||||||
task.bgColor = "#fef0f0"
|
task.bgColor = "#fef0f0"
|
||||||
task.priority+= '<span class="overdue">' + $A.L('超期未完成') + '</span>';
|
task.priority+= '<span class="overdue">' + $A.L('超期未完成') + '</span>';
|
||||||
}
|
}
|
||||||
|
if (!task.borderColor) {
|
||||||
|
task.borderColor = task.bgColor;
|
||||||
|
}
|
||||||
let index = state.calendarTask.findIndex(({id}) => id === data.id);
|
let index = state.calendarTask.findIndex(({id}) => id === data.id);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
state.calendarTask.splice(index, 1, Object.assign(state.calendarTask[index], task))
|
state.calendarTask.splice(index, 1, Object.assign(state.calendarTask[index], task))
|
||||||
@ -504,7 +514,7 @@ export default {
|
|||||||
const {content} = result.data;
|
const {content} = result.data;
|
||||||
state.projectTaskContent[task_id] = content;
|
state.projectTaskContent[task_id] = content;
|
||||||
if (task_id == state.projectOpenTask.id) {
|
if (task_id == state.projectOpenTask.id) {
|
||||||
state.projectOpenTask = Object.assign({}, state.projectOpenTask, {content: content});
|
state.projectOpenTask = Object.assign({}, state.projectOpenTask, {content: content || ''});
|
||||||
}
|
}
|
||||||
resolve(result)
|
resolve(result)
|
||||||
}).catch(result => {
|
}).catch(result => {
|
||||||
@ -628,7 +638,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dispatch("saveCalendarTask", task);
|
dispatch("saveTask", task);
|
||||||
dispatch("getProjectOne", task.project_id);
|
dispatch("getProjectOne", task.project_id);
|
||||||
resolve(result)
|
resolve(result)
|
||||||
}).catch(result => {
|
}).catch(result => {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: 36px;
|
margin-bottom: 24px;
|
||||||
.project-title {
|
.project-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -81,8 +81,8 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
margin-top: -18px;
|
margin-top: -6px;
|
||||||
margin-bottom: 6px;
|
margin-bottom: -18px;
|
||||||
padding-right: 260px;
|
padding-right: 260px;
|
||||||
}
|
}
|
||||||
.project-switch {
|
.project-switch {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user