feat:任务大纲编辑文字悬浮边框重构

This commit is contained in:
liailing1026
2026-02-27 11:45:16 +08:00
parent c009db12a6
commit c14430cfae
6 changed files with 263 additions and 81 deletions

View File

@@ -3,8 +3,12 @@ import Task from './Task.vue'
import TaskTemplate from './TaskTemplate/index.vue'
import { nextTick, ref } from 'vue'
const taskRef = ref<{ currentTaskID: string }>()
const taskTemplateRef = ref<{ changeTask: () => void; clear: () => void }>()
const taskRef = ref<{ currentTaskID: string; restoreFromHistory: (plan: any) => void }>()
const taskTemplateRef = ref<{
changeTask: () => void
clear: () => void
openHistoryDialog: () => void
}>()
function handleSearch() {
nextTick(() => {
@@ -17,16 +21,34 @@ function getTaskID(): string {
return taskRef.value?.currentTaskID || ''
}
// 打开历史记录弹窗
function openHistoryDialog() {
taskTemplateRef.value?.openHistoryDialog()
}
// 处理历史任务恢复
function handleRestorePlan(plan: any) {
taskRef.value?.restoreFromHistory(plan)
}
defineExpose({
getTaskID
getTaskID,
openHistoryDialog
})
</script>
<template>
<div class="p-[24px] h-[calc(100%-60px)]">
<Task ref="taskRef" @search="handleSearch" @search-start="taskTemplateRef?.clear" />
<TaskTemplate ref="taskTemplateRef" :TaskID="taskRef?.currentTaskID" />
<Task
ref="taskRef"
@search="handleSearch"
@search-start="taskTemplateRef?.clear"
@open-history="openHistoryDialog"
/>
<TaskTemplate
ref="taskTemplateRef"
:TaskID="taskRef?.currentTaskID"
@restore="handleRestorePlan"
/>
</div>
</template>
<style scoped lang="scss"></style>