mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-18 07:35:52 +03:00
feat(form-decompile,form-compile): StandardBeginningDate в значении фильтра — структурно {variant, date?}
Значение фильтра типа v8:StandardBeginningDate (стандартная дата начала) серилизуется
структурно: <v8:variant xsi:type="v8:StandardBeginningDateVariant">Custom</v8:variant>
+ <v8:date>… (Custom несёт дату; именованные варианты — без). Компилятор эмитил
плоскую склейку InnerText (Custom3999-12-31T23:59:59), декомпилятор брал
сцепленный текст. Корпус 8.3.24: 307 случаев (Custom 280 с датой, BeginningOfThisDay
23, …Week 3, …Year 1; StandardEndDate/StandardPeriod как значение фильтра не
встречаются, но обработаны симметрично).
Не «забытый порт» — skd-decompile тоже не структурирует SBD в filter right (только в
dataParameters). DSL: value = {variant, date?} + valueType="v8:StandardBeginningDate".
Декомпилятор Get-FilterValueWithType читает variant/date; компилятор Emit-FilterItem
эмитит структурно (variant xsi:type выводится из valueType). Зеркало py.
Форма УправлениеОбменом (ДатаЗакрытия = SBD, op Equal): SBD-потерь 0 (остаток diff —
несвязанный TitleFont/FooterText). Кейс input-fields (+CA фильтр SBD Custom+date и
именованный вариант) сертифицирован в 1С, round-trip декомпиляции подтверждён.
Регресс 43/43.
ОТДЕЛЬНАЯ НАХОДКА (не в этом коммите): операторы Filled/NotFilled несут
тип-зависимый плейсхолдер <dcsset:right> (пустой xs:string для строк, SBD с дефолт.
датой для дат), который декомпилятор дропает как беззначный — нужен отдельный фикс.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
459d3feb69
commit
3ce71d436f
@@ -1,4 +1,4 @@
|
||||
# form-compile v1.116 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.117 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[string]$JsonPath,
|
||||
@@ -1718,6 +1718,20 @@ function Emit-FilterItem {
|
||||
X "$indent`t<dcsset:right xsi:type=`"$vt`">$vStr</dcsset:right>"
|
||||
}
|
||||
}
|
||||
} elseif ($null -ne $item.value -and "$($item.valueType)" -match 'Standard(Beginning|End)Date$' -and (($item.value -is [PSCustomObject]) -or ($item.value -is [System.Collections.IDictionary]))) {
|
||||
# Стандартная дата начала/окончания: структурное значение {variant, date?}.
|
||||
# Custom несёт <v8:date>; именованные варианты (BeginningOfThisDay/…) — без даты.
|
||||
$sdType = "$($item.valueType)" -replace '^v8:',''
|
||||
$sv = $item.value
|
||||
$variant = if ($sv -is [PSCustomObject]) { "$($sv.variant)" } else { "$($sv['variant'])" }
|
||||
$hasDate = if ($sv -is [PSCustomObject]) { [bool]$sv.PSObject.Properties['date'] } else { $sv.Contains('date') }
|
||||
X "$indent`t<dcsset:right xsi:type=`"v8:$sdType`">"
|
||||
X "$indent`t`t<v8:variant xsi:type=`"v8:${sdType}Variant`">$(Esc-Xml $variant)</v8:variant>"
|
||||
if ($hasDate) {
|
||||
$dateV = if ($sv -is [PSCustomObject]) { "$($sv.date)" } else { "$($sv['date'])" }
|
||||
X "$indent`t`t<v8:date>$(Esc-Xml $dateV)</v8:date>"
|
||||
}
|
||||
X "$indent`t</dcsset:right>"
|
||||
} elseif ($null -ne $item.value) {
|
||||
$vt = if ($item.valueType) { "$($item.valueType)" } else { "" }
|
||||
if (-not $vt) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# form-compile v1.116 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.117 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
import argparse
|
||||
import copy
|
||||
@@ -1465,6 +1465,15 @@ def emit_filter_item(lines, item, indent):
|
||||
vt = _value_type_for(v, item.get('valueType'))
|
||||
v_str = str(v).lower() if isinstance(v, bool) else esc_xml(str(v))
|
||||
lines.append(f'{indent}\t<dcsset:right xsi:type="{vt}">{v_str}</dcsset:right>')
|
||||
elif val is not None and isinstance(val, dict) and re.search(r'Standard(Beginning|End)Date$', str(item.get('valueType') or '')):
|
||||
# Стандартная дата начала/окончания: структурное значение {variant, date?}.
|
||||
# Custom несёт <v8:date>; именованные варианты (BeginningOfThisDay/…) — без даты.
|
||||
sd_type = re.sub(r'^v8:', '', str(item['valueType']))
|
||||
lines.append(f'{indent}\t<dcsset:right xsi:type="v8:{sd_type}">')
|
||||
lines.append(f'{indent}\t\t<v8:variant xsi:type="v8:{sd_type}Variant">{esc_xml(str(val.get("variant", "")))}</v8:variant>')
|
||||
if 'date' in val:
|
||||
lines.append(f'{indent}\t\t<v8:date>{esc_xml(str(val["date"]))}</v8:date>')
|
||||
lines.append(f'{indent}\t</dcsset:right>')
|
||||
elif val is not None:
|
||||
vt = _value_type_for(val, item.get('valueType'))
|
||||
v_str = str(val).lower() if isinstance(val, bool) else esc_xml(str(val))
|
||||
|
||||
Reference in New Issue
Block a user