admin 发表于 2024-12-27 23:27:58

【平台组件】开窗复杂搜索栏位怎么自定义?

开窗复杂搜索栏位怎么自定义?开窗searchInfo的配置方式?

admin 发表于 2024-12-27 23:27:58

searchInfos代表搜索栏位,如果没有配置,取表格表头数据,如果有配置取配置,配置如下:

"openWindowDefine": {
            ...
             "getDataAction": {
               ...
               "dataSourceSet": {
               "dataSourceList": [
                   {
                  ...
                     "action": {
                     ...
                        "searchInfos": [
                              // 普通 info 会当成可筛选项
                           {
                                 searchField: 'task_template_parameter_name',
                                 dataType: 'string',
                           },
                            /**
                            * paramType: 'constant' 表示常量条件
                           * 后续和开窗内的条件 merge 后给后端,不会出现 paras 中 search_info 会被开窗条件被覆盖的情况
                           * 如下筛选条件,请求接口返回的数据都是 manage_status: 'V' 的数据 list,即便开窗内搜索,也是基于该条件之上
                           */
                           {
                              searchField: 'manage_status',
                               dataType: 'string',
                               paramType: 'constant',
                               searchOperator: 'equal', // 运算子,具体含义可参考 API 部分的 IOperator
                               preLogic: 'OR', // 与前一条件的逻辑关系(前一条并非指上面的筛选项,通常是指前一个常量筛选)
                               searchValue: 'V', // 值
                        },
                        ],
                     }
                   }
               ]
               }
             }   
         },
searchInfos中对象的属性如下:
{
searchField: string;
dataType: 'numeric' | 'string' | ...; // field dataType 联合类型
paramType?: 'constant'; // 常量条件,不显示在搜索条件中,但是查询接口时,会携带该条件给后端进行数据过滤
preLogic?: 'AND' | 'OR';
logic?: 'AND' | 'OR';
searchOperator?: 'equal' | 'greater_equal' | 'less_equal' | 'greater' | 'less' | 'not_equal' | 'not_equal' | 'like' | 'l_like' | 'not_like' | 'exist' | 'not_exist' | 'between' ; // 运算子,具体含义可参考 API 部分的 IOperator
searchValue?: any;
}
页: [1]
查看完整版本: 【平台组件】开窗复杂搜索栏位怎么自定义?