[go: up one dir, main page]

CN119783649B - Form generation method, device, electronic device and storage medium - Google Patents

Form generation method, device, electronic device and storage medium

Info

Publication number
CN119783649B
CN119783649B CN202510287672.3A CN202510287672A CN119783649B CN 119783649 B CN119783649 B CN 119783649B CN 202510287672 A CN202510287672 A CN 202510287672A CN 119783649 B CN119783649 B CN 119783649B
Authority
CN
China
Prior art keywords
component
hierarchical
data structure
infrastructure
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202510287672.3A
Other languages
Chinese (zh)
Other versions
CN119783649A (en
Inventor
袁成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Miniwan Technology Co ltd
Original Assignee
Shenzhen Miniwan Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Miniwan Technology Co ltd filed Critical Shenzhen Miniwan Technology Co ltd
Priority to CN202510287672.3A priority Critical patent/CN119783649B/en
Publication of CN119783649A publication Critical patent/CN119783649A/en
Application granted granted Critical
Publication of CN119783649B publication Critical patent/CN119783649B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Stored Programmes (AREA)

Abstract

The application provides a form generation method, a form generation device, electronic equipment and a storage medium. The form generation method comprises the steps of obtaining a form data structure, configuring corresponding component elements based on an infrastructure component contained in the form data structure, obtaining a hierarchical nesting relationship of the infrastructure component based on the form data structure, and performing form rendering processing according to the component elements corresponding to the infrastructure component and the hierarchical nesting relationship to generate a target form. The method and the device are used for improving the generation effect of the form data of the multi-level structure when the form data generates the electronic form.

Description

Form generation method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a form generating method, an apparatus, an electronic device, and a storage medium.
Background
An electronic form is an interface component on a digital device for collecting and processing user input information. Typically consists of a series of input fields including text boxes, check boxes, radio buttons, etc. The prior art typically generates libraries or frameworks by manually writing code, using forms, and automatically by low code/no code tools. Although the method supports the associated data, the method has limitation in dynamic hierarchical management, can not flexibly manage a multi-hierarchy structure, has single display mode and has poor generation effect of the electronic form.
Disclosure of Invention
An object of the present application is to provide a form generation method, apparatus, electronic device, and storage medium for improving generation effect when generating an electronic form from form data of a multi-level structure.
According to an aspect of an embodiment of the present application, there is provided a form generating method, including:
Acquiring a form data structure, and configuring corresponding component elements based on an infrastructure component contained in the form data structure;
acquiring a hierarchical nesting relationship of the basic structure component based on the form data structure;
and performing form rendering processing according to the component elements corresponding to the basic structure components and the hierarchical nested relation to generate a target form.
According to an aspect of an embodiment of the present application, there is provided a form generating apparatus including:
the component element configuration module is used for acquiring a form data structure and configuring corresponding component elements based on a basic structure component contained in the form data structure;
the nested relation acquisition module is used for acquiring the hierarchical nested relation of the basic structure component based on the form data structure;
And the form generation module is used for performing form rendering processing according to the component elements corresponding to the basic structure component and the hierarchical nested relation so as to generate a target form.
According to an aspect of an embodiment of the present application, there is provided an electronic device including:
The electronic device comprises one or more processors, and storage means for storing one or more programs that, when executed by the one or more processors, cause the electronic device to implement the methods provided in the various alternative implementations described above.
According to an aspect of embodiments of the present application, there is provided a computer program medium having computer readable instructions stored thereon, which when executed by a processor of a computer, cause the computer to perform the methods provided in the various alternative implementations described above.
According to an aspect of embodiments of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions are read from the computer-readable storage medium by a processor of a computer device, and executed by the processor, cause the computer device to perform the methods provided in the various alternative implementations described above.
In the embodiment of the application, the form data structure is obtained, corresponding component elements are configured based on the basic structure component contained in the form data structure, the hierarchical nested relation of the basic structure component is obtained based on the form data structure, the form rendering processing is carried out according to the component elements corresponding to the basic structure component and the hierarchical nested relation so as to generate the target form, the hierarchical nested relation can indicate the hierarchical relation among the basic structure components, form fields of different levels can be rendered according to the hierarchical nested relation, the expression form of the target form is further enriched, and the form data structure is dynamically managed by means of the form of the target form, so that the generation effect of the form data structure with the dynamic hierarchical relation after the target form is generated is improved to a certain extent.
Other features and advantages of the application will be apparent from the following detailed description, or may be learned by the practice of the application.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
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.
Fig. 1 shows a flowchart of a form generating method according to an embodiment of the present application.
Fig. 2 shows a schematic display diagram of a target form provided in this embodiment.
Fig. 3 shows a schematic structural diagram of a form generating apparatus according to an embodiment of the present application.
Fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many different forms and should not be construed as limited to the examples set forth herein, but rather, the exemplary embodiments are provided so that the description of the present application will be more complete and thorough, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The drawings are merely schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more example embodiments. In the following description, numerous specific details are provided to give a thorough understanding of example embodiments of the application. However, those skilled in the art will recognize that the aspects of the application may be practiced without one or more of the specific details, or with other methods, components, steps, etc. In other instances, well-known structures, methods, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the application.
Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
In the front-end form rendering mode, the format, type, and constraints of the data are defined by a Schema mode. The tree structure essentially consists of nested objects and arrays, each node representing a data field, and if the field is a complex object, nesting sub-attributes can be continued on the basis of the field to form a hierarchy.
Each field may be of a basic type (e.g., string, number type number) or of a complex type (e.g., object structure or data structure).
In the rendering process of the target form, the target form is an object structure, the form items of the target form are array structures or object structures, each form item is provided with other sub-items or sub-nodes, the root node of the target form is a father node of the tree structure, the form item is a sub-node of the tree structure, and the form item is used as a nested field to form a hierarchical relationship with the target form.
Fig. 1 shows a schematic flow chart of form generation provided in this embodiment. As shown in fig. 1, the method comprises the steps of:
S100, acquiring a form data structure, and configuring corresponding component elements based on an infrastructure component contained in the form data structure.
Form data structures are used to represent the structure of the form and the way the data of the content is organized. In this embodiment, the form data structure is a tree structure, and is used to define a hierarchical nested relationship between fields.
The form data structure defines the types of the various form fields, each type corresponding to an infrastructure component.
The types of the form item fields include a base type and a complex type. Basic types refer to the most basic data types that are typically used to store a single data value, rather than complex data structures or nested data, and are typically used to define the input format of a single form item, such as a text box, number, check box, etc. A complex type refers to complex structure or nested data having multiple children or multiple children, typically containing multiple base types or other types of fields, most commonly object data or array data.
The object structure is used for a group of key value pairs and is suitable for multi-field combination, and the array structure is used for storing a plurality of elements of the same type or different types and is suitable for dynamic lists, multi-options and the like.
The basic structure component ensures that the forms display reasonable structures on the user interface according to the layout of the form item fields of each type on the target forms.
The component element refers to a form layout form set according to the type of the form item field. Pull down selections, numbers, input boxes, time, color, switches, etc.
When component elements are allocated according to the types of form fields, component elements of the fields may be hierarchically configured according to the hierarchical nested relationship of the form data structure.
Illustratively, component elements of all of the same level form fields are placed at a first level, and component elements of other sub-items included in the form fields having nested attributes are placed at a second level.
The field values of other sub-items located in the second hierarchy are viewed by clicking or touching the component elements of the form item fields in the first hierarchy that have nested properties. The setting mode can dynamically render the form data structure with the hierarchical relation, can display form item fields with the nested relation according to the hierarchy on the user interface, and can reflect the hierarchical relation of the target form in visual effect.
S200, acquiring the hierarchical nested relation of the basic structure component based on the form data structure.
Specifically, the form data structure defines the type of each form field, and the nesting relationship between the infrastructure components according to the type of the form field. The hierarchical nesting relationship between infrastructure components depends on whether the form item fields have nesting properties.
Specifically, whether the form item field has a nested attribute is judged through the field type of the form item field, and if the form item field has the nested attribute, an infrastructure component with a hierarchical nested relationship is configured for the form item field.
The nesting attribute can be obtained according to the field type of the form item field, and if the field type of the form item field is defined as Array or Object in the form data structure, the form item field is described as a complex field, and a plurality of sub-items or sub-nodes are further included under the form field.
In the rendering process of the target form, the hierarchical nested relation refers to that the form data structure presents a parent-child relation on the data storage mechanism, namely a tree structure. This nested relationship can be extended in an infinite hierarchy, also known as an endless tree structure.
The target form is essentially a data structure of an object attribute, and includes a preset number of basic fields and a preset number of complex fields in the target form, where the complex fields may be object attributes or array attributes, and further, the form item fields of the array attributes may include subfields of the object attribute.
S300, performing form rendering processing according to the component elements corresponding to the infrastructure components and the hierarchical nested relation to generate a target form.
And recursively rendering the form data structure according to the component elements corresponding to the basic structure components and the hierarchical nested relation to generate a target form.
The target forms are displayed in a layering manner according to the layering nesting relationship, so that a user can intuitively know the father-son relationship and the structure of the data, and when the forms are displayed, proper layout can be performed according to the depth and the structure of the layering nesting.
In addition, display interfaces of different layouts may be configured according to the type of sub-fields included in the form item field having the hierarchical attribute.
In this embodiment, a form data structure is obtained, corresponding component elements are configured based on an infrastructure component included in the form data structure, a hierarchical nesting relationship of the infrastructure component is obtained based on the form data structure, a target form is obtained by recursively rendering according to the component elements and the hierarchical nesting relationship corresponding to the infrastructure component, the hierarchical nesting relationship can indicate the hierarchical relationship among the infrastructure components, form fields of different levels can be rendered according to the hierarchical nesting relationship, the expression forms of the target form are further enriched, the form data structure of the tree structure is managed by means of the form data structure of the target form, and the generation effect of the form data structure with dynamic hierarchical relationship after the target form is generated is improved to a certain extent.
Further, S100, obtaining a form data structure, configuring corresponding component elements based on an infrastructure component included in the form data structure, includes:
S110, analyzing the form data structure to obtain the structure type of the basic structure component.
S120, configuring corresponding component elements for the basic structure component according to the structure type.
Specifically, the form data structure is parsed, the field type of each form field is obtained, 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 infrastructure component.
Specifically, a structure type is defined as the underlying structure component belonging to an object type or array type.
And configuring corresponding component elements for the basic structure component according to the structure type.
Further, S120, configuring corresponding component elements for the infrastructure component according to the structure type, includes:
S1211, searching corresponding component elements in the base element library according to the data attribute of the structure type and the field type of the base structure component.
S1213, the component elements are configured as form components to the various field types of the infrastructure components.
Specifically, the data attribute according to the structure type is used to define the structure attribute 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.
For example, the subfields under the fields of the object type are array types, and the data attributes refer to attributes of each piece of data under the data type. The infrastructure component is a field type for each field.
[ Url ] represents an object type url field, string represents a field type of the field, i.e., the field type of the [ url ] field is a character string.
Further, S200, based on the form data structure, obtaining a hierarchical nesting relationship of the infrastructure component includes:
s210, defining a meta structure component based on the form data structure, wherein the meta structure component is used for defining the form item level when the form data structure forms a form.
S220, under the meta-structure component, acquiring the hierarchical nested relation of the basic structure component according to the hierarchical identifier carried by the basic structure component in the form data structure.
Specifically, the meta-structure component is configured to accept the nesting relationship of the infrastructure components to define the level of the form item when the form data structure forms a form.
The meta-structure component is capable of accepting the rendering of any structure component, including array structure components and object structure components.
And acquiring the hierarchical nested relation of the infrastructure components according to the hierarchical identifiers carried by the infrastructure components in the form data structure.
The hierarchy identification is used to define parent-child relationships between the fields corresponding to the infrastructure components. The hierarchy identification comprises a father node identification and a child node identification, and the hierarchy nesting relation of the infrastructure component is obtained according to the hierarchy identification.
Further, in S220, under the meta-structure component, after obtaining the hierarchical nested relationship of the infrastructure component according to the hierarchical identifier carried by the infrastructure component in the form data structure, the method further includes:
s221, defining a hierarchical nested relation among the infrastructure components according to the hierarchical identifications carried by the infrastructure components in the form data structure.
S223, under the meta-structure component, rendering multiple types of infrastructure components according to the hierarchical nested relationship.
Specifically, under the meta-structure component, each level of the form data structure is rendered until a termination condition without child nodes is reached.
And performing recursion rendering according to the hierarchical nested relation of the form data structure.
Further, S300, performing a form rendering process according to the component elements corresponding to the infrastructure components and the hierarchical nested relationship to generate a target form, including:
s310, obtaining the field type of the infrastructure component, and setting a dynamic updating mechanism of the field type and the field value.
In particular, the dynamic update mechanism refers to dynamically changing the type of the form item field or the rendering mode according to some condition or external event.
Further, according to the type change of the form item field, the verification rule of the form item field is dynamically adjusted. By way of example, changing the field type from a numeric field to a date field requires a different validation rule.
S320, setting a recursion component and recursively rendering the infrastructure component based on the hierarchical nested relationship to generate a target form with a hierarchical relationship of the form items.
Specifically, according to the hierarchical nested relation, a component corresponding to the structure type to which the hierarchy belongs is called to call the component itself for rendering the child nodes thereof.
The form interfaces of different levels may be different, and specifically determined according to the structure type corresponding to the field and the field type of the sub-field included in the field.
Specifically, the target form can be controlled to be displayed according to the second operation mode according to the form item field defined by the first hierarchy structural component as the initial display form of the target form.
By way of example, the target form displayed in the second manner presents fields defined by structural components of the second hierarchy.
The second operation mode may be a touch operation or a click operation on the form item field of the first hierarchy.
Fig. 2 shows a schematic display diagram of a target form provided in this embodiment. As shown in FIG. 2, the first hierarchy defines the form items, the operation items, and the field areas. The form item is used for displaying a form item field of the target form, and the field area is used for displaying a field value under the form item field.
The operation item is used for editing the field value of the field or the field area in the form item. Specifically, the operation items include editing, deleting, copying, and the like.
The second level defines the structural components corresponding to the [ picture list ] field under the target form.
It can be derived that the first hierarchy is in a hierarchy nested relationship with the second hierarchy.
Further, in S300, after performing the form rendering process according to the component elements corresponding to the infrastructure components and the hierarchical nested relationship to generate the target form, the method further includes:
s400, setting a control component, wherein the control component is used for triggering editing operation aiming at a target form.
S410, responding to a trigger instruction of the editing operation component, and executing editing operation aiming at the target form.
The control component is used for triggering editing operation aiming at the target form, and the editing instruction comprises functions of adding, deleting, checking and the like. The control component is used for configuring a target data structure, rendering the target data structure in a form of a table or a form, and rendering the array structure in the form of the table.
A field of a field attribute fliter is set in the target data structure, and is used for filtering service data stored in the target form. Further, a screening function is set to complete the editing operation of the service data.
Fig. 3 shows a schematic configuration diagram of the form generating apparatus provided in the present embodiment. As shown in fig. 3, the form generating apparatus includes:
The component element configuration module 31 is configured to obtain a form data structure, and configure corresponding component elements based on an infrastructure component included in the form data structure.
The nested relation obtaining module 32 is configured to obtain a hierarchical nested relation of the infrastructure component based on the form data structure.
The form generation module 33 is configured to perform a form rendering process according to the component elements corresponding to the infrastructure components and the hierarchical nested relationship to generate a target form.
Further, the component element configuration module 31 is configured to:
And analyzing the form data structure to obtain the structure type of the basic structure component.
And configuring corresponding component elements for the basic structure component according to the structure type.
Further, the component element configuration module 31 is configured to:
And searching corresponding component elements in the base element library according to the field type of the structure type and the field type of the base structure component.
The component elements are configured as form components to the various field types of the infrastructure components.
Further, the nested relationship acquisition module 32 is configured to:
based on the form data structure, a meta structure component is defined, which is used to define the form level when the form data structure forms a form.
And under the meta-structure component, acquiring the hierarchical nested relation of the basic structure component according to the hierarchical identifier carried by the basic structure component in the form data structure.
Further, the form generation device is further configured to:
And defining the hierarchical nested relation among the infrastructure components according to the hierarchical identifier carried by the infrastructure components in the form data structure.
Under the meta-structure component, multiple types of infrastructure components are rendered according to a hierarchical nested relationship.
Further, the form generation module 33 is configured to:
The field type of the infrastructure component is acquired, and a dynamic updating mechanism of the field type and the field value is set.
And setting a recursion component and recursively rendering the infrastructure component based on the hierarchical nested relation to generate a target form with a hierarchical relation of the form items.
Further, the form generation device is further configured to:
and setting a control component which is used for triggering editing operation aiming at the target form.
And responding to the trigger instruction of the editing operation component, and executing the editing operation aiming at the target form.
Fig. 4 shows a schematic structural diagram of the electronic device provided in the present embodiment. The electronic device 50 provided in the present embodiment is described below with reference to fig. 4. The electronic device 50 shown in fig. 4 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present application.
As shown in fig. 4, the electronic device 50 is embodied in the form of a general purpose computing device. The components of the electronic device 50 may include, but are not limited to, the at least one processing unit 510 described above, the at least one memory unit 520 described above, and a bus 530 that connects the various system components, including the memory unit 520 and the processing unit 510.
Wherein the storage unit stores program code that can be executed by the processing unit 510 such that the processing unit 510 performs the steps according to various exemplary embodiments of the present application described in the description of the exemplary methods described above in this specification. For example, the processing unit 510 may perform the various steps as shown in fig. 1.
The storage unit 520 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 5201 and/or cache memory unit 5202, and may further include Read Only Memory (ROM) 5203.
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 or some combination of which may include an implementation of a network environment.
Bus 530 may be 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.
The electronic device 50 may also communicate with one or more external devices 600 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 50, and/or any device (e.g., router, modem, etc.) that enables the electronic device 50 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 550. An input/output (I/O) interface 550 is connected to the display unit 540. Also, electronic device 50 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 560. As shown, network adapter 560 communicates with other modules of electronic device 50 over bus 530. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 50, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a mobile terminal, etc.) to perform the form generating method according to the embodiments of the present application.
In an exemplary embodiment of the present application, there is also provided a computer-readable storage medium having stored thereon computer-readable instructions, which when executed by a processor of a computer, cause the computer to perform the form generation method described in the method embodiment section above.
According to an embodiment of the present application, there is also provided a program product for implementing the method in the above method embodiment, which may employ a portable compact disc read only memory (CD-ROM) and comprise program code and may 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 may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ 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 can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of a readable storage medium include an electrical connection having 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind 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., connected via the Internet using an Internet service provider).
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods of the present application are depicted in the accompanying drawings in a particular order, this is not required to or suggested that the steps must be performed in this particular order or that all of the steps shown be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, comprising several instructions to cause a computing device (may be a personal computer, a mobile terminal, etc.) to perform the method according to the embodiments of the present application.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.

Claims (8)

1.一种表单生成方法,其特征在于,包括:1. A form generation method, comprising: 获取表单数据结构,基于所述表单数据结构包含的基础结构组件配置对应的组件元素;Obtaining a form data structure, and configuring corresponding component elements based on the infrastructure components contained in the form data structure; 基于所述表单数据结构,定义元结构组件,所述元结构组件用于定义所述表单数据结构形成表单时的表单项层级,以及承接不同类型的结构组件的渲染;Based on the form data structure, a meta-structure component is defined, wherein the meta-structure component is used to define a form item hierarchy when the form data structure forms a form, and to undertake rendering of different types of structure components; 在所述元结构组件下,根据所述表单数据结构中所述基础结构组件携带的层级标识,获取所述基础结构组件的层级嵌套关系;Under the meta-structure component, according to the hierarchical identifier carried by the basic structure component in the form data structure, obtaining the hierarchical nesting relationship of the basic structure component; 根据所述基础结构组件对应的组件元素以及所述层级嵌套关系,进行表单渲染处理以生成目标表单;Perform form rendering processing to generate a target form based on the component elements corresponding to the infrastructure components and the hierarchical nesting relationship; 其中,所述根据所述基础结构组件对应的组件元素以及所述层级嵌套关系,进行表单渲染处理以生成目标表单包括: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 with a hierarchical relationship in form items. The structure type of each level is called for rendering according to the hierarchical nesting relationship. The target form has different form interfaces at different levels. 2.根据权利要求1所述的表单生成方法,其特征在于,所述获取表单数据结构,基于所述表单数据结构包含的基础结构组件配置对应的组件元素,包括:2. The form generation method according to claim 1, wherein the step of obtaining the form data structure and configuring corresponding component elements based on the infrastructure components contained in the form data structure comprises: 对所述表单数据结构进行解析,获取基础结构组件的结构类型;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.根据权利要求2所述的表单生成方法,其特征在于,所述根据所述结构类型为所述基础结构组件配置对应的组件元素,包括:3. The form generation method according to claim 2, wherein configuring corresponding component elements for the infrastructure component according to the structure type comprises: 根据所述结构类型的字段类型以及所述基础结构组件的字段类型,在基础元件库中查找对应的组件元素;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.根据权利要求1所述的表单生成方法,其特征在于,在所述元结构组件下,根据所述表单数据结构中所述基础结构组件携带的层级标识,获取所述基础结构组件的层级嵌套关系之后,所述方法还包括:4. The form generation method according to claim 1, wherein, 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, the method further comprises: 根据所述表单数据结构中所述基础结构组件携带的层级标识,定义各个所述基础结构组件之间的层级嵌套关系;Defining a hierarchical nesting relationship between the infrastructure components according to the hierarchical identifiers carried by the infrastructure components in the form data structure; 在所述元结构组件下,根据所述层级嵌套关系渲染多种类型的所述基础结构组件。Under the meta-structure component, multiple types of the basic structure components are rendered according to the hierarchical nesting relationship. 5.根据权利要求1所述的表单生成方法,其特征在于,在所述根据所述基础结构组件对应的组件元素以及所述层级嵌套关系,进行表单渲染处理以生成目标表单之后,所述方法还包括:5. The form generation method according to claim 1, characterized in that after performing form rendering processing to generate a target form based on the component elements corresponding to the infrastructure components and the hierarchical nesting relationship, the method further comprises: 设置操控组件,所述操控组件用于触发针对所述目标表单的编辑操作;Setting a manipulation component, wherein the manipulation component is used to trigger an editing operation on the target form; 响应于所述编辑操作组件的触发指令,执行针对所述目标表单的编辑操作。In response to the triggering instruction of the editing operation component, an editing operation is performed on the target form. 6.一种表单生成装置,其特征在于,所述装置包括:6. A form generation device, characterized in that the device comprises: 组件元素配置模块,用于获取表单数据结构,基于所述表单数据结构包含的基础结构组件配置对应的组件元素;A component element configuration module is used to obtain a form data structure and configure corresponding component elements based on the infrastructure components contained in the form data structure; 嵌套关系获取模块,用于:Nested relationship acquisition module, used for: 基于所述表单数据结构,定义元结构组件,所述元结构组件用于定义所述表单数据结构形成表单时的表单项层级,以及承接不同类型的结构组件的渲染;Based on the form data structure, a meta-structure component is defined, wherein the meta-structure component is used to define a form item hierarchy when the form data structure forms a form, and to undertake rendering of different types of structure components; 在所述元结构组件下,根据所述表单数据结构中所述基础结构组件携带的层级标识,获取所述基础结构组件的层级嵌套关系;Under the meta-structure component, according to the hierarchical identifier carried by the basic structure component in the form data structure, obtaining the hierarchical nesting relationship of the basic structure component; 表单生成模块,用于根据所述基础结构组件对应的组件元素以及所述层级嵌套关系,进行表单渲染处理以生成目标表单;A form generation module for performing form rendering processing to generate a target form based on the component elements corresponding to the infrastructure components and the hierarchical nesting relationship; 其中,所述根据所述基础结构组件对应的组件元素以及所述层级嵌套关系,进行表单渲染处理以生成目标表单包括: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 with a hierarchical relationship in form items. The structure type of each level is called for rendering according to the hierarchical nesting relationship. The target form has different form interfaces at different levels. 7.一种电子设备,其特征在于,包括:7. An electronic device, comprising: 一个或多个处理器;one or more processors; 存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述电子设备实现如权利要求1至5中任一项所述的表单生成方法。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 according to any one of claims 1 to 5. 8.一种计算机可读存储介质,其特征在于,其上存储有计算机可读指令,当所述计算机可读指令被计算机的处理器执行时,使计算机执行权利要求1至5中任一项所述的表单生成方法。8. 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 generation method according to any one of claims 1 to 5.
CN202510287672.3A 2025-03-12 2025-03-12 Form generation method, device, electronic device and storage medium Active CN119783649B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202510287672.3A CN119783649B (en) 2025-03-12 2025-03-12 Form generation method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202510287672.3A CN119783649B (en) 2025-03-12 2025-03-12 Form generation method, device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN119783649A CN119783649A (en) 2025-04-08
CN119783649B true CN119783649B (en) 2025-08-29

Family

ID=95232648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202510287672.3A Active CN119783649B (en) 2025-03-12 2025-03-12 Form generation method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN119783649B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114968235A (en) * 2022-05-16 2022-08-30 中国空气动力研究与发展中心计算空气动力研究所 Page form generation method and device, computer equipment and storage medium
CN116627418A (en) * 2023-07-21 2023-08-22 之江实验室 Multi-level form interface visual generation method and device based on recursion algorithm

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11386263B2 (en) * 2020-06-12 2022-07-12 Servicenow, Inc. Automatic generation of form application
CN111459488B (en) * 2020-06-19 2020-09-18 嘉兴太美医疗科技有限公司 Form page rendering method, device and system and readable medium
CN116594614A (en) * 2022-02-07 2023-08-15 北京新氧科技有限公司 Multi-level form automatic generation method, system, equipment and storage medium
CN114841126A (en) * 2022-05-12 2022-08-02 招银云创信息技术有限公司 Form generation method, apparatus, device, storage medium and program product

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114968235A (en) * 2022-05-16 2022-08-30 中国空气动力研究与发展中心计算空气动力研究所 Page form generation method and device, computer equipment and storage medium
CN116627418A (en) * 2023-07-21 2023-08-22 之江实验室 Multi-level form interface visual generation method and device based on recursion algorithm

Also Published As

Publication number Publication date
CN119783649A (en) 2025-04-08

Similar Documents

Publication Publication Date Title
CN110502227B (en) Code complement method and device, storage medium and electronic equipment
US9361069B2 (en) Systems and methods for defining a simulated interactive web page
US20050132336A1 (en) Analyzing software performance data using hierarchical models of software structure
CN107357593A (en) Source code file construction method, device, electric terminal and readable storage medium storing program for executing
CN114020246A (en) Navigation caliper H5 page layout method, device, equipment and medium
CN114356964A (en) Data lineage construction method, device, storage medium and electronic device
CN110889013B (en) Data association method, device, server and storage medium based on XML
CN117453713A (en) SQL sentence generation method, device and storage medium for multi-type database
CN114997117A (en) Document editing method, device, terminal and non-transitory storage medium
JP2018005933A (en) Method and apparatus for managing system specification
CN116028062B (en) Target code generation method, NPU instruction display method and device
CN108388576B (en) Method and system for interactively generating map
WO2021129074A1 (en) Method and system for processing reference of variable in program code
CN111666100A (en) Software framework generation method and device, electronic equipment and storage medium
CN113094776B (en) Method and system for constructing visual component model data and electronic equipment
CN117850764B (en) Design modeling method and device based on integrated model driving architecture
CN119783649B (en) Form generation method, device, electronic device and storage medium
CN119226256A (en) Database visualization method, device, medium and electronic equipment
CN115525629A (en) Data processing method, data processing device, storage medium and electronic equipment
US20060005174A1 (en) Defining hierarchical structures with markup languages and reflection
US11921688B2 (en) Environment construction support device and environment construction support method
US20070153342A1 (en) Display and editing of documents described by schemas
JP2000250744A (en) Software requirement definition support device
Castroianni et al. Development of a Workflow Design Tool for the Scarabaeus Project
CN117407403A (en) Data update method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant