User feedback 2026-05-07: muốn toggle "Nhập tay" + 2 input fields hiển thị trực
tiếp trong Section 2 "b. Ngân sách" (PeDetailTabs) — KHÔNG cần đi tới "Sửa
header" page. Visible trong cả 3 view (Workspace / Danh sách / Duyệt). Empty
giá trị thì hiển thị empty.
Implementation:
+ BudgetFieldRow component (~125 LOC) thay cho FormRow tĩnh cũ
- Detect mode auto khi mount: prefer manual mode nếu ev.budgetManualName/Amount
set + !ev.budgetId
- canEdit = !readOnly && isDraft (DangSoanThao):
→ Render toggle "Nhập tay" + Select Budget OR 2 input grid 2-col + nút
"Lưu ngân sách" (chỉ hiện khi dirty) + "Hủy thay đổi" reset
→ Save: full PUT /pe/:id với current values (tenGoiThau/diaDiem/moTa/
paymentTerms) + new budget payload conditional (manual mode → clear
budgetId, link mode → clear manual). Invalidate ['pe-detail', 'pe-list'].
- canEdit=false (Duyệt mode hoặc !isDraft):
→ Display only — link card / manual values / empty "—" (không text "chưa
link" verbose nữa per user "giá trị rỗng thì cứ hiển thị rỗng")
Files:
~ fe-admin/src/components/pe/PeDetailTabs.tsx
- import BudgetPhase + BudgetListItem từ types/budget + Paged từ types/master
- new BudgetFieldRow component
- ChonNccSection b. Ngân sách FormRow → <BudgetFieldRow> (1-line replacement)
Verify: npm run build fe-admin pass · 1922 modules · 0 TS error.
Next: Chunk 2 fe-user mirror.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])