mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-05 17:50:53 +03:00
feat(skd): bool/numeric values в inputParameters choiceParameters
Раньше все values в <dcscor:value xsi:type="dcscor:ChoiceParameters"> эмитились как DesignTimeValue. Оригинал использует xs:boolean для bool-флагов (пример: Отбор.ОбособленноеПодразделение=false в ChoiceParameters элементе inputParameters поля ДанныеОрганизации). decompile: читает тип xsi из <dcscor:value> и конвертит в JSON-native (true/false для boolean, int/double для decimal, иначе строка). compile: при эмите inputParameters → choiceParameters → values детектирует тип значения и эмитит соответствующий xsi:type. PS и Py синхронизированы.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# skd-compile v1.86 — Compile 1C DCS from JSON
|
||||
# skd-compile v1.87 — Compile 1C DCS from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
import argparse
|
||||
import json
|
||||
@@ -586,7 +586,13 @@ def emit_input_parameters(lines, ip, indent):
|
||||
lines.append(f'{indent}\t\t\t<dcscor:item>')
|
||||
lines.append(f'{indent}\t\t\t\t<dcscor:choiceParameter>{esc_xml(str(cp.get("name", "")))}</dcscor:choiceParameter>')
|
||||
for v in cp.get('values', []) or []:
|
||||
lines.append(f'{indent}\t\t\t\t<dcscor:value xsi:type="dcscor:DesignTimeValue">{esc_xml(str(v))}</dcscor:value>')
|
||||
if isinstance(v, bool):
|
||||
vs = 'true' if v else 'false'
|
||||
lines.append(f'{indent}\t\t\t\t<dcscor:value xsi:type="xs:boolean">{vs}</dcscor:value>')
|
||||
elif isinstance(v, (int, float)):
|
||||
lines.append(f'{indent}\t\t\t\t<dcscor:value xsi:type="xs:decimal">{v}</dcscor:value>')
|
||||
else:
|
||||
lines.append(f'{indent}\t\t\t\t<dcscor:value xsi:type="dcscor:DesignTimeValue">{esc_xml(str(v))}</dcscor:value>')
|
||||
lines.append(f'{indent}\t\t\t</dcscor:item>')
|
||||
lines.append(f'{indent}\t\t</dcscor:value>')
|
||||
elif 'choiceParameterLinks' in item:
|
||||
|
||||
Reference in New Issue
Block a user