CN113656533A - Tree control processing method and device and electronic equipment - Google Patents

Tree control processing method and device and electronic equipment Download PDF

Info

Publication number
CN113656533A
CN113656533A CN202110968078.2A CN202110968078A CN113656533A CN 113656533 A CN113656533 A CN 113656533A CN 202110968078 A CN202110968078 A CN 202110968078A CN 113656533 A CN113656533 A CN 113656533A
Authority
CN
China
Prior art keywords
control
node
tree
control node
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110968078.2A
Other languages
Chinese (zh)
Inventor
汪振海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110968078.2A priority Critical patent/CN113656533A/en
Publication of CN113656533A publication Critical patent/CN113656533A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • G06F16/316Indexing structures
    • G06F16/322Trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems

Abstract

The disclosure provides a tree control processing method and device and electronic equipment, and relates to the field of artificial intelligence such as intelligent search, big data and control technology. The specific scheme is as follows: acquiring a target data source; rendering based on a target data source to generate a first tree control, wherein any control node in the first tree control is associated with a plurality of operation controls, and any operation control corresponds to an operation event; and executing corresponding target operation on the first control node under the condition that the first operation control is triggered or first input to the first control node is received, so that the first tree control is adjusted to obtain the target tree control, the operation process can be simplified, and the efficiency of adjusting the tree control is improved.

Description

Tree control processing method and device and electronic equipment
Technical Field
The present disclosure relates to the field of artificial intelligence in computer technologies, such as intelligent search, big data, and control technologies, and in particular, to a tree control processing method and apparatus, and an electronic device.
Background
In recent years, intelligent question-answering technology in the field of artificial intelligence has been developed, and intelligent equipment can provide solutions uninterruptedly. Knowledge maintenance is an effective means for improving the accuracy of intelligent equipment, and in general, the knowledge maintenance can be performed through a tree control, for example, each control node in the tree control has corresponding knowledge information, and the control nodes in the tree control have levels, so that the level layout of the knowledge information is realized.
However, in the process of operating the tree control at present, the main function is to display information, for example, click a control to view corresponding knowledge information.
Disclosure of Invention
The disclosure provides a tree control processing method and device and electronic equipment.
In a first aspect, an embodiment of the present disclosure provides a method for processing a tree control, where the method includes:
acquiring a target data source;
rendering the target data source to generate a first tree control, wherein any control node in the first tree control is associated with a plurality of operation controls, and any operation control corresponds to an operation event;
executing corresponding target operation on a first control node to obtain a target tree control under the condition that the first operation control is triggered or first input to the first control node is received, wherein the first operation control is any one of a plurality of operation controls of the first control node, and the first control node is any one of the control nodes in the first tree control.
In this embodiment, a target data source may be obtained first, the target data source is used for rendering, a first tree control is generated, any control node in the generated first tree control has a plurality of operation controls associated therewith, and any operation control has a corresponding operation event, and when the first operation control in the plurality of operation controls associated with the first control node is triggered or receives a first input to the first control node, a corresponding target operation may be performed on the first control node, so as to obtain the target tree control. That is, in the processing process of the tree control in this embodiment, the operation control of the control node in the first tree control may be operated to trigger the operation control or perform the first input on the first control node, and then the corresponding target operation may be performed on the first control node, so as to adjust the first tree control and obtain the target tree control.
In a second aspect, an embodiment of the present disclosure provides an apparatus for processing tree controls, the apparatus including:
the acquisition module is used for acquiring a target data source;
the generating module is used for rendering the target data source and generating a first tree control, wherein any control node in the first tree control is associated with a plurality of operation controls, and any operation control corresponds to an operation event;
the processing module is configured to execute a corresponding target operation on a first control node to obtain a target tree control when the first operation control is triggered or a first input to the first control node is received, where the first operation control is any one of a plurality of operation controls of the first control node, and the first control node is any one of the first tree controls.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the tree control processing method of the present disclosure as provided in the first aspect.
In a fourth aspect, an embodiment of the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the tree control processing method provided in the first aspect of the present disclosure.
In a fifth aspect, an embodiment of the present disclosure provides a computer program product, which includes a computer program that, when executed by a processor, implements the tree control processing method provided in the first aspect of the present disclosure.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is one of the flow diagrams of a tree control processing method according to an embodiment provided in the present disclosure;
fig. 2 is a second flowchart of a tree control processing method according to an embodiment of the present disclosure;
FIG. 3 is a third flowchart illustrating a tree control processing method according to an embodiment of the present disclosure;
FIG. 4 is a block diagram of a tree control processing apparatus according to an embodiment of the present disclosure;
fig. 5 is a block diagram of an electronic device for implementing a tree control processing method according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As shown in fig. 1, according to an embodiment of the present disclosure, the present disclosure provides a tree control processing method, which is applicable to an electronic device, and the method includes:
step S101: and acquiring a target data source.
The target data source may be understood as source data required for rendering the generated tree control, and may be a json format data source, for example.
Step S102: rendering a target data source, and generating a first tree control, wherein any control node in the first tree control is associated with a plurality of operation controls, and any operation control corresponds to an operation event.
And after the target data source is obtained, rendering can be carried out to generate a first tree control, wherein the generated first tree control not only comprises at least two control nodes with hierarchy, but also any control node is associated with a plurality of operation controls, any operation control is bound with an operation event, and the operation events corresponding to each operation control are different, namely the operation controls correspond to the operation events one by one. For example, the plurality of operation controls may include at least two of an addition control, an editing control, and a deletion control, correspondingly, the plurality of operation events include at least two of an addition event, an editing event, and a deletion event, and the first operation control is any one of the plurality of operation controls, and then the corresponding target operation may be addition, editing, or deletion.
Step S103: and executing corresponding target operation on the first control node to obtain a target tree control under the condition that the first operation control is triggered or first input to the first control node is received.
The first operation control is any one of a plurality of operation controls of a first control node, and the first control node is any one of control nodes of a first tree control.
The trigger conditions of the multiple operation controls of the control node in the first tree control can be obtained, for example, the operation controls can be clicked to trigger the control, and when the first operation control obtained from the first control node is triggered, it can be understood that an operation event corresponding to the first operation control for the first control node is triggered.
In this embodiment, a target data source may be obtained first, the target data source is used for rendering, a first tree control is generated, any control node in the generated first tree control has a plurality of operation controls associated therewith, and any operation control has a corresponding operation event, and when the first operation control in the plurality of operation controls associated with the first control node is triggered or receives a first input to the first control node, a corresponding target operation may be performed on the first control node, so as to obtain the target tree control. That is, in the processing process of the tree control in this embodiment, the operation control of the control node in the first tree control may be operated to trigger the operation control or perform the first input on the first control node, and then the corresponding target operation may be performed on the first control node, so as to adjust the first tree control and obtain the target tree control.
As shown in fig. 2, in one embodiment, the step S101 of acquiring the target data source includes:
step S1011: acquiring a data source of a second tree control, wherein the data source of the second tree control comprises subdata sources of a plurality of control nodes of the second tree control;
step S1012: respectively adding a first attribute field to the subdata sources of the multiple control nodes of the second tree control, and adding an identifier of a third control node to the subdata source of the second control node to obtain a target data source;
the second control node is a control node of which the plurality of control nodes comprise father nodes, and the third control node is a father node of which the second control node comprises.
The data source of the second tree control is a source file required for generating the second tree control in a rendering mode, the second tree control comprises a plurality of control nodes, any control node is provided with a corresponding sub data source, and the data source of the second tree control comprises the sub data sources of the control nodes of the second tree control. A first attribute field may be added to the child data source of each of the plurality of control nodes of the second tree control, and an identifier of a parent node of the second control node, that is, a third control node, may be added to the child data source of the second control node, and may be used to subsequently indicate a specific mounting position of a newly added node. In this way, a target data source is obtained, and the target data source is utilized to generate the second tree control.
In this embodiment, a target data source is obtained by adjusting a data source of the second tree control, for example, adding an attribute field and an identifier of a parent node of the second tree control to a child data source of the second control node, and then rendering the target data source to generate the first tree control, and subsequently operating the control node of the first tree control or an operation control of the control node, so that a corresponding target operation can be performed on the control node to obtain the target tree control, which can simplify an operation flow and improve the efficiency of adjusting the tree control.
In one embodiment, when the first operation control is triggered, executing a corresponding target operation on the first control node to obtain a target tree control, including:
under the condition that the first operation control is triggered, if the first operation control is a newly added operation control or an editing operation control, setting an editing attribute field in a first attribute field of a subdata source of a first control node as a first target value, and outputting an input box;
receiving content input in an input box;
and based on the content, adding child control nodes to the first control node or modifying the name of the first control node into the content to obtain the target tree control, wherein the name of the child control node is the content.
In this embodiment, if the new operation control or the edit operation control of the first control node is operated, that is, the new operation control or the edit operation control is triggered, and correspondingly, the new event or the edit event is triggered, the edit attribute field in the first attribute field of the sub data source of the first control node may be set as the first target value, for example, the first target value may be tune, which indicates that editing is possible. Then, an input box can be output, and a user can input corresponding content in the input box, so that if the newly added operation control is triggered, a child control node named as the content can be newly added to the first control node based on the input content to realize node addition and obtain a target tree control, or if the editing operation control is triggered, the name of the first control node can be modified into the content to realize editing of the name of the first control node to obtain the target tree control, so that the convenience of newly adding nodes or editing nodes to the tree control is improved, and the efficiency of node addition or node editing to the tree control is improved.
In one embodiment, when the first operation control is triggered, executing a corresponding target operation on the first control node to obtain a target tree control, including:
and under the condition that the first operation control is triggered, if the first operation control is a deletion operation control, deleting the first control node in the first tree control to obtain the target tree control.
In this embodiment, if the deletion operation control of the first control node is operated, that is, the deletion operation control is triggered, and correspondingly, the deletion event is triggered, the first control node in the first tree control can be deleted to obtain the target tree control, that is, the deletion operation control of the first control node in the first tree control is operated, that is, the deletion operation event trigger can be triggered, deletion of the first control node is realized, convenience in deleting the control node in the tree control is improved, and thus efficiency in deleting the node of the tree control is improved.
In one embodiment, the first input comprises a drag input;
under the condition that a first input to a first control node is received, executing corresponding target operation on the first control node to obtain a target tree control, wherein the target tree control comprises the following steps:
setting the states of the first control node and child nodes of the first control node to be a draggable state under the condition that a dragging input for the first control node is received;
and under the condition that the states of the first control node and the child nodes of the first control node are in a dragging state, dragging the first control node and the child nodes of the first control node in the first tree control to a target position corresponding to a dragging input to obtain a target tree control, wherein the first control node is the child node or the brother node of the target control node corresponding to the target position.
In this embodiment, the first control node may be dragged to be input, the states of the first control node and the child nodes of the first control node are set to be dragging states, the first control node and the child nodes of the first control node in the first tree-shaped control may be dragged to a target position corresponding to the dragging input, the first control node is used as a child node or a brother node of a target control node corresponding to the target position to obtain a target tree-shaped control, that is, the control node may be dragged, adjustment of the first tree-shaped control is achieved, a process of adjusting the tree-shaped control may be simplified, and adjustment efficiency is improved.
It should be noted that, in the process of dragging, the relationship between the child node of the first control node and the first control node is not changed, that is, in the process of dragging the first control node, if the child node includes the child node, the child node of the first control node moves along with the movement of the first control node, and the hierarchical relationship between the child node of the first control node and the first control node is not changed. In addition, if the first control node and the target control node are sibling nodes, it can be understood that the first control node and the target control node are nodes at the same level, and there is no parent-child relationship between the two nodes.
In one embodiment, the first tree control is associated with a first information content;
executing corresponding target operation on the first control node to obtain a target tree control, and then:
and adjusting the first information content based on the target tree control to obtain the target information content.
Any control node in the first tree control has corresponding information content, the first information content of the first tree control comprises the information content of the control node in the first tree control, the hierarchy of the first tree control corresponds to the hierarchy of the first information content, after the first tree control is adjusted to obtain the target tree control, the first information content can be adjusted to obtain the target information content, the maintenance of the information content is achieved, and the convenience of the maintenance of the information content can be improved.
The process of the above method is described in detail below with an embodiment. As shown in fig. 3, the flow of the tree control processing method of this embodiment is as follows:
step S301: and acquiring a data source of the second tree control.
Accessing an interface provided by a background in a get request mode based on an HTTP (Hyper Text Transfer Protocol) to take a data source of the second tree control, and storing the requested data source in an instance data object defined in advance in a component lifecycle created attribute provided by Vue.
Step S302: and processing the data source of the first tree control to obtain a target data source.
Js modifies the retrieved data source of the second tree control to the desired data format in the compute attribute provided by vue. The hierarchy of the data source of the second tree control is unknown, so that the method can be realized in a recursive mode, the data source of the second tree control is traversed through circulation, and by judging whether the subdata source of each control node of the data source of the second tree control contains a child field, child field is continuously transmitted to the function to be continuously traversed if yes, and the child field is not represented as the last stage, and the circulation is skipped. In the process of the recursive cycle, an identifier (id) of a previous node (parent node) of each control node needs to be added to a child data source of each control node to identify a specific mounting position of a subsequent newly added node, an edit attribute field (i.e., the first attribute field includes an edit attribute field) may be added to mark whether the corresponding child data source is in an editable state, and an operation attribute field (i.e., the first attribute field includes an operation attribute field) may be added to mark whether the corresponding child data source can be added, deleted or edited (i.e., modified), so that a new data source, i.e., a target data source, is generated by processing the data source.
Step S303: and rendering the target data source to generate a first tree control.
And generating a first tree control structure based on the tree component in the element in combination with the rendering of the target data source, and realizing the draggable state of the node by using a dragable attribute. Customizing the content of the tree node based on slot-scope: the method comprises the steps of judging whether a tree node is in an editing state of an input box or a display state of a span label by using a v-if instruction and a newly added editable attribute field, additionally, adding three operation controls (such as buttons) of 'editing', 'newly adding' and 'deleting' to the tree node, controlling the three buttons to be displayed when a mouse is drawn over the tree node through a CSS (Cascading Style Sheets) Style, and judging whether the buttons can be clicked or not according to the operable attribute field, so that the first tree control is generated based on the target data source rendering.
Step S304: and binding the operation event for the spatial node of the first tree control.
And binding operation events for the control nodes in the tree control based on click, allow-drop and allow-drag events provided in the elements, and detecting the change of the selected item (the selected node).
Step S305: and operating the first tree control to obtain a target tree control.
For example, when a control node in the first tree-shaped control triggers a new event, a property field of whether the property field can be edited in a sub data source of the control node is set to a first target value, for example, true, a new node (i.e., a new child node of the control node) is added below the control node, the first tree-shaped control is changed, an input box (input) is arranged on the node, the input box is submitted and stored based on a keyboard event in JavaScript, and the editable property field of the new node is set to false. For another example, when an edit event is triggered by a control node in the first tree control, and whether an editable property field in the control node is set to true, the span label is changed into an input box on the control node to perform editing and modification, so that the first tree control is changed, and the storage principle is the same as that described above. For another example, when a control node in the first tree control triggers a deletion event, the control node is deleted, the first tree control is changed, the change of the specific tree control is detected, and the updated DOM is rendered. For another example, when a control node in the first tree-shaped control is triggered to be dragged, whether the node can be dragged is judged based on an allow-drop event, whether a target control node corresponding to a dragging input is allowed to be placed is judged based on the allow-drop event, if yes, the control node can be dragged to a target position corresponding to the target control node to serve as a child node or a brother node of the target control node, and the first tree-shaped control is changed.
The tree control can be re-rendered, and the page DOM elements are updated in real time to be rendered and displayed.
Step S306: and adjusting the first content information of the first tree control according to the target tree control to obtain the target content information.
It should be noted that the tree control hierarchy changes, and the hierarchy of the responded knowledge content (information content) changes accordingly, that is, the first information content needs to be adjusted according to the target tree control, so as to implement maintenance of the knowledge content.
The process of processing the tree-shaped control can be understood as a novel tree-shaped control interaction process, and the tree-shaped control interaction process can be applied to a web front end, namely a novel tree-shaped control interaction method on a web front end website is realized. In addition, after the method of the embodiment of the disclosure is used in a system of an intelligent device, functions of adding, deleting and dragging in the tree control can be combined together, so that the operation and maintenance cost of manually performing the knowledge base is reduced, the efficiency of knowledge maintenance is improved, a service scene is more compounded, and the user experience is improved. And the method can help the user to effectively avoid the interference of the same group of elements or similar elements on the operation result, greatly improve the screening efficiency and range, and simultaneously improve the accuracy of the result. The tree control structure can be clearer and easier to understand, the transportability is strong, and the working efficiency of front-end developers is improved. In addition, native JavaScript technology is used for realizing dragging and the operations of adding, deleting and modifying on the control nodes of the tree control.
As shown in fig. 4, according to an embodiment of the present disclosure, the present disclosure further provides a tree control processing apparatus 400, including:
an obtaining module 401, configured to obtain a target data source;
a generating module 402, configured to render a target data source, and generate a first tree control, where any control node in the first tree control is associated with multiple operation controls, and any operation control corresponds to an operation event;
the processing module 403 is configured to, when the first operation control is triggered or receives a first input to the first control node, execute a corresponding target operation on the first control node to obtain a target tree control, where the first operation control is any one of the multiple operation controls of the first control node, and the first control node is any one of the control nodes in the first tree control.
In one embodiment, the obtaining module 401 includes:
the obtaining sub-module is used for obtaining a data source of a second tree control, and the data source of the second tree control comprises sub data sources of a plurality of control nodes of the second tree control;
the adding module is used for respectively adding a first attribute field to the subdata sources of the control nodes of the second tree control and adding an identifier of a third control node to the subdata source of the second control node to obtain a target data source;
the second control node is a control node of which the plurality of control nodes comprise father nodes, and the third control node is a father node of which the second control node comprises.
In one embodiment, the processing module 403 includes:
the output module is used for setting an editing attribute field in a first attribute field of a subdata source of a first control node as a first target value and outputting an input box if the first operation control is a newly added operation control or an editing operation control under the condition that the first operation control is triggered;
a receiving module for receiving the content input in the input box;
and the first processing submodule is used for adding a child control node to the first control node or modifying the name of the first control node into content based on the content to obtain the target tree control, wherein the name of the child control node is the content.
In one embodiment, the processing module 403 includes:
and the deleting module is used for deleting the first control node in the first tree control to obtain the target tree control if the first operation control is the deleting operation control under the condition that the first operation control is triggered.
In one embodiment, the first input comprises a drag input;
a processing module 403, comprising:
the setting module is used for setting the states of the first control node and the child nodes of the first control node to be in a draggable state under the condition that dragging input to the first control node is received;
and the dragging module is used for dragging the first control node and the child node of the first control node in the first tree control to a target position corresponding to a dragging input under the condition that the states of the first control node and the child node of the first control node are dragging states to obtain a target tree control, wherein the first control node is the child node or the brother node of the target control node corresponding to the target position.
In one embodiment, the first tree control is associated with a first information content;
the apparatus 400 further comprises:
and the adjusting module is used for adjusting the first information content based on the target tree control to obtain the target information content.
The tree control processing apparatus in each embodiment is an apparatus for implementing the tree control processing method in each embodiment applied to the first vehicle, and has corresponding technical features and technical effects, which are not described herein again.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
The non-transitory computer-readable storage medium of the embodiments of the present disclosure stores computer instructions for causing a computer to execute the tree control processing method provided by the present disclosure.
The computer program product of the embodiments of the present disclosure includes a computer program, and the computer program is used for causing a computer to execute the tree control processing method provided by the embodiments of the present disclosure.
FIG. 5 illustrates a schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data required for the operation of the device 500 can also be stored. The calculation unit 501, the ROM 502, and the RAM503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in the electronic device 500 are connected to the I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, or the like; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508, such as a magnetic disk, optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated artificial intelligence (I) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 501 executes the respective methods and processes described above, such as the tree control processing method. For example, in some embodiments, the tree control processing method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM 502 and/or the communication unit 509. When the computer program is loaded into the RAM503 and executed by the computing unit 501, one or more steps of the tree control processing method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the tree control processing method in any other suitable manner (e.g., by way of firmware). Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (15)

1. A tree control processing method, the method comprising:
acquiring a target data source;
rendering the target data source to generate a first tree control, wherein any control node in the first tree control is associated with a plurality of operation controls, and any operation control corresponds to an operation event;
executing corresponding target operation on a first control node to obtain a target tree control under the condition that the first operation control is triggered or first input to the first control node is received, wherein the first operation control is any one of a plurality of operation controls of the first control node, and the first control node is any one of the control nodes in the first tree control.
2. The method of claim 1, wherein the obtaining a target data source comprises:
acquiring a data source of a second tree control, wherein the data source of the second tree control comprises subdata sources of a plurality of control nodes of the second tree control;
respectively adding a first attribute field to the subdata sources of the plurality of control nodes of the second tree control, and adding an identifier of a third control node to the subdata source of the second control node to obtain the target data source;
the second control node is a control node including a father node in the plurality of control nodes, and the third control node is the father node included in the second control node.
3. The method of claim 1, wherein, in a case that the first operation control is triggered, performing a corresponding target operation on the first control node to obtain a target tree control, includes:
under the condition that the first operation control is triggered, if the first operation control is a newly added operation control or an editing operation control, setting an editing attribute field in a first attribute field of a sub data source of the first control node as a first target value, and outputting an input box;
receiving content input in the input box;
and based on the content, adding a child control node to the first control node or modifying the name of the first control node into the content to obtain the target tree control, wherein the name of the child control node is the content.
4. The method of claim 1, wherein, in a case that a first operation control is triggered, performing a corresponding target operation on the first control node to obtain a target tree control, comprises:
and under the condition that the first operation control is triggered, if the first operation control is a deletion operation control, deleting the first control node in the first tree control to obtain the target tree control.
5. The method of claim 1, wherein the first input comprises a drag input;
under the condition that a first input to a first control node is received, executing corresponding target operation on the first control node to obtain a target tree control, wherein the target tree control comprises the following steps:
setting the states of the first control node and child nodes of the first control node to be in a draggable state under the condition that a dragging input for the first control node is received;
and under the condition that the states of the first control node and the child nodes of the first control node are in a dragging state, dragging the first control node and the child nodes of the first control node in the first tree control to a target position corresponding to the dragging input to obtain the target tree control, wherein the first control node is the child node or the brother node of the target control node corresponding to the target position.
6. The method of claim 1, wherein the first tree control is associated with a first information content;
after the corresponding target operation is executed on the first control node to obtain the target tree control, the method further includes:
and adjusting the first information content based on the target tree control to obtain target information content.
7. A tree control processing apparatus, the apparatus comprising:
the acquisition module is used for acquiring a target data source;
the generating module is used for rendering the target data source and generating a first tree control, wherein any control node in the first tree control is associated with a plurality of operation controls, and any operation control corresponds to an operation event;
the processing module is configured to execute a corresponding target operation on a first control node to obtain a target tree control when the first operation control is triggered or a first input to the first control node is received, where the first operation control is any one of a plurality of operation controls of the first control node, and the first control node is any one of the first tree controls.
8. The apparatus of claim 7, wherein the means for obtaining comprises:
the obtaining sub-module is used for obtaining a data source of a second tree control, and the data source of the second tree control comprises sub-data sources of a plurality of control nodes of the second tree control;
the adding module is used for respectively adding a first attribute field to the sub data sources of the plurality of control nodes of the second tree control and adding an identifier of a third control node to the sub data source of the second control node to obtain the target data source;
the second control node is a control node including a father node in the plurality of control nodes, and the third control node is the father node included in the second control node.
9. The apparatus of claim 7, wherein the processing module comprises:
an output module, configured to set, when the first operation control is triggered, an edit attribute field in a first attribute field of a child data source of the first control node as a first target value if the first operation control is a newly added operation control or an edit operation control, and output an input box;
a receiving module, configured to receive content input in the input box;
and the first processing submodule is used for adding a child control node to the first control node or modifying the name of the first control node into the content based on the content to obtain the target tree control, wherein the name of the child control node is the content.
10. The apparatus of claim 7, wherein the processing module comprises:
and the deleting module is used for deleting the first control node in the first tree control to obtain the target tree control if the first operation control is the deleting operation control under the condition that the first operation control is triggered.
11. The apparatus of claim 7, wherein the first input comprises a drag input;
the processing module comprises:
the setting module is used for setting the states of the first control node and the child nodes of the first control node to be in a draggable state under the condition that a dragging input for the first control node is received;
and a dragging module, configured to, when the states of the first control node and the child node of the first control node are dragging-enabled states, drag the first control node and the child node of the first control node in the first tree control to a target position corresponding to the dragging input to obtain the target tree control, where the first control node is a child node or a sibling node of a target control node corresponding to the target position.
12. The apparatus of claim 7, wherein the first tree control is associated with a first information content;
the device further comprises:
and the adjusting module is used for adjusting the first information content based on the target tree control to obtain target information content.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the tree control processing method of any of claims 1-6.
14. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the tree control processing method of any of claims 1-6.
15. A computer program product comprising a computer program which, when being executed by a processor, carries out the tree control handling method according to any one of claims 1-6.
CN202110968078.2A 2021-08-23 2021-08-23 Tree control processing method and device and electronic equipment Pending CN113656533A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110968078.2A CN113656533A (en) 2021-08-23 2021-08-23 Tree control processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110968078.2A CN113656533A (en) 2021-08-23 2021-08-23 Tree control processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN113656533A true CN113656533A (en) 2021-11-16

Family

ID=78491995

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110968078.2A Pending CN113656533A (en) 2021-08-23 2021-08-23 Tree control processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113656533A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114130016A (en) * 2021-12-07 2022-03-04 腾讯科技(深圳)有限公司 Control resource management method and related device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101470727A (en) * 2007-12-24 2009-07-01 新奥特(北京)视频技术有限公司 Method and system for editing and processing tree-form data
CN102253940A (en) * 2010-05-18 2011-11-23 深圳市金蝶中间件有限公司 Method and device for processing data by tree view
CN102541544A (en) * 2011-12-20 2012-07-04 北京数码大方科技有限公司 Method, device and system for processing tree control
CN111782329A (en) * 2020-07-03 2020-10-16 北京字节跳动网络技术有限公司 Node dragging method, device, equipment and computer readable medium
CN113282799A (en) * 2021-05-21 2021-08-20 武汉联影医疗科技有限公司 Node operation method and device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101470727A (en) * 2007-12-24 2009-07-01 新奥特(北京)视频技术有限公司 Method and system for editing and processing tree-form data
CN102253940A (en) * 2010-05-18 2011-11-23 深圳市金蝶中间件有限公司 Method and device for processing data by tree view
CN102541544A (en) * 2011-12-20 2012-07-04 北京数码大方科技有限公司 Method, device and system for processing tree control
CN111782329A (en) * 2020-07-03 2020-10-16 北京字节跳动网络技术有限公司 Node dragging method, device, equipment and computer readable medium
CN113282799A (en) * 2021-05-21 2021-08-20 武汉联影医疗科技有限公司 Node operation method and device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114130016A (en) * 2021-12-07 2022-03-04 腾讯科技(深圳)有限公司 Control resource management method and related device
CN114130016B (en) * 2021-12-07 2023-07-14 腾讯科技(深圳)有限公司 Control resource management method and related device

Similar Documents

Publication Publication Date Title
US10152362B2 (en) Techniques to modify a document using a latent transfer surface
US9696972B2 (en) Method and apparatus for updating a web-based user interface
US9471213B2 (en) Chaining applications
US20150149951A1 (en) Live previews for multitasking and state management
CN113342345A (en) Operator fusion method and device of deep learning framework
CN112015468A (en) Interface document processing method and device, electronic equipment and storage medium
CN112947916B (en) Method, apparatus, device and storage medium for implementing online canvas
CN113836877A (en) Text labeling method, device, equipment and storage medium
CN113868273A (en) Metadata snapshot method and device
CN113656533A (en) Tree control processing method and device and electronic equipment
US20120216132A1 (en) Embedding User Selected Content In A Web Browser Display
CN116719456A (en) Icon style switching method and device, electronic equipment and storage medium
US20230177103A1 (en) Systems and methods for rendering interactive web pages
CN114489639A (en) File generation method, device, equipment and storage medium
CN110908550B (en) Operation processing method and device in cursor hovering state
CN113536755A (en) Method, device, electronic equipment, storage medium and product for generating poster
CN113138760A (en) Page generation method and device, electronic equipment and medium
CN113781608A (en) Animation editing method and device
CN114741072B (en) Page generation method, device, equipment and storage medium
CN113342413B (en) Method, apparatus, device, medium, and article for processing components
CN114398122B (en) Input method, input device, electronic equipment, storage medium and product
CN114327465A (en) Page component generation method and device, electronic equipment and storage medium
CN115481193A (en) Data visualization method, device, equipment and storage medium
CN115761093A (en) Rendering method, rendering device, electronic equipment and storage medium
CN115756457A (en) List item generation method, device, equipment and storage medium

Legal Events

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