CN118312178A - Form page generation method and device, computer equipment and readable storage medium - Google Patents

Form page generation method and device, computer equipment and readable storage medium

Info

Publication number
CN118312178A
CN118312178A CN202410552729.3A CN202410552729A CN118312178A CN 118312178 A CN118312178 A CN 118312178A CN 202410552729 A CN202410552729 A CN 202410552729A CN 118312178 A CN118312178 A CN 118312178A
Authority
CN
China
Prior art keywords
page
generating
code
configuration
configuration table
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.)
Pending
Application number
CN202410552729.3A
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Publication of CN118312178A publication Critical patent/CN118312178A/en
Pending legal-status Critical Current

Links

Abstract

The application relates to a method, a device, computer equipment, a readable storage medium and a computer program product for generating form pages, and relates to the technical field of big data. The method comprises the following steps: responding to a page generation request aiming at a target form page to be generated, and displaying at least one page configuration table for generating the form page; acquiring page configuration attribute values which are input in each page configuration table and matched with the target form page, and generating element construction codes for each page configuration table according to the page configuration attribute values input in each page configuration table and preset code templates corresponding to the page configuration tables; and running element construction codes, constructing page elements contained in the target form page, and rendering the page elements to generate the target form page. By adopting the method, the generation efficiency of the form page can be improved.

Description

Form page generation method and device, computer equipment and readable storage medium
Technical Field
The present application relates to the field of big data technology, and in particular, to a method, an apparatus, a computer device, a computer readable storage medium, and a computer program product for generating a form page.
Background
With the increase of the service quantity, the front-end page quantity is obviously increased, and more service scenes need elements such as forms, lists, query conditions and the like in new pages to realize requirements.
However, with the wide use of these page elements, the corresponding development workload is greatly increased, and the verification operation of the submitted field of the corresponding form is very complicated; and the development work corresponding to the newly added elements, form verification, interface call and the like is mostly repetitive labor, and a large amount of manpower resources are consumed.
Therefore, the current generation technology of the form filling page aiming at the front end has the problem of low generation efficiency of the form page.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a form page generation method, apparatus, computer device, computer readable storage medium, and computer program product that can improve the form page generation efficiency.
In a first aspect, the present application provides a method for generating a form page. The method comprises the following steps:
Responding to a page generation request aiming at a target form page to be generated, and displaying at least one page configuration table for generating the form page;
acquiring page configuration attribute values which are input in the page configuration tables and matched with the target form page, and generating element construction codes for the page configuration tables according to the page configuration attribute values input in the page configuration tables and preset code templates corresponding to the page configuration tables;
And running the element construction code, constructing page elements contained in the target form page, and rendering the page elements to generate the target form page.
In one embodiment, the page configuration table includes a page element configuration table, the element construction code includes element identity construction code, and the generating element construction code for each of the page configuration tables includes:
generating the element identity construction code according to the page element configuration table;
wherein the element identity construction code is configured to create an instance of the page element according to the identity of each page element.
In one embodiment, the page element configuration table includes an element type of a page element, and rendering the page element includes:
Acquiring the element type corresponding to the current page element from the page element configuration table; the current page element is any one of page elements contained in the target form page;
obtaining target element rendering codes matched with the element types from a plurality of preconfigured element rendering codes;
and executing the element rendering code, and rendering each current page element to generate the target form page.
In one embodiment, the page configuration table includes an element check rule table, the element build code includes an element check rule build code, and the generating the element build code for each of the page configuration tables includes:
Generating the element check rule construction code according to the element check rule table;
the element check rule construction code is used for determining a rule for performing data check on each page element.
In one embodiment, after the step of generating the target form page, the method further comprises:
Responding to a form information submitting instruction input by a page filling account after filling the target form page, and inquiring to obtain the element verification rule construction codes corresponding to the page elements in the filled target form page;
Executing the element verification rule construction code, and verifying each page element in the filled target form page to obtain a verification result;
and under the condition that the verification result is that the verification is successful, storing the target form page which is that the verification is successful.
In one embodiment, the page configuration table includes a page element interface configuration table, the element build code includes element interface call code, and the generating element build code for each of the page configuration tables includes:
Acquiring element types corresponding to the current page elements; the current page element is any one of page elements contained in the target form page;
generating a parameter calling interface address of each selectable option corresponding to the option type according to the page element interface configuration table aiming at the element with the option type;
and generating the element interface calling code according to the parameter calling interface address.
In one embodiment, the generating the element construction code for each of the page configuration tables includes:
Checking the page configuration table to obtain a checking result; the test result is used for representing the integrity of the page configuration table;
and generating a construction code aiming at the element of the page configuration table under the condition that the check result is that the page configuration table is complete.
In a second aspect, the application further provides a device for generating the form page. The device comprises:
The page configuration table display module is used for responding to a page generation request aiming at a target form page to be generated and displaying at least one page configuration table for generating the form page;
The code generation module is used for acquiring page configuration attribute values which are input in the page configuration tables and matched with the target form page, and generating element construction codes for the page configuration tables according to the page configuration attribute values input in the page configuration tables and preset code templates corresponding to the page configuration tables;
The form page generation module is used for running the element construction codes, constructing page elements contained in the target form page, rendering the page elements and generating the target form page.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
Responding to a page generation request aiming at a target form page to be generated, and displaying at least one page configuration table for generating the form page;
acquiring page configuration attribute values which are input in the page configuration tables and matched with the target form page, and generating element construction codes for the page configuration tables according to the page configuration attribute values input in the page configuration tables and preset code templates corresponding to the page configuration tables;
And running the element construction code, constructing page elements contained in the target form page, and rendering the page elements to generate the target form page.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
Responding to a page generation request aiming at a target form page to be generated, and displaying at least one page configuration table for generating the form page;
acquiring page configuration attribute values which are input in the page configuration tables and matched with the target form page, and generating element construction codes for the page configuration tables according to the page configuration attribute values input in the page configuration tables and preset code templates corresponding to the page configuration tables;
And running the element construction code, constructing page elements contained in the target form page, and rendering the page elements to generate the target form page.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of:
Responding to a page generation request aiming at a target form page to be generated, and displaying at least one page configuration table for generating the form page;
acquiring page configuration attribute values which are input in the page configuration tables and matched with the target form page, and generating element construction codes for the page configuration tables according to the page configuration attribute values input in the page configuration tables and preset code templates corresponding to the page configuration tables;
And running the element construction code, constructing page elements contained in the target form page, and rendering the page elements to generate the target form page.
The method, the device, the computer equipment, the storage medium and the computer program product for generating the form pages are characterized in that firstly, page configuration tables are displayed in response to a page generation request aiming at target form pages to be generated, then page configuration attribute values input in the page configuration tables are obtained, element construction codes aiming at the page configuration tables are generated according to the page configuration attribute values input in the page configuration tables and preset code templates corresponding to the page configuration tables, finally, element construction codes are operated, page elements contained in the target form pages are constructed, the page elements are rendered, and the target form pages are generated; the front-end page is added with the repeated element updating work such as form element, verification rule and logic, interface calling and return value analysis, back-end added parameter verification and the like, and unified configuration is carried out, so that a large number of repeated operations of developers are reduced, maintenance cost is reduced, development efficiency is improved, and form page generation efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related art, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
FIG. 1is an application environment diagram of a method of generating form pages in one embodiment;
FIG. 2 is a flow diagram of a method of generating form pages in one embodiment;
FIG. 3 is a flow chart of a method of generating form pages in another embodiment;
FIG. 4 is an overall flow diagram of a method of generating form pages in one embodiment;
FIG. 5 is a schematic diagram of a verification flow of a method of generating form pages in one embodiment;
FIG. 6 is a block diagram of an apparatus for generating form pages in one embodiment;
FIG. 7 is an internal block diagram of a computer device in one embodiment;
fig. 8 is an internal structural view of a computer device in another embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
It should be noted that, the method, the device, the computer device, the storage medium and the computer program product for generating the form page disclosed in the present application may be applied to the field of financial science and technology, and may also be applied to any field other than the field of financial science and technology.
The method for generating the form page provided by the embodiment of the application can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network.
The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, where the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In one embodiment, as shown in fig. 2, a method for generating a form page is provided, and the method is applied to the terminal 102 in fig. 1 for illustration, and includes the following steps:
s201, responding to a page generation request for a target form page to be generated, and displaying at least one page configuration table for generating the form page.
The target form page refers to a page to be generated and containing form contents, the page is used for displaying a filling account of the page, and the filling account can finish information filling by inputting contents of page elements corresponding to the form in the page, and finally finish data input aiming at the form.
The page generation request refers to a request instruction initiated by the program development account to generate a certain page. Program development account refers to an account of a program developer who realizes page generation software by using the form page generation method of the present application.
The page configuration table is a table for configuring contents in a page, and may include a page element configuration table, an element check rule table, and a page element interface configuration table, for example. The number of page configuration tables may be one or a plurality of page configuration tables.
S202, acquiring page configuration attribute values which are input in each page configuration table and matched with the target form page, and generating element construction codes for each page configuration table according to the page configuration attribute values input in each page configuration table and preset code templates corresponding to the page configuration tables.
The page configuration attribute value is the content input by the program development account in each page configuration table, and is matched with the target form page. For example, if the page includes the "date" element, then the "date" element may correspond to a page configuration attribute value of "2024, 1 month, 1 day".
The preset code template is a preset template for generating codes, and the template comprises rules for generating codes.
The element construction code refers to a code generated by using a preset code template and referring to key information in a page configuration table, and the task of the code is to construct an element, for example, a construction process may include creating an instance of the element, and determining a verification rule and interface information corresponding to the element.
S203, running element construction codes, constructing page elements contained in the target form page, and rendering the page elements to generate the target form page.
The page elements are elements constituting the content in the page, such as DOM (Document Object Model ) elements, and each content item to be collected or to be subjected to data entry in a table pointed by the page elements, such as a data reporting mechanism, an occurrence date, a statistical period, a client system code, a first-level classification of a product, a product name and the like.
For example, after the elements are built, rendering may be performed according to the presentation style of each element, and a page including the element names and input boxes of each element is generated.
In the method for generating the form page, firstly, a page configuration table is displayed in response to a page generation request aiming at a target form page to be generated, then page configuration attribute values input in the page configuration tables are obtained, element construction codes aiming at the page configuration tables are generated according to the page configuration attribute values input in the page configuration tables and preset code templates corresponding to the page configuration tables, finally, element construction codes are operated, page elements contained in the target form page are constructed, and the page elements are rendered to generate the target form page; the front-end page is added with the repeated element updating work such as form element, verification rule and logic, interface calling and return value analysis, back-end added parameter verification and the like, and unified configuration is carried out, so that a large number of repeated operations of developers are reduced, maintenance cost is reduced, development efficiency is improved, and form page generation efficiency is improved.
In one embodiment, generating element build code for each page configuration table includes: and generating element identity construction codes according to the page element configuration table.
The page configuration table comprises a plurality of page element configuration tables, one page element configuration table corresponds to each page element, and basic attribute information corresponding to the element, such as element ID, element type and the like, is recorded in the page element configuration table.
Wherein the element build code comprises an element identity build code for creating instances of the page elements from the identity characteristics of each page element.
Illustratively, when there is an element of the "statistics period" in the element configuration table, the element identity build code includes instructions to create an instance of the "statistics period" element.
In the embodiment, the element identity construction code is generated by using the configured page element configuration table, and the element identity construction code is used for generating the examples of each element in the page when the element identity construction code is executed, so that the manual modification of a program when the types and the numbers of the elements are changed is avoided, and the program development efficiency of the element creation process is improved.
In one embodiment, the page element configuration table includes element types of page elements, and the rendering of the page elements includes: acquiring an element type corresponding to a current page element from a page element configuration table; obtaining target element rendering codes matched with element types from a plurality of preconfigured element rendering codes; and executing element rendering codes, and rendering each current page element to generate a target form page.
The current page element is any one of page elements contained in the target form page.
The preconfigured multiple element rendering codes can be rendering codes aiming at types of numbers, input boxes, drop-down boxes, mechanism selection boxes, date selection boxes and the like, and each element type corresponds to one rendering style.
Illustratively, the front end performs tag judgment by using dynamic characteristics in the programming framework, so as to identify the configured element types, and performs rendering aiming at different element types to realize page rendering.
In the embodiment, firstly, the element type corresponding to the current page element is obtained from a page element configuration table, then, a target element rendering code matched with the element type is obtained from a plurality of preconfigured element rendering codes, and finally, the element rendering codes are executed to render each current page element, so that a target form page is generated; by identifying the element types and matching different element styles, the rendering of each element in the page is sequentially realized, and the page rendering efficiency is improved.
In one embodiment, generating element build code for each page configuration table includes: and generating element check rule construction codes according to the element check rule table.
The page configuration table comprises an element check rule table, and the element check rule table comprises check rules of different types.
The element construction codes comprise element verification rule construction codes, wherein the element verification rule construction codes are program codes for verifying the page elements of all types and are used for determining rules for verifying data for the page elements.
In the embodiment, the element verification rule construction code is generated by using the configured element verification rule table and is used for verifying the content filled in the page after the element is established, so that manual modification of a program when the element verification rule is changed is avoided, and the program development efficiency aiming at the element verification process is improved.
In one embodiment, after the step of generating the target form page, the method further comprises: responding to a form information submitting instruction input by a page filling account after filling a target form page, and inquiring to obtain element verification rule construction codes corresponding to page elements in the filled target form page; executing element verification rule construction codes, and verifying each page element in the filled target form page to obtain a verification result; and under the condition that the verification result is that the verification is successful, storing the target form page of which the verification is successful.
The page filling account refers to an account for filling the corresponding content of each element in the page after the page is generated, and the form information submitting instruction refers to an instruction for confirming the submitting after the content is input.
Illustratively, a check rule is bound to a page element with element ID "e252", the rule specifically includes a type "must input" type, the rule takes effect by default, the field is checked before submission, after submission and after importing, and if the check fails, the user is prompted to "please input a statistics period".
In the embodiment, firstly, a form information submitting instruction input by a page filling account after filling a target form page is responded, element verification rule construction codes corresponding to page elements in the filled target form page are inquired and obtained, then the element verification rule construction codes are executed, each page element in the filled target form page is verified to obtain a verification result, and finally, the target form page with verification success is saved under the condition that the verification result is verification success; the check of different elements is realized by inquiring the pre-generated code constructed by the check rules of the elements and utilizing the inquired available codes, so that the check efficiency of the elements in the page is improved.
In one embodiment, the page configuration table comprises a page element interface configuration table, the element build code comprises element interface call code, and generating the element build code for each page configuration table comprises: acquiring element types corresponding to the current page elements; aiming at the element with the element type being the option type, generating a parameter call interface address of each selectable option corresponding to the option type according to the page element interface configuration table; and generating element interface calling codes according to the parameter calling interface addresses.
The current page element is any one of page elements contained in the target form page.
The option type refers to an element type that the element has selectable options, and the parameter call interface address of the selectable options characterizes the acquisition path of the parameters in each option. For example, the element type of an "age" element is "option type", the available options can be "1 year old" to "100 years old", the data of the option "100 years old" needs to be stored in the corresponding location in the database, and then the path URL obtained by the parameter corresponding to the option "100 years old" is the interface address of the option "100 years old". Thus, the interface address may be inserted into a pre-set code template, generating the element interface call code.
In this embodiment, firstly, an element type corresponding to a current page element is obtained, then, for an element with an element type being an option type, a parameter call interface address of each selectable option corresponding to the option type is generated according to a page element interface configuration table, and finally, an element interface call code is generated according to the parameter call interface address; the element interface calling code is generated by utilizing the configured page element interface configuration table and is used for calling parameters of element options after the elements are established, so that manual modification of a program when interfaces of the element options are changed is avoided, and the program development efficiency of the element option interface calling process is improved.
In one embodiment, generating element build code for each page configuration table includes: checking the page configuration table to obtain a checking result; and generating element construction codes aiming at the page configuration table under the condition that the check result is that the page configuration table is complete.
The verification result is used for representing the integrity of the configuration information corresponding to each page element. For example, the page element configuration table, the element check rule table and the page element interface configuration table corresponding to the element exist, which indicate that the data is complete and the check is successful.
In the embodiment, firstly, a page configuration table is checked to obtain a check result, and then element construction codes aiming at the page configuration table are generated under the condition that the check result is that the page configuration table is complete; by means of integrity checking of various contents in the page configuration table, feasibility of code generation is guaranteed, and reliability of form page generation is further improved.
In another embodiment, as shown in fig. 3, a method for generating a form page is provided, including the following steps:
s301, checking the page configuration table to obtain a checking result.
S302, generating element identity construction codes according to the page element configuration table under the condition that the page configuration table is complete as a result of the inspection.
S303, generating element check rule construction codes according to the element check rule table.
S304, aiming at the element with the element type being the option type, generating parameter call interface addresses of all selectable options corresponding to the option type according to the page element interface configuration table.
S305, generating element interface calling codes according to the parameter calling interface addresses.
It should be noted that, the specific limitation of the above steps may refer to the specific limitation of the method for generating a form page, which is not described herein.
In order to solve the problem of repetitive human consumption in the development process, the present application provides a method for generating a form page, which is also referred to as a frame design scheme based on VUE frame and database configuration, and the method for generating a form page is described in detail in a specific embodiment with reference to fig. 4 and 5. It is to be understood that the following description is exemplary only and is not intended to limit the application to the details of construction and the arrangements of the components set forth herein.
The method for generating the form page provided by the application carries out unified configuration management on the repetitive work, and the program codes only carry out analysis work of relevant configuration so as to reduce a large number of repetitive operations of developers. The repetitive work includes adding DOM (Document Object Model ) elements, form verification, and interface call.
Wherein the DOM element refers to each content item to be collected or data entered in the table, such as a datagram mechanism, date of occurrence, statistics period, customer system code, first level classification of product, product name, etc. Form verification refers to verifying form data input by a user, and interface call refers to calling interfaces facing parameters of corresponding selectable options in an input box with drop-down options in the form.
In addition, the application realizes configuration management by means of the dynamic characteristics of Vue (Vue. Js, progressive JavaScript framework): the DOM elements, the check rules, the list header and the interface call information are configured uniformly, the configuration analysis is carried out by the framework, and the developer is not required to carry out repeated work.
In the aspect of hot deployment, the application introduces a built-in cache mechanism, does not need to query configuration information in real time, is used for improving query efficiency, and simultaneously, the cache is emptied at regular time, so that the dynamic loading of the configuration information can be realized, and the dynamic display of the page can be realized without restarting.
In the aspect of overall design, the application calls the unified interface to acquire page configuration when the page is loaded, the back end queries the cache preferentially according to the page ID, and if the page information is not in the cache, the back end queries the database to acquire configuration information.
The unified interface refers to a universal API interface, and is used for providing consistent data access and operation modes. In this case, the unified interface is used to obtain page configuration information, whether from a cache or a database, and the developer only needs to call the one interface. Specifically, the acquisition path of the page configuration information may be selected according to the specific request content of HTTP.
The page ID is a unique identifier for identifying different pages and is used for distinguishing different page configuration information, and the back end queries corresponding configuration information in a cache or a database according to the page ID. The existence of the page ID can help the system to accurately acquire and load the configuration of the specific page, and the flexibility and maintainability of the system are improved.
Referring to fig. 4 for the overall flow, fig. 4 is also referred to as a configuration query flow chart. The three judging actions in fig. 4 respectively complete the judgment of whether DOM elements, check rules and interface information exist in the cache, and aim to ensure the integrity of configuration information and complete the task of generating pages. The integration result set after judgment refers to the obtained final complete configuration information, namely, the configuration information after inspection and the page ID are bound one by one, so that the generation of the page is facilitated. Thus, the core code of the query page configuration process may include: query DOM elements, query check rules, query interface information, and integration information.
In the aspect of page configuration database design, the application mainly relates to three core tables, namely a page element configuration table, an element check rule configuration table and an element interface configuration table. The three tables are associated with each other by ELEMENT ID (element_ID).
Illustratively, all fields presented on the configuration page in the page element configuration table, including hidden fields, are detailed in the following table.
According to the code data which can be generated by the table, the corresponding function is realized, and the configuration process of the element of the statistical period can be realized by executing the code. For example, the meaning of this piece of code data may be: the page with the page ID of "LED001_1" has a DATE selection control named "statistics period", the control is month selection, and if the user selects month one 2024, the page is displayed as "month 01 2024", the actual value is "202401", the element is a non-hidden element and a non-linkage element, and the field submitted to the back end is named "LEDGER _DATE". Wherein, an element in the page corresponds to a page element configuration table.
Illustratively, the page element check rule table configures check rules corresponding to all DOM elements, as detailed in the following table.
And according to the code data which can be generated by the table, the corresponding function is realized, and the verification process of the corresponding element can be realized by executing the code. For example, the meaning of this piece of code data may be: the page ELEMENT with ELEMENT ID (element_ID) of "e252" binds a check rule, the rule is of "must-input" type, the rule takes effect by default, the field is checked before submission, after submission and after importing, and if the check fails, the user is prompted to "please input a statistical period".
The field of 'EFFECT_RANGE' in the table represents the effective RANGE of the check rule, and is used for distinguishing in the request process and corresponding to different check actions, and specifically comprises front-end form submission check, rear-end data receiving check and importing check.
Illustratively, the page element interface configuration table configures interface call information bound by all DOM elements, is used for a drop-down box type query option, is an element (a drop-down box) with a plurality of options, and needs to call an interface of option parameter information, wherein the parameter information refers to the content of each option. The page element interface configuration table is detailed in the following table.
And according to the code data which can be generated by the table, the corresponding function is realized, and the configuration of the interface information of the corresponding element can be realized by executing the code. For example, the meaning of this piece of code data may be: the page ELEMENT with ELEMENT ID (element_ID) of "e063" binds an interface with URL "/rtm/LEDGERDICT/GETDICTITEMS", and when the interface is called, a parameter is required to be transmitted, the parameter is named "type", and the parameter value is "DIC032".
In the aspect of front-end DOM ELEMENT TYPE rendering design, DOM ELEMENTs comprise 5 TYPEs of digital TYPE, input box, drop-down box, mechanism selection box and date selection box, and the front end dynamically renders according to ELEMENT TYPE (element_TYPE). The specific rendering process comprises the following steps: the front end judges the label by utilizing the v-if attribute in the dynamic characteristic of the VUE, so that the TYPE of the ELEMENT corresponding to the configured element_TYPE is identified for rendering, other attributes are respectively bound with the configuration information, and finally page rendering is realized.
The v-if instruction is used for dynamically controlling the display and the hiding of the page elements according to the conditions, and dynamically displaying different contents according to different conditions, so that flexible rendering and interaction effects of the page are realized. Through the v-if instruction, different types of elements can be dynamically rendered according to the element types in the configuration information, so that the personalized display and customization functions of the page are realized.
In the aspect of analysis design of the back-end check rule, the check rule comprises 4 check types of date type, digital precision type, must-input type and maximum length type. To avoid a large number of decisions in the code, and to also avoid altering the core code for future additions of new types, the present application instantiates rule objects at the back end using factory patterns in the design pattern. And searching the corresponding RULE class according to the RULE TYPE (RULE_TYPE) to realize different verification modes. And if a check TYPE is needed to be added later, only one RULE_TYPE is needed to be added, and the corresponding implementation TYPE is added.
In the verification process of the back-end form, a user submits the form after filling in the form, the back-end queries the form configuration to analyze, verifies the corresponding verification rule of the form element item by item, and returns successful submission after all the form elements pass. In performing form data verification, the verification input element and the verification select element are typically involved. Both refer to the step of verifying the text input box (input) and the drop down box (select) in the form, respectively.
Referring to fig. 5 for a specific verification process, fig. 5 is also referred to as a back-end regular verification flowchart, and fig. 5 includes the following steps: the user submits the front-end page after filling in the form; the back end preferentially inquires whether the configuration information corresponding to the form exists in the cache; if the cache does not exist, the cache is refreshed after the database is queried; analyzing the configuration, and instantiating a specific verification object from a factory; checking rules one by one according to the table element; if any one of the rules fails to pass the verification, returning a verification failure; and if the rule passes the whole verification, returning successful verification.
Among them, a Factory Pattern (Factory Pattern) is one of object-oriented design patterns, which belongs to a creation type Pattern, which provides an optimal Pattern for creating objects. The factory schema provides a way to create objects without specifying the specific classes to be created. It provides an encapsulation mechanism when creating an object, separating the code that actually created the object from the usage code.
The method for generating the form page can effectively reduce the repeated codes, such as adding form elements, checking rules and logic, interface calling and return value analysis and adding parameter checking at the rear end to the front end page, so as to reduce the manpower resource consumption and improve the development efficiency. In addition, the method for generating the form page can also perform unified configuration management on the work so as to reduce the later maintenance workload, ensure that all information is in a database, ensure that maintenance configuration is clear at a glance, reduce maintenance cost and further improve the work efficiency.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a form page generating device for realizing the above related form page generating method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiment of the generating device of one or more form pages provided below may refer to the limitation of the generating method of the form pages hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 6, there is provided a form page generating apparatus, including: a page configuration table display module 601, a code generation module 602, and a form page generation module 603, wherein:
the page configuration table display module 601 is configured to respond to a page generation request for a target form page to be generated, and display at least one page configuration table for generating the form page;
The code generating module 602 is configured to obtain the page configuration attribute values input in each page configuration table and matched with the target form page, and generate element construction codes for each page configuration table according to the page configuration attribute values input in each page configuration table and the preset code templates corresponding to the page configuration tables;
The form page generation module 603 is configured to run element construction codes, construct page elements included in the target form page, and render the page elements to generate the target form page.
In one embodiment, the apparatus is for: generating element identity construction codes according to the page element configuration table; wherein the element identity construction code is used for creating an instance of the page element according to the identity characteristics of each page element.
In one embodiment, the apparatus is for: acquiring an element type corresponding to a current page element from a page element configuration table; the current page element is any one of page elements contained in the target form page; obtaining target element rendering codes matched with element types from a plurality of preconfigured element rendering codes; and executing element rendering codes, and rendering each current page element to generate a target form page.
In one embodiment, the apparatus is for: generating an element check rule construction code according to the element check rule table; the element check rule construction code is used for determining a rule for data check for each page element.
In one embodiment, the apparatus is for: responding to a form information submitting instruction input by a page filling account after filling a target form page, and inquiring to obtain element verification rule construction codes corresponding to page elements in the filled target form page; executing element verification rule construction codes, and verifying each page element in the filled target form page to obtain a verification result; and under the condition that the verification result is that the verification is successful, storing the target form page of which the verification is successful.
In one embodiment, the apparatus is for: acquiring element types corresponding to the current page elements; the current page element is any one of page elements contained in the target form page; aiming at the element with the element type being the option type, generating a parameter call interface address of each selectable option corresponding to the option type according to the page element interface configuration table; and generating element interface calling codes according to the parameter calling interface addresses.
In one embodiment, generating element build code for each page configuration table includes: checking the page configuration table to obtain a checking result; the test result is used for representing the integrity of the page configuration table; and generating element construction codes aiming at the page configuration table under the condition that the check result is that the page configuration table is complete.
The above-described respective modules in the form page generating apparatus may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing data. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a method of generating form pages.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure thereof may be as shown in fig. 8. The computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input means. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program, when executed by a processor, implements a method of generating form pages. The display unit of the computer device is used for forming a visual picture, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be a key, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by persons skilled in the art that the structures shown in fig. 7 and 8 are block diagrams of only portions of structures associated with the present inventive arrangements and are not limiting of the computer device to which the present inventive arrangements are applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device includes a memory having a computer program stored therein and a processor that when executing the computer program performs the steps of the method embodiments described above.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magneto-resistive random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (PHASE CHANGE Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (10)

1. A method for generating a form page, the method comprising:
Responding to a page generation request aiming at a target form page to be generated, and displaying at least one page configuration table for generating the form page;
acquiring page configuration attribute values which are input in the page configuration tables and matched with the target form page, and generating element construction codes for the page configuration tables according to the page configuration attribute values input in the page configuration tables and preset code templates corresponding to the page configuration tables;
And running the element construction code, constructing page elements contained in the target form page, and rendering the page elements to generate the target form page.
2. The method of claim 1, wherein the page configuration table comprises a page element configuration table, the element build code comprises element identity build code, the generating element build code for each of the page configuration tables comprises:
generating the element identity construction code according to the page element configuration table;
wherein the element identity construction code is configured to create an instance of the page element according to the identity of each page element.
3. The method according to claim 2, wherein the page element configuration table contains element types of page elements, and rendering the page elements comprises:
Acquiring the element type corresponding to the current page element from the page element configuration table; the current page element is any one of page elements contained in the target form page;
obtaining target element rendering codes matched with the element types from a plurality of preconfigured element rendering codes;
and executing the element rendering code, and rendering each current page element to generate the target form page.
4. The method of claim 1, wherein the page configuration table comprises an element check rule table, the element build code comprises an element check rule build code, the generating element build code for each of the page configuration tables comprises:
Generating the element check rule construction code according to the element check rule table;
the element check rule construction code is used for determining a rule for performing data check on each page element.
5. The method of claim 4, wherein after the step of generating the target form page, the method further comprises:
Responding to a form information submitting instruction input by a page filling account after filling the target form page, and inquiring to obtain the element verification rule construction codes corresponding to the page elements in the filled target form page;
Executing the element verification rule construction code, and verifying each page element in the filled target form page to obtain a verification result;
and under the condition that the verification result is that the verification is successful, storing the target form page which is that the verification is successful.
6. The method of claim 1, wherein the page configuration table comprises a page element interface configuration table, the element build code comprises element interface call code, the generating element build code for each of the page configuration tables comprises:
Acquiring element types corresponding to the current page elements; the current page element is any one of page elements contained in the target form page;
generating a parameter calling interface address of each selectable option corresponding to the option type according to the page element interface configuration table aiming at the element with the option type;
and generating the element interface calling code according to the parameter calling interface address.
7. The method of any one of claims 1 to 6, wherein the generating element build code for each of the page configuration tables comprises:
Checking the page configuration table to obtain a checking result; the test result is used for representing the integrity of the page configuration table;
and generating a construction code aiming at the element of the page configuration table under the condition that the check result is that the page configuration table is complete.
8. A device for generating a target form page, the device comprising:
The page configuration table display module is used for responding to a page generation request aiming at a target form page to be generated and displaying at least one page configuration table for generating the form page;
The code generation module is used for acquiring page configuration attribute values which are input in the page configuration tables and matched with the target form page, and generating element construction codes for the page configuration tables according to the page configuration attribute values input in the page configuration tables and preset code templates corresponding to the page configuration tables;
The form page generation module is used for running the element construction codes, constructing page elements contained in the target form page, rendering the page elements and generating the target form page.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202410552729.3A 2024-05-07 Form page generation method and device, computer equipment and readable storage medium Pending CN118312178A (en)

Publications (1)

Publication Number Publication Date
CN118312178A true CN118312178A (en) 2024-07-09

Family

ID=

Similar Documents

Publication Publication Date Title
CN112800370B (en) Processing method and device of business document, computer equipment and storage medium
CN114115844A (en) Page generation method and device, computer equipment and storage medium
CN116305895A (en) Product model generation method, device, computer equipment and storage medium
CN114265657A (en) Method and device for displaying page of applet
US9230022B1 (en) Customizable result sets for application program interfaces
CN114816405A (en) Business view interface display method and device, computer equipment and storage medium
CN115168668A (en) Information recommendation method and device, computer equipment and storage medium
CN118312178A (en) Form page generation method and device, computer equipment and readable storage medium
CN116263659A (en) Data processing method, apparatus, computer program product, device and storage medium
CN113608737A (en) Page generation method, device, equipment and medium
CN118245699A (en) Page acquisition method, device, equipment, storage medium and computer program product
CN116719892A (en) Data display method, device, computer equipment and storage medium
CN118228313A (en) Platform page display method and device, computer equipment and storage medium
CN117271449A (en) Batch file generation method, apparatus, device, storage medium and program product
CN117130606A (en) Front-end page configuration method, front-end page configuration device, computer equipment and storage medium
CN114201464A (en) Data display method and device, computer equipment and storage medium
CN117555521A (en) Business requirement development method, device, computer equipment and storage medium
CN116431260A (en) Interface rendering method and device based on data model driving and computer equipment
CN115630248A (en) Page determination method and device, computer equipment and storage medium
CN118092910A (en) Target data access display method and related equipment
CN117435651A (en) Test data processing method, device, computer equipment and storage medium
CN116383138A (en) Document changing method, device, computer equipment and storage medium
CN116304407A (en) Page rendering method, device, computer equipment and storage medium
CN116400922A (en) Interface guide schematic diagram generation method, device, computer equipment and storage medium
CN115268717A (en) Method and device for adding measurement points in point inspection management system and computer equipment

Legal Events

Date Code Title Description
PB01 Publication