mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-18 07:35:52 +03:00
feat(skd): orderExpression — сортировка поля по выражению (round-trip)
- skd-compile (ps1+py): object-form ключ orderExpression{expression,orderType,autoOrder}
→ <r:orderExpression><dcscom:expression/><dcscom:orderType/><dcscom:autoOrder/>
- skd-decompile: читает <r:orderExpression> → object form поля, без SilentDrop warning
- SKILL.md skd-compile: одна строка в "Дополнительные ключи объектной формы"
- docs/skd-dsl-spec.md: пример в объектной форме поля
- Новый тест field-order-expression (round-trip bit-perfect)
- Versions: compile v1.28→v1.29, decompile v0.10→v0.11
На сэмпле 30 ERP-отчётов: SilentDrop:orderExpression 11 → 0.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# skd-compile v1.28 — Compile 1C DCS from JSON
|
||||
# skd-compile v1.29 — Compile 1C DCS from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[string]$DefinitionFile,
|
||||
@@ -767,6 +767,10 @@ function Emit-Field {
|
||||
if ($fieldDef.attrRestrict) {
|
||||
$f["attrRestrict"] = @($fieldDef.attrRestrict)
|
||||
}
|
||||
# orderExpression — {expression, orderType, autoOrder}
|
||||
if ($fieldDef.orderExpression) {
|
||||
$f["orderExpression"] = $fieldDef.orderExpression
|
||||
}
|
||||
}
|
||||
|
||||
X "$indent<field xsi:type=`"DataSetFieldField`">"
|
||||
@@ -829,6 +833,19 @@ function Emit-Field {
|
||||
X "$indent`t</role>"
|
||||
}
|
||||
|
||||
# OrderExpression — после role, до valueType
|
||||
if ($f["orderExpression"]) {
|
||||
$oe = $f["orderExpression"]
|
||||
$expr = if ($oe.expression) { "$($oe.expression)" } else { '' }
|
||||
$oType = if ($oe.orderType) { "$($oe.orderType)" } else { 'Asc' }
|
||||
$autoOrder = if ($null -ne $oe.autoOrder) { $(if ($oe.autoOrder) { 'true' } else { 'false' }) } else { 'false' }
|
||||
X "$indent`t<orderExpression>"
|
||||
X "$indent`t`t<dcscom:expression>$(Esc-Xml $expr)</dcscom:expression>"
|
||||
X "$indent`t`t<dcscom:orderType>$oType</dcscom:orderType>"
|
||||
X "$indent`t`t<dcscom:autoOrder>$autoOrder</dcscom:autoOrder>"
|
||||
X "$indent`t</orderExpression>"
|
||||
}
|
||||
|
||||
# ValueType
|
||||
if ($f.type) {
|
||||
X "$indent`t<valueType>"
|
||||
|
||||
Reference in New Issue
Block a user