Form generation method and device, electronic equipment and storage medium
By obtaining and configuring form data structures, obtaining the hierarchical nested relationships of infrastructure components, and performing form rendering processing, the problem of poor generation of multi-level structure forms in the existing technology is solved, and flexible management and rich display are achieved.
Patent Information
- Application Number
- CN202510287672.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-03-12
AI Technical Summary
When the prior art generates multi-level electronic forms, dynamic hierarchical management is limited and the display method is single, resulting in poor generation results.
By obtaining the form data structure, configuring component elements, and obtaining the hierarchical nested relationships of the infrastructure components, performing form rendering to generate the target form. This method uses a tree structure to define the hierarchical relationship between fields, dynamically manages the form data structure, and enriches the form expression.
It realizes flexible management and dynamic display of multi-level structured form data, improves form generation effect, and can render form item fields at different levels according to hierarchical nested relationships.
Smart Images

Figure CN119783649A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a form generation method, device, electronic device and storage medium. Background Art
[0002] An electronic form is an interface component used on digital devices to collect and process user input information. It is usually composed of a series of input fields, including text boxes, check boxes, radio buttons, etc. In the prior art, it is generally generated by manually writing code, using form generation libraries or frameworks, and automatically generated by low-code / no-code tools. Although this method supports associated data, it has limitations in dynamic hierarchical management, cannot flexibly manage multi-level structures, and has a single display method, which performs poorly in the generation of electronic forms. Summary of the invention
[0003] One purpose of the present application is to provide a form generation method, device, electronic device and storage medium, which are used to improve the generation effect of electronic forms generated from multi-level structured form data.
[0004] According to one aspect of an embodiment of the present application, a form generation method is provided, including: Obtain a form data structure, and configure corresponding component elements based on the infrastructure components contained in the form data structure; Based on the form data structure, obtaining the hierarchical nesting relationship of the infrastructure components; According to the component elements corresponding to the infrastructure components and the hierarchical nesting relationship, form rendering processing is performed to generate a target form.
[0005] According to one aspect of an embodiment of the present application, a form generating device is provided, including: A component element configuration module, used to obtain a form data structure and configure corresponding component elements based on the infrastructure components contained in the form data structure; A nested relationship acquisition module, used to acquire the hierarchical nested relationship of the infrastructure components based on the form data structure; The form generation module is used to perform form rendering processing to generate a target form according to the component elements corresponding to the infrastructure components and the hierarchical nesting relationship.
[0006] According to one aspect of an embodiment of the present application, there is provided an electronic device, including: One or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the methods provided in the above-mentioned various optional implementations.
[0007] According to one aspect of an embodiment of the present application, a computer program medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the methods provided in the above-mentioned various optional implementations.
[0008] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above various optional implementations.
[0009] In an embodiment of the present application, a form data structure is obtained, component elements corresponding to the infrastructure component configuration contained in the form data structure are configured, and based on the form data structure, a hierarchical nested relationship of the infrastructure component is obtained, and form rendering processing is performed according to the component elements corresponding to the infrastructure component and the hierarchical nested relationship to generate a target form. The hierarchical nested relationship can indicate the hierarchical relationship between the infrastructure components, and form item fields of different levels can be rendered according to the hierarchical nested relationship, further enriching the expression form of the target form, and dynamically managing the form data structure with the help of the target form, which improves the generation effect of the form data structure with a dynamic hierarchical relationship after generating the target form to a certain extent.
[0010] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0011] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The above and other objects, features and advantages of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
[0013] Figure 1 A flow chart of a form generation method provided in an embodiment of the present application is shown.
[0014] Figure 2 A schematic diagram showing the display of the target form provided in this embodiment is shown.
[0015] Figure 3 A schematic diagram of the structure of a form generating device provided in an embodiment of the present application is shown.
[0016] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0017] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present application will be more comprehensive and complete and the concepts of the example embodiments will be fully conveyed to those skilled in the art. The accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0018] In addition, the described features, structures or characteristics may be combined in one or more example embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the example embodiments of the present application. However, those skilled in the art will appreciate that the technical solution of the present application may be practiced while omitting one or more of the specific details, or other methods, components, steps, etc. may be adopted. In other cases, known structures, methods, implementations or operations are not shown or described in detail to avoid obscuring the present application and making the various aspects of the present application obscure.
[0019] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0020] In the front-end form rendering mode, the format, type and constraints of the data are defined through the Schema mode. The tree structure is essentially composed of nested objects and arrays. Each node represents a data field. If the field is a complex object, sub-attributes can be nested on the basis of the field to form a hierarchical structure.
[0021] Each field can be a basic type (such as a string, a number) or a complex type (such as an object structure or a data structure).
[0022] During the rendering process of the target form, the target form itself is an object structure, and the form items of the target form are array structures or object structures, and each form item corresponds to other child items or child nodes. The root node of the target form is the parent node of the tree structure, and the form items are the child nodes of the tree structure. At this time, the form items are nested fields and form a hierarchical relationship with the target form.
[0023] Figure 1 FIG. 2 shows a schematic diagram of the process of generating a form provided in this embodiment. Figure 1As shown, the method comprises the following steps: S100, obtaining a form data structure, and configuring corresponding component elements based on the infrastructure components contained in the form data structure.
[0024] The form data structure is used to represent the data organization mode of the structure and content of the form. In this embodiment, the form data structure is a tree structure, which is used to define the hierarchical nesting relationship between fields.
[0025] The form data structure defines the types of each form item field, and each type corresponds to an infrastructure component.
[0026] The types of form item fields include basic types and complex types. Basic types refer to the most basic data types, which are usually used to store a single data value, rather than complex data structures or nested data. They are generally used to define the input format of a single form item, such as text boxes, numbers, check boxes, etc. Complex types refer to complex structures or nested data with multiple sub-items or multiple child nodes, generally containing multiple basic types or other types of fields, the most common of which are object data or array data.
[0027] Among them, the object structure is used for a set of key-value pairs and is suitable for multi-field combinations; the array structure is used to store multiple elements of the same or different types and is suitable for dynamic lists, multiple options, etc.
[0028] The infrastructure component ensures that the form displays a reasonable structure on the user interface based on the layout of each type of form item fields on the target form.
[0029] Component elements refer to the form layout format set according to the type of form item field, such as drop-down selection, number, input box, time, color, switch, etc.
[0030] When allocating component elements according to the type of the form item field, the component elements of the field may be hierarchically configured according to the hierarchical nesting relationship of the form data structure.
[0031] For example, all component elements of form item fields at the same level are placed at the first level, and component elements of other sub-items included in the form item field with nested attributes are placed at the second level.
[0032] By clicking or touching the component element of the form item field with nested attributes in the first level, you can view the field values of other sub-items in the second level. This setting method can dynamically render the form data structure with hierarchical relationships, and can also display the form item fields with nested relationships hierarchically on the user interface, visually reflecting the hierarchical relationship of the target form.
[0033] S200, based on the form data structure, obtain the hierarchical nesting relationship of the infrastructure components.
[0034] Specifically, the form data structure defines the type of each form item field, and the nesting relationship between the basic structure components according to the type of the form item field. The hierarchical nesting relationship between the basic structure components depends on whether the form item field has a nesting attribute.
[0035] Specifically, it is determined whether the form item field has a nested attribute according to the field type of the form item field. If the form item field has a nested attribute, a basic structure component with a hierarchical nested relationship is configured for the form item field.
[0036] The nested attribute can be derived according to the field type of the form item field. If the field type of the form item field is defined as Array or Object in the form data structure, it means that the form item field is a complex field, and the form field also includes multiple sub-items or sub-nodes.
[0037] In the rendering process of the target form, the hierarchical nesting relationship refers to the form data structure presenting a parent-child relationship in the data storage mechanism, that is, a tree structure. This nested relationship can be extended infinitely, also known as an infinite tree structure.
[0038] The target form is essentially a data structure of an object attribute, which includes a preset number of basic fields and a preset number of complex fields. These complex fields can be object attributes or array attributes. Furthermore, the form item fields of array attributes can include sub-fields of object attributes.
[0039] S300, performing form rendering processing to generate a target form according to the component elements and hierarchical nesting relationships corresponding to the infrastructure components.
[0040] According to the component elements corresponding to the infrastructure components and the hierarchical nesting relationship, the form data structure is recursively rendered to generate a target form.
[0041] The target form will be displayed hierarchically according to the hierarchical nesting relationship so that users can intuitively understand the parent-child relationship and structure of the data. When displaying such a form, appropriate layout can be made according to the depth and structure of the hierarchical nesting.
[0042] In addition, display interfaces with different layouts may be configured according to the types of subfields included in the form item field with hierarchical attributes.
[0043] In this embodiment, a form data structure is obtained, component elements corresponding to the infrastructure component configuration contained in the form data structure are obtained, and based on the form data structure, the hierarchical nesting relationship of the infrastructure components is obtained. According to the component elements corresponding to the infrastructure components and the hierarchical nesting relationship, recursive rendering is performed to obtain a target form. The hierarchical nesting relationship can indicate the hierarchical relationship between the infrastructure components, and form item fields at different levels can be rendered according to the hierarchical nesting relationship, further enriching the expression form of the target form. The tree-like form data structure is managed in the form of the target form, which improves the generation effect of the form data structure with a dynamic hierarchical relationship after generating the target form to a certain extent.
[0044] Further, S100, a form data structure is obtained, and corresponding component elements are configured based on the infrastructure components contained in the form data structure, including: S110, parsing the form data structure to obtain the structure type of the basic structure component.
[0045] S120, configuring corresponding component elements for the infrastructure component according to the structure type.
[0046] Specifically, the form data structure is parsed to obtain the field type of each form item field, and the structure type of the basic structure component is determined according to the field type. The structure type defines the attribute type of the basic structure component.
[0047] Specifically, the structure type is defined as the basic structure component belonging to the object type or array type.
[0048] Configure the corresponding component elements for the infrastructure components according to the structure type.
[0049] Further, S120, configuring corresponding component elements for the infrastructure component according to the structure type includes: S1211, according to the data attributes of the structure type and the field type of the basic structure component, search for the corresponding component element in the basic component library.
[0050] S1213, configure the component element as a form item component to each field type of the infrastructure component.
[0051] Specifically, the data attributes of the structure type are used to define the structure attributes of the structure type. The field type is used to define the data type of each field under the structure type and define the layout of the field on the target form.
[0052] For example, the subfields under the object type field are of array type, and the data attribute refers to the attribute of each data under the data type. The infrastructure component is the field type of each field.
[0053] [url] represents the url field under the object type, and string represents the field type of the field, that is, the field type of the [url] field is string.
[0054] Further, S200, based on the form data structure, obtain the hierarchical nesting relationship of the infrastructure components, including: S210, based on the form data structure, define a meta structure component, the meta structure component is used to define the form item hierarchy when the form data structure forms a form.
[0055] S220, under the meta-structure component, according to the hierarchical identifier carried by the infrastructure component in the form data structure, obtain the hierarchical nesting relationship of the infrastructure component.
[0056] Specifically, the meta-structure component is used to undertake the nested relationship of each basic structure component to define the form item hierarchy when the form data structure forms a form.
[0057] The meta-structure component can take over the rendering of any structure component, including array structure components and object structure components.
[0058] According to the hierarchical identifiers carried by each infrastructure component in the form data structure, the hierarchical nesting relationship of the infrastructure components is obtained.
[0059] The hierarchical identifier is used to define the parent-child relationship between the fields corresponding to each infrastructure component. The hierarchical identifier includes the parent node identifier and the child node identifier, and the hierarchical nesting relationship of the infrastructure component is obtained according to the hierarchical identifier.
[0060] Further, in S220, under the meta-structure component, after obtaining the hierarchical nesting relationship of the basic structure component according to the hierarchical identifier carried by the basic structure component in the form data structure, it also includes: S221, defining the hierarchical nesting relationship between the infrastructure components according to the hierarchical identifiers carried by the infrastructure components in the form data structure.
[0061] S223, under the meta-structure component, render various types of infrastructure components according to the hierarchical nesting relationship.
[0062] Specifically, under the meta-structure component, each level of the form data structure is rendered until a termination condition of no child nodes is reached.
[0063] That is, according to the hierarchical nesting relationship of the form data structure, recursive rendering is performed according to the hierarchical nesting relationship.
[0064] Further, S300, performing form rendering processing to generate a target form according to the component elements and hierarchical nesting relationships corresponding to the infrastructure components, including: S310, obtaining the field type of the infrastructure component, and setting a dynamic update mechanism for the field type and field value.
[0065] Specifically, the dynamic update mechanism refers to dynamically changing the type or rendering method of the form item field according to some conditions or external events.
[0066] Furthermore, the validation rules of the form item fields are dynamically adjusted according to the type of the form item fields. For example, changing the field type from a numeric field to a date field requires different validation rules.
[0067] S320, setting a recursive component and recursively rendering the basic structure component based on the hierarchical nesting relationship to generate a target form with form items having a hierarchical relationship.
[0068] Specifically, according to the hierarchical nesting relationship, calling the component corresponding to the structural type to which the hierarchy belongs calls the component itself to render its child nodes.
[0069] The form interfaces at different levels may be different, depending on the structure type corresponding to the field and the field type of the subfields contained in the field.
[0070] Specifically, the form item fields defined according to the first-level structural components may be used as the initial display form of the target form, and the target form may be controlled to be displayed in the second manner through the second operation mode.
[0071] For example, the target form displayed in the second manner presents the fields defined by the second-level structural component.
[0072] The second operation mode may be a touch operation or a click operation on the form item field of the first level.
[0073] Figure 2 FIG. 2 shows a schematic diagram of displaying the target form provided by this embodiment. Figure 2 As shown in the figure, the first level defines form items, operation items, and field areas. Form items are used to display the form item fields of the target form, and field areas are used to display the field values under the form item fields.
[0074] Operation items are used to edit fields in a form item or field values in a field area. Specifically, operation items include edit, delete, copy, etc.
[0075] The second level defines the structural components corresponding to the [Image List] field under the target form.
[0076] It can be concluded that the first level and the second level are in a hierarchical nested relationship.
[0077] Further, in S300, after performing form rendering processing to generate a target form according to the component elements and the hierarchical nesting relationship corresponding to the infrastructure component, the method further includes: S400: Setting a manipulation component, where the manipulation component is used to trigger an editing operation on a target form.
[0078] S410, in response to a trigger instruction of the editing operation component, executing an editing operation on a target form.
[0079] The manipulation component is used to trigger the editing operation on the target form. The editing instructions include adding, deleting, modifying and checking. The target data structure is configured based on the manipulation component. The form data structure is rendered in the form of a table or form; the array structure is rendered in the form of a table.
[0080] A field with a field attribute filter is set in the target data structure, and the field is used to filter the business data stored in the target form. Further, a filtering function is set to complete the editing operation of the business data.
[0081] Figure 3 FIG. 4 shows a schematic diagram of the structure of the form generation device provided in this embodiment. Figure 3 As shown, the form generating device includes: The component element configuration module 31 is used to obtain the form data structure and configure the corresponding component elements based on the basic structure components contained in the form data structure.
[0082] The nested relationship acquisition module 32 is used to acquire the hierarchical nested relationship of the basic structure components based on the form data structure.
[0083] The form generation module 33 is used to perform form rendering processing to generate a target form according to the component elements and hierarchical nesting relationships corresponding to the infrastructure components.
[0084] Furthermore, the component element configuration module 31 is configured as follows: Parse the form data structure and obtain the structure type of the basic structure component.
[0085] Configure the corresponding component elements for the infrastructure components according to the structure type.
[0086] Furthermore, the component element configuration module 31 is configured as follows: According to the field type of the structure type and the field type of the basic structure component, the corresponding component element is found in the basic component library.
[0087] Configure component elements as form item components to various field types of infrastructure components.
[0088] Furthermore, the nested relationship acquisition module 32 is configured as follows: Based on the form data structure, a meta-structure component is defined, and the meta-structure component is used to define the form item hierarchy when the form data structure forms a form.
[0089] Under the meta-structure component, the hierarchical nesting relationship of the infrastructure component is obtained according to the hierarchical identifier carried by the infrastructure component in the form data structure.
[0090] Furthermore, the form generating device is also configured to: According to the hierarchical identifiers carried by the infrastructure components in the form data structure, the hierarchical nesting relationship between the infrastructure components is defined.
[0091] Under the meta-structure component, various types of infrastructure components are rendered according to the hierarchical nesting relationship.
[0092] Furthermore, the form generation module 33 is configured to: Get the field type of the infrastructure component and set the dynamic update mechanism of the field type and field value.
[0093] Set up recursive components and recursively render infrastructure components based on hierarchical nesting relationships to generate a target form with hierarchical relationships between form items.
[0094] Furthermore, the form generating device is also configured to: Set the manipulation component, which is used to trigger the editing operation on the target form.
[0095] In response to the trigger instruction of the editing operation component, the editing operation on the target form is performed.
[0096] Figure 4 The schematic diagram of the structure of the electronic device provided by this embodiment is shown below. Figure 4 The electronic device 50 provided in this embodiment is described. Figure 4 The electronic device 50 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0097] like Figure 4 As shown, the electronic device 50 is in the form of a general computing device. The components of the electronic device 50 may include but are not limited to: at least one processing unit 510, at least one storage unit 520, and a bus 530 connecting different system components (including the storage unit 520 and the processing unit 510).
[0098] The storage unit stores program codes, which can be executed by the processing unit 510, so that the processing unit 510 executes the steps according to various exemplary embodiments of the present application described in the description of the exemplary method described above in this specification. For example, the processing unit 510 can execute the following steps: Figure 1 The steps shown in .
[0099] The storage unit 520 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 5201 and / or a cache storage unit 5202 , and may further include a read-only storage unit (ROM) 5203 .
[0100] The storage unit 520 may also include a program / utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0101] Bus 530 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0102] The electronic device 50 may also communicate with one or more external devices 600 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 50, and / or communicate with any device that enables the electronic device 50 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 550. The input / output (I / O) interface 550 is connected to a display unit 540. In addition, the electronic device 50 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 560. As shown, the network adapter 560 communicates with other modules of the electronic device 50 via a bus 530. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 50, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0103] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a mobile terminal, etc.) to execute the form generation method according to the implementation method of the present application.
[0104] In an exemplary embodiment of the present application, a computer-readable storage medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the form generation method described in the above method embodiment.
[0105] According to one embodiment of the present application, a program product for implementing the method in the above method embodiment is also provided, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0106] The program product may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0107] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0108] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0109] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages, such as JAVA, C++, etc., and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0110] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0111] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0112] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a mobile terminal, etc.) to execute the method according to the implementation method of the present application.
[0113] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the appended claims.
Claims
1. A form generation method, characterized in that: include: Obtain a form data structure, and configure corresponding component elements based on the infrastructure components contained in the form data structure; Based on the form data structure, obtaining the hierarchical nesting relationship of the infrastructure components; According to the component elements corresponding to the infrastructure components and the hierarchical nesting relationship, form rendering processing is performed to generate a target form.
2. The form generation method according to claim 1, characterized in that: The obtaining of the form data structure, and configuring corresponding component elements based on the infrastructure components contained in the form data structure, include: Parsing the form data structure to obtain the structure type of the infrastructure component; The corresponding component elements are configured for the infrastructure component according to the structure type.
3. The form generation method according to claim 2, characterized in that: The configuring corresponding component elements for the infrastructure component according to the structure type includes: According to the field type of the structure type and the field type of the basic structure component, searching for a corresponding component element in the basic component library; The component element is configured as a form item component to each field type of the infrastructure component.
4. The form generation method according to claim 1, characterized in that: The step of obtaining the hierarchical nesting relationship of the infrastructure components based on the form data structure includes: Based on the form data structure, a meta structure component is defined, where the meta structure component is used to define a form item hierarchy when the form data structure forms a form; Under the meta-structure component, the hierarchical nesting relationship of the basic structure component is obtained according to the hierarchical identifier carried by the basic structure component in the form data structure.
5. The form generation method according to claim 4, characterized in that: Under the meta-structure component, after obtaining the hierarchical nesting relationship of the infrastructure component according to the hierarchical identifier carried by the infrastructure component in the form data structure, the method further includes: According to the hierarchical identifiers carried by the infrastructure components in the form data structure, defining the hierarchical nesting relationship between the infrastructure components; Under the meta-structure component, multiple types of the basic structure components are rendered according to the hierarchical nesting relationship.
6. The form generation method according to claim 1, characterized in that: The performing form rendering processing to generate a target form according to the component elements corresponding to the infrastructure components and the hierarchical nesting relationship includes: Obtaining the field type of the infrastructure component, and setting a dynamic update mechanism for the field type and field value; A recursive component is set and based on the hierarchical nesting relationship, the basic structure component is recursively rendered to generate a target form in which form items have a hierarchical relationship.
7. The form generation method according to claim 1, characterized in that: After performing form rendering processing to generate a target form according to the component elements corresponding to the infrastructure components and the hierarchical nesting relationship, the method further includes: Setting a manipulation component, wherein the manipulation component is used to trigger an editing operation on the target form; In response to the trigger instruction of the editing operation component, the editing operation on the target form is performed.
8. A form generating device, characterized in that: The device comprises: A component element configuration module, used to obtain a form data structure and configure corresponding component elements based on the infrastructure components contained in the form data structure; A nested relationship acquisition module, used to acquire the hierarchical nested relationship of the infrastructure components based on the form data structure; The form generation module is used to perform form rendering processing to generate a target form according to the component elements corresponding to the infrastructure components and the hierarchical nesting relationship.
9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the form generation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the form generating method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Form page rendering method, device and system, and readable medium
CN111459488A
Form generation method and device, equipment, storage medium and program product
CN114841126A
Page form generation method and device, computer equipment and storage medium
CN114968235A
Multi-level form automatic generation method, system and device and storage medium
CN116594614A
Multi-level form interface visualization generation method and device based on recursive algorithm
CN116627418A