mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-20 09:30:59 +03:00
feat(form-decompile,form-compile): Command AssociatedTableElementId (используемая таблица)
Свойство команды «Используемая таблица» — ссылка по ИМЕНИ элемента-таблицы (<AssociatedTableElementId xsi:type="xs:string">Имя</…>, 240 в корпусе, всегда xs:string). Команда работает в контексте этой таблицы (текущая строка). - Ключ table; forgiving-синонимы associatedTableElementId (XML-тег) и ИспользуемаяТаблица (рус., регистро-/пробело-незав.) — команды идут отдельным путём Emit-Commands, не через PROP_SYNONYMS слой Emit-Element. - CurrentRowUse («использование текущей строки») уже поддерживался. Зеркало py. Кейс table расширен (table + currentRowUse), сертифицирован загрузкой в 1С. Регресс 39/39 в обоих рантаймах. 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
fd9539dd20
commit
8aad132cc3
@@ -1,4 +1,4 @@
|
|||||||
# form-compile v1.89 — Compile 1C managed form from JSON or object metadata
|
# form-compile v1.90 — Compile 1C managed form from JSON or object metadata
|
||||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
param(
|
param(
|
||||||
[string]$JsonPath,
|
[string]$JsonPath,
|
||||||
@@ -4766,6 +4766,15 @@ function Emit-Commands {
|
|||||||
X "$inner<CurrentRowUse>$($cmd.currentRowUse)</CurrentRowUse>"
|
X "$inner<CurrentRowUse>$($cmd.currentRowUse)</CurrentRowUse>"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Используемая таблица — имя элемента-таблицы (xsi:type обязателен).
|
||||||
|
# Forgiving-ключи: table / associatedTableElementId (XML-тег) / ИспользуемаяТаблица (рус., регистр-незав.)
|
||||||
|
$cmdTable = $cmd.table
|
||||||
|
if (-not $cmdTable) { $cmdTable = $cmd.associatedTableElementId }
|
||||||
|
if (-not $cmdTable) { $cmdTable = $cmd.используемаяТаблица }
|
||||||
|
if ($cmdTable) {
|
||||||
|
X "$inner<AssociatedTableElementId xsi:type=`"xs:string`">$(Esc-Xml "$cmdTable")</AssociatedTableElementId>"
|
||||||
|
}
|
||||||
|
|
||||||
if ($cmd.shortcut) {
|
if ($cmd.shortcut) {
|
||||||
X "$inner<Shortcut>$($cmd.shortcut)</Shortcut>"
|
X "$inner<Shortcut>$($cmd.shortcut)</Shortcut>"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# form-compile v1.89 — Compile 1C managed form from JSON or object metadata
|
# form-compile v1.90 — Compile 1C managed form from JSON or object metadata
|
||||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
import argparse
|
import argparse
|
||||||
import copy
|
import copy
|
||||||
@@ -4461,6 +4461,14 @@ def emit_commands(lines, cmds, indent):
|
|||||||
if cmd.get('currentRowUse'):
|
if cmd.get('currentRowUse'):
|
||||||
lines.append(f'{inner}<CurrentRowUse>{cmd["currentRowUse"]}</CurrentRowUse>')
|
lines.append(f'{inner}<CurrentRowUse>{cmd["currentRowUse"]}</CurrentRowUse>')
|
||||||
|
|
||||||
|
# Используемая таблица — имя элемента-таблицы (xsi:type обязателен).
|
||||||
|
# Forgiving-ключи: table / associatedTableElementId (XML-тег) / ИспользуемаяТаблица (рус., регистр-незав.)
|
||||||
|
_cmd_norm = {k.replace(' ', '').lower(): v for k, v in cmd.items()}
|
||||||
|
cmd_table = (_cmd_norm.get('table') or _cmd_norm.get('associatedtableelementid')
|
||||||
|
or _cmd_norm.get('используемаятаблица'))
|
||||||
|
if cmd_table:
|
||||||
|
lines.append(f'{inner}<AssociatedTableElementId xsi:type="xs:string">{esc_xml(str(cmd_table))}</AssociatedTableElementId>')
|
||||||
|
|
||||||
if cmd.get('shortcut'):
|
if cmd.get('shortcut'):
|
||||||
lines.append(f'{inner}<Shortcut>{cmd["shortcut"]}</Shortcut>')
|
lines.append(f'{inner}<Shortcut>{cmd["shortcut"]}</Shortcut>')
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# form-decompile v0.65 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
# form-decompile v0.66 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
||||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
|
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
|
||||||
param(
|
param(
|
||||||
@@ -1934,6 +1934,8 @@ if ($cmdsNode) {
|
|||||||
$us = Decompile-XrFlag $c 'Use'; if ($null -ne $us) { $co['use'] = $us }
|
$us = Decompile-XrFlag $c 'Use'; if ($null -ne $us) { $co['use'] = $us }
|
||||||
$cfo = Decompile-FunctionalOptions $c; if ($cfo) { $co['functionalOptions'] = $cfo }
|
$cfo = Decompile-FunctionalOptions $c; if ($cfo) { $co['functionalOptions'] = $cfo }
|
||||||
$cru = Get-Child $c 'CurrentRowUse'; if ($cru) { $co['currentRowUse'] = $cru }
|
$cru = Get-Child $c 'CurrentRowUse'; if ($cru) { $co['currentRowUse'] = $cru }
|
||||||
|
# Используемая таблица — ссылка по имени элемента-таблицы (<AssociatedTableElementId xsi:type="xs:string">Имя</…>)
|
||||||
|
$ate = Get-Child $c 'AssociatedTableElementId'; if ($ate) { $co['table'] = $ate }
|
||||||
$sc = Get-Child $c 'Shortcut'; if ($sc) { $co['shortcut'] = $sc }
|
$sc = Get-Child $c 'Shortcut'; if ($sc) { $co['shortcut'] = $sc }
|
||||||
$ref = $c.SelectSingleNode("lf:Picture/xr:Ref", $ns); if ($ref) { $co['picture'] = $ref.InnerText }
|
$ref = $c.SelectSingleNode("lf:Picture/xr:Ref", $ns); if ($ref) { $co['picture'] = $ref.InnerText }
|
||||||
# Дефолт у picture команды = true → фиксируем только отклонение false (true опускаем)
|
# Дефолт у picture команды = true → фиксируем только отклонение false (true опускаем)
|
||||||
|
|||||||
@@ -895,6 +895,7 @@ Pages поддерживает `pagesRepresentation`: `None`, `TabsOnTop`, `Tabs
|
|||||||
| `use` | bool/object | Доступность команды по ролям (`<Use>`). См. §4.1c |
|
| `use` | bool/object | Доступность команды по ролям (`<Use>`). См. §4.1c |
|
||||||
| `functionalOptions` | array | Функциональные опции команды (см. §5) |
|
| `functionalOptions` | array | Функциональные опции команды (см. §5) |
|
||||||
| `currentRowUse` | string | Использование текущей строки: `Auto`, `DontUse`, `Use` |
|
| `currentRowUse` | string | Использование текущей строки: `Auto`, `DontUse`, `Use` |
|
||||||
|
| `table` | string | Используемая таблица — имя элемента-таблицы формы (`<AssociatedTableElementId xsi:type="xs:string">Имя</…>`). Команда работает в контексте этой таблицы (текущая строка). Forgiving-синонимы: `associatedTableElementId` (XML-тег), `ИспользуемаяТаблица` (рус., регистро-/пробело-независимо) |
|
||||||
| `modifiesSavedData` | bool | Команда изменяет сохраняемые данные (`<ModifiesSavedData>`); эмитится только `true` |
|
| `modifiesSavedData` | bool | Команда изменяет сохраняемые данные (`<ModifiesSavedData>`); эмитится только `true` |
|
||||||
| `shortcut` | string | Клавиатурное сочетание |
|
| `shortcut` | string | Клавиатурное сочетание |
|
||||||
| `picture` | string | Ссылка на картинку |
|
| `picture` | string | Ссылка на картинку |
|
||||||
|
|||||||
+2
@@ -168,6 +168,8 @@
|
|||||||
</v8:item>
|
</v8:item>
|
||||||
</Title>
|
</Title>
|
||||||
<Action>ОбновитьОбработка</Action>
|
<Action>ОбновитьОбработка</Action>
|
||||||
|
<CurrentRowUse>Use</CurrentRowUse>
|
||||||
|
<AssociatedTableElementId xsi:type="xs:string">Данные</AssociatedTableElementId>
|
||||||
</Command>
|
</Command>
|
||||||
</Commands>
|
</Commands>
|
||||||
</Form>
|
</Form>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
]}
|
]}
|
||||||
],
|
],
|
||||||
"commands": [
|
"commands": [
|
||||||
{ "name": "Обновить", "action": "ОбновитьОбработка" }
|
{ "name": "Обновить", "action": "ОбновитьОбработка", "currentRowUse": "Use", "table": "Данные" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user