Hierarchical-aware row selection linkage method and system based on flat ordered list
Patent Information
- Application Number
- CN202611544247.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-08
- Publication Date
- 2026-11-03
AI Technical Summary
Existing technologies for tree-structured data tables based on flat lists suffer from problems such as dependency on nested data structures, stack overflow risks caused by recursive traversal, and lack of reverse filtering capabilities. This results in additional data cleaning steps required in batch operation scenarios, and they cannot be directly applied to flat lists sorted by number.
By leveraging the ordered nature of flat lists and the numerical relationships of hierarchical fields, linear scanning logic is used to directly determine descendant intervals, achieving integrated row selection linkage between forward disabling and reverse filtering. This avoids recursive traversal and auxiliary indexes, ensuring that the parent-child sets of batch operation objects are mutually exclusive and have no duplicates.
It reduces system complexity and maintenance costs, ensures interactive performance and business accuracy under massive hierarchical data, and is suitable for batch operation scenarios in enterprise-level information systems.
Smart Images

Figure CN123030610A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of data processing and user interface interaction technology, and in particular to a hierarchical awareness row selection linkage method and system based on a flat ordered list. Background Technology
[0002] In graphical user interfaces, displaying hierarchical data in tabular form and providing users with row selection capabilities is a common requirement for enterprise-level information systems. Taking the checklist in Product Data Management (PDM) and Quality Management System (QMS) as examples, checklists are typically organized according to a chapter-item-sub-item hierarchical structure and stored in a flat list format sorted by number. The front end renders this as an expandable tree table using the hierarchy field of each row. In this interactive scenario, when a user performs batch operations such as deletion, moving, and exporting on a group of rows (parent nodes), the cascading effect on all descendant rows under that group must be achieved. Therefore, when a user selects a parent node, all its descendant nodes should be automatically disabled (i.e., unselectable) to prevent the same operation from being repeatedly applied to the parent-child hierarchy; that is, the forward disabling rule must be met. When a parent node is unselected, its descendant nodes should be restored to an interactive state; that is, the reverse restoration rule must be met. In addition, when a user selects a batch of nodes, if the parent node and several of its descendant nodes are selected simultaneously, the system should automatically filter out the descendant nodes covered by the parent node before submission to ensure that there are no duplicate parent-child items in the set of operation objects; that is, the pre-submission filtering rule must be met.
[0003] Existing technologies offer three main solutions to address the aforementioned needs: First, a recursive traversal scheme based on a nested tree structure, starting from the selected parent node and recursively traversing its child node array to collect all descendant node identifiers; second, a parent node index scheme, which pre-constructs a parent node identifier-child node list index table, and when selected, uses this index to find the child node and then recursively finds the descendant node; third, directly utilizing the tree-shaped checkbox cascading capability built into the component library, which also requires the data to be organized in the form of a nested child node array.
[0004] However, all of the aforementioned existing technologies have varying degrees of drawbacks. Schemes 1 and 3 are rigidly dependent on the data structure, requiring the data to be organized as nested arrays of child nodes. They are not directly applicable when the data itself is a flat list sorted by number. Even converting the flat data into a nested structure introduces additional data preprocessing overhead and structure maintenance costs. While Scheme 2 is applicable to flat lists, each data update requires rebuilding the index, resulting in significant performance overhead in scenarios with frequent data changes. More critically, the recursive traversal strategy used in Scheme 1 carries the risk of stack overflow when the hierarchy depth is large, and each change in selected state requires re-execution of the recursion, causing computational costs to increase linearly with the data size.
[0005] Furthermore, the functional coverage of the above solutions is incomplete. Most of them only implement a one-way logic of selecting or disabling descendant nodes after selecting the parent node. They lack the reverse processing capability of automatically filtering descendant nodes that have been covered by the parent node when the selection changes. In other words, they lack reverse redundancy filtering capability, which means that additional data cleaning steps are still required in batch operation scenarios.
[0006] In summary, there is an urgent need for a row selection linkage scheme that can be directly based on a flat list data structure, without the need for auxiliary indexes or structure transformations, and can fully cover the dual linkage logic of forward disabling and reverse filtering.
[0007] Based on this, the present invention is proposed. Summary of the Invention
[0008] To address the technical problems of existing tree-structured data table row selection linkage schemes, such as reliance on nested data structures, the need to build auxiliary indexes, stack overflow risks from recursive traversal, and lack of reverse filtering capabilities, this invention provides a hierarchical-aware row selection linkage method and system based on a flat ordered list. By utilizing the inherent order of the flat list and the numerical relationship of the hierarchical fields, the descendant interval is directly determined, replacing recursive traversal with linear scanning. Furthermore, forward disabling control and reverse redundancy filtering share the same set of linear scanning logic, achieving row selection linkage with zero auxiliary structures, no recursion, and integrated forward disabling and reverse filtering. This ensures that the batch operation object set is always mutually exclusive between parent and child, clean, and free of duplication and redundancy, thereby effectively reducing system complexity and maintenance costs while guaranteeing the performance and business accuracy of interactions under massive hierarchical data.
[0009] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides a hierarchical row selection linkage method based on a flat ordered list in a first aspect, comprising: acquiring flat list data and a set of currently selected row identifiers, wherein each row in the flat list data is arranged in an order that makes all descendants of the same parent node form a continuous interval in the list, and each row contains at least a row identifier and a hierarchy field, wherein the hierarchy field is used to characterize the hierarchy depth of the row in the tree hierarchy structure; and, based on the set of currently selected row identifiers and the flat list data, setting linear scanning logic based on the order of rows in the list and the relative size relationship of hierarchy values between adjacent rows, performing a linear scanning operation on each selected row in the set of currently selected row identifiers. The linear scanning logic is used to determine the range of descendant rows for each selected row, and the descendant row identifiers of all selected rows are aggregated into a set of disabled row identifiers. The set of disabled row identifiers is output to the row selection rendering control interface so that the rows in the set of disabled row identifiers are rendered as non-interactive in the user interface. In response to a user-executed selection state change operation, the new set of selected row identifiers is obtained, the range of descendant rows for each selected row in the new set of selected row identifiers is determined using the linear scanning logic, the descendant row identifiers covered by any selected row are filtered and removed from the new set of selected row identifiers, and the filtered set of row identifiers is output as the final selection result.
[0010] The present invention provides a preferred embodiment in a first aspect, wherein the rows in the flat list data are arranged in such an order that all descendants of the same parent node form a continuous interval in the list. Specifically, the rows in the flat list data are sorted by business hierarchy number, wherein the business hierarchy number consists of several hierarchical segments connected by separators, and all descendant nodes under the same parent node form a continuous interval in the list after being sorted by the number.
[0011] This preferred solution clarifies the specific implementation of the data premise of sequential arrangement, namely, hierarchical numbering and sorting based on business levels. This sorting rule directly guarantees the validity of the positional and range properties, providing a deterministic data foundation for the correctness of subsequent downward scanning logic. This ensures that the scope of application of the invention aligns with the actual business characteristics of the data source, enhancing the feasibility of the solution.
[0012] The present invention provides a preferred embodiment in a first aspect, wherein the linear scanning logic is a downward scanning logic; the step of setting the linear scanning logic based on the current selected row identifier set and the flat list data, based on the order of rows in the list and the relative size relationship of the level values between adjacent rows, and executing the linear scanning logic on each selected row in the current selected row identifier set to determine the range of descendant rows for each selected row, specifically includes: traversing the flat list data; for the currently traversed selected row, if the row does not have an adjacent next row in the flat list, or the level value of the adjacent next row is not greater than the level value of the row, then the row is determined to be a non-parent node, and the descendant range determination operation is not performed on the row; if the level value of the adjacent next row is greater than the level value of the row, then the row is determined to be a parent node, and the row is used as the starting reference row, and the scan continues downward along the order of the flat list data starting from the next row of the row, including rows with level values greater than the level value of the row into the range of descendant rows of the row, until a row with a level value not greater than the level value of the row is encountered or the end of the flat list is reached.
[0013] This preferred scheme determines the parent node by first checking if the next row of the target row exists and whether the level value of the next row is greater than that of the target row. Downward scanning is only performed when the target row is determined to be a parent node, avoiding meaningless processing of leaf rows. This two-stage design of determining the parent node first and then scanning effectively reduces unnecessary computation and improves algorithm efficiency. It also clearly defines the termination conditions for the scan: encountering a row whose level value is not greater than that of the reference row or reaching the end of the list, making the boundaries of the scanning process clear and predictable.
[0014] In a first aspect, the present invention provides a preferred solution in which, during the process of performing downward scanning logic to determine the range of descendant rows, each row is visited at most once in a single scan, and the scan terminates immediately when it encounters a row whose level value is not greater than the level value of the reference row, without repeatedly traversing rows that have been confirmed not to belong to the descendant range of the current reference row.
[0015] This preferred scheme ensures the linear efficiency of downward scanning from two dimensions: the number of accesses in the scanning process and the termination time. Each row will not be repeatedly traversed in the scanning of the same parent node. The setting of the termination condition ensures that the scan will not go beyond the boundary of the descendant interval of the current parent node, thereby avoiding unnecessary subsequent row accesses. This makes the computational cost of the scan strictly limited to the actual descendant size of the target row, and is independent of the total amount of data in the table.
[0016] The present invention provides a preferred solution in a first aspect, wherein the step of summarizing the descendant row identifiers of all selected rows into a set of disabled row identifiers specifically includes: adding all row identifiers within the range of descendant rows of each selected row to a hash set, wherein the hash set automatically performs deduplication of row identifiers and provides member existence determination in constant time.
[0017] This scheme utilizes the idempotent addition property of hash sets to automatically merge duplicate entries caused by overlapping descendant ranges of multiple selected rows, eliminating the need to write additional deduplication logic during the scanning process. Furthermore, after the disabled set is generated, it needs to be called frequently during the rendering process of each row to determine whether the row is disabled. The constant-level member query of the hash set ensures that this high-frequency determination will not become a bottleneck for rendering performance, avoiding the query latency that grows linearly with the size of the set caused by array traversal.
[0018] The present invention provides a preferred embodiment in a first aspect, wherein filtering and removing descendant row identifiers covered by any selected row from the newly selected row identifier set specifically includes: traversing the newly selected row identifier set; during the traversal, determining whether there is a row identifier belonging to the newly selected row identifier set within the range of descendant rows of each selected row; if so, marking the row identifier as an object to be filtered; after the traversal is completed, if there is a marked object to be filtered, removing the object to be filtered from the newly selected row identifier set; otherwise, directly using the newly selected row identifier set as the final selection result.
[0019] This scheme employs a two-stage design of marking first and then uniformly removing, which, compared to a scheme that deletes while scanning, avoids missed deletions due to changes in the intermediate state set when processing multiple selected rows with ancestor-grandchild relationships, thus ensuring the correctness of the reverse filtering logic. Furthermore, the decision to remove only when an object to be filtered exists avoids unnecessary array reconstruction when filtering is not required, ensuring that the execution overhead of the filtering operation matches the actual needs.
[0020] In a first aspect, the present invention provides a preferred solution in which the determination of the set of disabled row identifiers is bound to the set of currently selected row identifiers and the flat list data, and a re-determination is triggered only when the set of currently selected row identifiers or the flat list data changes.
[0021] Through the aforementioned binding and triggering mechanism, this scheme incorporates the entire computation process of the disabled set into a dependency-driven memoized computation framework, avoiding invalid and repetitive computations when dependencies have not changed, reducing the computation frequency of the disabled set to the theoretical minimum, and further optimizing overall performance.
[0022] In a first aspect, the present invention provides a preferred solution in which, when a user deselects any parent node, the set of disabled row identifiers is re-determined based on the changed set of selected row identifiers, the descendant row identifiers of the parent node are automatically removed from the set of disabled row identifiers, and the corresponding row is synchronously restored to an interactive state in the user interface.
[0023] This solution provides a mechanism for automatically restoring descendant rows after a parent node is unchecked. This restoration effect is not achieved through independently written restoration logic, but rather is an inherent result derived from the design approach of using the disabled set as a derivative of the currently selected set and the data source. When a parent node is unchecked, it no longer serves as the trigger source for scanning, and its descendant rows are naturally no longer included in the recalculated disabled set. The interface state is updated synchronously, requiring no additional state maintenance or restoration logic, thus unifying positive disabling and unchecking restoration in the computational chain.
[0024] The present invention provides a preferred solution in a first aspect, wherein the row selection rendering control interface is a row disable judgment callback interface provided by a general table component; the step of outputting the set of disabled row identifiers to the row selection rendering control interface specifically involves: in the row disable judgment callback, querying the set of disabled row identifiers with the row identifier of the current row to be rendered; if it exists, returning a disable indication; if it does not exist, returning an availability indication; the set of disabled row identifiers is passed to the callback in the form of interface parameters.
[0025] This solution enables standardized integration between the present invention and the existing capabilities of general table components. Data is passed only through the callback interface provided by the component, without involving any modification to the internal logic of the table component or relying on the private API of a specific component library. This ensures the broad adaptability of the present invention to different table components and reduces the integration cost of the solution.
[0026] The present invention provides a hierarchical row selection linkage system based on a flat ordered list for executing the method, comprising: a flat ordered list acquisition module for acquiring flat list data and a set of currently selected row identifiers, wherein each row in the flat list data is arranged in an order that makes all descendants of the same parent node form a continuous interval in the list, and each row contains at least a row identifier and a hierarchy field, wherein the hierarchy field is used to characterize the hierarchy depth of the row in the tree hierarchy structure; and a descendant determination and disabling module for setting linear scanning logic based on the current selected row identifier set and the flat list data, based on the order of the rows in the list and the relative size relationship of the hierarchy values between adjacent rows, and performing a linear scanning on each row in the current selected row identifier set. A linear scan logic is executed on a selected row to determine the range of descendant rows for each selected row, and the descendant row identifiers of all selected rows are aggregated into a set of disabled row identifiers. The row selection rendering control module is used to output the set of disabled row identifiers to the row selection rendering control interface so that the rows in the set of disabled row identifiers are presented as non-interactive in the user interface. The selection change filtering module is used to respond to the user's selection state change operation, obtain the new set of selected row identifiers after the change, determine the range of descendant rows for each selected row in the new set of selected row identifiers using the linear scan logic, filter and remove descendant row identifiers covered by any selected row from the new set of selected row identifiers, and output the filtered set of row identifiers as the final selection result.
[0027] Compared with the prior art, the present invention can achieve the following beneficial technical effects: This invention first obtains a flat list of data as input, where each row is arranged in a sequence that ensures all descendants of the same parent node form a continuous interval in the list, and each row contains at least a row identifier and a hierarchy field. The range of descendant rows is determined based on the order of the rows in the list and the relative size of the hierarchy values between adjacent rows. This ensures that the determination of the descendant range relies entirely on the inherent order of the flat list and the numerical relationship of the hierarchy fields, without relying on any parent-child relationship fields, nested child node arrays, or pre-built auxiliary indexes. This allows for hierarchical awareness processing directly using the original flat storage form of the data, eliminating the dependence on nested data structures and index maintenance in existing technologies, and reducing the system's architectural complexity and storage overhead. Furthermore, the scanning logic employs a continuous downward traversal along the list order. Each row is accessed at most once in a single scan, stopping upon encountering a termination condition. This is a pure iterative operation without any recursive calls, thus eliminating the risk of stack overflow at any level depth. The scanning cost is linearly related to the actual descendant size of the target row and is independent of the total amount of data in the table, ensuring the algorithm's stable performance in deep-level and large-data-volume scenarios.
[0028] Secondly, this invention aggregates the descendant row identifiers of all selected rows obtained from the scan into a disabled row identifier set, and outputs it to the row selection rendering control interface to make the corresponding rows appear in an uninteractive state. This achieves positive interface control where descendant rows are automatically disabled after the parent node (parent row) is selected. Simultaneously, in response to each change in selection state, this scheme uses the same linear scanning logic to redetermine the range of descendant rows for each selected row in the new selection set, and filters out descendant row identifiers covered by any selected row. This allows positive disabling and reverse filtering to share the same linear scanning core, forming a complete closed loop at both the interface control and data cleaning levels. Since the disabled set is a dynamically calculated result derived in real time from the current selected row identifier set and the flat list data, when a user deselects a parent node, the descendant rows of that parent node are automatically removed from the disabled set and synchronously restored to an interactive state because the scan trigger source disappears, eliminating the need to write separate recovery logic for the deselection operation. Therefore, this invention achieves row selection linkage with zero auxiliary structure, no recursion, and integrated forward disabling and reverse filtering. While effectively reducing system complexity and maintenance costs, it ensures that the set of batch operation objects is always mutually exclusive between parent and child, clean and without duplication or redundancy, and guarantees the performance and business accuracy of interaction under massive hierarchical data. It can be applied to batch operation scenarios of check item lists in enterprise-level information systems such as product data management and quality management systems. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0030] Figure 1 This is a step diagram of the method provided in Embodiment 1 of the present invention; Figure 2 A system architecture diagram is provided for Embodiment 1 of the present invention; Figure 3 This is a diagram illustrating the specific implementation steps of determining the descendant range in step S2 of the method provided in Embodiment 1 of the present invention; Figure 4 This is a detailed process diagram illustrating the application of step S2 of the method provided in Embodiment 1 of the present invention to a real-world scenario. Figure 5 This is a diagram illustrating the specific implementation steps of the filtering and removal operation in step S4 of the method provided in Embodiment 1 of the present invention; Figure 6 This is a diagram illustrating the selection linkage process of the parent-child mutual exclusion selection model in step S2 of the method provided in Embodiment 1 of the present invention. Detailed Implementation
[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0032] Example 1 Please refer to Figure 1 This embodiment provides a hierarchical row selection linkage method based on a flat ordered list, which is mainly implemented through the following steps: S1. Obtain flat list data and the set of currently selected row identifiers. The rows in the flat list data are arranged in order so that all descendants under the same parent node form a continuous interval in the list. Each row contains at least a row identifier and a level field. The level field is used to characterize the level depth of the row in the tree hierarchy. S2. Based on the current selected row identifier set and the flat list data, set linear scanning logic based on the order of rows in the list and the relative size relationship of the hierarchical values between adjacent rows, execute the linear scanning logic for each selected row in the current selected row identifier set, determine the range of descendant rows of each selected row, and summarize the descendant row identifiers of all selected rows into a disabled row identifier set; S3. Output the set of disabled row identifiers to the row selection rendering control interface so that the rows in the set of disabled row identifiers are rendered as non-interactive in the user interface; S4. In response to the user's selected state change operation, obtain the new selected row identifier set after the change, determine the range of descendant rows of each selected row in the new selected row identifier set using the linear scanning logic, filter and remove descendant row identifiers covered by any selected row from the new selected row identifier set, and output the filtered row identifier set as the final selection result.
[0033] Please refer to Figure 2 Corresponding to the above method, this embodiment provides a hierarchical awareness row selection linkage system based on a flat ordered list, used to execute steps S1 to S4 of the above method, mainly composed of the following modules: Flat ordered list acquisition module 1 is used to acquire flat list data and the set of currently selected row identifiers. The rows in the flat list data are arranged in order so that all descendants under the same parent node form a continuous interval in the list. Each row contains at least a row identifier and a level field. The level field is used to characterize the level depth of the row in the tree hierarchy. The descendant determination and disabling module 2 is used to set linear scanning logic based on the current selected row identifier set and the flat list data, based on the order of the rows in the list and the relative size relationship of the hierarchical values between adjacent rows, execute the linear scanning logic for each selected row in the current selected row identifier set, determine the range of descendant rows for each selected row, and summarize the descendant row identifiers of all selected rows into a disabled row identifier set. The row selection rendering control module 3 is used to output the set of disabled row identifiers to the row selection rendering control interface so that the rows in the set of disabled row identifiers are presented as non-interactive in the user interface. The selected change filtering module 4 is used to respond to the user's selected state change operation, obtain the new selected row identifier set after the change, determine the range of descendant rows of each selected row in the new selected row identifier set using the linear scanning logic, filter and remove descendant row identifiers covered by any selected row from the new selected row identifier set, and output the filtered row identifier set as the final selection result.
[0034] Below, this embodiment will use the batch operation scenario of the inspection item list in the product data management system as an application example to illustrate the specific implementation process of each step and functional module of the above-mentioned method and system.
[0035] S1. Obtain the flat list data and the set of currently selected row identifiers. The rows in the flat list data are arranged in order so that all descendants of the same parent node form a continuous interval in the list. Each row contains at least a row identifier and a hierarchy field, where the hierarchy field represents the row's depth within the tree structure. In an optional implementation, the rows in the flat list data are arranged in order so that all descendants of the same parent node form a continuous interval in the list. Specifically, the rows in the flat list data are sorted by business hierarchy number, which consists of several hierarchy segments connected by separators. All descendant nodes of the same parent node form a continuous interval in the list sorted by this number.
[0036] Specifically, the first step is to obtain the flat list data and the set of identifiers for the currently selected row. The rows in the flat list data are arranged in a sequence that ensures all descendants of the same parent node form a continuous interval in the list. Each row contains at least a row identifier and a hierarchy field. In this embodiment, the flat list data is sorted by business hierarchy numbering. This business hierarchy numbering consists of several hierarchy segments connected by separators, such as "1", "1.1", and "1.2.1". All descendant nodes of the same parent node form a continuous interval in the list sorted by this numbering. For example, the data for a certain checklist is as follows: Table 1: List of Inspection Items The currently selected row identifier set is {id_001}, meaning the user has checked "Chapter 1 General Rules". S2. Based on the currently selected row identifier set and the flat list data, set linear scanning logic based on the order of rows in the list and the relative size relationship of the hierarchical values between adjacent rows, execute the linear scanning logic for each selected row in the currently selected row identifier set, determine the range of descendant rows of each selected row, and summarize the descendant row identifiers of all selected rows into a disabled row identifier set.
[0037] Please refer to Figure 3 In step S2 of this embodiment, the linear scanning logic is a downward scanning logic. The linear scanning logic is set based on the current selected row identifier set and the flat list data, taking into account the order of rows in the list and the relative size of hierarchical values between adjacent rows. This linear scanning logic is then executed on each selected row in the current selected row identifier set to determine the range of descendant rows for each selected row. This is specifically achieved through the following steps: S21. Traverse the flat list data. For the currently traversed selected row, if the row does not have an adjacent next row in the flat list, or the level value of the adjacent next row is not greater than the level value of the row, then the row is determined to be a non-parent node, and the descendant range determination operation is not performed on the row. S22. If the level value of the next adjacent row is greater than the level value of the current row, then the current row is determined to be the parent node, and the current row is used as the starting reference row. Starting from the next row, the data in the flat list is continuously scanned downwards in order, and rows with a level value greater than the level value of the current row are included in the range of the child and grandchild rows of the current row, until a row with a level value not greater than the level value of the current row is encountered or the end of the flat list is reached.
[0038] More specifically, when a user selects certain rows, the entire data list is traversed once, and only the selected rows are scanned using the downward scanning logic: first, it is quickly determined whether the row is a parent node (checking whether the level value of the next row is greater than that of the current row; if not, the inner scan is skipped to avoid meaningless processing of leaf nodes); if it is determined to be a parent node, the scan starts from the next row and adds all consecutive rows with level values greater than that of the parent node to a disabled set; when a row with a level value not greater than that of the parent node is encountered, the scan is stopped immediately.
[0039] It is understandable that the method in this embodiment employs a downward scanning logic. The principle is as follows: In a flat list sorted by number, all descendant nodes of a given row must satisfy the following conditions: they are located after that row; their level value is greater than the level value of that row; and these descendant rows are consecutive in the array until a row with a level value no greater than the level value of that row is encountered. Therefore, to determine all descendant nodes of a given row, it is only necessary to start from the next row and continuously scan rows with level values greater than the level value of that row, without requiring any parent-child relationship fields or nested structures. Simply put, in a sequentially arranged flat list, all descendants of a node must be a continuous interval immediately following it with a level value greater than it; therefore, it is only necessary to scan backwards from the next row until a row with a level value no greater than its is encountered, without recursive drill-down or the construction of any tree structure. Therefore, using the method provided in this embodiment to determine the range (interval) of descendant rows is essentially a local scan, the cost of which is related to the size of the subtree but not to the size of the entire table or the nesting depth.
[0040] Furthermore, in a preferred embodiment, during the downward scan logic to determine the descendant row range, each row is accessed at most once in a single scan. The scan terminates immediately when it encounters a row whose level value is not greater than the level value of the reference row, and rows that have been confirmed not to belong to the descendant range of the current reference row are not traversed repeatedly. The linear efficiency of the downward scan is guaranteed from two dimensions: the number of accesses in the scan process and the termination timing. Each row will not be traversed multiple times in the scan of the same parent node. The termination condition ensures that the scan will not exceed the boundary of the descendant interval of the current parent node, thereby avoiding unnecessary subsequent row accesses. This strictly limits the computational cost of the scan to the actual descendant size of the target row, regardless of the total amount of data in the table.
[0041] Please refer to Figure 4 More specifically, in the actual scenario applied in this embodiment, the specific process of step S2 is as follows: Traverse each row identifier in the currently selected row identifier set {id_001}. For the currently traversed target row id_001 (level value 0), the system first checks whether its next row exists: The next row's id_002 has a level value of 1, which is greater than the target row's level value of 0. Therefore, id_001 is determined to be the parent node.
[0042] After determining that it is the parent node, the system uses id_001 as the starting reference row and begins scanning downwards along the order of the flat list data from the next row (i.e., id_002): Scan id_002: Level value 1>0, it is included in the descendant row range of id_001 and added to the disabled set; Scan ID_003: Level value 1 > 0, falls into the descendant row range, and is added to the disabled set; Scan ID_004: Level value 2 > 0, falls into the descendant row range, and is added to the disabled set; Scan ID_005: Level value 2 > 0, falls into the descendant row range, and is added to the disabled set; Scan ID_006: Level value 1 > 0, falls into the descendant row range, and is added to the disabled set; Scan ID_007: Level value 0 > 0? No (0 is not greater than 0), stop scanning.
[0043] After the scan is complete, the range of descendant rows of id_001 is determined to be {id_002, id_003, id_004, id_005, id_006}.
[0044] Add all row identifiers within this range to the set of disabled row identifiers.
[0045] Therefore, the set of disabled row identifiers is {id_002, id_003, id_004, id_005, id_006}.
[0046] It should be noted that the values of the hierarchy field are not required to be consecutive or start from zero. The method in this embodiment only uses relative size comparisons of "greater than" and "not greater than" and does not involve the calculation of hierarchy differences. For example, if the hierarchy value is a jump value such as 0, 2, 5, the judgment logic is still correct.
[0047] Furthermore, in this embodiment, the disabled set is implemented using a HashSet data structure. Specifically, in step S2 of this embodiment, the aggregation of the descendant row identifiers of all selected rows into a disabled row identifier set is achieved as follows: all row identifiers within the descendant row range of each selected row are added to a hash set, which automatically performs row identifier deduplication and provides member existence determination in constant time. The use of a hashSet data structure for the disabled set has the following advantages: (1) Natural deduplication, no additional deduplication code required. Considering that multiple selected rows have a grandparent-grandchild relationship, to avoid the problem of overlapping ranges, that is, when the descendant ranges of multiple selected parent nodes overlap, no duplicate entries will be generated. For example, if a parent row and its child row are selected at the same time, the outer traversal will perform a downward scan on the parent row and the child row respectively. The scan range of the parent row covers all its descendants, including the descendants of the child row. The scan range of the child row is its own descendants, which are completely contained by the former. Thus, the same descendant row identifier will be added once in each of the two scans. Duplicate entries refer to the same row identifier being added to the set multiple times. Since the addition operation of the hash set is idempotent, that is, adding the same element repeatedly will not generate a second record. Such overlaps are automatically merged, and the final result is a set without duplicate identifiers. There is no need to write additional deduplication logic to check whether it already exists before adding during the scanning process, nor is it necessary to perform deduplication again afterward.
[0048] (2) The time taken for determining whether a row is disabled is independent of the size of the collection. After disabling collection output, the table component will call the function once for each row during rendering to determine whether the row is disabled, which is a high-frequency call. The member determination of the hash collection takes constant time and does not slow down as the number of existing identifiers in the collection increases; if an array is used in conjunction with a lookup method that compares each identifier one by one, the time taken for a single determination will be proportional to the size of the collection, which will accumulate into a noticeable rendering delay when there are many rows. Therefore, a constant time is used so that this high-frequency determination will not become a bottleneck for rendering performance.
[0049] S3. Output the set of disabled line identifiers to the line selection rendering control interface so that the lines in the set of disabled line identifiers are rendered as non-interactive in the user interface.
[0050] In a preferred embodiment, the row selection rendering control interface is a row disable judgment callback interface provided by a general table component; the step of outputting the set of disabled row identifiers to the row selection rendering control interface specifically involves: outputting the set of disabled row identifiers to the row selection rendering control interface. The row selection rendering control interface is a row disable judgment callback interface provided by a general table component. In the row disable judgment callback, the set of disabled row identifiers is queried using the row identifier of the current row to be rendered. If the row identifier exists in the disabled collection, a disabled indication (true) is returned, and the selection control for that row is rendered as gray and uninteractive. If it does not exist, an availability indicator (false) is returned, and the selection control for that row remains interactive.
[0051] The set of disabled row identifiers is passed to the callback as an interface parameter, without requiring any modification to the table component itself.
[0052] More specifically, in the actual scenario applied in this embodiment, the selection controls for the five rows from id_002 to id_006 are rendered as non-interactive, preventing users from selecting descendant rows already covered by the parent node "Chapter 1". On the user interface, "Chapter 1" is checked, and although all its descendant rows are visible, the checkboxes are displayed as grayed-out disabled, ensuring a unique selection semantic and allowing users to intuitively see the coverage area.
[0053] Step S3 is introduced because: if descendant rows are only grayed out without disabling their selection boxes, users can still click them, creating a redundant semantic effect where the parent is selected and the child is selected individually; however, if descendant rows are directly removed from the list, users cannot see the covered area. Therefore, step S3 ensures that descendant rows remain visible but cannot be selected individually, maintaining a unique selection semantic and allowing users to intuitively see the covered area. Specifically, step S3 passes the disabled set calculated in the previous step to the row disable judgment function of the table component. The selection controls of rows in the disabled set are rendered as non-interactive, preventing users from selecting descendant rows that have been covered by their parent nodes.
[0054] S4. In response to the user's selected state change operation, obtain the new selected row identifier set after the change, determine the range of descendant rows of each selected row in the new selected row identifier set using the linear scanning logic, filter and remove descendant row identifiers covered by any selected row from the new selected row identifier set, and output the filtered row identifier set as the final selection result.
[0055] In a preferred embodiment, the determination of the disabled row identifier set is bound to the currently selected row identifier set and the flat list data, and a re-determination is triggered only when the currently selected row identifier set or the flat list data changes.
[0056] In a preferred embodiment, when a user deselects any parent node, the set of disabled row identifiers is redefined based on the changed set of selected row identifiers. The descendant row identifiers of that parent node are automatically removed from the set of disabled row identifiers, and the corresponding row is synchronously restored to an interactive state in the user interface. This approach ensures linear efficiency of the downward scan by considering both the number of accesses during the scan process and the termination timing. Each row is not repeatedly traversed within the same parent node's scan. The termination condition ensures that the scan does not exceed the descendant range boundary of the current parent node, thus avoiding unnecessary subsequent row accesses. This strictly limits the computational cost of the scan to the actual descendant size of the target row, independent of the total amount of data in the table.
[0057] In a preferred embodiment, when a user triggers a check or decheck operation, the same downward scanning logic as in step S2 is performed on the changed set of newly selected identifiers to calculate all descendant row identifiers that are covered by a certain selected parent node; the filtering operation is performed on the newly selected list only when there are descendant identifiers that actually need to be filtered, to avoid unnecessary array reconstruction when filtering is not required, and these descendant identifiers are removed from the newly selected list and stored as the final selected state.
[0058] Step S4 is introduced to account for the possibility that a user might first select several descendant nodes and then select their parent node. If this is not cleared, the selected set will contain both parent and child nodes, resulting in duplicates when submitted to the backend. Therefore, step S4 ensures that no item in the selected set is listed simultaneously with its ancestor. This invariant is restored immediately after each selection change, rather than relying on the user to cancel it manually.
[0059] Please refer to Figure 5 Specifically, in step S4, the filtering and removal of descendant row identifiers covered by any selected row from the newly selected row identifier set, i.e., the filtering and removal operation, is implemented through the following sub-steps: S41. Traverse the newly selected row identifier set. During the traversal, determine whether there is a row identifier belonging to the newly selected row identifier set within the range of the descendant rows of each selected row. If there is, mark the row identifier as an object to be filtered. S42. After the traversal is completed, if there are marked objects to be filtered, remove the objects to be filtered from the set of newly selected row identifiers; otherwise, use the set of newly selected row identifiers as the final selection result.
[0060] In this preferred embodiment, the disabled set is bound to the currently selected identifier set and the data source through a reactive caching mechanism (specifically, a driver-dependent memoized calculation), and is recalculated only when the two change; when the user unchecks a parent node, the descendant identifiers corresponding to that parent node automatically disappear from the disabled set, and the selection control of the descendant row automatically returns to an interactive state. This recovery process reuses the same calculation chain as when it was checked, and no additional recovery logic needs to be written.
[0061] It's understandable that the cache here isn't a traditional cache with an expiration date and requiring active invalidation management (such as TTL cache or LRU cache), but rather a memoized computation capability provided by the front-end framework: it has only two dependencies—the currently selected identifier set and a flat, ordered list data source; and it has no expiration date, nor does it require any manual invalidation calls. The framework compares these two dependencies during each rendering; if both remain unchanged, it directly reuses the previous calculation result; any change immediately triggers a complete recalculation. Therefore, there are no issues like cache expiration or inconsistencies between the cache and the data source. A change in the data source changes the dependencies, inevitably requiring a recalculation. The entire disabled set is memoized as a whole, rather than caching each descendant set separately for each parent node. Furthermore, a complete scan of the entire list is re-performed whenever a dependency changes; no sharding or incremental updates are performed for extremely large datasets. The overall complexity of this embodiment is linear, and the overhead of this full recalculation is acceptable given the data scale of actual business applications.
[0062] It should be noted that regarding the method of passing the disabled collection to the table component, the calculation and passing of the disabled collection are entirely synchronous and completed in the same rendering, without any asynchronous intermediate steps. The table component retrieves this collection through a row disabled judgment callback. This callback takes a single row record object as its only input parameter and returns a boolean value indicating whether the row is disabled. In this embodiment, the method queries the disabled collection using the row identifier and returns the judgment result within this callback. This callback is an existing row selection configuration item in general table components, and this embodiment does not modify the table component itself. If a table component does not provide a row-level disabled configuration item, an equivalent method can be used to achieve the same effect, such as rendering it as non-interactive after judging it according to the same collection in the rendering wrapper of the selection control, or rejecting the identifier falling into the disabled collection in the selection change callback. The scanning and collection calculation parts of this embodiment are not affected.
[0063] Furthermore, the timing for filtering and removing descendant row identifiers covered by any selected row from the newly selected row identifier set can be either executed immediately after each selection status change, or delayed until before batch operation submission. In the latter case, the current selected identifier set at the time of submission is used as the new selected row identifier set for the filtering and removal operation. Extending the filtering trigger timing from immediate execution after each selection change to delayed execution until before batch submission provides a flexible option to reduce real-time computational load for high-frequency interaction or massive data scenarios.
[0064] Specifically, the timing of the selection filtering is not limited to synchronous execution with each selection change; it can also be delayed until a unified execution before batch submission, as long as the core principle of removing descendant identifiers covered by parent nodes from the submission results is still followed. Synchronous execution (currently used in this embodiment) specifically involves filtering and writing back the selected state immediately after each check / uncheck. Its advantage is that the selected state displayed on the interface is always consistent with the final submitted set, providing a WYSIWYG experience. The cost is that a scan is triggered for each selection change, but this scan has linear complexity, and the overhead is negligible for large datasets. Delayed execution (an equivalent alternative) specifically involves no filtering during the selection process, but only a unified execution before batch submission. Its advantage is zero scan overhead during selection changes, suitable for scenarios with extremely large data volumes or extremely frequent selection operations; the cost is that filtering occurs at the submission time, and the previously displayed selection set may contain descendant rows that will ultimately be removed.
[0065] More specifically, in the actual scenario where this embodiment is applied, the specific process of step S4 is as follows: Suppose the user first selects the descendant node id_002 ("1.1 Scope of Application"), and the newly selected set is {id_002}. Then the user selects the parent node id_001 ("Chapter 1 General Rules"), triggering a selection change process: The system iterates through the newly selected set {id_001, id_002}, determining the range of its descendant rows for each selected row: Processing id_001: Scan to determine its descendant row range as {id_002, id_003, id_004, id_005, id_006}, where id_002 belongs to the newly selected set, and mark id_002 as to be filtered; Processing id_002: id_002 is a leaf node (the level value of the next row id_003 is no greater than 1), and has no descendant rows.
[0066] After the traversal is complete, there is a marked object to be filtered, id_002. The system removes it from the newly selected set, and the final selection result is {id_001}. This filtering operation ensures that there are no duplicate parent-child items in the final submitted selection result.
[0067] The disabled set is bound to the currently selected set of identifiers and the data source through dependency-driven memoization, and is recalculated only when either changes. When the user deselects the parent node id_001, the disabled set is recalculated based on the changed selected set (empty set). The child and descendant row identifiers of this parent node are automatically removed from the disabled set, and the corresponding rows are synchronously restored to an interactive state in the user interface. This restoration process reuses the same computation chain as when the node was selected, eliminating the need for additional restoration logic.
[0068] Compared with existing technologies, the hierarchical awareness row selection linkage method and system based on a flat ordered list in this embodiment can achieve the following beneficial technical effects: 1. Zero auxiliary structure: This embodiment directly uses flat list data as the processing object, without the need to build auxiliary data structures such as nested child node arrays or parent node indices.
[0069] 2. No recursion, no stack overflow risk: The descendant range is determined through pure iterative downward scanning. Each row is visited at most once in a single scan, and the scan terminates immediately when it encounters a row whose level value is not greater than the level value of the reference row. There is no risk of recursive call stack overflow at any level depth.
[0070] 3. The disable check has constant time complexity: The disable set is implemented using a hash set, and the member existence check does not slow down as the size of the set increases, ensuring the performance of high-frequency rendering calls.
[0071] 4. Integrated forward disabling and reverse filtering: The automatic filtering and disabling set calculation when the selection changes share the same downward scanning logic (algorithm) core, achieving high reuse at the implementation level.
[0072] 5. Uncheck Auto Restore: Disables the collection from being a dynamic result derived in real time. After unchecking the parent node, the descendants will automatically restore to the selectable state, without the need to write additional restore logic.
[0073] Example 2 This embodiment uses a multi-level checklist in a quality management system (QMS) as an example to illustrate the specific implementation process of the present invention in a complex scenario where multiple parent nodes are selected simultaneously and there is overlap in the range of descendants.
[0074] S1. Obtain flat list data and the set of currently selected row identifiers. The rows in the flat list data are arranged in order so that all descendants under the same parent node form a continuous interval in the list. Each row contains at least a row identifier and a level field. The level field is used to characterize the level depth of the row in the tree hierarchy.
[0075] In this embodiment, the following flat list data arranged in order is obtained: Table 2: Multi-level checklist list (flat list data) S2. Based on the currently selected row identifier set and the flat list data, set linear scanning logic based on the order of rows in the list and the relative size relationship of the hierarchical values between adjacent rows, execute the linear scanning logic for each selected row in the currently selected row identifier set, determine the range of descendant rows of each selected row, and summarize the descendant row identifiers of all selected rows into a disabled row identifier set.
[0076] Please refer to Figure 6 In this embodiment, the selection linkage process will be explained using a parent-child mutual exclusion selection model, that is, the specific process of step S2 will be further explained: The currently selected row identifier set is {A, C, E}, meaning the user has selected parent node A (Chapter 1), grandchild node C (1.1.1 grandchild item), and parent node E (Chapter 2).
[0077] In this embodiment, each row identifier in the currently selected row identifier set {A, C, E} is traversed: Process A (level value 0): The next row has a level value of B (1>0), so A is determined to be the parent node. Scan downwards from B: B (1>0) → C (2>0) → D (3>0), stop when encountering E (level 0, not greater than 0); The descendant rows of A are in the range {B, C, D}, and are added to the disabled set.
[0078] Processing C (level value 2): The next row's D has a level value of 3 > 2, so C is determined to be the parent node; Start scanning downwards from D: D (3>2), stop when encountering E (level 0, not greater than 2); The descendant row range of C is {D}, which is added to the disabled set. Since D was already added when processing A, the hash set automatically removes duplicates, and finally only one record of D is retained in the disabled set.
[0079] Processing E (level value 0): The next row has a level value of F (1>0), so E is determined to be the parent node; Start scanning downwards from F: F (1>0), stop when the end of the list is encountered; The descendant rows of E are in the range {F}, and are added to the disabled set.
[0080] The final set of disabled row identifiers is {B, C, D, F}.
[0081] This example illustrates a typical scenario of overlapping ranges: the descendant ranges {B, C, D} of A overlap with the descendant range {D} of C, and D is attempted to be added to the disabled set twice. Because a hash set is used, duplicate entries are automatically merged, eliminating the need for additional deduplication code.
[0082] S3. Output the set of disabled line identifiers to the line selection rendering control interface so that the lines in the set of disabled line identifiers are rendered as non-interactive in the user interface.
[0083] The disabled set {B, C, D, F} is output to the row selection rendering control interface. The selection controls for rows B, C, D, and F are rendered as non-interactive. It is worth noting that although row C is itself a row selected by the user (belonging to the currently selected set), its selection control is disabled because it is also a descendant of A. However, this does not affect C's existence in the selected set; step S4 will further handle this situation.
[0084] S4. In response to the user's selected state change operation, obtain the new selected row identifier set after the change, determine the range of descendant rows of each selected row in the new selected row identifier set using the linear scanning logic, filter and remove descendant row identifiers covered by any selected row from the new selected row identifier set, and output the filtered row identifier set as the final selection result.
[0085] Suppose the user subsequently selects item D (great-grandchild item), triggering a change in selection status. The system obtains the set of newly selected row identifiers {A, C, D, E} and uses the aforementioned scanning logic to determine the range of grandchild rows for each selected row: Process A: Descendant range {B, C, D}, where C and D belong to the newly selected set, mark C and D as to be filtered; Process C: Descendant range {D}, where D belongs to the newly selected set, mark D as to be filtered (already marked, no duplicates); Processing D: D is a leaf node with no descendant range; Process E: Descendant range {F}, F does not belong to the newly selected set, so do not mark it.
[0086] After the traversal is complete, there are marked objects C and D to be filtered. The system removes them from the newly selected set, and the final selection result is {A, E}.
[0087] This filtering logic ensures that the parent and child nodes within the set of batch operations are mutually exclusive. Since A has already covered C and D, and E has already covered F, the final operation objects are only the two parent nodes A and E, eliminating the uncertainty of the same row being repeatedly affected by parent and child operations.
[0088] Compared with the prior art, this embodiment can achieve the following beneficial technical effects: 1. Correct handling of overlapping intervals of multiple parent nodes: When there is a grandparent-grandchild relationship between multiple selected parent nodes (such as A and C), their respective downward scanning ranges have an inclusion relationship. The natural deduplication property of hash sets ensures that there are no duplicate entries in the disabled set.
[0089] 2. Parent-child mutual exclusion selection model: From the selection stage, it ensures that the parent and child are mutually exclusive within the action set, eliminating the uncertainty of the same row being repeatedly acted on by parent and child operations.
[0090] 3. Linear scan efficiency: Each selected row undergoes a downward linear scan, and each row is visited at most once in a single scan. The complexity of the entire calculation process is linearly related to the sum of the descendant ranges of each selected row, and is independent of the total number of rows in the flat list and the depth of the tree hierarchy.
[0091] 4. Disabling and filtering share the same algorithm core: The calculation of the disabling set (S2) and the filtering when the selection changes (S4) share the same downward scanning logic, which achieves high reuse at the implementation level and reduces code maintenance costs.
[0092] Example 3 This embodiment illustrates the applicability of the present invention when the hierarchical field is not limited to integer form. Any comparable type that can express a relative depth relationship can be equivalently replaced, and the judgment and scanning logic should be adjusted accordingly.
[0093] For example, hierarchy fields can be of string type, such as "root", "chapter", "section", and "subsection", with their order predefined: "root" < "chapter" < "section" < "subsection". When determining hierarchy based on the relative size of hierarchy values between adjacent rows, the system first converts the hierarchy field to a comparable numeric type (such as an enumeration value or a mapped value) before performing the comparison operation. The core downward scanning logic remains unchanged: starting from the row after the target row, it continuously scans downwards along the list order, including rows with hierarchy values greater than the target row's hierarchy value in the descendant row range, until it encounters a row with a hierarchy value no greater than the target row's hierarchy value or reaches the end of the list.
[0094] This embodiment shows that the scope of application of the present invention is not limited to the case where the level field is an integer. As long as the level value can reflect the relative depth relationship in the tree structure, the method of the present invention can be used to realize row selection linkage.
[0095] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0096] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. Furthermore, the above embodiments only illustrate several implementation methods of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. For those skilled in the art, several modifications and improvements can be made, and these all fall within the protection scope of the present invention.
Claims
1. A hierarchical row selection linkage method based on a flat ordered list, characterized in that, include: Get the flat list data and the set of currently selected row identifiers. The rows in the flat list data are arranged in order so that all the descendants of the same parent node form a continuous interval in the list. Each row contains at least a row identifier and a level field. The level field is used to characterize the level depth of the row in the tree structure. Based on the current selected row identifier set and the flat list data, a linear scanning logic is set based on the order of rows in the list and the relative size of the hierarchical values between adjacent rows. The linear scanning logic is executed on each selected row in the current selected row identifier set to determine the range of descendant rows of each selected row, and the descendant row identifiers of all selected rows are summarized into a disabled row identifier set. The set of disabled row identifiers is output to the row selection rendering control interface so that the rows in the set of disabled row identifiers are rendered as non-interactive in the user interface; In response to a user's selected state change operation, the system obtains a new set of selected row identifiers after the change, uses the linear scanning logic to determine the range of descendant rows for each selected row in the new set of selected row identifiers, filters and removes descendant row identifiers that are covered by any selected row from the new set of selected row identifiers, and outputs the filtered set of row identifiers as the final selection result.
2. The method according to claim 1, characterized in that, The rows in the flat list data are arranged in a way that makes all the descendants of the same parent node form a continuous interval in the list. Specifically, the rows in the flat list data are sorted by business hierarchy number, which consists of several hierarchical segments connected by separators. All the descendant nodes under the same parent node form a continuous interval in the list after being sorted by the number.
3. The method according to claim 1, characterized in that, The linear scanning logic is a downward scanning logic; the linear scanning logic is set based on the current selected row identifier set and the flat list data, according to the order of rows in the list and the relative size of the hierarchical values between adjacent rows. The linear scanning logic is executed on each selected row in the current selected row identifier set to determine the range of descendant rows for each selected row, specifically including: When traversing the flat list data, if the selected row currently being traversed does not have an adjacent next row in the flat list, or if the level value of the adjacent next row is not greater than the level value of the current row, then the row is determined to be a non-parent node, and the descendant range determination operation is not performed on the row. If the level value of the next adjacent row is greater than the level value of the current row, then the current row is determined to be the parent node. Starting from the next row, the system continuously scans downwards along the order of the flat list data, including rows whose level value is greater than the current row's level value as their children and grandchildren, until a row whose level value is not greater than the current row's level value is encountered or the end of the flat list is reached.
4. The method according to claim 3, characterized in that, During the process of executing the downward scan logic to determine the range of descendant rows, each row is visited at most once in a single scan. The scan terminates immediately when it encounters a row whose level value is not greater than the level value of the reference row, and rows that have been confirmed not to belong to the descendant range of the current reference row are not traversed repeatedly.
5. The method according to claim 1, characterized in that, The step of summarizing the descendant row identifiers of all selected rows into a set of disabled row identifiers specifically includes: adding all row identifiers within the range of descendant rows of each selected row to a hash set, whereby the hash set automatically performs row identifier deduplication and provides member existence determination in constant time.
6. The method according to claim 1, characterized in that, The step of filtering and removing descendant row identifiers covered by any selected row from the newly selected row identifier set specifically includes: The newly selected row identifier set is traversed. During the traversal, it is determined whether there is a row identifier belonging to the newly selected row identifier set within the range of the descendant rows of each selected row. If there is, the row identifier is marked as an object to be filtered. After the traversal is complete, if there are marked objects to be filtered, the objects to be filtered are removed from the newly selected row identifier set; otherwise, the newly selected row identifier set is used as the final selection result.
7. The method according to claim 1, characterized in that, The determination of the disabled row identifier set is bound to the currently selected row identifier set and the flat list data, and is only triggered to re-determine when the currently selected row identifier set or the flat list data changes.
8. The method according to claim 7, characterized in that, When a user deselects any parent node, the set of disabled row identifiers is redefined based on the changed set of selected row identifiers. The child row identifiers of the parent node are automatically removed from the set of disabled row identifiers, and the corresponding row is synchronously restored to an interactive state in the user interface.
9. The method according to claim 1, characterized in that, The row selection rendering control interface is a row disable judgment callback interface provided by the general table component; the step of outputting the disabled row identifier set to the row selection rendering control interface is as follows: in the row disable judgment callback, the disabled row identifier set is queried with the row identifier of the current row to be rendered. If it exists, a disable indication is returned; if it does not exist, an available indication is returned. The disabled row identifier set is passed to the callback in the form of interface parameters.
10. A hierarchical row selection linkage system based on a flat ordered list, used to execute the method described in any one of claims 1 to 9, characterized in that, include: The flat ordered list acquisition module is used to acquire flat list data and the set of currently selected row identifiers. The rows in the flat list data are arranged in order so that all descendants under the same parent node form a continuous interval in the list. Each row contains at least a row identifier and a level field. The level field is used to characterize the level depth of the row in the tree hierarchy. The descendant determination and disabling module is used to set linear scanning logic based on the current selected row identifier set and the flat list data, based on the order of the rows in the list and the relative size of the hierarchical values between adjacent rows, to execute the linear scanning logic on each selected row in the current selected row identifier set, determine the range of descendant rows for each selected row, and summarize the descendant row identifiers of all selected rows into a disabled row identifier set. The row selection rendering control module is used to output the set of disabled row identifiers to the row selection rendering control interface so that the rows in the set of disabled row identifiers are presented as non-interactive in the user interface. The selected change filtering module is used to respond to the user's selected state change operation, obtain the new selected row identifier set after the change, determine the range of descendant rows of each selected row in the new selected row identifier set using the linear scanning logic, filter and remove descendant row identifiers covered by any selected row from the new selected row identifier set, and output the filtered row identifier set as the final selection result.
