Page rendering method and device based on template configuration
By using the template parsing function of the VEU framework on the browser side, dynamically generate pages, solving the problem of time-consuming and labor-consuming page development and maintenance in the existing technology, and achieving front-end separation and reduction of server pressure.
Patent Information
- Application Number
- CN202411468419.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-21
Smart Images

Figure CN119440527A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a page rendering method and device based on template configuration. Background Art
[0002] In the current business development situation, configuration management is a data operation page, and some business information is a pure display page. The development and maintenance of these pages are all written by developers one field at a time. When operating data, corresponding data operation interfaces need to be written, which is time-consuming, labor-intensive, and prone to errors. The styles of the developed pages are also different.
[0003] Currently, commonly used template rendering technologies generally adopt server-side rendering, including JSP, JSTL, FreeMarker, Velocity, Thymeleaf, etc. They do not occupy front-end resources, but are not conducive to the separation of front-end and back-end and increase the pressure on the server. Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention adopts browser-side rendering technology, utilizes the template parsing function v-for instruction of the Javascript framework VEU, parses the template metadata returned by the query interface, and dynamically generates DOM (Document Object Model) nodes. These nodes and the display data returned by the query interface are bound to form HTML to display data on the browser page. The rendering of data is completed on the browser side, and the server side only queries the data, which reduces the pressure on the server side, achieves the separation of the front and back ends, and provides a better user experience.
[0005] The technical solution adopted by the present invention is as follows:
[0006] A first aspect provides a page rendering method based on template configuration, comprising:
[0007] A template configuration metadata table is established to configure the template and obtain template metadata, wherein the template configuration metadata table includes a template configuration table, a template field table, a button configuration table and a tree map configuration table. The template configuration table is used to configure template information, including a template number. The template field table is used to configure displayed fields. The button configuration table is used to configure button information displayed on the page and the behavior after the button is clicked. The tree map configuration table is used to configure tree map structure information. The information configured in the template configuration table, the template field table, the button configuration table and the tree map configuration table constitutes template metadata.
[0008] Configure the menu information of the page where the data is to be displayed and the template number associated with the page;
[0009] In response to a click operation on the menu, a corresponding template configuration metadata table and a data query interface are called according to the template number associated with the page;
[0010] The template metadata corresponding to the template configuration metadata table is queried through the data query interface according to the template number associated with the page, and a database operation SQL is generated according to the template metadata, wherein the database operation SQL is used to return the data to be displayed, and then the template metadata and the data to be displayed are returned;
[0011] Template parsing technology is used to parse the template metadata, and the page is generated according to the parsing results and the data to be displayed.
[0012] In one embodiment, the template information also includes a template description, a queried data table, query conditions, whether it is a list template or a detail template, a column, a pop-up box or routing page configuration information; the displayed fields include field numbers, field descriptions, field names, field aliases, calculated fields, and data types; the button information displayed on the page includes button numbers, button types, button sizes, and button icons; the behavior after clicking the button includes whether to display, action type, action source, and action name; the tree map structure information includes tree map item numbers, tree map item descriptions, lists / details, template numbers, whether to expand, whether to select, and sort number information.
[0013] In one embodiment, when the template is described as a details template, the method further includes:
[0014] The configuration details page displays multiple fields in one row;
[0015] Configure how to open the details page;
[0016] Configure the display mode of the details page.
[0017] In one implementation, the display method of the configuration details page includes:
[0018] Configure tab names and folding panel names for classification;
[0019] The information of the detail page is displayed in the form of tabs and folding panels respectively.
[0020] In one embodiment, the method further comprises:
[0021] Configure the event button on the details page. The event button includes buttons and events. Button means that this button follows a certain field; event means the event triggered after operating this field.
[0022] In one embodiment, when the template is described as a list template, the method further includes:
[0023] Configure whether the field is used as a search condition.
[0024] In one embodiment, the method further includes: configuring and generating a button for adding, modifying, deleting, saving or customizing through a button configuration table to implement operation data.
[0025] Based on the same inventive concept, the second aspect of the present invention provides a page rendering device based on template configuration, comprising:
[0026] A template configuration module is used to establish a template configuration metadata table to configure the template and obtain template metadata, wherein the template configuration metadata table includes a template configuration table, a template field table, a button configuration table and a tree map configuration table. The template configuration table is used to configure template information, including a template number. The template field table is used to configure displayed fields. The button configuration table is used to configure the button information displayed on the page and the behavior after the button is clicked. The tree map configuration table is used to configure the tree map structure information. The information configured in the template configuration table, the template field table, the button configuration table and the tree map configuration table constitutes the template metadata;
[0027] A menu information configuration module, used to configure the menu information of the page to display data and the template number associated with the page;
[0028] The template configuration calling module is used to call the corresponding template configuration metadata table and data query interface according to the template number associated with the page in response to the click operation of the menu;
[0029] The data query module is used to query the template metadata corresponding to the template configuration metadata table according to the template number associated with the page through the data query interface, and generate a database operation SQL according to the template metadata, wherein the database operation SQL is used to return the data to be displayed, and then return the template metadata and the data to be displayed;
[0030] The page rendering module is used to parse the template metadata using template parsing technology and generate a page based on the parsing results and the data to be displayed.
[0031] Based on the same inventive concept, the third aspect of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the page rendering method based on template configuration described in the first aspect is implemented.
[0032] Based on the same inventive concept, the fourth aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the page rendering method based on template configuration described in the first aspect is implemented.
[0033] Compared with the prior art, the advantages and beneficial technical effects of the present invention are as follows:
[0034] The present invention provides a page rendering method based on template configuration, which first establishes a template configuration metadata table to configure template metadata; then configures the menu information of the page to display data and the template number associated with the page, and then calls the corresponding template configuration metadata table and data query interface according to the template number associated with the page; then queries the template metadata corresponding to the template configuration metadata table according to the template number associated with the page through the data query interface, and generates database operation SQL according to the template metadata, and then returns the template metadata and the data to be displayed; finally, the template metadata is parsed using template parsing technology, and a page is generated according to the parsing result and the data to be displayed. The present invention can generate pages according to the fields and styles of the template metadata configured in the template configuration metadata table, as well as the configured menu information, thereby reducing the development and maintenance workload, unifying the page style, and using browser-side rendering technology, using the VEU for instruction to dynamically generate dom nodes, so as to achieve front-end and back-end separation, which can reduce the pressure on the server. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A flow chart of a page rendering method based on template configuration provided by an embodiment of the present invention;
[0037] Figure 2 A structural block diagram of a page rendering device based on template configuration provided in an embodiment of the present invention;
[0038] Figure 3 A schematic diagram of a computer-readable storage medium provided in an embodiment of the present invention;
[0039] Figure 4 A schematic diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The present invention provides a page rendering method based on template configuration, and provides an implementation method for rendering WEB pages and operating data according to template configuration, aiming to develop WEB pages and maintain data in a fast and consistent manner. The main scheme includes: Step 1: Establish a template configuration metadata table, including a template configuration table, a template field table, a button configuration table, and a tree map configuration table, which are used to configure template metadata. The template metadata includes template configuration information, template field configuration information, template button configuration information, and tree map template configuration information for use by the page parsing engine; Step 2: The page menu management configures the menu information of the page to display data, mainly including the menu name, menu path, and the template number configured in step 1; Step 3: Click the page menu in step 2, and the template configuration and data query interface is called according to the template number associated with the menu; Step 4: The query interface queries the template metadata configured in step 1 according to the template number, generates database operation SQL according to the template metadata, and uses this SQL to query the data to be displayed, and finally returns the data to be displayed and the template data; Step 5: Use template parsing technology to parse the template data to dynamically generate a page and display the returned data. In addition, according to the template configuration metadata table configuration, add, modify, delete, save and customize buttons are generated to realize data operation. The present invention retrieves data from a database, uses a for loop of VUE to traverse the retrieved data, displays the data according to configured fields and styles, and operates the data according to configured buttons, thereby reducing development and maintenance workload and unifying page styles.
[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] Embodiment 1
[0043] The present invention discloses a page rendering method based on template configuration, see Figure 1 , the method comprising:
[0044] S1: Establish a template configuration metadata table to configure the template and obtain template metadata, wherein the template configuration metadata table includes a template configuration table, a template field table, a button configuration table and a tree map configuration table. The template configuration table is used to configure template information, including a template number. The template field table is used to configure displayed fields. The button configuration table is used to configure the button information displayed on the page and the behavior after the button is clicked. The tree map configuration table is used to configure the tree map structure information. The information configured in the template configuration table, the template field table, the button configuration table and the tree map configuration table constitutes the template metadata.
[0045] S2: configure the menu information of the page to display data and the template number associated with the page;
[0046] S3: In response to a click operation on the menu, calling a corresponding template configuration metadata table and a data query interface according to a template number associated with the page;
[0047] S4: querying the template metadata corresponding to the template configuration metadata table according to the template number associated with the page through the data query interface, and generating a database operation SQL according to the template metadata, wherein the database operation SQL is used to return the data to be displayed, and then returning the template metadata and the data to be displayed;
[0048] S5: Use template parsing technology to parse the template metadata, and generate a page based on the parsing results and the data to be displayed. Specifically, the template metadata includes template configuration information, template field configuration information, template button configuration information, and tree map template configuration information, which are used by the page parsing engine. The template configuration table is used to configure template information, mainly including template number, template description, query data table, query conditions, whether it is a list template or a detail template, columns, pop-up box or routing page configuration information; the template field table is used to configure the displayed fields, mainly including field number, field description, field name, field alias, calculated field, data type, code value, code value source, whether to query, sort number, whether to display, column width, component type, whether it is the primary key, whether it is read-only, whether it is disabled, field prefix, field suffix, event button, field check, tab page name, folding panel name, and number of columns occupied; the button configuration table is used to configure the buttons displayed on the page and the behavior after the button is clicked, mainly including button number, button type, button size, button icon, button description, whether to display, action type, action source, action name, sort number, and event button information; the tree map configuration table is used to configure the tree map structure, mainly including tree map item number, tree map item description, list / details, template number, whether to expand, whether to select, and sort number information.
[0049] In one implementation, the list template, detail template configuration, and tree map template configuration include:
[0050] Step 1.1: List template or detail template configuration includes basic information configuration, table configuration, field configuration and button configuration; tree template configuration includes basic information configuration and tree structure configuration;
[0051] Step 1.2: The basic information configuration of the list template or detail template includes template number, description, field, pop-up box or routing page configuration. Field is only valid for detail template, indicating that several fields are displayed in one line on the detail page. Pop-up box or routing page is only valid for list template, indicating how to open the detail page on the list page. Pop-up box means opening the detail page in the form of pop-up box, and routing page means opening the detail page in the form of routing page.
[0052] Step 1.3: The table configuration of the list template or detail template includes the configuration of querying the main table and table alias, the configuration of querying the sub-table, table alias, join condition, filter (WHERE) condition, sorting and grouping for the joint table (supporting INNER JOIN, LEFT JOIN, and RIGHT JOIN);
[0053] Step 1.4: The list template field configuration includes field description, which indicates the header of the list; field name, which corresponds to the field of the database table; field alias, which maps the field; calculated field, which is a field that does not exist in the table and is obtained through calculation, and the field alias needs to be configured; data type, which is the data type corresponding to the field, and the page can be displayed accordingly according to its type, including text, integer, decimal, amount, date; code value, which indicates that this field needs to be transcoded; code value source, which is the key-value pair required for field transcoding; whether to query, which indicates that this field is used as a search condition for querying list data; sort number, which is the display order of the field in the list; whether to display, which is whether the field is displayed on the page; column width, which is the display width of the field on the list;
[0054] Step 1.5: The field configuration of the details template includes field description, which indicates the description of this field in the form; field name, which corresponds to the field in the database table; field alias, which maps the field and manages it in a unified manner; calculated field, which is a field that does not exist in the table and is obtained through calculation, and the field alias needs to be configured; component type, which indicates what component is used to render this field, including input box, multi-line input box, drop-down selection box, and tree selection box; data type, which is the data type corresponding to the field, and the page can be displayed accordingly according to its type, including text, integer, decimal, amount, and date; code value, which indicates that this field needs to be transcoded; code value source, which is the key-value pair required for field transcoding; sort number, which is the display order of the field in the list; whether to display, whether the field is displayed on the page; primary key, which indicates that this field is the unique identifier of this form, corresponding to the database Primary key; Read-only or not, configure the component corresponding to this field to be read-only; Disable or not, configure the component corresponding to this field to be disabled; Prefix, the fixed information displayed in front of this field, only valid for the input box, such as the international area code +86 for telephone is placed in front of the telephone field input box; Suffix, the fixed information displayed after this field, only valid for the input box, such as "@qq.com" for email, "yuan" for amount unit, and "%" for percentage is placed after the field input box; Event button, indicating that there is a button after this field or an event is bound (change event of drop-down box); Field test, configure the test information of this field; Tab page name, indicating that this field belongs to this tab page; Folding panel name, indicating that this field belongs to this folding panel; Number of columns occupied, set how many columns this field occupies;
[0055] Step 1.6: Button configuration includes button number, which uniquely identifies a button; button type, button size, button icon, which set the button style; button description, which sets the text displayed on the button; whether to display, whether this button is displayed on the page; action type, which is the type of operation performed after the button is clicked or the event is triggered, including JS-execute a function, INTERFACE-indicates calling an interface, VUE-indicates popping up a page; action source, which indicates which file the function exists in or which service the interface belongs to; action name, which indicates the function name or interface service name; sort number, which sets the display order of the button on the page; event button, which indicates that the button function belongs to a certain field, following the field, or a field event, such as change event;
[0056] Step 1.7: The list template includes the query button, add button, modify button, and delete button by default, and no configuration is required; the detail template includes the save button, reset button, and cancel button by default, and no configuration is required;
[0057] Step 1.8: The tree map template configuration includes tree map item description, which is the description information of a certain item in the tree map; list or details, whether this tree map item is displayed as a list or details; template number, which is the template of the list or details page; whether to expand, whether to expand this tree structure when opening the page; whether to select, whether to open the list or details page corresponding to this tree map item by default when opening the page; sort number, which is the arrangement order of the tree map.
[0058] In one implementation, in step 1.2, the details page opening method may be configured:
[0059] After selecting a data on the list page, you can enter the detail page by clicking the View / Modify button. There are generally two ways. When there are fewer fields, you can use a pop-up box to pop up a modal page to display detailed information. If there are more fields, you need to open a separate page to display. Set the opening method by configuring the pop-up box / routing page configuration item in step 1.2. The pop-up box means opening the detail page in a pop-up box, and the routing page means opening the detail page in a routing page.
[0060] In addition, in step 1.2, you can configure the details page to display several fields in one row:
[0061] The details page displays information in a form, and multiple fields can be displayed in one row. When the pop-up window appears, the page is not full screen, and two fields are displayed in one row. If it is a routing page, it will not be compact to display two fields in one row. In this case, three fields need to be displayed in one row. Through the column configuration in step 1.2, you can set how many fields are displayed in one row. After the configuration is completed, render the page again to take effect. Some components, such as multi-line input boxes, can occupy the positions of two or more fields or occupy a single row. Combined with the number of columns occupied in step 1.5, configure the display length of this field. A row of the details page is divided into 24 grids, and each field is arranged according to the number of grids occupied. In general, the number of columns occupied by the field is not configured, and the number of grids occupied by each field is divided equally according to the number of columns. If configured, it will be automatically adapted according to the configuration. For example, if 24 is configured, this field will occupy a single row. If 16 is configured and the column is 3, only 2 fields will be displayed in this row, and this field will occupy the position of two fields.
[0062] In one implementation, in step 1.4, the column width of the list page may be configured:
[0063] The list page displays data in a table format. By default, the width of each column is the same, but in reality, some columns display information that is short and blank, and some columns are long, so the information displayed in this column is incomplete and unreasonable. Set the width of a column through the column width configuration in step 1.4 to make the data display more reasonable.
[0064] In one implementation, in step 1.4 or 1.5, the field code value may be configured as follows:
[0065] Some information (such as gender M for male and F for female) is stored in the storage medium as code values. The converted value is displayed on the list page and displayed through a drop-down box on the details page. The code value key-value pair needs to be configured. There are three configuration methods: method 1, directly configure the key-value pair in JSON format; method 2, JavaScript file method, write the code value key-value pair into a JavaScript file and configure the file name; method 3, get it from the existing code value library and configure the value key.
[0066] In one implementation, in step 1.4, it is possible to configure whether the field is used as a search condition:
[0067] The data on the list page is displayed in a table. When there is too much data to fit on one page, it is usually displayed by paging query or by conditional search to filter out the data that meets the conditions. By configuring whether to query the field, you can set whether this field is used as a conditional search field, generate a search box, enter the search information, and click Query to search.
[0068] In one implementation, in step 1.5, the display mode of the details page may be configured:
[0069] The details page displays data through a form. Generally, all fields are displayed on one page without classification. In some cases, the information needs to be displayed by category, with several fields displayed in one category. Classify by configuring the tab page name and folding panel name in step 1.5, and then display the information in the form of tab pages and folding panels respectively. After the field is configured with tab page information, the fields belonging to the same tab page are displayed on one tab page. After the field is configured with folding panel information, the fields belonging to the same folding panel are displayed on one panel. The tab page name and the property panel name cannot be configured at the same time. If neither the tab page name nor the folding panel name is configured, all fields are displayed on the same page.
[0070] In one implementation, in step 1.6, the buttons on the configurable page may:
[0071] The button on the list page is to select a data, click the button, and then operate on this data. The button on the details page is to click the button to process the information on the current page. After configuring the button, the button will be displayed on the page in sorted order. If you don't want to display that button, just configure whether to display it to no. In step 1.6, the action type, action source, and action name configure the behavior after this button is clicked. There are three behaviors, namely executing a JavaScript function, calling an interface, and popping up a page, which are configured by the action type. When executing a JavaScript function, the action source indicates which JavaScript file this function is in, and the action name indicates the name of the executed function, and this function is used to execute the logic after the button is clicked; when calling the interface, the action source indicates which service provides the interface, and the action name indicates the interface identifier (transaction code or URL), and this interface completes the logic after the button is clicked; when a page pops up, the action source indicates the link to this page (page component).
[0072] In one implementation, in step 1.7, the list page has add, modify, and delete buttons by default, and the detail page has save, reset, and cancel buttons by default:
[0073] These default buttons do not need to be configured, are displayed by default, and the default logic is executed after the button is clicked. For the list page, after clicking the Add button, a detail page is opened (the opening method is a pop-up box or a route, which is determined by the template configuration), and the fields are all empty and can be modified; click the Modify button to open a detail page (the opening method is a pop-up box or a route, which is determined by the template configuration), and the field is the currently selected data, which can be modified; click the Delete button to pop up a confirmation dialog box, and after confirmation, the data deletion interface is called to delete the currently selected data. For the detail page, click the Save button to call the Data Save button to save the data of the current page in the storage medium; click the Reset button to restore the data of the current page to the state when the page was just opened. The Reset button only appears on the page that pops up when the Add button is clicked on the list page, and will not appear on the page that is opened on the route page; click the Cancel button to close the current pop-up box. The Cancel button only appears on the page that pops up when the Modify button is clicked on the list page, and will not appear on the page that is opened on the route page. These 6 buttons have fixed button numbers. You can configure these 6 buttons in the button configuration to change their default behaviors. For example, if you don't want a button to be displayed on the page, you can configure whether it is displayed as No. If you don't want a button to execute the default logic when it is clicked, you can configure its action type, action source, and action name.
[0074] In one implementation, in step 1.6, the details page may configure an event button:
[0075] Event buttons include buttons and events. Buttons indicate that this button follows a certain field. For example, if a field is read-only or disabled, it can only be assigned a value by clicking the button following the field and selecting a value from the pop-up box. Events indicate the event triggered after operating this field, such as the change event of the drop-down box. The behavior after the event is triggered is configured. The value of this configuration is a button number, indicating that the event button here is associated with the configured button, and then the action logic corresponding to that button completes the logic of the event button here.
[0076] In summary, the present invention adopts the above technical solution, and thus has the following beneficial effects:
[0077] 1. In page development, you only need to create a template configuration metadata table to configure the template and obtain the template metadata. Very little page code needs to be written.
[0078] 2. After configuring the template, the background maintains the template parameters and controls the page display, which greatly improves the efficiency of page rendering;
[0079] 3. After the template parameters are modified, they can be rendered in time after refreshing, shortening the development and debugging time;
[0080] 4. You can adjust the query conditions of the data to be displayed in the template configuration at any time to control the visibility of the data.
[0081] Embodiment 2
[0082] Based on the same inventive concept, this embodiment discloses a page rendering device based on template configuration, see Figure 2 ,include:
[0083] The template configuration module 201 is used to establish a template configuration metadata table to configure the template and obtain template metadata, wherein the template configuration metadata table includes a template configuration table, a template field table, a button configuration table and a tree map configuration table. The template configuration table is used to configure template information, including a template number. The template field table is used to configure displayed fields. The button configuration table is used to configure the button information displayed on the page and the behavior after the button is clicked. The tree map configuration table is used to configure the tree map structure information. The information configured in the template configuration table, the template field table, the button configuration table and the tree map configuration table constitutes the template metadata.
[0084] The menu information configuration module 202 is used to configure the menu information of the page to display data and the template number associated with the page;
[0085] The template configuration calling module 203 is used to call the corresponding template configuration metadata table and data query interface according to the template number associated with the page in response to the click operation of the menu;
[0086] The data query module 204 is used to query the template metadata corresponding to the template configuration metadata table according to the template number associated with the page through the data query interface, and generate a database operation SQL according to the template metadata, wherein the database operation SQL is used to return the data to be displayed, and then return the template metadata and the data to be displayed;
[0087] The page rendering module 205 is used to parse the template metadata using template parsing technology and generate a page according to the parsing result and the data to be displayed.
[0088] Since the device introduced in the second embodiment of the present invention is a device used to implement the page rendering method based on template configuration in the first embodiment of the present invention, based on the method introduced in the first embodiment of the present invention, the person skilled in the art can understand the specific structure and deformation of the device, so it is not repeated here. All devices used in the method in the first embodiment of the present invention belong to the scope of protection of the present invention.
[0089] Embodiment 3
[0090] Based on the same inventive concept, see Figure 3 This embodiment further provides a computer-readable storage medium 300 on which a computer program 311 is stored. When the program is executed by a processor, the method described in the first embodiment is implemented.
[0091] Since the computer-readable storage medium introduced in the third embodiment of the present invention is a computer-readable storage medium used to implement the page rendering method based on template configuration in the first embodiment of the present invention, based on the method introduced in the first embodiment of the present invention, those skilled in the art can understand the specific structure and deformation of the computer-readable storage medium, so it is not repeated here. All computer-readable storage media used in the method of the first embodiment of the present invention belong to the scope of protection of the present invention.
[0092] Embodiment 4
[0093] The present invention also provides a computer device, see Figure 4 , including a memory 401, a processor 402, and a computer program 403 stored in the memory and executable on the processor, wherein the processor implements the method described in the first embodiment when executing the program.
[0094] Since the computer device introduced in the fourth embodiment of the present invention is a computer device used to implement the page rendering method based on template configuration in the first embodiment of the present invention, based on the method introduced in the first embodiment of the present invention, the person skilled in the art can understand the specific structure and deformation of the computer device, so it is not repeated here. All computer devices used in the method of the first embodiment of the present invention belong to the scope of protection of the present invention.
[0095] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0096] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0097] Although preferred embodiments of the present invention have been described, additional changes and modifications may be made to these embodiments by those skilled in the art once the basic creative concepts are known. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention. Obviously, those skilled in the art may make various changes and modifications to the embodiments of the present invention without departing from the spirit and scope of the embodiments of the present invention. Thus, if these modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A page rendering method based on template configuration, characterized in that: include: A template configuration metadata table is established to configure the template and obtain template metadata, wherein the template configuration metadata table includes a template configuration table, a template field table, a button configuration table and a tree map configuration table. The template configuration table is used to configure template information, including a template number. The template field table is used to configure displayed fields. The button configuration table is used to configure button information displayed on the page and the behavior after the button is clicked. The tree map configuration table is used to configure tree map structure information. The information configured in the template configuration table, the template field table, the button configuration table and the tree map configuration table constitutes template metadata. Configure the menu information of the page where the data is to be displayed and the template number associated with the page; In response to a click operation on the menu, a corresponding template configuration metadata table and a data query interface are called according to the template number associated with the page; The template metadata corresponding to the template configuration metadata table is queried through the data query interface according to the template number associated with the page, and a database operation SQL is generated according to the template metadata, wherein the database operation SQL is used to return the data to be displayed, and then the template metadata and the data to be displayed are returned; Template parsing technology is used to parse the template metadata, and the page is generated according to the parsing results and the data to be displayed.
2. The page rendering method based on template configuration according to claim 1, characterized in that: The template information also includes the template description, the data table to be queried, the query conditions, whether it is a list template or a detail template, the fields, the pop-up box or the routing page configuration information; the displayed fields include the field number, field description, field name, field alias, calculated field, and data type; The button information displayed on the page includes button number, button type, button size, and button icon; The behavior after clicking the button includes whether to display, action type, action source, and action name; the tree structure information includes the tree item number, tree item description, list / details, template number, whether to expand, whether to select, and sort number information.
3. The page rendering method based on template configuration according to claim 2, characterized in that: When the template description is a details template, the method further includes: The configuration details page displays multiple fields in one row; Configure how to open the details page; Configure the display mode of the details page.
4. The page rendering method based on template configuration according to claim 3, characterized in that: Configure the display mode of the details page, including: Configure tab names and folding panel names for classification; The information of the detail page is displayed in the form of tabs and folding panels respectively.
5. The page rendering method based on template configuration as claimed in claim 3, characterized in that: The method further comprises: Configure the event button on the details page. The event button includes buttons and events. Button means that this button follows a certain field; event means the event triggered after operating this field.
6. The page rendering method based on template configuration according to claim 2, characterized in that: When the template is described as a list template, the method further comprises: Configure whether the field is used as a search condition.
7. The page rendering method based on template configuration according to claim 1, characterized in that: The method further includes: generating a button for adding, modifying, deleting, saving or customizing through a button configuration table configuration to implement operations on the displayed data.
8. A page rendering device based on template configuration, characterized in that: include: A template configuration module is used to establish a template configuration metadata table to configure the template and obtain template metadata, wherein the template configuration metadata table includes a template configuration table, a template field table, a button configuration table and a tree map configuration table. The template configuration table is used to configure template information, including a template number. The template field table is used to configure displayed fields. The button configuration table is used to configure the button information displayed on the page and the behavior after the button is clicked. The tree map configuration table is used to configure the tree map structure information. The information configured in the template configuration table, the template field table, the button configuration table and the tree map configuration table constitutes the template metadata; A menu information configuration module, used to configure the menu information of the page to display data and the template number associated with the page; The template configuration calling module is used to call the corresponding template configuration metadata table and data query interface according to the template number associated with the page in response to the click operation of the menu; The data query module is used to query the template metadata corresponding to the template configuration metadata table according to the template number associated with the page through the data query interface, and generate a database operation SQL according to the template metadata, wherein the database operation SQL is used to return the data to be displayed, and then return the template metadata and the data to be displayed; The page rendering module is used to parse the template metadata using template parsing technology and generate a page based on the parsing results and the data to be displayed.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the page rendering method based on template configuration as described in any one of claims 1 to 7 is implemented.
10. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the page rendering method based on template configuration as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Form page generation method and device
CN110222293A
Software development method and platform, electronic equipment and computer readable storage medium
CN114741079A
General page template development method and system based on database table structure
CN116755665A
Method and system for generating UI (User Interface) frame
CN118778959A
Page construction method, terminal, computer readable storage medium, and page construction device
US20190095085A1
Cited By
Interaction method of form data management platform and related device
CN121411643A