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

By listening to mouse drag events in the Gantt chart, calculating the drag distance and updating the task bar position, the problem of insufficient time granularity of the Gantt chart is solved, and fine time management is achieved within 24 hours, improving the refinement of task arrangements is improved. degree.

CN118778869BActive Publication Date: 2024-12-27HANGZHOU MIANCHAO INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411270551.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-27
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

When scheduling tasks, the existing Gantt chart has a large time granularity, resulting in a low degree of refinement of task arrangements and the inability to achieve fine time management within 24 hours.

Method used

By implementing mouse drag operations in the Gantt chart, listening to mousedown and mousemove events, calculating the drag distance and the start and end times after drag, updating the position and width of the task bar, realizing the time within 24 hours as time granularity, and improving the The degree of refinement of task arrangement.

Benefits of technology

The task arrangement with a time granularity of 24 hours in the Gantt chart is realized, which improves the degree of refinement of task arrangements and allows users to manage time more accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118778869B_ABST
    Figure CN118778869B_ABST
Patent Text Reader

Abstract

The present application relates to a Gantt chart calendar dragging method, device, storage medium and electronic device, and relates to the field of Gantt chart technology, wherein the method includes: when the target Gantt chart is started in the user's terminal, the target Gantt chart is configured and initialized; if the mousedown event is triggered, the initial position of the mouse pressed in the terminal interface is determined and the mousemove event is listened, and when the mousemove event is triggered, the final position of the mouse dragged in the terminal interface during the dragging of the target task bar is determined, and the target task bar is the task bar to be dragged by the target object; according to the final position and the initial position, the dragging distance of the target task bar is determined, and based on the dragging distance, the start time and the end time of the target task bar after dragging are determined; according to the start time and the end time of the dragging, the position and width of the target task bar in the target Gantt chart are updated. The present application has the effect of improving the degree of refinement of task scheduling.
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 calendar dragging method, device, storage medium and electronic device. Background Art

[0002] Gantt chart, also known as bar chart, was developed by Henry Gantt in 1917. The inner idea of ​​Gantt chart is relatively simple. It is essentially a line chart, in which the vertical axis represents the tasks or activities in the project, and the horizontal axis represents time, which can intuitively show the degree of task completion in a unit of time. Gantt chart is widely used in project management due to its intuitive visualization characteristics, helping managers to easily grasp the overall situation of the project, identify potential problems in time and make adjustments. Among them, the calendar in the Gantt chart is a form of displaying the information in the Gantt chart in a calendar. It presents project tasks and schedules through a calendar view, making the time management of the project more in line with people's daily time management habits.

[0003] Currently, when arranging and counting tasks through Gantt charts, the time represented by the horizontal axis of the Gantt chart is usually in units of days, weeks, and months. Managers can only arrange tasks for a single day, week, or month through the Gantt chart. The time granularity of task arrangement is relatively large, resulting in a low degree of refinement in task arrangement. Summary of the invention

[0004] In order to improve the refinement of task scheduling, the present application provides a Gantt chart calendar dragging method, device, storage medium and electronic device.

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

[0006] When a target Gantt chart is started in a user's terminal, the target Gantt chart is configured and initialized, wherein the horizontal axis of the target Gantt chart is a time axis including various moments within 24 hours of a single day, the vertical axis of the target Gantt chart is a time axis including different dates, the calendar in the target Gantt chart includes at least one task bar, and the task bar is a time segment that can be dragged in the direction of the horizontal axis under a corresponding date, and the configuration initialization includes monitoring a mousedown event of the terminal;

[0007] If the mousedown event is triggered, the initial position of the mouse pressed in the terminal interface is determined and the mousemove event is monitored, and when the mousemove event is triggered, the final position of the mouse dragged in the terminal interface during the process of dragging the target task bar is determined, and the target task bar is the task bar of the target object to be dragged;

[0008] Determine the dragging distance of the target task bar according to the final position and the initial position, and determine the dragging start time and the dragging end time of the target task bar based on the dragging distance;

[0009] According to the dragging start time and the dragging end time, the position and width of the target task bar in the target Gantt chart are updated.

[0010] By adopting the above technical solution, if the mousedown event is monitored, it means that the user performs a mouse-pressing operation on the target Gantt chart, and then the initial position of the mouse pressed in the terminal interface is determined. If the mousemove event is monitored, it means that the user may be preparing to drag the task bar in the calendar of the target Gantt chart, that is, the target task bar, which is the task bar to be dragged by the target object, and then the user is ready to schedule tasks for the target object, then the final position of the mouse dragged to the target task bar in the terminal interface during the dragging process is determined. Further, according to the initial position and final position of the mouse when dragging in the terminal interface, the dragging distance of the target task bar is determined, and then the start time and end time of the target task bar after dragging are determined, that is, the start time and end time of the new task bar after the target task bar is dragged. Finally, according to the start time and end time after dragging, the width and position of the calendar of the dragged target task bar in the target Gantt chart are determined, so as to realize the time granularity within 24 hours, and the time granularity is small, so that the task scheduling is more refined.

[0011] Optionally, determining the dragging start time and the dragging end time of the target task bar based on the dragging distance specifically includes:

[0012] Determining the dragging duration of the target task bar according to the dragging distance, and determining the dragging type of the target task bar;

[0013] If the drag type is an overall drag type, determining the dragging start time and the dragging end time of the target task bar according to the task start time of the target task bar and the dragging duration;

[0014] If the drag type is a boundary drag type, then when the drag boundary is the boundary corresponding to the task start time, the drag post-start time of the target task bar is determined according to the task start time and the drag duration, and the task end time of the target task bar is determined as the drag post-end time of the target task bar;

[0015] When the dragging boundary is the boundary corresponding to the task end time, the task start time is determined as the dragging start time of the target task bar, and the dragging end time of the target task bar is determined based on the task end time and the dragging duration.

[0016] By adopting the above technical solution, if the drag type is the overall drag type, it means that the target task bar is dragged as a whole, which means that the task start time and task end time of the target task bar will change accordingly. Then, according to the task start time and the drag duration, the target task bar's start time after dragging and the end time after dragging are determined; if the drag type is the boundary drag type, it means that when the drag boundary is the boundary corresponding to the task start time, the end time of the target task bar before and after dragging remains unchanged, and the task end time is determined as the target task bar's end time after dragging. Then, according to the task start time and the drag duration, the target task bar's start time after dragging is determined; when the drag boundary is the boundary corresponding to the task end time, the start time of the target task bar before and after dragging remains unchanged, and the task start time is determined as the target task bar's start time after dragging. Finally, according to the task end time and the drag duration, the end time after dragging is determined, thereby realizing the accurate determination of the start time after dragging and the end time after dragging under different drag types.

[0017] Optionally, determining the dragging start time and the dragging end time of the target task bar according to the task start time of the target task bar and the dragging duration specifically includes:

[0018] When the target task bar does not exceed the time range within the corresponding target date when being dragged, the task start time of the target task bar is subtracted from or added to the dragging time according to the dragging direction of the target task bar to obtain the dragged start time of the target task bar;

[0019] Add the dragging start time to the total duration of the target task bar to obtain the dragging end time of the target task bar;

[0020] When the target task bar partially exceeds the time range of the corresponding target date during dragging, the start time and end time of the dragging of the target task bar are determined according to the date of the previous day or the later day of the target date.

[0021] By adopting the above technical solution, if the target task bar does not exceed the time range of the corresponding target date during the dragging process, it means that the dragging of the target task bar is limited to 24 hours on the target date. Then, according to the dragging direction of the target task bar, the task start time is subtracted or added to the dragging duration to obtain a new start time after the target task bar is dragged, that is, the start time after dragging. Since the target task bar is dragged as a whole, the total duration corresponding to the target task bar remains unchanged. Therefore, after the start time after dragging is determined, the start time after dragging is added to the total duration of the target task bar to obtain the end time after dragging. If the target task bar partially exceeds the time range within the corresponding target date when being dragged, it means that there may be a situation where the target task bar crosses dates during dragging. Then, according to the date of the day before or the day after the target date, the start time and end time of the target task bar after dragging are determined, so as to accurately determine the start time and end time of the target task bar after the overall dragging.

[0022] Optionally, determining the dragging start time and the dragging end time of the target task bar according to the date of the day before or the day after the target date specifically includes:

[0023] When the target task bar is dragged in a direction along the horizontal axis toward the vertical axis, the task start time is subtracted from the start time of the target date to obtain a first dragged duration, and the dragging duration is subtracted from the first dragged duration to obtain a first remaining dragging duration;

[0024] Subtract the first remaining dragging time from the end time of the date one day before the target date to obtain the dragging start time of the target task bar, and subtract the dragging time from the task end time of the target task bar to obtain the dragging end time of the target task bar;

[0025] When the target task bar is dragged in a direction away from the vertical axis along the horizontal axis, the task end time is subtracted from the end time of the target date to obtain a second dragged time, and the second dragged time is subtracted from the dragging time to obtain a second remaining dragging time;

[0026] Add the starting time of the day after the target date to the second remaining dragging time to obtain the end time of the target task bar after dragging, and add the task start time to the dragging time to obtain the start time of the target task bar after dragging.

[0027] By adopting the above technical solution, when the dragging direction of the target task bar is along the horizontal axis close to the vertical axis, it means that the target task bar may cross to the date one day before the target date, the dragging time is subtracted from the first dragged time to obtain the first remaining dragging time, that is, the time of continuing to drag in the direction of the time on the horizontal axis becoming smaller on the date one day before the target date, and further, the end time on the date one day before the target date is subtracted from the first remaining dragging time to obtain the start time of the target task bar after dragging, and at the same time, the boundary corresponding to the task end time of the target task bar is within the target date during the entire dragging process, then the target task bar The target task bar's task end time is subtracted from the dragging time to obtain the target task bar's end time after dragging; when the dragging direction of the target task bar is along the horizontal axis away from the vertical axis, it means that the target task bar may cross to the day after the target date. The second dragged time is subtracted from the dragging time to obtain the second remaining dragging time, that is, the time for continuing to drag in the direction of increasing time on the horizontal axis on the day after the target date. Furthermore, the starting time on the day after the target date is added to the second remaining dragging time to obtain the target task bar's start time after dragging. Finally, the target task bar's task start time is added to the dragging time.

[0028] Optionally, when the dragging boundary is a boundary corresponding to the task start time, determining the dragging start time of the target task bar according to the task start time and the dragging duration specifically includes:

[0029] When the dragging boundary is the boundary corresponding to the task start time, if the dragging direction of the target task bar is the direction along the horizontal axis approaching the vertical axis, then determining the target duration between the task start time and the start time of the target date where the target task bar is located;

[0030] If the dragging duration exceeds the target duration, the end time of the date one day before the target date is subtracted from the preset duration to obtain the start time of the target task bar after dragging;

[0031] If the dragging duration does not exceed the target duration, the dragging duration is subtracted from the task start time to obtain the post-drag start time of the target task bar.

[0032] By adopting the above technical scheme, if the dragging time exceeds the target time, it means that the target task bar involves crossing different dates during the dragging process, then the end time of the date of the day before the target date is subtracted from the preset time to obtain the start time after dragging, that is, the start time of the target task bar after dragging; if the dragging time does not exceed the target time, it means that the target task bar does not involve crossing different dates during the dragging process, then the task start time of the target task bar, that is, the start time of the target task bar before dragging, is subtracted from the dragging time to obtain the start time after dragging, thereby arranging task bars for the target object within a smaller time granularity.

[0033] Optionally, determining the dragging duration of the target task bar according to the dragging distance specifically includes:

[0034] Obtaining a container width of the target Gantt chart, and dividing the container width by the total number of seconds in a single day to obtain a ratio;

[0035] Dividing the drag distance by the ratio to obtain the initial drag duration of the target task bar, and determining whether a drag pace is set, the pace being the duration span in the horizontal direction when the mouse drags the target task bar once;

[0036] If yes, then when the initial dragging duration is a multiple of the step, the initial dragging duration is determined as the dragging duration of the target task bar; when the initial dragging duration is not a multiple of the step, the product of the quotient of the initial dragging duration divided by the step and the step is determined as the dragging duration of the target task bar;

[0037] If not, the initial dragging duration is determined as the dragging duration of the target task bar.

[0038] By adopting the above technical solution, the container width is divided by the total number of seconds to obtain a ratio, that is, the width occupied per second, and finally the dragging distance is divided by this ratio to obtain the initial dragging duration of the target task bar. Further, if a pace is set when dragging the target task bar, then when the initial dragging duration is a multiple of the pace, the initial dragging duration is directly determined as the duration of the target task bar being dragged; if the initial dragging duration is not a multiple of the pace, the actual dragging duration of the target task bar is the product of the quotient and the pace; if no pace is set, it means that the dragging duration is the actual dragging duration of the target task bar, thereby more accurately determining the dragging duration of the target task bar.

[0039] Optionally, the configuration initialization further includes monitoring a resize event of a page in the terminal, and the method further includes:

[0040] If the resize event is triggered, a new size of the terminal page is re-acquired;

[0041] Determine a new container width of the target Gantt chart according to the new size;

[0042] The width and position of the target task bar after dragging are re-determined according to the new container width, the start time after dragging, and the end time after dragging.

[0043] By adopting the above technical solution, if the resize event is triggered, it means that the size of the page currently displaying the target Gantt chart has changed, so the new size of the page in the terminal is re-acquired, and then the new container width of the target Gantt chart in the page is immediately determined. Finally, based on the start time and the end time after dragging, the dragging duration is determined, and according to the new container width and the dragging duration, the width and position of the target task bar after dragging are re-determined, so as to realize adaptive adjustment of the width and position of the target task bar after dragging when the page size changes.

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

[0045] An initial configuration module, configured to initialize the configuration of a target Gantt chart when the target Gantt chart is started in a user's terminal, wherein the horizontal axis of the target Gantt chart is a time axis including various moments within 24 hours of a single day, the vertical axis of the target Gantt chart is a time axis including different dates, the calendar in the target Gantt chart includes at least one task bar, and the task bar is a time segment that can be dragged in the direction of the horizontal axis under a corresponding date, and the configuration initialization includes monitoring a mousedown event of the terminal;

[0046] a position determination module, for determining the initial position of the mouse pressed in the terminal interface and listening to the mousemove event if the mousedown event is triggered, and for determining the final position of the mouse dragged in the terminal interface during the process of dragging the target task bar when the mousemove event is triggered, wherein the target task bar is the task bar of the target object to be dragged;

[0047] A time determination module, used to determine the dragging distance of the target task bar according to the final position and the initial position, and determine the dragging start time and the dragging end time of the target task bar based on the dragging distance;

[0048] The task updating module is used to update the position and width of the target task bar in the target Gantt chart according to the start time after dragging and the end time after dragging.

[0049] By adopting the above technical solution, the initial configuration module initializes the configuration of the target Gantt chart, then the position determination module determines the initial position and the final position, and then the time determination module determines the dragging distance of the target task bar according to the final position and the initial position, and determines the start time and the end time of the drag according to the dragging distance, and finally the task update module updates the position and width of the target task bar in the target Gantt chart according to the start time and the end time of the drag.

[0050] 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.

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

[0052] 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.

[0053] In summary, the present application includes at least one of the following beneficial technical effects: according to the initial position and final position of the mouse when dragging in the terminal interface, the dragging distance of the target task bar is determined, and then the start time and end time of the target task bar after dragging are determined, that is, the start time and end time of the new task bar after the target task bar is dragged. Finally, according to the start time and end time of the drag, the width and position of the calendar of the target task bar after dragging in the target Gantt chart are determined, so as to achieve the time granularity within 24 hours, and the time granularity is small, so that the task scheduling is more refined. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 It is a flowchart of a Gantt chart calendar dragging method provided by an embodiment of the present application;

[0055] Figure 2 This is a schematic diagram of a Gantt chart calendar dragging provided by an embodiment of the present application;

[0056] Figure 3 It is a flowchart of another Gantt chart calendar dragging method provided by an embodiment of the present application;

[0057] Figure 4 It is a structural schematic diagram of a Gantt chart calendar dragging device provided in an embodiment of the present application;

[0058] Figure 5It is a structural schematic diagram of another Gantt chart calendar dragging device provided in an embodiment of the present application.

[0059] Explanation of the accompanying drawings: 11. Initial configuration module; 12. Position determination module; 13. Time determination module; 14. Task update module; 15. Adaptation adjustment module. DETAILED DESCRIPTION

[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 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.

[0061] 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.

[0062] 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.

[0063] See also Figure 1 The present application embodiment discloses a flow chart of a Gantt chart calendar dragging method, which can be implemented by a computer program or run on a Gantt chart calendar dragging 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:

[0064] S101: When a target Gantt chart is started in a user's terminal, the target Gantt chart is configured and initialized, the horizontal axis of the target Gantt chart is a time axis including various moments within 24 hours of a single day, the vertical axis of the target Gantt chart is a time axis including different dates, the calendar in the target Gantt chart includes at least one task bar, and the task bar is a time segment that can be dragged in the horizontal direction under the corresponding date, and the configuration initialization includes monitoring a mousedown event of the terminal.

[0065] Specifically, in the embodiment of the present application, the user refers to the manager who arranges tasks for the object to be executed, and can be specifically the person who arranges the live broadcast schedule for the anchor in the enterprise, that is, the person who arranges the time period for the live broadcast for the anchor. The terminal can be an electronic device such as a mobile phone, a tablet computer, an e-book reader, a multimedia player, a wearable device, a PC (Personal Computer, personal computer), etc. Figure 2As shown, the target Gantt chart is a Gantt chart created by the user to arrange tasks. The target Gantt chart is different from the traditional Gantt chart. Its horizontal axis is a time axis containing all the moments in a 24-hour day. For example, the time axis in the horizontal axis of the target Gantt chart is 00:00:00~23:59:59. The vertical axis of the target Gantt chart is a time axis of different dates, that is, the dates on which tasks need to be arranged. For example, the time axis of the vertical axis of the target Gantt chart can be 2024.04.15~2024.04.19, that is, dates containing five days. In other embodiments, it can also be a date of half a month. For each date in the time axis of the vertical axis, the time period corresponding to the task can be arranged for different objects in the horizontal axis. For example, on 2024.04.15, Zhang San's live broadcast time period can be arranged from 01:00:00 to 04:00:00 from 00:00:00 to 23:59:59, and Li Si's live broadcast time period can be arranged from 05:00:00 to 22:00:00. There can be multiple time periods arranged for each object. Furthermore, the calendar in the target Gantt chart includes at least one task bar, which is a draggable time period under the corresponding date, that is, the time period required for the scheduled task to be executed. Each object can have multiple task bars under a single date. If the time period for an object to execute a task on a single date needs to be adjusted, the target Gantt chart can support dragging the corresponding task bar in the horizontal axis direction to adjust the time period corresponding to the task bar. In other embodiments, when the object is an anchor, the popularity of each historical live broadcast time period is counted, and the first historical live broadcast time period is selected from each historical live broadcast time period in order of popularity from large to small to determine it as a hot time period, and then the live broadcast popularity of each live broadcast type in each hot time period is counted, and the second live broadcast type is selected from each live broadcast type in order of live broadcast popularity from large to small to determine it as the hot live broadcast type of the corresponding hot time period. The first weight of each hot time period and the second weight of the corresponding hot live broadcast type are calculated, the first weight is the ratio of the popularity of each hot time period to the sum of the popularity of all hot time periods, and the second weight is the ratio of the live broadcast popularity of a single hot live broadcast type corresponding to the hot time period to the sum of the live broadcast popularity of all hot live broadcast types. When there is an anchor who takes leave, the target live broadcast type and leave time period of the anchor who takes leave are determined. When the leave period is a popular period and the target live broadcast type is a popular live broadcast type, the first weight product of the leave period and the first weight of the corresponding target live broadcast type is calculated. The larger the first weight product is, the easier it is for the anchor of the target live broadcast type to gain more popularity during this leave period.If the first weight product is greater than the preset product threshold, it means that the viewing demand for the target live broadcast type during this leave period is relatively large, then determine the other anchors of the target live broadcast type on the day of the leave period, and determine the target time period for other anchors on that day, and calculate the first weight of each target time period and the second weight product of the corresponding target live broadcast type. If the second weight product is less than the first weight product, then adjust the corresponding live broadcast time period of other anchors to the leave period, which can not only supplement the live broadcast of the leave anchor during the leave period, but also arrange more suitable live broadcast time periods for the corresponding other anchors.

[0066] Further, to determine whether the target Gantt chart in the terminal is started, a feasible determination method is: it can be determined by referencing refs of the Document Object Model (DOM) element of the target Gantt chart. When the target Gantt chart is started in the user's terminal, it means that the user needs to edit the task bar in the target Gantt chart, so the target Gantt chart is configured and initialized. The configuration initialization includes monitoring the mousedown event of the terminal. A feasible monitoring method is: mounting the mousedown event through addEventListener to monitor the mouse press event. Configuration initialization includes monitoring the resize event of the page in the terminal, which is used to monitor the zoom of the page in the terminal, etc., and specifically mounting the resize event through addEventListener. In other embodiments, configuration initialization also includes echoing data and pages. Among them, the mousedown event is a mouse event in JavaScript, which is triggered when the user presses any mouse button. The resize event is an event in JavaScript, which is triggered when the size of the browser window or an HTML element changes. It should be noted that the execution subject of the Gantt chart calendar dragging method in the embodiment of the present application is a terminal, and an application corresponding to the Gantt chart calendar dragging method is installed in the terminal in the form of a plug-in.

[0067] S102: If the mousedown event is triggered, determine the initial position of the mouse pressed in the terminal interface and monitor the mousemove event, and when the mousemove event is triggered, determine the final position of the mouse dragged in the terminal interface during the process of dragging the target task bar, where the target task bar is the task bar of the target object to be dragged.

[0068] Specifically, if the mousedown event is monitored, it means that the user has pressed the mouse on the target Gantt chart. Then, the initial position of the mouse in the terminal interface is obtained through the callback function, that is, the initial position coordinates of the mouse pointer in the terminal interface when the mouse is pressed, and the mousemove event is mounted through addEventListener to monitor the mouse movement event in time. Among them, the mousemove event is a mouse event in JavaScript, which is triggered repeatedly when the mouse moves inside an element. If the mousemove event is monitored, it means that the user may be preparing to drag the task bar in the calendar of the target Gantt chart, that is, the target task bar, which is the task bar to be dragged by the target object, and then it indicates that the user is ready to schedule tasks for the target object. Then, it is determined that the target task bar is dragged to the final position in the terminal interface during the dragging process, that is, the final position coordinates of the mouse pointer in the terminal interface when the mousemove event is triggered for the last time.

[0069] S103: Determine the dragging distance of the target task bar according to the final position and the initial position, and determine the dragging start time and the dragging end time of the target task bar based on the dragging distance.

[0070] Specifically, after the final position and the initial position are determined, the dragging distance of the target task bar in the horizontal direction by the user dragging the mouse on the terminal interface is determined according to the coordinates of the final position and the coordinates of the initial position, that is, the movement distance of the mouse pointer. Further, based on the dragging distance, the start time and the end time of the target task bar after dragging are determined, that is, the start time and the end time of the new task bar after the target task bar is dragged. A feasible implementation method is: first obtain the container width of the target Gantt chart, specifically obtain the DOM element of the target Gantt chart through document.getElementById, and based on the DOM element, use the .offsetWidth or .clientWidth attribute to determine the container width of the target Gantt chart. Among them, the container width refers to the width of the container element that holds the target Gantt chart when the terminal displays the target Gantt chart. Furthermore, the total number of seconds in a single day is calculated, that is, 24*60*60=86400 seconds, and the container width is divided by the total number of seconds to obtain the ratio, that is, the width occupied per second. Finally, the dragging distance is divided by this ratio to obtain the initial dragging duration of the target task bar.

[0071] Furthermore, the configuration information of the step parameter is obtained from the configuration item of the target Gantt chart, and it is determined according to the step parameter whether the user has set the pace of dragging. If so, the pace is extracted from the configuration information of the step parameter. The pace is the time span in the horizontal direction when the mouse drags the target task bar once. The unit of the pace can be hours, minutes or seconds. For example, the pace can be a dragging time span of 5 minutes or 10 seconds.

[0072] Divide the initial drag duration by the pace. If it is divisible, the initial drag duration is determined to be a multiple of the pace. Then the initial drag duration is determined as the drag duration of the target task bar, that is, the drag duration in the horizontal axis direction. If it is not divisible, it is determined that the initial drag duration is not a multiple of the pace. The product of the quotient of the initial drag duration divided by the pace and the pace is determined as the drag duration of the target task bar. On the contrary, if the drag pace is not set, the initial drag duration is directly determined as the drag duration, and finally the drag duration of the target task bar is determined according to the drag distance.

[0073] Further, the drag type of the target task bar dragged by the user is determined. In the embodiment of the present application, the drag type includes an overall drag type and a boundary drag type, such as Figure 2 As shown, the overall drag type is to drag the target task bar as a whole and move it in the horizontal direction, and the total duration of the target task bar after dragging will not change. The boundary drag type is to drag the boundary corresponding to the task start time or task end time in the target task bar and move it in the horizontal direction, and the total duration of the target task bar after dragging will change. Furthermore, if the initial position is in the middle of the target task bar, and the drag type of the target task bar is determined to be the overall drag type, then the start time and end time of the target task bar after dragging are determined according to the dragging duration and the task start time, specifically:

[0074] If the target task bar does not exceed the time range of the corresponding target date during the dragging process, it means that the dragging of the target task bar is limited to 24 hours on the target date, where the target date is the date on the vertical axis corresponding to the target task bar, and the time range is the starting time 00:00:00 to the end time 23:59:59 of the target date. Then determine the dragging direction of the target task bar. If the dragging direction is in the direction close to the vertical axis along the horizontal axis (the direction in which the time on the horizontal axis gradually decreases), then the start time and end time of the target task bar after dragging will become earlier. Subtract the dragging duration from the task start time to obtain the start time after dragging; if the dragging direction is in the direction away from the vertical axis along the horizontal axis (the direction in which the time on the horizontal axis gradually increases), add the dragging duration to the task start time to obtain the start time after dragging.

[0075] Since the target task bar is dragged as a whole, the total duration corresponding to the target task bar remains unchanged. Therefore, after the start time after dragging is determined, the start time after dragging is added to the total duration of the target task bar to obtain the end time after dragging.

[0076] If the target task bar partially exceeds the time range of the corresponding target date when being dragged, it indicates that the target task bar may cross dates during dragging. Then, according to the date of the day before or the day after the target date, the start time and the end time of the dragging of the target task bar are determined. One achievable implementation method is:

[0077] When the dragging direction of the target task bar is along the horizontal axis close to the vertical axis, it means that the target task bar may cross to the date before the target date. Then, subtract the starting time of the target date 00:00:00 from the task start time of the target task bar to obtain the first dragged duration of the target task bar within the target date. Then, subtract the first dragged duration from the drag duration to obtain the first remaining drag duration, that is, the duration of continuing to drag in the direction where the time on the horizontal axis becomes smaller on the date before the target date. Further, subtract the first remaining drag duration from the end time on the date before the target date to obtain the start time of the target task bar after dragging. Finally, subtract the drag duration from the task end time of the target task bar to obtain the end time of the target task bar after dragging.

[0078] When the dragging direction of the target task bar is along the horizontal axis away from the vertical axis, it means that the target task bar may span to the day after the target date. Then, subtract the task end time of the target task bar from the end time of the target date 23:59:59 to obtain the second dragged time of the target task bar. Then, subtract the second dragged time from the dragging time to obtain the second remaining dragging time, that is, the time of continuing to drag in the direction of increasing time on the horizontal axis on the day after the target date. Further, add the starting time of the day after the target date to the second remaining dragging time to obtain the start time of the target task bar after dragging. Finally, add the dragging time to the task start time of the target task bar to obtain the start time of the target task bar after dragging.

[0079] Further, if the drag type is a boundary drag type, when the drag boundary is the boundary corresponding to the task start time, the end time of the target task bar before and after the drag remains unchanged, and the task end time is determined as the end time of the target task bar after dragging. Then, according to the task start time and the drag duration, the start time after dragging of the target task bar is determined, and specifically according to the drag direction, the task start time is added or subtracted from the drag duration to obtain the start time after dragging. Exemplarily, if the drag direction is the direction in which the time on the horizontal axis becomes smaller, then the task start time is subtracted from the drag duration to obtain the start time after dragging; if the drag direction is the direction in which the time on the horizontal axis becomes larger, then the task start time is added to the drag duration to obtain the start time after dragging. When the drag boundary is the boundary corresponding to the task end time, the start time of the target task bar before and after the drag remains unchanged, and the task start time is determined as the start time after dragging of the target task bar. Further, according to the drag direction, the task end time is added or subtracted from the drag duration to obtain the end time after dragging. Exemplarily, if the dragging direction is along the direction in which the time on the horizontal axis becomes smaller, then the task end time is subtracted from the dragging duration to obtain the end time after dragging; if the dragging direction is along the direction in which the time on the horizontal axis becomes larger, then the task end time is added to the dragging duration to obtain the end time after dragging.

[0080] In another embodiment, when the dragging boundary is the boundary corresponding to the task start time, the start time of the target task bar after dragging is determined according to the task start time and the dragging duration. One achievable implementation is: if the dragging direction is along the horizontal axis close to the vertical axis, then determine the target duration between the task start time of the target task bar and the start time of the target date where the target task bar is located. If the dragging duration exceeds the target duration, it means that the target task bar involves crossing different dates during the dragging process. Then, the end time 23:59:59 of the date of the day before the target date is subtracted from the preset duration to obtain the start time after dragging, wherein the preset duration is configured in advance through the depthConfig parameter of the target Gantt chart. If the dragging duration does not exceed the target duration, it means that the target task bar does not involve crossing different dates during the dragging process. Then, the task start time of the target task bar is subtracted from the dragging duration to obtain the start time after dragging of the target task bar.

[0081] S104: updating the position and width of the target task bar in the target Gantt chart according to the dragging start time and the dragging end time.

[0082] Specifically, after the start time and end time of the target task bar after dragging are determined, the total duration from the start time to the end time is calculated, and then the ratio of the container width to the total number of seconds in a single day is obtained, and the product of this total duration and the ratio is calculated to obtain the final width of the target task bar after dragging. The start time after dragging is used as the starting position of the target task bar after dragging, and the end time after dragging is used as the ending position of the target task bar after dragging, and the task bar with the final width is redrawn, thereby updating the position and width of the target task bar in the target Gantt chart.

[0083] See also Figure 3 The present application embodiment discloses a flow chart of another Gantt chart calendar dragging method, which can be implemented by a computer program or run on a Gantt chart calendar dragging 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:

[0084] S201: When the target Gantt chart is started in the user's terminal, the target Gantt chart is configured and initialized, 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 a time axis containing different dates, the calendar in the target Gantt chart includes at least one task bar, and the task bar is a time segment that can be dragged in the horizontal direction under the corresponding date, and the configuration initialization includes monitoring the mousedown event of the terminal and the resize event of the page in the terminal.

[0085] S202: If the mousedown event is triggered, determine the initial position of the mouse pressed in the terminal interface and listen to the mousemove event, and when the mousemove event is triggered, determine the final position of the mouse dragged in the terminal interface during the process of dragging the target task bar, where the target task bar is the task bar of the target object to be dragged.

[0086] S203: Determine the dragging distance of the target task bar according to the final position and the initial position, and determine the dragging start time and the dragging end time of the target task bar based on the dragging distance.

[0087] S204: updating the position and width of the target task bar in the target Gantt chart according to the dragging start time and the dragging end time.

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

[0089] S205: If the resize event is triggered, a new size of the terminal page is re-acquired.

[0090] S206: Determine a new container width of the target Gantt chart according to the new size.

[0091] S207: Re-determine the width and position of the target task bar after dragging according to the new container width, the start time after dragging, and the end time after dragging.

[0092] Specifically, if the resize event is triggered, it means that the size of the page currently displaying the target Gantt chart has changed. Then, the new size of the page in the terminal is re-acquired. A feasible acquisition method is: after the resize event is triggered, the corresponding callback function is executed. In the callback function, the width and height of the page after the change can be obtained through window.innerWidth and window.innerHeight, and the new size is finally determined. Then, according to the new size and the size of the page before the size change, the scaling ratio of the terminal page is determined, and based on the scaling ratio and the container width of the target Gantt chart, the new container width of the target Gantt chart is determined. Further, the spacing between the screen container before the page change and the same side of the container of the target Gantt chart is obtained through the margin-left, margin-right, margin-top or margin-bottom attributes, and the corresponding new spacing is determined based on the scaling ratio. Further, based on the new spacing and the new container width, the position of the target Gantt chart in the page can be determined. Finally, based on the start time and the end time of the dragging, the dragging duration is determined, and according to the new container width and the dragging duration, the width and position of the target task bar after the dragging are re-determined, for details, see step S104, which will not be described in detail here. Thus, when the page is scaled, the width and position of the target task bar can be adaptively adjusted.

[0093] The implementation principle of a Gantt chart calendar dragging method in an embodiment of the present application is: according to the initial position and final position of the mouse when dragging in the terminal interface, determine the dragging distance of the target task bar, and then determine the start time and end time of the target task bar after dragging, that is, the start time and end time of the new task bar after the target task bar is dragged. Finally, according to the start time and end time of dragging, determine the width and position of the calendar of the target task bar after dragging in the target Gantt chart, so as to achieve the time granularity within 24 hours, and the time granularity is small, so that the task scheduling is more refined.

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

[0095] See also Figure 4, which is a schematic diagram of the structure of the Gantt chart calendar dragging device provided in the embodiment of the present application. The Gantt chart calendar dragging device can be implemented as all or part of the device through software, hardware or a combination of both. The device includes an initial configuration module 11, a position determination module 12, a time determination module 13 and a task update module 14.

[0096] The initial configuration module 11 is used to initialize the configuration of the target Gantt chart when the target Gantt chart is started in the user's terminal. The horizontal axis of the target Gantt chart is a time axis containing various moments within 24 hours of a single day, and the vertical axis of the target Gantt chart is a time axis containing different dates. The calendar in the target Gantt chart includes at least one task bar, and the task bar is a time segment that can be dragged in the horizontal direction under the corresponding date. The configuration initialization includes monitoring the mousedown event of the terminal;

[0097] The position determination module 12 is used to determine the initial position of the mouse pressed in the terminal interface and monitor the mousemove event if the mousedown event is triggered, and to determine the final position of the mouse dragged in the terminal interface during the process of dragging the target task bar when the mousemove event is triggered, where the target task bar is the task bar of the target object to be dragged;

[0098] The time determination module 13 is used to determine the dragging distance of the target task bar according to the final position and the initial position, and determine the dragging start time and the dragging end time of the target task bar based on the dragging distance;

[0099] The task updating module 14 is used to update the position and width of the target task bar in the target Gantt chart according to the start time after dragging and the end time after dragging.

[0100] Optionally, the time determination module 13 is specifically used for:

[0101] According to the dragging distance, determine the dragging duration of the target task bar and determine the dragging type of the target task bar;

[0102] If the drag type is the overall drag type, the dragging start time and dragging end time of the target task bar are determined according to the task start time and dragging duration of the target task bar;

[0103] If the drag type is a boundary drag type, when the drag boundary is the boundary corresponding to the task start time, the drag post start time of the target task bar is determined according to the task start time and the drag duration, and the task end time of the target task bar is determined as the drag post end time of the target task bar;

[0104] When the dragging boundary is the boundary corresponding to the task end time, the task start time is determined as the dragging start time of the target task bar, and the dragging end time of the target task bar is determined according to the task end time and the dragging duration.

[0105] Optionally, the time determination module 13 is further configured to:

[0106] When the target task bar does not exceed the time range within the corresponding target date when being dragged, the task start time of the target task bar is subtracted or added to the dragging time according to the dragging direction of the target task bar to obtain the dragged start time of the target task bar;

[0107] Add the drag start time to the total duration of the target task bar to get the drag end time of the target task bar;

[0108] When the target task bar partially exceeds the time range of the corresponding target date during dragging, the dragging start time and dragging end time of the target task bar are determined according to the date of the previous day or the later day of the target date.

[0109] Optionally, the time determination module 13 is further configured to:

[0110] When the target task bar is dragged in a direction close to the vertical axis along the horizontal axis, the task start time is subtracted from the start time of the target date to obtain a first dragged time, and the dragging time is subtracted from the first dragged time to obtain a first remaining dragging time;

[0111] Subtract the first remaining dragging time from the end time of the date one day before the target date to obtain the dragging start time of the target task bar, and subtract the dragging time from the task end time of the target task bar to obtain the dragging end time of the target task bar;

[0112] When the target task bar is dragged in a direction away from the vertical axis along the horizontal axis, the task end time is subtracted from the end time of the target date to obtain a second dragged time, and the second dragged time is subtracted from the dragging time to obtain a second remaining dragging time;

[0113] Add the start time of the day after the target date to the second remaining dragging time to obtain the end time of the target task bar after dragging, and add the task start time to the dragging time to obtain the start time of the target task bar after dragging.

[0114] Optionally, the time determination module 13 is further configured to:

[0115] When the dragging boundary is the boundary corresponding to the task start time, if the dragging direction of the target task bar is the direction along the horizontal axis approaching the vertical axis, then the target duration between the task start time and the start time of the target date where the target task bar is located is determined;

[0116] If the dragging duration exceeds the target duration, the end time of the date one day before the target date minus the preset duration is obtained to obtain the start time of the target task bar after dragging;

[0117] If the dragging duration does not exceed the target duration, the dragging duration is subtracted from the task start time to obtain the dragging start time of the target task bar.

[0118] Optionally, the time determination module 13 is specifically used for:

[0119] Get the bin width of the target Gantt chart and divide the bin width by the total number of seconds in a day to get the ratio.

[0120] Divide the drag distance by the ratio to obtain the initial drag duration of the target task bar, and determine whether a drag pace is set. The pace is the duration span in the horizontal direction when the mouse drags the target task bar once;

[0121] If so, when the initial dragging duration is a multiple of the step, the initial dragging duration is determined as the dragging duration of the target task bar; when the initial dragging duration is not a multiple of the step, the product of the quotient of the initial dragging duration divided by the step and the step is determined as the dragging duration of the target task bar;

[0122] If not, the initial dragging duration is determined as the dragging duration of the target task bar.

[0123] Optional, such as Figure 5 As shown, the device also includes an adaptation and adjustment module 15, which is specifically used to:

[0124] If the resize event is triggered, the new size of the terminal page is retrieved;

[0125] Determine the new container width of the target Gantt chart based on the new size;

[0126] Re-determine the width and position of the target task bar after dragging according to the new container width, the start time after dragging, and the end time after dragging.

[0127] It should be noted that the Gantt chart calendar dragging device provided in the above embodiment only uses the division of the above functional modules as an example when executing the Gantt chart calendar dragging method. 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, the Gantt chart calendar dragging device provided in the above embodiment and the Gantt chart calendar dragging method embodiment belong to the same concept. The implementation process is detailed in the method embodiment and will not be repeated here.

[0128] 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 calendar dragging method of the above embodiment is adopted.

[0129] 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.

[0130] Among them, through this computer-readable storage medium, a Gantt chart calendar dragging 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.

[0131] 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 calendar dragging method is adopted.

[0132] 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.

[0133] 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.

[0134] 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.

[0135] Among them, through this electronic device, a Gantt chart calendar dragging 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.

[0136] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. 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. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation 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 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 calendar dragging method, characterized in that: The method comprises: When a target Gantt chart is started in a user's terminal, the target Gantt chart is configured and initialized, wherein the horizontal axis of the target Gantt chart is a time axis including various moments within 24 hours of a single day, the vertical axis of the target Gantt chart is a time axis including different dates, the calendar in the target Gantt chart includes at least one task bar, and the task bar is a time segment that can be dragged in the direction of the horizontal axis under a corresponding date, and the configuration initialization includes monitoring a mousedown event of the terminal; If the mousedown event is triggered, the initial position of the mouse pressed in the terminal interface is determined and the mousemove event is monitored. When the mousemove event is triggered, the final position of the mouse dragged in the terminal interface during the process of dragging the target task bar is determined, and the target task bar is the task bar of the target object to be dragged; Determine the dragging distance of the target task bar according to the final position and the initial position, and determine the dragging start time and the dragging end time of the target task bar based on the dragging distance; the determining the dragging start time and the dragging end time of the target task bar based on the dragging distance specifically includes: Determining the dragging duration of the target task bar according to the dragging distance, and determining the dragging type of the target task bar; If the drag type is an overall drag type, determining the drag start time and drag end time of the target task bar according to the task start time of the target task bar and the drag duration; wherein, determining the drag start time and drag end time of the target task bar according to the task start time of the target task bar and the drag duration specifically includes: When the target task bar does not exceed the time range within the corresponding target date when being dragged, the task start time of the target task bar is subtracted from or added to the dragging time according to the dragging direction of the target task bar to obtain the dragged start time of the target task bar; Add the dragging start time to the total duration of the target task bar to obtain the dragging end time of the target task bar; When the target task bar is dragged and partly exceeds the time range of the corresponding target date, the start time and the end time of the dragging of the target task bar are determined according to the date of the previous day or the later day of the next day of the target date; If the drag type is a boundary drag type, then when the drag boundary is the boundary corresponding to the task start time, the drag post-start time of the target task bar is determined according to the task start time and the drag duration, and the task end time of the target task bar is determined as the drag post-end time of the target task bar; When the dragging boundary is the boundary corresponding to the task end time, the task start time is determined as the dragging start time of the target task bar, and the dragging end time of the target task bar is determined according to the task end time and the dragging duration; According to the dragging start time and the dragging end time, the position and width of the target task bar in the target Gantt chart are updated.

2. The Gantt chart calendar dragging method according to claim 1, characterized in that: The step of determining the start time and the end time of the target task bar after dragging according to the date of the day before or the day after the target date specifically includes: When the target task bar is dragged in a direction along the horizontal axis toward the vertical axis, the task start time is subtracted from the start time of the target date to obtain a first dragged duration, and the dragging duration is subtracted from the first dragged duration to obtain a first remaining dragging duration; Subtract the first remaining dragging time from the end time of the date one day before the target date to obtain the dragging start time of the target task bar, and subtract the dragging time from the task end time of the target task bar to obtain the dragging end time of the target task bar; When the target task bar is dragged in a direction away from the vertical axis along the horizontal axis, the task end time is subtracted from the end time of the target date to obtain a second dragged time, and the second dragged time is subtracted from the dragging time to obtain a second remaining dragging time; Add the starting time of the day after the target date to the second remaining dragging time to obtain the end time of the target task bar after dragging, and add the task start time to the dragging time to obtain the start time of the target task bar after dragging.

3. The Gantt chart calendar dragging method according to claim 1, characterized in that: When the dragging boundary is the boundary corresponding to the task start time, determining the dragging start time of the target task bar according to the task start time and the dragging duration specifically includes: When the dragging boundary is the boundary corresponding to the task start time, if the dragging direction of the target task bar is the direction along the horizontal axis approaching the vertical axis, then determining the target duration between the task start time and the start time of the target date where the target task bar is located; If the dragging duration exceeds the target duration, the end time of the date one day before the target date is subtracted from the preset duration to obtain the start time of the target task bar after dragging; If the dragging duration does not exceed the target duration, the dragging duration is subtracted from the task start time to obtain the post-drag start time of the target task bar.

4. The Gantt chart calendar dragging method according to claim 1, characterized in that: Determining the dragging duration of the target task bar according to the dragging distance specifically includes: Obtaining a container width of the target Gantt chart, and dividing the container width by the total number of seconds in a single day to obtain a ratio; Dividing the drag distance by the ratio to obtain the initial drag duration of the target task bar, and determining whether a drag pace is set, the pace being the duration span in the horizontal direction when the mouse drags the target task bar once; If yes, then when the initial dragging duration is a multiple of the step, the initial dragging duration is determined as the dragging duration of the target task bar; when the initial dragging duration is not a multiple of the step, the product of the quotient of the initial dragging duration divided by the step and the step is determined as the dragging duration of the target task bar; If not, the initial dragging duration is determined as the dragging duration of the target task bar.

5. The Gantt chart calendar dragging method according to claim 1, characterized in that: The configuration initialization further includes monitoring a resize event of a page in the terminal, and the method further includes: If the resize event is triggered, a new size of the terminal page is re-acquired; Determine a new container width of the target Gantt chart according to the new size; The width and position of the target task bar after dragging are re-determined according to the new container width, the start time after dragging, and the end time after dragging.

6. A Gantt chart calendar dragging device, used to implement the Gantt chart calendar dragging method according to any one of claims 1 to 5, characterized in that: include: An initial configuration module (11) is used to initialize the configuration of the target Gantt chart when the target Gantt chart is started in the user's terminal, wherein the horizontal axis of the target Gantt chart is a time axis containing various moments within 24 hours of a single day, and the vertical axis of the target Gantt chart is a time axis containing different dates, and the calendar in the target Gantt chart includes at least one task bar, and the task bar is a time segment that can be dragged in the direction of the horizontal axis under the corresponding date, and the configuration initialization includes monitoring the mousedown event of the terminal; a position determination module (12), for determining the initial position of the mouse pressed in the terminal interface and monitoring the mousemove event if the mousedown event is triggered, and for determining the final position of the mouse dragged in the terminal interface during the process of dragging the target task bar when the mousemove event is triggered, wherein the target task bar is the task bar of the target object to be dragged; A time determination module (13), used to determine the dragging distance of the target task bar according to the final position and the initial position, and to determine the dragging start time and the dragging end time of the target task bar based on the dragging distance; The task updating module (14) is used to update the position and width of the target task bar in the target Gantt chart according to the dragging start time and the dragging end time.

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

8. 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 5 is adopted.