Method, apparatus, electronic device, and storage medium for constructing a search table

By using a renderer to dynamically generate query tables with pre-configured column configurations, the method addresses the complexity of code development and maintenance in table grid systems, enhancing developer efficiency and reducing maintenance costs.

CN113760896BActive Publication Date: 2025-07-15BEIJING JINGDONG TUOXIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110056894.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-15
Publication Date
2025-07-15
Estimated Expiration
2041-01-15

AI Technical Summary

Technical Problem

In the prior art, when there are many table fields, the number of lines of code in the template expands sharply, which makes it difficult for developers to develop the code in the template, which is not conducive to maintenance.

Method used

By obtaining the table query request, the data in the data source is called in the renderer based on the pre-configured column configuration information to render, generate a query table, reduce the number of lines of code in the template, and reduce the difficulty of development.

Benefits of technology

It effectively shortens the number of lines of code in the template, reduces development difficulty, improves development efficiency, and facilitates maintenance by multiple people.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760896B_ABST
    Figure CN113760896B_ABST
Patent Text Reader

Abstract

The present application provides a method, an apparatus, an electronic device, and a storage medium for constructing a search form. In this method, by obtaining a form query request, and then in a renderer, according to the query request and pre-configured column configuration information, data in a data source is called based on the column configuration information for rendering to obtain a query form. The column configuration information is mainly used to describe the characteristics of the search form. In this method, the data is rendered according to the query request and the column configuration information, so as to obtain the query form, effectively shortening the number of code lines in the template, reducing the development difficulty, and further reducing the maintenance difficulty for developers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data processing, and particularly relates to a method, apparatus, electronic device, and storage medium for constructing a search table. Background Art

[0002] A table consists of one or more rows of cells and is used to display numbers and other items for quick reference and analysis. In daily life, when processing data in a table, it is necessary to search for the data in the table according to requirements to facilitate quickly obtaining and processing the required data.

[0003] In the prior art, when searching for data in a table, different templates are mainly generated for different forms and tables, and the fields of the form are manually associated with the fields of the table, and the form is used to search for and process the data in its corresponding table.

[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: when there are a large number of form and table templates, the number of code lines in the templates will increase significantly, making it difficult for developers to develop the code in the templates and being unfavorable for maintenance. Summary of the Invention

[0005] This application provides a method, apparatus, electronic device, and storage medium for constructing a search table to solve the problem in the prior art that it is difficult for developers to develop the code in the templates and it is unfavorable for maintenance.

[0006] In a first aspect, an embodiment of this application provides a method for constructing a search table, including:

[0007] Obtain a table query request;

[0008] In a renderer, based on the query request and pre-configured column configuration information, call data in a data source according to the column configuration information for rendering to obtain a query table; wherein, the column configuration information is used to describe the characteristics of the search table.

[0009] In a possible design of the first aspect, the method further includes:

[0010] Perform column configuration in response to a user's operation to obtain the column configuration information, where the column configuration information includes the names, types, and description contents of multiple fields of the query table, and the multiple fields include: form items and / or titles displayed in the table, corresponding field names in the data source, values bound to the form items, types of forms, widths of the table, whether to be displayed in the table and / or form, and rendering functions of the table and / or form.

[0011] Optionally, the step of rendering a query table by calling data in a data source based on the query request and pre-configured column configuration information includes:

[0012] Generating a model object by calling fields displayed in a form according to the column configuration information;

[0013] Rendering a corresponding form in the renderer according to the value of the form type in the column configuration information;

[0014] Obtaining the query table by calling data source request input parameters according to the form and the model object.

[0015] Optionally, the step of rendering a query table by calling data in a data source based on the query request and pre-configured column configuration information includes:

[0016] Generating a model object by calling fields displayed in a form according to the column configuration information;

[0017] Rendering a corresponding form in the renderer according to the value of the form type in the column configuration information;

[0018] Obtaining the query table by calling data source request input parameters according to the form and the model object.

[0019] Optionally, the method further includes:

[0020] Configuring key items in the renderer in response to a user operation, where the key items in the renderer include description information of a data source, column configuration information, and a method for obtaining the data source.

[0021] Optionally, the key items in the renderer further include at least one of the following: whether to display the waiting state, trigger when submitting a form, trigger when resetting a form, trigger after data loading is completed, and trigger after data loading fails.

[0022] In a second aspect, an embodiment of the present application provides a device for constructing a search table, including: an acquisition module and a processing module;

[0023] The acquisition module is configured to obtain a table query request;

[0024] The processing module is configured to render a query table by calling data in a data source based on the query request and pre-configured column configuration information in a renderer; wherein, the column configuration information is used to describe the characteristics of the search table.

[0025] In a possible design of the second aspect, the processing module is further configured to:

[0026] Column configuration is performed in response to a user operation to obtain the column configuration information, where the column configuration information includes the names, types, and description contents of multiple fields of a query table, and the multiple fields include: form items and / or titles displayed in the table, corresponding field names in the data source, values bound to the form items, form types, table widths, whether to be displayed in the table and / or form, and rendering functions of the table and / or form.

[0027] Optionally, the processing module is specifically configured to:

[0028] Call a field generation model object displayed in the form according to the column configuration information;

[0029] Render a corresponding form in the renderer according to the value of the form type in the column configuration information;

[0030] Call a data source request input parameter according to the form and the model object to obtain the query table.

[0031] Optionally, the processing module is further configured to:

[0032] Configure key items in the renderer in response to a user operation, where the key items in the renderer include description information of the data source, column configuration information, and a method for obtaining the data source.

[0033] Optionally, the key items in the renderer further include at least one of the following: whether to display a waiting state, triggers when submitting a form, triggers when resetting a form, triggers after data loading is completed, and triggers after data loading fails.

[0034] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory, and computer program instructions stored on the memory and executable on the processor, where when the processor executes the computer program instructions, it is used to implement the methods provided in the first aspect and all possible designs.

[0035] In a fourth aspect, an embodiment of the present application may provide a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, they are used to implement the methods provided in the first aspect and all possible designs.

[0036] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, where when the computer program is executed by a processor, it is used to implement the methods provided in the first aspect and all possible designs.

[0037] The method, apparatus, electronic device, and storage medium for constructing a search form provided by the embodiments of the present application. In this method, by obtaining a form query request, and then in a renderer, according to the query request and pre-configured column configuration information, data in a data source is called based on the column configuration information for rendering to obtain a query form. The column configuration information is mainly used to describe the characteristics of the search form. In this method, data is rendered according to the query request and column configuration information, so as to obtain a query form, effectively saving memory space, reducing the development difficulty, and further reducing the maintenance difficulty for developers. Brief Description of the Drawings

[0038] The accompanying drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure.

[0039] Figure 1 It is a schematic diagram of an application scenario of the method for constructing a search form provided by the embodiments of the present application;

[0040] Figure 2 It is a schematic flowchart of the first embodiment of the method for constructing a search form provided by the embodiments of the present application;

[0041] Figure 3 It is a schematic diagram of a search form interface provided by the embodiments of the present application;

[0042] Figure 4 It is a schematic diagram of the principle of the method for constructing a search form provided by the embodiments of the present application;

[0043] Figure 5 It is a schematic diagram of the structure of the device for constructing a search form provided by the embodiments of the present application;

[0044] Figure 6 It is a schematic diagram of the structure of the electronic device provided by the embodiments of the present application.

[0045] Through the above-mentioned accompanying drawings, the clear embodiments of the present disclosure have been shown, and there will be more detailed descriptions hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of the present disclosure in any way, but to illustrate the concept of the present disclosure to those skilled in the art by referring to specific embodiments. Detailed Embodiments

[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the scope of protection of the present application.

[0047] Before introducing the embodiments of the present application, the background of the present application is first explained as follows:

[0048] With the advancement of science and technology, forms, as an important way of presenting data, have played an increasingly important role in the process of data transmission. A form has three basic components, namely, form labels, form fields, and form controls. Among them, the form label contains the uniform resource locator (URL) of the program used to process form data and the method of submitting data to the electronic device. The form field contains text boxes, password boxes, hidden fields, multi-line text boxes, check boxes, radio buttons, drop-down selection boxes, and file upload boxes. Form controls include submit controls, reset controls, and general controls, which are used to transmit data to the script on the electronic device or cancel input. Form controls can also be used to control other processing tasks that define processing scripts. Since the table contains a large amount of data, it will take a lot of time to process each data separately. Therefore, the data in the table can be searched according to the needs, which can more conveniently and quickly obtain and process the required data.

[0049] In the prior art, when querying data in a table, different templates are mainly generated for different forms and tables, and the fields of the form and the fields of the table are manually associated, and the corresponding table is queried using the form template. However, in the prior art, when there are many fields in a table, a large number of forms and table templates are required to process the table, which greatly increases the number of lines of code in the template, making development more difficult and not conducive to developers maintaining the code in the template.

[0050] In view of the above problems, the invention of the present application is conceived as follows: in the process of searching for data in a table, in the current solution, since the fields of the form and the fields of the table are strongly associated, a large number of forms and table templates are required to process the table, which causes the number of lines of code in the template to expand sharply, which is not conducive to the developers to maintain the code in the template. Based on this, the inventor found that if the form and the table are rendered in association, the problem of the number of lines of code in the template of the prior art expanding sharply, which is not conducive to the developers to maintain the code in the template, can be solved, thereby achieving the purpose of improving development efficiency and reducing maintenance costs.

[0051] Exemplarily, the method for constructing a search table provided in the embodiment of the present application can be applied to Figure 1 In a schematic diagram of an application scenario shown in FIG. Figure 1 A schematic diagram of an application scenario of the method for constructing a search table provided in an embodiment of the present application is used to solve the above technical problems. Figure 1As shown, the electronic device can display a search form interface on the screen by running software or a browser, etc., facilitating user interaction through the search form interface. In the conventional processing method, the electronic device generates a query request by obtaining the user's click on the query control on the search form interface, processes the data in the data source according to the query request, and displays the processed query form on the search form interface. The electronic device can also send the obtained query request to the cloud or the server, process the data in the cloud or the server, and send the processed query form to the electronic device. During the process of processing the data in the data source, the electronic device can process the data in the data source stored in itself, or obtain the data in the cloud or the server and further process it, or obtain the query form processed in the cloud or the server according to the query request and display it on the search form interface.

[0052] In summary, the electronic device, which is the execution subject of the technical solution provided in this application, can be a mobile device with human-computer interaction capabilities such as a mobile phone, a tablet computer, a computer, or other intelligent terminals, or can be the cloud, or a processing function entity such as a server. This application does not impose too many restrictions on this.

[0053] Next, the technical solution of this application will be described in detail through specific embodiments.

[0054] It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0055] Figure 2 It is a schematic flowchart of the first embodiment of the method for constructing a search form provided in the embodiment of this application. As Figure 2 shown, the method for constructing this search form can include the following steps:

[0056] S101: Obtain the form query request.

[0057] The construction solution of the search form provided in the embodiment of this application needs to provide a search form interface for the user to facilitate the processing and display of the data in the data source, so that the user can access the service platform through a browser or an application installed on the electronic device.

[0058] In this step, when the user needs to search for a form, the user can perform a selection operation on the query control on the search form interface. For example, the user clicks on the query control on the search form interface, and after the electronic device detects that the query control is clicked, it obtains the generated form query request.

[0059] Further, the electronic device performs column configuration in response to a user operation to obtain column configuration information. The column configuration information includes the names, types, and description contents of multiple fields of a query table, where the multiple fields include: form items and / or the titles displayed in the table, the corresponding field names in the data source, and the values bound to the form items, the type of the form, the width of the table, whether to display in the table and / or the form, and the rendering functions of the table and / or the form.

[0060] Exemplarily, a search table is composed of rows and columns, which means that a search table can be generated by describing a column. In a search table, the search items in the form are basically the values of a certain column in the table, so a search table can be described by configuring the column. A partial example of the column configuration information is shown in Table 1.

[0061] Table 1

[0062]

[0063]

[0064] Specifically, the column configuration information will be explained in detail next.

[0065] The form item and / or the title displayed in the table are used to map the label name of the form item and the name of the column in the query table, and its type is a string. Among them, the label name refers to the display name of the Hyper Text Markup Language (HTML) tag label.

[0066] The corresponding field name in the data source and the value bound to the form item represent the data values corresponding to the query table in the data source. At the same time, the renderer will also determine the attributes bound to the form item through the corresponding field name in the data source and the value bound to the form item, and send the corresponding value as an input parameter according to the query request. Among them, the type of the corresponding field name in the data source and the value bound to the form item is also a string.

[0067] The type of the form represents the form that the form corresponding to this column should be rendered. Among them, the type of the form can be the following: input, date, date selection, dropdown list, interval, radio, checkbox. If the type of the form is not set, the default value is the input value. We can also customize other rendering forms through the rendering function of the form item.

[0068] Whether to display in the table is used to select to hide this column in the table in some scenarios when searching for a certain value through the form but not wanting it to be displayed on the search table interface. Among them, a boolean value is used to represent whether to display, 1 represents to display in the table, and 0 represents not to display in the table.

[0069] Whether to display in the form. In some scenarios, when there are too many fields to be displayed in the query table and one doesn't want to map too many form search items, one can choose to hide the rendering of form items. Here, a boolean value is used to represent whether to display, which will not be elaborated further here.

[0070] The rendering function of the table is used to render the data in this column using the rendering function of this table when some special styles need to be displayed or some scenarios not covered by the data need to be processed. For example, in the search table interface, some special controls for the search table interface are displayed according to the return value of the rendering function of the table.

[0071] The rendering function of the form item is used to customize some special controls for the search table interface.

[0072] It can be understood that only some column configuration information is shown in Table 1. In actual applications, the column configuration information can also have other contents and forms, which can be determined according to actual needs and will not be elaborated further here.

[0073] Among them, the column configuration information can be reflected in the form of code. The following is an example of the column configuration information.

[0074]

[0075]

[0076] Among them, developers can process the column configuration information under a specific Application Programming Interface (API).

[0077] S102: In the renderer, according to the query request and the pre-configured column configuration information, call the data in the data source based on the column configuration information for rendering to obtain a query table.

[0078] In this step, after the electronic device obtains the query request, it is necessary to render the data in the data source in the renderer according to the obtained query request and the pre-configured column configuration information, generate a query table according to the rendering result, and display the query table on the search table interface.

[0079] Among them, the data source can be composed of the data existing in the electronic device itself or the data stored in the cloud or server. This solution does not specifically limit this.

[0080] Specifically, the renderer is a device that processes the configuration and data source, and automatically displays the processed query results in the query table. In response to the user's operation, the key items in the renderer are configured. The key items in the renderer include the description information of the data source, column configuration information, and the method of obtaining the data source. Among them, the description information of the data source specifically includes the data source (data requested by the interface) and the method of preprocessing the data source. The description information of the data source can also include whether to display the waiting status, the trigger when submitting the form, the trigger when resetting the form, the trigger after the data is loaded, and the trigger when the data loading fails.

[0081] Exemplarily, a partial example of the key items is shown in Table 2.

[0082] Table 2

[0083]

[0084]

[0085] Specifically, the column configuration information will be explained in detail next.

[0086] The method of preprocessing the data source is mainly used to preprocess the data in the data source according to the corresponding function. The preprocessing can include cleaning the data (such as handling missing values, handling noisy data, etc.), integrating the data, and transforming the data.

[0087] The trigger when submitting the form is mainly used to make the corresponding changes to the search table interface according to the corresponding function after the user clicks the submit control. Exemplarily, after the user clicks the submit control, if the search table interface does not respond for a long time, it may cause the user to repeatedly click the submit control. After the user repeatedly clicks the submit control, the electronic device will receive repeated query requests, seriously affecting the operation of the electronic device. Therefore, by setting the corresponding function to disable the submit control after the user clicks the submit control for the first time, it can effectively prevent the trouble caused by the user's multiple clicks.

[0088] The trigger when resetting the form is mainly used to remind the user whether to perform the reset operation. Exemplarily, after the user clicks the reset control, a window can pop up on the search table interface, prompting whether to confirm the reset operation in the window, and providing a confirmation control and a cancellation control, facilitating the user to operate according to the needs.

[0089] The trigger after the data is loaded is mainly used to remind the user that the query table has been loaded. Exemplarily, after the query table has been loaded, a pop-up window can be displayed on the search table interface, prompting the user that the query table has been loaded.

[0090] The trigger when data loading fails is mainly used to remind the user that the query table fails to load successfully. Exemplarily, after the query table fails to load, a pop-up window can be displayed on the search table interface, and the user is prompted in the pop-up window that the query table fails to load and please query again.

[0091] It can be understood that only some key items are shown in Table 2. In actual applications, the key items can also have other contents and forms, which can be determined according to actual needs and will not be elaborated here.

[0092] Among them, the key items can be reflected in the form of code. The following is an example of a key item.

[0093]

[0094] Among them, developers can process the business logic of key items under specific APIs, effectively ensuring the unity of code style and facilitating maintenance by multiple people. Since a large number of forms and table templates are reduced, the development efficiency is greatly improved.

[0095] Specifically, a model object is generated by calling the fields displayed in the form according to the column configuration information. For example, after the electronic device obtains a table query request, it processes the data in the data source according to the query request and the pre-configured column configuration information, collects the corresponding field names in the data source displayed in the form, and the values bound to the form items, and generates a corresponding module object with the corresponding field names in the original data source of the module object and the values bound to the form items.

[0096] Among them, the column configuration information is used to describe the characteristics of the search table.

[0097] Next, the corresponding form is rendered in the renderer according to the value of the form type in the column configuration information. Exemplarily, in the renderer, the corresponding form is rendered according to the value of the form type in the column configuration information. When the value of the form type changes, and after the form type is selected or deselected, a change event is triggered. The renderer listens for the change event of the form. Whenever the change event of the form is triggered, the renderer obtains the updated value of the form type and replaces the corresponding field names and the values bound to the form items in the original data source of the module object with the updated value of the form type.

[0098] Further, according to the form and the model object, the input parameters for the data source request are called to obtain the query table. For example, the electronic device calls the data source according to the form and the model object, and uses the field names corresponding to the data source to be displayed in the form in the model object and the values bound to the form items as input parameters. If the input parameters do not match the format to be displayed, the input parameters can be preprocessed by preprocessing the data source, and the function output parameters in the method for preprocessing the data source are used as input parameters again. If no method for preprocessing the data source is set, the input parameters are not preprocessed by default.

[0099] Among them, the renderer uses the renderForm, renderTable, and renderPagination methods to render the data in the data source to obtain the query table.

[0100] For example, renderForm is mainly used to render form items. renderForm will have two built-in controls: a submit control and a reset control, and render the form according to the column configuration information to obtain the query table. When there are too many fields displayed in the table and there is no need to map too many form search items, the corresponding form is not rendered. When the rendering function of the form is set in the column configuration information, the return value of this function will be rendered. renderTable is mainly used to render the table according to the column configuration information. When the rendering function of the table is set in the column configuration information, the return value of this function will be rendered. In some scenarios, when searching for a certain value through the form, but not wanting it to be displayed on the search table interface, this column is not rendered in the table. renderPagination is mainly used to render pagination, and built-in pagination is beneficial for data pagination processing.

[0101] Figure 3 This is a schematic diagram of a search table interface provided by an embodiment of the present application. As Figure 3 shown, the electronic device displays the search table interface on the screen by running software or a browser, etc. The search table interface includes: a query control, a reset control, and a section control. The section control specifically includes a page number control and a next page control. At the same time, the search table interface also includes multiple input boxes and date selection boxes. Enter the conditions you want to query in the input boxes. For example, you can enter the number and / or name in the input boxes respectively, and then click the query control. The electronic device will form a corresponding query request according to the entered number and / or name, and obtain and display the rendered query table according to the query request. The date selection box is mainly used to provide the user with the selection of the start date and the end date, to determine the data of the data source within this date range, and render the data of the data source within this date range to obtain the query table and perform operations on it.

[0102] Meanwhile, the search form interface can also display the query form and provide viewing and editing controls, facilitating users to view or edit the query form.

[0103] Specifically, when the user clicks on the paging, search, and reset controls on the search form interface, the query request will be automatically obtained without manual operation. Among them, clicking on the paging control on the search form interface specifically includes clicking on the page number controls (Page 1, Page 2, Page 3, etc.) on the search form interface, clicking on the next page control, and entering the desired page number in the input box. The renderer will automatically use the field names corresponding to the data sources to be displayed in the form in the model object and the values bound to the form items as input parameters for automatic requests. At the same time, the display status of whether to show the waiting state in the renderer will be correspondingly displayed according to the request status.

[0104] Exemplarily, during the process of the renderer rendering the form, in order to enable the user to clearly understand that the renderer is processing the form and has not completed the processing, the request status can be correspondingly displayed by showing a spinning animation pattern on the search form interface or by popping up a window and displaying "Loading..." on the window.

[0105] In a specific implementation, when dealing with some specific scenarios, more fine-grained control of the query request is required. Therefore, the electronic device can not pass the obtained query request into the renderer, and at this time, the manual request mode is considered to be enabled. It should be noted that the manual request mode is automatically enabled or disabled through fields passed by developers, and developers do not need to care about the configuration.

[0106] Specifically, developers manually obtain the query request generated by the user's operation on the search form interface in the renderer, and perform rendering processing on the query request according to more refined control requirements by using the rendering function of the table and the rendering function of the form item to obtain the query form. When the user clicks on the paging, search, and reset controls on the search form interface, corresponding events (such as paging event, search event, reset event) will be dispatched to the renderer, as well as the field names corresponding to the data sources to be displayed in the form in the model object and the values bound to the form items. It should be noted that when the manual request mode is enabled, the display status of whether to show the waiting state in the renderer cannot be correspondingly displayed according to the request status.

[0107] Among them, the rendering function of the table and the rendering function of the form item in the column configuration information ensure that developers' more fine-grained request control requirements in some specific scenarios can meet the needs of custom rendering. At the same time, the search form interface can display different spaces according to the custom content, effectively improving the flexibility of the search form interface.

[0108] It should be understood that the user in the embodiments of the present application can be a R & D personnel, a maintenance personnel, or an ordinary user, and the embodiments of the present application do not limit this.

[0109] The method for constructing a search form provided by the embodiments of the present application obtains a form query request, and then in the renderer, according to the query request and the pre-configured column configuration information, calls the data in the data source based on the column configuration information for rendering to obtain a query form. The column configuration information is mainly used to describe the characteristics of the search form. In this method, the data is rendered according to the query request and the column configuration information, so as to obtain a query form, effectively shortening the number of code lines in the template, reducing a large amount of template writing, thereby reducing the development difficulty, ensuring the unity of the code style for easy maintenance by multiple people, and reducing the maintenance difficulty of developers. Since developers can customize the rendering of the data in the data source, the flexibility of organizing the search form interface is further improved.

[0110] Figure 4 is a schematic diagram of the principle of the method for constructing a search form provided by the embodiments of the present application, as Figure 4 shown, the electronic device responds to the user's operation on the search form interface, obtains a form query request, and renders the data in the called data source in the renderer according to the form query request and the pre-configured column configuration information to obtain a query form, and finally displays the query form on the search form interface. Among them, the search form interface includes a form, a table, and a paging situation.

[0111] The method for constructing a search form provided by the embodiments of the present application has the same implementation principle and technical effects as Figure 2 the method for constructing a search form provided, and will not be elaborated here.

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

[0113] Figure 5 is a schematic diagram of the structure of the search form construction device provided by the embodiments of the present application. As Figure 5 shown, the device includes: an acquisition module 51 and a processing module 52.

[0114] The acquisition module 51 is used to obtain the form query request.

[0115] The processing module 52 is used to, in the renderer, according to the query request and the pre-configured column configuration information, call the data in the data source based on the column configuration information for rendering to obtain a query form; wherein, the column configuration information is used to describe the characteristics of the search form.

[0116] In a possible design of an embodiment of the present application, the processing module 52 is further configured to:

[0117] Perform column configuration in response to a user operation to obtain column configuration information, where the column configuration information includes the names, types, and description contents of multiple fields of a query table, and the multiple fields include: form items and / or titles displayed in the table, corresponding field names in the data source, and values bound to the form items, the type of the form, the width of the table, whether to display in the table and / or form, and rendering functions of the table and / or form.

[0118] Optionally, the processing module 52 is specifically configured to:

[0119] Call a field generation model object displayed in the form according to the column configuration information;

[0120] Render a corresponding form in the renderer according to the value of the form type in the column configuration information;

[0121] Call a data source request input parameter according to the form and the model object to obtain a query table.

[0122] Optionally, the processing module 52 is further configured to:

[0123] Configure key items in the renderer in response to a user operation, where the key items in the renderer include description information of the data source, column configuration information, and a method for obtaining the data source.

[0124] Optionally, the key items in the renderer further include at least one of the following: whether to display the waiting state, triggers when submitting the form, triggers when resetting the form, triggers after data loading is completed, and triggers after data loading fails.

[0125] The device provided in the embodiment of the present application can be used to execute the method for constructing a search table in the above embodiment, and its implementation principle and technical effects are similar and will not be elaborated here.

[0126] It should be noted that it should be understood that the division of each module of the above device is only a logical function division. In actual implementation, it can be fully or partially integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software called by a processing element; they can also all be implemented in the form of hardware; or some modules can be implemented in the form of software called by a processing element, and some modules can be implemented in the form of hardware. In addition, all or part of these modules can be integrated together or independently implemented. The processing element mentioned here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by the integrated logic circuit in the processor element or instructions in software form.

[0127] Figure 6 This is a schematic structural diagram of the electronic device provided by the embodiment of the present application. As Figure 6 shown, the electronic device may include: a processor 61, a display 62, a memory 63, and computer program instructions stored on the memory and executable on the processor. When the processor executes the computer program instructions, the construction method of the search form provided in any of the foregoing embodiments is implemented.

[0128] Optionally, the electronic device may further include an interface for interacting with other devices.

[0129] Optionally, the various components of the electronic device may be connected through a system bus.

[0130] The memory 63 may be a separate storage unit or an integrated storage unit in the processor. The number of processors is one or more.

[0131] The display 62 is used for human-computer interaction and displaying the processing result of the processor 61. Optionally, the display 62 may be used to display a search form interface, which may include graphics, text, icons, videos, and any combination thereof. In some embodiments, the display 62 may be the front panel of the electronic device; in other embodiments, the display 62 may be a flexible display screen disposed on a curved surface or a folding surface of the electronic device. Even, the display 62 may be set as a display screen with an irregular non-rectangular shape, that is, a special-shaped screen. The display 62 may be prepared from materials such as a liquid crystal display (LCD) or an organic light-emitting diode (OLED).

[0132] It should be understood that the processor 61 may be a central processing unit (abbreviation: CPU in English), or may also be other general-purpose processors, a digital signal processor (abbreviation: DSP in English), an application specific integrated circuit (abbreviation: ASIC in English), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the present application may be directly implemented by the execution of the hardware processor, or implemented by the combination of the hardware and software modules in the processor.

[0133] The system bus can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The system bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus. The memory may include a Random Access Memory (RAM), and may also include non-volatile memory, such as at least one disk memory.

[0134] All or part of the steps of the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a readable memory. When the program is executed, it performs the steps of the above method embodiments; and the foregoing memory (storage medium) includes: Read-Only Memory (ROM), RAM, flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc, and any combination thereof.

[0135] The electronic device provided in the embodiments of the present application can be used to execute the method for constructing a search form provided in any of the above method embodiments, and its implementation principle and technical effect are similar, which will not be elaborated here.

[0136] The embodiments of the present application provide a computer-readable storage medium. Computer instructions are stored in the computer-readable storage medium. When the computer instructions run on a computer, the computer is enabled to execute the method for constructing a search form.

[0137] For the above computer-readable storage medium, the above-readable storage medium 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, a disk, or an optical disc. The readable storage medium can be any available medium accessible by a general-purpose or special-purpose computer.

[0138] Optionally, a readable storage medium is coupled to the processor so that the processor can read information from and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.

[0139] An embodiment of the present application further provides a computer program product. The computer program product includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, the above-mentioned method for constructing a search table can be implemented.

[0140] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A method for constructing a search table, characterized in that including: Obtain a table query request; In a renderer, based on the query request and pre-configured column configuration information, call data in a data source according to the column configuration information to render a query table; wherein, the column configuration information is used to describe the characteristics of a search table; It further includes: configuring key items in the renderer in response to a user operation, where the key items in the renderer include description information of a data source, the column configuration information, and a method for obtaining a data source.

2. The method according to claim 1, characterized in that The method further includes: Performing column configuration in response to a user operation to obtain the column configuration information, where the column configuration information includes the names, types, and description contents of multiple fields of a query table, and the multiple fields include: form items and / or titles displayed in a table, corresponding field names in a data source, values bound to form items, form types, table widths, whether to be displayed in a table and / or form, and rendering functions of a table and / or form.

3. The method according to claim 2, wherein The step of, based on the query request and pre-configured column configuration information, calling data in a data source according to the column configuration information to render a query table includes: Calling fields displayed in a form according to the column configuration information to generate a model object; Rendering a corresponding form in the renderer according to the value of the form type in the column configuration information; According to the form and the model object, calling data source request input parameters to obtain the query table.

4. The method according to claim 1, characterized in that The key items in the renderer further include at least one of the following: whether to display a waiting status, triggers when submitting a form, triggers when resetting a form, triggers after data loading is completed, and triggers after data loading fails.

5. A search form construction device, characterized in that, including: An acquisition module and a processing module; The acquisition module is used to obtain a table query request; The processing module is used to, in a renderer, based on the query request and pre-configured column configuration information, call data in a data source according to the column configuration information to render a query table; wherein, the column configuration information is used to describe the characteristics of a search table; The processing module is further used to: configure key items in the renderer in response to a user operation, where the key items in the renderer include description information of a data source, column configuration information, and a method for obtaining a data source.

6. The device according to claim 5, wherein The apparatus further includes: The processing module is further used to perform column configuration in response to a user operation to obtain the column configuration information, where the column configuration information includes the names, types, and description contents of multiple fields of a query table, and the multiple fields include: form items and / or titles displayed in a table, corresponding field names in a data source, values bound to form items, form types, table widths, whether to be displayed in a table and / or form, and rendering functions of a table and / or form.

7. The device according to claim 6, characterized in that, The processing module is specifically used to: Call fields displayed in a form according to the column configuration information to generate a model object; Render a corresponding form in the renderer according to the value of the form type in the column configuration information; According to the form and the model object, call data source request input parameters to obtain the query table.

8. The device according to claim 5, characterized in that, The key items in the renderer further include at least one of the following: whether to display the waiting state, the trigger when submitting a form, the trigger when resetting a form, the trigger after data loading is completed, and the trigger after data loading fails.

9. An electronic device, characterized in that, including: a processor, a display, a memory, and computer program instructions stored on the memory and executable on the processor, where when the processor executes the computer program instructions, it is used to implement the method for constructing a search form according to any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, they are used to implement the method for constructing a search form according to any one of claims 1 to 4.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it is used to implement the method for constructing a search form according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Realization method and device for query report

    CN108089899A

  • Form rendering method and device, computer equipment and storage medium

    CN112015420A