Template manufacturing method, device, equipment and storage medium

CN117195837BActive Publication Date: 2026-09-25CHINA MERCHANTS BANK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310937975.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-27
Publication Date
2026-09-25
Estimated Expiration
2043-07-27

AI Technical Summary

Technical Problem

[0005]本发明的主要目的在于提供了一种模板制作方法、装置、设备及存储介质,旨在解决现有技术中合同模板制作中的表格是通过预制并上传的方式,在表格内容存在修改时会导致用户工作量增加的技术问题

Benefits of technology

[0041]在本发明中,公开了基于目标用户发送的目标文本内容和目标文本内容对应的原始文本格式确定合同模板基底;获取目标用户的用户需求,并根据用户需求确定模板类型,模板类型包括:表格模板;基于模板类型对应的模板填充要素和文本编辑器在合同模板基底中进行模板填充,并获得填充完成的合同模板文件;相较于现有技术中合同模板制作时的表格需要在表格绘制应用中进行表格预制后再上传,由于本发明根据用户需求确定模板类型,模板类型包括表格模板,并基于模板类型对应的模板填充要素和文本编辑器在合同模板基底中进行模板填充,获得合同模板文件,从而解决了现有技术中合同模板制作中的表格是通过预制并上传的方式,在表格内容存在修改时会导致用户工作量增加的技术问题,进而提高了用户工作效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117195837B_ABST
    Figure CN117195837B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data processing, and discloses a template making method, device, equipment and storage medium, the method comprises the following steps: determining a contract template base based on target text content sent by a target user and an original text format corresponding to the target text content; obtaining user demand of the target user, and determining a template type according to the user demand, the template type comprising: a table template; performing template filling in the contract template base based on template filling elements corresponding to the template type and a text editor, and obtaining a filled contract template file.The present application determines a template type according to user demand, the template type comprising a table template, and performs filling in the contract template base based on template filling elements of the template type and a text editor, to obtain a contract template file, thereby solving the technical problem that in the prior art, a table in contract template making is pre-fabricated and uploaded, and when table content is modified, the workload of the user is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a template creation method, apparatus, device, and storage medium. Background Technology

[0002] With the expansion of business scenarios and the popularization and promotion of e-signatures, e-signatures have changed the original form of signing paper contracts, and electronic contracts are being used more and more widely. However, the existing contract template creation and filling are gradually failing to meet the growing needs of online signing, especially the tables in the contract templates.

[0003] Currently, contract templates typically only support file uploads of forms, meaning the form must be pre-created in a form creation application before uploading. However, if the form content is modified, users must edit the original form and re-upload it, increasing their workload and reducing efficiency.

[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main objective of this invention is to provide a template creation method, apparatus, device, and storage medium, which aims to solve the technical problem that in the prior art, the tables in contract template creation are pre-made and uploaded, which leads to an increase in the user's workload when the table content needs to be modified.

[0006] To achieve the above objectives, the present invention provides a template creation method, the template creation method comprising:

[0007] The contract template base is determined based on the target text content sent by the target user and the original text format corresponding to the target text content;

[0008] Obtain the user needs of the target user, and determine the template type based on the user needs. The template type includes: table template.

[0009] Based on the template filling elements corresponding to the template type and the text editor, the template is filled in the contract template base, and the filled contract template file is obtained.

[0010] Optionally, the step of obtaining the user needs of the target user and determining the template type based on the user needs includes:

[0011] Obtain the user requirements of the target user, and determine whether there are tables in the template to be created based on the user requirements;

[0012] If so, then set the template type to table template;

[0013] The step of filling the template in the contract template base using the template filling elements and text editor corresponding to the template type and obtaining the filled contract template file includes:

[0014] Based on the table filling elements corresponding to the table template, the template is filled in using a text editor on the contract template base, and the filled contract template file is obtained.

[0015] Optionally, the step of filling in the contract template base using a text editor based on the table filling elements corresponding to the table template, and obtaining the filled contract template file, includes:

[0016] Obtain the table name, table description, and table structure corresponding to the table template;

[0017] The table is created based on the table name, the table description, and the table structure to obtain the table fill elements corresponding to the table template.

[0018] Based on the table fill elements, the contract template is filled in using a text editor to obtain the completed contract template file.

[0019] Optionally, the template type further includes: a standard template; after the step of obtaining the user requirements of the target user and determining whether a table exists in the template to be created based on the user requirements, the template further includes:

[0020] If not, then the template type will be determined as the standard template.

[0021] The step of filling the template in the contract template base using the template filling elements and text editor corresponding to the template type and obtaining the filled contract template file includes:

[0022] The fill element type, fill element name, and fill element description are determined based on the standard fill element corresponding to the standard template.

[0023] Based on the fill element type, the fill element name, and the fill element description, the template is filled in using a text editor on the contract template base, and a completed contract template file is obtained.

[0024] Optionally, the step of filling the template in the contract template base based on the template filling elements and text editor corresponding to the template type includes:

[0025] When a double-click event is detected, the fill element information of the template fill element corresponding to the template type is obtained, and the fill element identifier is obtained based on the fill element information;

[0026] The double-click event function converts the fill element identifier into the corresponding document object model.

[0027] Insert the document object model at the target cursor position using a text editor to fill the template filling elements into the contract template base.

[0028] Optionally, before the step of converting the fill feature identifier into the corresponding document object model via the double-click event function, the method further includes:

[0029] When a drag event is detected, the dragged element information is cached. The dragged element information is the information dragged by the user from the template fill elements.

[0030] When a drag-and-release event is detected, the cached dragged element information is sent to the double-click event function.

[0031] Optionally, before the step of inserting the document object model at the target cursor position using a text editor to fill the template filling elements onto the contract template base, the method further includes:

[0032] Add the preset locking attribute to the target tag of the document object model to obtain the target document object model;

[0033] The step of inserting the document object model at the target cursor position using a text editor to fill the template filling elements onto the contract template base includes:

[0034] Insert the target document object model into the target cursor position using a text editor to fill the template filling elements into the contract template base.

[0035] Furthermore, to achieve the above objectives, the present invention also proposes a template making apparatus, the apparatus comprising:

[0036] The template base determination module is used to determine the contract template base based on the target text content sent by the target user and the original text format corresponding to the target text content.

[0037] The template type determination module is used to obtain the user requirements of the target user and determine the template type based on the user requirements;

[0038] The template file generation module is used to fill in the template on the contract template base based on the template filling elements corresponding to the template type and a text editor, and obtain the filled contract template file.

[0039] Furthermore, to achieve the above objectives, the present invention also proposes a template making device, the device comprising: a memory, a processor, and a template making program stored in the memory and executable on the processor, the template making program being configured to implement the steps of the template making method described above.

[0040] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing a template creation program, which, when executed by a processor, implements the steps of the template creation method described above.

[0041] This invention discloses a method for determining a contract template base based on the target text content sent by the target user and the corresponding original text format; obtaining the user's requirements and determining the template type based on those requirements, including table templates; filling the template base with template fill elements and a text editor based on the template type to obtain a completed contract template file. Compared to existing technologies where tables need to be pre-made in a table drawing application before uploading, this invention solves the technical problem that existing technologies, where tables are pre-made and uploaded, leading to increased user workload when table content is modified. This improves user efficiency. Attached Figure Description

[0042] Figure 1 This is a schematic diagram of the template creation device for the hardware operating environment involved in the embodiments of the present invention;

[0043] Figure 2 This is a flowchart illustrating the first embodiment of the template creation method of the present invention;

[0044] Figure 3 This is a schematic diagram of the contract template creation process in the first embodiment of the template creation method of the present invention;

[0045] Figure 4 This is a flowchart illustrating the second embodiment of the template creation method of the present invention;

[0046] Figure 5 This is a flowchart illustrating the third embodiment of the template creation method of the present invention;

[0047] Figure 6 This is a structural block diagram of the first embodiment of the template making device of the present invention.

[0048] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0049] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0050] Reference Figure 1 , Figure 1 This is a schematic diagram of the template creation device for the hardware operating environment involved in the embodiments of the present invention.

[0051] like Figure 1 As shown, the template creation device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk storage device. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0052] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the template making equipment and may include more or fewer parts than shown, or combine certain parts, or have different arrangements of parts.

[0053] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a template creation program.

[0054] exist Figure 1In the template making device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the template making device of the present invention can be set in the template making device. The template making device calls the template making program stored in the memory 1005 through the processor 1001 and executes the template making method provided in the embodiment of the present invention.

[0055] This invention provides a template creation method, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the template creation method of the present invention.

[0056] In this embodiment, the template creation method includes the following steps:

[0057] Step S10: Determine the contract template base based on the target text content sent by the target user and the original text format corresponding to the target text content.

[0058] It should be noted that the execution subject of the method in this embodiment can be a template making device for creating contract templates, or other template making system that includes such template making device and can achieve the same or similar functions. Here, the template making method provided in this embodiment and the following embodiments will be specifically described using a template making system (hereinafter referred to as the system).

[0059] It should be understood that the aforementioned target users can be users who can send information or files to the system.

[0060] It is understood that the target text content mentioned above can be the text content required in the contract template created in this embodiment.

[0061] It should be noted that the aforementioned original text format can be the original text font, font size, and orientation of the text content sent by the user, and this embodiment does not impose any restrictions on this. In practical applications, the target text content is obtained by the system after parsing the template file sent by the user. After parsing the template file, the system can obtain not only the text content but also the original text format of the text content sent by the user, such as font, font size, and orientation.

[0062] It should be understood that the aforementioned contract template base can be a template base without template content filling. In practical applications, the system can convert the target text content into a contract template base while retaining its original text format. Specifically, the system can convert Word format text content into HTML format (Hyper Text Markup Language) as the base for the text editor, and then display the Word format template uploaded by the target user by parsing the converted HTML format content.

[0063] In the specific implementation, refer to Figure 3 , Figure 3 This is a schematic diagram illustrating the contract template creation process in the first embodiment of the template creation method of the present invention. Figure 3 As shown, when creating a contract template, users can pre-fill in the basic information of the contract template and upload the template file to the system. After receiving the uploaded template file, the system can parse it to obtain text page information, such as margins, paper size, portrait and landscape orientations, font, and font size. At this point, the system can retain the original text format of the text content sent by the target user and convert it into HTML format to serve as the base for the contract template and display the template data.

[0064] Step S20: Obtain the user requirements of the target user and determine the template type based on the user requirements. The template type includes: table template.

[0065] It should be noted that the above user requirements refer to the contract templates that users need to create. In practical applications, the system can determine whether the contract template to be created contains tables based on the user's requirements, and thus determine the template type present in the contract template based on the presence or absence of tables.

[0066] It should be understood that the above-mentioned template type can be any template type existing in the contract template to be created. In this embodiment, the template type can include table templates and standard templates. A table template is a template that contains a table. A standard template can be a template that contains text, dates, and selection boxes, etc. This embodiment does not limit this.

[0067] In practice, the system can obtain the user requirements of the target user based on the template file sent by the target user, determine whether there are tables in the contract template to be made based on the user requirements, and then determine the template type of the contract template to be made based on whether there are tables.

[0068] Step S30: Based on the template filling elements corresponding to the template type and the text editor, fill in the template in the contract template base and obtain the completed contract template file.

[0069] It should be noted that the template fill elements mentioned above can be elements that are filled into the contract template base. In practical applications, template fill elements can be filled into the contract template base using a text editor to create the contract template.

[0070] It should be understood that the aforementioned text editor can be a tool for populating template content.

[0071] It is understandable that the above contract template file is the completed template file.

[0072] It should be understood that, since the creation and use of contract templates in this embodiment can be completed online, they do not rely on other office software. Simultaneously, the system can identify, track, and query key contract content, and can create templates with complex table, text, date, and option styles. Furthermore, in this embodiment, target users can use a text editor to perform visual operations such as adding, deleting, and filling in elements, thereby improving the efficiency of contract template creation.

[0073] In the implementation, after determining the template type, the target user can right-click on the area in the text editor where elements need to be filled and click the "Add" option to trigger a template filling request. Upon receiving the request, the system receives the template filling elements sent by the user and inserts them into the corresponding positions in the contract template base to fill the template, thus obtaining a completed contract template file. The template filling request sent by the target user can include the corresponding filling positions for each element, allowing the system to fill each element into its designated position in the contract template base to obtain the desired contract template file. Furthermore, the target user can also trigger a filling element modification request by right-clicking on an already inserted element in the text editor and selecting the "Modify / Delete" button. Upon receiving this modification request, the system can modify or delete the filling elements based on the modification position and content specified in the request.

[0074] This embodiment discloses a method for determining a contract template base based on the target text content sent by the target user and the corresponding original text format; obtaining the user's requirements and determining the template type based on those requirements, including table templates; filling the template base with template fill elements and a text editor based on the template type to obtain a completed contract template file; compared to the prior art where tables in contract template creation need to be pre-made in a table drawing application before uploading, this embodiment determines the template type based on user requirements (including table templates) and fills the template base with template fill elements and a text editor based on the template type to obtain a contract template file. This solves the technical problem in the prior art where tables in contract template creation are pre-made and uploaded, leading to increased user workload when table content is modified, thereby improving user work efficiency.

[0075] refer to Figure 4 , Figure 4 This is a flowchart illustrating the second embodiment of the template creation method of the present invention.

[0076] Based on the first embodiment described above, in order to create a contract template that includes a table template, in this embodiment, the template type further includes: a table template; step S20 includes:

[0077] Step S201: Obtain the user requirements of the target user, and determine whether there is a table in the template to be created based on the user requirements.

[0078] It should be noted that the above-mentioned template to be made is the contract template that needs to be made.

[0079] Step S202: If yes, then the template type is set to a table template.

[0080] Accordingly, step S30 includes:

[0081] Step S30': Based on the table filling elements corresponding to the table template, fill in the template on the contract template base using a text editor, and obtain the completed contract template file.

[0082] It should be understood that the above table fill elements can be fill elements from the table template.

[0083] Further, step S30' may specifically include: obtaining the table name, table description, and table structure corresponding to the table template; creating a table based on the table name, table description, and table structure to obtain the table fill elements corresponding to the table template; and filling the contract template base with a text editor based on the table fill elements to obtain the completed contract template file.

[0084] It is understandable that the above table structure can be a table header, table body, and table footer.

[0085] It should be noted that, since this embodiment can support the filling of complex table elements in the template to be created, it can meet the needs of complex contracts such as sales contracts for corporate clients; at the same time, the table filling elements in this embodiment can be combined with the electronic contract system, thereby realizing the recognition and saving of user input, which plays a fundamental role in further connecting electronic contracts with various interface systems and recognizing key content.

[0086] It should be understood that, since the table style is pre-set when creating the table template in the contract template in this embodiment, the text style in the generated contract template file is fixed and more formal and beautiful, thereby improving the user experience.

[0087] Understandably, in order to accurately and conveniently identify table headers, bodies, and footers, the system can insert the `` (HTML language tag) for the table header into a `<head>` tag, the `` for the table body into a `<body>` tag, and the `` for the table footer into a `<footer>` tag.<tbodydata-type=“footer”> In addition, if the above table structure is used in the text editor, it will cause adaptation problems for the editor's own functions. Therefore, this embodiment can use the text editor's own format. When the user submits the table to the system, the table structure generated by the text editor can be converted into the tbody recognition scheme in real time. Here, tbody can be the HTML language tag table body, which is used to combine the main content of the HTML table. Specifically, when the text editor generates the table, the last row of tags can be used as the table body (the table body can only be one row), and then the attribute data-type="body" is assigned. All tags above the table body are assigned the attribute data-type="header", and similarly, new tags when adding the table footer are assigned the attribute data-type="footer". When the table content is submitted to the system, the system can use these attribute identifiers to convert the text editor's own format into the tbody recognition scheme and pass it to the backend. When the table elements need to be edited, the obtained tbody recognition scheme data can be converted back to the editor's own format and displayed in the editor.

[0088] It should be understood that, in order to display the header, body, and footer labels in the table in real time, this embodiment can create a box with a fixed height on the left side outside the text editor (used to display the header, body, and footer labels, referred to as the label area). When the entire component loads, a scroll listener event can be enabled for the editing area inside the editor. When the listener event is triggered, the scroll top distance can be synchronized to the left label area. In this way, when scrolling within the editor, the label area can also scroll synchronously. The height of each small label in the label area changes dynamically in real time. For example, for the header label, if the height of the header portion in the editor is 100px after being edited by the user, then the corresponding label height must also be synchronized to 100px, so that the label and the corresponding part of the table are displayed aligned. In addition, the system can also monitor modifications to the table content. When a modification event is triggered, the logic for different scenarios is as follows: if the edited content is cleared, the heights of all the labels are also cleared, and none of the labels will be displayed; if the editor content only contains the table header and body, their heights are passed to the corresponding labels, and the label area will only display the corresponding labels; if the editor contains the table header, body, and footer, their heights are passed, and all the labels will be displayed in the label area.

[0089] In the specific implementation, when creating a table template containing tables, the first step is to add corresponding table fill elements to the contract template base based on the table name and description provided by the target user. Upon receiving a table drawing request from the target user, a table drawing window can be displayed, and the table drawn by the target user in a text editor based on this window can be received. The table drawing uses an n*m method, and only the table header and body are drawn, requiring more than two rows. If the number of rows exceeds two, only the last row is considered the table body, and the rest are treated as the table header. After the table is drawn, fill elements sent by the target user via drag-and-drop or double-click can be received and filled into the corresponding positions in the table. In this embodiment, a table footer can also be added and drawn, supporting multiple rows and columns, merging and splitting, and pre-created fill elements. After the table is created, pre-made table fill elements can be inserted into appropriate positions in the table template for template filling, thus obtaining the contract template file based on the filled table template.

[0090] Furthermore, in order to create a contract template containing a standard template, after step S201, the method further includes: if not, determining the template type as the standard template; correspondingly, step S30 may specifically include: determining the fill element type, fill element name, and fill element description based on the standard fill element corresponding to the standard template; based on the fill element type, the fill element name, and the fill element description, filling the template in the contract template base using a text editor, and obtaining the completed contract template file.

[0091] It should be noted that the above standard fill elements can be text, dates, and selection boxes, etc.

[0092] It should be understood that the above-mentioned fill element types refer to the types corresponding to each fill element. Specifically, text fill elements correspond to the text type, date fill elements correspond to the date type, and checkbox fill elements correspond to the checkbox type.

[0093] In specific implementations, such as Figure 3 As shown, after displaying the template data, the system can determine whether a table exists in the template based on user needs. If so, it creates and uses table fill elements; otherwise, it creates standard fill elements and performs target fill. Finally, after the template is filled, a preview page can be displayed to the user for previewing and submission. Additionally, if standard fill elements such as text, dates, and checkboxes need to be added to the template, the target user can right-click in the text editor to trigger a fill element insertion request. Upon receiving the request, the system can add the corresponding fill element at the user's click location, thus filling the template within the contract template base. Furthermore, after the template fill elements are filled, the generated PDF document can be displayed according to the entered fill element names.

[0094] This embodiment determines whether a table exists in the template to be created based on the user's needs. If so, the template type is determined to be a table template. Then, based on the table fill elements corresponding to the table template, a text editor is used to fill in the template on the contract template base to obtain a completed contract template file. This supports the filling of complex table fill elements in the template to be created and can meet the needs of complex contracts. Simultaneously, when the template type is a standard template, the template can be filled in the contract template base using a text editor based on the fill element type, fill element name, and fill element description corresponding to the standard template to obtain a completed contract template file. This allows for the filling of standard fill elements such as text, dates, and checkboxes to complete the creation of the contract template.

[0095] refer to Figure 5 , Figure 5This is a flowchart illustrating the third embodiment of the template creation method of the present invention.

[0096] Based on the above embodiments, in order to perform template filling when the user uses the double-click method, in this embodiment, step S30 further includes:

[0097] Step S301: When a double-click event is detected, obtain the fill element information of the template fill element corresponding to the template type, and obtain the fill element identifier based on the fill element information.

[0098] It should be noted that the above double-click event can be the event triggered when the user double-clicks the button.

[0099] It should be understood that the aforementioned fill element information can be the specific information of the fill element that the user double-clicks. Correspondingly, the aforementioned fill element identifier can be the identifier corresponding to the fill element that the user double-clicks. In this embodiment, the fill element identifier can be in string form, such as: ${name}, and this embodiment does not impose any restrictions on it.

[0100] Step S302: Convert the fill element identifier into the corresponding document object model function through the double-click event function.

[0101] It is understandable that the double-click event function described above can be a function that allows the user to convert the tag into an HTML element.

[0102] It should be understood that the aforementioned Document Object Model (DOM) element refers to the DOM, which can be used to view the page data it contains.

[0103] Furthermore, in order to fill the template when the user uses drag and drop, before step S302, the method further includes: when a drag event is detected, caching the drag element information, wherein the drag element information is the information dragged by the user in the template filling elements; and when a drag release event is detected, sending the cached drag element information to the double-click event function.

[0104] It should be noted that the drag events mentioned above can be events triggered when the user drags and fills elements.

[0105] It should be understood that the above-mentioned draggable element information can be the information of the fill element that is dragged by the user.

[0106] It is understandable that the aforementioned drag-and-release time can be an event triggered when the user stops dragging and filling elements.

[0107] In the specific implementation, since the text editor does not support drag-and-drop insertion of template fill elements, the system needs to listen to the user's drag events. When the user drags information and triggers a drag event, the system can listen to the drag event, cache the dragged element information, and monitor the drag release event. When the user stops dragging information and triggers a drag release event, the system can listen to the drag release event, pass the previously cached drag information to the double-click event function, and insert the fill elements through the same processing logic as the double-click event. This allows the user to fill the template by triggering drag events.

[0108] Step S303: Insert the document object model at the target cursor position using a text editor to fill the template filling elements into the contract template base.

[0109] It is understandable that the target cursor position mentioned above can be the current position of the cursor after the user double-clicks the button.

[0110] In the implementation, when a user double-clicks to populate a feature, triggering an event, the system can detect the double-click. At this point, the system can obtain the specific information of the feature corresponding to the double-click location, extract the feature's identifier, and convert the string identifier into the corresponding DOM element using the front-end encapsulated double-click event function. Then, the obtained DOM element is inserted into the target cursor position using the text editor's content insertion API (Application Programming Interface). This allows the text editor to render the updated content, thus achieving the insertion of the populated feature.

[0111] Furthermore, to prevent users from deleting or modifying template fill elements during the contract template creation process, before step S303, the method further includes: adding a preset locking attribute to the target label of the document object model to obtain the target document object model; correspondingly, step S303 may specifically include: inserting the target document object model into the target cursor position through a text editor to fill the template fill elements into the contract template base.

[0112] It should be noted that the aforementioned preset locking attributes can be used to lock the template fill elements. In practical applications, when creating contract templates, users may accidentally delete or modify fill element information, resulting in missing fill elements after the template is generated. This embodiment can avoid this situation by locking the template fill elements.

[0113] It should be understood that the target tag mentioned above can be the outermost tag of a DOM element. <label>Tags, or other related <label>In this embodiment, labels with the same or similar functions are selected. <label>The tag is used because the text editor does not use it internally, thus avoiding conflicts.

[0114] It is understandable that the aforementioned target document object model can be a DOM element with a preset locking attribute added.

[0115] It should be noted that, to more intuitively view the fill element information in the template, the fill element information can be highlighted during the template creation process. In practical applications, different fill element types generate different DOM styles, resulting in formatted style variations when displayed in a text editor. To highlight fill elements, table elements require special style processing, as they need to display table content; in this case, the outer layer is not... <label>Tags, and use Wrap the label tag around the table content; this ensures both proper content display and correct display width.

[0116] In the specific implementation, after the template fill element is inserted into the text editor, the system can use a wrapped function to convert the fill element identifier into a DOM element, and then assign it to the outermost layer of the DOM element. <label>Adding the default locked attribute `contenteditable="false"` to the label will cause the text editor to treat this element label as a whole, and its style cannot be edited at this time. If you need to edit the style of this filled element, you need to set the text editor configuration item `format_noneditable_selector: 'label'` to notify the text editor that the style of this label can be edited.

[0117] This embodiment achieves template filling via user-triggered double-click events by obtaining the fill element identifier based on the fill element information of the template fill element corresponding to the template type when a double-click event is detected. The double-click event function then converts the fill element identifier into the corresponding document object model (DOM), and a text editor inserts the DOM into the target cursor position for template filling. Simultaneously, when a drag event is detected, the information dragged by the user in the template fill element is cached. Upon detecting a drag-release event, the cached dragged element information is sent to the double-click event function, enabling template filling via user-triggered drag events. Furthermore, by adding a preset locking attribute to the target label of the DOM, the target DOM is obtained. This target DOM is then inserted into the target cursor position using a text editor for template filling, preventing users from deleting or modifying template fill elements during contract template creation.

[0118] Furthermore, this embodiment of the invention also proposes a storage medium storing a template creation program, which, when executed by a processor, implements the steps of the template creation method described above.

[0119] Reference Figure 6 , Figure 6 This is a structural block diagram of the first embodiment of the template making device of the present invention.

[0120] like Figure 6 As shown, the template making device proposed in this embodiment of the invention includes:

[0121] The template base determination module 601 is used to determine the contract template base based on the target text content sent by the target user and the original text format corresponding to the target text content.

[0122] Template type determination module 602 is used to obtain the user requirements of the target user and determine the template type based on the user requirements;

[0123] The template file generation module 603 is used to fill in the template on the contract template base based on the template filling elements corresponding to the template type and the text editor, and obtain the filled contract template file.

[0124] This embodiment of the template creation device discloses a method for determining a contract template base based on the target text content sent by the target user and the corresponding original text format; obtaining the user's requirements and determining the template type according to the user requirements, including table templates; filling the template base with template fill elements and a text editor based on the template type, and obtaining a completed contract template file. Compared to the prior art where tables in contract template creation need to be pre-made in a table drawing application before uploading, this embodiment determines the template type based on user requirements, including table templates, and fills the template base with template fill elements and a text editor based on the template type to obtain a contract template file. This solves the technical problem in the prior art where tables in contract template creation are pre-made and uploaded, which increases the user's workload when the table content is modified, thereby improving user work efficiency.

[0125] Based on the first embodiment of the template making device of the present invention described above, a second embodiment of the template making device of the present invention is proposed.

[0126] In this embodiment, the template type determination module 602 is further configured to obtain the user requirements of the target user and determine whether there is a table in the template to be made based on the user requirements; if so, the template type is determined to be a table template.

[0127] The template file generation module 603 is also used to fill in the contract template base with a text editor based on the table filling elements corresponding to the table template, and obtain the filled contract template file.

[0128] Furthermore, the template file generation module 603 is also used to obtain the table name, table description and table structure corresponding to the table template; to create a table based on the table name, table description and table structure to obtain the table fill elements corresponding to the table template; and to fill the template on the contract template base using a text editor based on the table fill elements to obtain the completed contract template file.

[0129] Furthermore, the template type also includes: a standard template; the template type determination module 602 is further configured to determine the template type as the standard template if no;

[0130] The template file generation module 603 is further configured to determine the fill element type, fill element name, and fill element description based on the standard fill element corresponding to the standard template; and to fill the template in the contract template base using a text editor based on the fill element type, the fill element name, and the fill element description, and to obtain the completed contract template file.

[0131] This embodiment determines whether a table exists in the template to be created based on the user's needs. If so, the template type is determined to be a table template. Then, based on the table fill elements corresponding to the table template, a text editor is used to fill in the template on the contract template base to obtain a completed contract template file. This supports the filling of complex table fill elements in the template to be created and can meet the needs of complex contracts. Simultaneously, when the template type is a standard template, the template can be filled in the contract template base using a text editor based on the fill element type, fill element name, and fill element description corresponding to the standard template to obtain a completed contract template file. This allows for the filling of standard fill elements such as text, dates, and checkboxes to complete the creation of the contract template.

[0132] Based on the above embodiments of the apparatus, a third embodiment of the template making apparatus of the present invention is proposed.

[0133] In this embodiment, the template file generation module 603 is further configured to, upon detecting a double-click event, obtain the fill element information of the template fill element corresponding to the template type, and obtain the fill element identifier based on the fill element information; convert the fill element identifier into the corresponding document object model through the double-click event function; and insert the document object model into the target cursor position through a text editor to fill the template fill element into the contract template base.

[0134] Furthermore, the template file generation module 603 is also used to cache the dragged element information when a drag event is detected, wherein the dragged element information is the information dragged by the user in the template fill elements; and to send the cached dragged element information to the double-click event function when a drag release event is detected.

[0135] Furthermore, the template file generation module 603 is also used to add preset locking attributes to the target tags of the document object model to obtain the target document object model; and to insert the target document object model into the target cursor position through a text editor to fill the template filling elements into the contract template base.

[0136] This embodiment achieves template filling via user-triggered double-click events by obtaining the fill element identifier based on the fill element information of the template fill element corresponding to the template type when a double-click event is detected. The double-click event function then converts the fill element identifier into the corresponding document object model (DOM), and a text editor inserts the DOM into the target cursor position for template filling. Simultaneously, when a drag event is detected, the information dragged by the user in the template fill element is cached. Upon detecting a drag-release event, the cached dragged element information is sent to the double-click event function, enabling template filling via user-triggered drag events. Furthermore, by adding a preset locking attribute to the target label of the DOM, the target DOM is obtained. This target DOM is then inserted into the target cursor position using a text editor for template filling, preventing users from deleting or modifying template fill elements during contract template creation.

[0137] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0138] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0139] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0140] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.< / label> < / label> < / label> < / label> < / label>

Claims

1. A method for creating a template, characterized in that, The template creation method includes: The contract template base is determined based on the target text content sent by the target user and the original text format corresponding to the target text content; Obtain the user needs of the target user, and determine the template type based on the user needs. The template type includes: table template. Based on the template filling elements corresponding to the template type and the text editor, the template is filled in the contract template base, and the filled contract template file is obtained; The step of obtaining the user requirements of the target user and determining the template type based on the user requirements includes: Obtain the user requirements of the target user, and determine whether there are tables in the template to be created based on the user requirements; If so, then set the template type to table template; The step of filling the template in the contract template base using the template filling elements and text editor corresponding to the template type and obtaining the filled contract template file includes: Obtain the table name, table description, and table structure corresponding to the table template. The table structure includes a table header, table body, and table footer. The table body is assigned a body attribute identifier, the table header is assigned a header attribute identifier, and the table footer is assigned a footer attribute identifier. The text editor's own format is converted into a tbody recognition scheme by using the body attribute identifier, the header attribute identifier, and the footer attribute identifier to identify the table header, table body, and table footer. The table is created based on the table name, the table description, and the table structure to obtain the table filling elements corresponding to the table template. Based on the table fill elements, the contract template is filled in using a text editor to obtain the completed contract template file.

2. The template creation method as described in claim 1, characterized in that, The template type also includes: standard template; after the step of obtaining the user requirements of the target user and determining whether there is a table in the template to be created based on the user requirements, it further includes: If not, then the template type will be determined as the standard template. The step of filling the template in the contract template base using the template filling elements and text editor corresponding to the template type and obtaining the filled contract template file includes: The fill element type, fill element name, and fill element description are determined based on the standard fill element corresponding to the standard template. Based on the fill element type, the fill element name, and the fill element description, the template is filled in using a text editor on the contract template base, and a completed contract template file is obtained.

3. The template creation method as described in claim 1, characterized in that, The step of filling the template in the contract template base using the template filling elements and text editor corresponding to the template type includes: When a double-click event is detected, the fill element information of the template fill element corresponding to the template type is obtained, and the fill element identifier is obtained based on the fill element information; The double-click event function converts the fill element identifier into the corresponding document object model. Insert the document object model at the target cursor position using a text editor to fill the template filling elements into the contract template base.

4. The template creation method as described in claim 3, characterized in that, Before the step of converting the fill feature identifier into the corresponding document object model via the double-click event function, the method further includes: When a drag event is detected, the dragged element information is cached. The dragged element information is the information dragged by the user from the template fill elements. When a drag-and-release event is detected, the cached dragged element information is sent to the double-click event function.

5. The template creation method as described in claim 3, characterized in that, Before the step of inserting the document object model at the target cursor position using a text editor to fill the template filling elements onto the contract template base, the method further includes: Add the preset locking attribute to the target tag of the document object model to obtain the target document object model; The step of inserting the document object model at the target cursor position using a text editor to fill the template filling elements onto the contract template base includes: Insert the target document object model into the target cursor position using a text editor to fill the template filling elements into the contract template base.

6. A template making device, characterized in that, The device includes: The template base determination module is used to determine the contract template base based on the target text content sent by the target user and the original text format corresponding to the target text content. The template type determination module is used to obtain the user requirements of the target user and determine the template type based on the user requirements; The template file generation module is used to fill in the template on the contract template base based on the template filling elements corresponding to the template type and a text editor, and obtain the filled contract template file. The template type determination module is also used to obtain the user requirements of the target user and determine whether there is a table in the template to be made based on the user requirements; if so, the template type is determined to be a table template. The template file generation module is further configured to obtain the table name, table description, and table structure corresponding to the table template. The table structure includes a header, table body, and table footer. The table body is assigned a body attribute identifier, the table header is assigned a header attribute identifier, and the table footer is assigned a footer attribute identifier. The header, table body, and table footer are identified by converting the text editor's own format into a tbody recognition scheme using the body attribute identifier, the header attribute identifier, and the footer attribute identifier. Based on the table name, table description, and table structure, a table is created to obtain the table filling elements corresponding to the table template. Based on the table filling elements, the template is filled using a text editor on the contract template base, and a filled contract template file is obtained.

7. A template making device, characterized in that, The device includes: a memory, a processor, and a template creation program stored in the memory and executable on the processor, the template creation program being configured to implement the steps of the template creation method as described in any one of claims 1 to 5.

8. A storage medium, characterized in that, The storage medium stores a template creation program, which, when executed by a processor, implements the steps of the template creation method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Contract template generation method and device, computer readable storage medium and electronic equipment

    CN115345142A