Disclosure of Invention
The invention discloses a method, a device, equipment and a storage medium for updating webpage form data, which aim to solve the problem that other input data disappear due to webpage refreshing and realize the controllable refreshing of local data. The technical scheme is as follows:
in a first aspect, the present invention provides a page table single data updating method, including:
acquiring control information of a target drop-down box in a webpage form;
according to the control information of the target drop-down box, adding control information of an interactive button in the control information of the target drop-down box through a webpage scripting language, and updating the control information of the target drop-down box;
monitoring the interactive button of the target drop-down frame according to the updated control information of the target drop-down frame;
when the triggering operation aiming at the interactive button is monitored, acquiring the response information of the interactive button;
sending a target data acquisition request according to the response information;
acquiring target data responding to the target data acquisition request, and taking the target data as update data of the target drop-down box;
backfilling the updating data into the list of the target drop-down box, and updating the list content of the target drop-down box.
Further, the monitoring the interactive button of the target drop-down box according to the updated control information of the target drop-down box includes:
setting a monitoring event for an interactive button of the target drop-down frame by calling a javascript method;
and when the single-click operation aiming at the interactive button is monitored, implementing the response event of the interactive button.
Further, when the trigger operation for the interactive button is monitored, the acquiring the response information of the interactive button includes:
acquiring background logic of the interactive button according to the control information of the interactive button;
the background logic of the interactive button comprises:
acquiring control information of the updated target drop-down box;
obtaining control parameters and path parameters of a data source of the target drop-down box according to the updated control information of the target drop-down box;
acquiring the content of the data source according to the control parameter and the path parameter of the data source;
and processing the background logic to obtain the response information of the interactive button.
Further, the sending the target data acquisition request according to the response information includes:
according to the response information, sending a target data acquisition request to the local webpage form and/or a related webpage form of the webpage form;
and/or sending a target data acquisition request to the server according to the response information.
Further, backfilling the update data into the list of target drop-down boxes, wherein updating the list content of the target drop-down boxes comprises:
deleting the current list content of the target drop-down box;
reading the updating data to obtain the data hierarchy of the updating data;
backfilling the updating data into the list of the target drop-down box according to the type of the target drop-down box and the data level of the updating data, and updating the list content of the target drop-down box.
In a second aspect, the present invention provides a page table single data updating method, including:
receiving a target data acquisition request;
acquiring control parameters and path parameters of a data source of target data according to the target data acquisition request;
acquiring the content of the data source according to the control parameter and the path parameter of the data source, and taking the content of the data source as the target data;
transmitting the target data in response to the target data acquisition request.
In a third aspect, the present invention provides an apparatus for updating data of a web form, where the apparatus includes:
the first acquisition module is used for acquiring control information of a target drop-down box in a webpage form;
the adding module is used for adding control information of an interactive button in the control information of the target drop-down box through a webpage scripting language according to the control information of the target drop-down box and updating the control information of the target drop-down box;
the monitoring module is used for monitoring the interactive button of the target drop-down box according to the updated control information of the target drop-down box;
the second acquisition module is used for acquiring response information of the interactive button when the triggering operation aiming at the interactive button is monitored;
the request module is used for sending a target data acquisition request according to the response information;
a third obtaining module, configured to obtain target data in response to the target data obtaining request, and use the target data as update data of the target drop-down box;
and the updating module is used for backfilling the updating data into the list of the target drop-down box and updating the list content of the target drop-down box.
Further, the request module includes:
the local request module is used for sending a target data acquisition request to the local webpage form and/or a related webpage form of the webpage form according to the response information;
and/or the server request module is used for sending a target data acquisition request to the server according to the response information.
Further, the third obtaining module includes:
a local obtaining module, configured to obtain request data stored locally and responding to the data request, and use the request data as update data of the target drop-down box;
and/or the server acquisition module is used for acquiring request data which is stored in the server and responds to the data request, and taking the request data as the update data of the target drop-down box.
In a fourth aspect, the present invention provides an apparatus for updating data of a web form, where the apparatus includes:
the receiving module is used for receiving a target data acquisition request;
the first acquisition module is used for acquiring control parameters and path parameters of the target data according to the target data acquisition request;
the second obtaining module is used for obtaining the target data according to the control parameters and the path parameters;
a sending module for sending the target data in response to the target data request.
In a fifth aspect, the present invention provides a computer device comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a set of codes, or a set of instructions, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the web form data updating method of the first aspect and the second aspect.
In a sixth aspect, the present invention provides a computer-readable storage medium, in which at least one instruction, at least one program, a set of codes, or a set of instructions is stored, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by a processor to implement the web form data updating method according to the first aspect and the second aspect.
By adopting the technical scheme, the method, the device, the equipment and the storage medium for updating the webpage form data have the following beneficial effects:
according to the method and the device, the interactive button is added in the drop-down box control to realize the controllable refreshing of the drop-down box list content, the whole page does not need to be refreshed, and the disappearance of the recorded other data caused by refreshing the whole page is avoided. Meanwhile, the problem of resource waste caused by frequent access to the server during automatic refreshing in the prior art can be effectively solved by the controllable refreshing of the local data.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Reference herein to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic may be included in at least one implementation of the invention. In describing the present invention, it is to be understood that the terms "first," "second," "third," and "fourth," etc. in the description and claims of the present invention and the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include additional steps or elements not listed
Or alternatively, may comprise other steps or elements inherent to such processes, methods, articles, or devices.
Fig. 1 is a schematic flow chart of a method for providing data of a web form according to an embodiment of the present invention, and the present specification provides the method operation steps according to the embodiment or the schematic flow chart, but more or less operation steps may be included based on conventional or non-creative labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. In practice, the system or server product may be implemented in a sequential or parallel manner (e.g., parallel processor or multi-threaded environment) according to the embodiments or methods shown in the figures. Specifically, as shown in fig. 1, the method for updating web form data may include:
s110: and acquiring control information of a target drop-down box in the webpage form.
S120: and according to the control information of the target drop-down box, adding control information of an interactive button in the control information of the target drop-down box through a webpage scripting language, and updating the control information of the target drop-down box.
It is to be appreciated that the interactive button is part of the target drop-down box component, and the control information of the interactive button is added to the control information of the target drop-down box to update the control information of the target drop-down box.
In some possible embodiments, the adding of the interactive button and the updating of the control information are implemented by hypertext Markup Language (HTML). The hypertext markup language is an application under the standard universal markup language, and is a specification, a standard, that marks various parts of a web page to be displayed by markup symbols. The web page file is a text file, and by adding a marker in the text file, the browser can be informed of how to display the contents (such as how to process words, how to arrange pictures, how to display pictures, etc.). The browser reads the web page files in sequence and then interprets and displays the contents of its markup according to the markup.
It is understood that the style, position, and other attributes of the interactive button used for refreshing the data of the target drop-down box are not limited herein.
S130: and monitoring the interactive button of the target drop-down frame according to the updated control information of the target drop-down frame.
In some possible embodiments, the monitoring the interactive button of the target drop-down box according to the updated control information of the target drop-down box includes:
setting a monitoring event for an interactive button of the target drop-down frame by calling a javascript method;
and when the single-click operation aiming at the interactive button is monitored, implementing the response event of the interactive button.
It is understood that different program languages may be selected or different function methods may be called to set a listening event for the interactive button for different types of terminals and web page applications.
It can be understood that, in the design of the front end of the web page, the trigger operation for the button is generally designed as a single-click operation, and of course, other trigger operations may be designed according to the actual application scenario.
S140: and when the triggering operation aiming at the interactive button is monitored, acquiring the response information of the interactive button.
In some possible embodiments, the obtaining the response information of the interactive button when the triggering operation for the interactive button is monitored includes:
acquiring background logic of the interactive button according to the control information of the interactive button;
the background logic of the interactive button comprises:
acquiring control information of the updated target drop-down box;
obtaining control parameters and path parameters of a data source of the target drop-down box according to the updated control information of the target drop-down box;
acquiring the content of the data source according to the control parameter and the path parameter of the data source;
and processing the background logic to obtain the response information of the interactive button.
It will be appreciated that in a form, the target drop-down box is associated with other controls, such as other text boxes, check boxes, etc., whose contents are the data source of the target drop-down box. When the pull-down menu of the target pull-down box is clicked for the first time, the system interacts with the server to obtain the data content of other controls related to the target pull-down box, and fills the data content into the list of the target pull-down box.
It can be understood that the background logic of the interactive button is derived from the control information of the target drop-down box, the control parameter and the path parameter in the background logic indicate parameters of other controls associated with the target drop-down box, and the content of the data source can be obtained according to the spatial parameter and the path parameter.
S150: and sending a target data acquisition request according to the response information.
In some possible embodiments, the sending the target data obtaining request according to the response information includes:
according to the response information, sending a target data acquisition request to the local webpage form and/or a related webpage form of the webpage form;
and/or sending a target data acquisition request to the server according to the response information.
It can be understood that, during the filling-in process of the form, the data source of the target drop-down box and the target drop-down box may be in the same web form or in different web forms. If the data source of the target drop-down box is updated, the content of the updated data source, namely the target data, may be cached in the local space, and may also be uploaded to and stored in the server. For the different storage modes, different data acquisition request modes are correspondingly available.
S160: and acquiring target data responding to the target data acquisition request, and taking the target data as the update data of the target drop-down box.
It is understood that, for the different target data acquisition requests, there are corresponding different target data acquisition modes.
S170: backfilling the updating data into the list of the target drop-down box, and updating the list content of the target drop-down box.
In some possible embodiments, the backfilling the update data into the list of target drop-down boxes, the updating the list content of the target drop-down boxes including:
deleting the current list content of the target drop-down box;
reading the updating data to obtain the data hierarchy of the updating data;
backfilling the updating data into the list of the target drop-down box according to the type of the target drop-down box and the data level of the updating data, and updating the list content of the target drop-down box.
In some possible embodiments, the current data content of the target drop-down box is compared with the updated data to add or delete the data content, so as to obtain the updated list content of the target drop-down box.
It is understood that the data source of the drop-down box in the form may relate to a cascade of data or differ from the data hierarchy, and besides the updated data content of the data source of the target drop-down box, the hierarchical relationship between the data contents is also required to be acquired.
Fig. 2 and fig. 3 are schematic diagrams of actual application scenarios of a method for updating web form data according to an embodiment of the present invention. Fig. 2 is a web form diagram of a target data in a web form data updating method according to an embodiment of the present invention. As shown in fig. 2, in the department management page, if a user adds a personnel department, when the user switches to the personnel management page to perform related operations, the user needs to refresh the whole page to obtain updated department information, which easily causes disappearance of other entered information. Fig. 3 is a web form diagram where a target drop-down box of a web form data updating method according to an embodiment of the present invention is located. As shown in FIG. 3, an interactive button is added on one side of the drop-down box for refreshing the data of the drop-down box. When the user clicks the pull-down menu of the pull-down box for the first time, the information of the personnel department is not seen, and the department information can be updated on the personnel management page by clicking the interactive button on the right side. At this time, if the user has already entered the information of the newly added person before clicking the interactive button, the information of the newly added person does not disappear due to the refresh operation. Because the interactive buttons enable partial refreshing of data, but do not refresh the data of the entire people managed page.
Fig. 4 is a flowchart of a method for updating web form data according to an embodiment of the present invention, and the present specification provides the method operation steps according to the embodiment or the flowchart, but more or less operation steps may be included based on conventional or non-creative labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. In practice, the system or server product may be implemented in a sequential or parallel manner (e.g., parallel processor or multi-threaded environment) according to the embodiments or methods shown in the figures. Specifically, as shown in fig. 4, the method for updating the web form data may include:
s210: a target data acquisition request is received.
It is to be understood that the web form data update method as shown in fig. 4 is a method applied to the server side.
In some possible embodiments, the target data of the target drop-down box is stored in the server, and when the interactive button is clicked, the web application sends a target data acquisition request to the server.
S220: and acquiring control parameters and path parameters of a data source of the target data according to the target data acquisition request.
It can be understood that the position of the web form where the data source of the target data is located can be located according to the control parameter and the path parameter.
S230: and acquiring the content of the data source according to the control parameter and the path parameter of the data source, and taking the content of the data source as the target data.
It is understood that the data source of the target drop-down box may relate to a cascade of data or may be different from the data hierarchy, and besides the updated data content of the data source of the target drop-down box, the hierarchical relationship between the data contents is also required to be acquired.
S240: transmitting the target data in response to the target data acquisition request.
An embodiment of the present invention further provides a device-1 for updating web form data, as shown in fig. 5, where the device-1 for updating web form data includes:
the first obtaining module 101 is configured to obtain control information of a target drop-down box in a web form.
And the adding module 102 is configured to add control information of an interactive button in the control information of the target drop-down box through a web page scripting language according to the control information of the target drop-down box, and update the control information of the target drop-down box.
And the monitoring module 103 is configured to monitor the interactive button of the target drop-down box according to the updated control information of the target drop-down box.
In some possible embodiments, the monitoring module 103 performs monitoring on the interaction button of the target drop-down box according to the updated control information of the target drop-down box, including:
setting a monitoring event for an interactive button of the target drop-down frame by calling a javascript method;
and when the single-click operation aiming at the interactive button is monitored, implementing the response event of the interactive button.
A second obtaining module 104, configured to obtain response information of the interactive button when the triggering operation for the interactive button is monitored.
In some possible embodiments, the second obtaining module 104, when monitoring the triggering operation for the interactive button, obtains the response information of the interactive button by:
acquiring background logic of the interactive button according to the control information of the interactive button;
the background logic of the interactive button comprises:
acquiring control information of the updated target drop-down box;
obtaining control parameters and path parameters of a data source of the target drop-down box according to the updated control information of the target drop-down box;
acquiring the content of the data source according to the control parameter and the path parameter of the data source;
and processing the background logic to obtain the response information of the interactive button.
A request module 105, configured to send a target data obtaining request according to the response information.
In some possible implementations, the request module 105 includes:
a local request module 1051, configured to send a target data acquisition request to the local web form and/or a web form associated with the web form according to the response information;
and/or, a server request module 1052, configured to send a target data obtaining request to the server according to the response information.
A third obtaining module 106, configured to obtain target data in response to the target data obtaining request, and use the target data as update data of the target drop-down box.
In some possible implementations, the third obtaining module 106 includes:
a local obtaining module 1061, configured to obtain request data stored locally and responding to the data request, and use the request data as update data of the target drop-down box;
and/or, the server obtaining module 1062 is configured to obtain request data stored in the server and responding to the data request, and use the request data as update data of the target drop-down box.
And the updating module 107 is configured to backfill the update data into the list of the target drop-down box, and update the list content of the target drop-down box.
In some possible implementations, the update module 107 backfills the update data into the list of target drop-down boxes, and updating the list contents of the target drop-down boxes includes:
deleting the current list content of the target drop-down box;
reading the updating data to obtain the data hierarchy of the updating data;
backfilling the updating data into the list of the target drop-down box according to the type of the target drop-down box and the data level of the updating data, and updating the list content of the target drop-down box.
The web form data updating apparatus-1 and the web form data updating method according to the embodiments of the present invention are based on the same inventive concept, and please refer to the method embodiment for details, which is not described herein again.
An embodiment of the present invention further provides a device-2 for updating web form data, and as shown in fig. 6, the device-2 for updating web form data includes:
the receiving module 201 is configured to receive a target data obtaining request.
A first obtaining module 202, configured to obtain a control parameter and a path parameter of the target data according to the target data obtaining request.
And a second obtaining module 203, configured to obtain the target data according to the control parameter and the path parameter.
A sending module 204, configured to send the target data in response to the target data request.
The web form data updating apparatus-2 and the web form data updating method according to the embodiments of the present invention are based on the same inventive concept, and please refer to the method embodiment for details, which is not described herein again.
An embodiment of the present invention further provides a computer device, where the computer device includes: a processor and a memory, the memory having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by the processor to implement a web form data update method according to an embodiment of the present invention.
The memory may be used to store software programs and modules, and the processor may execute various functional applications by executing the software programs and modules stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs needed by functions and the like; the storage data area may store data created according to use of the apparatus, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory may also include a memory controller to provide the processor access to the memory.
The method embodiments provided by the embodiments of the present invention may be executed in a computer terminal, a server, or a similar computing device, that is, the computer device may include a computer terminal, a server, or a similar computing device. Fig. 7 is a block diagram of a hardware structure of a computer device running a method for updating web form data according to an embodiment of the present invention, and as shown in fig. 7, the internal structure of the computer device may include, but is not limited to: a processor, a network interface, and a memory. The processor, the network interface, and the memory in the computer device may be connected by a bus or in other manners, and fig. 7 shown in the embodiment of the present specification is exemplified by being connected by a bus.
The processor (or CPU) is a computing core and a control core of the computer device. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI, mobile communication interface, etc.). Memory (Memory) is a Memory device in a computer device used to store programs and data. It is understood that the memory herein may be a high-speed RAM storage device, or may be a non-volatile storage device (non-volatile memory), such as at least one magnetic disk storage device; optionally, at least one memory device located remotely from the processor. The memory provides storage space that stores an operating system of the electronic device, which may include, but is not limited to: a Windows system (an operating system), a Linux system (an operating system), an Android system, an IOS system, etc., which are not limited in the present invention; also, one or more instructions, which may be one or more computer programs (including program code), are stored in the memory space and are adapted to be loaded and executed by the processor. In this embodiment of the present specification, the processor loads and executes one or more instructions stored in the memory to implement the method for updating data of a web form provided in the foregoing method embodiment.
The embodiment of the present invention further provides a computer storage medium, where at least one instruction, at least one program, a code set, or an instruction set is stored in the storage medium, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded by a processor and executes the method for updating data of a web form according to the embodiment of the present invention.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus, system and server embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.