feat:冗余代码清理
This commit is contained in:
@@ -201,10 +201,8 @@ function clear() {
|
||||
jsplumb.reset()
|
||||
}
|
||||
|
||||
// 🆕 封装连线重绘方法
|
||||
// 封装连线重绘方法
|
||||
const redrawConnections = () => {
|
||||
console.log('🔄 重新绘制 jsplumb 连线')
|
||||
|
||||
// 等待 DOM 更新完成
|
||||
nextTick(() => {
|
||||
// 清除旧连线
|
||||
@@ -221,22 +219,20 @@ const redrawConnections = () => {
|
||||
})
|
||||
|
||||
jsplumb.connects(arr)
|
||||
console.log('✅ jsplumb 连线重绘完成,任务数:', collaborationProcess.value.length)
|
||||
}, 100)
|
||||
})
|
||||
}
|
||||
|
||||
// 🆕 监听 collaborationProcess 变化,自动重绘连线
|
||||
// 监听 collaborationProcess 变化,自动重绘连线
|
||||
watch(
|
||||
() => collaborationProcess,
|
||||
() => {
|
||||
console.log('🔍 collaborationProcess 发生变化,触发重绘')
|
||||
redrawConnections()
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
// 🆕 组件挂载后初始化连线
|
||||
// 组件挂载后初始化连线
|
||||
onMounted(() => {
|
||||
// 初始化时绘制连线
|
||||
nextTick(() => {
|
||||
@@ -246,7 +242,6 @@ onMounted(() => {
|
||||
arr.push(...handleCurrentTask(item, true))
|
||||
})
|
||||
jsplumb.connects(arr)
|
||||
console.log('✅ 初始化 jsplumb 连线完成')
|
||||
}, 100)
|
||||
})
|
||||
})
|
||||
@@ -440,7 +435,7 @@ defineExpose({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<BranchButton v-dev-only v-if="planReady" @click="openPlanModification" />
|
||||
<BranchButton v-if="planReady" @click="openPlanModification" />
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user