Form configuration method, device and electronic device
By providing form configuration methods for dragging components and editing attributes on terminal devices, the problems of complex form configuration and high maintenance costs in the existing technology are solved, and flexible and fast form creation and release are realized, improving work efficiency and user experience .
Patent Information
- Application Number
- CN202111437901.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-11-30
AI Technical Summary
The process of creating and modifying forms in form configuration is complicated, time-consuming, and has high maintenance costs, so it is impossible to create and publish forms flexibly and quickly.
By providing a display interface on the terminal device, users can drag and drop components in the component panel to add to the canvas, and edit component properties in the properties panel to achieve flexible creation and publication of forms. The system includes component panels, canvas and attribute panels, which support component drag, preview, template parsing and saving functions, reducing maintenance costs.
Users can quickly create and publish forms, reducing maintenance costs, improving work efficiency, and supporting form management for multi-terminal devices.
Smart Images

Figure CN114063869B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of form development technology, and in particular to a form configuration method, device and electronic device. Background Art
[0002] At present, form configuration is mainly realized by using back-end technologies such as network organization (.NET), Java, and front-end technologies such as Hyper Text Markup Language (Html), JavaScript, etc. Each time a form is created, repeated operations are required, the process is very complicated, time-consuming, maintenance costs are high, and the form cannot be created and modified flexibly and quickly. In addition, there are many places where forms are needed in real life. Developing a separate form for each requirement will greatly increase the workload and maintenance costs of the staff.
[0003] Therefore, the existing technology cannot create and publish forms flexibly and quickly and has high maintenance costs. Summary of the invention
[0004] The embodiments of the present application provide a form configuration method, device and electronic device for flexibly and quickly creating and publishing forms.
[0005] In a first aspect, an embodiment of the present application provides a form configuration method, including:
[0006] In response to the user's operation on the display interface of the terminal device, a canvas, a component panel and a property panel are displayed on the display interface; the canvas is used to create a form, the component panel is composed of one or more components, any one of the one or more components is used to construct the table items in the form, and the property panel is used to display and edit the properties of one or more components in the canvas; in response to the user's operation of dragging the one or more components in the component panel, the one or more components are added to the canvas; in response to the user's operation of clicking on the first component of the one or more components in the canvas, the properties of the first component are displayed in the property panel.
[0007] Based on the above scheme, the form creation method provided by this application allows users to flexibly and quickly create and publish forms on terminal devices by simply dragging and dropping, and can reduce maintenance costs.
[0008] In a possible implementation, the attributes of the first component include a mandatory or optional attribute; the mandatory or optional attribute is used to indicate whether the first component is a mandatory item or an optional item in the form.
[0009] Based on the above solution, by setting the required and optional attributes of the component, more possibilities can be provided for form creation.
[0010] In a possible implementation, the component panel includes a second component; the second component is used to construct a table item in the form to which pictures need to be added; the attributes of the second component include an upload attribute; the upload attribute is used to limit the pictures added in the table item.
[0011] Based on the above solution, by setting the upload attribute for the table items in the form that need to add pictures, the pictures added to the table items can be restricted to meet the needs of users.
[0012] In a possible implementation, the display interface further includes an operation bar; the operation bar includes a preview button; in response to a user clicking the preview button, the status of the form being published is displayed on the display interface.
[0013] Based on the above solution, users can experience the properties of each component in the form when publishing through the preview function, so that users can adjust the form according to their needs at any time, which can improve the user experience to a certain extent.
[0014] In a possible implementation, the display interface also includes an operation bar; the operation bar also includes a template parsing input box and a template parsing button; in response to a user inputting text in JS object notation json format in the template parsing input box and clicking the template parsing button, a form template corresponding to the text in json format is displayed in the canvas.
[0015] Based on the above solution, users can modify existing form templates through the template parsing function, which can greatly reduce the user's workload.
[0016] In a possible implementation, the display interface also includes an operation bar; the operation bar also includes a save button; in response to the user clicking the save button, a text in json format including the form and the properties of all components in the form is generated; and the form constructed in the canvas and the properties of all components in the form are uploaded to the server.
[0017] Based on the above solution, the user can upload the created form to the server through the Save button, so that the form can be modified on multiple terminal devices, which can improve the user experience.
[0018] A possible implementation method, in response to the user dragging the one or more components in the component panel, adding the one or more components to the canvas, specifically includes: when no component is added to the canvas, in response to the user dragging the third component of the one or more components in the component panel, adding the third component to a designated position in the canvas; when at least one component has been added to the canvas, in response to the user dragging the fourth component of the one or more components in the component panel, adding the fourth component to the mouse dragged position.
[0019] Based on the above solution, by adding components to the location where the mouse is dragged, users can create forms more conveniently and quickly.
[0020] In a possible implementation, when the size of the canvas is not large enough to display the one or more components, the canvas is extended until the size of the canvas is large enough to display the one or more components.
[0021] Based on the above solution, extending the canvas can meet the needs of users to create large-size forms and improve the user experience.
[0022] A possible implementation method, after adding the one or more components to the canvas in response to the user dragging the one or more components in the component panel, further includes: selecting the one or more components added to the canvas; and displaying the properties of the one or more selected components in the property panel.
[0023] Based on the above solution, users can directly modify the properties of components added to the canvas without clicking, etc. Users can create multiple forms that meet their business needs by modifying the properties of each component.
[0024] In a second aspect, an embodiment of the present application provides a form configuration device, including:
[0025] A display unit, configured to display a display interface of a terminal device;
[0026] The processing unit is configured to perform the following operations:
[0027] In response to the user's operation on the display interface of the terminal device, a canvas, a component panel and a property panel are displayed on the display interface; the canvas is used to create a form, the component panel is composed of one or more components, any one of the one or more components is used to construct the table items in the form, and the property panel is used to display and edit the properties of one or more components in the canvas; in response to the user's operation of dragging the one or more components in the component panel, the one or more components are added to the canvas; in response to the user's operation of clicking on the first component of the one or more components in the canvas, the properties of the first component are displayed in the property panel.
[0028] In a possible implementation, the attributes of the first component include a mandatory or optional attribute; the mandatory or optional attribute is used to indicate whether the first component is a mandatory item or an optional item in the form.
[0029] In a possible implementation, the component panel includes a second component; the second component is used to construct a table item in the form to which pictures need to be added; the attributes of the second component include an upload attribute; the upload attribute is used to limit the pictures added in the table item.
[0030] In a possible implementation, the display interface further includes an operation bar; the operation bar includes a preview button; and the processing unit is configured to: in response to a user clicking the preview button, display the status of the form when it is published on the display interface.
[0031] In a possible implementation, the display interface also includes an operation bar; the operation bar also includes a template parsing input box and a template parsing button; the processing unit is further configured to: in response to a user inputting text in JS object notation json format in the template parsing input box and clicking the template parsing button, display the form template corresponding to the text in json format in the canvas.
[0032] In a possible implementation, the display interface also includes an operation bar; the operation bar also includes a save button; the processing unit is further configured to: in response to a user clicking the save button, generate a text in json format containing the form and the properties of all components in the form; and upload the completed form in the canvas and the properties of all components in the form to the server.
[0033] In a possible implementation, the processing unit is configured to add the one or more components to the canvas in response to the user dragging the one or more components in the component panel as follows: when no component is added to the canvas, in response to the user dragging a third component among the one or more components in the component panel, the third component is added to a designated position in the canvas; when at least one component has been added to the canvas, in response to the user dragging a fourth component among the one or more components in the component panel, the fourth component is added to the position where the mouse is dragged.
[0034] In a possible implementation, the processing unit is further configured to: when the size of the canvas is not large enough to display the one or more components, extend the canvas until the size of the canvas is large enough to display the one or more components.
[0035] In a possible implementation, after the processing unit adds the one or more components to the canvas in response to the user dragging the one or more components in the component panel, the processing unit is further configured to: select the one or more components added to the canvas; and display the properties of the one or more selected components in the property panel.
[0036] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0037] Memory, for storing computer instructions;
[0038] A processor is connected to the memory, and is used to execute computer instructions in the memory, and implement the method as described in any one of the first aspects when executing the computer instructions.
[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including:
[0040] The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is enabled to perform the method as described in any one of the first aspects.
[0041] In a fifth aspect, an embodiment of the present application provides a computer program product for a computer, comprising: a software code portion, and when the product is run on the computer, the software code portion is used to implement the method as described in any one of the first aspects.
[0042] In one possible implementation, the computer program product includes a computer-readable medium on which the software code portion is stored, and / or the computer program product can be directly loaded into the internal memory of the computer and / or sent via a network through at least one of an upload process, a download process, and a push process.
[0043] For each of the above-mentioned aspects from the second to the fifth aspects and the technical effects that may be achieved by each of the aspects, please refer to the above-mentioned description of the technical effects that can be achieved by the first aspect or various possible schemes in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application.
[0045] Figure 1 A system diagram for applying the form configuration method provided in this application;
[0046] Figure 2 One of the exemplary flow charts of a form configuration method provided in an embodiment of the present application;
[0047] Figure 3A One of the display interface schematic diagrams provided in the embodiment of the present application;
[0048] Figure 3B One of the display interface schematic diagrams provided in the embodiment of the present application;
[0049] Figure 4A A schematic diagram of the component dragging process provided in an embodiment of the present application;
[0050] Figure 4B A schematic diagram of component position movement provided in an embodiment of the present application;
[0051] Figure 5A One of the display interface schematic diagrams provided in the embodiment of the present application;
[0052] Figure 5B One of the display interface schematic diagrams provided in the embodiment of the present application;
[0053] Figure 5C One of the display interface schematic diagrams provided in the embodiment of the present application;
[0054] Figure 6 A schematic diagram of a terminal device start page provided in an embodiment of the present application;
[0055] Figure 7 A schematic diagram of a device provided in an embodiment of the present application;
[0056] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to facilitate understanding of the technical solutions provided by the embodiments of the present application, the professional terms involved in the embodiments of the present application are introduced below.
[0058] (1) Forms: Forms are mainly responsible for data collection in web pages. A form has three basic components: Form tag: This contains the Uniform Resource Locator (URL) of the Common Gateway Interface (CGI) program used to process form data and the method of submitting data to the server. Form fields: This includes text boxes, password boxes, hidden fields, multi-line text boxes, check boxes, radio buttons, drop-down selection boxes, and file upload boxes. Form buttons: This includes submit buttons, reset buttons, and general buttons; these are used to transmit data to CGI scripts on the server or cancel input. Form buttons can also be used to control other processing tasks that define processing scripts.
[0059] (2) Vue is a progressive framework for building user interfaces. Unlike other large frameworks, Vue is designed to be applied layer by layer from the bottom up. Vue's core library only focuses on the view layer, making it easy to integrate with third-party libraries or existing projects. On the other hand, when used in combination with a modern tool chain and various supporting libraries, Vue is also fully capable of driving complex single-page applications.
[0060] (3)element-ui is a Vue-based desktop component library for developers, designers, and product managers.
[0061] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0062] The terms "first" and "second" in the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.
[0063] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally indicates that the associated objects before and after are in an "or" relationship.
[0064] At present, form configuration is mainly implemented using back-end technologies such as network organization (.NET) and Java, as well as front-end technologies such as Hyper Text Markup Language (Html) and JavaScript. Each time a form is created, repeated operations are required. The process is very complicated and time-consuming, the maintenance cost is high, and the form cannot be created and modified flexibly and quickly.
[0065] In view of this, the present application provides a form configuration method, in which the terminal device constructs each table item of the form by responding to the user's operation of dragging components in the component panel, and the terminal device can also configure each table item of the form by responding to the user's operation of editing one or more properties of the component in the property panel. Thus, flexible and fast creation and publishing of forms are achieved.
[0066] See also Figure 1 , which is a system diagram for the application of the form configuration method provided in this application. System 100 includes: terminal device 101 and server 102. Among them, terminal device 101 can be a device such as a tablet computer, a computer or a smart phone. Terminal device 101 is used to respond to the user's operation of dragging components in the component panel to the canvas to construct the table items of the form, and the user's operation of clicking on the component in the canvas and editing the component properties in the property panel. Server 102 is used to save the form created by the user.
[0067] See also Figure 2 One of the exemplary flow charts of a form configuration method provided in an embodiment of the present application may include the following process:
[0068] S201, the terminal device displays a canvas, a component panel, and a property panel on the display interface in response to an operation of a user on the display interface of the terminal device.
[0069] The canvas is used to create a form, the component panel consists of one or more components, any of the one or more components is used to construct table items in the form, and the property panel is used to display and edit the properties of one or more components in the canvas.
[0070] In a possible implementation, the display interface may further include an operation bar. The operation bar may include a save button, a preview button, a template parsing input box, and a template parsing button. The save button is used to upload the created form to the server, the preview button is used to display the status of the form when it is published, and the template parsing input box and the template parsing button are used to input text in an existing JavaScript Object Notation (json) format and display the form template corresponding to the input json format text.
[0071] See also Figure 3A A schematic diagram of a display interface provided for an embodiment of the present application. As shown in the figure, the display interface of the terminal device can be divided into four parts, including: a component panel 301, a canvas 302, a property panel 303 and an operation bar 304. The component panel 301 is used to provide components for constructing table items in a form, wherein the component panel contains n components, and n is an integer greater than or equal to 1. Canvas 302 is used to create a form. The property panel 303 is used to display and edit the properties of one or more components selected in the canvas, and may include m properties of a selected component or may include m properties of multiple selected components, and m is an integer greater than or equal to 1. The properties displayed in the property panel shown in the figure are the m properties of component 1 in the canvas. The operation bar 304 is used to provide users with form saving, previewing and template parsing functions, and may include a save button, a preview button, a template parsing button and a template parsing input box.
[0072] For example, if the items in a form include the name, gender, age and photo of the person filling out the form, then the component panel may include a single-line text box, radio button, image upload component and submit button. Through these components, the user can create a form that includes the name, gender, age and photo of the person filling out the form. The above items in the form may include the initial value of the component, the name of the component, the position of the component in the form, the style of the component, the limit on the number of characters that can be input, the image upload attribute and the required and optional attributes of the component. In response to the user clicking on any of the one or more components in the canvas, the terminal device displays the corresponding relationship between the component and the attribute in the attribute panel. See also Figure 3B , which is one of the display interface schematic diagrams provided in the embodiment of the present application. In response to the user clicking the single-line text box component in the canvas 302, the terminal device displays all the properties of the single-line text box component in the property panel 303, including the initial value of the component, the name of the component, the position of the component in the form, the style of the component, the limited number of input characters of the component, and the required and optional properties of the component.
[0073] It should be understood that the corresponding relationship between table items, components and attributes can also be displayed in the property panel, or the corresponding relationship between components and attributes can also be displayed in the property panel, and this application does not make specific limitations.
[0074] S202: In response to a user's operation of dragging one or more components in a component panel, the terminal device adds one or more components to a canvas.
[0075] The user only needs to drag and drop one or more components required for the form from the component panel to the canvas to display the corresponding table items in the canvas. The components may include but are not limited to single-line text boxes, password boxes, check boxes, radio buttons, and submit buttons.
[0076] In one possible implementation, when no component has been added to the canvas, the terminal device adds the third component to a designated position in the canvas in response to the user dragging a third component from one or more components in the component panel. In one possible scenario, the designated position may be the first position in the canvas where a component can be placed. For example, the canvas may be divided into a rows and b columns, where a and b are both integers greater than or equal to 1, and the first position may refer to the first row and first column of the canvas. In another possible scenario, the designated position may also be the center of the canvas, which is not limited in the present application.
[0077] Another possible implementation is that when at least one component has been added to the canvas, the terminal device responds to the user's operation of dragging a fourth component from one or more components in the component panel by adding the fourth component to the position where the mouse is dragged. That is to say, when there is at least one component in the canvas, the user can place the component at any position in the canvas according to his or her needs. Figure 4A Schematic diagram of the component dragging process provided in an embodiment of the present application. When component 2 has been added to canvas 402, the terminal device can respond to the user's operation of clicking and dragging component 1 in component panel 401, and add component 1 to the position where the mouse is dragged, that is, the position of component panel 401 indicated by the dotted line in canvas 402.
[0078] When at least one component has been added to the canvas, the terminal device can also delete or copy the first component in the canvas in response to the user right-clicking the first component among the one or more components in the canvas.
[0079] The terminal device may also move the position of the first component in response to the user's operation of dragging the first component among the one or more components in the canvas. Figure 4B Schematic diagram of component position movement provided in an embodiment of the present application. In response to the user dragging component 1 in canvas 402, the terminal device can move component 1 from its original position to the mouse drag position, that is, move the component from the position of solid line component 1 to the position of dotted line component 1.
[0080] For example, if a user wants to create a form that includes the name, gender, age, and photo of the person filling out the form, the user can drag two single-line text box components in the component panel to create the name and age items of the person filling out the form, and then drag two radio button components from the component panel to create the gender item of the person filling out the form, and then drag a picture upload component from the component panel to create the photo of the person filling out the form. It should be understood that the order of dragging the components can be selected by the user, and this application does not limit this.
[0081] In a possible implementation, the components in the component panel may also include a form template component pre-configured in the terminal device. The user may drag the form template component to the canvas to complete the creation of the form, or may add, delete, and edit the properties of the table items in the form template after dragging the form template component to the canvas to complete the creation of the form. Optionally, the form template component may be built using the element-ui component library.
[0082] Based on the above solution, users can use the form template components preset on the terminal device to quickly and easily complete the creation of the form.
[0083] S203: In response to the user clicking on a first component among one or more components in the canvas, the terminal device displays the properties of the first component in a property panel.
[0084] The user can edit the properties of the first component in the property panel to edit the form. Optionally, the properties can be the initial value of the component, the name of the component, the position of the component in the form, the style of the component, the limited number of input characters of the component, and the mandatory and optional properties of the component. Among them, the mandatory and optional properties are used to indicate whether the component is a mandatory item or an optional item in the form.
[0085] When the terminal device displays all properties of the first component in the property panel in response to the user clicking on the first component among one or more components in the canvas, the terminal device extracts data in the canvas array and passes the data to the component panel, and the component panel uniformly passes the properties of the components to the property panel for display.
[0086] A possible implementation method is that when the component clicked by the user is the second component in the canvas used to construct a table item in the form to which a picture needs to be added, the properties of the second component displayed in the property panel may include upload properties. Among them, the second component may be a picture upload component, and the upload property is used to limit the properties of the picture added in the table item. For example, it may be a property used to limit the size of the uploaded picture, the format of the uploaded picture, and / or the size of the uploaded picture. That is to say, when the user clicks on the picture upload component in the canvas, the properties displayed in the property panel may include the size of the uploaded picture, the size of the uploaded picture, and the format of the uploaded picture, and the user can set it according to the form requirements. For example, it can be set that the size of the uploaded picture needs to be less than or equal to 100kb, the size of the uploaded picture needs to be equal to 800*800, and the format of the uploaded picture needs to be jpg format.
[0087] After the terminal device adds one or more components to the canvas in response to the user dragging one or more components in the component panel, the terminal device can also be set to select the one or more components by default and display the properties of the one or more components in the property panel.
[0088] Based on the above solution, users can directly modify the properties of components added to the canvas without clicking, etc. Users can create multiple forms that meet their business needs by modifying the properties of each component.
[0089] When the user does not click on a component in the canvas, the Properties panel does not display any properties. Figure 5AThis is one of the display interface schematic diagrams provided in the embodiment of the present application. The component panel 501 includes four components: component 1, component 2, component 3 and component 4. The form shown in the canvas 502 is a form created based on component 1, component 2, component 3 and component 4. As shown in the property panel 503 in the figure, when the user does not click on a component in the canvas, the property panel 503 does not display any properties.
[0090] When editing the properties of a component, users can edit some properties by inputting, such as the initial value of the component and the name of the component. Users can edit some properties by selecting from the given options in the drop-down selection box, such as the required and optional properties of the component. Figure 5B This is one of the display interface diagrams provided by the embodiment of the present application. As shown in the figure, component 1 in the canvas 502 is selected, and the initial value, name, and required and optional properties of component 1 before editing are displayed in the property panel 503. The user can edit the properties in the text box after the initial value and name, and the user can also select whether the component is an optional component or a required component by clicking the triangle drop-down button after the required and optional properties.
[0091] See also Figure 5C This is one of the display interface diagrams provided in an embodiment of the present application. Assuming that the initial value of component 1 is 000, the name is 111, and component 1 is a required component, the initial value, name and required and optional attributes of component 1 after editing are displayed in the property panel 503 as shown in the figure.
[0092] The user can complete the creation of the form by adding all the components required for the form to the canvas and editing the properties of the components in the canvas.
[0093] When the size of the canvas is not enough to display all the components in the canvas, the terminal device will extend the canvas until the size of the canvas is enough to display all the components in the canvas. Optionally, the canvas can be extended to just enough to display all the components in the canvas. For example, suppose the initial canvas size is 18.2cm*25.7cm. After the user adds multiple components, the width of the form in the canvas is 20cm and the length is 25cm. The size of the canvas will be extended to 20cm*25.7cm. The canvas can also be extended to a fixed size that can display all the components in the canvas. For example, suppose the initial canvas size is 18.2cm*25.7cm. After the user adds multiple components, the width of the form in the canvas is 20cm and the length is 25cm. The size of the canvas will be extended to 21cm*29.7cm. That is, when the width of the form in the canvas is greater than the initial canvas width but less than the fixed size width, and the length of the form in the canvas is greater than the initial canvas length but less than the fixed size length, the canvas is extended to the fixed size. This application does not limit the extension method of the canvas.
[0094] In one possible scenario, the initial value of the canvas size may be set by the user. For example, the terminal device provides multiple possible canvas sizes, and the user sets the initial value of the canvas by selecting a suitable canvas size from the multiple possible canvas sizes. For example, the possible canvas sizes provided by the terminal device may be A4 (21cm*29.7cm), B5 (18.8cm*25.7cm) and A3 (29.3cm*42cm), and the user may select any of the above three sizes as the initial value of the canvas size. In another possible scenario, the initial value of the canvas size may also be set by the user by inputting the initial length and width of the canvas.
[0095] After creating a form in the canvas, the user can upload the form to the server through the save function provided by the terminal device, and can view it on multiple terminal devices at the same time. For example, when the user completes the form creation and saves it to the server on the computer terminal device, the user can view it on the smartphone terminal device at the same time.
[0096] Specifically, in response to the user clicking the Save button in the operation bar, the terminal device saves the form created by the user in the canvas and the properties of all components in the form to the server, and can also generate a json format text corresponding to the form, which includes the properties of the form and all components in the form.
[0097] The terminal device can also provide a preview function for the user. Specifically, in response to the user clicking the preview button in the operation bar, the terminal device displays the status of the form when it is published on the display interface. Optionally, in the preview state, the user can fill in the form, but cannot submit the filled data, so as to experience the properties of each component in the form when it is published, so that the user can adjust the form according to the needs at any time, and it can also avoid user misoperation, which can improve the user experience to a certain extent.
[0098] The terminal device can also provide the user with a template parsing function. Specifically, in response to the user inputting text in json format in the template parsing input box and clicking the template parsing button, the terminal device displays the form template corresponding to the text in json format in the canvas. Optionally, the user can edit the form template to generate a new form.
[0099] In a possible implementation, before the canvas, component panel, property panel, and operation bar are displayed on the display interface, the user can create or edit the form by opening the terminal device on the terminal device. Figure 6Schematic diagram of the start page of the terminal device provided in the embodiment of the present application. The start page includes: a add button 601, a modify button 602, a delete button 603 and a form list 604. Among them, the form list 604 can include k created forms, where k is an integer greater than or equal to 1. It should be understood that if the user has not created a form, the form list is blank, that is, no form will be displayed. The terminal device can respond to the user clicking the add button 601 and display the following on the display interface: Figure 3A The terminal device can also respond to the user clicking on any first form in the form list 604, select the first form, and then the terminal device responds to the user clicking on the modify button 602, and displays the following on the display interface: Figure 3A The terminal device can also select the second form in response to the user clicking on any second form in the form list 604, and then delete the second form in the form list 604 in response to the user clicking on the delete button 603.
[0100] In a possible implementation, the terminal device is developed through a front-end framework. Optionally, the terminal device can be developed based on the front-end framework Angular, React or Vue. In the embodiment of the present application, the terminal device is developed using Vue as the framework as an example. Utilizing the characteristics of Vue's responsive data binding, the data binding relationship is declared in advance in the terminal device through the v-model attribute of the input tag in Vue. When the user edits the properties of the component in the canvas in the property panel, that is, when the data of the component changes, the data with the binding relationship and the content of the display interface can be changed synchronously.
[0101] The component component in Vue can be used in the design of the canvas to maintain the form of one or more components in the component panel when the user adds one or more components in the component panel to the canvas, thereby avoiding repeated rendering and causing performance problems on the terminal device.
[0102] Based on the same concept of the above method, see Figure 7 The form configuration device 700 provided in the embodiment of the present application can execute each step in the above method, which will not be described in detail here to avoid repetition. The device 700 includes a display unit 701 and a processing unit 702 .
[0103] In one scenario:
[0104] The display unit 701 is configured to display a display interface of the terminal device;
[0105] The processing unit 702 is used to perform the following processing:
[0106] In response to the user's operation on the display interface of the terminal device, a canvas, a component panel and a property panel are displayed on the display interface; the canvas is used to create a form, the component panel is composed of one or more components, any one of the one or more components is used to construct the table items in the form, and the property panel is used to display and edit the properties of one or more components in the canvas; in response to the user's operation of dragging the one or more components in the component panel, the one or more components are added to the canvas; in response to the user's operation of clicking on the first component of the one or more components in the canvas, the properties of the first component are displayed in the property panel.
[0107] In a possible implementation, the attributes of the first component include a mandatory or optional attribute; the mandatory or optional attribute is used to indicate whether the first component is a mandatory item or an optional item in the form.
[0108] In a possible implementation, the component panel includes a second component; the second component is used to construct a table item in the form to which pictures need to be added; the attributes of the second component include an upload attribute; the upload attribute is used to limit the pictures added in the table item.
[0109] In a possible implementation, the display interface further includes an operation bar; the operation bar includes a preview button; and the processing unit is further configured to: in response to a user clicking the preview button, display the status of the form when it is published on the display interface.
[0110] In a possible implementation, the display interface also includes an operation bar; the operation bar also includes a template parsing input box and a template parsing button; the processing unit is further configured to: in response to a user inputting text in JS object notation json format in the template parsing input box and clicking the template parsing button, display the form template corresponding to the text in json format in the canvas.
[0111] In a possible implementation, the display interface also includes an operation bar; the operation bar also includes a save button; the processing unit is further configured to: in response to a user clicking the save button, generate a text in json format containing the form and the properties of all components in the form; and upload the completed form in the canvas and the properties of all components in the form to the server.
[0112] In a possible implementation, the processing unit adds the one or more components to the canvas in response to a user dragging the one or more components in the component panel, and is specifically configured as follows: when no component is added to the canvas, in response to a user dragging a third component among the one or more components in the component panel, the third component is added to a designated position in the canvas; when at least one component has been added to the canvas, in response to a user dragging a fourth component among the one or more components in the component panel, the fourth component is added to the position where the mouse is dragged.
[0113] In a possible implementation, the processing unit is further configured to: when the size of the canvas is not large enough to display the one or more components, extend the canvas until the size of the canvas is large enough to display the one or more components.
[0114] In a possible implementation, after the processing unit adds the one or more components to the canvas in response to the user dragging the one or more components in the component panel, the processing unit is further configured to: select the one or more components added to the canvas; and display the properties of the one or more selected components in the property panel.
[0115] Based on the same concept of the above method, see Figure 8 , an electronic device is provided for an embodiment of the present application, the electronic device includes a processor 801 and a memory 802. The memory 802 is used to store computer instructions, and the processor 801 is connected to the memory and is used to execute the computer instructions in the memory, and implement the steps of any of the above methods when executing the computer instructions.
[0116] The embodiment of the present application further provides a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the steps of any of the above methods.
[0117] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0118] Although the specific embodiments of the present application are described above, it should be understood by those skilled in the art that these are merely examples, and the scope of protection of the present application is limited by the attached claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present application, but these changes and modifications all fall within the scope of protection of the present application. Although the preferred embodiments of the present application have been described, once those skilled in the art are aware of the basic creative concepts, additional changes and modifications may be made to these embodiments. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0119] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A form configuration method, characterized in that: include: In response to the user's operation on the display interface of the terminal device, displaying the canvas, the component panel and the property panel on the display interface; The canvas is used to create a form, the component panel is composed of one or more components, any one of the one or more components is used to construct table items in the form, and the property panel is used to display and edit the properties of one or more components in the canvas; In response to a user dragging the one or more components in the component panel, adding the one or more components to the canvas; In response to a user clicking on a first component among the one or more components in the canvas, displaying properties of the first component in the property panel; The components in the component panel include a pre-configured form template component. In response to a user dragging the form template component to the canvas, a form template corresponding to the form template component is created in the canvas. The form template corresponding to the form template component is modified through the component panel and the property panel. The form template component is constructed using a desktop component library in a user interface construction framework. Before the display interface displays the canvas, the component panel, and the property panel, the method further includes: Displaying a start page, wherein the start page includes a modification button and a form list, wherein the form list is used to display the created forms; In response to a user clicking on any first form in the form list, selecting the first form; In response to the user clicking the modification button, the canvas, the component panel and the property panel are displayed in the display interface, the first form is displayed in the canvas, and the first form is modified through the component panel and the property panel; Among them, the data binding relationship is declared in advance through the specified attributes of the input tag in the construction framework of the user interface, and when the attributes of the component in the canvas are edited in the attribute panel, the attribute data with the binding relationship and the component view of the display interface are changed synchronously; and the components in the component panel adopt the component components in the construction framework of the user interface, and when one or more components in the component panel are added to the canvas, the form of the one or more components in the component panel is maintained.
2. The method according to claim 1, characterized in that include: The attributes of the first component include mandatory and optional attributes; the mandatory and optional attributes are used to indicate whether the first component is a mandatory item or an optional item in the form.
3. The method according to claim 1, characterized in that include: The component panel includes a second component; the second component is used to construct a table item in the form to which a picture needs to be added; The attributes of the second component include an upload attribute; the upload attribute is used to limit the pictures added to the table item.
4. The method according to claim 1, characterized in that: The display interface also includes an operation bar; the operation bar includes a preview button; In response to the user clicking the preview button, the status of the form being published is displayed on the display interface.
5. The method according to claim 1, characterized in that The display interface also includes an operation bar; the operation bar also includes a template parsing input box and a template parsing button; In response to the user inputting text in the JS object notation json format in the template parsing input box and clicking the template parsing button, the form template corresponding to the text in the json format is displayed in the canvas.
6. The method according to claim 1, characterized in that The display interface also includes an operation bar; the operation bar also includes a save button; In response to the user clicking the save button, generating a text in json format including the form and the properties of all components in the form; The completed form in the canvas and the properties of all components in the form are uploaded to the server.
7. The method according to claim 1, characterized in that In response to the user dragging the one or more components in the component panel, adding the one or more components to the canvas specifically includes: When no component is added to the canvas, in response to a user dragging a third component among the one or more components in the component panel, adding the third component to a designated position in the canvas; When at least one component has been added to the canvas, in response to a user's operation of dragging a fourth component among the one or more components in the component panel, the fourth component is added to the position where the mouse is dragged.
8. The method according to claim 1, characterized in that Also includes: When the size of the canvas is not large enough to display the one or more components, the canvas is extended until the size of the canvas is large enough to display the one or more components.
9. The method according to claim 1, characterized in that: After adding the one or more components to the canvas in response to the user dragging the one or more components in the component panel, the method further includes: Selecting the one or more components added to the canvas; The properties of the one or more selected components are displayed in the property panel.
10. A form configuration device, characterized in that: include: A display unit, configured to display a display interface of a terminal device; The processing unit is configured to perform the following operations: In response to the user's operation on the display interface of the terminal device, a canvas, a component panel and a property panel are displayed on the display interface; the canvas is used to create a form, the component panel is composed of one or more components, any of the one or more components is used to construct a table item in the form, and the property panel is used to display and edit the properties of one or more components in the canvas; In response to a user dragging the one or more components in the component panel, adding the one or more components to the canvas; In response to a user clicking on a first component among the one or more components in the canvas, displaying properties of the first component in the property panel; The components in the component panel include a pre-configured form template component, and the processing unit is further configured to: in response to a user dragging the form template component to the canvas, create a form template corresponding to the form template component in the canvas, and modify the form template corresponding to the form template component through the component panel and the property panel; wherein the form template component is constructed using a desktop component library in a user interface construction framework; The display unit is further configured to: display a start page, the start page including a modification button and a form list, the form list is used to display the created forms; The processing unit is further configured to perform the following operations: In response to a user clicking on any first form in the form list, selecting the first form; In response to the user clicking the modification button, the canvas, the component panel and the property panel are displayed in the display interface, the first form is displayed in the canvas, and the first form is modified through the component panel and the property panel; Among them, the data binding relationship is declared in advance through the specified attributes of the input tag in the construction framework of the user interface, and when the attributes of the component in the canvas are edited in the attribute panel, the attribute data with the binding relationship and the component view of the display interface are changed synchronously; and the components in the component panel adopt the component components in the construction framework of the user interface, and when one or more components in the component panel are added to the canvas, the form of the one or more components in the component panel is maintained.
11. The device according to claim 10, characterized in that The attributes of the first component include mandatory and optional attributes; the mandatory and optional attributes are used to indicate whether the first component is a mandatory item or an optional item in the form.
12. The device according to claim 10, characterized in that The component panel includes a second component; the second component is used to construct a table item in the form to which a picture needs to be added; The attributes of the second component include an upload attribute; the upload attribute is used to limit the pictures added to the table item.
13. The device according to claim 10, characterized in that The display interface also includes an operation bar; the operation bar includes a preview button; The processing unit is further configured to: in response to a user clicking the preview button, display the status of the form when it is published on the display interface.
14. The device according to claim 10, characterized in that The display interface also includes an operation bar; the operation bar also includes a template parsing input box and a template parsing button; The processing unit is further configured to: in response to a user inputting text in the JS object notation json format in the template parsing input box and clicking the template parsing button, display a form template corresponding to the text in the json format in the canvas.
15. The device according to claim 10, characterized in that The display interface also includes an operation bar; the operation bar also includes a save button; The processing unit is further configured to: In response to the user clicking the save button, generating a text in json format including the form and the properties of all components in the form; The completed form in the canvas and the properties of all components in the form are uploaded to the server.
16. The device according to claim 10, characterized in that The processing unit adds the one or more components to the canvas in response to the user dragging the one or more components in the component panel, and is specifically configured to: When no component is added to the canvas, in response to a user dragging a third component among the one or more components in the component panel, adding the third component to a designated position in the canvas; When at least one component has been added to the canvas, in response to a user's operation of dragging a fourth component among the one or more components in the component panel, the fourth component is added to the position where the mouse is dragged.
17. The device according to claim 10, characterized in that The processing unit is further configured to: When the size of the canvas is not large enough to display the one or more components, the canvas is extended until the size of the canvas is large enough to display the one or more components.
18. The device according to claim 10, characterized in that The processing unit is further configured to: after adding the one or more components to the canvas in response to the user dragging the one or more components in the component panel, Selecting the one or more components added to the canvas; The properties of the one or more selected components are displayed in the property panel.
19. An electronic device, characterized in that: include: Memory, for storing computer instructions; A processor, connected to the memory, configured to execute computer instructions in the memory, and implement the method according to any one of claims 1 to 9 when executing the computer instructions.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 9.
21. A computer program product for a computer, characterized in that include: A software code portion, when the product is run on the computer, the software code portion is used to perform the method according to any one of claims 1 to 9.
22. The computer program product according to claim 21, characterized in that in, The computer program product comprises a computer readable medium having the software code portions stored thereon, and / or, The computer program product can be directly loaded into the internal memory of the computer and / or sent via a network through at least one of an upload process, a download process and a push process.
