Detailed Description
In order to make the technical problems solved, technical solutions adopted and technical effects achieved by the embodiments of the present disclosure clearer, the technical solutions of the embodiments of the present disclosure will be described in further detail below with reference to the accompanying drawings, and it is obvious that the described embodiments are only some embodiments, but not all embodiments, of the embodiments of the present disclosure. All other embodiments, which can be obtained by a person skilled in the art without making creative efforts based on the embodiments of the present disclosure, belong to the protection scope of the embodiments of the present disclosure.
It should be noted that the terms "system" and "network" are often used interchangeably in the embodiments of the present disclosure. Reference to "and/or" in embodiments of the present disclosure is meant to include any and all combinations of one or more of the associated listed items. The terms "first", "second", and the like in the description and claims of the present disclosure and in the drawings are used for distinguishing between different objects and not for limiting a particular order.
It should also be noted that, in the embodiments of the present disclosure, each of the following embodiments may be executed alone, or may be executed in combination with each other, and the embodiments of the present disclosure are not limited specifically.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The technical solutions of the embodiments of the present disclosure are further described by the following detailed description in conjunction with the accompanying drawings.
Fig. 1 is a schematic flowchart illustrating a method for generating content of configuration items of a multi-level pull-down menu according to an embodiment of the present disclosure, where the embodiment is applicable to a case where content of configuration items of a multi-level pull-down menu is generated according to a menu data source, and the method can be executed by a device for generating content of configuration items of a multi-level pull-down menu configured in an electronic device, as shown in fig. 1, the method for generating content of configuration items of a multi-level pull-down menu according to the embodiment includes:
in step S110, a menu data source corresponding to the target pull-down menu is acquired.
Wherein the menu data source comprises a title line and a plurality of content lines, the title line comprises at least two title items with a hierarchical relationship, and the content lines comprise at least two content items with a hierarchical relationship.
In step S120, labels of pull-down menus at different levels in the multi-level pull-down menus are generated according to the at least two title items having a hierarchical relationship.
Wherein the number of title items is equal to the number of levels of the multi-level drop-down menu.
For example, the at least two title items having a hierarchical relationship are respectively used as labels of pull-down menus of each level of the multi-level pull-down menu.
In step S130, a logical tree is generated according to at least two content items having a hierarchical relationship included in each of the plurality of content lines, where nodes of the logical tree correspond to the content items, and parent-child relationships between the nodes of the logical tree correspond to the hierarchical relationship between the content items corresponding to the nodes.
For example, the plurality of content lines may be traversed, performing the following for each content item of each content line:
determining the level number of the layers of the content item in the content line and the upper content item;
and judging whether the child node of the node corresponding to the upper-level content item in the logic tree contains the content item, if so, returning and traversing the next content item, and if not, adding a child node corresponding to the content item for the node corresponding to the upper-level content item in the logic tree.
In step S140, configuration contents of pull-down menus of each level of the multi-level pull-down menus are generated according to the logic tree.
For example, the configuration item content of a first level drop-down menu of the multi-level drop-down menu may be configured by a direct child of a root node of the logical tree;
traversing the non-leaf nodes of the logic tree, and performing the following operations on each non-leaf node:
and configuring the configuration item content of the next-level pull-down menu when the current non-leaf node is selected in the multi-level pull-down menu through the direct child node of the current non-leaf node.
According to the method and the device, the menu data source corresponding to the target pull-down menu is obtained, the label of each level of pull-down menu in the multi-level pull-down menu is generated according to the title item of the menu data source, the logic tree is generated according to the content rows of the menu data source, and the configuration content of each level of pull-down menu of the multi-level pull-down menu is generated according to the logic tree, so that each level of menu configuration items of the multi-level menu can be simplified, the page loading speed can be improved, and a user can conveniently search the target.
Fig. 2 is a schematic flow chart illustrating another method for generating contents of configuration items of a multi-level pull-down menu according to an embodiment of the present disclosure, where the present embodiment is based on the foregoing embodiments and is optimized. As shown in fig. 2, the method for generating the content of the configuration item of the multi-level pull-down menu according to this embodiment includes:
in step S210, a menu data source corresponding to the target pull-down menu is obtained.
Wherein the menu data source comprises a title line and a plurality of content lines, the title line comprises at least two title items with a hierarchical relationship, the content lines comprise at least two content items with a hierarchical relationship, and the content items further comprise weights of the content items.
For example, the title behavior "province, city, district", the L-th content behavior "Hunan province, Changsha city, Hibiscus district".
Wherein each content item in the content line is subordinate to the title item at the corresponding position in the title line, for example, the first content item "hunnan province" of the L-th content line is subordinate to the first title item "province" of the title line, the second content item "changsha" is subordinate to the second title item "city" of the title line, and the third content item "hibiscus area" is subordinate to the third title item "area" of the title line.
In step S220, the number of title items of the title line is acquired.
For example, the number of title items of the title line "province, city, district" is 3.
In step S230, the plurality of content lines are traversed, and the correctness verification is performed on each content line.
The method comprises the following steps of respectively carrying out the following operations on each content line for correctness verification:
and judging whether the number of content items included in the current content line is equal to the number of the title items, if so, determining that the current content line passes the correctness verification, and if not, determining that the current content line does not pass the correctness verification.
In step S240, labels of pull-down menus at different levels in the multi-level pull-down menus are generated according to the at least two title items having a hierarchical relationship.
Wherein the number of title items is equal to the number of levels of the multi-level drop-down menu.
For example, the at least two title items having a hierarchical relationship may be respectively used as labels of pull-down menus of respective levels of the multi-level pull-down menu. For example, the title behavior "province, city, and district", the corresponding multi-level pull-down menu is a three-level pull-down menu, and the labels of the three-level pull-down menu may be sequentially set to "province", "city", and "district".
In step S250, a logical tree is generated according to at least two content items having a hierarchical relationship included in each of the plurality of content lines, wherein nodes of the logical tree correspond to the content items, and parent-child relationships between the nodes of the logical tree correspond to the hierarchical relationship between the content items corresponding to the nodes.
For example, the plurality of content lines may be traversed, performing the following for each content item of each content line:
determining the level number of the layers of the content item in the content line and the upper content item;
and judging whether the child node of the node corresponding to the upper-level content item in the logic tree contains the content item, if so, returning and traversing the next content item, and if not, adding a child node corresponding to the content item for the node corresponding to the upper-level content item in the logic tree.
Taking the title behavior "province, city, district", the L-th content behavior "Hunan province, Changsha city, hibiscus area", as an example, before traversing the L-th content line, if the logic tree is as shown in FIG. 3, on this basis, the L-th line is traversed, and the following operations are performed on "Hunan province", "Changsha city", and "hibiscus area" in the L-th line, respectively:
the following operations are performed for the first content item "Hunan province":
in the L-th content line, the level number of the layer is 1, and the upper content item is empty;
and if the child node (including 'Hunan province' … 'Hubei province') of the corresponding node (root node of the logical tree) of the upper-level content item (which is empty) in the logical tree includes the content item 'Hunan province', returning to judge the second content item.
The following is performed for the second content item "Changsha":
the level number of the layer in the L-th content row of the Changsha city is 2, and the upper content item is Hunan province;
and if the child nodes (including ' Changsha ' … ' Ji Shou) of the corresponding nodes (Hunan province) of the upper-level content item (Hunan province) in the logic tree include the content item ' Changsha ', the logic tree returns to judge the third content item.
The following is performed for the third content item "hibiscus area":
the level number of the layer in the L-th content row of the cottonrose hibiscus area is 3, and the upper content item is Changsha;
and if the child nodes (including the Yuenu area, the Yuhua area and the Tianxin area …, the Kaifu area) of the node (Changsha) corresponding to the upper-level content item (Changsha) in the logic tree include the content item 'cotton rose', and if the child nodes (cotton rose) corresponding to the content item are not included, adding one child node (cotton rose) corresponding to the content item to the node (Changsha) corresponding to the upper-level content item (Changsha) in the logic tree.
After the L-th content line is executed, the logical tree becomes as shown in FIG. 4.
In step S260, the configuration contents of each level of the pull-down menus of the multi-level pull-down menus are generated according to the logic tree, and the sequence of the configuration items of each level of the pull-down menus of the multi-level pull-down menus is determined according to the weight of the content item corresponding to each node in the logic tree.
For example, the configuration item content of a first level drop-down menu of the multi-level drop-down menu may be configured by a direct child of a root node of the logical tree;
traversing the non-leaf nodes of the logic tree, and performing the following operations on each non-leaf node:
and configuring the configuration item content of the next-level pull-down menu when the current non-leaf node is selected in the multi-level pull-down menu through the direct child node of the current non-leaf node.
And then, determining the sequence of configuration items of each level of pull-down menus of the multi-level pull-down menus according to the weight of the content item corresponding to each node in the logic tree.
Furthermore, after the configuration contents of each level of pull-down menus of the multi-level pull-down menus are generated according to the logic tree, the first menu item of each level of pull-down menus of the multi-level pull-down menus can be respectively used as a default initial menu item, so that the operation times of the user can be further reduced, and the operation efficiency of the user for selecting the menu items of the pull-down menus can be improved.
On the basis of the previous embodiment, the embodiment discloses a case that a content item further includes a weight of the content item, and a step of performing correctness verification on each content line respectively, wherein the step of increasing the correctness verification can improve the robustness of the content generation method of the configuration item of the multi-level pull-down menu, the disclosed content item includes a scheme of the weight of the content item, the sequence of the configuration item of each level of the pull-down menu of the multi-level pull-down menu is determined according to the weight, a user can further conveniently search a target menu item, and the speed of the user searching the target menu can be improved.
As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a content generating apparatus for a configuration item of a multi-level pull-down menu, and fig. 5 illustrates a schematic structural diagram of the content generating apparatus for a configuration item of a multi-level pull-down menu provided in this embodiment, where the embodiment of the apparatus corresponds to the method embodiments shown in fig. 1 to fig. 4, and the apparatus may be specifically applied to various electronic devices. As shown in fig. 5, the apparatus for generating configuration item contents of a multi-level pull-down menu according to the present embodiment includes: a menu data source obtaining unit 510, a label generating unit 520, a logical tree generating unit 530, and a configuration content generating unit 540.
The menu data source obtaining unit 510 is configured to obtain a menu data source corresponding to a target pull-down menu.
Wherein the menu data source comprises a title line and a plurality of content lines, the title line comprises at least two title items with a hierarchical relationship, and the content lines comprise at least two content items with a hierarchical relationship.
The label generating unit 520 is configured to generate labels of pull-down menus of respective levels in the multi-level pull-down menus according to the at least two title items having a hierarchical relationship.
Wherein the number of title items is equal to the number of levels of the multi-level drop-down menu.
The logical tree generating unit 530 is configured to generate a logical tree according to at least two content items having a hierarchical relationship included in each of the plurality of content lines.
Wherein the nodes of the logical tree correspond to the content items, and parent-child relationships between the nodes of the logical tree correspond to hierarchical relationships between the content items corresponding to the nodes.
The configuration content generating unit 540 is configured to generate configuration contents of pull-down menus of each level of the multi-level pull-down menus according to the logic tree.
Further, the logical tree generating unit 530 is configured to:
traversing the plurality of content lines, performing the following operations for each content item of each content line:
determining the level number of the layers of the content item in the content line and the upper content item;
and judging whether the child node of the node corresponding to the upper-level content item in the logic tree contains the content item, if so, returning and traversing the next content item, and if not, adding a child node corresponding to the content item for the node corresponding to the upper-level content item in the logic tree.
Further, the label generating unit 520 is configured to use the at least two title items with a hierarchical relationship as labels of pull-down menus of each level of the multi-level pull-down menu, respectively.
Further, the configuration content generating unit 540 is configured to:
configuring configuration item contents of a first level pull-down menu of the multi-level pull-down menu through a direct child node of a root node of the logic tree;
traversing the non-leaf nodes of the logic tree, and performing the following operations on each non-leaf node:
and configuring the configuration item content of the next-level pull-down menu when the current non-leaf node is selected in the multi-level pull-down menu through the direct child node of the current non-leaf node.
Further, the content item further comprises a weight of the content item;
the configuration content generating unit 540 is configured to determine the order of configuration items of each level of the pull-down menus according to the weight of the content item corresponding to each node in the logic tree.
Further, the apparatus further includes a default setting unit (not shown in fig. 5), and the default setting unit is configured to, after generating configuration contents of pull-down menus of each level of the multi-level pull-down menus according to the logic tree, respectively take a first menu item of the pull-down menu of each level of the multi-level pull-down menus as a default initial menu item.
The device for generating the content of the configuration item of the multi-level pull-down menu, provided by the embodiment of the present disclosure, can execute the method for generating the content of the configuration item of the multi-level pull-down menu, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 6 is a schematic structural diagram of another multi-level pull-down menu configuration item content generating apparatus according to an embodiment of the present disclosure, and as shown in fig. 6, the multi-level pull-down menu configuration item content generating apparatus according to this embodiment includes: a menu data source obtaining unit 610, a data source verifying unit 620, a label generating unit 630, a logical tree generating unit 640, and a configuration content generating unit 650.
The menu data source obtaining unit 610 is configured to obtain a menu data source corresponding to a target pull-down menu.
Wherein the menu data source comprises a title line and a plurality of content lines, the title line comprises at least two title items with a hierarchical relationship, the content lines comprise at least two content items with a hierarchical relationship, and the content items further comprise weights of the content items.
The data source verification unit 620 is configured to:
acquiring the number of the title items of the title line;
traversing the content lines, and respectively executing the following operations on each content line for correctness verification:
and judging whether the number of content items included in the current content line is equal to the number of the title items, if so, determining that the current content line passes the correctness verification, and if not, determining that the current content line does not pass the correctness verification.
The label generating unit 630 is configured to generate labels of pull-down menus of respective levels in the multi-level pull-down menus according to the at least two title items having a hierarchical relationship.
Wherein the number of title items is equal to the number of levels of the multi-level drop-down menu.
The logical tree generating unit 640 is configured to generate a logical tree according to at least two content items having a hierarchical relationship included in each of the plurality of content lines, where nodes of the logical tree correspond to the content items, and parent-child relationships between the nodes of the logical tree correspond to the hierarchical relationship between the content items corresponding to the nodes.
The configuration content generating unit 650 is configured to generate configuration contents of pull-down menus of each level of the multi-level pull-down menus according to the logic tree, and determine an order of the configuration items of the pull-down menus of each level of the multi-level pull-down menus according to weights of content items corresponding to each node in the logic tree.
Further, the logical tree generation unit 640 is configured to:
traversing the plurality of content lines, performing the following operations for each content item of each content line:
determining the level number of the layers of the content item in the content line and the upper content item;
and judging whether the child node of the node corresponding to the upper-level content item in the logic tree contains the content item, if so, returning and traversing the next content item, and if not, adding a child node corresponding to the content item for the node corresponding to the upper-level content item in the logic tree.
Further, the label generating unit 630 is configured to use the at least two title items with a hierarchical relationship as labels of pull-down menus of each level of the multi-level pull-down menu, respectively.
Further, the configuration content generating unit 650 is configured to:
configuring configuration item contents of a first level pull-down menu of the multi-level pull-down menu through a direct child node of a root node of the logic tree;
traversing the non-leaf nodes of the logic tree, and performing the following operations on each non-leaf node:
and configuring the configuration item content of the next-level pull-down menu when the current non-leaf node is selected in the multi-level pull-down menu through the direct child node of the current non-leaf node.
The device for generating the content of the configuration item of the multi-level pull-down menu, provided by the embodiment of the present disclosure, can execute the method for generating the content of the configuration item of the multi-level pull-down menu, and has the corresponding functional modules and beneficial effects of the execution method.
Referring now to FIG. 7, shown is a schematic diagram of an electronic device 700 suitable for use in implementing embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication means 709, or may be installed from the storage means 708, or may be installed from the ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium described above in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the disclosed embodiments, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the disclosed embodiments, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
acquiring a menu data source corresponding to a target pull-down menu, wherein the menu data source comprises a title line and a plurality of content lines, the title line comprises at least two title items with a hierarchical relationship, and the content lines comprise at least two content items with a hierarchical relationship;
generating labels of pull-down menus of all levels in the multi-level pull-down menus according to the at least two title items with the hierarchical relationship, wherein the number of the title items is equal to the number of levels of the multi-level pull-down menus;
generating a logic tree according to at least two content items with hierarchical relationship included in each content line in the plurality of content lines, wherein nodes of the logic tree correspond to the content items, and parent-child relationship among the nodes of the logic tree corresponds to the hierarchical relationship among the content items corresponding to the nodes;
and generating the configuration content of each level of pull-down menus of the multi-level pull-down menus according to the logic tree.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
According to one or more embodiments of the present disclosure, in the method for generating contents of a configuration item of a multi-level pull-down menu, generating a logical tree according to at least two content items having a hierarchical relationship included in each of the plurality of content lines includes:
traversing the plurality of content lines, performing the following operations for each content item of each content line:
determining the level number of the layers of the content item in the content line and the upper content item;
and judging whether the child node of the node corresponding to the upper-level content item in the logic tree contains the content item, if so, returning and traversing the next content item, and if not, adding a child node corresponding to the content item for the node corresponding to the upper-level content item in the logic tree.
According to one or more embodiments of the present disclosure, in the method for generating content of a configuration item of a multi-level pull-down menu, generating a label of each level of pull-down menus in the multi-level pull-down menus according to the at least two title items having a hierarchical relationship includes:
and respectively taking the at least two title items with the hierarchical relationship as labels of pull-down menus of all levels of the multi-level pull-down menus.
According to one or more embodiments of the present disclosure, in the method for generating configuration item contents of a multilevel pull-down menu, generating configuration contents of pull-down menus of each level of the multilevel pull-down menu according to the logic tree includes:
configuring configuration item contents of a first level pull-down menu of the multi-level pull-down menu through a direct child node of a root node of the logic tree;
traversing the non-leaf nodes of the logic tree, and performing the following operations on each non-leaf node:
and configuring the configuration item content of the next-level pull-down menu when the current non-leaf node is selected in the multi-level pull-down menu through the direct child node of the current non-leaf node.
According to one or more embodiments of the present disclosure, in the multi-level pull-down menu configuration item content generation method, the content item further includes a weight of the content item;
generating configuration contents of each level of pull-down menus of the multi-level pull-down menus according to the logic tree further comprises: and determining the sequence of the configuration items of each level of pull-down menus of the multi-level pull-down menus according to the weight of the content item corresponding to each node in the logic tree.
According to one or more embodiments of the present disclosure, the method for generating configuration item contents of a multi-level pull-down menu further includes, after generating configuration contents of pull-down menus of respective levels of the multi-level pull-down menu according to the logic tree: and respectively taking the first menu items of all levels of pull-down menus of the multi-level pull-down menus as default initial menu items.
According to one or more embodiments of the present disclosure, in the method for generating configuration item content of a multi-level pull-down menu, after acquiring a menu data source corresponding to a target pull-down menu, the method further includes:
acquiring the number of the title items of the title line;
traversing the content lines, and respectively executing the following operations on each content line for correctness verification:
and judging whether the number of content items included in the current content line is equal to the number of the title items, if so, determining that the current content line passes the correctness verification, and if not, determining that the current content line does not pass the correctness verification.
According to one or more embodiments of the present disclosure, in the multi-level pull-down menu configuration item content generating apparatus, the logic tree generating unit is configured to:
traversing the plurality of content lines, performing the following operations for each content item of each content line:
determining the level number of the layers of the content item in the content line and the upper content item;
and judging whether the child node of the node corresponding to the upper-level content item in the logic tree contains the content item, if so, returning and traversing the next content item, and if not, adding a child node corresponding to the content item for the node corresponding to the upper-level content item in the logic tree.
According to one or more embodiments of the present disclosure, in the multi-level pull-down menu configuration item content generating apparatus, the tag generating unit is configured to: and respectively taking the at least two title items with the hierarchical relationship as labels of pull-down menus of all levels of the multi-level pull-down menus.
According to one or more embodiments of the present disclosure, in the multi-level pull-down menu configuration item content generating apparatus, the configuration content generating unit is configured to:
configuring configuration item contents of a first level pull-down menu of the multi-level pull-down menu through a direct child node of a root node of the logic tree;
traversing the non-leaf nodes of the logic tree, and performing the following operations on each non-leaf node:
and configuring the configuration item content of the next-level pull-down menu when the current non-leaf node is selected in the multi-level pull-down menu through the direct child node of the current non-leaf node.
According to one or more embodiments of the present disclosure, in the multi-level pull-down menu configuration item content generating apparatus, the content item further includes a weight of the content item;
the configuration content generating unit is further configured to: and determining the sequence of the configuration items of each level of pull-down menus of the multi-level pull-down menus according to the weight of the content item corresponding to each node in the logic tree.
According to one or more embodiments of the present disclosure, the device for generating configuration item contents of a multi-level pull-down menu further includes a default setting unit, configured to respectively take the first menu item of each level of pull-down menus of the multi-level pull-down menus as a default initial menu item after generating the configuration contents of each level of pull-down menus of the multi-level pull-down menus according to the logic tree.
According to one or more embodiments of the present disclosure, the apparatus for generating content of configuration items of a multi-level pull-down menu further includes a data source verification unit, configured to, after acquiring a menu data source corresponding to a target pull-down menu:
acquiring the number of the title items of the title line;
traversing the content lines, and respectively executing the following operations on each content line for correctness verification:
and judging whether the number of content items included in the current content line is equal to the number of the title items, if so, determining that the current content line passes the correctness verification, and if not, determining that the current content line does not pass the correctness verification.
The foregoing description is only a preferred embodiment of the disclosed embodiments and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure in the embodiments of the present disclosure is not limited to the particular combination of the above-described features, but also encompasses other embodiments in which any combination of the above-described features or their equivalents is possible without departing from the scope of the present disclosure. For example, the above features and (but not limited to) the features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.