mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-05 09:40:52 +03:00
feat(skd-compile): dataParameters auto — наследовать variant для StandardPeriod
Для параметров типа StandardPeriod в режиме "dataParameters": "auto" эмитируется <dcscor:value> с variant из дефолта параметра (Custom, если не задан) — как это делает 1C Designer при сохранении SettingsParameterValue для периодов. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
1b46eb4d85
commit
be74d224be
@@ -1,4 +1,4 @@
|
||||
# skd-compile v1.14 — Compile 1C DCS from JSON
|
||||
# skd-compile v1.15 — Compile 1C DCS from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[string]$DefinitionFile,
|
||||
@@ -2170,6 +2170,21 @@ function Emit-SettingsVariants {
|
||||
$dpItem | Add-Member -NotePropertyName "parameter" -NotePropertyValue $ap.name
|
||||
$dpItem | Add-Member -NotePropertyName "use" -NotePropertyValue $false
|
||||
$dpItem | Add-Member -NotePropertyName "userSettingID" -NotePropertyValue "auto"
|
||||
# For StandardPeriod emit <dcscor:value> with variant inherited from
|
||||
# the parameter default (Custom if none) — matches how 1C Designer
|
||||
# persists SettingsParameterValue for period parameters.
|
||||
if ($ap.type -eq 'StandardPeriod') {
|
||||
$variant = 'Custom'
|
||||
$av = $ap.value
|
||||
if ($null -ne $av) {
|
||||
if (($av -is [PSCustomObject] -or $av -is [hashtable]) -and $av.variant) {
|
||||
$variant = "$($av.variant)"
|
||||
} elseif ("$av") {
|
||||
$variant = "$av"
|
||||
}
|
||||
}
|
||||
$dpItem | Add-Member -NotePropertyName "value" -NotePropertyValue @{ variant = $variant }
|
||||
}
|
||||
$autoDP += $dpItem
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user