@@ -439,13 +439,26 @@ export function createTable() {
439439 // }, 2000);
440440
441441 // 插件更新
442- // setTimeout(() => {
443- // console.log('update');
444- // tableInstance.updateOption({
445- // ...option,
446- // plugins: [filterPlugin]
447- // });
448- // }, 8000);
442+ setTimeout ( ( ) => {
443+ console . log ( 'update' ) ;
444+ // tableInstance.updateOption({
445+ // ...option,
446+ // plugins: [filterPlugin]
447+ // });
448+ filterPlugin . updatePluginOptions ( {
449+ ...getTableFilterPluginAttrFromProps ( ) ,
450+ filterIcon : {
451+ name : 'filter-icon' ,
452+ type : 'svg' ,
453+ width : 120 ,
454+ height : 120 ,
455+ positionType : VTable . TYPES . IconPosition . right ,
456+ cursor : 'pointer' ,
457+ marginRight : 4 ,
458+ svg : `<svg t="1752821809070" class="icon" viewBox="0 0 1664 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12092" width="200" height="200" transform="translate(0,30)"><path d="M89.6 179.2A89.6 89.6 0 0 1 89.6 0h1408a89.6 89.6 0 0 1 0 179.2H89.6z m256 384a89.6 89.6 0 0 1 0-179.2h896a89.6 89.6 0 0 1 0 179.2h-896z m256 384a89.6 89.6 0 0 1 0-179.2h384a89.6 89.6 0 0 1 0 179.2h-384z" fill="red" p-id="12093"></path></svg>`
459+ }
460+ } ) ;
461+ } , 5000 ) ;
449462
450463 // 实例释放
451464 // setTimeout(() => {
@@ -464,4 +477,20 @@ export function createTable() {
464477 args [ 0 ] . event . preventDefault ( ) ;
465478 console . log ( 'icon_click' ) ;
466479 } ) ;
480+
481+ const HEADER_FILTER_HIGHLIGHT = 'header_filter_highlight' ;
482+ const HEADER_FILTER_DEFAULT = 'header_filter_default' ;
483+ tableInstance . registerCustomCellStyle ( HEADER_FILTER_HIGHLIGHT , {
484+ bgColor : 'red'
485+ } ) ;
486+ tableInstance . registerCustomCellStyle ( HEADER_FILTER_DEFAULT , {
487+ bgColor : 'blue'
488+ } ) ;
489+
490+ tableInstance . on ( 'filter_menu_show' , ( { col, row } ) => {
491+ tableInstance . arrangeCustomCellStyle ( { col, row } , HEADER_FILTER_HIGHLIGHT ) ;
492+ } ) ;
493+ tableInstance . on ( 'filter_menu_hide' , ( { col, row } ) => {
494+ tableInstance . arrangeCustomCellStyle ( { col, row } , HEADER_FILTER_DEFAULT ) ;
495+ } ) ;
467496}
0 commit comments