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

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

CN119718131BActive Publication Date: 2025-06-24HANGZHOU MIANCHAO INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411757894.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-06-24
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 new instructions in the target Gantt chart, the first time range and second time range of the task node are determined according to the mouse click position, and by analyzing the time range of the existing task node, the temporary time range of the newly added task node is automatically adjusted to avoid overlap, and the adjusted time range is finally added to the target task list.

Benefits of technology

It automatically avoids the problem of overlapping time 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 CN119718131B_ABST
    Figure CN119718131B_ABST
Patent Text Reader

Abstract

The present application relates to a Gantt chart management method, device, storage medium and electronic device, and relates to the technical field of Gantt charts. The method includes: obtaining a new instruction for a task node within a target progress bar in a target Gantt chart; determining a first time range and a second time range corresponding to the newly added task node according to the new instruction and the click position corresponding to the mouse click operation; 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; adding the final time range to the target task list to obtain an updated target task list, and generating the newly added task node within the target progress bar according to the updated target task list. The present application has the effect of improving the flexibility when adding task nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of Gantt charts, and particularly 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 graph that combines time with activities (projects) and is used to represent the progress of a task, plan, or project. The horizontal axis of a Gantt chart usually represents time. The management of a Gantt chart generally 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 bar charts reflect the duration of the task and its position on the time axis.

[0003] Currently, Gantt charts are usually applied to scheduling scenarios for different objects. Task scheduling for different objects is carried out within the same progress bar, that is, the working time ranges of multiple objects are arranged. Therefore, multiple task nodes need to be added within 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 commonly used method is to manually horizontally drag the task node through manual intervention to adjust its corresponding task start time and task end time to avoid overlapping with the time of other task nodes, resulting in poor flexibility when adding task nodes. Summary of the Invention

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

[0005] In the first aspect of this application, a Gantt chart management method is provided, which specifically includes:

[0006] Obtain an instruction to add a task node within a target progress bar in a target Gantt chart. The horizontal axis of the target Gantt chart is a time axis including each moment within 24 hours of a single day, the vertical axis of the target Gantt chart is at least one role for which tasks need to be arranged, the target progress bar is the progress bar in which task nodes that can be dragged by different objects corresponding to the target role are distributed, the time span of the progress bar is from 0:00 to 24:00, and the task node represents the task start time and task end time of an object;

[0007] 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. 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 the temporary time range of the newly added task node. The duration of the temporary time range is the default duration of the task node. The mouse click operation is an operation to add a task node at the corresponding click position within the target progress bar;

[0008] 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 contains the time range from the existing task start time to the existing task end time of the existing task nodes within the target progress bar. The final time range does not overlap with the time range corresponding to the existing task nodes;

[0009] Add the final time range to the target task list to obtain an updated target task list, and generate the newly added task node within the target progress bar according to the updated target task list.

[0010] By adopting the above technical solution, a newly added instruction is obtained, indicating that the scheduling personnel need to add a task node of a certain object within the target progress bar. Then, according to the click position of the scheduling personnel within the target progress bar, the first time range and the second time range of the newly added task node are determined. Then, analyze the occurrence of the existing task end time within the first time range and the occurrence of the existing start time within the second time range, and determine the time overlap situation with the existing task nodes before and after when setting the newly added task node with the temporary time range. And when there is a time overlap, automatically adjust the temporary task start time and / or the temporary task end time of the newly added task node, that is, the temporary time range, to obtain a final time range that avoids time overlap. Finally, add the final time range to the target task list, so that the newly added task node this time can automatically avoid the problem of time overlap and make the addition of task nodes more flexible and convenient.

[0011] Optionally, 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 a final time range specifically includes:

[0012] Judge 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;

[0013] If there is an existing task end time within the first time range, the corresponding existing task end time is determined as the start time of the new task. If there is no existing task end time within the first time range, the start time of the first time range is determined as the start time of the new task;

[0014] If there is an existing task start time within the second time range, the corresponding existing task start time is determined as the end time of the new task. 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 end time of the new task;

[0015] Adjust the temporary time range according to the start time and end time of the new task to obtain the final time range of the new task node.

[0016] By adopting the above technical solution, if there is an existing task end time within the first time range, it indicates that if the new task node is set with the temporary time range, there will be an overlap with the time range of the previous existing task node. Then, in order to avoid time overlap between different task nodes in the target progress bar, the corresponding existing task end time is determined as the start time of the new task. Otherwise, the start time of the first time range is determined as the start time of the new task; if there is an existing task start time within the second time range, it indicates that if the new task node is set with the temporary time range, there will be an overlap with the time range of the subsequent existing task node. Then, the corresponding existing task start time is determined as the end time of the new task. Otherwise, the end time of the second time range is determined as the end time of the new task. Finally, the final time range of the new task node is determined accordingly, that is, from the task start time to the task end time, thus realizing the automatic avoidance of the problem of time overlap between two task nodes.

[0017] Optionally, before determining the first time range and the second time range corresponding to the new task node according to the new instruction and the click position corresponding to the mouse click operation, it further includes:

[0018] Obtain the moving position of the mouse pointer in the target progress bar, and divide the total width of the entire row of the target progress bar by the total number of seconds in a day to obtain the unit width;

[0019] When the moving position is at the rightmost side of the target progress bar, subtract the total number of seconds of the default duration from the total number of seconds in a day to obtain the second difference;

[0020] Multiply the difference in seconds by the unit width to determine the maximum left limit distance, and determine the left distance constraint range when a task node is newly added as the range from 0 to the maximum left limit distance. The maximum left limit distance is the maximum distance of the newly added task node from the leftmost side of the target progress bar.

[0021] By adopting the above technical solution, before officially adding a task node within the target progress bar through a mouse click operation, since the person will control the mouse to move within the target progress bar to determine the position where the task node is newly added, 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 indicates that the mouse pointer may move out of the target progress bar. To ensure that the task node is only newly added within the target progress bar, at this time, it is necessary to limit the position where the task node is newly added. By calculating the maximum left limit distance, the left distance constraint distance is determined, thereby realizing the accuracy of the position when the task node is newly added.

[0022] Optionally, after generating the newly added task node within the target progress bar according to the updated target task list, it further includes:

[0023] Determine whether the newly added task node is dragged;

[0024] If so, determine the dragging type of the newly added task node being dragged;

[0025] Adjust the final time range according to the dragging type to obtain an adjusted time range;

[0026] Generate the final task node after the dragging of the newly added task node is completed according to the adjusted time range.

[0027] By adopting the above technical solution, after generating a newly added task node within the target progress bar according to the new addition instruction, if it is determined that the newly added task node is dragged, it indicates that the scheduling personnel may need to adjust the working time arrangement of the object to which the newly added task node belongs. Then, according to the dragging type of the newly added task node being dragged, analyze the specific situation of the newly added task node being dragged, thereby readjust the final time range to which it belongs to obtain an adjusted time range, so as to accurately determine the adjusted working time arrangement of the object.

[0028] Optionally, the adjusting the final time range according to the dragging type to obtain an adjusted time range specifically includes:

[0029] When the dragging type is dragging the right handle of the newly added task node, if the dragging position of the mouse dragging the newly added task node exceeds the rightmost side of the target progress bar, determine the start time of the final time range to the end time of the target progress bar as the first adjusted time range;

[0030] Determine the end time of the next day according to the dragging distance when the mouse is dragged beyond the rightmost side of the target progress bar, and determine the start time of the target progress bar to the end time of the next day as the second adjustment time range;

[0031] Generating the final task node after the dragging of the newly added task node is completed according to the adjustment time range specifically includes:

[0032] Update the updated target task list according to the first adjustment time range and the second adjustment time range, and generate the final task node after the dragging of the newly added task node is completed.

[0033] By adopting the above technical solution, if the dragging position exceeds the rightmost side of the target progress bar, it indicates that there may be a problem of working time across days in the work time arrangement of the object to which the newly added task node belongs. Then, determine the start time of the final time range to the end time of the target progress bar as the first adjustment time range, that is, the work time arrangement of the object on the current day. Further, based on the dragging distance exceeding the rightmost side of the target progress bar, analyze and determine the time span situation on the horizontal axis, so as to determine the end time of the next day. Finally, determine the start time of this target progress bar to the end time of this next day as the second adjustment time range, that is, the continuous working time of this object on the second day, so as to facilitate accurately generating the work time arrangement across days of this object in the target progress bar according to the first adjustment time range and the second adjustment time range in the future.

[0034] Optionally, adjusting the final time range according to the dragging type to obtain an adjustment time range specifically includes:

[0035] When the dragging type is dragging the left handle of the newly added task node, call the preset handleDrag function, and pass the position information of the current mouse position to the handleDrag function to obtain the time on the horizontal axis corresponding to the current mouse position;

[0036] Adjust the start time of the final time range to the time on the horizontal axis to obtain an adjustment time range.

[0037] By adopting the above technical solution, when dragging the left handle of the newly added task node of the drag type, the newly added task node is dragged in this type. The start time of the final time range will change, but the end time will not change. Further, the current position of the mouse is passed to the handleDrag function, so as to convert the current position of the mouse in the target progress bar into the time on the horizontal axis. After determining that the left handle is dragged, the change situation of the start time of the final time range is determined. Finally, the start time of the final time range is adjusted to this time on the horizontal axis, and the end time of the final time range remains unchanged, obtaining the adjusted time range, so as to facilitate regenerating the dragged task node in the target progress bar according to the adjusted time range subsequently.

[0038] Optionally, generating the newly added task node in the target progress bar according to the updated target task list specifically includes:

[0039] Calculating the target duration from the start time of the final time range to the start time of the target progress bar;

[0040] Dividing the total width of the entire row of the target progress bar by the total number of seconds in a single day to obtain the unit width, and determining 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;

[0041] Generating the newly added task node in the target progress bar through a preset barbox component according to the left distance and the updated target task list.

[0042] By adopting the above technical solution, calculating the product of the total number of seconds corresponding to the target duration and the unit width, thereby determining the width corresponding to the target duration in the target progress bar, and further determining the left distance of the newly added task node from the leftmost side of the target progress bar. Among them, the left distance can locate the starting position of the newly added task node in the target progress bar. Finally, according to this left distance and the final time range in the updated target task list, a newly added 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, and the addition of the task node is more flexible and convenient.

[0043] In the second aspect of the present application, a Gantt chart management device is provided, which specifically includes:

[0044] An instruction acquisition module, configured to acquire new instructions of task nodes within a target progress bar in a target Gantt chart, where the horizontal axis of the target Gantt chart is a time axis including each moment within 24 hours of a single day, the vertical axis of the target Gantt chart is at least one role for which tasks need to be arranged, the target progress bar is a progress bar in which task nodes that can be dragged by different objects corresponding to the target role are distributed, the time span of the progress bar is from 0:00 to 24:00, and the task nodes represent the task start time and task end time of the object;

[0045] A range division module, configured to determine a first time range and a second time range corresponding to the new task node according to the new instruction and the click position corresponding to 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 the 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 to add a task node at the corresponding click position within the target progress bar;

[0046] A range adjustment module, configured 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 new 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 nodes within the target progress bar, and the final time range does not overlap with the time range corresponding to the existing task nodes;

[0047] A node addition module, configured to add the final time range to the target task list to obtain an updated target task list, and generate the new task node within the target progress bar according to the updated target task list.

[0048] By adopting the above technical solution, the instruction acquisition module acquires new instructions, then the range division module determines the first time range and the second time range corresponding to the new task node, then the range adjustment module adjusts the temporary time range to obtain the final time range, and finally the node addition module adds the final time range to the target task list to obtain an updated target task list, and generates a new task node within the target progress bar according to the updated target task list.

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

[0050] In a fourth aspect of the present application, an electronic device is provided, specifically including:

[0051] A processor, a memory, and a computer program stored in the memory and capable of running on the processor. The processor is configured to load and execute the computer program stored in the memory, so that the electronic device executes the method described in any one of the first aspect.

[0052] In summary, the present application includes at least one of the following beneficial technical effects: obtaining a new instruction, indicating that the scheduling personnel need to add a task node of a certain object within 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 within the target progress bar. Then, analyzing the occurrence of the end times of the existing tasks within the first time range and the occurrence of the start times of the existing tasks within the second time range, determining the time overlap situation with the existing task nodes before and after when setting the new task node with a temporary time range, and automatically adjusting the temporary task start time and / or the temporary task end time of the new task node, that is, the temporary time range, when there is time overlap, to obtain the final time range that avoids time overlap. 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, and achieve more flexible and convenient addition of task nodes. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 is a schematic flowchart of a Gantt chart management method provided by an embodiment of the present application;

[0054] Figure 2 is a schematic interface diagram of a target Gantt chart provided by an embodiment of the present application;

[0055] Figure 3 is a schematic flowchart of another Gantt chart management method provided by an embodiment of the present application;

[0056] Figure 4 is a schematic interface diagram of another target Gantt chart provided by an embodiment of the present application;

[0057] Figure 5 is a schematic structural diagram of a Gantt chart management device provided by an embodiment of the present application;

[0058] Figure 6 is a schematic structural diagram of another Gantt chart management device provided by an embodiment of the present application.

[0059] Description of the reference numerals: 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 implementation mode

[0060] 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 accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments.

[0061] In the description of the embodiments of this application, words such as "exemplary", "for example" or "for instance" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "exemplary", "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the words "exemplary", "for example" or "for instance" are intended to present related concepts in a specific manner.

[0062] In the description of the embodiments of this application, the term "and / or" only describes the association relationship of associated objects and indicates that there can be three relationships. For example, A and / or B can represent: A exists alone, B exists alone, and A and B exist simultaneously. In addition, unless otherwise specified, the meaning of the term "plurality" refers to two or more. For example, a plurality of systems refers to two or more systems, and a plurality of screen terminals refers 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 technical features indicated. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. The terms "include", "comprise", "have" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0063] See Figure 1 , the embodiments of this application disclose a flow schematic diagram of a Gantt chart management method, which can be implemented depending on a computer program or run on a Gantt chart management device based on the von Neumann architecture. This computer program can be integrated in an application or run as an independent tool-type application, and specifically includes:

[0064] S101: Obtain a new instruction for a task node in a target progress bar in a target Gantt chart.

[0065] Specifically, see Figure 2, the horizontal axis of the target Gantt chart is a time axis including each moment within 24 hours of a single day, the vertical axis of the target Gantt chart is at least one role for which tasks need to be arranged, the target progress bar is the progress bar in which task nodes that can be dragged by different objects corresponding to the target role are distributed, the time span of the progress bar is from 0:00 to 24:00, and the task nodes represent 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 each moment within 0:00 to 24:00. The direction of the progress bar from left to right is the direction in which the moments in the horizontal axis increase from small to large. In the embodiment of the present application, the application scenario of the target Gantt chart is: arranging working hours for objects of different roles in a live broadcast scenario. The roles include, but are not limited to, the anchor, the field controller, the central controller, the bidder, etc. The target role can be the field controller, and there is at least one object corresponding to the field controller. It is necessary to arrange the corresponding working time range (corresponding task start time and task end time) for different objects of the target role within a whole row of progress bars corresponding to this target role in the vertical axis, that is, within the target progress bar, by setting corresponding task nodes. The time span of the working time range is defaulted to 2 hours, that is, the default duration of the task node. In other embodiments, it can also be 4 hours.

[0066] Further, the execution subject of a Gantt chart management method disclosed in the embodiment of the present application is a terminal. The terminal is a personal computer or a tablet computer. A feasible way to obtain a new instruction for a task node in the target progress bar of the target Gantt chart is: the scheduling staff clicks the "Team Scheduling" button on the terminal interface through the mouse, and the terminal obtains the new instruction for the task node, indicating that it is necessary to schedule the working hours for all or some 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.

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

[0068] Specifically, after obtaining the new instruction, the pre-mounted mousedown event is used to monitor the mouse-down event. Specifically, the mounting is implemented through addEventListener. If the mousedown event is monitored and triggered, it indicates that the scheduling staff has a mouse click operation within 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 monitored to determine whether there is a mouse click operation within the target progress bar. If the click event is monitored, it indicates 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. Further, according to the click position and the leftmost position of the target progress bar, the distance from the click position to the leftmost position of the target progress bar can be determined. Then, the total width of the entire row of the target progress bar is divided by the total number of seconds in a day, that is, 24 * 60 * 60 seconds, to obtain the unit width. Then, the distance from the click position to the leftmost position of the target progress bar is divided by this unit width to obtain the time span on the horizontal axis from the leftmost position of the target progress bar to the click position. 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 adding a task node, the duration between the task start time and the task end time of the newly added task node is the default duration, and by default, the task node is added 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 bounded by the central axis where the click position is located 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, if 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 an operation to add a task node at the click position corresponding to the target progress bar.

[0069] In other embodiments, before step S102, it further includes: obtaining the moving position of the mouse pointer in the target progress bar, and dividing the total width of the entire row of the target progress bar by the total number of seconds in a day to obtain the unit width;

[0070] When the moving position is at the rightmost side of the target progress bar, subtract the total number of seconds of the default duration from the total number of seconds in a day to obtain the second difference;

[0071] Multiply the difference in seconds by the unit width to determine the maximum left limit distance, and determine the left distance constraint range when a task node is newly added as the range from 0 to the maximum left limit distance. The maximum left limit distance is the maximum distance of the newly added task node from the leftmost side of the target progress bar.

[0072] Specifically, before officially adding a task node within the target progress bar through a mouse click operation, since the user will control the mouse to move within the target progress bar to determine the position where the task node is added, the moving position of the mouse pointer within the target progress bar is obtained in real time. Specifically, the moving position can be determined by listening to the mousemove event. When the moving position is at the rightmost side of the target progress bar, it indicates that the user's mouse pointer may move out of the target progress bar. To ensure that the task node is only added within the target progress bar, the position where the task node is added needs to be restricted at this time. Further, divide the entire line width of the target progress bar by the total number of seconds in a day to obtain the unit width. Then calculate the total number of seconds of the default duration of the task node, that is, default duration * 60 * 60. Then subtract the total number of seconds of the default duration from the total number of seconds in a day to obtain the difference in seconds, and multiply the difference in seconds by the unit width to obtain the maximum left limit distance, 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, determine the left distance constraint range when a task node is added as the range from 0 to the maximum left limit distance, so that when adding a task node at 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.

[0073] S103: Adjust the temporary time range according to the target task list, the first time range, and the second time range corresponding to the target progress bar to obtain the final time range for the newly added task node.

[0074] Specifically, in a feasible implementation, 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;

[0075] If there is an existing task end time in the first time range, determine the corresponding existing task end time as the start time of the newly added task. If there is no existing task end time in the first time range, determine the start time of the temporary time range as the start time of the newly added task;

[0076] If there is an existing task start time within the second time range, determine the corresponding existing task start time as the end time of the new task. If there is no existing task start time within the second time range, determine the end time of the temporary time range as the end time of the new task;

[0077] Adjust the temporary time range according to the start time and end time of the new task to obtain the final time range.

[0078] Specifically, after the first time range and the second time range are determined, obtain the target task list corresponding to this target task bar from the server. The target task list includes the time range from the existing task start time corresponding to the existing task node in the target task bar to the corresponding existing task end time. 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 the key factor determining the task nodes displayed in the progress bar. Specifically, the corresponding task nodes are displayed in the progress bar according to the task start time and task end time of a certain task node in the task list.

[0079] Furthermore, in the embodiment of the present application, in order to automatically avoid time overlap between the task nodes of the new addition and the task nodes of other objects of the target role when adding task nodes, it is necessary to implement time conflict avoidance between the current newly added task nodes and the existing task nodes in the target progress bar according to the first time range and the second time range. The specific implementation process is as follows: Traverse the existing task start time and 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 the temporary time range, there will be an overlap with the time range of the previous existing task node. Then, determine the corresponding existing task end time as the start time of the new 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 the temporary time range, there will be no overlap with the time range of the previous existing task node. Then, directly determine the start time of the first time range as the start time of the new task.

[0080] Further, it is determined whether the existing start and end times of each existing task node are within the second time range. If there is an existing task start time within the second time range, it indicates that if a new task node is set with the temporary time range, there will be an overlap with the time range of the subsequent existing task node. Then, the corresponding existing task start time is determined as the end time of the new task. If there is no existing task start time within the second time range, it indicates that if a new task node is set with the temporary time range, there will be no overlap with the time range of the subsequent existing task node. Then, the end time of the second time range is directly determined as the end time of the new task. 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. Furthermore, a new task node is set within the target progress bar according to the mouse click operation, which is set according to the final time range, so that when arranging shifts and assigning personnel to add task nodes according to the mouse click operation, existing task nodes with overlapping time before and after can be automatically avoided.

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

[0082] Specifically, after the final time range of the new task node is determined, this final time range is added to the target task list to obtain the updated target task list. Among them, the addition position of the final time range is 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, so as to ensure the correctness of the display of this new task node within the target progress bar.

[0083] Further, calculate the target duration from the start time of the final time range to the start time of the target progress bar; divide the total width of the entire row of the target progress bar by the total number of seconds in a 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. This left distance can locate the starting position of the new task node within the target progress bar. Finally, according to this left distance and the final time range in the updated target task list, a new task node is generated or constructed within the target progress bar through the preset barbox component, so that the newly added task node can automatically avoid the problem of time overlap and make the addition of task nodes more flexible and convenient.

[0084] See Figure 3, The flowchart of another Gantt chart management method disclosed in the embodiments of the present application can be implemented depending on a computer program or run on a Gantt chart management device based on the von Neumann architecture. This computer program can be integrated into an application or run as an independent tool application, and specifically includes:

[0085] S201: Obtain the new instruction of the task node in the target progress bar of the target Gantt chart.

[0086] S202: Determine the first time range and the second time range corresponding to the new task node according to the new instruction and the click position corresponding to the mouse click operation.

[0087] S203: 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 new task node.

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

[0089] Specifically, refer to steps S101 - S104, which will not be elaborated here.

[0090] S205: Determine whether the new task node is dragged.

[0091] S206: If so, determine the drag type of the new task node being dragged.

[0092] Specifically, after generating a new task node in the target progress bar through a mouse click operation in the target progress bar, the scheduling staff may need to adjust the working hours of the object to which the new task node belongs, such as advancing or delaying the start time of the task of the new task node, etc. Therefore, it is necessary to determine whether this new task node is dragged. A feasible determination method is as follows: By attaching the mousedown event, if it is monitored that the mousedown event is triggered and the position of the mouse click is within the new task node, it means that the scheduling staff clicks on the new task node, and at the same time monitors the previously attached mousemove event to timely monitor the event of mouse movement. If it is monitored that the mousemove event is triggered, it means that the scheduling staff may currently be preparing to drag this 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.

[0093] 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 as follows: If the position where the mouse clicks is the right handle of the newly added task node, it indicates that the drag type is dragging the right handle of the newly added task node. Dragging the newly added task node in 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 where the mouse clicks is the left handle of the newly added task node, it indicates that the drag type is dragging the left handle of the newly added task node. Dragging the newly added task node in this type, the start time of the final time range will change, but the end time will not change. If the position where the mouse clicks 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 both 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.

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

[0095] S208: Generate a final task node after the dragging of the newly added task node is completed according to the adjusted time range.

[0096] Specifically, refer to Figure 4 , when the drag type is dragging the right handle of the newly added task node, according to the continuous monitoring of the mousemove event, the dragging position of the mouse in the terminal interface can be determined in real time. If the dragging position exceeds the rightmost side of the target progress bar, it indicates that there may be a problem of crossing days in the working time arrangement of the object to which the newly added task node belongs, because the rightmost side of the target progress bar corresponds to 23:59:59 on the horizontal axis, that is, 23:59:59 of the current day. Then, determine the start time of the final time range to the end time of the target progress bar as the first adjusted time range, that is, the working time arrangement of the object on the current day. Further, when the mouse dragging operation ends, according to the event object when the mousemove event is finally triggered, determine the position when the mouse dragging ends. Finally, according to the position when the mouse dragging ends and the position of the rightmost side of the target progress bar, determine the dragging distance that exceeds the rightmost side of the target progress bar during the mouse dragging. Then divide this dragging distance by the unit width to obtain the duration corresponding to this exceeded dragging distance on the horizontal axis. Finally, add this duration to the start time (0:00) corresponding to the target progress bar to obtain the end time of the next day, and determine the start time of this target progress bar to this end time of the next day as the second adjusted time range, that is, the continuous working time of this object on the next day. Among them, the adjusted time range includes the first adjusted time range and the second adjusted time range.

[0097] After adjusting the final time range and obtaining the adjusted time range, replace the final time range in the updated target task list with the first adjusted time range, and at the same time 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 after the newly added task node is dragged and completed in the target progress bar. The time from the start time to the end time of the task corresponding to the final task node is the final working time arrangement of the corresponding object.

[0098] In other embodiments, if the drag type is to drag the left handle of the newly added task node, call the preset handleDrag function, obtain the current position information of the mouse according to the monitoring of the mousemove event, and then pass the position information of the current position of the mouse (the position where the mouse is currently dragged) to the handleDrag function to calculate the time corresponding to the current position of the mouse on the horizontal axis, that is, the time on the horizontal axis. Further, adjust the start time of the final time range to this time on the horizontal axis, and keep the end time of the final time range unchanged to obtain the adjusted time range. Finally, replace the final time range in the updated target task list with the adjusted time range, and then generate the final task node after the newly added task node is dragged and completed.

[0099] The implementation principle of a Gantt chart management in an embodiment of this application is as follows: After obtaining a new instruction, it indicates that the scheduling personnel need to add a task node of a certain object in the target progress bar. Then, according to the click position of the scheduling personnel in the target progress bar, determine the first time range and the second time range of the newly added task node. Then, analyze the occurrence of the end time of the existing tasks within the first time range and the occurrence of the start time of the existing tasks within the second time range, and determine the time overlap situation with the existing task nodes before and after when setting the newly added task node with a temporary time range. When there is a time overlap, automatically adjust the temporary task start time and / or the temporary task end time of the newly added task node, that is, the temporary time range, to obtain a final time range that avoids time overlap. 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 make the addition of the task node more flexible and convenient.

[0100] The following is an embodiment of the device of this application, which can be used to execute the method embodiment of this application. For the details not disclosed in the embodiment of the device of this application, please refer to the method embodiment of this application.

[0101] Please refer to Figure 5, which is a schematic structural diagram of the Gantt chart management device provided by the embodiment of the present application. The Gantt chart management device applied herein 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.

[0102] The instruction acquisition module 11 is configured to acquire an addition instruction for a task node within a target progress bar in a target Gantt chart. The horizontal axis of the target Gantt chart is a time axis including each moment within 24 hours of a single day, the vertical axis of the target Gantt chart is at least one role for which tasks need to be arranged, the target progress bar is a progress bar in which task nodes that can be dragged by different objects corresponding to the target role are distributed, the time span of the progress bar is from 0:00 to 24:00, and the task node represents the task start time and task end time of the object.

[0103] The range division module 12 is configured to determine a first time range and a second time range corresponding to the newly added task node according to the addition instruction and the click position corresponding to 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 the temporary time range of the newly added task node. The duration of the temporary time range is the default duration of the task node. The mouse click operation is an operation for adding a task node at the corresponding click position within the target progress bar.

[0104] The range adjustment module 13 is configured 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 nodes within the target progress bar. The final time range does not overlap with the time ranges corresponding to the existing task nodes.

[0105] The node addition module 14 is configured to add the final time range to the target task list to obtain an updated target task list, and generate a newly added task node within the target progress bar according to the updated target task list.

[0106] Optionally, the range adjustment module 13 is specifically configured to:

[0107] 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;

[0108] If there is an existing task end time within the first time range, the corresponding existing task end time is determined as the start time of the new task. If there is no existing task end time within the first time range, the start time of the first time range is determined as the start time of the new task;

[0109] If there is an existing task start time within the second time range, the corresponding existing task start time is determined as the end time of the new task. 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 end time of the new task;

[0110] Adjust the temporary time range according to the start time and end time of the new task to obtain the final time range of the new task node.

[0111] Optionally, as Figure 6 shown, the device further includes a distance constraint module 15, which is specifically used for:

[0112] Obtain the moving position of the mouse pointer in the target progress bar, and divide the entire row width of the target progress bar by the total number of seconds in a single day to obtain the unit width;

[0113] When the moving position is at the rightmost side of the target progress bar, subtract the total number of seconds of the default duration from the total number of seconds in a single day to obtain the second difference;

[0114] Multiply the second difference by the unit width to determine the left maximum limit distance, and determine the left distance constraint range when the task node is added as the range from 0 to the left maximum limit distance. The left maximum limit distance is the maximum distance of the added task node from the leftmost side of the target progress bar.

[0115] Optionally, the device further includes a node dragging module 16, which is specifically used for:

[0116] Determine whether the newly added task node is dragged;

[0117] If so, determine the dragging type of the newly added task node being dragged;

[0118] Adjust the final time range according to the dragging type to obtain the adjusted time range;

[0119] Generate the final task node after the dragging of the newly added task node is completed according to the adjusted time range.

[0120] Optionally, the node dragging module 16 is specifically used for:

[0121] When the dragging type is dragging the right handle of the newly added task node, if the dragging position of the mouse dragging the newly added task node exceeds the rightmost side of the target progress bar, determine the start time of the final time range to the end time of the target progress bar as the first adjusted time range;

[0122] Determine the end time of the next day according to the dragging distance that exceeds 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

[0123] Optionally, the node dragging module 16 is specifically used for:

[0124] Update the updated target task list according to the first adjustment time range and the second adjustment time range, and generate the final task node after the dragging of the newly added task node is completed.

[0125] Optionally, the node dragging module 16 is specifically used for:

[0126] When dragging the left handle of the newly added task node, call the preset handleDrag function, and pass the position information of the current mouse position to the handleDrag function to obtain the time on the horizontal axis corresponding to the current mouse position;

[0127] Adjust the start time of the final time range to the time on the horizontal axis to obtain the adjusted time range.

[0128] Optionally, the node adding module 14 is specifically used for:

[0129] Calculate the target duration from the start time of the final time range to the start time of the target progress bar;

[0130] Divide the total width of the entire row 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;

[0131] Generate a newly added task node in the target progress bar through the preset barbox component according to the left distance and the updated target task list.

[0132] It should be noted that when the Gantt chart management device provided in the above embodiment executes the Gantt chart management method, only the above-mentioned division of each functional module is used for illustration. In actual application, the above functions can be allocated to different functional modules according to needs, 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, the Gantt chart management device provided in the above embodiment and the Gantt chart management method embodiment belong to the same concept, and the implementation process is detailed in the method embodiment, which will not be repeated here.

[0133] The embodiments of the present application also disclose a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, a Gantt chart management method of the above embodiments is adopted.

[0134] Among them, the computer program can be stored in a computer-readable medium. The computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some middleware form, etc. The computer-readable medium includes any entity or device, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, 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 components.

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

[0136] The embodiments of the present application also disclose an electronic device. A computer program is stored in the computer-readable storage medium. When the computer program is loaded and executed by a processor, a Gantt chart management method of the above is adopted.

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

[0138] Among them, the processor can adopt a central processing unit (CPU). Of course, according to the actual usage situation, other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) 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. The present application does not make any restrictions on this.

[0139] Among them, the memory can be an internal storage unit of the electronic device, for example, the hard disk or memory of the electronic device, or can also be an external storage device of the electronic device, for example, a plug-in hard disk, a smart memory card (SMC), a secure digital card (SD), or a flash memory card (FC), etc. equipped on the electronic device. Moreover, the memory can also be a combination of the internal storage unit and the 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 the data that has been output or will be output. This application does not make any restrictions on this.

[0140] 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 convenient use.

[0141] The above are only exemplary embodiments of the present disclosure, and the scope of the present disclosure cannot be limited thereby. That is, any equivalent changes and modifications made according to the teachings of the present disclosure still fall within the scope covered by the present disclosure. This application aims to cover any variations, uses, or adaptive changes of the present disclosure, and these variations, uses, or adaptive changes follow the general principles of the present disclosure and include the common general knowledge or conventional technical means in the technical field not recorded in the present disclosure. The description and embodiments 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