A responsive interface implementation method and device
Patent Information
- Application Number
- CN202211053047.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-08-31
AI Technical Summary
[0005]本申请实施例提供一种响应式界面实现方法及设备,用于解决响应式界面开发流程效率低,且功能无法满足用户的个性化需求的问题
[0019] By constructing the interface description and component description of the responsive interface, executable code is generated, thereby providing a visual operation interface, allowing users to configure responsive interfaces at different resolutions and view the visual effects simultaneously, which not only provides responsiveness in standard mode The interface simplifies the development process, and provides a responsive interface in custom mode, realizing flexible configuration of the responsive interface, which can meet the personalized needs of users. It directly renders component data in the visual operation interface, allowing users to modify the response When configuring the interface, the system avoids frequent viewing of the front-end generated interface.
Smart Images

Figure CN115454427B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a method and device for implementing a responsive interface. Background Art
[0002] The design and development of responsive interfaces need to be able to respond and adjust accordingly based on user behavior and device environment (including system platform, screen size, screen orientation, etc.), that is, the interface should be able to automatically respond to the user's device environment. In other words, a responsive interface means that the website page can be compatible with a variety of smart terminal devices and has the function of automatically adjusting the display interface according to different screen sizes.
[0003] At present, there are many mainstream development solutions for existing responsive interface development, including elastic grid and layout, fluid layout, etc.
[0004] However, the current responsive interface development process is complex, the functions are too single and the flexibility is insufficient. For example, the key component information is not extracted, and the interface is previewed at multiple interface resolutions, resulting in frequent code generation of the html DOM architecture, no consideration of the adjustment of the width of each component under the responsive interface, no support for the classification of user-defined components, and the single setting cannot be reused, resulting in low efficiency of the responsive interface development process and the inability of the functions to meet the personalized needs of users. Summary of the invention
[0005] The embodiments of the present application provide a responsive interface implementation method and device, which are used to solve the problem that the responsive interface development process is inefficient and the functions cannot meet the personalized needs of users.
[0006] The present application embodiment adopts the following technical solutions:
[0007] On the one hand, an embodiment of the present application provides a responsive interface implementation method, the method comprising: determining an interface description of a responsive interface; the interface description comprising custom mode determination rules and standard mode determination rules of the responsive interface, and responsive interface implementation rules corresponding to the standard mode; determining a component description of the responsive interface; the component description comprising component belonging group conversion rules, component occupied grid number conversion rules, and component row conversion rules under a two-dimensional arrangement; through a pre-set conversion interface, processing component parameters in a container according to the interface description and the component description to convert the component parameters into executable code; generating a visual operation interface of the responsive interface according to the executable code; receiving a user's configuration request, configuring the interface resolution and interface layout of the visual operation interface, and obtaining an updated executable code; generating an htmldom structure according to the updated executable code; rendering the html dom structure to a form component area to generate the responsive interface.
[0008] In one example, the interface description of the responsive interface is determined, specifically including: dividing the responsive interface into twelve equal parts according to the resolution width according to a preset grid system, determining the breakpoint corresponding to the resolution width of the responsive interface in a preset breakpoint rule table, and determining the number of display columns of the responsive interface as the specified number of display columns corresponding to the breakpoint, so as to determine the responsive interface implementation rule corresponding to the standard mode; and determining the number of grids occupied by components corresponding to multiple components of a container in a form designer; judging whether the number of grids occupied by the components all meet the preset breakpoint rules; if so, determining that the responsive interface is in standard mode; if not, determining that the responsive interface is in custom mode; in the custom mode, the number of display columns of the multiple components under different interface resolutions is controlled by the user.
[0009] In one example, determining the component description of the responsive interface specifically includes: ID marking the components of the container in the form designer to determine the grouped nodes and the ungrouped nodes; determining the components in the grouped nodes, setting the component width and the component position in the grouped nodes to determine the component belonging group conversion rules of the responsive interface; and determining the conversion rules for the number of grids occupied by the components of the responsive interface according to the component class style of the standard mode and the component class style of the custom mode; and converting the one-dimensional data into two-dimensional data according to the number of grids occupied by the multiple components in the container in the form designer; determining the row allocation algorithm by subtracting the remaining number of grids from the number of grids occupied by the components, and determining the row positions of the multiple components according to the row allocation algorithm to determine the row conversion rules of the components under the two-dimensional arrangement.
[0010] In one example, determining a pre-set conversion interface specifically includes: determining an interface identifier in the container; the interface identifier includes the current breakpoint, the current group, the current component name, the breakpoint setting, and the component value storage; the component value storage records the configuration value of the current component at different interface resolutions, and the component value storage includes the number of grids occupied by an extra-large screen, the number of grids occupied by an extremely large screen, the number of grids occupied by a medium screen, the number of grids occupied by a small screen, the number of grids occupied by an extremely small screen, the number of columns occupied by components on an extra-large screen, the number of columns occupied by components on an extremely large screen, the number of columns occupied by components on a medium screen, the number of columns occupied by components on a small screen, and the number of columns occupied by components on an extremely small screen; the conversion interface is determined through the interface identifier.
[0011] In one example, generating a visual operation interface of the responsive interface according to the executable code specifically includes: dividing the visual operation interface into a control area, an operation area and a view area according to the executable code; wherein the control area is used to configure components of the responsive interface; the operation area is used to determine the component layout mode of the responsive interface and adjust the component width of the responsive interface; the view area is used to respond to drag changes and data changes in the operation area to render a preview interface.
[0012] In one example, the method also includes: determining that the control area includes an interface resolution switching area, a display mode switching area, and a group switching area; in the interface resolution switching area, extracting and rendering all resolutions supported by the current interface from the conversion interface; in the display mode switching area, determining whether the responsive interface is in standard mode; if so, upon receiving a first interface switching request, switching the standard mode of the responsive interface to the custom mode; if not, upon receiving a second interface switching request, determining whether the custom mode of the responsive interface matches the responsive interface implementation rule; if so, switching the custom mode of the responsive interface to the standard mode.
[0013] In one example, the method also includes: determining that the operation area includes a component display area and a component operation area; determining the configuration information of the responsive interface based on the data corresponding to the interface resolution switching area, the display mode switching area, and the group switching area sent by the control area, and extracting the component label from the component data to determine the component display area; extracting all optional items of the number of grids occupied by the component, and adding a draggable button for each component to determine the component operation area.
[0014] In one example, the method also includes: in the view area, according to the data corresponding to the interface resolution switching area, the display mode switching area, and the group switching area sent by the control area, determining the configuration information of the responsive interface; according to the configuration information of the responsive interface and the change data sent by the operation area, rendering the display interface of the responsive interface through the row conversion rules under the two-dimensional arrangement.
[0015] In one example, a user's configuration request is received, and the interface resolution and interface layout of the visual operation interface are configured to obtain an updated executable code, which specifically includes: receiving the user's configuration request, if the configuration request is to switch the interface resolution, then the interface resolution in the conversion interface is switched to the abbreviation value of the corresponding breakpoint; if the configuration request is to switch the mode of the responsive interface, then the responsive interface mode in the conversion interface is switched; if the configuration request is to switch component grouping, then the corresponding grouping value is obtained.
[0016] On the other hand, an embodiment of the present application provides a responsive interface implementation device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: determine an interface description of the responsive interface; the interface description includes custom mode determination rules and standard mode determination rules of the responsive interface, and responsive interface implementation rules corresponding to the standard mode; determine a component description of the responsive interface; the component description includes component belonging group conversion rules, component grid number conversion rules, and component row conversion rules under two-dimensional arrangement; through a pre-set conversion interface, according to the interface description and the component description, the component parameters in the container are processed to convert the component parameters into executable code; according to the executable code, a visual operation interface of the responsive interface is generated; a user's configuration request is received, and the interface resolution and interface layout configuration are performed on the visual operation interface to obtain an updated executable code; according to the updated executable code, an HTML DOM structure is generated; the HTML DOM structure is rendered to the form component area to generate the responsive interface
[0017] On the other hand, an embodiment of the present application provides a non-volatile computer storage medium for implementing a responsive interface, which stores computer executable instructions, and the computer executable instructions are configured to: determine an interface description of a responsive interface; the interface description includes custom mode determination rules and standard mode determination rules of the responsive interface, and responsive interface implementation rules corresponding to the standard mode; determine a component description of the responsive interface; the component description includes component belonging group conversion rules, component occupied grid number conversion rules, and component row conversion rules under a two-dimensional arrangement; through a pre-set conversion interface, the component parameters in the container are processed according to the interface description and the component description to convert the component parameters into executable code; according to the executable code, a visual operation interface of the responsive interface is generated; a user's configuration request is received, and the interface resolution and interface layout configuration are performed on the visual operation interface to obtain an updated executable code; according to the updated executable code, an html dom structure is generated; the html dom structure is rendered to the form component area to generate the responsive interface
[0018] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:
[0019] By constructing the interface description and component description of the responsive interface and generating executable code, a visual operation interface can be provided, allowing users to configure the responsive interface under different resolutions and view the visualization effect simultaneously. It not only provides a responsive interface in standard mode, which simplifies the development process, but also provides a responsive interface in custom mode, which realizes flexible configuration of the responsive interface and can meet the personalized needs of users. The component data is directly rendered in the visual operation interface, so that when the user modifies the configuration of the responsive interface, the system avoids frequently viewing the front-end generated interface. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solution of the present application, some embodiments of the present application will be described in detail below in conjunction with the accompanying drawings, in which:
[0021] Figure 1 A flowchart of a responsive interface implementation method provided in an embodiment of the present application;
[0022] Figure 2 A schematic diagram of a visual operation interface in a standard mode provided in an embodiment of the present application;
[0023] Figure 3 A schematic diagram of a visual operation interface of a custom mode provided in an embodiment of the present application;
[0024] Figure 4A schematic diagram of the structure of a responsive interface implementation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0026] Some embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0027] At present, the existing responsive interface layout method is mostly to preview the page after running the code, and the overall structural style modification needs to be performed in the DOM structure generated by HTML. If the developer wants to change the interface layout, he needs to query and modify the HTML structure in the source code and write the CSS style. The process is complicated and requires certain professional knowledge, and it is difficult to be flexibly reused. And when the interface size is enlarged, the components automatically wrap to fill the middle area. Due to the different widths of components, it is likely that the overall presentation style of the interface is not beautiful.
[0028] In addition, users cannot visually modify multiple display pages at different resolutions at the same time. When previewing streaming layout, adaptive layout method based on BFC characteristics, or responsive web design method with progressive enhancement, users will see the effect at the current interface resolution. When viewing other resolutions, it is necessary to use developer tools or switch screen sizes continuously, and then modify the CSS code. Developers configure the styles of different pages, and it is difficult to configure the effects at different resolutions at the same time.
[0029] In addition, it is difficult to support the customization and reuse of the overall interface. When the interface is laid out according to the responsive method, the size of each area changes. In the existing layout rules, the original components still retain their original size, and only the number of internal components is rearranged to fill the middle area. There is no rule that can configure components individually to achieve the effect of customizing the interface component style.
[0030] In addition, the existing page layout method only considers the changes of the layout container under the responsive interface, but does not consider the situation that components may be grouped inside the layout container. In a specific component collection area in the form designer, there may be component classification. In order to solve the above problem, this application proposes a responsive interface implementation method. Figure 1 Describe in detail.
[0031] Figure 1A flowchart of a responsive interface implementation method provided in an embodiment of the present application. The method can be applied to different business fields, such as Internet financial business field, e-commerce business field, instant messaging business field, game business field, official business field, etc. Certain input parameters or intermediate results in the process allow manual intervention and adjustment to help improve accuracy.
[0032] The analysis method involved in the embodiments of the present application can be implemented by a terminal device or a server, and the present application does not impose any special restrictions on this. For the convenience of understanding and description, the following embodiments are described in detail by taking a server as an example.
[0033] It should be noted that the server may be a single device or a system consisting of multiple devices, that is, a distributed server, and this application does not make any specific limitation on this.
[0034] Figure 1 The process in may include the following steps:
[0035] S102: Determine an interface description of a responsive interface; the interface description includes a custom mode determination rule and a standard mode determination rule of the responsive interface, and a responsive interface implementation rule corresponding to the standard mode.
[0036] In some embodiments of the present application, when determining the custom mode determination rules and the standard mode determination rules of the responsive interface, it is necessary to predetermine the number of grids occupied by the components corresponding to the multiple components of the container in the form designer. It should be noted that the form designer refers to the page where the user wants to modify the component layout, and one form designer contains one or more containers, and each container contains one or more components.
[0037] Then, it is determined whether the number of grids occupied by the components meets the preset breakpoint rules. If so, the responsive interface is determined to be in standard mode. If not, the responsive interface is determined to be in custom mode. In custom mode, the number of display columns of multiple components in different interface resolutions is controlled by the user. In other words, as long as the number of grids occupied by each component in the designer does not meet the breakpoint rules, it will be determined to be in custom mode.
[0038] Among them, a breakpoint rule table is pre-constructed, and the breakpoint rule table is used to describe the relationship between the breakpoint and the interface resolution, the number of grids occupied by components, and the number of display columns of the responsive interface in the standard mode. That is, the breakpoint rule table includes several breakpoint rules, and each breakpoint corresponds to the number of grids occupied by a specified component.
[0039] In addition, when determining the responsive interface implementation rules corresponding to the standard mode, the responsive interface is divided into twelve equal parts according to the resolution width according to the preset grid system, and the breakpoints corresponding to the resolution width of the responsive interface are determined in the preset breakpoint rule table, and the number of display columns of the responsive interface is determined as the specified number of display columns corresponding to the breakpoints. Among them, assuming that the resolution is 120px, after being divided into twelve equal parts, each grid occupies 10px. In the standard mode, if it is divided into only 1 column, 1 column occupies 12 grids, that is, 1 column occupies 120px. If it is divided into 2 columns, 1 column occupies 6 grids, that is, 1 column is 60px, and there are a maximum of 12 columns, that is, each column occupies 1 grid.
[0040] For example, the responsive interface implementation rules in standard mode utilize the 12-grid system and the breakpoint structure in the responsive layout. The 12-grid system is applied to responsive scenarios, dividing the entire interface into twelve equal parts by width. As the size of the interface or viewport increases, the system will automatically divide it into a maximum of 12 columns. Before reaching the resolution width of the next breakpoint, the number of display columns of the responsive interface can be maintained at the specified number of columns displayed in the current page layout, until the current viewport width reaches the range of the next breakpoint, then the specified number of display columns under the layout corresponding to the next breakpoint will be displayed.
[0041] More intuitively, the breakpoint rule table is shown in Table 1.
[0042] Table 1:
[0043]
[0044] In Table 1, there are 6 breakpoints: including X-small (extra small), abbreviated as xs, the resolution size is less than 576px, the number of grids occupied by the component is 12, and the column number display range under responsiveness, that is, the number of displayed columns is 1. It also includes small (small), abbreviated as sm, the resolution size is equal to 576px or greater than 576px and less than 768px, the number of grids occupied by the component is 12, and the number of displayed columns is 1. It also includes Medium, abbreviated as md, with a resolution size equal to or greater than 768px and less than 888px, the number of grids occupied by the component is 6, and the number of displayed columns is 1 to 2; it also includes Large, abbreviated as lg, with a resolution size equal to or greater than 888px and less than 1200px, the number of grids occupied by the component is 3, and the number of displayed columns is 1 to 4; it also includes Extra Large, abbreviated as xl, with a resolution size equal to or greater than 1200px and less than 1690px, the number of grids occupied by the component is 3, and the number of displayed columns is 1 to 4; it also includes Enormous Large, abbreviated as el, with a resolution size equal to or greater than 1690px, the number of grids occupied by the component is 2, and the number of displayed columns is 1 to 6.
[0045] For example, at an interface resolution of 800px, each component occupies 6 grids, and no more than 2 components are on a row, so the interface will display the standard mode first; and if the user sets a row at an interface resolution of 800px to display 4 components, and each component occupies 3 grids, the above rules are not met, and the display is in custom mode. When the user clicks the configuration button, the system verifies whether the interface data conforms to the display rules of the mode, and submits the data to the visual configuration interface if the verification is passed.
[0046] In summary, by determining the interface description, a standardized responsive interface is provided while meeting the user's needs for personalized interface customization.
[0047] S104: Determine a component description of the responsive interface; the component description includes component belonging group conversion rules, component occupied grid number conversion rules, and component row conversion rules in a two-dimensional arrangement.
[0048] In some embodiments of the present application, when determining the component belonging to the group conversion rule of the responsive interface, the components in the container of the form designer are marked with IDs to determine the grouped nodes and ungrouped nodes; the components in the grouped nodes are determined, and the component width and component position are set inside the grouped nodes. For example, all nodes with grouped nodes and ungrouped nodes are traversed, and starting from 1, they are increased by 1 at a time in the order from top to bottom and from left to right. All components are grouped and marked with the corresponding value of the area from which they come.
[0049] It is equivalent to defining grouped nodes and ungrouped nodes, and utilizing the component attribution group calculation method. Since there may be foldable components such as drop-downs inside the container, there may be ungrouped nodes above and below the component area. At this time, the two parts of the ungrouped nodes should not be merged, but should be divided into different components. Therefore, by adding a group ID tag where the component is located inside the container, grouped nodes and ungrouped nodes are distinguished. For components with group attribution, only the width and position adjustment of the component are supported within the original group. Cross-group processing of components is not allowed. This ensures that when the responsive interface changes, the component still retains the original grouping rules, ensuring that some ungrouped nodes will not be displayed out of place.
[0050] In addition, when determining the conversion rules for the number of grids occupied by components in a responsive interface, define the component class style of the standard mode and the component class style of the custom mode. Here, you can use any identifier English prefix + interface resolution abbreviation + the number of grids occupied by the component to form the overall class style, which is convenient for extracting the prerequisites for displaying the interface during subsequent operations. For example, the component class styles of the standard mode include: col-sm-12, col-md-6, col-lg-3, col-el-2, etc., and the component class styles of the custom mode include col-NUM, where NUM represents any integer from 1 to 12. By replacing the character part through the parstInt and replace functions, the number of grids occupied by the component can be extracted.
[0051] In addition, when determining the row conversion rules for components in a two-dimensional arrangement, the one-dimensional data is converted to two-dimensional data according to the number of grids occupied by the multiple components in the container in the form designer, and the row allocation algorithm is determined by subtracting the number of grids occupied by the components from the number of grids remaining, and the row positions of the multiple components are determined according to the row allocation algorithm. It should be noted that one-dimensional data means that all components in the container are originally in one row, and after conversion to two-dimensional data, it means that the components are allocated to different rows according to their width.
[0052] For example, suppose that on a large screen (900px) and in standard mode, the original class style of 4 components is col-lg-3, that is, each component occupies 3 grids, and each occupies 1 of the 4 columns. However, the subsequent class styles are set to col-lg-3, col-lg-3, col-lg-3, col-lg-6, respectively. Since the number of grids in a row is 12, after arranging 3 components, the remaining space is 3. At this time, the component occupying 6 grids cannot be placed, so this component is automatically placed in the next row. The row number tagRow changes, and other components move back in sequence.
[0053] S106: Processing the component parameters in the container according to the interface description and the component description through a preset conversion interface to convert the component parameters into executable codes.
[0054] In some embodiments of the present application, when setting the conversion interface, it is necessary to determine the interface identifier in the container. The interface identifier includes the current breakpoint, the current group, the current component name, the breakpoint setting, and the component value storage; the component value storage records the configuration value of the current component at different interface resolutions, and the component value storage includes the number of grids occupied by the super large screen, the number of grids occupied by the extremely large screen, the number of grids occupied by the medium screen, the number of grids occupied by the small screen, the number of grids occupied by the extremely small screen, the number of columns occupied by the components on the super large screen, the number of columns occupied by the components on the extremely large screen, the number of columns occupied by the components on the medium screen, the number of columns occupied by the components on the small screen, and the number of columns occupied by the components on the extremely small screen.
[0055] Then, the conversion interface is determined by the interface identifier. More intuitively, the interface identifier is shown in Table 2.
[0056] Table 2:
[0057]
[0058] As can be seen, the interface identifiers and the interface definitions corresponding to the interface identifiers are shown in Table 2. For example, the breakpoint setting corresponds to the specified number of display columns corresponding to the breakpoint of the responsive interface implementation rule.
[0059] Furthermore, the component values are stored as shown in Table 3.
[0060] Table 3:
[0061]
[0062]
[0063] As can be seen, Table 3 shows the interface names for component value storage and the interface definitions corresponding to each interface name.
[0064] That is, a conversion interface is defined, and the component parameters in the container are processed in sequence according to the rules of steps S102-S105, and the execution is repeated until all components are traversed, so that the component parameters are converted into executable codes, that is, the components are encapsulated.
[0065] S108: Generate a visual operation interface of the responsive interface according to the executable code.
[0066] In some embodiments of the present application, the visual operation interface is divided into a control area, an operation area, and a view area according to the executable code. The control area is used to configure the components of the responsive interface; the operation area is used to determine the component layout mode of the responsive interface and adjust the component width of the responsive interface; the view area is used to respond to the drag and drop changes and data changes in the operation area to render the preview interface.
[0067] Obviously, since the operation area is not the original component being dragged, but uses the grid number nodes occupied by the components in the original data, the DOM structure of the front-end HTML will not be changed frequently.
[0068] Among them, the control area includes an interface resolution switching area, a display mode switching area, and a group switching area.
[0069] In the interface resolution switching area, all resolutions supported by the current interface are extracted from the conversion interface and rendered.
[0070] In the display mode switching area, determine whether the responsive interface is in standard mode; if so, when receiving the first interface switching request, switch the standard mode of the responsive interface to the custom mode; if not, when receiving the second interface switching request, determine whether the custom mode of the responsive interface matches the responsive interface implementation rules; if they match, switch the custom mode of the responsive interface to the standard mode.
[0071] That is to say, since the standard mode complies with the responsive interface rules, it can be switched to the custom mode. However, since the custom mode can set the number of grids occupied by components, it is not allowed to switch to the standard mode when the responsive interface implementation rules are not met.
[0072] In the group switching area, it is used to switch the group nodes of the components.
[0073] Among them, the operation area includes the component display area and the component operation area. Specifically, according to the data corresponding to the interface resolution switching area, display mode switching area, and group switching area sent by the control area, the configuration information of the responsive interface is determined, and the component label is extracted from the component data as the component display area. In addition, all optional items of the number of grids occupied by the component are extracted, and a draggable button is added to each component as the component operation area. The basic preview effect can be met by the synchronous change of the position of the component label name.
[0074] In the view area, the configuration information of the responsive interface is determined according to the data corresponding to the interface resolution switching area, display mode switching area, and group switching area sent by the control area. At the same time, it is necessary to receive the configuration information of the responsive interface and the change data sent by the operation area, and render the display interface of the responsive interface through the row conversion rules under the two-dimensional arrangement.
[0075] More intuitively, the present application embodiment also provides a schematic diagram of a visual operation interface in a standard mode. Figure 2 shown.
[0076] exist Figure 2 In the control area, the switching of small screen, medium screen and extra large screen is included. Currently, it is a medium screen, that is, the switching of small interface resolution, medium interface resolution and extra large interface resolution is included. It also includes the switching of standard mode and automatic mode in the upper right corner. Currently, it is standard mode. It also includes the switching of regions. Currently, it is region 1. The components in the operation area include the organization, the person who reimburses, the reimbursement amount and the reimbursement type. Due to the medium interface resolution, it can be seen from Table 1 that the number of display columns is 1 to 2. Therefore, there are only 1 or 2 columns for users to choose. The preview area is shown on the right, including the corresponding organization, the person who reimburses, the reimbursement amount and the reimbursement type.
[0077] Furthermore, the present application embodiment also provides a schematic diagram of a visual operation interface of a custom mode. Figure 3 shown.
[0078] exist Figure 3 In the control area, the small screen, medium screen, and very large screen are switched. Currently, it is a medium screen, that is, the small interface resolution, medium interface resolution, and very large interface resolution are switched. It also includes switching for regions, currently region 1. The components in the operation area include the organization, the person who reimburses, the reimbursement amount, and the reimbursement type. Different from the standard mode, the user can customize the number of columns to be displayed, and there are multiple column options. The preview area is shown on the right, including the corresponding organization, the person who reimburses, the reimbursement amount, and the reimbursement type.
[0079] S110: receiving a configuration request from a user, performing interface resolution configuration and interface layout configuration on the visual operation interface, and obtaining an updated executable code.
[0080] In some embodiments of the present application, a configuration request from a user is received. If the configuration request is to switch the interface resolution, the interface resolution in the conversion interface is switched to the abbreviation value of the corresponding breakpoint; if the configuration request is to switch the responsive interface mode, the responsive interface mode in the conversion interface is switched; if the configuration request is to switch component grouping, the corresponding grouping value is obtained.
[0081] That is to say, the configuration is carried out according to the specific needs of the user. During the configuration process, the control area is responsible for group selection, interface resolution selection, and mode selection. The operation area is responsible for dragging components and configuring the number of columns. The view area renders the overall preview style. The configuration order in the whole process can be adjusted according to specific needs without affecting the final result. Steps that do not require configuration can also be omitted. The entire operation process is smooth, and the overall design flexibility and freedom are high.
[0082] S112: Generate an HTML DOM structure according to the updated executable code.
[0083] S114: Rendering the HTML DOM structure to the form component area to generate the responsive interface.
[0084] Among them, after the HTML structure is generated, the interaction form of the components remains the same, but the width of the area occupied by a single component supports free configuration. Moreover, under the premise of free configuration, the scope restrictions of the grouping are also retained, so that the form designer still retains the initial component classification architecture. Therefore, without affecting the flexible operation of the form designer, the configuration flexibility of a single component in the responsive style is greatly improved.
[0085] It should be noted that although the embodiments of the present application are based on Figure 1 Steps S102 to S114 are described in sequence, but this does not mean that steps S102 to S114 must be performed in a strict order. Figure 1 The order shown in the figure introduces and explains step S102 to step S114 in sequence to facilitate those skilled in the art to understand the technical solution of the embodiment of the present application. In other words, in the embodiment of the present application, the order between step S102 to step S114 can be appropriately adjusted according to actual needs.
[0086] pass Figure 1 The method can provide a visual configuration interface. The data linkage between the three main areas of the visual configuration interface allows the configuration of responsive interfaces at different resolutions and the simultaneous viewing of visualization effects. In addition, the conversion interface is generated, which can encapsulate component data and render the data directly on the visual operation interface. When users modify the configuration of the responsive interface, the system avoids frequently viewing the front-end generated page, but directly aggregates the configuration results of all nodes, greatly improving the computing performance and reusability. At the same time, it solves the problem that the interface effects at different resolutions cannot be visualized when the code is not re-run.
[0087] At the same time, in order to simplify the development process, a responsive interface in standard mode is provided. The standard mode complies with the existing responsive design rules, and users can quickly drag and drop to configure commonly used standard responsive interfaces.
[0088] It provides a responsive interface in custom mode, which can support the personalized customization of the responsive interface, provide component attribution group conversion strategy, support the overall architecture of the personalized customization interface and retain the original grouping rules of the components, so that the form designer still retains the initial component classification architecture.
[0089] It provides support for the configuration of a single component in a responsive interface. In addition to configuring the distribution style of interface components, users can also customize the size of the area occupied by a single component as needed, greatly improving the configuration flexibility.
[0090] Based on the same idea, some embodiments of the present application also provide devices and non-volatile computer storage media corresponding to the above methods.
[0091] Figure 4 A schematic diagram of a responsive interface implementation device provided in an embodiment of the present application includes:
[0092] at least one processor; and,
[0093] a memory communicatively connected to the at least one processor; wherein,
[0094] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0095] Determine an interface description of the responsive interface; the interface description includes a custom mode determination rule and a standard mode determination rule of the responsive interface, and a responsive interface implementation rule corresponding to the standard mode;
[0096] Determine the component description of the responsive interface; the component description includes component belonging group conversion rules, component occupied grid number conversion rules and component row conversion rules in two-dimensional arrangement;
[0097] Processing the component parameters in the container according to the interface description and the component description through a preset conversion interface to convert the component parameters into executable code;
[0098] Generate a visual operation interface of the responsive interface according to the executable code;
[0099] Receiving a configuration request from a user, performing interface resolution configuration and interface layout configuration on the visual operation interface, and obtaining an updated executable code;
[0100] Generate an HTML DOM structure according to the updated executable code;
[0101] The HTML DOM structure is rendered to the form component area to generate the responsive interface.
[0102] Some embodiments of the present application provide a responsive interface implementation non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to:
[0103] Determine an interface description of the responsive interface; the interface description includes a custom mode determination rule and a standard mode determination rule of the responsive interface, and a responsive interface implementation rule corresponding to the standard mode;
[0104] Determine the component description of the responsive interface; the component description includes component belonging group conversion rules, component occupied grid number conversion rules and component row conversion rules in two-dimensional arrangement;
[0105] Processing the component parameters in the container according to the interface description and the component description through a preset conversion interface to convert the component parameters into executable code;
[0106] Generate a visual operation interface of the responsive interface according to the executable code;
[0107] Receiving a configuration request from a user, performing interface resolution configuration and interface layout configuration on the visual operation interface, and obtaining an updated executable code;
[0108] Generate an HTML DOM structure according to the updated executable code;
[0109] The HTML DOM structure is rendered to the form component area to generate the responsive interface.
[0110] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0111] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0112] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0113] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0114] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0116] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0117] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0118] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0119] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0120] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the technical principle of the present application should all fall within the protection scope of the present application.
Claims
1. A method for implementing a responsive interface, characterized in that: The method comprises: Determine an interface description of the responsive interface; the interface description includes a custom mode determination rule and a standard mode determination rule of the responsive interface, and a responsive interface implementation rule corresponding to the standard mode; Determine the component description of the responsive interface; the component description includes component belonging group conversion rules, component occupied grid number conversion rules and component row conversion rules in two-dimensional arrangement; Determine a preset conversion interface, and process the component parameters in the container according to the interface description and the component description through the conversion interface to convert the component parameters into executable code; Generate a visual operation interface of the responsive interface according to the executable code; Receiving a configuration request from a user, performing interface resolution configuration and interface layout configuration on the visual operation interface, and obtaining an updated executable code; Generate an HTML DOM structure according to the updated executable code; Rendering the HTML DOM structure to the form component area to generate the responsive interface; The interface description of the determined responsive interface specifically includes: According to a preset grid system, the responsive interface is divided into twelve equal parts according to the resolution width, a breakpoint corresponding to the resolution width of the responsive interface is determined in a preset breakpoint rule table, and the number of display columns of the responsive interface is determined as the specified number of display columns corresponding to the breakpoint, so as to determine a responsive interface implementation rule corresponding to the standard mode; and Determine the number of grids occupied by components corresponding to the multiple components in the container of the form designer; Determine whether the number of grids occupied by the components meets the preset breakpoint rules; If so, determining that the responsive interface is in standard mode; If not, determining that the responsive interface is in custom mode; in the custom mode, the number of display columns of the multiple components in different interface resolutions is controlled by the user; The determining of the component description of the responsive interface specifically includes: Marking the components of the container in the form designer with IDs to determine grouped nodes and ungrouped nodes; determining the components in the grouped nodes, setting the component width and component position in the grouped nodes, so as to determine the component belonging to group conversion rules of the responsive interface; and Determine a conversion rule for the number of grids occupied by components of the responsive interface according to the component class style of the standard mode and the component class style of the custom mode; and According to the number of grids occupied by the multiple components in the container of the form designer, the one-dimensional data is converted into two-dimensional data, and a row allocation algorithm is determined by subtracting the number of grids occupied by the components from the number of grids remaining, and the row positions of the multiple components are determined according to the row allocation algorithm to determine the row conversion rules of the components under the two-dimensional arrangement; Determine the pre-set conversion interface, including: Determine the interface identifier in the container; the interface identifier includes the current breakpoint, the current group, the current component name, the breakpoint setting, and the component value storage; the component value storage records the configuration value of the current component at different interface resolutions, and the component value storage includes the number of grids occupied by the super large screen, the number of grids occupied by the extremely large screen, the number of grids occupied by the medium screen, the number of grids occupied by the small screen, the number of grids occupied by the extremely small screen, the number of columns occupied by the components on the super large screen, the number of columns occupied by the components on the extremely large screen, the number of columns occupied by the components on the medium screen, the number of columns occupied by the components on the small screen, and the number of columns occupied by the components on the extremely small screen; The conversion interface is determined by the interface identifier.
2. The method according to claim 1, characterized in that The step of generating a visual operation interface of the responsive interface according to the executable code specifically includes: According to the executable code, the visual operation interface is divided into a control area, an operation area and a viewing area; Among them, the control area is used to configure the components of the responsive interface; the operation area is used to determine the component layout of the responsive interface and adjust the component width of the responsive interface; the view area is used to respond to the drag changes and data changes in the operation area to render the preview interface.
3. The method according to claim 2, characterized in that The method further comprises: Determine that the control area includes an interface resolution switching area, a display mode switching area, and a group switching area; In the interface resolution switching area, all resolutions supported by the current interface are extracted and rendered from the conversion interface; In the display mode switching area, determining whether the responsive interface is in standard mode; If yes, upon receiving the first interface switching request, switching the standard mode of the responsive interface to the custom mode; If not, when receiving the second interface switching request, it is determined whether the custom mode of the responsive interface matches the responsive interface implementation rule; if matched, the custom mode of the responsive interface is switched to the standard mode.
4. The method according to claim 3, characterized in that The method further comprises: Determining that the operation area includes a component display area and a component operation area; Determine the configuration information of the responsive interface according to the data corresponding to the interface resolution switching area, the display mode switching area, and the group switching area sent by the control area, and extract the component tag from the component data to determine the component display area; Extract all options for the number of grids occupied by components, and add a draggable button to each component to determine the component operation area.
5. The method according to claim 3, characterized in that: The method further comprises: In the viewing area, the configuration information of the responsive interface is determined according to the data corresponding to the interface resolution switching area, the display mode switching area, and the group switching area sent by the control area; According to the configuration information of the responsive interface and the change data sent by the operation area, a display interface of the responsive interface is rendered through a row conversion rule under a two-dimensional arrangement.
6. The method according to claim 1, characterized in that Receiving a configuration request from a user, configuring the interface resolution and the interface layout of the visual operation interface, and obtaining an updated executable code, specifically including: receiving a configuration request from a user, and if the configuration request is to switch the interface resolution, switching the interface resolution in the conversion interface to an abbreviated value of a corresponding breakpoint; If the configuration request is to switch the mode of the responsive interface, the responsive interface mode in the conversion interface is switched; If the configuration request is to switch component groups, get the corresponding group value.
7. A responsive interface implementation device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a responsive interface implementation method as described in any one of claims 1-6 above.
Citation Information
Patent Citations
Multi-screen response type webpage layout adjustment method
CN105740315A
Form interface format configuration and interface display method and device, and medium
CN114281463A
Responsive layout system and server
CN114365084A
Responsive Grid Layouts for Graphic Design
US20180276182A1
