lavoce #18

Merged
bragaz_rexita merged 9 commits from lavoce into main 2025-11-17 08:27:39 +00:00
2 changed files with 75 additions and 56 deletions
Showing only changes of commit da9cf0d554 - Show all commits

View File

@@ -76,7 +76,7 @@ const allItems = [
icon: <NodeExpandOutlined style={{ fontSize: '19px' }} />, icon: <NodeExpandOutlined style={{ fontSize: '19px' }} />,
label: <Link to="/dashboard-svg/compressor-c">Compressor C</Link>, label: <Link to="/dashboard-svg/compressor-c">Compressor C</Link>,
}, },
] ],
}, },
{ {
key: 'dashboard-svg-airdryer', key: 'dashboard-svg-airdryer',
@@ -103,7 +103,7 @@ const allItems = [
icon: <NodeExpandOutlined style={{ fontSize: '19px' }} />, icon: <NodeExpandOutlined style={{ fontSize: '19px' }} />,
label: <Link to="/dashboard-svg/airdryer-c">Air Dryer C</Link>, label: <Link to="/dashboard-svg/airdryer-c">Air Dryer C</Link>,
}, },
] ],
}, },
], ],
}, },
@@ -142,11 +142,11 @@ const allItems = [
icon: <SafetyOutlined style={{ fontSize: '19px' }} />, icon: <SafetyOutlined style={{ fontSize: '19px' }} />,
label: <Link to="/master/status">Status</Link>, label: <Link to="/master/status">Status</Link>,
}, },
{ // {
key: 'master-shift', // key: 'master-shift',
icon: <ClockCircleOutlined style={{ fontSize: '19px' }} />, // icon: <ClockCircleOutlined style={{ fontSize: '19px' }} />,
label: <Link to="/master/shift">Shift</Link>, // label: <Link to="/master/shift">Shift</Link>,
}, // },
], ],
}, },
{ {
@@ -219,15 +219,15 @@ const allItems = [
</Link> </Link>
), ),
}, },
{ // {
key: 'jadwal-shift', // key: 'jadwal-shift',
icon: <CalendarOutlined style={{ fontSize: '19px' }} />, // icon: <CalendarOutlined style={{ fontSize: '19px' }} />,
label: ( // label: (
<Link to="/jadwal-shift" className="fontMenus"> // <Link to="/jadwal-shift" className="fontMenus">
Jadwal Shift // Jadwal Shift
</Link> // </Link>
), // ),
}, // },
]; ];
const LayoutMenu = () => { const LayoutMenu = () => {
@@ -255,11 +255,11 @@ const LayoutMenu = () => {
const masterKeyMap = { const masterKeyMap = {
'plant-sub-section': 'master-plant-sub-section', 'plant-sub-section': 'master-plant-sub-section',
'brand-device': 'master-brand-device', 'brand-device': 'master-brand-device',
'device': 'master-device', device: 'master-device',
'unit': 'master-unit', unit: 'master-unit',
'tag': 'master-tag', tag: 'master-tag',
'status': 'master-status', status: 'master-status',
'shift': 'master-shift' shift: 'master-shift',
}; };
return masterKeyMap[subPath] || `master-${subPath}`; return masterKeyMap[subPath] || `master-${subPath}`;
} }
@@ -284,8 +284,8 @@ const LayoutMenu = () => {
if (pathname.startsWith('/report/')) { if (pathname.startsWith('/report/')) {
const subPath = pathParts[1]; const subPath = pathParts[1];
const reportKeyMap = { const reportKeyMap = {
'trending': 'report-trending', trending: 'report-trending',
'report': 'report-report' report: 'report-report',
}; };
return reportKeyMap[subPath] || `report-${subPath}`; return reportKeyMap[subPath] || `report-${subPath}`;
} }
@@ -294,8 +294,8 @@ const LayoutMenu = () => {
if (pathname.startsWith('/history/')) { if (pathname.startsWith('/history/')) {
const subPath = pathParts[1]; const subPath = pathParts[1];
const historyKeyMap = { const historyKeyMap = {
'alarm': 'history-alarm', alarm: 'history-alarm',
'event': 'history-event' event: 'history-event',
}; };
return historyKeyMap[subPath] || `history-${subPath}`; return historyKeyMap[subPath] || `history-${subPath}`;
} }
@@ -378,9 +378,7 @@ const LayoutMenu = () => {
const necessaryParentKeys = getParentKeys(currentKey); const necessaryParentKeys = getParentKeys(currentKey);
// Filter out only the menus that are necessary to keep open // Filter out only the menus that are necessary to keep open
const filteredOpenKeys = openKeys.filter(key => const filteredOpenKeys = openKeys.filter((key) => necessaryParentKeys.includes(key));
necessaryParentKeys.includes(key)
);
setStateOpenKeys(filteredOpenKeys); setStateOpenKeys(filteredOpenKeys);
} }
@@ -391,9 +389,7 @@ const LayoutMenu = () => {
const karyawan = () => { const karyawan = () => {
return allItems return allItems
.filter( .filter((item) => item.key !== 'setting')
(item) => item.key !== 'setting'
)
.map((item) => { .map((item) => {
if (item.key === 'master') { if (item.key === 'master') {
return { return {

View File

@@ -12,8 +12,6 @@ import { useNavigate } from 'react-router-dom';
import { NotifAlert, NotifConfirmDialog } from '../../../components/Global/ToastNotif'; import { NotifAlert, NotifConfirmDialog } from '../../../components/Global/ToastNotif';
import { getAllContact, deleteContact } from '../../../api/contact'; import { getAllContact, deleteContact } from '../../../api/contact';
const { TabPane } = Tabs;
const ContactCard = memo(function ContactCard({ contact, showEditModal, showDeleteModal }) { const ContactCard = memo(function ContactCard({ contact, showEditModal, showDeleteModal }) {
return ( return (
<Col xs={24} sm={12} md={8} lg={6}> <Col xs={24} sm={12} md={8} lg={6}>
@@ -118,7 +116,14 @@ const ContactCard = memo(function ContactCard({ contact, showEditModal, showDele
</div> </div>
{/* Edit and Delete Buttons - Bottom Right */} {/* Edit and Delete Buttons - Bottom Right */}
<div style={{ display: 'flex', justifyContent: 'flex-end', gap: '8px', marginTop: '8px' }}> <div
style={{
display: 'flex',
justifyContent: 'flex-end',
gap: '8px',
marginTop: '8px',
}}
>
<Space> <Space>
<Button <Button
type="text" type="text"
@@ -127,9 +132,11 @@ const ContactCard = memo(function ContactCard({ contact, showEditModal, showDele
borderColor: '#faad14', borderColor: '#faad14',
padding: '2px 6px', padding: '2px 6px',
fontSize: '11px', fontSize: '11px',
height: '24px' height: '24px',
}} }}
icon={<EditOutlined style={{ color: '#faad14', fontSize: '11px' }} />} icon={
<EditOutlined style={{ color: '#faad14', fontSize: '11px' }} />
}
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
showEditModal(contact); showEditModal(contact);
@@ -145,7 +152,7 @@ const ContactCard = memo(function ContactCard({ contact, showEditModal, showDele
borderColor: 'red', borderColor: 'red',
padding: '2px 6px', padding: '2px 6px',
fontSize: '11px', fontSize: '11px',
height: '24px' height: '24px',
}} }}
icon={<DeleteOutlined style={{ fontSize: '11px' }} />} icon={<DeleteOutlined style={{ fontSize: '11px' }} />}
onClick={(e) => { onClick={(e) => {
@@ -282,7 +289,6 @@ const ListContact = memo(function ListContact(props) {
} }
}; };
return ( return (
<React.Fragment> <React.Fragment>
<Card> <Card>
@@ -302,7 +308,11 @@ const ListContact = memo(function ListContact(props) {
}} }}
onSearch={(value) => setFormDataFilter({ criteria: value })} onSearch={(value) => setFormDataFilter({ criteria: value })}
allowClear={{ allowClear={{
clearIcon: <span onClick={() => setFormDataFilter(defaultFilter)}></span>, clearIcon: (
<span onClick={() => setFormDataFilter(defaultFilter)}>
</span>
),
}} }}
enterButton={ enterButton={
<Button <Button
@@ -353,12 +363,25 @@ const ListContact = memo(function ListContact(props) {
marginBottom: '16px', marginBottom: '16px',
}} }}
> >
<Tabs activeKey={activeTab} onChange={setActiveTab} size="large"> <Tabs
<TabPane tab="All" key="all" /> activeKey={activeTab}
<TabPane tab="Operator" key="operator" /> onChange={setActiveTab}
<TabPane tab="Gudang" key="gudang" /> size="large"
</Tabs> items={[
{
key: 'all',
label: 'All',
},
{
key: 'operator',
label: 'Operator',
},
{
key: 'gudang',
label: 'Gudang',
},
]}
/>
</div> </div>
{getFilteredContacts().length === 0 ? ( {getFilteredContacts().length === 0 ? (
@@ -377,7 +400,7 @@ const ListContact = memo(function ListContact(props) {
id: contact.contact_id || contact.id, id: contact.contact_id || contact.id,
name: contact.contact_name || contact.name, name: contact.contact_name || contact.name,
phone: contact.contact_phone || contact.phone, phone: contact.contact_phone || contact.phone,
status: contact.is_active ? 'active' : 'inactive' status: contact.is_active ? 'active' : 'inactive',
}} }}
showEditModal={showEditModal} showEditModal={showEditModal}
showDeleteModal={showDeleteModal} showDeleteModal={showDeleteModal}