Page element online editing method, electronic equipment and storage medium
Through the online editing method, the problem of insufficient flexibility and customization in front-end development is solved, and flexible editing and real-time rendering of page elements are realized. Users can directly apply editing content to meet the needs of different permission levels.
Patent Information
- Application Number
- CN202410662493.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-08-30
AI Technical Summary
Existing front-end development technology lacks flexibility and customization, making it difficult to meet page display and editing needs under different permission levels. It lacks real-time preview and save functions, and user-edited content cannot be directly applied to the page.
Provides an online editing method for page elements. It generates an initial page through rendering, receives account information and verifies editing permissions, pushes the editing interface and code, renders new pages in real time, supports the user to click the edit button for code editing, and stores and stores the edited code. Push to server application.
It achieves flexible editing, convenience, customization and real-time rendering of the page, with flexibility and visual effects. Users can directly apply editing content to the page to meet the customized needs of specific business scenarios.
Smart Images

Figure CN118568382A
Abstract
Description
Technical Field
[0001] The present application relates to the field of front-end development technology, and in particular to an online editing method for page elements, an electronic device, and a storage medium. Background Art
[0002] Front-end development is the process of creating front-end interfaces such as web pages or apps to present to users, and realizing user interface interaction of Internet products through various technologies, frameworks, and solutions. The existing front-end development field generally uses permission management components and code editors based on front-end frameworks such as React to realize customized display and editing functions of pages.
[0003] However, the existing technical solutions have the following shortcomings: First, they lack flexibility and customization. Existing technologies often have difficulty meeting the flexible requirements for page display and editing in specific business scenarios. For example, different content may need to be displayed or different editing functions may need to be provided under different permission levels, and it is difficult for existing technologies to achieve such high customization. Second, there is a lack of real-time preview and save functions. Existing technologies usually lack real-time preview of the effects of user editing, and users need to manually refresh the page to view the modified results. At the same time, there is a lack of convenient save and replace functions, and the content edited by the user cannot be directly applied to the page, and requires a cumbersome process to take effect. Summary of the invention
[0004] In order to help improve the problems of poor flexibility and poor visualization effect in existing web page editing, the present application provides a page element online editing method, electronic device and storage medium.
[0005] In a first aspect, the present application provides a method for online editing of page elements, which adopts the following technical solution, and the method includes:
[0006] Render and generate the initial page, receive the input account information and send it to the server;
[0007] When the server reports that the account information has editing permissions, a page with an edit button is rendered;
[0008] Receive input editing request, push editing interface, and receive input editing code;
[0009] Store the edited code to the server and render a new page based on the edited code.
[0010] By adopting the above technical solution, flexible editing of web pages can be achieved, and authorized personnel can directly click a special editing button on the user side to perform targeted code editing on the corresponding part.
[0011] In a second aspect, the present invention further proposes a method for online editing of page elements, which is applied to a server side, and the method comprises:
[0012] Receive account information pushed by the user;
[0013] Verify whether the account information has editing permissions and feedback the verification results to the user end;
[0014] Receive editing requests from the user end and push the editing interface to the user end;
[0015] Receive the edited code from the user and save it;
[0016] Push the new edited code to all clients for application.
[0017] In a third aspect, the present invention further provides an electronic device, the electronic device comprising:
[0018] at least one processor;
[0019] Memory;
[0020] At least one application, wherein the at least one application is stored in a memory and configured to be executed by at least one processor, and the at least one application is configured to: execute the online editing method for page elements as described above.
[0021] In a fourth aspect, the present invention further proposes a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the above-mentioned online page element editing method.
[0022] In summary, this application develops editing components based on the React framework, which can support the function of replacing page areas with customized code. Authorized users can directly click a specific edit button on the user side to perform targeted code editing on the corresponding part. Page editing has the advantages of flexibility, convenience, customization, and real-time rendering. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a flow chart of a method for online editing of page elements provided in an embodiment of the present application;
[0024] Figure 2 This is a schematic diagram of an editing interface of an embodiment of a method for online editing of page elements of the present application;
[0025] Figure 3 It is an element image with an edit button in an embodiment of a method for online editing of page elements of the present application;
[0026] Figure 4It is a modified element image of an embodiment of a method for online editing of page elements of the present application;
[0027] Figure 5 It is a module schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-5 It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0029] An embodiment of the present application provides a method for online editing of page elements, which is used in a front-end development system.
[0030] This embodiment uses web page development as an application example to specifically illustrate the above method. In actual implementation, the above method can also be used in other front-end development, which is not limited in this embodiment.
[0031] Specific reference Figure 1 As shown, a method for online editing of page elements is applied to a user end, and the method includes:
[0032] S10: Rendering generates an initial page, receiving the input account information and sending it to the server; in this embodiment, the initial page is an interface of an account that is not logged in, such as a login interface, a homepage that is not logged in, etc.
[0033] S20: When the server feeds back that the account information has editing authority, a page with an edit button is rendered and generated; in this embodiment, when the account information shows that it has no editing authority, a page without an edit button is displayed.
[0034] S30: receiving the input editing request, pushing the editing interface, and receiving the input editing code; in this embodiment, when the user clicks the edit button, the editing interface of the element corresponding to the edit button is pushed, and the developer completes the modification of the element by entering the code into the editing interface.
[0035] S40: The edited code is stored in the server, and a new page is rendered according to the edited code; the code modification of the user end is transmitted to the server, and the modification is synchronized to other user ends through the server.
[0036] This application develops editing components based on the React framework, which can support the function of replacing page areas with customized code. Authorized users can directly click a specific edit button on the user side to perform targeted code editing on the corresponding part. Page editing has the advantages of flexibility, convenience, customization, and real-time rendering.
[0037] On the basis of this embodiment, when editing the code, a real-time rendering effect preview is performed on the editing interface. A rendering interface is provided on the editing interface, which can realize the effect viewing of the change interface and facilitate timely modification.
[0038] In this embodiment, the editing interface includes a variable prompt at the top, a code editor at the left, a code renderer at the right, and operation buttons at the bottom, wherein the operation buttons include an enable button and a save button.
[0039] In this embodiment, on a page with an edit button, an edit button is displayed on each editable element; when a user clicks the edit button, a code editing interface for the element pops up.
[0040] Furthermore, the code editing component in this embodiment is developed and implemented based on the React development framework.
[0041] On the other hand, the present invention also proposes a method for online editing of page elements applied to a server side, which is applied to the server side and comprises:
[0042] A10: Receive account information pushed by the user end;
[0043] A20: Verify whether the account information has editing permissions and feedback the verification result to the user end;
[0044] A30: receiving an editing request from a user terminal and pushing an editing interface to the user terminal;
[0045] A40: Receive the editing code from the user and save it;
[0046] A50: Push the new edited code to all users for application.
[0047] In one embodiment of the present invention, referring to the attached Figure 2 , 3 As shown in Figure 4, the following main functions are realized:
[0048] Permission management: This embodiment obtains the user's permission information through the interface and determines whether to display the edit button according to the permission level. This function can ensure that only users with corresponding permissions can edit the code in the page area.
[0049] In this embodiment, the views of the page controlled elements of the default user interface of different user identities of the user can be distinguished in a visual manner. If a certain page controlled element is in the set of page controlled elements with permissions for a certain user, then when the user interface of the user is rendered, the page controlled element is displayed; if a certain page controlled element is in the set of page controlled elements with permissions for a certain user, then when the user interface of the user is rendered, the page controlled element is intercepted, that is, the page controlled element is not displayed. The present invention decouples the configuration strategy from the software code in a visual manner, and can preset the set of page controlled elements with permissions under the user interface corresponding to each user identity of the user in the online editing system, realize the management of account permissions, and ensure that only users with corresponding permissions can edit the code of the page area.
[0050] Implementation of code editor pop-up window: This embodiment provides a pop-up code editor pop-up window, including variable prompts at the top of the pop-up window, a code editor on the left side of the middle of the pop-up window, a code renderer on the right side of the middle of the pop-up window, and an operation button at the bottom. Users can edit code freely in the code editor and view the editing effect in real time. This function allows users to intuitively modify and preview the code in the page area.
[0051] Implementation of the Save and Replace function: After editing the code, the user can choose to save the changes and choose to enable the code operation immediately to replace the content of the original page area. This embodiment will save the code edited by the user and render it according to the saved code and the enabled state, thereby realizing customized replacement of specific areas of the page. This function enables users to apply customized code to the page, realizing more flexible page customization requirements.
[0052] Implementation of interface call and data processing: This embodiment obtains user authority information, saves user edited code, and obtains the original content of the page area through interface call. At the same time, this embodiment can process and parse the data returned by the interface to ensure the accuracy and reliability of the data. This function ensures good interaction and data transmission between this solution and the backend system.
[0053] The present application also provides an electronic device, such as Figure 5 As shown, Figure 5 The electronic device 700 shown includes: a processor 701 and a memory 703. The processor 701 and the memory 703 are connected, such as through a bus 702. Optionally, the electronic device 700 may also include a transceiver 704. It should be noted that in actual applications, the transceiver 704 is not limited to one, and the structure of the electronic device 700 does not constitute a limitation on the embodiments of the present application.
[0054] Processor 701 may be a CPU (Central Processing Unit), a general purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 701 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0055] The bus 702 may include a path to transmit information between the above components. The bus 702 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 702 may be divided into an address bus, a data bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0056] The memory 703 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0057] The memory 703 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 701. The processor 701 is used to execute the application code stored in the memory 703 to implement the contents shown in the above method embodiment.
[0058] The electronic devices include, but are not limited to, mobile terminals such as mobile phones, notebook computers, PDAs (personal digital assistants), PADs (tablet computers), etc., and fixed terminals such as digital TVs, desktop computers, etc. It can also be a server, etc. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0059] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the online editing method of page elements provided in the above embodiment.
[0060] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the instructions of the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise clearly stated in this document, the execution of these steps is not strictly limited in order and can be performed in other orders.
[0061] The above are only some implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for online editing of page elements, characterized in that: Applied to a user terminal, the method includes: Render and generate the initial page, receive the input account information and send it to the server; When the server reports that the account information has editing permissions, a page with an edit button is rendered; Receive input editing request, push editing interface, and receive input editing code; Store the edited code to the server and render a new page based on the edited code.
2. The method for online editing of page elements according to claim 1, characterized in that: When editing code, you can preview the rendering effect in real time in the editing interface.
3. The method for online editing of page elements according to claim 1, characterized in that: The editing interface includes variable prompts, a code editor, a code renderer, and operation buttons, wherein the operation buttons include an enable button and a save button.
4. The method for online editing of page elements according to claim 1, characterized in that: On a page with an edit button, an edit button is displayed on each editable element; when the user clicks the edit button, the code editing interface for the element pops up.
5. The method for online editing of page elements according to claim 1, characterized in that: Code editing is implemented based on the React development framework.
6. A method for online editing of page elements, characterized in that: Applied to the server side, the method includes: Receive account information pushed by the user; Verify whether the account information has editing permissions and feedback the verification results to the user end; Receive editing requests from the user end and push the editing interface to the user end; Receive the edited code from the user and save it; Push the new edited code to all clients for application.
7. An electronic device, characterized in that: The electronic device includes: at least one processor; Memory; At least one application, wherein the at least one application is stored in a memory and configured to be executed by at least one processor, and the at least one application is configured to: execute the online editing method for page elements as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed in a computer, the computer is caused to execute the online editing method for page elements according to any one of claims 1 to 5.
Citation Information
Patent Citations
Page editing method and device
CN106201489A
Automatic terminal code generation method based on visual interface and platform thereof
CN114064040A
Cited By
Product page pushing method based on state machine and computer equipment
CN119515501A
State Machine-Based Product Page Push Method and Computer Device
CN119515501B
