feat:任务执行执行状态加载动画添加
This commit is contained in:
@@ -37,20 +37,20 @@ const branchLoading = ref(false)
|
|||||||
// Mock 数据配置
|
// Mock 数据配置
|
||||||
const USE_MOCK_DATA = true
|
const USE_MOCK_DATA = true
|
||||||
|
|
||||||
// 节点和边数据(改为 ref 以支持动态添加)
|
// 节点和边数据
|
||||||
const nodes = ref<Node[]>([])
|
const nodes = ref<Node[]>([])
|
||||||
const edges = ref<Edge[]>([])
|
const edges = ref<Edge[]>([])
|
||||||
|
|
||||||
// 🆕 当前选中的节点ID集合(用于高亮整条分支)
|
//当前选中的节点ID集合
|
||||||
const selectedNodeIds = ref<Set<string>>(new Set())
|
const selectedNodeIds = ref<Set<string>>(new Set())
|
||||||
|
|
||||||
// 用于防止重复同步的标志
|
// 用于防止重复同步的标志
|
||||||
let isSyncing = false
|
let isSyncing = false
|
||||||
|
|
||||||
// 🆕 初始化标记,避免重复初始化(使用 sessionStorage 持久化)
|
//初始化标记,避免重复初始化
|
||||||
const BRANCHES_INIT_KEY_PREFIX = 'plan-task-branches-initialized-'
|
const BRANCHES_INIT_KEY_PREFIX = 'plan-task-branches-initialized-'
|
||||||
|
|
||||||
// 🆕 最后选中的分支ID(使用 sessionStorage 持久化)
|
// 🆕 最后选中的分支ID
|
||||||
const LAST_SELECTED_BRANCH_KEY = 'plan-task-last-selected-branch'
|
const LAST_SELECTED_BRANCH_KEY = 'plan-task-last-selected-branch'
|
||||||
|
|
||||||
// ==================== 辅助函数定义 ====================
|
// ==================== 辅助函数定义 ====================
|
||||||
@@ -591,10 +591,10 @@ const syncBranchesToStore = () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (currentTask.value) {
|
if (currentTask.value) {
|
||||||
initializeFlow()
|
initializeFlow()
|
||||||
// 适应视图
|
// 适应视图 - 增加padding让节点显示更小
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
fit({ padding: 0.15, duration: 300 })
|
fit({ padding: 0.4, duration: 300 })
|
||||||
}, 100)
|
}, 100)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1277,13 +1277,14 @@ onConnect(params => addEdges(params))
|
|||||||
v-model:nodes="nodes"
|
v-model:nodes="nodes"
|
||||||
v-model:edges="edges"
|
v-model:edges="edges"
|
||||||
:delete-key-code="null"
|
:delete-key-code="null"
|
||||||
:default-viewport="{ zoom: 1, x: 0, y: 0 }"
|
:default-viewport="{ zoom: 0.3, x: 0, y: 0 }"
|
||||||
fit-view-on-init
|
:min-zoom="0.2"
|
||||||
|
:max-zoom="4"
|
||||||
@node-click="onNodeClick"
|
@node-click="onNodeClick"
|
||||||
class="vue-flow-container"
|
class="vue-flow-container"
|
||||||
>
|
>
|
||||||
<!-- <Background /> -->
|
<!-- <Background /> -->
|
||||||
<Controls />
|
<!-- <Controls /> -->
|
||||||
|
|
||||||
<template #node-root="nodeProps">
|
<template #node-root="nodeProps">
|
||||||
<div class="root-task-node-wrapper">
|
<div class="root-task-node-wrapper">
|
||||||
|
|||||||
@@ -440,11 +440,12 @@ defineExpose({
|
|||||||
:class="executeBtnClass"
|
:class="executeBtnClass"
|
||||||
:color="variables.tertiary"
|
:color="variables.tertiary"
|
||||||
:title="executeBtnTitle"
|
:title="executeBtnTitle"
|
||||||
:disabled="!agentsStore.agentRawPlan.data"
|
:disabled="!agentsStore.agentRawPlan.data || loading"
|
||||||
@mouseenter="handleExecuteMouseEnter"
|
@mouseenter="handleExecuteMouseEnter"
|
||||||
@click="handleRun"
|
@click="handleRun"
|
||||||
>
|
>
|
||||||
<svg-icon icon-class="action" />
|
<svg-icon v-if="loading" icon-class="loading" class="animate-spin" />
|
||||||
|
<svg-icon v-else icon-class="action" />
|
||||||
<span v-if="showExecuteText" class="btn-text">任务执行</span>
|
<span v-if="showExecuteText" class="btn-text">任务执行</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user