zunnzunn / vue-ganttastic

Simple, interactive and highly customizable Gantt chart component for Vue 3
https://zunnzunn.github.io/vue-ganttastic/
565 stars 141 forks source link

Issue with 'no-overlap' and 'push-on-overlap' functionalities #108

Open jgurnett opened 5 months ago

jgurnett commented 5 months ago

Currently I am unable to implement no-overlap, when I do it throws this console error and the bars overlap

Uncaught TypeError: D.isBetween is not a function
    at @infectoone_vue-ganttastic.js?v=80fab204:1154:20
    at Proxy.find (<anonymous>)
    at g (@infectoone_vue-ganttastic.js?v=80fab204:1150:28)
    at @infectoone_vue-ganttastic.js?v=80fab204:1197:33
    at Map.forEach (<anonymous>)
    at B (@infectoone_vue-ganttastic.js?v=80fab204:1196:7)
    at v (@infectoone_vue-ganttastic.js?v=80fab204:1181:5)
    at v (@infectoone_vue-ganttastic.js?v=80fab204:1088:141)

I am dynamically creating my rows and my data looks something like this

workers = [{
    name: "workerName",
    events: [
        {
             myBeginDate: "2024-04-12 13:00",
             myEndDate: "2022-04-12 13:00",
             ganttBarConfig: {
                 id: "eventId",
                label: "eventTitle",
             },
        },
    ]
}]

here is my vue 3 code

  <g-gantt-chart
    :chart-start="startDate"
    :chart-end="endDate"
    :precision="selectedPrecision"
    no-overlap
    bar-start="startDate"
    bar-end="endDate"
    @dblclick-bar="doubleClickBar"
    @dragend-bar="handleDragEnd"
  >
    <g-gantt-row
      v-for="(worker, index) in workers"
      :key="index"
      :label="worker.name"
      :bars="worker.events"
      :highlight-on-hover="true"
    />
</g-gantt-chart>

Any insight why this is happening?

duoyeyasuo commented 4 months ago

I also encountered this problem, please ask the author do you have a solution

duoyeyasuo commented 4 months ago

This is a very good plugin, I hope you can make more and more powerful

Pedrocanoas commented 4 months ago

I've tried to reproduce your bug, but I couldn't. Can you share some more explain?

jgurnett commented 4 months ago

I am using

duoyeyasuo commented 4 months ago

I am using node 18.12.1

duoyeyasuo commented 4 months ago

An error occurred when I set no overlay

duoyeyasuo commented 4 months ago

Uncaught TypeError: D.isBetween is not a function at @infectoone_vue-ganttastic.js?v=80fab204:1154:20 at Proxy.find () at g (@infectoone_vue-ganttastic.js?v=80fab204:1150:28) at @infectoone_vue-ganttastic.js?v=80fab204:1197:33 at Map.forEach () at B (@infectoone_vue-ganttastic.js?v=80fab204:1196:7) at v (@infectoone_vue-ganttastic.js?v=80fab204:1181:5) at v (@infectoone_vue-ganttastic.js?v=80fab204:1088:141)

duoyeyasuo commented 4 months ago

I hope you can help me solve it

Pedrocanoas commented 4 months ago

I still haven't been able to reproduce the bug, even though I've tried. but let's give it a try...

Did you check the startDate/endDate of the bar? because the isBetween function located in useBarDragManagement requires the start and end dates of the bar

Another possibility, have you been checked de format date?

If it's still continue, can you run this repo and tried the same values in playground

duoyeyasuo commented 4 months ago

What to do if both drag and double-click events are triggered simultaneously

duoyeyasuo commented 4 months ago

I wouldn't have had this problem before, using the problems that occurred with Node16.20 and Vue Ganttastic 2.3.2

duoyeyasuo commented 4 months ago

I still haven't been able to reproduce the bug, even though I've tried. but let's give it a try...

Did you check the startDate/endDate of the bar? because the isBetween function located in useBarDragManagement requires the start and end dates of the bar

Another possibility, have you been checked de format date?

If it's still continue, can you run this repo and tried the same values in playground

Although my problem has not been solved yet, thank you very much