CN112558967A - Page automatic generation method and device, electronic equipment and storage medium - Google Patents

Page automatic generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112558967A
CN112558967A CN202011482320.7A CN202011482320A CN112558967A CN 112558967 A CN112558967 A CN 112558967A CN 202011482320 A CN202011482320 A CN 202011482320A CN 112558967 A CN112558967 A CN 112558967A
Authority
CN
China
Prior art keywords
page
component
generating
function
information
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
CN202011482320.7A
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202011482320.7A priority Critical patent/CN112558967A/en
Publication of CN112558967A publication Critical patent/CN112558967A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/9038Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/906Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Abstract

The embodiment of the invention discloses a method and a device for automatically generating a page, electronic equipment and a storage medium. The page automatic generation method comprises the following steps: dividing at least two functional blocks according to the display function of the page to be generated; generating associated functional components for the at least two functional blocks; and generating a page component of the page to be generated according to the functional component so as to automatically generate the page according to the page component. The embodiment of the invention realizes the automatic generation of the page, ensures that developers only need to concentrate on the business logic development, reduces the probability of wrong input of the form message field caused by manual development, greatly reduces the repetition of codes, lightens the volume of the codes, accelerates the response speed of the page, improves the automatic generation efficiency of the page, is beneficial to the unification of the page style, and is convenient for the maintenance of the page codes in the later period.

Description

Page automatic generation method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of software development, in particular to a method and a device for automatically generating a page, electronic equipment and a storage medium.
Background
In order to meet the requirements of rapid development and style unification of front-end pages, design and development control of unification of some repeated pages in a system are required, and page style consistency and high usability are realized. Especially for the management system, the query page occupies most pages of the whole management system and is a common page. Without the design and development control of the query page being uniform, the style of the overall management system will be affected.
Currently, there are many open source frameworks on the market that are suitable for management systems, all having their own set of styles, but built only on a single gadget. For the same style of pages, different developers have different thoughts and inconsistent combination and arrangement of small components, so that the developed page styles and code styles are different, and the consistency of the system styles and the maintainability of codes are difficult to realize. Moreover, each page needs to be developed independently by developers, so that a large amount of codes are repeated, the volume of the codes is increased, the quick response of the website is not facilitated, the labor is repeated in the development process, the labor cost is increased, and the resources are wasted.
Disclosure of Invention
The embodiment of the invention provides a method and a device for automatically generating a page, electronic equipment and a storage medium, which are used for improving the efficiency of automatically generating the page, are beneficial to unifying the page style and are convenient for maintaining page codes at the later stage.
In a first aspect, an embodiment of the present invention provides an automatic page generation method, including:
dividing at least two functional blocks according to the display function of the page to be generated;
generating associated functional components for the at least two functional blocks;
and generating a page component of the page to be generated according to the functional component so as to automatically generate the page according to the page component.
In a second aspect, an embodiment of the present invention further provides an apparatus for automatically generating a page, including:
the function block dividing module is used for dividing at least two function blocks according to the display function of the page to be generated;
the functional component generating module is used for generating associated functional components for the at least two functional blocks;
and the page component generating module is used for generating the page component of the page to be generated according to the functional component so as to automatically generate the page according to the page component.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the automatic page generation method according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for automatically generating a page according to any embodiment of the present invention.
The method comprises the steps of dividing at least two functional blocks based on the display function according to the page to be generated; generating associated functional components for at least two functional blocks; and generating a page component of the page to be generated according to the functional component so as to automatically generate the page according to the page component. The embodiment of the invention realizes the automatic generation of the page, ensures that developers only need to concentrate on the business logic development, reduces the probability of wrong input of the form message field caused by manual development, greatly reduces the repetition of codes, lightens the volume of the codes, accelerates the response speed of the page, improves the automatic generation efficiency of the page, is beneficial to the unification of the page style, and is convenient for the maintenance of the page codes in the later period.
Drawings
FIG. 1 is a flowchart of a method for automatically generating a page according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a method for automatically generating a page according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an automatic page generation apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device in a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for automatically generating a page according to a first embodiment of the present invention, which is applicable to a case of automatically generating a page. The method may be performed by an automatic page generation apparatus, which may be implemented in software and/or hardware and may be configured in an electronic device, for example, the electronic device may be a device with communication and computing capabilities, such as a background server. As shown in fig. 1, the method specifically includes:
step 101, dividing at least two functional blocks according to the display function of the page to be generated.
The page is also called as an interface, which refers to a Web interface or an app interface created for presenting to a user in front-end development, and contents to be displayed can be displayed on the page, and the user can also perform operations to complete a data exchange process. The function block refers to one or more areas existing on the page, and a developer can complete corresponding functions through developing the control. Therefore, the page can be divided into different functional blocks according to different display functions, for example, if a query functional block is provided on a page, a control for a user to perform query operation is generated on the page, and the user can query related information according to the prompt of the control; if some pages have the function demonstration function, the developed programs or functions can be displayed to the user; some pages have a communication function, and users can perform online chatting, meeting and the like with administrators or other personnel on the current page through corresponding control areas.
For a complete page, multiple function blocks may be provided to implement multiple different display functions, the specific division is not limited herein, and a user may develop a page of a corresponding function block according to actual requirements.
In one possible embodiment, the page to be generated is a query page;
accordingly, step 101 includes:
and dividing according to the query function of the query page to obtain a page title function block, a form condition function block and a form result function block.
The query page means that a user can perform query operation through the page, and relevant information is obtained by setting and screening query conditions.
The page title function block is the title of the whole query page, has identification and prompting functions, shows the specific inquired function in a text form, can set the font size, color, font and the like of the title according to actual requirements, enables the title to have identification and be clear at a glance, and enables a user to easily understand that the function of the current page is the query function after seeing the title.
The form condition function block is a query condition which can be selected, information concerned by a user often has individual characteristics, a plurality of query conditions are summarized and set according to the concerned conditions of most users and the property of data content, the user can query according to the setting of the query conditions according to the requirement of the user, and the time for the user to acquire the information can be shortened.
The table result function block is a result display area, after a user queries according to set conditions, the system compares data in the database according to query requirements, and when all the data meet the query conditions, the system outputs the data meeting the conditions, the data are displayed in the table function block, and the user can read the data.
Specifically, for a page providing a query function, the page may be divided into three function blocks: a page title function block, a form condition function block, and a form result function block. When a user needs to inquire, an inquiry page is opened, a corresponding inquiry area can be found according to the page title function block, information to be inquired is set through the form condition function block, and finally, after the inquiry is finished, a final inquiry result is checked on the form result function block, and the form result function block can also be provided with a storage function, a downloading function or a printing function according to the requirement for the user to select.
Step 102, generating associated functional components for at least two functional blocks.
The function block refers to a page with corresponding functions, the generation of the page needs to depend on a function component, the function component refers to a control with certain functions, and the function component refers to the encapsulation of data and methods. The control can have its own attribute and method, wherein the attribute is visitor of control data, the method is some simple and visible functions of the control, the control creating process includes designing, developing and debugging
Illustratively, for a page title component of one query function block, mainly there are text type controls, picture components, etc., and display of title characters or display of special pictures, etc. can be realized; for the form function components of the query function, mainly comprising a text edit box component, a pull-down menu control, a date selection control, a button control and the like, setting query conditions; the form function component of the query function mainly comprises a form control and the like, and is used for displaying a query result. The method is not limited to the query function block, and the corresponding function block is designed according to actual requirements.
Specifically, for functional blocks and design styles with different requirements, corresponding functional components are associated to complete the functions of the functional blocks.
In one possible embodiment, step 102 includes:
generating a title functional component according to title information in a preset functional component configuration file;
generating a form functional component according to form condition information in a preset functional component configuration file;
and generating a table function component according to table result information in a preset function component configuration file.
The functional component configuration file is a special file for configuring and generating a corresponding functional component, and after a developer designs an inquiry page, controls and design modes used for forming the title functional component are recorded in the functional component configuration file; recording the controls and design modes used for forming the form functional components in the functional component configuration file; and recording the controls and the design modes used for forming the table functional components in the functional component configuration file. The configuration information may be the type, number, style, arrangement, position, display content, operation mode, etc. of the control.
Specifically, a developer writes a functional component configuration file in advance according to requirements and design concepts, the system reads the functional component configuration file, and generates corresponding title functional components, form functional components and the like according to rules designed in the file.
In one possible embodiment, generating the title function component according to the title information in the preset function component configuration file includes:
generating a title function component according to title attribute information in the title information based on the text component; wherein the title attribute information at least includes title length information, width information, and font attribute information.
The title information is mainly presented in a text form, the design content mainly comprises length information, width information, font attribute information and the like of the title, and the font attribute information comprises text content, font type, font size, font color, italic font and the like of the title. The title attribute information is reasonably designed, so that the title has identification and prompt properties, and can also contain other information, such as the color and scene of the background of the title, or the title can be set into a dynamic display mode.
Specifically, the system designs attribute information related to the title according to the title information in the configuration file, and edits the text component according to the title attribute information to generate a corresponding form.
In one possible embodiment, the generating the form function component according to the form condition information in the preset function component configuration file includes:
determining a related target form item basic component from the candidate form item basic components according to form item attribute information in the form condition information, and generating a form function component according to the target form item basic component;
the form item attribute information at least comprises the type, name, grid width, label width and minimum width of the form item to be displayed.
The form item basic component mainly completes the condition setting function of the query function, so that the type of the form item is firstly determined, the contents to be queried are classified, the name of the form item is determined according to the classified type, and the width of a displayed grid, the width of a label and the minimum width are finally set.
Specifically, after a developer designs a form condition component, the developer writes specific configuration information into a form attribute information file, the system analyzes the form attribute information according to the form attribute information file, selects from candidate form basic components, screens out required target form basic components, generates a target form according to preset information by each target form basic component, and finally combines to generate a form function component.
In a possible embodiment, the attribute information of the form item further includes content verification description information of the form item;
correspondingly, the form function component is generated according to the target form item basic component, and the method comprises the following steps:
and generating a form function component for displaying a corresponding content verification effect according to the content verification description information based on the content verification function in the target form item basic component.
In the working process of the form component, interaction with a user is needed, the user operates a related target form item basic component according to the requirement of the user, and then the system inquires information according to the input information of the user. When a user inputs information, the user sometimes does not notice the range of the input information or inputs wrong information due to misoperation, so that a system is wrong or even crashes. Illustratively, when a user inquires about a certain item of information and inputs a certain target form basic component, the value to be input is between 0 and 10, and the user does not notice when inputting the certain target form basic component, and 15 is input; or the basic component of the target form requires to be input as text information, and the user inputs numerical value information by mistake, and the like, the system can generate processing abnormity when acquiring the information transmitted by the wrong target form component, and even cause the crash of the program. Thus requiring authentication of the information entered by the user.
Specifically, the developer also writes verification information configuration for each form item basic component in the form item attribute information file, that is, after the user inputs information, the form item basic component checks and verifies the user input information according to a preconfigured condition, such as whether the input data meets a format requirement, whether the input data meets a value range, and the like, and if the verification shows that the data input by the user does not meet the requirement, the developer prompts and warns the user in time to correct the user, so that errors are avoided.
In one possible embodiment, the generating the table function component according to the table result information in the preset function component configuration file includes:
based on the table component, generating a table function component according to table attribute information in the table result information;
the table attribute information at least comprises column titles, attributes, grid widths, data processing functions, fixed information, and types, styles, data processing and event processing of each column of data in the table.
The form component mainly completes the result display of the function of the query component, the display form is form display, the design is carried out according to the queried content, firstly, a corresponding data processing function is set according to the query type, after the query by the data processing function is completed, a related form title is generated, and the attributes of the form including the row number, the column number, the grid width and the like of the form are set according to the length of the data content. The setting of fixed information display can be realized according to the characteristics of table display, and the type and style displayed by each column of data in the table, such as the color of a display font, the font size, the background color of the size and the like, can be designed. Meanwhile, some response functions of data processing and event processing can be added, some abnormal situations can be processed, and the like.
Specifically, after a developer designs a form component, the developer writes specific configuration information into a form attribute information file, the system analyzes the form attribute information according to the form attribute information file, selects from candidate form basic components, screens out required target form basic components, generates a target form according to preset information by each target form basic component, and finally combines to generate a form function component.
And 103, generating a page component of the page to be generated according to the functional component, so as to automatically generate the page according to the page component.
Different page components need to be set for different pages, because different pages have different functions and different required page components, a page component herein refers to a functional component divided to form a whole page, and illustratively, for example, a voting page, a title functional component, a voting selection component, a voting result display component, and the like need to be provided.
Specifically, different pages have different functions, corresponding page components are configured according to the functions of the pages, and the page components automatically generate the pages according to preset parameters.
In one possible embodiment, step 103 includes:
and generating the page component of the page to be generated according to the title function component, the form function component and the form function component based on a preset page component configuration file.
After the query page is designed, recording controls and design modes used for forming the title functional components in the functional component configuration file; recording the controls and design modes used for forming the form functional components in the functional component configuration file; and recording the controls and the design modes used for forming the table functional components in the functional component configuration file. The configuration information may be the type, number, style, arrangement, position, display content, operation mode, etc. of the control.
Specifically, a developer writes a functional component configuration file in advance according to requirements and design concepts, the system reads the functional component configuration file, and generates corresponding title functional components, form functional components and form functional components into page components according to rules designed in the file.
In one possible embodiment, the page component configuration file includes at least page header information, page form description information, and page form description information.
The page component configuration file is a special file for configuring and generating a corresponding page component, and after a developer designs an inquiry page, the developer records a control and a design mode used for forming title page information in the page component configuration file; recording controls and design modes used for forming page form description information in a page component configuration file; and recording the control and the design mode used for forming the page table description information in a page component configuration file. The configuration information may be the type, number, style, arrangement, position, display content, operation mode, etc. of the control.
Specifically, a developer writes a page component configuration file in advance according to requirements and design concepts, the system reads the page component configuration file, and generates corresponding title page information, page form description information, page form information and the like according to rules designed in the file.
In one possible embodiment, based on a preset query calling interface, a logical linkage relation is established for the form function component and the form function component in the page component.
Because the form function components in the page components can have different query functions, the query results of different query page components are different, and the query results need to be displayed in different form forms, that is, the form function components in different page components need to be provided with different form function components. Therefore, the form function component and the corresponding form function component in each page component are preset, and the logical relationship between the form function component and the form function component is established.
Specifically, a logic linkage relation is established between the related form function component and the form function component, the logic linkage relation is made into a callable interface and is put into a preset configuration file, the system reads the preset configuration file, the callable interface is inquired according to the form function component type in the page component, the corresponding form function component type is obtained, and the call interface is constructed.
In a possible embodiment, after step 103, the method further includes:
and generating a page template of the page to be generated according to the page component based on a preset page template configuration file.
The query interface occupies most of the interfaces of the whole management system, and is common and common. The style of the entire system will be affected without the control of design and development being uniform. Different developers develop interfaces independently, the interface style and the code style are difficult to keep consistent, and the later interfaces are difficult to maintain uniformly. And if each interface is developed independently, a large amount of codes are repeated, the volume of the codes is increased, the quick response of the website is not facilitated, the labor is repeated in the development process, the labor cost is increased, and the resources are wasted. In the interface development, if some fields corresponding to the messages are manually developed each time, the workload is greatly increased for some more form fields, and errors are easy to occur. Therefore, according to the preset page template configuration file, the page template which can generate the page is manufactured.
In a possible embodiment, after generating the page template of the page to be generated according to the page component, the method further includes:
and setting the content of the page assembly in the page template according to the page development file to generate the page.
For the page template, a developer can configure a corresponding page development file according to the type of the page to be developed, and the page template generates a page according to the page development file. The development speed of developers is greatly increased by only paying attention to the business logic. And the repetition of codes is reduced to a great extent, the volume of the codes is reduced, and the response speed of the page is accelerated. The process of generating the page by the page template is an automatic generation link, thereby reducing errors of developers, and the unified template is used, which is beneficial to the unification of interface styles and the maintenance of later codes.
The method comprises the steps of dividing at least two functional blocks based on the display function according to the page to be generated; generating associated functional components for at least two functional blocks; and generating a page component of the page to be generated according to the functional component so as to automatically generate the page according to the page component. The embodiment of the invention realizes the automatic generation of the page, ensures that developers only need to concentrate on the business logic development, reduces the probability of wrong input of the form message field caused by manual development, greatly reduces the repetition of codes, lightens the volume of the codes, accelerates the response speed of the page, improves the automatic generation efficiency of the page, is beneficial to the unification of the page style, and is convenient for the maintenance of the page codes in the later period.
Example two
Fig. 2 is a flowchart of a method for automatically generating a page in the second embodiment of the present invention, and the second embodiment is a preferred embodiment of the present invention. As shown in fig. 2, the method includes:
and step 201, dividing functional blocks of the page.
Dividing a query list page into three functional blocks: a page title function block, a form condition function block, and a form result function block.
And the page title function block is used for displaying the title of the page.
And the form condition function block is used for displaying the condition of the page query. The system can be composed of a plurality of query blocks, different query blocks can be added with own titles, and the bottom is composed of query, reset and other self-defined buttons.
And the table result function block is used for displaying the result data of the page query. The table is displayed by a table, and buttons (adding, deleting, updating and other self-defining operation buttons) for operating the table are arranged above the table; the table has various data processing functions (click jump, different button operations, color distinction and the like).
Step 202, functional component extraction.
Through the page function block division of step 201, it can be roughly determined that the page is composed of three major components: title function component, form function component, and table function component.
Title function component: a simple text display component. Can be directly packaged.
Form function component: the system is composed of a plurality of independent basic components, including a form title component, a form item basic component and a button component. The basic components of the form item comprise various form item components of the lead-in framework. Which form entry to use is determined by the incoming JSON data (i.e., the functional component configuration file) description. The JSON data description includes a description of the displayed form item base component, including type, name modelName, grid width span, tag width labelWidth, minimum width minWidth, etc., and all the attributes of the form item base component containing the lead-in frame can be defined. The interior of the basic assembly of the form item is provided with various verification functions, and the corresponding verification effect can be displayed by inputting the corresponding JSON data verification description. The form function component can also be directly and independently used for other form pages, and defaults to two types, namely a storage type and a query type. Different types, the bottom button display is not consistent. When the type is a save type, the bottom button displays a save and cancel button; when of the query type, the bottom button is displayed as a query and reset button, and the other buttons are user-defined buttons. This subassembly function is loaded down with trivial details, uses frequently, through drawing form title subassembly, form item basic component, button assembly into form functional component, has made things convenient for the developer greatly, and developer can directly use this form functional component, spreads into the JSON data description of oneself and can see the effect of wanting. On the query list page, the form function component defaults to the query type, and the bottom button defaults to display query, reset, other custom buttons.
The table function component: consists of a form and a series of custom buttons on the form. The table has all functions of the introduced frame table, displays a plurality of pieces of data with similar structures, and can perform sorting, screening, comparison or other custom operations on the data. Each column of data of the table is described by incoming JSON data (i.e., a functional component configuration file) for type, style, data processing, event processing, and the like. The JSON data description is a description of the displayed table element, including the column title, attribute key, grid width span, data processing function format, fixed, etc., all of the attributes that contain the lead-in frame table component can be defined.
The JSON data description format that describes the components differs depending on the use of different front end frameworks.
In the embodiment of the invention, the extracted title function component, form function component and form function component can also be independently used for other page development.
And step 203, extracting the page components.
Through the extraction of the functional components in step 202, the above three functional components can also be used alone in other places, and in the query list page, by combining the three functional components, a universal page component with complete functions is formed. That is, the independent components constitute the functional components (title functional component, form functional component, and form functional component), and the functional components constitute the page component. The page components, too, are driven by a large JSON data (i.e., page component configuration file) description, which has both a data description for the title and a data description for the form and table, which is a combination of the title, form and table data descriptions. Meanwhile, the page component links the logic of the form and the table, and when the logic is inquired, an Interface Application Program Interface (API) is automatically called, the form data is automatically updated after the Interface API returns, and the specific Interface API is provided by developers.
And step 204, extracting the page template.
The page component has been extracted, via step 203. Each query list page only needs to introduce JSON data description and query interface API which need to be displayed. However, if each query list page is written by itself every time the query list page is introduced, the corresponding JSON data description is manually developed step by step, which is also very cumbersome. Therefore, a page template is extracted, the template is an introduced page component and comprises public parts such as various hook functions and the like, only JSON data (namely a page template configuration file) is specifically described to be null, and a query interface API is a fixed API.
Step 205, automatically generating a page.
A diff-only JSON data description (i.e., the page content data in the page development file) and page template of the interface API are generated, via step 204. When the fields of the front-end and back-end interface communication messages are defined, corresponding JSON data description is generated by corresponding all the fields through an automatic program, the JSON data description in the page template is automatically replaced, the name of an API (application program interface) is modified, and a new page is automatically generated. Therefore, developers only need to directly use the automatically generated new page to develop business logic, and the front end and the rear end are jointly adjusted, so that the development time is greatly saved.
The arrangement design of the page provided by the embodiment of the invention is composed of a title function component, a form function component and a form function component from top to bottom in sequence. The form function components can be displayed in blocks, and the bottom is a button group. The form function component consists of a form and a set of form top buttons.
The idea of the technical scheme of the invention is as follows: the method comprises the steps of general page, function block partitioning, basic component combination, function component extraction, page template extraction and automatic page generation. The idea can also be applied to other highly multiplexed generic pages. Wherein the base assembly is provided by an open-source frame.
By using the technical scheme, when a developer only needs to define the front-end and back-end interface communication messages, a new query list page is generated, the project is introduced into the page, the page effect is checked, and the front end and the back end are jointly adjusted. According to the technical scheme, developers only need to concentrate on business logic development and pay attention to data, and the page styles are uniformly controlled by the components.
The embodiment of the invention solves the following problems: the query list interface occupies most interfaces of the whole management system, and the style of the whole system is influenced without the control of unified design and development; different developers develop interfaces independently, the interface style and the code style are difficult to keep consistent, and the later interfaces are difficult to maintain uniformly; each interface is developed independently, so that a large amount of codes are repeated, the volume of the codes is increased, the quick response of the website is not facilitated, the labor is repeated in the development process, the labor cost is increased, and the resources are wasted; in development, if some fields corresponding to the messages are manually developed each time, the workload is greatly increased and the errors are easy to occur for some more form fields, so that the interface is automatically generated by a program, the needed JSON data is automatically injected, and the workload is greatly reduced.
The embodiment of the invention has the following beneficial effects: developers only need to pay attention to the business logic, and the development speed of the developers is greatly accelerated. The method greatly reduces the repetition of codes, lightens the volume of the codes and accelerates the response speed of the page. And the link is automatically generated, so that the error of developers is reduced. The unified template is used, which is beneficial to the unification of page styles and the maintenance of later codes.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an automatic page generation apparatus according to a third embodiment of the present invention, which is applicable to a case of automatically generating a page. As shown in fig. 3, the apparatus includes:
the function block dividing module 310 is configured to divide at least two function blocks according to a display function of a page to be generated;
a functional component generating module 320, configured to generate associated functional components for the at least two functional blocks;
the page component generating module 330 is configured to generate a page component of the page to be generated according to the functional component, so as to automatically generate a page according to the page component.
The method comprises the steps of dividing at least two functional blocks based on the display function according to the page to be generated; generating associated functional components for at least two functional blocks; and generating a page component of the page to be generated according to the functional component so as to automatically generate the page according to the page component. The embodiment of the invention realizes the automatic generation of the page, ensures that developers only need to concentrate on the business logic development, reduces the probability of wrong input of the form message field caused by manual development, greatly reduces the repetition of codes, lightens the volume of the codes, accelerates the response speed of the page, improves the automatic generation efficiency of the page, is beneficial to the unification of the page style, and is convenient for the maintenance of the page codes in the later period.
Optionally, the page to be generated is a query page;
correspondingly, the functional block dividing module is specifically configured to:
and dividing according to the query function of the query page to obtain a page title function block, a form condition function block and a form result function block.
Optionally, the functional component generating module includes:
the title function component generating unit is used for generating a title function component according to the title information in the preset function component configuration file;
the form functional component generating unit is used for generating a form functional component according to form condition information in a preset functional component configuration file;
and the table function component generating unit is used for generating the table function component according to the table result information in the preset function component configuration file.
Optionally, the title function component generating unit is specifically configured to:
generating a title function component according to title attribute information in the title information based on the text component; wherein the title attribute information at least includes title length information, width information, and font attribute information.
Optionally, the form functional component generating unit is specifically configured to:
determining a related target form item basic component from candidate form item basic components according to form item attribute information in the form condition information, and generating a form function component according to the target form item basic component;
the form item attribute information at least comprises the type, name, grid width, label width and minimum width of the form item to be displayed.
Optionally, the form item attribute information further includes content verification description information of the form item;
correspondingly, the form function component generating unit is further configured to:
and generating a form function component for displaying a corresponding content verification effect according to the content verification description information based on the content verification function in the target form item basic component.
Optionally, the table function component generating unit is specifically configured to:
based on the table component, generating a table function component according to table attribute information in the table result information;
the table attribute information at least comprises column titles, attributes, grid widths, data processing functions, fixed information, and types, styles, data processing and event processing of each column of data in the table.
Optionally, the page component generating module is specifically configured to:
and generating the page component of the page to be generated according to the title functional component, the form functional component and the form functional component based on a preset page component configuration file.
Optionally, the page component configuration file at least includes page title information, page form description information, and page form description information.
Optionally, a logic linkage relationship is established for the form functional component and the form functional component in the page component based on a preset query call interface.
Optionally, the apparatus further includes a page template generating module, configured to generate a page template of the page to be generated according to the page component based on a preset page template configuration file after generating the page component of the page to be generated according to the functional component.
Optionally, the apparatus further includes a page generating module, configured to perform content setting on the page component in the page template according to the page development file after generating the page template of the page to be generated according to the page component, so as to generate the page.
The automatic page generation device provided by the embodiment of the invention can execute the automatic page generation method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the automatic page generation method.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 4 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in FIG. 4, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory device 28, and a bus 18 that couples various system components including the system memory device 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory device bus or memory device controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system storage 28 may include computer system readable media in the form of volatile storage, such as Random Access Memory (RAM)30 and/or cache storage 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Storage 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in storage 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with device 12, and/or with any devices (e.g., network card, modem, etc.) that enable device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown in FIG. 4, the network adapter 20 communicates with the other modules of the electronic device 12 via the bus 18. It should be appreciated that although not shown in FIG. 4, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system storage device 28, for example, implementing an automatic page generation method provided by an embodiment of the present invention, including:
dividing at least two functional blocks according to the display function of the page to be generated;
generating associated functional components for the at least two functional blocks;
and generating a page component of the page to be generated according to the functional component so as to automatically generate the page according to the page component.
EXAMPLE five
The fifth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for automatically generating a page provided in the fifth embodiment of the present invention, and the method includes:
dividing at least two functional blocks according to the display function of the page to be generated;
generating associated functional components for the at least two functional blocks;
and generating a page component of the page to be generated according to the functional component so as to automatically generate the page according to the page component.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (15)

1. A method for automatically generating a page is characterized by comprising the following steps:
dividing at least two functional blocks according to the display function of the page to be generated;
generating associated functional components for the at least two functional blocks;
and generating a page component of the page to be generated according to the functional component so as to automatically generate the page according to the page component.
2. The method according to claim 1, wherein the page to be generated is a query page;
correspondingly, at least two function blocks are divided according to the display function of the page to be generated, and the method comprises the following steps:
and dividing according to the query function of the query page to obtain a page title function block, a form condition function block and a form result function block.
3. The method of claim 2, wherein generating associated functional components for the at least two functional blocks comprises:
generating a title functional component according to title information in a preset functional component configuration file;
generating a form functional component according to form condition information in a preset functional component configuration file;
and generating a table function component according to table result information in a preset function component configuration file.
4. The method of claim 3, wherein generating the title function component according to the title information in the preset function component configuration file comprises:
generating a title function component according to title attribute information in the title information based on the text component; wherein the title attribute information at least includes title length information, width information, and font attribute information.
5. The method of claim 3, wherein generating the form function component according to the form condition information in the preset function component configuration file comprises:
determining a related target form item basic component from candidate form item basic components according to form item attribute information in the form condition information, and generating a form function component according to the target form item basic component;
the form item attribute information at least comprises the type, name, grid width, label width and minimum width of the form item to be displayed.
6. The method according to claim 5, wherein the form item attribute information further includes content verification description information of the form item;
correspondingly, the form function component is generated according to the target form item basic component, and the method comprises the following steps:
and generating a form function component for displaying a corresponding content verification effect according to the content verification description information based on the content verification function in the target form item basic component.
7. The method of claim 3, wherein generating the table function component according to the table result information in the preset function component configuration file comprises:
based on the table component, generating a table function component according to table attribute information in the table result information;
the table attribute information at least comprises column titles, attributes, grid widths, data processing functions, fixed information, and types, styles, data processing and event processing of each column of data in the table.
8. The method according to claim 3, wherein generating the page component of the page to be generated according to the functional component comprises:
and generating the page component of the page to be generated according to the title functional component, the form functional component and the form functional component based on a preset page component configuration file.
9. The method of claim 8, wherein the page component configuration file comprises at least page header information, page form description information, and page form description information.
10. The method according to claim 8, wherein a logical linkage relation is established for the form function component and the form function component in the page component based on a preset query call interface.
11. The method according to claim 1, after generating the page component of the page to be generated according to the functional component, further comprising:
and generating a page template of the page to be generated according to the page component based on a preset page template configuration file.
12. The method according to claim 11, after generating the page template of the page to be generated according to the page component, further comprising:
and setting the content of the page assembly in the page template according to the page development file to generate the page.
13. An apparatus for automatically generating a page, comprising:
the function block dividing module is used for dividing at least two function blocks according to the display function of the page to be generated;
the functional component generating module is used for generating associated functional components for the at least two functional blocks;
and the page component generating module is used for generating the page component of the page to be generated according to the functional component so as to automatically generate the page according to the page component.
14. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method for automatic generation of pages as claimed in any one of claims 1 to 12.
15. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for automatic generation of a page according to any one of claims 1 to 12.
CN202011482320.7A 2020-12-15 2020-12-15 Page automatic generation method and device, electronic equipment and storage medium Pending CN112558967A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011482320.7A CN112558967A (en) 2020-12-15 2020-12-15 Page automatic generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011482320.7A CN112558967A (en) 2020-12-15 2020-12-15 Page automatic generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112558967A true CN112558967A (en) 2021-03-26

Family

ID=75063777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011482320.7A Pending CN112558967A (en) 2020-12-15 2020-12-15 Page automatic generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112558967A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113805885A (en) * 2021-09-18 2021-12-17 建信金融科技有限责任公司 Workflow engine-based front-end construction system and method of flow management system
CN115221452A (en) * 2022-09-19 2022-10-21 广东省信息工程有限公司 Portal construction method, system, electronic equipment and medium based on visual configuration
CN115577676A (en) * 2022-12-07 2023-01-06 苏州万店掌网络科技有限公司 Page table control method, device, equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113805885A (en) * 2021-09-18 2021-12-17 建信金融科技有限责任公司 Workflow engine-based front-end construction system and method of flow management system
CN113805885B (en) * 2021-09-18 2023-06-02 建信金融科技有限责任公司 Workflow engine-based front-end construction system and method for flow-type management system
CN115221452A (en) * 2022-09-19 2022-10-21 广东省信息工程有限公司 Portal construction method, system, electronic equipment and medium based on visual configuration
CN115577676A (en) * 2022-12-07 2023-01-06 苏州万店掌网络科技有限公司 Page table control method, device, equipment and storage medium
CN115577676B (en) * 2022-12-07 2023-03-28 苏州万店掌网络科技有限公司 Page table control method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112558967A (en) Page automatic generation method and device, electronic equipment and storage medium
CN111126019B (en) Report generation method and device based on mode customization and electronic equipment
CN108319575B (en) Page component checking method, device, server and storage medium
CN113031946A (en) Method and device for rendering page component
CN112241265A (en) Visual page processing method and equipment
CN112241263A (en) Visual page processing method and equipment
CN111813409A (en) Code generation method, device, equipment and storage medium of interactive interface
US20120260237A1 (en) Portable Business Language and Automated Software Application Development System
US10788959B2 (en) Personalization of a web application
CN111061522A (en) Method, device, equipment and storage medium for generating front-end card assembly based on back end
US20200118176A1 (en) System and method for identifying members of a dynamic target segment
US10061686B2 (en) Method, electronic apparatus, system, and storage medium for automated testing of application user interface
CN113419711A (en) Page guiding method and device, electronic equipment and storage medium
CN113741953A (en) Form processing method and device, electronic equipment and computer storage medium
CN113515505A (en) Data model generation method and device of data warehouse and electronic equipment
CN113111632A (en) Visual configuration method, device, equipment and medium for electronic manuscript paper
CN107220045B (en) Station building method, device, equipment and storage medium based on artificial intelligence
CN111736825A (en) Information display method, device, equipment and storage medium
CN112613287A (en) Data list display method, device, equipment and storage medium
CN112231802A (en) Multi-window examination method and device of BIM file and computer storage medium
CN112988139A (en) Method and device for developing event processing file
CN112800370B (en) Processing method and device of business document, computer equipment and storage medium
CN113704593B (en) Operation data processing method and related device
CN116991385A (en) Data instrument panel construction method and device, electronic equipment and storage medium
CN117055792A (en) Interface presentation method, apparatus, device, medium, and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination