图层字段
在图层操作中我们理解了一个图层就是数据库的一张表
现在介绍如何获取到该图层的字段信息
# 字段是啥?
在一张图的概念里面,一个图层就是一张表,如果只是一张表的话,,那就必须得告诉你字段,不然你就没有办法对他进行查询等操作.
这里简要的提一下我们系统的对于图层字段有下面几个系统字段
| 字段名称 | 字段说明 | 能否操作 | 备注 |
|---|---|---|---|
| gtc_id | 图层的主键 | 不能 | 插入时自动生成 |
| the_geom | 空间信息的存放 | 可以 | |
| 创建时间 | 标识这一行的插入时间 | 不能 | 由数据库触发,用户不用接触 |
| 更新时间 | 标识这一行的更新时间 | 不能 | 由数据库触发,用户不用接触 |
| 创建人 | 谁创建的这一行 记录ID | 不能 | 由一张图服务器通过AppId进行自动识别,用户不用接触 |
| 更新人 | 这一行最近被谁更新了 记录ID | 不能 | 由一张图服务器通过AppId进行自动识别,用户不用接触 |
| 是否删除 | 逻辑删除标识 | 不能 | 由一张图系统控制 |
| 租户id | 图层租户来源 | 不能 | 客户不允许操作 |
| 创建来源 | 图层数据来源 | 不能 | 客户不允许操作 |
| 删除ID | 逻辑删除用于记录是谁删除这一行 记录Id | 不能 | 客户不允许操作 |
| 删除人 | 逻辑删除用于记录是谁删除这一行 记录名称 | 不能 | 客户不允许操作 |
| 删除时间 | 逻辑删除用于记录删除时间 | 不能 | 客户不允许操作 |
| 创建人名称 | 用于记录是谁创建的这一行 记录名称 | 不能 | 客户不允许操作 |
| 更新人名称 | 用于记录是谁更新的这一行 记录名称 | 不能 | 客户不允许操作 |
| 更新版本 | 用于记录这一行记录被更新的次数,更新日志另外有接口在管理端查询 | 不能 | 客户不允许操作 |
# (字段) 通过tableId获取图层的字段列表
接口描述: 通过tableId获取图层的字段列表 (该接口已经过时,新对接请迁移到 获取字段列表V2 )
接口地址:/one-map-server/om/OmInfoTableField/listInfoTableFieldPage
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*
请求示例:
{
"tableId": "t_1797566480388255744"
}
字段对象描述:
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| id | 字段ID | string |
| aliasField | 字段名称 | string |
| dictType | 数据字典 | string |
| dictTypeName | 数据字典名称 | string |
| dictTypeSys | 数据字典类型 | string |
| displayIs | 该字段是否在该子表中展示,可用值:{name: YES;code: YES},{name: NO;code: NO} | string |
| editChildIs | 该字段在子表中是否允许编辑,可用值:{name: YES;code: YES},{name: NO;code: NO} | string |
| fieldDefaultValue | 默认值 | string |
| fieldLength | 字段长度 | string |
| fieldNullable | 是否允许为空 ,可用值:{name: YES;code: YES},{name: NO;code: NO} | string |
| fieldPrecision | 精度 | string |
| fieldType | 字段类型,可用值:{name: 时间;code: timestamp},{name: 字符串;code: varchar},{name: 浮点;code: decimal},{name: 数值;code: numeric},{name: 长整型;code: int8},{name: 空间类型;code: geometry},{name: 文本;code: text},{name: 整型;code: int4} | string |
| multChoiceIs | 描述该字段是不是多选字典,可用值:{name: YES;code: YES},{name: NO;code: NO} | string |
| orderNum | 展示排序 | string |
| primaryIs | 是否为主键 | string |
| queryIs | 能否查询 | string |
| remark | 备注信息 | string |
| sysFieldIs | 是否系统字段,可用值:{name: YES;code: YES},{name: NO;code: NO} | string |
| tableId | 表id | string |
响应示例:
{
"code": 200,
"alertType": 0,
"alertMsg": null,
"data": {
"pageSize": 99999,
"startRow": 99999,
"pageNum": 1,
"pageParam": {
"pageSize": 99999,
"startRow": 99999,
"pageNum": 1
},
"total": 22,
"list": [
{
"id": "tf_1797566524617191447", // 字段ID
"sysFieldIs": "NO",//是否为系统字段
"tableId": "t_1797566480388255744",
"aliasField": "名称", //字段名称
"primaryIs": "NO", //是否主键
"fieldType": "varchar", //字段类型
"fieldLength": "1000",//字段长度
"fieldPrecision": null,//字段精度
"fieldNullable": "YES",//字段是否允许为空
"fieldDefaultValue": null,//字段默认值
"remark": null,//字段描述信息
"orderNum": "1",//字段展示排序
"queryIs": "YES",//是否允许查询
"fieldComment": null,
"showOut": "YES",
"showInner": "YES",
"orderCan": "NO",
"orderStrategy": null,
"dictType": "dict_|#|xiaoqubuweileibie", // 前缀为 dict_ 表示这个字段受字典约束 字典类型是 xiaoqubuweileibie ,|#| 是一个分割符号
"var1": null,
"relRuleId": null,
"multChoiceIs": "NO", //描述该字段是不是多选字典
"dictTypeName": "xiaoqubuweileibie", //描述使用的字典类型 ,当使用的是字典的时候,该字段才有值
"dictTypeSys": "layersys",
"connectTargetFieldId": null,
"connectTargetTableId": null,
"mappingTargetFieldId": null,
"connectTargetFieldName": null,
"mappingTargetFieldName": null,
"connectSourceId": null,
"connectTargetId": null
},
// ...... 其他字段对象
]
},
"location": null
}
postman

# 获取字段列表V2
接口描述: 这里对一张表 新增,修改,详情,列表 的可显示可编辑的字段做了区分, 因为存在有的字段,我不需要编辑,但是需要在列表或者详情里面能够看的到.
这里对上面增删改查场景分为了四个接口.
列表字段接口地址:/one-map-server/om/OmInfoTableField/v2/getFieldListByPropertySheet
新增字段接口地址:/one-map-server/om/OmInfoTableField/v2/getFieldListByInsert
修改字段接口地址:/one-map-server/om/OmInfoTableField/v2/getFieldListByUpdate
详情字段接口地址:/one-map-server/om/OmInfoTableField/v2/getFieldListByDetail
请求方式:POST
请求数据类型:x-www-form-urlencoded
响应数据类型:*/*
请求示例:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| tableId | 表Id | query | true | string |
字段对象描述:
| 参数名称 | 参数说明 | 数据类型 | 备注 |
|---|---|---|---|
| id | 字段ID | string | |
| aliasField | 字段名称 | string | |
| dictType | 数据字典 | string | 已废弃,字典相关标记已经迁移到 dictionaryType 字段中 |
| dictTypeName | 数据字典名称 | string | 已废弃,字典相关标记已经迁移到 dictionaryType 字段中 |
| dictTypeSys | 数据字典类型 | string | 已废弃,字典相关标记已经迁移到 dictionaryType 字段中 |
| displayIs | 该字段是否在该子表中展示,可用值:{name: YES;code: YES},{name: NO;code: NO} | string | |
| editChildIs | 该字段在子表中是否允许编辑,可用值:{name: YES;code: YES},{name: NO;code: NO} | string | |
| fieldDefaultValue | 默认值 | string | 已废弃, 默认值相关逻辑请根据 formDefaultValueType与 formDefaultValue两个字段判断 |
| fieldLength | 字段长度 | string | |
| fieldNullable | 是否允许为空 ,可用值:{name: YES;code: YES},{name: NO;code: NO} | string | |
| fieldPrecision | 精度 | string | |
| fieldType | 字段类型,可用值:{name: 时间;code: timestamp},{name: 字符串;code: varchar},{name: 浮点;code: decimal},{name: 数值;code: numeric},{name: 长整型;code: int8},{name: 空间类型;code: geometry},{name: 文本;code: text},{name: 整型;code: int4} | string | |
| multChoiceIs | 描述该字段是不是多选字典,可用值:{name: YES;code: YES},{name: NO;code: NO} | string | |
| orderNum | 展示排序 | string | |
| primaryIs | 是否为主键 | string | |
| queryIs | 能否查询 | string | |
| remark | 备注信息 | string | |
| sysFieldIs | 是否系统字段,可用值:{name: YES;code: YES},{name: NO;code: NO} | string | |
| tableId | 表id | string | |
| dictionaryType | 数据字典类型 | string | dictType, dictTypeName,dictTypeSys 三个字段再之前的设计中,有点儿语义重复不好理解,这里合并为一 |
| formDefaultValueType | 表单默认值类型,可用值:{name: 无默认值;code: NULL},{name: 输入;code: from_default_value},{name: UUID;code: uuid},{name: 随机10位数值字符串;code: random_10_string},{name: 经度;code: coordinate_x},{name: 纬度;code: coordinate_y},{name: 字典;code: dict},{name: 行政区划;code: districts},{name: 警务辖区;code: station},{name: 当前用户名称;code: user_name},{name: 当前用户部门名称;code: dept_name},{name: 当前用户部门ID;code: dept_id},{name: 当前用户ID;code: user_id},{name: 当前日期;code: current_date},{name: 当前时间;code: current_time} | string | 新加字段 |
| formDefaultValue | 表单默认值 | string | 新加字段 |
| formDetailsShow | 详情表单策略,可用值:{name: 可见只读;code: only_read}, {name: 不可见;code: show_not},{name: 仅数据;code: only_data} | string | 新加字段 |
| formInsertShow | 插入表单策略,可用值:{name: 可见只读;code: only_read},{name: 可见可编辑;code: can_edit},{name: 不可见需编辑;code: can_edit_not_show},{name: 不可见;code: show_not},{name: 仅数据;code: only_data} | string | 新加字段 |
| formListShow | 列表显示策略,可用值:{name: 可见只读;code: only_read},{name: 可见可编辑;code: can_edit},{name: 不可见需编辑;code: can_edit_not_show},{name: 不可见;code: show_not},{name: 仅数据;code: only_data} | string | 新加字段 |
| formDetailsShow | 详情表单策略,可用值:{name: 可见只读;code: only_read}, {name: 不可见;code: show_not},{name: 仅数据;code: only_data} | string | 新加字段 |
| formUpdateShow | 更新表单策略,可用值:{name: 可见只读;code: only_read},{name: 可见可编辑;code: can_edit},{name: 不可见需编辑;code: can_edit_not_show},{name: 不可见;code: show_not},{name: 仅数据;code: only_data} | string | 新加字段 |
| placeholder | 占位文本 | string | 新加字段 |
| widgetType | 控件类型,可用值:{name: 日期控件;code: date_widget},{name: 日期范围控件;code: data_range_widget},{name: 文本控件;code: text_widget},{name: 文本域控件;code: text_area_widget},{name: 数值控件;code: number_widget},{name: 字典控件;code: dictionary_widget},{name: 行政区划控件;code: districts_widget},{name: 警务辖区控件;code: station_widget},{name: 单文件控件;code: file_widget},{name: 多文件控件;code: multi_file_widget},{name: 高级输入控件;code: adv_input_widget},{name: 路口道路;code: road_crossing_widget},{name: 道路关联;code: road_related_widget},{name: 无须控件;code: NULL} | string | 新加字段 |
响应示例:
{
"id": "tf_shp_1848958058914951168", // 字段ID
"formUpdateShow": "can_edit", // 该字段在更新的表单中是否展示
"formInsertShow": "can_edit", // 该字段在插入的表单中是否展示
"formDetailsShow": "only_read", // 该字段在详情的表单中是否展示
"formListShow": "only_read",// 该字段在列表中是否展示
"widgetType": "dictionary_widget",// 控件类型
"widgetHeight": "32",
"widgetWidth": "100%",
"placeholder": "请输入字典测试",
"labelPosition": "left",
"formDefaultValue": null,
"displayControl": "NULL",
"dictionaryType": "yesOrNo", ,// 字典类型
"formDefaultValueType": "NULL", // 表单默认值类型
"tableId": "t_add_184895274685XXXX92",
"aliasField": "字典测试", //字段名称
"primaryIs": "NO",
"fieldType": "varchar",
"fieldLength": "2000",
"fieldPrecision": null,
"fieldNullable": "YES",
"fieldDefaultValue": null, // 已经废弃
"remark": null,
"orderNum": "6",
"queryIs": "YES",
"fieldComment": null,
"showOut": "YES", // 已经废弃
"showInner": "YES",// 已经废弃
"orderCan": "NO",// 已经废弃
"orderStrategy": null,// 已经废弃
"dictType": null,// 已经废弃
"var1": null,
"relRuleId": null,
"multChoiceIs": null,
"displayIs": null,
"editChildIs": null,
"dictTypeName": null,// 已经废弃
"dictTypeSys": null,// 已经废弃
"sysFieldIs": null,
"addSimpleField": "NO",
"extAttribute": {
"fieldConnect": {
"connectFilling": {
"id": null,
"currentFieldId": null,
"targetFieldId": null,
"connectionConditions": null,
"currentTableId": null,
"targetTableId": null,
"timeCreate": null
},
"connectFillingDoc": "跟我有关的链接策略",
"fieldConnectFillingMapping": {
"id": null,
"currentFieldId": null,
"targetFieldId": null,
"connectId": null,
"timeCreate": null
},
"fieldConnectFillingMappingDoc": "我关联了谁"
},
"disPlayCondition": {
"master": {},
"slave": {}
},
"dictOption": [{ // 如果是字典字段,这里就是该字段的可选值
"dictCode": "1692432933304676352",
"dictSort": 1,
"dictLabel": "是",
"dictValue": "YES",
"dictType": "yesOrNo",
"defaultIs": null,
"childHas": null,
"parentId": null,
"showIs": "YES",
"color": "#48D1CC",
"fullDictValue": "YES",
"fullDictLable": "是",
"childData": []
},
{
"dictCode": "1692433096114974720",
"dictSort": 2,
"dictLabel": "否",
"dictValue": "NO",
"dictType": "yesOrNo",
"defaultIs": null,
"childHas": null,
"parentId": null,
"showIs": "YES",
"color": "#48D1CC",
"fullDictValue": "NO",
"fullDictLable": "否",
"childData": []
}
],
"disPlayConditionDoc": "字段展示配置相关功能组件",
"dictOptionDoc": "字典可选项目",
"fieldConnectDoc": "高级输入配置的字段链接策略",
"dictTypeProperty": {
"dictId": "1689448712498749440",
"dictName": "是或否",
"dictType": "yesOrNo",
"remark": "通用型",
"tenantId": null,
"dictScope": "layer"
},
"dictTypePropertyDoc": "dictTypeProperty"
},
"extVoAttribute": null
}