CN116954795A - Page view component control method and device, storage medium and computer equipment - Google Patents

Page view component control method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN116954795A
CN116954795A CN202310810779.2A CN202310810779A CN116954795A CN 116954795 A CN116954795 A CN 116954795A CN 202310810779 A CN202310810779 A CN 202310810779A CN 116954795 A CN116954795 A CN 116954795A
Authority
CN
China
Prior art keywords
state machine
state
page view
information
view component
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.)
Pending
Application number
CN202310810779.2A
Other languages
Chinese (zh)
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.)
Kangjian Information Technology Shenzhen Co Ltd
Original Assignee
Kangjian Information Technology Shenzhen 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 Kangjian Information Technology Shenzhen Co Ltd filed Critical Kangjian Information Technology Shenzhen Co Ltd
Priority to CN202310810779.2A priority Critical patent/CN116954795A/en
Publication of CN116954795A publication Critical patent/CN116954795A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • 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
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4498Finite state machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching

Abstract

The invention discloses a control method, a control device, a storage medium and computer equipment of a page view component, which are applied to terminal equipment provided with a state machine and relate to the technical field of computers and digital medical treatment. The method comprises the following steps: responding to input information of the terminal equipment, executing a state machine event method corresponding to the input information, so that a state machine performs a preset state switching action corresponding to the state machine event method, wherein the state switching action is used for enabling the state of the state machine to be converted from a pre-migration state to a post-migration state; monitoring state machine variable information of a state machine, and judging whether the result of an expression of a pre-bound preset attribute in a page view component is true according to the state machine variable information, wherein the preset attribute comprises an opening attribute and a forbidden attribute; if the expression of the preset attribute of the page view component is true, the page view component enables the preset attribute. The method can improve the interaction efficiency of the page view component.

Description

Page view component control method and device, storage medium and computer equipment
Technical Field
The present invention relates to the field of computer and digital medical technology, and in particular, to a control method and apparatus for a page view component, a storage medium, and a computer device.
Background
With the rapid development of the internet technology, consumer electronics and digital medical services, the demands of the public on internet pages are also increasing, and at the same time, in order to meet the increasing demands of the public on digital medical services, the front-end development technology for digital medical services page development is also becoming more complex. However, in the current front-end development technology, the problem that the interaction efficiency between page view components is too low due to the complex interaction logic of the page view components and the high coupling between the page view components in code development is faced, and the efficiency of front-end development is seriously reduced due to the problem, so that pages of more medical services cannot be generated in a short time, and the timeliness requirement of the public on acquisition of medical information when on-line purchase of medical services and medical problem consultation cannot be met.
At present, along with the development of front-end and back-end development separation ideas and the maturation of low-code development technologies, when the problems are faced, a general basic component is mostly used, a front-end page view component is directly linked with a back-end, and the display and interaction of the page view component are controlled based on the data interaction of the front-end and the back-end, so that the layout development visualized in a page dragging and dropping mode is realized.
However, the problems of complicated development of the view components, low code multiplexing and the like in the front-end development process are effectively solved by the mode. However, when the interaction process of the front-end page view components is performed, the interaction process between the page view components needs to be processed by the back-end, and only the pre-agreed simple interaction actions can be completed. In addition, in interacting logic with complex page view components, secondary development is often required to achieve interaction of the components. Therefore, the interaction mode seriously reduces the interaction efficiency between page view components, and further reduces the working efficiency of front-end development.
Disclosure of Invention
In view of this, the application provides a control method, a device, a storage medium and a computer device for a page view component, which mainly aims to solve the technical problem that interaction efficiency between page view components is too low in front-end development work.
According to a first aspect of the present application, there is provided a control method of a page view component applied to a terminal device provided with a state machine, the method comprising:
responding to input information of the terminal equipment, executing a state machine event method corresponding to the input information, and enabling the state machine to perform a preset state switching action corresponding to the state machine event method, wherein the state switching action is used for enabling the state of the state machine to be converted from a pre-migration state to a post-migration state;
Monitoring state machine variable information of the state machine, and judging whether the result of an expression of a pre-bound preset attribute in the page view component is true according to the state machine variable information, wherein the preset attribute comprises an opening attribute and a forbidden attribute;
and if the result of the expression of the preset attribute of the page view component is true, enabling the preset attribute by the page view component.
According to a second aspect of the present invention, there is provided a control apparatus for a page view assembly, the apparatus comprising:
the switching execution module is used for responding to the input information of the terminal equipment and executing a state machine event method corresponding to the input information so as to enable the state machine to perform a preset state switching action corresponding to the state machine event method, wherein the state switching action is used for enabling the state of the state machine to be converted from a pre-migration state to a post-migration state;
the switching monitoring module is used for monitoring state machine variable information of the state machine and judging whether the result of the expression of the pre-bound preset attribute in the page view component is true or not according to the state machine variable information, wherein the preset attribute comprises an opening attribute and a forbidden attribute;
And the interaction execution module is used for enabling the preset attribute by the page view component if the result of the expression of the preset attribute of the page view component is true.
According to a third aspect of the present application, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the control method of the page view component described above.
According to a fourth aspect of the present application, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a method of controlling the page view component described above when executing the program.
The application provides a control method, a device, a storage medium and a computer device of a page view component, firstly, a state machine event method corresponding to input information is executed in response to the input information of a terminal device, wherein the state machine event method can be a preset method for enabling a state machine to perform state switching action. Then, state machine variable information of a state machine can be monitored, and whether the result of the expression of the pre-bound preset attribute in the page view component is true or not is judged according to the state machine variable information, wherein the preset attribute comprises an open attribute and a disable attribute (disable); as an example, an expression of a preset attribute of the page view component may be configured in advance as a value of specific state machine variable information, and when state switching occurs to the state machine, it may be determined whether the state machine variable information of the state machine and the result of the page view component expression at this time are true. Finally, if the result of the expression of the preset attribute of the page view component is true, the page view component enables the preset attribute of the page view component. As an example, in the case where the preset attribute of the page view component is an open attribute (open), and the expression of the preset attribute is s= = 'in-edit', if the state machine variable information is 'in-edit', the result of the expression of the preset attribute of the page view component is true at this time, and then the open attribute may be enabled, so that the page view component is displayed in the display page of the terminal device, so as to complete the control of the page view component. According to the technical scheme, through the state of the page view component when the state of the state machine is converted, when the interaction of the page view component is carried out, the state machine can be controlled through the input information, so that the state of the page view components in the display, hiding, disabling and other states can be controlled based on the state change of the state machine, the control of the page view component and the interaction between the page view components can be realized under the condition that the data interaction with the back end is not needed, and the interaction efficiency of the page view component is improved.
The foregoing description is only an overview of the present application, and is intended to be implemented in accordance with the teachings of the present application in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present application more readily apparent.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a schematic flow diagram of a control method of a page view component according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a control device of a page view assembly according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a control device of another page view assembly according to an embodiment of the present application.
Detailed Description
The application will be described in detail hereinafter with reference to the drawings in conjunction with embodiments. It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other.
At present, along with the development of front-end and back-end development separation ideas and the maturation of low-code development technologies, when the problems are faced, a general basic component is mostly used, a front-end page view component is directly linked with a back-end, and the display and interaction of the page view component are controlled based on the data interaction of the front-end and the back-end, so that the layout development visualized in a page dragging and dropping mode is realized. However, the problems of complicated development of the view components, low code multiplexing and the like in the front-end development process are effectively solved by the mode. However, when the interaction process of the front-end page view components is performed, the interaction process between the page view components needs to be processed by the back-end, and only the pre-agreed simple interaction actions can be completed. In addition, in interacting logic with complex page view components, secondary development is often required to achieve interaction of the components. Therefore, the interaction mode seriously reduces the interaction efficiency between page view components, and further reduces the working efficiency of front-end development.
In view of the above problem, in one embodiment, as shown in fig. 1, a control method of a page view component is provided, and the method is applied to a digital medical service page development scenario, and is described by taking a terminal device provided with a state machine as an example. It should be noted that, the present application is described taking a medical service page development scenario as an example, and other scenarios are also applicable to the present embodiment, where the method includes the following steps:
101. And responding to the input information of the terminal equipment, executing a state machine event method corresponding to the input information, so that the state machine performs a preset state switching action corresponding to the state machine event method.
The state machine is a mathematical calculation model representing a finite number of states and actions such as transition and action among the states, and is a control center for coordinating related signal actions and completing specific operations. Further, the input information may be information triggered by clicking a specific icon or button in the display interface of the terminal device, or interaction information received from other devices, where the state switching action is used to make the state of the state machine transition from the pre-migration state to the post-migration state. Further, the state machine event method can be preset and bound with the corresponding input information, and when the input information exists, the corresponding state machine event method is triggered, so that the state machine performs a preset state switching action corresponding to the state machine event method.
Further, the state switching action may be preset, including a pre-transition state before state transition of the state machine and a post-transition state after state transition of the state machine. After executing the state machine event method based on the input information, the state machine performs a preset state switching action corresponding to the state machine event method to change from the pre-migration state to the post-migration state. Specifically, when input information exists, the state machine event method corresponding to the input information can be performed in response to the input information, so that the state machine performs state switching actions.
102. And monitoring state machine variable information of the state machine, and judging whether the result of the expression of the pre-bound preset attribute in the page view component is true according to the state machine variable information.
The state machine variable information is state identification information of the state machine, and when the state of the state machine is converted from a pre-migration state to a post-migration state, the value of the state machine variable information is attached to be the name of the post-migration state; as an example, if the current state of the state machine is "waiting for editing", the state machine variable information is also "waiting for editing" at this time, and when the state of the state machine is changed from "waiting for editing" to "in editing", the state machine variable information is also changed to "in editing".
Further, the page view component may be a code editing page used in front-end code editing or a component such as a button or an input box at a display page of the terminal device; further, the preset attribute is an attribute bound with the page view component in advance, and may include an open attribute (open) and a disable attribute (disable), where the preset attribute may be a boolean attribute, and when a result of an expression based on state machine variable information and the preset attribute of the page view component is true, the page view component enables the preset attribute, for example, if the result of the expression of the preset attribute of the page view component is true based on state machine variable information, and the page view component enables the open attribute to enable the page view component to display at the page.
Specifically, the page view component can monitor state machine variable information of the state machine in real time, and when the state machine generates state switching action according to a state machine event method, the state machine variable information of the state machine changes according to a change mode corresponding to the state switching action. As an example, when the state machine changes from "waiting for editing" to "editing", the state machine variable information of the state machine also changes from "waiting for editing" to "editing", and at this time, the page view component can determine that the state machine variable information of the state machine changes to "editing" through real-time monitoring; further, based on the current state machine variable information, whether the result of the expression of the pre-bound preset attribute in the page view component is true can be judged, and if the expression of the pre-bound preset attribute in the page view component is "in editing", the result of the expression of the pre-bound preset attribute in the page view component is true.
103. And if the result of the expression of the preset attribute of the page view component is true, enabling the preset attribute by the page view component.
As an example, in the case where the preset attribute of the page view component is an open attribute (open), and the expression of the open attribute is s= = 'in editing', if the state machine variable information is 'in editing', the result of the expression of the open attribute of the page view component is true at this time, and then the open attribute may be enabled, so that the page view component is displayed in the display page of the terminal device, so as to complete the interaction of the page view component. In contrast, in the case where the preset attribute of the page view component is a disable attribute (disable), and the expression of the disable attribute is s= = 'in commit', if the state machine variable information is 'in commit', the result of the expression of the disable attribute of the page view component is true, and thus the disable attribute may be enabled, so that the page view component is disabled.
The following describes a technical solution of the present embodiment by taking an interaction flow of a page view component in a medical service page development scenario as an example: firstly, a page of a terminal device is in a state of waiting for editing, and state machine variable information of a state machine is initial waiting for editing; meanwhile, the page is provided with a button for entering a page view component in an 'editing' state; at this time, if the developer clicks the button, input information corresponding to the button is obtained, and a state machine event method is triggered, so that the state of the state machine is changed from the state waiting for editing to the state in editing; further, when the state machine completes the state transition, the state machine variable information of the state machine is changed from "waiting for editing" to "editing". Further, the preset attribute of the page view component used for front-end code development is an open attribute, the expression of the open attribute is preset to be s= 'in editing' when the page view component monitors that the state machine variable information of the state machine is changed to be 'in editing', the result of the expression of the open attribute of the page view component is true, and at the moment, the page view component can enable the open attribute and display the open attribute at a page of the terminal device for development work of a developer.
Further, when a developer finishes the development of the code and clicks a page view component corresponding to a 'submit' button arranged in a page, input information of 'submit' is generated, and a corresponding state machine event method is triggered, so that the state of a state machine is changed from an 'edit' state to an 'submit' state; further, when the state machine completes the state transition, the state machine variable information of the state machine is changed from "in-edit" to "in-commit". Further, the preset attribute of the page view component corresponding to the "submit" button is a disable attribute, the expression of the preset attribute is s= = 'in the submit', when the page view component monitors that the state machine variable information of the state machine becomes "in the submit", the result of the expression of the disable attribute of the page view component is true, at this time, the disable attribute is enabled by the page view component, so that the "submit" button corresponding to the page view component is disabled, and secondary submission is prevented. Through the above-described process, the interworking of the page view components may be completed.
In the control method of the page view component provided in this embodiment, first, in response to input information to a terminal device, a state machine event method corresponding to the input information is executed, where the state machine event method may be a method that is preset, so that a state machine performs a state switching action. Then, state machine variable information of a state machine can be monitored, and whether the result of the expression of the pre-bound preset attribute in the page view component is true or not is judged according to the state machine variable information, wherein the preset attribute comprises an open attribute and a disable attribute (disable); as an example, an expression of a preset attribute of the page view component may be configured in advance as a value of specific state machine variable information, and when state switching occurs to the state machine, it may be determined whether the state machine variable information of the state machine and the result of the page view component expression at this time are true. Further, if the result of the expression of the preset attribute of the page view component is true, the page view component enables the preset attribute of the page view component. As an example, in the case where the preset attribute of the page view component is an open attribute (open), and the expression of the preset attribute is s= = 'in-edit', if the state machine variable information is 'in-edit', the result of the expression of the preset attribute of the page view component is true at this time, and then the open attribute may be enabled, so that the page view component is displayed in the display page of the terminal device, so as to complete the control of the page view component.
According to the technical scheme, through the state of the page view component in the state conversion of the preset state machine, when the interaction of the page view component is carried out, the change of the state machine can be controlled through the input information, so that the multiple page view components can be controlled to enter the states of display, hiding, disabling and the like based on the state change of the state machine, the control of the page view component and the interaction between the page view components can be realized under the condition that the data interaction is not carried out with the back-end equipment, and the interaction efficiency of the page view component can be remarkably improved.
In one embodiment, after monitoring the state machine variable information of the state machine in step 102, the method further comprises: firstly, judging whether the state machine variable information is preset target state machine variable information or not. The target state machine variable information can be selected from preset state machine variable information, and is used for calibrating a method corresponding to the state machine variable information when the state machine variable information is a specific value. Specifically, the state machine variable information may be matched with a preset state machine variable information comparison table, and whether the current state machine variable information is the target state machine variable information is determined, where the state machine variable information defined as the target state machine variable information is preset in the state machine variable information comparison table.
Further, if the state machine variable information is the target state machine variable information, the page view component executes a preset method corresponding to the target state machine variable information. The preset method may be a pre-configured script method or JavaScript function, and is used for executing the set method. Specifically, the mapping between the variable information of the target state machine and the preset method can be stored locally in advance, and when the variable information of the target state machine is determined, the preset method corresponding to the variable information of the target state machine can be called. As an example, when a developer completes the development of the code and clicks a page view component corresponding to a "submit" button in a page, input information of "submit" is generated, and a state machine event method is triggered, so that the state of the state machine is changed from an "in-edit" state to an "in-submit" state; further, when the state machine completes the state transition, the state machine variable information of the state machine is changed from "in-edit" to "in-commit". Further, the target state machine variable information corresponding to the preset method for code submission is "in submission", and when the state machine variable information is monitored to be "in submission", the page view component responsible for code development is made to execute the method for code submission, for example, data submission is initiated based on the post request of hppt. The embodiment of the application can enable the page view component to execute the method corresponding to the variable information of the specific state machine based on the variable information of the state machine, thereby increasing the functions which can be realized by the page view component and further improving the development efficiency of the Internet page.
In one embodiment, the implementation method of step 102 may be: firstly, monitoring assignment result information obtained after state machine variable information of the state machine is subjected to the state switching action. Specifically, state machine variable information of the state machine can be acquired in real time, a value given to the state machine variable information of the state machine due to state change is determined, and the value is determined as assignment result information. And then, judging whether the expression of the preset attribute is identical to the assignment result information or not according to the assignment result information. Specifically, the assignment result information of the state machine variable information of the state machine after the state transformation can be compared with the expression, and whether the assignment result information is identical with the expression or not is judged. And finally, if the assignment result information is the same as the expression of the preset attribute, the result of the expression of the preset attribute is true. According to the embodiment of the application, the real-time state of the state machine can be determined based on the monitoring of the state machine variable information of the state machine, so that whether the page view component is required to enter the display, hiding, forbidden and other states is determined, the control logic is simplified, and the control efficiency of interaction among the page view components is effectively improved.
In one embodiment, the implementation method of step 102 may further be: first, determining a state switching result of the state machine from the pre-migration state to the post-migration state when the state machine executes the state switching action. The state switching result may be in the form of a pre-migration state and a post-migration state, for example, the pre-migration state and the post-migration state of the state machine are "waiting for editing" and "editing", respectively, and the state switching result is "waiting for editing-editing". Specifically, the state of the state machine before and after the state switching can be monitored, and the state is determined to be a state switching result according to the state of the state machine before and after the state switching. Further, according to the state switching result, whether the expression of the preset attribute is the same as the state switching result is judged. Here, the expression of the preset attribute may be preset, and may be in the form of a combination of two state machine variable information before and after state machine state switching, for example, the expression of the preset attribute may be "s= waiting for editing-in-editing".
Further, if the state switching result is the same as the expression of the preset attribute, the result of the expression of the preset attribute is true. As an example, if the status switching result is "waiting for editing-in-editing", and at the same time, the expression of the preset attribute may be "s= waiting for editing-in-editing", the result of the expression of the preset attribute may be determined to be true. According to the embodiment of the application, each specific state switching action performed by the state machine can be accurately identified, meanwhile, when the expression of the preset attribute is set, the states before and after the state machine is switched are determined to be the expression of the preset attribute, so that the preset attribute is enabled only when the state machine is switched from a specific state before migration to a state after migration, and the interaction precision of the page view component is improved.
In one embodiment, the page view component includes a page interaction component; the page interaction component can be a component for receiving operation information, such as a button, an input box and the like on a display page; further, the input information includes click operation information of the page interaction component, such as a JavaScript function generated by the system when the button is clicked, for conveying clicking actions of a developer on the button to the system; further, the implementation manner of step 101 may be: firstly, responding to the click operation information of the page interaction component to obtain preset event information corresponding to the page interaction component; the event information may be preset, and is obtained when the click operation information triggered by the click page interaction component is generated.
Further, based on the event information, executing a state machine event method corresponding to the event information, so that the state machine performs the state switching action corresponding to the state machine event method. The state machine event method corresponding to the event information can be preset, and is called when the event information exists, so that the state machine executes the state switching action. According to the embodiment of the application, the event information can be generated based on the operation information of the components such as the buttons on the page by the developer, so that the developer can directly convert the state of the state machine to realize the control of the page view component, and the interaction convenience and interaction efficiency of the page view component are improved.
In one embodiment, the input information includes callback event information received from a remote upper computer, where the upper computer may be a computer device such as a back-end server connected to the terminal device, and the callback event information may be interaction information sent by the upper computer to the terminal device; further, the implementation manner of step 101 may be: firstly, obtaining callback event information received from the upper computer; specifically, the interaction information sent by the upper computer can be monitored in real time, and callback event information in the interaction information is received. And then, executing the state machine event method corresponding to the callback event information based on the callback event information so as to enable the state machine to perform the state switching action corresponding to the state machine event method. The state machine event method corresponding to the callback event information can be preset, and is called when the callback event information exists, so that the state machine executes state switching actions. According to the embodiment of the application, the interaction information from other devices can be received as callback event information to trigger the state transition of the state machine, so that the interaction requirement among page view components in the process of information interaction among multiple devices is met, and the page view component interaction mode which is increasingly complicated is met.
In one embodiment, if the pre-bound preset attribute of the page view component is an open attribute, after step 102, the method further includes: and if the result of the expression of the opening attribute of the page view component is not true, the page view component is in a hidden state on the interface of the terminal equipment. As an example, if the expression of the open attribute of the page view component is "in edit", and the state machine variable information of the state machine is "waiting for edit", the result of the expression of the preset attribute of the page view component is not true, and the page view component is hidden. According to the embodiment of the application, whether the page view component is displayed or not can be controlled based on the state machine variable information of the state machine, and the page view component which does not need to be operated is hidden, so that a developer can more intuitively observe a page to be operated, and the development efficiency of the developer is improved.
The implementation flow of the technical scheme of the present application is described below in connection with a medical service page development scenario, and first, a form in which a state machine can be configured in advance may be:
{ source: 'waiting for editing', target: 'in editing', event: 'click edit' }
{ source: 'in editing', target: 'in commit', event: 'submit' }
The source is a state before transition of the state machine, the target is a state after transition, and the event is event information triggering the state transition.
Further, the initial value of the state machine variable information of the state machine is 'waiting for editing', after a developer clicks a page interaction component serving as an editing button, event information clicking for editing is generated, a state machine event method corresponding to the event information is triggered, the state machine executes a state switching action corresponding to the state machine event method, the state machine is switched from a 'waiting for editing' state to an 'editing' state, and the state machine variable information is switched from 'waiting for editing' to 'editing'. Further, the expression of the open attribute of the page view component for code development is preset as "in S= editing", and at this time, according to the state machine variable information, the open attribute is enabled to display the page view component for code development if the result of the expression of the open attribute of the page view component is true.
Further, after the developer finishes code development, clicking a page interaction component serving as a submit button to generate submitted event information, triggering a state machine event method corresponding to the event information, enabling a state machine to execute a state switching action corresponding to the state machine event method, converting a state in editing into a state in submitting, and enabling state machine variable information of the state machine to be converted from the state in editing into the state in submitting; further, the expression of the disable attribute of the page interaction component serving as the submit button is preset as "s= in submission", and at this time, according to the state machine variable information "in submission", if the result of the expression of the disable attribute of the page interaction component is true, the disable attribute is enabled, so that the submit button cannot be clicked, and the developer is prevented from performing secondary submission. Meanwhile, target state machine variable information corresponding to a preset method for submitting codes to the back-end server is preset as "submitting in the middle", when the state machine variable information is identified as "submitting in the middle", development data submission can be initiated to the back-end server, development codes written by developers are sent to the back-end server, and feedback results of the back-end server on the development codes are waited.
Further, after receiving a callback event which is sent from a server and is submitted successfully, the terminal equipment triggers a state machine event method corresponding to the event information, so that a state machine executes a preset state switching action corresponding to the state machine event method, the state of the state machine is converted from a state in submission to a state waiting for editing, and variable information of the state machine is converted from the state in submission to the state waiting for editing; at this point, the expression of the open attribute of the page view component for code development is not true, hiding the page view component.
In contrast, after receiving a callback event of failure in submission sent from a server, the terminal equipment triggers a preset state machine event method corresponding to the event information, so that the state machine executes a state switching action corresponding to the state machine event method, the state of the state machine is converted from a submitting state to an editing state, and the state machine variable information is converted from the submitting state to the editing state; at this time, the expression of the open attribute of the page view component for code development is true, and the page view component is displayed so that the developer can modify the development code based on the page view component. It should be noted that the state setting of the state machine, the condition for generating the event information, the correspondence of the event information to the state machine event method, and the setting of the preset attribute may be determined according to the actual situation, and are equally applicable to the present embodiment.
According to the control method for the page view component, through the state of the page view component to be in and the execution method during state conversion of the preset state machine, when the page view component is interacted, the change of the state machine can be controlled through the operation behavior of the page component or the interaction information among devices, so that the plurality of page view components can be controlled to enter the states of display, hiding, disabling and the like based on the state change of the state machine, the corresponding method is executed, and further the control of the page view component and the interaction between the page view component are realized under the condition that the data interaction is not carried out with the rear end, and the interaction efficiency of the page view component is improved.
Further, as a specific implementation of the method shown in fig. 1, the present embodiment provides a control device for a page view component, as shown in fig. 2, where the device includes: a switch execution module 21, a switch monitoring module 22 and an interaction execution module 23.
A switch execution module 21, configured to execute a state machine event method corresponding to input information in response to the input information to the terminal device, so that the state machine performs a preset state switching action corresponding to the state machine event method, where the state switching action is used to make a state of the state machine transition from a pre-transition state to a post-transition state;
The switch monitoring module 22 is configured to monitor state machine variable information of the state machine, and determine whether a result of an expression of a preset attribute pre-bound in the page view component is true according to the state machine variable information, where the preset attribute includes an open attribute and a disable attribute;
the interaction executing module 23 may be configured to enable the preset attribute of the page view component if the result of the expression of the preset attribute of the page view component is true.
In a specific application scenario, the switch monitoring module 22 may be specifically configured to monitor assignment result information obtained after the state machine variable information of the state machine is subjected to the state switching action; judging whether the expression of the preset attribute is identical to the assignment result information or not according to the assignment result information; and if the assignment result information is the same as the expression of the preset attribute, the result of the expression of the preset attribute is true.
In a specific application scenario, the switch monitoring module 22 may be specifically configured to determine a state switching result of the state machine from the pre-migration state to the post-migration state when the state machine performs the state switching action; judging whether the expression of the preset attribute is the same as the state switching result or not according to the state switching result; and if the state switching result is the same as the expression of the preset attribute, the result of the expression of the preset attribute is true.
In a specific application scenario, the page view component comprises a page interaction component; the input information comprises click operation information of the page interaction component; the switch execution module 21 is specifically configured to obtain preset event information corresponding to the page interaction component in response to the click operation information of the page interaction component; and executing a state machine event method corresponding to the event information based on the event information, so that the state machine performs the state switching action corresponding to the state machine event method.
In a specific application scene, the input information comprises callback event information received from a remote upper computer; the switch execution module 21 is specifically configured to obtain the callback event information received from the upper computer; and executing the state machine event method corresponding to the callback event information based on the callback event information so as to enable the state machine to perform the state switching action corresponding to the state machine event method.
In a specific application scenario, if the preset attribute pre-bound to the page view component is an open attribute, the interaction executing module 23 may be specifically configured to enable the page view component to be in a hidden state on the interface of the terminal device if the result of the expression of the open attribute of the page view component is not true.
In a specific application scenario, as shown in fig. 3, the apparatus further includes a method execution module 34, where the method execution module 34 is specifically configured to determine whether the state machine variable information is preset target state machine variable information; and if the state machine variable information is the target state machine variable information, enabling the page view component to execute a preset method corresponding to the target state machine variable information.
It should be noted that, other corresponding descriptions of each functional unit related to the control device of the page view assembly provided in this embodiment may refer to corresponding descriptions in fig. 1, and are not repeated herein.
Based on the above method shown in fig. 1, correspondingly, the present embodiment further provides a storage medium, on which a computer program is stored, which when executed by a processor, implements the above method for controlling the page view component shown in fig. 1.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, where the software product to be identified may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disc, a mobile hard disk, etc.), and include several instructions for causing a computer device (may be a personal computer, a server, or a network device, etc.) to execute the method described in the various implementation scenarios of the present application.
Based on the method shown in fig. 1 and the embodiments of the control device of the page view component shown in fig. 2 and 3, in order to achieve the above objects, the present embodiment further provides an entity device for controlling the page view component, which may specifically be a personal computer, a server, a smart phone, a tablet computer, a smart watch, or other network devices, where the entity device includes a storage medium and a processor; a storage medium storing a computer program; a processor for executing a computer program to implement the method as described above and shown in fig. 1.
Optionally, the physical device may further include a user interface, a network interface, a camera, radio Frequency (RF) circuitry, sensors, audio circuitry, WI-FI modules, and the like. The user interface may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), etc.
It will be appreciated by those skilled in the art that the structure of the physical device for controlling the page view assembly provided in this embodiment is not limited to the physical device, and may include more or fewer components, or may combine certain components, or may be a different arrangement of components.
The storage medium may also include an operating system, a network communication module. The operating system is a program for managing the entity equipment hardware and the software resources to be identified, and supports the operation of the information processing program and other software and/or programs to be identified. The network communication module is used for realizing communication among all components in the storage medium and communication with other hardware and software in the information processing entity equipment.
From the above description of the embodiments, it will be apparent to those skilled in the art that the present application may be implemented by means of software plus necessary general hardware platforms, or may be implemented by hardware. By applying the technical scheme of the application, firstly, a state machine event method corresponding to input information is executed in response to the input information of the terminal equipment, so that the state machine performs a preset state switching action corresponding to the state machine event method, wherein the state switching action is used for converting the state of the state machine from a state before migration to a state after migration; then, state machine variable information of the state machine is monitored, and whether the result of the expression of the pre-bound preset attribute in the page view component is true or not is judged according to the state machine variable information, wherein the preset attribute comprises an opening attribute and a forbidden attribute; finally, if the result of the expression of the preset attribute of the page view component is true, the page view component enables the preset attribute. Compared with the prior art, the interaction efficiency of the page view component can be improved. Those skilled in the art will appreciate that the drawing is merely a schematic illustration of a preferred implementation scenario and that the modules or flows in the drawing are not necessarily required to practice the application. Those skilled in the art will appreciate that modules in an apparatus in an implementation scenario may be distributed in an apparatus in an implementation scenario according to an implementation scenario description, or that corresponding changes may be located in one or more apparatuses different from the implementation scenario. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above-mentioned inventive sequence numbers are merely for description and do not represent advantages or disadvantages of the implementation scenario. The foregoing disclosure is merely illustrative of some embodiments of the application, and the application is not limited thereto, as modifications may be made by those skilled in the art without departing from the scope of the application.

Claims (10)

1. A control method of a page view component, applied to a terminal device provided with a state machine, characterized in that the method comprises:
responding to input information of the terminal equipment, executing a state machine event method corresponding to the input information, and enabling the state machine to perform a preset state switching action corresponding to the state machine event method, wherein the state switching action is used for enabling the state of the state machine to be converted from a pre-migration state to a post-migration state;
monitoring state machine variable information of the state machine, and judging whether the result of an expression of a pre-bound preset attribute in the page view component is true according to the state machine variable information, wherein the preset attribute comprises an opening attribute and a forbidden attribute;
and if the result of the expression of the preset attribute of the page view component is true, enabling the preset attribute by the page view component.
2. The method of claim 1, wherein after the monitoring of state machine variable information of the state machine, the method further comprises:
judging whether the state machine variable information is preset target state machine variable information or not;
and if the state machine variable information is the target state machine variable information, enabling the page view component to execute a preset method corresponding to the target state machine variable information.
3. The method according to claim 1, wherein the monitoring state machine variable information of the state machine and determining whether the result of the expression of the pre-bound preset attribute in the page view component is true according to the state machine variable information comprises:
monitoring assignment result information obtained after state machine variable information of the state machine is subjected to the state switching action;
judging whether the expression of the preset attribute is identical to the assignment result information or not according to the assignment result information;
and if the assignment result information is the same as the expression of the preset attribute, the result of the expression of the preset attribute is true.
4. The method of claim 1, wherein the monitoring state machine variable information of the state machine and determining whether the result of the expression of the pre-bound preset attribute in the page view component is true according to the state machine variable information further comprises:
Determining a state switching result of the state machine from the pre-migration state to the post-migration state when the state machine executes the state switching action;
judging whether the expression of the preset attribute is the same as the state switching result or not according to the state switching result;
and if the state switching result is the same as the expression of the preset attribute, the result of the expression of the preset attribute is true.
5. The method of claim 3 or 4, wherein the page view component comprises a page interaction component; the input information comprises click operation information of the page interaction component; the responding to the input information of the terminal equipment, executing a state machine event method corresponding to the input information, so that the state machine performs a preset state switching action corresponding to the state machine event method, and the method comprises the following steps:
responding to the click operation information of the page interaction component, and obtaining preset event information corresponding to the page interaction component;
and executing a state machine event method corresponding to the event information based on the event information, so that the state machine performs the state switching action corresponding to the state machine event method.
6. The method of claim 3 or 4, wherein the input information comprises callback event information received from a remote host computer; the responding to the input information of the terminal equipment executes a state machine event method corresponding to the input information so as to enable the state machine to perform a preset state switching action corresponding to the state machine event method, and the method further comprises the following steps:
obtaining callback event information received from the upper computer;
and executing the state machine event method corresponding to the callback event information based on the callback event information so as to enable the state machine to perform the state switching action corresponding to the state machine event method.
7. The method according to claim 1, wherein if the pre-bound preset attribute of the page view component is an open attribute, the monitoring the state machine variable information of the state machine, and determining whether the result of the expression of the pre-bound preset attribute in the page view component is true according to the state machine variable information, the method further comprises:
and if the result of the expression of the opening attribute of the page view component is not true, the page view component is in a hidden state on the interface of the terminal equipment.
8. A control device for a page view assembly, the device comprising:
the switching execution module is used for responding to the input information of the terminal equipment and executing a state machine event method corresponding to the input information so as to enable the state machine to perform a preset state switching action corresponding to the state machine event method, wherein the state switching action is used for enabling the state of the state machine to be converted from a pre-migration state to a post-migration state;
the switching monitoring module is used for monitoring state machine variable information of the state machine and judging whether the result of the expression of the pre-bound preset attribute in the page view component is true or not according to the state machine variable information, wherein the preset attribute comprises an opening attribute and a forbidden attribute;
and the interaction execution module is used for enabling the preset attribute by the page view component if the result of the expression of the preset attribute of the page view component is true.
9. A storage medium having stored thereon a computer program, which when executed by a processor, implements the steps of the method of any of claims 1 to 7.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the computer program when executed by the processor implements the steps of the method according to any one of claims 1 to 7.
CN202310810779.2A 2023-07-04 2023-07-04 Page view component control method and device, storage medium and computer equipment Pending CN116954795A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310810779.2A CN116954795A (en) 2023-07-04 2023-07-04 Page view component control method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310810779.2A CN116954795A (en) 2023-07-04 2023-07-04 Page view component control method and device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN116954795A true CN116954795A (en) 2023-10-27

Family

ID=88452129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310810779.2A Pending CN116954795A (en) 2023-07-04 2023-07-04 Page view component control method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN116954795A (en)

Similar Documents

Publication Publication Date Title
US9280451B2 (en) Testing device
US11468226B2 (en) Systems and methods for presentation of a terminal application screen
US20210405111A1 (en) Test method and electronic device
US11934175B2 (en) Robotic process automation for remote assistance
CN111708528A (en) Method, device and equipment for generating small program and storage medium
US8977968B2 (en) Pseudo-remote terminal IOTA mobile diagnostics and electronic customer care
WO2023098732A1 (en) Cross-device interaction method and apparatus, electronic device, and storage medium
CN104246696A (en) Image-based application automation
CN111538659B (en) Interface testing method, system, electronic equipment and storage medium of business scene
US11579948B2 (en) Application programming interface for web page and visualization generation
KR101865343B1 (en) Server-side framework device for development of web service application, method for executing web service application developmed using the same and computer program for the same
US20210098012A1 (en) Voice Skill Recommendation Method, Apparatus, Device and Storage Medium
CN112506503A (en) Programming method, device, terminal equipment and storage medium
CN116954795A (en) Page view component control method and device, storage medium and computer equipment
CN112799656B (en) Script file configuration method, device, equipment and storage medium for automation operation
CN115904183A (en) Interface display process, apparatus, device and storage medium
US20130007622A1 (en) Demonstrating a software product
CN111813407B (en) Game development method, game running device and electronic equipment
CN111897529B (en) Front-end component conversion method, device, equipment and readable storage medium
CN111177558B (en) Channel service construction method and device
KR20180076020A (en) Apparatus and method for application test automation
CN111737372A (en) Map data generation method and device
CN111367597A (en) Color switching method and device and electronic equipment
US9274760B2 (en) Adaptive developer experience based on project types and process templates
CN115469838A (en) Information display method and device, computer readable storage medium and electronic equipment

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