odant-work 1.0.91 → 1.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/#system/certs/russian_trusted_root_ca.pem +32 -32
- package/#system/mail.json.example +9 -9
- package/#system/package-manifest.json +332 -373
- package/#system/settings.json.example +3 -3
- package/$server/$folder/$class/$data/handlers/pages/form/objects/$handler/class.js +2158 -0
- package/$server/$folder/$class/$data/handlers/pages/form/objects/object/$handler/class.js +1377 -0
- package/$server/$folder/$class/$domain/class.js +4 -4
- package/$server/$folder/$class/$handler/$trigger/class.js +3 -3
- package/$server/$folder/$class/$handler/class.js +9 -9
- package/$server/$folder/$class/$handler/handlers/pages/editor/$handler/class.js +5 -5
- package/$server/$folder/$class/$handler/readme.md +23 -23
- package/$server/$folder/$class/$module/handlers/pages/form/system/{$handler/tabs/mcp/$handler/mcp.js → mcp/$handler/class.js} +251 -210
- package/$server/$folder/$class/$module/handlers/pages/form/system/{$handler/tabs/modules → modules}/$handler/class.js +1 -0
- package/$server/$folder/$class/$structure/$organization/handlers/pages/site/$handler/{site.js → class.js} +351 -364
- package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/{$handler/tabs/license/$handler/license.js → license/$handler/class.js} +104 -103
- package/$server/$folder/$class/$structure/$server/handlers/pages/site/$handler/{site.js → class.js} +45 -30
- package/$server/$folder/$class/$structure/$user/class.js +2 -2
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/agent/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/messengers/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/modules/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/{$handler/tabs/profile/$handler/profile.js → profile/$handler/class.js} +6 -2
- package/$server/$folder/$class/$structure/handlers/pages/data/$handler/class.js +308 -5
- package/$server/$folder/$class/$structure/handlers/pages/explorer/$handler/class.js +14 -3
- package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/class.js +1281 -7
- package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/readme.md +40 -40
- package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/class.js +2216 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/class.js +1304 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/search/$handler/class.js +305 -5
- package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/agent/$handler/agent.js → agent/$handler/class.js} +329 -320
- package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/database/$handler/database.js → database/$handler/class.js} +510 -577
- package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/messengers/$handler/messengers.js → messengers/$handler/class.js} +142 -143
- package/$server/$folder/$class/$structure/handlers/pages/form/system/modules/$handler/class.js +270 -0
- package/$server/$folder/$class/$structure/handlers/pages/form/system/staff/$handler/class.js +2114 -0
- package/$server/$folder/$class/$structure/handlers/pages/site/$handler/class.js +229 -4
- package/$server/$folder/$class/ai/config.js +19 -19
- package/$server/$folder/$class/ai/prompt/$method/class.js +41 -41
- package/$server/$folder/$class/ai/skills/approval-flow.md +14 -14
- package/$server/$folder/$class/ai/skills/backup-check.md +13 -13
- package/$server/$folder/$class/ai/skills/computer.md +27 -27
- package/$server/$folder/$class/ai/skills/delegate-task.md +15 -15
- package/$server/$folder/$class/ai/skills/external-signup.md +14 -14
- package/$server/$folder/$class/ai/skills/onboarding.md +15 -15
- package/$server/$folder/$class/ai/skills/orchestration.md +41 -41
- package/$server/$folder/$class/ai/system.md +1 -1
- package/$server/$folder/$class/class.js +0 -3
- package/$server/$folder/$class/handlers/pages/form/folder/$handler/class.js +3 -0
- package/$server/$folder/$class/handlers/pages/form/system/$handler/class.js +2 -4
- package/$server/$folder/$class/handlers/pages/form/system/{$handler/tabs/files → files}/$handler/class.js +2 -0
- package/$server/$folder/$class/handlers/pages/form/system/{$handler/tabs/requisites/$handler/requisites.js → requisites/$handler/class.js} +43 -36
- package/$server/$folder/$class/handlers/pages/storage/$handler/class.js +25 -6
- package/$server/$folder/$file/$audio/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$audio/handlers/preview/$handler/preview.js +88 -88
- package/$server/$folder/$file/$call/class.js +10 -10
- package/$server/$folder/$file/$call/handlers/preview/$handler/class.js +4 -4
- package/$server/$folder/$file/$call/triggers/on_save/$trigger/class.js +48 -48
- package/$server/$folder/$file/$data/class.js +16 -16
- package/$server/$folder/$file/$data/handlers/pages/form/editor/$handler/class.js +31 -4
- package/$server/$folder/$file/$devs/$js/class.js +2 -2
- package/$server/$folder/$file/$devs/$json/class.js +2 -2
- package/$server/$folder/$file/$devs/$ts/class.js +2 -2
- package/$server/$folder/$file/$devs/handlers/pages/form/file/$handler/class.js +30 -2
- package/$server/$folder/$file/$eml/class.js +17 -17
- package/$server/$folder/$file/$ics/class.js +44 -44
- package/$server/$folder/$file/$ics/handlers/pages/form/file/$handler/class.js +10 -2
- package/$server/$folder/$file/$ics/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$ics/handlers/preview/$handler/preview.js +67 -67
- package/$server/$folder/$file/$ics/readme.md +21 -21
- package/$server/$folder/$file/$image/$svg/class.js +11 -11
- package/$server/$folder/$file/$image/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$image/handlers/preview/$handler/preview.js +33 -33
- package/$server/$folder/$file/$ipynb/handlers/pages/form/file/$handler/class.js +82 -2
- package/$server/$folder/$file/$logs/class.js +39 -39
- package/$server/$folder/$file/$logs/handlers/methods/txt-test/$handler/class.js +4 -4
- package/$server/$folder/$file/$md/handlers/pages/form/file/$handler/class.js +60 -2
- package/$server/$folder/$file/$office/$outlook/$ics/class.js +227 -227
- package/$server/$folder/$file/$office/$word/$rtf/template.rtf +159 -159
- package/$server/$folder/$file/$office/handlers/pages/form/file/$handler/class.js +1699 -2
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/class.js +827 -2
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/readme.md +1 -1
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/feed.js +17 -0
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/panel.js +7 -1
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/util.js +1 -0
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/voice-policy.js +6 -2
- package/$server/$folder/$file/$task/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$task/readme.md +32 -32
- package/$server/$folder/$file/$txt/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$txt/handlers/preview/$handler/preview.js +41 -41
- package/$server/$folder/$file/$video/handlers/preview/$handler/class.js +4 -4
- package/$server/$folder/$file/$video/handlers/preview/$handler/preview.js +13 -13
- package/$server/$folder/$file/class.js +2 -2
- package/$server/$folder/$file/handlers/methods/download/$handler/class.js +2 -2
- package/$server/$folder/$file/handlers/methods/download/$handler/download.js +4 -4
- package/$server/$folder/$file/handlers/pages/form/$handler/class.js +2 -2
- package/$server/$folder/$file/handlers/pages/form/file/$handler/class.js +32 -2
- package/$server/$folder/$file/handlers/pages/form/folder/$handler/class.js +3 -0
- package/$server/$folder/$file/readme.md +31 -31
- package/$server/$folder/class.js +11 -11
- package/$server/$folder/handlers/pages/form/$handler/class.js +2469 -5
- package/$server/$folder/handlers/pages/form/folder/$handler/class.js +22 -0
- package/$server/$folder/lib/chat-item/chat-item.js +2 -2
- package/$server/$folder/lib/email/settings.js +82 -82
- package/$server/$folder/lib/file-viewer/file-viewer.js +8 -8
- package/$server/$folder/lib/icon/user/user.js +6 -6
- package/$server/$folder/lib/item-data-grid/item-data-grid.js +48 -48
- package/$server/$folder/lib/item-form/item-form.js +84 -84
- package/$server/$folder/lib/menu/menu.js +3 -2
- package/$server/$folder/lib/menu/readme.md +29 -29
- package/$server/$folder/lib/node/readme.md +29 -29
- package/$server/$folder/lib/pack/pack.js +4 -4
- package/$server/$folder/lib/site-loc/readme.md +16 -16
- package/.github/workflows/ci.yml +39 -39
- package/AGENTS.md +1 -1
- package/{models/$ai/$folder/$class/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/$ai/$folder/$class/$ai/handlers/pages/form/system/ai/$handler/class.js} +383 -430
- package/{models/$ai/$folder/$class/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/$ai/$folder/$class/$provider/handlers/pages/form/system/ai/$handler/class.js} +155 -166
- package/{models → MODELS}/$ai/$folder/$class/$provider/readme.md +16 -16
- package/{models/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/$ai/handlers/pages/form/system/ai/$handler/class.js} +34 -33
- package/{models → MODELS}/GigaChat/$provider/readme.md +24 -24
- package/{models/Local/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/Local/$provider/handlers/pages/form/system/ai/$handler/class.js} +569 -626
- package/MODULES/$domain/handlers/pages/form/system/{$handler/tabs/mcp → mcp}/$handler/class.js +1 -0
- package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/class.js +648 -20
- package/MODULES/KLADR/$module/handlers/pages/form/kladr/$handler/class.js +140 -6
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/gantt/$handler/class.js" +305 -5
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/scheduler/$handler/class.js" +241 -5
- package/MODULES/Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/handlers/pages/form/bpmn/$handler/class.js" +515 -15
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/objects/$handler/class.js +3 -0
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/virtual/$handler/class.js +422 -5
- package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/241/321/207/321/221/321/202 /320/275/320/260 /320/276/320/277/320/273/320/260/321/202/321/203.html" +40 -40
- package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/242/320/276/320/262/320/260/321/200/320/275/320/260/321/217 /320/275/320/260/320/272/320/273/320/260/320/264/320/275/320/260/321/217.html" +56 -56
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/analysis/$handler/class.js +13 -7
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/postings/$handler/class.js +1791 -7
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/turnovers/$handler/class.js +13 -7
- package/MODULES/Register/REGISTER/$register/handlers/pages/form/journal/$handler/class.js +776 -5
- package/MODULES/Register/REGISTER/$register/handlers/pages/form/sheet/$handler/class.js +807 -5
- package/MODULES/Register/REGISTER/68/01/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/68/02/$account/class.js +1 -1
- package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/320/276/320/262/321/213/320/271 /321/200/320/265/320/267/320/265/321/200/320/262/$account/class.js" +1 -1
- package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/321/213//320/222 /320/276/321/202/320/277/321/203/321/201/320/272/320/265/$account/class.js" +1 -1
- package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/321/213//320/240/320/260/320/261/320/276/321/202/320/260/321/216/321/202/$account/class.js +1 -1
- package/MODULES/Register/REGISTER//320/242/320/265/321/205/320/275/320/270/321/207/320/265/321/201/320/272/320/270/320/271/$account/class.js +1 -1
- package/MODULES/Register/STRUCTS/$struct/class.js +4 -4
- package/NODES/$node/$folder/$class/$node/class.js +35 -35
- package/NODES/$node/class.js +5 -5
- package/NODES/$node/handlers/pages/form/network/$handler/class.js +121 -4
- package/oda/benchmarks/dbmon/lib/ENV.js +213 -213
- package/oda/benchmarks/dbmon/lib/ga.js +11 -11
- package/oda/benchmarks/dbmon/lib/memory-stats.js +105 -105
- package/oda/benchmarks/dbmon/lib/monitor.js +69 -69
- package/oda/benchmarks/sierpinski/sierpinski.js +149 -149
- package/oda/components/editors/code-editor/code-editor.js +387 -387
- package/oda/components/editors/code-editor/src/ace.js +16 -16
- package/oda/components/editors/code-editor/src/beautify-css.js +1625 -1625
- package/oda/components/editors/code-editor/src/beautify-html.js +3122 -3122
- package/oda/components/editors/code-editor/src/beautify.js +4005 -4005
- package/oda/components/editors/code-editor/src/ext-beautify.js +7 -7
- package/oda/components/editors/code-editor/src/ext-code_lens.js +7 -7
- package/oda/components/editors/code-editor/src/ext-elastic_tabstops_lite.js +7 -7
- package/oda/components/editors/code-editor/src/ext-emmet.js +7 -7
- package/oda/components/editors/code-editor/src/ext-error_marker.js +7 -7
- package/oda/components/editors/code-editor/src/ext-hardwrap.js +7 -7
- package/oda/components/editors/code-editor/src/ext-keybinding_menu.js +7 -7
- package/oda/components/editors/code-editor/src/ext-language_tools.js +7 -7
- package/oda/components/editors/code-editor/src/ext-linking.js +7 -7
- package/oda/components/editors/code-editor/src/ext-modelist.js +7 -7
- package/oda/components/editors/code-editor/src/ext-options.js +7 -7
- package/oda/components/editors/code-editor/src/ext-prompt.js +7 -7
- package/oda/components/editors/code-editor/src/ext-rtl.js +7 -7
- package/oda/components/editors/code-editor/src/ext-searchbox.js +7 -7
- package/oda/components/editors/code-editor/src/ext-settings_menu.js +7 -7
- package/oda/components/editors/code-editor/src/ext-spellcheck.js +7 -7
- package/oda/components/editors/code-editor/src/ext-split.js +7 -7
- package/oda/components/editors/code-editor/src/ext-static_highlight.js +7 -7
- package/oda/components/editors/code-editor/src/ext-statusbar.js +7 -7
- package/oda/components/editors/code-editor/src/ext-textarea.js +7 -7
- package/oda/components/editors/code-editor/src/ext-themelist.js +7 -7
- package/oda/components/editors/code-editor/src/ext-whitespace.js +7 -7
- package/oda/components/editors/code-editor/src/keybinding-emacs.js +7 -7
- package/oda/components/editors/code-editor/src/keybinding-sublime.js +7 -7
- package/oda/components/editors/code-editor/src/keybinding-vim.js +7 -7
- package/oda/components/editors/code-editor/src/keybinding-vscode.js +7 -7
- package/oda/components/editors/code-editor/src/mode-css.js +7 -7
- package/oda/components/editors/code-editor/src/mode-html.js +7 -7
- package/oda/components/editors/code-editor/src/mode-javascript.js +7 -7
- package/oda/components/editors/code-editor/src/mode-json.js +7 -7
- package/oda/components/editors/code-editor/src/mode-markdown.js +7 -7
- package/oda/components/editors/code-editor/src/mode-svg.js +7 -7
- package/oda/components/editors/code-editor/src/mode-text.js +7 -7
- package/oda/components/editors/code-editor/src/mode-xml.js +7 -7
- package/oda/components/editors/code-editor/src/mode-xquery.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/css.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/html.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/javascript.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/json.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/markdown.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/svg.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/text.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/xml.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/xquery.js +7 -7
- package/oda/components/editors/code-editor/src/theme-solarized_dark.js +7 -7
- package/oda/components/editors/code-editor/src/theme-solarized_light.js +7 -7
- package/oda/components/editors/markdown/markdown-editor/lib/font-awesome.min.css +3 -3
- package/oda/components/editors/markdown/markdown-editor/lib/readme.md +332 -332
- package/oda/components/editors/markdown/markdown-editor/markdown-editor.js +78 -78
- package/oda/components/editors/markdown/markdown-viewer/test.md +239 -239
- package/oda/components/editors/markdown/markdown.js +76 -76
- package/oda/components/inputs/block/readme.md +39 -39
- package/oda/components/inputs/checkbox/checkbox.js +92 -92
- package/oda/components/inputs/color/color.js +83 -83
- package/oda/components/inputs/date/date.js +40 -40
- package/oda/components/inputs/input/input.js +219 -219
- package/oda/components/inputs/link/link.js +1 -1
- package/oda/components/inputs/link/readme.md +42 -42
- package/oda/components/inputs/markdown-input/markdown-input.js +77 -77
- package/oda/components/inputs/numeric/numeric.js +141 -141
- package/oda/components/inputs/table-input/readme.md +39 -39
- package/oda/components/inputs/text/text.js +88 -88
- package/oda/components/inputs/toggle/toggle.js +101 -101
- package/oda/components/layouts/hexagon-layout/hexagon-layout.js +218 -218
- package/oda/components/menus/menu/index_old.html +140 -140
- package/oda/components/structure/controls-map.js +56 -56
- package/oda/components/structure/controls.js +29 -29
- package/oda/components/structure/readme.md +31 -31
- package/oda/components/structure/structure.js +64 -64
- package/oda/components/table/index.html +210 -210
- package/oda/components/table/lib/coerce.js +68 -68
- package/oda/components/table/lib/column.js +568 -568
- package/oda/components/table/readme.md +120 -120
- package/oda/components/table/router.js +86 -86
- package/oda/components/table/settings.js +89 -89
- package/oda/index.html +159 -159
- package/oda/tools/icons/icons-set/icons-set.js +60 -60
- package/oda/tools/icons/lib/svg/_makeSVG.html +41 -41
- package/oda/tools/icons/lib/svg/aws.svg +2679 -2679
- package/oda/tools/icons/lib/svg/info.json +46 -46
- package/oda/tools/jupyter/demo.ipynb +160 -160
- package/oda/tools/jupyter/lib/print_elements.js +73 -73
- package/oda/tools/jupyter/test-2.ipynb +305 -305
- package/oda/tools/jupyter/test.ipynb +603 -603
- package/oda/tools/styles/adoptedStyleSheets.js +333 -333
- package/oda/tools/tester/device-preview/devices.json +9 -9
- package/package.json +1 -1
- package/rules/rules.md +445 -445
- package/scripts/SYNC-README.md +107 -107
- package/scripts/agent-eval.mjs +223 -223
- package/scripts/dump-svn-chat.mjs +9 -9
- package/scripts/extract-chat-day.mjs +21 -21
- package/scripts/rag-bench.mjs +166 -166
- package/scripts/restore-chat.mjs +166 -166
- package/scripts/sync-svn-git.bat +129 -129
- package/scripts/test-merge.mjs +75 -75
- package/scripts/work-desktop-bridge.mjs +101 -101
- package/sources/client/class.js +3 -0
- package/sources/client/field.js +168 -168
- package/sources/client/handler.js +68 -32
- package/sources/client/index.js +32 -32
- package/sources/client/readme.md +16 -16
- package/sources/client.js +12 -0
- package/sources/core.js +91 -91
- package/sources/data/choices.js +125 -125
- package/sources/host/babel-merge.js +398 -353
- package/sources/host/config.js +48 -48
- package/sources/host/index-db.js +94 -94
- package/sources/host/net-guard.js +228 -228
- package/sources/host/package-install.js +63 -63
- package/sources/host/push.js +86 -86
- package/sources/host/readme.md +41 -41
- package/sources/host/secret-box.js +93 -93
- package/sources/host/server-id.js +26 -26
- package/sources/host/stun.js +33 -33
- package/sources/host/tls-ca.js +60 -60
- package/sources/host/vapid.js +14 -14
- package/sources/index.html +1 -1
- package/sources/modules/a2a/server.js +608 -608
- package/sources/modules/agent/connections.js +442 -442
- package/sources/modules/agent/diff.js +69 -69
- package/sources/modules/agent/eval.js +222 -222
- package/sources/modules/agent/hooks.js +131 -131
- package/sources/modules/agent/index.js +6 -3
- package/sources/modules/agent/log.js +43 -43
- package/sources/modules/agent/loop.js +65 -0
- package/sources/modules/agent/mcp-pool.js +253 -253
- package/sources/modules/agent/recovery.js +89 -89
- package/sources/modules/agent/scope.js +387 -0
- package/sources/modules/agent/session.js +350 -15
- package/sources/modules/agent/taint.js +100 -100
- package/sources/modules/agent/tools/branch.js +311 -311
- package/sources/modules/agent/tools/browser.js +254 -254
- package/sources/modules/agent/tools/computer.js +120 -120
- package/sources/modules/agent/tools/connect.js +316 -316
- package/sources/modules/agent/tools/dev/lsp.js +334 -334
- package/sources/modules/agent/tools/dev/patch.js +564 -564
- package/sources/modules/agent/tools/memory.js +153 -153
- package/sources/modules/agent/tools/meta.js +60 -0
- package/sources/modules/agent/tools/os-files.js +358 -358
- package/sources/modules/agent/tools/plugins.js +80 -80
- package/sources/modules/agent/tools/sandbox.js +268 -268
- package/sources/modules/agent/types.d.ts +183 -183
- package/sources/modules/agent/undo.js +254 -254
- package/sources/modules/agent/util.js +179 -179
- package/sources/modules/contacts/contacts.js +200 -200
- package/sources/modules/contacts/index.html +546 -546
- package/sources/modules/lan/discovery.js +192 -192
- package/sources/modules/lan/store.js +62 -62
- package/sources/modules/mcp/readme.md +70 -70
- package/sources/modules/mcp/server.js +525 -525
- package/sources/modules/mcp/tokens.js +140 -140
- package/sources/modules/nodes/identity.js +123 -123
- package/sources/modules/nodes/outbound.js +105 -105
- package/sources/modules/nodes/signing.js +71 -71
- package/sources/modules/rag/embed-worker.js +36 -36
- package/sources/modules/rag/readme.md +70 -70
- package/sources/modules/readme.md +21 -21
- package/sources/modules/sandbox/config.js +74 -74
- package/sources/modules/sandbox/driver.js +100 -100
- package/sources/modules/sandbox/images/work-computer/Dockerfile +34 -34
- package/sources/modules/sandbox/images/work-computer/entrypoint.sh +24 -24
- package/sources/modules/sandbox/manager.js +1089 -1089
- package/sources/modules/sandbox/readme.md +63 -63
- package/sources/modules/sandbox/vnc-proxy.js +296 -296
- package/sources/server/access/audit.js +138 -138
- package/sources/server/access/refs.js +106 -106
- package/sources/server/assert-class-id.js +23 -23
- package/sources/server/chat-threads.js +16 -5
- package/sources/server/class.js +4 -1
- package/sources/server/external-source.js +90 -90
- package/sources/server/file.js +1 -1
- package/sources/server/folder.js +75 -33
- package/sources/server/handler.js +25 -12
- package/sources/server/index.js +12 -12
- package/sources/server/memory-mark.js +34 -34
- package/sources/server/readme.md +110 -110
- package/sources/server/safe-node-name.js +67 -67
- package/sources/server/server.js +6 -6
- package/sources/server/upload-mark.js +24 -24
- package/sources/server/zip-guard.js +81 -81
- package/whitepaper.md +568 -568
- package/$server/$folder/$class/$module/handlers/pages/form/system/$handler/tabs/mcp/$handler/class.js +0 -9
- package/$server/$folder/$class/$module/handlers/pages/form/system/$handler/tabs/modules/$handler/modules.js +0 -1
- package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/$handler/tabs/license/$handler/class.js +0 -6
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/agent/$handler/class.js +0 -3
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/messengers/$handler/class.js +0 -3
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/modules/$handler/class.js +0 -3
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/profile/$handler/class.js +0 -5
- package/$server/$folder/$class/$structure/handlers/pages/data/$handler/data.js +0 -313
- package/$server/$folder/$class/$structure/handlers/pages/explorer/$handler/explorer.js +0 -16
- package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/calendar.js +0 -1226
- package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/chat.js +0 -2095
- package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/email.js +0 -1188
- package/$server/$folder/$class/$structure/handlers/pages/form/search/$handler/search.js +0 -289
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/agent/$handler/class.js +0 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/database/$handler/class.js +0 -9
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/messengers/$handler/class.js +0 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/modules/$handler/class.js +0 -5
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/modules/$handler/modules.js +0 -281
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/staff/$handler/class.js +0 -5
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/staff/$handler/staff.js +0 -2126
- package/$server/$folder/$class/$structure/handlers/pages/site/$handler/site.js +0 -240
- package/$server/$folder/$class/handlers/pages/form/object/$handler/class.js +0 -32
- package/$server/$folder/$class/handlers/pages/form/object/$handler/object.js +0 -1371
- package/$server/$folder/$class/handlers/pages/form/objects/$handler/class.js +0 -32
- package/$server/$folder/$class/handlers/pages/form/objects/$handler/objects.js +0 -2130
- package/$server/$folder/$class/handlers/pages/form/system/$handler/system.js +0 -309
- package/$server/$folder/$class/handlers/pages/form/system/$handler/tabs/files/$handler/files.js +0 -17
- package/$server/$folder/$class/handlers/pages/form/system/$handler/tabs/requisites/$handler/class.js +0 -16
- package/$server/$folder/$class/handlers/pages/storage/$handler/storage.js +0 -21
- package/$server/$folder/$file/$data/handlers/pages/form/editor/$handler/editor.js +0 -27
- package/$server/$folder/$file/$devs/handlers/pages/form/file/$handler/file.js +0 -31
- package/$server/$folder/$file/$ics/handlers/pages/form/file/$handler/file.js +0 -10
- package/$server/$folder/$file/$ipynb/handlers/pages/form/file/$handler/file.js +0 -72
- package/$server/$folder/$file/$md/handlers/pages/form/file/$handler/file.js +0 -63
- package/$server/$folder/$file/$office/handlers/pages/form/file/$handler/file.js +0 -1845
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/file.js +0 -760
- package/$server/$folder/$file/handlers/pages/form/file/$handler/file.js +0 -29
- package/$server/$folder/handlers/pages/form/$handler/form.js +0 -2122
- package/MODULES/$domain/handlers/pages/form/system/$handler/tabs/mcp/$handler/mcp.js +0 -1
- package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/map.js +0 -623
- package/MODULES/KLADR/$module/handlers/pages/form/kladr/$handler/kladr.js +0 -134
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/gantt/$handler/gantt.js" +0 -293
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/scheduler/$handler/scheduler.js" +0 -234
- package/MODULES/Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/handlers/pages/form/bpmn/$handler/bpmn.js" +0 -406
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/virtual/$handler/virtual.js +0 -399
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/analysis/$handler/analysis.js +0 -9
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/postings/$handler/postings.js +0 -1700
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/turnovers/$handler/turnovers.js +0 -9
- package/MODULES/Register/REGISTER/$register/handlers/pages/form/journal/$handler/journal.js +0 -723
- package/MODULES/Register/REGISTER/$register/handlers/pages/form/sheet/$handler/sheet.js +0 -808
- package/NODES/$node/handlers/pages/form/network/$handler/network.js +0 -110
- package/models/$ai/$folder/$class/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
- package/models/$ai/$folder/$class/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
- package/models/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
- package/models/Local/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
- /package/$server/$folder/$class/$structure/$organization/handlers/pages/form/system/{$handler/tabs/requisites → requisites}/$handler/class.js +0 -0
- /package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/{$handler/tabs/database → database}/$handler/class.js +0 -0
- /package/{models → MODELS}/$ai/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/$ai/$folder/$class/$ai/methods/chat/$method/class.js +0 -0
- /package/{models → MODELS}/$ai/$folder/$class/$provider/class.js +0 -0
- /package/{models → MODELS}/$ai/class.js +0 -0
- /package/{models → MODELS}/$ai/readme.md +0 -0
- /package/{models → MODELS}/GigaChat/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/GigaChat/$provider/class.js +0 -0
- /package/{models → MODELS}/GigaChat/GigaChat 2 Lite/$ai/class.js +0 -0
- /package/{models → MODELS}/GigaChat/GigaChat 2 Max/$ai/class.js +0 -0
- /package/{models → MODELS}/GigaChat/GigaChat 2 Pro/$ai/class.js +0 -0
- /package/{models → MODELS}/GigaChat/GigaChat Embeddings/$ai/class.js +0 -0
- /package/{models → MODELS}/Local/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/Local/$provider/class.js +0 -0
- /package/{models → MODELS}/Local/$provider/handlers/methods/transfer/$handler/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/$provider/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/Cotype Lite/$ai/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/Cotype Pro 2/$ai/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/Cotype Vision/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/$provider/class.js +0 -0
- /package/{models → MODELS}/T-Bank/T-Lite 2.0/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/T-Pro 2.0/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/T-VoiceKit ASR/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/T-VoiceKit TTS/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/$provider/class.js +0 -0
- /package/{models → MODELS}/Yandex/Alice AI (YandexGPT 5 Pro)/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/Yandex Embeddings/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/Yandex SpeechKit ASR/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/Yandex SpeechKit TTS/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/YandexART/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/YandexGPT 5 Lite/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/YandexGPT Reasoning/$ai/class.js +0 -0
- /package/{users → USERS}/$users/class.js +0 -0
|
@@ -1,808 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* form/sheet — Экран 1 ODANT: Общая оборотно-сальдовая ведомость Журнала (`db_sheet`, sources/data/api.js).
|
|
3
|
-
* Сверху — полоса периодов `oda-packets` с запоминанием выбранного периода.
|
|
4
|
-
* В центре — таблица с двухслойным заголовком (Счёт / Субсчёт | На начало: Дебет/Кредит | За период: Дебет/Кредит | На конец: Дебет/Кредит),
|
|
5
|
-
* вертикальными разделителями и прижатым к низу футером итогов.
|
|
6
|
-
* Переходы к счёту (Обороты | Анализ | Проводки) работают через штатные $handler Счёта на сервисной панели формы (`focusedItem`).
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const PERIOD_STORAGE_KEY = 'work.accounting.period';
|
|
10
|
-
|
|
11
|
-
function _day(d) {
|
|
12
|
-
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
|
13
|
-
}
|
|
14
|
-
const _today = () => _day(new Date());
|
|
15
|
-
const _yearStart = () => `${new Date().getFullYear()}-01-01`;
|
|
16
|
-
const _yearEnd = () => _today();
|
|
17
|
-
|
|
18
|
-
const money = v => (Number(v) ? Number(v).toLocaleString('ru-RU', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) : '');
|
|
19
|
-
|
|
20
|
-
function _readSavedPeriod() {
|
|
21
|
-
try {
|
|
22
|
-
const raw = typeof sessionStorage !== 'undefined' ? sessionStorage.getItem(PERIOD_STORAGE_KEY) : null;
|
|
23
|
-
if (!raw)
|
|
24
|
-
return null;
|
|
25
|
-
const parsed = JSON.parse(raw);
|
|
26
|
-
return parsed && typeof parsed === 'object' ? parsed : null;
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function _writeSavedPeriod(packetsKey, from, to) {
|
|
34
|
-
try {
|
|
35
|
-
if (typeof sessionStorage !== 'undefined')
|
|
36
|
-
sessionStorage.setItem(PERIOD_STORAGE_KEY, JSON.stringify({ packetsKey: packetsKey || '*', from: from || '', to: to || '' }));
|
|
37
|
-
}
|
|
38
|
-
catch { /* ignore */ }
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function _derivePacketsKey(from, to, fallback = '*') {
|
|
42
|
-
if (!from && !to)
|
|
43
|
-
return '*';
|
|
44
|
-
if (fallback && fallback !== '*')
|
|
45
|
-
return fallback;
|
|
46
|
-
if (from && to) {
|
|
47
|
-
const ym1 = /^(\d{4})-01-01$/.exec(from);
|
|
48
|
-
const ym2 = /^(\d{4})-12-31$/.exec(to);
|
|
49
|
-
if (ym1 && ym2 && ym1[1] === ym2[1])
|
|
50
|
-
return `${ym1[1]}*`;
|
|
51
|
-
return `period:${from}:${to}`;
|
|
52
|
-
}
|
|
53
|
-
return fallback || '*';
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function _daysInMonth(y, m) {
|
|
57
|
-
return new Date(y, m, 0).getDate();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function _weekBounds(dt) {
|
|
61
|
-
const dow = dt.getDay();
|
|
62
|
-
const diffToMon = dow === 0 ? -6 : 1 - dow;
|
|
63
|
-
const mon = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate() + diffToMon);
|
|
64
|
-
const sun = new Date(mon.getFullYear(), mon.getMonth(), mon.getDate() + 6);
|
|
65
|
-
return { from: _day(mon), to: _day(sun) };
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _boundsFromPacketsKey(key, defaultMode = 'month') {
|
|
69
|
-
const k = String(key || '').trim();
|
|
70
|
-
if (!k || k === '*')
|
|
71
|
-
return { from: '', to: '' };
|
|
72
|
-
if (k.startsWith('period:')) {
|
|
73
|
-
const [, s = '', e = ''] = k.split(':');
|
|
74
|
-
return { from: s, to: e };
|
|
75
|
-
}
|
|
76
|
-
if (k === 'now' || k.startsWith('now:')) {
|
|
77
|
-
const gran = k.startsWith('now:') ? k.slice(4) : defaultMode;
|
|
78
|
-
const now = new Date();
|
|
79
|
-
const y = now.getFullYear(), m = now.getMonth() + 1;
|
|
80
|
-
if (gran === 'day') {
|
|
81
|
-
const d = _day(now);
|
|
82
|
-
return { from: d, to: d };
|
|
83
|
-
}
|
|
84
|
-
if (gran === 'week')
|
|
85
|
-
return _weekBounds(now);
|
|
86
|
-
if (gran === 'quarter') {
|
|
87
|
-
const q = Math.floor((m - 1) / 3) + 1;
|
|
88
|
-
const m1 = String((q - 1) * 3 + 1).padStart(2, '0');
|
|
89
|
-
const m2 = (q - 1) * 3 + 3;
|
|
90
|
-
return { from: `${y}-${m1}-01`, to: `${y}-${String(m2).padStart(2, '0')}-${String(_daysInMonth(y, m2)).padStart(2, '0')}` };
|
|
91
|
-
}
|
|
92
|
-
if (gran === 'year')
|
|
93
|
-
return { from: `${y}-01-01`, to: `${y}-12-31` };
|
|
94
|
-
const ms = String(m).padStart(2, '0');
|
|
95
|
-
return { from: `${y}-${ms}-01`, to: `${y}-${ms}-${String(_daysInMonth(y, m)).padStart(2, '0')}` };
|
|
96
|
-
}
|
|
97
|
-
const clean = k.replace(/\*+$/, '');
|
|
98
|
-
if (/^\d{4}$/.test(clean))
|
|
99
|
-
return { from: `${clean}-01-01`, to: `${clean}-12-31` };
|
|
100
|
-
const qm = /^(\d{4})-q([1-4])$/i.exec(clean);
|
|
101
|
-
if (qm) {
|
|
102
|
-
const y = +qm[1], q = +qm[2];
|
|
103
|
-
const m1 = String((q - 1) * 3 + 1).padStart(2, '0');
|
|
104
|
-
const m2 = (q - 1) * 3 + 3;
|
|
105
|
-
return { from: `${y}-${m1}-01`, to: `${y}-${String(m2).padStart(2, '0')}-${String(_daysInMonth(y, m2)).padStart(2, '0')}` };
|
|
106
|
-
}
|
|
107
|
-
const mm = /^(\d{4})-(0[1-9]|1[0-2])$/.exec(clean);
|
|
108
|
-
if (mm) {
|
|
109
|
-
const y = +mm[1], m = +mm[2];
|
|
110
|
-
return { from: `${clean}-01`, to: `${clean}-${String(_daysInMonth(y, m)).padStart(2, '0')}` };
|
|
111
|
-
}
|
|
112
|
-
if (clean.startsWith('week:')) {
|
|
113
|
-
const monIso = clean.slice(5);
|
|
114
|
-
if (/^\d{4}-\d{2}-\d{2}$/.test(monIso)) {
|
|
115
|
-
const [y, m, d] = monIso.split('-').map(Number);
|
|
116
|
-
return _weekBounds(new Date(y, m - 1, d));
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
if (/^\d{4}-\d{2}-\d{2}$/.test(clean))
|
|
120
|
-
return { from: clean, to: clean };
|
|
121
|
-
return { from: '', to: '' };
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export default {
|
|
125
|
-
imports: 'oda//button, oda//packets',
|
|
126
|
-
template: /*html*/`
|
|
127
|
-
<style>
|
|
128
|
-
:host {
|
|
129
|
-
@apply --vertical;
|
|
130
|
-
@apply --flex;
|
|
131
|
-
gap: 0;
|
|
132
|
-
padding: 0;
|
|
133
|
-
overflow: hidden;
|
|
134
|
-
background: var(--content-background, #fff);
|
|
135
|
-
color: var(--content-color, #222);
|
|
136
|
-
font-size: 13px;
|
|
137
|
-
}
|
|
138
|
-
.error {
|
|
139
|
-
padding: 6px 10px;
|
|
140
|
-
color: var(--error-color, #c53030);
|
|
141
|
-
background: light-dark(#fff5f5, rgba(229, 62, 62, 0.15));
|
|
142
|
-
border-bottom: 1px solid var(--error-color, #feb2b2);
|
|
143
|
-
white-space: break-spaces;
|
|
144
|
-
}
|
|
145
|
-
.grid {
|
|
146
|
-
@apply --vertical;
|
|
147
|
-
flex: 1;
|
|
148
|
-
min-height: 0;
|
|
149
|
-
overflow: hidden;
|
|
150
|
-
border-top: 1px solid light-dark(#b5b4ac, #3e4049);
|
|
151
|
-
}
|
|
152
|
-
div.head-top, div.head, div.row {
|
|
153
|
-
display: grid !important;
|
|
154
|
-
grid-template-columns: minmax(220px, 2.6fr) repeat(6, minmax(90px, 1fr));
|
|
155
|
-
align-items: stretch;
|
|
156
|
-
}
|
|
157
|
-
.head-wrap {
|
|
158
|
-
@apply --vertical;
|
|
159
|
-
flex-shrink: 0;
|
|
160
|
-
background: var(--header-background);
|
|
161
|
-
color: var(--header-color);
|
|
162
|
-
border-bottom: 1px solid var(--border-color);
|
|
163
|
-
user-select: none;
|
|
164
|
-
scrollbar-gutter: stable;
|
|
165
|
-
overflow-y: hidden;
|
|
166
|
-
}
|
|
167
|
-
.head-top {
|
|
168
|
-
border-bottom: 1px solid var(--border-color);
|
|
169
|
-
font-weight: 600;
|
|
170
|
-
font-size: 12px;
|
|
171
|
-
}
|
|
172
|
-
.head {
|
|
173
|
-
font-weight: 600;
|
|
174
|
-
font-size: 12px;
|
|
175
|
-
}
|
|
176
|
-
.grid-body {
|
|
177
|
-
@apply --vertical;
|
|
178
|
-
flex: 1;
|
|
179
|
-
min-height: 0;
|
|
180
|
-
overflow-y: auto;
|
|
181
|
-
overflow-x: hidden;
|
|
182
|
-
scrollbar-gutter: stable;
|
|
183
|
-
background: var(--content-background);
|
|
184
|
-
}
|
|
185
|
-
div.row {
|
|
186
|
-
flex-shrink: 0;
|
|
187
|
-
min-height: 25px;
|
|
188
|
-
border-bottom: 1px solid var(--subtle-border);
|
|
189
|
-
cursor: pointer;
|
|
190
|
-
}
|
|
191
|
-
div.row:hover:not(.selected):not(.total) {
|
|
192
|
-
background: var(--accent-soft);
|
|
193
|
-
}
|
|
194
|
-
div.row.selected {
|
|
195
|
-
background: var(--selected-background) !important;
|
|
196
|
-
color: var(--selected-color) !important;
|
|
197
|
-
}
|
|
198
|
-
div.row.selected .cell {
|
|
199
|
-
background: transparent !important;
|
|
200
|
-
color: var(--selected-color) !important;
|
|
201
|
-
border-right-color: rgba(255, 255, 255, 0.3) !important;
|
|
202
|
-
}
|
|
203
|
-
div.row.selected .cell.acc {
|
|
204
|
-
border-right-color: rgba(255, 255, 255, 0.55) !important;
|
|
205
|
-
}
|
|
206
|
-
.cell {
|
|
207
|
-
min-width: 0;
|
|
208
|
-
padding: 4px 8px;
|
|
209
|
-
overflow: hidden;
|
|
210
|
-
text-overflow: ellipsis;
|
|
211
|
-
white-space: nowrap;
|
|
212
|
-
box-sizing: border-box;
|
|
213
|
-
display: flex;
|
|
214
|
-
align-items: center;
|
|
215
|
-
border-right: 1px solid var(--subtle-border);
|
|
216
|
-
}
|
|
217
|
-
.cell:last-child {
|
|
218
|
-
border-right: none;
|
|
219
|
-
}
|
|
220
|
-
.head-wrap .cell {
|
|
221
|
-
border-right: 1px solid var(--border-color);
|
|
222
|
-
padding: 3px 8px;
|
|
223
|
-
}
|
|
224
|
-
.head-wrap .cell:last-child {
|
|
225
|
-
border-right: none;
|
|
226
|
-
}
|
|
227
|
-
.cell.span2 {
|
|
228
|
-
grid-column: span 2;
|
|
229
|
-
justify-content: center;
|
|
230
|
-
text-align: center;
|
|
231
|
-
border-right: 1px solid var(--border-color);
|
|
232
|
-
}
|
|
233
|
-
.cell.span2:last-child {
|
|
234
|
-
border-right: none;
|
|
235
|
-
}
|
|
236
|
-
.cell.acc {
|
|
237
|
-
border-right: 2px solid var(--border-color) !important;
|
|
238
|
-
}
|
|
239
|
-
.head .cell.acc.sub-head {
|
|
240
|
-
padding-left: 20px;
|
|
241
|
-
}
|
|
242
|
-
.grid-body div.row .cell.acc {
|
|
243
|
-
background: var(--subtle-background);
|
|
244
|
-
text-indent: 8px;
|
|
245
|
-
}
|
|
246
|
-
.grid-body div.row:hover:not(.selected) .cell.acc {
|
|
247
|
-
background: var(--accent-soft);
|
|
248
|
-
}
|
|
249
|
-
.cell.num {
|
|
250
|
-
justify-content: flex-end;
|
|
251
|
-
text-align: right;
|
|
252
|
-
font-variant-numeric: tabular-nums;
|
|
253
|
-
}
|
|
254
|
-
.head .cell.num {
|
|
255
|
-
justify-content: center;
|
|
256
|
-
text-align: center;
|
|
257
|
-
}
|
|
258
|
-
.cell.group-sep {
|
|
259
|
-
border-right: 1px solid var(--border-color);
|
|
260
|
-
}
|
|
261
|
-
.grid-body div.row .cell.debit-col {
|
|
262
|
-
background: light-dark(rgba(224, 245, 248, 0.32), rgba(56, 189, 248, 0.03));
|
|
263
|
-
}
|
|
264
|
-
.grid-body div.row .cell.credit-col {
|
|
265
|
-
background: light-dark(rgba(253, 230, 238, 0.32), rgba(244, 114, 182, 0.03));
|
|
266
|
-
}
|
|
267
|
-
div.row.top-level, div.row.group {
|
|
268
|
-
font-weight: 700;
|
|
269
|
-
}
|
|
270
|
-
div.row.detail .cell.acc {
|
|
271
|
-
font-weight: 400;
|
|
272
|
-
font-style: italic;
|
|
273
|
-
}
|
|
274
|
-
div.row.total {
|
|
275
|
-
flex-shrink: 0;
|
|
276
|
-
font-weight: 700;
|
|
277
|
-
min-height: 27px;
|
|
278
|
-
background: var(--header-background);
|
|
279
|
-
color: var(--header-color);
|
|
280
|
-
border-top: 2px solid var(--border-color);
|
|
281
|
-
border-bottom: none;
|
|
282
|
-
scrollbar-gutter: stable;
|
|
283
|
-
overflow-y: hidden;
|
|
284
|
-
cursor: default;
|
|
285
|
-
}
|
|
286
|
-
.row.total .cell {
|
|
287
|
-
border-right: 1px solid var(--border-color);
|
|
288
|
-
}
|
|
289
|
-
.row.total .cell:last-child {
|
|
290
|
-
border-right: none;
|
|
291
|
-
}
|
|
292
|
-
.row.total .cell.acc {
|
|
293
|
-
justify-content: space-between;
|
|
294
|
-
}
|
|
295
|
-
.row-count {
|
|
296
|
-
font-weight: 600;
|
|
297
|
-
opacity: 0.85;
|
|
298
|
-
margin-left: 8px;
|
|
299
|
-
}
|
|
300
|
-
</style>
|
|
301
|
-
<oda-packets no-flex mode="month" ~if="packetsStart"
|
|
302
|
-
:start="packetsStart" :end="packetsEnd" :days="packetDays"
|
|
303
|
-
::value="packetsKey" @selection-changed="onPackets($event)"></oda-packets>
|
|
304
|
-
<div class="error" ~if="error">{{error}}</div>
|
|
305
|
-
<div class="grid">
|
|
306
|
-
<div class="head-wrap">
|
|
307
|
-
<div class="head-top">
|
|
308
|
-
<div class="cell acc">Счёт</div>
|
|
309
|
-
<div class="cell span2">На начало</div>
|
|
310
|
-
<div class="cell span2">За период</div>
|
|
311
|
-
<div class="cell span2">На конец</div>
|
|
312
|
-
</div>
|
|
313
|
-
<div class="head">
|
|
314
|
-
<div class="cell acc sub-head">Субсчёт</div>
|
|
315
|
-
<div class="cell num">Дебет</div>
|
|
316
|
-
<div class="cell num group-sep">Кредит</div>
|
|
317
|
-
<div class="cell num">Дебет</div>
|
|
318
|
-
<div class="cell num group-sep">Кредит</div>
|
|
319
|
-
<div class="cell num">Дебет</div>
|
|
320
|
-
<div class="cell num">Кредит</div>
|
|
321
|
-
</div>
|
|
322
|
-
</div>
|
|
323
|
-
<div class="grid-body" @tap="onGridBodyTap($event)">
|
|
324
|
-
<div class="row" ~class="{group: !$for.item.leaf, 'top-level': $for.item.level === 0, detail: $for.item.detail, selected: selectedRow?.account === $for.item.account && selectedRow?.label === $for.item.label}"
|
|
325
|
-
~for="displayRows" @tap.stop="selectRow($for.item)" @dblclick="open($for.item)" @contextmenu.stop.prevent="onRowContextMenu($for.item, $event)">
|
|
326
|
-
<div class="cell acc" ~style="{paddingLeft: $for.item.indent + 'px'}">{{$for.item.label}}</div>
|
|
327
|
-
<div class="cell num debit-col">{{$for.item.open_debit}}</div>
|
|
328
|
-
<div class="cell num credit-col group-sep">{{$for.item.open_credit}}</div>
|
|
329
|
-
<div class="cell num debit-col">{{$for.item.debit}}</div>
|
|
330
|
-
<div class="cell num credit-col group-sep">{{$for.item.credit}}</div>
|
|
331
|
-
<div class="cell num debit-col">{{$for.item.close_debit}}</div>
|
|
332
|
-
<div class="cell num credit-col">{{$for.item.close_credit}}</div>
|
|
333
|
-
</div>
|
|
334
|
-
</div>
|
|
335
|
-
<div class="row total">
|
|
336
|
-
<div class="cell acc"><span>Итого</span><span class="row-count">{{displayRows.length}}</span></div>
|
|
337
|
-
<div class="cell num">{{totals.open_debit}}</div>
|
|
338
|
-
<div class="cell num group-sep">{{totals.open_credit}}</div>
|
|
339
|
-
<div class="cell num">{{totals.debit}}</div>
|
|
340
|
-
<div class="cell num group-sep">{{totals.credit}}</div>
|
|
341
|
-
<div class="cell num">{{totals.close_debit}}</div>
|
|
342
|
-
<div class="cell num">{{totals.close_credit}}</div>
|
|
343
|
-
</div>
|
|
344
|
-
</div>
|
|
345
|
-
`,
|
|
346
|
-
packetsKey: { $def: '*', $type: String, $save: true },
|
|
347
|
-
packetsStart: '',
|
|
348
|
-
packetsEnd: '',
|
|
349
|
-
packetDays: null,
|
|
350
|
-
_packetFiltered: false,
|
|
351
|
-
_initializingPackets: false,
|
|
352
|
-
_attachedDone: false,
|
|
353
|
-
_initialNav: null,
|
|
354
|
-
from: '',
|
|
355
|
-
to: '',
|
|
356
|
-
account: '',
|
|
357
|
-
/** слоты аналитик для разворота строк счёта, через запятую */
|
|
358
|
-
by: '',
|
|
359
|
-
slots: [],
|
|
360
|
-
/** видимые подразделения (db_scope): больше одного — фильтр */
|
|
361
|
-
units: [],
|
|
362
|
-
/** выбранное подразделение (с вложенными), пусто — все видимые */
|
|
363
|
-
unit: '',
|
|
364
|
-
rows: [],
|
|
365
|
-
selectedRow: null,
|
|
366
|
-
focusedItem: null,
|
|
367
|
-
fallbackFocusedItem: null,
|
|
368
|
-
total: null,
|
|
369
|
-
names: { objects: {}, classes: {}, paths: {} },
|
|
370
|
-
error: '',
|
|
371
|
-
/** Суммы строки ведомости ядра → текст колонок. */
|
|
372
|
-
cells(r) {
|
|
373
|
-
return {
|
|
374
|
-
open_debit: money(r?.opening?.debit), open_credit: money(r?.opening?.credit),
|
|
375
|
-
debit: money(r?.turnover?.debit), credit: money(r?.turnover?.credit),
|
|
376
|
-
close_debit: money(r?.closing?.debit), close_credit: money(r?.closing?.credit),
|
|
377
|
-
};
|
|
378
|
-
},
|
|
379
|
-
get totals() {
|
|
380
|
-
return this.cells(this.total);
|
|
381
|
-
},
|
|
382
|
-
/** Подпись строки: счёт — код и название (без дублирования кода), строка разворота — объекты аналитик. */
|
|
383
|
-
rowLabel(r) {
|
|
384
|
-
if (r.key)
|
|
385
|
-
return Object.values(r.key).map(id => (id === null ? '—' : this.names?.objects?.[id] || id)).join(' / ');
|
|
386
|
-
const code = String(r.account || '').split('/').pop().replace(/^acc\./, '');
|
|
387
|
-
const label = String(r.label || this.names?.classes?.[r.account] || '').trim();
|
|
388
|
-
if (!label || label === code)
|
|
389
|
-
return code;
|
|
390
|
-
if (label.startsWith(code + ' ') || label.startsWith(code + '.') || /^\d+(?:\.\d+)?\s/.test(label))
|
|
391
|
-
return label;
|
|
392
|
-
return `${code} ${label}`;
|
|
393
|
-
},
|
|
394
|
-
rowHasPostings(r) {
|
|
395
|
-
if (!r)
|
|
396
|
-
return false;
|
|
397
|
-
if (typeof r.hasPostings === 'boolean')
|
|
398
|
-
return r.hasPostings;
|
|
399
|
-
if (r.opening || r.turnover || r.closing) {
|
|
400
|
-
return Boolean(
|
|
401
|
-
Number(r.opening?.debit) || Number(r.opening?.credit)
|
|
402
|
-
|| Number(r.turnover?.debit) || Number(r.turnover?.credit)
|
|
403
|
-
|| Number(r.closing?.debit) || Number(r.closing?.credit)
|
|
404
|
-
|| Number(r.qty?.opening) || Number(r.qty?.debit) || Number(r.qty?.credit) || Number(r.qty?.closing)
|
|
405
|
-
);
|
|
406
|
-
}
|
|
407
|
-
return Boolean(r.open_debit || r.open_credit || r.debit || r.credit || r.close_debit || r.close_credit);
|
|
408
|
-
},
|
|
409
|
-
rowHasAnalytics(r) {
|
|
410
|
-
if (!r)
|
|
411
|
-
return false;
|
|
412
|
-
if (typeof r.hasAnalytics === 'boolean')
|
|
413
|
-
return r.hasAnalytics;
|
|
414
|
-
if (r.key && typeof r.key === 'object' && Object.keys(r.key).length)
|
|
415
|
-
return true;
|
|
416
|
-
if ((this.rows || []).some(x => x.account === r.account && x.key))
|
|
417
|
-
return true;
|
|
418
|
-
return Array.isArray(this.slots) && this.slots.length > 0;
|
|
419
|
-
},
|
|
420
|
-
isToolDisabled(tool) {
|
|
421
|
-
const row = this.selectedRow;
|
|
422
|
-
if (!row || !this.rowHasPostings(row))
|
|
423
|
-
return true;
|
|
424
|
-
if (tool?.id === 'analysis' && !this.rowHasAnalytics(row))
|
|
425
|
-
return true;
|
|
426
|
-
return false;
|
|
427
|
-
},
|
|
428
|
-
get displayRows() {
|
|
429
|
-
return (this.rows || []).map(r => ({
|
|
430
|
-
account: r.account,
|
|
431
|
-
key: r.key || null,
|
|
432
|
-
label: this.rowLabel(r),
|
|
433
|
-
leaf: !!r.leaf,
|
|
434
|
-
detail: !!r.key,
|
|
435
|
-
hasAnalytics: this.rowHasAnalytics(r),
|
|
436
|
-
hasPostings: this.rowHasPostings(r),
|
|
437
|
-
level: Number(r.level) || 0,
|
|
438
|
-
indent: (Number(r.level) || 0) * 16,
|
|
439
|
-
...this.cells(r),
|
|
440
|
-
}));
|
|
441
|
-
},
|
|
442
|
-
_findFormHost() {
|
|
443
|
-
if (this.$form && ('focusedItem' in this.$form || typeof this.$form.syncFromView === 'function' || typeof this.$form.setFormPeriod === 'function'))
|
|
444
|
-
return this.$form;
|
|
445
|
-
for (let p = this.parentElement || this.domHost; p; p = p.parentElement || p.domHost) {
|
|
446
|
-
if (p.localName === 'work-form' || typeof p.syncFromView === 'function' || typeof p.setFormPeriod === 'function' || 'focusedItem' in p)
|
|
447
|
-
return p;
|
|
448
|
-
}
|
|
449
|
-
return null;
|
|
450
|
-
},
|
|
451
|
-
_notifyForm() {
|
|
452
|
-
const host = this._findFormHost();
|
|
453
|
-
if (!host)
|
|
454
|
-
return;
|
|
455
|
-
if (typeof host.syncFromView === 'function')
|
|
456
|
-
host.syncFromView(this);
|
|
457
|
-
else
|
|
458
|
-
host.focusedItem = this.focusedItem;
|
|
459
|
-
},
|
|
460
|
-
onGridBodyTap(e) {
|
|
461
|
-
if (!e?.target?.closest?.('.row'))
|
|
462
|
-
this.selectRow(null);
|
|
463
|
-
},
|
|
464
|
-
selectRow(row) {
|
|
465
|
-
this.selectedRow = row || null;
|
|
466
|
-
this._syncFocusedAccount(this.selectedRow);
|
|
467
|
-
},
|
|
468
|
-
async _ensureFallbackFocused() {
|
|
469
|
-
if (this.fallbackFocusedItem)
|
|
470
|
-
return this.fallbackFocusedItem;
|
|
471
|
-
if (typeof WORK === 'undefined' || typeof WORK.get_item !== 'function')
|
|
472
|
-
return null;
|
|
473
|
-
const firstRow = this.displayRows?.[0];
|
|
474
|
-
const firstPath = (firstRow && (this.names?.paths?.[firstRow.account] || firstRow.account))
|
|
475
|
-
|| (this.$item?.short ? `${this.$item.short}/$register/$folder/$class/$account` : '');
|
|
476
|
-
if (!firstPath)
|
|
477
|
-
return null;
|
|
478
|
-
try {
|
|
479
|
-
this.fallbackFocusedItem = await WORK.get_item(firstPath);
|
|
480
|
-
}
|
|
481
|
-
catch {
|
|
482
|
-
this.fallbackFocusedItem = null;
|
|
483
|
-
}
|
|
484
|
-
return this.fallbackFocusedItem;
|
|
485
|
-
},
|
|
486
|
-
async _syncFocusedAccount(row) {
|
|
487
|
-
const path = this.names?.paths?.[row?.account] || row?.account || '';
|
|
488
|
-
if (!row || !path) {
|
|
489
|
-
this.focusedItem = null;
|
|
490
|
-
await this._ensureFallbackFocused();
|
|
491
|
-
this._notifyForm();
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
// Мгновенно выставляем фокус с путём, чтобы кнопки переключились без ожидания сети
|
|
495
|
-
this.focusedItem = { path, short: path };
|
|
496
|
-
this._notifyForm();
|
|
497
|
-
if (typeof WORK === 'undefined' || typeof WORK.get_item !== 'function')
|
|
498
|
-
return;
|
|
499
|
-
try {
|
|
500
|
-
await this._ensureFallbackFocused();
|
|
501
|
-
const item = await WORK.get_item(path);
|
|
502
|
-
if (this.selectedRow !== row)
|
|
503
|
-
return;
|
|
504
|
-
if (item) {
|
|
505
|
-
this.focusedItem = item;
|
|
506
|
-
this._notifyForm();
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
catch {
|
|
510
|
-
/* оставляем { path, short: path } */
|
|
511
|
-
}
|
|
512
|
-
},
|
|
513
|
-
buildDrilldownNav(viewId = 'postings') {
|
|
514
|
-
const target = this.selectedRow || this.displayRows?.[0];
|
|
515
|
-
const mode = viewId === 'turnovers' ? 'turnovers' : viewId === 'analysis' ? 'analysis' : 'card';
|
|
516
|
-
const effectiveKey = (this.packetsKey && this.packetsKey !== '*')
|
|
517
|
-
? this.packetsKey
|
|
518
|
-
: _derivePacketsKey(this.from, this.to, this.packetsKey || '*');
|
|
519
|
-
const nav = {
|
|
520
|
-
view: viewId,
|
|
521
|
-
mode,
|
|
522
|
-
packetsKey: effectiveKey,
|
|
523
|
-
from: this.from || '',
|
|
524
|
-
to: this.to || '',
|
|
525
|
-
unit: this.unit || '',
|
|
526
|
-
};
|
|
527
|
-
if (target?.key && typeof target.key === 'object') {
|
|
528
|
-
const filters = Object.fromEntries(Object.entries(target.key).filter(([, v]) => v));
|
|
529
|
-
if (Object.keys(filters).length)
|
|
530
|
-
nav.filters = filters;
|
|
531
|
-
}
|
|
532
|
-
return nav;
|
|
533
|
-
},
|
|
534
|
-
async onPackets(e) {
|
|
535
|
-
const d = e?.detail?.value ?? e?.detail ?? {};
|
|
536
|
-
if (Array.isArray(d))
|
|
537
|
-
return;
|
|
538
|
-
if (this._initializingPackets)
|
|
539
|
-
return;
|
|
540
|
-
const nextKey = d.value || (d.selected?.name === '*' ? '*' : (d.selected?.mask || this.packetsKey || '*'));
|
|
541
|
-
if (d.selected?.name === '*') {
|
|
542
|
-
this.packetsKey = '*';
|
|
543
|
-
_writeSavedPeriod('*', '', '');
|
|
544
|
-
this._findFormHost()?.setFormPeriod?.({ packetsKey: '*', from: '', to: '' });
|
|
545
|
-
if (this._packetFiltered || this.from || this.to) {
|
|
546
|
-
this._packetFiltered = false;
|
|
547
|
-
this.from = '';
|
|
548
|
-
this.to = '';
|
|
549
|
-
await this.reload();
|
|
550
|
-
}
|
|
551
|
-
return;
|
|
552
|
-
}
|
|
553
|
-
if (d.period?.start && d.period?.end) {
|
|
554
|
-
const changed = this.from !== d.period.start || this.to !== d.period.end || !this._packetFiltered;
|
|
555
|
-
this._packetFiltered = true;
|
|
556
|
-
this.from = d.period.start;
|
|
557
|
-
this.to = d.period.end;
|
|
558
|
-
this.packetsKey = _derivePacketsKey(this.from, this.to, nextKey);
|
|
559
|
-
_writeSavedPeriod(this.packetsKey, this.from, this.to);
|
|
560
|
-
this._findFormHost()?.setFormPeriod?.({ packetsKey: this.packetsKey, from: this.from, to: this.to });
|
|
561
|
-
if (changed)
|
|
562
|
-
await this.reload();
|
|
563
|
-
}
|
|
564
|
-
},
|
|
565
|
-
_restorePeriodState(nav = null) {
|
|
566
|
-
const hasNavPeriod = nav && (nav.from !== undefined || nav.to !== undefined || nav.packetsKey);
|
|
567
|
-
if (!hasNavPeriod && (this.from || this.to))
|
|
568
|
-
return;
|
|
569
|
-
const formPeriod = this._findFormHost()?.formPeriod || null;
|
|
570
|
-
const saved = _readSavedPeriod();
|
|
571
|
-
const localSavedKey = typeof this.loadFromLocalStorage === 'function' ? this.loadFromLocalStorage('packetsKey') : undefined;
|
|
572
|
-
if (!hasNavPeriod && !formPeriod && !saved && typeof localSavedKey === 'string' && localSavedKey && (typeof this.packetsKey !== 'string' || this.packetsKey === '*'))
|
|
573
|
-
this.packetsKey = localSavedKey;
|
|
574
|
-
const pk = typeof this.packetsKey === 'string' ? this.packetsKey : '';
|
|
575
|
-
const src = hasNavPeriod ? nav : (formPeriod || saved || (pk && pk !== '*' ? { packetsKey: pk } : null));
|
|
576
|
-
if (!src)
|
|
577
|
-
return;
|
|
578
|
-
this._initializingPackets = true;
|
|
579
|
-
try {
|
|
580
|
-
const rawKey = typeof src.packetsKey === 'string' && src.packetsKey ? src.packetsKey : (pk || '*');
|
|
581
|
-
let from = String(src.from || '');
|
|
582
|
-
let to = String(src.to || '');
|
|
583
|
-
if (!from && !to && rawKey !== '*') {
|
|
584
|
-
const derived = _boundsFromPacketsKey(rawKey, 'month');
|
|
585
|
-
if (derived.from && derived.to) {
|
|
586
|
-
from = derived.from;
|
|
587
|
-
to = derived.to;
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
const key = _derivePacketsKey(from, to, rawKey);
|
|
591
|
-
this.from = from;
|
|
592
|
-
this.to = to;
|
|
593
|
-
this._packetFiltered = !!(from || to);
|
|
594
|
-
this.packetsKey = key;
|
|
595
|
-
this._findFormHost()?.setFormPeriod?.({ packetsKey: this.packetsKey, from: this.from, to: this.to });
|
|
596
|
-
}
|
|
597
|
-
finally {
|
|
598
|
-
this._initializingPackets = false;
|
|
599
|
-
}
|
|
600
|
-
},
|
|
601
|
-
async syncFormPeriod(fp) {
|
|
602
|
-
if (!fp || typeof fp !== 'object')
|
|
603
|
-
return;
|
|
604
|
-
const nextFrom = String(fp.from || '');
|
|
605
|
-
const nextTo = String(fp.to || '');
|
|
606
|
-
const nextKey = String(fp.packetsKey || '*');
|
|
607
|
-
if (this.from === nextFrom && this.to === nextTo && this.packetsKey === nextKey)
|
|
608
|
-
return;
|
|
609
|
-
this._restorePeriodState(fp);
|
|
610
|
-
await this.reload();
|
|
611
|
-
},
|
|
612
|
-
_applyNavFields(nav) {
|
|
613
|
-
if (!nav || typeof nav !== 'object')
|
|
614
|
-
return;
|
|
615
|
-
this._restorePeriodState(nav);
|
|
616
|
-
if (nav.unit !== undefined)
|
|
617
|
-
this.unit = String(nav.unit || '');
|
|
618
|
-
if (nav.account !== undefined)
|
|
619
|
-
this.account = String(nav.account || '');
|
|
620
|
-
if (nav.by !== undefined)
|
|
621
|
-
this.by = String(nav.by || '');
|
|
622
|
-
_writeSavedPeriod(this.packetsKey, this.from, this.to);
|
|
623
|
-
this._findFormHost()?.setFormPeriod?.({ packetsKey: this.packetsKey, from: this.from, to: this.to });
|
|
624
|
-
},
|
|
625
|
-
async applyNav(nav) {
|
|
626
|
-
if (!nav || typeof nav !== 'object')
|
|
627
|
-
return;
|
|
628
|
-
this._applyNavFields(nav);
|
|
629
|
-
await this.reload();
|
|
630
|
-
},
|
|
631
|
-
async attached() {
|
|
632
|
-
if (this._attachedDone && !this._initialNav)
|
|
633
|
-
return;
|
|
634
|
-
const initNav = this._initialNav;
|
|
635
|
-
this._initialNav = null;
|
|
636
|
-
if (initNav)
|
|
637
|
-
this._applyNavFields(initNav);
|
|
638
|
-
else
|
|
639
|
-
this._restorePeriodState();
|
|
640
|
-
await Promise.all([this.loadSlots(), this.loadScope(), this.reload()]);
|
|
641
|
-
this._attachedDone = true;
|
|
642
|
-
},
|
|
643
|
-
async loadSlots() {
|
|
644
|
-
try {
|
|
645
|
-
const s = await this.$item?.fetch('db_schema');
|
|
646
|
-
this.slots = Array.isArray(s?.slots) ? s.slots : [];
|
|
647
|
-
}
|
|
648
|
-
catch {
|
|
649
|
-
this.slots = [];
|
|
650
|
-
}
|
|
651
|
-
},
|
|
652
|
-
async setBy(val) {
|
|
653
|
-
this.by = String(val || '');
|
|
654
|
-
await this.reload();
|
|
655
|
-
},
|
|
656
|
-
/** Видимые подразделения для фильтра; без ответа — без фильтра. */
|
|
657
|
-
async loadScope() {
|
|
658
|
-
try {
|
|
659
|
-
const s = await this.$item?.fetch('db_scope');
|
|
660
|
-
this.units = Array.isArray(s?.units) && !s.all ? s.units : [];
|
|
661
|
-
}
|
|
662
|
-
catch {
|
|
663
|
-
this.units = [];
|
|
664
|
-
}
|
|
665
|
-
},
|
|
666
|
-
params() {
|
|
667
|
-
const p = {};
|
|
668
|
-
for (const key of ['from', 'to', 'account', 'unit']) {
|
|
669
|
-
const s = String(this[key] ?? '').trim();
|
|
670
|
-
if (s)
|
|
671
|
-
p[key] = s;
|
|
672
|
-
}
|
|
673
|
-
const by = String(this.by ?? '').split(',').map(s => s.trim()).filter(Boolean);
|
|
674
|
-
if (by.length)
|
|
675
|
-
p.by = JSON.stringify(by);
|
|
676
|
-
return p;
|
|
677
|
-
},
|
|
678
|
-
_syncPacketRange(res) {
|
|
679
|
-
if (!res)
|
|
680
|
-
return false;
|
|
681
|
-
if (!('range' in res)) {
|
|
682
|
-
if (!this.packetsStart) {
|
|
683
|
-
this.packetsStart = _yearStart();
|
|
684
|
-
this.packetsEnd = _yearEnd();
|
|
685
|
-
}
|
|
686
|
-
return false;
|
|
687
|
-
}
|
|
688
|
-
const r = res.range;
|
|
689
|
-
if (!r || !r.start || !r.end) {
|
|
690
|
-
this.packetsStart = '';
|
|
691
|
-
this.packetsEnd = '';
|
|
692
|
-
this.packetDays = null;
|
|
693
|
-
return false;
|
|
694
|
-
}
|
|
695
|
-
this.packetsStart = r.start;
|
|
696
|
-
this.packetsEnd = r.end;
|
|
697
|
-
this.packetDays = Array.isArray(r.days) && r.days.length ? r.days : null;
|
|
698
|
-
const keyStr = typeof this.packetsKey === 'string' ? this.packetsKey : '';
|
|
699
|
-
const isNowKey = keyStr === 'now' || keyStr.startsWith('now:');
|
|
700
|
-
if (this._packetFiltered && !isNowKey && this.to && this.to < r.start) {
|
|
701
|
-
this._initializingPackets = true;
|
|
702
|
-
try {
|
|
703
|
-
this._packetFiltered = false;
|
|
704
|
-
this.from = '';
|
|
705
|
-
this.to = '';
|
|
706
|
-
this.packetsKey = '*';
|
|
707
|
-
_writeSavedPeriod('*', '', '');
|
|
708
|
-
}
|
|
709
|
-
finally {
|
|
710
|
-
this._initializingPackets = false;
|
|
711
|
-
}
|
|
712
|
-
return true;
|
|
713
|
-
}
|
|
714
|
-
return false;
|
|
715
|
-
},
|
|
716
|
-
async reload() {
|
|
717
|
-
this.error = '';
|
|
718
|
-
if (!this.$item) {
|
|
719
|
-
this.rows = [];
|
|
720
|
-
this.total = null;
|
|
721
|
-
return;
|
|
722
|
-
}
|
|
723
|
-
try {
|
|
724
|
-
const res = await this.$item.fetch('db_sheet', this.params());
|
|
725
|
-
if (this._syncPacketRange(res))
|
|
726
|
-
return await this.reload();
|
|
727
|
-
this.names = { objects: {}, classes: {}, paths: {}, ...(res?.names || {}) };
|
|
728
|
-
this.rows = Array.isArray(res?.rows) ? res.rows : [];
|
|
729
|
-
this.total = res?.total || null;
|
|
730
|
-
if (this.displayRows.length) {
|
|
731
|
-
const prevAcc = this.selectedRow?.account;
|
|
732
|
-
const found = prevAcc ? this.displayRows.find(r => r.account === prevAcc && r.label === this.selectedRow?.label) : null;
|
|
733
|
-
this.selectRow(found || null);
|
|
734
|
-
}
|
|
735
|
-
else {
|
|
736
|
-
this.selectRow(null);
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
catch (e) {
|
|
740
|
-
this.error = String(e?.message || e);
|
|
741
|
-
this.selectRow(null);
|
|
742
|
-
}
|
|
743
|
-
},
|
|
744
|
-
async onRowContextMenu(row, e) {
|
|
745
|
-
if (!row)
|
|
746
|
-
return;
|
|
747
|
-
await this.selectRow(row);
|
|
748
|
-
const path = this.names?.paths?.[row.account] || row.account;
|
|
749
|
-
if (!path || typeof WORK?.showMenu !== 'function')
|
|
750
|
-
return;
|
|
751
|
-
try {
|
|
752
|
-
const t = await WORK.get_item(path);
|
|
753
|
-
if (t)
|
|
754
|
-
await WORK.showMenu({ $item: t, mode: 'handlers' }, e);
|
|
755
|
-
}
|
|
756
|
-
catch { /* ignore */ }
|
|
757
|
-
},
|
|
758
|
-
async open(row, mode = '') {
|
|
759
|
-
const target = row || this.selectedRow;
|
|
760
|
-
if (!target || !this.rowHasPostings(target))
|
|
761
|
-
return;
|
|
762
|
-
if (mode === 'analysis' && !this.rowHasAnalytics(target))
|
|
763
|
-
return;
|
|
764
|
-
const path = this.names?.paths?.[target?.account] || target?.account;
|
|
765
|
-
if (!path)
|
|
766
|
-
return;
|
|
767
|
-
try {
|
|
768
|
-
const t = await WORK.get_item(path);
|
|
769
|
-
if (!t || !window.execute)
|
|
770
|
-
return;
|
|
771
|
-
const effectiveMode = mode || (target.detail ? '' : (this.rowHasAnalytics(target) ? 'analysis' : 'turnovers'));
|
|
772
|
-
const view = effectiveMode === 'turnovers' ? 'turnovers' : effectiveMode === 'analysis' ? 'analysis' : 'postings';
|
|
773
|
-
const nav = {
|
|
774
|
-
view,
|
|
775
|
-
from: this.from,
|
|
776
|
-
to: this.to,
|
|
777
|
-
unit: this.unit,
|
|
778
|
-
};
|
|
779
|
-
if (typeof this.packetsKey === 'string' && this.packetsKey !== '*')
|
|
780
|
-
nav.packetsKey = this.packetsKey;
|
|
781
|
-
if (effectiveMode)
|
|
782
|
-
nav.mode = effectiveMode;
|
|
783
|
-
if (target?.key && typeof target.key === 'object') {
|
|
784
|
-
const filters = Object.fromEntries(Object.entries(target.key).filter(([, v]) => v));
|
|
785
|
-
if (Object.keys(filters).length)
|
|
786
|
-
nav.filters = filters;
|
|
787
|
-
}
|
|
788
|
-
const effectiveKey = (typeof this.packetsKey === 'string' && this.packetsKey !== '*')
|
|
789
|
-
? this.packetsKey
|
|
790
|
-
: _derivePacketsKey(this.from, this.to, this.packetsKey || '*');
|
|
791
|
-
_writeSavedPeriod(effectiveKey, this.from, this.to);
|
|
792
|
-
this._findFormHost()?.setFormPeriod?.({ packetsKey: effectiveKey, from: this.from, to: this.to });
|
|
793
|
-
window.execute(t, nav);
|
|
794
|
-
}
|
|
795
|
-
catch (e) {
|
|
796
|
-
this.error = String(e?.message || e);
|
|
797
|
-
}
|
|
798
|
-
},
|
|
799
|
-
openTurnovers(row) {
|
|
800
|
-
return this.open(row || this.selectedRow, 'turnovers');
|
|
801
|
-
},
|
|
802
|
-
openAnalysis(row) {
|
|
803
|
-
return this.open(row || this.selectedRow, 'analysis');
|
|
804
|
-
},
|
|
805
|
-
openPostings(row) {
|
|
806
|
-
return this.open(row || this.selectedRow, 'card');
|
|
807
|
-
},
|
|
808
|
-
};
|