CN117519696A - Page operation behavior rendering method and device - Google Patents

Page operation behavior rendering method and device Download PDF

Info

Publication number
CN117519696A
CN117519696A CN202311451551.5A CN202311451551A CN117519696A CN 117519696 A CN117519696 A CN 117519696A CN 202311451551 A CN202311451551 A CN 202311451551A CN 117519696 A CN117519696 A CN 117519696A
Authority
CN
China
Prior art keywords
page operation
page
operation behavior
rendering
condition
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
CN202311451551.5A
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.)
Beijing Casicloud Co ltd
Original Assignee
Beijing Casicloud 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 Beijing Casicloud Co ltd filed Critical Beijing Casicloud Co ltd
Priority to CN202311451551.5A priority Critical patent/CN117519696A/en
Publication of CN117519696A publication Critical patent/CN117519696A/en
Pending legal-status Critical Current

Links

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention provides a rendering method and a rendering device of page operation behaviors, which relate to the technical field of computers, and the method comprises the following steps: pre-configuring a page operation behavior array, wherein the page operation behavior array comprises a plurality of page operation behaviors, and each page operation behavior comprises display conditions and rendering operations; the display condition is used for judging whether page operation behaviors are displayed or not; judging whether to display the page operation behaviors or not based on the display conditions aiming at each page operation behavior; and under the condition that the page operation behaviors are displayed, rendering the page operation behaviors based on rendering operation to obtain rendered page operation behaviors. Through pre-configuring each page operation behavior in the page operation behavior array, the page operation behavior is rendered according to the display condition and the rendering operation configuration, front-end coding and rendering operation processing logic are standardized, the complexity of page development work is reduced, and the development efficiency is improved.

Description

Page operation behavior rendering method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for rendering page operation behaviors.
Background
When displaying a network (WEB) page to a user, operation buttons which can be operated by the user are usually displayed on the WEB page, and the display of the operation buttons is related to factors such as user authority, currently displayed data and the like. When the user clicks the operation button, a hypertext transfer protocol (Hypertext Transfer Protocol, HTTP) request is typically initiated to the server to change the data of the WEB page. However, the display of the operation buttons makes the WEB page development work complex and the development efficiency low.
Disclosure of Invention
The invention provides a rendering method and a rendering device for page operation behaviors, which are used for solving the problems of complex development work and low development efficiency of WEB pages.
The invention provides a rendering method of page operation behaviors, which comprises the following steps:
pre-configuring a page operation behavior array, wherein the page operation behavior array comprises a plurality of page operation behaviors, and each page operation behavior comprises display conditions and rendering operations; the display condition is used for judging whether the page operation behavior is displayed or not; the rendering operation is used for rendering the page operation behavior;
judging whether to display the page operation behaviors or not according to the display conditions aiming at each page operation behavior;
And under the condition that the page operation behaviors are displayed, rendering the page operation behaviors based on the rendering operation to obtain the rendered page operation behaviors.
According to the rendering method of the page operation behavior, the display condition comprises a weight value and a first attribute value group; the permission value represents permission required by the page operation behavior display; the first attribute value group represents attribute values required for displaying the page operation behavior;
the step of judging whether to display the page operation behavior based on the display condition comprises the following steps:
displaying the page operation behavior under the condition that the value of the display condition is empty;
and judging whether to display the page operation behavior or not based on the authority value and the first attribute value group under the condition that the value of the display condition is not null.
According to the rendering method of the page operation behavior provided by the invention, the judging whether to display the page operation behavior based on the weight value and the first attribute value group comprises the following steps:
determining whether the user has rights or not based on the rights value;
Determining whether all attribute values in the first attribute value group are matched with second attribute values corresponding to an object to be operated or not based on the first attribute value group;
and displaying the page operation behavior under the condition that the user has authority and all attribute values in the first attribute value group are matched with the second attribute value.
According to the rendering method of page operation behavior provided by the invention, the determining whether the user has the authority based on the authority value comprises the following steps:
determining that the user has authority under the condition that the authority value is empty;
and under the condition that the authority value is not null, determining whether the user has the authority or not based on the type corresponding to the authority value.
According to the rendering method of page operation behavior provided by the invention, the determining whether the user has the authority based on the type corresponding to the authority value comprises the following steps:
under the condition that the type corresponding to the authority value is a character string type, dividing the authority value by adopting a preset dividing character to obtain a first character string array; the first character string array comprises a plurality of first character strings;
judging whether each first character string has authority or not respectively;
And under the condition that all the first character strings have authority, determining that the user has authority.
According to the rendering method of page operation behavior provided by the invention, the determining whether the user has the authority based on the type corresponding to the authority value comprises the following steps:
under the condition that the type corresponding to the authority value is a character string array type, judging whether each second character string in the authority value has authority or not respectively;
and determining that the user has authority in the condition that at least one second character string has authority.
According to the rendering method of page operation behavior provided by the invention, the determining whether all attribute values in the first attribute value group are matched with the second attribute value corresponding to the object to be operated based on the first attribute value group comprises the following steps:
under the condition that the first attribute value group is empty, determining that all attribute values in the first attribute value group are matched with the second attribute value corresponding to the object to be operated;
under the condition that the first attribute value group is not empty, matching each attribute value in the first attribute value group with the second attribute value corresponding to the object to be operated; and under the condition that each attribute value in the first attribute value group is respectively matched with the second attribute value corresponding to the object to be operated, determining that all attribute values in the first attribute value group are matched with the second attribute value corresponding to the object to be operated.
According to the rendering method of the page operation behavior, the page operation behavior further comprises a post-trigger processing operation, wherein the post-trigger processing operation comprises a form item value, a processing parameter function, a request address, a request mode, a first callback function and a second callback function; the first callback function is used for indicating that the current operation behavior is successful or updating page data; the second callback function is used for indicating that the current operation behavior fails;
after the page operation behavior is rendered, and the rendered page operation behavior is obtained, the method further comprises:
acquiring target parameters input by a target user under the condition that the form item value is not null;
determining a second parameter corresponding to the processing parameter function based on the current operation behavior of the user, the target parameter and the processing parameter function under the condition that the processing parameter is not null;
determining a webpage request based on the second parameter, the request address and the request mode under the condition that the request address is not empty;
and executing the first callback function or the second callback function based on the webpage request.
According to the rendering method of page operation behavior provided by the invention, the executing of the first callback function or the second callback function based on the webpage request comprises the following steps:
determining a return value corresponding to the webpage request based on the webpage request;
determining whether the web page request is successful based on the return value;
executing the first callback function under the condition that the webpage request is successful and the first callback function is not empty; or executing the second callback function under the condition that the webpage request fails and the second callback function is not empty.
The invention also provides a rendering device of page operation behaviors, which comprises:
the configuration module is used for pre-configuring a page operation behavior array, wherein the page operation behavior array comprises a plurality of page operation behaviors, and each page operation behavior comprises a display condition and a rendering operation; the display condition is used for judging whether the page operation behavior is displayed or not; the rendering operation is used for rendering the page operation behavior;
the judging module is used for judging whether the page operation behaviors are displayed or not according to the display conditions aiming at each page operation behavior;
And the rendering module is used for rendering the page operation behaviors based on the rendering operation under the condition that the page operation behaviors are displayed, so as to obtain the rendered page operation behaviors.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the rendering method of the page operation behavior according to any one of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a rendering method of page operation behavior as described in any of the above.
The invention also provides a computer program product comprising a computer program which when executed by a processor implements a rendering method of page operation behaviour as described in any one of the above.
According to the rendering method and the rendering device for the page operation behaviors, the page operation behavior array is preconfigured, the page operation behavior array comprises a plurality of page operation behaviors, and each page operation behavior comprises display conditions and rendering operation; the display condition is used for judging whether page operation behaviors are displayed or not; the rendering operation is used for rendering page operation behaviors; judging whether to display the page operation behaviors or not according to the display conditions aiming at each page operation behavior; and under the condition that the page operation behaviors are displayed, rendering the page operation behaviors based on the rendering operation to obtain the rendered page operation behaviors. Through pre-configuring each page operation behavior in the page operation behavior array, the page operation behavior is rendered according to the display condition and the rendering operation configuration, front-end coding and rendering operation processing logic are standardized, the complexity of page development work is reduced, and the development efficiency is improved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a rendering method of page operation behavior provided by the present invention;
FIG. 2 is a schematic flow chart for judging whether to display page operation behavior according to the present invention;
FIG. 3 is a schematic flow chart of determining whether a user has rights according to the present invention;
FIG. 4 is a flowchart illustrating a method for determining whether all attribute values in a first attribute value set match a second attribute value corresponding to an object to be operated according to the present invention;
FIG. 5 is a schematic diagram of a processing flow of a trigger event corresponding to a post-trigger processing operation according to the present invention;
FIG. 6 is a second flow chart of a rendering method of page operation behavior according to the present invention;
FIG. 7 is a schematic diagram of a rendering device for page operation behavior according to the present invention;
Fig. 8 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The rendering method of page operation behavior of the present invention is described below with reference to fig. 1 to 6.
FIG. 1 is a schematic flow chart of a rendering method of page operation behavior according to the present invention, as shown in FIG. 1, the method includes steps 101-103; wherein,
step 101, pre-configuring a page operation behavior array, wherein the page operation behavior array comprises a plurality of page operation behaviors, and each page operation behavior comprises a display condition and a rendering operation; the display condition is used for judging whether the page operation behavior is displayed or not; the rendering operation is used for rendering the page operation behavior.
It should be noted that, the method for rendering the page operation behavior provided by the present invention is suitable for use in a scenario of rendering and processing the page operation behavior of a WEB page, and the execution body of the method may be a rendering device of the page operation behavior, for example, an electronic device, or a control module of the rendering device of the page operation behavior, which is used for executing the rendering method of the page operation behavior.
Specifically, the page operation behavior may be a page operation button, for example, edit, add, delete, approval, or the like. Pre-configuring a page operation behavior array (actions) in a JSON format by adopting a TypeScript grammar, wherein the page operation behavior array comprises a plurality of page operation behaviors (actions), and each page operation behavior comprises a display condition (condition) and a rendering operation (display); the display condition is used for judging whether page operation behaviors are displayed or not; the rendering operation is used for rendering page operation behaviors. Table 1 is an object attribute description table of a rendering operation, and as shown in table 1, the object of the rendering operation includes a title (title), an icon (icon), and a style (className).
TABLE 1 object Property Specification Table for rendering operations
Step 102, for each page operation behavior, determining whether to display the page operation behavior based on the display condition.
Specifically, since the display condition is used to determine whether to display the page operation behavior, it is possible to determine whether to display the page operation behavior according to the display condition.
And step 103, rendering the page operation behavior based on the rendering operation under the condition that the page operation behavior is displayed, so as to obtain the rendered page operation behavior.
Specifically, in the case of displaying the page operation behavior, the page operation behavior may be rendered based on the rendering operation, to obtain the rendered page operation behavior.
Optionally, in the case that the page operation behavior is not displayed, the page operation behavior is not rendered.
According to the rendering method of the page operation behaviors, the page operation behavior array is preconfigured and comprises a plurality of page operation behaviors, and each page operation behavior comprises display conditions and rendering operations; the display condition is used for judging whether page operation behaviors are displayed or not; the rendering operation is used for rendering page operation behaviors; judging whether to display the page operation behaviors or not according to the display conditions aiming at each page operation behavior; and under the condition that the page operation behaviors are displayed, rendering the page operation behaviors based on the rendering operation to obtain the rendered page operation behaviors. Through pre-configuring each page operation behavior in the page operation behavior array, the page operation behavior is rendered according to the display condition and the rendering operation configuration, front-end coding and rendering operation processing logic are standardized, the complexity of page development work is reduced, and the development efficiency is improved.
Optionally, the display condition includes a weight value and a first attribute value set; the permission value represents permission required by the page operation behavior display; the first attribute value group represents attribute values required for displaying the page operation behavior;
the specific implementation manner of the step (1) comprises the following steps:
(1-1) displaying the page operation behavior in a case where the value of the display condition is empty.
Specifically, table 2 is an object attribute description table of display conditions including a weight value (pem) and a first attribute value group (values) including a plurality of attribute values (values), as shown in table 2; the permission value represents permission required by page operation behavior display; the first attribute value group represents attribute values required for page operation behavior display.
TABLE 2 object Property description Table showing conditions
Specifically, when the value of the display condition (condition) is empty, that is, when there is no limitation on the display of the page operation behavior, the page operation behavior is directly displayed.
(1-2) determining whether to display the page operation behavior based on the authority value and the first attribute value group, in a case where the value of the display condition is not null.
Specifically, in the case where the value of the display condition is not null, it may be determined whether to display the page operation behavior based on the weight value and the first attribute value group.
Optionally, the determining, based on the weight value and the first attribute value set, whether to display the page operation behavior includes:
(a) And determining whether the user has the authority or not based on the authority value.
Specifically, according to the authority value, whether the user has authority can be judged, namely whether the user has authority is judged according to the pem attribute value.
(b) Based on the first attribute value group, determining whether all attribute values in the first attribute value group are matched with second attribute values corresponding to the object to be operated.
Specifically, the object to be operated displays the required current data for the operation behavior, for example, the object to be operated is a list. The second attribute value is an item value (itemValue). According to the first attribute value group, it may be determined whether all attribute values in the first attribute value group match second attribute values corresponding to the object to be operated.
(c) And displaying the page operation behavior under the condition that the user has authority and all attribute values in the first attribute value group are matched with the second attribute value.
Specifically, in the case where the user has authority and all attribute values in the first attribute value group match the second attribute value, the page operation behavior may be displayed.
Optionally, the page operation behavior is not displayed in case the user has permission or any one of the first set of attribute values does not match the second attribute value.
Fig. 2 is a schematic flow chart for determining whether to display page operation behaviors according to the present invention, where, as shown in fig. 2, the flow chart includes:
step 201, it is determined whether the value of the display condition is null. If the value of the display condition is empty, the process proceeds to step 206; if the value of the display condition is not null, the process proceeds to step 203.
Step 202, determining whether the user has rights based on the rights value.
Step 203, it is determined whether the user has rights. If the user has rights, go to step 206; in the event that the user has no rights, the flow goes to step 207.
Step 204, determining whether the attribute values match according to the first attribute value set. Specifically, according to the first attribute value group, whether all attribute values in the first attribute value group are matched with second attribute values corresponding to the object to be operated is determined.
Step 205, it is determined whether all attribute values in the first attribute value set match the second attribute value corresponding to the object to be operated. If all attribute values in the first attribute value set match the second attribute value corresponding to the object to be operated, go to step 206; if any one of the attribute values in the first attribute value group does not match the second attribute value corresponding to the object to be operated, the process proceeds to step 207.
Step 206, displaying the page operation behavior under the condition that the user has authority and all the attribute values in the first attribute value group are matched with the second attribute value.
In step 207, in case the user has no authority or any attribute value in the first attribute value set does not match the second attribute value, no page operation behavior is displayed.
Optionally, the determining whether the user has the authority based on the authority value includes:
1) And under the condition that the authority value is empty, determining that the user has authority.
Specifically, whether the authority value is empty is judged, and the authority of the user can be directly determined under the condition that the authority value is empty.
2) And under the condition that the authority value is not null, determining whether the user has the authority or not based on the type corresponding to the authority value.
Specifically, in the case that the authority value is not null, whether the user has the authority may be determined according to the type corresponding to the authority value. The type corresponding to the weight value is a character string type or a character string array type.
Optionally, the determining whether the user has the authority based on the type corresponding to the authority value includes:
a) Under the condition that the type corresponding to the authority value is a character string type, dividing the authority value by adopting a preset dividing character to obtain a first character string array; the first string array includes a plurality of first strings.
Specifically, the preset separation character is a preset separation symbol, for example, the preset separation character is a "separation character". Judging the type corresponding to the authority value, and separating the authority value by adopting a preset separation character to obtain a first character string array, namely separating the pep value to obtain the first character string array under the condition that the type corresponding to the authority value is a character string type; the first character string array comprises a plurality of first character strings.
b) And judging whether each first character string has authority or not respectively.
Specifically, matching each first character string with the character strings in the user authority list, and determining that the first character string has authority under the condition that the first character string is matched with the character strings in the user authority list; in the case that the first string does not match a string in the user permission list, it is determined that the first string does not have permission.
c) And under the condition that all the first character strings have authority, determining that the user has authority.
Specifically, judging whether all the first character strings have authority, and if all the first character strings have authority, determining that the user has authority; in the case that at least one first character string has no authority, it is determined that the user has no authority.
Optionally, the determining whether the user has the authority based on the type corresponding to the authority value includes:
under the condition that the type corresponding to the authority value is a character string array type, judging whether each second character string in the authority value has authority or not respectively; and determining that the user has authority in the condition that at least one second character string has authority.
Specifically, under the condition that the type corresponding to the authority value is a character string array type, judging whether each second character string in the authority value has the authority or not respectively; if at least one second character string has authority, determining that the user has authority; if all the second character strings have no authority, it can be determined that the user has no authority.
Fig. 3 is a schematic flow chart for determining whether a user has authority, which is provided in the present invention, as shown in fig. 3, and includes:
Step 301, it is determined whether the weight value is empty. If the authority value is null, go to step 306; in the case where the authority value is not null, the process goes to step 302.
Step 302, judging the type corresponding to the authority value. If the type corresponding to the authority value is a character string type, go to step 303; if the type corresponding to the authority value is the string array type, the process goes to step 305.
Step 303, dividing the authority value by adopting a preset dividing character to obtain a first character string array; the first character string array comprises a plurality of first character strings.
Step 304, it is determined whether each first string has authority. If all the first strings have authority, go to step 306; in case at least one first string has no rights, go to step 307.
Step 305, it is determined whether each second string in the authority value has authority. If at least one second character string is authorized, go to step 306; in case all the second strings have no rights, go to step 307.
Step 306, determining that the user has rights.
Step 307, determining that the user has no rights.
Optionally, the determining, based on the first attribute value set, whether all attribute values in the first attribute value set match with second attribute values corresponding to the object to be operated includes:
(1) And under the condition that the first attribute value group is empty, determining that all attribute values in the first attribute value group are matched with the second attribute value corresponding to the object to be operated.
Specifically, in the case where the first attribute value group is empty, that is, in the case where each attribute value in the first attribute value group is empty, it may be determined that all attribute values in the first attribute value group match the second attribute value corresponding to the object to be operated.
(2) Under the condition that the first attribute value group is not empty, matching each attribute value in the first attribute value group with the second attribute value corresponding to the object to be operated; and under the condition that each attribute value in the first attribute value group is respectively matched with the second attribute value corresponding to the object to be operated, determining that all attribute values in the first attribute value group are matched with the second attribute value corresponding to the object to be operated.
Specifically, in the case where the first attribute value group is not null, that is, in the case where each attribute value in the first attribute value group is not null, each attribute value in the first attribute value group may be respectively matched with a second attribute value corresponding to the object to be operated, and in the case where each attribute value in the first attribute value group is respectively matched with a second attribute value corresponding to the object to be operated, it may be determined that all attribute values in the first attribute value group are matched with the second attribute value corresponding to the object to be operated.
For example, in the case that the first attribute value group is an array, if each attribute value (value) in the first attribute value group (values) contains a second attribute value (itemValue) corresponding to the object to be operated, each attribute value in the first attribute value group is respectively matched with the second attribute value corresponding to the object to be operated; if each attribute value (value) in the first attribute value group (values) does not contain the second attribute value (itemValue) corresponding to the object to be operated, each attribute value in the first attribute value group is not matched with the second attribute value corresponding to the object to be operated.
Optionally, in the case that the first attribute value group is a non-array, if each attribute value (value) in the first attribute value group (values) is equal to a second attribute value (itemValue) corresponding to the object to be operated, matching each attribute value in the first attribute value group with the second attribute value corresponding to the object to be operated; if each attribute value (value) in the first attribute value group (values) is not equal to the second attribute value (itemValue) corresponding to the object to be operated, each attribute value in the first attribute value group is not matched with the second attribute value corresponding to the object to be operated.
Fig. 4 is a schematic flow chart of determining whether all attribute values in the first attribute value set match with the second attribute value corresponding to the object to be operated according to the present invention, as shown in fig. 4, including:
Step 401, determining whether the first attribute value set is empty. If the first attribute value set is empty, the process proceeds to step 407; in the case where the first attribute value set is not empty, go to step 402.
Step 402, determining whether the first attribute value set is an array. If the first attribute value set is an array, go to step 403; if the first attribute value set is a non-array, the process proceeds to step 406.
In step 403, it is determined whether each attribute value (value) in the first attribute value set (values) contains a second attribute value (itemValue) corresponding to the object to be operated. In the case that each attribute value (value) in the first attribute value group (values) contains a second attribute value (itemValue) corresponding to the object to be operated, go to step 404; in the case that each attribute value (value) in the first attribute value group (values) does not contain the second attribute value (itemValue) corresponding to the object to be operated, go to step 405.
In step 404, each attribute value in the first attribute value set is respectively matched with a second attribute value corresponding to the object to be operated.
In step 405, each attribute value in the first attribute value set is not matched with the second attribute value corresponding to the object to be operated.
In step 406, it is determined whether each attribute value (value) in the first set of attribute values (values) is equal to a second attribute value (itemValue) corresponding to the object to be operated. In the case that each attribute value (value) in the first attribute value group (values) is not equal to the second attribute value (itemValue) corresponding to the object to be operated, go to step 405; in case that each attribute value (value) in the first attribute value group (values) is equal to the second attribute value (itemValue) corresponding to the object to be operated on, go to step 404.
Step 407, determining that all attribute values in the first attribute value group are matched with the second attribute value corresponding to the object to be operated under the condition that each attribute value in the first attribute value group is respectively matched with the second attribute value corresponding to the object to be operated.
In step 408, in the case that at least one attribute value in the first attribute value set does not match the second attribute value corresponding to the object to be operated, it is determined that all attribute values in the first attribute value set do not match the second attribute value corresponding to the object to be operated.
Optionally, the page operation behavior further includes a post-trigger processing operation, where the post-trigger processing operation includes a form value, a processing parameter function, a request address, a request mode, a first callback function and a second callback function; the first callback function is used for indicating that the current operation behavior is successful or updating page data; the second callback function is used for indicating that the current operation behavior fails; after the page operation behavior is rendered, and the rendered page operation behavior is obtained, the method further comprises:
(a) And under the condition that the form item value is not null, acquiring the target parameter input by the target user.
It should be noted that the page operation behavior further includes a post-trigger processing operation (handler). Table 3 is an object attribute description table of a post-trigger processing operation, and as shown in table 3, the post-trigger processing operation includes a form item value (formItems), a processing parameter function (handleparameters), a request address (requestmearl), a request manner (requestMethd), a first callback function (success), and a second callback function (fail).
TABLE 3 object Property specification Table triggering post-processing operations
The JSON format of the page operation Action is as follows:
/>
the reactinode is a component in the reacti framework, and can be replaced by a component type of a corresponding framework when other frameworks are used. Table 4 is an object property specification table of page operation behavior actions, which includes operation behavior identification (key), rendering operation (display), display condition (condition), and trigger post-processing operation (handler), as shown in Table 4.
TABLE 4 object Property description Table for Page operation Action
/>
Specifically, after the rendered page operation behavior is obtained, that is, after the rendered page operation button is obtained, the target user clicks the rendered page operation button, that is, triggers a trigger event corresponding to the rendered page operation button, and the target user is a user who actually applies the page operation button. Judging whether the form item value is empty, displaying the form according to the interaction mode of the form item value through a popup frame or a drawer under the condition that the form item value is not empty, and acquiring the target parameter (params) input by the target user by filling the target parameter in the displayed form and then clicking a determination button on the popup frame or the drawer by the target user.
Alternatively, in the case where the form value is null, the target parameter is also null.
(b) And under the condition that the processing parameter function is not empty, determining a second parameter corresponding to the processing parameter function based on the current operation behavior of the user, the target parameter and the processing parameter function.
Specifically, whether the processing parameter function is empty is judged, and when the processing parameter function is not empty, the processing parameter function is called, the parameters of the processing parameter function are the current operation behavior (action) of a user and the target parameter, the return value of the processing parameter function is given to the target parameter, a second parameter corresponding to the processing parameter function is obtained, and the second parameter is a new target parameter.
Optionally, in the case where the processing parameter function is empty, the processing parameter function is not processed, and the target parameter is unchanged.
(c) And determining a webpage request based on the second parameter, the request address and the request mode under the condition that the request address is not empty.
Specifically, under the condition that the request address is not null, constructing a webpage request (http request) according to the second parameter, the request address and the request mode; the webpage request comprises a second parameter, a request address and a request mode.
Alternatively, in the case where the request address is empty, the web page request is not constructed.
(d) And executing the first callback function or the second callback function based on the webpage request.
Specifically, depending on the web page request, either the first callback function or the second callback function may be executed.
Optionally, the executing the first callback function or the second callback function based on the web page request includes:
(d-1) determining a return value corresponding to the web page request based on the web page request.
Specifically, a return value (ret) returned by the server is obtained by sending the web page request to the server, so that the return value corresponding to the web page request is determined.
Optionally, in the case that the request address is null, the second parameter is taken as a return value (ret) returned by the server.
(d-2) determining whether the web page request was successful based on the return value.
Specifically, matching the return value with a preset return value, and determining that the webpage request is successful under the condition that the return value is matched with the preset return value; and under the condition that the return value is not matched with the preset return value, determining that the webpage request fails.
(d-3) executing the first callback function if the web page request is successful and the first callback function is not empty; or executing the second callback function under the condition that the webpage request fails and the second callback function is not empty.
Specifically, whether the success value is null is judged, and under the condition that the webpage request is successful and the first callback function is not null, the first callback function is executed, parameters of the first callback function are a current operation behavior (action) and a return value, and the first callback function can prompt or update data of a current page after the current operation behavior is successfully executed according to the current operation behavior and the return value.
Or under the condition that the webpage request fails and the second callback function is not empty, executing the second callback function, wherein parameters of the second callback function are the current operation behavior (action) and the return value, and the second callback function can prompt the failure of executing the current operation behavior according to the current operation behavior and the return value.
Fig. 5 is a schematic process flow diagram of a trigger event corresponding to a post-trigger processing operation provided in the present invention, where, as shown in fig. 5, the process flow diagram includes:
step 501, it is determined whether the form item is empty. If the form value is not empty, go to step 502; in the case where the form value is empty, go to step 503.
Step 502, obtaining target parameters input by a target user. Specifically, the form is displayed according to the form item value through the interaction mode of the popup frame or the drawer, and the target user fills in the target parameter in the displayed form, and then the user clicks the determination button on the popup frame or the drawer, so that the target parameter (params) input by the target user is obtained.
In step 503, the target parameter is null.
Step 504, it is determined whether the process parameter function is null. If the process parameter function is not null, go to step 505; in the event that the process parameter function is empty, go to step 506;
step 505, determining a second parameter corresponding to the processing parameter function based on the current operation behavior of the user, the target parameter and the processing parameter function. Specifically, when the processing parameter function is not null, the processing parameter function is called, the parameters of the processing parameter function are the current operation behavior (action) of the user and the target parameter, the return value of the processing parameter function is given to the target parameter, and a second parameter corresponding to the processing parameter function is obtained, wherein the second parameter is a new target parameter.
Step 506, the processing parameter function is not processed, and the target parameter is unchanged.
Step 507, it is determined whether the request address is empty. If the request address is not empty, go to step 508; if the request address is empty, the process proceeds to step 509.
Step 508, determining a web page request based on the second parameter, the request address and the request mode; and determining a return value corresponding to the webpage request based on the webpage request.
In step 509, the web page request is not constructed, and the second parameter is used as a return value (ret) returned by the server.
Step 510, determining whether the web page request was successful. In case the web page request is successful, go to step 511; in the event that the web page request is unsuccessful, go to step 514.
In step 511, it is determined whether the first callback function is empty. If the first callback function is not empty, go to step 512; in the case that the first callback function is empty, go to step 513.
Step 512, execute the first callback function.
In step 513, the first callback function is not executed.
Step 514, it is determined whether the second callback function is empty. If the second callback function is not empty, go to step 515; in the case that the first callback function is empty, go to step 516.
Step 515, a second callback function is executed.
In step 516, the second callback function is not executed.
FIG. 6 is a second flowchart of a rendering method of page operation behavior according to the present invention, as shown in FIG. 6, the method includes steps 601-605; wherein,
step 601, pre-configuring a page operation behavior array, wherein the page operation behavior array comprises a plurality of page operation behaviors, and each page operation behavior comprises a display condition, a rendering operation and a trigger post-processing operation; the display condition is used for judging whether page operation behaviors are displayed or not; the rendering operation is used for rendering page operation behaviors.
Step 602, based on the display condition, it is determined whether to display the page operation behavior.
In step 603, in the case that the page operation behavior is not displayed, the page operation behavior is not rendered.
Step 604, in the case of displaying the page operation behavior, rendering the page operation behavior based on the rendering operation, to obtain a rendered page operation behavior.
Step 605, a trigger event corresponding to the post-trigger processing operation is processed.
The page operation behavior rendering device provided by the invention is described below, and the page operation behavior rendering device described below and the page operation behavior rendering method described above can be referred to correspondingly.
Fig. 7 is a schematic structural diagram of a rendering device for page operation behavior according to the present invention, and as shown in fig. 7, a rendering device 700 for page operation behavior includes: a configuration module 701, a judgment module 702, and a rendering module 703; wherein,
a configuration module 701, configured to pre-configure a page operation behavior array, where the page operation behavior array includes a plurality of page operation behaviors, and each page operation behavior includes a display condition and a rendering operation; the display condition is used for judging whether the page operation behavior is displayed or not; the rendering operation is used for rendering the page operation behavior;
A judging module 702, configured to judge, for each of the page operation behaviors, whether to display the page operation behavior based on the display condition;
and a rendering module 703, configured to render the page operation behavior based on the rendering operation, to obtain the rendered page operation behavior when the page operation behavior is displayed.
According to the rendering device of the page operation behaviors, the page operation behavior array is preconfigured and comprises a plurality of page operation behaviors, and each page operation behavior comprises display conditions and rendering operations; the display condition is used for judging whether page operation behaviors are displayed or not; the rendering operation is used for rendering page operation behaviors; judging whether to display the page operation behaviors or not according to the display conditions aiming at each page operation behavior; and under the condition that the page operation behaviors are displayed, rendering the page operation behaviors based on the rendering operation to obtain the rendered page operation behaviors. Through pre-configuring each page operation behavior in the page operation behavior array, the page operation behavior is rendered according to the display condition and the rendering operation configuration, front-end coding and rendering operation processing logic are standardized, the complexity of page development work is reduced, and the development efficiency is improved.
Optionally, the display condition includes a weight value and a first attribute value set; the permission value represents permission required by the page operation behavior display; the first attribute value group represents attribute values required for displaying the page operation behavior; the rendering module 703 is specifically configured to:
displaying the page operation behavior under the condition that the value of the display condition is empty;
and judging whether to display the page operation behavior or not based on the authority value and the first attribute value group under the condition that the value of the display condition is not null.
Optionally, the rendering module 703 is further configured to:
determining whether the user has rights or not based on the rights value;
determining whether all attribute values in the first attribute value group are matched with second attribute values corresponding to an object to be operated or not based on the first attribute value group;
and displaying the page operation behavior under the condition that the user has authority and all attribute values in the first attribute value group are matched with the second attribute value.
Optionally, the rendering module 703 is further configured to:
determining that the user has authority under the condition that the authority value is empty;
And under the condition that the authority value is not null, determining whether the user has the authority or not based on the type corresponding to the authority value.
Optionally, the rendering module 703 is further configured to:
under the condition that the type corresponding to the authority value is a character string type, dividing the authority value by adopting a preset dividing character to obtain a first character string array; the first character string array comprises a plurality of first character strings;
judging whether each first character string has authority or not respectively;
and under the condition that all the first character strings have authority, determining that the user has authority.
Optionally, the rendering module 703 is further configured to:
under the condition that the type corresponding to the authority value is a character string array type, judging whether each second character string in the authority value has authority or not respectively;
and determining that the user has authority in the condition that at least one second character string has authority.
Optionally, the rendering module 703 is further configured to:
under the condition that the first attribute value group is empty, determining that all attribute values in the first attribute value group are matched with the second attribute value corresponding to the object to be operated;
under the condition that the first attribute value group is not empty, matching each attribute value in the first attribute value group with the second attribute value corresponding to the object to be operated; and under the condition that each attribute value in the first attribute value group is respectively matched with the second attribute value corresponding to the object to be operated, determining that all attribute values in the first attribute value group are matched with the second attribute value corresponding to the object to be operated.
Optionally, the page operation behavior further includes a post-trigger processing operation, where the post-trigger processing operation includes a form value, a processing parameter function, a request address, a request mode, a first callback function and a second callback function; the first callback function is used for indicating that the current operation behavior is successful or updating page data; the second callback function is used for indicating that the current operation behavior fails; the rendering device 700 of page operation behavior further includes:
the acquisition module is used for acquiring target parameters input by a target user under the condition that the form item value is not null;
the first determining module is used for determining a second parameter corresponding to the processing parameter function based on the current operation behavior of the user, the target parameter and the processing parameter function under the condition that the processing parameter is not empty;
the second determining module is used for determining a webpage request based on the second parameter, the request address and the request mode under the condition that the request address is not empty;
and the execution module is used for executing the first callback function or the second callback function based on the webpage request.
Optionally, the execution module is specifically configured to:
determining a return value corresponding to the webpage request based on the webpage request;
determining whether the web page request is successful based on the return value;
executing the first callback function under the condition that the webpage request is successful and the first callback function is not empty; or executing the second callback function under the condition that the webpage request fails and the second callback function is not empty.
Fig. 8 is a schematic physical structure of an electronic device according to the present invention, as shown in fig. 8, the electronic device 800 may include: processor 810, communication interface (Communications Interface) 820, memory 830, and communication bus 840, wherein processor 810, communication interface 820, memory 830 accomplish communication with each other through communication bus 840. Processor 810 may call logic instructions in memory 830 to perform a rendering method for page operation behavior, the method comprising: pre-configuring a page operation behavior array, wherein the page operation behavior array comprises a plurality of page operation behaviors, and each page operation behavior comprises display conditions and rendering operations; the display condition is used for judging whether the page operation behavior is displayed or not; the rendering operation is used for rendering the page operation behavior; judging whether to display the page operation behaviors or not according to the display conditions aiming at each page operation behavior; and under the condition that the page operation behaviors are displayed, rendering the page operation behaviors based on the rendering operation to obtain the rendered page operation behaviors.
Further, the logic instructions in the memory 830 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of executing a rendering method of page operation behavior provided by the methods described above, the method comprising: pre-configuring a page operation behavior array, wherein the page operation behavior array comprises a plurality of page operation behaviors, and each page operation behavior comprises display conditions and rendering operations; the display condition is used for judging whether the page operation behavior is displayed or not; the rendering operation is used for rendering the page operation behavior; judging whether to display the page operation behaviors or not according to the display conditions aiming at each page operation behavior; and under the condition that the page operation behaviors are displayed, rendering the page operation behaviors based on the rendering operation to obtain the rendered page operation behaviors.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a rendering method for performing page operation behavior provided by the above methods, the method comprising: pre-configuring a page operation behavior array, wherein the page operation behavior array comprises a plurality of page operation behaviors, and each page operation behavior comprises display conditions and rendering operations; the display condition is used for judging whether the page operation behavior is displayed or not; the rendering operation is used for rendering the page operation behavior; judging whether to display the page operation behaviors or not according to the display conditions aiming at each page operation behavior; and under the condition that the page operation behaviors are displayed, rendering the page operation behaviors based on the rendering operation to obtain the rendered page operation behaviors.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for rendering page operations, comprising:
pre-configuring a page operation behavior array, wherein the page operation behavior array comprises a plurality of page operation behaviors, and each page operation behavior comprises display conditions and rendering operations; the display condition is used for judging whether the page operation behavior is displayed or not; the rendering operation is used for rendering the page operation behavior;
judging whether to display the page operation behaviors or not according to the display conditions aiming at each page operation behavior;
and under the condition that the page operation behaviors are displayed, rendering the page operation behaviors based on the rendering operation to obtain the rendered page operation behaviors.
2. The method of rendering page operations of claim 1, wherein the display conditions comprise a set of weight values and first attribute values; the permission value represents permission required by the page operation behavior display; the first attribute value group represents attribute values required for displaying the page operation behavior;
the step of judging whether to display the page operation behavior based on the display condition comprises the following steps:
Displaying the page operation behavior under the condition that the value of the display condition is empty;
and judging whether to display the page operation behavior or not based on the authority value and the first attribute value group under the condition that the value of the display condition is not null.
3. The method for rendering page operations according to claim 2, wherein the determining whether to display the page operations based on the weight value and the first attribute value group comprises:
determining whether the user has rights or not based on the rights value;
determining whether all attribute values in the first attribute value group are matched with second attribute values corresponding to an object to be operated or not based on the first attribute value group;
and displaying the page operation behavior under the condition that the user has authority and all attribute values in the first attribute value group are matched with the second attribute value.
4. A method of rendering page operations according to claim 3, wherein said determining whether the user has permission based on said permission value comprises:
determining that the user has authority under the condition that the authority value is empty;
And under the condition that the authority value is not null, determining whether the user has the authority or not based on the type corresponding to the authority value.
5. The method for rendering page operations according to claim 4, wherein the determining whether the user has the right based on the type corresponding to the right value comprises:
under the condition that the type corresponding to the authority value is a character string type, dividing the authority value by adopting a preset dividing character to obtain a first character string array; the first character string array comprises a plurality of first character strings;
judging whether each first character string has authority or not respectively;
and under the condition that all the first character strings have authority, determining that the user has authority.
6. The method for rendering page operations according to claim 4, wherein the determining whether the user has the right based on the type corresponding to the right value comprises:
under the condition that the type corresponding to the authority value is a character string array type, judging whether each second character string in the authority value has authority or not respectively;
and determining that the user has authority in the condition that at least one second character string has authority.
7. A rendering method of page operations according to claim 3, wherein the determining, based on the first attribute value group, whether all attribute values in the first attribute value group match second attribute values corresponding to an object to be operated, includes:
under the condition that the first attribute value group is empty, determining that all attribute values in the first attribute value group are matched with the second attribute value corresponding to the object to be operated;
under the condition that the first attribute value group is not empty, matching each attribute value in the first attribute value group with the second attribute value corresponding to the object to be operated; and under the condition that each attribute value in the first attribute value group is respectively matched with the second attribute value corresponding to the object to be operated, determining that all attribute values in the first attribute value group are matched with the second attribute value corresponding to the object to be operated.
8. The method of rendering page operations according to any one of claims 1 to 7, wherein the page operations further comprise a post-trigger processing operation, the post-trigger processing operation comprising a form item, a processing parameter function, a request address, a request mode, a first callback function, and a second callback function; the first callback function is used for indicating that the current operation behavior is successful or updating page data; the second callback function is used for indicating that the current operation behavior fails;
After the page operation behavior is rendered, and the rendered page operation behavior is obtained, the method further comprises:
acquiring target parameters input by a target user under the condition that the form item value is not null;
determining a second parameter corresponding to the processing parameter function based on the current operation behavior of the user, the target parameter and the processing parameter function under the condition that the processing parameter is not null;
determining a webpage request based on the second parameter, the request address and the request mode under the condition that the request address is not empty;
and executing the first callback function or the second callback function based on the webpage request.
9. The method for rendering page operations according to claim 8, wherein the executing the first callback function or the second callback function based on the web page request comprises:
determining a return value corresponding to the webpage request based on the webpage request;
determining whether the web page request is successful based on the return value;
executing the first callback function under the condition that the webpage request is successful and the first callback function is not empty; or executing the second callback function under the condition that the webpage request fails and the second callback function is not empty.
10. A rendering apparatus for page operation behavior, comprising:
the configuration module is used for pre-configuring a page operation behavior array, wherein the page operation behavior array comprises a plurality of page operation behaviors, and each page operation behavior comprises a display condition and a rendering operation; the display condition is used for judging whether the page operation behavior is displayed or not; the rendering operation is used for rendering the page operation behavior;
the judging module is used for judging whether the page operation behaviors are displayed or not according to the display conditions aiming at each page operation behavior;
and the rendering module is used for rendering the page operation behaviors based on the rendering operation under the condition that the page operation behaviors are displayed, so as to obtain the rendered page operation behaviors.
CN202311451551.5A 2023-11-02 2023-11-02 Page operation behavior rendering method and device Pending CN117519696A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311451551.5A CN117519696A (en) 2023-11-02 2023-11-02 Page operation behavior rendering method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311451551.5A CN117519696A (en) 2023-11-02 2023-11-02 Page operation behavior rendering method and device

Publications (1)

Publication Number Publication Date
CN117519696A true CN117519696A (en) 2024-02-06

Family

ID=89746824

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311451551.5A Pending CN117519696A (en) 2023-11-02 2023-11-02 Page operation behavior rendering method and device

Country Status (1)

Country Link
CN (1) CN117519696A (en)

Similar Documents

Publication Publication Date Title
US10990511B2 (en) Apparatus and application interface traversing method
US10878121B2 (en) Method and device for converting data containing user identity
US9420031B2 (en) Systems and methods for building and using hybrid mobile applications
CN112577760A (en) Method, system, equipment and readable storage medium for vehicle diagnosis
CN110633390A (en) Method and device for acquiring user behavior path
CN107480117B (en) Recovery method and device for automatic page table single data
CN111552633A (en) Interface abnormal call testing method and device, computer equipment and storage medium
CN108470126B (en) Data processing method, device and storage medium
CN106789973B (en) Page security detection method and terminal equipment
CN111679976A (en) Method and device for searching page object
CN110413279B (en) Data loading method and device
CN112634090A (en) Home decoration information reporting management method, system, computer device and storage medium
CN115795203B (en) Method and device for constructing menu page, electronic equipment and storage medium
CN117519696A (en) Page operation behavior rendering method and device
CN107506124B (en) Video making friends method and system
CN112966252B (en) Client verification method and device based on password technology, electronic equipment and medium
CN111143206B (en) Data acquisition method and device, electronic equipment and storage medium
CN113986941A (en) Transaction batch processing method and device
CN113468076A (en) Application program exception testing method, device, equipment and storage medium
US20170083699A1 (en) Dynamic inline assistance messaging
CN108664253B (en) Application replacement method and device, storage medium and electronic equipment
CN114385054B (en) Form filling method and device, electronic equipment and storage medium
CN111737036B (en) Service processing method and device based on robot flow automation
CN117271482B (en) Historical data migration method and device, electronic equipment and storage medium
US11733847B2 (en) Knowledge engine auto-generation of guided flow experience

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