描述
主要用于获取元素内容、已选择项等功能。
接口
object GetElementProperties(identity: object, config : object)
identity 参数
参数名 |
必填 |
类型 |
说明 |
备注 |
mode |
是 |
enum |
获取模式 |
=0 所有元素; =1 id或者source非空所有元素; =2 按ids或sources提取元素; |
subDocName |
否 |
string |
文档合并时,限定提取的子文档名 |
为””时 不限制子文档名 |
ids |
否 |
json array |
元素Id数组 |
mode=2时 有效 |
sources |
否 |
json array。内部需包含sourceClasssourceId、 |
源信息数组 |
mode=2时 有效 |
config 参数
参数名 |
必填 |
类型 |
说明 |
备注 |
buildAttribute |
否 |
bool? |
提取属性 |
null/0: 默认,精简模式; 1:全属性 |
buildText |
否 |
bool |
提取文本 |
=0 不提取元素内容 =1 默认, 提取元素内容 |
buildFragment |
否 |
bool |
提取片段 |
=0 默认, 不提取元素片段 =1 提取元素片段 |
入参示例
按元素id
{
"mode": 2,
"ids": [
"sex",
"province"
]
}
按元素source
{
"mode": 2,
"sources": [
{
"sourceClass": "系统",
"sourceId": "性别"
},
{
"sourceClass": "系统",
"sourceId": "省份"
}
]
}
返回值
- note: inputHandle.checked 标识元素选择了的多个选项子项。
- 注意:选项元素inputHandle.inputMode=2才有inputHandle.checked字段
[
{
"id": "id2",
"name": "",
"empty": false,
"text": "男",
"fragment": "<Fragment><Element id='id2' cfg='30000' inputMode='2' optionClass='系统' optionId='性别' linkStr='、' items='1' hint='请输入'>男<\/Element><\/Fragment>",
"inputHandle": {
"inputMode": 2,
"optionClass": "系统",
"optionId": "性别",
"checked": [
"1"
],
"linkStr": "、",
"optionShowMode": 0,
"multipleChoice": 0,
"groupExclusion": 0,
"showFilter": 0,
"externalFilter": 0,
"popSelectorWidth": "0.00",
"items": [
{
"id": "1",
"group": "1",
"weight": "0.00",
"content": "男"
},
{
"id": "2",
"group": "1",
"weight": "0.00",
"content": "女"
},
{
"id": "9",
"group": "1",
"weight": "0.00",
"content": "未"
}
]
}
},
{
"id": "id3",
"name": "",
"empty": false,
"text": "男、未",
"fragment": "<Fragment><Element id='id3' cfg='30000' xCfg='100' inputMode='2' optionClass='系统' optionId='性别' linkStr='、' items='1;9' hint='请输入'>男、未<\/Element><\/Fragment>",
"inputHandle": {
"inputMode": 2,
"optionClass": "系统",
"optionId": "性别",
"checked": [
"1",
"9"
],
"linkStr": "、",
"optionShowMode": 0,
"multipleChoice": 1,
"groupExclusion": 0,
"showFilter": 0,
"externalFilter": 0,
"popSelectorWidth": "0.00",
"items": [
{
"id": "1",
"group": "1",
"weight": "0.00",
"content": "男"
},
{
"id": "2",
"group": "1",
"weight": "0.00",
"content": "女"
},
{
"id": "9",
"group": "1",
"weight": "0.00",
"content": "未"
}
]
}
}
]
文档更新时间: 2025-08-22 14:42 作者:admin