CN114217798A - Code generation method and device for database form interface - Google Patents
Code generation method and device for database form interface Download PDFInfo
- Publication number
- CN114217798A CN114217798A CN202111560279.5A CN202111560279A CN114217798A CN 114217798 A CN114217798 A CN 114217798A CN 202111560279 A CN202111560279 A CN 202111560279A CN 114217798 A CN114217798 A CN 114217798A
- Authority
- CN
- China
- Prior art keywords
- code
- database
- database form
- interface
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 62
- 230000006870 function Effects 0.000 claims description 43
- 230000015654 memory Effects 0.000 claims description 22
- 230000000694 effects Effects 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 12
- 238000012795 verification Methods 0.000 claims description 8
- 230000008676 import Effects 0.000 abstract description 13
- 238000010586 diagram Methods 0.000 description 11
- 238000004891 communication Methods 0.000 description 5
- 238000011161 development Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000009434 installation Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- VYZAMTAEIAYCRO-UHFFFAOYSA-N Chromium Chemical compound [Cr] VYZAMTAEIAYCRO-UHFFFAOYSA-N 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000013479 data entry Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2428—Query predicate definition using graphical user interfaces, including menus and forms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the disclosure provides a code generation method and device for a database form interface, which comprises the following steps: importing database list information based on a VBA plug-in or a node packet manager, wherein the database list information is the structural content of a database form used for generating codes of a database form interface, generating a query area code, a query result area code, a dialog box code, a background query interface code, and an auxiliary function code based on the database table entry information, creating Vue a file, and adds a query region code, a query result region code, a dialog box code, a background query interface code, and an auxiliary function code to Vue files, vue files are spliced to generate codes of the database form interface, and the codes of the database form interface are used for generating and outputting the interface of the database form, thereby avoiding environment dependence, improving flexibility, and the generation efficiency of codes of the database form interface is improved through automatic import, and the intuitiveness of interface display is improved.
Description
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a code generation method and device for a database form interface.
Background
The single interface of the database table comprises a single-table transaction interface, and the single-table transaction refers to the operation of adding, deleting, changing, checking and the like to a single record or a plurality of records in the database table through front-end codes and rear-end codes.
In the prior art, a code generation method for a database form interface is generally adopted, and comprises the following steps: an environment such as Python, jdk, etc. is installed in a computer to generate code in the Python, Java, etc. language running in the environment for outputting a database form interface, such as displaying a form transaction interface in a display device of the computer.
However, the above method requires installation of environments such as Python and jdk in a computer, which is a complicated process and inefficient technique.
Disclosure of Invention
The embodiment of the disclosure provides a code generation method and device for a database form interface, which are used for solving the problem of low efficiency.
In a first aspect, an embodiment of the present disclosure provides a code generation method for a database form interface, where the method includes:
importing database form information based on a VBA plug-in or a node packet manager, wherein the database form information is the structural content of a database form used for generating codes of a database form interface;
generating a query area code, a query result area code, a dialog box code, a background query interface code and an auxiliary function code according to the database form information;
creating Vue files, adding the query area codes, the query result area codes, the dialog box codes, the background query interface codes and the auxiliary function codes into the Vue files, and splicing and generating the codes of a database form interface based on the Vue files, wherein the codes of the database form interface are used for generating and outputting the interfaces of the database forms.
In some embodiments, generating a query region code from the database form information comprises:
analyzing the form information of the database to obtain required data information of a relational database, generating a text input box code, a date control code and a numerical input box code according to the required data information, and generating a query area code according to the text input box code, the date control code and the numerical input box code.
In some embodiments, parsing the database form information to obtain required data information of a relational database, and generating a text input box code, a date control code, and a numerical input box code according to the required data information includes:
analyzing the database form information to obtain required data information of a relational database, and extracting the field type of the database form from the required data information;
if the field type comprises a character string, generating the text input box code according to the field type of the character string;
if the field type comprises a date, generating the date control code according to the field type of the date;
and if the field type comprises numbers, generating a numerical value input box code according to the field type of the numbers.
In some embodiments, generating a dialog code from the database table entry information includes:
analyzing the form information of the database to obtain required data information of a relational database, wherein the required data information comprises a main key field;
determining an editing attribute of the required data information according to the primary key field, wherein the editing attribute is used for representing whether a database form interface corresponding to the required data information can be edited or not;
and generating the dialog box code according to the editing attribute and the requirement data information.
In some embodiments, generating background query interface code from the database form information comprises:
analyzing the form information of the database to obtain the required data information of the relational database, extracting the address information of a background query interface from the required data information, and generating a background query interface code according to the address information.
In some embodiments, the method further comprises:
acquiring type information, display effect information and verification logic information of a historical database form, and creating an analysis tool according to the type information, the display effect information and the verification logic information;
and analyzing the database form information to obtain the required data information of the relational database, wherein the required data information comprises the following steps: and analyzing the database form information based on the analysis tool to obtain the required data information.
In a second aspect, an embodiment of the present disclosure provides a code generation apparatus for a database form interface, where the apparatus includes:
the system comprises an importing unit, a database form interface generating unit and a database form management unit, wherein the importing unit is used for importing database form information based on a VBA plug-in or a node packet manager, and the database form information is the structural content of a database form used for generating codes of the database form interface;
the first generation unit is used for generating a query area code, a query result area code, a dialog box code, a background query interface code and an auxiliary function code according to the database form information;
a first creating unit for creating Vue a file;
an adding unit, configured to add the query region code, the query result region code, the dialog box code, the background query interface code, and the auxiliary function code to the Vue file;
and the second generation unit is used for generating codes of a database form interface based on the Vue file splicing, wherein the codes of the database form interface are used for generating and outputting the interface of the database form.
In some embodiments, the first generating unit includes:
the analysis subunit is used for analyzing the database list information to obtain the required data information of the relational database;
and the first generation subunit is used for generating a text input box code, a date control code and a numerical value input box code according to the demand data information, and generating a query area code according to the text input box code, the date control code and the numerical value input box code.
In some embodiments, the first generation subunit is configured to extract a field type of a database form from the demand data information; if the field type comprises a character string, generating the text input box code according to the field type of the character string; if the field type comprises a date, generating the date control code according to the field type of the date; and if the field type comprises numbers, generating a numerical value input box code according to the field type of the numbers.
In some embodiments, the requirements data information includes a primary key field; the first generation unit further includes:
the determining subunit is configured to determine an editing attribute of the required data information according to the primary key field, where the editing attribute is used to represent whether a database form interface corresponding to the required data information can be edited;
and the second generation subunit is used for generating the dialog box code according to the editing attribute and the requirement data information.
In some embodiments, the first generating unit further comprises:
the extraction subunit is used for extracting the address information of the background query interface from the required data information;
and the third generating subunit is used for generating the background query interface code according to the address information.
In some embodiments, the apparatus further comprises:
the acquisition unit is used for acquiring the type information, the display effect information and the verification logic information of the historical database form;
the second creating unit is used for creating an analysis tool according to the type information, the display effect information and the check logic information;
and the analysis subunit is used for analyzing the database form information based on the analysis tool to obtain the required data information.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to perform the method of the first aspect.
In a fourth aspect, the present disclosure provides a computer-readable storage medium having stored therein computer-executable instructions for implementing the method according to the first aspect when executed by a processor.
In a fifth aspect, the disclosed embodiments provide a computer program product comprising a computer program that, when executed by a processor, implements the method according to the first aspect.
The code generation method and device for the database form interface provided by the embodiment of the disclosure comprise the following steps: importing database form information based on a VBA plug-in or a node packet manager, wherein the database form information is the structural content of a database form used for generating codes of a database form interface, generating a query area code, a query result area code, a dialog box code, a background query interface code and an auxiliary function code according to the database form information, creating Vue files, adding the query area code, the query result area code, the dialog box code, the background query interface code and the auxiliary function code to Vue files, and generating the codes of the database form interface based on Vue file splicing, wherein the codes of the database form interface are used for generating and outputting interfaces of the database form, so that environment dependence in related technologies is avoided, application flexibility and diversity are improved, and the generation efficiency, the generation efficiency and the generation rate of the codes of the database form interface are improved through automatic import, Accuracy and reliability, thereby improving the technical effects of intuition and reliability of interface display.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a schematic diagram of a code generation method for a database form interface according to one embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a database form interface for code generation of the database form interface in accordance with an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a code generation method for a database form interface according to another embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a code generation apparatus for a database form interface, according to one embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a code generation apparatus of a database form interface according to another embodiment of the present disclosure;
fig. 6 is a block diagram of an electronic device of a code generation method of a database form interface according to an embodiment of the present disclosure.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
To facilitate the reader's understanding of the various embodiments of the disclosure, some of the terms are now explained as follows:
the VBA plug-in is a macro language plug-in of Visual Basic, is a programming language for executing general automation (OLE) tasks in desktop applications, and can be mainly used for extending application functions of Windows, in particular Microsoft Office and WPS Office software.
The single-table transaction is to complete the operations of adding, deleting, changing and checking a single or multiple records in the database table through the front-end code and the back-end code.
Vue, a set of progressive JavaScript open source lightweight framework for constructing a user interface is used as one of the three front-end frameworks (the other two are Angular and fact respectively), and the framework has the advantages of simplicity and easiness in learning, bidirectional data binding, data structure separation and the like.
The VsCode is a cross-platform source code editor developed by Microsoft, can be used for Windows, Mac OS and Linux, has built-in support for js, ts and node.
Js refers to a JavaScript running environment based on Chrome V8 engine. Js uses an event-driven, non-blocking Input/Output (I/O) model, making it lightweight and efficient.
The npm (node package manager) tool is presented as a VsCode built-in plug-in, and based on a node package manager developed by node. js, the code vue can be quickly generated by installing the VsCode and the npm tool.
In various user operating systems, the single-form transaction is generally large in duty ratio, that is, the duty ratio of operations such as adding, deleting, modifying, inquiring and the like to data entries in a database form is large. The single-table transaction logic is simple, and the number of reusable codes among a plurality of transactions is also large. The code generation tool can greatly reduce the threshold of developers, reduce the workload and improve the team efficiency, and the code development of the single-form transaction comprises the single-form transaction interface development and the single-form transaction rear-end logic function development.
In the related art, a code generation method of a database form interface is generally adopted as follows: an environment such as Python, jdk, etc. is installed in a computer to generate code in the Python, Java, etc. language running in the environment for outputting a database form interface, such as displaying a form transaction interface in a display device of the computer.
However, with the above method, on one hand, installation dependence is required, i.e., a tool developed using a language such as Python, Java, or the like, is required to install an environment such as Python, jdk, or the like; on the other hand, the method is usually realized by combining a manual mode, for example, a worker manually inputs the form information of the database, so that the time is wasted and the form information cannot be repeatedly generated; on the other hand, the database list information cannot be visually displayed, or the function corresponding to the database list information cannot be visually displayed.
In order to avoid at least one of the above problems, the inventors of the present disclosure have made creative efforts to obtain the inventive concept of the present disclosure: introducing database list information based on a VBA plug-in or npm tool mode, generating codes with different functions according to the database list information, creating Vue files, adding the codes with different functions into the files, and splicing to obtain codes of a database form interface.
The following describes the technical solutions of the present disclosure and how to solve the above technical problems in specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
According to one aspect of the disclosed embodiments, the disclosed embodiments provide a code generation method for a database form interface.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a code generation method for a database form interface according to an embodiment of the present disclosure.
As shown in fig. 1, the method includes:
s101: and importing database list information based on a VBA plug-in or a node packet manager.
The database form information is the structural content of the database form used for generating codes of the database form interface.
For example, the execution subject of this embodiment may be a code generation apparatus of a database form interface (hereinafter, referred to as a code generation apparatus), and the code generation apparatus may be a server (such as a local server or a cloud server), a terminal device, a computer, a processor, a chip, or the like, which is not limited in this embodiment.
In the embodiment, a method for importing database form information based on automatic import is provided, and two methods for automatically importing database form information are provided, one method is based on VBA plug-in import, and the other method is based on node packet manager (i.e., npm tool) import, so that automation of database form information import is realized, the defects of low accuracy and low efficiency caused by human factors due to manual mode import are avoided, the efficiency of database form information import is improved, and the technical effects of reliability and accuracy of database form information import are improved.
And when the VBA plug-in and npm tools are adopted to import the database form information, other dependence does not need to be installed, namely, environments such as Python, jdk and the like in the related technology do not need to be installed, the database form information can be used offline, distributed quickly and recycled, and when the VBA plug-in is adopted, the imported database form information can be conveniently stored in the spreadsheet tools, and the table structure content can be visually displayed and debugged.
S102: and generating a query area code, a query result area code, a dialog box code, a background query interface code and an auxiliary function code according to the database list information.
It should be understood that the codes for implementing different functions are only used for exemplarily illustrating the codes that may be generated by the present embodiment, and are not to be construed as limitations on the codes that may be generated by the present embodiment, and the kind of the specifically generated codes may be determined based on an application scenario and the like.
The query area code is a code for realizing a query function; the query result code is a code for realizing the output of the query result; the dialog box code is used for realizing functions of adding, modifying and checking; the background query interface code is a code for realizing communication and interaction with a background interface; the auxiliary function code refers to code for implementing a corresponding auxiliary function based on requirements of an application scenario and the like, such as code for implementing a reset function, which are not listed here.
S103: vue files are created, query area codes, query result area codes, dialog box codes, background query interface codes and auxiliary function codes are added to Vue files, and codes of database form interfaces are generated based on Vue file splicing.
And the code of the database form interface is used for generating and outputting the interface of the database form.
Illustratively, a. vue file is created, and the codes for implementing the functions described above can be filled into the. vue file, and a vue project file is generated to output the interface of the database form as shown in fig. 2.
It should be understood that fig. 2 is only used for exemplary illustration of the possible appearance of the interface of the database form, and is not to be understood as a limitation of the interface of the database form.
Based on the above analysis, an embodiment of the present disclosure provides a code generation method for a database form interface, where the method includes: importing database form information based on a VBA plug-in or a node packet manager, wherein the database form information is the structural content of a database form used for generating codes of a database form interface, generating a query area code, a query result area code, a dialog box code, a background query interface code and an auxiliary function code according to the database form information, creating Vue files, adding the query area code, the query result area code, the dialog box code, the background query interface code and the auxiliary function code to Vue files, and generating the codes of the database form interface based on Vue file splicing, wherein the codes of the database form interface are used for generating and outputting the interface of the database form, and in the embodiment, the following steps are introduced: the method comprises the steps of importing database list information based on a VBA plug-in or a node packet manager, generating different codes for achieving different functions according to the database list information, writing the different codes into a created Vue file, achieving the technical characteristic of displaying a database form interface, avoiding environmental dependence in the related technology, improving flexibility and diversity of application, improving generation efficiency, accuracy and reliability of the codes of the database form interface through automatic import, and improving intuition and reliability of interface display.
Referring to fig. 3, fig. 3 is a schematic diagram of a code generation method of a database form interface according to another embodiment of the present disclosure.
As shown in fig. 3, the method includes:
s301: and importing database list information based on a VBA plug-in or a node packet manager.
The database form information is the structural content of the database form used for generating codes of the database form interface.
It should be noted that, regarding the technical features of the present embodiment that are the same as those of the above embodiments, the present embodiment is not described again.
S302: and analyzing the form information of the database to obtain the required data information of the relational database.
Wherein, the demand data information includes: table name, english field name, chinese field name, type field, length field, primary key field (for characterizing whether or not it is a primary key), and file generation address (for characterizing Vue that a file needs to be generated into a certain directory of a computer).
In some embodiments, a parsing tool may be created in advance to parse the database form information based on the parsing tool to obtain the demand data information.
Illustratively, creating the parsing tool may include: the method comprises the steps of obtaining type information, display effect information and verification logic information of a historical database form, and creating an analysis tool according to the type information, the display effect information and the verification logic information.
The analysis tool may be a script or software, and this embodiment is not limited.
In this embodiment, by creating the analysis tool and analyzing the database form information in combination with the analysis tool, automation of analysis can be achieved, and the technical effects of improving the efficiency and accuracy of analysis can be achieved.
S303: and generating a query area code, a query result area code, a dialog box code, a background query interface code and an auxiliary function code according to the required data information.
In some embodiments, the requiring data information generating query area code may include: and generating a text input box code, a date control code and a numerical value input box code according to the required data information, and generating a query area code according to the text input box code, the date control code and the numerical value input box code.
That is to say, the query area code may include three-dimensional codes, where the three-dimensional codes are a text input box code, a date control code, and a numerical value input box code, and the query area code is determined by the three-dimensional codes, so that the query area code has higher compatibility and reliability, and further, the technical effects of comprehensiveness and reliability when displaying the interface of the database form are achieved.
By combining the analysis, if the required data information comprises the field type, the field type can be further judged, and a text input box code is generated according to the field type of the character string aiming at the field type of the character string; generating a date control code according to the field type of the date aiming at the field type of the date; and generating a numerical value input box code according to the field type of the number aiming at the field type of the number.
In this embodiment, by generating codes of different types of functions in combination with the field type, an interface for generating database forms with different functions can be realized, and technical effects of browsing, viewing and operation experience of a user are met.
After the codes corresponding to the different functions are generated, the controls corresponding to the function codes can be determined, and the position information of the controls can be determined based on the requirements of the scene, so that the display rationality is improved and the user experience is improved when the database form interface is displayed as shown in fig. 2.
For example, field information input by a user can be received and filled into a corresponding control, and a query result area code is generated.
In combination with the above analysis, the requirement data information includes a primary key field, and accordingly, in some embodiments, generating the dialog code may include the following steps:
the first step is as follows: and determining the editing attribute of the required data information according to the primary key field.
The editing attribute is used for representing whether a database form interface corresponding to the required data information can be edited or not.
The second step is as follows: and generating a dialog box code according to the editing attribute and the demand data information.
For example, the dialog code includes a new dialog code, a modified dialog code, and a view dialog code, the database form interface corresponding to the demand data information for generating the new dialog code may be edited, the database form interface corresponding to the demand data information for generating the modified dialog code may be partially editable, and the database form interface corresponding to the demand data information for generating the view dialog code may not be editable.
It is worth explaining that the editability of the database form interface is determined by combining the main key field, so that the database form interface can meet different operation requirements of users, and the technical effects of flexibility and strong operability of the generated database form interface are achieved.
For example, the address information of the background query interface may be extracted based on the demand data information, and the background query interface code may be generated according to the address information.
In conjunction with the above analysis, the auxiliary function code includes a code for implementing a reset function, in other embodiments, the auxiliary function code further includes a processing code returned to the background interface, and the like, and further includes an adjusting code generated based on a field length and used for performing a width adjustment on the database form, and the like, which are not listed here.
S304: vue files are created, query area codes, query result area codes, dialog box codes, background query interface codes and auxiliary function codes are added to Vue files, and codes of database form interfaces are generated based on Vue file splicing.
According to another aspect of the embodiment of the present disclosure, a code generation apparatus of a database form interface is further provided.
Referring to fig. 4, fig. 4 is a schematic diagram of a code generation apparatus of a database form interface according to an embodiment of the present disclosure.
As shown in fig. 4, the code generation apparatus 400 of the database form interface includes:
the importing unit 401 is configured to import database form information based on a VBA plug-in or a node package manager, where the database form information is structural content of a database form used for generating a code of a database form interface.
A first generating unit 402, configured to generate a query area code, a query result area code, a dialog code, a background query interface code, and an auxiliary function code according to the database form information.
A first creating unit 403 for creating Vue a file.
An adding unit 404, configured to add the query region code, the query result region code, the dialog box code, the background query interface code, and the auxiliary function code to the Vue file.
And a second generating unit 405, configured to generate a code of a database form interface based on the Vue file splicing, where the code of the database form interface is used to generate and output an interface of a database form.
Referring to fig. 5, fig. 5 is a schematic diagram of a code generation apparatus of a database form interface according to another embodiment of the present disclosure.
As shown in fig. 5, the code generation apparatus 500 of the database form interface includes:
the obtaining unit 501 is configured to obtain type information, display effect information, and verification logic information of the history database form.
A second creating unit 502, configured to create an analysis tool according to the type information, the presentation effect information, and the check logic information.
An importing unit 503, configured to import database form information based on a VBA plug-in or a node package manager, where the database form information is structural content of a database form used for generating a code of a database form interface.
A first generating unit 504, configured to generate a query area code, a query result area code, a dialog code, a background query interface code, and an auxiliary function code according to the database form information.
As can be seen in fig. 5, in some embodiments, the first generating unit 504 includes:
and the analysis subunit 5041 is configured to analyze the database form information according to the analysis tool to obtain the required data information of the relational database.
The first generating subunit 5042 is configured to generate a text input box code, a date control code, and a numerical input box code according to the demand data information, and generate a query area code according to the text input box code, the date control code, and the numerical input box code.
In some embodiments, the first generating subunit 5042 is configured to extract a field type of a database form from the requirement data information; if the field type comprises a character string, generating the text input box code according to the field type of the character string; if the field type comprises a date, generating the date control code according to the field type of the date; and if the field type comprises numbers, generating a numerical value input box code according to the field type of the numbers.
In some embodiments, the requirements data information includes a primary key field; as can be seen from fig. 5, the first generating unit 504 further includes:
a determining subunit 5043, configured to determine an edit attribute of the requirement data information according to the primary key field, where the edit attribute is used to characterize whether a database form interface corresponding to the requirement data information can be edited.
A second generating subunit 5044, configured to generate the dialog box code according to the edit attribute and the requirement data information.
As can be seen from fig. 5, the first generating unit 504 further includes:
and the extracting sub-unit 5045 is configured to extract address information of the background query interface from the demand data information.
A third generating subunit 5046, configured to generate the background query interface code according to the address information.
A first creating unit 505 for creating Vue a file.
An adding unit 506, configured to add the query region code, the query result region code, the dialog box code, the background query interface code, and the auxiliary function code to the Vue file.
A second generating unit 507, configured to generate a code of a database form interface based on the Vue file splicing, where the code of the database form interface is used to generate and output an interface of a database form.
The present disclosure also provides an electronic device and a readable storage medium according to an embodiment of the present disclosure.
According to an embodiment of the present disclosure, the present disclosure also provides a computer program product comprising: a computer program, stored in a readable storage medium, from which at least one processor of the electronic device can read the computer program, the at least one processor executing the computer program causing the electronic device to perform the solution provided by any of the embodiments described above.
As shown in fig. 6, a block diagram of an electronic device of a code generation method of a database form interface according to an embodiment of the present disclosure is shown. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the electronic apparatus includes: one or more processors 601, memory 602, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 6, one processor 601 is taken as an example.
The memory 602 is a non-transitory computer readable storage medium provided by the present disclosure. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the code generation method of the database form interface provided by the present disclosure. The non-transitory computer-readable storage medium of the present disclosure stores computer instructions for causing a computer to perform a code generation method of a database form interface provided by the present disclosure.
The memory 602, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the code generation method of the database form interface in the disclosed embodiments. The processor 601 executes various functional applications of the server and data processing by running non-transitory software programs, instructions and modules stored in the memory 602, that is, implementing the code generation method of the database form interface in the above method embodiment.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device of the code generation method of the database form interface, and the like. Further, the memory 602 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 602 optionally includes memory remotely located from the processor 601, and these remote memories may be connected over a network to the electronic device of the code generation method of the database form interface. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the code generation method of the database form interface may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected by a bus or other means, and fig. 6 illustrates the connection by a bus as an example.
The input device 603 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device of the code generation method of the database form interface, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or the like. The output devices 604 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (10)
1. A code generation method for a database form interface, the method comprising:
importing database form information based on a VBA plug-in or a node packet manager, wherein the database form information is the structural content of a database form used for generating codes of a database form interface;
generating a query area code, a query result area code, a dialog box code, a background query interface code and an auxiliary function code according to the database form information;
creating Vue files, adding the query area codes, the query result area codes, the dialog box codes, the background query interface codes and the auxiliary function codes into the Vue files, and splicing and generating the codes of a database form interface based on the Vue files, wherein the codes of the database form interface are used for generating and outputting the interfaces of the database forms.
2. The method of claim 1, wherein generating a query area code from the database form information comprises:
analyzing the form information of the database to obtain required data information of a relational database, generating a text input box code, a date control code and a numerical input box code according to the required data information, and generating a query area code according to the text input box code, the date control code and the numerical input box code.
3. The method of claim 2, wherein parsing the database form information to obtain required data information of a relational database, and generating text entry box codes, date control codes, and numeric entry box codes according to the required data information comprises:
analyzing the database form information to obtain required data information of a relational database, and extracting the field type of the database form from the required data information;
if the field type comprises a character string, generating the text input box code according to the field type of the character string;
if the field type comprises a date, generating the date control code according to the field type of the date;
and if the field type comprises numbers, generating a numerical value input box code according to the field type of the numbers.
4. The method of claim 1, wherein generating a dialog code from the database form information comprises:
analyzing the form information of the database to obtain required data information of a relational database, wherein the required data information comprises a main key field;
determining an editing attribute of the required data information according to the primary key field, wherein the editing attribute is used for representing whether a database form interface corresponding to the required data information can be edited or not;
and generating the dialog box code according to the editing attribute and the requirement data information.
5. The method of claim 1, wherein generating background query interface code from the database form information comprises:
analyzing the form information of the database to obtain the required data information of the relational database, extracting the address information of a background query interface from the required data information, and generating a background query interface code according to the address information.
6. The method of any of claims 2-5, further comprising:
acquiring type information, display effect information and verification logic information of a historical database form, and creating an analysis tool according to the type information, the display effect information and the verification logic information;
and analyzing the database form information to obtain the required data information of the relational database, wherein the required data information comprises the following steps: and analyzing the database form information based on the analysis tool to obtain the required data information.
7. A code generation apparatus for a database form interface, the apparatus comprising:
the system comprises an importing unit, a database form interface generating unit and a database form management unit, wherein the importing unit is used for importing database form information based on a VBA plug-in or a node packet manager, and the database form information is the structural content of a database form used for generating codes of the database form interface;
the first generation unit is used for generating a query area code, a query result area code, a dialog box code, a background query interface code and an auxiliary function code according to the database form information;
a first creating unit for creating Vue a file;
an adding unit, configured to add the query region code, the query result region code, the dialog box code, the background query interface code, and the auxiliary function code to the Vue file;
and the second generation unit is used for generating codes of a database form interface based on the Vue file splicing, wherein the codes of the database form interface are used for generating and outputting the interface of the database form.
8. An electronic device, comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to perform the method of any one of claims 1-6.
9. A computer-readable storage medium having stored therein computer-executable instructions for implementing the method of any one of claims 1-6 when executed by a processor.
10. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111560279.5A CN114217798A (en) | 2021-12-20 | 2021-12-20 | Code generation method and device for database form interface |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111560279.5A CN114217798A (en) | 2021-12-20 | 2021-12-20 | Code generation method and device for database form interface |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114217798A true CN114217798A (en) | 2022-03-22 |
Family
ID=80704234
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111560279.5A Pending CN114217798A (en) | 2021-12-20 | 2021-12-20 | Code generation method and device for database form interface |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114217798A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117519704A (en) * | 2024-01-08 | 2024-02-06 | 慧新全智工业互联科技(青岛)有限公司 | Automatic construction method for database application interface |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105760382A (en) * | 2014-12-16 | 2016-07-13 | 深圳云之家网络有限公司 | Method and device for importing excel data into database |
US20160364445A1 (en) * | 2015-06-15 | 2016-12-15 | Sap Se | Database view generation |
CN107133044A (en) * | 2017-05-05 | 2017-09-05 | 上海携程商务有限公司 | The quick development method and system of the data maintenance type page |
CN108491510A (en) * | 2018-03-22 | 2018-09-04 | 平安科技(深圳)有限公司 | Excel data import method, apparatus, computer equipment and the storage medium of database |
CN112596719A (en) * | 2020-12-25 | 2021-04-02 | 中国农业银行股份有限公司 | Method and system for generating front-end and back-end codes |
CN113434133A (en) * | 2021-08-27 | 2021-09-24 | 深圳市信润富联数字科技有限公司 | Application building method, device, equipment and computer readable storage medium |
-
2021
- 2021-12-20 CN CN202111560279.5A patent/CN114217798A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105760382A (en) * | 2014-12-16 | 2016-07-13 | 深圳云之家网络有限公司 | Method and device for importing excel data into database |
US20160364445A1 (en) * | 2015-06-15 | 2016-12-15 | Sap Se | Database view generation |
CN107133044A (en) * | 2017-05-05 | 2017-09-05 | 上海携程商务有限公司 | The quick development method and system of the data maintenance type page |
CN108491510A (en) * | 2018-03-22 | 2018-09-04 | 平安科技(深圳)有限公司 | Excel data import method, apparatus, computer equipment and the storage medium of database |
CN112596719A (en) * | 2020-12-25 | 2021-04-02 | 中国农业银行股份有限公司 | Method and system for generating front-end and back-end codes |
CN113434133A (en) * | 2021-08-27 | 2021-09-24 | 深圳市信润富联数字科技有限公司 | Application building method, device, equipment and computer readable storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117519704A (en) * | 2024-01-08 | 2024-02-06 | 慧新全智工业互联科技(青岛)有限公司 | Automatic construction method for database application interface |
CN117519704B (en) * | 2024-01-08 | 2024-04-23 | 慧新全智工业互联科技(青岛)有限公司 | Automatic construction method for database application interface |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11829436B2 (en) | Method and apparatus of pre-rendering page, electronic device, and storage medium | |
CN110597959A (en) | Text information extraction method and device and electronic equipment | |
CN112527748A (en) | Method, device, equipment and storage medium for analyzing user operation behaviors | |
US20210304142A1 (en) | End-user feedback reporting framework for collaborative software development environments | |
US9043760B2 (en) | Creating dynamic interactive views from trace events for performing deterministic performance analysis | |
CN113722647A (en) | Method and device for displaying information | |
CN112506854B (en) | Page template file storage and page generation methods, devices, equipment and media | |
CN111610972A (en) | Page generation method, device, equipment and storage medium | |
CN112015468A (en) | Interface document processing method and device, electronic equipment and storage medium | |
CN113254043A (en) | Web front-end project processing method and device, electronic equipment and storage medium | |
CN113220571A (en) | Debugging method, system, equipment and storage medium of mobile webpage | |
CN111914528A (en) | Content editing method, editor generation method, device, equipment and medium | |
CN111125597A (en) | Webpage loading method, browser, electronic equipment and storage medium | |
CN114217789A (en) | Function component expansion method, device, equipment, storage medium and program product | |
CN114217798A (en) | Code generation method and device for database form interface | |
CN111639116B (en) | Data access connection session protection method and device | |
EP3889770A1 (en) | Mini program material processing method and apparatus, electronic device, and medium | |
CN111596897B (en) | Code multiplexing processing method and device and electronic equipment | |
CN111274520B (en) | Webpage resource auditing method, device, equipment and medium | |
CN115469849B (en) | Service processing system, method, electronic equipment and storage medium | |
CN112148596B (en) | Method and device for generating error reporting content of deep learning framework | |
CN114661274A (en) | Method and device for generating intelligent contract | |
JP5644599B2 (en) | Object-oriented model design support device | |
CN110377401B (en) | Transaction request processing method, device, server and storage medium based on IDEA | |
CN113254405A (en) | File conversion method, device, equipment and medium |
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 |