CN113094047B - Method and device for processing webpage buttons, storage medium and processor - Google Patents

Method and device for processing webpage buttons, storage medium and processor Download PDF

Info

Publication number
CN113094047B
CN113094047B CN202110358364.7A CN202110358364A CN113094047B CN 113094047 B CN113094047 B CN 113094047B CN 202110358364 A CN202110358364 A CN 202110358364A CN 113094047 B CN113094047 B CN 113094047B
Authority
CN
China
Prior art keywords
verification
button
webpage
setting
webpage button
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110358364.7A
Other languages
Chinese (zh)
Other versions
CN113094047A (en
Inventor
张啸
朱明宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hillstone Networks Co Ltd
Original Assignee
Hillstone Networks Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hillstone Networks Co Ltd filed Critical Hillstone Networks Co Ltd
Priority to CN202110358364.7A priority Critical patent/CN113094047B/en
Publication of CN113094047A publication Critical patent/CN113094047A/en
Application granted granted Critical
Publication of CN113094047B publication Critical patent/CN113094047B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Debugging And Monitoring (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a method and a device for processing webpage buttons, a storage medium and a processor. The method comprises the following steps: setting an association component of a webpage button, and setting a target event for the association component; monitoring a target event of the associated component; if the target event of the associated component is triggered, calling a preset verification method of the webpage button to verify the verification method array of the webpage button to obtain a verification result; and setting the state of the webpage button based on the verification result, wherein the state of the webpage button is an enabled state or a disabled state. Through the method and the device, the problem that the state control on the webpage button assembly is complex in the front-end development process in the related technology, and the development efficiency is low is solved.

Description

Method and device for processing webpage buttons, storage medium and processor
Technical Field
The present application relates to the technical field of web page design, and in particular, to a method and an apparatus for processing a web page button, a storage medium, and a processor.
Background
In the design and development process of the front-end page, the interaction process of a user is more friendly. For a button component in a web page, we often dynamically design a display state of the component, for example, an edit button of table data, and usually the edit button needs to be switched to an enabled state when only one piece of data is selected, and is otherwise set to a disabled state. Such button assemblies are often used in multiple modules or function pages and the switching logic is nearly identical.
For these scenarios that require dynamic switching of button presentation states, three solutions of the prior art are proposed: firstly, in a page, writing codes to respectively control the display states of all buttons in the page according to service logic, for example, directly setting disable attributes of the buttons according to user interaction; secondly, based on a currently popular MVVM (Model-View w-ViewModel) development mode, for example, in front-end popular frameworks such as reach, Vue and Angular, a local variable can be defined in a code of each page, and the display state of a button is directly bound with the local variable, so that the value of the local variable is directly modified in different interactive logics, namely the state of the button can be changed; and thirdly, developing a custom button assembly, packaging specific interactive logic into the custom assembly to meet related business requirements, wherein the custom button assembly is usually customized, and is difficult to extract public parts and develop into public assemblies.
Aiming at the problem of low development efficiency caused by complicated state control of a webpage button assembly in the front-end development process in the related technology, an effective solution is not provided at present.
Disclosure of Invention
The present application mainly aims to provide a method, an apparatus, a storage medium, and a processor for processing a webpage button, so as to solve the problem of low development efficiency in the related art.
In order to achieve the above object, according to one aspect of the present application, there is provided a method for processing a webpage button. The method comprises the following steps: setting an association component of a webpage button, and setting a target event for the association component; monitoring a target event of the associated component; if the target event of the associated component is triggered, calling a preset verification method of the webpage button to verify the verification method array of the webpage button to obtain a verification result; and setting the state of the webpage button based on the verification result, wherein the state of the webpage button is an enabled state or a disabled state.
Further, before setting an association component of the webpage button and setting a target event for the association component, the method further comprises: and setting a global checking method pool, wherein the global checking method pool takes the character string as a main key, and the content in the global checking method pool is a function of the checking method.
Further, setting an association component of the webpage button, and setting a target event for the association component includes: and setting a check method array for the webpage button, wherein the target event is one of check method array members, and the type of the check method array member comprises a character string type or a function type.
Further, if the target event of the associated component is triggered, calling a preset verification method of the webpage button to verify the verification method array of the webpage button, and obtaining a verification result comprises: if the target event of the associated component is triggered, traversing the check method array of the webpage button, and acquiring the check method array member which is not checked; judging whether a verification method array member which does not execute verification exists or not, and if the verification method array member which does not execute verification exists, judging the data type of the member; if the data type of the member is the function type, determining that the verification method of the webpage button is a verification method array member, and verifying the verification method array of the webpage button based on the verification method array member to obtain a verification result; and if the data type of the member is the character string type, searching a verification method from the global verification method pool according to the content of the verification method array member of the webpage button, and verifying the verification method array of the webpage button based on the searched verification method to obtain a verification result.
Further, setting the state of the webpage button based on the verification result includes: if the verification result shows that the verification is successful, executing the step of obtaining the verification method array members which are not verified; and if the verification result shows that the verification fails, setting the state of the webpage button to be a forbidden state.
Further, after determining whether there is a checking method array member for which checking has not been performed, the method further includes: and if no verification method array member which does not execute verification is available, setting the state of the webpage button to be an enabled state.
In order to achieve the above object, according to another aspect of the present application, there is provided a processing apparatus for a webpage button. The device includes: the method comprises the following steps: the first setting unit is used for setting the association components of the webpage buttons and setting target events for the association components; the first monitoring unit is used for monitoring a target event of the associated component; the first calling unit is used for calling a preset verification method of the webpage button to verify the verification method array of the webpage button if the target event of the associated component is triggered, so as to obtain a verification result; and the second setting unit is used for setting the state of the webpage button based on the verification result, wherein the state of the webpage button is an enabled state or a disabled state.
Further, the apparatus further comprises: and the third setting unit is used for setting a global check method pool before setting the associated component of the webpage button and setting a target event for the associated component, wherein the global check method pool takes the character string as a main key, and the content in the global check method pool is a function of a check method.
Further, the first setting unit includes: the first setting module is used for setting a check method array for the webpage button, and the target event is used as one of the check method array members, wherein the type of the check method array member comprises a character string type or a function type.
Further, the first calling unit includes: the first acquisition module is used for traversing the check method array of the webpage button and acquiring the check method array members which are not checked if the target event of the associated component is triggered; the first judgment module is used for judging whether a verification method array member which does not execute verification exists or not, and judging the data type of the member if the verification method array member which does not execute verification exists; the first determining module is used for determining that the verification method of the webpage button is a verification method array member if the data type of the member is a function type, and verifying the verification method array of the webpage button based on the verification method array member to obtain a verification result; and the first searching module is used for searching the verification method from the global verification method pool according to the content of the verification method array member of the webpage button if the data type of the member is the character string type, and verifying the verification method array of the webpage button based on the searched verification method to obtain a verification result.
Further, the second setting unit includes: the first execution module is used for executing the step of obtaining the array members of the check method which is not checked yet if the check result shows that the check is successful; and the second setting module is used for setting the state of the webpage button to be a forbidden state if the verification result shows that the verification fails.
Further, the apparatus further comprises: and the fourth setting unit is used for setting the state of the webpage button to be an enabled state if the verification method array member which is not verified does not exist after judging whether the verification method array member which is not verified exists or not.
To achieve the above object, according to another aspect of the present application, there is provided a processor for executing a program, wherein the program executes to perform the method of any one of the above.
In order to achieve the above object, according to another aspect of the present application, there is provided a storage medium characterized in that the storage medium includes a stored program, wherein the program performs the method of any one of the above.
Through the application, the following steps are adopted: setting an association component of a webpage button, and setting a target event for the association component; monitoring a target event of the associated component; if the target event of the associated component is triggered, calling a preset verification method of the webpage button to verify the verification method array of the webpage button to obtain a verification result; and setting the state of the webpage button based on the verification result, wherein the state of the webpage button is an enabled state or a disabled state. The problem of among the prior art front end development process carry out state control to webpage button subassembly more loaded down with trivial details, lead to development efficiency lower is solved. The check method array of the webpage button is checked through a preset check method of the webpage button, the state of the webpage button is controlled based on a check result, front-end development codes are simplified, and the effect of improving development efficiency is achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
FIG. 1 is a flow chart of a method for processing a webpage button provided according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a main body distribution of a method for processing a webpage button according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for processing a webpage button according to an embodiment of the present application;
fig. 4 is a schematic diagram of a processing device for web page buttons according to an embodiment of the present application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all 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 application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an embodiment of the application, a method for processing webpage buttons is provided.
Fig. 1 is a flowchart of a method for processing a webpage button according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S101, setting the association component of the webpage button, and setting a target event for the association component.
In a software system, for example, the system may include lists for different functions, and corresponding functional web page buttons such as "add", "edit", and "delete" for the lists, perform setting of associated components according to the web page buttons for different functions, and set target events for the associated components.
For example, when the webpage button with the "add" function is performed on the list, a component required for the mouse to perform an action on a certain area may be set for the webpage button with the "add" function, for example, a target event set for the associated component may be a mouse frame selection completion event, and the target event is set for the webpage button, so that tracking and monitoring of the state of the subsequent webpage button are facilitated.
Fig. 2 is a main distribution flow chart of a processing method of a web page button provided according to an embodiment of the present application, and as shown in fig. 2, the web page button (corresponding to the button in fig. 2) monitors a specific target event of an associated component, and obtains a global check method from a global check method pool, and the global check function is returned from the global check method pool for executing a subsequent web page button check.
Optionally, in the method for processing a webpage button provided in the embodiment of the present application, before setting an association component of the webpage button and setting a target event for the association component, the method further includes: and setting a global checking method pool, wherein the global checking method pool takes the character string as a main key, and the content in the global checking method pool is a function of the checking method.
The content types in the global verification method pool are mainly character string types, and the commonly used verification method functions are predefined in the global verification method pool, so that resource sharing of the predefined verification method functions in the global verification method pool by a plurality of webpage buttons is realized, codes are simplified, and the development efficiency of front-end developers is improved.
Optionally, in the method for processing a web page button provided in the embodiment of the present application, setting an association component of the web page button, and setting a target event for the association component includes: and setting a check method array for the webpage button, wherein the target event is one of check method array members, and the type of the check method array member comprises a character string type or a function type.
The method comprises the steps that a check method array of a webpage button is checked, wherein a target event of the webpage button is used as one of members of the check method array, the array member comprises a character string type and a function type, and when the group members are the character string type, the webpage button selects a check method function of corresponding content from a global check method pool to be used as the member of the check method array. If the check method is used for checking the type of the character string of the array member, the method directly obtains the character string from the global check method pool, simplifies the code operation complexity of developers, and improves the development efficiency.
Step S102, monitoring the target event of the associated component.
The monitoring function is required to be added to the webpage button before the verification of the verification method array set for the webpage button, and the webpage button target event is tracked and monitored in real time through the monitoring function, so that the verification of the webpage button verification method array is conveniently executed subsequently.
Step S103, if the target event of the associated component is triggered, calling a preset verification method of the webpage button to verify the verification method array of the webpage button to obtain a verification result.
And step S104, setting the state of the webpage button based on the verification result, wherein the state of the webpage button is an enabled state or a disabled state.
Fig. 3 is a flowchart of a processing method of a web page button according to an embodiment of the present application, and as shown in fig. 3, when it is monitored that a target event of an associated component is triggered, optionally, in the processing method of a web page button provided in the embodiment of the present application, if the target event of the associated component is triggered, a preset verification method of the web page button is called to verify a verification method array of the web page button, and obtaining a verification result includes: if the target event of the associated component is triggered, traversing the check method array of the webpage button, and acquiring the check method array member which is not checked; judging whether a verification method array member which does not execute verification exists or not, and if the verification method array member which does not execute verification exists, judging the data type of the member; if the data type of the member is the function type, determining that the verification method of the webpage button is a verification method array member, and verifying the verification method array of the webpage button based on the verification method array member to obtain a verification result; and if the data type of the member is the character string type, searching a verification method from the global verification method pool according to the content of the verification method array member of the webpage button, and verifying the verification method array of the webpage button based on the searched verification method to obtain a verification result.
According to the method and the device, the preset verification method of the webpage button is called in the global verification method pool, so that the verification method array of the webpage button is verified, and therefore when developers process a large amount of identical or similar webpage button logic codes, the verification efficiency of webpage button processing is greatly improved.
For example, when processing a web page button of a list page, the predefined check methods in the global check method pool include: authority _ add: whether the current user has the addition authority, authority _ edge: whether the current user has the editing right, authority _ delete: whether the current user has the deletion authority or not, creator _ only: whether the current user is a creator, only _ one: whether the list is selected and only one item, at _ least _ one: whether the list has at least one item selected.
For example 1, when the webpage button is an "add" functional button, setting a target event of an associated component for the "add" button, and when it is found through a monitoring function that the event is triggered, checking a checking method array set by the "add" button is required, and a checking method array member set by the "add" button only includes "whether a current user has an adding permission".
And when the verification method array member set by the 'adding' button is the function type, determining the verification method of the webpage button as the verification method array member, and verifying the verification method array of the webpage button based on the verification method array member to obtain a verification result.
Optionally, in the method for processing a webpage button provided in the embodiment of the present application, setting the state of the webpage button based on the verification result includes: if the verification result shows that the verification is successful, executing the step of obtaining the verification method array members which are not verified; and if the verification result shows that the verification fails, setting the state of the webpage button to be a forbidden state.
Specifically, when the check method array member set by the add button is of a character string type, the check method is searched from the global check method pool according to the content of the check method array member of the webpage button, that is, the selected check method is authority _ add, if the current user has the add function right corresponding to the webpage button, the check result is successful, the check method array member which is not checked yet does not exist in the check method array of the webpage button, and the webpage button is displayed in an enabled state. Through the verification of the members of the check array one by one, the accuracy of the check result of the webpage button is further ensured.
That is, optionally, in the method for processing a webpage button provided in the embodiment of the present application, after determining whether there is a check method array member for which a check has not been performed, the method includes: and if no verification method array member which does not execute verification is available, setting the state of the webpage button to be an enabled state.
For example 2, when the webpage button is an "edit" functional button, the edit button is set for a target event of an associated component, and when the event is triggered through the monitoring function, the check method array set by the edit button needs to be checked, and the check method array set by the edit button includes "whether the current user has an editing right", "whether the list is selected and only one item is selected", and "whether the current user is a creator".
When the check method array member set by the edit button is of a character string type, a check method is searched from the global check method pool according to the contents of the check method array member of the webpage button, namely, the selected check method is authority _ edge, creator _ only and only _ one, if the current user has the editing function right corresponding to the webpage button, the check method array member which is not checked exists, whether the check method array member list is selected and only one is selected or not and whether the current user is a creator or not are continuously judged, if the check method array member check results are yes, the webpage button is displayed in an enabled state. And if any member checks that the result is 'no', displaying the webpage button in a forbidden state. Through the verification of the check array members one by one, if any member in the check method array members does not satisfy the corresponding check method, the webpage button state is the forbidden state, and the safety and reliability of the webpage button check result to the user webpage information are further guaranteed.
It should be noted that, when the above-mentioned exemplary webpage button is a "delete" functional button, the processing method is similar, and it is not described herein again, and by searching the verification method from the global verification method pool, the multiple webpage buttons can share the predefined verification method function in the global verification method pool, thereby simplifying the code and improving the development efficiency of the front-end developer.
In summary, in the processing method for the webpage button provided by the embodiment of the present application, by setting the association component of the webpage button, and setting the target event for the association component; monitoring a target event of the associated component; if the target event of the associated component is triggered, calling a preset verification method of the webpage button to verify the verification method array of the webpage button to obtain a verification result; and setting the state of the webpage button based on the verification result, wherein the state of the webpage button is an enabled state or a disabled state. The problem of among the prior art front end development process carry out state control to webpage button subassembly more loaded down with trivial details, lead to development efficiency lower is solved. The check method array of the webpage button is checked through a preset check method of the webpage button, the state of the webpage button is controlled based on a check result, front-end development codes are simplified, and the effect of improving development efficiency is achieved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The embodiment of the present application further provides a processing apparatus for a webpage button, and it should be noted that the processing apparatus for a webpage button of the embodiment of the present application may be used to execute the processing method for a webpage button provided in the embodiment of the present application. The following describes a processing apparatus for a web page button according to an embodiment of the present application.
Fig. 4 is a schematic diagram of a processing device for web page buttons according to an embodiment of the present application. As shown in fig. 4, the apparatus includes: the device comprises a first setting unit 401, a first monitoring unit 402, a first calling unit 403 and a second setting unit 404.
Specifically, the first setting unit 401 is configured to set an association component of a webpage button, and set a target event for the association component;
a first listening unit 402, configured to listen for a target event of an associated component;
the first calling unit 403 is configured to, if a target event of the associated component is triggered, call a preset verification method of the web page button to verify the verification method array of the web page button, and obtain a verification result;
a second setting unit 404, configured to set a state of the web page button based on the verification result, where the state of the web page button is an enabled state or a disabled state.
To sum up, the processing apparatus for a web page button provided in the embodiment of the present application sets an association component of the web page button through the first setting unit 401, and sets a target event for the association component; the first listening unit 402 listens for a target event of an associated component; if the target event of the associated component is triggered, the first calling unit 403 calls a preset verification method of the webpage button to verify the verification method array of the webpage button to obtain a verification result; the second setting unit 404 sets the state of the webpage button based on the verification result, wherein the state of the webpage button is an enabled state or a disabled state, and the problem of low development efficiency caused by complicated state control on the webpage button component in the front-end development process in the related art is solved. The check method array of the webpage button is checked through the preset check method of the webpage button, the state of the webpage button is controlled based on the check result, front-end development codes are simplified, and the effect of improving development efficiency is achieved.
Optionally, in the apparatus for processing a webpage button provided in the embodiment of the present application, the apparatus further includes: and the third setting unit is used for setting a global checking method pool before setting the association component of the webpage button and setting a target event for the association component, wherein the global checking method pool takes the character string as a main key, and the content in the global checking method pool is a function of a checking method.
Optionally, in the processing apparatus for web page buttons provided in the embodiment of the present application, the first setting unit 401 includes: the first setting module is used for setting a check method array for the webpage button, and the target event is used as one of the check method array members, wherein the type of the check method array member comprises a character string type or a function type.
Optionally, in the processing apparatus for web page buttons provided in the embodiment of the present application, the first invoking unit 403 includes: the first acquisition module is used for traversing the check method array of the webpage button and acquiring the check method array members which are not checked if the target event of the associated component is triggered; the first judgment module is used for judging whether a verification method array member which does not execute verification exists or not, and judging the data type of the member if the verification method array member which does not execute verification exists; the first determining module is used for determining that the verification method of the webpage button is a verification method array member if the data type of the member is a function type, and verifying the verification method array of the webpage button based on the verification method array member to obtain a verification result; and the first searching module is used for searching the verification method from the global verification method pool according to the content of the verification method array member of the webpage button if the data type of the member is the character string type, and verifying the verification method array of the webpage button based on the searched verification method to obtain a verification result.
Optionally, in the processing apparatus for web page buttons provided in the embodiment of the present application, the second setting unit 404 includes: the first execution module is used for executing the step of obtaining the array members of the check method which is not checked yet if the check result shows that the check is successful; and the second setting module is used for setting the state of the webpage button to be a forbidden state if the verification result shows that the verification fails.
Optionally, in the apparatus for processing a webpage button provided in the embodiment of the present application, the apparatus further includes: and the fourth setting unit is used for setting the state of the webpage button to be an enabled state if the verification method array member which is not verified does not exist after judging whether the verification method array member which is not verified exists or not.
The processing device of the webpage button comprises a processor and a memory, the first setting unit 401, the first monitoring unit 402, the first calling unit 403, the second setting unit 404 and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the processing of the webpage buttons is carried out by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium having a program stored thereon, the program implementing a processing method of a webpage button when being executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein a processing method of a webpage button is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps: setting an association component of a webpage button, and setting a target event for the association component; monitoring a target event of the associated component; if the target event of the associated component is triggered, calling a preset verification method of the webpage button to verify the verification method array of the webpage button to obtain a verification result; and setting the state of the webpage button based on the verification result, wherein the state of the webpage button is an enabled state or a disabled state.
The processor executes the program and further realizes the following steps: setting a global checking method pool before setting an association component of a webpage button and setting a target event for the association component, wherein the global checking method pool takes a character string as a main key, and the content in the global checking method pool is a function of a checking method.
The processor executes the program and further realizes the following steps: and setting a check method array for the webpage button, wherein the target event is one of the check method array members, and the types of the check method array members comprise character string types or function types.
The processor executes the program and further realizes the following steps: if the target event of the associated component is triggered, traversing the check method array of the webpage button, and acquiring the check method array member which is not checked; judging whether a verification method array member which does not execute verification exists or not, and if the verification method array member which does not execute verification exists, judging the data type of the member; if the data type of the member is the function type, determining that the verification method of the webpage button is a verification method array member, and verifying the verification method array of the webpage button based on the verification method array member to obtain a verification result; and if the data type of the member is the character string type, searching a verification method from the global verification method pool according to the content of the verification method array member of the webpage button, and verifying the verification method array of the webpage button based on the searched verification method to obtain a verification result.
The processor executes the program and further realizes the following steps: if the verification result shows that the verification is successful, executing the step of obtaining the verification method array members which are not verified; and if the verification result shows that the verification fails, setting the state of the webpage button to be a forbidden state.
The processor executes the program and further realizes the following steps: after judging whether a verification method array member which does not execute verification exists or not, if the verification method array member which does not execute verification does not exist, setting the state of the webpage button to be an enabling state.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application also provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device: setting an association component of a webpage button, and setting a target event for the association component; monitoring a target event of the associated component; if the target event of the associated component is triggered, calling a preset verification method of the webpage button to verify the verification method array of the webpage button to obtain a verification result; and setting the state of the webpage button based on the verification result, wherein the state of the webpage button is an enabled state or a disabled state.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: setting a global checking method pool before setting an association component of a webpage button and setting a target event for the association component, wherein the global checking method pool takes a character string as a main key, and the content in the global checking method pool is a function of a checking method.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: and setting a check method array for the webpage button, wherein the target event is one of check method array members, and the type of the check method array member comprises a character string type or a function type.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: if the target event of the associated component is triggered, traversing the check method array of the webpage button, and acquiring the check method array member which is not checked; judging whether a verification method array member which does not execute verification exists or not, and if the verification method array member which does not execute verification exists, judging the data type of the member; if the data type of the member is the function type, determining that the verification method of the webpage button is a verification method array member, and verifying the verification method array of the webpage button based on the verification method array member to obtain a verification result; and if the data type of the member is the character string type, searching a verification method from the global verification method pool according to the content of the verification method array member of the webpage button, and verifying the verification method array of the webpage button based on the searched verification method to obtain a verification result.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: if the verification result shows that the verification is successful, executing the step of obtaining the verification method array members which are not verified; and if the verification result shows that the verification fails, setting the state of the webpage button to be a forbidden state.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: after judging whether a verification method array member which does not execute verification exists or not, if the verification method array member which does not execute verification does not exist, setting the state of the webpage button to be an enabling state.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (9)

1. A method for processing webpage buttons is characterized by comprising the following steps:
setting an association component of a webpage button, and setting a target event for the association component;
monitoring a target event of the association component;
if the target event of the associated component is triggered, calling a preset verification method of the webpage button to verify the verification method array of the webpage button to obtain a verification result;
setting the state of the webpage button based on the verification result, wherein the state of the webpage button is an enabled state or a disabled state;
if the target event of the associated component is triggered, traversing the check method array of the webpage button to obtain the check method array members which are not checked;
judging whether a verification method array member which does not execute verification exists or not, and if the verification method array member which does not execute verification exists, judging the data type of the member;
if the data type of the member is a function type, determining that the verification method of the webpage button is the verification method array member, and verifying the verification method array of the webpage button based on the verification method array member to obtain the verification result;
and if the data type of the member is the character string type, searching a verification method from a global verification method pool according to the content of the verification method array member of the webpage button, and verifying the verification method array of the webpage button based on the searched verification method to obtain the verification result.
2. The method of claim 1, wherein prior to setting an association component of a web page button and targeting the association component, the method further comprises:
setting a global checking method pool, wherein the global checking method pool takes a character string as a main key, and the content in the global checking method pool is a function of a checking method.
3. The method of claim 2, wherein setting an association component of a web page button and targeting the association component comprises:
and setting a check method array for the webpage button, wherein the target event is one of check method array members, and the types of the check method array members comprise character string types or function types.
4. The method of claim 1, wherein setting the state of the webpage button based on the verification result comprises:
if the check result indicates that the check is successful, executing a step of acquiring the check method array members which do not execute the check;
and if the verification result shows that the verification fails, setting the state of the webpage button to be a forbidden state.
5. The method of claim 1, wherein after determining whether there are check method array members for which no check has been performed, the method further comprises:
and if no verification method array member which is not verified yet exists, setting the state of the webpage button to be an enabled state.
6. A web page button processing apparatus, comprising:
the first setting unit is used for setting the association component of the webpage button and setting a target event for the association component;
the first monitoring unit is used for monitoring a target event of the associated component;
the first calling unit is used for calling a preset verification method of the webpage button to verify the verification method array of the webpage button to obtain a verification result if a target event of the associated component is triggered;
the second setting unit is used for setting the state of the webpage button based on the verification result, wherein the state of the webpage button is an enabled state or a disabled state;
wherein the first calling unit comprises: the first acquisition module is used for traversing the check method array of the webpage button and acquiring the check method array members which are not checked if the target event of the associated component is triggered; the first judgment module is used for judging whether a verification method array member which does not execute verification exists or not, and judging the data type of the member if the verification method array member which does not execute verification exists; the first determining module is used for determining that the verification method of the webpage button is a verification method array member if the data type of the member is a function type, and verifying the verification method array of the webpage button based on the verification method array member to obtain a verification result; and the first searching module is used for searching the verification method from the global verification method pool according to the content of the verification method array member of the webpage button if the data type of the member is the character string type, and verifying the verification method array of the webpage button based on the searched verification method to obtain a verification result.
7. The apparatus of claim 6, further comprising:
and the third setting unit is used for setting a global checking method pool before setting the association component of the webpage button and setting a target event for the association component, wherein the global checking method pool takes the character string as a main key, and the content in the global checking method pool is a function of a checking method.
8. A processor, characterized in that the processor is configured to run a program, wherein the program when running performs the method of any of claims 1 to 5.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program performs the method of any one of claims 1 to 5.
CN202110358364.7A 2021-04-01 2021-04-01 Method and device for processing webpage buttons, storage medium and processor Active CN113094047B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110358364.7A CN113094047B (en) 2021-04-01 2021-04-01 Method and device for processing webpage buttons, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110358364.7A CN113094047B (en) 2021-04-01 2021-04-01 Method and device for processing webpage buttons, storage medium and processor

Publications (2)

Publication Number Publication Date
CN113094047A CN113094047A (en) 2021-07-09
CN113094047B true CN113094047B (en) 2022-09-06

Family

ID=76672869

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110358364.7A Active CN113094047B (en) 2021-04-01 2021-04-01 Method and device for processing webpage buttons, storage medium and processor

Country Status (1)

Country Link
CN (1) CN113094047B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113362173A (en) * 2021-06-03 2021-09-07 中国工商银行股份有限公司 Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113362173A (en) * 2021-06-03 2021-09-07 中国工商银行股份有限公司 Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于MES的注塑企业生产监视及统计分析系统设计与开发;李春;《中国优秀硕士学位论文全文数据库》;20170315;第42-43页 *

Also Published As

Publication number Publication date
CN113094047A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
CN107450981B (en) Block chain consensus method and equipment
CN107038042B (en) Service execution method and device
CN108268609B (en) File path establishing and accessing method and device
CN107066519B (en) Task detection method and device
CN107016282B (en) information processing method and device
US10776180B1 (en) Expression-based feature toggle in an application programming interface (API)
CN109582305B (en) Encoding method and device for mobile application page elements and electronic equipment
CN108874379B (en) Page processing method and device
CN111125650A (en) Page access right processing method and device, storage medium and processor
CN110941428A (en) Website creation method and device
CN110046100B (en) Packet testing method, electronic device and medium
CN113434063B (en) Information display method, device and equipment
CN111190692A (en) Monitoring method and system based on Roc processor and readable medium
CN110837446A (en) Equipment management method and device applied to embedded system, medium and embedded equipment
CN113094047B (en) Method and device for processing webpage buttons, storage medium and processor
CN111381745B (en) Page switching method, device and equipment
CN111367577A (en) Method, device and terminal for loading plug-in of application
CN111078435A (en) Service processing method and device and electronic equipment
CN107368486B (en) Service migration method and device
CN110968373A (en) Page switching implementation method and device, storage medium and processor
CN110874322A (en) Test method and test server for application program
CN113176988B (en) Data recording method and device
CN111651160B (en) Plug-in construction and webpage design method and device
CN114217697A (en) Multi-screen input method and device, electronic equipment and computer readable storage medium
CN114238934A (en) Equipment information acquisition method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant