A page generation method, device, electronic device and computer-readable medium
By receiving page generation requests and parsing configuration information to determine the fine-grained configuration dimensions, and calling page source model loading configuration rules, it solves the problem of changing needs of interface elements display by different user groups, realizing the effect of personalized display and reducing maintenance costs.
Patent Information
- Application Number
- CN202210141086.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-16
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2042-02-16
AI Technical Summary
Different user groups have a variety of needs for personalized display layers such as the display order of the developed interface elements and whether it is visible, resulting in multiple versions of the project, high maintenance costs, and it is difficult to form standard product products.
By receiving page generation requests, obtaining page identification, parsing configuration information to determine the fine-grained configuration dimension, calling page source model loading configuration rules, rendering the page based on configuration rules and displaying them.
Meet the needs of personalized display layers of groups from different dimensions, reduce maintenance costs, and enhance the universality of projects.
Smart Images

Figure CN114527972B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technologies, and in particular, to a page generation method, apparatus, electronic device, and computer-readable medium. Background Art
[0002] When dynamically rendering a page, for the display order and visibility of interface elements that have been developed, etc., it is necessary to branch or split the interface function items on the original basis to achieve the goal. Moreover, the personalized display layer requirements of different user groups are variable, there are multiple project versions, the maintenance cost is high, and it is difficult for the project to form a standard product.
[0003] In the process of implementing this application, the inventors found that there are at least the following problems in the prior art:
[0004] For different user groups, the personalized display layer requirements for the display order and visibility of interface elements that have been developed, etc., are variable, there are multiple project versions, the maintenance cost is high, and it is difficult for the project to form a standard product. Summary of the Invention
[0005] In view of this, embodiments of this application provide a page generation method, apparatus, electronic device, and computer-readable medium, which can solve the problems in the prior art that for different user groups, the personalized display layer requirements for the display order and visibility of interface elements that have been developed, etc., are variable, there are multiple project versions, the maintenance cost is high, and it is difficult for the project to form a standard product.
[0006] To achieve the above object, according to one aspect of the embodiments of this application, a page generation method is provided, including:
[0007] Receiving a page generation request and obtaining a corresponding page identifier;
[0008] According to the page identifier, obtaining corresponding configuration information, and parsing the configuration information to determine corresponding fine-grained configuration dimensions;
[0009] Based on the fine-grained configuration dimensions, calling a corresponding page source model, loading configuration rules in the page source model, and rendering and displaying the page based on the configuration rules.
[0010] Optionally, before calling the corresponding page source model, the method further includes:
[0011] Scanning code files in a target path to obtain page files carrying the page identifier;
[0012] Scanning the page files based on a preset component tag to obtain corresponding elements;
[0013] Determining source model attributes corresponding to the elements, and then generating a page source model based on the elements and the corresponding source model attributes.
[0014] Optionally, a page source model is generated, including:
[0015] Based on the corresponding source model attributes, establish the association relationship between the page and the elements, and then configure the source model based on the fine-grained configuration dimension to generate the page source model.
[0016] Optionally, after generating the page source model, the method further includes:
[0017] Perform persistence processing on the page source model.
[0018] Optionally, determining the corresponding fine-grained configuration dimension includes:
[0019] Obtain the dimension identifier in the configuration information;
[0020] Determine the corresponding fine-grained configuration dimension based on the dimension identifier.
[0021] Optionally, determining the corresponding fine-grained configuration dimension based on the dimension identifier includes:
[0022] In response to determining that the dimension identifier is empty and the user dimension configuration is not empty, determine that the fine-grained configuration dimension corresponding to the dimension identifier is the user;
[0023] In response to determining that the dimension identifier is empty, the user dimension configuration is empty, and the role dimension configuration is not empty, determine that the fine-grained configuration dimension corresponding to the dimension identifier is the role;
[0024] In response to determining that the dimension identifier is empty, the user dimension configuration is empty, the role dimension configuration is empty, and the tenant dimension configuration is not empty, determine that the fine-grained configuration dimension corresponding to the dimension identifier is the tenant.
[0025] Optionally, determining the corresponding fine-grained configuration dimension includes:
[0026] In response to triggering the self-customization event, pop up a floating layer page, obtain the input information of the user for the floating layer page, and determine the corresponding fine-grained configuration dimension based on the input information.
[0027] Optionally, rendering the page based on the configuration rules includes:
[0028] According to the configuration rules, determine the corresponding custom component label;
[0029] Execute the instruction corresponding to the page component with the page identifier to obtain the instruction execution result;
[0030] Dynamically display the elements according to the custom component label and the instruction execution result to perform page rendering.
[0031] In addition, the present application also provides a page generation device, including:
[0032] A receiving unit, configured to receive a page generation request and obtain a corresponding page identifier;
[0033] An analysis unit, configured to obtain corresponding configuration information according to the page identifier, and analyze the configuration information to determine corresponding fine-grained configuration dimensions;
[0034] A page generation unit, configured to call a corresponding page source model based on the fine-grained configuration dimension, load configuration rules in the page source model, and render and display a page based on the configuration rules.
[0035] Optionally, the page generation unit is further configured to:
[0036] Scan code files in a target path to obtain page files carrying the page identifier;
[0037] Scan the page file based on a preset component tag to obtain corresponding elements;
[0038] Determine source model attributes corresponding to the elements, and then generate a page source model based on the elements and the corresponding source model attributes.
[0039] Optionally, the page generation unit is further configured to:
[0040] Establish an association relationship between the page and the elements based on the corresponding source model attributes, and then configure the source model based on the fine-grained configuration dimension to generate a page source model.
[0041] Optionally, the page generation unit is further configured to:
[0042] Perform a persistence process on the page source model.
[0043] Optionally, the analysis unit is further configured to:
[0044] Obtain a dimension identifier in the configuration information;
[0045] Determine corresponding fine-grained configuration dimensions based on the dimension identifier.
[0046] Optionally, the analysis unit is further configured to:
[0047] In response to determining that the dimension identifier is empty and the user dimension configuration is not empty, determine that the fine-grained configuration dimension corresponding to the dimension identifier is the user;
[0048] In response to determining that the dimension identifier is empty, the user dimension configuration is empty, and the role dimension configuration is not empty, determine that the fine-grained configuration dimension corresponding to the dimension identifier is the role;
[0049] In response to determining that the dimension identifier is empty, the user dimension configuration is empty, the role dimension configuration is empty, and the tenant dimension configuration is non-empty, determine that the fine-grained configuration dimension corresponding to the dimension identifier is the tenant.
[0050] Optionally, the parsing unit is further configured to:
[0051] In response to triggering an autonomous customization event, pop up a floating layer page, obtain the input information of the user for the floating layer page, and determine the corresponding fine-grained configuration dimension based on the input information.
[0052] Optionally, the page generation unit is further configured to:
[0053] Determine the corresponding custom component label according to the configuration rule;
[0054] Execute the instruction corresponding to the page component with the page identifier to obtain the instruction execution result;
[0055] Dynamically display elements according to the custom component label and the instruction execution result, and perform page rendering.
[0056] In addition, the present application also provides a page generation electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enabling the one or more processors to implement the page generation method as described above.
[0057] In addition, the present application also provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, it implements the page generation method as described above.
[0058] One embodiment of the above invention has the following advantages or beneficial effects: The present application receives a page generation request, obtains the corresponding page identifier; according to the page identifier, obtains the corresponding configuration information, parses the configuration information to determine the corresponding fine-grained configuration dimension; based on the fine-grained configuration dimension, calls the corresponding page source model, loads the configuration rules in the page source model, and renders and displays the page based on the configuration rules. Based on the fine-grained configuration dimension, calls the corresponding page source model, loads the configuration rules in the page source model, and renders and displays the page based on the configuration rules. Thereby meeting the personalized display layer requirements of different dimensional groups, reducing maintenance costs, and enhancing the universality of the project.
[0059] The further effects of the above non-conventional optional methods will be described in combination with specific embodiments below. Description of the Drawings
[0060] The drawings are used to better understand the present application and do not constitute an improper limitation to the present application. Among them:
[0061] Figure 1It is a schematic diagram of the main process of the page generation method according to the first embodiment of the present application;
[0062] Figure 2 It is a schematic diagram of the main process of the page generation method according to the second embodiment of the present application;
[0063] Figure 3 It is a schematic diagram of the application scenario of the page generation method according to the third embodiment of the present application;
[0064] Figure 4 It is a schematic diagram of the main units of the page generation device according to the embodiment of the present application;
[0065] Figure 5 It is an exemplary system architecture diagram to which the embodiments of the present application can be applied;
[0066] Figure 6 It is a schematic structural diagram of a computer system of a terminal device or a server suitable for implementing the embodiments of the present application. Detailed implementation manners
[0067] The following describes exemplary embodiments of the present application with reference to the accompanying drawings. Various details of the embodiments of the present application are included to assist in understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted below.
[0068] Figure 1 It is a schematic diagram of the main process of the page generation method according to the first embodiment of the present application, as Figure 1 shown, the page generation method includes:
[0069] Step S101, receive a page generation request and obtain the corresponding page identifier.
[0070] In this embodiment, the execution subject of the page generation method (for example, it can be a server) can receive the page generation request through a wired connection or a wireless connection. The page generation request can be a request for customized page rendering and display according to actual services. The page identifier can be the unique identification code of the page defined by the prop attribute, and the corresponding dynamic configuration can be obtained through this identifier.
[0071] Step S102, according to the page identifier, obtain the corresponding configuration information, and parse the configuration information to determine the corresponding fine-grained configuration dimension.
[0072] The execution entity can uniquely determine the configuration information of the corresponding page based on the page identifier. The page configuration information may include fine-grained dimensions (such as tenant level, role level, user level), whether the elements in the component are displayed, and the sorting of the elements in the component, etc. After the execution entity obtains the configuration information corresponding to the page identifier, it can parse the configuration information to determine the fine-grained configuration dimensions included in the configuration information, such as whether it is tenant level, role level, or user level. Then, the execution entity can call the front-end custom VUE component to complete the page rendering of different fine-grained dimensions on the page that needs to be customized. VUE is a progressive JavaScript framework for building user interfaces. Different from other large frameworks, VUE is designed to be applied layer by layer from the bottom up. The core library of VUE only focuses on the view layer, which is not only easy to get started but also convenient to integrate with third-party libraries or existing projects. On the other hand, when used in combination with modern toolchains and various support libraries, VUE can also fully drive complex single-page applications (SPAs).
[0073] Specifically, determining the corresponding fine-grained configuration dimension includes:
[0074] Obtain the dimension identifier in the configuration information. For example, ZH corresponding to the tenant dimension, JS corresponding to the role dimension, and YH corresponding to the user dimension. The specific representation form of the dimension identifier in the embodiments of the present application is not limited. Furthermore, based on the preset correspondence between the dimension identifier and the fine-grained configuration dimension, the execution entity can determine the corresponding fine-grained configuration dimension based on the dimension identifier in the configuration information. For example, when the dimension identifier is ZH, the corresponding fine-grained configuration dimension is tenant; when the dimension identifier is JS, the corresponding fine-grained configuration dimension is role; when the dimension identifier is YH, the corresponding fine-grained configuration dimension is user.
[0075] Specifically, determining the corresponding fine-grained configuration dimension based on the dimension identifier includes:
[0076] In response to determining that the dimension identifier is empty and the user dimension configuration is not empty, determine that the fine-grained configuration dimension corresponding to the dimension identifier is user; in response to determining that the dimension identifier is empty, the user dimension configuration is empty, and the role dimension configuration is not empty, determine that the fine-grained configuration dimension corresponding to the dimension identifier is role; in response to determining that the dimension identifier is empty, the user dimension configuration is empty, the role dimension configuration is empty, and the tenant dimension configuration is not empty, determine that the fine-grained configuration dimension corresponding to the dimension identifier is tenant. By way of example, for customizing whether the elements in the component are displayed, sorted, etc., when there is corresponding customized configuration information in the user dimension, it is configured according to the user dimension; when there is no customized configuration information in the user dimension, it is configured according to the role dimension, and when there is no corresponding customized configuration information in the role dimension, it is configured according to the tenant dimension. If none of them exist, it is ignored.
[0077] Of course, the execution entity can also provide a floating layer on a page that supports customization, allowing users to customize it independently, which is more flexible. Specifically, the corresponding fine-grained configuration dimensions are determined, including:
[0078] In response to triggering an independent customization event, a floating layer page is popped up, and the input information of the user for the floating layer page is obtained. Based on the input information, the corresponding fine-grained configuration dimensions are determined. Specifically, the input information may include the fine-grained dimensions of the page source model to be created (such as tenant level, role level, or user level, etc.), whether the elements of the components in the page source model to be created are displayed, and the sorting order, etc.
[0079] Step S103: Based on the fine-grained configuration dimensions, call the corresponding page source model, load the configuration rules in the page source model, and render and display the page based on the configuration rules.
[0080] Specifically, rendering the page based on the configuration rules includes:
[0081] According to the configuration rules, the corresponding custom component tags are determined. The custom component tags may include the tags corresponding to the VUE components customized on the front end.
[0082] The execution entity can load the configuration rules, then load the corresponding configuration, determine the corresponding custom component tags, and then locate the custom components based on the custom component tags to parse the custom components / directives in the configuration to execute the configuration rules, and further render the page presentation layer.
[0083] Specifically, the front-end custom VUE components: <m-page prop='xxx'>, <m-query prop='xxx'>, <m-table prop='xxx'>, <m-column prop='xxx'>, and the directive: v-mshow:xxx='data' can be used on the pages that need to be customized to complete different levels of fine-grained dynamic rendering. Among them, <m-page prop='xxx'> is the page identification component, which defines the unique identifier of the page through the prop attribute, and obtains the corresponding dynamic configuration through this identifier. <m-query prop='xxx'> is the query area component, and the prop marks the component code. Multiple areas on the same page are allowed to use this component, and each component is independent and does not affect each other. The corresponding component-related configuration is obtained from the page configuration, and dynamic rendering is completed by using the v-mshow directive on the elements within the component. <m-table prop='xxx'> and <m-column prop='xxx'> are table area components, and the prop marks the component code. Multiple areas on the same page are allowed to use this component, and each component is independent and does not affect each other. The prop of the <m-column> component marks the attribute name that needs to be dynamically displayed, and the corresponding configuration is parsed to complete the dynamic rendering of the table columns. Among them, the operation buttons in the operation column of the table area are components of v-mshow:xxx='scope.row', and the configuration information is parsed to complete the dynamic rendering of the buttons or elements in the table operation area. Among them, v-mshow is a custom VUE directive, and its function is to use this directive on page elements, and through obtaining the back-end configuration, the dynamic display or hiding of the page elements can be completed.
[0084] Execute the instructions corresponding to the page components corresponding to the page identifier to obtain the instruction execution result; dynamically display the elements according to the custom component tags and the instruction execution result, and perform the rendering of the page.
[0085] For example, the instruction: v-mshow:xxx='data' element is used to determine whether to display a custom instruction. Here, xxx identifies the element name using this instruction, and data is the source data when executing this instruction (the table can use the current row data). When the element configuration is defined as an EL expression, such as {data.lineType!=='101' && data.loadType === '1'}, it is determined whether to display the element by parsing the result of the expression. The result of the expression is a boolean value, either true or false. The EL expression is represented by ${}, for example, the logical expressions ${true and false}, ${1 === 2} both result in false. It is an expression used to define whether an interface element can be displayed. Other expressions can be used here instead. The expression can be defined according to business attributes. For example, when the document status is signed, the confirm receipt button can be displayed (here the document status attribute name is status, and completed can be represented by 1), and the expression is: ${status === 1}. When the document status in the actual business is signed and the result is true, the confirm receipt button is displayed, otherwise it is not displayed.
[0086] In the embodiments of the present application, for the VUE front-end page, a way is provided to dynamically render page elements with as little code modification as possible. Through customized configuration, the same functional page can meet the real-time and dynamic display of different interface requirements for different user groups in different dimensions such as different tenants and different permission roles, without making different branch processes for the page or the backend, reducing the complexity of business scenario adaptation and development costs. It is applicable to VUE projects that have been developed or newly developed.
[0087] This embodiment receives a page generation request, obtains the corresponding page identifier; according to the page identifier, obtains the corresponding configuration information, parses the configuration information to determine the corresponding fine-grained configuration dimension; based on the fine-grained configuration dimension, calls the corresponding page source model, loads the configuration rules in the page source model, and renders and displays the page based on the configuration rules. Based on the fine-grained configuration dimension, calls the corresponding page source model, loads the configuration rules in the page source model, and renders and displays the page based on the configuration rules. Thus, it meets the personalized display layer requirements of different dimensional groups, reduces maintenance costs, and enhances the universality of the project.
[0088] Figure 2 It is a schematic diagram of the main process of the page generation method according to the second embodiment of the present application, as Figure 2 shown, the page generation method includes:
[0089] Step S201, scan the code files in the target path to obtain the page files carrying the page identifier.
[0090] Backend configuration: First, the execution entity can divide page elements into four major types: basic elements (such as: input), display items (such as: label), table items (such as: table columns), and table operation items (such as: buttons in table operation columns, etc.). Page components are divided into two major types: query components and table components. First, the execution entity can use a front-end code scanner to scan all or part of the code in a specified path.
[0091] Step S202: Scan the page file based on a preset component tag to obtain the corresponding elements.
[0092] By scanning the dynamic page unique identifier (i.e., page identifier) of <m-page prop='xxx'>, it is used to identify the mapping relationship between the page and its configuration items. Scan <m-query> <m-table>Elements under the tag, for example, pageCode, componentList, etc.
[0093] Step S203: determine the source model attribute corresponding to the element, and then generate a page source model based on the element and the corresponding source model attribute.
[0094] The execution subject can call the execution script analyzer to store each element under the component tag in a component with key-value-type, that is, a component contains multiple elements. For example, code, name, type, elementList and other elements are stored in the componentList component.
[0095] For example, the implementation of dynamically scanning and generating a page source model is as follows:
[0096]
[0097]
[0098] Then, the execution subject can store the multiple page model generation files obtained by analysis to a local or fixed address, and call the backend service through file import or directly call the backend service for persistence. Provide manual configuration management function, the administrator can customize the page configuration of different dimensions at the tenant level, role level, user level and other fine-grained levels for the page source model, and customize whether to display and sort the elements in the component. Page registration: dynamic scanning or manual creation. Component definition: dynamic scanning or manual creation. Page configuration: dynamic scanning or manual creation, whether to display the item defaults to "true" (support EL expression: the final result is a Boolean value). When the user has not customized, configure by role, when the role is not configured, configure by tenant, if none, ignore, the fine-grained configuration level can be used according to the actual scenario. At this point, the page model dynamic generator completes the mapping relationship between the actual business code and the configuration. It can also provide a floating layer on the page that supports customization, which is more flexible for users to customize.
[0099] This embodiment can realize a multi-dimensional customized interface by dynamically scanning and generating a page source model. It can realize tenant-level, role-level, user-level and other granularity configurations through parsing configuration to achieve a complete solution for new and old projects to realize dynamic page display more quickly, simply and flexibly.
[0100] Specifically, generate a page source model, including:
[0101] Based on the corresponding source model attributes, the association relationship between the page and the element is established, and then the source model is configured based on the fine-grained configuration dimension to generate a page source model.
[0102] The function of the code scanner is that after the front-end development accesses the dynamic page components, it marks the unique page identifier, the elements and components that need to be dynamically displayed. The execution entity can dynamically create a page source model through the code scanner, and then different dimensions of configurations can be established based on each source model to dynamically render different display layers. When the code changes and the elements that need to be controlled for display on the page change, there is no need to manually maintain different dimensions of configurations. Here, the page source model can also be created manually to replace the code scanner, that is, when the code changes and the elements that need to be controlled for display on the page change, different dimensions of configurations need to be manually maintained. The above is the configuration tense, that is, the initial configuration of the dynamic page is completed.
[0103] Specifically, after generating the page source model, the method further includes:
[0104] Performing a persistence process on the page source model.
[0105] Specifically, performing a persistence process on the page source model includes:
[0106] Obtaining the page source model, configuring model attribute rules according to levels, scenarios, etc., and generating rules (such as Tenant A, Tenant B, Tenant A - User) and storing them in the rule pool.
[0107] Step S204, receiving a page generation request and obtaining the corresponding page identifier.
[0108] Step S205, according to the page identifier, obtaining the corresponding configuration information and parsing the configuration information to determine the corresponding fine-grained configuration dimension.
[0109] Step S206, based on the fine-grained configuration dimension, calling the corresponding page source model, loading the configuration rules in the page source model, and rendering and displaying the page based on the configuration rules.
[0110] When in the running tense, the execution entity receives a page generation request, and then obtains the corresponding page identifier, that is, the unique page identifier, and completes the dynamic rendering of the page by calling the dynamic page components to obtain the configurations of the corresponding dimensions.
[0111] In the embodiments of the present application, the levels involved include: tenant level, role level, user level, etc. The page source model: used to describe the relationship between all elements of a page and its components. By configuring the source model at a fine-grained level according to levels. The page unique identification code: used to identify a page. Model attributes: used to identify component elements. Tenant: A tenant is equivalent to an organization, and multi-tenancy = multiple organizations. Role: The permission to operate functions. User: A member under an organization. The relationship among the three: A tenant can have multiple roles and users; a user can have multiple roles and tenants; a role grants a user the permission to operate functions. The fine-grained model is to subdivide the objects in the business model to obtain a more scientific and reasonable object model. Intuitively, it is to divide into many objects. The higher the degree of refinement, the smaller the granularity level; on the contrary, the lower the degree of refinement, the larger the granularity level. Granularity is used for access authorization.
[0112] Figure 3 It is a schematic diagram of the application scenario of the page generation method according to the third embodiment of the present application. The page generation method of the embodiments of the present application can be applied to the scenario of dynamic page rendering. As Figure 3 shown, the server 302 receives the page generation request 301 and obtains the corresponding page identifier 303. The server 302 obtains the corresponding configuration information 304 according to the page identifier 303, parses the configuration information 304 to determine the corresponding fine-grained configuration dimension 305. The server 302 invokes the corresponding page source model 306 based on the fine-grained configuration dimension 305, loads the configuration rules 307 in the page source model 306, and renders and displays the page 308 based on the configuration rules 307.
[0113] Figure 4 It is a schematic diagram of the main units of the page generation device according to the embodiments of the present application. As Figure 4 shown, the page generation device includes a receiving unit 401, an analysis unit 402, and a page generation unit 403.
[0114] The receiving unit 401 is configured to receive a page generation request and obtain the corresponding page identifier.
[0115] The analysis unit 402 is configured to obtain the corresponding configuration information according to the page identifier, parse the configuration information to determine the corresponding fine-grained configuration dimension.
[0116] The page generation unit 403 is configured to invoke the corresponding page source model based on the fine-grained configuration dimension, load the configuration rules in the page source model, and render and display the page based on the configuration rules.
[0117] In some embodiments, the page generation unit 403 is further configured to: scan the code files in the target path to obtain page files carrying page identifiers; scan the page files based on preset component tags to obtain corresponding elements; determine the source model attributes corresponding to the elements, and then generate a page source model based on the elements and the corresponding source model attributes.
[0118] In some embodiments, the page generation unit 403 is further configured to: establish an association relationship between the page and the elements based on the corresponding source model attributes, and then configure the source model based on the fine-grained configuration dimension to generate a page source model.
[0119] In some embodiments, the page generation unit 403 is further configured to: perform a persistence process on the page source model.
[0120] In some embodiments, the parsing unit 402 is further configured to: obtain the dimension identifier in the configuration information; determine the corresponding fine-grained configuration dimension based on the dimension identifier.
[0121] In some embodiments, the parsing unit 402 is further configured to: in response to determining that the dimension identifier is empty and the user dimension configuration is not empty, determine that the fine-grained configuration dimension corresponding to the dimension identifier is the user; in response to determining that the dimension identifier is empty, the user dimension configuration is empty, and the role dimension configuration is not empty, determine that the fine-grained configuration dimension corresponding to the dimension identifier is the role; in response to determining that the dimension identifier is empty, the user dimension configuration is empty, the role dimension configuration is empty, and the tenant dimension configuration is not empty, determine that the fine-grained configuration dimension corresponding to the dimension identifier is the tenant.
[0122] In some embodiments, the parsing unit 402 is further configured to: in response to triggering an independent customization event, pop up a floating layer page, obtain the input information of the user for the floating layer page, and determine the corresponding fine-grained configuration dimension based on the input information.
[0123] In some embodiments, the page generation unit 403 is further configured to: determine the corresponding custom component tag according to the configuration rule; execute the instruction of the page component corresponding to the page identifier to obtain an instruction execution result; dynamically display the elements according to the custom component tag and the instruction execution result, and perform page rendering.
[0124] It should be noted that there is a corresponding relationship in the specific implementation content between the page generation method and the page generation device of the present application, so the repeated content will not be described again.
[0125] Figure 5 An exemplary system architecture 500 to which the page generation method or the page generation device of the embodiments of the present application can be applied is shown.
[0126] As Figure 5 As shown, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0127] Users can use the terminal devices 501, 502, 503 to interact with the server 505 through the network 504 to receive or send messages, etc. Various communication client applications may be installed on the terminal devices 501, 502, 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0128] The terminal devices 501, 502, 503 may be various electronic devices with a page generation processing screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, and desktop computers, etc.
[0129] The server 505 may be a server providing various services, such as a background management server (only as an example) that supports page generation requests submitted by users using the terminal devices 501, 502, 503. The background management server may receive a page generation request, obtain the corresponding page identifier; according to the page identifier, obtain the corresponding configuration information, parse the configuration information to determine the corresponding fine-grained configuration dimension; based on the fine-grained configuration dimension, call the corresponding page source model, load the configuration rules in the page source model, and render and display the page based on the configuration rules. Based on the fine-grained configuration dimension, call the corresponding page source model, load the configuration rules in the page source model, and render and display the page based on the configuration rules. Thus, it can meet the personalized display layer requirements of different dimensional groups, reduce maintenance costs, and enhance the universality of the project.
[0130] It should be noted that the page generation method provided by the embodiments of the present application is generally executed by the server 505. Correspondingly, the page generation device is generally set in the server 505.
[0131] It should be understood that Figure 5 the numbers of the terminal devices, the network, and the server in
[0132] are merely illustrative. According to the implementation needs, there may be any number of terminal devices, networks, and servers. Figure 6 are merely illustrative. According to the implementation needs, there may be any number of terminal devices, networks, and servers. Figure 6 The terminal device shown is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
[0133] As Figure 6 shown, computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage section 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the computer system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0134] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read from it can be installed into the storage section 608 as needed.
[0135] Specifically, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above functions defined in the system of the present application are executed.
[0136] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device. And in this application, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0137] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0138] The units involved in the embodiments described in this application can be implemented in software or in hardware. The described units can also be provided in a processor. For example, it can be described as: A processor includes a receiving unit, a parsing unit, and a page generating unit. Among them, the names of these units do not, in some cases, limit the units themselves.
[0139] As another aspect, this application also provides a computer-readable medium. The computer-readable medium can be included in the device described in the above embodiments; it can also exist alone without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by the device, the device receives a page generation request, obtains the corresponding page identifier; according to the page identifier, obtains the corresponding configuration information, parses the configuration information to determine the corresponding fine-grained configuration dimension; based on the fine-grained configuration dimension, calls the corresponding page source model, loads the configuration rules in the page source model, and renders and displays the page based on the configuration rules. Based on the fine-grained configuration dimension, call the corresponding page source model, load the configuration rules in the page source model, and render and display the page based on the configuration rules.
[0140] According to the technical solution of the embodiments of this application, the personalized display layer requirements of different dimensional groups can be met, the maintenance cost can be reduced, and the universality of the project can be enhanced.
[0141] The above specific embodiments do not limit the protection scope of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of this application should be included within the protection scope of this application. < / m-query>
Claims
1. A page generation method, characterized in that, it includes: Receiving a page generation request and obtaining the corresponding page identifier; According to the page identifier, obtaining the corresponding configuration information, and parsing the configuration information to determine the corresponding fine-grained configuration dimension; The determining the corresponding fine-grained configuration dimension includes: obtaining the dimension identifier in the configuration information; determining the corresponding fine-grained configuration dimension based on the dimension identifier; the determining the corresponding fine-grained configuration dimension based on the dimension identifier includes: in response to determining that the dimension identifier is empty and the user dimension configuration is not empty, determining that the fine-grained configuration dimension corresponding to the dimension identifier is the user; in response to determining that the dimension identifier is empty, the user dimension configuration is empty, and the role dimension configuration is not empty, determining that the fine-grained configuration dimension corresponding to the dimension identifier is the role; in response to determining that the dimension identifier is empty, the user dimension configuration is empty, the role dimension configuration is empty, and the tenant dimension configuration is not empty, determining that the fine-grained configuration dimension corresponding to the dimension identifier is the tenant; Based on the fine-grained configuration dimension, calling the corresponding page source model, loading the configuration rules in the page source model, and rendering and displaying the page based on the configuration rules. The custom components corresponding to the configuration rules include a query area component. Rendering the page based on the configuration rules includes: using the query area component in multiple areas of the same page to obtain the corresponding component-related configuration from the configuration information, and completing the dynamic rendering of the corresponding page display layer by using the v-mshow directive on the elements within the corresponding component. The v-mshow directive is a custom VUE directive, and the function of the v-mshow directive is to use this directive on page elements, and by obtaining the backend configuration, the dynamic display or hiding of the page element can be completed.
2. The method according to claim 1, characterized in that, before the calling the corresponding page source model, the method further includes: Scanning the code files under the target path to obtain the page file carrying the page identifier; Scanning the page file based on the preset component tags to obtain the corresponding elements; Determining the source model attributes corresponding to the elements, and then generating a page source model based on the elements and the corresponding source model attributes.
3. The method according to claim 2, characterized in that, the generating the page source model includes: Based on the corresponding source model attributes, establishing an association relationship between the page and the elements, and then configuring the source model based on the fine-grained configuration dimension to generate a page source model.
4. The method according to any one of claims 2 to 3, characterized in that, after the generating the page source model, the method further includes: Performing a persistence process on the page source model.
5. The method according to claim 1, characterized in that, the determining the corresponding fine-grained configuration dimension includes: In response to triggering an independent customization event, popping up a floating layer page, obtaining the input information of the user for the floating layer page, and determining the corresponding fine-grained configuration dimension based on the input information.
6. The method according to claim 1, characterized in that, Rendering a page based on the configuration rules includes: Determining corresponding custom component tags according to the configuration rules; Executing the instructions corresponding to the page components with the page identifier to obtain an instruction execution result; Dynamically displaying elements according to the custom component tags and the instruction execution result to render the page.
7. A page generation device characterized in that it includes: A receiving unit configured to receive a page generation request and obtain a corresponding page identifier; An analysis unit configured to obtain corresponding configuration information according to the page identifier, analyze the configuration information to determine corresponding fine-grained configuration dimensions; The determination of the corresponding fine-grained configuration dimension includes: obtaining a dimension identifier in the configuration information; determining a corresponding fine-grained configuration dimension based on the dimension identifier; the determination of the corresponding fine-grained configuration dimension based on the dimension identifier includes: in response to determining that the dimension identifier is empty and the user dimension configuration is not empty, determining that the fine-grained configuration dimension corresponding to the dimension identifier is the user; in response to determining that the dimension identifier is empty, the user dimension configuration is empty and the role dimension configuration is not empty, determining that the fine-grained configuration dimension corresponding to the dimension identifier is the role; in response to determining that the dimension identifier is empty, the user dimension configuration is empty, the role dimension configuration is empty and the tenant dimension configuration is not empty, determining that the fine-grained configuration dimension corresponding to the dimension identifier is the tenant; A page generation unit configured to, based on the fine-grained configuration dimension, call a corresponding page source model, load configuration rules in the page source model, render and display the page based on the configuration rules, the custom components corresponding to the configuration rules include a query area component, and rendering the page based on the configuration rules includes: using the query area component in multiple areas of the same page to obtain configuration related to the corresponding component from the configuration information, and dynamically rendering the corresponding page display layer by using the v-mshow instruction on the elements within the corresponding component. The v-mshow instruction is a custom VUE instruction, and the function of the v-mshow instruction is to use this instruction on a page element, and by obtaining the backend configuration, the dynamic display or hiding of the page element can be completed.
8. The device according to claim 7 characterized in that the page generation unit is further configured to: Scan the code files in the target path to obtain page files carrying the page identifier; Scan the page files based on preset component tags to obtain corresponding elements; Determine the source model attributes corresponding to the elements, and then generate a page source model based on the elements and the corresponding source model attributes.
9. A page generation electronic device characterized in that it includes: One or more processors; A storage device for storing one or more programs When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any one of claims 1-6.
10. A computer-readable medium having a computer program stored thereon characterized in that When the described program is executed by a processor, it implements the method according to any one of claims 1-6.
Citation Information
Patent Citations
Page information individualization processing method, device and system
CN108153788A
Method and system for controlling user authority
CN109214151A
Method and device for controlling display permission of page elements, equipment and medium
CN113536253A
Template page dynamic adjustment method and device, computer equipment and storage medium
CN114003816A