mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-06-26 06:54:38 +03:00
feat(skd-decompile): чтение useInXxx и use=false на conditionalAppearance
Build-ConditionalAppearance теперь читает: - <dcsset:use>false</...> → use: false - любые <dcsset:useInXxx>DontUse</...> → элемент в массиве useInDontUse (имена тегов: useInGroup → "group", useInFieldsHeader → "fieldsHeader", и т.п.) Эффект на sample30: −187 строк diff. Существенная часть LOST <use> и LOST <content>/<lang> (внутри useInXxx-окружения) закрыта. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# skd-decompile v0.35 — Decompile 1C DCS Template.xml to JSON DSL (draft)
|
||||
# skd-decompile v0.36 — Decompile 1C DCS Template.xml to JSON DSL (draft)
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
@@ -1568,6 +1568,22 @@ function Build-ConditionalAppearance {
|
||||
if ($vmN) { $entry['viewMode'] = $vmN.InnerText }
|
||||
$usid = Get-Text $it "dcsset:userSettingID"
|
||||
if ($usid) { $entry['userSettingID'] = 'auto' }
|
||||
# use=false на самом condAppearance item
|
||||
$useV = Get-Text $it "dcsset:use"
|
||||
if ($useV -eq 'false') { $entry['use'] = $false }
|
||||
# useInXxx — управляет где применяется правило оформления
|
||||
# (group, hierarchicalGroup, overall, fieldsHeader, header, parameters,
|
||||
# filter, resourceFieldsHeader, overallHeader, overallResourceFieldsHeader)
|
||||
$useInDontUse = @()
|
||||
foreach ($ch in $it.ChildNodes) {
|
||||
if ($ch.NodeType -ne 'Element' -or $ch.NamespaceURI -ne 'http://v8.1c.ru/8.1/data-composition-system/settings') { continue }
|
||||
if ($ch.LocalName -match '^useIn(.+)$' -and $ch.InnerText -eq 'DontUse') {
|
||||
# Преобразуем useInGroup → group, useInFieldsHeader → fieldsHeader
|
||||
$shortName = ($matches[1]).Substring(0, 1).ToLower() + ($matches[1]).Substring(1)
|
||||
$useInDontUse += $shortName
|
||||
}
|
||||
}
|
||||
if ($useInDontUse.Count -gt 0) { $entry['useInDontUse'] = $useInDontUse }
|
||||
$out += $entry
|
||||
$i++
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user