CN-119847518-B - Method and system for configuring custom buttons on target function page
Abstract
The embodiment of the application discloses a method and a system for configuring a custom button on a target function page, wherein the method comprises the following steps of receiving original driving data and tenant information of the target function page from a parasitic middle layer component; the original driving data and the tenant information of the target function page are hijacked through the parasitic middle layer component, the button configuration driving data corresponding to the tenant information is called from the configuration database, the original driving data and the button configuration driving data are compared and assembled, and page layout and button function logic are dynamically rendered based on the assembled driving data. The embodiment of the application can integrate the original driving data and the button configuration driving data, and finally realize the configuration of the custom buttons on the target function page.
Inventors
- CHEN DAIMING
- ZHOU GUOKU
- LIU CONGCONG
Assignees
- 百望股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20241223
Claims (8)
- 1. A method for configuring a custom button on a target function page, comprising the steps of: sending a communication request to a parasitic middle layer component through a configuration page, receiving original driving data and tenant information of the target function page from the parasitic middle layer component, wherein the configuration page is embedded into the target function page through an iframe, and the parasitic middle layer component is parasitic in the target function page; Acquiring custom button configuration driving data in a custom button designer, splicing the original driving data of the target function page and the button configuration driving data through the configuration page, and storing the spliced configuration driving data into a configuration database according to tenant isolation; Hijacking original driving data and tenant information of the target function page through the parasitic middle layer component, calling spliced configuration driving data corresponding to the tenant information from the configuration database, comparing and assembling the original driving data with the spliced configuration driving data, and dynamically rendering page layout and button function logic based on the assembled driving data; the dynamic rendering page layout and button function logic based on the assembled driving data specifically comprises the following steps: judging whether a button is an own button or a custom button of the target function page, if the button is the own button, executing the execution logic of the button of the target function page, rendering an interactive page to call an api, if the button is the custom button, judging the type of the custom button, if the custom button is an uploading or importing button, using an uploading or importing form analyzer, rendering an api interface in the custom importing file interactive call configuration according to the configured attribute, if the custom button is the downloading or exporting button, analyzing the configuration data of the downloading or exporting button, executing the downloading or exporting operation of the api interface in the logic call configuration, if the custom button is the common button, judging the interactive mode of the common button, if the interactive mode is the direct execution, directly calling the api in the configuration to complete the operation, if the interactive mode is the confirmation execution, rendering the configuration of the file, analyzing the configuration of the file of the confirmation file, the interface of the api and the input form, and clicking the configuration of the user interface of the form, and the configuration of the form, and completing the interactive operation of the api in the form by clicking a user-input window; and judging whether the button operation is interacted with the form or not after finishing the button operation, and executing the form data refreshing logic under the condition that the refreshing form is configured, so as to finish the functions of adding, deleting, changing, checking and customizing the form.
- 2. The method of claim 1, wherein the raw driver data comprises query terms, form terms, and function buttons, the button configuration driver data comprises a button base attribute, a button type, a button interaction attribute, a button api attribute, and a button callback event, the button type is a base button, an import/upload button, an export/download button, and the button interaction attribute is a custom direct execution button, a custom confirmation box button, and a custom form interaction button; After receiving the original driving data of the target function page from the parasitic intermediate layer component, the method further comprises: A configuration popup window is popped up through the configuration page, and the information of display, hiding or sequencing of the query items, the table items and the original function buttons of the target page configured by a user and the configuration information of the custom buttons are obtained in the configuration popup window; Assembling the original driving data of the target function page and the button configuration driving data through the configuration page specifically comprises the following steps: And comparing and assembling the original driving data of the target function page and the button configuration driving data according to the latest display and sequence through the configuration page.
- 3. The method of claim 1, wherein the target function page contains own global data, methods, incoming components that handle self-functional button interactions, and the parasitic middle layer component, wherein SearchAndTable components, built-in data processing logic, built-in custom button interaction parser components, and custom form parsers are integrated in the parasitic middle layer component; before hijacking the original driving data and tenant information of the target function page through the parasitic middle layer component, the method further comprises: loading the page resource of the target function page, executing a page life cycle function, acquiring the original driving data of the target function page, and loading the parasitic middle layer component.
- 4. The method of claim 1, wherein the assembled driving data comprises a query region, a table region, and a button region, the query region, the table region, and the button region corresponding to different region parser components, each region parser component parsing configuration data of a respective region, recursively traversing a field key parsing component type or button type, rendering a corresponding component or button.
- 5. A system for configuring custom buttons on a target function page, comprising: The receiving and transmitting module is used for sending a communication request to the parasitic middle layer component through a configuration page, receiving original driving data and tenant information of the target function page from the parasitic middle layer component, wherein the configuration page is embedded into the target function page through an iframe, and the parasitic middle layer component is parasitic in the target function page; The acquisition module is used for acquiring custom button configuration driving data in a custom button designer, splicing the original driving data of the target function page and the button configuration driving data through the configuration page, and storing the spliced configuration driving data into a configuration database according to tenant isolation; the rendering module is used for hijacking the original driving data and tenant information of the target function page through the parasitic middle layer component, calling spliced configuration driving data corresponding to the tenant information from the configuration database, comparing and assembling the original driving data with the spliced configuration driving data, and dynamically rendering page layout and button function logic based on the assembled driving data; The rendering module is specifically configured to determine whether a button is an own button or a custom button of the target function page, if the button is an own button, execute the own button execution logic of the target function page, and render an interaction page to call api; judging the type of the custom button if the custom button is a download or export button, judging the interactive mode of the ordinary button if the custom button is an upload or import button, using an upload or import form parser to render an api interface in the custom import file interactive call configuration according to the configured attribute, completing upload or import operation, rendering a confirmation frame after determining that the api interface in the custom import file interactive call configuration is finished, analyzing download or export button configuration data if the custom button is a download or export button, executing download/export operation after completing the api interface in the download or export logic call configuration, judging the interactive mode of the ordinary button if the custom button is a common button, directly calling the api and import configuration in the analysis configuration if the interactive mode is direct execution, directly calling the api and completing operation if the interactive mode is confirmation execution, prompting a confirmation case, an api interface and an import configuration in the confirmation frame parser to click the confirmation configuration, rendering the confirmation frame after determining that the api is finished, completing the operation after the user is finished, completing the form interactive mode through the form component, the self-defining element, the self-defining unit, the interface and the map window in the custom form parser configuration, completing the download/export operation after completing the update of the form, the form interactive mode, and updating the user interface and updating the form, and completing the data after completing the update of the form configuration, and updating the form input operation, judging the user interface and updating the form interface and the interface, and checking and customizing function operation.
- 6. The system of claim 5, wherein the raw driver data comprises query terms, form terms, and function buttons, the button configuration driver data comprises a button base attribute, a button type, a button interaction attribute, a button api attribute, and a button callback event, the button type is a base button, an import/upload button, an export/download button, the button interaction attribute is a custom direct execution button, a custom confirmation box button, and a custom form interaction button; the system further comprises: The configuration module is used for popping up a configuration popup window through the configuration page, and acquiring information of display, hiding or sequencing of the query items, the table items and the original function buttons of the target page configured by a user and configuration information of the custom buttons in the configuration popup window; The acquisition module is specifically configured to compare and assemble the original driving data of the target function page and the button configuration driving data according to the latest display and sequence through the configuration page.
- 7. The system of claim 5, wherein the target function page contains own global data, methods, incoming components that handle self-functional button interactions, and the parasitic middle layer component, wherein SearchAndTable components, built-in data processing logic, built-in custom button interaction parser components, and custom form parsers are integrated in the parasitic middle layer component; the system further comprises: The loading module is used for loading the page resources of the target function page, executing the page life cycle function, acquiring the original driving data of the target function page and loading the parasitic middle layer component.
- 8. The system of claim 5, wherein the assembled driving data comprises a query region, a table region, and a button region, the query region, the table region, and the button region corresponding to different region parser components, each region parser component parsing configuration data of a respective region, recursively traversing a field key parsing component type or button type, rendering a corresponding component or button.
Description
Method and system for configuring custom buttons on target function page Technical Field The application belongs to the technical field of computers, and particularly relates to a method and a system for configuring a custom button on a target function page. Background Along with the arrival of the digitization age, all enterprises are pushing the digitization transformation, the cost reduction and synergy become main targets of internal research and development of all enterprises, the development cost is reduced, the development efficiency and the code quality are improved, the project delivery period is shortened, the development of the traditional web front end needs a large amount of development time and development resources, and the conditions of repeated development and repeated wheel manufacturing exist. To solve this pain, low-code development platforms have been developed in the continuous effort of large-enterprise development teams, and the continuous upgrading of low-code technology has been promoted. However, at present, the low-code development platforms of all manufacturers have great differences due to different requirements and scenes, and the secondary development capability of the history page cannot be met. Content of the application The embodiment of the application aims to provide a method and a system for configuring a custom button on a target function page, which are used for solving the defect that the prior art cannot meet the requirement of secondary development capability on a history page. In order to solve the technical problems, the application is realized as follows: In a first aspect, a method for configuring a custom button on a target function page is provided, including the steps of: sending a communication request to a parasitic middle layer component through a configuration page, receiving original driving data and tenant information of the target function page from the parasitic middle layer component, wherein the configuration page is embedded into the target function page through an iframe, and the parasitic middle layer component is parasitic in the target function page; Acquiring custom button configuration driving data in a custom button designer, splicing the original driving data of the target function page and the button configuration driving data through the configuration page, and storing the spliced configuration driving data into a configuration database according to tenant isolation; And hijacking original driving data and tenant information of the target function page through the parasitic middle layer component, calling button configuration driving data corresponding to the tenant information from the configuration database, comparing and assembling the original driving data with the button configuration driving data, and dynamically rendering page layout and button function logic based on the assembled driving data. In a second aspect, a system for configuring a custom button on a target function page is provided, comprising: The receiving and transmitting module is used for sending a communication request to the parasitic middle layer component through a configuration page, receiving original driving data and tenant information of the target function page from the parasitic middle layer component, wherein the configuration page is embedded into the target function page through an iframe, and the parasitic middle layer component is parasitic in the target function page; The acquisition module is used for acquiring custom button configuration driving data in a custom button designer, splicing the original driving data of the target function page and the button configuration driving data through the configuration page, and storing the spliced configuration driving data into a configuration database according to tenant isolation; And the rendering module is used for hijacking the original driving data and tenant information of the target function page through the parasitic middle layer component, calling button configuration driving data corresponding to the tenant information from the configuration database, comparing and assembling the original driving data with the button configuration driving data, and dynamically rendering page layout and button function logic based on the assembled driving data. According to the embodiment of the application, the driving data of the functional page is obtained through the configuration page, the driving data is expanded and configured, the integration of the original driving data and the button configuration driving data is realized, the configuration of the custom button on the target functional page is finally realized, the coverage scene is rich, the function expansion under different requirements can be completed, and the advantages of zero code iteration upgrading, no edition sending and configuration are realized. Drawings FIG. 1 is a flowchart of a method for configuring custom buttons on a target function p