当前位置: 首页 > news >正文

衡石科技技术手册--仪表盘过滤控件详解

过滤控件说明 

过滤控件 的定义 

过滤控件用于在仪表盘中过滤图表数据,分为仪表盘内过滤控件和全局过滤控件。

过滤控件结构说明 
字段类型描述
uidSTRING过滤控件唯一识别 id
appIdLONG过滤控件所属的应用 id
dataAppIdLONG字段来源是数据包时的数据包 id
dashboardIdLONG过滤控件所属的仪表盘 id
datasetIdLONG过滤控件所是用的字段所属的数据集 id
titleSTRING过滤控件标题
filterTypeSTRING过滤控类型,可选值为:FILTER(过滤控件),FILTER_BTN(过滤按钮),PARAM(参数控件),MULTIPLE_DATE_PARAM(日期多选过滤控件)
fieldNameSTRING过滤器所用的字段名称
fieldOBJECT过滤器所用的字段配置
useSTRING过滤器过滤样式,默认传"checkbox"即可
kindOBJECT过滤器表达式类型,默认传"formula"即可
opOBJECT过滤器表达式,默认传"1=1"即可
optionsOBJECT过滤控件样式相关配置
options.styleOBJECT过滤控件样式配置
options.titleStyleOBJECT过滤控件标题样式配置
childrenLIST子过滤控件集合,list中的值为子控件的uid
isGlobalFilterBOOLEAN过滤控件是否为全局控件
controllerMAP过滤按钮控制的过滤控件映射表,key为要控制的过滤控件uid,value为boolean值:true(控制)
byDashboardOBJECT全局过滤器在各仪表盘中的样式设置
childrenByDashboardOBJECT全局过滤器与各仪表盘中的过滤控件的父子关系

接口说明 

新增过滤控件 

新增过滤控件

请求URL 

http

POST /api/apps/${appId}/filter-controllers HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数 
URL 参数 
字段类型是否必须说明
appIdINTEGER过滤控件所在的应用 id
Request Body 参数 

过滤控件配置信息,见过滤控件结构

返回对象的格式说明 
字段类型说明
versionSTRING当前系统版本哈希值
dataOBJECT过滤控件的完整配置信息,见过滤控件结构
接口示例1: 新增仪表盘内过滤控件 

http

POST /api/apps/1/filter-controllers HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...// Request Body:
{"title": "新建过滤器","options": {"titleStyle": {"textAlign": "center","position": "left"},"style": {"method": "select","itemStyle": {"borderTopColor": "#dadada","borderRightColor": "#dadada","borderBottomColor": "#dadada","borderLeftColor": "#dadada","maxHeight": 28,"background": "#fff"}}},"filterType": "filter","fieldName": "director","field": {"datasetId": 1,"fieldName": "director","tags": {},"defaultAggrType": "count","comment": "","type": "string","config": {},"originType": "string","visible": true,"nativeType": "bpchar","hideValue": false,"detectedType": "string","suggestedTypes": ["string"],"basicType": "string","dataAppId": 130713,"_ukey": "director","labelOrigin": "director"},"use": "checkbox","kind": "formula","op": "1=1","appId": 1,"uid": "01HJ0TE602Z2VERDA4CMY4JR59","dataAppId": 1,"datasetId": 1,"dashboardId": 1,"dashboardOptions": {"layouts": {"1": {"static": false,"w": 4,"moved": false,"h": 4,"x": 1,"i": "1","y": 1,"type": "chart","zIndex": 902,"options": {}},"01HJ0TE602Z2VERDA4CMY4JR59": {"i": "01HJ0TE602Z2VERDA4CMY4JR59","x": 1,"y": 1,"w": 4,"h": 1,"moved": false,"static": false,"zIndex": 904,"type": "filter"}}}
}

说明

dashboardOptions.layouts为过滤控件在仪表盘内的样式配置,layouts为MAP类型,key是过滤控件uid或图表id,value为具体的样式配置,请注意,这里的options.layouts每次都需要传递完整的layouts而不是仅传当前新增的控件样式,如:仪表盘内已有一个图表和一个过滤控件,那么新增过滤控件时,layouts中应该有三个键值对,分别对应两个过滤控件和一个已有图表的样式。

接口示例2: 新增仪全局过滤控件 

http

POST /api/apps/1/filter-controllers HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...// Request Body:
{"title": "全局过滤器","options": {"titleStyle": {},"style": {"method": "select","itemStyle": {"borderTopColor": "#dadada","borderRightColor": "#dadada","borderBottomColor": "#dadada","borderLeftColor": "#dadada","maxHeight": 28,"background": "#fff"}}},"filterType": "filter","appId": 130713,"isGlobalFilter": true,"uid": "01HJ0V48VGN5M8XV4FQDW9BZ6D","fieldName": "director","field": {"datasetId": 1,"fieldName": "director","tags": {},"defaultAggrType": "count","type": "string","comment": "","originType": "string","config": {},"visible": true,"nativeType": "bpchar","hideValue": false,"detectedType": "string","suggestedTypes": ["string"],"basicType": "string","dataAppId": 130713,"_ukey": "director","labelOrigin": "director"},"byDashboard": {"1": {"style": {"method": "select","itemStyle": {"borderTopColor": "#dadada","borderRightColor": "#dadada","borderBottomColor": "#dadada","borderLeftColor": "#dadada","maxHeight": 28,"background": "#fff"}}}},"children": ["01HJ0TE602Z2VERDA4CMY4JR59"],"childrenByDashboard": {"1": ["01HJ0TE602Z2VERDA4CMY4JR59"]},"dataAppId": 130713,"datasetId": 1,"inside": true
}

说明

全局过滤控件不需要传递dashboardOptions

接口示例3: 新增参数控件 

http

POST /api/apps/1/filter-controllers HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...// Request Body:
{"uid": "01HJ0WYABBYAHBS8N33KVRHFJH","dashboardId": 1,"appId": 1,"options": {"style": {"method": "input"},"titleStyle": {"textAlign": "center","position": "left"},"mobileOptions": {"style": {"method": "input"},"titleStyle": {"textAlign": "center","position": "left"}},"enableAll": false},"datasetId": 1,"title": "参数控件","filterType": "param","field": {"id": 1,"name": "param","appId": 130713,"options": {"type": "string","subType": "ALL","allowAllValue": true,"defaultValue": null},"extendAppTitle": "过滤控件","uid": "1","isParam": true,"type": "string","datasetId": 1,"dataAppId": 130713,"labelOrigin": "param","label": "param"},"use": "paramInput","fieldName": "param","dashboardOptions": {"layouts": {"1": {"static": false,"w": 4,"moved": false,"h": 4,"x": 1,"options": {},"i": "1","y": 1,"type": "chart","zIndex": 902},"01HJ0WYABBYAHBS8N33KVRHFJH": {"i": "01HJ0WYABBYAHBS8N33KVRHFJH","x": 1,"y": 1,"w": 4,"h": 1,"moved": false,"static": false,"zIndex": 910,"type": "param"}}}
}

接口示例4: 新增过滤按钮 

http

POST /api/apps/1/filter-controllers HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...// Request Body:
{"version": 5000,"title": "查询","options": {},"filterType": "filterBtn","appId": 130713,"uid": "01HJ0X4WF0SR2MEND24V1J5BNE","dashboardId": 1,"dashboardOptions": {"layouts": {"1": {"static": false,"w": 4,"moved": false,"h": 4,"x": 1,"options": {},"i": "1","y": 1,"type": "chart","zIndex": 902},"01HJ0X4WF0SR2MEND24V1J5BNE": {"i": "01HJ0X4WF0SR2MEND24V1J5BNE","x": 1,"y": 1,"w": 4,"h": 1,"moved": false,"static": false,"zIndex": 912,"type": "filterBtn"}}}
}

说明

过滤按钮具体控制哪些过滤控件需要调用批量更新接口

更新过滤控件 

更新过滤控件

请求URL 

http

PUT /api/apps/${appId}/filter-controllers/{uid} HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数 
URL 参数 
字段类型是否必须说明
appIdINTEGER过滤控件所在的应用 id
uidINTEGER过滤控件唯一识别id
Request Body 参数 

过滤控件配置信息,见过滤控件结构

返回对象的格式说明 
字段类型说明
versionSTRING当前系统版本哈希值
dataOBJECT过滤控件的完整配置信息,见过滤控件结构
接口示例 

http

PUT /api/apps/1/filter-controllers/01HJ0TE602Z2VERDA4CMY4JR59 HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...// Request Body:
{"uid": "01HJ0TE602Z2VERDA4CMY4JR59","dashboardId": 1,"appId": 130713,"options": {"style": {"method": "select"},"titleStyle": {"textAlign": "center","position": "left"},"mobileOptions": {"style": {"method": "select"},"titleStyle": {"textAlign": "center","position": "left"}}},"datasetId": 1,"dataAppId": 130713,"title": "新建过滤器","filterType": "filter","version": 5000,"fieldName": "director","field": {"datasetId": 1,"fieldName": "director","tags": {},"defaultAggrType": "count","comment": "","type": "string","config": {},"originType": "string","visible": true,"nativeType": "bpchar","hideValue": false,"detectedType": "string","suggestedTypes": ["string"],"basicType": "string","dataAppId": 130713,"_ukey": "director","labelOrigin": "director"},"use": "checkbox","kind": "formula","op": "1=1"
}

说明

更新不需要再次传递dashboardOptions

批量更新过滤控件 

批量更新过滤控件

请求URL 

http

PUT /api/apps/${appId}/filter-controllers HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

1
2
3

请求参数 
URL 参数 
字段类型是否必须说明
appIdINTEGER过滤控件所在的应用 id
Request Body 参数 

过滤控件配置信息,见过滤控件结构

返回对象的格式说明 
字段类型说明
versionSTRING当前系统版本哈希值
dataOBJECT过滤控件的完整配置信息,见过滤控件结构
接口示例 

http

PUT /api/apps/1/filter-controllers/01HJ0TE602Z2VERDA4CMY4JR59 HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...// Request Body:
[{"op": "1=1","controller": {"01HJ0X4WF0SR2MEND24V1J5BNE": true},"fieldsChain": [{"field": "月份","keys": ["130145_datasetList_2"],"appId": 130145,"datasetId": 2,"label": "月份"}],"fieldName": "director","use": "checkbox","kind": "formula","datasetName": "A_IVT_MOVIE","title": "新建过滤器","version": 5000,"uid": "01HJ0TE602Z2VERDA4CMY4JR59","hasChain": true,"field": {"fieldName": "director","visible": true,"suggestedTypes": ["string"],"type": "string","detectedType": "string","tags": {},"basicType": "string","defaultAggrType": "count","originType": "string","hideValue": false,"appId": 130713,"nativeType": "bpchar","_ukey": "director","datasetId": 1,"comment": "","labelOrigin": "director","id": 125664649,"config": {}},"children": ["01HJ0TNJJFG2S7HGKA5B57A11S"],"dashboardId": 1,"appId": 130713,"options": {"style": {"method": "select"},"titleStyle": {"textAlign": "center","position": "left"},"mobileOptions": {"style": {"method": "select"},"titleStyle": {"textAlign": "center","position": "left"}}},"datasetId": 1,"fieldSiblings": [],"dataAppId": 130713,"filterType": "filter"},{"uid": "01HJ0WYABBYAHBS8N33KVRHFJH","controller": {"01HJ0X4WF0SR2MEND24V1J5BNE": true},"fieldName": "d","field": {"updatedBy": 8,"isParam": true,"isDelete": false,"label": "d","type": "string","tags": {},"createdAt": 1702984863536,"uid": "1","extendAppTitle": "过滤控件","createdBy": 8,"appId": 130713,"name": "d","options": {"allowAllValue": true,"subType": "ALL","type": "string"},"datasetId": 1,"labelOrigin": "d","id": 1,"dataAppId": 130713,"updatedAt": 1702984863536},"dashboardId": 1,"use": "paramInput","appId": 130713,"options": {"style": {"method": "input"},"titleStyle": {"textAlign": "center","position": "left"},"enableAll": false,"mobileOptions": {"style": {"method": "input"},"titleStyle": {"textAlign": "center","position": "left"}}},"datasetId": 1,"dataAppId": 130713,"title": "新建参数控件","filterType": "param"},{"uid": "01HJ0X4WF0SR2MEND24V1J5BNE","dashboardId": 1,"appId": 130713,"options": {},"dataAppId": 130713,"title": "查询","filterType": "filterBtn","version": 5000}
]

说明

该例为更新过滤按钮,需要将过滤按钮要控制的过滤控件的信息都放在list中并设置controller后传递,controller中为过滤按钮的uid

获取过滤控件列表 

获取过滤控件列表

请求URL 

http

GET /api/apps/${appId}/filter-controllers HTTP/1.1
Accept: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...

请求参数 
URL 参数 
字段类型是否必须说明
appIdINTEGER过滤控件所在的应用 id
Request Body 参数 

过滤控件配置信息,见过滤控件结构

返回对象的格式说明 
字段类型说明
versionSTRING当前系统版本哈希值
dataOBJECT过滤控件的完整配置信息,见过滤控件结构
接口示例 

http

GET /api/apps/1/filter-controllers HTTP/1.1
Content-Type: application/json
Cookie: csrf=183f1c4...; sid=26ee552d...; _USER_SESSION_ID=f2a01083...// Request Body:
{"version": "version@9a5e106#6730f0d","code": 0,"msg": "success","data": [{"op": "1=1","fieldsChain": [{"field": "月份","keys": ["130145_datasetList_2"],"appId": 130145,"datasetId": 2,"label": "月份"}],"fieldName": "director","use": "checkbox","kind": "formula","datasetName": "A_IVT_MOVIE","title": "新建过滤器","version": 5000,"uid": "01HJ0TE602Z2VERDA4CMY4JR59","hasChain": true,"field": {"visible": true,"fieldName": "director","suggestedTypes": ["string"],"type": "string","detectedType": "string","tags": {},"basicType": "string","originType": "string","defaultAggrType": "count","hideValue": false,"appId": 130713,"nativeType": "bpchar","_ukey": "director","datasetId": 1,"comment": "","labelOrigin": "director","id": 125664649,"config": {}},"children": ["01HJ0TNJJFG2S7HGKA5B57A11S"],"dashboardId": 1,"appId": 130713,"options": {"style": {"method": "select"},"titleStyle": {"textAlign": "center","position": "left"},"mobileOptions": {"style": {"method": "select"},"titleStyle": {"textAlign": "center","position": "left"}}},"datasetId": 1,"fieldSiblings": [],"dataAppId": 130713,"filterType": "filter"},{"op": "1=1","fieldName": "stars","use": "checkbox","kind": "formula","datasetName": "A_IVT_MOVIE","title": "新建过滤器","version": 5000,"uid": "01HJ0TNJJFG2S7HGKA5B57A11S","field": {"visible": true,"fieldName": "stars","suggestedTypes": ["string"],"type": "string","detectedType": "string","tags": {},"basicType": "string","originType": "string","defaultAggrType": "count","hideValue": false,"appId": 130713,"nativeType": "varchar","_ukey": "stars","datasetId": 1,"comment": "","labelOrigin": "stars","id": 125664654,"config": {}},"children": ["01HJ0TRQ88JAJNHEQQK6NYE16F"],"dashboardId": 1,"appId": 130713,"options": {"style": {"method": "select"},"titleStyle": {"textAlign": "center","position": "left"},"mobileOptions": {"style": {"method": "select"},"titleStyle": {"textAlign": "center","position": "left"}}},"datasetId": 1,"fieldSiblings": [],"dataAppId": 130713,"filterType": "filter"},{"op": "1=1","fieldName": "zh_name","use": "checkbox","kind": "formula","datasetName": "A_IVT_MOVIE","title": "新建过滤器","version": 5000,"uid": "01HJ0TRQ88JAJNHEQQK6NYE16F","field": {"visible": true,"fieldName": "zh_name","suggestedTypes": ["string"],"type": "string","detectedType": "string","tags": {},"basicType": "string","originType": "string","defaultAggrType": "count","hideValue": false,"appId": 130713,"nativeType": "bpchar","_ukey": "zh_name","datasetId": 1,"comment": "","labelOrigin": "zh_name","id": 125664648,"config": {}},"dashboardId": 1,"appId": 130713,"options": {"style": {"method": "select"},"titleStyle": {"textAlign": "center","position": "left"},"mobileOptions": {"style": {"method": "select"},"titleStyle": {"textAlign": "center","position": "left"}}},"datasetId": 1,"fieldSiblings": [],"dataAppId": 130713,"filterType": "filter"},{"uid": "01HJ0WYABBYAHBS8N33KVRHFJH","fieldName": "d","field": {"isParam": true,"updatedBy": 8,"isDelete": false,"label": "d","type": "string","tags": {},"uid": "1","createdAt": "2023-12-19 19:21:03","extendAppTitle": "过滤控件","createdBy": 8,"appId": 130713,"name": "d","options": {"allowAllValue": true,"subType": "ALL","type": "string"},"datasetId": 1,"labelOrigin": "d","id": 1,"dataAppId": 130713,"updatedAt": "2023-12-19 19:21:03"},"dashboardId": 1,"use": "paramInput","appId": 130713,"options": {"enableAll": false,"style": {"method": "input"},"titleStyle": {"textAlign": "center","position": "left"},"mobileOptions": {"style": {"method": "input"},"titleStyle": {"textAlign": "center","position": "left"}}},"datasetId": 1,"dataAppId": 130713,"title": "新建参数控件","filterType": "param","version": 5000},{"uid": "01HJ0X4WF0SR2MEND24V1J5BNE","dashboardId": 1,"appId": 130713,"options": {},"dataAppId": 130713,"title": "查询","filterType": "filterBtn","version": 5000}],"chartDataStartTimeMillis": 0
}

http://www.lryc.cn/news/587623.html

相关文章:

  • 空间智能-李飞飞团队工作总结(至2025.07)
  • Spring Cloud分布式配置中心:架构设计与技术实践
  • 2025前端面试题
  • (懒人救星版)CNN_Kriging_NSGA2_Topsis(多模型融合典范)深度学习+SCI热点模型+多目标+熵权法 全网首例,完全原创,早用早发SCI
  • 【前端:Typst】--let关键字的用法
  • ethers.js-5–和solidity的关系
  • Popover API 实战指南:前端弹层体验的原生重构
  • 七、深度学习——RNN
  • C语言-流程控制
  • 详解从零开始实现循环神经网络(RNN)
  • 使用 keytool 在服务器上导入证书操作指南(SSL 证书验证错误处理)
  • kafka的部署
  • Android系统的问题分析笔记 - Android上的调试方式 bugreport
  • 论文阅读:WildGS-SLAM:Monocular Gaussian Splatting SLAM in Dynamic Environments
  • 深入浅出Kafka Consumer源码解析:设计哲学与实现艺术
  • Angular 框架下 AI 驱动的企业级大前端应用开
  • Kafka 时间轮深度解析:如何O(1)处理定时任务
  • 【Python】-实用技巧5- 如何使用Python处理文件和目录
  • 计算机网络通信的相关知识总结
  • 基于GA遗传优化的多边形拟合算法matlab仿真
  • vscode/cursor怎么自定义文字、行高、颜色
  • PHP password_hash() 函数
  • 仓储智能穿梭车:提升仓库效率50%的自动化核心设备
  • Ubuntu系统下Conda的详细安装教程与Python多版本管理指南
  • 【软件架构】软件体系结构风格实现
  • I2C设备寄存器读取调试方法
  • 卷绕/叠片工艺
  • React源码3:update、fiber.updateQueue对象数据结构和updateContainer()中enqueueUpdate()阶段
  • 新手向:Python自动化办公批量重命名与整理文件系统
  • 理解:进程、线程、协程