文档
测试

p4组件-类型转换

POST

请求参数

参数名
类型
描述
必填
id
int
组件id
必填
code
string
preparation_change_type
必填
parents
string
父组件 多个逗号隔开
必填
children
string
子组件多个 逗号隔开
必填
value
object
组件具体参数
必填
operation
list
处理数据数组
必填
field
string
处理字段名
必填
opt_type
string
操作类型: to_str:转化为字符串;to_date:转换为日期;to_time:转换为时间; to_datetime:转换为日期时间 to_num: 转换为数值
必填
char_type
string
字符占用 half:半角 full:全角
可选
char_mode
string
字符格式: first_up:首字母大写 first_down:首字母小写 all_up:全字段大写 all_down:全字段小写
可选
format
string
转为日期或时间的 输出格式
可选
cnt_point
int
保留小数位数
可选
name
string
组件名称,组件说明的描述字段
必填

说明 / 示例

修改类型是指对数据表中的字段类型进行修改 ``` opt_type 操作类型: to_str:转化为字符串 to_datetime:转换为时间、日期、日期时间 to_num: 转换为数值 char_type 字符占用: half:半角 full:全角 char_mode 字符格式: first_up:首字母大写 first_down:首字母小写 all_up:全字段大写 all_down:全字段小写 format:转为日期或时间的格式 cnt_point:保留小数位数 { "id":, "parents":"", "children":"", "code": "preparation_change_type", "operation": [ { "field": "c", "type": "int", "opt_type": "to_str", "char_type":"half",字符占用:半角 "char_mode":"up",字符格式:大写 "mode_offset":0 }, { "field": "a.b", "type": "str", "opt_type": "to_time", 转为日期 "format": "HH:mm:ss" 格式 } ] } 源数据 {"a": {"b": "2020-12-29 11:12:00"}, "c":1223} 处理后 {"a": {"b": "11:12:00"}, "c":"1223"} ```