获取审批申请详情的文档解释不清楚
apply_data作为接收审批申请数据的字段
开发者如何快速的从控件中获取控件标题和值,这点没有说明吗?以前的接口(获取审批数据(旧):https://qyapi.weixin.qq.com/cgi-bin/corp/getapprovaldata?access_token=ACCESS_TOKEN)中,开发者可以通过解析comm很方便的获取,但是现在却要解析控件吗?根据控件的不同从不同的数据结构中取值,而且路径很深,这种体验是不是有待提升
举个例子,这是申请数据字段:
"apply_data": {
"contents": [
{
"control": "Vacation",
"id": "vacation-1563793073898",
"title": [
{
"text": "请假类型",
"lang": "zh_CN"
}
],
"value": {
"tips": [],
"members": [],
"departments": [],
"files": [],
"children": [],
"stat_field": [],
"vacation": {
"selector": {
"type": "single",
"options": [
{
"key": "4",
"value": [
{
"text": "调休假",
"lang": "zh_CN"
}
]
}
]
},
"attendance": {
"date_range": {
"type": "halfday",
"new_begin": 1633708800,
"new_end": 1633752000,
"new_duration": 86400
},
"type": 1,
"slice_info": {
"day_items": [
{
"daytime": 1633708800,
"time_sections": [],
"duration": 27000
}
],
"state": 1,
"duration": 27000
}
}
},
"sum_field": [],
"related_approval": [],
"students": [],
"classes": []
}
},
{
"control": "Textarea",
"id": "item-1497581399901",
"title": [
{
"text": "请假事由(详细说明)",
"lang": "zh_CN"
}
],
"value": {
"text": "休息",
"tips": [],
"members": [],
"departments": [],
"files": [],
"children": [],
"stat_field": [],
"sum_field": [],
"related_approval": [],
"students": [],
"classes": []
}
},
{
"control": "File",
"id": "item-1497581426169",
"title": [
{
"text": "说明附件",
"lang": "zh_CN"
}
],
"value": {
"tips": [],
"members": [],
"departments": [],
"files": [],
"children": [],
"stat_field": [],
"sum_field": [],
"related_approval": [],
"students": [],
"classes": []
}
},
{
"control": "Tips",
"id": "item-1540863017484",
"title": [
{
"text": "说明",
"lang": "zh_CN"
}
],
"value": {
"tips": [],
"members": [],
"departments": [],
"files": [],
"children": [],
"stat_field": [],
"sum_field": [],
"related_approval": [],
"students": [],
"classes": []
}
},
{
"control": "Tips",
"id": "item-1556244979686",
"title": [
{
"text": "说明",
"lang": "zh_CN"
}
],
"value": {
"tips": [],
"members": [],
"departments": [],
"files": [],
"children": [],
"stat_field": [],
"sum_field": [],
"related_approval": [],
"students": [],
"classes": []
}
},
{
"control": "Tips",
"id": "item-1556244996788",
"title": [
{
"text": "说明",
"lang": "zh_CN"
}
],
"value": {
"tips": [],
"members": [],
"departments": [],
"files": [],
"children": [],
"stat_field": [],
"sum_field": [],
"related_approval": [],
"students": [],
"classes": []
}
}
]
}
这么复杂的结构深度,我们也需要去定义这么深的对象属性去解析吗,有朋友帮忙解释一下吗?还有别的方式吗?