CN112257005A - Form component generation method and device - Google Patents

Form component generation method and device Download PDF

Info

Publication number
CN112257005A
CN112257005A CN202011249024.2A CN202011249024A CN112257005A CN 112257005 A CN112257005 A CN 112257005A CN 202011249024 A CN202011249024 A CN 202011249024A CN 112257005 A CN112257005 A CN 112257005A
Authority
CN
China
Prior art keywords
target
component
data
items
item
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.)
Granted
Application number
CN202011249024.2A
Other languages
Chinese (zh)
Other versions
CN112257005B (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.)
Beijing Lewo Wuxian Technology Co ltd
Original Assignee
Beijing Lewo Wuxian 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 Beijing Lewo Wuxian Technology Co ltd filed Critical Beijing Lewo Wuxian Technology Co ltd
Priority to CN202011249024.2A priority Critical patent/CN112257005B/en
Publication of CN112257005A publication Critical patent/CN112257005A/en
Application granted granted Critical
Publication of CN112257005B publication Critical patent/CN112257005B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides a form component generation method and a form component generation device, which relate to the technical field of application programs, wherein the method comprises the following steps: the same components as the pre-generated common base form components are created as the initial form components. And obtaining the form requirement corresponding to the form component to be generated. Based on the form requirement, the form items supported by the form component to be generated are reserved in the initial form structure data corresponding to the initial form component, and the configuration values of the supported form items are recorded in the initial form structure data, so that the form component to be generated is generated. By applying the scheme provided by the embodiment of the invention, the efficiency of generating the form component can be improved.

Description

Form component generation method and device
Technical Field
The invention relates to the technical field of application programs, in particular to a method and a device for generating a form component.
Background
With the popularization of network applications and the increase of network users, various application programs have more and more data to process. Typically, various applications typically implement data processing based on forms, e.g., data entry, data display, etc., based on forms. In addition, in different application scenarios, the forms based on which the application programs are based are different, for example, the types of data recorded by the forms are different, for example, the data recorded by the forms may be user information, user permissions, and the like, and the forms may also have different data processing functions, for example, the forms may have at least one of functions of data query, data deletion, data modification, and the like.
In view of the above, in the prior art, developers of application programs are generally required to customize and write software code for different requirements of forms for different application scenarios, so as to develop different form components and create forms based on the developed form components.
Because the form components are developed based on the requirement customization of the application scenes on the form in the prior art, when the application scenes are more, application program developers are required to write a plurality of software codes, and the form components required in different application scenes can be developed, so that the efficiency of generating the form components is low.
Disclosure of Invention
The embodiment of the invention aims to provide a form component generation method and device so as to improve the efficiency of generating form components. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a form component generation method, where the method includes:
creating the same components as pre-generated common base form components as initial form components, wherein the common base form components are described by form structure data comprising form items, the form items comprising: form data items and/or form function items, wherein the form items are obtained by analyzing the requirements of a plurality of application scenes collected in advance on a form;
obtaining a form requirement corresponding to a form component to be generated, wherein the form requirement is used for describing form items supported by the form component to be generated and configuration values of the supported form items;
based on the form requirement, retaining the form items supported by the form component to be generated in the initial form structure data corresponding to the initial form component, and recording the configuration values of the supported form items in the initial form structure data, thereby generating the form component to be generated.
In one embodiment of the invention, the method further comprises:
determining a target form component for creating a target form from the generated form components;
initializing form items included in the target form structure data according to configuration values recorded in the target form structure data corresponding to the target form component;
and creating and rendering the target form based on the initialized form item.
In an embodiment of the present invention, after creating and rendering the target form based on the initialized form item, the method further includes:
after receiving an operation request of a user based on a target form function item supported by the target form and aiming at a form record, determining a data interface for interaction of the target form function item and a server;
and calling the determined data interface and responding to the operation request.
In an embodiment of the present invention, before the invoking the determined data interface and responding to the operation request, the method further includes:
displaying a page for showing detail information of a target form record to which the operation request is directed, wherein the page includes form data items supported by the target form and record values of the supported form data items, and if the target form record exists in the target form, the record values of the supported form data items are: if the target form record does not exist in the target form, the record value of the supported form data item is as follows: presetting a default value;
acquiring editing information of a user for editing the target form record in the page;
the calling the determined data interface and responding to the operation request comprises the following steps:
and calling the determined data interface, and responding to the operation request based on the obtained editing information.
In an embodiment of the present invention, initializing a form item included in the target form structure data according to a configuration value recorded in the target form structure data corresponding to the target form component includes:
initializing a control of a form function item included in the target form structure data and a data interface used for interaction of the function item and a server according to a configuration value of the form function item recorded in the target form structure data corresponding to the target form component;
and/or
And initializing a control of a form data item included in the target form structure data according to a configuration value of the form data item recorded in the target form structure data corresponding to the target form component.
In a second aspect, an embodiment of the present invention provides a form component generation apparatus, where the apparatus includes:
a component creating module, configured to create a component identical to a pre-generated common basic form component as an initial form component, where the common basic form component is described by form structure data including a form item, and the form item includes: form data items and/or form function items, wherein the form items are obtained by analyzing the requirements of a plurality of application scenes collected in advance on a form;
the system comprises a requirement obtaining module, a form generating module and a form setting module, wherein the requirement obtaining module is used for obtaining a form requirement corresponding to a form component to be generated, and the form requirement is used for describing form items supported by the form component to be generated and configuration values of the supported form items;
and the component generating module is used for reserving the form items supported by the form component to be generated in the initial form structure data corresponding to the initial form component based on the form requirement, and recording the configuration values of the supported form items in the initial form structure data so as to generate the form component to be generated.
In one embodiment of the present invention, the apparatus further comprises:
the component determination module is used for determining a target form component for creating a target form from the generated form components;
the form initialization module is used for initializing form items included in the target form structure data according to configuration values recorded in the target form structure data corresponding to the target form component;
and the form creating module is used for creating and rendering the target form based on the initialized form item.
In one embodiment of the present invention, the apparatus further comprises:
the interface determining module is used for determining a data interface for interaction between the target form function item and a server after receiving an operation request of a user based on the target form function item supported by the target form and aiming at the form record;
and the request response module is used for calling the determined data interface and responding to the operation request.
In one embodiment of the present invention, the apparatus further comprises:
a page display module, configured to display a page for showing detail information of a target form record to which the operation request is directed, where the page includes a form data item supported by the target form and a record value of the supported form data item, and if the target form record already exists in the target form, the record value of the supported form data item is: if the target form record does not exist in the target form, the record value of the supported form data item is as follows: presetting a default value;
the editing information obtaining module is used for obtaining the editing information of the user for editing the target form record in the page;
the request response module is specifically configured to:
and calling the determined data interface, and responding to the operation request based on the obtained editing information.
In an embodiment of the present invention, the form initialization module is specifically configured to:
initializing a control of a form function item included in the target form structure data and a data interface used for interaction of the function item and a server according to a configuration value of the form function item recorded in the target form structure data corresponding to the target form component;
and/or
And initializing a control of a form data item included in the target form structure data according to a configuration value of the form data item recorded in the target form structure data corresponding to the target form component.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of the first aspect when executing a program stored in the memory.
In a fourth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method steps of any one of the first aspect.
In a fifth aspect, embodiments of the present invention also provide a computer program product comprising instructions, which when run on a computer, cause the computer to perform the method steps of any of the first aspects described above.
The embodiment of the invention has the following beneficial effects:
by applying the scheme provided by the embodiment of the invention, the component which is the same as the general basic form component can be created and used as the initial form component, the form items supported by the form component to be generated are kept in the initial form structure data based on the form requirement, and the configuration values of the supported form items are recorded in the initial form structure data, so that the form component to be generated is generated.
As can be seen from the above, in the scheme provided by the embodiment of the present invention, the form item in the initial form structure data of the initial form component can be adjusted based on the form requirement, the form item supported by the form component to be generated is retained, and the configuration value of the supported form item is recorded, so that different form components corresponding to different form requirements can be generated based on the initial form component. Because the common basic form component is generated in advance, and different form components corresponding to different form requirements are obtained based on the common basic form component, an application program developer is not required to write software codes of different form components, and the efficiency of generating the form components is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a form component generation method according to an embodiment of the present invention;
fig. 2A is a schematic flowchart of a form creating method according to an embodiment of the present invention;
FIG. 2B is a diagram illustrating a target form according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a form data processing method according to an embodiment of the present invention;
fig. 4A is a schematic flowchart of a page generation method according to an embodiment of the present invention;
FIG. 4B is a diagram illustrating a page showing a target form record according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a form component generating apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a form creating apparatus according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a form data processing apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a page generating apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problem, embodiments of the present invention provide a method and an apparatus for generating a form component, because the efficiency of generating the form component in the prior art is low.
In one embodiment of the present invention, a form component generation method is provided, including:
creating a component identical to a pre-generated common base form component as an initial form component, wherein the common base form component is described by form structure data including form items, the form items including: form data items and/or form function items, wherein the form items are obtained by analyzing the requirements of a plurality of application scenes collected in advance on the form;
obtaining a form requirement corresponding to a form component to be generated, wherein the form requirement is used for describing form items supported by the form component to be generated and configuration values of the supported form items;
based on the form requirement, the form items supported by the form component to be generated are reserved in the initial form structure data corresponding to the initial form component, and the configuration values of the supported form items are recorded in the initial form structure data, so that the form component to be generated is generated.
As can be seen from the above, in the scheme provided by the embodiment of the present invention, the form item in the initial form structure data of the initial form component can be adjusted based on the form requirement, the form item supported by the form component to be generated is retained, and the configuration value of the supported form item is recorded, so that different form components corresponding to different form requirements can be generated based on the initial form component. Because the common basic form component is generated in advance, and different form components corresponding to different form requirements are obtained based on the common basic form component, an application program developer is not required to write software codes of different form components, and the efficiency of generating the form components is improved.
The following describes a method and an apparatus for generating a form component according to an embodiment of the present invention with a specific embodiment.
Referring to fig. 1, an embodiment of the present invention provides a flowchart of a form component generation method, where the method includes the following steps S101 to S103.
S101: the same components as the pre-generated common base form components are created as the initial form components.
Wherein the generic base form component is described by form structure data comprising form items.
Specifically, the common basic form component may be a component generated by an application developer through a pre-written software code, and the form item in the form structure data may be divided into front-end data for describing a display form of the form component and back-end data for describing a control logic of the form component according to a code logic.
For example, the front-end data may be: the color, size, location in the page of the application, etc. of the controls contained in the form component. The backend data described above can be used to define: and when receiving instructions such as clicking controls contained in the form components by a user, inputting data in the form components and the like, triggering the form components to operate and the like.
In addition, the form items may include, according to the type division of the form items: form data items and/or form function items.
The form data items may represent various types of data included in the form component, such as name data, age data, gender data, academic data, and the like. The above-mentioned form data items may be represented by fields contained in a form.
The above form function items may be used to represent data processing functions that the form component can implement.
Specifically, the form function items may include: a modification item indicating that a form record in the form component can be modified, an addition item indicating that a form record can be added to the form component, a deletion item indicating that a form record can be deleted in the form component, a search item indicating that data can be searched for in the form component, an adjustment item indicating that the structure of the form component can be adjusted, and the like.
In addition, the modification item, the addition item, the deletion item, and the search item may indicate that the form component is capable of performing data processing on form records corresponding to all form data items, or performing data processing on form records corresponding to only a part of form data items.
Furthermore, the form item is obtained by analyzing the requirements of a plurality of application scenes collected in advance on the form.
For example, a preset number of forms from different application scenarios may be collected in advance, the occurrence frequency of each form item in the collected forms may be determined, and the form item whose occurrence frequency is greater than the preset frequency may be determined as a form item included in the form structure data corresponding to the common basic form component.
S102: and obtaining the form requirement corresponding to the form component to be generated.
The form requirement is used for describing the form items supported by the form component to be generated and the configuration values of the supported form items.
Specifically, the form requirement may be a form requirement input by a user, or a form requirement recorded in a requirement document.
The form items supported by the to-be-generated form component may be form data items and/or form function items, for example, the form items supported by the to-be-generated form component may include name data, age data, addition items, search terms, and the like.
In addition, for a form data item, the configuration value may be a data representation, a data description, a data type, a data attribute, a data constraint, a data remark, and the like corresponding to the form data item, where the data attribute may include: whether the data is a primary key, whether the data can be modified, whether the data can be searched, whether the data can be hidden, whether the data can be null, and the like, wherein the data limitation can comprise: maximum value of the data, length limit, etc.
The data types can be various commonly used data types, such as integer type, floating point type, character string type, boolean type, text type, image type, enumeration type, date type, and the like.
For different data types, the form data items may correspond to different configuration values, for example, for an enumeration type, the configuration values may further include enumeration option values, for example, when the form data items correspond to residence data, the enumeration option values may be city names, and for an image type, the configuration values may further include image size restrictions, for example, the size of an image is up to 3M.
Taking age data as an example, the data representation may be "age", the data description may be "age", the data type may be integer, the data is not a primary key, may be modified, may be searched, may not be hidden, may not be null, the maximum value of the data is 150, and the like.
Further, for the form function item, the configuration values may include: the processing limit of the form record indicating which form data items can be processed by the data processing function corresponding to the form function item, and the interface information of the data interface required for implementing the data processing function corresponding to the form function item, where the interface information may include an interface address, a domain name, and the like of the data interface.
Referring to fig. 2B, "find", "add", "copy", "modify", and "delete" in the figure correspond to form function items, "title", "activity ID", "activity type", and "sort" correspond to form data items.
S103: based on the form requirement, the form items supported by the form component to be generated are reserved in the initial form structure data corresponding to the initial form component, and the configuration values of the supported form items are recorded in the initial form structure data, so that the form component to be generated is generated.
In an embodiment of the present invention, the form items represented by the form requirement and supported by the form component to be generated may be enabled, or the form items in the initial form structure data except the form items supported by the form component to be generated may be deleted, so as to retain the form items supported by the form component to be generated.
The initial configuration value of the form item included in the initial form structure data may be a preset configuration default value, and the preset configuration default value may be a null value or another preset value.
The initial configuration values included in the initial form structure data may be replaced with the configuration values, and the configuration values may be recorded in the initial form structure data.
According to the form requirement, after the initial form structure data is processed, the initial form structure data is used for describing the form component to be generated, and therefore after the initial form structure data is processed, the form component to be generated can be generated.
In addition, the initial form structure data may be stored in a structure database. The processed initial form structure data may also be serialized, for example, the processed initial form structure data is serialized into a JSON character string.
As can be seen from the above, in the scheme provided by the embodiment of the present invention, the form item in the initial form structure data of the initial form component can be adjusted based on the form requirement, the form item supported by the form component to be generated is retained, and the configuration value of the supported form item is recorded, so that different form components corresponding to different form requirements can be generated based on the initial form component. Because the common basic form component is generated in advance, and different form components corresponding to different form requirements are obtained based on the common basic form component, an application program developer is not required to write software codes of different form components, and the efficiency of generating the form components is improved.
Referring to fig. 2A, a flowchart of a form creating method according to an embodiment of the present invention is shown, and compared with the foregoing embodiment shown in fig. 1, the method further includes the following steps S104 to S106.
S104: from the generated form components, a target form component for creating a target form is determined.
Specifically, in the case that each generated form component corresponds to a form component serial number, the target form component may be determined according to the form component serial number.
And determining a target form component for creating a target form in the application program page according to the corresponding relation between the preset application program page and the generated form component.
S105: and initializing the form item included in the target form structure data according to the configuration value recorded in the target form structure data corresponding to the target form component.
Specifically, the form items supported by the target form component are retained in the target form structure data, and the configuration values of the supported form items are recorded, so that the configuration values recorded in the target form structure data can be configured in a preset form item program template, and the form items are initialized, that is, the display form of the corresponding control of the form items in the page of the application program can be initialized according to the front-end data included in the configuration values, and the control logic of the form items is initialized according to the back-end data included in the configuration values.
For example, the configuration values of the form data items recorded in the target form structure data may be configured into a preset data item program template, and the form data items may be initialized.
In addition, in the case where the form structure data is stored in a structure database, the target form structure data may be acquired from the structure database.
In one embodiment of the present invention, the step S105 may be implemented by the following step a and/or step B.
Step A: and initializing a control of a form function item included in the target form structure data and a data interface used for interaction of the function item and a server according to the configuration value of the form function item recorded in the target form structure data corresponding to the target form component.
Specifically, if the form function item indicates that the target form can implement functions of searching for a form record, modifying a form record, and adding a form record, the initialized control may include: searching input box controls and searching key controls, modifying input box controls and modifying key controls, adding input box controls and modifying key controls and the like. If the configuration value of the form function item indicates that the target form can implement the delete function, the initialized control may include: delete key controls, and the like.
And B: and initializing a control of a form data item included in the target form structure data according to the configuration value of the form data item recorded in the target form structure data corresponding to the target form component.
The form data item control may be a table control, and the form records corresponding to the form data item may be displayed in each cell in the table control.
According to different data types of the form data items, the control of the form data item may also be: a selector control for displaying enumerated type data, a radio box component for displaying boolean type data, a date selection control for displaying date type data, an image control for displaying an image, a text box control for displaying text type data, and the like. The selector control, radio box assembly, date selection control, image control, and text box control may all be displayed within cells in the form control.
S106: and creating and rendering the target form based on the initialized form item.
Specifically, the target form may be created and rendered in a preset area in a page of an application program. Namely, the list items after the rendering initialization in the preset area are formed into the target list by the list items.
In addition, if the configuration value corresponding to the form item indicates that the form item can be hidden, the concealable form item may not be rendered.
Referring to fig. 2B, a schematic diagram of a target form according to an embodiment of the present invention is shown.
The target form comprises a search input box, a search key, an addition key, four form data items of title, activity ID, activity type and sequencing, record values of form records of the form data items are displayed, and the target form further comprises a copy key and a modification key for each form record.
As can be seen from the above, the form items supported by the target form component can be initialized according to the configuration values recorded in the target form data corresponding to the target form component, and the target form can be created and rendered. Therefore, the target form is created and displayed in the page of the application program, and the target form can be generated in the application program.
In addition, the above steps S104-S106 can be executed each time the page of the application is opened or refreshed, so that if the target form structure data is modified, the created target form can be changed synchronously corresponding to the modified target form structure data.
The electronic device executing steps S101 to S103 and the electronic device executing steps S104 to S106 may be the same electronic device or different electronic devices.
Referring to fig. 3, a flowchart of a form data processing method according to an embodiment of the present invention is shown, and compared with the embodiment shown in fig. 2A, the method further includes the following steps S107-S108 after the step S106.
S107: and after receiving an operation request of a user based on a target form function item supported by the target form and aiming at the form record, determining a data interface for the interaction of the target form function item and a server.
The target form can implement a data processing function corresponding to a target form function item supported by the target form, for example, a form record corresponding to a form data item is modified, a form record is added, and the like, so that the target form can process an operation request corresponding to the data processing function.
The operation request may be an operation request input by a user through a click of a key, data input, screen sliding, or the like.
The above form records are: and recording specific numerical values corresponding to the form data items in the target form. For example, specific values of the recorded age data, such as "18", "30", etc.
Specifically, the operation request may be a request for modifying a form record, a request for adding a form record, a request for deleting a form record, a request for finding a form record, a request for copying a form record, or the like, which is supported by the target form.
The data interface may be: the data interface in the electronic device running the target form may also be a data interface in the server.
In an embodiment of the present invention, the data interface corresponding to the received operation request may be determined according to a correspondence between a preset operation request and the data interface. The data interface can also be determined according to interface information recorded in the function item of the target form.
S108: and calling the determined data interface to respond to the operation request.
In the embodiment provided by the present invention, for different operation requests, the manner of responding to the operation request is different, and specifically, the following five cases (one) to (five) may be included.
And (I) under the condition that the operation request is a search form recording request, calling the search data interface if the determined data interface is a search data interface, sending the search form recording request to the server, and receiving a search result returned by the server through the search data interface so as to display the search result.
And (II) under the condition that the operation request is a request for adding the form record, calling the data adding interface if the determined data interface is the data adding interface, and sending the form record to be added to the server so that the server stores the form record to be added. In addition, each form record corresponding to the target form can be obtained from the server again, and each form record after the form record is added is displayed in the target form again.
In addition, whether the form data items can be null values can be determined according to the configuration values of the form data items, before the form records to be added are sent to the server, whether the form records corresponding to the form data items which cannot be null values in the form records to be added are null values is determined, and the form records to be added are sent to the server only under the condition that the form records are not null values.
And thirdly, under the condition that the operation request is a request for modifying the form record, calling the modified data interface if the determined data interface is the modified data interface, and sending the form record to be modified and the identifier of the original form record to be modified to the server, so that the server modifies the original form record into the form record to be modified according to the identifier of the original form record. In addition, each form record corresponding to the target form can be obtained from the server again, and the modified form record is displayed in the target form again.
The identifier of the original form record may be a record value of a primary key corresponding to the original form record, a form data item corresponding to the modified original form record, or the like.
In addition, whether the form data item can be a null value or not can be determined according to the configuration value of the form data item, whether the form record corresponding to the form data item which cannot be the null value in the form record to be modified is a null value or not is determined before the form record to be modified and the identifier of the original form record to be modified are sent to the server by calling the modification data interface, and the identifier of the form record to be modified and the identifier of the original form record to be modified are sent to the server only under the condition that the form record to be modified and the identifier of the original form record to be modified are not the null value.
And (IV) under the condition that the operation request is a request for deleting the form records, calling the data deleting interface if the determined data interface is the data deleting interface, and sending the identifiers of the form records to be deleted to the server, so that the server deletes the form records to be deleted according to the identifiers of the form records to be deleted. In addition, each form record corresponding to the target form can be obtained from the server again, and the form record after the form record to be deleted is displayed in the target form again.
The identifier of the form record to be deleted may be a record value of a main key corresponding to the form record to be deleted, and the like.
And (V) under the condition that the operation request is a copy form record request, calling the copy data interface if the determined data interface is a copy data interface, sending the identifier of the to-be-copied form record to the server, and receiving the to-be-copied form record sent by the server, so that the to-be-copied form record can be copied.
The identifier of the form record to be copied may be a record value of a primary key corresponding to the form record to be copied.
As can be seen from the above, after the target form is created, the data processing function corresponding to the target form function item supported by the target form can be realized through the data interface, so that the form records in the target form can be subjected to data processing such as adding, deleting, modifying, searching and the like through the data interface. And the data processing function supported by the target form can be realized only in the target form, so that the form record in the target form can be protected.
Referring to fig. 4A, a schematic flowchart of a page generation method according to an embodiment of the present invention is shown, and compared with the embodiment shown in fig. 3, the method further includes steps S109 to S110 before the step S108.
S109: and displaying a page for showing the detail information of the target form record to which the operation request aims.
The page includes the form data items supported by the target form and the record values of the supported form data items.
Specifically, the form data items included in the page may be all the form data items supported by the target form. It may also be the form data item for which the operation request is directed.
For example, in the case where the operation request is a request for modifying a form record, the form data item included in the page may be a modifiable form data item.
If the target form has the target form record, the record values of the supported form data items are as follows: the values in the target form records.
Specifically, if the operation request is a request for modifying a form record, a request for searching a form record, a request for deleting a form record, a request for copying a form record, or the like, and the target form has already been recorded in the target form, the value of the original target form record may be displayed on the page.
If the target form record does not exist in the target form, the record values of the supported form data items are as follows: default values are preset.
Specifically, if the operation request is a request for adding a form record, and no form record to be added exists in the target form, a preset default value may be displayed in the page. Wherein, the default value may be: a null value or other predetermined value, e.g., the predetermined value for age data may be 18, the predetermined value for gender data may be male, etc.
In one embodiment of the invention, the record values corresponding to the data items of the forms with different data types can be displayed in different controls.
For example, integer, floating point, string type recorded values may be displayed in an input box control, enumerated type recorded values may be displayed in a selector control, boolean type recorded values may be displayed in a radio box control, text type may be displayed in a text field control, date type recorded values may be displayed in a date selection control, and so forth.
Referring to fig. 4B, a schematic diagram of a page showing a target form record according to an embodiment of the present invention is provided. The page shows the recorded values of four form data items, namely, title, activity ID, activity type and sorting. Where the record values for "title", "activity ID", "sort" are displayed in the input box component and the record values for "activity type" are displayed in the selector component.
S110: and acquiring editing information of the user for editing the target form record in the page.
Specifically, the editing may be to modify the target form record, and the editing information is the modified target form record. The editing may be copying the target form record, and the editing information may be an instruction for copying the target form record. The editing may be deleting the target form record, and the editing information may be an instruction to delete the target form record. The editing may be adding a form record, and the editing information may be a form record to be added.
After the above steps S109 to S110, the above step S108 may be realized by the following step S108A.
S108A: and calling the determined data interface, and responding to the operation request based on the obtained editing information.
As can be seen from the above, in the scheme provided by the embodiment of the present invention, the record value corresponding to the form data item may be displayed through a page in which the target form record is displayed, where the page corresponds to the target form record, and the edit information may be received through the page, so as to perform data processing on the target form record.
Corresponding to the form component generating method, the invention also provides a form component generating device.
Referring to fig. 5, an embodiment of the present invention provides a schematic structural diagram of a form component generating apparatus, where the apparatus includes:
a component creating module 501, configured to create a component identical to a pre-generated common basic form component as an initial form component, where the common basic form component is described by form structure data including form items, and the form items include: form data items and/or form function items, wherein the form items are obtained by analyzing the requirements of a plurality of application scenes collected in advance on a form;
a requirement obtaining module 502, configured to obtain a form requirement corresponding to a form component to be generated, where the form requirement is used to describe a form item supported by the form component to be generated and a configuration value of the supported form item;
the component generating module 503 is configured to, based on the form requirement, reserve the form items supported by the to-be-generated form component in the initial form structure data corresponding to the initial form component, and record the configuration values of the supported form items in the initial form structure data, so as to generate the to-be-generated form component.
As can be seen from the above, in the scheme provided by the embodiment of the present invention, the form item in the initial form structure data of the initial form component can be adjusted based on the form requirement, the form item supported by the form component to be generated is retained, and the configuration value of the supported form item is recorded, so that different form components corresponding to different form requirements can be generated based on the initial form component. Because the common basic form component is generated in advance, and different form components corresponding to different form requirements are obtained based on the common basic form component, an application program developer is not required to write software codes of different form components, and the efficiency of generating the form components is improved.
Referring to fig. 6, which is a schematic structural diagram of a form creating apparatus according to an embodiment of the present invention, the apparatus further includes:
a component determination module 504 for determining a target form component for creating a target form from the generated form components;
a form initialization module 505, configured to initialize a form item included in the target form structure data according to a configuration value recorded in the target form structure data corresponding to the target form component;
a form creation module 506, configured to create and render the target form based on the initialized form item.
As can be seen from the above, the form items supported by the target form component can be initialized according to the configuration values recorded in the target form data corresponding to the target form component, and the target form can be created and rendered. Therefore, the target form is created and displayed in the page of the application program, and the target form can be generated in the application program.
Referring to fig. 7, which is a schematic structural diagram of a form data processing apparatus according to an embodiment of the present invention, the apparatus further includes:
an interface determining module 507, configured to determine, after receiving an operation request, which is based on a target form function item supported by the target form and is directed to a form record, a data interface for interaction between the target form function item and a server;
a request response module 508, configured to invoke the determined data interface and respond to the operation request.
As can be seen from the above, after the target form is created, the data processing function corresponding to the target form function item supported by the target form can be realized through the data interface, so that the form records in the target form can be subjected to data processing such as adding, deleting, modifying, searching and the like through the data interface. And the data processing function supported by the target form can be realized only in the target form, so that the form record in the target form can be protected.
Referring to fig. 8, which is a schematic structural diagram of a page generating apparatus according to an embodiment of the present invention, the apparatus further includes:
a page display module 509, configured to display a page for showing detail information of a target form record to which the operation request is directed, where the page includes a form data item supported by the target form and a record value of the supported form data item, and if the target form record already exists in the target form, the record value of the supported form data item is: if the target form record does not exist in the target form, the record value of the supported form data item is as follows: presetting a default value;
an edit information obtaining module 510, configured to obtain edit information for a user to edit the target form record in the page;
the request response module 508 is specifically configured to:
and calling the determined data interface, and responding to the operation request based on the obtained editing information.
As can be seen from the above, in the scheme provided by the embodiment of the present invention, the record value corresponding to the form data item may be displayed through a page in which the target form record is displayed, where the page corresponds to the target form record, and the edit information may be received through the page, so as to perform data processing on the target form record.
In an embodiment of the present invention, the form initialization module 505 is specifically configured to:
initializing a control of a form function item included in the target form structure data and a data interface used for interaction of the function item and a server according to a configuration value of the form function item recorded in the target form structure data corresponding to the target form component;
and/or
And initializing a control of a form data item included in the target form structure data according to a configuration value of the form data item recorded in the target form structure data corresponding to the target form component.
An embodiment of the present invention further provides an electronic device, as shown in fig. 9, which includes a processor 901, a communication interface 902, a memory 903, and a communication bus 904, where the processor 901, the communication interface 902, and the memory 903 complete mutual communication through the communication bus 904,
a memory 903 for storing computer programs;
the processor 901 is configured to implement the method steps of any one of the above-described form component generation methods when executing the program stored in the memory 903.
Under the condition that the form component is generated by the electronic equipment provided by the embodiment of the invention, the form item in the initial form structure data of the initial form component can be adjusted based on the form requirement in the scheme provided by the embodiment of the invention, the form item supported by the form component to be generated is reserved, and the configuration value of the supported form item is recorded, so that different form components corresponding to different form requirements can be generated on the basis of the initial form component. Because the common basic form component is generated in advance, and different form components corresponding to different form requirements are obtained based on the common basic form component, an application program developer is not required to write software codes of different form components, and the efficiency of generating the form components is improved.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above-mentioned form component generation methods.
When the computer program stored in the computer-readable storage medium applied to the agent side provided by the embodiment of the present invention is executed to generate the form component, in the scheme provided by the embodiment of the present invention, the form item in the initial form structure data of the initial form component may be adjusted based on the form requirement, the form item supported by the form component to be generated is retained, and the configuration value of the supported form item is recorded, so that different form components corresponding to different form requirements may be generated based on the initial form component. Because the common basic form component is generated in advance, and different form components corresponding to different form requirements are obtained based on the common basic form component, an application program developer is not required to write software codes of different form components, and the efficiency of generating the form components is improved.
In yet another embodiment, the present invention further provides a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above-described method for generating a form component.
In the case of executing the computer program applied to the agent side provided by the embodiment of the present invention to generate the form component, in the scheme provided by the embodiment of the present invention, the form item in the initial form structure data of the initial form component may be adjusted based on the form requirement, the form item supported by the form component to be generated is retained, and the configuration value of the supported form item is recorded, so that different form components corresponding to different form requirements may be generated based on the initial form component. Because the common basic form component is generated in advance, and different form components corresponding to different form requirements are obtained based on the common basic form component, an application program developer is not required to write software codes of different form components, and the efficiency of generating the form components is improved.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus, the electronic device, the computer-readable storage medium and the computer program product, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to them, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A form component generation method, the method comprising:
creating the same components as pre-generated common base form components as initial form components, wherein the common base form components are described by form structure data comprising form items, the form items comprising: form data items and/or form function items, wherein the form items are obtained by analyzing the requirements of a plurality of application scenes collected in advance on a form;
obtaining a form requirement corresponding to a form component to be generated, wherein the form requirement is used for describing form items supported by the form component to be generated and configuration values of the supported form items;
based on the form requirement, retaining the form items supported by the form component to be generated in the initial form structure data corresponding to the initial form component, and recording the configuration values of the supported form items in the initial form structure data, thereby generating the form component to be generated.
2. The method of claim 1, further comprising:
determining a target form component for creating a target form from the generated form components;
initializing form items included in the target form structure data according to configuration values recorded in the target form structure data corresponding to the target form component;
and creating and rendering the target form based on the initialized form item.
3. The method of claim 2, further comprising, after the creating and rendering the target form based on the initialized form item:
after receiving an operation request of a user based on a target form function item supported by the target form and aiming at a form record, determining a data interface for interaction of the target form function item and a server;
and calling the determined data interface and responding to the operation request.
4. The method of claim 3, wherein prior to said invoking the determined data interface in response to the operation request, further comprising:
displaying a page for showing detail information of a target form record to which the operation request is directed, wherein the page includes form data items supported by the target form and record values of the supported form data items, and if the target form record exists in the target form, the record values of the supported form data items are: if the target form record does not exist in the target form, the record value of the supported form data item is as follows: presetting a default value;
acquiring editing information of a user for editing the target form record in the page;
the calling the determined data interface and responding to the operation request comprises the following steps:
and calling the determined data interface, and responding to the operation request based on the obtained editing information.
5. The method according to any of claims 2-4, wherein initializing the form item included in the target form structure data according to the configuration value recorded in the target form structure data corresponding to the target form component comprises:
initializing a control of a form function item included in the target form structure data and a data interface used for interaction of the function item and a server according to a configuration value of the form function item recorded in the target form structure data corresponding to the target form component;
and/or
And initializing a control of a form data item included in the target form structure data according to a configuration value of the form data item recorded in the target form structure data corresponding to the target form component.
6. An apparatus for generating a form component, the apparatus comprising:
a component creating module, configured to create a component identical to a pre-generated common basic form component as an initial form component, where the common basic form component is described by form structure data including a form item, and the form item includes: form data items and/or form function items, wherein the form items are obtained by analyzing the requirements of a plurality of application scenes collected in advance on a form;
the system comprises a requirement obtaining module, a form generating module and a form setting module, wherein the requirement obtaining module is used for obtaining a form requirement corresponding to a form component to be generated, and the form requirement is used for describing form items supported by the form component to be generated and configuration values of the supported form items;
and the component generating module is used for reserving the form items supported by the form component to be generated in the initial form structure data corresponding to the initial form component based on the form requirement, and recording the configuration values of the supported form items in the initial form structure data so as to generate the form component to be generated.
7. The apparatus of claim 6, further comprising:
the component determination module is used for determining a target form component for creating a target form from the generated form components;
the form initialization module is used for initializing form items included in the target form structure data according to configuration values recorded in the target form structure data corresponding to the target form component;
and the form creating module is used for creating and rendering the target form based on the initialized form item.
8. The apparatus of claim 7, further comprising:
the interface determining module is used for determining a data interface for interaction between the target form function item and a server after receiving an operation request of a user based on the target form function item supported by the target form and aiming at the form record;
and the request response module is used for calling the determined data interface and responding to the operation request.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
CN202011249024.2A 2020-11-10 2020-11-10 Form component generation method and device Active CN112257005B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011249024.2A CN112257005B (en) 2020-11-10 2020-11-10 Form component generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011249024.2A CN112257005B (en) 2020-11-10 2020-11-10 Form component generation method and device

Publications (2)

Publication Number Publication Date
CN112257005A true CN112257005A (en) 2021-01-22
CN112257005B CN112257005B (en) 2024-04-19

Family

ID=74265364

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011249024.2A Active CN112257005B (en) 2020-11-10 2020-11-10 Form component generation method and device

Country Status (1)

Country Link
CN (1) CN112257005B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112883012A (en) * 2021-02-08 2021-06-01 建信金融科技有限责任公司 Implementation method and device of Domino data table component
CN113485963A (en) * 2021-06-30 2021-10-08 金蝶软件(中国)有限公司 Information acquisition method and device and computer storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080307298A1 (en) * 2007-06-05 2008-12-11 Adobe Systems Incorporated Method and system to process an electronic form
JP2012173745A (en) * 2011-02-17 2012-09-10 Mitsubishi Electric Corp Database analysis device and database analysis program
CN103455473A (en) * 2012-05-30 2013-12-18 刘继业 WEB form definition and application method based on hypertext markup language (HTML)
CN105320700A (en) * 2014-08-05 2016-02-10 南京理工大学常熟研究院有限公司 Database dynamic query form generation method
CN110472207A (en) * 2018-05-10 2019-11-19 北京京东尚科信息技术有限公司 List generation method and device
CN110647709A (en) * 2019-09-12 2020-01-03 北京达佳互联信息技术有限公司 Form construction method and device and storage medium
CN110765746A (en) * 2019-10-15 2020-02-07 支付宝(杭州)信息技术有限公司 Automatic form generation method and system based on event agent
CN110837366A (en) * 2019-10-11 2020-02-25 平安科技(深圳)有限公司 Form generation method, electronic device and computer readable storage medium
CN111638876A (en) * 2020-05-28 2020-09-08 深圳壹账通智能科技有限公司 Dynamic form implementation method and device, electronic equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080307298A1 (en) * 2007-06-05 2008-12-11 Adobe Systems Incorporated Method and system to process an electronic form
JP2012173745A (en) * 2011-02-17 2012-09-10 Mitsubishi Electric Corp Database analysis device and database analysis program
CN103455473A (en) * 2012-05-30 2013-12-18 刘继业 WEB form definition and application method based on hypertext markup language (HTML)
CN105320700A (en) * 2014-08-05 2016-02-10 南京理工大学常熟研究院有限公司 Database dynamic query form generation method
CN110472207A (en) * 2018-05-10 2019-11-19 北京京东尚科信息技术有限公司 List generation method and device
CN110647709A (en) * 2019-09-12 2020-01-03 北京达佳互联信息技术有限公司 Form construction method and device and storage medium
CN110837366A (en) * 2019-10-11 2020-02-25 平安科技(深圳)有限公司 Form generation method, electronic device and computer readable storage medium
CN110765746A (en) * 2019-10-15 2020-02-07 支付宝(杭州)信息技术有限公司 Automatic form generation method and system based on event agent
CN111638876A (en) * 2020-05-28 2020-09-08 深圳壹账通智能科技有限公司 Dynamic form implementation method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112883012A (en) * 2021-02-08 2021-06-01 建信金融科技有限责任公司 Implementation method and device of Domino data table component
CN113485963A (en) * 2021-06-30 2021-10-08 金蝶软件(中国)有限公司 Information acquisition method and device and computer storage medium

Also Published As

Publication number Publication date
CN112257005B (en) 2024-04-19

Similar Documents

Publication Publication Date Title
JP3053153B2 (en) How to start application of document management system
US8332359B2 (en) Extended system for accessing electronic documents with revision history in non-compatible repositories
CN110162525B (en) B+ tree-based read-write conflict resolution method, device and storage medium
US20060080603A1 (en) Method and apparatus for utilizing an object model to manage document parts for use in an electronic document
US10698938B2 (en) Systems and methods for organizing and identifying documents via hierarchies and dimensions of tags
US10706033B2 (en) Content management system and method for managing ad-hoc collections of content
US11770450B2 (en) Dynamic routing of file system objects
EP1248206A1 (en) Method and apparatus for database table definition
US11841836B2 (en) Target environment data seeding
CN112257005B (en) Form component generation method and device
AU2017265144A1 (en) Information retrieval
CN111274263A (en) Visual database change statement generation method and device and storage medium
US20110113319A1 (en) Introducing a form instance into an information container
US10021187B2 (en) Presenting content using decoupled presentation resources
CN113344514A (en) Item information display method and device, electronic equipment and readable medium
CN112835638A (en) Configuration information management method and device based on embedded application program
US7512790B2 (en) Method, system and article of manufacture for management of co-requisite files in a data processing system using extended file attributes
US10635458B2 (en) Systems and methods for generating a self-updating maintenance page
KR101804139B1 (en) Data management system and method thereof based on keyword
CN105354506A (en) File hiding method and apparatus
CN114356330A (en) Page configuration method and device, electronic equipment and storage medium
JP2024505238A (en) Data processing system with operations on logical dataset groups
CN114281688A (en) Codeless or low-code automatic case management method and device
JPH11282882A (en) Document management method
CN106227713A (en) The processing method and processing device of document

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
GR01 Patent grant