feat: 待办事项直接新增至列表

This commit is contained in:
xiaozzzi
2024-02-06 12:20:07 +03:00
parent 27e7fcea0c
commit 70974929b1
2 changed files with 14 additions and 5 deletions

View File

@@ -13,7 +13,7 @@
v-if="countComp != 0"
:class="['completed', viewStyle.isGlobalShadow ? '' : 'bar-light']"
:style="{ width: `calc(${(countComp / countTotal) * 100}% - 6px)` }"></div>
<div v-if="countTotal == 0" class="completed" style="width: calc(100% - 6px)"></div>
<div v-if="countTotal == 0" :class="['completed', viewStyle.isGlobalShadow ? '' : 'bar-light']" style="width: calc(100% - 6px)"></div>
</bl-row>
<bl-row height="24px" just="space-between" align="center" style="padding: 0 10px">
<div class="task-name">{{ curTodo.todoName }}</div>
@@ -65,7 +65,10 @@
ref="WaitRef">
<div class="tasks-title">
<span>待办</span>
<span class="add-icon iconbl bl-a-addline-line" @click="showTaskInfoDialog()"></span>
<div>
<span class="add-icon iconbl bl-a-addline-line" @click="quickAdd()"></span>
<span class="add-icon iconbl bl-a-pageadd-line" @click="showTaskInfoDialog()"></span>
</div>
</div>
<div class="tasks-sub-title" align="flex-start">
@@ -291,7 +294,7 @@
import { useConfigStore } from '@renderer/stores/config'
import { computed, nextTick, onMounted, onUnmounted, Ref, ref } from 'vue'
import { isBlank, isNotBlank } from '@renderer/assets/utils/obj'
import { tasksApi, updTaskApi, toWaitingApi, toProcessingApi, toCompletedApi, exportTodoApi, taskTransferApi } from '@renderer/api/todo'
import { tasksApi, addTaskApi, updTaskApi, toWaitingApi, toProcessingApi, toCompletedApi, exportTodoApi, taskTransferApi } from '@renderer/api/todo'
import { TaskInfo, TaskStatus, TodoType } from './scripts/types'
import { getDateFormat } from '@renderer/assets/utils/util'
import { isEmpty } from 'lodash'
@@ -368,6 +371,12 @@ const showTaskInfoDialog = (id?: string) => {
})
}
const quickAdd = () => {
addTaskApi({ todoId: curTodo.value.todoId, taskName: '新待办事项' }).then((_resp) => {
getTasks(curTodo.value.todoId)
})
}
/**
* 保存数据后的回调
* @param data

View File

@@ -104,7 +104,7 @@
}
.add-icon {
@include font(13px, 300);
@include font(16px, 300);
padding: 0 3px;
color: var(--bl-text-color-light);
cursor: pointer;
@@ -124,7 +124,7 @@
padding: 0 10px;
.tasks-title {
@include flex(row, space-between, center);
@include flex(row, space-between, flex-end);
@include box(270px, 30px);
@include font(28px, 700);
text-shadow: var(--bl-text-shadow);