mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-06-15 18:34:57 +03:00
feat(skd-compile): inputParameters на параметрах + multilang в value
Параметр (parameters[]) может иметь свой inputParameters блок —
например <ФорматРедактирования> со значением xs:LocalStringType.
Раньше Emit-InputParameters использовался только для DataSet field;
теперь подключён и к Emit-Parameter (вывод после <use>).
emit_input_parameters value: добавлена поддержка multilang dict
({ru, en, ...} → LocalStringType). Раньше падал в xs:string.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# skd-compile v1.52 — Compile 1C DCS from JSON
|
||||
# skd-compile v1.53 — Compile 1C DCS from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[string]$DefinitionFile,
|
||||
@@ -799,6 +799,9 @@ function Emit-InputParameters {
|
||||
X "$indent`t`t<dcscor:value xsi:type=`"xs:boolean`">$vStr</dcscor:value>"
|
||||
} elseif ($val -is [int] -or $val -is [long] -or $val -is [double] -or $val -is [decimal]) {
|
||||
X "$indent`t`t<dcscor:value xsi:type=`"xs:decimal`">$val</dcscor:value>"
|
||||
} elseif ($val -is [hashtable] -or $val -is [System.Collections.IDictionary] -or $val -is [PSCustomObject]) {
|
||||
# Multilang dict {ru, en, ...} → LocalStringType
|
||||
Emit-MLText -tag "dcscor:value" -text $val -indent "$indent`t`t"
|
||||
} else {
|
||||
X "$indent`t`t<dcscor:value xsi:type=`"xs:string`">$(Esc-Xml "$val")</dcscor:value>"
|
||||
}
|
||||
@@ -1316,6 +1319,11 @@ function Emit-SingleParam {
|
||||
X "`t`t<use>$(Esc-Xml $useVal)</use>"
|
||||
}
|
||||
|
||||
# InputParameters на параметре (ФорматРедактирования и т.п.)
|
||||
if ($null -ne $p -and $p -isnot [string] -and $p.inputParameters) {
|
||||
Emit-InputParameters -ip $p.inputParameters -indent "`t`t"
|
||||
}
|
||||
|
||||
X "`t</parameter>"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# skd-compile v1.52 — Compile 1C DCS from JSON
|
||||
# skd-compile v1.53 — Compile 1C DCS from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
import argparse
|
||||
import json
|
||||
@@ -605,6 +605,9 @@ def emit_input_parameters(lines, ip, indent):
|
||||
lines.append(f'{indent}\t\t<dcscor:value xsi:type="xs:boolean">{vstr}</dcscor:value>')
|
||||
elif isinstance(val, (int, float)):
|
||||
lines.append(f'{indent}\t\t<dcscor:value xsi:type="xs:decimal">{val}</dcscor:value>')
|
||||
elif isinstance(val, dict):
|
||||
# Multilang dict {ru, en, ...} → LocalStringType
|
||||
emit_mltext(lines, f'{indent}\t\t', 'dcscor:value', val)
|
||||
else:
|
||||
lines.append(f'{indent}\t\t<dcscor:value xsi:type="xs:string">{esc_xml(str(val))}</dcscor:value>')
|
||||
lines.append(f'{indent}\t</dcscor:item>')
|
||||
@@ -1132,6 +1135,10 @@ def emit_single_param(lines, p, parsed):
|
||||
if use_val:
|
||||
lines.append(f'\t\t<use>{esc_xml(use_val)}</use>')
|
||||
|
||||
# InputParameters на параметре (ФорматРедактирования и т.п.)
|
||||
if p is not None and not isinstance(p, str) and p.get('inputParameters'):
|
||||
emit_input_parameters(lines, p['inputParameters'], '\t\t')
|
||||
|
||||
lines.append('\t</parameter>')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user