Page dynamic list processing method and device, medium and product
By encapsulating the data information item data into HTML table format data and rendering with a preset template engine, the problem of re-encoding in the existing technology changes in the number of information items is solved, and automatic updates and efficient development are achieved.
Patent Information
- Application Number
- CN202411187316.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-03
AI Technical Summary
The prior art needs to recode when the number of display information items and description information changes, resulting in low code reuse, increasing coding workload, and reducing development efficiency.
By encapsulating the information item data into table format data in HTML structure, when displaying the page, use the preset template engine to render it to achieve dynamic display without modifying any code, which improves code reuse and reduces code Workload to improve development efficiency.
It realizes automatic update of list display data, improves code reuse and development efficiency, and reduces coding workload.
Smart Images

Figure CN119065665A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a page dynamic list processing method, device, medium and product. Background Art
[0002] In various software projects, descriptive information lists are often used to display detailed information of corresponding business entities. A common approach is to customize and develop corresponding detailed list information pages according to business needs, but this may face a lot of coding and adaptation problems for different screen sizes.
[0003] In the prior art, by using the el-descriptions component, responsive design is supported to adapt to different screen sizes, and the number of information items displayed in each row and a custom list style are supported.
[0004] However, when the number of information items to be displayed and the description information change, the existing technology still needs to be re-encoded, and the code reuse is low, thereby increasing the coding workload and reducing development efficiency. Summary of the invention
[0005] The embodiments of the present application provide a page dynamic list processing method, device, medium and product to achieve the effect of improving development efficiency.
[0006] In the first aspect, an embodiment of the present application provides a method for processing a dynamic list of a page, comprising: obtaining identification information of data to be processed, calling a data interface according to the identification information to obtain information item data of the data to be processed; configuring the information item data according to configuration requirement information to obtain configuration information; wherein the configuration information includes the attributes of each information item data and a parameter for the number of information items displayed in each row; traversing the information item data, grouping the information item data according to the parameter for the number of information items displayed in each row and the attributes of each information item data to obtain a two-dimensional data group; wherein the two-dimensional data group is used to store each row of information item data to be displayed; calling a hypertext markup language HTML structure in a preset template engine, and using table elements in the HTML structure to perform structured display of the two-dimensional data group to obtain tabular data; using the preset template engine to process the tabular data to complete the dynamic list rendering of the page.
[0007] In one possible implementation, a two-dimensional data group is structured and displayed using a table element in an HTML structure to obtain tabular data, including: using a table tag in an HTML structure to define a table; in the table tag, using a preset loop syntax to traverse the two-dimensional data group to generate table column attributes; using a col tag to define table columns according to the table column attributes; using a tbody tag in a tabel tag to define the body of the table; using a preset loop syntax in the tbody tag to traverse the two-dimensional data group to generate table row attributes; using a tr tag to define table rows according to the table row attributes; using a td tag in the tr tag to define table cells; traversing the two-dimensional data group and inputting each information item data into each cell to generate tabular data.
[0008] In a possible implementation, information item data is configured according to configuration requirements to obtain configuration information, including: generating a parameter for the number of information items displayed in each row in response to a user's selection and confirmation operation on each row of parameters; traversing all information item data of the data to be processed, and for any information item data, generating a single-row attribute of any information item data in response to a user's selection and confirmation operation on a single-row attribute state of any information item data; wherein the single-row attribute is used to indicate a single row of any information item data; and generating configuration information for the information item data in response to a user's application operation.
[0009] In a possible implementation, each information item data includes a description and a value; accordingly, before traversing the information item data and grouping the information item data according to a parameter for the number of information items displayed in each row and the attributes of each information item data to obtain a two-dimensional data group, it also includes: traversing all information item data of the data to be processed, and if there is any information item data whose single-row attribute is in a selected state, confirming the single-row attribute state of other information item data according to the parameter for the number of information items displayed in each row and the total number of all information item data; determining the number of cells occupied by the description of each information item data and the number of cells occupied by the value of each information item data according to the single-row attribute state of each information item data.
[0010] In a possible implementation, the preset template engine is a VUE-based template engine.
[0011] In a second aspect, an embodiment of the present application provides a device for processing a dynamic list of pages, comprising:
[0012] The data acquisition module is used to acquire identification information of the data to be processed, and to call the data interface according to the identification information to acquire information item data of the data to be processed.
[0013] The configuration information acquisition module is used to configure the information item data according to the configuration requirements to obtain the configuration information; wherein the configuration information includes the attributes of each information item data and the number of information items displayed in each row.
[0014] The grouping module is used to traverse the information item data and group the information item data according to the number parameter of information items displayed in each row and the attributes of each information item data to obtain a two-dimensional data group; wherein the two-dimensional data group is used to store each row of information item data to be displayed.
[0015] The tabular data generation module is used to call the hypertext markup language HTML structure in the preset template engine, and use table elements in the HTML structure to perform structured display on the two-dimensional data group to obtain tabular data.
[0016] The processing module is used to process the tabular data using a preset template engine to complete the dynamic list rendering of the page.
[0017] In a third aspect, an embodiment of the present application provides a computer device, including: a memory, a processor;
[0018] The memory stores computer-executable instructions;
[0019] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.
[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.
[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.
[0022] The page dynamic list processing method, device, medium and product provided in the embodiments of the present application encapsulate the information item data into tabular data in the HTML structure. When the web page needs to display the tabular data, dynamic display is achieved by calling the encapsulated tabular data and using a preset template engine for rendering. Automatic update of list display data can be achieved without modifying any code, thereby improving code reuse and thus improving development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0024] Figure 1 A schematic diagram of a scenario of a page dynamic list processing method provided in an embodiment of the present application;
[0025] Figure 2 A flowchart of a page dynamic list processing method provided in an embodiment of the present application;
[0026] Figure 3 A schematic diagram of the structure of a dynamic page list processing device provided in an embodiment of the present application;
[0027] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present application.
[0028] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0029] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0030] In order to clearly understand the technical solution of the present application, the solution of the prior art is first introduced in detail. With the popularity and promotion of the front-end and back-end separation software architecture model, many front-end development frameworks have emerged. In the software development process, front-end developers mainly focus on data display and interaction, and the data is provided by various back-end interfaces. In various software projects, description information lists are often used to display detailed information of corresponding business entities. A more common practice is to customize the development of corresponding detailed list information pages according to business needs, but this may face a lot of coding and adaptation problems with different screen sizes. If you want to adjust the number of information items displayed in each row, you need to re-encode. In the prior art, the network element view component ElementUI has launched the component el-descriptions for this type of scenario. It supports responsive design that can adapt to different screen sizes, and supports the configuration of the number of information items displayed per row and custom list styles. However, when the number of information items and description information to be displayed changes, re-encoding is still required, and the code reuse is low, thereby increasing the coding workload and reducing development efficiency.
[0031] In response to the above technical problems, the inventors thought of encapsulating the information item data into tabular data in an HTML structure and displaying it on the page. When using the tabular data, only a preset template engine needs to be used to render the tabular data to achieve dynamic display. There is no need to modify any code to achieve automatic update of the data displayed in list form, which improves code reuse, reduces coding workload, and thus improves development efficiency.
[0032] Based on the above creative findings, the inventor proposed the technical solution of the present application.
[0033] Figure 1 A schematic diagram of a scenario of a page dynamic list processing method provided in an embodiment of the present application, such as Figure 1 As shown, the specific application scenario of the present application includes: a receiving device 101, a processor 102 and a display device 103. It is understandable that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the object identification method. In other feasible implementations of the present application, the above architecture may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown may be implemented in hardware, software, or a combination of software and hardware.
[0034] In a specific implementation process, the receiving device 101 may be an input / output interface or a communication interface, which may obtain identification information of the data to be processed and call a data interface according to the identification information to obtain information item data of the data to be processed.
[0035] Processor 102 can configure the information item data according to the configuration requirements to obtain configuration information; traverse the information item data, group the information item data according to the parameter of the number of information items displayed in each row and the attributes of each information item data to obtain a two-dimensional data group; call the hypertext markup language HTML structure in the preset template engine, use table elements in the HTML structure to perform structured display of the two-dimensional data group to obtain tabular data; use the preset template engine to process the tabular data to complete the dynamic list rendering of the page.
[0036] The display device 103 may be used to output the rendered list and display it on the page.
[0037] The display device may also be a touch display screen, which is used to receive user instructions while displaying the above content to achieve operational interaction with the user.
[0038] It should be understood that the above-mentioned processor can be implemented by the processor reading instructions in the memory and executing the instructions, or it can be implemented by a chip circuit.
[0039] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. 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. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0040] Figure 2 The following is a flow chart of a page dynamic list processing method provided in an embodiment of the present application. Figure 2 As shown, the method includes:
[0041] S201: Acquire identification information of the data to be processed, and call a data interface according to the identification information to acquire information item data of the data to be processed.
[0042] The information item data of the data to be processed is stored in a database, and the database is connected to the computer device through a data interface.
[0043] Specifically, when it is necessary to dynamically generate or dynamically update a list displayed on a web page, all information item data of the data is acquired through a data interface by querying identification information such as a name and a number.
[0044] S202: configuring the information item data according to the configuration requirement information to obtain configuration information; wherein the configuration information includes the attributes of each information item data and the number of information items displayed in each row.
[0045] Among them, the configuration data may include the number of information items displayed in each row, the width of the information item description column, the content exceeds the display policy and other list style attributes, among which the information item description column width can be a specific pixel value or percentage, and the content exceeds the display policy can be selected to omit the display or wrap the display. When the content exceeds the display policy is selected as true, an ellipsis will be displayed after a row of content exceeds the cell, and the complete content will be displayed in the form of a floating box when the mouse hovers over the corresponding content. When the content exceeds the display policy is selected as false, the entire content will be wrapped and displayed.
[0046] Specifically, in response to the user selecting and configuring the information item data according to the configuration requirement information, the information item data to be displayed and other configuration information of the component are generated, including Sa1~Sa3:
[0047] Sa1: In response to the user's selection confirmation operation on the parameter of each row, a parameter of the number of information items displayed in each row is generated.
[0048] Sa2: Traverse all information item data of the data to be processed, and for any information item data, generate a single-line attribute of any information item data in response to the user's selection and confirmation operation on the single-line attribute state of any information item data; wherein the single-line attribute is used to indicate a single line of any information item data.
[0049] Sa3: In response to the user's application operation, generate configuration information of the information item data.
[0050] Exemplarily, if the parameter for the number of information items displayed per line is 2, the information item data to be displayed includes the unified social credit code, company name, legal representative, establishment date, registered capital and address information, where each information item data includes a description and the value content of the information item, and the address item is configured to occupy a separate line for display.
[0051] S203: traversing the information item data, grouping the information item data according to the number parameter of information items displayed in each row and the attributes of each information item data to obtain a two-dimensional data group; wherein the two-dimensional data group is used to store each row of information item data to be displayed.
[0052] Specifically, the list of information item data to be displayed is traversed and grouped, each group being each row of information item data to be displayed, and the grouping result is a two-dimensional data group.
[0053] For example, a two-dimensional data group is represented by dataGroup, and after grouping, dataGroup is:
[0054] [{label:'Unified social credit code', value:'xxx'},{label:'Company name',value:'xxx'}],
[0055] [{label:'Representative of the magic weapon',value:'xxx'},{label:'Date of establishment',value:'xxx'}],
[0056] [{label:'Registered capital',value:'xxx in RMB',colpsan:3}],
[0057] [{label:'Address',value:'xxx Province xxx City xxx District xxx Road xxx No.xxx',colpsan:3}]
[0058] Among them, colpsan indicates the number of cells that need to be merged. Each row displays 2 information item data. Each information item data includes 2 cells for description and value content. Therefore, 4 cells need to be displayed in each row. Since the address item is configured in the original data of the information item data and needs to be displayed in a separate row, the registered capital item also needs to be displayed in a separate row, and the value content of the registered capital item and address item is configured to occupy the width of 3 cells.
[0059] S204: calling a hypertext markup language HTML structure in a preset template engine, and using table elements in the HTML structure to perform structured display on the two-dimensional data group to obtain tabular data.
[0060] The preset template engine is based on HTML template syntax, which allows developers to declaratively bind the document object model DOM to the data of the underlying component instance. It has the characteristics of two-way binding. When the data referenced in the template changes, the corresponding attributes bound in the DOM will also be updated, that is, the corresponding data displayed on the page will also be updated.
[0061] Specifically, the preset template engine is a VUE-based template engine.
[0062] Specifically, a hypertext markup language HTML structure is called in a preset template engine, and data is filled in the HTML template. Accordingly, a table element is used in the HTML structure to display the two-dimensional data group in a structured manner to obtain tabular data, including Sb1 to Sb8:
[0063] Sb1: Use the table tag to define a table in the HTML structure.
[0064] Among them, the table tag is a markup language element used to display structured data.
[0065] Specifically, create a table tag and use the table tag to define the table frame.
[0066] Sb2: In the table tag, use the preset loop syntax to traverse the two-dimensional data set to generate the column attributes of the table.
[0067] The preset loop syntax may be a v-for syntax, which is used to traverse an array or an object and generate a corresponding number of elements.
[0068] Sb3: According to the column attributes of the table, use the col tag to define the columns of the table.
[0069] Exemplarily, the two-dimensional data group is traversed, and two information items are displayed in each row. Each information item includes two cells, and the constructed table should include 4 columns. In the table tag, two col tag elements are constructed in each row using the v-for syntax. Each col tag element contains two pieces of information. The first represents the description of the information item data, and the second represents the value of the information item. The number of v-for loops is the value of the parameter for the number of information items displayed in each row.
[0070] Sb4: Use the tbody tag within the tabel tag to define the body of the table.
[0071] The tbody tag is used to contain the main content of the table, that is, all rows and cells.
[0072] Sb5: Use the preset loop syntax in the tbody tag to iterate over the two-dimensional data set to generate the row attributes of the table.
[0073] Exemplarily, a preset loop syntax is used to traverse the two-dimensional data group in the main body content of the table, and according to the fact that the two-dimensional data group contains four rows of information item data, four row attributes are correspondingly defined in the tbody tag.
[0074] Sb6: According to the table row attributes, use the tr tag to define the table rows.
[0075] The tr tag is used to define the rows of the table.
[0076] Specifically, according to the obtained row attributes of the table, the tr tag is used to define the rows of the table.
[0077] Sb7: Use the td tag within the tr tag to define the table cells.
[0078] Specifically, in the tr tag, a preset loop syntax is used to construct a td tag. Each tr tag includes two td tags, the first one is used to display the description of the information item data, and the second one is used to display the value of the information item data. The number of loops is the number of data items in the corresponding group in the two-dimensional data group. In addition, the relevant attributes of the td tag are configured according to the user's configuration information, and the merged cell attribute is determined according to the value of colpsan in the two-dimensional data group.
[0079] Sb8: Traverse the two-dimensional data group and input each information item data into each cell to generate tabular data.
[0080] S205: Using a preset template engine to process the tabular data to complete page dynamic list rendering.
[0081] Among them, page dynamic list rendering refers to the process of presenting the content of the dynamic list on the web page.
[0082] Specifically, rendering involves converting data into HTML and displaying it in the browser. Dynamic rendering usually needs to be implemented using front-end technology so that the list content can be updated without refreshing the entire page.
[0083] In summary, by encapsulating the information item data into tabular data in the HTML structure, when the web page needs to display the tabular data, dynamic display is achieved by calling the encapsulated tabular data and using the preset template engine for rendering. The list display data can be automatically updated without modifying any code, which improves code reuse and thus improves development efficiency.
[0084] In another embodiment of the present application, each information item data includes a description and a value. Before grouping the information item data, it is also necessary to determine whether each information item data occupies a single line for display, specifically including:
[0085] S301: traverse all information item data of the data to be processed, and if a single-line attribute of any information item data is in a selected state, confirm the single-line attribute state of other information item data according to the information item data displayed in each line and the total number of all information item data.
[0086] Among them, the single-line attribute is in the selected state, which means that the information item data is displayed in a single line when displayed in the user interface.
[0087] Specifically, all information item data of the data to be processed are traversed and read, and each information item data is checked one by one to determine whether its single-line attribute is in the selected state. If the single-line attribute of the information item data is in the selected state, it is determined whether the single-line attribute state of other information item data needs to be adjusted according to the total number of all information item data.
[0088] S302: Determine the number of cells occupied by the description of each information item data and the number of cells occupied by the value of each information item data according to the single-row attribute state of each information item data.
[0089] Specifically, for information item data in a single-row attribute state, its description is set to occupy one cell, and the value of the information item data is set to occupy the remaining cells of the row.
[0090] By setting the single-row property of each information item data and the number of cells it occupies, the layout of the user interface can be adjusted to ensure that all information item data can be displayed correctly.
[0091] Figure 3 A schematic diagram of the structure of a page dynamic list processing device provided in an embodiment of the present application, such as Figure 3As shown, the page dynamic list processing device provided by this embodiment includes: a data acquisition module 301, a configuration information acquisition module 302, a grouping module 303, a table format data generation module 304 and a processing module 305.
[0092] The data acquisition module 301 is used to acquire identification information of the data to be processed, and call the data interface according to the identification information to acquire information item data of the data to be processed.
[0093] The configuration information acquisition module 302 is used to configure the information item data according to the configuration requirements to obtain configuration information; wherein the configuration information includes the attributes of each information item data and the number of information items displayed in each row.
[0094] The grouping module 303 is used to traverse the information item data and group the information item data according to the number parameter of information items displayed in each row and the attributes of each information item data to obtain a two-dimensional data group; wherein the two-dimensional data group is used to store each row of information item data to be displayed.
[0095] The tabular data generating module 304 is used to call the hypertext markup language HTML structure in the preset template engine, and use table elements in the HTML structure to perform structured display on the two-dimensional data group to obtain tabular data.
[0096] The processing module 305 is used to process the tabular data using a preset template engine to complete the dynamic list rendering of the page.
[0097] In one possible implementation, the tabular data generation module 304 is specifically used to define a table using a table tag in an HTML structure; in the table tag, use a preset loop syntax to traverse a two-dimensional data group to generate table column attributes; based on the table column attributes, use the col tag to define the table columns; use the tbody tag in the tabel tag to define the table body; use the preset loop syntax in the tbody tag to traverse the two-dimensional data group to generate table row attributes; based on the table row attributes, use the tr tag to define the table rows; use the td tag in the tr tag to define the table cells; traverse the two-dimensional data group, and input each information item data into each cell to generate tabular data.
[0098] In one possible implementation, the configuration information acquisition module 302 is specifically used to generate a parameter for the number of information items displayed in each row in response to the user's selection and confirmation operation on each row of parameters; traverse all information item data of the data to be processed, and for any information item data, generate a single-row attribute of any information item data in response to the user's selection and confirmation operation on the single-row attribute state of any information item data; wherein the single-row attribute is used to indicate a single row of any information item data; and generate configuration information of the information item data in response to the user's application operation.
[0099] In a possible implementation, the surface dynamic list processing device also includes an attribute determination module, which is used to traverse all information item data of the data to be processed. If there is any information item data whose single-line attribute is in a selected state, the single-line attribute state of other information item data is confirmed based on the parameter of the number of information items displayed in each row and the total number of all information item data; based on the single-line attribute state of each information item data, the number of cells occupied by the description of each information item data and the number of cells occupied by the value of each information item data are determined.
[0100] In a possible implementation, the preset template engine is a VUE-based template engine.
[0101] The page dynamic list processing device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.
[0102] Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 4 As shown, the computer device provided in this embodiment includes: at least one processor 401 and a memory 402. Optionally, the computer device also includes a communication component 403. The processor 401, the memory 402 and the communication component 403 are connected via a bus 404.
[0103] In a specific implementation process, at least one processor 401 executes the computer-executable instructions stored in the memory 402, so that at least one processor 401 executes the above method.
[0104] The specific implementation process of the processor 401 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0105] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.
[0106] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.
[0107] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0108] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0109] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0110] The above-mentioned 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, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0111] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0112] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0113] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0114] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0115] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0116] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0117] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A page dynamic list processing method, characterized in that: Applicable to computer equipment, including: Acquire identification information of the data to be processed, and call a data interface according to the identification information to acquire information item data of the data to be processed; The information item data is configured according to the configuration requirement information to obtain configuration information; wherein the configuration information includes the attributes of each information item data and the number of information items displayed in each row; Traversing the information item data, grouping the information item data according to the parameter of the number of information items to be displayed in each row and the attributes of each information item data, so as to obtain a two-dimensional data group; wherein the two-dimensional data group is used to store each row of information item data to be displayed; Calling a hypertext markup language HTML structure in a preset template engine, and using a table element in the HTML structure to perform a structured display on the two-dimensional data group to obtain tabular data; The tabular data is processed using the preset template engine to complete page dynamic list rendering.
2. The method according to claim 1, characterized in that The using of table elements in the HTML structure to perform structured display on the two-dimensional data group to obtain tabular data includes: Use the table tag to define a table in the HTML structure; In the table tag, the two-dimensional data set is traversed using a preset loop syntax to generate column attributes of the table; According to the column attributes of the table, the col tag is used to define the columns of the table; Use the tbody tag in the tabel tag to define the body of the table; Using the preset loop syntax in the tbody tag to traverse the two-dimensional data set to generate row attributes of the table; According to the row attributes of the table, the tr tag is used to define the rows of the table; Use the td tag in the tr tag to define the cell of the table; The two-dimensional data group is traversed, and each information item data is input into each cell to generate the tabular data.
3. The method according to claim 1, characterized in that The step of configuring the information item data according to the configuration requirements to obtain the configuration information includes: In response to the user's selection confirmation operation on each row of parameters, generating the parameter of the number of information items displayed in each row; Traversing all the information item data of the data to be processed, for any information item data, in response to the user's selection and confirmation operation on the single-line attribute state of the any information item data, generating a single-line attribute of the any information item data; wherein the single-line attribute is used to indicate that the any information item data has a single line; In response to the application operation of the user, configuration information of the information item data is generated.
4. The method according to claim 3, characterized in that Each information item data includes a description and a value; Accordingly, before traversing the information item data and grouping the information item data according to the parameter of the number of information items displayed in each row and the attribute of each information item data to obtain a two-dimensional data group, the method further includes: Traversing all the information item data of the data to be processed, if there is any information item data whose single-line attribute is in the selection state, confirming the single-line attribute state of other information item data according to the parameter of the number of information items displayed in each line and the total number of all the information item data; According to the single-row attribute status of each information item data, the number of cells occupied by the description of each information item data and the number of cells occupied by the value of each information item data are determined.
5. The method according to any one of claims 1 to 4, characterized in that: The preset template engine is a VUE-based template engine.
6. A page dynamic list processing device, characterized in that: Applicable to computer equipment, including: A data acquisition module, used to acquire identification information of the data to be processed, and call a data interface according to the identification information to acquire information item data of the data to be processed; A configuration information acquisition module, configured to configure the information item data according to configuration requirements to obtain configuration information; wherein the configuration information includes the attributes of each information item data and the number of information items displayed in each row; a grouping module, used for traversing the information item data, and grouping the information item data according to the parameter of the number of information items displayed in each row and the attribute of each information item data, so as to obtain a two-dimensional data group; wherein the two-dimensional data group is used for storing each row of information item data to be displayed; A tabular data generation module, used for calling a hypertext markup language HTML structure in a preset template engine, and using table elements in the HTML structure to perform structured display on the two-dimensional data group to obtain tabular data; The processing module is used to process the tabular data using the preset template engine to complete the dynamic list rendering of the page.
7. The device according to claim 6, characterized in that The tabular data generation module is specifically used to define a table using a table tag in the HTML structure; in the table tag, use a preset loop syntax to traverse the two-dimensional data group to generate column attributes of the table; according to the column attributes of the table, use a col tag to define the columns of the table; in the tabel tag, use a tbody tag to define the body of the table; in the tbody tag, use the preset loop syntax to traverse the two-dimensional data group to generate row attributes of the table; according to the row attributes of the table, use a tr tag to define the rows of the table; and in the tr tag, use a td tag to define the cells of the table; The two-dimensional data group is traversed, and each information item data is input into each cell to generate the tabular data.
8. A computer device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 5 when executed by a processor.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 5 when being executed by a processor.
