WO2020253059A1 - Method and apparatus for implementing multi-stage linkage drop-down box, and computer device - Google Patents

Method and apparatus for implementing multi-stage linkage drop-down box, and computer device Download PDF

Info

Publication number
WO2020253059A1
WO2020253059A1 PCT/CN2019/118176 CN2019118176W WO2020253059A1 WO 2020253059 A1 WO2020253059 A1 WO 2020253059A1 CN 2019118176 W CN2019118176 W CN 2019118176W WO 2020253059 A1 WO2020253059 A1 WO 2020253059A1
Authority
WO
WIPO (PCT)
Prior art keywords
drop
down box
option data
data set
current
Prior art date
Application number
PCT/CN2019/118176
Other languages
French (fr)
Chinese (zh)
Inventor
陈旭敏
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020253059A1 publication Critical patent/WO2020253059A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Definitions

  • This application relates to a method, device, computer equipment, and storage medium for implementing a multi-level linkage drop-down box.
  • a method, device, computer device, and storage medium for implementing a multi-level linkage drop-down box are provided.
  • a method for implementing multi-level linkage drop-down boxes includes:
  • each drop-down box element configure the instance of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes;
  • Each visual drop-down box corresponds to different levels according to the position relationship between two adjacent visual drop-down boxes;
  • the option data set of the lower-level drop-down box is obtained according to the target option data, and the drop-down list of the lower-level drop-down box is generated according to the obtained option data set.
  • a device for implementing multi-level linkage drop-down boxes includes:
  • the page data acquisition module is used to acquire page data, where the page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element;
  • the drop-down box component obtaining module is used to obtain the drop-down box component corresponding to the drop-down box element, and respectively generate instances of each drop-down box element;
  • the rendering module is used to configure the instance of each drop-down box element according to the attribute information of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes Box; the plurality of visual drop-down boxes correspond to different levels according to the position relationship between each two adjacent visual drop-down boxes;
  • the first drop-down list generating module is configured to obtain the option data set corresponding to the current drop-down box, and generate the drop-down list of the current drop-down box according to the obtained option data set;
  • the event monitoring module is used to monitor the drop-down box change event in the current drop-down box when there is a lower-level drop-down box corresponding to the current drop-down box, and change the event from the current drop-down box according to the monitored drop-down box change event To determine the target option data in the drop-down list;
  • the second drop-down list generating module is configured to obtain the option data set of the next-level drop-down box according to the target option data, and generate the drop-down list of the next-level drop-down box according to the obtained option data set.
  • a computer device including a memory and one or more processors, the memory stores computer readable instructions, when the computer readable instructions are executed by the processor, the one or more processors execute The following steps:
  • each drop-down box element configure the instance of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes;
  • Each visual drop-down box corresponds to different levels according to the position relationship between two adjacent visual drop-down boxes;
  • the option data set of the lower-level drop-down box is obtained according to the target option data, and the drop-down list of the lower-level drop-down box is generated according to the obtained option data set.
  • One or more non-volatile computer-readable storage media storing computer-readable instructions.
  • the one or more processors execute the following steps:
  • each drop-down box element configure the instance of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes;
  • Each visual drop-down box corresponds to different levels according to the position relationship between two adjacent visual drop-down boxes;
  • the option data set of the lower-level drop-down box is obtained according to the target option data, and the drop-down list of the lower-level drop-down box is generated according to the obtained option data set.
  • Fig. 1 is an application scenario diagram of a method for implementing a multi-level linkage drop-down box in one or more embodiments.
  • Fig. 2 is a schematic flowchart of a method for implementing a multi-level linkage drop-down box according to one or more embodiments.
  • Fig. 3 is a schematic flowchart of a method for implementing a multi-level linkage drop-down box in another embodiment.
  • Fig. 4 is a block diagram of a device for implementing a multi-level linkage drop-down box according to one or more embodiments.
  • Figure 5 is a block diagram of a computer device according to one or more embodiments.
  • the implementation method of the multi-level linkage drop-down box provided in this application can be applied to the application environment as shown in FIG. 1.
  • the terminal 102 communicates with the server 104 through the network.
  • the terminal first obtains page data containing multiple drop-down box elements and attribute information from the server, and then obtains the drop-down box component corresponding to the drop-down box element, generates an instance of each drop-down box element, and corresponds to the drop-down box element according to the attribute information of each drop-down box element
  • the instance of each drop-down box element is rendered to obtain multiple visual drop-down boxes.
  • the terminal can obtain the option data set corresponding to the current drop-down box.
  • the selected option data collection generates the drop-down list of the current drop-down box, monitors the drop-down box change event in the current drop-down box, and determines the target option data from the drop-down list of the current drop-down box according to the monitored drop-down box change event, and obtains it according to the target option data
  • the option data collection of the lower-level drop-down box generates the drop-down list of the lower-level drop-down box according to the obtained option data collection.
  • the terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, and tablet computers.
  • the server 104 may be implemented by an independent server or a server cluster composed of multiple servers.
  • a method for implementing a multi-level linkage drop-down box is provided. Taking the method applied to the terminal in FIG. 2 as an example for description, the method includes the following steps:
  • Step S202 Obtain page data.
  • the page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element.
  • the attribute information corresponding to the drop-down box element includes the attribute value set by the front-end developer for the corresponding attribute of the drop-down box element when developing the front-end page, the style attribute and position attribute of the drop-down box element, and the style attributes such as length, width, and height.
  • the drop-down box component is a component encapsulated according to the select2.Js plug-in.
  • the select2 function is defined in the component, and four attributes of select-key, select-value, select options, and ng-model are set.
  • Select-options is a drop-down list Option data attributes
  • select-options uses the data object returned by the server as the data source
  • select-value is the selected value attribute
  • select-key is the key corresponding to the selected value
  • ng-model is the two-way data binding attribute. Therefore, this embodiment
  • developers need to set the corresponding attribute values of the four attributes of select-key, select-value, select-options, and ng-model to the drop-down box elements to ensure that the resulting drop-down box can be used normally
  • the attribute value configured here is a variable.
  • the drop-down box component can call the watch monitoring function to monitor the user's selection event in real time, and update the attribute value according to the user's selection event.
  • a drop-down box element used to implement bank selection its corresponding attribute information can be set as:
  • select-key bankcode
  • select-value bankname
  • the bankcode and bankname are respectively consistent with the corresponding field names of the drop-down list option data in the database.
  • the terminal can obtain page data from the server.
  • Step 204 Obtain the drop-down box components corresponding to the drop-down box elements, and generate instances of each drop-down box element respectively.
  • the terminal can obtain the drop-down box component from the local component library, or obtain the drop-down box component from the server and register it. After obtaining the drop-down box component corresponding to the drop-down box element, instantiate the drop-down box component to obtain each The corresponding instance of the drop-down box element.
  • the terminal acquiring the drop-down box component of the drop-down box element includes the following steps: query the current component registry to determine whether there is a registration record corresponding to the drop-down box element; if it exists, it will be stored locally according to the storage path in the registration record. Get the component corresponding to the drop-down box element in the component library; if it does not exist, send a component get request to the service, receive the drop-down box component returned by the server, and register the drop-down box component returned by the server.
  • Step 206 Configure an instance of each drop-down box element according to the attribute information of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes.
  • the terminal configures instances of each drop-down box element according to the attribute information of each drop-down box element, including configuring drop-down list option data attributes, selected value attributes, key attributes corresponding to the selected values, and two-way data binding attributes.
  • the style of the drop-down box configures the position of the drop-down box.
  • the terminal renders the instance corresponding to each drop-down box element to obtain multiple visual drop-down boxes.
  • each two adjacent visual drop-down boxes correspond to different levels according to the position relationship, and the position relationship includes upper and lower adjacent and left and right adjacent.
  • the positional relationship is left and right adjacent, then the drop-down box on the left is the upper drop-down box corresponding to the adjacent drop-down box on the right, and the drop-down box on the right corresponds to the adjacent left drop-down box.
  • the next drop-down box is adjacent to each other up and down, and the drop-down box on the upper side is the upper drop-down box corresponding to the adjacent drop-down box on the lower side, and the drop-down box on the lower side corresponds to the adjacent upper drop-down box. The next drop-down box.
  • the terminal can connect the option data returned by the server through the drop-down list option data attribute of the drop-down box, and call the monitoring function to monitor the user's selection event, and update the selected value attribute in real time according to the user's selection event, the key attribute corresponding to the selected value, two-way The variable value corresponding to each data binding property.
  • Step S208 Obtain the option data set corresponding to the current drop-down box, and generate a drop-down list of the current drop-down box according to the obtained option data set.
  • Step S210 when there is a lower-level drop-down box corresponding to the current drop-down box, monitor the drop-down box change event in the current drop-down box, and determine the target option data from the drop-down list of the current drop-down box according to the monitored drop-down box change event.
  • Step S212 Obtain the option data set of the lower-level drop-down box according to the target option data, and generate the drop-down list of the lower-level drop-down box according to the obtained option data set.
  • the current drop-down box refers to the drop-down box currently operated by the user.
  • the lower-level drop-down box corresponding to the current drop-down box refers to the drop-down box adjacent to the current drop-down box and located to the right or below the current drop-down box.
  • the option data of the lower-level drop-down box needs to be determined according to the drop-down box change event (onchange event) of the current drop-down box.
  • the drop-down box change event (onchange event) in the drop-down box is triggered, and the onchange event is used to indicate that the content of the drop-down box has changed.
  • the terminal can monitor the onchange event of the current drop-down box.
  • the option data set of the next-level drop-down box After successfully listening to the ochange event in the current drop-down box, it can obtain the option data set of the next-level drop-down box according to the option data corresponding to the monitored drop-down box change event.
  • the option data collection of the lower-level drop-down box generates a drop-down list corresponding to the lower-level drop-down box.
  • the option data set of the current drop-down box may be determined by the identifier of the current drop-down box. Obtain the option data set from the server or the local database according to the identifier of the current drop-down box.
  • the option data set of the current drop-down box is acquired by the onchage event of the corresponding upper-level drop-down box.
  • this application will not repeat it here. It can also be understood that when the current drop-down box is the last-level drop-down box, there is no next-level drop-down box corresponding to the current drop-down box.
  • the page data including multiple drop-down box elements and the attribute information corresponding to each drop-down box element is obtained, and then the drop-down box component corresponding to the drop-down box element is obtained to generate the respective drop-down box elements.
  • the terminal can obtain the option data set corresponding to the current drop-down box, generate the drop-down list of the current drop-down box according to the obtained option data set, monitor the drop-down box change event in the current drop-down box, and change the event from the current drop-down box according to the monitored drop-down box
  • the target option data is determined in the drop-down list, and the option data set of the next-level drop-down box is obtained according to the target option data, and the drop-down list of the next-level drop-down box is generated according to the obtained option data set.
  • This application only needs to encapsulate one drop-down box Component, by calling the drop-down box component to generate the corresponding instance, it can realize multi-level linkage drop-down box in different scenes, which improves the code reuse rate, reduces code redundancy, and improves computer performance.
  • obtaining the option data set of the next-level drop-down box according to the target option data, and generating the drop-down list of the next-level drop-down box according to the obtained option data set includes: sending the target option data to the server, and receiving the server The returned next-level option data queried based on the target option data obtains the option data set corresponding to the next-level drop-down box, and generates the drop-down list of the next-level drop-down box according to the obtained option data set.
  • the terminal monitors the drop-down box change event of the current drop-down box, it determines the target option data from the drop-down list of the current drop-down box according to the monitored drop-down box change event, sends the target option data to the server, and the server
  • the target option data is determined as the primary key query condition to query in the database to obtain the corresponding data record.
  • determine the next-level option data corresponding to the target option data and send it to the terminal.
  • the terminal will receive the The option data is determined as the option data set corresponding to the drop-down box at the next level.
  • the selection data set of the current drop-down box may be occupational data, such as professional technicians, service personnel, operators of production and transportation equipment, persons in charge of enterprises and institutions, etc.
  • the terminal obtains the occupational data from the server, it generates The drop-down list corresponding to the current drop-down box.
  • the drop-down box change event in the current drop-down box will be triggered.
  • the terminal listens to the drop-down box change event, it will change the drop-down box change event.
  • the corresponding occupation is determined as the target occupation, and the loan use data corresponding to the target occupation is obtained from the server side, and the drop-down list corresponding to the lower-level drop-down box is generated based on the loan use data.
  • the method includes: obtaining a total set of option data corresponding to all drop-down boxes, and saving the obtained total set of option data to a local database; Get the option data set corresponding to the current drop-down box, and generate the drop-down list of the current drop-down box based on the obtained option data set, including: obtaining the option data set of the current drop-down box from the local database, and generating the current drop-down based on the obtained option data set
  • the drop-down list of the box according to the target option data to obtain the option data collection of the lower-level drop-down box, and generate the drop-down list of the next-level drop-down box according to the obtained option data collection, including: query the corresponding data from the local database according to the target option data
  • the option data of the next level obtains the option data set corresponding to the drop-down box of the next level, and the drop-down list of the next level drop-down box is generated according to the obtained
  • the total set of option data refers to the set of option data corresponding to all drop-down boxes.
  • the terminal can obtain the total set of option data from the server, and save the total set of obtained option data in the local database.
  • the option data of different drop-down boxes can be saved separately In different data tables, set the option data in the data table corresponding to the drop-down box with the lower-level drop-down box as the foreign key of the data table.
  • the terminal needs to obtain the option data set of the lower-level drop-down box, it will monitor the drop-down box change event of the current drop-down box.
  • the target option data is determined in the option data set of the box, and then the next-level option data corresponding to the target option data is queried from the local database, and the option data set of the next-level drop-down box is obtained according to the queried option data.
  • the terminal when implementing the three-level linkage drop-down box of provinces, cities and counties, after the terminal gets the drop-down boxes corresponding to the displayed provinces, cities and counties, it obtains all the option data corresponding to the three drop-down boxes of province, city, and county from the server. , And save the option data corresponding to provinces, cities, and counties in different data tables in the local database.
  • each province field is used as the foreign key of the data table, and it is also the city
  • the terminal needs to obtain option data from the city-level drop-down box, if the target option data corresponding to the change event in the drop-down box of the province-level drop-down box is monitored as "Hunan province", then the data corresponding to the city-level drop-down box from the local database In the table, the data records with "Hunan province” as the primary key are queried, and the selection data set corresponding to the city-level drop-down box is obtained according to the queried data records.
  • the option data of each drop-down box is uniformly saved locally, which can improve the acquisition speed of the option data set corresponding to the drop-down box, thereby realizing the multi-level linkage drop-down box more quickly.
  • the method further includes: obtaining query keywords through the current drop-down box, and filtering from the drop-down list corresponding to the current drop-down box according to the query keywords , The drop-down list is visually displayed according to the screening results; when a selection operation on the drop-down list of the visual display is received, the drop-down box change event in the current drop-down box is triggered.
  • the user can enter a query keyword in the current drop-down box, and the terminal filters the option data containing the query keyword from the drop-down list according to the query keyword, and visually displays the option data to obtain a visually displayed drop-down
  • the drop-down list displayed at this time only contains the above option data filtered by keywords.
  • the terminal may obtain the option data set of the lower-level drop-down box according to the option data corresponding to the drop-down box change event, and then generate the drop-down list of the lower-level drop-down box according to the obtained option data set.
  • the drop-down list of the city-level drop-down box can be obtained through the city-level drop-down list.
  • Get the query keyword in the box, for example, "Yang” then the terminal will screen according to the query keyword "Yang” in the drop-down list to get “Shaoyang City”, “Hengyang City”, “Yueyang City”, “Yiyang” City” and so on, and display a drop-down list based on these data.
  • the displayed drop-down list includes four options of "Shaoyang City", “Hengyang City”, “Yueyang City”, and "Yiyang City”.
  • the terminal will receive the selection operation and trigger the drop-down box change event in the city-level drop-down box.
  • the terminal can obtain the option data set corresponding to the county-level drop-down box .
  • the user can enter a query keyword in the drop-down box to make a query, which improves the convenience for the user to query data in the drop-down list corresponding to the drop-down box.
  • the method further includes: when a preset click event corresponding to the current drop-down box is monitored, obtaining the option data set corresponding to the current drop-down box The historical selection times of each option data in a preset time period; generate a reference list based on the option data whose historical selection times are greater than a preset threshold; visually display the drop-down list and the reference list.
  • the preset time period can be set according to needs, such as one week, one month, etc.
  • the preset threshold can be set by the developer based on experience.
  • the preset click event is a click event that can trigger the open event in the drop-down box, such as clicking on the drop-down box Drop-down button.
  • the terminal when the opening event corresponding to the current drop-down box is monitored, the terminal can obtain the historical selection times of each option data in the option data set corresponding to the current drop-down box within a preset time period, and according to the historical selection times greater than the preset
  • the threshold option data generates a reference list, and visually displays the drop-down list corresponding to the current drop-down box and the reference list.
  • obtaining the historical selection times of each option data in the preset time period in the option data set corresponding to the current drop-down box can be achieved by setting a buried point on the current page.
  • the threshold option data when the preset click event corresponding to the current drop-down box is monitored, the historical selection times of each option data in the option data set corresponding to the current drop-down box within the preset time period are obtained, and the number of historical selections is greater than the preset time.
  • the threshold option data generates a reference list, and displaying the drop-down list and the reference list at the same time can improve the user's selection efficiency.
  • a method for implementing multi-level linkage drop-down boxes including the following steps:
  • Step S302 Obtain page data.
  • the page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element;
  • Step S304 Obtain the drop-down box components corresponding to the drop-down box elements, and respectively generate instances of each drop-down box element;
  • Step S306 according to the attribute information of each drop-down box element, configure the instance of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes;
  • Step S308 Obtain a total set of option data corresponding to all drop-down boxes, and save the obtained total set of option data in a local database;
  • Step S310 obtaining the option data set of the current drop-down box from the local database, and generating the drop-down list of the current drop-down box according to the obtained option data set;
  • Step S312 Obtain the query keyword through the current drop-down box, filter from the drop-down list corresponding to the current drop-down box according to the query keyword, and visually display the drop-down list according to the filtering result;
  • Step S314 when a selection operation on the drop-down list of the visual display is received, trigger a drop-down box change event in the current drop-down box;
  • Step S316 when there is a lower-level drop-down box corresponding to the current drop-down box, monitor the drop-down box change event in the current drop-down box, and determine the target option data from the drop-down list of the current drop-down box according to the monitored drop-down box change event;
  • Step S318 Query the corresponding next-level option data from the local database according to the target option data to obtain the option data set corresponding to the next-level drop-down box, and generate the drop-down list of the next-level drop-down box based on the obtained option data set.
  • step S302 to step S308 please refer to the description in the above embodiment, which will not be repeated in this application.
  • a device 400 for implementing a multi-level linkage drop-down box including:
  • the page data acquisition module 402 is used to acquire page data, and the page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element;
  • the drop-down box component obtaining module 404 is used to obtain the drop-down box components corresponding to the drop-down box elements, and respectively generate instances of each drop-down box element;
  • the rendering module 408 is used to configure the instance of each drop-down box element according to the attribute information of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes; multiple visualizations Each two adjacent visual drop-down boxes in the drop-down box correspond to different levels according to the position relationship;
  • the first drop-down list generating module 410 is configured to obtain the option data set corresponding to the current drop-down box, and generate the drop-down list of the current drop-down box according to the obtained option data set;
  • the event monitoring module 412 is used to monitor the drop-down box change event in the current drop-down box when there is a lower-level drop-down box corresponding to the current drop-down box, and determine from the drop-down list of the current drop-down box according to the monitored drop-down box change event Target option data;
  • the second drop-down list generating module 414 is configured to obtain the option data set of the next-level drop-down box according to the target option data, and generate the drop-down list of the next-level drop-down box according to the obtained option data set.
  • the second drop-down list generation module 412 is configured to send the target option data to the server; receive the next-level option data queried according to the target option data returned by the server to obtain the option data corresponding to the next-level drop-down box Set; generate the drop-down list of the next-level drop-down box according to the obtained option data set.
  • the above device further includes: an option data saving module, configured to obtain a total set of option data corresponding to all drop-down boxes, and save the obtained total set of option data in a local database; and a first drop-down list generating module 408 is also used to obtain the option data set of the current drop-down box from the local database, and to generate the drop-down list of the current drop-down box according to the obtained option data set; the second drop-down list generation module 412 is also used to obtain data from the local database according to the target option data Query the corresponding lower-level option data to obtain the option data set corresponding to the lower-level drop-down box, and generate the drop-down list of the lower-level drop-down box according to the obtained option data set.
  • an option data saving module configured to obtain a total set of option data corresponding to all drop-down boxes, and save the obtained total set of option data in a local database
  • a first drop-down list generating module 408 is also used to obtain the option data set of the current drop-down box from the local
  • the above-mentioned apparatus further includes: a third drop-down list generating module, configured to obtain query keywords from the current drop-down box, filter from the drop-down list corresponding to the current drop-down box according to the query keywords, and select the drop-down list according to the screening results.
  • the list is displayed visually; when a selection operation on the drop-down list of the visual display is received, the drop-down box change event in the current drop-down box is triggered.
  • the above-mentioned apparatus further includes: a reference list generation module, which is used to obtain the preset time period of each option data in the option data set corresponding to the current drop-down box when the preset click event corresponding to the current drop-down box is monitored.
  • the number of historical selections within; the reference list is generated based on the option data with the number of historical selections greater than the preset threshold; the drop-down list and the reference list are visually displayed.
  • Each module in the device for realizing the above-mentioned multi-level linkage drop-down box can be implemented in whole or in part by software, hardware, and a combination thereof.
  • the foregoing modules may be embedded in the form of hardware or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the foregoing modules.
  • a computer device is provided.
  • the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 5.
  • the computer equipment includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus.
  • the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and computer readable instructions.
  • the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen
  • the input device of the computer equipment can be a touch layer covered on the display screen, or it can be a button, a trackball or a touchpad set on the housing of the computer equipment , It can also be an external keyboard, touchpad, or mouse.
  • FIG. 5 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
  • the specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
  • a computer device includes a memory and one or more processors.
  • the memory stores computer-readable instructions.
  • the one or more processors can realize the implementation provided in any one of the embodiments of the present application. Steps of the implementation method of the multi-level linkage drop-down box.
  • One or more non-volatile computer-readable storage media storing computer-readable instructions.
  • the one or more processors implement any one of the embodiments of the present application. Provides the steps of the implementation method of the multi-level linkage drop-down box.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • ROM read only memory
  • PROM programmable ROM
  • EPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A method for implementing a multi-stage linkage drop-down box. The method comprises: acquiring page data, wherein the page data comprises a plurality of drop-down box elements and attribute information corresponding to each drop-down box element; acquiring a drop-down box component corresponding to a drop-down box element, and respectively generating an instance of each drop-down box element; configuring the instance of each drop-down box element according to the attribute information of each drop-down box element, and rendering the instance of each drop-down box element after the configuration is completed so as to obtain a plurality of visual drop-down boxes; acquiring an option data set corresponding to the current drop-down box and generating a drop-down list; detecting a drop-down box change event in the current drop-down box, and determining target option data according to the detected drop-down box change event; and acquiring an option data set of a next-level drop-down box according to the target option data, and generating a drop-down list of the next-level drop-down box according to the acquired option data set.

Description

多级联动下拉框的实现方法、装置和计算机设备Method, device and computer equipment for implementing multi-level linkage drop-down box
相关申请的交叉引用Cross references to related applications
本申请要求于2019年06月18日提交中国专利局,申请号为2019105253184,申请名称为“多级联动下拉框的实现方法、装置和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on June 18, 2019, the application number is 2019105253184, and the application name is "Methods, devices and computer equipment for implementing multi-level linkage drop-down boxes", all of which are approved The reference is incorporated in this application.
技术领域Technical field
本申请涉及一种多级联动下拉框的实现方法、装置、计算机设备和存储介质。This application relates to a method, device, computer equipment, and storage medium for implementing a multi-level linkage drop-down box.
背景技术Background technique
随着互联网的发展,企业的营销活动由线下向线上转移,借助互联网和社交圈实现贷款产品营销、客户服务、获取客户等目标。With the development of the Internet, corporate marketing activities have shifted from offline to online, and the Internet and social circles are used to achieve the goals of loan product marketing, customer service, and customer acquisition.
客户通过线上的营销活动页面参加活动时,经常需要填写一些个人信息,为方便客户填写,提高客户体验,通常都尽可能使客户填写的文字降至最少,通常采用在页面中加载级联插件,以实现多级联动的下拉选择框,用户只需要从下拉框中进行选择即可。传统技术中,级联插件大多是致力于解决某一问题而实现,在不同的场景下需要使用不同的插件,然而发明人意识到,这种方式会导致代码变得非常冗余,影响计算机的性能。When customers participate in activities through online marketing activities pages, they often need to fill in some personal information. In order to facilitate customers to fill in and improve customer experience, they usually try to minimize the text filled in by customers, and usually load cascading plug-ins in the page. , In order to realize the multi-level linkage drop-down selection box, the user only needs to select from the drop-down box. In traditional technology, cascading plug-ins are mostly implemented to solve a certain problem, and different plug-ins need to be used in different scenarios. However, the inventor realized that this method will cause the code to become very redundant and affect the computer's performance. performance.
发明内容Summary of the invention
根据本申请公开的各种实施例,提供一种多级联动下拉框的实现方法、装置、计算机设备和存储介质。According to various embodiments disclosed in the present application, a method, device, computer device, and storage medium for implementing a multi-level linkage drop-down box are provided.
一种多级联动下拉框的实现方法包括:A method for implementing multi-level linkage drop-down boxes includes:
获取页面数据,所述页面数据中包括多个下拉框元素及各个下拉框元素对应的属性信息;Acquiring page data, where the page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element;
获取所述下拉框元素对应的下拉框组件,分别生成各个下拉框元素的实例;Obtain the drop-down box component corresponding to the drop-down box element, and respectively generate instances of each drop-down box element;
根据所述各个下拉框元素的属性信息,对所述各个下拉框元素的实例进行配置,当配置完成后,对所述各个下拉框元素的实例进行渲染,得到多个可视化下拉框;所述多个可视化下拉框中每两个相邻的可视化下拉框之间按照位置关系对应不同的级别;According to the attribute information of each drop-down box element, configure the instance of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes; Each visual drop-down box corresponds to different levels according to the position relationship between two adjacent visual drop-down boxes;
获取当前下拉框对应的选项数据集合,根据获取到的所述选项数据集合生成当前下拉框的下拉列表;Acquiring an option data set corresponding to the current drop-down box, and generating a drop-down list of the current drop-down box according to the acquired option data set;
当存在与所述当前下拉框对应的下一级下拉框时,监听当前下拉框中的下拉框改变事件,根据监听到的所述下拉框改变事件从所述当前下拉框的下拉列表中确定目标选项数据;及When there is a lower-level drop-down box corresponding to the current drop-down box, monitor the drop-down box change event in the current drop-down box, and determine the target from the drop-down list of the current drop-down box according to the monitored drop-down box change event Option data; and
根据所述目标选项数据获取下一级下拉框的选项数据集合,根据获取到的所述选项数据集合生成下一级下拉框的下拉列表。The option data set of the lower-level drop-down box is obtained according to the target option data, and the drop-down list of the lower-level drop-down box is generated according to the obtained option data set.
一种多级联动下拉框的实现装置包括:A device for implementing multi-level linkage drop-down boxes includes:
页面数据获取模块,用于获取页面数据,所述页面数据中包括多个下拉框元素及各个下拉框元素对应的属性信息;The page data acquisition module is used to acquire page data, where the page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element;
下拉框组件获取模块,用于获取所述下拉框元素对应的下拉框组件,分别生成各个下拉框元素的实例;The drop-down box component obtaining module is used to obtain the drop-down box component corresponding to the drop-down box element, and respectively generate instances of each drop-down box element;
渲染模块,用于根据所述各个下拉框元素的属性信息,对所述各个下拉框元素的实例进行配置,当配置完成后,对所述各个下拉框元素的实例进行渲染,得到多个可视化下拉框;所述多个可视化下拉框中每两个相邻的可视化下拉框之间按照位置关系对应不同的级别;The rendering module is used to configure the instance of each drop-down box element according to the attribute information of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes Box; the plurality of visual drop-down boxes correspond to different levels according to the position relationship between each two adjacent visual drop-down boxes;
第一下拉列表生成模块,用于获取当前下拉框对应的选项数据集合,根据获取到的所述选项数据集合生成当前下拉框的下拉列表;The first drop-down list generating module is configured to obtain the option data set corresponding to the current drop-down box, and generate the drop-down list of the current drop-down box according to the obtained option data set;
事件监听模块,用于当存在与所述当前下拉框对应的下一级下拉框时,监听当前下拉框中的下拉框改变事件,根据监听到的所述下拉框改变事件从所述当前下拉框的下拉列表中确定目标选项数据;及The event monitoring module is used to monitor the drop-down box change event in the current drop-down box when there is a lower-level drop-down box corresponding to the current drop-down box, and change the event from the current drop-down box according to the monitored drop-down box change event To determine the target option data in the drop-down list; and
第二下拉列表生成模块,用于根据所述目标选项数据获取下一级下拉框的选项数据集合,根据获取到的所述选项数据集合生成下一级下拉框的下拉列表。The second drop-down list generating module is configured to obtain the option data set of the next-level drop-down box according to the target option data, and generate the drop-down list of the next-level drop-down box according to the obtained option data set.
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:A computer device, including a memory and one or more processors, the memory stores computer readable instructions, when the computer readable instructions are executed by the processor, the one or more processors execute The following steps:
获取页面数据,所述页面数据中包括多个下拉框元素及各个下拉框元素对应的属性信息;Acquiring page data, where the page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element;
获取所述下拉框元素对应的下拉框组件,分别生成各个下拉框元素的实例;Obtain the drop-down box component corresponding to the drop-down box element, and respectively generate instances of each drop-down box element;
根据所述各个下拉框元素的属性信息,对所述各个下拉框元素的实例进行配置,当配置完成后,对所述各个下拉框元素的实例进行渲染,得到多个可视化下拉框;所述多个可视化下拉框中每两个相邻的可视化下拉框之间按照位置关系对应不同的级别;According to the attribute information of each drop-down box element, configure the instance of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes; Each visual drop-down box corresponds to different levels according to the position relationship between two adjacent visual drop-down boxes;
获取当前下拉框对应的选项数据集合,根据获取到的所述选项数据集合生成当前下拉框的下拉列表;Acquiring an option data set corresponding to the current drop-down box, and generating a drop-down list of the current drop-down box according to the acquired option data set;
当存在与所述当前下拉框对应的下一级下拉框时,监听当前下拉框中的下拉框改变事件,根据监听到的所述下拉框改变事件从所述当前下拉框的下拉列表中确定目标选项数据;及When there is a lower-level drop-down box corresponding to the current drop-down box, monitor the drop-down box change event in the current drop-down box, and determine the target from the drop-down list of the current drop-down box according to the monitored drop-down box change event Option data; and
根据所述目标选项数据获取下一级下拉框的选项数据集合,根据获取到的所述选项数 据集合生成下一级下拉框的下拉列表。The option data set of the lower-level drop-down box is obtained according to the target option data, and the drop-down list of the lower-level drop-down box is generated according to the obtained option data set.
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:One or more non-volatile computer-readable storage media storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the following steps:
获取页面数据,所述页面数据中包括多个下拉框元素及各个下拉框元素对应的属性信息;Acquiring page data, where the page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element;
获取所述下拉框元素对应的下拉框组件,分别生成各个下拉框元素的实例;Obtain the drop-down box component corresponding to the drop-down box element, and respectively generate instances of each drop-down box element;
根据所述各个下拉框元素的属性信息,对所述各个下拉框元素的实例进行配置,当配置完成后,对所述各个下拉框元素的实例进行渲染,得到多个可视化下拉框;所述多个可视化下拉框中每两个相邻的可视化下拉框之间按照位置关系对应不同的级别;According to the attribute information of each drop-down box element, configure the instance of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes; Each visual drop-down box corresponds to different levels according to the position relationship between two adjacent visual drop-down boxes;
获取当前下拉框对应的选项数据集合,根据获取到的所述选项数据集合生成当前下拉框的下拉列表;Acquiring an option data set corresponding to the current drop-down box, and generating a drop-down list of the current drop-down box according to the acquired option data set;
当存在与所述当前下拉框对应的下一级下拉框时,监听当前下拉框中的下拉框改变事件,根据监听到的所述下拉框改变事件从所述当前下拉框的下拉列表中确定目标选项数据;及When there is a lower-level drop-down box corresponding to the current drop-down box, monitor the drop-down box change event in the current drop-down box, and determine the target from the drop-down list of the current drop-down box according to the monitored drop-down box change event Option data; and
根据所述目标选项数据获取下一级下拉框的选项数据集合,根据获取到的所述选项数据集合生成下一级下拉框的下拉列表。The option data set of the lower-level drop-down box is obtained according to the target option data, and the drop-down list of the lower-level drop-down box is generated according to the obtained option data set.
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。The details of one or more embodiments of the application are set forth in the following drawings and description. Other features and advantages of this application will become apparent from the description, drawings and claims.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
图1为根据一个或多个实施例中多级联动下拉框的实现方法的应用场景图。Fig. 1 is an application scenario diagram of a method for implementing a multi-level linkage drop-down box in one or more embodiments.
图2为根据一个或多个实施例中多级联动下拉框的实现方法的流程示意图。Fig. 2 is a schematic flowchart of a method for implementing a multi-level linkage drop-down box according to one or more embodiments.
图3为另一个实施例中多级联动下拉框的实现方法的流程示意图。Fig. 3 is a schematic flowchart of a method for implementing a multi-level linkage drop-down box in another embodiment.
图4为根据一个或多个实施例中多级联动下拉框的实现装置的框图。Fig. 4 is a block diagram of a device for implementing a multi-level linkage drop-down box according to one or more embodiments.
图5为根据一个或多个实施例中计算机设备的框图。Figure 5 is a block diagram of a computer device according to one or more embodiments.
具体实施方式Detailed ways
为了使本申请的技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the technical solutions and advantages of the present application clearer, the following further describes the present application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the application, and not used to limit the application.
本申请提供的多级联动下拉框的实现方法,可以应用于如图1所示的应用环境中。终端102通过网络与服务器104进行通信。终端首先从服务器获取包含多个下拉框元素及属性信息的页面数据,然后获取下拉框元素对应的下拉框组件,生成各个下拉框元素的实例,根据各个下拉框元素的属性信息对下拉框元素对应的实例进行配置,当配置完成后,对各个下拉框元素的实例进行渲染,得到多个可视化下拉框,在得到多个可视化下拉框后,终端可以获取当前下拉框对应的选项数据集合,根据获取到的选项数据集合生成当前下拉框的下拉列表,监听当前下拉框中的下拉框改变事件,根据监听到的下拉框改变事件从当前下拉框的下拉列表中确定目标选项数据,根据目标选项数据获取下一级下拉框的选项数据集合,根据获取到的选项数据集合生成下一级下拉框的下拉列表。The implementation method of the multi-level linkage drop-down box provided in this application can be applied to the application environment as shown in FIG. 1. The terminal 102 communicates with the server 104 through the network. The terminal first obtains page data containing multiple drop-down box elements and attribute information from the server, and then obtains the drop-down box component corresponding to the drop-down box element, generates an instance of each drop-down box element, and corresponds to the drop-down box element according to the attribute information of each drop-down box element After the configuration is completed, the instance of each drop-down box element is rendered to obtain multiple visual drop-down boxes. After multiple visual drop-down boxes are obtained, the terminal can obtain the option data set corresponding to the current drop-down box. The selected option data collection generates the drop-down list of the current drop-down box, monitors the drop-down box change event in the current drop-down box, and determines the target option data from the drop-down list of the current drop-down box according to the monitored drop-down box change event, and obtains it according to the target option data The option data collection of the lower-level drop-down box generates the drop-down list of the lower-level drop-down box according to the obtained option data collection.
终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, and tablet computers. The server 104 may be implemented by an independent server or a server cluster composed of multiple servers.
在一些实施例中,如图2所示,提供了一种多级联动下拉框的实现方法,以该方法应用于图2中的终端为例进行说明,包括以下步骤:In some embodiments, as shown in FIG. 2, a method for implementing a multi-level linkage drop-down box is provided. Taking the method applied to the terminal in FIG. 2 as an example for description, the method includes the following steps:
步骤S202,获取页面数据,页面数据中包括多个下拉框元素及各个下拉框元素对应的属性信息。Step S202: Obtain page data. The page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element.
下拉框元素对应的属性信息包括前端开发人员在进行前端页面开发时针对下拉框元素对应的属性设置的属性值、下拉框元素的样式属性及位置属性,样式属性比如长、宽、高等样式。下拉框组件为根据select2.Js插件进行封装得到的组件,该组件中定义了select2函数,并设置了select-key、select-value、select options、ng-model四种属性,select-options为下拉列表选项数据属性,select-options使用服务器返回的数据对象作为数据源,select-value为选择值属性,select-key为选择值对应的键,ng-model为双向数据绑定属性,因此,本实施例中,开发人员在进行前端页面时,需要对下拉框元素分别设置select-key、select-value、select-options、ng-model这四种属性对应的属性值,为了保证得到的下拉框能正常使用,在进行属性值设置时,需保证每各个属性对应的属性值与数据库中相应的字段名保持一致。可以理解,这里配置的属性值为变量,在实现了下拉框后,下拉框组件可以调用watch监听函数实时监听用户的选择事件,根据用户的选择事件对属性值进行更新。The attribute information corresponding to the drop-down box element includes the attribute value set by the front-end developer for the corresponding attribute of the drop-down box element when developing the front-end page, the style attribute and position attribute of the drop-down box element, and the style attributes such as length, width, and height. The drop-down box component is a component encapsulated according to the select2.Js plug-in. The select2 function is defined in the component, and four attributes of select-key, select-value, select options, and ng-model are set. Select-options is a drop-down list Option data attributes, select-options uses the data object returned by the server as the data source, select-value is the selected value attribute, select-key is the key corresponding to the selected value, and ng-model is the two-way data binding attribute. Therefore, this embodiment In the front-end page, developers need to set the corresponding attribute values of the four attributes of select-key, select-value, select-options, and ng-model to the drop-down box elements to ensure that the resulting drop-down box can be used normally When setting the attribute value, ensure that the attribute value corresponding to each attribute is consistent with the corresponding field name in the database. It is understandable that the attribute value configured here is a variable. After the drop-down box is implemented, the drop-down box component can call the watch monitoring function to monitor the user's selection event in real time, and update the attribute value according to the user's selection event.
举个例子,某个用于实现银行选择的下拉框元素,其对应的属性信息可以设置为:For example, for a drop-down box element used to implement bank selection, its corresponding attribute information can be set as:
select-key=bankcode,select-value=bankname,select-key=bankcode, select-value=bankname,
Select-options=“getPrevBankList”,ng-model=“disBankNo”;Select-options="getPrevBankList", ng-model="disBankNo";
bankcode和bankname分别与该下拉列表的选项数据在数据库中对应的字段名一致。The bankcode and bankname are respectively consistent with the corresponding field names of the drop-down list option data in the database.
具体地,终端可以从服务器获取页面数据。Specifically, the terminal can obtain page data from the server.
步骤204,获取下拉框元素对应的下拉框组件,分别生成各个下拉框元素的实例。Step 204: Obtain the drop-down box components corresponding to the drop-down box elements, and generate instances of each drop-down box element respectively.
具体地,终端可以从本地组件库中获取下拉框组件,也可以从服务器获取下拉框组件并进行注册,在获取到下拉框元素对应的下拉框组件后,将下拉框组件实例化,分别得到各个下拉框元素对应的实例。Specifically, the terminal can obtain the drop-down box component from the local component library, or obtain the drop-down box component from the server and register it. After obtaining the drop-down box component corresponding to the drop-down box element, instantiate the drop-down box component to obtain each The corresponding instance of the drop-down box element.
在一些实施例中,终端获取下拉框元素的下拉框组件,包括以下步骤:查询当前组件注册表,判断是否存在下拉框元素对应的注册记录;若存在,则根据注册记录中的存储路径从本地组件库中获取下拉框元素对应的组件;若不存在,则向服务发送组件获取请求,并接收服务器返回的下拉框组件,对服务器返回的下拉框组件进行注册。In some embodiments, the terminal acquiring the drop-down box component of the drop-down box element includes the following steps: query the current component registry to determine whether there is a registration record corresponding to the drop-down box element; if it exists, it will be stored locally according to the storage path in the registration record. Get the component corresponding to the drop-down box element in the component library; if it does not exist, send a component get request to the service, receive the drop-down box component returned by the server, and register the drop-down box component returned by the server.
步骤206,根据各个下拉框元素的属性信息,对各个下拉框元素的实例进行配置,当配置完成后,对各个下拉框元素的实例进行渲染,得到多个可视化下拉框。Step 206: Configure an instance of each drop-down box element according to the attribute information of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes.
具体地,终端根据各个下拉框元素的属性信息,分别对各个下拉框元素的实例进行配置,包括配置下拉列表选项数据属性、选择值属性、选择值对应的键属性及双向数据绑定属性,配置下拉框的样式,配置下拉框的位置,配置完后,终端对各个下拉框元素对应的实例进行渲染,从而得到多个可视化下拉框。Specifically, the terminal configures instances of each drop-down box element according to the attribute information of each drop-down box element, including configuring drop-down list option data attributes, selected value attributes, key attributes corresponding to the selected values, and two-way data binding attributes. The style of the drop-down box configures the position of the drop-down box. After configuration, the terminal renders the instance corresponding to each drop-down box element to obtain multiple visual drop-down boxes.
多个可视化下拉框中每两个相邻的可视化下拉框之间按照位置关系对应不同的级别,位置关系包括上下相邻及左右相邻。在一些实施例中,位置关系为左右相邻,则左边的下拉框为其相邻的右边的下拉框对应的上一级下拉框,右边的下拉框为其相邻的左边的下拉框对应的下一级下拉框。在另一些实施例中,位置关系为上下相邻,则上边的下拉框为其相邻的下边的下拉框对应的上一级下拉框,下边的下拉框为其相邻的上边的下拉框对应的下一级下拉框。In the multiple visual drop-down boxes, each two adjacent visual drop-down boxes correspond to different levels according to the position relationship, and the position relationship includes upper and lower adjacent and left and right adjacent. In some embodiments, the positional relationship is left and right adjacent, then the drop-down box on the left is the upper drop-down box corresponding to the adjacent drop-down box on the right, and the drop-down box on the right corresponds to the adjacent left drop-down box. The next drop-down box. In other embodiments, the positional relationship is adjacent to each other up and down, and the drop-down box on the upper side is the upper drop-down box corresponding to the adjacent drop-down box on the lower side, and the drop-down box on the lower side corresponds to the adjacent upper drop-down box. The next drop-down box.
此时,终端可通过下拉框的下拉列表选项数据属性对接服务器返回的选项数据,并调用监听函数监听用户的选择事件,根据用户的选择事件实时更新选择值属性、选择值对应的键属性、双向数据绑定属性各自对应的变量值。At this time, the terminal can connect the option data returned by the server through the drop-down list option data attribute of the drop-down box, and call the monitoring function to monitor the user's selection event, and update the selected value attribute in real time according to the user's selection event, the key attribute corresponding to the selected value, two-way The variable value corresponding to each data binding property.
步骤S208,获取当前下拉框对应的选项数据集合,根据获取到的选项数据集合生成当前下拉框的下拉列表。Step S208: Obtain the option data set corresponding to the current drop-down box, and generate a drop-down list of the current drop-down box according to the obtained option data set.
步骤S210,当存在与当前下拉框对应的下一级下拉框时,监听当前下拉框中的下拉框改变事件,根据监听到的下拉框改变事件从当前下拉框的下拉列表中确定目标选项数据。Step S210, when there is a lower-level drop-down box corresponding to the current drop-down box, monitor the drop-down box change event in the current drop-down box, and determine the target option data from the drop-down list of the current drop-down box according to the monitored drop-down box change event.
步骤S212,根据目标选项数据获取下一级下拉框的选项数据集合,根据获取到的选项数据集合生成下一级下拉框的下拉列表。Step S212: Obtain the option data set of the lower-level drop-down box according to the target option data, and generate the drop-down list of the lower-level drop-down box according to the obtained option data set.
当前下拉框指的是用户当前操作的下拉框。与当前下拉框对应的下一级下拉框指的是与当前下拉框相邻且位置在当前下拉框的右边或者下边的下拉框。The current drop-down box refers to the drop-down box currently operated by the user. The lower-level drop-down box corresponding to the current drop-down box refers to the drop-down box adjacent to the current drop-down box and located to the right or below the current drop-down box.
在一些实施例中,当存在与所述当前下拉框对应的下一级下拉框时,下一级下拉框的选项数据需要根据当前下拉框的下拉框改变事件(onchange事件)确定。当用户点击当前下拉框的下拉列表中任意一个选项数据时,即触发该下拉框中的下拉框改变事件(onchange事件),onchange事件用于表征下拉框的内容发生了改变。终端可对当前下拉框的onchange事件进行监听,在成功监听到当前下拉框中的ochange事件后,可根据监听到的下拉框改变事件对应的选项数据获取下一级下拉框的选项数据集合,根据下一级下拉框的选项数据集合生成下一级下拉框对应的下拉列表。In some embodiments, when there is a lower-level drop-down box corresponding to the current drop-down box, the option data of the lower-level drop-down box needs to be determined according to the drop-down box change event (onchange event) of the current drop-down box. When the user clicks any option data in the drop-down list of the current drop-down box, the drop-down box change event (onchange event) in the drop-down box is triggered, and the onchange event is used to indicate that the content of the drop-down box has changed. The terminal can monitor the onchange event of the current drop-down box. After successfully listening to the ochange event in the current drop-down box, it can obtain the option data set of the next-level drop-down box according to the option data corresponding to the monitored drop-down box change event. The option data collection of the lower-level drop-down box generates a drop-down list corresponding to the lower-level drop-down box.
在一些实施例中,当当前下拉框为第一级下拉框时,当前下拉框的选项数据集合可以由当前下拉框的标识确定。根据当前下拉框的标识从服务器或者本地数据库获取选项数据集合。In some embodiments, when the current drop-down box is the first-level drop-down box, the option data set of the current drop-down box may be determined by the identifier of the current drop-down box. Obtain the option data set from the server or the local database according to the identifier of the current drop-down box.
可以理解的是,当当前下拉框不是第一级下拉框时,当前下拉框的选项数据集合由其对应的上一级下拉框的onchage事件来获取,具体的获取方式可参见上述实施例中的描述,本申请在此不赘述。还可以理解的是,当前下拉框为最后一级下拉框时,不存在与当前下拉框对应的下一级下拉框。It is understandable that when the current drop-down box is not the first-level drop-down box, the option data set of the current drop-down box is acquired by the onchage event of the corresponding upper-level drop-down box. For the specific acquisition method, please refer to the above embodiment Description, this application will not repeat it here. It can also be understood that when the current drop-down box is the last-level drop-down box, there is no next-level drop-down box corresponding to the current drop-down box.
上述多级联动下拉框的实现方法中,通过获取包括多个下拉框元素及各个下拉框元素对应的属性信息的页面数据,然后获取下拉框元素对应的下拉框组件,分别生成各个下拉框元素的实例,根据各个下拉框元素的属性信息,对各个下拉框元素的实例进行配置,当配置完成后,渲染各个下拉框元素的实例,得到多个可视化下拉框,在得到多个可视化下拉框后,终端可以获取当前下拉框对应的选项数据集合,根据获取到的选项数据集合生成当前下拉框的下拉列表,监听当前下拉框中的下拉框改变事件,根据监听到的下拉框改变事件从当前下拉框的下拉列表中确定目标选项数据,根据目标选项数据获取下一级下拉框的选项数据集合,根据获取到的选项数据集合生成下一级下拉框的下拉列表,本申请中只需要封装一个下拉框组件,通过调用下拉框组件生成对应的实例,可在各个不同的场景实现多级联动下拉框,提高了代码的复用率,减少了代码的冗余,从而提高了计算机性能。In the implementation method of the above-mentioned multi-level linkage drop-down box, the page data including multiple drop-down box elements and the attribute information corresponding to each drop-down box element is obtained, and then the drop-down box component corresponding to the drop-down box element is obtained to generate the respective drop-down box elements. Example, according to the attribute information of each drop-down box element, configure the instance of each drop-down box element. When the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes. After obtaining multiple visual drop-down boxes, The terminal can obtain the option data set corresponding to the current drop-down box, generate the drop-down list of the current drop-down box according to the obtained option data set, monitor the drop-down box change event in the current drop-down box, and change the event from the current drop-down box according to the monitored drop-down box The target option data is determined in the drop-down list, and the option data set of the next-level drop-down box is obtained according to the target option data, and the drop-down list of the next-level drop-down box is generated according to the obtained option data set. This application only needs to encapsulate one drop-down box Component, by calling the drop-down box component to generate the corresponding instance, it can realize multi-level linkage drop-down box in different scenes, which improves the code reuse rate, reduces code redundancy, and improves computer performance.
在一些实施例中,根据目标选项数据获取下一级下拉框的选项数据集合,根据获取到的选项数据集合生成下一级下拉框的下拉列表,包括:将目标选项数据发送至服务器,接收服务器返回的根据目标选项数据查询到的下一级选项数据,得到下一级下拉框对应的选项数据集合,根据所得到的选项数据集合生成下一级下拉框的下拉列表。In some embodiments, obtaining the option data set of the next-level drop-down box according to the target option data, and generating the drop-down list of the next-level drop-down box according to the obtained option data set includes: sending the target option data to the server, and receiving the server The returned next-level option data queried based on the target option data obtains the option data set corresponding to the next-level drop-down box, and generates the drop-down list of the next-level drop-down box according to the obtained option data set.
具体地,当终端监听到当前下拉框的下拉框改变事件时,根据监听到的下拉框改变事件从当前下拉框的下拉列表中确定目标选项数据,将该目标选项数据发送至服务器,服务器将该目标选项数据确定为主键查询条件在数据库中进行查询,以获取对应的数据记录,根据获取到的数据记录确定该目标选项数据对应的下一级选项数据,并发送至终端,终端将接收到的选项数据确定为下一级下拉框对应的选项数据集合。Specifically, when the terminal monitors the drop-down box change event of the current drop-down box, it determines the target option data from the drop-down list of the current drop-down box according to the monitored drop-down box change event, sends the target option data to the server, and the server The target option data is determined as the primary key query condition to query in the database to obtain the corresponding data record. According to the obtained data record, determine the next-level option data corresponding to the target option data, and send it to the terminal. The terminal will receive the The option data is determined as the option data set corresponding to the drop-down box at the next level.
在一些实施例中,当前下拉框的选项数据集合可以为职业数据,例如专业技术人员、服务人员、生产运输设备操作人员、企事业单位负责人等等,终端从服务器获取到职业数据后,生成当前下拉框对应的下拉列表,当用户在当前下拉框的下拉列表中进行职业选择时,会触发当前下拉框中的下拉框改变事件,终端监听到该下拉框改变事件后,将下拉框改变事件对应的职业确定为目标职业,并从服务器端获取该目标职业对应的贷款用途数据,根据这些贷款用途数据生成下一级下拉框对应的下拉列表。In some embodiments, the selection data set of the current drop-down box may be occupational data, such as professional technicians, service personnel, operators of production and transportation equipment, persons in charge of enterprises and institutions, etc. After the terminal obtains the occupational data from the server, it generates The drop-down list corresponding to the current drop-down box. When the user selects a career in the drop-down list of the current drop-down box, the drop-down box change event in the current drop-down box will be triggered. After the terminal listens to the drop-down box change event, it will change the drop-down box change event. The corresponding occupation is determined as the target occupation, and the loan use data corresponding to the target occupation is obtained from the server side, and the drop-down list corresponding to the lower-level drop-down box is generated based on the loan use data.
在一些实施例中,在对各个下拉框元素的实例进行渲染,得到多个可视化下拉框之后,包括:获取所有下拉框对应的选项数据总集合,将获取选项数据总集合保存至本地数据库中;获取当前下拉框对应的选项数据集合,根据获取到的选项数据集合生成当前下拉框的 下拉列表,包括:从本地数据库中获取当前下拉框的选项数据集合,根据获取到的选项数据集合生成当前下拉框的下拉列表;根据目标选项数据获取下一级下拉框的选项数据集合,根据获取到的选项数据集合生成下一级下拉框的下拉列表,包括:根据目标选项数据从本地数据库中查询对应的下一级选项数据,得到下一级下拉框对应的选项数据集合,根据所得到的选项数据集合生成下一级下拉框的下拉列表。In some embodiments, after the instances of each drop-down box element are rendered to obtain multiple visual drop-down boxes, the method includes: obtaining a total set of option data corresponding to all drop-down boxes, and saving the obtained total set of option data to a local database; Get the option data set corresponding to the current drop-down box, and generate the drop-down list of the current drop-down box based on the obtained option data set, including: obtaining the option data set of the current drop-down box from the local database, and generating the current drop-down based on the obtained option data set The drop-down list of the box; according to the target option data to obtain the option data collection of the lower-level drop-down box, and generate the drop-down list of the next-level drop-down box according to the obtained option data collection, including: query the corresponding data from the local database according to the target option data The option data of the next level obtains the option data set corresponding to the drop-down box of the next level, and the drop-down list of the next level drop-down box is generated according to the obtained option data set.
具体地,选项数据总集合指的是所有下拉框对应的选项数据所组成的集合。终端在得到显示的多个下拉框后,可以从服务器获取选项数据总集合,将获取的选项数据总集合保持至本地数据库中,在进行保存时,可分别将不同的下拉框的选项数据分别保存在不同的数据表中,并将具有下一级下拉框的下拉框所对应的数据表中的选项数据设置为该数据表的外键。当终端需要获取下一级下拉框的选项数据集合时,对当前下拉框的下拉框改变事件进行监听,若成功监听到当前下拉框的下拉框改变事件,则根据该下拉框改变事件从当前下拉框的选项数据集合中确定目标选项数据,然后从本地数据库中查询该目标选项数据对应的下一级选项数据,根据查询到的选项数据得到下一级下拉框的选项数据集合。Specifically, the total set of option data refers to the set of option data corresponding to all drop-down boxes. After getting the multiple drop-down boxes displayed, the terminal can obtain the total set of option data from the server, and save the total set of obtained option data in the local database. When saving, the option data of different drop-down boxes can be saved separately In different data tables, set the option data in the data table corresponding to the drop-down box with the lower-level drop-down box as the foreign key of the data table. When the terminal needs to obtain the option data set of the lower-level drop-down box, it will monitor the drop-down box change event of the current drop-down box. If it successfully monitors the drop-down box change event of the current drop-down box, it will change the event from the current drop-down box according to the drop-down box. The target option data is determined in the option data set of the box, and then the next-level option data corresponding to the target option data is queried from the local database, and the option data set of the next-level drop-down box is obtained according to the queried option data.
举个例子,在实现省市县三级联动的下拉框时,终端得到显示的省市县分别对应的下拉框后,从服务器器获取省、市、县三个下拉框对应的所有的选项数据,并将省、市、县对应的选项数据分别保存至本地数据库中不同的数据表中,且在省级下拉框对应的数据表中,各个省份字段作为该数据表的外键,同时也是市级下拉框对应的数据表的主键,而在市级下拉框对应的数据表中,各个市区字段作为该数据表的外键,同时也是县级下拉框对应的数据表的主键。当终端需要对市级下拉框进行选项数据获取时,若监听到省级下拉框中下拉框改变事件对应的目标选项数据为“湖南省”,则从本地数据库中与市级下拉框对应的数据表中查询以“湖南省”作为主键的数据记录,根据查询到的数据记录得到市级下拉框对应的选项数据集合。For example, when implementing the three-level linkage drop-down box of provinces, cities and counties, after the terminal gets the drop-down boxes corresponding to the displayed provinces, cities and counties, it obtains all the option data corresponding to the three drop-down boxes of province, city, and county from the server. , And save the option data corresponding to provinces, cities, and counties in different data tables in the local database. In the data table corresponding to the drop-down box at the provincial level, each province field is used as the foreign key of the data table, and it is also the city The primary key of the data table corresponding to the drop-down box at the city level, and in the data table corresponding to the drop-down box at the city level, each city field serves as the foreign key of the data table, and is also the primary key of the data table corresponding to the drop-down box at the county level. When the terminal needs to obtain option data from the city-level drop-down box, if the target option data corresponding to the change event in the drop-down box of the province-level drop-down box is monitored as "Hunan Province", then the data corresponding to the city-level drop-down box from the local database In the table, the data records with "Hunan Province" as the primary key are queried, and the selection data set corresponding to the city-level drop-down box is obtained according to the queried data records.
本实施例中,将各个下拉框的选项数据统一保存至本地,可提高下拉框对应的选项数据集合的获取速度,从而更加快速的实现多级联动的下拉框。In this embodiment, the option data of each drop-down box is uniformly saved locally, which can improve the acquisition speed of the option data set corresponding to the drop-down box, thereby realizing the multi-level linkage drop-down box more quickly.
在一些实施例中,在根据获取到的选项数据集合生成当前下拉框的下拉列表之后,还包括:通过当前下拉框获取查询关键字,根据查询关键字从当前下拉框对应的下拉列表中进行筛选,根据筛选结果对下拉列表进行可视化展示;当接收到作用于可视化展示的下拉列表的选择操作时,触发当前下拉框中的下拉框改变事件。In some embodiments, after generating the drop-down list of the current drop-down box based on the obtained option data set, the method further includes: obtaining query keywords through the current drop-down box, and filtering from the drop-down list corresponding to the current drop-down box according to the query keywords , The drop-down list is visually displayed according to the screening results; when a selection operation on the drop-down list of the visual display is received, the drop-down box change event in the current drop-down box is triggered.
本实施例中,用户可在当前下拉框中输入查询关键字,终端根据该查询关键字从下拉列表中筛选包含该查询关键字的选项数据,将这些选项数据进行可视化展示,得到可视化展示的下拉列表,此时展示的下拉列表中只包含了上述根据关键字筛选出的选项数据,当用户点击此时展示的下拉列表中任意一个选项数据时,即触发当前下拉框中的下拉框改变事件,此时,终端可根据下拉框改变事件对应的选项数据获取下一级下拉框的选项数据集合,然后根据获取到的选项数据集合生成下一级下拉框的下拉列表。In this embodiment, the user can enter a query keyword in the current drop-down box, and the terminal filters the option data containing the query keyword from the drop-down list according to the query keyword, and visually displays the option data to obtain a visually displayed drop-down The drop-down list displayed at this time only contains the above option data filtered by keywords. When the user clicks any option data in the drop-down list displayed at this time, it will trigger the drop-down box change event in the current drop-down box. At this time, the terminal may obtain the option data set of the lower-level drop-down box according to the option data corresponding to the drop-down box change event, and then generate the drop-down list of the lower-level drop-down box according to the obtained option data set.
举个例子,在实现上述实施例中省市县三级联动的下拉框时,当根据省级下拉框的选 择数据“湖南省”,得到市级下拉框的下拉列表中,可通过市级下拉框获取查询关键字,例如可以是“阳”,此时终端根据该查询关键字“阳”在下拉列表中进行筛查,得到“邵阳市”、“衡阳市”、“岳阳市”、“益阳市”等等,并根据这些数据展示下拉列表,展示的下拉列表中包括“邵阳市”、“衡阳市”、“岳阳市”、“益阳市”四个选项数据,当用户点击“邵阳市”时,终端会接收到该选择操作,并且触发市级下拉框中的下拉框改变事件,根据该下拉框改变事件对应的选项数据(即邵阳市)终端可以获取县级下拉框对应的选项数据集合。For example, when implementing the drop-down box of the three-level linkage of provinces, cities and counties in the above embodiment, when selecting the data "Hunan Province" in the drop-down box at the provincial level, the drop-down list of the city-level drop-down box can be obtained through the city-level drop-down list. Get the query keyword in the box, for example, "Yang", then the terminal will screen according to the query keyword "Yang" in the drop-down list to get "Shaoyang City", "Hengyang City", "Yueyang City", "Yiyang" City" and so on, and display a drop-down list based on these data. The displayed drop-down list includes four options of "Shaoyang City", "Hengyang City", "Yueyang City", and "Yiyang City". When the user clicks on "Shaoyang City" At the time, the terminal will receive the selection operation and trigger the drop-down box change event in the city-level drop-down box. According to the drop-down box to change the option data corresponding to the event (that is, Shaoyang City), the terminal can obtain the option data set corresponding to the county-level drop-down box .
上述实施例中,用户可以在下拉框中输入查询关键字进行查询,提高了用户在下拉框对应的下拉列表中进行数据查询的便利性。In the above embodiment, the user can enter a query keyword in the drop-down box to make a query, which improves the convenience for the user to query data in the drop-down list corresponding to the drop-down box.
在一些实施例中,在根据获取到的选项数据集合生成当前下拉框的下拉列表之后,还包括:当监听到当前下拉框对应的预设点击事件时,获取当前下拉框对应的选项数据集合中各个选项数据在预设时间段内的历史选择次数;根据历史选择次数大于预设阈值的选项数据生成参考列表;将下拉列表及参考列表进行可视化展示。In some embodiments, after generating the drop-down list of the current drop-down box based on the obtained option data set, the method further includes: when a preset click event corresponding to the current drop-down box is monitored, obtaining the option data set corresponding to the current drop-down box The historical selection times of each option data in a preset time period; generate a reference list based on the option data whose historical selection times are greater than a preset threshold; visually display the drop-down list and the reference list.
预设时间段可以根据需要进行设置,例如一周、一个月等,预设阈值可由开发人员根据经验进行设置,预设点击事件为可以触发下拉框中的打开事件的点击事件,例如点击下拉框上的下拉按钮。本实施例中,当监听到当前下拉框对应的打开事件时,终端可以获取当前下拉框对应的选项数据集合中各个选项数据在预设时间段内的历史选择次数,根据历史选择次数大于预设阈值的选项数据生成参考列表,对当前下拉框对应的下拉列表及该参考列表进行可视化展示。The preset time period can be set according to needs, such as one week, one month, etc. The preset threshold can be set by the developer based on experience. The preset click event is a click event that can trigger the open event in the drop-down box, such as clicking on the drop-down box Drop-down button. In this embodiment, when the opening event corresponding to the current drop-down box is monitored, the terminal can obtain the historical selection times of each option data in the option data set corresponding to the current drop-down box within a preset time period, and according to the historical selection times greater than the preset The threshold option data generates a reference list, and visually displays the drop-down list corresponding to the current drop-down box and the reference list.
在一些实施例中,获取当前下拉框对应的选项数据集合中各个选项数据在预设时间段内的历史选择次数可以通过在当前页面设置埋点实现。In some embodiments, obtaining the historical selection times of each option data in the preset time period in the option data set corresponding to the current drop-down box can be achieved by setting a buried point on the current page.
本实施例中,当监听到当前下拉框对应的预设点击事件时,获取当前下拉框对应的选项数据集合中各个选项数据在预设时间段内的历史选择次数,根据历史选择次数大于预设阈值的选项数据生成参考列表,同时显示下拉列表和参考列表可以提高用户的选择效率。In this embodiment, when the preset click event corresponding to the current drop-down box is monitored, the historical selection times of each option data in the option data set corresponding to the current drop-down box within the preset time period are obtained, and the number of historical selections is greater than the preset time. The threshold option data generates a reference list, and displaying the drop-down list and the reference list at the same time can improve the user's selection efficiency.
在一些实施例中,如图3所示,提供了一种多级联动下拉框的实现方法,包括以下步骤:In some embodiments, as shown in FIG. 3, a method for implementing multi-level linkage drop-down boxes is provided, including the following steps:
步骤S302,获取页面数据,页面数据中包括多个下拉框元素及各个下拉框元素对应的属性信息;Step S302: Obtain page data. The page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element;
步骤S304,获取下拉框元素对应的下拉框组件,分别生成各个下拉框元素的实例;Step S304: Obtain the drop-down box components corresponding to the drop-down box elements, and respectively generate instances of each drop-down box element;
步骤S306,根据各个下拉框元素的属性信息,对各个下拉框元素的实例进行配置,当配置完成后,对各个下拉框元素的实例进行渲染,得到多个可视化下拉框;Step S306, according to the attribute information of each drop-down box element, configure the instance of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes;
步骤S308,获取所有下拉框对应的选项数据总集合,将获取的选项数据总集合保存至本地数据库中;Step S308: Obtain a total set of option data corresponding to all drop-down boxes, and save the obtained total set of option data in a local database;
步骤S310,从本地数据库中获取当前下拉框的选项数据集合,根据获取到的选项数据集合生成当前下拉框的下拉列表;Step S310, obtaining the option data set of the current drop-down box from the local database, and generating the drop-down list of the current drop-down box according to the obtained option data set;
步骤S312,通过当前下拉框获取查询关键字,根据查询关键字从当前下拉框对应的下拉列表中进行筛选,根据筛选结果对下拉列表进行可视化展示;Step S312: Obtain the query keyword through the current drop-down box, filter from the drop-down list corresponding to the current drop-down box according to the query keyword, and visually display the drop-down list according to the filtering result;
步骤S314,当接收到作用于可视化展示的下拉列表的选择操作时,触发当前下拉框中的下拉框改变事件;Step S314, when a selection operation on the drop-down list of the visual display is received, trigger a drop-down box change event in the current drop-down box;
步骤S316,当存在与当前下拉框对应的下一级下拉框时,监听当前下拉框中的下拉框改变事件,根据监听到的下拉框改变事件从当前下拉框的下拉列表中确定目标选项数据;Step S316, when there is a lower-level drop-down box corresponding to the current drop-down box, monitor the drop-down box change event in the current drop-down box, and determine the target option data from the drop-down list of the current drop-down box according to the monitored drop-down box change event;
步骤S318,根据目标选项数据从本地数据库中查询对应的下一级选项数据,得到下一级下拉框对应的选项数据集合,根据所得到的选项数据集合生成下一级下拉框的下拉列表。Step S318: Query the corresponding next-level option data from the local database according to the target option data to obtain the option data set corresponding to the next-level drop-down box, and generate the drop-down list of the next-level drop-down box based on the obtained option data set.
关于上述步骤S302-步骤S308的解释可参见上述实施例中的描述,本申请在此不赘述。For the explanation of the above step S302 to step S308, please refer to the description in the above embodiment, which will not be repeated in this application.
应该理解的是,虽然图2-3的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flowchart of FIGS. 2-3 are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless specifically stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least some of the steps in Figure 2-3 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. These sub-steps or stages The execution order of is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
在一些实施例中,如图4所示,提供了一种多级联动下拉框的实现装置400,包括:In some embodiments, as shown in FIG. 4, a device 400 for implementing a multi-level linkage drop-down box is provided, including:
页面数据获取模块402,用于获取页面数据,页面数据中包括多个下拉框元素及各个下拉框元素对应的属性信息;The page data acquisition module 402 is used to acquire page data, and the page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element;
下拉框组件获取模块404,用于获取下拉框元素对应的下拉框组件,分别生成各个下拉框元素的实例;The drop-down box component obtaining module 404 is used to obtain the drop-down box components corresponding to the drop-down box elements, and respectively generate instances of each drop-down box element;
渲染模块408,用于根据各个下拉框元素的属性信息,对各个下拉框元素的实例进行配置,当配置完成后,对各个下拉框元素的实例进行渲染,得到多个可视化下拉框;多个可视化下拉框中每两个相邻的可视化下拉框之间按照位置关系对应不同的级别;The rendering module 408 is used to configure the instance of each drop-down box element according to the attribute information of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes; multiple visualizations Each two adjacent visual drop-down boxes in the drop-down box correspond to different levels according to the position relationship;
第一下拉列表生成模块410,用于获取当前下拉框对应的选项数据集合,根据获取到的选项数据集合生成当前下拉框的下拉列表;The first drop-down list generating module 410 is configured to obtain the option data set corresponding to the current drop-down box, and generate the drop-down list of the current drop-down box according to the obtained option data set;
事件监听模块412,用于当存在与当前下拉框对应的下一级下拉框时,监听当前下拉框中的下拉框改变事件,根据监听到的下拉框改变事件从当前下拉框的下拉列表中确定目标选项数据;The event monitoring module 412 is used to monitor the drop-down box change event in the current drop-down box when there is a lower-level drop-down box corresponding to the current drop-down box, and determine from the drop-down list of the current drop-down box according to the monitored drop-down box change event Target option data;
第二下拉列表生成模块414,用于根据目标选项数据获取下一级下拉框的选项数据集合,根据获取到的选项数据集合生成下一级下拉框的下拉列表。The second drop-down list generating module 414 is configured to obtain the option data set of the next-level drop-down box according to the target option data, and generate the drop-down list of the next-level drop-down box according to the obtained option data set.
在一些实施例中,第二下拉列表生成模块412用于将目标选项数据发送至服务器;接收服务器返回的根据目标选项数据查询到的下一级选项数据,得到下一级下拉框对应的选项数据集合;根据所得到的选项数据集合生成下一级下拉框的下拉列表。In some embodiments, the second drop-down list generation module 412 is configured to send the target option data to the server; receive the next-level option data queried according to the target option data returned by the server to obtain the option data corresponding to the next-level drop-down box Set; generate the drop-down list of the next-level drop-down box according to the obtained option data set.
在一些实施例中,上述装置还包括:选项数据保存模块,用于获取所有下拉框对应的选项数据总集合,将获取到的选项数据总集合保存至本地数据库中;第一下拉列表生成模块408还用于从本地数据库中获取当前下拉框的选项数据集合,根据获取到的选项数据集合生成当前下拉框的下拉列表;第二下拉列表生成模块412还用于根据目标选项数据从本地数据库中查询对应的下一级选项数据,得到下一级下拉框对应的选项数据集合,根据所得到的选项数据集合生成下一级下拉框的下拉列表。In some embodiments, the above device further includes: an option data saving module, configured to obtain a total set of option data corresponding to all drop-down boxes, and save the obtained total set of option data in a local database; and a first drop-down list generating module 408 is also used to obtain the option data set of the current drop-down box from the local database, and to generate the drop-down list of the current drop-down box according to the obtained option data set; the second drop-down list generation module 412 is also used to obtain data from the local database according to the target option data Query the corresponding lower-level option data to obtain the option data set corresponding to the lower-level drop-down box, and generate the drop-down list of the lower-level drop-down box according to the obtained option data set.
在一些实施例中,上述装置还包括:第三下拉列表生成模块,用于通过当前下拉框获取查询关键字,根据查询关键字从当前下拉框对应的下拉列表中进行筛选,根据筛选结果对下拉列表进行可视化展示;当接收到作用于可视化展示的下拉列表的选择操作时,触发当前下拉框中的下拉框改变事件。In some embodiments, the above-mentioned apparatus further includes: a third drop-down list generating module, configured to obtain query keywords from the current drop-down box, filter from the drop-down list corresponding to the current drop-down box according to the query keywords, and select the drop-down list according to the screening results. The list is displayed visually; when a selection operation on the drop-down list of the visual display is received, the drop-down box change event in the current drop-down box is triggered.
在一些实施例中,上述装置还包括:参考列表生成模块,用于当监听到当前下拉框对应的预设点击事件时,获取当前下拉框对应的选项数据集合中各个选项数据在预设时间段内的历史选择次数;根据历史选择次数大于预设阈值的选项数据生成参考列表;将下拉列表及参考列表进行可视化展示。In some embodiments, the above-mentioned apparatus further includes: a reference list generation module, which is used to obtain the preset time period of each option data in the option data set corresponding to the current drop-down box when the preset click event corresponding to the current drop-down box is monitored. The number of historical selections within; the reference list is generated based on the option data with the number of historical selections greater than the preset threshold; the drop-down list and the reference list are visually displayed.
关于多级联动下拉框的实现装置的具体限定可以参见上文中对于多级联动下拉框的实现方法的限定,在此不再赘述。上述多级联动下拉框的实现装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific definition of the device for implementing the multi-level linkage drop-down box, please refer to the above limitation on the implementation method of the multi-level linkage drop-down box, which will not be repeated here. Each module in the device for realizing the above-mentioned multi-level linkage drop-down box can be implemented in whole or in part by software, hardware, and a combination thereof. The foregoing modules may be embedded in the form of hardware or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the foregoing modules.
在一些实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图5所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机可读指令。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种多级联动下拉框的实现方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In some embodiments, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 5. The computer equipment includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. The processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer readable instructions. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instruction is executed by the processor, a method for implementing a multi-level linkage drop-down box is realized. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, or it can be a button, a trackball or a touchpad set on the housing of the computer equipment , It can also be an external keyboard, touchpad, or mouse.
本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 5 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
一种计算机设备,包括存储器和一个或多个处理器,存储器中存储有计算机可读指令,计算机可读指令被处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的多级联动下拉框的实现方法的步骤。A computer device includes a memory and one or more processors. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the one or more processors can realize the implementation provided in any one of the embodiments of the present application. Steps of the implementation method of the multi-level linkage drop-down box.
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的多级联动下拉框的实现方法的步骤。One or more non-volatile computer-readable storage media storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors implement any one of the embodiments of the present application. Provides the steps of the implementation method of the multi-level linkage drop-down box.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through computer-readable instructions, which can be stored in a non-volatile computer. In a readable storage medium, when the computer-readable instructions are executed, they may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not a limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction between the combinations of these technical features, they should It is considered as the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the scope of the invention patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can be made, and these all fall within the protection scope of this application. Therefore, the scope of protection of the patent of this application shall be subject to the appended claims.

Claims (20)

  1. 一种多级联动下拉框的实现方法,包括:A method for implementing multi-level linkage drop-down boxes includes:
    获取页面数据,所述页面数据中包括多个下拉框元素及各个下拉框元素对应的属性信息;Acquiring page data, where the page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element;
    获取所述下拉框元素对应的下拉框组件,分别生成各个下拉框元素的实例;Obtain the drop-down box component corresponding to the drop-down box element, and respectively generate instances of each drop-down box element;
    根据所述各个下拉框元素的属性信息,对所述各个下拉框元素的实例进行配置,当配置完成后,对所述各个下拉框元素的实例进行渲染,得到多个可视化下拉框;所述多个可视化下拉框中每两个相邻的可视化下拉框之间按照位置关系对应不同的级别;According to the attribute information of each drop-down box element, configure the instance of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes; Each visual drop-down box corresponds to different levels according to the position relationship between two adjacent visual drop-down boxes;
    获取当前下拉框对应的选项数据集合,根据获取到的所述选项数据集合生成当前下拉框的下拉列表;Acquiring an option data set corresponding to the current drop-down box, and generating a drop-down list of the current drop-down box according to the acquired option data set;
    当存在与所述当前下拉框对应的下一级下拉框时,监听当前下拉框中的下拉框改变事件,根据监听到的所述下拉框改变事件从所述当前下拉框的下拉列表中确定目标选项数据;及When there is a lower-level drop-down box corresponding to the current drop-down box, monitor the drop-down box change event in the current drop-down box, and determine the target from the drop-down list of the current drop-down box according to the monitored drop-down box change event Option data; and
    根据所述目标选项数据获取下一级下拉框的选项数据集合,根据获取到的所述选项数据集合生成下一级下拉框的下拉列表。The option data set of the lower-level drop-down box is obtained according to the target option data, and the drop-down list of the lower-level drop-down box is generated according to the obtained option data set.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述目标选项数据获取下一级下拉框的选项数据集合,根据获取到的所述选项数据集合生成下一级下拉框的下拉列表,包括:The method according to claim 1, characterized in that the option data set of the next-level drop-down box is obtained according to the target option data, and the drop-down list of the next-level drop-down box is generated according to the obtained option data set ,include:
    将所述目标选项数据发送至服务器;Sending the target option data to the server;
    接收所述服务器返回的根据所述目标选项数据查询到的下一级选项数据,得到下一级下拉框对应的选项数据集合;及Receiving the next-level option data queried according to the target option data returned by the server to obtain the option data set corresponding to the next-level drop-down box; and
    根据所得到的选项数据集合生成下一级下拉框的下拉列表。The drop-down list of the next-level drop-down box is generated according to the obtained option data set.
  3. 根据权利要求1所述的方法,其特征在于,在所述对所述各个下拉框元素的实例进行渲染,得到多个可视化下拉框之后,所述方法还包括:The method according to claim 1, wherein after said rendering the instances of the respective drop-down box elements to obtain multiple visual drop-down boxes, the method further comprises:
    获取所有下拉框对应的选项数据总集合,将获取到的所述选项数据总集合保存至本地数据库中;Obtain a total set of option data corresponding to all drop-down boxes, and save the obtained total set of option data in a local database;
    所述获取当前下拉框对应的选项数据集合,根据获取到的所述选项数据集合生成当前下拉框的下拉列表,包括:The obtaining the option data set corresponding to the current drop-down box, and generating the drop-down list of the current drop-down box according to the obtained option data set includes:
    从本地数据库中获取当前下拉框的选项数据集合,根据获取到的所述选项数据集合生成当前下拉框的下拉列表;及Obtain the option data set of the current drop-down box from the local database, and generate the drop-down list of the current drop-down box according to the obtained option data set; and
    所述根据所述目标选项数据获取下一级下拉框的选项数据集合,根据获取到的所述选项数据集合生成下一级下拉框的下拉列表,包括:The obtaining the option data set of the next-level drop-down box according to the target option data, and generating the drop-down list of the next-level drop-down box according to the obtained option data set includes:
    根据所述目标选项数据从本地数据库中查询对应的下一级选项数据,得到下一级下拉框对应的选项数据集合,根据所得到的选项数据集合生成下一级下拉框的下拉列表。According to the target option data, the corresponding lower-level option data is queried from the local database to obtain the option data set corresponding to the lower-level drop-down box, and the drop-down list of the lower-level drop-down box is generated according to the obtained option data set.
  4. 根据权利要求1所述的方法,其特征在于,在所述根据获取到的所述选项数据集 合生成当前下拉框的下拉列表之后,所述方法还包括:The method according to claim 1, characterized in that, after said generating the drop-down list of the current drop-down box according to the obtained option data set, the method further comprises:
    通过当前下拉框获取查询关键字,根据所述查询关键字从当前下拉框对应的下拉列表中进行筛选,根据筛选结果对所述下拉列表进行可视化展示;及Obtain query keywords from the current drop-down box, filter from the drop-down list corresponding to the current drop-down box according to the query keywords, and visually display the drop-down list according to the screening results; and
    当接收到作用于可视化展示的所述下拉列表的选择操作时,触发当前下拉框中的所述下拉框改变事件。When a selection operation acting on the drop-down list for visual display is received, the drop-down box change event in the current drop-down box is triggered.
  5. 根据权利要求1所述的方法,其特征在于,在所述根据获取到的所述选项数据集合生成当前下拉框的下拉列表之后,所述方法还包括:The method according to claim 1, wherein after said generating the drop-down list of the current drop-down box according to the acquired option data set, the method further comprises:
    当监听到当前下拉框对应的预设点击事件时,获取当前下拉框对应的选项数据集合中各个选项数据在预设时间段内的历史选择次数;When the preset click event corresponding to the current drop-down box is monitored, the number of historical selections within the preset time period of each option data in the option data set corresponding to the current drop-down box is obtained;
    根据历史选择次数大于预设阈值的选项数据生成参考列表;及Generate a reference list based on the option data whose historical selection times are greater than a preset threshold; and
    将所述下拉列表及所述参考列表进行可视化展示。Visually display the drop-down list and the reference list.
  6. 根据权利要求1至5任意一项所述的方法,其特征在于,所述获取所述下拉框元素对应的下拉框组件,包括:The method according to any one of claims 1 to 5, wherein the obtaining the drop-down box component corresponding to the drop-down box element comprises:
    查询当前组件注册表,判断所述当前组件注册表中是否存在所述下拉框元素对应的注册记录;Query the current component registry to determine whether there is a registration record corresponding to the drop-down box element in the current component registry;
    若存在,则根据所述注册记录中的存储路径从本地组件库中获取下拉框元素对应的组件;及If it exists, obtain the component corresponding to the drop-down box element from the local component library according to the storage path in the registration record; and
    若不存在,则向服务发送组件获取请求,并接收所述服务器返回的下拉框组件,对所述服务器返回的下拉框组件进行注册。If it does not exist, send a component acquisition request to the service, receive the drop-down box component returned by the server, and register the drop-down box component returned by the server.
  7. 一种多级联动下拉框的实现装置,包括:A device for implementing multi-level linkage drop-down boxes includes:
    页面数据获取模块,用于获取页面数据,所述页面数据中包括多个下拉框元素及各个下拉框元素对应的属性信息;The page data acquisition module is used to acquire page data, where the page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element;
    下拉框组件获取模块,用于获取所述下拉框元素对应的下拉框组件,分别生成各个下拉框元素的实例;The drop-down box component obtaining module is used to obtain the drop-down box component corresponding to the drop-down box element, and respectively generate instances of each drop-down box element;
    渲染模块,用于根据所述各个下拉框元素的属性信息,对所述各个下拉框元素的实例进行配置,当配置完成后,对所述各个下拉框元素的实例进行渲染,得到多个可视化下拉框;所述多个可视化下拉框中每两个相邻的可视化下拉框之间按照位置关系对应不同的级别;The rendering module is used to configure the instance of each drop-down box element according to the attribute information of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes Box; the plurality of visual drop-down boxes correspond to different levels according to the position relationship between each two adjacent visual drop-down boxes;
    第一下拉列表生成模块,用于获取当前下拉框对应的选项数据集合,根据获取到的所述选项数据集合生成当前下拉框的下拉列表;The first drop-down list generating module is configured to obtain the option data set corresponding to the current drop-down box, and generate the drop-down list of the current drop-down box according to the obtained option data set;
    事件监听模块,用于当存在与所述当前下拉框对应的下一级下拉框时,监听当前下拉框中的下拉框改变事件,根据监听到的所述下拉框改变事件从所述当前下拉框的下拉列表中确定目标选项数据;及The event monitoring module is used to monitor the drop-down box change event in the current drop-down box when there is a lower-level drop-down box corresponding to the current drop-down box, and change the event from the current drop-down box according to the monitored drop-down box change event To determine the target option data in the drop-down list; and
    第二下拉列表生成模块,用于根据所述目标选项数据获取下一级下拉框的选项数据集合,根据获取到的所述选项数据集合生成下一级下拉框的下拉列表。The second drop-down list generating module is configured to obtain the option data set of the next-level drop-down box according to the target option data, and generate the drop-down list of the next-level drop-down box according to the obtained option data set.
  8. 根据权利要求7所述的装置,其特征在于,所述第二下拉列表生成模块还用于将所述目标选项数据发送至服务器;接收所述服务器返回的根据所述目标选项数据查询到的下一级选项数据,得到下一级下拉框对应的选项数据集合;及根据所得到的选项数据集合生成下一级下拉框的下拉列表。8. The device according to claim 7, wherein the second drop-down list generating module is further configured to send the target option data to a server; receive the download information queried according to the target option data returned by the server For the first-level option data, the option data set corresponding to the next-level drop-down box is obtained; and the drop-down list of the next-level drop-down box is generated according to the obtained option data set.
  9. 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:A computer device includes a memory and one or more processors. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the one or more processors, the one or more Each processor performs the following steps:
    获取页面数据,所述页面数据中包括多个下拉框元素及各个下拉框元素对应的属性信息;Acquiring page data, where the page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element;
    获取所述下拉框元素对应的下拉框组件,分别生成各个下拉框元素的实例;Obtain the drop-down box component corresponding to the drop-down box element, and respectively generate instances of each drop-down box element;
    根据所述各个下拉框元素的属性信息,对所述各个下拉框元素的实例进行配置,当配置完成后,对所述各个下拉框元素的实例进行渲染,得到多个可视化下拉框;所述多个可视化下拉框中每两个相邻的可视化下拉框之间按照位置关系对应不同的级别;According to the attribute information of each drop-down box element, configure the instance of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes; Each visual drop-down box corresponds to different levels according to the position relationship between two adjacent visual drop-down boxes;
    获取当前下拉框对应的选项数据集合,根据获取到的所述选项数据集合生成当前下拉框的下拉列表;Acquiring an option data set corresponding to the current drop-down box, and generating a drop-down list of the current drop-down box according to the acquired option data set;
    当存在与所述当前下拉框对应的下一级下拉框时,监听当前下拉框中的下拉框改变事件,根据监听到的所述下拉框改变事件从所述当前下拉框的下拉列表中确定目标选项数据;及When there is a lower-level drop-down box corresponding to the current drop-down box, monitor the drop-down box change event in the current drop-down box, and determine the target from the drop-down list of the current drop-down box according to the monitored drop-down box change event Option data; and
    根据所述目标选项数据获取下一级下拉框的选项数据集合,根据获取到的所述选项数据集合生成下一级下拉框的下拉列表。The option data set of the lower-level drop-down box is obtained according to the target option data, and the drop-down list of the lower-level drop-down box is generated according to the obtained option data set.
  10. 根据权利要求9所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:The computer device according to claim 9, wherein the processor further executes the following steps when executing the computer-readable instruction:
    将所述目标选项数据发送至服务器;Sending the target option data to the server;
    接收所述服务器返回的根据所述目标选项数据查询到的下一级选项数据,得到下一级下拉框对应的选项数据集合;及Receiving the next-level option data queried according to the target option data returned by the server to obtain the option data set corresponding to the next-level drop-down box; and
    根据所得到的选项数据集合生成下一级下拉框的下拉列表。The drop-down list of the next-level drop-down box is generated according to the obtained option data set.
  11. 根据权利要求9所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:The computer device according to claim 9, wherein the processor further executes the following steps when executing the computer-readable instruction:
    获取所有下拉框对应的选项数据总集合,将获取到的所述选项数据总集合保存至本地数据库中;Obtain a total set of option data corresponding to all drop-down boxes, and save the obtained total set of option data in a local database;
    从本地数据库中获取当前下拉框的选项数据集合,根据获取到的所述选项数据集合生成当前下拉框的下拉列表;及Obtain the option data set of the current drop-down box from the local database, and generate the drop-down list of the current drop-down box according to the obtained option data set; and
    根据所述目标选项数据从本地数据库中查询对应的下一级选项数据,得到下一级下拉框对应的选项数据集合,根据所得到的选项数据集合生成下一级下拉框的下拉列表。According to the target option data, the corresponding lower-level option data is queried from the local database to obtain the option data set corresponding to the lower-level drop-down box, and the drop-down list of the lower-level drop-down box is generated according to the obtained option data set.
  12. 根据权利要求9所述的计算机设备,其特征在于,所述处理器执行所述计算机可 读指令时还执行以下步骤:The computer device according to claim 9, wherein the processor further executes the following steps when executing the computer readable instruction:
    通过当前下拉框获取查询关键字,根据所述查询关键字从当前下拉框对应的下拉列表中进行筛选,根据筛选结果对所述下拉列表进行可视化展示;及Obtain query keywords from the current drop-down box, filter from the drop-down list corresponding to the current drop-down box according to the query keywords, and visually display the drop-down list according to the screening results; and
    当接收到作用于可视化展示的所述下拉列表的选择操作时,触发当前下拉框中的所述下拉框改变事件。When a selection operation acting on the drop-down list for visual display is received, the drop-down box change event in the current drop-down box is triggered.
  13. 根据权利要求9所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:The computer device according to claim 9, wherein the processor further executes the following steps when executing the computer-readable instruction:
    当监听到当前下拉框对应的预设点击事件时,获取当前下拉框对应的选项数据集合中各个选项数据在预设时间段内的历史选择次数;When the preset click event corresponding to the current drop-down box is monitored, the number of historical selections within the preset time period of each option data in the option data set corresponding to the current drop-down box is obtained;
    根据历史选择次数大于预设阈值的选项数据生成参考列表;及Generate a reference list based on the option data whose historical selection times are greater than a preset threshold; and
    将所述下拉列表及所述参考列表进行可视化展示。Visually display the drop-down list and the reference list.
  14. 根据权利要求9至13任意一项所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:The computer device according to any one of claims 9 to 13, wherein the processor further executes the following steps when executing the computer readable instruction:
    查询当前组件注册表,判断所述当前组件注册表中是否存在所述下拉框元素对应的注册记录;Query the current component registry to determine whether there is a registration record corresponding to the drop-down box element in the current component registry;
    若存在,则根据所述注册记录中的存储路径从本地组件库中获取下拉框元素对应的组件;及If it exists, obtain the component corresponding to the drop-down box element from the local component library according to the storage path in the registration record; and
    若不存在,则向服务发送组件获取请求,并接收所述服务器返回的下拉框组件,对所述服务器返回的下拉框组件进行注册。If it does not exist, send a component acquisition request to the service, receive the drop-down box component returned by the server, and register the drop-down box component returned by the server.
  15. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:One or more non-volatile computer-readable storage media storing computer-readable instructions, which when executed by one or more processors, cause the one or more processors to perform the following steps:
    获取页面数据,所述页面数据中包括多个下拉框元素及各个下拉框元素对应的属性信息;Acquiring page data, where the page data includes multiple drop-down box elements and attribute information corresponding to each drop-down box element;
    获取所述下拉框元素对应的下拉框组件,分别生成各个下拉框元素的实例;Obtain the drop-down box component corresponding to the drop-down box element, and respectively generate instances of each drop-down box element;
    根据所述各个下拉框元素的属性信息,对所述各个下拉框元素的实例进行配置,当配置完成后,对所述各个下拉框元素的实例进行渲染,得到多个可视化下拉框;所述多个可视化下拉框中每两个相邻的可视化下拉框之间按照位置关系对应不同的级别;According to the attribute information of each drop-down box element, configure the instance of each drop-down box element, and when the configuration is completed, render the instance of each drop-down box element to obtain multiple visual drop-down boxes; Each visual drop-down box corresponds to different levels according to the position relationship between two adjacent visual drop-down boxes;
    获取当前下拉框对应的选项数据集合,根据获取到的所述选项数据集合生成当前下拉框的下拉列表;Acquiring an option data set corresponding to the current drop-down box, and generating a drop-down list of the current drop-down box according to the acquired option data set;
    当存在与所述当前下拉框对应的下一级下拉框时,监听当前下拉框中的下拉框改变事件,根据监听到的所述下拉框改变事件从所述当前下拉框的下拉列表中确定目标选项数据;及When there is a lower-level drop-down box corresponding to the current drop-down box, monitor the drop-down box change event in the current drop-down box, and determine the target from the drop-down list of the current drop-down box according to the monitored drop-down box change event Option data; and
    根据所述目标选项数据获取下一级下拉框的选项数据集合,根据获取到的所述选项数据集合生成下一级下拉框的下拉列表。The option data set of the lower-level drop-down box is obtained according to the target option data, and the drop-down list of the lower-level drop-down box is generated according to the obtained option data set.
  16. 根据权利要求15所述的存储介质,其特征在于,所述计算机可读指令被所述处 理器执行时还执行以下步骤:The storage medium according to claim 15, wherein the following steps are further performed when the computer-readable instructions are executed by the processor:
    将所述目标选项数据发送至服务器;Sending the target option data to the server;
    接收所述服务器返回的根据所述目标选项数据查询到的下一级选项数据,得到下一级下拉框对应的选项数据集合;及Receiving the next-level option data queried according to the target option data returned by the server to obtain the option data set corresponding to the next-level drop-down box; and
    根据所得到的选项数据集合生成下一级下拉框的下拉列表。The drop-down list of the next-level drop-down box is generated according to the obtained option data set.
  17. 根据权利要求15所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:The storage medium according to claim 15, wherein the following steps are further executed when the computer-readable instructions are executed by the processor:
    获取所有下拉框对应的选项数据总集合,将获取到的所述选项数据总集合保存至本地数据库中;Obtain a total set of option data corresponding to all drop-down boxes, and save the obtained total set of option data in a local database;
    从本地数据库中获取当前下拉框的选项数据集合,根据获取到的所述选项数据集合生成当前下拉框的下拉列表;及Obtain the option data set of the current drop-down box from the local database, and generate the drop-down list of the current drop-down box according to the obtained option data set; and
    根据所述目标选项数据从本地数据库中查询对应的下一级选项数据,得到下一级下拉框对应的选项数据集合,根据所得到的选项数据集合生成下一级下拉框的下拉列表。According to the target option data, the corresponding lower-level option data is queried from the local database to obtain the option data set corresponding to the lower-level drop-down box, and the drop-down list of the lower-level drop-down box is generated according to the obtained option data set.
  18. 根据权利要求15所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:The storage medium according to claim 15, wherein the following steps are further executed when the computer-readable instructions are executed by the processor:
    通过当前下拉框获取查询关键字,根据所述查询关键字从当前下拉框对应的下拉列表中进行筛选,根据筛选结果对所述下拉列表进行可视化展示;及Obtain query keywords from the current drop-down box, filter from the drop-down list corresponding to the current drop-down box according to the query keywords, and visually display the drop-down list according to the screening results; and
    当接收到作用于可视化展示的所述下拉列表的选择操作时,触发当前下拉框中的所述下拉框改变事件。When a selection operation acting on the drop-down list for visual display is received, the drop-down box change event in the current drop-down box is triggered.
  19. 根据权利要求15所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:The storage medium according to claim 15, wherein the following steps are further executed when the computer-readable instructions are executed by the processor:
    当监听到当前下拉框对应的预设点击事件时,获取当前下拉框对应的选项数据集合中各个选项数据在预设时间段内的历史选择次数;When the preset click event corresponding to the current drop-down box is monitored, the number of historical selections within the preset time period of each option data in the option data set corresponding to the current drop-down box is obtained;
    根据历史选择次数大于预设阈值的选项数据生成参考列表;及Generate a reference list based on the option data whose historical selection times are greater than a preset threshold; and
    将所述下拉列表及所述参考列表进行可视化展示。Visually display the drop-down list and the reference list.
  20. 根据权利要求15至19任意一项所述的存储介质,其特征在于,所述计算机可读指令被所述处理器执行时还执行以下步骤:The storage medium according to any one of claims 15 to 19, wherein the following steps are further executed when the computer-readable instructions are executed by the processor:
    查询当前组件注册表,判断所述当前组件注册表中是否存在所述下拉框元素对应的注册记录;Query the current component registry to determine whether there is a registration record corresponding to the drop-down box element in the current component registry;
    若存在,则根据所述注册记录中的存储路径从本地组件库中获取下拉框元素对应的组件;及If it exists, obtain the component corresponding to the drop-down box element from the local component library according to the storage path in the registration record; and
    若不存在,则向服务发送组件获取请求,并接收所述服务器返回的下拉框组件,对所述服务器返回的下拉框组件进行注册。If it does not exist, send a component acquisition request to the service, receive the drop-down box component returned by the server, and register the drop-down box component returned by the server.
PCT/CN2019/118176 2019-06-18 2019-11-13 Method and apparatus for implementing multi-stage linkage drop-down box, and computer device WO2020253059A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910525318.4A CN110377851B (en) 2019-06-18 2019-06-18 Method and device for realizing multi-stage linkage drop-down frame and computer equipment
CN201910525318.4 2019-06-18

Publications (1)

Publication Number Publication Date
WO2020253059A1 true WO2020253059A1 (en) 2020-12-24

Family

ID=68250385

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118176 WO2020253059A1 (en) 2019-06-18 2019-11-13 Method and apparatus for implementing multi-stage linkage drop-down box, and computer device

Country Status (2)

Country Link
CN (1) CN110377851B (en)
WO (1) WO2020253059A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113835603A (en) * 2021-08-31 2021-12-24 五八有限公司 Page element selection method and device, electronic equipment and storage medium
CN114356327A (en) * 2021-12-29 2022-04-15 上海万物新生环保科技集团有限公司 React visual area rendering method and device
CN114579098A (en) * 2022-03-18 2022-06-03 河钢数字技术股份有限公司 Method for linkage control of ElementUI form and list

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110377851B (en) * 2019-06-18 2024-02-02 平安科技(深圳)有限公司 Method and device for realizing multi-stage linkage drop-down frame and computer equipment
CN111191163B (en) * 2019-11-11 2021-01-12 苏州亿歌网络科技有限公司 Method, device, equipment and storage medium for updating webpage form data
CN111026312B (en) * 2019-12-10 2021-07-23 北京新氧万维科技咨询有限公司 Linkage data processing method and device and terminal
CN112052418B (en) * 2020-09-08 2024-03-05 新奥数能科技有限公司 Data configuration method and device
CN112130836A (en) * 2020-09-10 2020-12-25 华帝股份有限公司 Method for generating multi-stage linkage assembly based on JSON file
CN112269785B (en) * 2020-10-29 2023-04-21 嘉兴易迪希计算机技术有限公司 Method and system for dynamically filling field in subject state details in EDC (electronic data communication) system
CN112528189B (en) * 2020-12-23 2024-05-17 北京神州数码云科信息技术有限公司 Data-based component packaging method and device, computer equipment and storage medium
CN112799760B (en) * 2021-01-26 2023-05-12 挂号网(杭州)科技有限公司 Form rendering method and device
CN113377634A (en) * 2021-05-25 2021-09-10 北京猿力教育科技有限公司 Monitoring method for backtracking user operation, user operation backtracking method and device
CN113721812A (en) * 2021-08-05 2021-11-30 中核武汉核电运行技术股份有限公司 Nuclear power plant data drop-down box component creation method and system based on acts
CN113721908B (en) * 2021-08-30 2024-03-22 湖南快乐阳光互动娱乐传媒有限公司 Unlimited cascade component rendering method and device
CN113923131B (en) * 2021-09-10 2023-08-22 北京世纪互联宽带数据中心有限公司 Monitoring information determining method and device, computing equipment and storage medium
CN114265658B (en) * 2021-12-24 2024-03-01 中国农业银行股份有限公司 Page display method, device and equipment
CN114995719B (en) * 2022-06-10 2023-08-01 北京百度网讯科技有限公司 List rendering method, device, equipment and storage medium
CN115981624A (en) * 2022-12-26 2023-04-18 广东保伦电子股份有限公司 WPF-based drop-down box control element screening method and server
CN116700725B (en) * 2023-08-04 2023-10-31 太平金融科技服务(上海)有限公司 Page generation method, page generation device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150127613A1 (en) * 2013-08-01 2015-05-07 Tencent Technology (Shenzhen) Company Limited Method, apparatus, and application platform for updating application object attribute
CN106033471A (en) * 2015-03-20 2016-10-19 阿里巴巴集团控股有限公司 Method and device for processing form
CN108038142A (en) * 2017-11-24 2018-05-15 平安科技(深圳)有限公司 Realize method, electronic device and the storage medium of multistage linking combobox
CN108694214A (en) * 2017-04-12 2018-10-23 北京京东尚科信息技术有限公司 Generation method, generating means, readable medium and the electronic equipment of data sheet
CN110377851A (en) * 2019-06-18 2019-10-25 平安科技(深圳)有限公司 Implementation method, device and the computer equipment of multistage linking combobox

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106354483B (en) * 2015-07-16 2020-02-07 阿里巴巴集团控股有限公司 Data processing method and device and electronic equipment
CN106856485B (en) * 2015-12-08 2020-09-11 阿里巴巴集团控股有限公司 Data service publishing method and device
CN106951428B (en) * 2016-01-06 2020-06-02 菜鸟智能物流控股有限公司 Page initialization method and device
CN106599213B (en) * 2016-12-16 2020-06-30 车智互联(北京)科技有限公司 Automatic form filling method and system
CN109471685A (en) * 2017-09-08 2019-03-15 北京国双科技有限公司 The methods of exhibiting and device of drop-down menu
CN108846087A (en) * 2018-06-12 2018-11-20 恒生电子股份有限公司 A kind of page rendering method, apparatus, terminal and server
CN109446249A (en) * 2018-10-26 2019-03-08 平安科技(深圳)有限公司 Base table display methods, device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150127613A1 (en) * 2013-08-01 2015-05-07 Tencent Technology (Shenzhen) Company Limited Method, apparatus, and application platform for updating application object attribute
CN106033471A (en) * 2015-03-20 2016-10-19 阿里巴巴集团控股有限公司 Method and device for processing form
CN108694214A (en) * 2017-04-12 2018-10-23 北京京东尚科信息技术有限公司 Generation method, generating means, readable medium and the electronic equipment of data sheet
CN108038142A (en) * 2017-11-24 2018-05-15 平安科技(深圳)有限公司 Realize method, electronic device and the storage medium of multistage linking combobox
CN110377851A (en) * 2019-06-18 2019-10-25 平安科技(深圳)有限公司 Implementation method, device and the computer equipment of multistage linking combobox

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113835603A (en) * 2021-08-31 2021-12-24 五八有限公司 Page element selection method and device, electronic equipment and storage medium
CN114356327A (en) * 2021-12-29 2022-04-15 上海万物新生环保科技集团有限公司 React visual area rendering method and device
CN114356327B (en) * 2021-12-29 2024-05-17 上海万物新生环保科技集团有限公司 Method and equipment for rendering real visible area
CN114579098A (en) * 2022-03-18 2022-06-03 河钢数字技术股份有限公司 Method for linkage control of ElementUI form and list
CN114579098B (en) * 2022-03-18 2024-05-28 河钢数字技术股份有限公司 Method for ElementUI form and list linkage control

Also Published As

Publication number Publication date
CN110377851B (en) 2024-02-02
CN110377851A (en) 2019-10-25

Similar Documents

Publication Publication Date Title
WO2020253059A1 (en) Method and apparatus for implementing multi-stage linkage drop-down box, and computer device
US10599313B2 (en) System for high volume data analytic integration and channel-independent advertisement generation
CN112036736B (en) Workflow creation method and device
US20160364770A1 (en) System for high volume data analytic integration and channel-independent advertisement generation
US20150324453A1 (en) Representation of datasets using view-specific visual bundlers
CN110442341B (en) Interface configuration method and device of application program and terminal equipment
US20150070383A1 (en) Techniques to generate digital maps
US10089372B2 (en) Data visualization using level of detail magnification
US20150142727A1 (en) Analytic operations for data services
CN115759018A (en) Report generation method and device, computer equipment and storage medium
US11323526B2 (en) Analysis and visualization of session paths
CN112035555B (en) Information display method, device and equipment
US11599857B2 (en) Categorized time designation on calendars
CN114816405A (en) Business view interface display method and device, computer equipment and storage medium
CN109656549B (en) Construction method and device of monitoring system, computer equipment and storage medium
CN111191057A (en) User-defined retrieval method and device, electronic equipment and storage medium thereof
CN112528189A (en) Data-based component packaging method and device, computer equipment and storage medium
US11366826B2 (en) Customizing data visualizations according to user activity
CN112988291B (en) Page event management method and device, computer readable medium and electronic equipment
CN115062082A (en) Data acquisition method and device, storage medium and computer equipment
CN115878715A (en) Method and device for generating page display scheme and computer equipment
CN115878746A (en) Policy text determination method and device
CN114462362A (en) Report file generation method and device, computer equipment and storage medium
CN116681203A (en) Enterprise management consultation method and system based on big data analysis
CN117319335A (en) Communication client construction method and device adapting to financial operation system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19934253

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19934253

Country of ref document: EP

Kind code of ref document: A1