feat:任务大纲编辑文字悬浮边框重构
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user