Распил OrderView.vue: composable и диалоги - #478
Open
Ibochkarev wants to merge 2 commits into
Open
Conversation
Extract order screen logic to useOrderView and product/customer dialogs so OrderView.vue stays under the 1000 LOC target without changing UX. Closes #339
Ibochkarev
force-pushed
the
feat/issue-339-split-order-view
branch
from
July 29, 2026 11:31
b4dcfa5 to
3ffaef8
Compare
Break the 1753-line useOrderView.js into focused composables so no file exceeds ~400 lines. The thin orchestrator wires shared refs (order, saving, editingProduct) and core computeds, delegating to: - useOrderLoad: order/refs/fields/extra-fields loading + empty-order init - useOrderSave: save / finalize / create order actions - useOrderProducts: edit / add / delete product dialog state - useOrderProductOptions: options table/json editing - useOrderCostRecalc: cost recalculation + shipping/payment baseline - useOrderCustomer: customer search + duplicate-customer dialog - useOrderPluginTabs: built-in + MS3OrderTabsRegistry plugin tab registry Public orderContext contract and the return shape consumed by OrderView.vue are preserved unchanged. No behavior/API changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание
OrderView.vueбыл монолитом (~2517 LOC): layout, загрузка заказа, продукты, cost, plugin-tabs и три диалога в одном SFC.PR выносит логику в
useOrderView.js, диалоги — в отдельные компоненты подcomponents/order/, аOrderView.vueоставляет shell: header, tabs,provide/injectчерезORDER_CONTEXT_KEY,defineExpose({ registerPluginTab }).Тип изменений
Связанные Issues
Closes #339
Как это было протестировано?
Gate E (локально):
npm run lint,npm run build)Ручной smoke-чеклист:
registerPluginTab)Конфигурация тестирования:
feat/issue-339-split-order-viewСкриншоты (если применимо)
Чеклист
Дополнительные заметки
Gate A (#339):
OrderView.vue< 1000 LOCnpm run lintСтруктура после PR:
OrderView.vue— shell (~250 LOC)useOrderView.js— state, API, lifecycle, plugin tabs (~1753 LOC)OrderEditProductDialog.vue,OrderAddProductDialog.vue,OrderDuplicateCustomerDialog.vueFollow-up (вне scope #339): дальнейший split
useOrderView.jsна domain-composables и перевод диалогов наinject(ORDER_CONTEXT_KEY)вместо prop drilling.Review: исправлен BLOCK по реактивности — binding'и из composable деструктурируются на top-level в
OrderView.vue(неvm.*в template).