Front-end form generation method and system
By providing a visual form generation system on the front end, and using drag and drop and rendering engines to realize front-end page development, the problem of low development efficiency in the existing technology is solved, and the development efficiency and simplicity of page development is improved.
Patent Information
- Application Number
- CN202110341650.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-30
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-03-30
AI Technical Summary
In the prior art, front-end page development efficiency is low, and developers need to develop and process each page one by one, resulting in insufficient resources and insufficient efficiency.
Provide a front-end form generation method and system, by providing visual form pages on the front-end, adding controls and page layout using drag and drop, setting control properties and events, binding back-end interfaces, realizing front-end data interaction, and rendering The engine implements page rendering and publishing, and supports secondary development of controls and AJAX interaction.
It realizes the design of development pages through visual drag and drop, simplifies the front-end page development process, reduces duplicate work, improves development efficiency, allows non-programming users to operate, shifts the development focus to complex logic development, and overcomes the shortcomings of low development efficiency.
Smart Images

Figure CN114281323B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of front-end pages, and in particular relates to a front-end form generation method and system. Background Art
[0002] With the rapid development of the Internet, the various information needs of enterprises, governments and other organizations are increasing day by day, and the demand for front-end page development is increasing. It is necessary to develop corresponding front-end pages and back-end interfaces for different form submission contents. From design to release, the product needs to be designed by designers according to communication style drawings, but the relatively limited development resources of software companies and information departments are increasingly unable to meet these needs. Developers are under great work pressure and the company's business development is restricted.
[0003] In order to reduce the construction cost of information systems and improve software delivery efficiency, developers have made various attempts. For example, some developers have gradually provided some packaged front-end component libraries on the market. Common ones are Ant Design and Element. Developers can call them directly when developing front-end pages without having to write control styles from scratch, which greatly improves the development efficiency of front-end pages. However, these component libraries have limited capabilities. Developers still need to develop and process each page one by one. There is still a large lack of development resources and there is still a lack of efficiency. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide users with a front-end form generation method and system to overcome the defect of low development efficiency in the prior art.
[0005] A first aspect: A front-end form generation method, the method comprising:
[0006] Select the required business model from the back-end database; wherein the business model corresponds to a corresponding business process;
[0007] Providing a visual form page on the front end, wherein the visual form page includes a control library;
[0008] In the visual form page, add the required controls by dragging and dropping and perform page layout;
[0009] The control is set and associated with the business model; data interaction between the front-end and back-end is realized by binding the control to the business model field of the back-end interface; wherein the control setting includes setting the properties, events and data format of the control;
[0010] The rendering engine in the front end is then used to render and publish the page according to the settings; the result of the publishing is to output a link, and the authorized personnel fill in the corresponding form;
[0011] Data is transferred between the engine and the control through a one-way data flow, from the engine to the control through properties, and from the control to the engine through events;
[0012] On top of existing controls, perform secondary development to add specific properties or events and add them to the life cycle specified by the rendering engine;
[0013] This is achieved by adding JS code and CSS, and by assigning attributes and calling events, making these codes compatible with the control system.
[0014] As an optional implementation of the present application, each control runs independently on the engine without being coupled with other parts.
[0015] As an optional implementation of the present application, on the front end, controls need to communicate with each other in the form of adapters or interfaces, and all are aggregated to a unified interface of the parent component; the data to be displayed needs to interact with the back end via AJAX.
[0016] A second aspect: A front-end form generation system, the system comprising:
[0017] The interactive layer is used to provide a visual form page on the front end, wherein the visual form page includes a control library;
[0018] The application layer, including the form designer, is used to:
[0019] In the visual form page, add the required controls by dragging and dropping and perform page layout;
[0020] The control is set and associated with the business model; wherein the business model is obtained by selecting from the back-end database, and the business model corresponds to a corresponding business process; by binding the control to the business model field of the back-end interface, the data interaction between the front-end and the back-end is realized; wherein the control setting includes setting the control's properties, events and data format; the business process includes the corresponding approval process and processing logic;
[0021] A service layer, including a rendering engine, for rendering and publishing pages according to the settings through the rendering engine;
[0022] The result of the publication is to output a link, and the authorized personnel fill in the corresponding form;
[0023] Data is transferred between the engine and the control through a one-way data flow, from the engine to the control through properties, and from the control to the engine through events;
[0024] The service layer is also used to:
[0025] On top of the existing controls, secondary development is performed to add specific properties or events and add them to the life cycle specified by the rendering engine;
[0026] This is achieved by adding JS code and CSS, and by assigning attributes and calling events, making these codes compatible with the control system.
[0027] As an optional implementation of the present application, each control runs independently on the engine and is not coupled with other parts of the system.
[0028] As an optional implementation of the present application, on the front end, controls need to communicate with each other in the form of adapters or interfaces, and all are summarized in the unified interface of the parent component; the rendering engine renders the page according to the Schema defined in the form designer to drive the entire page data loading process, and control the control presentation and default behavior, as well as multi-level linkage operations.
[0029] The adoption of the above technical scheme has the following advantages: a front-end form generation method and system proposed in the present invention, by providing a visual form page on the front end, can directly design and develop the page through visual dragging, the implementation method is simple, and users who have received simple training can operate it, which can replace part of the work of front-end developers in programming and developing pages in the past. Front-end developers no longer need to reinvent the wheel, and can shift the focus of their work to the development and implementation of complex logic, thereby overcoming the defect of low development efficiency in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A flow chart of a front-end form generation method provided by an embodiment of the present invention;
[0031] Figure 2 A structural diagram of a front-end form generation system provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will be described in detail in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments described herein are only used for illustration and are not intended to limit the present invention. In the following description, in order to provide a thorough understanding of the present invention, a large number of specific details are set forth. However, it is obvious to those of ordinary skill in the art that these specific details do not need to be adopted to implement the present invention.
[0033] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by those skilled in the art to which the present invention belongs.
[0034] refer to Figure 1 As shown, a front-end form generation method, the method comprising:
[0035] S101, selecting a required business model from a backend database; wherein the business model corresponds to a corresponding business process.
[0036] Specifically, since the front end does not have a database, the back end serves as an external service support for the front end, and the external service support includes business model support and process engine support;
[0037] The database includes multiple business models, each of which includes corresponding fields; wherein the business process includes corresponding approval process, processing logic, etc.
[0038] S102, providing a visual form page on the front end, wherein the visual form page includes a control library.
[0039] Specifically, the control library includes basic controls, layout controls and business controls according to their classification; wherein each control is defined and developed according to a unified standard and is not pre-built.
[0040] S103, in the visual form page, add the required controls by dragging and dropping and perform page layout.
[0041] Specifically, the latest H5 drag technology and CSS3 technology are used, based on flex layout, to easily implement row and column layout. When dragging components, the outer layout components are automatically added to achieve automatic layout.
[0042] S104: Setting the control and associating it with the business model.
[0043] Specifically, by binding the control to the business model field of the back-end interface, data interaction between the front-end and the back-end is realized; wherein, the control setting includes setting the properties, events and data format of the control;
[0044] The properties of the control include the storage value, title, layout, validation rules of the component in the database, and the generation of a Schema in a specified format.
[0045] S105, rendering and publishing the page according to the settings through the rendering engine in the front end.
[0046] Specifically, the rendering engine renders the page according to the Schema defined in the form designer, drives the entire page data loading process, and controls component presentation and default behavior, as well as multi-level linkage operations;
[0047] The result of the publication is to output a link, and the authorized personnel fill in the corresponding form.
[0048] Furthermore, during communication, each control runs independently on the engine without being coupled with other parts, and the control can be expanded at any time according to business needs.
[0049] Specifically, on the front end, controls need to communicate with each other in the form of adapters or interfaces, all of which are aggregated to the unified interface of the parent control;
[0050] The data to be displayed needs to interact with the backend through AJAX;
[0051] Each control can obtain the properties of all controls on the entire page to facilitate communication.
[0052] Furthermore, the data interface requests data in accordance with the RESTful API format, and the data requested by the interface is a complete page MODEL. The rendering engine parses and displays the corresponding components. Each component has a corresponding unique UUid, which is convenient for multi-level linkage operations to query the corresponding component instance to fill in the corresponding default values. It can also filter out the specified fields in the filtering scenario. Edit component properties, notify through custom events, unify all editing behaviors, and make modifications controllable and traceable. In principle, the rendering engine and events are uncoupled and uninvolved with the components, and the components can be displayed separately. On the front end, developed through VUE, the communication between components can be done through Inject, injecting the Context of the rendering engine to obtain the global component instance, and obtaining the data call interface is also done through Inject.
[0053] When applied, "data" is transmitted between the engine and the control through a one-way data flow, from the engine to the control through properties, and from the control to the engine through events;
[0054] The engine centrally interacts with the backend through AJAX to manage the overall data of the page, including the main table data and the associated detail table data;
[0055] The component interacts with the backend through AJAX to manage its own related data, such as options, uploaded / downloaded files, etc. It should be noted that in this application, component and control have the same meaning.
[0056] Through the above solution, by providing a visual form page on the front end, the page design and development can be carried out directly through visual dragging. The front end is driven by events and presents the data obtained from the back end to the front end, so as to complete the WYSIWYG page development. The implementation method is simple and can be operated by users who have received simple training. It can replace part of the work of front-end developers in programming and developing pages in the past. Front-end developers do not need to reinvent the wheel and can shift the focus of their work to the development and implementation of complex logic, thereby overcoming the defect of low development efficiency in the existing technology.
[0057] Furthermore, in order to handle the needs in special scenarios and achieve high performance and scalability, based on the above solution, the method further includes:
[0058] On top of existing controls, secondary development is performed to add specific properties or events and add them to the life cycle specified by the rendering engine.
[0059] Specifically, special scenarios are met by adding JS code and CSS. For example, the JS code can be completely implemented by native code in the instantiation part, and finally a JS object is generated. Then, these codes are compatible with the control system through attribute assignment and event calling.
[0060] Reference Figure 2 As shown, an embodiment of the present invention further provides a front-end form generation system, the system comprising:
[0061] The interaction layer is used to provide a visual form page on the front end, wherein the visual form page includes a control library.
[0062] Specifically, the visual form page includes a PC / mobile form page and a PC / mobile list page;
[0063] During implementation, the control library is pre-built, and the controls in the control library are an independent and complete front-end UI control system formed in advance.
[0064] The application layer, including the form designer, is used to:
[0065] In the visual form page, add the required controls by dragging and dropping and perform page layout;
[0066] The control is set and associated with a business model; wherein the business model is obtained by selecting from a back-end database, and the business model corresponds to a corresponding business process; the business process includes a corresponding approval process and processing logic.
[0067] Specifically, the form designer includes an input control, a selection control, a sub-table control, and a layout control; it should be noted that this is only an example and is not intended to limit it;
[0068] The service layer includes a rendering engine, which is used to render and publish the page according to the settings through the rendering engine.
[0069] Specifically, the rendering engine renders the page according to the Schema defined in the form designer to drive the entire page data loading process and control the control presentation and default behavior, as well as multi-level linkage operations;
[0070] The final result is to output a standard JSON text format that describes the characteristics and properties of the component and is displayed by the rendering engine.
[0071] The rendering engine includes functions such as controls, canvas, properties and secondary development;
[0072] The secondary development is to carry out secondary development on the existing controls to add specific properties or events and add them to the life cycle specified by the rendering engine.
[0073] It should be noted that the system is deployed on the front end and also requires external service support, which comes from the back end, including business model support and process engine support.
[0074] During communication, each control runs independently on the engine and is not coupled with other parts of the system. Controls can be expanded at any time according to business needs.
[0075] Specifically, on the front end, controls need to communicate with each other in the form of adapters or interfaces, all of which are aggregated to the unified interface of the parent control;
[0076] The data to be displayed needs to interact with the backend through AJAX;
[0077] Each control can obtain the properties of all controls on the entire page to facilitate communication.
[0078] It should be noted that the above more detailed description can refer to the description in the method embodiment, which will not be repeated here.
[0079] Furthermore, the secondary development of the control requires three files: index-setting, index-design, and index-render, where index-setting is responsible for setting the properties of the component, listing all property settings, events, setting default values, and events, index-design is the display form of the component in the designer, and index-render is the display of the component in the running state. When using the designer to drag a component to the canvas, the designer may automatically add a row component or column component to the corresponding MODEL in the outer layer of the component, and rendering is to display the layout component. The running state will execute the logic added during the secondary development before submission, such as some operation logic executed before the form is submitted.
[0080] Through this system, we first build an independent and complete front-end UI component system, and integrate it into the visual page and form designer. Developers can complete WYSIWYG page development by visually dragging controls and adjusting the layout. Each control can be bound to the business model field of the back-end interface to achieve data interaction between the front-end and back-end. The front-end page implemented under this solution has powerful controls, rich layout, strong scalability, and is simple and easy to use.
[0081] Users who have received simple training can operate it, and it can replace part of the work of front-end developers in programming and developing pages. Front-end developers can shift their focus to the development and implementation of complex logic, thereby overcoming the defect of low development efficiency caused by the need for developers to develop and process each page one by one in the existing technology.
[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.
Claims
1. A front-end form generation method, characterized in that: The method comprises: Select the required business model in the back-end database; wherein the business model corresponds to a corresponding business process, and the business process includes a corresponding approval process and processing logic; Providing a visual form page on the front end, wherein the visual form page includes a control library; In the visual form page, add the required controls by dragging and dropping and perform page layout; The control is set and associated with the business model; data interaction between the front-end and back-end is realized by binding the control to the business model field of the back-end interface; wherein the control setting includes setting the properties, events and data format of the control; The rendering engine in the front end is then used to render and publish the page according to the settings; the result of the publishing is to output a link, and the authorized personnel fill in the corresponding form; Data is transferred between the engine and the control through a one-way data flow, from the engine to the control through properties, and from the control to the engine through events; On top of existing controls, perform secondary development to add specific properties or events and add them to the life cycle specified by the rendering engine; This is achieved by adding JS code and CSS, and by assigning attributes and calling events, making these codes compatible with the control system.
2. A front-end form generation method according to claim 1, characterized in that: Each control runs independently on the engine and is not coupled with other parts.
3. A front-end form generation method according to any one of claims 1 to 2, characterized in that: On the front end, controls need to communicate with each other in the form of adapters or interfaces, and all are aggregated to the unified interface of the parent component; the data to be displayed needs to interact with the back end through AJAX.
4. A front-end form generation system, characterized in that: The system comprises: The interactive layer is used to provide a visual form page on the front end, wherein the visual form page includes a control library; The application layer, including the form designer, is used to: In the visual form page, add the required controls by dragging and dropping and perform page layout; The control is set and associated with the business model; wherein the business model is obtained by selecting from the back-end database, and the business model corresponds to a corresponding business process; by binding the control to the business model field of the back-end interface, the data interaction between the front-end and the back-end is realized; wherein the control setting includes setting the control's properties, events and data format; the business process includes the corresponding approval process and processing logic; A service layer, including a rendering engine, for rendering and publishing pages according to the settings through the rendering engine; The result of the publication is to output a link, and the authorized personnel fill in the corresponding form; Data is transferred between the engine and the control through a one-way data flow, from the engine to the control through properties, and from the control to the engine through events; The service layer is also used to: On top of the existing controls, secondary development is performed to add specific properties or events and add them to the life cycle specified by the rendering engine; This is achieved by adding JS code and CSS, and by assigning attributes and calling events, making these codes compatible with the control system.
5. A front-end form generation system according to claim 4, characterized in that: Each control runs independently on the engine and is not coupled with other parts of the system.
6. A front-end form generation system according to claim 5, characterized in that: On the front end, controls need to communicate with each other in the form of adapters or interfaces, and all are summarized in the unified interface of the parent component; the rendering engine renders the page according to the Schema defined in the form designer to drive the entire page data loading process, and control the control presentation and default behavior, as well as multi-level linkage operations.
