CN115268902A - Method, device and equipment for generating Html page - Google Patents

Method, device and equipment for generating Html page Download PDF

Info

Publication number
CN115268902A
CN115268902A CN202110473137.9A CN202110473137A CN115268902A CN 115268902 A CN115268902 A CN 115268902A CN 202110473137 A CN202110473137 A CN 202110473137A CN 115268902 A CN115268902 A CN 115268902A
Authority
CN
China
Prior art keywords
component
configuration information
excel
page
sheet
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
CN202110473137.9A
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202110473137.9A priority Critical patent/CN115268902A/en
Publication of CN115268902A publication Critical patent/CN115268902A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse

Abstract

The application relates to the technical field of computers and discloses a method for generating an Html page. The method comprises the following steps: acquiring an Excel file; the Excel file comprises a plurality of Sheet pages, and each Sheet page comprises a plurality of Excel components; analyzing the Sheet page to obtain the type of the Excel component in the Sheet page; generating an React component according to the type of the Excel component; filling preset configuration information into the React assembly, and acquiring first JSON data corresponding to the filled React assembly; creating a Schema object, filling the first JSON data into an attribute field of the Schema object, and acquiring second JSON data corresponding to the filled Schema object; and introducing the second JSON data into the static page, and generating an Html page corresponding to the Sheet page. By the method, the Html page can be constructed by utilizing the Excel file, and the user is more familiar with the operation of the Excel, so that the Html page can be constructed more conveniently and rapidly to a certain extent, and the technical threshold for constructing the Html page is reduced. The application also discloses a device and equipment for generating the Html page.

Description

Method, device and equipment for generating Html page
Technical Field
The present application relates to the field of computer technologies, and for example, to a method, an apparatus, and a device for generating an Html page.
Background
With the continuous development of computer technology, a great number of users research and study, and find that Excel is one of the most well-known digital office software, and is used as office software by a great number of users to make various forms so as to be capable of declaration, examination and approval and the like. For some enterprise users, quick functions such as declaration and approval of a form and uploading of a service file can be realized by constructing an Html (Hyper Text Markup Language) page, but two independent processes are used for generating various forms and constructing the Html page to realize declaration and approval of the form, and the Html page cannot be constructed by the prior art.
Disclosure of Invention
The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed embodiments. This summary is not an extensive overview nor is intended to identify key/critical elements or to delineate the scope of such embodiments but rather as a prelude to the more detailed description that is presented later.
The embodiment of the disclosure provides a method, a device and equipment for generating an Html page, so that the Html page can be constructed through an Excel file.
In some embodiments, the method for generating an Html page includes: acquiring an Excel file; the Excel file comprises a plurality of Sheet pages, and the Sheet pages comprise a plurality of Excel components; analyzing the Sheet page to obtain the type of an Excel component in the Sheet page; generating a React component according to the type; the fact component is a front-end component packaged by using the fact technology, for example: a button assembly, a pull-down assembly, a sliding bar assembly and the like; filling preset configuration information into the React component, and acquiring first JSON (JavaScript Object Notation) data corresponding to the filled React component; creating a Schema (data structure model) object, filling the first JSON data into an attribute field of the Schema object, and acquiring second JSON data corresponding to the filled Schema object; and introducing the second JSON data into a static page, and generating an Html page corresponding to the Sheet page.
In some embodiments, the means for generating an Html page includes: the obtaining module is configured to obtain an Excel file; the Excel file comprises a plurality of Sheet pages, and the Sheet pages comprise a plurality of Excel components; the analysis module is configured to analyze the Sheet page and obtain the type of the Excel assembly in the Sheet page; a first generation module configured to generate a React component according to the type; the first filling module is configured to fill preset configuration information into the React component and obtain first JSON data corresponding to the filled React component; the second filling module is configured to create a Schema object, fill the first JSON data into an attribute field of the Schema object, and obtain second JSON data corresponding to the filled Schema object; and the second generation module is configured to introduce the second JSON data into a static page and generate an Html page corresponding to the Sheet page.
In some embodiments, the means for generating an Html page comprises: a processor and a memory storing program instructions, the processor being configured, when executing the program instructions, to perform the method for generating an Html page described above.
In some embodiments, the apparatus comprises the means for generating an Html page described above.
The method, the device and the equipment for generating the Html page provided by the embodiment of the disclosure can achieve the following technical effects: obtaining an Excel file comprising a plurality of Sheet pages, wherein the Sheet pages comprise a plurality of Excel components; analyzing the Sheet page to obtain the type of the Excel component in the Sheet page; generating a React component according to the type of the Excel component; filling preset configuration information into the fact component, and acquiring first JSON data corresponding to the fact component; creating a Schema object, filling the first JSON data into an attribute field of the Schema object, and acquiring second JSON data corresponding to the filled Schema object; and introducing the second JSON data into the static page, and generating an Html page corresponding to the Sheet page. By the method, the Html page can be constructed by utilizing the Excel file, and as the user is more familiar with the operation of the Excel, the Html page can be constructed more conveniently and rapidly to a certain extent, and the technical threshold for constructing the Html page is reduced.
The foregoing general description and the following description are exemplary and explanatory only and are not restrictive of the application.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the accompanying drawings and not in limitation thereof, in which elements having the same reference numeral designations are shown as like elements and not in limitation thereof, and wherein:
FIG. 1 is a schematic diagram of a method for generating an Html page provided by an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of an apparatus for generating an Html page according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of another apparatus for generating an Html page provided by an embodiment of the present disclosure.
Detailed Description
So that the manner in which the features and elements of the disclosed embodiments can be understood in detail, a more particular description of the disclosed embodiments, briefly summarized above, may be had by reference to the embodiments, some of which are illustrated in the appended drawings. In the following description of the technology, for purposes of explanation, numerous details are set forth in order to provide a thorough understanding of the disclosed embodiments. However, one or more embodiments may be practiced without these details. In other instances, well-known structures and devices may be shown in simplified form in order to simplify the drawing.
The terms "first," "second," and the like in the description and claims of the embodiments of the disclosure and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the present disclosure described herein may be made. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions.
The term "plurality" means two or more unless otherwise specified.
In the embodiment of the present disclosure, the character "/" indicates that the preceding and following objects are in an or relationship. For example, A/B represents: a or B.
The term "and/or" is an associative relationship that describes objects, meaning that three relationships may exist. For example, a and/or B, represents: a or B, or A and B.
As shown in fig. 1, an embodiment of the present disclosure provides a method for generating an Html page, including:
step S101, obtaining an Excel file; the Excel file comprises a plurality of Sheet pages, and each Sheet page comprises a plurality of Excel components;
step S102, analyzing the Sheet page to obtain the type of the Excel component in the Sheet page;
step S103, generating a React component according to the type of the Excel component;
step S104, filling preset configuration information into the fact component, and obtaining first JSON data corresponding to the filled fact component;
step S105, creating the Schema object, filling the first JSON data into the attribute field of the Schema object, and acquiring second JSON data corresponding to the filled Schema object;
and step S106, introducing the second JSON data into the static page, and generating an Html page corresponding to the Sheet page.
By adopting the method for generating the Html page provided by the embodiment of the disclosure, the Excel file is obtained; the Excel file comprises a plurality of Sheet pages, and each Sheet page comprises a plurality of Excel components; analyzing the Sheet page to obtain the type of the Excel component in the Sheet page; generating an React component according to the type; filling preset configuration information into a React component, and acquiring first JSON data corresponding to the React component; creating a Schema object, filling the first JSON data into an attribute field of the Schema object, and acquiring second JSON data corresponding to the filled Schema object; and introducing the second JSON data into the static page, and generating an Html page corresponding to the Sheet page. By the method, the Html page can be constructed by utilizing the Excel file, and the user is more familiar with the operation of the Excel, so that the Html page can be constructed more conveniently and rapidly to a certain extent, and the technical threshold for constructing the Html page is reduced.
Optionally, the Excel file is uploaded to a Software-as-a-Service (SaaS-a-Service) platform, and a background server of the SaaS platform is used to analyze a Sheet page in the Excel file, so as to obtain the type of the Excel component in the Sheet page.
Optionally, analyzing the Sheet page to obtain JSON data of the Excel component; and determining the type of the Excel component from the JSON data of the Excel component.
Optionally, the types of Excel components include: upload type, request approval type, return type, input information type, etc.
Optionally, the configuration information corresponding to the Excel component is determined according to the type of the Excel component.
Optionally, the configuration information corresponding to each type of Excel component includes function configuration information, style configuration information, and size configuration information.
In some embodiments, the function configuration information corresponding to the approval type Excel component is "approval function", the corresponding style configuration information is "approval style", and the corresponding size configuration information is "medium size"; the function configuration information corresponding to the uploading type Excel component is 'uploading function', the corresponding style configuration information is 'uploading style', and the corresponding size configuration information is 'large size'; the function configuration information corresponding to the Excel component of the return type is a return function, the corresponding style configuration information is a return style, and the corresponding size configuration information is a large size; the function configuration information corresponding to the Excel component of the input information type is an 'input information function', the corresponding style configuration information is an 'input information style', and the corresponding size configuration information is a 'small size'.
Optionally, the range of "small size" in the size configuration information is 1 to 12 cells; the "medium size" ranges from 13 to 24 cells; the "large size" ranges from 25 or more cells.
Optionally, generating a read component according to the type of the Excel component includes: create a React component that includes the type of Excel component in the Sheet page.
In some embodiments, the type of React component is the same as the type of Excel component in the Sheet page.
Optionally, generating a read component according to the type of the Excel component includes: and acquiring a component object corresponding to the type of the Excel component, and analyzing JSON data of the Excel component in the component object to generate a React component.
Optionally, the component object contains the style configuration information, the size configuration information, the function configuration information, other embedded components and the like of the Excel component.
Optionally, the component object is provided with a tag ID.
Optionally, obtaining a component object corresponding to the type of the Excel component includes: and acquiring a component object corresponding to the tag ID with the same type as the Excel component.
Optionally, the preset configuration information includes function configuration information, the function configuration information has a first ID uniquely corresponding to the function configuration information, and the filling of the preset configuration information into the read component includes: acquiring a second ID of the React component; and filling the function configuration information corresponding to the first ID which has a corresponding relation with the second ID into the React component.
Optionally, the preset function configuration information includes: an upload function, an approve function, a return function, an enter information function, etc.
Optionally, the first ID is a name corresponding to preset function configuration information. For example, if the name corresponding to the upload function is shangchuan, the first ID corresponding to the upload function is shangchuangong; if the name corresponding to the function is requested to be approved is qingpizhungongneng, the first ID corresponding to the function is requested to be approved is qingpizhungngneng; if the name corresponding to the return function is fanhuigongeng, the first ID corresponding to the return function is fanhuigongeng; and if the name corresponding to the input information function is shuxunxingneng, the first ID corresponding to the input information function is shuxunxingneng.
Optionally, obtaining a second ID of the read component includes: analyzing the Sheet page to obtain the position information of the Excel assembly in the Sheet page; and acquiring a second ID of the read component according to the position information and the type of the Excel component.
Optionally, the position information of the Excel component is the position of the cell where the Excel component is located in the Sheet page and the page number of the Sheet page where the Excel component is located. Optionally, the position of the cell is the number of rows and columns of the cell in the Sheet page.
Optionally, obtaining the second ID of the read component according to the location information and the type of the Excel component includes: determining functional configuration information corresponding to the Excel component according to the type of the Excel component; and generating a second ID according to the position of the cell where the Excel component is located, the page number of the Sheet page where the Excel component is located and the function configuration information corresponding to the Excel component.
Optionally, the second ID includes a name corresponding to the function configuration information corresponding to the Excel component, a Sheet number where the Excel component is located, a cell position where the Excel component is located, and the like.
Optionally, in a case that names corresponding to the function configuration information in the first ID and the second ID are the same, it is determined that there is a correspondence between the first ID and the second ID.
In some embodiments, the format of the second ID is "Sheet number where the name _ Excel component corresponding to the function configuration information corresponding to the Excel component is located — cell position where the Excel component is located". For example, if the second ID of the fact component is qingpizhugonggneng _ page01_ f 2, and the first ID corresponding to the preset function configuration information is qingpizhugonggneng, it is determined that the first ID and the second ID have a corresponding relationship, and the function configuration information "please approve the function" corresponding to the first ID "qingzhugonggneng" is filled in the fact component.
Optionally, the preset configuration information includes style configuration information, and the style configuration information has a first ID uniquely corresponding to the style configuration information; filling preset configuration information into the React component, and the method comprises the following steps: acquiring a second ID of the React component; and filling the style configuration information corresponding to the first ID which has a corresponding relation with the second ID into the React component.
Optionally, the preset style configuration information includes: upload style, please approve style, return style, input information style, etc.
Optionally, the first ID is a name corresponding to preset style configuration information. For example, if the name corresponding to the upload pattern is shangchuanyangshi, the first ID corresponding to the upload pattern is shangchuanyangshi; if the name corresponding to the approval pattern is qingpizhhunyanngshi, the first ID corresponding to the approval pattern is qingpizhhunyanngshi; if the name corresponding to the returned pattern is fanhuiyangshi, the first ID corresponding to the returned pattern is fanhuiyangshi; the name corresponding to the input information pattern is shuxunxiyangshi, and the first ID corresponding to the input information pattern is shuxunxiyangshi.
Optionally, obtaining the second ID of the read component according to the location information and the type of the Excel component includes: determining style configuration information corresponding to the Excel component according to the type of the Excel component; and generating a second ID according to the position of the cell where the Excel component is located, the page number of the Sheet page where the Excel component is located and the style configuration information corresponding to the Excel component.
Optionally, the second ID includes a name corresponding to the style configuration information corresponding to the Excel component, a Sheet number where the Excel component is located, a cell position where the Excel component is located, and the like.
Optionally, in a case that names corresponding to the style configuration information in the first ID and the second ID are the same, it is determined that there is a correspondence between the first ID and the second ID.
In some embodiments, the format of the second ID is "Sheet number where name _ Excel component corresponding to style configuration information corresponding to Excel component is located — cell position where Excel component is located". For example, if the second ID of the fact component is qingpizhhunyangshi _ page01_ f 2, and the first ID corresponding to the preset pattern configuration information is qingpizhhunyangshi, it is determined that the first ID and the second ID have a corresponding relationship, and the pattern configuration information "please approve the pattern" corresponding to the first ID "qingpizhhunyangshi" is filled in the fact component.
Optionally, the preset configuration information includes size configuration information, and the size configuration information has a unique corresponding first ID; filling preset configuration information into the React component, and the method comprises the following steps: acquiring a second ID of the React component; and filling the dimension configuration information corresponding to the first ID which has a corresponding relation with the second ID into the React component.
Optionally, the preset size configuration information includes: large size, medium size, small size, and the like.
Optionally, the first ID is a name corresponding to preset size configuration information. For example, if the name corresponding to the large size is dachicon, the first ID corresponding to the large size is dachicon; the name corresponding to the medium size is zhongdengchicin, and the first ID corresponding to the medium size is zhongdengchicin; the name corresponding to the small size is xiaochhicin, and then the first ID corresponding to the small size is xiaochhicin.
Optionally, obtaining the second ID of the read component according to the location information and the type of the Excel component includes: determining size configuration information corresponding to the Excel component according to the type of the Excel component; and generating a second ID according to the position of the cell where the Excel component is located, the page number of the Sheet page where the Excel component is located and the size configuration information corresponding to the Excel component.
Optionally, the second ID includes a name corresponding to the size configuration information corresponding to the Excel component, a Sheet number where the Excel component is located, a cell position where the Excel component is located, and the like.
Optionally, in a case that the names corresponding to the size configuration information in the first ID and the second ID are the same, it is determined that there is a correspondence between the first ID and the second ID.
In some embodiments, the format of the second ID is "Sheet number where name _ Excel component corresponding to size configuration information corresponding to the Excel component is located — cell position where the Excel component is located". For example, if the second ID of the fact component is zhongdengchicin _ page01_ f 2, and the first ID corresponding to the preset size configuration information is zhongdengchicin, it is determined that there is a correspondence between the first ID and the second ID, and the medium size of the size configuration information corresponding to the first ID "zhongdengchicin" is filled in the fact component.
Optionally, the filling step includes filling the preset configuration information into the act component, where the preset configuration information includes function configuration information, style configuration information, and size configuration information, and the preset configuration information has a first ID uniquely corresponding to the preset configuration information, and includes: acquiring a second ID of the React component; and filling configuration information corresponding to the first ID which has a corresponding relation with the second ID into the fact component.
Optionally, the preset function configuration information includes: an upload function, an approve function, a return function, an enter information function, etc.
Optionally, the first ID is a name corresponding to the preset function configuration information, a name of the preset style configuration information, and a name of the preset size configuration information. For example, if the name corresponding to the upload function is shangchuangong, the name corresponding to the upload pattern is shangchuanyangshi, and the name corresponding to the large size is dachicin, the first ID corresponding to the preset configuration information is shangchuangneng _ shangchuanyangshi _ dachicin.
Optionally, obtaining the second ID of the read component according to the location information and the type of the Excel component includes: determining function configuration information corresponding to the Excel component, style configuration information corresponding to the Excel component and size configuration information corresponding to the Excel component according to the type of the Excel component; and generating a second ID according to the position of the cell where the Excel component is located, the page number of the Sheet page where the Excel component is located, the function configuration information corresponding to the Excel component, the style configuration information corresponding to the Excel component and the size configuration information corresponding to the Excel component.
Optionally, the second ID includes a name corresponding to function configuration information corresponding to the Excel component, a name corresponding to style configuration information corresponding to the Excel component, a name corresponding to size configuration information corresponding to the Excel component, a Sheet number where the Excel component is located, a cell position where the Excel component is located, and the like.
Optionally, in a case that names corresponding to the configuration information in the first ID and the second ID are the same, it is determined that there is a correspondence between the first ID and the second ID.
In some embodiments, the format of the second ID is "Sheet number where name _ Excel component corresponding to configurable information corresponding to Excel component is located — cell position where Excel component is located". For example, the second ID of the fact component is shangchuangneng _ shangchuanyangshi _ dachicon _ page01_ f 2, and the preset first ID corresponding to the configuration information is shangchuangneng _ shangchuanyangshi _ dachicon, it is determined that there is a correspondence between the first ID and the second ID, and the configuration information "upload function _ upload pattern _ large size" corresponding to the first ID "shangchuangneng _ shangchuanyangshi _ dachicon" is filled in the fact component.
Optionally, after parsing the Sheet page, the method further includes: judging whether the Sheet page is successfully analyzed; and under the condition that the Sheet page analysis fails, acquiring error reporting information, and feeding the error reporting information back to the user terminal.
As shown in fig. 2, an embodiment of the present disclosure provides an apparatus for generating an Html page, including: the device comprises an acquisition module 1, an analysis module 2, a first generation module 3, a first filling module 4, a second filling module 5 and a second generation module 6. The obtaining module 1 is configured to obtain an Excel file; the Excel file comprises a plurality of Sheet pages, and each Sheet page comprises a plurality of Excel components; the analyzing module 2 is configured to analyze the Sheet page to obtain the type of the Excel component in the Sheet page; the first generation module 3 is configured to generate a React component according to the type of the Excel component; the first filling module 4 is configured to fill preset configuration information into the React component, and obtain first JSON data corresponding to the filled React component; the second filling module 5 is configured to create a Schema object, fill the first JSON data into an attribute field of the Schema object, and obtain second JSON data corresponding to the filled Schema object; the second generation module 6 is configured to introduce the second JSON data into the static page, and generate an Html page corresponding to the Sheet page.
By adopting the device for generating the Html page provided by the embodiment of the disclosure, the Excel file is obtained through the obtaining module; the Excel file comprises a plurality of Sheet pages, and each Sheet page comprises a plurality of Excel components; analyzing the Sheet page to obtain the type of the Excel component in the Sheet page; generating a React component according to the type of the Excel component; filling preset configuration information into the fact component, and acquiring first JSON data corresponding to the fact component; creating a Schema object, filling the first JSON data into an attribute field of the Schema object, and acquiring second JSON data corresponding to the filled Schema object; and introducing the second JSON data into the static page, and generating an Html page corresponding to the Sheet page. By the method, the Html page can be constructed by utilizing the Excel file, and as the user is more familiar with the operation of the Excel, the Html page can be constructed more conveniently and rapidly to a certain extent, and the technical threshold for constructing the Html page is reduced.
Optionally, the obtaining module is further configured to obtain the location information of the Excel component in the Sheet page and the type of the Excel component.
Optionally, the first generation module is further configured to receive the location information and the type of the Excel component sent by the acquisition module, and acquire the second ID of the fact component according to the location information and the type of the Excel component.
Optionally, the first filling module is further configured to obtain preset configuration information.
Optionally, the preset configuration information includes function configuration information, and the function configuration information has a first ID uniquely corresponding to the function configuration information. The first filling module is also configured to fill the function configuration information corresponding to the first ID which has a corresponding relation with the second ID into the React component.
Optionally, the preset configuration information includes style configuration information, and the style configuration information has a uniquely corresponding first ID. The first filling module is also configured to fill style configuration information corresponding to the first ID which has a corresponding relationship with the second ID into the React component.
Optionally, the preset configuration information includes size configuration information, and the size configuration information has a first ID uniquely corresponding thereto. The first filling module is also configured to fill style size information corresponding to the first ID having a corresponding relationship with the second ID into the reach component.
Optionally, the apparatus for generating the Html page further includes an error reporting module, where the error reporting module is configured to determine whether the Sheet page is successfully parsed; and under the condition that the Sheet page analysis fails, the error reporting module acquires error reporting information.
As shown in fig. 3, an apparatus for generating an Html page according to an embodiment of the present disclosure includes a processor (processor) 100 and a memory (memory) 101 storing program instructions. Optionally, the apparatus may also include a Communication Interface (Communication Interface) 102 and a bus 103. The processor 100, the communication interface 102, and the memory 101 may communicate with each other via a bus 103. The communication interface 102 may be used for information transfer. The processor 100 may call program instructions in the memory 101 to perform the method for generating Html pages of the above-described embodiments.
Further, the program instructions in the memory 101 may be implemented in the form of software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product.
The memory 101, which is a computer-readable storage medium, may be used for storing software programs, computer-executable programs, such as program instructions/modules corresponding to the methods in the embodiments of the present disclosure. The processor 100 executes functional applications and data processing, i.e., implements the method for generating Html pages in the above-described embodiments, by executing program instructions/modules stored in the memory 101.
The memory 101 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 the use of the terminal device, and the like. In addition, the memory 101 may include a high-speed random access memory, and may also include a nonvolatile memory.
By adopting the device for generating the Html page provided by the embodiment of the disclosure, the Excel file is obtained; the Excel file comprises a plurality of Sheet pages, and each Sheet page comprises a plurality of Excel components; analyzing the Sheet page to obtain the type of the Excel component in the Sheet page; generating a React component according to the type of the Excel component; filling preset configuration information into the fact component, and acquiring first JSON data corresponding to the fact component; creating a Schema object, filling the first JSON data into an attribute field of the Schema object, and acquiring second JSON data corresponding to the filled Schema object; and introducing the second JSON data into the static page, and generating an Html page corresponding to the Sheet page. By the method, the Html page can be constructed by utilizing the Excel file, and the user is more familiar with the operation of the Excel, so that the Html page can be constructed more conveniently and rapidly to a certain extent, and the technical threshold for constructing the Html page is reduced.
The device provided by the embodiment of the disclosure comprises the above device for generating the Html page.
Optionally, the device is a server or a computer.
The equipment acquires an Excel file; the Excel file comprises a plurality of Sheet pages, and each Sheet page comprises a plurality of Excel components; analyzing the Sheet page to obtain the type of the Excel component in the Sheet page; generating a React component according to the type of the Excel component; filling preset configuration information into a React component, and acquiring first JSON data corresponding to the React component; creating a Schema object, filling the first JSON data into an attribute field of the Schema object, and acquiring second JSON data corresponding to the filled Schema object; and introducing the second JSON data into the static page, and generating an Html page corresponding to the Sheet page. By the method, the Html page can be constructed by utilizing the Excel file, and the user is more familiar with the operation of the Excel, so that the Html page can be constructed more conveniently and rapidly to a certain extent, and the technical threshold for constructing the Html page is reduced.
Embodiments of the present disclosure provide a computer-readable storage medium storing computer-executable instructions configured to perform the above-described method for generating a provision of an Html page.
The disclosed embodiments provide a computer program product comprising a computer program stored on a computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the above-described method for generating an Html page.
The computer-readable storage medium described above may be a transitory computer-readable storage medium or a non-transitory computer-readable storage medium.
The technical solution of the embodiments of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium may be a non-transitory storage medium comprising: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes, and may also be a transient storage medium.
The above description and the drawings sufficiently illustrate embodiments of the disclosure to enable those skilled in the art to practice them. Other embodiments may incorporate structural, logical, electrical, process, and other changes. The examples merely typify possible variations. Individual components and functions are optional unless explicitly required, and the sequence of operations may vary. Portions and features of some embodiments may be included in or substituted for those of others. Furthermore, the words used in the specification are words of description only and are not intended to limit the claims. As used in the description of the embodiments and the claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term "and/or" as used in this application is meant to encompass any and all possible combinations of one or more of the associated listed. Furthermore, the terms "comprises" and/or "comprising," when used in this application, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. Without further limitation, an element defined by the phrase "comprising a" \8230; "does not exclude the presence of additional like elements in a process, method or apparatus comprising the element. In this document, each embodiment may be described with emphasis on differences from other embodiments, and the same and similar parts between the respective embodiments may be referred to each other. For methods, products, etc. of the embodiment disclosure, reference may be made to the description of the method section for relevance if it corresponds to the method section of the embodiment disclosure.
Those of skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software may depend upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments. It can be clearly understood by the skilled person that, for convenience and brevity of description, the specific working processes of the system, the apparatus and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments disclosed herein, the disclosed methods, products (including but not limited to devices, apparatuses, etc.) may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units may be only one type of logical functional division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to implement the present embodiment. In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. In the description corresponding to the flowcharts and block diagrams in the figures, operations or steps corresponding to different blocks may also occur in different orders than disclosed in the description, and sometimes there is no specific order between the different operations or steps. For example, two sequential operations or steps may in fact be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. Each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

Claims (10)

1. A method for generating an Html page, comprising:
obtaining an Excel file; the Excel file comprises a plurality of Sheet pages, and the Sheet pages comprise a plurality of Excel components;
analyzing the Sheet page to obtain the type of an Excel component in the Sheet page;
generating an React component according to the type;
filling preset configuration information into the React component, and acquiring first JSON data corresponding to the filled React component;
creating a Schema object, filling the first JSON data into an attribute field of the Schema object, and acquiring second JSON data corresponding to the filled Schema object;
and introducing the second JSON data into a static page, and generating an Html page corresponding to the Sheet page.
2. The method of claim 1, wherein generating the React component from the type comprises:
and creating an React component, wherein the React component comprises the type of the Excel component in the Sheet page.
3. The method of claim 1, wherein the preset configuration information comprises function configuration information, the function configuration information has a first ID uniquely corresponding to the function configuration information, and the populating the preset configuration information into the read component comprises:
acquiring a second ID of the React component;
and filling the function configuration information corresponding to the first ID which has a corresponding relation with the second ID into the reach component.
4. The method of claim 1, wherein the preset configuration information comprises a pattern configuration information, and the pattern configuration information has a first ID uniquely corresponding to the pattern configuration information; the filling of preset configuration information into the reach component comprises:
acquiring a second ID of the React component;
and filling the style configuration information corresponding to the first ID which has a corresponding relation with the second ID into the reach component.
5. The method of claim 1, wherein the preset configuration information comprises size configuration information, and the size configuration information has a first ID uniquely corresponding to the size configuration information; the filling of preset configuration information into the reach component includes:
acquiring a second ID of the React component;
and filling the dimension configuration information corresponding to the first ID which has the corresponding relation with the second ID into the React component.
6. The method of any of claims 3 to 5, wherein obtaining the second ID of the React component comprises:
analyzing the Sheet page to obtain the position information of the Excel assembly in the Sheet page;
and acquiring a second ID of the reach component according to the position information and the type.
7. The method according to claim 2, wherein after parsing the Sheet page, further comprising:
judging whether the Sheet page is successfully analyzed;
and under the condition that the Sheet page analysis fails, acquiring error reporting information, and feeding back the error reporting information to the user terminal.
8. An apparatus for generating an Html page, comprising:
the obtaining module is configured to obtain an Excel file; the Excel file comprises a plurality of Sheet pages, and the Sheet pages comprise a plurality of Excel components;
the analysis module is configured to analyze the Sheet page to obtain the type of the Excel component in the Sheet page;
a first generation module configured to generate a React component according to the type;
the first filling module is configured to fill preset configuration information into the React component and obtain first JSON data corresponding to the filled React component;
the second filling module is configured to create a Schema object, fill the first JSON data into an attribute field of the Schema object, and obtain second JSON data corresponding to the filled Schema object;
and the second generation module is configured to introduce the second JSON data into a static page and generate an Html page corresponding to the Sheet page.
9. An apparatus for generating an Html page, comprising a processor and a memory storing program instructions, characterized in that the processor is configured to perform the method for generating an Html page according to any one of claims 1 to 7 when executing the program instructions.
10. A device comprising means for generating an Html page as claimed in claim 9.
CN202110473137.9A 2021-04-29 2021-04-29 Method, device and equipment for generating Html page Pending CN115268902A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110473137.9A CN115268902A (en) 2021-04-29 2021-04-29 Method, device and equipment for generating Html page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110473137.9A CN115268902A (en) 2021-04-29 2021-04-29 Method, device and equipment for generating Html page

Publications (1)

Publication Number Publication Date
CN115268902A true CN115268902A (en) 2022-11-01

Family

ID=83745469

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110473137.9A Pending CN115268902A (en) 2021-04-29 2021-04-29 Method, device and equipment for generating Html page

Country Status (1)

Country Link
CN (1) CN115268902A (en)

Similar Documents

Publication Publication Date Title
CN108804159B (en) Javascript module loading method and preprocessing method and device thereof, and computer equipment
CN103605747A (en) Method and device for processing file form
CN111680634B (en) Document file processing method, device, computer equipment and storage medium
CN114424257A (en) Automatic rendering and extraction of form data using machine learning
CN106933835A (en) The data lead-in method and system of a kind of compatibility parsing Excel file
CN111126019B (en) Report generation method and device based on mode customization and electronic equipment
US9613005B2 (en) Method and apparatus for bidirectional typesetting
CN110780860A (en) Generation method and device of table building script, computer equipment and storage medium
CN108255479A (en) Creation method, device, storage medium and the terminal of cube files
CN114816404A (en) Method and device for dynamically rendering view page, computer equipment and storage medium
CN112558940A (en) Website page development method, device, equipment and storage medium based on table
CN110362630B (en) Data management method, device, equipment and computer readable storage medium
CN108388796B (en) Dynamic domain name verification method, system, computer device and storage medium
CN111367982B (en) Method, device, computer equipment and storage medium for importing TRRIGA basic data
CN106933552B (en) Data processing method and front-end code generating device
CN114861614A (en) Method and device for filling data, electronic equipment and medium
CN115268902A (en) Method, device and equipment for generating Html page
CN110727458A (en) Method and device for switching page template settings through background management
CN110543641A (en) chinese and foreign language information comparison method and device
CN111435300A (en) Web system development method, device, equipment and storage medium
CN113703753B (en) Method and device for product development and product development system
CN109597845B (en) Report configuration method, report configuration device, computer equipment and storage medium
CN114925125A (en) Data processing method, device and system, electronic equipment and storage medium
CN114741077A (en) Page effect preview method, device, equipment and medium based on field granularity
CN112464618A (en) Method and device for paging document data, storage medium and electronic equipment

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