From e2a92db057ef2153f3e645e074f1e771987b2051 Mon Sep 17 00:00:00 2001 From: Gary Gu <garygu@Garydebijibendiannao.local> Date: Fri, 30 May 2025 10:35:53 +0800 Subject: [PATCH] feat: 优化数据 --- src/components/Gantt.vue | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/src/components/Gantt.vue b/src/components/Gantt.vue index d65cee0..83990c9 100644 --- a/src/components/Gantt.vue +++ b/src/components/Gantt.vue @@ -18,7 +18,7 @@ ><span class="color" style="background-color: rgb(14, 172, 81)"></span> </div> </div> - <div ref="gantt" style="height: 400px; font-size: 12px"></div> + <div ref="gantt" style="height: 100%; font-size: 12px"></div> </div> </template> @@ -30,6 +30,12 @@ export default { name: "Gantt", components: {}, + props: { + selectedId: { + type: String, + default: "", + }, + }, data() { return { taskslist: [], @@ -39,6 +45,16 @@ }, columnsShow: false, }; + }, + watch: { + selectedId: { + handler(newVal) { + console.log("甘特图接收到的数据:", newVal); + // 处理数据变化的逻辑 + }, + deep: true, // 深度监听对象内部变化 + immediate: true, // 立即执行一次 + }, }, mounted() { this.init(); //初始化 @@ -510,6 +526,7 @@ </script> <style lang="scss" scoped> .gantt-box { + height: calc(100% - 52px); background-color: rgba(0, 0, 0, 0.2); margin: 10px; color: #fff; -- Gitblit v1.9.3