Gary Gu
5 days ago e2a92db057ef2153f3e645e074f1e771987b2051
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;