Data processing method and device, electronic equipment and storage medium
By creating a canvas area on the web table page and listening to mouse events, dynamically adjusting the working status of the device, the problem of single application function of the existing device management calendar is solved, real-time update and management of the working status of the device is realized, and user operation experience is improved and equipment management efficiency.
Patent Information
- Application Number
- CN202310590421.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2024-11-26
AI Technical Summary
The existing web-end device management calendar application function is single, and the equipment working status cannot be dynamically adjusted, which limits users' equipment management and maintenance plans in smart manufacturing factories.
By creating a canvas area on the table page, listening to mouse events to determine the target area, dynamically adjusting the display content of cells in the target area, and supporting users to update and adjust the working status of the device in real time.
It improves the convenience and feature richness of web-side table operations, supports users to dynamically adjust the working status of the equipment, and enhances the flexibility of device management and maintenance plans.
Smart Images

Figure CN119025007A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing method and device, an electronic device, and a storage medium. Background Art
[0002] In the B / S architecture (Browser / Server), the browser on the Web side is the main application software on the client side, and users can implement various application functions through the browser.
[0003] For example, in the smart manufacturing industry, equipment management in smart manufacturing factories is of paramount importance. The equipment operation calendar can be displayed on the Web to facilitate equipment managers to monitor and manage the equipment operation status. The equipment operation calendar is one of the sub-functions of the maintenance management function. Its main function is to set the production line equipment operation status in batches or individually on a monthly basis to help equipment managers formulate reasonable equipment maintenance and inspection plans. However, the relevant Web-side calendar applications are all in the form of traditional calendar panels, with only a calendar display function and a single function. Summary of the invention
[0004] The present disclosure provides a data processing method and device, an electronic device, and a storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a data processing method, including:
[0006] Based on the table page displayed on the Web end, create a canvas area on the table page;
[0007] In response to monitoring a target mouse event in the canvas area, determining a target area selected on the canvas area; wherein the target area includes at least one cell;
[0008] The working status of the device represented by the display content of each cell in the target area is adjusted, and a table page including the adjusted working status of the device is displayed on the Web end.
[0009] In some embodiments, the method further comprises:
[0010] Detecting an instruction to update displayed contents of cells in the target area;
[0011] The adjusting the working state of the device represented by the display content of each cell in the target area includes:
[0012] Based on the update instruction, the working state of the device represented by the display content of each cell in the target area is adjusted.
[0013] In some embodiments, the method further comprises:
[0014] In response to detecting a predetermined operation of the mouse on any cell in the target area, displaying prompt information;
[0015] The detecting of an instruction to update displayed contents of cells in the target area includes:
[0016] In response to detecting a selection instruction for the displayed prompt information, it is determined that an update instruction for displayed content of cells in the target area is detected.
[0017] In some embodiments, in response to monitoring a target mouse event in the canvas area, determining a target area selected on the canvas area includes:
[0018] In response to monitoring that the mouse points to a cell and monitoring a click event of a target button on the mouse, determining a start cell selected on the canvas area;
[0019] In response to monitoring that the mouse points to a cell and monitoring a release event after the target button is clicked, determining a terminal cell selected on the canvas area;
[0020] The target area is determined based on the start cell and the end cell.
[0021] In some embodiments, the method further comprises:
[0022] Based on the starting cell and the ending cell, determining the row and column where each cell in the target area is located;
[0023] The adjusting the working state of the device represented by the display content of each cell in the target area includes:
[0024] Based on the row and column where each cell in the target area is located, the working state of the device represented by the display content of each cell in the target area is adjusted.
[0025] In some embodiments, the method further comprises:
[0026] Determine the moving direction of the mouse based on the mouse events monitored between when the target button is clicked and when the target button is released;
[0027] Determine the coordinates of the drawing vertices corresponding to the target area based on the moving direction, the starting cell, and the ending cell;
[0028] Adjusting the display status of each cell in the target area based on the drawing vertex coordinates;
[0029] The adjusting the working state of the device represented by the display content of each cell in the target area includes:
[0030] After the display status of each cell is adjusted, the working status of the device represented by the display content of each cell in the target area is adjusted.
[0031] In some embodiments, the method further comprises:
[0032] In response to detecting that the mouse points to a cell in the target area, starting the function of adjusting the display state of each cell in the target area;
[0033] The adjusting the display state of each cell in the target area based on the drawing vertex coordinates includes:
[0034] When the function of adjusting the display state of each cell in the target area is turned on, the display state of each cell in the target area is adjusted based on the drawing vertex coordinates.
[0035] In some embodiments, the method further comprises:
[0036] In response to detecting a click instruction on an area outside the target area in the table page after the work status is adjusted, the display status of each cell in the target area is restored.
[0037] According to a second aspect of an embodiment of the present disclosure, there is provided a data processing device, including:
[0038] A creation module is configured to create a table page displayed on a Web side and a canvas area on the table page;
[0039] A first determination module is configured to determine a target area selected on the canvas area in response to monitoring a target mouse event in the canvas area; wherein the target area includes at least one cell, and the display content in the cell represents the working state of the device;
[0040] The first adjustment module is configured to adjust the working status of the device represented by the display content of each cell in the target area, and display a table page including the adjusted working status of the device on the Web end.
[0041] In some embodiments, the apparatus further comprises:
[0042] A detection module configured to detect an update instruction for display content of cells in the target area;
[0043] The first adjustment module is further configured to adjust the working state of the device represented by the display content of each cell in the target area based on the update instruction.
[0044] In some embodiments, the apparatus further comprises:
[0045] A display module, configured to display prompt information in response to detecting a predetermined operation of the mouse on any cell in the target area;
[0046] The detection module is further configured to determine that an update instruction for displayed content of a cell in the target area is detected in response to detecting a selection instruction for the displayed prompt information.
[0047] In some embodiments, the first determination module is further configured to determine the starting cell selected on the canvas area in response to monitoring the mouse pointing to the cell and monitoring a click event on a target button on the mouse; determine the ending cell selected on the canvas area in response to monitoring the mouse pointing to the cell and monitoring a release event after the target button is clicked; and determine the target area based on the starting cell and the ending cell.
[0048] In some embodiments, the apparatus further comprises:
[0049] A second determination module is configured to determine the row and column where each cell in the target area is located based on the starting cell and the ending cell;
[0050] The first adjustment module is further configured to adjust the working state of the device represented by the display content of each cell in the target area based on the row and column where each cell in the target area is located.
[0051] In some embodiments, the apparatus further comprises:
[0052] A third determination module is configured to determine the moving direction of the mouse based on the mouse events monitored between the time when the target button is clicked and the time when the target button is released;
[0053] A fourth determination module is configured to determine the coordinates of the drawing vertices corresponding to the target area based on the moving direction, the starting cell and the ending cell;
[0054] A second adjustment module is configured to adjust the display state of each cell in the target area based on the drawing vertex coordinates;
[0055] The first adjustment module is further configured to adjust the working state of the device represented by the display content of each cell in the target area after the display state of each cell is adjusted.
[0056] In some embodiments, the apparatus further comprises:
[0057] A starting module, configured to start the function of adjusting the display state of each cell in the target area in response to detecting that the mouse points to a cell in the target area;
[0058] The first adjustment module is further configured to adjust the display state of each cell in the target area based on the drawing vertex coordinates when a function of adjusting the display state of each cell in the target area is turned on.
[0059] In some embodiments, the apparatus further comprises:
[0060] The restoration module is configured to restore the display status of each cell in the target area in response to detecting a click instruction on an area outside the target area in the table page after the work status is adjusted.
[0061] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0062] processor;
[0063] a memory for storing processor-executable instructions;
[0064] Wherein, the processor is configured to execute the data processing method as described in the first aspect above.
[0065] According to a fourth aspect of an embodiment of the present disclosure, there is provided a storage medium, including:
[0066] When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data processing method as described in the first aspect above.
[0067] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0068] In an embodiment of the present disclosure, the electronic device creates a canvas area on a table page, determines the target area by monitoring mouse events in the canvas area, and then updates and displays the working status of the device represented by the display content of the cells in the target area. Since the target area determined based on the target mouse event is the area selected by the user, and the user's operation is dynamic and random, the solution of the embodiment of the present disclosure can support the user's dynamic adjustment of data in the Web table, improves the convenience of the Web end for table operations, and enriches the functions supported by the table displayed on the Web end.
[0069] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0071] Figure 1 It is a flow chart of a data processing method shown in an embodiment of the present disclosure.
[0072] Figure 2 An example diagram of a table page provided in an embodiment of the present disclosure.
[0073] Figure 3a An example of an interface for displaying prompt information in an embodiment of the present disclosure Figure 1 .
[0074] Figure 3b An example of an interface for displaying prompt information in an embodiment of the present disclosure Figure 2 .
[0075] Figure 4 This is an example diagram of drawing vertex coordinates corresponding to a target area in an embodiment of the present disclosure.
[0076] Figure 5 The figure is a diagram of a data processing device according to an exemplary embodiment.
[0077] Figure 6 The invention is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0078] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0079] The disclosed embodiments provide a data processing method, which is applied to an electronic device, and the execution subject may be a processor of the electronic device, such as a central processing unit (CPU), a microcontroller unit (MCU), and other devices capable of data processing and control; wherein the electronic device may be a user equipment (UE), a tablet computer, a smart phone, a personal computer, etc. In some possible implementations, data processing may be implemented by the processor calling computer-readable instructions stored in a memory.
[0080] Figure 1 is a flow chart of a data processing method shown in an embodiment of the present disclosure, such as Figure 1 As shown, the data processing method applied to the electronic device includes the following steps:
[0081] S11. Based on the table page displayed on the Web end, create a canvas area on the table page;
[0082] S12, in response to monitoring a target mouse event in the canvas area, determining a target area selected on the canvas area; wherein the target area includes at least one cell, and display content in the cell represents a working state of a device;
[0083] S13, adjusting the working status of the device represented by the display content of each cell in the target area, and displaying a table page including the adjusted working status of the device on the Web end.
[0084] The Web (World Wide Web) terminal is a type of Internet application, also known as a web page terminal, which can provide web browsing, file transfer, email, chat and other services. The Web terminal is a special client / server model, and users can access files and web pages on the Web server through a browser. In the embodiment of the present disclosure, a browser is installed on the electronic device, and the electronic device can display a table page through the Web terminal.
[0085] In step S11, the table page displayed on the web page of the electronic device is a page that includes statistics on the working status data of the device. For example, the table page is an operation calendar of the device, which counts the working status of the device in the form of a calendar. Figure 2 An example diagram of a table page provided in an embodiment of the present disclosure, such as Figure 2As shown, the working status of the device such as "start-up", "maintenance", and "inspection" is displayed in the form of a calendar. Of course, the data processing method in the disclosed embodiment can also be applied to any table page that is convenient for statistical viewing of data content, such as a table page for class member data management, a table page for commodity sales status, etc. In the disclosed embodiment, the electronic device determines a canvas area on the table page so as to update the display content of the cells on the table page based on the canvas area.
[0086] In the disclosed embodiment, the canvas area may be an area created based on canvas. The created canvas area may be a canvas created for the entire area on the original table page, or a canvas created for a partial area on the original table page. The canvas area may include one or more cells.
[0087] It should be noted that methods related to the canvas component can be executed in the canvas area, such as lineTo, moveTo, isPointInPath, fill, stroke methods, etc. In addition, in the embodiment of the present disclosure, after the electronic device displays the table page on the Web, it can execute the useEffect method instead of the JavaScript native window.onload method, because the useEffect method supports clearing some unnecessary content after the page is loaded, thereby reducing the probability of the table page crashing and further improving the stability of the data processing execution in the embodiment of the present disclosure.
[0088] Since there is usually a header on a table page, the header is the part that defines the cell position and content at the initial stage of table creation, and the header content belongs to the content of a fixed field and does not need to be modified; while the content in other cells in the table other than the header is a modifiable and adjustable part. Therefore, in the embodiment of the present disclosure, the canvas area created by the electronic device can be the cell area in the table on the table page excluding the header area.
[0089] like Figure 2 As shown, the black frame part of the L logo is the area for creating the canvas. In the table page, the column corresponding to the "serial number" outside the L logo, the column corresponding to the "line body" and the row corresponding to the "line body" (the row where the numbered logos such as "01" are located and the row where the "early" and "late" logos are located) all belong to the table header.
[0090] In the embodiment of the present disclosure, the canvas area on the table page created by the electronic device can be created based on the canvas function of HTML. Canvas is an HTML element that can use scripts (such as JavaScript) to draw graphics. Figure 2For example, the electronic device can use JavaScript to call the Document Object Model (DOM) based on canvas to determine the width of the table, the height of the table, the width of the fixed column on the left, and the height of the fixed row above. Among them, the fixed column width is the sum of the width of the column where the "serial number" is located and the width of the column where the "line body" is located, and the fixed row height is the sum of the height of the row where the numbered identifiers such as "01" are located and the height of the row where the identifiers "early" and "late" are located. Subsequently, the electronic device can calculate the position of the canvas area based on the width of the table, the height of the table, the width of the fixed column on the left, and the height of the fixed row above, and create the canvas area on the table page.
[0091] Specifically, the position of the canvas area can be expressed as (left, top, width, height); wherein left represents the horizontal coordinate of the starting point of the canvas area, left = fixed column width; top represents the vertical coordinate of the starting point of the canvas area, top = fixed row height; width represents the width of the canvas area, width = width of the table - fixed column width; height represents the height of the canvas area, height = height of the table - fixed row height.
[0092] It should be noted that in the embodiments of the present disclosure, a table page refers to a complete page displayed by a browser including a table and areas outside the table. Figure 2 In the table, the table refers to all cells corresponding to the rows from "Serial Number" to "11" and the columns from "Serial Number" to "05 (Sunday)", and the entire Figure 2 The page shown is a table page, and the table is a part of the table page.
[0093] In some embodiments, considering that the size of the table page displayed on the browser may be adjusted, in order not to affect the created canvas area, a resize event can be added to the canvas area. When the page size on the browser changes, the position of the canvas area will be re-adjusted based on the resize event. It can be understood that this method can make the interaction more intelligent.
[0094] In the embodiment of the present disclosure, the electronic device will monitor the mouse events in the canvas area, and in step S12, determine the target area selected on the canvas area based on the monitored target mouse events. The target mouse event is an event triggered based on the user's operation, including a click event on the target button on the mouse, a mouse movement event, or a release event after the target button is clicked, etc.; the target area selected on the canvas area includes at least one cell on the table page located in the canvas area, and the display content in the cell represents the working state of the device. The working state, for example, represents whether the device has completed or not completed the task, and can also represent the startup state of the device, etc., which is not limited by the embodiment of the present disclosure.
[0095] by Figure 2 For example, the target area may be the entire canvas area marked by L, including multiple cells, or may be a cell in the canvas area marked by L0.
[0096] In the disclosed embodiment, the target area can be dynamic, for example, a cell pointed to by the current target button on the mouse is the current target area, and the next cell pointed to by the target button on the mouse can be the next target area. The electronic device can draw immediately after the mouse points to a cell. In addition, the target area can also be static, for example, all cells between the initial cell pointed to for the first time when the target button on the mouse is pressed and the terminal cell pointed to by the mouse when the target button on the mouse is released are the final target area, and the electronic device can draw uniformly after the final target area is determined. In addition, in the disclosed embodiment, the electronic device can also dynamically draw each cell, and after the final target area is determined, clear the drawing of cells that are not in the target area.
[0097] In step S13, the electronic device adjusts the working status of the device represented by the display content of each cell in the target area and displays it so that the user can update the working status of the device in real time.
[0098] It can be understood that the embodiment of the present disclosure creates a canvas area on the table page, determines the target area by monitoring the mouse events in the canvas area, and then updates and displays the working status of the device represented by the display content of the cells in the target area. Since the target area determined based on the target mouse event is the area selected by the user, and the user's operation is dynamic and random, the solution of the embodiment of the present disclosure can support the user to dynamically adjust the data in the table on the Web side, improves the convenience of the Web side for table operations, and enriches the functions supported by the table displayed on the Web side.
[0099] In some embodiments, the method further comprises:
[0100] Detecting an instruction to update displayed contents of cells in the target area;
[0101] The adjusting the working state of the device represented by the display content of each cell in the target area includes:
[0102] Based on the update instruction, the working state of the device represented by the display content of each cell in the target area is adjusted.
[0103] In this embodiment, the electronic device adjusts the display content of the cells in the target area based on the detected update instruction for the display content of the cells in the target area.
[0104] It should be noted that the disclosed embodiment can determine the update instruction for the displayed content of the cells in the target area based on the detected mouse operation and / or keyboard operation, and the electronic device updates the content of the cells in the entire target area based on the update instruction. Exemplarily, when the electronic device detects a mouse selection operation and a keyboard editing input operation on any cell in the target area, the content of each cell in the target area will be updated based on the content edited by the keyboard. Of course, the disclosed embodiment can also rely only on the keyboard for selection and content editing, and can also rely only on the mouse for selection of cell content and selection of content to be updated.
[0105] In addition, in some embodiments, the electronic device can detect an update instruction for the cell display content in the target area based on the table page initially displayed on the Web side; in other embodiments, the electronic device can also detect an update instruction for the cell display content in the target area based on the table page displayed on the Web side including a table page after the display status is adjusted.
[0106] It can be understood that in the embodiment of the present disclosure, the electronic device supports the user to modify the displayed content of cells in the dynamically selected target area of the Web-side table, thereby improving the convenience of the Web-side table operation.
[0107] In some embodiments, the method further comprises:
[0108] In response to detecting a predetermined operation of the mouse on any cell in the target area, displaying prompt information;
[0109] The detecting of an instruction to update displayed contents of cells in the target area includes:
[0110] In response to detecting a selection instruction for the displayed prompt information, it is determined that an update instruction for displayed content of cells in the target area is detected.
[0111] In an embodiment of the present disclosure, the target area dynamically selected by the user includes at least one cell, and each cell on the table page is embedded with prompt information, which can be content prompt information indicating the updated content, or information reminding that the content can be updated. After the electronic device detects the selection instruction of the prompt information, it determines that an update instruction for the target area is detected. Among them, the update instruction can carry the selected prompt information, and the electronic device can update the display content of the target area based on the selected prompt information. At this time, the prompt information is the content prompt information indicating the updated content; in addition, the update instruction may not carry the prompt information, and the electronic device can trigger the update of the display content of the target area according to the predetermined content based on the update instruction. At this time, the prompt information is a simple prompt information reminding to update the content.
[0112] In the disclosed embodiment, the electronic device detects the predetermined operation of the mouse on any cell in the target area, which may be the electronic device detecting that the mouse is pointing to any cell, or the electronic device detecting that the mouse is pointing to any cell and then performing a click operation in the cell. In addition, the prompt information may be displayed in the form of a clickable text control or in the form of plain text, the prompt information may be displayed in a suspended manner or in the form of a pop-up window, and the disclosed embodiment does not limit the method of triggering the display of the prompt information and the display form of the prompt information.
[0113] Figure 3a An example of an interface for displaying prompt information in an embodiment of the present disclosure Figure 1 ,like Figure 3a As shown, after the electronic device detects that the mouse is pointing to any cell, it displays L2, wherein "rest", "shutdown" and "weekly maintenance" in L2 can all be independent text controls. For example, the electronic device can receive the user's "shutdown" operation (select instruction) based on a mouse click in L2, so that the content in the target area is modified to "shutdown"; the prompt information L2 can also be plain text, such as information displayed by a tooltip component, and the user cannot click on the above text content to select it. At this time, the electronic device can detect the user's voice command based on the displayed prompt information L2 to determine whether to select part of the prompt information in L2.
[0114] Figure 3b An example of an interface for displaying prompt information in an embodiment of the present disclosure Figure 2 ,like Figure 3bAs shown, after the electronic device detects that the mouse points to any cell in the target area marked by L3, it displays the prompt information marked by L4. In the prompt information marked by L4, information such as "power on", "rest", and "stop" are all displayed in text form. For example, the electronic device determines that the selection instruction of "rest" is detected by detecting the selection operation of the check box on the left side of "rest" in L4. Further, the electronic device can change the content corresponding to all cells in the target area marked by L3 to "rest", and draw and update the changed content, so that the content displayed in the target area marked by L3 is "rest".
[0115] In addition, in the embodiment of the present disclosure, it can also be Figure 3a and Figure 3b The two methods are combined to realize the display of prompt information and the selection of prompt information. For example, after the electronic device detects that the mouse points to any cell in the target area marked by L3, it displays the drop-down arrow L1 and the pure text prompt information marked by L2. After the electronic device detects that the user clicks the drop-down arrow L1, it displays the prompt information L4 that can be selected.
[0116] It should be noted that in the embodiments of the present disclosure, the prompt information can be dynamically displayed or hidden. In some embodiments, the electronic device can detect the display duration of the prompt information, and hide the prompt information when the display duration of the prompt information exceeds a predetermined duration threshold. In other embodiments, the electronic device can also detect the position of the mouse. If the electronic device detects that the mouse moves from the cell displaying the prompt information to the next cell, the electronic device hides the prompt information of the previous cell and triggers the display of the prompt information of the next cell.
[0117] It can be understood that in the embodiment of the present disclosure, the electronic device triggers the display of prompt information, and on this basis detects the update instruction of the display content in the target area, that is, it allows the user to update the display content in the target area through the interface display, which can enhance the interactive experience and has better intelligence.
[0118] In some embodiments, in response to monitoring a target mouse event in the canvas area, determining a target area selected on the canvas area includes:
[0119] In response to monitoring that the mouse points to a cell and monitoring a click event of a target button on the mouse, determining a start cell selected on the canvas area;
[0120] In response to monitoring that the mouse points to a cell and monitoring a release event after the target button is clicked, determining a terminal cell selected on the canvas area;
[0121] The target area is determined based on the start cell and the end cell.
[0122] In an embodiment of the present disclosure, the electronic device comprehensively determines the final target area based on the click event of the target button on the mouse and the release event after the click. When the mouse is moving, the electronic device can monitor whether the mouse is pointing to a cell, that is, determine whether e.target.nodeName is equal to 'TD', where 'TD' represents a cell. If the mouse points to a cell and the target button on the mouse, such as the left button of the mouse, is clicked, a mouseDownEvent event is triggered. The electronic device can determine the starting cell currently pointed to based on the triggered mouseDownEvent event, and obtain the Dom attributes of the starting cell, such as the width, height, vertex coordinates, etc. of the starting cell.
[0123] In addition, when the electronic device monitors the mouse pointing to a cell and the release event after the target button is clicked (i.e., the mouseUpEvent event), it will determine the terminal cell selected in the canvas area. The cell executed by the mouse when the release event after the target button is clicked is triggered can be the same cell as the starting cell (the moseMoveEvent event is not triggered after the target button of the mouse is pressed) or a different cell (the moseMoveEvent event is triggered after the target button of the mouse is pressed). Similarly, after determining the terminal cell currently pointed to, the electronic device will obtain the Dom attribute of the terminal cell.
[0124] The electronic device can determine the target area based on the starting cell and the ending cell. It can be understood that the cells covered by the coordinate range of the starting cell and the ending cell belong to the target area.
[0125] In some embodiments, the method further comprises:
[0126] Based on the starting cell and the ending cell, determining the row and column where the cell in the target area is located;
[0127] The adjusting the working state of the device represented by the display content of each cell in the target area includes:
[0128] Based on the row and column where each cell in the target area is located, the working state of the device represented by the display content of each cell in the target area is adjusted.
[0129] In the disclosed embodiment, when the electronic device determines the row and column where the cells in the target area are located based on the starting cell and the ending cell, the electronic device can obtain the row and column corresponding to the starting cell and the row and column corresponding to the ending cell based on the mouse events corresponding to the starting cell and the ending cell respectively, and then determine the row value where the cells in the target area are located by the row value flipped between the starting cell and the ending cell, and similarly determine the column where the cells in the target area are located. The electronic device can adjust the working state of the device represented by the display content of each cell in the target area based on the row and column where each cell is located.
[0130] In the embodiment of the present disclosure, the electronic device can also establish a correspondence between the coordinates and rows and columns of each cell in the target area in a coordinate system with the upper left corner of the canvas area as the origin. For example, the electronic device can bind the dataKey and the coordinate point as a mapping of {[point coordinate]:dataKey}.
[0131] by Figure 2 The selected target area is the "S01" and "S0003" rows, the cells in the "Morning" and "Evening" columns corresponding to 01 (Wednesday) are columns, and the mapping relationship between the coordinate points and the columns includes: (0,0): 01 (Wednesday)-Morning, (0,72): 01 (Wednesday)-Evening, and so on.
[0132] In the disclosed embodiment, the electronic device may save the mapping relationship between the coordinate points and the columns after obtaining the mapping relationship, so that the electronic device can update the display content in each cell in the corresponding target area according to the mapping between the coordinate points and the columns.
[0133] In some embodiments, the method further comprises:
[0134] Determine the moving direction of the mouse based on the mouse events monitored between when the target button is clicked and when the target button is released;
[0135] Determine the coordinates of the drawing vertices corresponding to the target area based on the moving direction, the starting cell, and the ending cell;
[0136] Adjusting the display status of each cell in the target area based on the drawing vertex coordinates;
[0137] The adjusting the working state of the device represented by the display content of each cell in the target area includes:
[0138] After the display status of each cell is adjusted, the working status of the device represented by the display content of each cell in the target area is adjusted.
[0139] In an embodiment of the present disclosure, the electronic device determines the drawing vertex coordinates corresponding to the target area in order to adjust the display status of each cell in the target area, that is, redraws each cell in the target area based on the drawing vertex coordinates, for example, highlights each cell in the target area, or adds a mask to each cell in the target area.
[0140] In the disclosed embodiment, the electronic device determines the direction of mouse movement. Different drawing coordinate systems can be established under different mouse movement directions, and the coordinates of each vertex in the target area under the drawing coordinate system are determined, wherein the coordinates of each vertex in the drawing coordinate system have a mapping relationship with the coordinates of each vertex in the coordinate system with the upper left corner of the canvas area as the origin.
[0141] In the disclosed embodiment, the electronic device may determine the direction of movement of the mouse based on the mouse events monitored between the time when the target button is clicked and the time when the target button is released. For example, the direction of movement of the mouse may be determined based on the initial coordinate values (clientX and clientY) of the mouse in the table page when the click event of the target button on the mouse is triggered, and the coordinate changes relative to the initial coordinate values during the movement of the mouse, including determining the direction of movement of the mouse based on the coordinate changes of the mouse in the table page when the release event of the target button is monitored after the mouse moves. For another example, the electronic device may also determine the direction of movement of the mouse based on the Dom attributes of the mouse in the starting cell and the Dom attributes of the ending cell (offsetLeft, offsetTop, offsetWidth, offsetHeight, etc.). Among them, offsetLeft is the distance of the cell relative to the leftmost side of the table on the table page, and offsetTop is the distance of the cell relative to the topmost side of the table on the table page.
[0142] When determining the drawing vertex coordinates corresponding to the target area based on the moving direction, the starting cell, and the ending cell, the embodiment of the present disclosure can define the coordinate value of each vertex according to the drawing requirements in combination with the Dom attribute of the cell. Figure 4 is an example diagram of drawing vertex coordinates corresponding to a target area in an embodiment of the present disclosure, Figure 4 Based on Figure 2 In the selected target area "S01" and "S0003" rows, the cells in the "Morning" and "Evening" columns corresponding to 01 (Wednesday) have a fixed width offsetWidth of 72 and a fixed height offsetHeight of 52. Figure 4As shown in , the direction pointed by the arrow is the direction of mouse movement. For example, A1 indicates movement toward the upper left, and the starting cell is the cell at the lower right. If the point on the starting cell is defined as the origin, the starting coordinates of the origin, such as origin, are (0,0). According to the moving direction, the vertex coordinates in the diagonal direction with respect to the origin, such as br, are defined as (-144,-104), the vertex coordinates in the vertical direction with respect to the origin, such as bl, are defined as (0,-104), and the vertex coordinates in the horizontal direction with respect to the origin, such as tr, are defined as (-144,0).
[0143] Similarly, Figure 4 In the figure, A2 indicates movement to the upper right. If origin is defined as (0,0), br can be defined as (144,-104), bl as (0,-104), and tr as (144,0) according to the moving direction; A3 indicates movement to the lower left. If origin is defined as (0,0), br can be defined as (-144,104), bl as (0,104), and tr as (-144,0) according to the moving direction; A4 indicates movement to the lower right. If origin is defined as (0,0), br can be defined as (144,104), bl as (0,104), and tr as (144,0) according to the moving direction.
[0144] Based on the above definition of vertex coordinates, the canvas's moveTo method can be used to point to the starting coordinates, the canvas's lineTo method can be used to point to other vertices, and the fill method can be used to adjust the state of the target area pointed to by the vertex coordinate range. Figure 4 The above method can be used to draw in any moving direction.
[0145] It should be noted that in the embodiments of the present disclosure, the electronic device can save the drawing vertex coordinates (i.e. save the drawing path) so that the electronic device can restore the display status of each cell in the target area according to the drawing vertex coordinates, such as clearing the added mask or removing the highlight.
[0146] In addition, when determining the rows and columns of each cell in the target area, the embodiment of the present disclosure can also determine the rows and columns based on the coordinates of the starting point in the vertex coordinates in the drawing coordinate system (i.e., the drawing vertex coordinates corresponding to the starting cell) in the coordinate system with the upper left corner of the canvas area as the origin, and the coordinates of the vertex in the vertex coordinates in the drawing coordinate system that is in the direction of the object line with the starting point (the drawing vertex coordinates corresponding to the ending cell), combined with a preset mapping relationship.
[0147] Among them, the preset mapping relationship can be that the row index rowIndex satisfies the range between (origin1[1]+br[1]) / offsetHeight and origin1[1] / offsetHeight, and the column index dataKey satisfies the range between (origin1[0]+br[0]) / offsetWidth and origin1[0] / offsetWidth.
[0148] For example, Figure 4 In the coordinate system shown in A1, the origin origin (0,0) corresponds to the coordinate origin1 in the coordinate system with the upper left corner of the canvas area as the origin, which should be (144,104). Based on the above mapping relationship, the row index calculation process is: (104-104) / 52=0, 104 / 52=2, that is, the row index is in the range of 0 to 2; the column index calculation process is: (144-144) / 72=0, 144 / 72=2, that is, the column index is in the range of 0 to 2. In the coordinate system shown in A3, the origin origin (0,0) corresponds to the coordinate origin1 in the coordinate system with the upper left corner of the canvas area as the origin, which should be (144,0). Based on the above mapping relationship, the calculation process of the row index is: (0+104) / 52=2, 0 / 52=0, and the row index is also in the range of 0 to 2; the calculation process of the column index is: (144-144) / 72=0, 144 / 72=2, and the column index is also in the range of 0 to 2. Similarly, the row and column indices corresponding to the vertices shown in A2 and A4 can be calculated.
[0149] In an embodiment of the present disclosure, after adjusting the display status of each cell in the target area based on the drawn vertex coordinates, the working status of the device represented by the display content of each cell in the target area can be adjusted. It can be understood that by adjusting the display status to highlight the cells selected by the user, it can further facilitate the user to view the content in the table in the selected target area, so as to adjust the display content of each cell in the target area, which is more intelligent.
[0150] In some embodiments, the method further comprises:
[0151] In response to detecting that the mouse points to a cell in the target area, starting the function of adjusting the display state of each cell in the target area;
[0152] The adjusting the display state of each cell in the target area based on the drawing vertex coordinates includes:
[0153] When the function of adjusting the display state of each cell in the target area is turned on, the display state of each cell in the target area is adjusted based on the drawing vertex coordinates.
[0154] In the disclosed embodiment, the electronic device determines the target area selected on the canvas area based on the target mouse event detected in the canvas area. The target mouse event may include the event that the target button of the mouse is pressed, that is, the mouseDownEvent event. When the electronic device detects that the target button of the mouse is pressed, the e.target method of obtaining the mouse is triggered. When it is determined that e.target.nodeName=='TD', the function of adjusting the display state of each cell in the target area is started. In the disclosed embodiment, this function is called the drawing function. For example, the lock variable corresponding to the drawing function is set to True; and if e.target.nodeName!='TD', the lock variable corresponding to the drawing function is set to False, that is, the drawing function is locked. In the disclosed embodiment, during the mouse movement, the mouseMoveEvent event is triggered. When the mouseMoveEvent event is triggered, if the lock variable corresponding to the drawing function is true, the display state of each cell in the target area is adjusted, otherwise the display state is not allowed to be adjusted.
[0155] It should be noted that in the embodiment of the present disclosure, in response to detecting that the mouse is pointing to a position outside a cell in the target area, the electronic device turns off the function of adjusting the display status of each cell in the target area.
[0156] As mentioned above, since the embodiment of the present disclosure can add prompt information to the cell, for example Figure 3a L2 and Figure 3b As shown in L4 in the figure, since the location where the prompt information is displayed does not require changing the display state, and the layer where the prompt information is located may not be consistent with the layer where the cells in the table page are located, if the mouse points to the prompt information and the display state adjustment function is still turned on, meaningless state adjustment drawing may occur, and state adjustment drawing may be invalid, resulting in drawing interruption during the display state adjustment drawing process.
[0157] In this regard, in the disclosed embodiment, when the electronic device detects that the mouse is pointing to a position outside the cell in the target area (such as the prompt information), the function of adjusting the display state is turned off; and when the electronic device detects that the mouse is pointing to a cell outside the prompt information, the function of adjusting the display state is activated. For example, the electronic device can monitor whether the mouse is pointing to the prompt information in the current cell. If it is pointing to the prompt information, the current cell will not be drawn to adjust the display state, and the current cell can be understood as the current target area; or, the electronic device can monitor whether the current mouse is selected and moved to the next cell. If the next cell is not drawn, the next cell will be drawn to adjust the display state based on the activated display state adjustment function, and the next cell can be understood as the next target area; or, when the electronic device points to the prompt information corresponding to any cell in the target area, the display state adjustment will not be drawn for the entire target area.
[0158] It can be understood that in the embodiment of the present disclosure, by detecting the position of the mouse to determine whether to turn on the function of adjusting the display status of each cell in the target area, it can help reduce meaningless drawing during display status adjustment and invalid drawing during display status adjustment, thereby increasing the necessity of drawing during display status adjustment.
[0159] In some embodiments, the method further comprises:
[0160] In response to detecting a click instruction on an area outside the target area in the table page after the work status is adjusted, the display status of each cell in the target area is restored.
[0161] In the disclosed embodiment, upon detecting a click instruction on an area outside the target area in the table page after the work status is adjusted, the electronic device restores the display status of each cell in the target area. Exemplarily, the electronic device can determine whether the position clicked by the mouse is within the drawing path corresponding to the target area through the isPointInPath method of the canvas, and if not, clear the adjustment of the display status of the target area to restore the display status of each cell in the target area.
[0162] It should be noted that if prompt information is displayed in the target area, the electronic device will also clear the display of the prompt information based on the click instruction.
[0163] It can be understood that in the embodiment of the present disclosure, the electronic device restores the display status of each cell in the target area based on the detected click instruction, which helps to display the table page after the working status is adjusted normally. For example, the table page after the working status is adjusted is displayed on the Web side next time, which is more intelligent.
[0164] Figure 5 FIG. 1 is a diagram showing a data processing device according to an exemplary embodiment. Figure 5 , the device comprises:
[0165] A creation module 101 is configured to create a canvas area on a table page displayed on a Web end;
[0166] A first determination module 102 is configured to determine a target area selected on the canvas area in response to monitoring a target mouse event in the canvas area; wherein the target area includes at least one cell;
[0167] The first adjustment 103 is configured to adjust the working status of the device represented by the display content of each cell in the target area, and display a table page including the adjusted working status of the device on the Web end.
[0168] In some embodiments, the apparatus further comprises:
[0169] A detection module 104, configured to detect an update instruction for display content of cells in the target area;
[0170] The first adjustment module 103 is further configured to adjust the working state of the device represented by the display content of each cell in the target area based on the update instruction.
[0171] In some embodiments, the apparatus further comprises:
[0172] The display module 105 is configured to display prompt information in response to detecting a predetermined operation of the mouse on any cell in the target area;
[0173] The detection module 104 is further configured to determine that an update instruction for displayed content of a cell in the target area is detected in response to detecting a selection instruction for the displayed prompt information.
[0174] In some embodiments, the first determination module 102 is further configured to determine the starting cell selected on the canvas area in response to monitoring the mouse pointing to the cell and monitoring a click event on a target button on the mouse; determine the ending cell selected on the canvas area in response to monitoring the mouse pointing to the cell and monitoring a release event after the target button is clicked; and determine the target area based on the starting cell and the ending cell.
[0175] In some embodiments, the apparatus further comprises:
[0176] A second determination module 106 is configured to determine the row and column where each cell in the target area is located based on the start cell and the end cell;
[0177] The first adjustment module 103 is further configured to update the drawing of the target area based on the drawing vertex coordinates corresponding to the target area and / or the rows and columns where each cell in the target area is located.
[0178] In some embodiments, the apparatus further comprises:
[0179] A third determination module 107 is configured to determine the moving direction of the mouse based on the mouse events monitored between the time when the target button is clicked and the time when the target button is released;
[0180] A fourth determination module 108 is configured to determine the coordinates of the drawing vertices corresponding to the target area based on the moving direction, the starting cell and the ending cell;
[0181] A second adjustment module 109, configured to adjust the display state of each cell in the target area based on the drawing vertex coordinates;
[0182] The first adjustment module 103 is further configured to adjust the working state of the device represented by the display content of each cell in the target area after the display state of each cell is adjusted.
[0183] In some embodiments, the apparatus further comprises:
[0184] A starting module 110, configured to start the function of adjusting the display state of each cell in the target area in response to detecting that the mouse points to a cell in the target area;
[0185] The first adjustment module 103 is further configured to adjust the display state of each cell in the target area based on the drawing vertex coordinates when the function of adjusting the display state of each cell in the target area is turned on.
[0186] In some embodiments, the apparatus further comprises:
[0187] The restoration module 111 is configured to restore the display status of each cell in the target area in response to detecting a click instruction on an area outside the target area in the table page after the work status is adjusted.
[0188] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0189] Figure 6 8 is a block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device (device 800) may be the aforementioned personal computer, etc.
[0190] Reference Figure 6 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0191] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0192] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0193] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0194] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0195] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0196] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0197] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an infrared light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0198] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as Wi-Fi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0199] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above methods.
[0200] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0201] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform a data processing method, the method comprising:
[0202] Based on the table page displayed on the Web end, create a canvas area on the table page;
[0203] In response to monitoring a target mouse event in the canvas area, determining a target area selected on the canvas area; wherein the target area includes at least one cell, and the display content in the cell represents the working state of the device;
[0204] The working status of the device represented by the display content of each cell in the target area is adjusted, and a table page including the adjusted working status of the device is displayed on the Web end.
[0205] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims above.
[0206] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data processing method, characterized in that: The method comprises: Based on the table page displayed on the Web end, create a canvas area on the table page; In response to monitoring a target mouse event in the canvas area, determining a target area selected on the canvas area; wherein the target area includes at least one cell, and the display content in the cell represents the working state of the device; The working status of the device represented by the display content of each cell in the target area is adjusted, and a table page including the adjusted working status of the device is displayed on the Web end.
2. The method according to claim 1, characterized in that: The method further comprises: Detecting an instruction to update displayed contents of cells in the target area; The adjusting the working state of the device represented by the display content of each cell in the target area includes: Based on the update instruction, the working state of the device represented by the display content of each cell in the target area is adjusted.
3. The method according to claim 2, characterized in that The method further comprises: In response to detecting a predetermined operation of the mouse on any cell in the target area, displaying prompt information; The detecting of an instruction to update displayed contents of cells in the target area includes: In response to detecting a selection instruction for the displayed prompt information, it is determined that an update instruction for displayed content of cells in the target area is detected.
4. The method according to any one of claims 1 to 3, characterized in that In response to monitoring a target mouse event in the canvas area, determining a target area selected on the canvas area includes: In response to monitoring that the mouse points to a cell and monitoring a click event of a target button on the mouse, determining a start cell selected on the canvas area; In response to monitoring that the mouse points to a cell and monitoring a release event after the target button is clicked, determining a terminal cell selected on the canvas area; The target area is determined based on the start cell and the end cell.
5. The method according to claim 4, characterized in that The method further comprises: Based on the starting cell and the ending cell, determining the row and column where each cell in the target area is located; The adjusting the working state of the device represented by the display content of each cell in the target area includes: Based on the row and column where each cell in the target area is located, the working state of the device represented by the display content of each cell in the target area is adjusted.
6. The method according to claim 4, characterized in that The method further comprises: Determine the moving direction of the mouse based on the mouse events monitored between when the target button is clicked and when the target button is released; Determine the coordinates of the drawing vertices corresponding to the target area based on the moving direction, the starting cell, and the ending cell; Adjusting the display status of each cell in the target area based on the drawing vertex coordinates; The adjusting the working state of the device represented by the display content of each cell in the target area includes: After the display status of each cell is adjusted, the working status of the device represented by the display content of each cell in the target area is adjusted.
7. The method according to claim 6, characterized in that The method further comprises: In response to detecting that the mouse points to a cell in the target area, starting the function of adjusting the display state of each cell in the target area; The adjusting the display state of each cell in the target area based on the drawing vertex coordinates includes: When the function of adjusting the display state of each cell in the target area is turned on, the display state of each cell in the target area is adjusted based on the drawing vertex coordinates.
8. The method according to claim 6, characterized in that The method further comprises: In response to detecting a click instruction on an area outside the target area in the table page after the work status is adjusted, the display status of each cell in the target area is restored.
9. A data processing device, characterized in that: The device comprises: A creation module is configured to create a table page displayed on a Web side and a canvas area on the table page; A first determination module is configured to determine a target area selected on the canvas area in response to monitoring a target mouse event in the canvas area; wherein the target area includes at least one cell, and the display content in the cell represents the working state of the device; The first adjustment module is configured to adjust the working status of the device represented by the display content of each cell in the target area, and display a table page including the adjusted working status of the device on the Web end.
10. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the data processing method according to any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data processing method as claimed in any one of claims 1 to 8.
