Method, device and computer equipment for generating forms based on Excel template

The method and device convert Excel templates into Html forms by parsing attributes, allowing users to input data, thereby simplifying the development process and reducing costs and enhancing efficiency.

CN111680479BActive Publication Date: 2024-12-17PINGAN INT SMART CITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010327850.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-23
Publication Date
2024-12-17
Estimated Expiration
2040-04-23

AI Technical Summary

Technical Problem

Existing Html forms require technical expertise for development and modification, leading to high development time, labor costs, and low efficiency due to fixed data processing modes and form styles.

Method used

A method and device that converts Excel templates into Html forms by parsing Excel table attributes into corresponding Html attributes, allowing users to input data at designated positions to generate forms, simplifying the development process.

Benefits of technology

Enables users to quickly and easily convert Excel tables into Html forms, reducing development and maintenance costs while improving efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111680479B_ABST
    Figure CN111680479B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, computer equipment and storage medium for generating a form based on an Excel template, the method comprising: obtaining a preset Excel template and displaying the Excel template; receiving table data corresponding to a first header attribute in the Excel template inputted by a user at a first designated position of the Excel template to obtain an Excel table; converting a second header attribute of the Excel table into a corresponding Html attribute according to a preset parsing rule; adding a corresponding attribute tag to each Html attribute respectively; obtaining a preset form template and an attribute tag, and rendering the attribute tag in the form template to obtain an original Html form; according to the table data, inputting table data at a second designated position corresponding to the Html attribute in the original Html form to obtain an Html form corresponding to the Excel table. The present application can effectively simplify the development process of Html forms, save the development and maintenance costs of Html forms, and improve the development efficiency of Html forms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet development technology, and in particular to a method, device, computer equipment and storage medium for generating a form based on an Excel template. Background Art

[0002] Html forms refer to pages on a web page that require users to enter information, usually text information. Currently, the normal business operations of large and small companies are inseparable from Html forms. Companies use various Html forms to understand the company's production, sales, and profitability, and use this to provide a basis for the company's later production and employee assessment.

[0003] The existing Html forms have the following problems: Html forms only provide one or several fixed data processing modes and form styles. When the calculation method and form style need to be changed, ordinary users cannot operate due to technical limitations, and can only be completed by developers. That is, after receiving the business requirements, developers conduct technical analysis and implementation, and then launch the form on the system after a certain period of development. In the process of business personnel using Html forms, if the business requirements change in the middle, the developers need to re-develop the Html form. Therefore, the existing Html form generation and development mode is highly technical, complex to operate, the form development time cost and labor cost are relatively high, and the development efficiency is low. Summary of the invention

[0004] The main purpose of this application is to provide a method, device, computer equipment and storage medium for generating forms based on Excel templates, aiming to solve the technical problems of the existing Html form generation and development mode being highly technical, complex to operate, relatively high form development time and labor costs, and low development efficiency.

[0005] The present application proposes a method for generating a form based on an Excel template, the method comprising the steps of:

[0006] Obtain a preset Excel template and display the Excel template;

[0007] Receiving table data corresponding to a first table header attribute in the Excel template input by a user at a first designated position of the Excel template, and obtaining an Excel table, wherein the first table header attribute at least includes label display, label category, and label name;

[0008] According to a preset parsing rule, convert the second header attribute of the Excel table into a corresponding Html attribute, wherein the second header attribute of the Excel table corresponds to the first header attribute of the Excel template;

[0009] Add corresponding attribute tags to each of the Html attributes respectively;

[0010] Obtaining a preset form template and the attribute tag, and rendering the attribute tag in the form template to obtain an original Html form;

[0011] According to the table data, the table data is input at a second designated position corresponding to the Html attribute in the original Html form to obtain an Html form corresponding to the Excel form.

[0012] Optionally, before the step of obtaining a preset Excel template and displaying the Excel template, the following steps are included:

[0013] Get the form style corresponding to user needs;

[0014] Generate an original Excel template according to the form style;

[0015] Get Html form data corresponding to user needs;

[0016] According to the Html form data, header attribute data corresponding to the Html form data is added to the original Excel template to obtain the Excel template.

[0017] Optionally, before the step of converting the second header attribute of the Excel table into a corresponding Html attribute according to a preset parsing rule, the following steps are included:

[0018] Determine whether there is a specified header attribute among all header attributes in the Excel table, wherein the number of the specified header attributes is one or more, and the specified cell corresponding to the specified header attribute is not filled with cell information;

[0019] If it is determined that a specified header attribute exists among all header attributes in the Excel table, the specified header attribute is screened out, and a default attribute data value corresponding to the specified header attribute is obtained;

[0020] Filling the default data value of the attribute in the specified cell to obtain an Excel table filled with data;

[0021] Display the Excel table filled with the data;

[0022] Determining whether a modification instruction for the Excel table triggered by the user is received;

[0023] If it is determined that a modification instruction for the Excel table triggered by the user is received, a corresponding modification process is performed on the Excel table according to the modification instruction.

[0024] Optionally, the Html attribute includes an Html tag attribute and a form layout attribute, and the step of converting the second header attribute of the Excel table into a corresponding Html attribute according to a preset parsing rule includes:

[0025] Filter out the first designated header attribute and the second designated header attribute from the second header attribute of the Excel table;

[0026] Get the preset attribute mapping table;

[0027] According to the attribute mapping table, converting the first specified header attribute of the Excel table into a corresponding Html tag attribute; and,

[0028] According to the attribute mapping table, the second designated header attribute of the Excel table is converted into a corresponding form layout attribute.

[0029] Optionally, the step of obtaining a preset form template and the attribute tags, and rendering each of the attribute tags in the form template to obtain an original Html form includes:

[0030] Acquire the attribute tags, and filter out a first attribute tag corresponding to the Html tag attribute and a second attribute tag corresponding to the form layout attribute from the attribute tags;

[0031] Rendering the first attribute mark into a corresponding first UI component; and,

[0032] Rendering the second attribute mark into a corresponding second UI component;

[0033] Get the preset form template;

[0034] The first UI component and the second UI component are deployed in the form template to obtain the original Html form.

[0035] Optionally, the step of inputting the table data at a second designated position corresponding to the Html attribute in the original Html form according to the table data to obtain an Html form corresponding to the Excel form includes:

[0036] Filtering out first table data corresponding to the first UI component from the table data; and,

[0037] Filtering second table data corresponding to the second UI component from the table data;

[0038] importing the first table data into the first UI component; and,

[0039] Get the preset form template;

[0040] Import the second table data into the second UI component to obtain an Html form corresponding to the Excel table.

[0041] Optionally, after the step of inputting the table data at a second designated position corresponding to the Html attribute in the original Html form according to the table data to obtain an Html form corresponding to the Excel form, the method further comprises:

[0042] Create the specified file directory;

[0043] Storing the Html form in the specified file directory;

[0044] After the storage of the Html form is completed, the Html form is displayed.

[0045] The present application also provides a device for generating a form based on an Excel template, comprising:

[0046] A first acquisition module is used to acquire a preset Excel template and display the Excel template;

[0047] A first receiving module is used to receive table data corresponding to a first table header attribute in the Excel template input by a user at a first designated position of the Excel template, and obtain an Excel table, wherein the first table header attribute at least includes label display, label category and label name;

[0048] A conversion module, used for converting the second header attribute of the Excel table into a corresponding Html attribute according to a preset parsing rule, wherein the second header attribute of the Excel table corresponds to the first header attribute of the Excel template;

[0049] A first adding module, used for adding a corresponding attribute tag to each of the Html attributes;

[0050] The second acquisition module is used to acquire a preset form template and the attribute mark, and render the attribute mark in the form template to obtain an original Html form;

[0051] An input module is used to input the table data at a second designated position corresponding to the Html attribute in the original Html form according to the table data, so as to obtain an Html form corresponding to the Excel form.

[0052] The present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0053] The present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0054] The method, device, computer equipment and storage medium for generating a form based on an Excel template provided in this application have the following beneficial effects:

[0055] The method, device, computer equipment and storage medium for generating a form based on an Excel template provided in the present application obtain a preset Excel template and display the Excel template; receive table data corresponding to a first header attribute in the Excel template input by a user at a first designated position of the Excel template to obtain an Excel table, wherein the first header attribute at least includes label display, label category and label name; according to a preset parsing rule, convert the second header attribute of the Excel table into a corresponding Html attribute, wherein the second header attribute of the Excel table corresponds to the first header attribute of the Excel template; add a corresponding attribute tag to each of the Html attributes; obtain a preset form template and the attribute tag, and render the attribute tag in the form template to obtain an original Html form; according to the table data, input the table data at a second designated position corresponding to the Html attribute in the original Html form to obtain an Html form corresponding to the Excel table. Through this application, users only need to enter standardized table data at the corresponding position in the Excel table to quickly and easily convert the Excel table file into the corresponding Html form, which effectively simplifies the development process of the Html form, saves the development and maintenance costs of the Html form, and improves the development efficiency of the Html form. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a flowchart of a method for generating a form based on an Excel template according to an embodiment of the present application;

[0057] Figure 2It is a structural schematic diagram of a device for generating a form based on an Excel template according to an embodiment of the present application;

[0058] Figure 3 It is a schematic diagram of the structure of a computer device according to an embodiment of the present application.

[0059] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0060] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0061] It should be noted that all directional indications in the embodiments of the present application (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly. The connection can be a direct connection or an indirect connection.

[0062] Reference Figure 1 , a method for generating a form based on an Excel template in an embodiment of the present application includes:

[0063] S1: Obtain a preset Excel template and display the Excel template;

[0064] S2: receiving table data corresponding to a first table header attribute in the Excel template input by a user at a first designated position of the Excel template, and obtaining an Excel table, wherein the first table header attribute at least includes label display, label category and label name;

[0065] S3: according to a preset parsing rule, convert the second header attribute of the Excel table into a corresponding Html attribute, wherein the second header attribute of the Excel table corresponds to the first header attribute of the Excel template;

[0066] S4: adding corresponding attribute tags to each of the Html attributes;

[0067] S5: obtaining a preset form template and the attribute mark, and rendering the attribute mark in the form template to obtain an original Html form;

[0068] S6: According to the table data, input the table data at a second designated position corresponding to the Html attribute in the original Html form to obtain an Html form corresponding to the Excel form.

[0069] As described in the above steps S1 to S6, the execution subject of the embodiment of the method is a device for generating a form based on an Excel template. In practical applications, the device for generating a form based on an Excel template can be implemented by a virtual device, such as a software code, or by a physical device with relevant execution code written or integrated, and can interact with the user through a keyboard, a mouse, a remote control, a touchpad or a voice control device. The device for generating a form based on an Excel template provided in this embodiment can easily and quickly convert an Excel table file into a corresponding Html form, thereby effectively simplifying the development process of the Html form and improving the development efficiency of the Html form. Specifically, first obtain a preset Excel template, and show the above Excel template to the user, so that the user can enter the corresponding data in the Excel template according to their actual needs. Among them, the above Excel template is developed and generated by the developer according to actual needs using the Excel parsing method and the form rendering method. Then receive the table data corresponding to the first header attribute in the Excel template entered by the user at the first specified position of the above Excel template, and obtain an Excel table. Among them, the above table data may specifically include form components and configuration data, and the above first header attribute at least includes label display, label category and label name. After obtaining the above-mentioned Excel table, according to the preset parsing rules, the second header attribute of the above-mentioned Excel table is converted into the corresponding Html attribute, wherein the second header attribute of the above-mentioned Excel table corresponds to the first header attribute of the above-mentioned Excel template. In addition, the above-mentioned Html attribute may specifically include Html tag attributes and form layout attributes. After obtaining the above-mentioned Html attributes, corresponding attribute tags will be added to each of the above-mentioned Html attributes. Then, the preset form template and the above-mentioned attribute tags are obtained, and the above-mentioned attribute tags are rendered in the above-mentioned form template to obtain the original Html form. Among them, the above-mentioned form template is an Html form template that has not been rendered and is designed according to the form development requirements. In addition. The above-mentioned rendering process refers to rendering the above-mentioned attribute tags corresponding to the Html attributes into corresponding UI components. After obtaining the above-mentioned original Html form, according to the above-mentioned table data, the above-mentioned table data is input at the second designated position corresponding to the above-mentioned Html attribute in the above-mentioned original Html form to obtain the Html form corresponding to the above-mentioned Excel table. Through this embodiment, the user only needs to enter standardized table data in the Excel table to conveniently and quickly convert the Excel table file into the corresponding Html form, which simplifies the development process of the Html form, saves the development and maintenance costs of the Html form, and improves the development efficiency of the Html form.

[0070] Furthermore, in an embodiment of the present application, before the above step S1, the following steps are included:

[0071] S100: Obtain a form style corresponding to user needs;

[0072] S101: Generate an original Excel template according to the form style;

[0073] S102: Obtaining Html form data corresponding to user needs;

[0074] S103: According to the Html form data, header attribute data corresponding to the Html form data is added to the original Excel template to obtain the Excel template.

[0075] As described in the above steps S100 to S103, before the above steps of obtaining the preset Excel template and displaying the above Excel template, the generation process of generating the above Excel template is also included. Specifically, a form style corresponding to the user's needs is first obtained. Among them, the content and form of the above form style are not specifically limited, as long as they are consistent with the actual needs of the user. Then, according to the above form style, an original Excel template is generated. Among them, the content and form of the above original Excel template are not specifically limited, and the template generation is only required to meet the requirements of the above form style and according to the form style. After that, the Html form data corresponding to the user's needs is obtained. Among them, the above form data at least includes form components and form components, etc. After obtaining the above Html form data, the header attribute data corresponding to the above Html form data is added to the above original Excel template to obtain the above Excel template. This embodiment can generate an Excel template according to the actual needs of the user, and then can quickly generate an Html form that meets the user's needs according to the Excel template, effectively ensuring the user's experience.

[0076] Furthermore, in an embodiment of the present application, before the above step S3, the following steps are included:

[0077] S300: Determine whether there is a designated header attribute among all header attributes in the Excel table, wherein the number of the designated header attributes is one or more, and the designated cell corresponding to the designated header attribute is not filled with cell information;

[0078] S301: If it is determined that a designated header attribute exists among all header attributes in the Excel table, the designated header attribute is selected, and a default attribute data value corresponding to the designated header attribute is obtained;

[0079] S302: Fill the default data value of the attribute in the designated cell to obtain an Excel table filled with data;

[0080] S303: Displaying the Excel table filled with the data;

[0081] S304: Determine whether a modification instruction for the Excel table triggered by the user is received;

[0082] S305: If it is determined that a modification instruction for the Excel table is received, then a corresponding modification process is performed on the Excel table according to the modification instruction.

[0083] As described in the above steps S300 to S305, after the step of receiving the table data corresponding to the first header attribute in the Excel template input by the user at the first designated position of the Excel template to obtain the Excel table, a data processing process for data improvement and data supplementation of the Excel table can be further performed. Specifically, first determine whether there is a specified header attribute among all the header attributes in the Excel table, wherein the number of the specified header attributes is one or more, and the specified cell corresponding to the specified header attribute is not filled with cell information. If it is determined that there is a specified header attribute among all the header attributes in the Excel table, the specified header attribute is filtered out, and the attribute default data value corresponding to the specified header attribute is obtained. Then fill the attribute default data value in the specified cell to obtain the Excel table filled with data. Among them, the label information to be supplemented corresponding to the specified cell of the specified header attribute can be obtained, and then according to the label information to be supplemented, the pre-stored default data value of the attribute of the label information to be supplemented is automatically configured. For example, if the above-mentioned specified header attribute is the maximum input, and the corresponding label information to be supplemented is age, the pre-set attribute default data value 100 corresponding to the above-mentioned age will be automatically filled in for the specified cell that has not been filled in with cell information. After that, the Excel table filled with data is displayed to the user, and it is determined whether the modification instruction for the above-mentioned Excel table triggered by the user is received. Among them, there is no specific limitation on the triggering method for the above-mentioned modification, for example, it can be received by pressing a physical button, or by touching a virtual button, and by issuing a corresponding voice, etc. If it is determined that the modification instruction for the above-mentioned Excel table triggered by the user is received, the above-mentioned Excel table is modified accordingly according to the above-mentioned modification instruction. In this embodiment, when there is a situation in which data is not filled in the specified cell corresponding to the specified table attribute in the Excel table, the default attribute data value will be intelligently filled in the Excel table to supplement the Excel table, so that a more complete Html form with data can be generated according to the Excel table later. In addition, since the user has the right to modify the generated Excel template, the user's experience is effectively guaranteed.

[0084] Furthermore, in an embodiment of the present application, the Html attributes include Html tag attributes and form layout attributes, and the above step S3 includes:

[0085] S310: Filtering out a first designated header attribute and a second designated header attribute from the second header attributes of the Excel table;

[0086] S311: Obtain a preset attribute mapping table;

[0087] S312: According to the attribute mapping table, convert the first specified header attribute of the Excel table into a corresponding Html tag attribute; and

[0088] S313: According to the attribute mapping table, convert the second designated header attribute of the Excel table into a corresponding form layout attribute.

[0089] As described in the above steps S310 to S313, the above Html attributes include Html tag attributes and form layout attributes. The above step of converting the second header attributes of the above Excel table into corresponding Html attributes according to the preset parsing rules may specifically include: first, filter out the first specified header attribute and the second specified header attribute from the header attributes of the above Excel table. Among them, the first specified header attribute is the header attribute corresponding to the above Html tag attribute, and the second specified header attribute is the header attribute corresponding to the above form layout attribute. Then obtain the preset attribute mapping table, wherein the above attribute mapping table is developed and generated by the developer according to the actual form generation requirements, and the above attribute mapping table may specifically include the header attributes corresponding to the Excel table and the Html attributes corresponding to the Html form. Specifically, the above header attributes may at least include the following attribute data: tag attributes, tag category, tag name, maximum input, default value, empty display, whether disabled, whether readable, whether required, layout spanning columns, and layout offset. And the Html attributes that have a one-to-one mapping relationship with the above header attributes are: label, tagtype, name, maxlength, value, placeholder, disabled, readonly, required, layoutspan, layoutoffset. Finally, according to the mapping relationship in the above attribute mapping table, the first specified header attribute of the above Excel table is converted into the corresponding Html tag attribute; and according to the above attribute mapping table, the second specified header attribute of the above Excel table is converted into the corresponding form layout attribute, so that the preset form template can be rendered and the table data input can be processed according to the converted Html tag attribute and form layout attribute to generate an Html form corresponding to the Excel table.

[0090] Furthermore, in an embodiment of the present application, the above step S5 includes:

[0091] S500: Acquire the attribute tags, and filter out a first attribute tag corresponding to the Html tag attribute and a second attribute tag corresponding to the form layout attribute from the attribute tags;

[0092] S501: Rendering the first attribute mark into a corresponding first UI component; and,

[0093] S502: Rendering the second attribute mark into a corresponding second UI component;

[0094] S503: Obtain a preset form template;

[0095] S504: deploy the first UI component and the second UI component in the form template to obtain the original Html form.

[0096] As described in the above steps S500 to S504, different attribute tags are set for different Html attributes. The above step of rendering the above attribute tags in the above form template to obtain the original Html form may specifically include: first obtaining the above attribute tags, and filtering out the first attribute tags corresponding to the above Html tag attributes and the second attribute tags corresponding to the above form layout attributes from the above attribute tags. Among them, different attribute tags are marked for different Html attributes. Then the above first attribute tag is rendered into the corresponding first UI component, and the above second attribute tag is rendered into the corresponding second UI component. Among them, the above first UI component and the second UI component may specifically include UI components such as text boxes, radio buttons, check boxes, multiple selection boxes, date components, etc. In addition, the process of rendering the above first attribute tag into the corresponding first UI component may include: first splitting the above first attribute tag according to the agreed format to obtain a split result, then reading the split result to obtain a read result, and finally rendering the above first attribute tag into the corresponding first UI component according to the read result. For example, for the first attribute tag, assuming that the first attribute tag is / label / , #label# can be split into three results: #, label, and #, and the three results are read to obtain the reading result: starting with the first #, label as the input style, and ending with the last #. Finally, according to the reading result, #label# is rendered into a label display box. In addition, for the second attribute tag, the format of the second attribute tag is different from the format of the first attribute tag. For example, assuming that the second attribute tag is #layoutspan#, the rendering steps for the second attribute tag can refer to the rendering steps of the first attribute tag, which will not be repeated here. After completing the rendering of the above-mentioned first UI component and the second UI component, the preset form template is obtained. Finally, the above-mentioned first UI component and the above-mentioned second UI component are deployed in the above-mentioned form template to obtain the above-mentioned original Html form, so that the Html form corresponding to the Excel table can be generated in the original Html form according to the original Html form.

[0097] In one embodiment of the present application, the above step S6 includes:

[0098] S600: Filtering out first table data corresponding to the first UI component from the table data; and

[0099] S601: Filtering out second table data corresponding to the second UI component from the table data;

[0100] S602: Importing the first table data into the first UI component; and,

[0101] S603: Import the second table data into the second UI component to obtain an Html form corresponding to the Excel table.

[0102] As described in the above steps S600 to S603, the above table data can also be specifically divided into the first table data and the second table data according to the different data attribute types. The above step of inputting the above table data at the position corresponding to the above Html attribute in the above original Html form according to the above table data to obtain the Html form corresponding to the above Excel table may specifically include: firstly, filtering out the first table data corresponding to the above first UI component from the above table data; and, filtering out the second table data corresponding to the above second UI component from the above table data. After obtaining the above first table data and the second table data, the above first table data is imported into the above first UI component; and the above second table data is imported into the above second UI component, thereby obtaining the Html form corresponding to the above Excel table. After obtaining the original Html form, this embodiment generates the final Html form by splitting the table data input into Excel by the user into the first table data and the second table data, and then importing the first table data and the second table data into different UI components respectively, which effectively ensures the accuracy of the generated Html form.

[0103] Furthermore, in an embodiment of the present application, after the above step S6, the following steps are included:

[0104] S610: Create a specified file directory;

[0105] S611: storing the Html form in the specified file directory;

[0106] S612: After completing the storage of the Html form, display the Html form.

[0107] As described in above steps S610 to S612, after generating the above Html form, the Html form can also be subsequently stored and displayed accordingly. Specifically, first create a designated file directory. Wherein, the file address corresponding to the above designated file directory can be set according to actual conditions, preferably a file directory for storing intermediate files and having a large storage space. After completing the creation of the above designated file directory, then the above Html form is stored in the above designated file directory. Wherein, by storing the produced Html form in the designated file directory, it can be effectively prevented that even if the Html form is lost, the corresponding storage file can be found later. And after completing the storage of the above Html form, the above Html form is displayed. Wherein, the display mode of the Html form is not specifically limited, for example, it can be displayed to the user in the form of a browser so that the user can clearly view the content in the Html form.

[0108] Reference Figure 2 In one embodiment of the present application, there is also provided a device for generating a form based on an Excel template, comprising:

[0109] The first acquisition module 1 is used to acquire a preset Excel template and display the Excel template;

[0110] A first receiving module 2 is used to receive table data corresponding to a first table header attribute in the Excel template input by a user at a first designated position of the Excel template, and obtain an Excel table, wherein the first table header attribute at least includes label display, label category and label name;

[0111] A conversion module 3, used for converting the second header attribute of the Excel table into a corresponding Html attribute according to a preset parsing rule, wherein the second header attribute of the Excel table corresponds to the first header attribute of the Excel template;

[0112] A first adding module 4, used to add a corresponding attribute tag to each of the Html attributes;

[0113] The second acquisition module 5 is used to acquire a preset form template and the attribute mark, and render the attribute mark in the form template to obtain an original Html form;

[0114] The input module 6 is used to input the table data at a second designated position corresponding to the Html attribute in the original Html form according to the table data, so as to obtain an Html form corresponding to the Excel form.

[0115] In this embodiment, the implementation process of the functions and effects of the first acquisition module, the first receiving module, the conversion module, the first adding module, the second acquisition module and the input module in the above-mentioned device for generating a form based on an Excel template is specifically described in the implementation process of the corresponding steps S1 to S6 in the above-mentioned method for generating a form based on an Excel template, and will not be repeated here.

[0116] Furthermore, in one embodiment of the present application, the device for generating a form based on an Excel template includes:

[0117] The third acquisition module is used to acquire the form style corresponding to the user's needs;

[0118] A generating module, used for generating an original Excel template according to the form style;

[0119] The fourth acquisition module is used to acquire Html form data corresponding to user needs;

[0120] The second adding module is used to add header attribute data corresponding to the Html form data in the original Excel template according to the Html form data to obtain the Excel template.

[0121] In this embodiment, the implementation process of the functions and effects of the third acquisition module, generation module, fourth acquisition module and second adding module in the above-mentioned device for generating a form based on an Excel template is specifically described in the implementation process of the corresponding steps S100 to S103 in the above-mentioned method for generating a form based on an Excel template, and will not be repeated here.

[0122] Furthermore, in one embodiment of the present application, the device for generating a form based on an Excel template includes:

[0123] A first judging module is used to judge whether there is a designated header attribute among all the header attributes in the Excel table, wherein the number of the designated header attributes is one or more, and the designated cell corresponding to the designated header attribute has no cell information filled in;

[0124] A screening module, for screening out the specified header attribute if it is determined that there is a specified header attribute among all the header attributes in the Excel table, and obtaining a default attribute data value corresponding to the specified header attribute;

[0125] A filling module is used to fill the default data value of the attribute in the specified cell to obtain an Excel table filled with data;

[0126] A first display module is used to display the Excel table filled with the data;

[0127] A second judgment module is used to judge whether a modification instruction for the Excel table triggered by the user is received;

[0128] The modification module is used to perform corresponding modification processing on the Excel table according to the modification instruction if it is determined that a modification instruction for the Excel table triggered by the user is received.

[0129] In this embodiment, the implementation process of the functions and effects of the first judgment module, screening module, filling module, first display module, second judgment module and modification module in the above-mentioned device for generating a form based on an Excel template is specifically described in the implementation process of the corresponding steps S300 to S305 in the above-mentioned method for generating a form based on an Excel template, and will not be repeated here.

[0130] Furthermore, in one embodiment of the present application, the Html attributes include Html tag attributes and form layout attributes, and the above-mentioned conversion module includes:

[0131] A first screening unit, used to screen out a first designated header attribute and a second designated header attribute from the second header attribute of the Excel table;

[0132] A first acquisition unit, used to acquire a preset attribute mapping table;

[0133] A first conversion unit is used to convert the first specified header attribute of the Excel table into a corresponding Html tag attribute according to the attribute mapping table; and

[0134] The second conversion unit is used to convert the second designated header attribute of the Excel table into a corresponding form layout attribute according to the attribute mapping table.

[0135] In this embodiment, the implementation process of the functions and effects of the screening unit, the acquisition unit, the first conversion unit and the second conversion unit in the above-mentioned device for generating a form based on an Excel template is specifically described in the implementation process of the corresponding steps S310 to S313 in the above-mentioned method for generating a form based on an Excel template, and will not be repeated here.

[0136] Furthermore, in one embodiment of the present application, the second acquisition module includes:

[0137] A second screening unit is used to obtain the attribute tags, and screen out a first attribute tag corresponding to the Html tag attribute and a second attribute tag corresponding to the form layout attribute from the attribute tags;

[0138] A first rendering unit is configured to render the first attribute mark into a corresponding first UI component; and

[0139] A second rendering unit, configured to render the second attribute mark into a corresponding second UI component;

[0140] A second acquisition unit, used to acquire a preset form template;

[0141] A deployment unit is used to deploy the first UI component and the second UI component in the form template to obtain the original Html form.

[0142] In this embodiment, the implementation process of the functions and effects of the second screening unit, the first rendering unit, the second rendering unit, the second acquisition unit and the deployment unit in the above-mentioned device for generating a form based on an Excel template is specifically described in the implementation process of the corresponding steps S500 to S504 in the above-mentioned method for generating a form based on an Excel template, and will not be repeated here.

[0143] Furthermore, in one embodiment of the present application, the third processing module includes:

[0144] A second acquisition unit is used to acquire a preset report template and a curve template;

[0145] a first input unit, configured to input the return data value into a corresponding position of the report template to obtain report data corresponding to the return data value; and

[0146] The second input unit is used to input the return data value into the corresponding position of the curve template to obtain curve data corresponding to the return data value.

[0147] In this embodiment, the implementation process of the functions and effects of the second acquisition unit, the first input unit and the second input unit in the above-mentioned device for generating a form based on an Excel template is specifically described in the implementation process of the corresponding steps S6010 to S6012 in the above-mentioned method for generating a form based on an Excel template, and will not be repeated here.

[0148] Furthermore, in one embodiment of the present application, the input module includes:

[0149] Create a unit, used to create a specified file directory;

[0150] A storage unit, used for storing the Html form in the specified file directory;

[0151] The second display unit is used to display the Html form after completing the storage of the Html form.

[0152] In this embodiment, the implementation process of the functions and effects of the creation unit, the storage unit and the second display unit in the above-mentioned device for generating a form based on an Excel template is specifically described in detail in the implementation process of the corresponding steps S610 to S612 in the above-mentioned method for generating a form based on an Excel template, and will not be repeated here.

[0153] Reference Figure 3 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed for the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as Excel templates, table data, header attributes, attribute tags and form templates. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for generating a form based on an Excel template is implemented.

[0154] The processor executes the steps of the method for generating a form based on an Excel template:

[0155] Obtain a preset Excel template and display the Excel template;

[0156] Receiving table data corresponding to a first table header attribute in the Excel template input by a user at a first designated position of the Excel template, and obtaining an Excel table, wherein the first table header attribute at least includes label display, label category, and label name;

[0157] According to a preset parsing rule, convert the second header attribute of the Excel table into a corresponding Html attribute, wherein the second header attribute of the Excel table corresponds to the first header attribute of the Excel template;

[0158] Add corresponding attribute tags to each of the Html attributes respectively;

[0159] Obtaining a preset form template and the attribute tag, and rendering the attribute tag in the form template to obtain an original Html form;

[0160] According to the table data, the table data is input at a second designated position corresponding to the Html attribute in the original Html form to obtain an Html form corresponding to the Excel form.

[0161] Those skilled in the art will understand that Figure 3 The structure shown in is merely a block diagram of a portion of the structure related to the present application scheme, and does not constitute a limitation on the devices and computer equipment to which the present application scheme is applied.

[0162] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, a method for generating a form based on an Excel template is implemented, specifically:

[0163] Obtain a preset Excel template and display the Excel template;

[0164] Receiving table data corresponding to a first table header attribute in the Excel template input by a user at a first designated position of the Excel template, and obtaining an Excel table, wherein the first table header attribute at least includes label display, label category, and label name;

[0165] According to a preset parsing rule, convert the second header attribute of the Excel table into a corresponding Html attribute, wherein the second header attribute of the Excel table corresponds to the first header attribute of the Excel template;

[0166] Add corresponding attribute tags to each of the Html attributes respectively;

[0167] Obtaining a preset form template and the attribute tag, and rendering the attribute tag in the form template to obtain an original Html form;

[0168] According to the table data, the table data is input at a second designated position corresponding to the Html attribute in the original Html form to obtain an Html form corresponding to the Excel form.

[0169] In summary, the method, device, computer equipment and storage medium for generating a form based on an Excel template provided in the embodiments of the present application obtain a preset Excel template and display the Excel template; receive table data corresponding to the first header attribute in the Excel template input by the user at the first specified position of the Excel template to obtain an Excel table, wherein the first header attribute at least includes label display, label category and label name; according to a preset parsing rule, the second header attribute of the Excel table is converted into a corresponding Html attribute, wherein the second header attribute of the Excel table corresponds to the first header attribute of the Excel template; add corresponding attribute tags to each of the Html attributes respectively; obtain a preset form template and the attribute tags, and render the attribute tags in the form template to obtain an original Html form; according to the table data, enter the table data at the second specified position corresponding to the Html attribute in the original Html form to obtain an Html form corresponding to the Excel table. Through the embodiments of the present application, users only need to enter standardized table data at the corresponding position in the Excel table to quickly and conveniently convert the Excel table file into the corresponding Html form, which effectively simplifies the development process of the Html form, saves the development and maintenance costs of the Html form, and improves the development efficiency of the Html form.

[0170] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0171] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0172] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for generating a form based on an Excel template, characterized in that: include: Obtain a preset Excel template and display the Excel template; Receiving table data corresponding to a first table header attribute in the Excel template input by a user at a first designated position of the Excel template, and obtaining an Excel table, wherein the first table header attribute at least includes label display, label category, and label name; According to a preset parsing rule, convert the second header attribute of the Excel table into a corresponding Html attribute, wherein the second header attribute of the Excel table corresponds to the first header attribute of the Excel template; Add corresponding attribute tags to each of the Html attributes respectively; Obtaining a preset form template and the attribute tag, and rendering the attribute tag in the form template to obtain an original Html form; According to the table data, input the table data at a second designated position corresponding to the Html attribute in the original Html form to obtain an Html form corresponding to the Excel form; The Html attributes include Html tag attributes and form layout attributes. The step of converting the second header attributes of the Excel table into corresponding Html attributes according to the preset parsing rules includes: Filter out the first designated header attribute and the second designated header attribute from the second header attribute of the Excel table; Get the preset attribute mapping table; According to the attribute mapping table, converting the first specified header attribute of the Excel table into a corresponding Html tag attribute; and, According to the attribute mapping table, convert the second specified header attribute of the Excel table into a corresponding form layout attribute; The step of obtaining the preset form template and the attribute tags, and rendering each of the attribute tags in the form template to obtain the original Html form includes: Acquire the attribute tags, and filter out a first attribute tag corresponding to the Html tag attribute and a second attribute tag corresponding to the form layout attribute from the attribute tags; Rendering the first attribute mark into a corresponding first UI component; and, Rendering the second attribute mark into a corresponding second UI component; Get the preset form template; Deploy the first UI component and the second UI component in the form template to obtain the original Html form; The step of inputting the table data at a second designated position corresponding to the Html attribute in the original Html form according to the table data to obtain an Html form corresponding to the Excel form comprises: Filtering out first table data corresponding to the first UI component from the table data; and, Filtering second table data corresponding to the second UI component from the table data; importing the first table data into the first UI component; and, Import the second table data into the second UI component to obtain an Html form corresponding to the Excel table.

2. The method for generating a form based on an Excel template according to claim 1, characterized in that: Before the step of obtaining a preset Excel template and displaying the Excel template, the following steps are included: Get the form style corresponding to user needs; Generate an original Excel template according to the form style; Get Html form data corresponding to user needs; According to the Html form data, header attribute data corresponding to the Html form data is added to the original Excel template to obtain the Excel template.

3. The method for generating a form based on an Excel template according to claim 1, characterized in that: Before the step of converting the second header attribute of the Excel table into the corresponding Html attribute according to the preset parsing rule, the method includes: Determine whether there is a specified header attribute among all header attributes in the Excel table, wherein the number of the specified header attributes is one or more, and the specified cell corresponding to the specified header attribute is not filled with cell information; If it is determined that a specified header attribute exists among all header attributes in the Excel table, the specified header attribute is screened out, and a default attribute data value corresponding to the specified header attribute is obtained; Filling the default data value of the attribute in the specified cell to obtain an Excel table filled with data; Display the Excel table filled with the data; Determining whether a modification instruction for the Excel table triggered by the user is received; If it is determined that a modification instruction for the Excel table triggered by the user is received, a corresponding modification process is performed on the Excel table according to the modification instruction.

4. The method for generating a form based on an Excel template according to claim 1, characterized in that: After the step of inputting the table data at the second designated position corresponding to the Html attribute in the original Html form according to the table data to obtain the Html form corresponding to the Excel form, the method further comprises: Create the specified file directory; Storing the Html form in the specified file directory; After the storage of the Html form is completed, the Html form is displayed.

5. A device for generating a form based on an Excel template, used to execute the method according to any one of claims 1 to 4, characterized in that: include: A first acquisition module is used to acquire a preset Excel template and display the Excel template; A first receiving module is used to receive table data corresponding to a first table header attribute in the Excel template input by a user at a first designated position of the Excel template, and obtain an Excel table, wherein the first table header attribute at least includes label display, label category and label name; A conversion module, used for converting the second header attribute of the Excel table into a corresponding Html attribute according to a preset parsing rule, wherein the second header attribute of the Excel table corresponds to the first header attribute of the Excel template; A first adding module, used for adding a corresponding attribute tag to each of the Html attributes; The second acquisition module is used to acquire a preset form template and the attribute mark, and render the attribute mark in the form template to obtain an original Html form; An input module is used to input the table data at a second designated position corresponding to the Html attribute in the original Html form according to the table data, so as to obtain an Html form corresponding to the Excel form.

6. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

7. A storage medium having a computer program stored thereon, characterized in that: The computer program When the program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.