+

CN114579914A - Webpage form generation method, electronic equipment and computer readable storage medium - Google Patents

Webpage form generation method, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN114579914A
CN114579914A CN202210291708.1A CN202210291708A CN114579914A CN 114579914 A CN114579914 A CN 114579914A CN 202210291708 A CN202210291708 A CN 202210291708A CN 114579914 A CN114579914 A CN 114579914A
Authority
CN
China
Prior art keywords
tag
content
excel
data
label
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
CN202210291708.1A
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.)
CRSC Institute of Smart City Research and Design Co Ltd
Original Assignee
CRSC Institute of Smart City Research and Design Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CRSC Institute of Smart City Research and Design Co Ltd filed Critical CRSC Institute of Smart City Research and Design Co Ltd
Priority to CN202210291708.1A priority Critical patent/CN114579914A/en
Publication of CN114579914A publication Critical patent/CN114579914A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • 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/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/174Form filling; Merging
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure provides a webpage form generation method, an electronic device and a computer readable storage medium, wherein the webpage form generation method comprises the following steps: preprocessing an Excel report in an Excel file; reading the content of an Excel report in the preprocessed Excel file; packaging the title content in the read content into a head label code of a webpage form; packaging main body content in the read content into a main body label code of the webpage form; and storing the head label code and the body label code into a hypertext markup language (HTML) file. According to the webpage form generation method provided by the embodiment of the disclosure, the Excel report in the Excel file is automatically encapsulated into the head tag code and the main body tag code, and the head tag code and the main body tag code are stored in the HTML file, and the corresponding webpage form can be displayed by opening the HTML file through a browser, so that numerous repeated writing work of the front-end tag code by openers is not needed, and the generation efficiency and accuracy of the webpage form are improved.

Description

Webpage form generation method, electronic equipment and computer readable storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of internet, in particular to a webpage form generation method, electronic equipment and a computer-readable storage medium.
Background
With the continuous development of national informatization, the informatization process in enterprise reform is promoted, and more enterprises improve the work efficiency and the informatization degree. And gradually transferring the originally offline service to the online service. In the process of realizing offline file online informatization, a plurality of file conversion technologies are involved. In the process of advancing enterprise informatization process, the fact that most of the conventional information acquisition modes are counted by using an Excel document mode is found, which is slightly better than the most original paper mode, but the problems that real-time sharing cannot be realized, operation is performed by multiple persons, and summarization and public display are difficult exist. In the development process of an enterprise information system, an existing Excel document needs to be converted into an editable webpage form. Generally, a form used for statistical information of a medium-sized or large-sized enterprise is often large, and has multiple data indexes and contents to be filled, and an Excel document is difficult to limit the types of data filled by editors, so that a great deal of inconvenience exists in a data classification statistical process.
In the existing method for converting the Excel document into the webpage form, developers are required to finish numerous repeated writing works of front-end tag codes, the problems of missed writing, wrong writing and the like are easily caused in the writing process of a large number of front-end tag codes, and the efficiency and the accuracy are lower.
Disclosure of Invention
The embodiment of the disclosure provides a webpage form generation method, electronic equipment and a computer readable storage medium.
In a first aspect, an embodiment of the present disclosure provides a method for generating a web form, including: preprocessing an Excel report in an Excel file; reading the content of an Excel report in the preprocessed Excel file; packaging the title content in the read content into a head label code of a webpage form; packaging main body content in the read content into a main body label code of the webpage form; and storing the head label codes and the body label codes into a hypertext markup language (HTML) file.
In some exemplary embodiments, the preprocessing the Excel report in the Excel file includes at least one of: canceling the merged cells of the Excel report in the Excel file, and assigning the same value to the cells obtained by canceling the merged cells; adding an index column to the Excel report in the Excel file; adding a description column to the Excel report in the Excel file; and processing missing values of the Excel report in the Excel file.
In some exemplary embodiments, the reading the content of the Excel report in the preprocessed Excel file includes: converting the Excel report in the preprocessed Excel file into a CSV table in a comma separated value CSV file; and reading the content of the CSV table in the CSV file.
In some exemplary embodiments, the title content includes at least one title information; the packaging the title contents in the read contents into the head label codes of the web page form comprises the following steps: for each line of the Excel report, encapsulating all the header information in the same line into a first tr tag code corresponding to the line; and packaging the first tr label codes corresponding to all the lines in the head label pair to obtain the head label code.
In some exemplary embodiments, the encapsulating all the header information located in the same row into the first tr tag code corresponding to the row includes: for each title information located in the same row, packaging the title information in a th label pair to obtain a th label code corresponding to the title information; and packaging the th label codes corresponding to all the title information positioned in the same row in a first tr label pair to obtain a first tr label code corresponding to the row.
In some exemplary embodiments, the subject content includes at least one subject data; the packaging the main body content in the read content into the main body label code of the webpage form comprises the following steps: for each line of the Excel report, encapsulating all the main data in the same line into a second tr label code corresponding to the line; and packaging the second tr label codes corresponding to all the lines in tbody label pairs to obtain the main body label code.
In some exemplary embodiments, the encapsulating all the body data located in the same row into the second tr tag code corresponding to the row includes: for each main body data located in the same row, packaging the main body data in a td tag pair to obtain a td tag code corresponding to the main body data; and packaging the td tag codes corresponding to all the main data of the row in a second tr tag pair to obtain a second tr tag code corresponding to the row.
In some exemplary embodiments, the encapsulating the body data in a td tag pair to obtain a td tag code corresponding to the body data includes at least one of: under the condition that the main data is data needing to be filled, packaging the attribute of the main data in an input label to obtain an input label code, and packaging the input label code in a td label pair to obtain a td label code corresponding to the main data; and under the condition that the main data is not data needing to be filled, packaging the main data in the td tag pair to obtain the td tag code corresponding to the main data.
In some exemplary embodiments, the attributes of the body data include at least one of: a type of the subject data, a validation function of the subject data.
In some exemplary embodiments, after reading the content of the Excel report in the preprocessed Excel file, before encapsulating the main content in the read content into the main tag code of the web form, the method further includes: and classifying the main content, and adding a corresponding index to each line of main data in the classified main content.
In some exemplary embodiments, after storing the head tag code and the body tag code in a hypertext markup language HTML file, the method further comprises: and carrying out replacement processing on the HTML file.
In a second aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor; the at least one program is executed by the at least one processor, so that the at least one processor realizes any one of the above webpage form generating methods.
In a third aspect, an embodiment of the present disclosure provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer-readable storage medium implements any one of the above-mentioned methods for generating a web form.
According to the webpage form generation method provided by the embodiment of the disclosure, the Excel report in the Excel file is automatically encapsulated into the head tag code and the main body tag code, and the head tag code and the main body tag code are stored in the HTML file, and the corresponding webpage form can be displayed by opening the HTML file through a browser, so that numerous repeated writing work of the front-end tag code by openers is not needed, and the generation efficiency and accuracy of the webpage form are improved.
Drawings
The accompanying drawings are included to provide a further understanding of the embodiments of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the principles of the disclosure and not to limit the disclosure. Detailed exemplary embodiments are described by reference to the accompanying drawings, in which:
fig. 1 is a flowchart of a method for generating a web form according to an embodiment of the present disclosure;
fig. 2 is a block diagram of a web page form generating apparatus according to another embodiment of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present disclosure, the following describes in detail a web form generation method, an electronic device, and a computer-readable storage medium provided in the present disclosure with reference to the accompanying drawings.
Example embodiments will be described more fully hereinafter with reference to the accompanying drawings, but which may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Embodiments of the disclosure and features of the embodiments may be combined with each other without conflict.
As used herein, the term "and/or" includes any and all combinations of at least one of the associated listed items.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of at least one other feature, integer, step, operation, element, component, and/or group thereof.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
Fig. 1 is a flowchart of a method for generating a web form according to an embodiment of the present disclosure.
In a first aspect, referring to fig. 1, an embodiment of the present disclosure provides a method for generating a web form, including:
and step 100, preprocessing an Excel report in the Excel file.
In the embodiment of the application, the purpose of preprocessing the Excel report in the Excel file is to facilitate the subsequent reading operation and packaging process, and what preprocessing is specifically performed depends on the adopted programming language and the standard or requirement of the web page form. For example, preprocessing an Excel report in an Excel file includes at least one of: canceling the merged cells of the Excel report in the Excel file, and assigning the same value to the cells obtained by canceling the merged cells; adding an index column for an Excel report in an Excel file; adding a description column for an Excel report in an Excel file; and processing missing values of the Excel report in the Excel file.
In some exemplary embodiments, the index column may be a number to a column.
In some exemplary embodiments, the description column may be a corresponding description of the content of the corresponding row. For example, whether the content of the row is content that needs to be filled in, or content that does not need to be filled in (i.e., content that only needs to be presented), the type of content that is filled in, and so on.
In some exemplary embodiments, the missing value processing on the Excel report in the Excel file refers to adding a corresponding value to a cell with a missing value, and what value is specifically added depends on values of other cells of the Excel report.
And step 101, reading the content of an Excel report in the preprocessed Excel file.
In some exemplary embodiments, the content of the Excel report in the preprocessed Excel file can be directly read. In other exemplary embodiments, an Excel report in a preprocessed Excel file may be converted into a CSV table in a Comma Separated Values (CSV) file; and then reads the content of the CSV table in the CSV file. The Excel report in the preprocessed Excel file is converted into a CSV table in a CSV file, and the content of the CSV identifier is read for the purpose of more convenience.
The embodiment of the present application does not limit the specific reading manner. For example, when Python is used as the programming language, the pandas library can be used to read the contents of Excel report in preprocessed Excel file, or read the contents of CSV table in CSV file.
In some exemplary embodiments, the title content includes at least one title information. For example, the value of each cell belonging to the title content in the Excel report is a title information.
In some exemplary embodiments, the body content includes at least one body data. For example, each cell belonging to the main content in the Excel report is a main data.
In some exemplary embodiments, after reading the content of the Excel report in the preprocessed Excel file, before encapsulating the main content in the read content into the main label code of the web page form, the method further includes: and classifying the main content, and adding a corresponding index to each line of main data in the classified main content.
In some exemplary embodiments, adding a corresponding index to each line of data in the classified main content may be to use a category to which the line of main data belongs as the index corresponding to the line of main data.
And 102, encapsulating the header content in the read content into a head label code of the web page form.
In the embodiment of the present application, encapsulating the header content in the read content into the header tag code of the web page form means converting the header content in the read content into a tag Language dedicated to HyperText Markup Language (HTML) for description, forming an HTML Language that can be interpreted by a standard browser, and a specific implementation process depends on the standard of the HTML Language. Some examples are listed below for illustration, and the listed examples are only for illustrating the generation process of the header label code more intuitively, and are not used to limit the scope of the embodiments of the present application.
In some exemplary embodiments, encapsulating the header content of the read content into header tag code of the web page form includes: packaging all header information in the same line into a first tr tag code corresponding to the line aiming at each line of the Excel report; and packaging the first tr label codes corresponding to all the lines in the head label pair to obtain a head label code.
In some exemplary embodiments, the thead tag pair includes a thead start tag < thead > representing the start of the head tag code and a thead end tag < thead > representing the end of the head tag code. For example, a certain section of the header tag code is as follows:
<thead>
line-corresponding first tr tag code
</thead>
That is, the head tag code begins with < then > and ends with </then >, with the first tr tag code corresponding to each row between the head start tag < then > and the head end tag </then >.
In some exemplary embodiments, encapsulating all header information located in the same row into a row-corresponding first tr-tag code includes: for each title information located in the same row, packaging the title information in a th tag pair to obtain a th tag code corresponding to the title information; and packaging the th label codes corresponding to all the title information in the same row in the first tr label pair to obtain the first tr label codes corresponding to the row.
In some exemplary embodiments, the th tag pair includes a th start tag < th > representing the start of the th tag code and a th end tag </th > representing the end of the th tag code. For example, the th tag code corresponding to a certain title information is as follows: < th Table Attribute > title information; that is, the th tag code corresponding to a certain title information starts with < th > and ends with </th >, the title information is between the th start tag < th > and the th end tag </th >, that is, the value of the cell in the Excel report, and the attribute of the table in the netpage table where the title information is located, such as the width and height of the table, can also be defined at the th start tag < th >.
In some exemplary embodiments, the first tr-tag pair includes a tr-start tag < tr > representing the start of the first tr-tag code and a tr-end tag </tr > representing the end of the first tr-tag code. For example, the first tr tag code corresponding to a certain row is as follows:
<tr>
< th Table Attribute > title information </th >
</tr>
That is, the first tr tag code corresponding to a certain line starts with < tr > and ends with </tr >, and the interval between the tr start tag < tr > and the tr end tag </tr > is the th tag code corresponding to each title information.
And 103, packaging the main body content in the read content into a main body label code of the webpage form.
In the embodiment of the present application, encapsulating the main body content in the read content into the main body tag code of the web page form means converting the subject content in the read content into a tag language dedicated to HTML to describe, and forming a standard HTML language that can be interpreted by a browser, where a specific implementation process depends on the standard of the HTML language. Some examples are listed below for explanation, and the listed examples are only for more intuitively showing the generation process of the body tag code and are not used to limit the protection scope of the embodiments of the present application.
In some exemplary embodiments, encapsulating the body content in the read content into the body tag code of the web form includes: packaging all main body data positioned in the same line into a second tr tag code corresponding to the line aiming at each line of the Excel report; and packaging the second tr label codes corresponding to all the lines in the tbody label pair to obtain a main body label code.
In some exemplary embodiments, when all the main data in the same line are packaged into the second tr tag codes corresponding to the line aiming at each line of the Excel report, the second tr tag codes corresponding to the line can be sequentially generated according to the sequence of the lines of the Excel report; or sequentially generating a second tr label code corresponding to the row of the category according to the category to which the row belongs and the sequence of the rows belonging to the same category.
For example, assuming that a certain Excel report includes 10 lines of main data, second tr tag codes corresponding to the lines may be sequentially generated according to the sequence of the lines, that is, a second tr tag code corresponding to the 1 st line, a second tr tag code corresponding to the 2 nd line, … …, and a second tr tag code corresponding to the 10 th line are sequentially generated; second tr tag codes corresponding to the rows of the category may be sequentially generated according to the category to which the rows belong and the sequence of the rows belonging to the same category, and assuming that the 1 st row, the 3 rd row and the 7 th row belong to category 1, the 2 nd row, the 6 th row and the 8 th row belong to category 2, and the 4 th row, the 5 th row, the 9 th row and the 10 th row belong to category 3, second tr tag codes corresponding to the 1 st row, the 3 rd row, the 7 th row, the 2 nd row, the 6 th row, the 8 th row, the 4 th row, the 5 th row, the 9 th row and the 10 th row are sequentially generated.
In some exemplary embodiments, the tbody tag pair includes a tbody start tag < tbody > that represents the start of the head tag code and a tbody end tag </tbody > that represents the end of the head tag code. For example, a certain section of the body tag code is as follows:
<tbody>
Second tr label code corresponding to row
</tbody>
That is, the subject label code begins with < tbody >, ends with </tbody >, and tbody starts with the second tr label code for each line between the < tbody > and the tbody ends label </tbody >.
In some exemplary embodiments, encapsulating all body data located in the same row into a row-corresponding second tr-tag code comprises: for each main body data located in the same row, packaging the main body data in a td tag pair to obtain a td tag code corresponding to the main body data; and packaging td tag codes corresponding to all main body data in the same row in a second tr tag pair to obtain a second tr tag code corresponding to the row.
In some exemplary embodiments, the td tag pair includes a td start tag < td > representing the start of the td tag code and a td end tag </td > representing the end of the td tag code. For example, td tag code corresponding to a certain main data is as follows: < td > subject data </td >; that is, a td tag code corresponding to a certain main data starts with < td > and ends with </td >, and a space between the td start tag < td > and the td end tag </td > is the main data, namely the cell value in the Excel report form of the main data.
In some exemplary embodiments, the second tr-tag pair includes a tr-start tag < tr > representing the start of the second tr-tag code and a tr-end tag </tr > representing the end of the second tr-tag code. For example, the second tr tag code corresponding to a certain row is as follows:
<tr>
< td > Main body data </td >
</tr>
That is, the second tr tag code corresponding to a certain line starts with < tr > and ends with </tr >, and td tag codes corresponding to respective body data are between the tr start tag < tr > and the tr end tag </tr >.
In some exemplary embodiments, encapsulating the body data in a td tag pair to obtain a td tag code corresponding to the body data includes at least one of: when the main data is data needing to be filled, packaging the attribute of the main data in an input label to obtain an input label code, and packaging the input label code in a td label pair to obtain a td label code corresponding to the main data; and under the condition that the main data is not data needing to be filled, packaging the main data in a td tag pair to obtain a td tag code corresponding to the main data.
In some exemplary embodiments, the attributes of the body data include at least one of: type of subject data, verification function of subject data.
In some exemplary embodiments, the type of the body data includes at least one of: logical, character, and numeric.
For example, when the main data is data that needs to be filled in, the td tag code corresponding to the main data is as follows: < td > < attribute > </td > of input body data.
For example, in the case that the main data is not data that needs to be filled in, the td tag code corresponding to the main data is as follows: < td > subject data </td >.
In some exemplary embodiments, the different types, the verification functions of the subject data are different. The corresponding verification functions can be generated according to the types of the main data, and the verification functions are used for verifying whether the type of the content input by the user is the type of the main data which is defined in advance and needs to be input.
In some exemplary embodiments, the predefined type of the subject data to be input may be determined according to the description column corresponding to the subject data to be filled. For example, in the case where the type explicitly labeled as a logical type in the description column, the type of the body data that needs to be input is determined to be a logical type; under the condition that the description column is explicitly marked as a character type, determining the type of the main data needing to be input, which is defined in advance, as the character type; in the case of explicit marking as digital type in the description column, determining the type of the predefined main data needing to be input as digital type; in the case of explicitly labeled decimal type in the description column, determining the type of the predefined main data needing to be input as decimal type; in the case where there is no explicit notation in the description column, the determination is made based on the keywords in the description column.
In some exemplary embodiments, in a case where a keyword characterizing a numerical type is included in the description column, it is determined that a type of predefined subject data that needs to be input is the numerical type; determining the type of the predefined main data needing to be input as a floating point type under the condition that the description column comprises keywords for representing the floating point type; in the case where the numeric type keyword and the floating-point type keyword are not included in the description column, the type of the predefined body data to be input is determined to be a text type.
In some exemplary embodiments, keywords that characterize a numeric type, such as number of people, department number, organization number, and the like.
In some exemplary embodiments, floating-point type keywords such as profit margin, productivity, trillions, and billions, etc. are characterized.
And 104, storing the head label codes and the body label codes into a hypertext markup language (HTML) file.
In some exemplary embodiments, after storing the header tag code and the body tag code in the HTML file, the method further includes: and replacing the HTML file.
In some exemplary embodiments, replacing the HTML file refers to replacing a blank table in a web form displayed after the HTML file is opened in the browser with a special display symbol (e.g., NAN, etc.) of the web form.
According to the webpage form generation method provided by the embodiment of the disclosure, the Excel report in the Excel file is automatically encapsulated into the head tag code and the main body tag code, and the head tag code and the main body tag code are stored in the HTML file, and the corresponding webpage form can be displayed by opening the HTML file through a browser, so that numerous repeated writing work of the front-end tag code by openers is not needed, and the generation efficiency and accuracy of the webpage form are improved.
In a second aspect, another embodiment of the present disclosure provides an electronic device, including: at least one processor; the storage is stored with at least one program, and when the at least one program is executed by the at least one processor, the at least one processor is enabled to realize the webpage form generating method.
Wherein, the processor is a device with data processing capability, which includes but is not limited to a Central Processing Unit (CPU) and the like; memory is a device with data storage capabilities including, but not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), FLASH memory (FLASH).
In some embodiments, the processor, memory, and in turn other components of the computing device are connected to each other by a bus.
In a third aspect, another embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements any one of the above-mentioned methods for generating a web form.
Fig. 2 is a block diagram of a web page form generating apparatus according to another embodiment of the disclosure.
In a fourth aspect, referring to fig. 2, another embodiment of the present disclosure provides a web form generating apparatus, including: the preprocessing module 201 is used for preprocessing an Excel report in an Excel file; the reading module 202 is used for reading the content of the Excel report in the preprocessed Excel file; a header tag code generating module 203, configured to encapsulate the header content in the read content into a header tag code of the web page form; a main body tag code generation module 204, configured to encapsulate main body content in the read content into a main body tag code of the web page form; and the storage module 205 is used for storing the head tag codes and the body tag codes into the hypertext markup language (HTML) file.
In some exemplary embodiments, the preprocessing module 201 is specifically configured to perform at least one of: canceling the merged cells of the Excel report in the Excel file, and assigning the same value to the cells obtained by canceling the merged cells; adding an index column for an Excel report in an Excel file; adding a description column for an Excel report in an Excel file; and processing missing values of the Excel report in the Excel file.
In some exemplary embodiments, the reading module 202 is specifically configured to: converting an Excel report in the preprocessed Excel file into a CSV table in a comma separated value CSV file; the contents of the CSV table in the CSV file are read.
In some exemplary embodiments, the title content includes at least one title information; the head tag code generation module 203 is specifically configured to: packaging all header information in the same line into a first tr tag code corresponding to the line aiming at each line of the Excel report; and packaging the first tr label codes corresponding to all the lines in the head label pair to obtain a head label code.
In some exemplary embodiments, the header tag code generating module 203 is specifically configured to implement the following method for packaging all header information located in the same row into a first tr tag code corresponding to the row: for each title information located in the same row, packaging the title information in a th tag pair to obtain a th tag code corresponding to the title information; and packaging the th label codes corresponding to all the title information in the same row in the first tr label pair to obtain the first tr label codes corresponding to the row.
In some exemplary embodiments, the subject content includes at least one subject data; the subject tag code generation module 204 is specifically configured to: packaging all main body data positioned in the same line into a second tr tag code corresponding to the line aiming at each line of the Excel report; and packaging the second tr label codes corresponding to all the lines in the tbody label pair to obtain a main body label code.
In some exemplary embodiments, the subject tag code generation module 204 is specifically configured to implement the encapsulation of all subject data located in the same row into a row-corresponding second tr tag code by: for each main body data located in the same row, packaging the main body data in a td tag pair to obtain a td tag code corresponding to the main body data; and packaging td tag codes corresponding to all main data in the same row in a second tr tag pair to obtain a second tr tag code corresponding to the row.
In some exemplary embodiments, the body tag code generating module 204 is specifically configured to implement encapsulation of the body data in a td tag pair to obtain a td tag code corresponding to the body data by using at least one of the following manners: when the main data is data needing to be filled, packaging the attribute of the main data in an input label to obtain an input label code, and packaging the input label code in a td label pair to obtain a td label code corresponding to the main data; and under the condition that the main data is not data needing to be filled, packaging the main data in a td tag pair to obtain a td tag code corresponding to the main data.
In some exemplary embodiments, the attributes of the body data include at least one of: type of subject data, verification function of subject data.
In some exemplary embodiments, the subject tag code generation module 204 is further configured to: and classifying the main content, and adding a corresponding index to each line of main data in the classified main content.
In some exemplary embodiments, the storage module 205 is further configured to: and replacing the HTML file.
The specific implementation process of the web form generation apparatus is the same as that of the web form generation method in the foregoing embodiment, and is not described here again.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by the computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted in a generic and descriptive sense only and not for purposes of limitation. In some instances, features, characteristics and/or elements described in connection with a particular embodiment may be used alone or in combination with features, characteristics and/or elements described in connection with other embodiments, unless expressly stated otherwise, as would be apparent to one skilled in the art. Accordingly, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the disclosure as set forth in the appended claims.

Claims (13)

1. A webpage form generation method comprises the following steps:
preprocessing an Excel report in an Excel file;
reading the content of an Excel report in the preprocessed Excel file;
packaging the title content in the read content into a head label code of a webpage form;
packaging main body content in the read content into a main body label code of the webpage form;
and storing the head label codes and the body label codes into a hypertext markup language (HTML) file.
2. The method for generating a web form according to claim 1, wherein the preprocessing the Excel report in the Excel file comprises at least one of:
canceling the merged cells of the Excel report in the Excel file, and assigning the same value to the cells obtained by canceling the merged cells;
adding an index column to the Excel report in the Excel file;
adding a description column to the Excel report in the Excel file;
and processing missing values of the Excel report in the Excel file.
3. The method for generating a web form according to claim 1, wherein the reading the content of the Excel report in the preprocessed Excel file comprises:
converting the Excel report in the preprocessed Excel file into a CSV table in a comma separated value CSV file;
and reading the content of the CSV table in the CSV file.
4. The web page form generating method of claim 1, wherein the banner content comprises at least one banner information; the header tag code for encapsulating the header content in the read content into a web form includes:
for each line of the Excel report, encapsulating all the header information in the same line into a first tr label code corresponding to the line;
And packaging the first tr tag codes corresponding to all the lines in the head tag pair to obtain the head tag code.
5. The method for generating a web page form of claim 4, wherein the encapsulating all the header information in the same row into the first tr tag code corresponding to the row comprises:
for each title information located in the same row, packaging the title information in a th tag pair to obtain a th tag code corresponding to the title information;
and encapsulating the th tag codes corresponding to all the header information in the same row in a first tr tag pair to obtain a first tr tag code corresponding to the row.
6. The web page form generation method of claim 1, wherein the body content includes at least one body data; the encapsulating the main body content in the read content into the main body label code of the webpage form comprises:
for each line of the Excel report, encapsulating all the main data in the same line into a second tr label code corresponding to the line;
and packaging the second tr label codes corresponding to all the lines in tbody label pairs to obtain the main body label code.
7. The method for generating a web page form of claim 6, wherein the encapsulating all the body data in the same row into the second tr tag code corresponding to the row comprises:
for each main body data located in the same row, packaging the main body data in a td tag pair to obtain a td tag code corresponding to the main body data;
and encapsulating the td tag codes corresponding to all the main data in the same row in a second tr tag pair to obtain a second tr tag code corresponding to the row.
8. The web page form generation method according to claim 7, wherein the encapsulating the body data into a td tag pair to obtain a td tag code corresponding to the body data includes at least one of:
when the main data is data needing to be filled, encapsulating the attribute of the main data in an input label to obtain an input label code, and encapsulating the input label code in a td label pair to obtain a td label code corresponding to the main data;
and under the condition that the main data is not data needing to be filled, encapsulating the main data in the td tag pair to obtain the td tag code corresponding to the main data.
9. The web page form generating method according to claim 8, wherein the attribute of the body data includes at least one of: a type of the subject data, a validation function of the subject data.
10. The method for generating a netpage form according to any one of claims 1 to 9, wherein after reading the content of the Excel report in the preprocessed Excel file, before encapsulating the main content in the read content into the main label code of the netpage form, the method further comprises:
and classifying the main content, and adding a corresponding index to each line of main data in the classified main content.
11. The method for generating a web page form according to any one of claims 1 to 9, wherein after storing the header tag code and the body tag code in a hypertext markup language HTML file, the method further comprises: and carrying out replacement processing on the HTML file.
12. An electronic device, comprising:
at least one processor;
a memory having stored thereon at least one program which, when executed by the at least one processor, causes the at least one processor to implement the method of web form generation of any of claims 1-11.
13. A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the web form generation method of any one of claims 1 to 11.
CN202210291708.1A 2022-03-22 2022-03-22 Webpage form generation method, electronic equipment and computer readable storage medium Pending CN114579914A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210291708.1A CN114579914A (en) 2022-03-22 2022-03-22 Webpage form generation method, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210291708.1A CN114579914A (en) 2022-03-22 2022-03-22 Webpage form generation method, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114579914A true CN114579914A (en) 2022-06-03

Family

ID=81782313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210291708.1A Pending CN114579914A (en) 2022-03-22 2022-03-22 Webpage form generation method, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114579914A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101809610A (en) * 2007-09-28 2010-08-18 微软公司 Auto-generation and syndication of tables as forms
CN113297831A (en) * 2021-06-03 2021-08-24 通号智慧城市研究设计院有限公司 Method and system for generating verifiable report webpage by Excel

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101809610A (en) * 2007-09-28 2010-08-18 微软公司 Auto-generation and syndication of tables as forms
CN113297831A (en) * 2021-06-03 2021-08-24 通号智慧城市研究设计院有限公司 Method and system for generating verifiable report webpage by Excel

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
宋杨: "基于WebBrowser的网页数据交换方法研究", 《智能城市》 *
范礼: "网页中表格式数据的处理策略", 《科技信息》 *

Similar Documents

Publication Publication Date Title
US8140468B2 (en) Systems and methods to extract data automatically from a composite electronic document
US7590647B2 (en) Method for extracting, interpreting and standardizing tabular data from unstructured documents
US8176003B2 (en) Automatic designation of XBRL taxonomy tags
US8892579B2 (en) Method and system of data extraction from a portable document format file
US20050182736A1 (en) Method and apparatus for determining contract attributes based on language patterns
CN110727703A (en) Method and device for automatically identifying comments in JSON (Java Server object notation) code
US12190052B2 (en) System and method for validating tabular summary reports
CN113779218B (en) Question-answer pair construction method, question-answer pair construction device, computer equipment and storage medium
CN113535817A (en) Method and device for generating characteristic broad table and training business processing model
CN113297831B (en) Method and system for generating verifiable report webpage by Excel
CN113627168A (en) Method, device, medium and equipment for checking component packaging conflict
US20150058716A1 (en) System and method for summarizing documents
CN105630839A (en) Webpage information acquisition method and device
CN106649210A (en) Data conversion method and device
CN114626341A (en) Document conversion method, device and storage medium
US9189478B2 (en) System and method for collecting data from an electronic document and storing the data in a dynamically organized data structure
US11281901B2 (en) Document extraction system and method
CN118261130A (en) Bill layout data generation method and device, computer equipment and storage medium
CN114579914A (en) Webpage form generation method, electronic equipment and computer readable storage medium
US8719693B2 (en) Method for storing localized XML document values
CN115098629B (en) File processing method, device, server and readable storage medium
CN117216279A (en) Text extraction method, device and equipment of PDF (portable document format) file and storage medium
CN107977459B (en) Report generation method and device
CN112445461B (en) Business rule generation method and device, electronic equipment and readable storage medium
CN115688718A (en) Implementation method and related device for batch import of multi-page tag Excel

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220603

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载