A form creation method and device based on JSON structure
Through the form creation method based on JSON structure, users can dynamically generate component models and view models by selecting form templates, data entity models and field information, solving the problem of difficult user operations, and achieving a simplified form creation process and an improved user experience.
Patent Information
- Application Number
- CN202110983930.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-25
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2041-08-25
AI Technical Summary
In the prior art, there are problems such as difficult and inconvenient use when a user operates the JSON structure of a form.
Provides a form creation method based on JSON structure, and dynamically generates component models and view models by selecting form templates, data entity models and field information to complete form creation.
It reduces the difficulty of user operations, simplifies the form creation process, and improves the user experience and usage threshold.
Smart Images

Figure CN113760287B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of form creation, and more particularly to a form creation method and device based on a JSON structure. Background Art
[0002] During the development of software products, they should be developed according to customer needs. With the popularization of Internet technology, most companies will use forms such as automated office and approval flow. However, each company has different needs for forms, and different forms must be used to handle different events. This requires configuration to generate different forms. Therefore, customers need to customize the content of the form JSON according to different scenarios.
[0003] In the prior art, directly exposing the JSON structure of the form to the front-end customer requires manpower and material resources to provide basic skills training to the customer, but there are still a lot of problems from the customer's understanding, operation, and skills, which makes the product difficult to operate and is not conducive to user use. Summary of the invention
[0004] One or more embodiments of the present specification provide a form creation method and device based on a JSON structure, which are used to solve the following technical problems: the prior art has the problem that user operation is difficult and inconvenient for users to use.
[0005] One or more embodiments of this specification adopt the following technical solutions:
[0006] One or more embodiments of the present specification provide a form creation method based on a JSON structure, the method comprising: selecting a corresponding form template according to the usage type of the form, wherein the form template is described using a JSON structure, and the JSON structure of the form template comprises: a data entity model, a component model, and a view model; selecting a corresponding form data entity model according to the usage scenario of the form, wherein the form data entity model comprises field information; selecting the field information displayed by the form according to the usage scenario, so as to determine the component model and the view model corresponding to the form, and completing the form creation according to the component model and the view model corresponding to the form.
[0007] Furthermore, before selecting the corresponding form template according to the form usage type, the method also includes: presetting multiple types of form templates, wherein the types of form templates include one or more of a list interface template, a dual list interface template, a card interface template, a left list and right card interface template, a tree table interface template, a left tree and right card interface template, a left tree and right list interface template, a batch editing list interface template, a wizard interface template, and a scroll positioning card interface template.
[0008] Furthermore, the selecting a corresponding form data entity model according to the usage scenario of the form specifically includes: selecting a database table corresponding to the form according to the usage scenario of the form; converting the database table into the corresponding form data entity model in advance, so as to select the form data entity model corresponding to the database table according to the database table selected by the user.
[0009] Furthermore, the field information includes: the field type and the form control type corresponding to the field; the field information in the form data entity model selected for form display according to the usage scenario specifically includes: selecting the field to be displayed according to the usage scenario of the form; determining the form control type of the form according to the field information of the field to be displayed, and generating the corresponding control JSON structure.
[0010] Furthermore, the form control type of the form is determined according to the field type of the field to be displayed, and a corresponding control JSON structure is generated, specifically including: when the field type of the field to be displayed selected by the user is a numeric type, the form control type of the form is determined to be a numeric control type, and a corresponding numeric control JSON structure is generated.
[0011] Furthermore, determining the component model and view model corresponding to the form specifically includes: dividing the form into at least one component area according to the type of form template corresponding to the form, the component area including one or more of a list area, a card area and a table area; defining each of the component areas as a corresponding component model and view model, wherein the component model and the view model are in a one-to-one mapping relationship; setting the control JSON structure in the component model, and recording the field information in the corresponding view model.
[0012] Furthermore, the JSON structure of the form template also includes a state machine model for controlling the state switching when the form is running, wherein the state of the form when running includes a read-only state and an editing state.
[0013] Furthermore, before completing the form creation, the method also includes: presetting advanced features of the form according to user needs, wherein the advanced features of the form include one or more of the following: enabling approval workflow, enabling data import and export, and enabling attachment upload and download.
[0014] Furthermore, presetting the advanced features of the form according to user needs specifically includes: determining the type of the advanced features of the form according to user needs, adding corresponding components in the component model based on the type of the advanced features, and adding corresponding commands in the view model to generate a JSON structure related to the advanced features.
[0015] One or more embodiments of the present specification provide a form creation device based on a JSON structure, including: at least one processor; and,
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0018] Selecting a corresponding form template according to the usage type of the form, wherein the form template is described using a JSON structure, and the JSON structure of the form template includes: a data entity model, a component model, and a view model;
[0019] Selecting a corresponding form data entity model according to a usage scenario of the form, wherein the form data entity model includes field information;
[0020] The field information displayed by the form is selected according to the usage scenario to determine the component model and view model corresponding to the form, and the form creation is completed according to the component model and view model corresponding to the form.
[0021] At least one of the above-mentioned technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects: pre-setting the JSON structure of the form, selecting a pre-set form template according to the usage type of the form, and further determining the form data entity model corresponding to the database according to the usage scenario. After the user selects the field information to be displayed, the corresponding component model and view model are generated to complete the creation of the form. The user only needs to select the form template, the database table and the fields to be displayed to complete the creation of the form, which reduces the difficulty of operation and the user's usage threshold. The user can complete the creation of the form through an intuitive and simple front-end interface, which simplifies the form creation process. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0023] Figure 1 A schematic diagram of a form creation method based on a JSON structure provided in an embodiment of this specification;
[0024] Figure 2 A flowchart of another form creation method based on JSON structure provided in an embodiment of this specification;
[0025] Figure 3 A schematic diagram of the structure of a form creation device based on a JSON structure provided in an embodiment of this specification. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0027] In the process of developing software products, they should be developed according to customer needs. With the popularization of Internet technology, enterprises will use Internet technology to simplify office processes, and most enterprises will use form businesses such as automated office and approval flow. However, each enterprise has different needs for forms, which requires configuration and generation of different forms. Therefore, customers need to customize the content of the form JSON according to different scenarios.
[0028] The form is described in JSON format. If the JSON structure of the form is directly displayed to the customer on the front end, the customer needs to fully learn the JSON structure before they can operate the form. This greatly increases the threshold for using the product and requires manpower and material resources to provide basic skills training to customers. Even so, there will still be a lot of problems from customer understanding, operation, and skills. This makes the existing form creation method that displays the JSON structure to the front-end user unable to meet the user's customized scenario requirements, and makes the product difficult to operate and inconvenient for users.
[0029] This specification embodiment provides a form creation method based on JSON structure. Figure 1 is a flow chart of the method, such as Figure 1 As shown, the method comprises the following steps:
[0030] Step S101, selecting a corresponding form template according to the usage type of the form.
[0031] Before step S101, it also includes: presetting multiple types of form templates, wherein the types of form templates include one or more of a list interface template, a dual list interface template, a card interface template, a left list and right card interface template, a tree table interface template, a left tree and right card interface template, a left tree and right list interface template, a batch editing list interface template, a wizard interface template, and a scroll positioning card interface template.
[0032] In one embodiment of the present specification, various types of form templates are pre-set to meet various usage scenarios of users. The types of form templates include: list interface template, dual list interface template, card interface template, left list and right card interface template, tree table interface template, left tree and right card interface template, left tree and right list interface template, batch edit list interface template, wizard interface template and scroll positioning card interface template.
[0033] The list interface template displays data in the form of a list. For example, in the application scenario of counting students' grades, the grades of all students in the class are displayed in the form of a list. The double-list interface template refers to the use of two lists in the form to display data. For example, displaying the two grades of any student in the form of a double list can achieve a better comparison effect. The card interface refers to displaying data in the form of a card. The left-list and right-card interface template refers to the form of a list on the left side of the form and a card on the right side. For example, in the reimbursement document of a financial product, the corresponding reimbursement person information is displayed in the list on the left, and the specific reimbursement form information is displayed in the form of a card on the right side. The tree table interface template refers to displaying in the form of a table. For example, the form data of the company's organizational structure and hierarchical structure can be displayed in the form of a table. Other templates are not specifically limited in this manual. By setting a variety of different types of form templates, the user's usage needs in various different scenarios are met.
[0034] Specifically, step S101 includes: the form template is described using a JSON structure, and the JSON structure of the form template includes: a data entity model, a component model, and a view model; the JSON structure of the form template also includes a state machine model to control the state switching when the form is running, wherein the state of the form at runtime includes a read-only state and an editing state.
[0035] In one embodiment of the present specification, the user selects the corresponding form template according to the usage scenario. It should be noted that the form template is described in a JSON structure, mainly including a template identifier, a data entity model, a state machine model, a component model, a view model, and the like. The template identifier is used to indicate the identifier of the template used when the form is created, and the data entity model describes the database table structure, field structure, and the association relationship between multiple tables corresponding to the form. The state machine model describes the state flow rules between the read-only state and the edit state when the form page is running. This rule can be bound to the control to realize the automatic switching of the control between the read-only state and the edit state. The component model describes the control structure inside the component, and the control is bound to a field of the data entity to realize data access. The view model is a one-to-one mapping with the component model. It describes the brief structure of the field corresponding to the component and the commands and parameter information of the commands used inside the component. The control inside the component implements the scripts of actions such as click and refresh by binding commands. The form JSON description structure also includes: form identifier, form name, form creator, etc., as shown in the following table.
[0036]
[0037] Step S102: selecting a corresponding form data entity model according to the usage scenario of the form.
[0038] Specifically, step S102 includes: selecting a database table corresponding to the form according to the usage scenario of the form; converting the database table into the corresponding form data entity model in advance, so as to select the form data entity model corresponding to the database table according to the database table selected by the user.
[0039] When creating a form, the user needs to select the database corresponding to the form. In one embodiment of the present specification, multiple database tables are converted into corresponding form data entity models in advance, and the user selects the database table corresponding to the form according to the actual form usage scenario, so as to select the form data entity model corresponding to the database table. By converting the database table into the corresponding form data entity model in advance, the user only needs to select the corresponding database table when using the form, which is convenient to operate and reduces the user's usage threshold. It should be noted that the form data entity model includes an entity identifier, an entity number, an entity name, and an entity type description structure, and the specific attribute values are shown in the following table.
[0040] Property ID Property Name Value Types Is this field required? illustrate id Entity Identification String yes Entity unique identifier code Entity Number String yes Entity Number name Entity Name String yes Entity Name type Entity Type Description Structure FormSchemaEntityType yes Entity Type Description Structure
[0041] The entity type description structure includes entity display fields, primary key field number, entity fields, and sub-entities. The specific attribute values are shown in the table below.
[0042] Property ID Property Name Value Types Is this field required? illustrate displayName Entity Display Name String yes Entity Display Name primary Primary key field number String yes The primary key field number of the entity fields Entity Fields FormSchemaEntityField[] yes Entity field information entities Fruiting body FormSchemaEntity[] no Sub-entity model
[0043] The form entity field model corresponding to the entity field includes: field ID, field number, field name, field type, field default value, whether the field is required, whether the field is mandatory, field length, field precision, form control type, field path and other information. Please refer to the table below for details.
[0044]
[0045] In the form entity field model, the field types include text (string), notes (text), Boolean (boolean), number (number), enumeration (enum), date (date), date and time (datetime) and other basic data types.
[0046] Step S103, selecting field information displayed in the form according to the usage scenario to determine the component model and view model corresponding to the form, and completing the form creation according to the component model and view model corresponding to the form.
[0047] Specifically, in step S103, field information in the form data entity model for form display is selected according to the usage scenario, specifically including: selecting the field to be displayed according to the usage scenario of the form; determining the form control type of the form according to the field information of the field to be displayed, and generating the corresponding control JSON structure, the field information includes: the field type and the form control type corresponding to the field. When the field type of the field to be displayed selected by the user is a numeric type, the form control type of the form is determined to be a numeric control type, and the corresponding numeric control JSON structure is generated.
[0048] In one embodiment of the present specification, the fields to be displayed in the form are selected according to the usage scenario of the form, and the form control type of the form is determined according to the corresponding field information, and the corresponding control JSON structure is generated. The fields include basic data types such as text, notes, Booleans, numbers, enumerations, dates, date and time. When the field type of the field to be displayed is a text type, a JSON structure of the text control is generated. For example, when the field displayed by the user in the form is gender, the field information is a text type, and a JSON structure of the text control is generated. When the field type of the field to be displayed is a note type, a JSON structure of the note control is generated. When the field type of the field to be displayed is a Boolean type, a JSON structure of a Boolean control is generated; when the field type of the field to be displayed is a numeric type, a JSON structure of a numeric control is generated, for example, the information to be displayed is grades, amounts, etc., and the required, read-only, length, precision and other attributes of the field are mapped to the numeric control, thereby forming input restrictions for users, such as the length of the amount is two decimal places; when the field type of the field to be displayed is an enumeration type, a JSON structure of an enumeration control is generated; when the field type of the field to be displayed is a date type, a JSON structure of a date control is generated; when the field type of the field to be displayed is a date and time type, a JSON structure of a date and time control is generated. When using the form, the user only needs to select the field to be displayed to generate the control JSON structure corresponding to the field type, and generate a standard code structure by dynamically creating controls. The user does not need to master the principles and various usage rules to create the JSON structure corresponding to different display fields, which reduces the user's usage threshold, simplifies the form creation process, and facilitates user operation.
[0049] Specifically, the component model and view model corresponding to the form are determined in step S103, which specifically includes: dividing the form into at least one component area according to the type of form template corresponding to the form, and the component area includes one or more items of the list area, the card area and the table area; defining each component area as a corresponding component model and view model, wherein the component model and the view model are in a one-to-one mapping relationship; setting the control JSON structure in the component model, and recording the field information in the corresponding view model.
[0050] In one embodiment of the present specification, the component model and view model corresponding to the form are determined according to the type of form template corresponding to the form. It should be noted that, in one embodiment of the present specification, each form model divides the form into different component areas according to the displayed page elements. For example, a form using a list interface template includes a list area, a form using a dual list interface template includes two list areas, a form using a left list and right card interface template includes a list area and a card interface area, and the area division of forms using other types of form templates is not described in detail here. After the form is divided into different component areas, each component area corresponds to a component model and view model, and the component model and the view model are in a one-to-one correspondence.
[0051] In one embodiment of the present specification, a visual interface is provided to facilitate users to select fields to be displayed on a form according to usage scenarios. Specifically, data entities and corresponding sub-entities are displayed in a tree format in the form interface, and a list of fields defined in the data entity is displayed when the user switches the data entity, and the user selects the fields to be displayed according to needs.
[0052] Generate a control JSON structure of the corresponding type according to the field type selected by the user, and place the generated control JSON structure in different components according to the region division, and record the field brief information in the corresponding view model. For example, when creating a grade form, the user needs to display the student name and math grade information. The student transcript and the corresponding sub-entity math transcript are displayed in a tree format in the form interface. When switching data entities, the student name and math grade field information are displayed. The user selects the field, and generates a text control JSON structure and a numeric control JSON structure according to the text type corresponding to the student name and the numeric type corresponding to the math grade. The text control JSON structure and the numeric control JSON structure are placed in different component models, and the field brief information is recorded in the corresponding view model.
[0053] In one embodiment of the present specification, if a component needs to preset events such as initialization and click operations, information about commands and command parameters will be recorded in the view model.
[0054] After step S103, the method further includes: presetting advanced features of the form according to user needs, wherein the advanced features of the form include one or more of the following: enabling approval workflow, enabling data import and export, and enabling attachment upload and download. Presetting the advanced features of the form according to user needs specifically includes: determining the type of the advanced features of the form according to user needs, adding corresponding components in the component model based on the type of the advanced features, adding corresponding commands in the view model, and generating a JSON structure related to the advanced features.
[0055] In actual application scenarios, users may have other advanced operations besides completing the form content. For example, when the form type is a reimbursement document, the unit price needs to be submitted to the superior for approval, so the approval workflow will be used. Therefore, in order to meet the needs of users, the embodiments of this specification pre-pay the advanced features of the form, including: enabling approval workflow, enabling data import and export, and enabling attachment upload and download. When users need to use advanced features of the form, they can check the corresponding advanced features for use.
[0056] After selecting the advanced features of the form, the user adds the corresponding components in the component model and the corresponding commands in the view model to generate the JSON structure related to the advanced features. For example, after the user enables the approval workflow, two buttons "Submit for Approval" and "Cancel Submission for Approval" will be added to the form component model, and commands related to the approval logic will be added to the view model. In this way, the form created by this wizard will automatically enable the approval logic, and the user no longer needs to manually write the approval-related JSON structure, which lowers the threshold for using the product and simplifies the form creation process.
[0057] This specification embodiment also provides another form creation method flow chart based on JSON structure, such as Figure 2 As shown. In this embodiment, it is assumed that the application scenario of the form is a reimbursement form for a financial product, and the data is required to be displayed in the form of a list on the left and a card on the right. The list on the left only displays three columns of information: the reimbursement form number, the person who reimburses, and the amount spent. After selecting a row in the list, the reimbursement form details are displayed in the card on the right. In addition, the form needs to enable the attachment upload function so that the invoice image can be uploaded to the system. The implementation steps for creating this form are as follows:
[0058] First, select the form model. The form type of the expense report is a left list and right card page, so select the left list and right card interface template in the first step of the wizard.
[0059] After selecting the form template, select the data model. Determine the database table information corresponding to the expense report, select the expense report data table preset in the background, and the present invention will convert the expense report table information into an entity model. The following is a partial entity JSON data intercepted:
[0060]
[0061]
[0062]
[0063] After that, select the form display fields. In the interface, check the list display fields: reimbursement form number, reimbursement person, and expense amount; check the card display fields: reimbursement form number, reimbursement date, reimbursement person, expense amount, reimbursement department, reimbursement form notes and other fields. The present invention will generate list columns for the list display fields, and the card display fields will generate text controls, date controls, text controls, number controls, text controls, and multi-line text controls according to the control type defined in the field. The generated control JSON is placed in the component model.
[0064] Determine whether to use the advanced features of the form. If not, complete the form creation. If you need to use the advanced features of the form, select the advanced features of the form. In the embodiment of this specification, the reimbursement form needs to enable the attachment upload function to upload the invoice image to the system, so the attachment upload feature is checked. After checking, a JSON structure of the attachment control will be created and placed in the form component model. In addition, the attachment upload command will be preset in the view model.
[0065] The embodiment of this specification also provides a form creation device based on JSON structure, such as Figure 3 As shown, it includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: select a corresponding form template according to the usage type of the form, wherein the form template is described using a JSON structure, and the JSON structure of the form template includes: a data entity model, a component model, and a view model; select a corresponding form data entity model according to the usage scenario of the form, wherein the form data entity model includes field information; select field information displayed in the form according to the usage scenario, so as to determine the component model and view model corresponding to the form, and complete the form creation according to the component model and view model corresponding to the form.
[0066] At least one of the above-mentioned technical solutions adopted in the embodiments of this specification pre-sets the JSON structure of the form, selects a pre-set form template according to the usage type of the form, and further determines the form data entity model corresponding to the database according to the usage scenario. After the user selects the field information to be displayed, the corresponding component model and view model are generated to complete the creation of the form. The user only needs to select the form template, the database table and the fields to be displayed to complete the form operation, which reduces the difficulty of operation and the user's usage threshold. The user can complete the creation of the form through an intuitive and simple front-end interface, which simplifies the form creation process.
[0067] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0068] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0069] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.
Claims
1. A form creation method based on JSON structure, characterized in that: The method comprises: Selecting a corresponding form template according to the usage type of the form, wherein the form template is described using a JSON structure, and the JSON structure of the form template includes: a data entity model, a component model, and a view model; Selecting a corresponding form data entity model according to a usage scenario of the form, wherein the form data entity model includes field information; Selecting the field information displayed by the form according to the usage scenario to determine the component model and view model corresponding to the form, and completing the form creation according to the component model and view model corresponding to the form; Before selecting the corresponding form template according to the form usage type, the following is also included: Preset multiple types of form templates, wherein the types of the form templates include one or more of a list interface template, a dual list interface template, a card interface template, a left list and right card interface template, a tree table interface template, a left tree and right card interface template, a left tree and right list interface template, a batch edit list interface template, a wizard interface template, and a scroll positioning card interface template; The field information includes: field type and form control type corresponding to the field; The field information in the form data entity model selected for display in the form according to the usage scenario specifically includes: Select the fields to be displayed according to the usage scenario of the form; Determine the form control type of the form according to the field information of the field to be displayed, and generate a corresponding control JSON structure; Determining the component model and view model corresponding to the form specifically includes: According to the type of the form template corresponding to the form, the form is divided into at least one component area, wherein the component area includes one or more of a list area, a card area, and a tree table area; Defining each of the component areas as a corresponding component model and a view model, wherein the component model and the view model are in a one-to-one mapping relationship; The control JSON structure is set in the component model, and the field information is recorded in the corresponding view model.
2. A form creation method based on JSON structure according to claim 1, characterized in that: The selecting a corresponding form data entity model according to the usage scenario of the form specifically includes: Selecting a database table corresponding to the form according to the usage scenario of the form; The database table is converted into the corresponding form data entity model in advance, so that the form data entity model corresponding to the database table is selected according to the database table selected by the user.
3. A form creation method based on JSON structure according to claim 1, characterized in that: The determining of the form control type of the form according to the field type of the field to be displayed and generating a corresponding control JSON structure specifically includes: When the field type of the field to be displayed selected by the user is a numeric type, it is determined that the form control type of the form is a numeric control type, and a corresponding numeric control JSON structure is generated.
4. A form creation method based on JSON structure according to claim 1, characterized in that: The JSON structure of the form template also includes a state machine model for controlling the state switching when the form is running, wherein the state of the form when running includes a read-only state and an editing state.
5. A form creation method based on JSON structure according to claim 1, characterized in that: Before completing the form creation, the method further includes: Advanced features of the form are preset according to user needs, wherein the advanced features of the form include one or more of the following: enabling approval workflow, enabling data import and export, and enabling attachment upload and download.
6. A form creation method based on JSON structure according to claim 5, characterized in that: The advanced features of the form are pre-set according to user needs, specifically including: The type of the advanced feature of the form is determined according to user needs, corresponding components are added to the component model based on the type of the advanced feature, and corresponding commands are added to the view model to generate a JSON structure related to the advanced feature.
7. A form creation device based on JSON structure, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Selecting a corresponding form template according to the usage type of the form, wherein the form template is described using a JSON structure, and the JSON structure of the form template includes: a data entity model, a component model, and a view model; Selecting a corresponding form data entity model according to a usage scenario of the form, wherein the form data entity model includes field information; Selecting the field information displayed by the form according to the usage scenario to determine the component model and view model corresponding to the form, and completing the form creation according to the component model and view model corresponding to the form; Before selecting the corresponding form template according to the form usage type, the following is also included: Preset multiple types of form templates, wherein the types of the form templates include one or more of a list interface template, a dual list interface template, a card interface template, a left list and right card interface template, a tree table interface template, a left tree and right card interface template, a left tree and right list interface template, a batch edit list interface template, a wizard interface template, and a scroll positioning card interface template; The field information includes: field type and form control type corresponding to the field; The field information in the form data entity model selected for display in the form according to the usage scenario specifically includes: Select the fields to be displayed according to the usage scenario of the form; Determine the form control type of the form according to the field information of the field to be displayed, and generate a corresponding control JSON structure; Determining the component model and view model corresponding to the form specifically includes: According to the type of the form template corresponding to the form, the form is divided into at least one component area, wherein the component area includes one or more of a list area, a card area, and a tree table area; Defining each of the component areas as a corresponding component model and a view model, wherein the component model and the view model are in a one-to-one mapping relationship; The control JSON structure is set in the component model, and the field information is recorded in the corresponding view model.
Citation Information
Patent Citations
Method and device for generating user-defined form
CN102779040A
Form designing method based on modularization
CN105630514A