CN115576556A - element-UI-based paging method, system, device and storage medium - Google Patents

element-UI-based paging method, system, device and storage medium Download PDF

Info

Publication number
CN115576556A
CN115576556A CN202211322850.4A CN202211322850A CN115576556A CN 115576556 A CN115576556 A CN 115576556A CN 202211322850 A CN202211322850 A CN 202211322850A CN 115576556 A CN115576556 A CN 115576556A
Authority
CN
China
Prior art keywords
target
page
view
logic
paging
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
CN202211322850.4A
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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202211322850.4A priority Critical patent/CN115576556A/en
Publication of CN115576556A publication Critical patent/CN115576556A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Abstract

The invention provides a paging method, a paging system, paging equipment and a paging storage medium based on element-UI, wherein the method comprises the following steps: acquiring a page sub-view contained in a target page according to the page layout information of the target page; configuring target business logic for the page sub-view according to UI display information and associated business logic corresponding to the page sub-view; acquiring a logic input parameter and a target paging attribute corresponding to the page sub-view according to the target service logic corresponding to the page sub-view; calling a logic implementation function in the public folder according to the logic input parameters corresponding to the page sub-view to obtain a target event processing function; and assigning the target paging attribute and the target event processing function to an abstract component in the page sub-view so as to realize paging. The embodiment of the invention provides a paging method which can support various service scenes and ensure the flexibility of paging components, effectively improves the robustness of the paging method and can be suitable for various service scenes.

Description

element-UI-based paging method, system, device and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a paging method, a paging system, paging equipment and a paging storage medium based on element-UI (user interface).
Background
In background class management systems of APPs (application program) such as money and money payment, paging is a service requirement with very high use frequency, almost all data related to tables are processed through paging when all payment schemes are realized at the front end, so that a page is prevented from crashing due to one-time loading of too much data, and page fluency is guaranteed. In a system developed by a front end based on a vue framework, an element-UI is generally selected as a UI component library of the system, and the element-UI also provides a paging component to realize paging effect. When the paging requirement on business needs to be realized, a callback function corresponding to an event needs to be written, the value of the paging attribute is changed, and then the data is obtained again to update the page content.
Generally, in order to enable logical multiplexing, a component packaging method is adopted, however, one problem of this method is that: if only a few commonly used attribute APIs are opened, the components are not universal, and cannot always be supported when a service demand scenario changes, and a developer needs to write a set of paging scheme of the developer, and if the developer wants to ensure that the components can support all service scenarios, all APIs and event processing functions need to be included, so that the encapsulation is redundant, and the significance is not great.
Therefore, there is a need for a method that can support various service scenarios and ensure the flexibility and scalability of paging components to achieve fast paging.
Disclosure of Invention
The embodiment of the invention provides a paging method, a paging system, a paging device and a paging storage medium based on element-UI (user interface), and mainly aims to provide a paging method which can support various service scenes and ensure the flexibility of paging components, effectively improve the robustness of the paging method and be suitable for various service scenes.
In a first aspect, an embodiment of the present invention provides an element-UI-based paging method, including:
acquiring a page sub-view contained in a target page according to page layout information of the target page, wherein the page sub-view comprises abstract components in the target page;
acquiring service logic associated with the UI display information according to the UI display information corresponding to the page sub-view, and respectively configuring target service logic for the page sub-view;
acquiring a logic input parameter and a target paging attribute corresponding to the page sub-view according to the target service logic corresponding to the page sub-view;
calling a logic implementation function in a public folder according to a logic input parameter corresponding to the page sub-view to obtain a target event processing function, wherein the logic implementation function calls the target event processing function according to the logic input parameter to implement the target service logic, and the target event processing function comprises the target paging attribute;
and assigning a target paging attribute and a target event processing function to an abstract component in the page sub-view so as to realize paging of the target page.
Preferably, the calling a logic implementation function in a common folder according to the logic input parameter corresponding to the page sub-view to obtain a target event processing function includes:
analyzing the logic input parameters corresponding to the page sub-view to acquire a service sub-logic;
acquiring an alternative event processing function and a logic number according to the service sub-logic;
and associating the target paging attribute to the alternative event processing function, setting a calling relation according to the alternative event processing function according to the logic number, and finally obtaining the target event processing function.
Preferably, the setting, according to the logic number, a call relationship according to the alternative event processing function to finally obtain the target event processing function includes:
acquiring a position corresponding to each alternative event processing function and a corresponding relation between each alternative event processing function and the target paging attribute according to the logic number;
acquiring each alternative event processing function related to the target paging attribute according to the corresponding relation between each alternative event processing function and the target paging attribute;
and setting each alternative event processing function related to the target paging attribute to a corresponding position, and acquiring the target event processing function.
Preferably, the configuring the target business logic for the page sub-views respectively comprises:
and acquiring the target service logic corresponding to the page sub-view through a data processing layer, wherein the data processing layer is created according to the page sub-view and is used for finishing data request and logic processing on the page sub-view.
Preferably, there are a plurality of page sub-views, and the assigning the target paging attribute and the target event handling function to an abstract component in the page sub-view further includes:
the life cycle of each page sub-view is set such that each page sub-view has an independent life cycle.
Preferably, the setting the life cycle of each page sub-view includes:
inheriting a life cycle interface of a page base class through a page sub-view to enable the page sub-view to obtain an independent life cycle, wherein the life cycle interface comprises life cycle callback functions of interfaces in an operating system under multiple states;
and binding the life cycle of the page sub-view with the life cycle of the target page so that the operating system calls the life cycle of the page sub-view through the target interface.
Preferably, the assigning the target paging attribute and the target event handling function to the abstract component in the page sub-view further includes:
and rendering the UI interface corresponding to the page sub-view according to the UI display information corresponding to the page sub-view.
In a second aspect, an embodiment of the present invention provides an element-UI-based paging system, including:
the view module is used for acquiring a page sub-view contained in a target page according to page layout information of the target page, wherein the page sub-view comprises an abstract component in the target page;
the logic module is used for acquiring service logic associated with the UI display information according to the UI display information corresponding to the page sub-view, and respectively configuring target service logic for the page sub-view;
the attribute module is used for acquiring a logic input parameter and a target paging attribute corresponding to the page sub-view according to the target service logic corresponding to the page sub-view;
the calling module is used for calling a logic implementation function in a public folder according to a logic input parameter corresponding to the page sub-view to obtain a target event processing function, wherein the logic implementation function calls a related event processing function according to the logic input parameter to implement the target service logic, and the event processing function comprises the target paging attribute;
and the paging module is used for assigning a target paging attribute and a target event processing function to the abstract component in the page sub-view so as to realize paging of the target page.
In a third aspect, an embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the element-UI-based paging method when executing the computer program.
In a fourth aspect, an embodiment of the present invention provides a computer storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of the element-UI-based paging method described above.
According to the element-UI-based paging method, the element-UI-based paging system, the element-UI-based paging device and the element-UI-based paging storage medium, the page sub-view is obtained according to the page layout information of the target page, the target service logic corresponding to the page sub-view is obtained according to the UI display information corresponding to the page sub-view, the event processing function to be called is obtained according to the event processing function information contained in the logic input function, and the calling of the event processing function corresponding to the function is achieved through the logic in the public folder, so that the target service logic corresponding to the page sub-view is achieved. The embodiment of the invention can be free from the restriction of service scenes by carrying out a generalized processing mode on the event calling logic, can be used at any time when realizing the service function, greatly saves the time for processing paging, does not lose the flexibility and expandability of the original UI component compared with the secondary packaging of the component, has higher practicability, effectively improves the robustness of the paging method, and can be suitable for various service scenes.
Drawings
Fig. 1 is a schematic view of an application scenario of a paging method based on element-UI according to an embodiment of the present invention;
FIG. 2 is a flowchart of an element-UI based paging method according to an embodiment of the present invention;
FIG. 3 is a flow chart of obtaining a target event handling function according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating setting a call relationship of an alternative event handling function according to a logic number to obtain a target event handling function according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an element-UI-based paging system according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device provided in an embodiment of the present invention.
The implementation, functional features and advantages of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making creative efforts shall fall within the protection scope of the present application. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Fig. 1 is a schematic view of an application scenario of a paging method based on element-UI according to an embodiment of the present invention, and as shown in fig. 1, a user inputs page layout information of a target page on a page provided by a client, the client sends the page layout information to a server after receiving the page layout information, and the server executes the paging method based on element-UI after receiving the page layout information, so as to page the target page.
It should be noted that the server may be implemented by an independent server or a server cluster composed of a plurality of servers. The client may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, and the like. The client and the server may be connected through bluetooth, USB (Universal Serial Bus), or other communication connection manners, which is not limited in this embodiment of the present invention.
In the prior art, the logic and UI of component encapsulation are all encapsulated in one file, and several common attributes and event processing methods are exposed to the outside for implementation. Just because the UI is also encapsulated inside, the encapsulated component has no exposed properties and methods, and the component user cannot operate on the original UI component, resulting in its loss of usability. Therefore, in the prior art, the scheme for realizing fast paging either sacrifices flexibility and expandability or slightly shows chicken ribs, which is of little significance, so that a more general scheme is needed to meet the requirements of flexibility, expandability and adaptation to various service scenes.
In order to enable a scheme to be more general, and only perform generalized processing on logic without packaging UI components, an embodiment of the present invention provides an element-UI-based paging method, and fig. 2 is a flowchart of the element-UI-based paging method provided in the embodiment of the present invention, where as shown in fig. 2, the method includes:
s210, acquiring a page sub-view contained in a target page according to page layout information of the target page, wherein the page sub-view comprises an abstract component in the target page;
firstly, according to page layout information of a target page, a page sub-view included in the target page is obtained, the target page is a page needing paging, interface elements in the target page can be abstracted into the page sub-view, and the page layout information comprises the interface elements and page element layout in the target page. The page sub-view can be a coarse-grained abstraction component in the target page, the coarse-grained abstraction component can be reused, and the reusable component can greatly reduce the code writing and code storage of the same page sub-view, so that the development cost is saved. The page layout information comprises function module information of the target page and all components included in each function module, the function module information of the target page comprises which function modules are included in the target page, and if the target page is a webpage for car insurance purchase, the target page can be divided into three functions, namely a search module, a login module and a car insurance purchase module; for another example, the target page is used for managing an online wallet and is used for online payment, and the target page can be divided into a login module, a payment module, a financing module and the like, and can be specifically determined according to actual requirements of an enterprise; therefore, the page indication map is the function module in the target page. In the embodiment of the invention, the page sub-view comprises all abstract components in the target page, which means that the page sub-view comprises all abstract components of corresponding functional modules, if the target page is a webpage for buying car insurance, the page sub-view corresponding to the search module comprises all abstract components corresponding to the search module, such as a search frame component, a search button component and the like; the page sub-view corresponding to the login module comprises all abstract components corresponding to the login module, such as a login button, an account password text box, a gender selection button, a birthday selection drop-down box and the like; the vehicle insurance purchasing module comprises a vehicle insurance introduction button, a vehicle insurance information display frame and the like.
The smallest interface element in the operating system may be abstracted into a single page sub-view, for example, the elements of the UI interface in the android operating system may be abstracted into a page sub-view, each element of the UI interface may be respectively used as a coarse-grained abstraction component, each element is separately constructed into a page sub-view, the constructed page sub-view has a function of a corresponding element, and the function of the corresponding element may include logic processing and page display.
S220, acquiring service logic associated with the UI display information according to the UI display information corresponding to the page sub-view, and respectively configuring target service logic for the page sub-view;
and then according to the UI display information corresponding to the page sub-views, acquiring the service logic associated with the UI display information to obtain the target service logic of the page sub-views, wherein each page sub-view has the corresponding target service logic. The UI display information in the embodiment of the invention refers to the content displayed on a target page seen by a user, different types of target web pages can determine specific UI display information according to actual requirements, for example, the specific UI display information is described by purchasing a target web page of a car insurance, the target web page firstly comprises a search module, and the uppermost position of the target web page is provided with a search box for searching the content related to input keywords; the target webpage also comprises a login module, the upper right corner of the target webpage is user login information, and after the user login is successful, the head portrait of the user is displayed; the target webpage also comprises a vehicle insurance purchasing module, then different types of vehicle insurance are respectively introduced in the home page part, and the current popular vehicle insurance is recommended in the middle of the target webpage; each module on the target webpage can be regarded as a page sub-view, and the user behavior logic in the page indication graph is the target business logic corresponding to each page sub-view. For the login module, the target service logic corresponding to the page sub-view is as follows: and clicking the login component by the user, then displaying a login page, verifying according to the account and the password input by the user, wherein if the verification is successful, the login is successful, and if the verification is failed, the login is failed. For the search module, the target service logic corresponding to the page sub-view is as follows: and searching according to the input keywords and displaying insurance meeting the requirements. For the car insurance purchasing module, the target business logic corresponding to the page sub-view is as follows: and if receiving that the user clicks a certain vehicle insurance component, displaying all the vehicle insurance information of the category. The UI display information corresponding to the target page is obtained according to the design requirement of the target page, and in the process of developing the target page by a developer, the UI display information of the target page is designed according to the function of the target page, for example, if the target page is the car insurance purchasing webpage, the target page can be designed to comprise a searching module, a login module and a car insurance purchasing module, and corresponding target business logic is configured for each page sub-view according to the description.
S230, acquiring a logic input parameter and a target paging attribute corresponding to the page sub-view according to the target service logic corresponding to the page sub-view;
and then according to the target service logic corresponding to the page sub-view, obtaining a logic input parameter and a target paging attribute corresponding to the page sub-view.
In a specific implementation process, the logic input parameters in the embodiment of the present invention may include a preset number corresponding to an event processing function, and according to the preset number, the corresponding event processing function may be called from the element-UI library, so that the called event processing functions are combined correspondingly, and finally, a target service logic for implementing the corresponding module function is obtained. Specifically, each event processing function in the element-UI library is numbered in advance, preset number information in the logic input parameters is extracted, the extracted numbers are compared in the element-UI library, and the corresponding event processing function is extracted. The method finds out the corresponding event processing function through the event number, only needs one step of intermediate steps, can simplify the structure of the logic input parameter, and the contained information can not be reduced. In a specific implementation process, the logic input parameters in the embodiment of the present invention may also directly include a function ID directly corresponding to the event processing function, so that when the corresponding event processing function is called, the corresponding event processing function may be found directly according to the function ID without intermediate steps. According to the method, the function ID is directly contained in the logic input parameter, although the structure of the logic input parameter becomes complicated, when the event processing function is searched, the function ID can be directly searched, and the searching efficiency is high.
It should be noted that the event handling function is a function called in response to a certain event, and is mainly used for processing that when the page attribute of the target page changes, data is acquired again and the page is updated, and common event handling functions include handleCurrentPageChange (current page change handling function) and handlePageSizeChange (number of display items per page change handling function). The target paging attribute refers to a paging attribute of a target page, for example, common paging attributes include currentPage (current page), pageSize (number of display items per page, how many pieces of data per page) and total (total number of items).
S240, according to a logic input parameter corresponding to the page sub-view, calling a logic implementation function in a public folder to obtain a target event processing function, wherein the logic implementation function calls the target event processing function according to the logic input parameter to implement the target service logic, and the target event processing function comprises the target paging attribute;
the embodiment of the invention opens up a public folder, a logic realization function is placed in the public folder, the input of the logic realization function is the logic input parameter, the logic realization function finds the corresponding event processing function according to the content information contained in the logic input parameter, and the corresponding event processing function is the target event processing function. The target event processing function is executed in the logic implementation function to implement the target service logic corresponding to the corresponding functional module. The target event processing function comprises a target paging attribute and is used for calling a corresponding function when the target paging attribute changes.
And S250, assigning a target paging attribute and a target event processing function to the abstract component in the page sub-view so as to realize paging of the target page.
Then assigning the target paging attribute and the target event processing function to an abstract component in the page sub-view, so that the abstract component endows corresponding event processing capability, for example, clicking a search button can be associated with a search event function, and finally displaying search information; for example, when a login button is clicked, a login event function is associated, the login event function acquires an input account and an input password of a user, matching and verification are carried out on the input account and the input password, whether the input account and the input password are correct or not is judged, if the input account and the input password are correct, login is successful, and otherwise, login is failed. Through assignment association, the component can realize corresponding module functions when realizing corresponding events in reality.
The embodiment of the invention provides an element-UI-based paging method, which comprises the steps of firstly obtaining a page sub-view according to page layout information of a target page, then obtaining target service logic corresponding to the page sub-view according to UI display information corresponding to the page sub-view, then obtaining an event processing function needing to be called according to event processing function information contained in a logic input function, and calling the corresponding event processing function of the function through logic in a public folder, so as to realize the target service logic corresponding to the page sub-view. The embodiment of the invention can be free from the restriction of service scenes by carrying out a generalized processing mode on the event calling logic, can be used at any time when realizing the service function, greatly saves the time for processing paging, does not lose the flexibility and expandability of the original UI component compared with the secondary packaging of the component, has higher practicability, effectively improves the robustness of the paging method, and can be suitable for various service scenes.
On the basis of the foregoing embodiment, preferably, as shown in fig. 3, fig. 3 is a flowchart of obtaining a target event processing function according to an embodiment of the present invention, and as shown in fig. 3, the calling a logic implementation function in a common folder according to a logic input parameter corresponding to the page sub-view to obtain the target event processing function includes:
s310, analyzing the logic input parameters corresponding to the page sub-view to obtain a service sub-logic;
firstly, analyzing a logic input parameter corresponding to a page sub-view to obtain a service sub-logic, wherein the service sub-logic is that which paging attribute is set in the first step, which paging attribute is set in the second step, and an event processing function associated with each paging attribute is what, and the service sub-logic is a code execution logic.
S320, acquiring an alternative event processing function and a logic number according to the business sub-logic;
then, according to the business sub-logic, the alternative event processing functions and the logic numbers are obtained, after the execution logic is obtained, the relevant event processing functions on the logic line can be selected, and it is easy to understand that a plurality of event processing functions exist in the element-UI library, but when the function of a certain logic module is realized, all event processing functions in the element-UI library are not needed, only the needed event processing functions need to be selected from the event processing functions, and the selected event processing functions are the alternative event processing functions. The related event processing functions on one logic line are alternative event processing functions, and the alternative event processing functions are combined with logic according to a certain sequence, so that the target service logic is realized.
In the embodiment of the invention, each event processing function in the element-UI is numbered in advance, then when a target page is designed, the number corresponding to the required alternative event processing function is included in the logic input parameter, so that the number corresponding to the alternative event processing function can be obtained by analyzing the logic input parameter, and the corresponding alternative event processing function can be found by searching the number corresponding to the alternative event processing function in the element-UI library in the public folder.
S330, the target paging attribute is associated to the alternative event processing function, and the calling relation according to the alternative event processing function is set according to the logic number, so that the target event processing function is finally obtained.
And associating the target paging attribute to the alternative event processing functions, for example, if the target paging attribute is the current page and one of the alternative event processing functions is the current page change processing function, associating the target paging attribute to the input parameters of the alternative event processing function, thereby obtaining the target event processing function. Therefore, when the current page of the target page is changed, the adjustment and adaptation can be carried out through the alternative event processing function through the target event processing function.
On the basis of the foregoing embodiment, preferably, as shown in fig. 4, a flowchart of obtaining a target event handling function by setting a call relation of an alternative event handling function according to a logic number in the embodiment of the present invention is shown in fig. 4, where setting the call relation of the alternative event handling function according to the logic number to finally obtain the target event handling function includes:
s410, acquiring the corresponding position of each alternative event processing function and the corresponding relation between each alternative event processing function and the target paging attribute according to the logic number;
firstly, according to the logic number, obtaining each alternative event processing function, and the corresponding relation between the position of each alternative event processing function and the target paging attribute, wherein the position of each alternative event processing function can fully represent the execution sequence of the alternative event processing function, it is easy to understand that, generally speaking, the execution sequence of the alternative event processing function with the front position is also front, the execution sequence of the alternative event processing function with the back position is also back, then according to the corresponding relation between each alternative event processing function and the target paging attribute, according to the corresponding relation, the operation relation between each target paging attribute in the target page can be found, and according to the operation relation, the call relation between each alternative event processing function and the relation between each other can be extracted.
S420, acquiring each alternative event processing function related to the target paging attribute according to the corresponding relation between each alternative event processing function and the target paging attribute;
and then associating each target paging attribute to each candidate event processing function according to the corresponding relation between each candidate event processing function and the target paging attribute, for example, for the target paging attribute of the current page, associating the target paging attribute to the change event processing function of the current page, and finally obtaining each candidate event processing function associated with the target paging attribute.
S430, each alternative event processing function associated to the target paging attribute is set to a corresponding position, and the target event processing function is obtained.
And then setting each alternative event processing function related to the target paging attribute to a corresponding position to obtain a target event processing function.
On the basis of the foregoing embodiment, preferably, the configuring, respectively, target service logic for the page sub-views includes:
and acquiring the target service logic corresponding to the page sub-view through a data processing layer, wherein the data processing layer is created according to the page sub-view and is used for finishing data request and logic processing on the page sub-view.
During specific implementation, a data processing layer is created first, each page sub-view corresponds to one data processing layer, the data processing layers are used for completing data request and logic processing, and when a UI (user interface) of the page sub-views starts to be initialized, one data processing layer is created at the same time. The page sub-view can process the data request to the network in the data processing layer and acquire the network data, and can execute the service logic corresponding to the function of the page sub-view in the data processing layer to realize the function of the page sub-view.
On the basis of the foregoing embodiment, preferably, the page sub-view is multiple, and the assigning the target paging attribute and the target event handling function to the abstract component in the page sub-view further includes:
the life cycle of each page sub-view is set such that each page sub-view has an independent life cycle.
Specifically, the lifecycle of a page sub-view includes a series of state events from beginning to end of the page, and the corresponding lifecycle callback function is called in different state events, for example, whenever a new page is entered or switched to, the lifecycle function is called to register a page, the type parameter of an object is accepted, and the initial data, the lifecycle callback and the event processing function are specified, and so on. The page sub-view for setting the life cycle is similar to the page with the life cycle, and the page sub-view can also be provided with a series of state events from beginning to end similar to the life cycle of the page, and corresponding life cycle callback functions are called in different state events. Independent page sub-views on the logic and UI interfaces have a life cycle at the same time, the page sub-views have complete page capabilities, and the page sub-views can be run in any page needing the page sub-views.
On the basis of the foregoing embodiment, preferably, the setting a life cycle of each page sub-view includes:
inheriting a life cycle interface of a page base class through a page sub-view to enable the page sub-view to obtain an independent life cycle, wherein the life cycle interface comprises life cycle callback functions of interfaces in an operating system under multiple states;
and binding the life cycle of the page sub-view with the life cycle of the target page so that the operating system calls the life cycle of the page sub-view through the target interface.
The page child view can inherit the life cycle interface of the page base class, and the page child view has the function of life cycle callback. The lifecycle interface comprises lifecycle callback functions of interfaces in an operating system in multiple states, for example, the lifecycle callback function of a page of an android system can be used for being recalled when the page is created, when the page is started, when the page is restarted, when the page is displayed, when the page is suspended, when the page is stopped, when the page is destroyed, when the page is reused, when the page gets focus or loses focus, and the like.
And binding the life cycle of the target page with the cycle of the page sub-view, so that the operating system can call the life cycle callback function of the view module and activate the life cycle of the page sub-view.
On the basis of the foregoing embodiment, preferably, the assigning the target page attribute and the target event handling function to an abstract component in the page sub-view further includes:
and rendering the UI interface corresponding to the page sub-view according to the UI display information corresponding to the page sub-view.
Specifically, the UI display information corresponding to the page sub-view is used for rendering the UI interface corresponding to the page sub-view, the view of the UI interface of the page sub-view arranged on the target page is rendered, the construction of the target page on the logic and UI interface is completed, and the target page is generated.
Fig. 5 is a schematic structural diagram of an element-UI-based paging system according to an embodiment of the present invention, and as shown in fig. 5, the system includes a view module 510, a logic module 520, an attribute module 530, a calling module 540, and a paging module 550, where:
the view module 510 is configured to obtain a page sub-view included in a target page according to page layout information of the target page, where the page sub-view includes an abstract component in the target page;
the logic module 520 is configured to obtain service logic associated with the UI display information according to the UI display information corresponding to the page sub-view, and configure target service logic for the page sub-view respectively;
the attribute module 530 is configured to obtain a logic input parameter and a target paging attribute corresponding to the page sub-view according to the target service logic corresponding to the page sub-view;
the calling module 540 is configured to call a logic implementation function in a public folder according to a logic input parameter corresponding to the page sub-view, so as to obtain a target event processing function, where the logic implementation function calls a relevant event processing function according to the logic input parameter, so as to implement the target service logic, and the event processing function includes the target paging attribute;
the paging module 550 is configured to assign a target paging attribute and a target event handling function to an abstract component in the page sub-view, so as to page the target page.
The present embodiment is a system embodiment corresponding to the method, the specific implementation process is the same as the method embodiment, please refer to the method embodiment for details, and the system embodiment is not described herein again.
On the basis of the foregoing embodiment, preferably, the calling module includes an analyzing unit, a selecting unit, and an implementing unit, where:
the analysis unit is used for analyzing the logic input parameters corresponding to the page sub-view to acquire a service sub-logic;
the alternative unit is used for acquiring alternative event processing functions and logic numbers according to the service sub-logic;
the implementation unit is configured to associate the target paging attribute with the alternative event processing function, set a call relationship according to the alternative event processing function according to the logic number, and finally obtain the target event processing function.
On the basis of the foregoing embodiment, preferably, the implementation unit includes a corresponding subunit, an association subunit, and a location subunit, where:
the corresponding subunit is used for acquiring a position corresponding to each alternative event processing function and a corresponding relation between each alternative event processing function and the target paging attribute according to the logic number;
the association subunit is configured to obtain each alternative event processing function associated with the target paging attribute according to a corresponding relationship between each alternative event processing function and the target paging attribute;
the position subunit is configured to set each candidate event processing function associated with the target paging attribute to a corresponding position, and acquire the target event processing function.
On the basis of the above embodiment, preferably, the logic module includes a data processing layer unit, where:
the data processing layer unit is used for acquiring the target service logic corresponding to the page sub-view through a data processing layer, the data processing layer is created according to the page sub-view, and the data processing layer is used for completing data request and logic processing of the page sub-view.
On the basis of the foregoing embodiment, preferably, the page sub-view is multiple, and the paging system further includes a life cycle unit, where:
the life cycle unit is used for setting the life cycle of each page sub-view, so that each page sub-view has an independent life cycle.
On the basis of the foregoing embodiment, preferably, the lifecycle unit includes an inheritance subunit and a binding subunit, where:
the inheritance subunit is used for inheriting a life cycle interface of a page base class through a page child view to enable the page child view to obtain an independent life cycle, wherein the life cycle interface comprises life cycle callback functions of an interface in an operating system under multiple states;
and the binding subunit is used for binding the life cycle of the page sub-view with the life cycle of the target page, so that the operating system calls the life cycle of the page sub-view through the target interface.
On the basis of the foregoing embodiment, preferably, the paging system further includes a presentation module, wherein:
and the display module is used for rendering the UI interface corresponding to the page sub-view according to the UI display information corresponding to the page sub-view.
The various modules in the element-UI-based paging system described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Fig. 6 is a schematic structural diagram of a computer device provided in an embodiment of the present invention, where the computer device may be a server, and an internal structural diagram of the computer device may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a computer storage medium and an internal memory. The computer storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the running of computer programs in the computer storage media. The database of the computer device is used for storing data generated or acquired in the process of executing a paging method based on element-UI, such as page layout information and page sub-views. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an element-UI based paging method.
In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the processor implements the steps of one of the element-UI-based paging methods in the above embodiments. Alternatively, the processor, when executing the computer program, implements the functions of the modules/units in an element-UI-based paging system embodiment.
In an embodiment, a computer storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of an element-UI-based paging method in the above embodiments. Alternatively, the computer program realizes the functions of the modules/units in the embodiment of the element-UI-based paging system described above when executed by the processor.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein.

Claims (10)

1. A paging method based on element-UI is characterized by comprising the following steps:
acquiring a page sub-view contained in a target page according to page layout information of the target page, wherein the page sub-view comprises abstract components in the target page;
according to UI display information corresponding to the page sub-views, acquiring service logics associated with the UI display information, and respectively configuring target service logics for the page sub-views;
acquiring a logic input parameter and a target paging attribute corresponding to the page sub-view according to the target service logic corresponding to the page sub-view;
calling a logic implementation function in a public folder according to a logic input parameter corresponding to the page sub-view to obtain a target event processing function, wherein the logic implementation function calls the target event processing function according to the logic input parameter to implement the target service logic, and the target event processing function comprises the target paging attribute;
and assigning a target paging attribute and a target event processing function to the abstract component in the page sub-view so as to realize paging of the target page.
2. The element-UI-based paging method according to claim 1, wherein calling a logic implementation function in a common folder according to a logic input parameter corresponding to the page sub-view to obtain a target event processing function, includes:
analyzing the logic input parameters corresponding to the page sub-view to obtain a service sub-logic;
acquiring an alternative event processing function and a logic number according to the service sub-logic;
and associating the target paging attribute to the alternative event processing function, setting a calling relation according to the alternative event processing function according to the logic number, and finally obtaining the target event processing function.
3. The element-UI-based paging method according to claim 2, wherein setting a call relationship according to the alternative event processing function according to the logic number to finally obtain the target event processing function comprises:
acquiring a position corresponding to each alternative event processing function and a corresponding relation between each alternative event processing function and the target paging attribute according to the logic number;
acquiring each alternative event processing function related to the target paging attribute according to the corresponding relation between each alternative event processing function and the target paging attribute;
and setting each alternative event processing function related to the target paging attribute to a corresponding position, and acquiring the target event processing function.
4. The element-UI-based paging method according to claim 1, wherein the individually configuring the target business logic for the page sub-views comprises:
and acquiring the target service logic corresponding to the page sub-view through a data processing layer, wherein the data processing layer is created according to the page sub-view and is used for finishing data request and logic processing on the page sub-view.
5. The element-UI-based paging method as claimed in claim 1, wherein the page sub-view is multiple, and the assigning the target paging attribute and the target event handling function to the abstract component in the page sub-view further comprises:
the life cycle of each page sub-view is set such that each page sub-view has an independent life cycle.
6. The element-UI based paging method according to claim 5, wherein the setting of the life cycle of each page sub-view comprises:
inheriting a life cycle interface of a page base class through a page sub-view to enable the page sub-view to obtain an independent life cycle, wherein the life cycle interface comprises life cycle callback functions of an interface in an operating system under multiple states;
and binding the life cycle of the page sub-view with the life cycle of the target page so that the operating system calls the life cycle of the page sub-view through the target interface.
7. The element-UI based paging method according to any one of claims 1 to 6, wherein assigning a target paging attribute and a target event handling function to an abstract component in the page sub-view further comprises:
and rendering the UI interface corresponding to the page sub-view according to the UI display information corresponding to the page sub-view.
8. An element-UI based paging system, comprising:
the view module is used for acquiring a page sub-view contained in a target page according to page layout information of the target page, wherein the page sub-view comprises an abstract component in the target page;
the logic module is used for acquiring service logic associated with the UI display information according to the UI display information corresponding to the page sub-view, and respectively configuring target service logic for the page sub-view;
the attribute module is used for acquiring a logic input parameter and a target paging attribute corresponding to the page sub-view according to the target service logic corresponding to the page sub-view;
the calling module is used for calling a logic implementation function in a public folder according to a logic input parameter corresponding to the page sub-view to obtain a target event processing function, wherein the logic implementation function calls a related event processing function according to the logic input parameter to implement the target service logic, and the event processing function comprises the target paging attribute;
and the paging module is used for assigning a target paging attribute and a target event processing function to the abstract component in the page sub-view so as to realize paging of the target page.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the element-UI based paging method according to any one of claims 1 to 7 when executing the computer program.
10. A computer storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the element-UI-based paging method according to any one of claims 1 to 7.
CN202211322850.4A 2022-10-27 2022-10-27 element-UI-based paging method, system, device and storage medium Pending CN115576556A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211322850.4A CN115576556A (en) 2022-10-27 2022-10-27 element-UI-based paging method, system, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211322850.4A CN115576556A (en) 2022-10-27 2022-10-27 element-UI-based paging method, system, device and storage medium

Publications (1)

Publication Number Publication Date
CN115576556A true CN115576556A (en) 2023-01-06

Family

ID=84587409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211322850.4A Pending CN115576556A (en) 2022-10-27 2022-10-27 element-UI-based paging method, system, device and storage medium

Country Status (1)

Country Link
CN (1) CN115576556A (en)

Similar Documents

Publication Publication Date Title
US9558016B2 (en) Platform system, method for changing support hardware configuration of universal extensible firmware interface basic input output system and computer program product
CN112488855B (en) Business verification method and device based on rule template
US9324063B2 (en) Contextual solicitation in a starter application
US10656939B2 (en) Modeling lifetime of hybrid software application using application manifest
US10552233B2 (en) Application convergence method and apparatus
CN113434063A (en) Information display method, device and equipment
CN111694580B (en) Method and device for upgrading and initializing storage device and electronic device
CN115576556A (en) element-UI-based paging method, system, device and storage medium
CN114756293A (en) Service processing method, device, computer equipment and storage medium
JP6422346B2 (en) Program generation apparatus and program generation method
CN113779132A (en) Data import method and device, computer equipment and storage medium
CN113986416B (en) Method and system for rendering font icon based on Flutter
CN108170408B (en) JS object definition generation method and device
US20230350593A1 (en) Method, system, and circuit for deploying file system on embedded memory in programmable computing device
US20220156005A1 (en) Service management device, service management method, and non-transitory computer-readable recording medium
CN115480912A (en) Memory frequency configuration method and device, electronic equipment and storage medium
CN115438113A (en) Parameter management method and device, electronic equipment and storage medium
CN113760466A (en) Multi-transaction processing method, device, computer system and readable storage medium
CN113238784A (en) Transaction program updating method and device
CN116483777A (en) File storage management method and device and electronic equipment
CN116737137A (en) Business process generation method, device, computer equipment and storage medium
CN115935108A (en) Configuration method and device for ordering pages, electronic equipment and storage medium
CN112035103A (en) Code generation method, device, server and medium
CN115587344A (en) Button authority control method, system, equipment and storage medium based on vue
CN117573518A (en) Large-scale data parameterization method, device and processing equipment

Legal Events

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