Form configuration method and device
By obtaining form field parameters from the database and configuring rule functions using the preset rule library, the complex and time-consuming problem of form configuration in the existing technology is solved, and efficient and reusable multi-rule complex form configuration is realized, and the functions of supporting different business rules are supported.
Patent Information
- Application Number
- CN202110300948.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-22
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2041-03-22
AI Technical Summary
The prior art is difficult to achieve efficient and reusable multi-rule complex form configuration, and cannot support linkage between form elements and control field attributes according to business logic, resulting in complex and time-consuming configuration.
By receiving a table configuration request, obtaining form field parameters from the database, using the preset rule base to determine the corresponding rule function, configuring the rule parameters, generating field parameters configured by the rule function, and sending them to the front-end page to configure the form.
It realizes efficient and reusable multi-rule complex form configuration, supports the functions of different business rules, quickly responds to business needs, and reduces the development cycle.
Smart Images

Figure CN113051269B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of database technology, and in particular to a form configuration method and device. Background Art
[0002] Today's business systems require users to enter a wide variety of form information, and business logic is becoming increasingly complex. In order to meet different business needs, it is often necessary to develop a separate set of forms to support the entry of business elements. Separate development will increase the workload, accumulate a large amount of duplicate and redundant code, and extend the construction period. In response to this situation, most systems currently use configurable form management. Although it can cover the style, sorting, and block configuration of form field controls, it cannot support direct configuration of the linkage between form elements, or control the relevant attributes of the field according to specific business logic, resulting in a simple configuration that cannot meet the actual business needs, and still requires a lot of business logic processing development. Summary of the invention
[0003] In view of the problems existing in the prior art, the main purpose of the embodiments of the present invention is to provide a form configuration method and device to achieve efficient and reusable multi-rule complex form configuration.
[0004] In order to achieve the above object, an embodiment of the present invention provides a form configuration method, the method comprising:
[0005] Acquire multiple field parameters of the form from a database according to the received form configuration request; wherein the field parameters include rule parameters;
[0006] According to the rule parameters, determining a rule function corresponding to the rule parameters in a preset rule library;
[0007] The rule parameters are configured using the rule function to obtain field parameters configured by the rule function;
[0008] The field rule parameters of the form are generated according to the field parameters configured by the rule function, and the field rule parameters of the form are sent to the front-end page to configure the form.
[0009] Optionally, in one embodiment of the present invention, determining a rule function corresponding to the rule parameter in a preset rule base according to the rule parameter includes: determining a rule function corresponding to the function name in a preset rule base according to the function name in the rule parameter.
[0010] Optionally, in an embodiment of the present invention, configuring the rule parameters by using the rule function to obtain the field parameters configured by the rule function includes:
[0011] Write the parameter name, parameter value and form-related information of the rule function into the corresponding rule parameters to obtain the field parameters configured by the rule function.
[0012] Optionally, in an embodiment of the present invention, the method further includes: determining an association relationship of the forms according to the form association information in the rule parameters.
[0013] The embodiment of the present invention also provides a form configuration method, the method comprising:
[0014] Receive and parse the field rule parameters of the form sent by the backend server to obtain multiple field parameters configured by the rule function;
[0015] Use the preset public template to match form controls and bind rules according to the field parameters configured by the rule function to complete the form configuration.
[0016] Optionally, in an embodiment of the present invention, the field parameters configured by the rule function include rule parameters, and the rule parameters include a function name, a parameter name, a parameter value, and form association information of the rule function.
[0017] Optionally, in one embodiment of the present invention, the use of a preset common template to match form controls and bind rules according to field parameters configured by rule functions includes: matching multiple form controls in a preset common module with field parameters configured by rule functions; and binding rules to each form control according to the function name, parameter name, parameter value and form association information in the rule parameters corresponding to each form control.
[0018] The embodiment of the present invention further provides a form configuration device, the device comprising:
[0019] A field information module, used to obtain multiple field parameters of the form from the database according to the received form configuration request; wherein the field parameters include rule parameters;
[0020] A rule function module, used to determine a rule function corresponding to the rule parameter in a preset rule library according to the rule parameter;
[0021] A field parameter module, used to configure the rule parameters using the rule function to obtain the field parameters configured by the rule function;
[0022] The parameter generation module is used to generate the field rule parameters of the form according to the field parameters configured by the rule function, and send the field rule parameters of the form to the front-end page to configure the form.
[0023] Optionally, in an embodiment of the present invention, the rule function module is further used to determine, according to the function name in the rule parameter, a rule function corresponding to the function name in a preset rule library.
[0024] Optionally, in one embodiment of the present invention, the field parameter module is further used to write the parameter name, parameter value and form association information of the rule function into the corresponding rule parameters to obtain the field parameters configured by the rule function.
[0025] Optionally, in an embodiment of the present invention, the device further includes: an association relationship module, configured to determine an association relationship of forms according to form association information in the rule parameters.
[0026] The embodiment of the present invention further provides a form configuration device, the device comprising:
[0027] The parameter parsing module is used to receive and parse the field rule parameters of the form sent by the backend server to obtain multiple field parameters configured by the rule function;
[0028] The form configuration module is used to use the preset public template to match form controls and bind rules according to the field parameters configured by the rule function to complete the form configuration.
[0029] Optionally, in an embodiment of the present invention, the field parameters configured by the rule function include rule parameters, and the rule parameters include a function name, a parameter name, a parameter value, and form association information of the rule function.
[0030] Optionally, in one embodiment of the present invention, the form configuration module includes: a control matching unit, used to match multiple form controls in a preset common module with field parameters configured by rule functions; and a rule binding unit, used to perform rule binding on each form control according to the function name, parameter name, parameter value and form association information in the rule parameters corresponding to each form control.
[0031] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the program.
[0032] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above method.
[0033] The present invention realizes differentiated control of configured forms by using rules by setting rule parameters for different fields and a reusable rule base, realizes the function of supporting different business rules, can quickly respond to business needs, and business processing logic can be directly reused, greatly shortening the development cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 A flowchart of a form configuration method according to an embodiment of the present invention;
[0036] Figure 2 A flowchart of a form configuration method in another embodiment of the present invention;
[0037] Figure 3 A flowchart of configuring a form in an embodiment of the present invention;
[0038] Figure 4 A system workflow diagram of the form configuration method used in the embodiment of the present invention;
[0039] Figure 5 This is a flowchart of the system backend server in an embodiment of the present invention;
[0040] Figure 6 This is a system front-end page workflow diagram in an embodiment of the present invention;
[0041] Figure 7 This is a schematic diagram of the association relationship of forms in an embodiment of the present invention;
[0042] Figure 8 A schematic diagram of the structure of a form configuration device according to an embodiment of the present invention;
[0043] Fig. 9 It is a structural schematic diagram of a form configuration device in another embodiment of the present invention;
[0044] Fig.10 This is a schematic diagram of the structure of a form configuration module in an embodiment of the present invention;
[0045] Fig.11 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The embodiments of the present invention provide a form configuration method and device, which can be used in the financial field or other fields. It should be noted that the form configuration method and device of the present invention can be used in the financial field, and can also be used in any field other than the financial field. The application field of the form configuration method and device of the present invention is not limited.
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] like Figure 1 The flowchart of a form configuration method according to an embodiment of the present invention is shown. The execution subject of the form configuration method provided by the embodiment of the present invention includes but is not limited to a computer, and the execution party may be a business system backend server. The method shown in the figure includes:
[0049] Step S101, obtaining multiple field parameters of a form from a database according to the received form configuration request; wherein the field parameters include rule parameters.
[0050] Wherein, multiple field parameters of a preset form are obtained from a database according to a received form configuration request, the form configuration request may be a SQL statement, and the form configuration request includes a form name and / or form type requested for configuration. Corresponding form field parameters are obtained from a database according to the form configuration request. The form field parameters in the database are preset.
[0051] Furthermore, multiple field parameters are recorded in the field information of the form, so the field information of the form can be directly obtained from the database, and the field parameters of the form can be obtained from the field information of the form. Specifically, the field parameters of the form include field name, type, sort, module, rule parameters, and the field parameter format is shown in Table 1.
[0052] Table 1
[0053]
[0054] The rule parameter format is shown in Table 2.
[0055] Table 2
[0056]
[0057] Step S102: determining a rule function corresponding to the rule parameter in a preset rule base according to the rule parameter.
[0058] The preset rule base integrates the common control logic in business scenarios and abstracts it into rule functions. According to the function name in the rule parameter, the rule function corresponding to the rule parameter is determined in the preset rule base, for example:
[0059] (1) Visible: You can directly configure a rule function in a rule base.
[0060] If you need to link with other fields in the form according to business logic, you can directly configure a rule function similar to the following:
[0061] Function name (the form field id to be linked, the value that triggers the linkage)
[0062] This rule function can compare the actual value of the incoming form field id (input from the front-end page) with the value that triggers the linkage. If they are the same, the process is performed. According to the actual business scenario, the return value of this rule function can be set to true for display and false for hiding.
[0063] (2) For form controls such as drop-down boxes that contain data dictionaries: a remote search function can be configured.
[0064] ①Function name (dictionary type)
[0065] This rule function can obtain an array corresponding to the field by querying the configured dictionary table. The array contains multiple dictionary objects, each of which has the format of {dictionary key, dictionary value}. The array is returned to the front-end page as the data source for the form control.
[0066] ②Function name (parameter 1, parameter 2...)
[0067] This rule function can be a specific query function. For example, the input parameter is the job title. The function implementation content is to query the system job table and obtain all personnel information under the job. The assembled return parameter is also an array. The array contains multiple dictionary objects. Each object format is {dictionary key, dictionary value}. The array is returned to the front-end page as the data source of the control.
[0068] (3) Editing permission control: If you need to control field modification permissions based on business logic, you can directly configure a function in the rule base:
[0069] Function name (currently logged in user id, position id)
[0070] This rule function can match the current logged-in user ID passed in with the position to which the query user belongs, and then with the passed-in position ID. Depending on the specific business logic, it returns an indicator of whether editing is allowed based on the matching result.
[0071] Step S103: Use the rule function to configure the rule parameters to obtain field parameters configured by the rule function.
[0072] The process of configuring the rule parameters is to write the parameter name, parameter value, and form association relationship in the rule function into the rule parameters. After the rule parameters are configured, the field parameters configured by the rule function are obtained. The format of the configured rule parameters is shown in Table 3.
[0073] Table 3
[0074]
[0075] Step S104, generating field rule parameters of the form according to the field parameters configured by the rule function, and sending the field rule parameters of the form to the front-end page to configure the form.
[0076] The field parameters configured by the rule function are assembled into parameters that can be recognized by the public template of the front-end page, namely, field rule parameters. The field rule parameters of the form are sent to the front-end page to configure the form. The format of the field rule parameters is shown in Table 4.
[0077] Table 4
[0078]
[0079]
[0080] As an embodiment of the present invention, determining a rule function corresponding to the rule parameter in a preset rule base according to the rule parameter includes: determining a rule function corresponding to the function name in the preset rule base according to the function name in the rule parameter.
[0081] The preset rule base integrates common control logic in business scenarios and abstracts them into rule functions. According to the function name in the rule parameter, the rule function corresponding to the rule parameter is determined in the preset rule base.
[0082] As an embodiment of the present invention, the rule function is used to configure the rule parameters to obtain the field parameters configured by the rule function, including: writing the parameter name, parameter value and form association information of the rule function into the corresponding rule parameters to obtain the field parameters configured by the rule function.
[0083] The process of configuring the rule parameters is to write the parameter name, parameter value, and form association relationship in the rule function into the rule parameters. After the rule parameters are configured, the field parameters configured by the rule function are obtained.
[0084] In this embodiment, the method further includes: determining the association relationship of the forms according to the form association information in the rule parameters.
[0085] Among them, the form types include dictionary table, field table, position table, user table and user position table. The form association information in the rule parameters represents the relationship between tables, as follows:
[0086] (1) Relationship between dictionary table and field table:
[0087] Dictionary table, the dictionary field plus the dictionary code value can determine a unique data dictionary; through the dictionary field, you can bind a form control on a front-end page, so that you can get all the data dictionaries of the form control.
[0088] The rule parameter fields in the field table can be configured with the corresponding dictionary fields to achieve association. The format is as follows:
[0089] Rule parameters: {Dictionary field: XXX,...}.
[0090] (2) Position table, user table and user position table:
[0091] The user position table associates user information and position information through user ID and position ID, and the corresponding relationship is many-to-many.
[0092] The rule field of the field table can be configured with position information, such as:
[0093] Rule parameters: {Position ID:XXX,...}
[0094] The back-end server can obtain the current user's job information based on the job information configured in the field, through the relationship between the job table, user table and user-job table, perform corresponding processing based on the information, and return it to the front-end page.
[0095] like Figure 2 The flowchart of a form configuration method according to an embodiment of the present invention is shown. The execution subject of the form configuration method provided by the embodiment of the present invention includes but is not limited to a computer, and the execution party can be a front-end page of a business system. The method shown in the figure includes:
[0096] Step S201, receiving and parsing the field rule parameters of the form sent by the backend server, and obtaining a plurality of field parameters configured by the rule function.
[0097] Among them, the front-end page receives the form field rule parameters sent by the back-end server, and parses the form field rule parameters according to the form field rule parameters, and extracts multiple field parameters configured by the rule function. Among them, the field parameters configured by the rule function include rule parameters, and the rule parameters record the function name, parameter name, parameter value and form association information. The format of a single field parameter configured by the rule function is shown in Table 5.
[0098] Table 5
[0099]
[0100] Step S202, using a preset public template, performing form control matching and rule binding according to field parameters configured by a rule function, to complete form configuration.
[0101] Among them, the common module preset in the front-end page includes multiple form controls, matches the field parameters to different form controls, binds the id and value of the corresponding field parameters, and binds the rule function in the field parameters.
[0102] Specifically, the table control is rendered according to the configured rule parameters. For example:
[0103] (1) The visibility rule function is configured in the following format:
[0104] {Is it visible: function name (linked form field id, value that triggers the linkage)}
[0105] When the front-end page renders the control, it recognizes that the "visible" rule is configured, and the control needs to be bound to the front-end event for processing whether it is visible. In this event, the value of the linkage field is obtained through the input parameter "linked form field id", and matched with the input parameter "trigger linkage value". Based on the matching result and business rules, the flag of whether to display the field is returned;
[0106] (2) The data source of the selection control is configured, such as:
[0107] {Data source: function name (parameter 1, parameter 2...)}
[0108] When the front-end renders the control, it recognizes that the "data source" rule is configured, triggers a parsing event, and calls the corresponding function through the function name (the function name encapsulated by the front-end). The encapsulated function assembles the passed parameters, requests the back-end interface, and returns the corresponding dictionary value in the array format: [{dictionary key1, dictionary value 1}, {dictionary key2, dictionary value 2}...];
[0109] (3) Edit permissions are configured in the following format:
[0110] {Whether editable: function name (currently logged in user id, parameters)}
[0111] When the front-end renders the control, it recognizes that the "Editable" rule is configured, and triggers an event to set the field editing status. The event will request the back-end interface and return an identifier of whether editing is allowed based on the input parameters. For example, a function that controls whether the user's position can edit the field, the input parameters are "current logged-in user ID" and "authorized position ID". The back-end interface will match whether the user has a corresponding position, determine whether the field is allowed to be edited, and return an identifier for the front-end to set in the properties of the corresponding control.
[0112] Finally, complete the form configuration, generate the page, and trigger the corresponding rules based on user operations.
[0113] As an embodiment of the present invention, the field parameters configured by the rule function include rule parameters, and the rule parameters include a function name, a parameter name, a parameter value, and form association information of the rule function.
[0114] Among them, the back-end server uses the rule function to configure the rule parameters, and writes the parameter name, parameter value, and form association relationship in the rule function into the rule parameters. After the front-end page parses the field rule parameters, the field parameters configured by the rule function include the rule parameters, thereby obtaining the function name, parameter name, parameter value, and form association information of the rule function in the rule parameters.
[0115] In this embodiment, if Figure 3 As shown, the use of a preset public template to match form controls and bind rules according to field parameters configured by a rule function includes:
[0116] Step S2021, matching multiple form controls in the preset common module with field parameters configured by the rule function.
[0117] Among them, the common module preset in the front-end page includes multiple form controls, matches the field parameters to different form controls, binds the id and value of the corresponding field parameters, and binds the rule function in the field parameters.
[0118] Step S2022: Bind the rules to each form control according to the function name, parameter name, parameter value and form association information in the rule parameters corresponding to each form control.
[0119] Among them, the function name, parameter name, parameter value and form association information of the rule function are obtained according to the configured rule parameters, and the rule binding and control rendering are performed.
[0120] In a specific embodiment of the present invention, Figure 4The system workflow diagram of the form configuration method in the embodiment of the present invention is shown. The system of the form configuration method includes a front-end page and a back-end server. The front-end page integrates various types of form controls and encapsulates the common logic into a common template; the back-end server abstractly encapsulates various rule functions; and the corresponding relationship between the common fields and the rule functions is configured by using database parameters.
[0121] Among them, Figure 5 As shown, the backend server implements the logic as follows:
[0122] 1. Request SQL statements to query field information from the database according to the form configuration, including: field name, type, sort, module, and rule parameters.
[0123] 2. The rule base integrates common control logic in business scenarios and abstracts them into functions. Match rule base functions, for example:
[0124] (1) Visibility: You can directly configure a function in the backend rule library.
[0125] If you need to link with other fields in the form according to business logic, you can directly configure a function similar to the following:
[0126] Function name (the form field id to be linked, the value that triggers the linkage)
[0127] This rule function can compare the actual value of the incoming form field id (input from the front-end page) with the value that triggers the linkage. If they are the same, it will be processed. According to the actual business scenario, the return value of this function can be set to true for display and false for hiding.
[0128] (2) For controls such as drop-down boxes that contain data dictionaries: a remote search function can be configured.
[0129] ①Function name (dictionary type)
[0130] This rule function can obtain an array corresponding to the field by querying the configured dictionary table. The array contains multiple dictionary objects, each of which has the format of {dictionary key, dictionary value}. The array is returned to the front end as the data source of the control.
[0131] ②Function name (parameter 1, parameter 2...)
[0132] This rule function can be a specific query function. For example, the input parameter is the job title. The function implementation content is to query the system job table and obtain all personnel information under the job. The assembled return parameter is also an array. The array contains multiple dictionary objects. Each object format is {dictionary key, dictionary value}. The array is returned to the front-end page as the data source of the control.
[0133] (3) Editing permission control: If you need to control field modification permissions based on business logic, you can directly configure a function in the backend rule library:
[0134] Function name (currently logged in user id, position id)
[0135] This function can match the current logged-in user ID passed in with the position to which the query user belongs, and then with the passed-in position ID. Depending on the specific business logic, it returns an indicator of whether editing is allowed based on the matching result.
[0136] 3. Perform preprocessing and assemble into parameters that can be recognized by the public template of the front-end page, namely, field rule parameters.
[0137] Further, such as Figure 6 As shown, the front-end page implementation logic is as follows:
[0138] 1. The public template splits and extracts each field parameter according to the field rule parameters returned by the backend server, matches different controls, and binds the ID and value of the corresponding field. The controls that come with the system framework can basically cover all of them. If there are special business needs, you can also write custom controls.
[0139] 2. Render the form controls according to the configured rule parameters. For example:
[0140] (1) The visibility rule is configured in the following format:
[0141] {Is it visible: function name (linked form field id, value that triggers the linkage)}
[0142] When the front-end page renders the form control, it recognizes that the "visible" rule is configured, so the control needs to be bound to the front-end event for processing whether it is visible. In this event, the value of the linkage field is obtained through the input parameter "linked form field id", and matched with the input parameter "trigger linkage value". Based on the matching result and business rules, the flag of whether to display the field is returned;
[0143] (2) The data source of the selection control is configured, such as:
[0144] {Data source: function name (parameter 1, parameter 2...)}
[0145] When the front-end page renders the form control, it recognizes that the "data source" rule is configured, triggers a parsing event, and calls the corresponding function through the function name (the function name encapsulated by the front-end). The encapsulated function assembles the passed parameters, requests the back-end interface, and returns the corresponding dictionary value in the array format: [{dictionary key1, dictionary value 1}, {dictionary key2, dictionary value 2}...];
[0146] (3) Edit permissions are configured in the following format:
[0147] {Whether editable: function name (currently logged in user id, parameters)}
[0148] When the front-end page renders the form control, it recognizes that the "Editable" rule is configured, and triggers an event to set the field editing status. The event will request the back-end interface and return an identifier of whether editing is allowed based on the input parameters. For example, a function that controls whether the user's position can edit the field, the input parameters are "current logged-in user ID" and "authorized position ID". The back-end interface will match whether the user has a corresponding position, determine whether the field is allowed to be edited, and return an identifier for the front-end to set in the properties of the corresponding control.
[0149] 2. After the form configuration is completed, the page is generated and the corresponding rules are triggered according to user operations.
[0150] In this embodiment, if Figure 7 The figure shows a schematic diagram of the association relationship of forms in an embodiment of the present invention. The table information mainly configured in each form includes:
[0151] 1. The field table is the core configuration table, which is used to configure form field information. The main fields of the table structure are shown in Table 6.
[0152] Table 6
[0153]
[0154] 2. Position table. This is used as an example in one of the scenarios in multiple rules. When the business requirement is to control the field attributes based on the position of the logged-in user, it is necessary to associate the system's own position table. The main table structure information is shown in Table 7.
[0155] Table 7
[0156]
[0157]
[0158] The system in this embodiment involves a scenario of maintaining positions by application, so the table structure here includes application fields. Table fields related to the position setting dimension can be added or deleted according to the needs of the actual business system.
[0159] 3. User table: a table in the system that records user-related information. The main table structure information is shown in Table 8.
[0160] Table 8
[0161]
[0162] 4. User position table, which associates users and positions. The relationship is many-to-many. The main table structure information is shown in Table 9.
[0163] Table 9
[0164] Field Chinese name Field English name Field Type Is it a primary key? Remark User ID id varchar(32) yes Unique ID of the user Position ID post_id varchar(255) Related position ID username user_name varchar(50) User Chinese Name Data Source source tinyint(4) Data synchronization source
[0165] 5. Dictionary table, set dictionary key and value, used to associate the front-end page selection control, as the data dictionary of the form control. The main table structure information is shown in Table 10.
[0166] Table 10
[0167]
[0168] In this embodiment, the relationship between the tables is as follows:
[0169] (1) Relationship between dictionary table and field table:
[0170] Dictionary table, the dictionary field plus the dictionary code value can determine a unique data dictionary; through the dictionary field, you can bind a form control on a front-end page, so that you can get all the data dictionaries of the control.
[0171] The rule parameter fields in the field table can be configured with the corresponding dictionary fields to achieve association. The format is as follows:
[0172] Rule parameters: {Dictionary field: XXX,...}
[0173] (2) Position table, user table and user position table:
[0174] The user position table associates user information and position information through user ID and position ID, and the corresponding relationship is many-to-many.
[0175] The rule field of the field table can be configured with position information, such as:
[0176] Rule parameters: {Position ID:XXX,...}
[0177] The back-end server can obtain the current user's job information based on the job information configured in the field, through the relationship between the job table, user table and user-job table, perform corresponding processing based on the information, and return it to the front-end page.
[0178] In a specific embodiment of the present invention, the specific process of configuring a multi-rule form includes:
[0179] 1. Database parameter configuration
[0180] In this embodiment, the key fields of the form include the fields: "Applicant", "Issue Classification", "Issue Type", "Review Plan Time", "Program Review Key Points Checklist", and "Review Decision Factors Table". The information that needs to be configured in the field table is shown in Table 11.
[0181] Table 11
[0182]
[0183] As shown in Table 11, the rules that need to be configured are shown in Table 12.
[0184] Table 12
[0185]
[0186]
[0187] The dictionary table needs to be configured with the information shown in Table 13.
[0188] Table 13
[0189]
[0190] As shown in Table 13, "Project Plan", "Research Results", and "Specification Guidelines" are first-level data dictionaries; "Business R&D", "Technical Transformation", "Technical Report or Planning Report", and "Others" are second-level data dictionaries. Here, the second-level data dictionary is associated with the first-level data dictionary through the two fields "pre_dict_type" and "pre_dict_code". The information that needs to be configured in the position table is shown in Table 14.
[0191] Table 14
[0192] id post_name dept_id dept_name app_id status remark ABC0001 administrator 15C4E7C2EDC7CAA8E053051118503D93 Second Sector 1
[0193] The information that needs to be configured in the user table is shown in Table 15.
[0194] Table 15
[0195] id name dept_id dept_name app_id status 001166780 First 15C4E7C2EDC7CAA8E053051118503D93 Second Sector 1
[0196] The information that needs to be configured in the user position table is shown in Table 16.
[0197] Table 16
[0198]
[0199]
[0200] As shown in Table 16, the position of administrator is set for A, and the position id is "ABC0001".
[0201] 2. The backend server processes the organization field rule parameters
[0202] First, call the function to get all the fields under the current form type. The function is as follows:
[0203] queryEditField("TechnicalCommitteeReviewProcess").
[0204] This function will traverse the field information and perform the following processing:
[0205] (1) After obtaining all fields, call the following function:
[0206] getAllFieldDict("TechnicalCommitteeReviewProcess")
[0207] Get all the data dictionaries needed for the form and return them to the front-end page. The specific process is shown in Table 17.
[0208] Table 17
[0209]
[0210]
[0211] (2) "tab_id" is used for classification, which in this embodiment includes: "baseInfo" tab page;
[0212] (3) Assemble field parameter attributes;
[0213] (4) Read the rules in "attr_rules" and perform corresponding operations: In the "Review Plan Time" field in this embodiment, the rule is: {backEnd:[{"postRel":{"postId":"ABC0001"}}]}, backEnd identifies it as a rule processed by the backend server, calls the rule processing function corresponding to "postRel", and passes in the id "ABC0001" corresponding to the limited position "administrator". The function will obtain the position information of the current logged-in user and the limited "postId" according to the relationship between the position table, user table and user position table, and compare them. If they meet the requirements, replace the default "visiable" and "editable" attributes and set them to "1", which means they are visible and editable;
[0214] (5) Assemble field rule parameters and return to the front-end page.
[0215] Specifically, the field rule parameter sample is shown in Table 18.
[0216] Table 18
[0217]
[0218]
[0219] 3. The front-end page public template processing process includes: when the form is opened, the interface corresponding to the back-end server rule function queryEditField("TechnicalCommitteeReviewProcess") is called. The public template contains multiple controls, which are matched with the parameters returned by the back-end server, and the parameters of each field are split and extracted to match different form controls. Here, they are mainly the following fields:
[0220] (1) Applicant: belongs to the tab "Basic Information"; control type input box; visible; editable; sort 1; block "Basic Information";
[0221] (2) Topic classification: belongs to the tab "Basic Information"; Control type single selection; Visible; Editable; Sort 2; Block "Basic Information"
[0222] (3) Topic type: belongs to the tab "Basic Information"; Control type single choice; Visible; Editable; Sort 3; Block "Basic Information";
[0223] (4) Review plan time: belongs to the tab "Basic Information"; control type input box; visible; editable; sort 4; block "Basic Information";
[0224] (5) Checklist of key points for program review: belongs to the tab "Basic Information"; control type attachment; visible; editable; sort 5; block "Document Information";
[0225] (6) Review decision factor table: belongs to the tab "Basic Information"; control type attachment; visible; editable; sort 6; block "Document Information".
[0226] 4. Bind rules, bind the "frontEnd" front-end rule in "attrRules", and perform corresponding processing. The main operations here are as follows:
[0227] (1) The topic classification is shown in Table 19.
[0228] Table 19
[0229]
[0230]
[0231] Traverse the field attributes to get the corresponding rule function configured in frontEnd:
[0232] ① The front-end page calls the corresponding initialization event according to the function name "relDataFunc". The event will bind the event triggered when the data changes to the "Agenda Category" control based on the data dictionary returned by the back-end server to establish an association relationship: when the topic category selects "Project Plan", the topic type control dictionary is "Business R&D Category" and "Technical Transformation Category"; when the topic category selects "R&D Results" or "Specification Guidelines", the topic type control dictionary is "Technical Report or Planning Report" and "Other".
[0233] ② The front-end page calls the corresponding initialization event according to the function name "relShowFunc". The event will bind the event triggered when the data changes to the "Agenda Classification" control according to the data dictionary returned by the back-end server, determine the field of the bound event according to the input parameter "attrName", and determine the corresponding operation of the data dictionary according to relData to establish an association relationship: when the topic classification selects "Project Plan", the document attachment field contains the "Plan Review Points Checklist" and "Review Decision Factors Table"; when the topic classification selects "R&D Results" or "Specification Guidelines", the document attachment field does not contain the "Plan Review Points Checklist" and "Review Decision Factors Table".
[0234] (2) The checklist for key points in program review is shown in Table 20.
[0235] Table 20
[0236]
[0237] Traverse the field attributes to obtain the corresponding parameters configured in uploadRules, and set the properties of the upload document control according to the parameters:
[0238] ① "maxSize" is set to 200, limiting the uploaded file size to no more than 200M;
[0239] ② "suffix" is set to "doc" or "docx", which means the suffix of the uploaded document must be .doc or .docx;
[0240] ③Set “uploadTemplate” to:
[0241] "http: / / adlm-wiki.icbc:8090 / pages / viewpage.action?pageId=13569951", this address is the document template download link;
[0242] ④ Set “uploadTemplateDownloadText” to “Download Checklist Template”, and the download link will be displayed as “Download Template”.
[0243] (3) The checklist for key points in program review is shown in Table 21.
[0244] Table 21
[0245]
[0246] Traverse the field attributes to obtain the corresponding parameters configured in uploadRules, and set the properties of the upload document control according to the parameters:
[0247] ⑤ "maxSize" is set to 200, limiting the uploaded file size to no more than 200M;
[0248] ⑥ "suffix" is set to "doc" or "docx", which means that the suffix of the uploaded document must be .doc or .docx;
[0249] ⑦Set “uploadTemplate” to:
[0250] "http: / / 84.34.110.3:8080 / sites / doc / zx_docs / DocLib / Forms / AllItems.aspx?RootFolder=% 2fsites%2fdoc%2fzx%5fdocs%2fDocLib%2f02%20%e6%9e%b6%e6%9e%84%2f008%20%e7%bb%bc%e5% 90%88%2f%e5%88%b6%e5%ba%a6%2f%e6%8a%80%e6%9c%af%e5%a7%94%e5%91%98%e4%bc%9a%e5%b7%a 5%e4%bd%9c%e6%89%8b%e5%86%8c&FolderCTID=0x012000BAF3D6C916E6114A9C116183462893B3",
[0251] This address is the document template download link; "uploadTemplateDownloadText" is set to "Download decision factor table template", and the download link display name is "Download template".
[0252] 5. Linkage: When the user interacts with the form interface, the corresponding event is triggered and processed and fed back according to the above rules.
[0253] In this embodiment, the rule sample is shown in Table 22.
[0254] Table 22
[0255]
[0256] The multi-rule form configuration method of the present invention configures different field rules by setting rule attributes and associating a rule base that can be reused after abstraction. The configured form can be differentially controlled according to the rules to realize the function of supporting different business rules. The specific advantages of the present invention are as follows:
[0257] 1. It can quickly respond to business needs, especially the abstracted business processing logic, which can be directly reused, greatly shortening the development cycle;
[0258] 2. Through the relationship between database configuration fields and rules, differentiated configurations can be performed according to the specific needs of different forms to implement different linkage rules for different forms;
[0259] 3. The abstracted rules deal with the linkage between different fields, the attributes of the fields themselves, etc. They are not limited to a certain business system and are highly reusable.
[0260] like Figure 8 The structure diagram of a form configuration device according to an embodiment of the present invention is shown in the figure, and the device shown in the figure includes:
[0261] The field information module 101 is used to obtain multiple field parameters of the form from the database according to the received form configuration request; wherein the field parameters include rule parameters;
[0262] A rule function module 102, configured to determine a rule function corresponding to the rule parameter in a preset rule base according to the rule parameter;
[0263] A field parameter module 103, configured to configure the rule parameters using the rule function to obtain the field parameters configured by the rule function;
[0264] The parameter generation module 104 is used to generate field rule parameters of the form according to the field parameters configured by the rule function, and send the field rule parameters of the form to the front-end page to configure the form.
[0265] As an embodiment of the present invention, the rule function module is further used to determine a rule function corresponding to the function name in a preset rule base according to the function name in the rule parameter.
[0266] As an embodiment of the present invention, the field parameter module is further used to write the parameter name, parameter value and form association information of the rule function into the corresponding rule parameter to obtain the field parameter configured by the rule function.
[0267] In this embodiment, the device further includes: an association relationship module, which is used to determine the association relationship of the forms according to the form association information in the rule parameters.
[0268] like Fig. 9 The figure is a schematic diagram of the structure of a form configuration device in another embodiment of the present invention, and the device shown in the figure includes:
[0269] The parameter parsing module 201 is used to receive and parse the field rule parameters of the form sent by the backend server to obtain multiple field parameters configured by the rule function;
[0270] The form configuration module 202 is used to use a preset public template to perform form control matching and rule binding according to field parameters configured by rule functions to complete form configuration.
[0271] As an embodiment of the present invention, the field parameters configured by the rule function include rule parameters, and the rule parameters include a function name, a parameter name, a parameter value, and form association information of the rule function.
[0272] In this embodiment, if Fig.10 As shown, the form configuration module 202 includes:
[0273] A control matching unit 2021 is used to match multiple form controls in a preset common module with field parameters configured by a rule function;
[0274] The rule binding unit 2022 is used to perform rule binding on each form control according to the function name, parameter name, parameter value and form association information in the rule parameters corresponding to each form control.
[0275] Based on the same application concept as the above form configuration method, the present invention also provides the above form configuration device. Since the principle of solving the problem by the form configuration device is similar to that of the form configuration method, the implementation of the form configuration device can refer to the implementation of the form configuration method, and the repeated parts will not be repeated.
[0276] The present invention realizes differentiated control of configured forms by using rules by setting rule parameters for different fields and a reusable rule base, realizes the function of supporting different business rules, can quickly respond to business needs, and business processing logic can be directly reused, greatly shortening the development cycle.
[0277] The present invention further provides an electronic device, comprising a first memory, a first processor, and a first computer program stored in the first memory and executable on the first processor, wherein the first processor implements the following method when executing the program, for example, including:
[0278] Acquire multiple field parameters of the form from a database according to the received form configuration request; wherein the field parameters include rule parameters;
[0279] According to the rule parameters, determining a rule function corresponding to the rule parameters in a preset rule library;
[0280] The rule parameters are configured using the rule function to obtain field parameters configured by the rule function;
[0281] The field rule parameters of the form are generated according to the field parameters configured by the rule function, and the field rule parameters of the form are sent to the front-end page to configure the form.
[0282] The structural diagram of the electronic device in this embodiment is as follows: Fig.11 shown.
[0283] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a first computer program for executing the following method, for example, including:
[0284] Acquire multiple field parameters of the form from a database according to the received form configuration request; wherein the field parameters include rule parameters;
[0285] According to the rule parameters, determining a rule function corresponding to the rule parameters in a preset rule library;
[0286] The rule parameters are configured using the rule function to obtain field parameters configured by the rule function;
[0287] The field rule parameters of the form are generated according to the field parameters configured by the rule function, and the field rule parameters of the form are sent to the front-end page to configure the form.
[0288] The present invention further provides an electronic device, comprising a second memory, a second processor, and a second computer program stored in the second memory and executable on the second processor, wherein the second processor implements the following method when executing the program, for example, including:
[0289] Acquire multiple field parameters of the form from a database according to the received form configuration request; wherein the field parameters include rule parameters;
[0290] According to the rule parameters, determining a rule function corresponding to the rule parameters in a preset rule library;
[0291] The rule parameters are configured using the rule function to obtain field parameters configured by the rule function;
[0292] The field rule parameters of the form are generated according to the field parameters configured by the rule function, and the field rule parameters of the form are sent to the front-end page to configure the form.
[0293] The electronic device in this embodiment has the same structure as the electronic device in the above embodiment. Fig.11 .
[0294] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a second computer program for executing the following method, specifically comprising:
[0295] Acquire multiple field parameters of the form from a database according to the received form configuration request; wherein the field parameters include rule parameters;
[0296] According to the rule parameters, determining a rule function corresponding to the rule parameters in a preset rule library;
[0297] The rule parameters are configured using the rule function to obtain field parameters configured by the rule function;
[0298] The field rule parameters of the form are generated according to the field parameters configured by the rule function, and the field rule parameters of the form are sent to the front-end page to configure the form.
[0299] like Fig.11 As shown, the electronic device 600 may further include: a communication module 110, an input unit 120, an audio processor 130, a display 160, and a power supply 170. It is worth noting that the electronic device 600 does not necessarily have to include Fig.11 In addition, the electronic device 600 may also include Fig.11 For components not shown, reference may be made to the prior art.
[0300] like Fig.11 As shown, the central processor 100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices. The central processor 100 receives inputs and controls the operations of various components of the electronic device 600.
[0301] The memory 140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 100 may execute the program stored in the memory 140 to implement information storage or processing.
[0302] The input unit 120 provides input to the CPU 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used to display display objects such as images and text. The display may be, for example, an LCD display, but is not limited thereto.
[0303] The memory 140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 140 may also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage unit 142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 600 through the central processor 100.
[0304] The memory 140 may also include a data storage unit 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0305] The communication module 110 is a transmitter / receiver that transmits and receives signals via the antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processor 100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0306] Based on different communication technologies, multiple communication modules 110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module. The communication module (transmitter / receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide an audio output via the speaker 131 and receive an audio input from the microphone 132, thereby realizing a common telecommunication function. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 130 is also coupled to the central processor 100, so that the sound can be recorded on the local machine through the microphone 132, and the sound stored on the local machine can be played through the speaker 131.
[0307] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0308] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0309] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0310] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0311] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A form configuration method, characterized in that: The method comprises: Acquire multiple field parameters of the form from a database according to the received form configuration request; wherein the field parameters include rule parameters; According to the rule parameters, a rule function corresponding to the rule parameters is determined in a preset rule library, wherein the rule function includes whether it is visible, a data source of a selection class control, and whether it is editable; The rule function is used to configure the rule parameters to obtain field parameters configured by the rule function, wherein the parameter name, parameter value and form association information of the rule function are written into the corresponding rule parameters to obtain the field parameters configured by the rule function, and the form association information represents the relationship between tables; The field rule parameters of the form are generated according to the field parameters configured by the rule function, and the field rule parameters of the form are sent to the front-end page to configure the form, wherein the field rule parameters are parameters recognizable by the public template of the front-end page.
2. The method according to claim 1, characterized in that: The step of determining, according to the rule parameter, a rule function corresponding to the rule parameter in a preset rule base comprises: According to the function name in the rule parameter, a rule function corresponding to the function name is determined in a preset rule library.
3. The method according to claim 1, characterized in that: The step of configuring the rule parameters by using the rule function to obtain the field parameters configured by the rule function includes: Write the parameter name, parameter value and form-related information of the rule function into the corresponding rule parameters to obtain the field parameters configured by the rule function.
4. The method according to claim 3, characterized in that The method further includes: determining the association relationship of the forms according to the form association information in the rule parameters.
5. A form configuration method, characterized in that: The method comprises: Receive and parse the field rule parameters of the form sent by the backend server to obtain multiple field parameters configured by the rule function; Use the preset public template to match form controls and bind rules according to the field parameters configured by the rule function to complete the form configuration; The process of generating the field rule parameters includes: Acquiring multiple field parameters of the form including rule parameters from a database through the back-end server according to the received form configuration request; According to the rule parameters, a rule function corresponding to the rule parameters is determined in a preset rule library, wherein the rule function includes whether it is visible, a data source of a selection class control, and whether it is editable; The rule function is used to configure the rule parameters to obtain field parameters configured by the rule function, wherein the parameter name, parameter value and form association information of the rule function are written into the corresponding rule parameters to obtain the field parameters configured by the rule function, and the form association information represents the relationship between tables; The field rule parameters of the form are generated according to the field parameters configured by the rule function, and the field rule parameters of the form are sent to the front-end page to configure the form, wherein the field rule parameters are parameters recognizable by the public template of the front-end page.
6. The method according to claim 5, characterized in that The field parameters configured by the rule function include rule parameters, and the rule parameters include the function name, parameter name, parameter value and form association information of the rule function.
7. The method according to claim 6, characterized in that The method of using a preset public template to match form controls and bind rules according to field parameters configured by a rule function includes: Match multiple form controls in the preset common module with the field parameters configured by the rule function; Rules are bound to each form control according to the function name, parameter name, parameter value and form association information in the rule parameters corresponding to each form control.
8. A form configuration device, characterized in that: The device comprises: A field information module, used to obtain multiple field parameters of the form from the database according to the received form configuration request; wherein the field parameters include rule parameters; A rule function module, used to determine a rule function corresponding to the rule parameter in a preset rule library according to the rule parameter, wherein the rule function includes whether it is visible, a data source of a selection class control, and whether it is editable; A field parameter module, used to configure the rule parameters using the rule function to obtain the field parameters configured by the rule function, wherein the parameter name, parameter value and form association information of the rule function are written into the corresponding rule parameters to obtain the field parameters configured by the rule function, and the form association information represents the relationship between tables; The parameter generation module is used to generate the field rule parameters of the form according to the field parameters configured by the rule function, and send the field rule parameters of the form to the front-end page to configure the form, wherein the field rule parameters are parameters recognizable by the public template of the front-end page.
9. The device according to claim 8, characterized in that The rule function module is also used to determine the rule function corresponding to the function name in the preset rule library according to the function name in the rule parameter.
10. The device according to claim 8, characterized in that The field parameter module is also used to write the parameter name, parameter value and form association information of the rule function into the corresponding rule parameter to obtain the field parameter configured by the rule function.
11. The device according to claim 10, characterized in that The device further comprises: an association relationship module, which is used to determine the association relationship of the forms according to the form association information in the rule parameters.
12. A form configuration device, characterized in that: The device comprises: The parameter parsing module is used to receive and parse the field rule parameters of the form sent by the backend server to obtain multiple field parameters configured by the rule function; The form configuration module is used to use the preset public template to match form controls and bind rules according to the field parameters configured by the rule function to complete the form configuration; The generation process of the field rule parameters is implemented by the following modules: A field information module, used to obtain multiple field parameters of the form from the database according to the received form configuration request; wherein the field parameters include rule parameters; A rule function module, used to determine a rule function corresponding to the rule parameter in a preset rule library according to the rule parameter, wherein the rule function includes whether it is visible, a data source of a selection class control, and whether it is editable; A field parameter module, used to configure the rule parameters using the rule function to obtain the field parameters configured by the rule function, wherein the parameter name, parameter value and form association information of the rule function are written into the corresponding rule parameters to obtain the field parameters configured by the rule function, and the form association information represents the relationship between tables; The parameter generation module is used to generate the field rule parameters of the form according to the field parameters configured by the rule function, and send the field rule parameters of the form to the front-end page to configure the form, wherein the field rule parameters are parameters recognizable by the public template of the front-end page.
13. The device according to claim 12, characterized in that The field parameters configured by the rule function include rule parameters, and the rule parameters include the function name, parameter name, parameter value and form association information of the rule function.
14. The device according to claim 13, characterized in that The form configuration module includes: A control matching unit is used to match multiple form controls in a preset common module with field parameters configured by a rule function; The rule binding unit is used to perform rule binding on each form control according to the function name, parameter name, parameter value and form association information in the rule parameters corresponding to each form control.
15. An electronic device comprising a first memory, a first processor, and a first computer program stored in the first memory and executable on the first processor, characterized in that: When the first processor executes the first computer program, the method according to any one of claims 1 to 4 is implemented.
16. An electronic device comprising a second memory, a second processor, and a second computer program stored in the second memory and executable on the second processor, characterized in that: When the second processor executes the second computer program, the method according to any one of claims 5 to 7 is implemented.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a first computer program for executing the method according to any one of claims 1 to 4.
18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a second computer program for executing the method according to any one of claims 5 to 7.
Citation Information
Patent Citations
Form configuration method and device, computer equipment and storage medium
CN110069764A