A meter multifunction processing method, system, device and medium

CN121579083BActive Publication Date: 2026-09-29INSPUR YUNZHOU (SHANDONG) IND INTERNET CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511473848.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-15
Publication Date
2026-09-29
Estimated Expiration
2045-10-15

AI Technical Summary

Technical Problem

当表格列数超过10列时,这些额外预留的空间会显著压缩有效数据展示区域,极大地限制了表格在展示大量数据时的可用性和可读性

Benefits of technology

本申请提供的表头多功能处理方法、系统、设备及介质中,通过集成排序、筛选和自定义操作功能于表头,提升了表格组件的用户体验和界面简洁性;减少了用户操作区域的分散性,降低了用户认知负担,提高了界面简洁性;同时,通过坐标事件分流算法,精准区分排序点击与自定义操作,避免了事件冲突,提高了操作响应的准确性和稳定性。此外,通过防抖和节流机制,优化了事件响应,减少了不必要的操作和数据重绘,提升了表格的性能和响应速度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579083B_ABST
    Figure CN121579083B_ABST
Patent Text Reader

Abstract

The application provides a table header multifunction processing method, system, device and medium, belongs to the technical field of user interface design, and the method introduces an Ant Design Vue component library in a Vue project, creates a Vue page containing a Table component, initializes the Table component and a column configuration array columns, configures a sorting function and a custom slot for a target column, inserts custom content in the template of the Table component through the slot mechanism of Vue, obtains the click position through an event object when a user clicks a target table header area, triggers the built-in sorting logic of Vue if it is a text area, executes a sorting function to sort the table data of the target column, and calls a click event processing function if it is an icon area, and executes a custom target operation. The application integrates sorting, filtering and custom operation, optimizes space utilization, and improves performance and user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of user interface design technology, specifically relating to a multi-functional processing method, system, device, and medium for table headers. Background Technology

[0002] In the field of web development, table components, as core tools for displaying data, have a significant impact on user experience and interface simplicity due to their functional design. Existing web table components (such as Element UI and Bootstrap Table) typically suffer from the following shortcomings in their header functionality. For example, Element UI, Bootstrap Table, and Ant Design Vue all exhibit the following common defects in their header design that urgently need to be addressed: First, in traditional table components, sorting operations typically require users to click on the header text area, while filtering relies on a separate funnel icon or other dedicated filter buttons. This fragmented design forces users to click across different areas of the header when performing data sorting and filtering, significantly increasing their cognitive load. Second, to accommodate the operation icons required for sorting and filtering, each header needs to reserve additional display area. When the number of columns exceeds 10, this extra space significantly compresses the effective data display area, severely limiting the usability and readability of the table when displaying large amounts of data. Finally, existing table components cannot accurately distinguish between sorting clicks (text area) and custom operations (icon area) within the same header area, forcing developers to create complex event delegate logic. This not only increases development difficulty and maintenance costs but may also lead to delayed or unstable operation responses, impacting the user experience. Summary of the Invention

[0003] In a first aspect, embodiments of this application provide a multi-functional header processing method, comprising the following steps: S1. Import the Ant Design Vue component library into the Vue project, create a Vue page containing a Table component, and initialize the Table component and the column configuration array (columns); S2. Configure sorting functionality and custom slots for the target column of the Vue page: In the column description object of the column configuration array of the target column, set the sorter property to the sorting function to complete the sorting function configuration; In the column description object of the column configuration array columns of the target column, set the scopedSlots property to an object, customize the filter menu slot name and icon slot name, and complete the custom slot configuration; S3. Insert custom content into the Table component template using Vue's slot mechanism: Insert a custom filter component with input fields and action buttons, and associate the custom filter component with the filter menu slot name; Insert a custom icon, associate the custom icon with the icon slot name, and bind it to a click event handler function; the click event handler function is customized for the target operation. S4. When a user clicks on the header area of ​​the target list, the click location is obtained through the event object; If the clicked location is a text area, the built-in sorting logic of Ant Design Vue is triggered, and the sorting function is executed to sort the table data in the target column; If the clicked location is an icon area, the click event handler function is called to perform the custom target operation.

[0004] Furthermore, the specific steps of step S1 are as follows: S11. Create a Vue single-file component and import the CSS style file and JS module of Ant Design Vue; S12. Declare the table data source array dataSource in the data property of the Vue single-file component; S13. Initialize the column configuration array columns, and set the column title, data field dataIndex, and unique identifier key attribute for each column; S14. Insert into the template of the Table component <a-table>The component binds to the table data source array dataSource and the column configuration array columnns property.

[0005] Furthermore, the specific steps of step S2 are as follows: S21. Declare the sorting logic through the sorter attribute, and set sorting functions for numeric data columns, date data columns, and text data columns respectively; S22. Declare custom slots that include menu slot name, icon slot name, and data field name of the current column through the scopedSlots property.

[0006] Furthermore, the specific steps of step S3 are as follows: S31. In the template of the Table component, use Vue's slot syntax to insert a custom filter menu for each target column; the custom filter menu includes an input box and at least one action button, the input box is used to receive filter conditions input by the user, and the action button is used to trigger a filter or reset operation; S32. In the template of the Table component, use Vue's slot syntax to insert a custom icon for each target column, the custom icon being associated with an icon slot name defined in the column configuration array columns; S33. Bind the click event of the custom icon to a custom event handler function, which is used to perform custom operations related to the current column.

[0007] Furthermore, the customized operation includes the overall operation process of data extraction, data analysis, and data display.

[0008] Furthermore, the specific steps of step S4 are as follows: S41. When a user clicks on the header area, obtain the horizontal offset of the click position relative to the top left corner of the header element through the browser event object; S42. Calculate the width of the header text area, which is obtained by measuring the rendering width of the header title text and adding a preset inner margin compensation value; S43. Compare the horizontal offset with the width of the header text area; If the horizontal offset is less than or equal to the width of the text area, it is determined that the text area has been clicked, triggering the built-in sorting logic; If the horizontal offset is greater than the width of the text area, it is determined that the icon area has been clicked, and the custom event handler function is triggered.

[0009] Furthermore, it also includes optimizing processing steps: S5. Optimize event response: Add debouncing to the sorting click event of the header text area, and set the debouncing delay time to the first time period to prevent continuous clicks within the first time period from causing several sorting operations. Add debouncing to the input event of the input box in the filter menu, set the debouncing delay time to the second time period, and filter the data triggered by input within the second time period; The click event of the custom icon is kept responsive without adding debouncing.

[0010] Secondly, embodiments of this application also provide a header multi-functional processing system, including: The environment configuration module is used to import the Ant Design Vue component library into a Vue project, create a Vue page containing a Table component, and initialize the Table component and the column configuration array. The column configuration module is used to configure sorting functionality and custom slots for target columns in a Vue page: In the column description object of the column configuration array of the target column, set the sorter property to the sorting function to complete the sorting function configuration; In the column description object of the column configuration array columns of the target column, set the scopedSlots property to an object, customize the filter menu slot name and icon slot name, and complete the custom slot configuration; The slot rendering module is used to insert custom content into the template of the Table component via Vue's slot mechanism: Insert a custom filter component with input fields and action buttons, and associate the custom filter component with the filter menu slot name; Insert a custom icon, associate the custom icon with the icon slot name, and bind it to a click event handler function; the click event handler function is customized for the target operation. The event handling module is used to obtain the click location through the event object when the user clicks the header area of ​​the target list; If the clicked location is a text area, the built-in sorting logic of Ant Design Vue is triggered, and the sorting function is executed to sort the table data in the target column; If the clicked location is an icon area, the click event handler function is called to perform the custom target operation.

[0011] Thirdly, embodiments of this application also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the header multi-function processing method as described in the first aspect.

[0012] Fourthly, embodiments of this application also provide a storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the header multi-function processing method described in the first aspect.

[0013] As can be seen from the above technical solutions, this application has the following advantages: The multi-functional header processing method, system, device, and medium provided in this application improve the user experience and interface simplicity of table components by integrating sorting, filtering, and custom operation functions into the header; reduce the dispersion of user operation areas, lower the cognitive burden on users, and improve interface simplicity; simultaneously, through a coordinate event diversion algorithm, it accurately distinguishes between sorting clicks and custom operations, avoiding event conflicts and improving the accuracy and stability of operation response. Furthermore, through debouncing and throttling mechanisms, event response is optimized, unnecessary operations and data redrawing are reduced, and table performance and response speed are improved. Attached Figure Description

[0014] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a flowchart illustrating the multi-functional processing method for the header of the present invention.

[0016] Figure 2 This is a schematic diagram of the multi-functional processing system for the meter header of the present invention. Detailed Implementation

[0017] The various embodiments of this disclosure will be described more fully in the detailed steps of the header multi-functional processing method described below. This disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of this disclosure to the specific embodiments disclosed herein, but rather this disclosure should be understood to cover all adjustments, equivalents, and / or alternatives falling within the spirit and scope of the various embodiments of this disclosure.

[0018] For example, in web development, table components are important tools for data display, and their functional design directly affects user experience and interface simplicity. However, existing mainstream web table components (such as Element UI, BootstrapTable, and Ant Design Vue) have some common problems in the design of table header functionality that urgently need to be addressed: First, traditional table components typically bind sorting functionality to click events in the header text area, while filtering is triggered by separate funnel icons or other dedicated filter buttons. This fragmented design requires users to interact with different areas of the header, increasing cognitive load and operational complexity. Second, to accommodate the icons needed for sorting and filtering within the header, each header needs to reserve additional display area. When the table has many columns (e.g., more than 10), this extra space significantly compresses the display area for valid data, limiting usability and readability when displaying large amounts of data. Finally, existing table components cannot accurately distinguish between sorting clicks (text area) and custom actions (icon area) within the same header area. This forces developers to create complex event delegate logic to handle these events, increasing development difficulty and maintenance costs, and potentially leading to delayed or unstable response times, thus impacting user experience.

[0019] To address the aforementioned issues, this embodiment provides a multi-functional header processing method that integrates sorting, filtering, and customization functions into the header, reducing the dispersion of operation areas, lowering the cognitive burden on users, and improving the simplicity and ease of operation of the interface.

[0020] 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.

[0021] Please see Figure 1 The diagram shows a flowchart of a multi-functional header processing method in a specific embodiment. The method includes the following steps: S1. Import the Ant Design Vue component library into the Vue project, create a Vue page containing a Table component, and initialize the Table component and the column configuration array (columns); It should be noted that introducing the Ant Design Vue component library into the Vue project provides rich functionality and style support for the table component; creating a Vue page containing the Table component and initializing the Table component and the column configuration array provides the foundation for subsequent table header configuration; S2. Configure sorting functionality and custom slots for the target column of the Vue page: In the column description object of the column configuration array of the target column, set the sorter property to the sorting function to complete the sorting function configuration; In the column description object of the column configuration array columns of the target column, set the scopedSlots property to an object, customize the filter menu slot name and icon slot name, and complete the custom slot configuration; It should be noted that by setting the sorter property to a sorting function, the table columns can support sorting operations, which improves the data processing capabilities of the table; by setting the scopedSlots property, custom slots are configured for the table header, providing extensibility for subsequent custom operations. S3. Insert custom content into the Table component template using Vue's slot mechanism: Insert a custom filter component with input fields and action buttons, and associate the custom filter component with the filter menu slot name; Insert a custom icon, associate the custom icon with the icon slot name, and bind it to a click event handler function; the click event handler function is customized for the target operation. It should be noted that by inserting a custom filter component with input fields and operation buttons through Vue's slot mechanism, the filtering function is visualized, improving the convenience of user operation; by inserting a custom icon and binding it to a click event handler function, users can trigger custom operations by clicking the icon, enhancing the functionality of the table header. S4. When a user clicks on the header area of ​​the target list, the click location is obtained through the event object; If the clicked location is a text area, the built-in sorting logic of Ant Design Vue is triggered, and the sorting function is executed to sort the table data in the target column; If the clicked location is an icon area, call the click event handler function to execute the custom target operation; It should be noted that by obtaining the click location and comparing the coordinates, the system can accurately distinguish between sorting clicks and custom operations, avoiding event conflicts and improving the accuracy and stability of operation response.

[0022] This embodiment integrates sorting functionality and custom slots to enable multi-functional operations in the table header, reducing the dispersion of the user's operating area, lowering the user's cognitive burden, and improving the simplicity of the interface.

[0023] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, in order to fully illustrate the specific implementation process in this embodiment, another multi-functional header processing method is provided, which includes the following steps: S1. Import the Ant Design Vue component library into the Vue project, create a Vue page containing a Table component, and initialize the Table component and the column configuration array (columns); The specific steps of step S1 are as follows: S11. Create a Vue single-file component and import the CSS style file and JS module of Ant Design Vue; S12. Declare the table data source array dataSource in the data property of the Vue single-file component; S13. Initialize the column configuration array columns, and set the column title, data field dataIndex, and unique identifier key attribute for each column; S14. Insert into the template of the Table component <a-table>The component is bound to the table data source array dataSource and the column configuration array columns property; S2. Configure sorting functionality and custom slots for the target column of the Vue page: In the column description object of the column configuration array of the target column, set the sorter property to the sorting function to complete the sorting function configuration; In the column description object of the column configuration array columns of the target column, set the scopedSlots property to an object, customize the filter menu slot name and icon slot name, and complete the custom slot configuration; The specific steps of step S2 are as follows: S21. Declare the sorting logic using the `sorter` attribute, and set sorting functions for numeric, date, and text data columns respectively: Specifically, for columns of numeric data, set a sorting function: sorter:(a,b)=>a[dataIndex]-b[dataIndex] Set a sorting function for date data columns: sorter:(a,b)=>new Date(a[dataIndex])-new Date(b[dataIndex]) Set a sorting function for text data columns: sorter:(a,b)=>a[dataIndex].localeCompare(b[dataIndex]); S22. Declare custom slots containing menu slot names, icon slot names, and data field names of the current column using the scopedSlots property; S3. Insert custom content into the Table component template using Vue's slot mechanism: Insert a custom filter component with input fields and action buttons, and associate the custom filter component with the filter menu slot name; Insert a custom icon, associate the custom icon with the icon slot name, and bind it to a click event handler function; the click event handler function is customized for the target operation. The specific steps of step S3 are as follows: S31. In the template of the Table component, use Vue's slot syntax to insert a custom filter menu for each target column; the custom filter menu includes an input box and at least one action button, the input box is used to receive filter conditions input by the user, and the action button is used to trigger a filter or reset operation; S32. In the template of the Table component, use Vue's slot syntax to insert a custom icon for each target column, the custom icon being associated with an icon slot name defined in the column configuration array columns; S33. Bind the click event of the custom icon to a custom event handler function, wherein the custom event handler function is used to perform custom operations related to the current column; The customized operation includes the overall operation process of data extraction, data analysis, and data display; Specifically, data extraction involves extracting all data values ​​of the current column from the table data source, and then performing format conversion and cleaning according to the data type; Data analysis involves performing statistical calculations on numerical data, word frequency analysis on text data, and time distribution statistics on date data. The data visualization chart is generated by selecting the chart type based on the data type, generating chart configuration parameters, and then rendering the data visualization chart in the modal window. S4. When a user clicks on the header area of ​​the target list, the click location is obtained through the event object; If the clicked location is a text area, the built-in sorting logic of Ant Design Vue is triggered, and the sorting function is executed to sort the table data in the target column; If the clicked location is an icon area, call the click event handler function to execute the custom target operation; The specific steps of step S4 are as follows: S41. When a user clicks on the header area, obtain the horizontal offset of the click position relative to the top left corner of the header element through the browser event object; S42. Calculate the width of the header text area, which is obtained by measuring the rendering width of the header title text and adding a preset inner margin compensation value; S43. Compare the horizontal offset with the width of the header text area; If the horizontal offset is less than or equal to the width of the text area, it is determined that the text area has been clicked, triggering the built-in sorting logic; If the horizontal offset is greater than the width of the text area, it is determined that the icon area has been clicked, and the custom event handler function is triggered. It also includes optimizing processing steps: S5. Optimize event response: Add debouncing to the sorting click event of the header text area, and set the debouncing delay time to the first time period to prevent continuous clicks within the first time period from causing several sorting operations. Add debouncing to the input event of the input box in the filter menu, set the debouncing delay time to the second time period, and filter the data triggered by input within the second time period; The click event of the custom icon is kept responsive without adding debouncing.

[0024] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0025] like Figure 2 As shown, the following are embodiments of the header multi-function processing system provided in this disclosure. This system and the header multi-function processing methods in the above embodiments belong to the same inventive concept. For details not described in detail in the embodiments of the header multi-function processing system, please refer to the embodiments of the header multi-function processing methods described above.

[0026] The system includes: The environment configuration module is used to import the Ant Design Vue component library into a Vue project, create a Vue page containing a Table component, and initialize the Table component and the column configuration array. The column configuration module is used to configure sorting functionality and custom slots for target columns in a Vue page: In the column description object of the column configuration array of the target column, set the sorter property to the sorting function to complete the sorting function configuration; In the column description object of the column configuration array columns of the target column, set the scopedSlots property to an object, customize the filter menu slot name and icon slot name, and complete the custom slot configuration; The slot rendering module is used to insert custom content into the template of the Table component via Vue's slot mechanism: Insert a custom filter component with input fields and action buttons, and associate the custom filter component with the filter menu slot name; Insert a custom icon, associate the custom icon with the icon slot name, and bind it to a click event handler function; the click event handler function is customized for the target operation. The event handling module is used to obtain the click location through the event object when the user clicks the header area of ​​the target list; If the clicked location is a text area, the built-in sorting logic of Ant Design Vue is triggered, and the sorting function is executed to sort the table data in the target column; If the clicked location is an icon area, the click event handler function is called to perform the custom target operation.

[0027] This embodiment achieves this through the interactive collaboration of the environment configuration module, column configuration module, slot rendering module, and event handling module.

[0028] The header multi-functional processing method provided in this application embodiment can be applied to electronic devices. Those skilled in the art will understand that the electronic device structure involved in the embodiments of this invention does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. In the embodiments of this invention, the electronic device includes, but is not limited to, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of this application described and / or claimed herein.

[0029] Electronic devices may include processors, external memory interfaces, internal memory, universal serial bus (USB) interfaces, charging management modules, power management modules, batteries, wireless communication modules, audio modules, speakers, microphones, sensor modules, buttons, cameras, displays, and SIM card interfaces, etc.

[0030] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0031] A processor may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0032] The processor can serve as the nerve center and command center of an electronic device. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.

[0033] The processor may also include memory for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. This memory can store instructions or data that the processor has just used or that are used repeatedly. If the processor needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces processor latency, and thus improves system efficiency.

[0034] The aforementioned electronic device implements the multi-functional header processing method of this application by introducing the Ant DesignVue component library into a Vue project, creating a Vue page containing a Table component, and initializing the Table component and the column configuration array (columns); configuring sorting functionality and custom slots for the target column of the Vue page: setting the sorter property to the sorting function in the column description object of the column configuration array (columns) of the target column to complete the sorting function configuration; setting the scopedSlots property to an object in the column description object of the column configuration array (columns) of the target column to customize the filter menu slot name and icon slot name to complete the custom slot configuration; inserting custom content into the template of the Table component through Vue's slot mechanism: inserting a custom filter component with input boxes and operation buttons, and associating the custom filter component with the filter menu slot name; inserting a custom icon, associating the custom icon with the icon slot name, and binding it to a click event handling function; the click event handling function customizes the target operation; when the user clicks the header area of ​​the target column, the click position is obtained through the event object; if the click position is a text area, Ant Design is triggered. Vue's built-in sorting logic executes a sorting function to sort the table data in the target column; if the clicked location is an icon area, it calls a click event handler function to execute a custom target operation. This technical solution achieves the beneficial effects of integrating sorting, filtering, and custom operation functions into the table header, reducing the dispersion of operation areas, lowering the cognitive burden on users, and improving the simplicity of the interface.

[0035] The storage medium provided in this application stores a program product capable of implementing a multi-functional header processing method.

[0036] The multi-functional header processing method includes: importing the Ant Design Vue component library into the Vue project, creating a Vue page containing a Table component, and initializing the Table component and the column configuration array (columns); configuring sorting functionality and custom slots for the target column of the Vue page: setting the sorter property to the sorting function in the column description object of the target column's column configuration array (columns) to complete the sorting functionality configuration; setting the scopedSlots property to an object in the column description object of the target column's column configuration array (columns) to customize the filter menu slot name and icon slot name to complete the custom slot configuration; inserting custom content into the Table component template through Vue's slot mechanism: inserting a custom filter component with input boxes and operation buttons, and associating the custom filter component with the filter menu slot name; inserting a custom icon, associating the custom icon with the icon slot name, and binding it to a click event handler function; the click event handler function is customized for the target operation; when the user clicks the target column header area, the click position is obtained through the event object; if the click position is a text area, Ant Design is triggered. Vue's built-in sorting logic executes a sorting function to sort the table data in the target column; if the clicked location is an icon area, the click event handler function is called to execute the custom target operation.

[0037] In some possible implementations, the header multi-functional processing method of this disclosure can be implemented as a program product including program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section above according to various exemplary embodiments of this disclosure.

[0038] The storage medium disclosed herein may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0039] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A multi-functional processing method for meter headers, characterized in that, Includes the following steps: S1. Import the Ant Design Vue component library into the Vue project, create a Vue page containing a Table component, and initialize the Table component and the column configuration array (columns); S2. Configure sorting functionality and custom slots for the target column of the Vue page: In the column description object of the column configuration array of the target column, set the sorter property to the sorting function to complete the sorting function configuration; In the column description object of the column configuration array columns of the target column, set the scopedSlots property to an object, customize the filter menu slot name and icon slot name, and complete the custom slot configuration; S3. Insert custom content into the Table component template using Vue's slot mechanism: Insert a custom filter component with input fields and action buttons, and associate the custom filter component with the filter menu slot name; Insert a custom icon, associate the custom icon with the icon slot name, and bind it to a click event handler function; the click event handler function is customized for the target operation. S4. When a user clicks on the header area of ​​the target list, the click location is obtained through the event object; If the clicked location is a text area, the built-in sorting logic of Ant Design Vue is triggered, and the sorting function is executed to sort the table data in the target column; If the clicked location is an icon area, the click event handler function is called to perform the custom target operation.

2. The multi-functional processing method for the meter header according to claim 1, characterized in that, The specific steps of step S1 are as follows: S11. Create a Vue single-file component and import the CSS style file and JS module of Ant Design Vue; S12. Declare the table data source array dataSource in the data property of the Vue single-file component; S13. Initialize the column configuration array columns, and set the column title, data field dataIndex, and unique identifier key attribute for each column; S14. Insert into the template of the Table component <a-table> The component binds to the table data source array dataSource and the column configuration array columnns property.

3. The multi-functional processing method for the meter head according to claim 2, characterized in that, The specific steps of step S2 are as follows: S21. Declare the sorting logic through the sorter attribute, and set sorting functions for numeric data columns, date data columns, and text data columns respectively; S22. Declare custom slots that include the filter menu slot name, icon slot name, and data field name of the current column through the scopedSlots property.

4. The multi-functional processing method for the meter head according to claim 3, characterized in that, The specific steps of step S3 are as follows: S31. In the template of the Table component, use Vue's slot syntax to insert a custom filter menu for each target column; the custom filter menu includes an input box and at least one action button, the input box is used to receive filter conditions input by the user, and the action button is used to trigger a filter or reset operation; S32. In the template of the Table component, use Vue's slot syntax to insert a custom icon for each target column, the custom icon being associated with an icon slot name defined in the column configuration array columns; S33. Bind the click event of the custom icon to a custom event handler function, which is used to perform custom operations related to the current column.

5. The multi-functional processing method for the meter head according to claim 4, characterized in that, The customized operation includes the overall operation process of data extraction, data analysis, and data display.

6. The multi-functional processing method for the meter head according to claim 4, characterized in that, The specific steps of step S4 are as follows: S41. When a user clicks on the header area, obtain the horizontal offset of the click position relative to the top left corner of the header element through the browser event object; S42. Calculate the width of the header text area, which is obtained by measuring the rendering width of the header title text and adding a preset inner margin compensation value; S43. Compare the horizontal offset with the width of the header text area; If the horizontal offset is less than or equal to the width of the text area, it is determined that the text area has been clicked, triggering the built-in sorting logic; If the horizontal offset is greater than the width of the text area, it is determined that the icon area has been clicked, and the custom event handler function is triggered.

7. The multi-functional processing method for the meter head according to claim 6, characterized in that, It also includes optimizing processing steps: S5. Optimize event response: Add debouncing to the sorting click event of the header text area, and set the debouncing delay time to the first time period to prevent continuous clicks within the first time period from causing several sorting operations. Add debouncing to the input event of the input box in the filter menu, set the debouncing delay time to the second time period, and filter the data triggered by input within the second time period; The click event of the custom icon is kept responsive without adding debouncing.

8. A multi-functional processing system for meter heads, characterized in that, include: The environment configuration module is used to import the Ant Design Vue component library into a Vue project, create a Vue page containing a Table component, and initialize the Table component and the column configuration array. The column configuration module is used to configure sorting functionality and custom slots for target columns in a Vue page: In the column description object of the column configuration array of the target column, set the sorter property to the sorting function to complete the sorting function configuration; In the column description object of the column configuration array columns of the target column, set the scopedSlots property to an object, customize the filter menu slot name and icon slot name, and complete the custom slot configuration; The slot rendering module is used to insert custom content into the template of the Table component via Vue's slot mechanism: Insert a custom filter component with input fields and action buttons, and associate the custom filter component with the filter menu slot name; Insert a custom icon, associate the custom icon with the icon slot name, and bind it to a click event handler function; the click event handler function is customized for the target operation. The event handling module is used to obtain the click location through the event object when the user clicks the header area of ​​the target list; If the clicked location is a text area, the built-in sorting logic of Ant Design Vue is triggered, and the sorting function is executed to sort the table data in the target column; If the clicked location is an icon area, the click event handler function is called to perform the custom target operation.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the header multi-function processing method as described in any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the header multi-function processing method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Table data screening method and device based on Ant Design, medium and electronic equipment

    CN117055767A

  • Gauge head fixing method and device

    CN120688460A