Work visa sheet generation method and device, storage medium and program product
Through the automated work visa form generation method and the use of Canvas objects, the problems of low generation efficiency and low accuracy in the existing technology are solved, efficient and accurate work visa form generation is achieved, and the completeness and user experience of work records are improved.
Patent Information
- Application Number
- CN202510185128.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-06-17
AI Technical Summary
In the prior art, the generation efficiency and accuracy of work visa forms are low, resulting in inaccurate data or missing key information, affecting the completeness and accuracy of work records.
By receiving the user's interaction on the visa form generation interface, the system automatically triggers the generation of the work visa form, uses the Canvas object to represent the page content, converts the page content into PDF format based on the HTML2Canvas and jsPDF plug-in, and generates the work visa form corresponding to the content to be visa.
Reduces the complexity of human operations, improves work efficiency, ensures that the generated work visa form is consistent with the user's input, and improves accuracy and data integrity.
Smart Images

Figure CN120161981A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power technologies, and in particular, to a method, device, storage medium, and program product for generating a work visa form. Background Art
[0002] In the daily work of each power supply enterprise, the work visa form is an important basis for recording work tasks, progress, and results. To ensure operation safety, compliance, and efficient management, accurately filling out the work visa form is an essential and important step.
[0003] In the related art, the work visa form is filled out manually for work records. However, there are problems such as low efficiency and low accuracy. Summary of the Invention
[0004] This application provides a method, device, storage medium, and program product for generating a work visa form to solve problems such as low efficiency and low accuracy in generating the work visa form.
[0005] In a first aspect, this application provides a method for generating a work visa form, which is applied to an electronic device. The generating method includes:
[0006] Receiving a first interaction operation on a visa form generation control on a visa form generation interface, where the first interaction operation is used to trigger the generation of a work visa form;
[0007] Responding to the first interaction operation, converting the page content of the visa form generation interface into a Canvas object, where the page content includes content to be visaed;
[0008] Generating a work visa form corresponding to the content to be visaed according to the Canvas object.
[0009] In a possible implementation manner, converting the page content of the visa form generation interface into a Canvas object includes:
[0010] Based on the HTML2Canvas plugin, converting the page content of the visa form generation interface into a Canvas object.
[0011] In a possible implementation manner, generating a work visa form corresponding to the content to be visaed according to the Canvas object includes:
[0012] Based on the jsPDF plugin, converting the Canvas object into a PDF format to obtain a work visa form corresponding to the content to be visaed.
[0013] In a possible implementation manner, the content to be visaed is filled into the visa form generation interface in the following way:
[0014] In response to receiving a confirmation operation on the work visa form template selection control on the visa form generation interface, display alternative work visa form templates;
[0015] In response to receiving a selection operation on the target work visa form template among the alternative work visa form templates, display the target work visa form template;
[0016] Receive an operation to fill in the content to be visaed on the target work visa form template, and the operation to fill in the content to be visaed is used to fill in the content to be visaed;
[0017] In response to detecting a completion of filling instruction, display the visa form generation interface, and in the visa form generation interface, display the target work visa form template filled with the content to be visaed.
[0018] In a possible implementation manner, the content to be visaed further includes an electronic signature, and the electronic signature is filled into the visa form generation interface through the following method:
[0019] In response to receiving a second interaction operation on the signature control on the visa form generation interface, call the screen handwriting function of the electronic device;
[0020] Based on the canvas.getContext() method, obtain the electronic signature in the signature area on the screen of the electronic device;
[0021] In response to detecting a completion of signature instruction, display the visa form generation interface, and in the visa form generation interface, display the electronic signature.
[0022] In a possible implementation manner, the content to be visaed further includes on-site environment image information, and the on-site environment image information is filled into the visa form generation interface through the following method:
[0023] In response to receiving a third interaction operation on the camera control on the visa form generation interface, call the camera of the electronic device to obtain on-site environment image information;
[0024] In response to detecting a completion of photographing instruction, display the visa form generation interface, and in the visa form generation interface, display the on-site environment image information.
[0025] In a possible implementation manner, the method for generating a work visa form further includes:
[0026] Receive an operation to change the content to be visaed on the visa form generation interface;
[0027] In response to detecting a completion of change instruction, display the visa form generation interface, and in the visa form generation interface, display the updated content to be visaed.
[0028] In a second aspect, the present application provides a device for generating a work visa form, which is applied to an electronic device. The generating device includes:
[0029] A receiving module, configured to receive a first interaction operation on a visa form generation control on a visa form generation interface, where the first interaction operation is used to trigger the generation of a work visa form;
[0030] A conversion module, configured to respond to the first interaction operation and convert the page content of the visa form generation interface into a Canvas object, where the page content includes content to be visaed;
[0031] A generating module, configured to generate a work visa form corresponding to the content to be visaed according to the Canvas object.
[0032] In a possible implementation manner, the conversion module is specifically configured to: based on the HTML2Canvas plugin, convert the page content of the visa form generation interface into a Canvas object.
[0033] In a possible implementation manner, the conversion module is further configured to: based on the jsPDF plugin, convert the Canvas object into a PDF format to obtain a work visa form corresponding to the content to be visaed.
[0034] In a possible implementation manner, the content to be visaed is filled into the visa form generation interface in the following way: in response to receiving a confirmation operation on a work visa form template selection control on the visa form generation interface, display alternative work visa form templates; in response to receiving a selection operation on a target work visa form template among the alternative work visa form templates, display the target work visa form template; receive a filling operation of the content to be visaed on the target work visa form template, where the filling operation of the content to be visaed is used to fill in the content to be visaed; in response to detecting a completion filling instruction, display the visa form generation interface, and in the visa form generation interface, display the target work visa form template filled with the content to be visaed.
[0035] In a possible implementation manner, the content to be visaed further includes an electronic signature, and the electronic signature is filled into the visa form generation interface in the following way: in response to receiving a second interaction operation on a signature control on the visa form generation interface, call the screen handwriting function of the electronic device; based on the canvas.getContext() method, obtain the electronic signature in the signature area on the screen of the electronic device; in response to detecting a completion signature instruction, display the visa form generation interface, and in the visa form generation interface, display the electronic signature.
[0036] In a possible implementation, the content to be visaed further includes on-site environment image information, and the on-site environment image information is filled into the visa form generation interface in the following manner: in response to receiving a third interaction operation on the camera control on the visa form generation interface, the camera of the electronic device is called to obtain the on-site environment image information; in response to detecting the completion of the photographing instruction, the visa form generation interface is displayed, and the on-site environment image information is displayed in the visa form generation interface.
[0037] In a possible implementation, the generating device further includes a processing module, and the processing module is configured to: receive a change operation on the content to be visaed on the visa form generation interface; in response to detecting the completion of the change instruction, display the visa form generation interface, and display the updated content to be visaed in the visa form generation interface.
[0038] In a third aspect, the present application provides an electronic device, including: a memory, a processor;
[0039] The memory stores computer-executable instructions;
[0040] The processor executes the computer-executable instructions stored in the memory to implement the method of the first aspect.
[0041] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed, they are used to implement the method of the first aspect.
[0042] In a fifth aspect, the present application provides a computer program product, including: a computer program, and when the computer program is executed, it implements the method of the first aspect.
[0043] The method, device, storage medium and program product for generating a work visa form provided by the present application are applied to an electronic device. The generating method includes: receiving a first interaction operation on a visa form generation control on the visa form generation interface, and the first interaction operation is used to trigger the generation of a work visa form; in response to the first interaction operation, converting the page content of the visa form generation interface into a Canvas object, and the page content includes the content to be visaed; generating a work visa form corresponding to the content to be visaed according to the Canvas object. By receiving the interaction operation of the user on the visa form generation interface, the system can automatically trigger the generation process of the work visa form. This automated method reduces the complexity of manual operations, improves work efficiency, and provides a convenient operation experience for users. Using the Canvas object to represent the page content improves the efficiency of processing and converting the content to be visaed, and further quickly generates a work visa form. In addition, by converting the page content into a Canvas object, the information input by the user on the visa form generation interface can be captured and presented more accurately, ensuring that the generated work visa form is consistent with the user's input and improving the accuracy. Description of the Drawings
[0044] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0045] Figure 1 It is a schematic flowchart of a method for generating a work visa form provided by an embodiment of the present application;
[0046] Figure 2 It is a schematic diagram of the front-end interface provided by an embodiment of the present application Figure 1 ;
[0047] Figure 3 It is a schematic diagram of the front-end interface provided by an embodiment of the present application Figure 2 ;
[0048] Figure 4 It is a schematic diagram of the front-end interface provided by an embodiment of the present application Figure 3 ;
[0049] Figure 5 It is a schematic diagram of the front-end interface provided by an embodiment of the present application Figure 4 ;
[0050] Figure 6 It is a schematic flowchart of a method for generating a work visa form provided by a specific embodiment of the present application;
[0051] Figure 7 It is a schematic structural diagram of a device for generating a work visa form provided by an embodiment of the present application;
[0052] Figure 8 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
[0053] Through the above-mentioned accompanying drawings, specific embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These accompanying drawings and textual descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Specific Embodiments
[0054] Here, exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0055] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards, and corresponding operation entrances are provided for users to choose to authorize or reject.
[0056] In the related art, a manual filling method is used to record work content to obtain a work visa form. Manual filling has the risk of human error, which may lead to inaccurate data or omission of key information, affecting the integrity and accuracy of work records. In addition, generating a work visa form by manual filling is time-consuming and laborious. Staff need to spend a lot of time on filling and sorting work records, resulting in low efficiency.
[0057] To solve the above technical problems, this application provides a method for generating a work visa form. Through human-computer interaction, the generation process of the work visa form is triggered in an automated manner, reducing the complexity of manual operations, improving work efficiency, and providing users with a convenient operation experience. In addition, by converting the page content into a Canvas object and generating a work visa form based on the Canvas object, the accuracy and generation efficiency of the work visa form are further improved.
[0058] The following uses specific embodiments to elaborate in detail on the technical solutions of this application and how the technical solutions of this application solve the above technical problems. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this application will be described below in conjunction with the accompanying drawings.
[0059] Figure 1 It is a schematic flowchart of the method for generating a work visa form provided by the embodiments of this application.
[0060] It should be noted that the method for generating a work visa form provided by the embodiments of this application is applied to an electronic device, and the execution subject of this method is the electronic device, such as mobile terminals such as mobile phones, tablets, handheld computers, and wearable watches.
[0061] As Figure 1 shown, the method for generating a work visa form includes:
[0062] S101. Receive a first interaction operation on a visa form generation control on a visa form generation interface, where the first interaction operation is used to trigger the generation of a work visa form.
[0063] For example, taking an electronic device as a mobile phone, an auxiliary tool for generating a work visa form is installed on the mobile phone. Through the interaction between the user and the front-end page of the auxiliary tool, the method for generating a work visa form is implemented to generate a work visa form. The user enters the usage interface of the auxiliary tool and clicks the visa form generation control on the visa form generation interface. For example, the control can be in the form of a button. By clicking the button, a work visa form for the current visa form generation interface is triggered to be generated.
[0064] S102. In response to the first interaction operation, convert the page content of the visa form generation interface into a Canvas object, where the page content includes the content to be visaed.
[0065] Among them, the Canvas object represents an HTML canvas element. The page content includes HTML elements of different types (text, table, picture, etc.) and different contents. Converting the HTML elements into a Canvas object can be regarded as rendering the HTML elements onto the Canvas. Correspondingly, through a third-party JavaScript library, such as HTML2Canvas, the HTML elements can be rendered as a Canvas, which is simple and easy to use and supports complex HTML content; or, parse the HTML content and call the API of the Canvas through JavaScript to write code line by line to achieve rendering, which does not depend on a third-party library and is suitable for simple content; or, without depending on a third-party library, manually apply the style to the Canvas by parsing the HTML and CSS of the visa form generation interface; and so on.
[0066] For the content to be visaed on the visa form generation interface, the work visa forms corresponding to different construction operation scenarios may be different.
[0067] In order to improve the accuracy and efficiency of filling out the work visa form, in one example, the user can select the corresponding work visa form template according to the actual scenario, and fill in the content to be visaed based on the work visa form template. Further, the content to be visaed is filled into the visa form generation interface in the following manner: in response to receiving the determination operation on the work visa form template selection control on the visa form generation interface, display the alternative work visa form templates; in response to receiving the selection operation on the target work visa form template among the alternative work visa form templates, display the target work visa form template; receive the operation of filling in the content to be visaed on the target work visa form template, and the operation of filling in the content to be visaed is used to fill in the content to be visaed; in response to detecting the completion of the filling instruction, display the visa form generation interface, and in the visa form generation interface, display the target work visa form template filled with the content to be visaed.
[0068] Exemplarily, a variety of work visa form templates are built into the work visa form generation auxiliary tool installation package. After installing the auxiliary tool on an electronic device and entering the visa form generation interface in the auxiliary tool, when the user clicks on the work visa form template selection control, all the built-in alternative work visa form templates are displayed, as shown in Figure 2 a schematic diagram of the front-end interface provided by an embodiment of the present application Figure 1 As shown, it may include work visa form templates under multiple different construction operation scenarios. After the user selects a suitable target work visa form template (for example, selects the on-site project quantity visa form for live working on distribution networks), click to enter the target work visa form template, as shown in Figure 3 a schematic diagram of the front-end interface provided by an embodiment of the present application Figure 2 As shown, the target work visa form template contains form items such as line / substation name, implementation content, unit, work ticket number, etc. According to the actual work content, fill in the information related to the form items (i.e., the content to be visaed) in the target work visa form template. After filling in, for example, when clicking the complete button or the submit button, a complete filling instruction will be generated. When the electronic device detects this complete filling instruction, it will exit the current filling interface, display the visa form generation interface, and display the target work visa form template filled with the content to be visaed again on the visa form generation interface.
[0069] By digitizing the content of physical paper documents and replacing the traditional way of manually filling out paper work visa forms, it has higher flexibility and convenience. Filling in the content to be visaed based on the work visa form template reduces the risk of human errors and improves the integrity, accuracy, and efficiency of work records.
[0070] S103. Generate a work visa form corresponding to the content to be visaed according to the Canvas object.
[0071] Exemplarily, through a built-in algorithm, export the Canvas object as a picture and directly save the picture as a work visa form file. The obtained work visa form can be a picture (such as PNG or JPEG) or a PDF file.
[0072] It should be noted that a suitable method can be selected according to actual needs to implement the generation of the work visa form, and the embodiments of the present application do not limit this.
[0073] Optionally, for the convenience of subsequent search and management, the generated work visa form can be saved to the local storage of the electronic device, and the work visa form and / or the folder storing the work visa form are named in the format of the generation time of the work visa form or the name of the work visa form template + the generation time, as shown in Figure 4 a schematic diagram of the front-end interface provided by an embodiment of the present application Figure 3As shown, the folder is named "2024-05-10", and the work visa form is named "On-site Project Quantity Visa Form for Live Distribution Network Operation - 2024-05-10 10:17:4"
[0074] In the embodiment of the present application, by receiving the interactive operation of the user on the visa form generation interface, the system can automatically trigger the generation process of the work visa form. This automated method reduces the complexity of manual operations, improves work efficiency, and provides a convenient operation experience for users. Using the Canvas object to represent the page content improves the efficiency of processing and converting the content to be visaed, and further quickly generates the work visa form. In addition, by converting the page content into a Canvas object, all the information input by the user on the visa form generation interface can be captured and presented more accurately, ensuring that the generated work visa form is consistent with the user's input and improving accuracy.
[0075] In some embodiments, converting the page content of the visa form generation interface into a Canvas object includes: converting the page content of the visa form generation interface into a Canvas object based on the HTML2Canvas plugin.
[0076] Among them, the HTML2Canvas plugin is a JavaScript plugin that can convert HTML elements on a web page into a Canvas object, so that the web page screenshot can be output as a picture, that is, rendering the HTML content as a Canvas using HTML2Canvas.
[0077] Exemplarily, by traversing the DOM tree (the area on the visa form generation interface where the work visa form needs to be generated), each HTML element is converted into a Canvas object and added together to form a complete picture.
[0078] In the embodiment of the present application, the HTML2Canvas plugin can accurately render HTML content (including CSS styles, layouts, pictures, etc.) into the Canvas, supports complex HTML content, realizes high-performance rendering, and is suitable for the work visa form generation scenario with rich content. In addition, the Canvas object generated based on the HTML2Canvas plugin can be seamlessly integrated with other tools (such as jsPDF), and has strong scalability.
[0079] In some embodiments, generating a work visa form corresponding to the content to be visaed according to the Canvas object includes: converting the Canvas object into a PDF format based on the jsPDF plugin to obtain the work visa form corresponding to the content to be visaed.
[0080] Among them, the jsPDF plugin is a powerful tool suitable for generating PDF files on the client side. It supports content such as text, images, and tables, and can be used in combination with Canvas to convert the Canvas object into an image and add it to the PDF to obtain the work visa form corresponding to the content to be visaed. For example, use canvas.toDataURL('image / png') to convert the Canvas object into a Base64-encoded image, use jsPDF to create a PDF document, add the Canvas image to the PDF, and set the position and size of the image, and use doc.save() to save the PDF file.
[0081] In the embodiment of this application, a high-quality PDF-format work visa form is generated through the jsPDF plugin, ensuring that the content is displayed completely and clearly; it has good cross-platform compatibility, ensuring the consistency of the work visa form on different platforms (Windows, macOS, mobile terminals, etc.); in addition, it supports multi-page PDFs, which is suitable for generating work visa forms with longer content, thereby improving the generation efficiency of the work visa form and enhancing the user experience.
[0082] Optionally, based on the HTML2Canvas plugin and the jsPDF plugin, the page content of the visa form generation interface is used to generate the work visa form corresponding to the content to be visaed on the basis of the above embodiment.
[0083] Exemplarily, the HTML content is rendered as Canvas through the HTML2Canvas plugin, and the jsPDF plugin converts the Canvas into an image (such as Base64 format) and embeds the image into the PDF, and saves the PDF file. When implementing, the following is only an example: install the jsPDF plugin and declare a variable for instantiation: const doc = new jsPDF(); use the addImage() method of jsPDF to adjust the layout parameters of the PDF file: doc.addImage(imgData, 'PNG', 15, 40, 180, 0); call the save() method of jsPDF to save the pdf: doc.save('visa form.pdf').
[0084] Integrate the HTML2Canvas plugin and the jsPDF plugin. Use the HTML2Canvas plugin to convert the page content into a Canvas object, and then use the jsPDF plugin to convert the Canvas object into a PDF format and save it locally on the electronic device, realizing the efficient generation and saving functions of electronic documents. In addition, due to the use of the HTML2Canvas plugin and the jsPDF plugin, the generation method of this work visa form has good cross-platform compatibility and is applicable to a variety of mobile terminals and operating systems.
[0085] In some embodiments, to improve the traceability and integrity of the work visa form, the content to be visaed also includes an electronic signature, which is filled into the visa form generation interface in the following way: in response to receiving a second interaction operation acting on the signature control on the visa form generation interface, call the screen handwriting function of the electronic device; based on the canvas.getContext() method, obtain the electronic signature of the signature area on the electronic device screen; in response to detecting the completion of the signature instruction, display the visa form generation interface, and in the visa form generation interface, display the electronic signature.
[0086] Among them, the canvas.getContext() method can implement the real-time signature function. By listening to the user's mouse or touch events, a signature can be drawn on the Canvas, and the signature can be saved as a picture or combined with the jsPDF plugin package to embed the signature into the PDF document.
[0087] Exemplarily, there is also a signature control on the interaction interface of the work visa form generation auxiliary tool. After the user fills in the target work visa form template and submits it, click the signature control, and through the API interface provided by the operating system of the electronic device, call the screen handwriting function of the electronic device. For example, after clicking the signature control, a signature area is displayed. When it is detected that the user makes an electronic signature in this signature area, use the canvas.getContext() method to obtain the handwriting trajectory of the signature area, as shown in Figure 5 Schematic diagram of the front-end interface provided by the embodiments of the present application Figure 4 As shown, after the user completes the signature and clicks the save button to generate a completion signature instruction, when the completion signature instruction is detected, exit the interface of the current signature area, return to the visa form generation interface, and display the user's electronic signature on this visa form generation interface.
[0088] In the embodiments of the present application, through the canvas.getContext() method, developers can easily implement the real-time signature function and integrate it into various applications, such as electronic forms, contract signing and other scenarios, with wide applicability.
[0089] In some embodiments, to facilitate subsequent reference and verification and increase the reliability and credibility of the work visa form, the content to be visaed also includes on-site environment image information, which is filled into the visa form generation interface in the following manner: in response to receiving a third interaction operation on the camera control on the visa form generation interface, the camera of the electronic device is called to obtain the on-site environment image information; in response to detecting the completion of the photographing instruction, the visa form generation interface is displayed, and the on-site environment image information is displayed in the visa form generation interface.
[0090] Exemplarily, there is also a photographing button on the interaction interface of the work visa form generation auxiliary tool. After the user fills in the target work visa form template and submits it, the user can continue to add a photo of the on-site environment. Click the photographing button, and through the API interface provided by the operating system of the electronic device, the camera of the electronic device is called. The user takes a photo of the on-site environment. After the photographing is completed, click buttons such as save or complete or submit to generate a completion photographing instruction. When the completion photographing instruction is detected, the current photographing interface is exited, and the visa form generation interface is returned, and the on-site environment image information photographed by the user is displayed on the visa form generation interface.
[0091] When implementing, the following is only an example. Use the <input type="file"> element of HTML5 to implement the photographing function and allow the user to upload a photo (i.e., the on-site environment image information), and at the same time use the HTML2Canvas plugin to convert the photo content into a Canvas object for saving. Specifically, install the HTML2Canvas plugin and instantiate it to declare a variable: const canvas = document.createElement('canvas'); call the camera of the electronic device through the takePictureBtn.innerText method in the HTML2Canvas plugin; the width of the picture can also be set: canvas.width = video.videoWidth, and the height of the picture can be set: canvas.height = video.videoHeight; and the storage path and format of the saved photographed picture can be set: canvas.toDataURL('image / png').
[0092] Optionally, the on-site environment image information can also be a picture pre-stored locally. In response to receiving a third interaction operation on the camera control on the visa form generation interface, the storage path of the locally stored picture is displayed, and the user selects a target picture in the storage path as the on-site environment image information to be filled into the visa form generation interface.
[0093] In some embodiments, the method for generating a work visa form further includes: receiving a change operation on the content to be visaed on the visa form generation interface; in response to detecting a completion of the change instruction, displaying the visa form generation interface, and in the visa form generation interface, displaying the updated content to be visaed.
[0094] Exemplarily, there is also an edit button on the interaction interface of the work visa form generation auxiliary tool. By clicking this edit button, the content to be visaed that has been filled in by the user can be changed. For example, after the user fills in and submits the target work visa form template and finds that the filled content is incorrect, clicks the edit button to change the content filled in on the target work visa form template. After the change, clicks buttons such as complete, save, or submit to generate a completion change instruction. When the electronic device detects this completion change instruction, it will exit the current editing interface, display the visa form generation interface, and display the target work visa form template filled with the updated content to be visaed again in the visa form generation interface.
[0095] In the embodiments of the present application, during the generation process of the work visa form, it supports the change of the content to be visaed, has high flexibility, enhances user interaction, and improves user satisfaction.
[0096] Optionally, after the work visa form is generated, it also supports statistical operations. The user sets statistical conditions in the generation list of the work visa form to perform statistics, and then displays the statistical results corresponding to the statistical conditions. For example, relevant retrieval is performed by setting keywords.
[0097] Compared with manually filling in the work visa form, which cannot perform quick retrieval, analysis, and statistics, the embodiments of the present application can improve statistical efficiency, save labor costs, improve work efficiency, and facilitate subsequent data analysis and decision-making.
[0098] Figure 6 It is a schematic flowchart of the method for generating a work visa form provided by a specific embodiment of the present application. On the basis of the above embodiments, Figure 6 the method for generating a work visa form is further described as follows. As Figure 6 shown, the method includes:
[0099] S601. Select a work visa form template.
[0100] Exemplarily, multiple work visa form templates are built into the installation package of the work visa form generation auxiliary tool. After installing this auxiliary tool on the electronic device and entering the visa form generation interface in the auxiliary tool, after the user clicks the work visa form template selection control, all built-in alternative work visa form templates are displayed. After the user selects a suitable target work visa form template (for example, selects the on-site engineering quantity visa form for live working on the distribution network), clicks to enter this target work visa form template.
[0101] When developing the underlying layer of the auxiliary tool for generating work visa forms, a main web page interface (such as a visa form generation interface) needs to be created, where users can select a suitable work visa form template and fill in relevant content. For example, using the <select>Set the label for the work visa form template:
[0102] < / select>
[0103] <option value="template1">Template 1< / option>
[0104] <option value="template2">Template 2< / option>
[0105]
[0106] The area for filling in the content to be visaed uses the <from>Configure the label to fill in the content and submit the form:
[0107]
[0108] Using the <button>The button labels set the photo-taking button and the button for generating a work visa form on the main web page interface. Among them:
[0109] Photo-taking function button:
[0110] < / button> <button id="takePhotoBtn">Take a photo< / button>
[0111]
[0112] Generate work visa form button:
[0113] <button id="generateBtn">Generate the visa form< / button>
[0114] Dynamically load different work visa form templates through JavaScript and populate the corresponding form elements. Use the JavaScript web programming statement loadTemplate(template) in HTML to load the work visa form template. Specific implementation:
[0115] The document.getElementById('formContainer').innerHTML method calls the ${template} template variable configured in the electronic device and displays it on the front-end page for the user to select.
[0116] The code corresponding to the work visa form template (such as the on-site project quantity visa form for live working on the distribution network) is as follows:
[0117] <form id="visaForm">
[0118] <label for="workContent">Line / Substation name:< / label>
[0119] <textarea id="workContent" name="workContent">< / textarea>
[0120] <label for="responsiblePerson">Implementation content< / label>
[0121] <input type="text" id="responsiblePerson" name="responsiblePerson">
[0122] <label for="responsiblePerson">Unit< / label>
[0123] <input type="text" id="responsiblePerson" name="responsiblePerson">
[0124] <label for="responsiblePerson">Work permit number< / label>
[0125] <input type="text" id="responsiblePerson" name="responsiblePerson">
[0126] <label for="responsiblePerson">Engineering quantity< / label>
[0127] <input type="text" id="responsiblePerson" name="responsiblePerson">
[0128] <label for="responsiblePerson">Remarks< / label>
[0129] <input type="text" id="responsiblePerson" name="responsiblePerson">
[0130] < / form>
[0131]
[0132] S602. Fill in the work visa form template.
[0133] Fill in the content to be visaed according to the guiding information in the target work visa form template.
[0134] S603. Take on-site photos.
[0135] To facilitate subsequent reference and verification, and increase the reliability and credibility of the work visa form, the on-site environmental image information obtained from on-site photos can be embedded in the visa form generation interface. For example, use the <input type="file"> element of HTML5 to implement the photo-taking function, and allow users to upload photos (i.e., on-site environmental image information). At the same time, use the HTML2Canvas plugin to convert the photo content into a Canvas object for saving. Specifically, install the HTML2Canvas plugin and instantiate it to declare a variable: const canvas = document.createElement('canvas'); call the electronic device camera through the takePictureBtn.innerText method in the HTML2Canvas plugin; you can also set the picture width: canvas.width = video.videoWidth, set the picture height: canvas.height = video.videoHeight; and set the path and format for saving the taken photo: canvas.toDataURL('image / png').
[0136] S604. Sign in real time.
[0137] To improve the traceability and integrity of the work visa form, for example, there is also a signature control on the interaction interface of the work visa form generation auxiliary tool. After the user takes on-site photos and embeds the obtained on-site environmental image information into the visa form generation interface, click the signature control. Through the API interface provided by the operating system of the electronic device, call the screen handwriting function of the electronic device. For example, after clicking the signature control, a signature area is displayed. When it is detected that the user makes an electronic signature in this signature area, use the canvas.getContext() method to obtain the handwriting trajectory of the signature area, as shown in Figure 5 shown. When the user completes the signature and clicks the save button to generate a completed signature instruction, when the completed signature instruction is detected, exit the interface of the current signature area, return to the visa form generation interface, and display the user's electronic signature on this visa form generation interface.
[0138] S605. Generate a work visa form.
[0139] For example, use the HTML2Canvas plugin to render HTML content into a Canvas, and the jsPDF plugin to convert the Canvas into an image (such as in Base64 format), and embed the image into a PDF and save the PDF file. Specifically, install the jsPDF plugin and instantiate it to declare a variable: const doc = new jsPDF(); use the addImage() method of jsPDF to adjust the layout parameters of the PDF file: doc.addImage(imgData, 'PNG', 15, 40, 180, 0); call the save() method of jsPDF to save the pdf: doc.save('visa form.pdf'). The final work visa form contains a completed target work visa form template, on-site environment image information, and an electronic signature.
[0140] In summary, this application has at least the following advantages:
[0141] 1. Electronic recording replaces traditional manual filling, realizing the electronic recording of work content, reducing the risk of human error, and improving the accuracy and integrity of data.
[0142] 2. Systematic information input: According to the work content, fill in or select the corresponding work visa form template in the corresponding input box to fill in the work content, ensuring the standardization and normalization of information.
[0143] 3. On-site environment recording function: Support taking photos of the on-site environment for subsequent reference and verification, increasing the reliability and credibility of the work visa form.
[0144] 4. One-click generation and saving function: Support one-click generation of a work visa form and save it to the local folder of the electronic device. Support naming the folder by date for easy searching and management.
[0145] 5. Integration of HTML2Canvas plugin and jsPDF plugin: Use the HTML2Canvas plugin to convert page content into a Canvas object, and then use the jsPDF plugin to convert the Canvas object into PDF format and save it to the local of the electronic device, realizing the efficient generation and saving function of electronic documents.
[0146] 6. Multi-platform compatibility: Due to the use of the HTML2Canvas plugin and jsPDF plugin, this method has good cross-platform compatibility and is applicable to a variety of mobile devices and operating systems.
[0147] 7. Data Management and Storage: By systematically managing and storing work visa form data, it is convenient for long-term preservation and query, further enhancing the traceability and management convenience of the data.
[0148] 8. Efficient Workflow: The entire process from filling to saving has a high degree of automation, reducing the time and error rate of manual operations and improving work efficiency.
[0149] Figure 7 It is a schematic structural diagram of a work visa form generation device provided by an embodiment of the present application. As Figure 7 shown, the work visa form generation device provided in this embodiment is applied to an electronic device. The work visa form generation device 70 includes: a receiving module 71, a conversion module 72, and a generation module 73. Among them:
[0150] The receiving module 71 is configured to receive a first interaction operation acting on a visa form generation control on the visa form generation interface, and the first interaction operation is used to trigger the generation of a work visa form.
[0151] The conversion module 72 is configured to respond to the first interaction operation and convert the page content of the visa form generation interface into a Canvas object, and the page content includes the content to be visaed.
[0152] The generation module 73 is configured to generate a work visa form corresponding to the content to be visaed according to the Canvas object.
[0153] In a possible implementation manner, the conversion module 72 is specifically configured to: based on the HTML2Canvas plugin, convert the page content of the visa form generation interface into a Canvas object.
[0154] In a possible implementation manner, the conversion module 72 is further configured to: based on the jsPDF plugin, convert the Canvas object into a PDF format to obtain a work visa form corresponding to the content to be visaed.
[0155] In a possible implementation manner, the content to be visaed is filled into the visa form generation interface in the following way: in response to receiving a confirmation operation acting on a work visa form template selection control on the visa form generation interface, display alternative work visa form templates; in response to receiving a selection operation acting on a target work visa form template among the alternative work visa form templates, display the target work visa form template; receive a filling operation of the content to be visaed acting on the target work visa form template, and the filling operation of the content to be visaed is used to fill in the content to be visaed; in response to detecting a completion filling instruction, display the visa form generation interface, and in the visa form generation interface, display the target work visa form template filled with the content to be visaed.
[0156] In a possible implementation, the content to be visaed further includes an electronic signature, which is filled into the visa form generation interface in the following manner: in response to receiving a second interaction operation on the signature control on the visa form generation interface, the screen handwriting function of the electronic device is called; based on the canvas.getContext() method, the electronic signature in the signature area on the screen of the electronic device is obtained; in response to detecting a completion of the signature instruction, the visa form generation interface is displayed, and the electronic signature is displayed in the visa form generation interface.
[0157] In a possible implementation, the content to be visaed further includes on-site environment image information, which is filled into the visa form generation interface in the following manner: in response to receiving a third interaction operation on the camera control on the visa form generation interface, the camera of the electronic device is called to obtain on-site environment image information; in response to detecting a completion of the photographing instruction, the visa form generation interface is displayed, and the on-site environment image information is displayed in the visa form generation interface.
[0158] In a possible implementation, the generating device 70 further includes a processing module, and the processing module is configured to: receive a change operation on the content to be visaed on the visa form generation interface; in response to detecting a completion of the change instruction, display the visa form generation interface, and display the updated content to be visaed in the visa form generation interface.
[0159] The generating device of the work visa form provided in this embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effect are similar, and will not be elaborated here in this embodiment.
[0160] Figure 8 This is a schematic structural diagram of the electronic device provided in the embodiment of the present application. As Figure 8 shown, the electronic device 80 provided in this embodiment includes: at least one processor 801 and a memory 802. Optionally, the electronic device 80 further includes a communication component 803. Among them, the processor 801, the memory 802, and the communication component 803 are connected through a bus 804.
[0161] In a specific implementation process, at least one processor 801 executes the computer execution instructions stored in the memory 802, so that at least one processor 801 executes the above method.
[0162] The specific implementation process of the processor 801 can be referred to in the above method embodiment, and its implementation principle and technical effect are similar, and will not be elaborated here in this embodiment.
[0163] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU for short), or other general-purpose processors, digital signal processors (DSP for short), application specific integrated circuits (ASIC for short), etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
[0164] The memory may include a high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk memory.
[0165] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0166] The embodiments of this application also provide a computer program product, including a computer program, which implements the above method when executed by a processor.
[0167] The embodiments of this application also provide a computer-readable storage medium, in which computer-executable instructions are stored, and when the processor executes the computer-executable instructions, the above method is implemented.
[0168] The above-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk or an optical disk. The readable storage medium can be any available medium accessible by a general-purpose or special-purpose computer.
[0169] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in a device.
[0170] The division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Additionally, the couplings or direct couplings or communication connections shown or discussed between each other can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0171] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0172] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0173] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks or optical discs that can store program codes.
[0174] Those of ordinary skill in the art will understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments; and the foregoing storage medium includes: various media such as ROM, RAM, magnetic disk, or optical disk that can store program codes.
[0175] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention, which follow the general principles of the present invention and include known common knowledge or conventional technical means in the technical field not disclosed in the present invention. It is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only limited by the appended claims.< / from>
Claims
1. A method for generating a work visa, characterized in that: Applied to electronic equipment, the generating method comprises: Receiving a first interactive operation on a visa form generation control on a visa form generation interface, wherein the first interactive operation is used to trigger the generation of a work visa form; In response to the first interactive operation, converting the page content of the visa form generation interface into a Canvas object, wherein the page content includes content to be visaed; A work visa form corresponding to the content to be visaed is generated according to the Canvas object.
2. The method for generating a work visa according to claim 1, characterized in that: The converting the page content of the visa form generation interface into a Canvas object includes: Based on the HTML2Canvas plug-in, the page content of the visa form generation interface is converted into a Canvas object.
3. The method for generating a work visa according to claim 1 or 2, characterized in that: Generating a work visa form corresponding to the content to be visaed according to the Canvas object includes: Based on the jsPDF plug-in, the Canvas object is converted into PDF format to obtain the work visa form corresponding to the content to be visaed.
4. The method for generating a work visa according to claim 3, characterized in that: The content to be visaed is filled into the visa form generation interface in the following way: In response to receiving a confirmation operation on a work visa form template selection control on the visa form generation interface, displaying an alternative work visa form template; In response to receiving a selection operation on a target work visa form template in the candidate work visa form template, displaying the target work visa form template; Receiving an operation of filling in the content to be visaed that acts on the target work visa form template, wherein the operation of filling in the content to be visaed is used to fill in the content to be visaed; In response to detecting that the filling instruction is completed, the visa form generation interface is displayed, and in the visa form generation interface, the target work visa form template filled with the content to be visaed is displayed.
5. The method for generating a work visa according to claim 3, characterized in that: The content to be signed also includes an electronic signature, which is filled into the visa form generation interface in the following manner: In response to receiving a second interactive operation acting on a signature control on the visa form generation interface, calling a screen handwriting function of the electronic device; Based on the canvas.getContext() method, obtain the electronic signature in the signature area on the electronic device screen; In response to detecting the completion of the signature instruction, the visa form generation interface is displayed, and the electronic signature is displayed in the visa form generation interface.
6. The method for generating a work visa according to claim 3, characterized in that: The content to be visaed also includes on-site environment image information, and the on-site environment image information is filled into the visa form generation interface in the following manner: In response to receiving a third interactive operation acting on a photo control on the visa form generation interface, calling a camera of the electronic device to obtain on-site environment image information; In response to detecting that the photo taking instruction is completed, the visa form generation interface is displayed, and the on-site environment image information is displayed in the visa form generation interface.
7. The method for generating a work visa according to claim 3, characterized in that: Also includes: Receiving a change operation on the content to be visaed on the visa form generation interface; In response to detecting the completion of the change instruction, the visa form generation interface is displayed, and the updated content to be visaed is displayed in the visa form generation interface.
8. A device for generating a work visa, characterized in that: Applied to electronic equipment, the generating device comprises: A receiving module, used for receiving a first interactive operation acting on a visa form generation control on a visa form generation interface, wherein the first interactive operation is used for triggering the generation of a work visa form; A conversion module, configured to respond to the first interactive operation and convert the page content of the visa form generation interface into a Canvas object, wherein the page content includes content to be visaed; A generation module is used to generate a work visa form corresponding to the content to be visaed according to the Canvas object.
9. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed.
11. A computer program product, characterized in that include: A computer program, which, when executed, implements the method according to any one of claims 1 to 7.