feat(board): 支持批量添加与批量删除任务
- 批量添加面板:一行一条,整批共用目标列、优先级、标签与截止日期 - 快速新增支持粘贴多行文本,直接拆成多条任务 - 多选模式支持全选可见任务、整批删除,撤销时连原顺序一起还原 - 批量创建与删除走 store 的批量方法,一次落盘、一次广播 - 补充单元测试与 E2E 用例
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onBeforeUnmount, ref, watch } from 'vue'
|
||||
|
||||
const props = defineProps<{ open: boolean; title?: string }>()
|
||||
const props = defineProps<{
|
||||
open: boolean
|
||||
title?: string
|
||||
/**
|
||||
* 打开时优先聚焦的元素(CSS 选择器)。
|
||||
* 默认聚焦面板内第一个可聚焦元素,也就是常驻在头部的「关闭」按钮;
|
||||
* 需要「一打开就能输入」的面板(如批量添加)可用它把焦点放到正文控件上。
|
||||
*/
|
||||
initialFocus?: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{ close: [] }>()
|
||||
|
||||
@@ -67,7 +76,10 @@ watch(
|
||||
previouslyFocused = document.activeElement as HTMLElement | null
|
||||
document.addEventListener('keydown', onDocumentKeydown, true)
|
||||
void nextTick(() => {
|
||||
const target = focusableElements()[0] ?? panelRef.value
|
||||
const preferred = props.initialFocus
|
||||
? (panelRef.value?.querySelector<HTMLElement>(props.initialFocus) ?? null)
|
||||
: null
|
||||
const target = preferred ?? focusableElements()[0] ?? panelRef.value
|
||||
target?.focus()
|
||||
})
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user