CN112162679A - Drop-down menu configuration method and device, electronic equipment and storage medium - Google Patents

Drop-down menu configuration method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112162679A
CN112162679A CN202011132966.2A CN202011132966A CN112162679A CN 112162679 A CN112162679 A CN 112162679A CN 202011132966 A CN202011132966 A CN 202011132966A CN 112162679 A CN112162679 A CN 112162679A
Authority
CN
China
Prior art keywords
menu
pull
level
menu item
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011132966.2A
Other languages
Chinese (zh)
Other versions
CN112162679B (en
Inventor
吴桐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Lewo Wuxian Technology Co ltd
Original Assignee
Beijing Lewo Wuxian Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Lewo Wuxian Technology Co ltd filed Critical Beijing Lewo Wuxian Technology Co ltd
Priority to CN202011132966.2A priority Critical patent/CN112162679B/en
Publication of CN112162679A publication Critical patent/CN112162679A/en
Application granted granted Critical
Publication of CN112162679B publication Critical patent/CN112162679B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0482Interaction with lists of selectable items, e.g. menus

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The pull-down menu configuration method, device, electronic equipment and storage medium provided by the embodiment of the invention are applied to the technical field of information, and a multi-level pull-down menu is created; setting menu item field identifications and menu item names for all menu items in the multi-level pull-down menu to obtain the pull-down menu after the menu items are set; setting an index value of each menu item according to the menu item field identification and the menu item name to obtain the menu item with the set index value; retrieving the multilevel pull-down menu according to the index value to obtain list structure data of the multilevel pull-down menu; serializing the list structure data to obtain multi-level pull-down menu data in a target format; and setting a logic structure of the pull-down menu data in the target format to obtain multi-level pull-down menu data to be displayed. Therefore, when the logic structure is changed, the data of the pull-down menu only needs to be set according to the changed logic structure, and the maintenance efficiency of the pull-down menu is improved.

Description

Drop-down menu configuration method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of information technologies, and in particular, to a method and an apparatus for configuring a pull-down menu, an electronic device, and a storage medium.
Background
At present, when information is recorded at application terminals such as APP and WEB, the information is often recorded in a pull-down menu mode. For example, in the process of filling in personal information on a webpage, when a user address is filled in, a plurality of options in a market appear when a pull-down menu is clicked, and the user clicks the corresponding option to complete information entry.
In the actual use process, the situation that maintenance needs to be carried out on the pull-down menu often occurs. For example, with the establishment of three cities in China, the drop-down menu may have a situation that the option of the three cities needs to be added. However, currently, pull-down menus are often static menus, that is, pull-down menus at different levels are directly written by codes, so that when maintenance personnel maintain the pull-down menus, the codes need to be rewritten, which causes inconvenience in maintaining the pull-down menus.
Disclosure of Invention
An embodiment of the present invention provides a pull-down menu configuration method, an apparatus, an electronic device, and a storage medium, so as to solve the problem of inconvenient maintenance of a pull-down menu. The specific technical scheme is as follows:
in a first aspect of the present invention, a method for configuring a pull-down menu is provided, including:
creating a multi-level pull-down menu;
setting menu item field identifications and menu item names for all menu items in the multi-level pull-down menu to obtain the pull-down menu after the menu items are set;
setting an index value of each menu item according to the field identifier of the menu item and the name of the menu item to obtain the menu item with the set index value, wherein in each menu item, the index value of a sub-level menu item except for the final-level menu item is larger than the index value of a parent-level menu item, and the final-level menu item is the menu item without the sub-level menu item;
retrieving the multilevel pull-down menu according to the index value to obtain list structure data of the multilevel pull-down menu;
serializing the list structure data to obtain multi-level pull-down menu data in a target format;
and setting a logic structure of the pull-down menu data in the target format to obtain multi-level pull-down menu data to be displayed, wherein the logic structure comprises the corresponding relation between a child level and a parent level in each menu item.
Optionally, the method further includes:
and when the logic structure is changed, adjusting the multi-level pull-down menu data to be displayed according to the changed logic.
Optionally, the method further includes:
analyzing the multi-level pull-down menu data to be displayed to obtain menu item field identifications and menu item names of all menu items;
rendering each menu item according to the menu item field identification and the menu item name of each menu item to obtain a rendered menu component;
and displaying the rendered menu components through a preset client interface.
Optionally, the method further includes:
judging whether a third party interface is accessed;
and if so, acquiring the pull-down menu data in the target format through a third-party interface.
Optionally, the obtaining of the pull-down menu data in the target format through the third-party interface includes:
acquiring a third party interface address;
acquiring list structure data of the multilevel pull-down menu through a third-party interface address;
judging whether the list structure data of the multi-level pull-down menu meets a preset standard or not;
and if so, serializing the list structure data of the multi-level pull-down menu to obtain the pull-down menu data in the target format.
In a second aspect of the present invention, there is provided a pull-down menu configuration apparatus, including:
the menu creating module is used for creating a multi-level pull-down menu;
the menu setting module is used for setting menu item field identifications and menu item names for all menu items in the multi-level pull-down menu to obtain the pull-down menu after the menu items are set;
the index value setting module is used for setting the index value of each menu item according to the menu item field identifier and the menu item name to obtain the menu item with the set index value, wherein in each menu item, the index value of a sub-level menu item except the final-level menu item is larger than the index value of a parent-level menu item, and the final-level menu item is the menu item without the sub-level menu item;
the menu retrieval module is used for retrieving the multi-level pull-down menu according to the index value to obtain list structure data of the multi-level pull-down menu;
the data serialization module is used for serializing the list structure data to obtain multi-level pull-down menu data in a target format;
and the logic setting module is used for setting a logic structure of the pull-down menu data in the target format to obtain multi-level pull-down menu data to be displayed, wherein the logic structure comprises the corresponding relation between a child level and a parent level in each menu item.
Optionally, the apparatus further comprises:
and the logic change module is used for adjusting the multi-level pull-down menu data to be displayed according to the changed logic when the logic structure is changed.
Optionally, the apparatus further comprises:
the menu analysis module is used for analyzing the multi-level pull-down menu data to be displayed to obtain menu item field identifiers and menu item names of all menu items;
the menu rendering module is used for rendering each menu item according to the menu item field identifier and the menu item name of each menu item to obtain a rendered menu component;
and the menu display module is used for displaying the rendered menu components through a preset client interface.
Optionally, the apparatus further comprises:
the interface judging module is used for judging whether to access a third party interface;
and the interface data acquisition module is used for acquiring the pull-down menu data in the target format through the third party interface if the third party interface is accessed.
Optionally, the interface data obtaining module includes:
the address acquisition submodule is used for acquiring a third-party interface address;
the list structure acquisition submodule is used for acquiring the list structure data of the multilevel pull-down menu through the third-party interface address;
the standard judgment submodule is used for judging whether the list structure data of the multi-level pull-down menu meet the preset standard or not;
and the list serialization submodule is used for serializing the list structure data of the multi-level pull-down menu to obtain the pull-down menu data in the target format if the list structure data of the multi-level pull-down menu meets the preset specification.
In a third aspect of the present invention, an electronic device is provided, which includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any pull-down menu configuration method when executing the computer program stored in the memory.
In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, and the computer program is executed by a processor to implement any one of the pull-down menu configuration methods described above.
The embodiment of the invention has the following beneficial effects:
the pull-down menu configuration method, the pull-down menu configuration device, the electronic equipment and the storage medium can create a multi-level pull-down menu; setting menu item field identifications and menu item names for all menu items in the multi-level pull-down menu to obtain the pull-down menu after the menu items are set; setting an index value of each menu item according to the field identifier of the menu item and the name of the menu item to obtain the menu item with the set index value, wherein in each menu item, the index value of a sub-level menu item except for the final-level menu item is larger than the index value of a parent-level menu item, and the final-level menu item is the menu item without the sub-level menu item; retrieving the multilevel pull-down menu according to the index value to obtain list structure data of the multilevel pull-down menu; serializing the list structure data to obtain multi-level pull-down menu data in a target format; and setting a logic structure of the pull-down menu data in the target format to obtain multi-level pull-down menu data to be displayed, wherein the logic structure comprises the corresponding relation between a child level and a parent level in each menu item. Therefore, when the logic structure is changed, the pull-down menu data only needs to be set according to the changed logic structure, and the multi-level pull-down menu data does not need to be rewritten, so that the pull-down menu maintenance difficulty is reduced, and the pull-down menu maintenance efficiency is improved.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
Fig. 1 is a first flowchart illustrating a pull-down menu configuration method according to an embodiment of the present disclosure;
FIG. 2 is a diagram illustrating an example of list structure data according to an embodiment of the present application;
fig. 3 is a second flowchart illustrating a drop-down menu configuration method according to an embodiment of the present disclosure;
fig. 4 is a schematic flowchart illustrating a process of rendering each menu item according to an embodiment of the present application;
FIG. 5 is a schematic flow chart illustrating a process for obtaining pull-down menu data according to an embodiment of the present application;
FIG. 6 is a schematic diagram of third party interface address entry according to an embodiment of the present application;
FIG. 7 is a diagram illustrating a background menu configuration according to an embodiment of the present application;
FIG. 8 is a diagram illustrating an example of creating a multi-level linked menu according to an embodiment of the present disclosure;
FIG. 9 is a diagram illustrating an example of multi-level linked menu rendering according to an embodiment of the present disclosure;
FIG. 10 is a diagram illustrating an example of rendered menu components according to an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of a pull-down menu configuration apparatus according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problem that a pull-down menu in the prior art is inconvenient to maintain, embodiments of the present application provide a pull-down menu configuration method and apparatus, an electronic device, and a storage medium.
In one embodiment of the present application, the method includes:
creating a multi-level pull-down menu;
setting menu item field identifications and menu item names for all menu items in the multi-level pull-down menu to obtain the pull-down menu after the menu items are set;
setting an index value of each menu item according to the field identifier of the menu item and the name of the menu item to obtain the menu item with the set index value, wherein in each menu item, the index value of a sub-level menu item except for the final-level menu item is larger than the index value of a parent-level menu item, and the final-level menu item is the menu item without the sub-level menu item;
retrieving the multilevel pull-down menu according to the index value to obtain list structure data of the multilevel pull-down menu;
serializing the list structure data to obtain multi-level pull-down menu data in a target format;
and setting a logic structure of the pull-down menu data in the target format to obtain multi-level pull-down menu data to be displayed, wherein the logic structure comprises the corresponding relation between a child level and a parent level in each menu item.
By applying the scheme of the application, when the logic structure is changed, the pull-down menu data only needs to be set according to the changed logic structure, and the code rewriting of the multi-level pull-down menu data is not needed, so that the difficulty of pull-down menu maintenance is reduced, and the efficiency of pull-down menu maintenance is improved.
The following describes in detail a drop-down menu configuration method provided in an embodiment of the present application with a specific embodiment.
In the embodiment of the present Application, the pull-down menu is an information entry method used when an Application such as APP (Application program) or WEB (World Wide WEB) enters information. For example, when the user fills in the address, a plurality of options in the market appear when clicking the pull-down menu, and the user clicks the corresponding options to complete the information entry.
Referring to fig. 1, fig. 1 is a first flowchart illustrating a drop-down menu configuration method according to an embodiment of the present application, including:
in step S11, a multi-level pull-down menu is created.
Wherein, the multi-level pull-down menu can be various types of pull-down menus. For example, the pull-down menu may be a multi-level pull-down menu corresponding to address information, or a multi-level pull-down menu corresponding to personal information such as gender and identification number. Creating the multi-level drop-down menu may also create an id (identity document) corresponding to the multi-level drop-down menu at the same time.
For example, a multi-level pull-down menu corresponding to the address information is created, such as country, province, city, etc., wherein one level of the country may include china, usa, japan, etc., one level of the province includes shaanxi province, Shandong province, Guangdong province, etc., and one level of the city includes Xian city, Suiyang city, Bao Ji city, etc.
The multi-level pull-down menu is a pull-down menu corresponding to a plurality of items, for example, when an address is filled, a plurality of items of address information such as country, province, city, and the like are corresponding to the pull-down menu.
In this embodiment of the application, the configuration method of the pull-down menu may be executed by an intelligent terminal, and the intelligent terminal may be a back-end server or a computer for maintaining the multi-level pull-down menu.
And step S12, setting menu item field identifications and menu item names for each menu item in the multilevel pull-down menu to obtain the pull-down menu after the menu items are set.
In the actual use process, the menu item field identifier and the menu item name are set for each menu item in the multi-level pull-down menu, and the setting can be the menu item field identifier (key) and the menu item name (name).
For example, the menu item field corresponding to China is identified as cn, the menu item name is China, the menu item field corresponding to the United states is identified as us, and the menu item name is United states.
And step S13, setting the index value of each menu item according to the menu item field identification and the menu item name to obtain the menu item with the set index value.
In each menu item, the index value of each menu item is set, and the index value can be set according to the sequence from the parent level to the child level. Thus, the index value of the sub-level menu item is greater than the index value of the parent-level menu item, except for the last-level menu item, which is a menu item where there is no sub-level menu item.
In the actual use process, the setting of the index value of each menu item is performed according to the menu item field identification and the menu item name, which may be the setting of the index value (child) of each menu item. And associating each level of menu list through the index value, and retrieving corresponding menu list data in the multi-level linkage menu list structure. Wherein the index value of the last menu item may be uniformly set to a same value, for example-1.
For example, indexes of 1, 2, and 3 are set for china, usa, and japan, while the index of the final stage is "xi 'an", suyang ", and baoji", and the index of the final stage is "1" for each of xi' an ", suyang", and baoji ".
And step S14, retrieving the multi-level pull-down menu according to the index value to obtain the list structure data of the multi-level pull-down menu.
The list structure of the multi-level pull-down menu is a comprehensive list structure formed by taking menu lists at all levels as elements. All the single-level menu lists can be retrieved through the index values of the multi-level menu lists; each single-level menu list is a list composed of a plurality of menu item data as elements; the menu item data specifically includes: three core parameters of menu item field identification, menu item name and sub-level menu index value; and the sub-level menu index value is a directly related next-level menu index value and is used for retrieving corresponding menu list data in the multi-level linkage menu list structure for related display. When the index value of the last menu item is uniformly set to-1, a menu without sub-level is indicated when the index value of-1 is detected. Referring to fig. 2, fig. 2 is a diagram illustrating an example of list structure data according to an embodiment of the present application.
And step S15, serializing the list structure data to obtain the multi-level pull-down menu data in the target format.
In the actual use process, the list structure data is serialized, and the list structure data can be serialized into JSON (JSON Object Notation) format data and stored in a database.
Step S16, the logic structure of the pull-down menu data in the target format is set, and the multi-level pull-down menu data to be displayed is obtained.
The logic structure comprises the corresponding relation between the child level and the parent level in each menu item. For example, the provinces such as shanxi province, shandong province and guangdong province belong to China, so that the primary menu items of the provinces such as shanxi province, shandong province and guangdong province can be corresponding to China in the primary menu items of the countries, and the cities such as xi 'an city, sha yang city and bao ji city belong to the shanxi province, so that the primary menu items of the cities such as xi' an city, sha yang city and bao ji city can be corresponding to the shanxi province in the primary menu items of the provinces.
The logic structure of the pull-down menu data in the target format is set, so that linkage of the multi-level menus can be realized, for example, when a user fills in an address, when one province selects shanxi, the corresponding first-level options in the city can appear in west-ann city, shanyang city, chicken city and the like, and when one province selects Shandong, the corresponding first-level options in the city can appear in Jinan city, Qingdao city, tobacco platform city and the like.
The logical structure of the pull-down menu data in the target format is set, and the logical structure can be set based on the index values of the pull-down menus in the pull-down menu data in the target format and the positions of the pull-down menus in the list structure. For example, china corresponds to an index value of 1, shaanxi province has an index value of 5, and Shandong province has an index value of 7, and the drop-down menu data in the target format is logically configured, and sub-levels having index values of 1 may be configured by setting index values of 5 and 7. And for the final stages of the xi' an city, the yang city, the chicken city and the like, all index values are-1, and the logical relationship can be set based on the position of the final stage in the list structure and the index value of 5.
By applying the scheme of the application, when the logic structure is changed, the pull-down menu data only needs to be set according to the changed logic structure, and the code rewriting of the multi-level pull-down menu data is not needed, so that the difficulty of pull-down menu maintenance is reduced, and the efficiency of pull-down menu maintenance is improved.
Referring to fig. 3, fig. 3 is a second flowchart illustrating a drop-down menu configuration method according to an embodiment of the present application, where the method further includes:
in step S17, when the logical structure is changed, the multilevel pull-down menu data to be displayed is adjusted according to the changed logic.
And adjusting the multi-level pull-down menu data to be displayed according to the changed logic, and realizing the change of the logic structure by modifying the index value of the menu item. For example, the index value of beijing is 11, the index value of hebei province is 15, and the index value of male security is 20, when male security belongs to beijing, the menu item whose logical relationship should be the index value 15 is the parent level of the menu item with the index value 20, and after male security is divided into beijing, the logical structure change can be realized only by setting the menu item with the index value 11 as the parent level of the menu item with the index value 20.
By applying the scheme of the application, when the logic structure is changed, the pull-down menu data only needs to be set according to the changed logic structure, and the code rewriting of the multi-level pull-down menu data is not needed, so that the difficulty of pull-down menu maintenance is reduced, and the efficiency of pull-down menu maintenance is improved.
Referring to fig. 4, fig. 4 is a schematic view of a rendering process performed on each menu item according to an embodiment of the present application, including:
and step S18, analyzing the multi-level pull-down menu data to be displayed to obtain the menu item field identification and the menu item name of each menu item.
The analysis of the multi-level pull-down menu data to be displayed can be realized by inquiring the multi-level pull-down menu data in a database through the ID corresponding to the multi-level pull-down menu when the APP and the WEB application terminal are initialized/the page is updated, and analyzing the inquired multi-level pull-down menu data.
The menu item field identifier and the menu item name of each menu item may be preset, for example: the menu item field corresponding to China is marked cn, the name of the menu item is China, the menu item field corresponding to the United states is marked us, and the name of the menu item is United states.
And step S19, rendering each menu item according to the menu item field identification and the menu item name of each menu item to obtain a rendered menu component.
The method comprises the steps of analyzing multilevel pull-down menu data to be displayed to obtain menu item field identifications and menu item names of all menu items, and rendering all menu items according to the menu item field identifications and the menu item names of all menu items to obtain rendered menu components. For example, a multi-level linkage menu list structure is obtained by analyzing JSON data, and a primary menu component is rendered according to the primary menu structure to obtain a rendered menu component.
When a user selects a current level menu item, the front end acquires a sub-level menu index value of the corresponding menu item, and judges whether the index value is a preset specified value, such as-1; if not, retrieving a corresponding menu list from the multi-level linkage menu list structure according to the index value, and rendering the sub-level menu components; if yes, the current menu item is indicated to be the corresponding sub-menu item.
And step S20, displaying the rendered menu component through a preset client interface.
And displaying the rendered menu components through a preset client interface. The rendered menu components can be displayed through a preset client interface when the APP and the WEB application terminals are initialized/updated.
By the aid of the method and the device, each menu item can be rendered according to the menu item field identification and the menu item name of each menu item, rendered menu components are obtained, and the rendered menu components are displayed through the preset client interface.
Referring to fig. 5, fig. 5 is a schematic flowchart of a process for acquiring pull-down menu data according to an embodiment of the present application, including:
and step S51, judging whether to access a third party interface.
In step S52, if yes, pull-down menu data in the target format is obtained through the third-party interface.
The method for acquiring the pull-down menu data in the target format through the third-party interface comprises the following steps:
acquiring a third party interface address; acquiring list structure data of the multilevel pull-down menu through a third-party interface address; judging whether the list structure data of the multi-level pull-down menu meets a preset standard or not; and if so, serializing the list structure data of the multi-level pull-down menu to obtain the pull-down menu data in the target format.
In the actual use process, the list structure data of the multi-level pull-down menu is serialized to obtain the pull-down menu data in the target format. Whether the menu list structure data returned by the interface meets the specification or not can be checked; if the verification is passed, the data are serialized into JSON format data and stored in a database; and if the verification fails, configuring through the pull-down menu configuration method.
The pull-down menu data in the target format is acquired through the third-party interface, so that the pull-down menu data provided by the third-party interface can be acquired in real time, and the pull-down menu can be rapidly updated according to the pull-down menu data provided by the third-party interface.
The pull-down menu data in the target format is acquired through the third-party interface, the menu structure data can be directly dynamically provided by the third-party interface for real-time updating, manual processing is not needed, and therefore the problem of large-data-volume menu item configuration is effectively solved.
In order to explain the configuration method of the pull-down menu provided in the embodiment of the present application, a specific application scenario is described below. For example, when the drop-down menu configuration method provided by the embodiment of the present application is applied to a drop-down menu component of a live.
1. Firstly, a multi-level pull-down menu can be created in a menu configuration background during product operation, and a system automatically generates a unique identification ID;
2. if the menu data is directly provided by the third-party interface, inputting an interface address, and obtaining pull-down menu data in a target format through the third-party interface, referring to fig. 6, where fig. 6 is a schematic diagram of inputting a third-party interface address in the embodiment of the present application;
3. if the configuration is performed manually, setting menu list data at each level and sub-level menu index values thereof in a menu configuration background, referring to fig. 7, where fig. 7 is a schematic diagram of the menu configuration background according to the embodiment of the present application;
4. the menu configuration background system generates a multi-level menu list structure according to the menu structure data configured by the user, serializes the multi-level menu list structure into JSON data, and stores the JSON data into a back-end database, referring to FIG. 8, wherein FIG. 8 is an example diagram for creating a multi-level linkage menu according to the embodiment of the application;
5. when a front-end menu is initialized/updated, firstly, the data of the multi-level menu list structure is pulled from the database according to the menu ID, and then the menu list structure is traversed step by step according to a specific rule, so that the multi-level linkage relation of the front-end pull-down menu component and the menu items thereof can be efficiently rendered, see fig. 9, and fig. 9 is an example diagram for rendering the multi-level linkage menu in the embodiment of the application. A rendered menu component can be obtained by rendering a multi-level linked menu, and referring to fig. 10, fig. 10 is a diagram illustrating an example of a rendered menu component according to an embodiment of the present application.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a pull-down menu configuration apparatus according to an embodiment of the present application, including:
a menu creating module 1101 for creating a multi-level pull-down menu;
the menu setting module 1102 is configured to perform setting of a menu item field identifier and a menu item name for each menu item in the multi-level pull-down menu to obtain a pull-down menu after the menu item is set;
an index value setting module 1103, configured to perform index value setting on each menu item according to a menu item field identifier and a menu item name, to obtain a menu item with a set index value, where in each menu item, an index value of a sub-level menu item is greater than an index value of a parent-level menu item except for a last-level menu item, and the last-level menu item is a menu item without a sub-level menu item;
the menu retrieval module 1104 is used for retrieving the multi-level pull-down menu according to the index value to obtain list structure data of the multi-level pull-down menu;
a data serialization module 1105, configured to serialize the list structure data to obtain multi-level pull-down menu data in the target format;
the logic setting module 1106 is configured to set a logic structure for the pull-down menu data in the target format to obtain multi-level pull-down menu data to be displayed, where the logic structure includes a correspondence between a child level and a parent level in each menu item.
Optionally, the apparatus further comprises:
and the logic change module is used for adjusting the multi-level pull-down menu data to be displayed according to the changed logic when the logic structure is changed.
Optionally, the apparatus further comprises:
the menu analysis module is used for analyzing the multi-level pull-down menu data to be displayed to obtain menu item field identifiers and menu item names of all menu items;
the menu rendering module is used for rendering each menu item according to the menu item field identifier and the menu item name of each menu item to obtain a rendered menu component;
and the menu display module is used for displaying the rendered menu components through a preset client interface.
Optionally, the apparatus further comprises:
the interface judging module is used for judging whether to access a third party interface;
and the interface data acquisition module is used for acquiring the pull-down menu data in the target format through the third party interface if the third party interface is accessed.
Optionally, the interface data obtaining module includes:
the address acquisition submodule is used for acquiring a third-party interface address;
the list structure acquisition submodule is used for acquiring the list structure data of the multilevel pull-down menu through the third-party interface address;
the standard judgment submodule is used for judging whether the list structure data of the multi-level pull-down menu meet the preset standard or not;
and the list serialization submodule is used for serializing the list structure data of the multi-level pull-down menu to obtain the pull-down menu data in the target format if the list structure data of the multi-level pull-down menu meets the preset specification.
By applying the scheme of the application, when the logic structure is changed, the pull-down menu data only needs to be set according to the changed logic structure, and the code rewriting of the multi-level pull-down menu data is not needed, so that the difficulty of pull-down menu maintenance is reduced, and the efficiency of pull-down menu maintenance is improved.
An embodiment of the present invention further provides an electronic device, as shown in fig. 12, including a processor 1201, a communication interface 1202, a memory 1203, and a communication bus 1204, where the processor 1201, the communication interface 1202, and the memory 1203 complete mutual communication through the communication bus 1004,
a memory 1203 for storing a computer program;
the processor 1201 is configured to implement the following steps when executing the program stored in the memory 1203:
creating a multi-level pull-down menu;
setting menu item field identifications and menu item names for all menu items in the multilevel pull-down menu to obtain a pull-down menu after the menu items are set;
setting index values of the menu items according to the menu item field identifications and the menu item names to obtain the menu items with the set index values, wherein in the menu items, the index values of sub-level menu items except for the final-level menu item are larger than the index values of parent-level menu items, and the final-level menu item is the menu item without the sub-level menu items;
retrieving the multilevel pull-down menu according to the index value to obtain list structure data of the multilevel pull-down menu;
serializing the list structure data to obtain multi-level pull-down menu data in a target format;
and setting a logic structure of the pull-down menu data in the target format to obtain multi-level pull-down menu data to be displayed, wherein the logic structure comprises the corresponding relation between a child level and a parent level in each menu item.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the pull-down menu configuration methods described above.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer, causes the computer to perform any of the pull-down menu configuration methods of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for configuring a pull-down menu, comprising:
creating a multi-level pull-down menu;
setting menu item field identifications and menu item names for all menu items in the multilevel pull-down menu to obtain a pull-down menu after the menu items are set;
setting index values of the menu items according to the menu item field identifications and the menu item names to obtain the menu items with the set index values, wherein in the menu items, the index values of sub-level menu items except for the final-level menu item are larger than the index values of parent-level menu items, and the final-level menu item is the menu item without the sub-level menu items;
retrieving the multilevel pull-down menu according to the index value to obtain list structure data of the multilevel pull-down menu;
serializing the list structure data to obtain multi-level pull-down menu data in a target format;
and setting a logic structure of the pull-down menu data in the target format to obtain multi-level pull-down menu data to be displayed, wherein the logic structure comprises the corresponding relation between a child level and a parent level in each menu item.
2. The method of claim 1, further comprising:
and when the logic structure is changed, the multi-level pull-down menu data to be displayed is adjusted according to the changed logic.
3. The method of claim 1, further comprising:
analyzing the multi-level pull-down menu data to be displayed to obtain menu item field identifiers and menu item names of all the menu items;
rendering each menu item according to the menu item field identification and the menu item name of each menu item to obtain a rendered menu component;
and displaying the rendered menu component through a preset client interface.
4. The method of claim 1, wherein after creating the multi-level drop-down menu, the method further comprises:
judging whether a third party interface is accessed;
and if so, acquiring the pull-down menu data in the target format through the third-party interface.
5. A pull-down menu configuration apparatus, comprising:
the menu creating module is used for creating a multi-level pull-down menu;
the menu setting module is used for setting menu item field identifications and menu item names for all menu items in the multilevel pull-down menu to obtain the pull-down menu after the menu items are set;
an index value setting module, configured to set an index value of each menu item according to the menu item field identifier and the menu item name, so as to obtain a menu item with a set index value, where in each menu item, an index value of a sub-level menu item is greater than an index value of a parent-level menu item except for a final-level menu item, and the final-level menu item is a menu item without a sub-level menu item;
the menu retrieval module is used for retrieving the multilevel pull-down menus according to the index values to obtain list structure data of the multilevel pull-down menus;
the data serialization module is used for serializing the list structure data to obtain multi-level pull-down menu data in a target format;
and the logic setting module is used for setting a logic structure of the pull-down menu data in the target format to obtain multi-level pull-down menu data to be displayed, wherein the logic structure comprises the corresponding relation between a child level and a parent level in each menu item.
6. The apparatus of claim 5, further comprising:
and the logic change module is used for adjusting the multi-level pull-down menu data to be displayed according to the changed logic when the logic structure is changed.
7. The apparatus of claim 5, further comprising:
the menu analysis module is used for analyzing the multi-level pull-down menu data to be displayed to obtain menu item field identifiers and menu item names of all the menu items;
the menu rendering module is used for rendering each menu item according to the menu item field identifier and the menu item name of each menu item to obtain a rendered menu component;
and the menu display module is used for displaying the rendered menu components through a preset client interface.
8. The apparatus of claim 5, further comprising:
the interface judging module is used for judging whether to access a third party interface;
and the interface data acquisition module is used for acquiring the pull-down menu data in the target format through a third party interface if the third party interface is accessed.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 4 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN202011132966.2A 2020-10-21 2020-10-21 Drop-down menu configuration method and device, electronic equipment and storage medium Active CN112162679B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011132966.2A CN112162679B (en) 2020-10-21 2020-10-21 Drop-down menu configuration method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011132966.2A CN112162679B (en) 2020-10-21 2020-10-21 Drop-down menu configuration method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112162679A true CN112162679A (en) 2021-01-01
CN112162679B CN112162679B (en) 2022-04-22

Family

ID=73867758

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011132966.2A Active CN112162679B (en) 2020-10-21 2020-10-21 Drop-down menu configuration method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112162679B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112882630A (en) * 2021-03-19 2021-06-01 腾讯科技(深圳)有限公司 Information configuration method and related product
CN113923131A (en) * 2021-09-10 2022-01-11 北京世纪互联宽带数据中心有限公司 Monitoring information determination method and device, computing equipment and storage medium
CN114138363A (en) * 2021-11-27 2022-03-04 深圳市元征科技股份有限公司 Program data calling method, device, equipment and storage medium
CN114296601A (en) * 2021-12-29 2022-04-08 普强时代(珠海横琴)信息技术有限公司 Navigation bar display content processing method and device based on WEB interface dynamic rendering
CN114513417A (en) * 2022-02-11 2022-05-17 新奥数能科技有限公司 Information configuration method and device of Internet of things equipment
CN114995719A (en) * 2022-06-10 2022-09-02 北京百度网讯科技有限公司 List rendering method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101387935A (en) * 2007-09-12 2009-03-18 大唐移动通信设备有限公司 Method and device for implementing man-machine interface service logic in embedded system
EP3142004A1 (en) * 2015-09-14 2017-03-15 Thomson Licensing Method and apparatus for enabling access to configuration entries
CN109284152A (en) * 2017-07-21 2019-01-29 中兴通讯股份有限公司 A kind of menu visual configuration method, equipment and computer readable storage medium
CN110780793A (en) * 2019-10-31 2020-02-11 北京梆梆安全科技有限公司 Tree menu construction method and device, electronic equipment and storage medium
CN111611036A (en) * 2020-05-06 2020-09-01 香港乐蜜有限公司 Application menu configuration method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101387935A (en) * 2007-09-12 2009-03-18 大唐移动通信设备有限公司 Method and device for implementing man-machine interface service logic in embedded system
EP3142004A1 (en) * 2015-09-14 2017-03-15 Thomson Licensing Method and apparatus for enabling access to configuration entries
CN109284152A (en) * 2017-07-21 2019-01-29 中兴通讯股份有限公司 A kind of menu visual configuration method, equipment and computer readable storage medium
CN110780793A (en) * 2019-10-31 2020-02-11 北京梆梆安全科技有限公司 Tree menu construction method and device, electronic equipment and storage medium
CN111611036A (en) * 2020-05-06 2020-09-01 香港乐蜜有限公司 Application menu configuration method and device, electronic equipment and storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112882630A (en) * 2021-03-19 2021-06-01 腾讯科技(深圳)有限公司 Information configuration method and related product
CN113923131A (en) * 2021-09-10 2022-01-11 北京世纪互联宽带数据中心有限公司 Monitoring information determination method and device, computing equipment and storage medium
CN113923131B (en) * 2021-09-10 2023-08-22 北京世纪互联宽带数据中心有限公司 Monitoring information determining method and device, computing equipment and storage medium
CN114138363A (en) * 2021-11-27 2022-03-04 深圳市元征科技股份有限公司 Program data calling method, device, equipment and storage medium
CN114296601A (en) * 2021-12-29 2022-04-08 普强时代(珠海横琴)信息技术有限公司 Navigation bar display content processing method and device based on WEB interface dynamic rendering
CN114513417A (en) * 2022-02-11 2022-05-17 新奥数能科技有限公司 Information configuration method and device of Internet of things equipment
CN114995719A (en) * 2022-06-10 2022-09-02 北京百度网讯科技有限公司 List rendering method, device, equipment and storage medium
CN114995719B (en) * 2022-06-10 2023-08-01 北京百度网讯科技有限公司 List rendering method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112162679B (en) 2022-04-22

Similar Documents

Publication Publication Date Title
CN112162679B (en) Drop-down menu configuration method and device, electronic equipment and storage medium
CN105528218B (en) Data drawing list Cascading Methods and data drawing list cascade system
CN105528416B (en) A kind of monitoring method and system of network upgrade content
TWI230873B (en) System and method for storing, retrieving, and analyzing characterization data
CN110019263B (en) Information storage method and device
CN107247798B (en) Method and device for constructing search word bank
CN105095369A (en) Website matching method and device
CN109582155B (en) Recommendation method and device for inputting association words, storage medium and electronic equipment
CN108494728B (en) Method, device, equipment and medium for creating blacklist library for preventing traffic hijacking
CN111563199A (en) Data processing method and device
CN111435406A (en) Method and device for correcting database statement spelling errors
CN112667716A (en) Data processing method and device, electronic equipment and storage medium
CN116881156A (en) Automatic test method, device, equipment and storage medium
CN104361094A (en) Storage method and device for file in search result, and browser client
CN116483707A (en) Test method, test device, test apparatus, test program, and test program
CN114995719B (en) List rendering method, device, equipment and storage medium
CN108319606A (en) The construction method and device of specialized database
CN115543428A (en) Simulated data generation method and device based on strategy template
CN114238475A (en) Data processing method of data warehouse
WO2010008397A1 (en) System and method for automated filling of web-based forms
CN108804195B (en) Page display method and device, server and client
CN113031835A (en) Menu data processing method and device
CN112948264A (en) Test task execution method, device, system, storage medium and electronic device
CN111767223A (en) File processing method and device, electronic equipment and storage medium
CN111881356A (en) Content recommendation method and device, electronic equipment and storage medium

Legal Events

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