feat(tkeg, gateway): tkeg 대시보드 리디자인 + gateway 구매관리 네이밍 수정
- tkeg: MUI 기반 대시보드 전면 리디자인 (theme, 메트릭 카드, 프로젝트 Autocomplete, Quick Action, 관리자 섹션) - gateway: tkpurchase 카드 "소모품 관리" → "구매관리"로 복원 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
52
tkeg/web/src/pages/dashboard/ProjectSelectorBar.jsx
Normal file
52
tkeg/web/src/pages/dashboard/ProjectSelectorBar.jsx
Normal file
@@ -0,0 +1,52 @@
|
||||
import React from 'react';
|
||||
import Box from '@mui/material/Box';
|
||||
import Autocomplete from '@mui/material/Autocomplete';
|
||||
import TextField from '@mui/material/TextField';
|
||||
import Button from '@mui/material/Button';
|
||||
import AddIcon from '@mui/icons-material/Add';
|
||||
|
||||
export default function ProjectSelectorBar({
|
||||
projects,
|
||||
selectedProject,
|
||||
onSelectProject,
|
||||
onCreateProject,
|
||||
inactiveProjects,
|
||||
}) {
|
||||
const activeProjects = projects.filter(p => {
|
||||
const id = p.job_no || p.official_project_code || p.id;
|
||||
return !inactiveProjects.has(id);
|
||||
});
|
||||
|
||||
return (
|
||||
<Box sx={{ display: 'flex', gap: 1.5, alignItems: 'center' }}>
|
||||
<Autocomplete
|
||||
size="small"
|
||||
sx={{ flex: 1, maxWidth: 500 }}
|
||||
options={activeProjects}
|
||||
value={selectedProject}
|
||||
onChange={(_, v) => onSelectProject(v)}
|
||||
getOptionLabel={(opt) => {
|
||||
const name = opt.job_name || opt.project_name || '';
|
||||
const code = opt.job_no || opt.official_project_code || '';
|
||||
return name ? `${name} (${code})` : code;
|
||||
}}
|
||||
isOptionEqualToValue={(opt, val) =>
|
||||
(opt.job_no || opt.id) === (val.job_no || val.id)
|
||||
}
|
||||
renderInput={(params) => (
|
||||
<TextField {...params} placeholder="프로젝트 선택..." />
|
||||
)}
|
||||
noOptionsText="프로젝트 없음"
|
||||
/>
|
||||
<Button
|
||||
variant="contained"
|
||||
size="small"
|
||||
startIcon={<AddIcon />}
|
||||
onClick={onCreateProject}
|
||||
sx={{ whiteSpace: 'nowrap' }}
|
||||
>
|
||||
프로젝트 생성
|
||||
</Button>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user