Gantt chart management method and device, storage medium and electronic equipment

By obtaining new instructions and mouse click positions in the Gantt chart, the time range of the task node is automatically adjusted to avoid overlapping, which solves the problem of poor flexibility in the new task node in the existing technology, and realizes the automatic avoidance of time overlapping when the task node is added.

CN119718131AActive Publication Date: 2025-03-28HANGZHOU MIANCHAO INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411757894.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-28
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

The existing Gantt chart management method is less flexible when new task nodes are added, and it is difficult to automatically avoid time overlap between task nodes.

Method used

By obtaining the newly added instructions and mouse click locations, determine the first and second time ranges of the task nodes, analyze the time range of the existing task nodes, automatically adjust the time range of the newly added task nodes to avoid overlap, and add the final time range to the task list.

Benefits of technology

It automatically avoids time overlap when new task nodes are added, and improves the flexibility and convenience of new task nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718131A_ABST
    Figure CN119718131A_ABST
Patent Text Reader

Abstract

The invention relates to a Gantt chart management method and device, a storage medium and electronic equipment, and relates to the technical field of Gantt charts, and the method comprises the steps: obtaining a newly-added instruction of a task node in a target progress bar in a target Gantt chart; determining a first time range and a second time range corresponding to a newly added task node according to the newly added instruction and a click position corresponding to a mouse click operation; according to a target task list corresponding to the target progress bar, the first time range and the second time range, adjusting the temporary time range to obtain a final time range of the newly added task node; and adding the final time range to the target task list to obtain an updated target task list, and generating the newly added task node in the target progress bar according to the updated target task list. The method and the device have the effect of improving the flexibility when the task nodes are newly added.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of Gantt charts, and in particular to a Gantt chart management method, device, storage medium and electronic device. Background Art

[0002] A Gantt chart, also known as a bar chart or bar graph, is a graphic that combines time with activities (projects) to represent the progress of a task, plan, or project. The horizontal axis of a Gantt chart usually represents time. Gantt chart management usually includes adding and dragging task nodes within the progress bar of the Gantt chart. In a Gantt chart, a task node usually represents a specific task, including the task start time and task end time, and can be displayed on the Gantt chart in the form of a bar chart. The length and position of these bars reflect the duration of the task and its position on the timeline.

[0003] At present, Gantt charts are usually used in scheduling scenarios for different objects. Tasks are scheduled for different objects in the same progress bar, that is, the working time ranges of multiple objects are arranged. Therefore, multiple task nodes need to be added in the progress bar. Once the time ranges corresponding to adjacent task nodes overlap, the working times of different objects will conflict. At this time, the method usually adopted is: through human intervention, manually drag the task node horizontally, adjust its corresponding task start time and task end time to avoid time overlap with other task nodes, which makes the flexibility of adding task nodes poor. Summary of the invention

[0004] In order to improve the flexibility when adding task nodes, the present application provides a Gantt chart management method, device, storage medium and electronic device.

[0005] In a first aspect of the present application, a Gantt chart management method is provided, which specifically includes: Obtain a new instruction for a task node in a target progress bar in a target Gantt chart, wherein the horizontal axis of the target Gantt chart is a time axis including all moments within 24 hours of a single day, the vertical axis of the target Gantt chart is at least one role for which a task needs to be arranged, the target progress bar is a progress bar distributed with draggable task nodes of different objects corresponding to the target role, the time span of the progress bar is from 0 o'clock to 24 o'clock, and the task node represents the task start time and task end time of the object; According to the click position corresponding to the new instruction and the mouse click operation, determine the first time range and the second time range corresponding to the new task node, each time in the second time range is later than each time in the first time range, the duration of the first time range is equal to the duration of the second time range, the first time range and the second time range constitute a temporary time range of the new task node, the duration of the temporary time range is the default duration of the task node, and the mouse click operation is an operation of adding a task node at the corresponding click position in the target progress bar; According to the target task list corresponding to the target progress bar, the first time range and the second time range, the temporary time range is adjusted to obtain the final time range of the newly added task node, the target task list includes the time range from the existing task start time to the existing task end time of the existing task node in the target progress bar, and the final time range does not overlap with the time range corresponding to the existing task node; The final time range is added to the target task list to obtain an updated target task list, and the newly added task node is generated in the target progress bar according to the updated target task list.

[0006] By adopting the above technical solution, a new instruction is obtained, indicating that the scheduling personnel needs to add a task node of an object in the target progress bar, and then the first time range and the second time range of the new task node are determined according to the click position of the scheduling personnel in the target progress bar, and then the occurrence of the existing task end time in the first time range and the occurrence of the existing start time in the second time range are analyzed to determine the time overlap with the previous existing task node and the subsequent existing task node when the new task node is set with a temporary time range, and automatically adjust the temporary task start time and / or temporary task end time of the new task node when there is a time overlap, that is, the temporary time range, to obtain the final time range that avoids time overlap, and finally add the final time range to the target task list, so that the newly added task node can automatically avoid the problem of time overlap, and realize more flexible and convenient addition of task nodes.

[0007] Optionally, adjusting the temporary time range according to the target task list corresponding to the target progress bar, the first time range, and the second time range to obtain a final time range specifically includes: Determine whether the existing task start time and the existing task end time of each existing task node in the target task list corresponding to the target progress bar are within the first time range or the second time range; If the end time of the existing task exists in the first time range, the corresponding end time of the existing task is determined as the start time of the newly added task; if the end time of the existing task does not exist in the first time range, the start time of the first time range is determined as the start time of the newly added task; If the existing task start time exists within the second time range, the corresponding existing task start time is determined as the new task end time; if the existing task start time does not exist within the second time range, the end time of the second time range is determined as the new task end time; The temporary time range is adjusted according to the start time of the newly added task and the end time of the newly added task to obtain the final time range of the newly added task node.

[0008] By adopting the above technical scheme, if there is an existing task end time in the first time range, it means that if a new task node is set in a temporary time range, it will overlap with the time range of the previous existing task node. In order to have time overlap between different task nodes in the target progress bar, the corresponding existing task end time is determined as the new task start time, otherwise, the start time of the first time range is determined as the new task start time; if there is an existing task start time in the second time range, it means that if a new task node is set in a temporary time range, it will overlap with the time range of the subsequent existing task node. In this way, the corresponding existing task start time is determined as the new task end time, otherwise, the end time of the second time range is determined as the new task end time. Finally, the final time range for generating the new task node is determined accordingly, that is, the task start time to the task end time, thereby automatically avoiding the problem of time overlap between the two task nodes.

[0009] Optionally, before determining the first time range and the second time range corresponding to the newly added task node according to the newly added instruction and the click position corresponding to the mouse click operation, the method further includes: Obtain the moving position of the mouse pointer in the target progress bar, and divide the entire line width of the target progress bar by the total number of seconds in a single day to obtain a unit width; When the moving position is at the rightmost side of the target progress bar, the total number of seconds of a single day is subtracted from the total number of seconds of the default duration to obtain the difference in seconds; The product of the second difference and the unit width is determined as the maximum limit distance on the left, and 0 to the maximum limit distance on the left is determined as the left distance constraint range when a task node is added. The maximum limit distance on the left is the maximum distance between the newly added task node and the leftmost side of the target progress bar.

[0010] By adopting the above technical solution, before the task node is officially added to the target progress bar through the mouse clicking operation, since the personnel will control the mouse to move in the target progress bar to determine the location of the new task node, the moving position of the mouse pointer is obtained in real time. When the moving position is at the rightmost side of the target progress bar, it means that the mouse pointer may move out of the target progress bar. In order to ensure that the task node is only added to the target progress bar, it is necessary to limit the location of the new task node at this time. By calculating the maximum limit distance on the left, the left distance constraint distance is determined, thereby achieving the accuracy of the position when the task node is added.

[0011] Optionally, after generating a new task node in the target progress bar according to the updated target task list, the method further includes: Determine whether the newly added task node is dragged; If yes, determining the drag type of the newly added task node being dragged; According to the dragging type, the final time range is adjusted to obtain an adjusted time range; According to the adjustment time range, a final task node after the newly added task node is dragged is generated.

[0012] By adopting the above technical solution, after a new task node is generated in the target progress bar according to the new instruction, if it is determined that the new task node is dragged, it means that the scheduling personnel may need to adjust the work schedule of the object to which the new task node belongs. Then, according to the dragging type of the new task node, the specific situation of the new task node being dragged is analyzed, so as to readjust the final time range to which it belongs, and obtain the adjusted time range, so as to accurately determine the adjusted work schedule of the object.

[0013] Optionally, adjusting the final time range according to the dragging type to obtain an adjusted time range specifically includes: When the dragging type is dragging the right handle of the newly added task node, if the dragging position of the newly added task node dragged by the mouse exceeds the rightmost side of the target progress bar, the start time of the final time range to the end time of the target progress bar is determined as the first adjustment time range; Determine the end time of the next day according to the dragging distance beyond the rightmost side of the target progress bar when the mouse is dragged, and determine the start time of the target progress bar to the end time of the next day as the second adjustment time range; Generating the final task node after the newly added task node is dragged and completed according to the adjustment time range specifically includes: The updated target task list is updated according to the first adjustment time range and the second adjustment time range, and a final task node after the newly added task node is dragged is generated.

[0014] By adopting the above technical solution, if the dragging position exceeds the rightmost side of the target progress bar, it means that the working time arrangement of the object to which the newly added task node belongs may have a problem of crossing days, so the start time of the final time range to the end time of the target progress bar is determined as the first adjustment time range, that is, the working time arrangement of the object on that day. Further, based on the dragging distance beyond the rightmost side of the target progress bar, the time span on the horizontal axis is analyzed and determined, so as to determine the end time of the next day, and finally the start time of the target progress bar to the end time of the next day is determined as the second adjustment time range, that is, the working time of this object on the second day, so as to facilitate the subsequent accurate generation of the working time arrangement of this object across days in the target progress bar according to the first adjustment time range and the second adjustment time range.

[0015] Optionally, adjusting the final time range according to the dragging type to obtain an adjusted time range specifically includes: When the dragging type is dragging the left handle of the newly added task node, calling the preset handleDrag function, and passing the position information of the current position of the mouse to the handleDrag function, to obtain the time on the horizontal axis corresponding to the current position of the mouse; The start time of the final time range is adjusted to the time on the horizontal axis to obtain an adjusted time range.

[0016] By adopting the above technical solution, when the dragging type is to drag the left handle of the newly added task node, the start time of the final time range will change, but the end time will not change when the newly added task node is dragged in this way. Further, the current position of the mouse is passed to the handleDrag function, so that the current position of the mouse in the target progress bar is converted into the time on the horizontal axis, and the change in the start time of the final time range after the left handle is dragged is determined. Finally, the start time of the final time range is adjusted to the time on the horizontal axis, and the end time of the final time range remains unchanged, so as to obtain the adjusted time range, so as to facilitate the subsequent regeneration of the dragged task node in the target progress bar according to the adjusted time range.

[0017] Optionally, generating the newly added task node in the target progress bar according to the updated target task list specifically includes: Calculate the target duration from the start time of the final time range to the start time of the target progress bar; Divide the entire row width of the target progress bar by the total number of seconds in a single day to obtain a unit width, and determine the product of the total number of seconds corresponding to the target duration and the unit width as the left distance from the leftmost side of the target progress bar; According to the left distance and the updated target task list, the newly added task node is generated in the target progress bar through a preset barbox component.

[0018] By adopting the above technical solution, the product of the total number of seconds corresponding to the target duration and the unit width is calculated to determine the width corresponding to the target duration in the target progress bar, and then the left distance of the newly added task node from the leftmost side of the target progress bar is determined, wherein the left distance can locate the starting position of the newly added task node in the target progress bar, and finally, based on this left distance and the final time range in the updated target task list, a new task node is generated or constructed in the target progress bar through a preset barbox component, so that the newly added task node can automatically avoid the problem of time overlap, making the addition of task nodes more flexible and convenient.

[0019] In a second aspect of the present application, a Gantt chart management device is provided, specifically comprising: An instruction acquisition module is used to acquire new instructions for a task node in a target progress bar in a target Gantt chart, wherein the horizontal axis of the target Gantt chart is a time axis including all moments within 24 hours of a single day, the vertical axis of the target Gantt chart is at least one role for which a task needs to be arranged, the target progress bar is a progress bar distributed with draggable task nodes of different objects corresponding to the target role, the time span of the progress bar is from 0 o'clock to 24 o'clock, and the task node represents the task start time and task end time of the object; A range division module is used to determine a first time range and a second time range corresponding to a newly added task node according to a click position corresponding to the newly added instruction and a mouse click operation, wherein each time in the second time range is later than each time in the first time range, and the duration of the first time range is equal to the duration of the second time range. The first time range and the second time range constitute a temporary time range of the newly added task node, and the duration of the temporary time range is a default duration of the task node. The mouse click operation is an operation of adding a task node at a corresponding click position in the target progress bar; A range adjustment module is used to adjust the temporary time range according to the target task list corresponding to the target progress bar, the first time range and the second time range to obtain the final time range of the newly added task node, wherein the target task list includes the time range from the existing task start time to the existing task end time of the existing task node in the target progress bar, and the final time range does not overlap with the time range corresponding to the existing task node; A node adding module is used to add the final time range to the target task list to obtain an updated target task list, and generate the newly added task node in the target progress bar according to the updated target task list.

[0020] By adopting the above technical solution, the instruction acquisition module obtains the new instruction, and then the range division module determines the first time range and the second time range corresponding to the new task node, and then the range adjustment module adjusts the temporary time range to obtain the final time range. Finally, the node addition module adds the final time range to the target task list to obtain the updated target task list, and generates the new task node in the target progress bar according to the updated target task list.

[0021] In a third aspect of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is loaded and executed by a processor, the method steps described in any one of the first aspects are performed.

[0022] In a fourth aspect of the present application, an electronic device is provided, specifically comprising: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the processor is used to load and execute the computer program stored in the memory so that the electronic device performs the method as described in any one of the first aspects.

[0023] To summarize, the present application includes at least one of the following beneficial technical effects: obtaining a new instruction, indicating that the scheduling personnel needs to add a task node of an object in the target progress bar, and then determining the first time range and the second time range of the new task node according to the click position of the scheduling personnel in the target progress bar, and then analyzing the occurrence of the existing task end time in the first time range and the occurrence of the existing start time in the second time range, and determining the time overlap with the previous existing task node and the subsequent existing task node when setting the new task node with a temporary time range, and automatically adjusting the temporary task start time and / or temporary task end time of the new task node when there is a time overlap, that is, the temporary time range, to obtain the final time range that avoids time overlap, and finally adding the final time range to the target task list, so that the newly added task node can automatically avoid the problem of time overlap, making the addition of task nodes more flexible and convenient. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a flow chart of a Gantt chart management method provided in an embodiment of the present application; Figure 2This is a schematic diagram of an interface of a target Gantt chart provided in an embodiment of the present application; Figure 3 It is a flowchart of another Gantt chart management method provided by an embodiment of the present application; Figure 4 It is a schematic diagram of another interface of a target Gantt chart provided in an embodiment of the present application; Figure 5 It is a structural schematic diagram of a Gantt chart management device provided in an embodiment of the present application; Figure 6 It is a structural schematic diagram of another Gantt chart management device provided in an embodiment of the present application.

[0025] Explanation of the accompanying drawings: 11. instruction acquisition module; 12. range division module; 13. range adjustment module; 14. node addition module; 15. distance constraint module; 16. node dragging module. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0027] In the description of the embodiments of the present application, words such as "illustrative", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "illustrative", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "illustrative", "for example" or "for example" is intended to present related concepts in a concrete way.

[0028] In the description of the embodiments of the present application, the term "and / or" is only a kind of association relationship describing the associated objects, indicating that there may be three kinds of relationships, for example, A and / or B, which can represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0029] See also Figure 1 The present application embodiment discloses a flow chart of a Gantt chart management method, which can be implemented by a computer program or run on a Gantt chart management device based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application, specifically including: S101: Acquire a new instruction for a task node in a target progress bar in a target Gantt chart.

[0030] For details, see Figure 2 The horizontal axis of the target Gantt chart is a time axis that includes all moments within 24 hours of a single day. The vertical axis of the target Gantt chart is at least one role that needs to arrange tasks. The target progress bar is a progress bar distributed by the draggable task nodes of different objects corresponding to the target role. The time span of the progress bar is from 0 to 24 hours, and the task node represents the task start time and task end time of the object. Each role corresponds to a row of progress bars in the target Gantt chart, and each row of progress bars corresponds to various moments from 0 to 24 hours. The direction of the progress bar from left to right is the direction from small to large in the horizontal axis. In an embodiment of the present application, an application scenario of a target Gantt chart is to arrange working hours for objects of different roles in a live broadcast scene, including but not limited to anchors, field controllers, center controllers, and pitchers, etc. The target role may be a field controller, and there is at least one object corresponding to the field controller. It is necessary to arrange corresponding working time ranges (corresponding task start time and task end time) for different objects of the target role in a whole row of progress bars corresponding to the target role in the vertical axis, that is, in the target progress bar, by setting corresponding task nodes. The span of the working time range defaults to 2 hours, that is, the default duration of the task node. In other embodiments, it may also be 4 hours.

[0031] Furthermore, the execution subject of a Gantt chart management method disclosed in an embodiment of the present application is a terminal, and the terminal is a personal computer or a tablet computer. A feasible way to obtain new instructions for task nodes in the target progress bar in the target Gantt chart is: the scheduling personnel clicks the "Team Scheduling" button in the terminal interface with a mouse, and the terminal obtains the new instructions for the task node, indicating that it is necessary to schedule the working hours for all objects or part of the objects corresponding to the target role. It should be noted that the target Gantt chart includes at least one row of progress bars, and the target progress bar is one of all the progress bars in the target Gantt chart.

[0032] S102: Determine a first time range and a second time range corresponding to the newly added task node according to the newly added instruction and the click position corresponding to the mouse click operation.

[0033] Specifically, after obtaining the new instruction, the pre-mounted mousedown event is used to listen for the mouse press event. The mounting is specifically implemented through addEventListener. If the mousedown event is triggered, it means that the scheduling personnel has a mouse click operation in the target progress bar, which further indicates that they want to add a task node for the object of the target role at the corresponding click position. In other embodiments, the click event can also be listened to to determine whether the scheduling personnel has a mouse click operation in the target progress bar. If the click event is listened to, it means that there is a mouse click operation. Then the coordinates of the mouse click are obtained through the clientX and clientY attributes of the corresponding event object, that is, the click position corresponding to the mouse click operation is determined. Furthermore, according to the click position and the leftmost position of the target progress bar, the distance from the click position to the leftmost side of the target progress bar can be determined. Then, the entire line width of the target progress bar is divided by the total number of seconds in a single day, that is, 24*60*60 seconds, to obtain the unit width. Then, the distance from the click position to the leftmost side of the target progress bar is divided by this unit width to obtain the time span from the leftmost side of the target progress bar to the click position on the horizontal axis. Finally, the start time of the target progress bar is added to this time span to obtain the time corresponding to the click position on the horizontal axis. In addition, when a task node is added, the duration between the task start time and the task end time of the newly added task node is the default duration, and the task node is added by default with the click position as the central axis. Therefore, according to the result of dividing the default duration by 2 and the time corresponding to the click position on the horizontal axis, the first time range and the second time range of the newly added task node with the central axis where the click position is located as the boundary can be determined. The two together constitute the temporary time range of the newly added task node, that is, the temporary task start time to the temporary task end time. For details, please refer to Figure 2 . The duration of the first time range is equal to the duration of the second time range. Among them, the duration of the temporary time range is the default duration corresponding to the task node, and each time in the second time range is later than each time in the first time range. Exemplarily, the first time range is 2:30-3:30, and the second time range is 3:30-4:30, then the temporary time range corresponding to the newly added task node is 2:30-4:30. In addition, the mouse click operation is to perform the operation of adding a task node at the corresponding click position in the target progress bar.

[0034] In other embodiments, before step S102, the method further includes: obtaining the moving position of the mouse pointer in the target progress bar, and dividing the entire line width of the target progress bar by the total number of seconds in a single day to obtain a unit width; When the moving position is at the far right of the target progress bar, subtract the total seconds of the default duration from the total seconds of the day to get the difference in seconds; The product of the difference in seconds and the unit width is determined as the maximum limit distance on the left, and 0 to the maximum limit distance on the left is determined as the left distance constraint range when adding a task node. The maximum limit distance on the left is the maximum distance between the newly added task node and the leftmost side of the target progress bar.

[0035] Specifically, before adding a task node to the target progress bar through a mouse click operation, since the personnel will control the mouse to move in the target progress bar to determine the location of the task node, the moving position of the mouse pointer in the target progress bar is obtained in real time. Specifically, the moving position can be determined by monitoring the mousemove event. When the moving position is located at the rightmost side of the target progress bar, it means that the personnel mouse pointer may move out of the target progress bar. In order to ensure that the task node is only added to the target progress bar, it is necessary to limit the location of the task node. Further, the entire line width of the target progress bar is divided by the total number of seconds in a single day to obtain the unit width, and then the total number of seconds of the default duration of the task node is calculated, that is, the default duration * 60 * 60. Then the total number of seconds of the default duration is subtracted from the total number of seconds of the single day to obtain the difference in seconds, and the difference in seconds is multiplied by the unit width to obtain the maximum limit distance on the left, which can be understood as the maximum distance from the task node at the rightmost end of the target progress bar to the leftmost side of the target progress bar. Finally, the distance from 0 to the maximum limit on the left is determined as the left distance constraint range when adding a task node, so that when adding a task node on the rightmost side of the target progress bar, it will not exceed the target progress bar, thereby achieving the accuracy of the position when the task node is added. It should be noted that in the embodiment of the present application, the entire line width of the target progress bar is obtained through the width attribute in the DOM element corresponding to the target progress bar.

[0036] S103: According to the target task list, the first time range and the second time range corresponding to the target progress bar, the temporary time range is adjusted to obtain the final time range of the newly added task node.

[0037] Specifically, in an achievable implementation, it is determined whether the existing task start time and the existing task end time of each existing task node in the target task list corresponding to the target progress bar are within the first time range or the second time range; If there is an existing task end time in the first time range, the corresponding existing task end time is determined as the new task start time; if there is no existing task end time in the first time range, the start time of the temporary time range is determined as the new task start time; If there is an existing task start time within the second time range, the corresponding existing task start time is determined as the new task end time; if there is no existing task start time within the second time range, the end time of the temporary time range is determined as the new task end time; According to the start time and end time of the newly added task, the temporary time range is adjusted to obtain the final time range.

[0038] Specifically, after the first time range and the second time range are determined, the target task list corresponding to the target task bar is obtained from the server, and the target task list includes the time range from the existing task start time to the corresponding existing task end time corresponding to the existing task node in the target task bar, and the existing task node can be understood as the task node that has been set before the current addition. Among them, the task list is a key factor in determining the task nodes displayed in the progress bar, and specifically, the corresponding task node is displayed in the progress bar according to the task start time and task end time of a task node in the task list.

[0039] Furthermore, in an embodiment of the present application, in order to automatically avoid time overlap with task nodes of other objects of the target role when a task node is added, it is necessary to avoid time conflicts between the current newly added task node and the existing task nodes in the target progress bar based on the first time range and the second time range. The specific implementation process is: traverse the existing task start time and the existing task end time of each existing task node in the target task list, and determine whether the existing task end time of each existing task node is within the first time range. If there is an existing task end time within the first time range, it means that if the new task node is set with a temporary time range, it will overlap with the time range of the previous existing task node. Then the corresponding existing task end time is determined as the start time of the newly added task. If there is no existing task end time within the first time range, it means that if the new task node is set with a temporary time range, it will not overlap with the time range of the previous existing task node. Then the start time of the first time range is directly determined as the start time of the newly added task.

[0040] Further, it is determined whether the existing start and end time of each existing task node is within the second time range. If there is an existing task start time within the second time range, it means that if a new task node is set in a temporary time range, it will overlap with the time range of the existing task node behind it, so the corresponding existing task start time is determined as the new task end time; if there is no existing task start time within the second time range, it means that if a new task node is set in a temporary time range, it will not overlap with the time range of the existing task node behind it, so the end time of the second time range is directly determined as the new task end time. Finally, the start time of the temporary time range is adjusted to the start time of the new task, and the end time of the temporary time range is adjusted to the end time of the new task to obtain the final time range, and then the new task node is set in the target progress bar according to the mouse click operation. The setting is based on the final time range, so that when the shift scheduling personnel add task nodes according to the mouse click operation, the existing task nodes with overlapping time before and after can be automatically avoided.

[0041] S104: Add the final time range to the target task list to obtain an updated target task list, and generate a new task node in the target progress bar according to the updated target task list.

[0042] Specifically, after the final time range of the newly added task node is determined, the final time range is added to the target task list to obtain an updated target task list. The final time range is added after the existing task node whose task end time is earlier than the start time of the final time range and before the existing task node whose task start time is later than the end time of the final time range, thereby ensuring the correct display of the newly added task node in the target progress bar.

[0043] Furthermore, the target duration from the start time of the final time range to the start time of the target progress bar is calculated; the entire line width of the target progress bar is divided by the total seconds of a single day to obtain the unit width, and the product of the total seconds corresponding to the target duration and the unit width is determined as the left distance from the leftmost side of the target progress bar. This left distance can locate the starting position of the newly added task node in the target progress bar. Finally, based on this left distance and the final time range in the updated target task list, a new task node is generated or constructed in the target progress bar through the preset barbox component, so that the newly added task node can automatically avoid the problem of time overlap, making the addition of task nodes more flexible and convenient.

[0044] See also Figure 3The present application embodiment discloses a flow chart of another Gantt chart management method, which can be implemented by a computer program or run on a Gantt chart management device based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application, specifically including: S201: Acquire a new instruction for a task node in a target progress bar in a target Gantt chart.

[0045] S202: Determine a first time range and a second time range corresponding to the newly added task node according to the newly added instruction and the click position corresponding to the mouse click operation.

[0046] S203: According to the target task list, the first time range and the second time range corresponding to the target progress bar, the temporary time range is adjusted to obtain the final time range of the newly added task node.

[0047] S204: Add the final time range to the target task list to obtain an updated target task list, and generate a new task node in the target progress bar according to the updated target task list.

[0048] For details, please refer to steps S101-S104, which will not be described in detail here.

[0049] S205: Determine whether the newly added task node is dragged.

[0050] S206: If yes, determine the drag type of the newly added task node being dragged.

[0051] Specifically, after a new task node is generated in the target progress bar by clicking the mouse in the target progress bar, the scheduler may need to adjust the working time of the object to which the new task node belongs, such as advancing or delaying the task start time of the new task node, etc. Therefore, it is necessary to determine whether the new task node is dragged. A feasible determination method is: by mounting the mousedown event, if the mousedown event is triggered and the position of the mouse click is in the new task node, it means that the scheduler clicks on the new task node and listens to the mousemove event mounted in advance, thereby timely monitoring the mouse movement event. If the mousemove event is triggered, it means that the scheduler may be preparing to drag the new task node, then it is determined that the new task node is dragged, otherwise, it is determined that the new task node is not dragged.

[0052] Further, if the newly added task node is dragged, then determine the drag type of the newly added task node being dragged. In an embodiment of the present application, a feasible determination method is: if the position of the mouse click is the right handle of the newly added task node, it indicates that the drag type is to drag the right handle of the newly added task node. By dragging the newly added task node with this type, the start time of the final time range will not change, but the end time will change as the mouse is dragged. If the position of the mouse click is the left handle of the newly added task node, it indicates that the drag type is to drag the left handle of the newly added task node. By dragging the newly added task node with this type, the start time of the final time range will change, but the end time will not change. If the position of the mouse click is the middle area of ​​the newly added task node, the duration of the final time range will not change, that is, the width of the newly added task node will not change, but the start time and the end time will change. It should be noted that the left handle and the right handle are two control points for adjusting the duration of the newly added task node.

[0053] S207: Adjust the final time range according to the drag type to obtain an adjusted time range.

[0054] S208: Generate a final task node after the newly added task node is dragged and completed according to the adjustment time range.

[0055] For details, see Figure 4 , when the drag type is to drag the right handle of the newly added task node, the drag position of the mouse in the terminal interface can be determined in real time based on the continuous monitoring of the mousemove event. If the drag position exceeds the rightmost side of the target progress bar, it means that the working time arrangement of the object to which the newly added task node belongs may have a problem of crossing days, because the rightmost side of the target progress bar corresponds to 23:59:59 on the horizontal axis, that is, 23:59:59 on the day. Then the start time of the final time range to the end time of the target progress bar is determined as the first adjustment time range, that is, the working time arrangement of the object on the day. Furthermore, when the mouse drag operation ends, the position of the mouse at the end of the drag operation is determined based on the event object when the mousemove event was last triggered. Finally, the drag distance beyond the rightmost side of the target progress bar is determined based on the position of the mouse at the end of the drag operation and the rightmost side of the target progress bar. Then, the drag distance is divided by the unit width to obtain the duration corresponding to the drag distance on the horizontal axis. Finally, the start time (0 o'clock) corresponding to the target progress bar is added to this duration to obtain the end time of the next day. The start time of the target progress bar to the end time of the next day is determined as the second adjustment time range, that is, the continuous working time of the object on the second day. The adjustment time range includes the first adjustment time range and the second adjustment time range.

[0056] Adjust the final time range, and after obtaining the adjusted time range, replace the final time range in the updated target task list with the first adjusted time range, and add the second adjusted time range as new task node data to the updated target task list, so as to generate the final task node in the target progress bar after the new task node is dragged. The task start time to the task end time corresponding to the final task node are the final working time arrangements for the corresponding object.

[0057] In other embodiments, if the drag type is to drag the left handle of the newly added task node, the preset handleDrag function is called, and according to the monitoring of the mousemove event, the current position information of the mouse is obtained, and then the position information of the current position of the mouse (the position to which the mouse is currently dragged) is passed to the handleDrag function, and the time corresponding to the current position of the mouse on the horizontal axis, i.e., the time on the horizontal axis, is calculated. Further, the start time of the final time range is adjusted to the time on this horizontal axis, and the end time of the final time range remains unchanged to obtain the adjusted time range. Finally, according to replacing the final time range in the updated target task list with the adjusted time range, the final task node completed by dragging the newly added task node is generated.

[0058] The implementation principle of a Gantt chart management in an embodiment of the present application is as follows: a new instruction is obtained, indicating that the scheduling personnel needs to add a task node of an object in the target progress bar, and then the first time range and the second time range of the new task node are determined according to the click position of the scheduling personnel in the target progress bar, and then the occurrence of the existing task end time in the first time range and the occurrence of the existing start time in the second time range are analyzed, and it is determined that when the new task node is set with a temporary time range, the time overlap with the previous existing task node and the subsequent existing task node, and when there is a time overlap, the temporary task start time and / or the temporary task end time of the new task node are automatically adjusted, that is, the temporary time range, to obtain the final time range that avoids time overlap, and finally the final time range is added to the target task list, so that the newly added task node can automatically avoid the problem of time overlap, and the task node can be added more flexibly and conveniently.

[0059] The following are device embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

[0060] See also Figure 5, which is a schematic diagram of the structure of the Gantt chart management device provided in the embodiment of the present application. The application in the Gantt chart management device can be implemented as all or part of the device through software, hardware or a combination of both. The device includes an instruction acquisition module 11, a range division module 12, a range adjustment module 13 and a node addition module 14.

[0061] The instruction acquisition module 11 is used to acquire new instructions for task nodes in the target progress bar of the target Gantt chart, the horizontal axis of the target Gantt chart is a time axis containing all moments within 24 hours of a single day, the vertical axis of the target Gantt chart is at least one role that needs to arrange tasks, the target progress bar is a progress bar distributed with draggable task nodes of different objects corresponding to the target role, the time span of the progress bar is from 0 o'clock to 24 o'clock, and the task node represents the task start time and task end time of the object; The range division module 12 is used to determine the first time range and the second time range corresponding to the newly added task node according to the click position corresponding to the newly added instruction and the mouse click operation, each time in the second time range is later than each time in the first time range, the duration of the first time range is equal to the duration of the second time range, the first time range and the second time range constitute a temporary time range for the newly added task node, the duration of the temporary time range is the default duration of the task node, and the mouse click operation is to perform the operation of adding a task node at the corresponding click position in the target progress bar; The range adjustment module 13 is used to adjust the temporary time range according to the target task list corresponding to the target progress bar, the first time range and the second time range to obtain the final time range of the newly added task node, the target task list includes the time range from the existing task start time to the existing task end time of the existing task node in the target progress bar, and the final time range does not overlap with the time range corresponding to the existing task node; The node adding module 14 is used to add the final time range to the target task list, obtain an updated target task list, and generate a new task node in the target progress bar according to the updated target task list.

[0062] Optionally, the range adjustment module 13 is specifically used for: Determine whether the existing task start time and the existing task end time of each existing task node in the target task list corresponding to the target progress bar are within the first time range or the second time range; If there is an existing task end time in the first time range, the corresponding existing task end time is determined as the new task start time; if there is no existing task end time in the first time range, the start time of the first time range is determined as the new task start time; If there is an existing task start time within the second time range, the corresponding existing task start time is determined as the new task end time; if there is no existing task start time within the second time range, the end time of the second time range is determined as the new task end time; According to the start time and end time of the newly added task, the temporary time range is adjusted to obtain the final time range of the newly added task node.

[0063] Optional, such as Figure 6 As shown, the device also includes a distance constraint module 15, which is specifically used to: Get the moving position of the mouse pointer in the target progress bar, and divide the entire line width of the target progress bar by the total number of seconds in a single day to get the unit width; When the moving position is at the far right of the target progress bar, subtract the total seconds of the default duration from the total seconds of the day to get the difference in seconds; The product of the difference in seconds and the unit width is determined as the maximum limit distance on the left, and 0 to the maximum limit distance on the left is determined as the left distance constraint range when adding a task node. The maximum limit distance on the left is the maximum distance between the newly added task node and the leftmost side of the target progress bar.

[0064] Optionally, the device further includes a node dragging module 16, which is specifically used for: Determine whether the newly added task node is dragged; If yes, then determine the drag type of the newly added task node being dragged; According to the drag type, the final time range is adjusted to obtain the adjusted time range; According to the adjustment time range, the final task node is generated after the newly added task node is dragged and completed.

[0065] Optionally, the node dragging module 16 is specifically used for: When the dragging type is dragging the right handle of the newly added task node, if the dragging position of the newly added task node by the mouse exceeds the rightmost side of the target progress bar, the start time of the final time range to the end time of the target progress bar is determined as the first adjustment time range; The end time of the next day is determined based on the dragging distance beyond the rightmost side of the target progress bar when the mouse is dragged, and the start time of the target progress bar to the end time of the next day is determined as the second adjustment time range. Optionally, the node dragging module 16 is specifically used for: The updated target task list is updated according to the first adjustment time range and the second adjustment time range, and a final task node after the newly added task node is dragged is generated.

[0066] Optionally, the node dragging module 16 is specifically used for: When the drag type is to drag the left handle of the newly added task node, the preset handleDrag function is called, and the position information of the current position of the mouse is passed to the handleDrag function to obtain the time on the horizontal axis corresponding to the current position of the mouse; The start time of the final time range is adjusted to the time on the horizontal axis to obtain the adjusted time range.

[0067] Optionally, the node newly adds a module 14, specifically for: Calculate the target duration from the start time of the final time range to the start time of the target progress bar; Divide the entire line width of the target progress bar by the total number of seconds in a single day to obtain the unit width, and determine the product of the total number of seconds corresponding to the target duration and the unit width as the left distance from the leftmost side of the target progress bar; According to the distance on the left and the updated target task list, a new task node is generated in the target progress bar through the preset barbox component.

[0068] It should be noted that when a Gantt chart management device provided in the above embodiment executes the Gantt chart management method, only the division of the above functional modules is used as an example. In actual applications, the above functional distribution can be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, a Gantt chart management device and a Gantt chart management method embodiment provided in the above embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.

[0069] The embodiment of the present application further discloses a computer-readable storage medium, and the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, a Gantt chart management method of the above embodiment is adopted.

[0070] Among them, the computer program can be stored in a computer-readable medium, the computer program includes computer program code, the computer program code can be in the form of source code, object code, executable file or certain middleware, etc. The computer-readable medium includes any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the computer-readable medium includes but is not limited to the above-mentioned components.

[0071] Among them, through this computer-readable storage medium, a Gantt chart management method of the above embodiment is stored in a computer-readable storage medium, and is loaded and executed on a processor to facilitate the storage and application of the above method.

[0072] An embodiment of the present application further discloses an electronic device, wherein a computer program is stored in a computer-readable storage medium, and when the computer program is loaded and executed by a processor, the above-mentioned Gantt chart management method is adopted.

[0073] The electronic device may be a desktop computer, a laptop computer, a cloud server or other electronic device, and the electronic device includes but is not limited to a processor and a memory. For example, the electronic device may also include input and output devices, a network access device, and a bus.

[0074] Among them, the processor can adopt a central processing unit (CPU). Of course, according to actual usage, other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. can also be adopted. The general-purpose processor can adopt a microprocessor or any conventional processor, etc., and this application does not impose any restrictions on this.

[0075] Among them, the memory can be an internal storage unit of the electronic device, such as a hard disk or memory of the electronic device, or it can be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital card (SD) or a flash memory card (FC) equipped on the electronic device. Moreover, the memory can also be a combination of an internal storage unit and an external storage device of the electronic device. The memory is used to store computer programs and other programs and data required by the electronic device. The memory can also be used to temporarily store data that has been output or is to be output, and this application does not impose any restrictions on this.

[0076] Among them, through this electronic device, a Gantt chart management method of the above embodiment is stored in the memory of the electronic device, and is loaded and executed on the processor of the electronic device for easy use.

[0077] The above is only an exemplary embodiment of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. This application is intended to cover any variation, use or adaptive change of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field that are not recorded in the present disclosure. The description and examples are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A Gantt chart management method, characterized in that: The method comprises: Obtain a new instruction for a task node in a target progress bar in a target Gantt chart, wherein the horizontal axis of the target Gantt chart is a time axis including all moments within 24 hours of a single day, the vertical axis of the target Gantt chart is at least one role for which a task needs to be arranged, the target progress bar is a progress bar distributed with draggable task nodes of different objects corresponding to the target role, the time span of the progress bar is from 0 o'clock to 24 o'clock, and the task node represents the task start time and task end time of the object; According to the click position corresponding to the new instruction and the mouse click operation, determine the first time range and the second time range corresponding to the new task node, each time in the second time range is later than each time in the first time range, the duration of the first time range is equal to the duration of the second time range, the first time range and the second time range constitute a temporary time range of the new task node, the duration of the temporary time range is the default duration of the task node, and the mouse click operation is an operation of adding a task node at the corresponding click position in the target progress bar; According to the target task list corresponding to the target progress bar, the first time range and the second time range, the temporary time range is adjusted to obtain the final time range of the newly added task node, the target task list includes the time range from the existing task start time to the existing task end time of the existing task node in the target progress bar, and the final time range does not overlap with the time range corresponding to the existing task node; The final time range is added to the target task list to obtain an updated target task list, and the newly added task node is generated in the target progress bar according to the updated target task list.

2. The Gantt chart management method according to claim 1, characterized in that: The adjusting the temporary time range according to the target task list corresponding to the target progress bar, the first time range and the second time range to obtain the final time range of the newly added task node specifically includes: Determine whether the existing task start time and the existing task end time of each existing task node in the target task list corresponding to the target progress bar are within the first time range or the second time range; If the end time of the existing task exists in the first time range, the corresponding end time of the existing task is determined as the start time of the newly added task; if the end time of the existing task does not exist in the first time range, the start time of the first time range is determined as the start time of the newly added task; If the existing task start time exists within the second time range, the corresponding existing task start time is determined as the new task end time; if the existing task start time does not exist within the second time range, the end time of the second time range is determined as the new task end time; The temporary time range is adjusted according to the start time of the newly added task and the end time of the newly added task to obtain the final time range of the newly added task node.

3. The Gantt chart management method according to claim 1, characterized in that: Before determining the first time range and the second time range corresponding to the newly added task node according to the newly added instruction and the click position corresponding to the mouse click operation, the method further includes: Obtain the moving position of the mouse pointer in the target progress bar, and divide the entire line width of the target progress bar by the total number of seconds in a single day to obtain a unit width; When the moving position is at the rightmost side of the target progress bar, the total number of seconds of a single day is subtracted from the total number of seconds of the default duration to obtain the difference in seconds; The product of the second difference and the unit width is determined as the maximum limit distance on the left, and 0 to the maximum limit distance on the left is determined as the left distance constraint range when a task node is added. The maximum limit distance on the left is the maximum distance between the newly added task node and the leftmost side of the target progress bar.

4. The Gantt chart management method according to claim 1, characterized in that: After generating a new task node in the target progress bar according to the updated target task list, the method further includes: Determine whether the newly added task node is dragged; If yes, determining the drag type of the newly added task node being dragged; According to the dragging type, the final time range is adjusted to obtain an adjusted time range; According to the adjustment time range, a final task node after the newly added task node is dragged is generated.

5. The Gantt chart management method according to claim 4, characterized in that: The adjusting the final time range according to the dragging type to obtain the adjusted time range specifically includes: When the dragging type is dragging the right handle of the newly added task node, if the dragging position of the newly added task node dragged by the mouse exceeds the rightmost side of the target progress bar, the start time of the final time range to the end time of the target progress bar is determined as the first adjustment time range; Determine the end time of the next day according to the dragging distance beyond the rightmost side of the target progress bar when the mouse is dragged, and determine the start time of the target progress bar to the end time of the next day as the second adjustment time range; Generating the final task node after the newly added task node is dragged and completed according to the adjustment time range specifically includes: The updated target task list is updated according to the first adjustment time range and the second adjustment time range, and a final task node after the newly added task node is dragged is generated.

6. The Gantt chart management method according to claim 4, characterized in that: The adjusting the final time range according to the dragging type to obtain the adjusted time range specifically includes: When the dragging type is dragging the left handle of the newly added task node, calling the preset handleDrag function, and passing the position information of the current position of the mouse to the handleDrag function, to obtain the time on the horizontal axis corresponding to the current position of the mouse; The start time of the final time range is adjusted to the time on the horizontal axis to obtain an adjusted time range.

7. The Gantt chart management method according to claim 1, characterized in that: Generating the newly added task node in the target progress bar according to the updated target task list specifically includes: Calculate the target duration from the start time of the final time range to the start time of the target progress bar; Divide the entire row width of the target progress bar by the total number of seconds in a single day to obtain a unit width, and determine the product of the total number of seconds corresponding to the target duration and the unit width as the left distance from the leftmost side of the target progress bar; According to the left distance and the updated target task list, the newly added task node is generated in the target progress bar through a preset barbox component.

8. A Gantt chart management device, characterized in that: include: An instruction acquisition module (11) is used to acquire new instructions for a task node in a target progress bar in a target Gantt chart, wherein the horizontal axis of the target Gantt chart is a time axis containing various moments within 24 hours of a single day, the vertical axis of the target Gantt chart is at least one role for which a task needs to be arranged, the target progress bar is a progress bar distributed with draggable task nodes of different objects corresponding to the target role, the time span of the progress bar is from 0 o'clock to 24 o'clock, and the task node represents the task start time and task end time of the object; A range division module (12) is used to determine a first time range and a second time range corresponding to a newly added task node according to the click position corresponding to the newly added instruction and the mouse click operation, wherein each time in the second time range is later than each time in the first time range, the duration of the first time range is equal to the duration of the second time range, the first time range and the second time range constitute a temporary time range of the newly added task node, the duration of the temporary time range is a default duration of the task node, and the mouse click operation is an operation of adding a task node at a corresponding click position in the target progress bar; A range adjustment module (13) is used to adjust the temporary time range according to the target task list corresponding to the target progress bar, the first time range and the second time range, so as to obtain the final time range of the newly added task node, wherein the target task list includes the time range from the existing task start time to the existing task end time of the existing task node in the target progress bar, and the final time range does not overlap with the time range corresponding to the existing task node; A node adding module (14) is used to add the final time range to the target task list to obtain an updated target task list, and generate the newly added task node in the target progress bar according to the updated target task list.

9. A computer-readable storage medium having a computer program stored therein, characterized in that: When the computer program is loaded and executed by a processor, the method according to any one of claims 1 to 7 is adopted.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor loads and executes the computer program, the method according to any one of claims 1 to 7 is adopted.

Citation Information

Patent Citations

  • Method and device for realizing automatic generation of planned Gantt chart based on RPA

    CN116932823A

  • Gantt chart calendar dragging method and device, storage medium and electronic equipment

    CN118778869A

  • System and method for non-linear and discontinuous project timelines

    US20190130611A1

Cited By

  • Task arrangement method, robot control method and robot control system

    CN120326642A

  • Task orchestration methods, robot control methods, and robot control systems

    CN120326642B