mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-05 09:40:52 +03:00
feat(skd): modify-parameter operation, availableValues/denyIncompleteValues support
- skd-edit: new modify-parameter operation — set use, denyIncompleteValues, add availableValue entries to existing parameters - skd-compile: availableValues array and denyIncompleteValues in parameter JSON DSL - Auto-detect DesignTimeValue type for reference values in availableValue entries Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
87e636f644
commit
d755c41233
@@ -754,6 +754,28 @@ def emit_single_param(lines, p, parsed):
|
||||
if parsed.get('valueListAllowed'):
|
||||
lines.append('\t\t<valueListAllowed>true</valueListAllowed>')
|
||||
|
||||
# AvailableValues
|
||||
if p is not None and not isinstance(p, str) and p.get('availableValues'):
|
||||
for av in p['availableValues']:
|
||||
av_val = str(av.get('value', ''))
|
||||
av_type = 'xs:string'
|
||||
if re.match(r'^(Перечисление|Справочник|ПланСчетов|Документ|ПланВидовХарактеристик|ПланВидовРасчета)\.', av_val):
|
||||
av_type = 'dcscor:DesignTimeValue'
|
||||
lines.append('\t\t<availableValue>')
|
||||
lines.append(f'\t\t\t<value xsi:type="{av_type}">{esc_xml(av_val)}</value>')
|
||||
if av.get('presentation'):
|
||||
lines.append('\t\t\t<presentation xsi:type="v8:LocalStringType">')
|
||||
lines.append('\t\t\t\t<v8:item>')
|
||||
lines.append('\t\t\t\t\t<v8:lang>ru</v8:lang>')
|
||||
lines.append(f'\t\t\t\t\t<v8:content>{esc_xml(str(av["presentation"]))}</v8:content>')
|
||||
lines.append('\t\t\t\t</v8:item>')
|
||||
lines.append('\t\t\t</presentation>')
|
||||
lines.append('\t\t</availableValue>')
|
||||
|
||||
# DenyIncompleteValues
|
||||
if p is not None and not isinstance(p, str) and p.get('denyIncompleteValues') is True:
|
||||
lines.append('\t\t<denyIncompleteValues>true</denyIncompleteValues>')
|
||||
|
||||
# Use
|
||||
if p is not None and not isinstance(p, str) and p.get('use'):
|
||||
lines.append(f'\t\t<use>{esc_xml(str(p["use"]))}</use>')
|
||||
|
||||
Reference in New Issue
Block a user