Optimization method, device and storage medium for batch selection of data from a table
By creating an array of selected rows and table data in the grid table, and combining it with the page-turning check mark and select-all box components, the problem of selected rows not being retained when turning pages in the grid table is solved. This enables flexible selection of cross-page data rows and asynchronous batch setting of page turning, thereby improving data processing efficiency.
Patent Information
- Application Number
- CN202111273865.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-10-29
AI Technical Summary
The existing grid table cannot implement batch selection across pages and asynchronous batch setting of page turning when turning pages, resulting in the inability to maintain the selected rows of data, affecting data processing efficiency.
By creating an array of selected rows and table data, combined with the page-turning check mark and select-all box components, flexible control of selecting and deselecting cross-page data rows is achieved. This supports selecting the current page, all pages, and selecting by number of rows, and allows for batch setting of asynchronous page turning based on query keywords.
This feature enables the display of selected rows in the grid table to be maintained when turning pages, improves the flexibility and efficiency of data processing, and supports cross-page data row selection and asynchronous page turning batch settings.
Smart Images

Figure CN114021533B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of table data processing, and in particular to an optimization method, device and storage medium for batch selection of data from a table. Background Art
[0002] Tables are an important means of storing, processing and displaying data. Batch operations are an important means of processing table data and can effectively improve data processing capabilities. For most architectures that implement tables, batch selection is the basis for batch data operations.
[0003] If the data capacity of a table is large and it is impossible to display all the data stored in the table on the current display page, the table needs to be paginated. If the table content is non-static, the dynamically inserted data will affect the distribution of the existing data in the table, which will affect the implementation of page turning and selecting data. Conventional table batch operations are all performed within the page. For example, in the application of tables in mailboxes, in the mailbox management of incoming and outgoing emails, batch selection of target emails is performed within the current page. Once the page is turned, the emails selected on the previous page are cancelled. This batch selection restricted by page turning is inconvenient to use the application. Grid tables currently used in network data processing can display large amounts of data and implement many functions such as paging, searching, and multiple columns. However, existing grid tables also have the problem of not being able to implement page turning selection, asynchronous page turning batch setting combined with query, and data echo. Summary of the Invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides an optimization method, device and storage medium for batch selection of data from a table.
[0005] In a first aspect, the present application provides an optimization method for batch selecting data from a table, comprising: creating a selected row array to store selected data rows in a grid table, and deleting the corresponding content from the selected row array when a grid table row is unselected or a selected data row in the grid table is deleted;
[0006] Create a table data array to store the existing content of the grid table;
[0007] Set up a batch selection component, listen to the batch selection component's events, and when a batch selection is triggered by the batch selection component's events, add the batch selected contents to the selected row array;
[0008] When displaying the selected row of the target paging of the grid table, loop through the selected row array, traverse the content of the target paging in the table data array, and select the content in the selected row array that matches the target paging content as the selected row of the target paging.
[0009] Furthermore, the configuration items added to the grid table include two states of page turning selection flags. When the page turning selection flag is in the first state, the existing content in the selected row array is cleared when the page turning is triggered. When the page turning selection flag is in the second state, the content of the selected row array will not be cleared when the page turning is triggered.
[0010] Furthermore, the batch selection component includes a select all box, and the select all box is equipped with a select all configuration option including two options;
[0011] When the select all configuration option is the first option, the event of selecting the select all box by the mouse triggers the first batch selection operation, and the event of deselecting the select all box by the mouse triggers the first batch deselection operation;
[0012] When the select all configuration option is the second option, the event of selecting the select all box by the mouse triggers the second batch selection operation, and the event of deselecting the select all box by the mouse triggers the second batch deselection operation.
[0013] Furthermore, the first batch selection operation includes: batch selecting data rows of the current page of the grid table and adding the data rows of the current page of the grid table to the selected row array;
[0014] The first batch deselection operation includes: batch deselecting the data rows of the current page of the grid table and deleting the data rows of the current page of the grid table from the selected row array;
[0015] The second batch selection operation includes: batch selecting data rows of all pages of the grid table and adding the data rows of all pages of the grid table to the selected row array;
[0016] The second batch deselection operation includes: deselecting data rows of all pages of the grid table in batches and deleting data rows of all pages of the grid table from the selected row array.
[0017] Furthermore, the target content is searched using the search keyword to form a grid table recording the target content, and the searched target content is selected through the second batch selection operation.
[0018] Furthermore, the batch selection component includes a selection input box, and the event of inputting the batch selection row number in the selection input box triggers a third batch selection operation; the event of setting the content of the selection input box to empty triggers a third batch cancellation operation, wherein the third batch selection operation includes: selecting corresponding data rows from the grid table as selected rows according to the batch selection row number, and adding the selected data rows to the selected row array; the third batch cancellation operation includes: canceling the selection of data rows selected according to the selection row number, and deleting the data rows selected according to the batch selection row number in the selected row array.
[0019] Furthermore, when switching pages of the grid table, the content of the table data array is updated in units of pages according to the entire page content of the grid table.
[0020] Furthermore, when the selected data row fails to be added to the selected row array, a prompt indicating the selection failure is fed back.
[0021] In a second aspect, the present application provides a device for optimizing batch data selection from a table, comprising a bus unit, an interface unit, a display unit, a processing unit, a storage unit, and an input unit, wherein the bus unit connects the display unit, the processing unit, the storage unit, the input unit, and the interface unit, the storage unit stores at least one instruction, and the processing unit executes the instruction to implement the method for optimizing batch data selection from a table.
[0022] In a third aspect, the present application provides a storage medium for implementing a method for optimizing batch data selection from a table. The storage medium for implementing the method for optimizing batch data selection from a table stores at least one instruction, and reads and executes the instruction to implement the method for optimizing batch data selection from a table.
[0023] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:
[0024] In this application, the selected rows in each page of the grid table are displayed by cooperating with the selected row array and the table data array; even if the grid table is changed due to insertion, the selected rows can still be displayed without being affected. By cooperating with the selected row array and the table data array, data row selection can be achieved across pages.
[0025] The present application controls the characteristics of the selected row array that records the contents of the selected row through the page turning selection flag. When the page turning selection flag is in the first state, the contents in the selected row array will be cleared due to triggering page turning. When the page turning selection flag is in the second state, triggering page turning cannot clear the contents of the selected row array; free configuration of page turning selection and page turning non-selection is realized.
[0026] In this application, a select box component is provided to facilitate selecting all of the current page and all pages. The select box component is configured with a select all configuration option that controls the select box function. When the select all configuration option is the first option, the select box is used to select all and unselect all of the current page of the grid table. When the select all configuration option is the second option, the select box is used to select all and unselect all of all pages of the grid table. This application sets a selection input box that facilitates selecting all by the number of rows of selected data. The combination of the select box and the selection input box allows for more flexible batch selection of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0029] Figure 1 A flowchart of an optimization method for batch selecting data from a table provided in an embodiment of the present application;
[0030] Figure 2 A flowchart of configuring page turning selection by using a page turning selection flag provided in an embodiment of the present application;
[0031] Figure 3 A schematic diagram of a device for optimizing batch data selection from a table provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0033] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0034] Example 1
[0035] See Figure 1 As shown, the embodiment of the present application provides an optimization method for batch selecting data from a table, including:
[0036] S100, configure the page selection of the grid table through the page selection mark. For details, see Figure 2 As shown, configuring the page turning selection of the grid table by using the page turning selection mark includes:
[0037] S101, detect whether the page turning selection flag is in the second state, otherwise, execute S102,
[0038] S102: Configure the page turning selection flag to a second state to implement configuration page turning selection.
[0039] The page-turning selection flag is a grid table configuration item and includes two states: a first state and a second state. When the page-turning selection flag is in the first state, the selected row array used to record grid table data row selection in this application clears the existing content when a page turn is triggered. When the page-turning selection flag is in the second state, the selected row array clears the existing content when a page turn is triggered.
[0040] S200 , selecting a data row in the grid table by selecting a component, and recording the selected data row in the grid table.
[0041] Specifically, a selected row array is created for storing selected data rows in the grid table, and the initialized selected row array is empty; when a data row in the grid table is selected by the selection component, the content of the selected row is stored in the selected row array as an element of the selected row array; when the grid table data row is deselected by the selection component or the selected data row in the grid table is deleted, the corresponding content is deleted from the selected row array.
[0042] The selection components include: batch selection components and single item selection components.
[0043] The one-way selection component is a radio button corresponding to a grid row. Detecting a mouse click on a selection cell triggers the selection of the corresponding grid row, adding the selected row's contents to the selected rows array. Detecting a mouse click on a deselection cell triggers the deselection of the corresponding selected row, deleting the deselected row's contents from the selected rows array.
[0044] The batch selection component includes a select all box, and the select all box is equipped with a select all configuration option including two options. Specifically, the select all configuration option is implemented by a select label component.
[0045] When the select all configuration option is the first option, the event of selecting the select all box by the mouse triggers a first batch selection operation, and the event of deselecting the select all box by the mouse triggers a first batch deselection operation; the first batch selection operation includes: batch selecting the content of the current page of the grid table and adding the content of the current page of the grid table to the selected row array; the first batch deselection operation includes: batch deselecting the content of the current page of the grid table and deleting the content of the current page of the grid table from the selected row array.
[0046] When the Select All configuration option is the second option, the mouse selecting the Select All box triggers a second batch selection operation, and the mouse deselecting the Select All box triggers a second batch deselection operation. The second batch selection operation includes: batch selecting the contents of all pages of the grid table and adding the contents of all pages of the grid table to the selected row array; the second batch deselection operation includes: batch deselecting the contents of all pages of the grid table and deleting the contents of all pages of the grid table from the selected row array.
[0047] By controlling the select all configuration option and operating the select all box, batch selection of the current page of the grid table and batch selection of all pages of the grid table are achieved.
[0048] The batch selection component also includes a selection input box. Entering the number of rows to be selected in the batch selection input box triggers a third batch selection operation. Clearing the selection input box triggers a third batch deselection operation. Specifically, the third batch selection operation includes selecting corresponding rows from the grid as selected rows according to the number of rows to be selected, and adding the contents of the selected rows to the selected rows array. The third batch deselection operation includes canceling the selection of the rows selected according to the number of rows to be selected, and deleting the contents of the rows selected according to the number of rows to be selected from the selected rows array.
[0049] During specific implementation, when selecting a grid table data row through a selection component, if the selected data row fails to be added to the selected row array, a prompt indicating selection failure is fed back.
[0050] S300: After switching to a new grid page, the selected rows in the target page are displayed by coordinating the selected rows array with the table data array. Specifically, each row in the target page in the table data array is looped through, and each row in the selected rows array is looped through. A determination is made as to whether each row in the target page matches a row in the selected rows array. If so, the content in the selected rows array that matches the content in the target page is selected and displayed as the selected row in the target page.
[0051] The table data array stores the existing content of the grid table. For grid tables that store large amounts of data, the backend cannot directly send all the data to the frontend, and the frontend can only gradually obtain the content of the grid table from the backend through step-by-step queries. The present application stores the existing content of the grid table in the table data array. When the frontend queries the grid table data from the backend, the queried data is added to the table data array for each page queried. When switching paging of the grid table, the content of the table data array is updated in units of pages according to the entire page content of the grid table. Since the backend grid table data may be dynamic, when switching paging of the grid table, the new paging content obtained by the frontend from the backend may be different from the previous time. Therefore, when switching paging of the grid table, the content of the table data array is updated in units of pages according to the entire page content of the grid table.
[0052] In step S300, a double-layer traversal is performed to match the selected row array with the contents of the target page in the table data array. After the grid page is switched, the target page can still display the contents of the selected row of the current target page. This allows the background grid table data to be updated so that the selected row's sort order is changed. The selected row can still be displayed, breaking the limitation of being unable to switch pages.
[0053] In the specific implementation process, a query component is configured, and the query component uses the query keyword to search for the target content, forming a grid table recording the target content. The second batch selection operation selects the queried target content. The query component is combined with the batch selection component to implement asynchronous page turning batch setting combined with the query.
[0054] During the specific implementation process, the number of data rows stored in the selected row array is obtained and displayed through a selected data row number label set on the table page.
[0055] Example 2
[0056] See Figure 3 As shown, an embodiment of the present application provides a device for optimizing batch selection of data from a table, including a bus unit, an interface unit, a display unit, a processing unit, a storage unit and an input unit, wherein the bus unit connects the display unit, the processing unit, the storage unit, the input unit and the interface unit, the storage unit stores at least one instruction, and the processing unit executes the instruction to implement the method for optimizing batch selection of data from a table.
[0057] Example 3
[0058] An embodiment of the present application provides a storage medium for implementing an optimization method for batch selecting data from a table. The storage medium for implementing the optimization method for batch selecting data from a table stores at least one instruction, and reads and executes the instruction to implement the optimization method for batch selecting data from a table.
[0059] In this application, the selected rows in each page of the grid table are displayed by cooperating with the selected row array and the table data array; even if the grid table is changed due to insertion, the selected rows can still be displayed without being affected. By cooperating with the selected row array and the table data array, data row selection can be achieved across pages.
[0060] The present application controls the characteristics of the selected row array that records the contents of the selected row through the page turning selection flag. When the page turning selection flag is in the first state, the contents in the selected row array will be cleared due to triggering page turning. When the page turning selection flag is in the second state, triggering page turning cannot clear the contents of the selected row array; free configuration of page turning selection and page turning non-selection is realized.
[0061] In this application, a select box component is provided to facilitate selecting all of the current page and all pages. The select box component is configured with a select all configuration option that controls the select box function. When the select all configuration option is the first option, the select box is used to select all and unselect all of the current page of the grid table. When the select all configuration option is the second option, the select box is used to select all and unselect all of all pages of the grid table. This application sets a selection input box that facilitates selecting all by the number of rows of selected data. The combination of the select box and the selection input box allows for more flexible batch selection of data.
[0062] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0063] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0064] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0065] The foregoing description is intended only to provide specific embodiments of the present invention, which will enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown herein, but is intended to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for optimizing batch data selection in a table, characterized in that: include: Create a selected row array to store the selected rows in the grid. If the grid row is unselected or the selected row is deleted, the corresponding content will be deleted from the selected row array. Create a table data array to store the existing content of the grid table. When the front end queries the grid table data from the back end, each time a page is queried, the queried data is added to the table data array. When switching pages of the grid table, the content of the table data array is updated in units of pages according to the entire page content of the grid table. Set up a batch selection component and listen to the batch selection component's events. When the batch selection is triggered by the batch selection component's events, the batch selected content is added to the selected row array. When a data row in the grid table is selected by the selection component, the content of the selected row is stored as an element of the selected row array in the selected row array. When displaying the selected row of the target paging of the grid table, loop through the selected row array, traverse the content of the target paging in the table data array, and select the content in the selected row array that matches the target paging content as the selected row of the target paging.
2. The optimization method for batch selecting data from a table according to claim 1, characterized in that: The addition of a configuration item for the grid table includes two states of page turning selection flags. When the page turning selection flag is in the first state, the existing content in the selected row array is cleared when the page is triggered. When the page turning selection flag is in the second state, the existing content in the selected row array is not cleared when the page is triggered.
3. The optimization method for batch selecting data from a table according to claim 1 is characterized in that: The batch selection component includes a select all box, and the select all box is equipped with a select all configuration option including two options; When the select all configuration option is the first option, the event of selecting the select all box by the mouse triggers the first batch selection operation, and the event of deselecting the select all box by the mouse triggers the first batch deselection operation; When the select all configuration option is the second option, the event of selecting the select all box by the mouse triggers the second batch selection operation, and the event of deselecting the select all box by the mouse triggers the second batch deselection operation.
4. The optimization method for batch selecting data from a table according to claim 3 is characterized in that: The first batch selection operation includes: batch selecting data rows of the current page of the grid table and adding the data rows of the current page of the grid table to the selected row array; The first batch deselection operation includes: batch deselecting the data rows of the current page of the grid table and deleting the data rows of the current page of the grid table from the selected row array; The second batch selection operation includes: batch selecting data rows of all pages of the grid table and adding the data rows of all pages of the grid table to the selected row array; The second batch deselection operation includes: deselecting data rows of all pages of the grid table in batches and deleting data rows of all pages of the grid table from the selected row array.
5. The optimization method for batch selecting data from a table according to claim 4 is characterized in that: The target content is searched using the search keyword to form a grid table recording the target content, and the searched target content is selected through the second batch selection operation.
6. The optimization method for batch selecting data from a table according to claim 1, characterized in that: The batch selection component includes a selection input box, and the event of inputting the batch selection row number in the selection input box triggers a third batch selection operation; the event of setting the content of the selection input box to empty triggers a third batch cancellation selection operation, wherein the third batch selection operation includes: selecting corresponding data rows from the grid table as selected rows according to the batch selection row number, and adding the selected data rows to the selected row array; the third batch cancellation selection operation includes: canceling the selection of data rows selected according to the selection row number, and deleting the data rows selected according to the batch selection row number in the selected row array.
7. The optimization method for batch selecting data from a table according to claim 1, characterized in that: When the selected data row fails to be added to the selected row array, a prompt indicating the selection failure is fed back.
8. A device for optimizing batch selection of data from a table, characterized in that: The method comprises a bus unit, an interface unit, a display unit, a processing unit, a storage unit and an input unit, wherein the bus unit connects the display unit, the processing unit, the storage unit, the input unit and the interface unit, the storage unit stores at least one instruction, and the processing unit executes the instruction to implement the optimization method for batch data selection from a table according to any one of claims 1 to 7.
9. A storage medium for implementing an optimization method for batch selecting data from a table, characterized in that: The storage medium for implementing the optimization method for batch selecting data from a table stores at least one instruction, and reads and executes the instruction to implement the optimization method for batch selecting data from a table according to any one of claims 1-7.
Citation Information
Patent Citations
Method and device recording selected data items in result page
CN107145488A
Paging query method and device, storage medium and electronic equipment
CN111858581A