字典操作
# 字典说明
在字段对象里面有个字段叫做 dictTypeName ,这个字段就是表示该字段的输入输出是一个字典对象数组.
dictTypeName 在下面的描述中叫做 字典类型
一个字典类型包含了多个字典数据. 字典数据对象如下:
{
"dictCode": "1797569490782842880", // 字典数据的主键
"dictSort": 1, //字典排序
"dictLabel": "小区出入口", //字典的显示域
"dictValue": "01",//字典值域
"dictType": "xiaoqubuweileibie", //字典类型
"defaultIs": null,
"childHas": "YES",//是否包含子节点(注意:存在树形字典)
"parentId": null,// 父级字典ID
"showIs": "YES", // 是否展示 (存在有的字典能够在列表中翻译,但是在下拉中不可选择)
"color": "#00FF00",//该字典标签的颜色,可忽略
"fullDictValue": "01",//全字典值域
"fullDictLable": "小区出入口",// 全显示域
"childData": [ //不存在的时候这个是空数组
{
"dictCode": "1805509909669842944",
"dictSort": 1,
"dictLabel": "小区出口",
"dictValue": "cukou",
"dictType": "1797569490782842880",
"defaultIs": null,
"childHas": null,
"parentId": "1797569490782842880", // 父级别代码
"showIs": "YES",
"color": "#22C8B2",
"fullDictValue": "01|#|cukou",// 全值域 |#| 为分隔符
"fullDictLable": "小区出入口|#|小区出口", // 全显示域 |#| 为分隔符
"childData": []
}
]
}
# 查询字典类型的数据
接口地址:/one-map-server/om/OmDictData/findTypeData
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*
接口描述:
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| dictType | dictType | query | false | string |
响应状态:
响应示例:
{
"code": 200,
"alertType": 1,
"alertMsg": "操作成功",
"data": [
{
"dictCode": "1797569490782842880",
"dictSort": 1,
"dictLabel": "小区出入口",
"dictValue": "01",
"dictType": "xiaoqubuweileibie",
"defaultIs": null,
"childHas": "YES",
"parentId": null,
"showIs": "YES",
"color": "#00FF00",
"fullDictValue": "01",
"fullDictLable": "小区出入口",
"childData": [
{
"dictCode": "1805509909669842944",
"dictSort": 1,
"dictLabel": "小区出口",
"dictValue": "",
"dictType": "1797569490782842880",
"defaultIs": null,
"childHas": null,
"parentId": "1797569490782842880",
"showIs": "YES",
"color": "#22C8B2",
"fullDictValue": "01|#|",
"fullDictLable": "小区出入口|#|小区出口",
"childData": []
}
]
}
],
"location": null
}
# (字典)获取平铺的字典列表
接口描述: 跟上面的接口不同的是,这个接口会把树节点进行展开
接口地址:/one-map-server/om/OmDictData/findTypeDataExpandChild
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| dictType | dictType | query | false | string |
响应示例:
{
"code": 200,
"alertType": 1,
"alertMsg": "操作成功",
"data": [
{
"dictCode": "1797569490782842880",
"dictSort": 1,
"dictLabel": "小区出入口",
"dictValue": "01",
"dictType": "xiaoqubuweileibie",
"defaultIs": null,
"childHas": "YES",
"parentId": null,
"showIs": "YES",
"color": "#00FF00",
"fullDictValue": "01",
"fullDictLable": "小区出入口",
"childData": []
},
{
"dictCode": "1805510301589803008",
"dictSort": 1,
"dictLabel": "小区出口",
"dictValue": "cukou",
"dictType": "1797569490782842880",
"defaultIs": null,
"childHas": null,
"parentId": "1797569490782842880",
"showIs": "YES",
"color": "#22C8B2",
"fullDictValue": "01|#|cukou",
"fullDictLable": "小区出入口|#|小区出口",
"childData": []
}
],
"location": null
}
# (字典)通过字典的类型与显示域模糊查询字典对象列表
接口地址:/one-map-server/om/OmDictData/getInfoByTypeAndDisplayLike
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*
接口描述: 该接口不查询叶子节点
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| dictType | dictType | query | false | string | |
| displayLikeString | displayLikeString | query | false | string |
请求示例:
响应示例:
{
"code": 200,
"alertType": 1,
"alertMsg": "操作成功",
"data": [
{
"dictCode": "1797569490782842880",
"dictSort": 1,
"dictLabel": "小区出入口",
"dictValue": "01",
"dictType": "xiaoqubuweileibie",
"defaultIs": null,
"childHas": "YES",
"parentId": null,
"showIs": "YES",
"color": "#00FF00",
"fullDictValue": null,
"fullDictLable": null,
"childData": []
},
// .. 其他字典对象
],
"location": null
}
上次更新: 2024/06/25, 17:57:58