- 분할접수 카드 구분: 같은 공정 복수 SPLIT 시 "접수 #1", "접수 #2" 표시 - 재작업 카드 전공정 표시: is_rework='Y' 카드는 공정 필터 무시, 모든 공정에서 표시 - 대기/완료 탭: 선택한 공정 기준으로만 카드 표시 (기존 동작 확인) - DefectTypeModal: 전공정/지정공정 UI 이미 구현 확인 (수정 불필요)
1339 lines
45 KiB
HTML
1339 lines
45 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>POP 화면 설정 관리 v2</title>
|
|
<style>
|
|
/* ── Reset ── */
|
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
|
|
body {
|
|
font-family: 'Pretendard', system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
background: #e2e8f0;
|
|
color: #1e293b;
|
|
min-height: 100vh;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* ── Main Layout: 65% POP / 35% Settings ── */
|
|
.main-layout {
|
|
display: flex;
|
|
height: 100vh;
|
|
gap: 0;
|
|
}
|
|
|
|
/* ── Left: POP Preview Area ── */
|
|
.pop-area {
|
|
flex: 0 0 65%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: #cbd5e1;
|
|
padding: 24px;
|
|
position: relative;
|
|
}
|
|
|
|
.pop-frame {
|
|
width: 100%;
|
|
max-width: 1000px;
|
|
aspect-ratio: 1280 / 800;
|
|
background: #f8fafc;
|
|
border-radius: 16px;
|
|
box-shadow: 0 20px 60px rgba(0,0,0,0.25), 0 0 0 2px #94a3b8;
|
|
overflow: hidden;
|
|
position: relative;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
/* ── POP Header ── */
|
|
.pop-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 12px 20px;
|
|
background: #fff;
|
|
border-bottom: 1px solid #e2e8f0;
|
|
flex-shrink: 0;
|
|
}
|
|
.pop-header-left {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
.pop-logo {
|
|
width: 36px; height: 36px;
|
|
background: linear-gradient(135deg, #3b82f6, #1d4ed8);
|
|
border-radius: 8px;
|
|
display: flex; align-items: center; justify-content: center;
|
|
color: #fff; font-weight: 800; font-size: 14px;
|
|
}
|
|
.pop-brand { font-size: 18px; font-weight: 700; color: #0f172a; letter-spacing: -0.5px; }
|
|
.pop-header-right {
|
|
display: flex; align-items: center; gap: 12px;
|
|
font-size: 13px; color: #64748b;
|
|
}
|
|
.pop-user-badge {
|
|
background: #f1f5f9; padding: 4px 12px; border-radius: 20px;
|
|
font-weight: 600; color: #475569;
|
|
}
|
|
.pop-logout-btn {
|
|
padding: 4px 12px; border-radius: 6px; border: 1px solid #e2e8f0;
|
|
background: #fff; font-size: 12px; color: #64748b; cursor: pointer;
|
|
}
|
|
|
|
/* ── POP Back Header (for sub-screens) ── */
|
|
.pop-back-header {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 12px 20px;
|
|
background: #fff;
|
|
border-bottom: 1px solid #e2e8f0;
|
|
flex-shrink: 0;
|
|
gap: 12px;
|
|
}
|
|
.back-btn {
|
|
width: 36px; height: 36px;
|
|
border-radius: 8px; border: 1px solid #e2e8f0;
|
|
background: #fff; display: flex; align-items: center; justify-content: center;
|
|
cursor: pointer; font-size: 18px; color: #475569;
|
|
transition: all .15s;
|
|
}
|
|
.back-btn:hover { background: #f1f5f9; }
|
|
.pop-screen-title { font-size: 18px; font-weight: 700; color: #0f172a; }
|
|
|
|
/* ── POP Content ── */
|
|
.pop-content {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
background: #f1f5f9;
|
|
position: relative;
|
|
}
|
|
|
|
/* ── Configurable Zone ── */
|
|
.config-zone {
|
|
position: relative;
|
|
cursor: pointer;
|
|
transition: all .2s;
|
|
}
|
|
.config-zone::before {
|
|
content: '';
|
|
position: absolute; inset: 0;
|
|
border: 2px solid transparent;
|
|
border-radius: 8px;
|
|
z-index: 5;
|
|
pointer-events: none;
|
|
transition: all .2s;
|
|
}
|
|
.config-zone::after {
|
|
content: attr(data-label);
|
|
position: absolute;
|
|
top: 4px; left: 8px;
|
|
background: rgba(37, 99, 235, 0.85);
|
|
color: #fff;
|
|
font-size: 10px; font-weight: 600;
|
|
padding: 2px 8px;
|
|
border-radius: 4px;
|
|
opacity: 0;
|
|
z-index: 6;
|
|
pointer-events: none;
|
|
transition: opacity .15s;
|
|
white-space: nowrap;
|
|
}
|
|
.config-zone:hover::before {
|
|
border-color: rgba(37, 99, 235, 0.4);
|
|
background: rgba(37, 99, 235, 0.06);
|
|
}
|
|
.config-zone:hover::after {
|
|
opacity: 1;
|
|
}
|
|
.config-zone.selected::before {
|
|
border-color: #2563eb;
|
|
background: rgba(37, 99, 235, 0.08);
|
|
}
|
|
.config-zone.selected::after {
|
|
opacity: 1;
|
|
background: #2563eb;
|
|
}
|
|
.config-zone.off-state {
|
|
opacity: 0.3;
|
|
position: relative;
|
|
}
|
|
.config-zone.off-state .off-overlay {
|
|
position: absolute; inset: 0;
|
|
display: flex; align-items: center; justify-content: center;
|
|
background: rgba(148, 163, 184, 0.3);
|
|
border-radius: 8px;
|
|
z-index: 4;
|
|
pointer-events: none;
|
|
}
|
|
.off-overlay span {
|
|
background: #64748b; color: #fff;
|
|
padding: 4px 16px; border-radius: 6px;
|
|
font-size: 13px; font-weight: 700;
|
|
}
|
|
|
|
/* ══════════ HOME SCREEN ══════════ */
|
|
.home-screen { padding: 20px; }
|
|
|
|
/* KPI Carousel */
|
|
.kpi-carousel {
|
|
display: flex; gap: 12px; margin-bottom: 20px;
|
|
overflow-x: auto; padding-bottom: 4px;
|
|
}
|
|
.kpi-card {
|
|
flex: 0 0 calc(33.33% - 8px);
|
|
background: #fff;
|
|
border-radius: 12px;
|
|
padding: 16px 20px;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
|
|
}
|
|
.kpi-card-title {
|
|
font-size: 12px; font-weight: 600; color: #64748b;
|
|
margin-bottom: 4px;
|
|
}
|
|
.kpi-card-value {
|
|
font-size: 28px; font-weight: 800;
|
|
background: linear-gradient(135deg, #2563eb, #7c3aed);
|
|
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
|
|
background-clip: text;
|
|
}
|
|
.kpi-card-sub {
|
|
font-size: 11px; color: #94a3b8; margin-top: 2px;
|
|
}
|
|
.kpi-card.green .kpi-card-value {
|
|
background: linear-gradient(135deg, #059669, #10b981);
|
|
-webkit-background-clip: text; background-clip: text;
|
|
}
|
|
.kpi-card.orange .kpi-card-value {
|
|
background: linear-gradient(135deg, #ea580c, #f59e0b);
|
|
-webkit-background-clip: text; background-clip: text;
|
|
}
|
|
|
|
/* Menu Grid */
|
|
.menu-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(4, 1fr);
|
|
gap: 12px;
|
|
margin-bottom: 20px;
|
|
}
|
|
.menu-item {
|
|
background: #fff;
|
|
border-radius: 14px;
|
|
padding: 20px 12px;
|
|
text-align: center;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.06);
|
|
cursor: pointer;
|
|
transition: all .2s;
|
|
}
|
|
.menu-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
|
|
.menu-icon {
|
|
width: 56px; height: 56px;
|
|
border-radius: 16px;
|
|
display: flex; align-items: center; justify-content: center;
|
|
margin: 0 auto 10px;
|
|
font-size: 26px;
|
|
}
|
|
.menu-icon.blue { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
|
|
.menu-icon.green { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
|
|
.menu-icon.purple { background: linear-gradient(135deg, #ede9fe, #ddd6fe); }
|
|
.menu-icon.amber { background: linear-gradient(135deg, #fef3c7, #fde68a); }
|
|
.menu-icon.gray { background: #f1f5f9; }
|
|
.menu-label { font-size: 13px; font-weight: 600; color: #334155; }
|
|
.menu-item.empty { opacity: 0.4; cursor: default; }
|
|
.menu-item.empty:hover { transform: none; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
|
|
|
|
/* Recent Activity */
|
|
.recent-section { }
|
|
.recent-title {
|
|
font-size: 14px; font-weight: 700; color: #334155; margin-bottom: 10px;
|
|
display: flex; align-items: center; gap: 6px;
|
|
}
|
|
.recent-list {
|
|
background: #fff; border-radius: 12px;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.06);
|
|
overflow: hidden;
|
|
}
|
|
.recent-item {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
padding: 12px 16px;
|
|
border-bottom: 1px solid #f1f5f9;
|
|
font-size: 13px;
|
|
}
|
|
.recent-item:last-child { border-bottom: none; }
|
|
.recent-item-left { display: flex; align-items: center; gap: 10px; }
|
|
.recent-dot {
|
|
width: 8px; height: 8px; border-radius: 50%;
|
|
}
|
|
.recent-dot.blue { background: #3b82f6; }
|
|
.recent-dot.green { background: #10b981; }
|
|
.recent-dot.amber { background: #f59e0b; }
|
|
.recent-item-text { color: #334155; font-weight: 500; }
|
|
.recent-item-time { color: #94a3b8; font-size: 12px; }
|
|
|
|
/* ══════════ INBOUND SCREEN ══════════ */
|
|
.inbound-screen, .outbound-screen { padding: 16px; }
|
|
|
|
.field-row {
|
|
display: flex; gap: 10px; margin-bottom: 12px;
|
|
}
|
|
.field-input {
|
|
flex: 1;
|
|
padding: 12px 16px;
|
|
border: 1px solid #e2e8f0;
|
|
border-radius: 10px;
|
|
background: #fff;
|
|
font-size: 14px;
|
|
color: #334155;
|
|
}
|
|
.field-input::placeholder { color: #94a3b8; }
|
|
.scan-btn {
|
|
width: 48px; height: 48px;
|
|
border-radius: 10px;
|
|
border: 1px solid #e2e8f0;
|
|
background: #fff;
|
|
display: flex; align-items: center; justify-content: center;
|
|
font-size: 20px;
|
|
cursor: pointer;
|
|
transition: all .15s;
|
|
flex-shrink: 0;
|
|
}
|
|
.scan-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
|
|
|
|
/* Item Cards */
|
|
.item-card {
|
|
background: #fff;
|
|
border-radius: 12px;
|
|
padding: 16px;
|
|
margin-bottom: 10px;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.06);
|
|
}
|
|
.item-card-header {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
margin-bottom: 10px;
|
|
}
|
|
.item-name { font-size: 15px; font-weight: 700; color: #0f172a; }
|
|
.item-code { font-size: 12px; color: #94a3b8; }
|
|
.inspection-badge {
|
|
background: #fef2f2; color: #dc2626;
|
|
padding: 3px 10px; border-radius: 6px;
|
|
font-size: 11px; font-weight: 600;
|
|
}
|
|
.item-card-body {
|
|
display: flex; align-items: center; gap: 12px;
|
|
}
|
|
.qty-input {
|
|
width: 80px; padding: 10px;
|
|
border: 1px solid #e2e8f0; border-radius: 8px;
|
|
text-align: center; font-size: 16px; font-weight: 700;
|
|
background: #f8fafc;
|
|
}
|
|
.pkg-select {
|
|
padding: 10px 14px;
|
|
border: 1px solid #e2e8f0; border-radius: 8px;
|
|
background: #fff; font-size: 13px; color: #475569;
|
|
}
|
|
|
|
/* Bottom Action Area */
|
|
.bottom-actions {
|
|
display: flex; gap: 10px; margin-top: 16px;
|
|
}
|
|
.action-btn {
|
|
flex: 1;
|
|
padding: 14px;
|
|
border-radius: 12px;
|
|
border: none;
|
|
font-size: 15px;
|
|
font-weight: 700;
|
|
cursor: pointer;
|
|
display: flex; align-items: center; justify-content: center; gap: 8px;
|
|
transition: all .15s;
|
|
}
|
|
.action-btn.primary {
|
|
background: linear-gradient(135deg, #2563eb, #1d4ed8);
|
|
color: #fff;
|
|
}
|
|
.action-btn.primary:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); }
|
|
.action-btn.secondary {
|
|
background: #fff;
|
|
border: 1px solid #e2e8f0;
|
|
color: #475569;
|
|
}
|
|
.action-btn.secondary:hover { background: #f8fafc; }
|
|
|
|
/* Photo Upload */
|
|
.photo-upload-zone {
|
|
border: 2px dashed #cbd5e1;
|
|
border-radius: 12px;
|
|
padding: 16px;
|
|
text-align: center;
|
|
color: #94a3b8;
|
|
font-size: 13px;
|
|
margin-top: 12px;
|
|
display: flex; align-items: center; justify-content: center; gap: 8px;
|
|
}
|
|
|
|
/* ══════════ PROCESS EXECUTION SCREEN ══════════ */
|
|
.process-screen {
|
|
display: flex;
|
|
flex: 1;
|
|
height: 100%;
|
|
}
|
|
|
|
/* Process Sidebar */
|
|
.process-sidebar {
|
|
width: 160px;
|
|
background: #fff;
|
|
border-right: 1px solid #e2e8f0;
|
|
overflow-y: auto;
|
|
flex-shrink: 0;
|
|
}
|
|
.process-sidebar-title {
|
|
padding: 14px 14px 8px;
|
|
font-size: 12px; font-weight: 700; color: #94a3b8;
|
|
text-transform: uppercase; letter-spacing: 0.5px;
|
|
}
|
|
.process-item {
|
|
padding: 10px 14px;
|
|
font-size: 13px; font-weight: 500;
|
|
color: #475569; cursor: pointer;
|
|
border-left: 3px solid transparent;
|
|
transition: all .15s;
|
|
}
|
|
.process-item:hover { background: #f8fafc; }
|
|
.process-item.active {
|
|
background: #eff6ff;
|
|
border-left-color: #2563eb;
|
|
color: #1d4ed8; font-weight: 700;
|
|
}
|
|
|
|
/* Process Main */
|
|
.process-main {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Tabs */
|
|
.process-tabs {
|
|
display: flex; gap: 0;
|
|
background: #fff;
|
|
border-bottom: 1px solid #e2e8f0;
|
|
flex-shrink: 0;
|
|
}
|
|
.process-tab {
|
|
padding: 10px 18px;
|
|
font-size: 13px; font-weight: 600;
|
|
color: #64748b;
|
|
cursor: pointer;
|
|
border-bottom: 2px solid transparent;
|
|
transition: all .15s;
|
|
}
|
|
.process-tab:hover { color: #334155; }
|
|
.process-tab.active {
|
|
color: #2563eb;
|
|
border-bottom-color: #2563eb;
|
|
}
|
|
|
|
/* Process Content */
|
|
.process-content {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
padding: 14px;
|
|
background: #f1f5f9;
|
|
}
|
|
|
|
/* Work Order Card */
|
|
.wo-card {
|
|
background: #fff;
|
|
border-radius: 10px;
|
|
padding: 14px;
|
|
margin-bottom: 10px;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
|
|
cursor: pointer;
|
|
transition: all .15s;
|
|
border: 2px solid transparent;
|
|
}
|
|
.wo-card:hover { border-color: #bfdbfe; }
|
|
.wo-card.active { border-color: #2563eb; background: #eff6ff; }
|
|
.wo-card-top {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
margin-bottom: 6px;
|
|
}
|
|
.wo-product { font-size: 14px; font-weight: 700; color: #0f172a; }
|
|
.wo-status {
|
|
font-size: 11px; font-weight: 600; padding: 2px 10px;
|
|
border-radius: 10px;
|
|
}
|
|
.wo-status.waiting { background: #fef3c7; color: #92400e; }
|
|
.wo-status.running { background: #dbeafe; color: #1e40af; }
|
|
.wo-card-info { font-size: 12px; color: #64748b; }
|
|
|
|
/* Work Detail */
|
|
.work-detail {
|
|
margin-top: 12px;
|
|
background: #fff;
|
|
border-radius: 10px;
|
|
padding: 14px;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
|
|
}
|
|
.work-detail-title {
|
|
font-size: 14px; font-weight: 700; color: #0f172a;
|
|
margin-bottom: 12px; padding-bottom: 8px;
|
|
border-bottom: 1px solid #f1f5f9;
|
|
}
|
|
|
|
/* Timer Bar */
|
|
.timer-bar {
|
|
display: flex; align-items: center; gap: 8px;
|
|
background: #f8fafc; border-radius: 10px;
|
|
padding: 10px 14px; margin-bottom: 12px;
|
|
}
|
|
.timer-item {
|
|
display: flex; flex-direction: column; align-items: center;
|
|
flex: 1;
|
|
}
|
|
.timer-label { font-size: 10px; color: #94a3b8; font-weight: 600; }
|
|
.timer-value { font-size: 16px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; }
|
|
.timer-sep { width: 1px; height: 30px; background: #e2e8f0; }
|
|
.timer-start-btn {
|
|
padding: 8px 18px; border-radius: 8px; border: none;
|
|
background: linear-gradient(135deg, #10b981, #059669);
|
|
color: #fff; font-size: 13px; font-weight: 700;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* Checklist */
|
|
.checklist { margin-bottom: 12px; }
|
|
.checklist-title { font-size: 12px; font-weight: 700; color: #64748b; margin-bottom: 6px; }
|
|
.checklist-item {
|
|
display: flex; align-items: center; gap: 8px;
|
|
padding: 6px 0; font-size: 13px; color: #334155;
|
|
}
|
|
.checklist-check {
|
|
width: 18px; height: 18px; border-radius: 4px;
|
|
border: 2px solid #cbd5e1; background: #fff;
|
|
display: flex; align-items: center; justify-content: center;
|
|
font-size: 11px; color: #fff; cursor: pointer;
|
|
}
|
|
.checklist-check.checked { background: #2563eb; border-color: #2563eb; }
|
|
|
|
/* Result Input */
|
|
.result-input-row {
|
|
display: flex; gap: 10px; margin-bottom: 12px; align-items: center;
|
|
}
|
|
.result-label { font-size: 13px; font-weight: 600; color: #475569; min-width: 50px; }
|
|
.result-qty {
|
|
width: 70px; padding: 8px;
|
|
border: 1px solid #e2e8f0; border-radius: 8px;
|
|
text-align: center; font-size: 15px; font-weight: 700;
|
|
background: #f8fafc;
|
|
}
|
|
.result-qty.bad { border-color: #fecaca; background: #fef2f2; color: #dc2626; }
|
|
|
|
/* Material Section */
|
|
.material-section {
|
|
background: #f8fafc; border-radius: 10px;
|
|
padding: 12px; margin-bottom: 12px;
|
|
}
|
|
.material-title {
|
|
font-size: 12px; font-weight: 700; color: #64748b; margin-bottom: 8px;
|
|
display: flex; align-items: center; gap: 6px;
|
|
}
|
|
.material-item {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
padding: 6px 0; font-size: 13px;
|
|
border-bottom: 1px solid #e2e8f0;
|
|
}
|
|
.material-item:last-child { border-bottom: none; }
|
|
|
|
/* Defect Button */
|
|
.defect-btn {
|
|
padding: 10px 18px; border-radius: 8px; border: none;
|
|
background: linear-gradient(135deg, #ef4444, #dc2626);
|
|
color: #fff; font-size: 13px; font-weight: 700;
|
|
cursor: pointer; width: 100%; margin-top: 8px;
|
|
}
|
|
|
|
/* ══════════ RIGHT: SETTINGS PANEL ══════════ */
|
|
.settings-area {
|
|
flex: 0 0 35%;
|
|
background: #fff;
|
|
border-left: 1px solid #e2e8f0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Settings Header */
|
|
.settings-header {
|
|
padding: 20px 24px;
|
|
border-bottom: 1px solid #e2e8f0;
|
|
flex-shrink: 0;
|
|
}
|
|
.settings-header h2 {
|
|
font-size: 16px; font-weight: 700; color: #0f172a;
|
|
}
|
|
.settings-header .screen-name {
|
|
font-size: 13px; color: #64748b; margin-top: 2px;
|
|
}
|
|
|
|
/* Settings Body */
|
|
.settings-body {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
padding: 20px 24px;
|
|
}
|
|
|
|
/* Empty State */
|
|
.settings-empty {
|
|
display: flex; flex-direction: column;
|
|
align-items: center; justify-content: center;
|
|
height: 100%;
|
|
color: #94a3b8;
|
|
text-align: center;
|
|
}
|
|
.settings-empty-icon {
|
|
font-size: 48px; margin-bottom: 16px; opacity: 0.5;
|
|
}
|
|
.settings-empty-text {
|
|
font-size: 14px; font-weight: 600; margin-bottom: 4px; color: #64748b;
|
|
}
|
|
.settings-empty-sub {
|
|
font-size: 13px; color: #94a3b8;
|
|
}
|
|
|
|
/* Setting Group */
|
|
.setting-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
.setting-group-title {
|
|
font-size: 14px; font-weight: 700; color: #0f172a;
|
|
margin-bottom: 4px;
|
|
}
|
|
.setting-group-desc {
|
|
font-size: 12px; color: #94a3b8; margin-bottom: 12px;
|
|
}
|
|
|
|
/* Toggle */
|
|
.toggle-row {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
padding: 10px 0;
|
|
border-bottom: 1px solid #f1f5f9;
|
|
}
|
|
.toggle-row:last-child { border-bottom: none; }
|
|
.toggle-label { font-size: 13px; font-weight: 500; color: #334155; }
|
|
.toggle-switch {
|
|
width: 44px; height: 24px;
|
|
border-radius: 12px;
|
|
background: #cbd5e1;
|
|
position: relative;
|
|
cursor: pointer;
|
|
transition: background .2s;
|
|
flex-shrink: 0;
|
|
}
|
|
.toggle-switch.on { background: #2563eb; }
|
|
.toggle-switch::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: 2px; left: 2px;
|
|
width: 20px; height: 20px;
|
|
border-radius: 50%;
|
|
background: #fff;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
|
|
transition: transform .2s;
|
|
}
|
|
.toggle-switch.on::after { transform: translateX(20px); }
|
|
|
|
/* Tag Editor */
|
|
.tag-editor { margin-top: 8px; }
|
|
.tag-editor-label { font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 6px; }
|
|
.tag-list {
|
|
display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px;
|
|
}
|
|
.tag {
|
|
display: flex; align-items: center; gap: 4px;
|
|
padding: 4px 10px; border-radius: 6px;
|
|
background: #eff6ff; color: #1d4ed8;
|
|
font-size: 12px; font-weight: 600;
|
|
}
|
|
.tag-remove {
|
|
cursor: pointer; opacity: 0.6; font-size: 14px;
|
|
}
|
|
.tag-remove:hover { opacity: 1; }
|
|
.tag-input-row { display: flex; gap: 6px; }
|
|
.tag-input {
|
|
flex: 1; padding: 6px 10px;
|
|
border: 1px solid #e2e8f0; border-radius: 6px;
|
|
font-size: 12px;
|
|
}
|
|
.tag-add-btn {
|
|
padding: 6px 12px; border-radius: 6px;
|
|
border: 1px solid #2563eb; background: #eff6ff;
|
|
color: #2563eb; font-size: 12px; font-weight: 600;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* Settings Footer */
|
|
.settings-footer {
|
|
padding: 16px 24px;
|
|
border-top: 1px solid #e2e8f0;
|
|
display: flex; gap: 10px;
|
|
flex-shrink: 0;
|
|
}
|
|
.settings-footer .btn {
|
|
flex: 1;
|
|
padding: 10px;
|
|
border-radius: 8px;
|
|
border: 1px solid #e2e8f0;
|
|
background: #fff;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
text-align: center;
|
|
}
|
|
.settings-footer .btn:hover { background: #f8fafc; }
|
|
.settings-footer .btn-save {
|
|
background: #2563eb; color: #fff; border-color: #2563eb;
|
|
}
|
|
.settings-footer .btn-save:hover { background: #1d4ed8; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="main-layout">
|
|
<!-- ══════ LEFT: POP PREVIEW ══════ -->
|
|
<div class="pop-area">
|
|
<div class="pop-frame" id="popFrame">
|
|
<!-- HOME SCREEN -->
|
|
<div id="screen-home" class="screen active-screen">
|
|
<div class="pop-header">
|
|
<div class="pop-header-left">
|
|
<div class="pop-logo">V</div>
|
|
<span class="pop-brand">VEXPLOR</span>
|
|
</div>
|
|
<div class="pop-header-right">
|
|
<span class="pop-user-badge">topseal_admin</span>
|
|
<button class="pop-logout-btn">로그아웃</button>
|
|
</div>
|
|
</div>
|
|
<div class="pop-content home-screen">
|
|
<!-- KPI Carousel -->
|
|
<div class="config-zone" data-key="kpiCarousel" data-label="KPI 캐러셀" data-screen="home" onclick="selectZone(this)">
|
|
<div class="kpi-carousel">
|
|
<div class="kpi-card">
|
|
<div class="kpi-card-title">입고 현황</div>
|
|
<div class="kpi-card-value">127</div>
|
|
<div class="kpi-card-sub">오늘 입고 완료</div>
|
|
</div>
|
|
<div class="kpi-card green">
|
|
<div class="kpi-card-title">출고 현황</div>
|
|
<div class="kpi-card-value">89</div>
|
|
<div class="kpi-card-sub">오늘 출고 완료</div>
|
|
</div>
|
|
<div class="kpi-card orange">
|
|
<div class="kpi-card-title">생산 현황</div>
|
|
<div class="kpi-card-value">34</div>
|
|
<div class="kpi-card-sub">진행중 작업</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Menu Grid -->
|
|
<div class="menu-grid">
|
|
<div class="menu-item" onclick="navigateTo('inbound')">
|
|
<div class="menu-icon blue">📦</div>
|
|
<div class="menu-label">구매입고</div>
|
|
</div>
|
|
<div class="menu-item" onclick="navigateTo('outbound')">
|
|
<div class="menu-icon green">🚛</div>
|
|
<div class="menu-label">판매출고</div>
|
|
</div>
|
|
<div class="menu-item" onclick="navigateTo('process')">
|
|
<div class="menu-icon purple">⚙️</div>
|
|
<div class="menu-label">생산실행</div>
|
|
</div>
|
|
<div class="menu-item" onclick="navigateTo('inventory')">
|
|
<div class="menu-icon amber">📊</div>
|
|
<div class="menu-label">재고관리</div>
|
|
</div>
|
|
<div class="menu-item empty">
|
|
<div class="menu-icon gray">+</div>
|
|
<div class="menu-label" style="color:#94a3b8">비어있음</div>
|
|
</div>
|
|
<div class="menu-item empty">
|
|
<div class="menu-icon gray">+</div>
|
|
<div class="menu-label" style="color:#94a3b8">비어있음</div>
|
|
</div>
|
|
<div class="menu-item empty">
|
|
<div class="menu-icon gray">+</div>
|
|
<div class="menu-label" style="color:#94a3b8">비어있음</div>
|
|
</div>
|
|
<div class="menu-item empty">
|
|
<div class="menu-icon gray">+</div>
|
|
<div class="menu-label" style="color:#94a3b8">비어있음</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Recent Activity -->
|
|
<div class="config-zone" data-key="recentActivity" data-label="최근 활동" data-screen="home" onclick="selectZone(this)">
|
|
<div class="recent-section">
|
|
<div class="recent-title">📋 최근 활동</div>
|
|
<div class="recent-list">
|
|
<div class="recent-item">
|
|
<div class="recent-item-left">
|
|
<div class="recent-dot blue"></div>
|
|
<span class="recent-item-text">구매입고 #2024-0127 완료</span>
|
|
</div>
|
|
<span class="recent-item-time">10분 전</span>
|
|
</div>
|
|
<div class="recent-item">
|
|
<div class="recent-item-left">
|
|
<div class="recent-dot green"></div>
|
|
<span class="recent-item-text">SMT 공정 작업 시작</span>
|
|
</div>
|
|
<span class="recent-item-time">25분 전</span>
|
|
</div>
|
|
<div class="recent-item">
|
|
<div class="recent-item-left">
|
|
<div class="recent-dot amber"></div>
|
|
<span class="recent-item-text">판매출고 #2024-0089 대기중</span>
|
|
</div>
|
|
<span class="recent-item-time">1시간 전</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- INBOUND SCREEN -->
|
|
<div id="screen-inbound" class="screen" style="display:none">
|
|
<div class="pop-back-header">
|
|
<button class="back-btn" onclick="navigateTo('home')">←</button>
|
|
<span class="pop-screen-title">구매입고</span>
|
|
</div>
|
|
<div class="pop-content inbound-screen">
|
|
<!-- Vendor Select + Barcode -->
|
|
<div class="config-zone" data-key="barcodeEnabled" data-label="바코드 스캔" data-screen="inbound" onclick="selectZone(this)">
|
|
<div class="field-row">
|
|
<input class="field-input" placeholder="거래처 선택..." readonly>
|
|
<button class="scan-btn" title="바코드 스캔">📷</button>
|
|
</div>
|
|
<div class="field-row">
|
|
<input class="field-input" placeholder="품목 검색..." readonly>
|
|
<button class="scan-btn" title="바코드 스캔">📷</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Item Cards -->
|
|
<div class="config-zone" data-key="inspectionRequired" data-label="검사 필수 배지" data-screen="inbound" onclick="selectZone(this)">
|
|
<div class="item-card">
|
|
<div class="item-card-header">
|
|
<div>
|
|
<div class="item-name">PCB 기판 A-Type</div>
|
|
<div class="item-code">ITM-2024-001</div>
|
|
</div>
|
|
<span class="inspection-badge">검사 필수</span>
|
|
</div>
|
|
<div class="item-card-body">
|
|
<input class="qty-input" value="100" readonly>
|
|
<span style="font-size:13px;color:#64748b">EA</span>
|
|
<select class="pkg-select"><option>박스</option></select>
|
|
</div>
|
|
</div>
|
|
<div class="item-card">
|
|
<div class="item-card-header">
|
|
<div>
|
|
<div class="item-name">커넥터 B-12P</div>
|
|
<div class="item-code">ITM-2024-042</div>
|
|
</div>
|
|
<span class="inspection-badge">검사 필수</span>
|
|
</div>
|
|
<div class="item-card-body">
|
|
<input class="qty-input" value="500" readonly>
|
|
<span style="font-size:13px;color:#64748b">EA</span>
|
|
<select class="pkg-select"><option>봉투</option></select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Bottom Actions + Photo -->
|
|
<div class="bottom-actions">
|
|
<button class="action-btn primary">✓ 입고 확정</button>
|
|
</div>
|
|
|
|
<div class="config-zone" data-key="photoUpload" data-label="사진 첨부" data-screen="inbound" onclick="selectZone(this)">
|
|
<div class="photo-upload-zone">
|
|
📎 사진 첨부 (터치하여 촬영 또는 갤러리 선택)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- OUTBOUND SCREEN -->
|
|
<div id="screen-outbound" class="screen" style="display:none">
|
|
<div class="pop-back-header">
|
|
<button class="back-btn" onclick="navigateTo('home')">←</button>
|
|
<span class="pop-screen-title">판매출고</span>
|
|
</div>
|
|
<div class="pop-content outbound-screen">
|
|
<!-- Customer + Barcode -->
|
|
<div class="config-zone" data-key="barcodeEnabled" data-label="바코드 스캔" data-screen="outbound" onclick="selectZone(this)">
|
|
<div class="field-row">
|
|
<input class="field-input" placeholder="고객사 선택..." readonly>
|
|
<button class="scan-btn" title="바코드 스캔">📷</button>
|
|
</div>
|
|
<div class="field-row">
|
|
<input class="field-input" placeholder="품목 검색..." readonly>
|
|
<button class="scan-btn" title="바코드 스캔">📷</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Item Cards -->
|
|
<div class="item-card">
|
|
<div class="item-card-header">
|
|
<div>
|
|
<div class="item-name">완제품 모듈 X-100</div>
|
|
<div class="item-code">PRD-2024-015</div>
|
|
</div>
|
|
</div>
|
|
<div class="item-card-body">
|
|
<input class="qty-input" value="50" readonly>
|
|
<span style="font-size:13px;color:#64748b">EA</span>
|
|
<select class="pkg-select"><option>파렛트</option></select>
|
|
</div>
|
|
</div>
|
|
<div class="item-card">
|
|
<div class="item-card-header">
|
|
<div>
|
|
<div class="item-name">센서 어셈블리 Y-20</div>
|
|
<div class="item-code">PRD-2024-023</div>
|
|
</div>
|
|
</div>
|
|
<div class="item-card-body">
|
|
<input class="qty-input" value="200" readonly>
|
|
<span style="font-size:13px;color:#64748b">EA</span>
|
|
<select class="pkg-select"><option>박스</option></select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="bottom-actions">
|
|
<button class="action-btn primary">✓ 출고 확정</button>
|
|
</div>
|
|
|
|
<div class="config-zone" data-key="photoUpload" data-label="사진 첨부" data-screen="outbound" onclick="selectZone(this)">
|
|
<div class="photo-upload-zone">
|
|
📎 사진 첨부 (터치하여 촬영 또는 갤러리 선택)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- PROCESS EXECUTION SCREEN -->
|
|
<div id="screen-process" class="screen" style="display:none; flex-direction:column;">
|
|
<div class="pop-back-header">
|
|
<button class="back-btn" onclick="navigateTo('home')">←</button>
|
|
<span class="pop-screen-title">생산실행</span>
|
|
</div>
|
|
<div class="pop-content" style="padding:0; display:flex; flex:1;">
|
|
<div class="process-screen">
|
|
<!-- Sidebar -->
|
|
<div class="process-sidebar">
|
|
<div class="process-sidebar-title">공정 목록</div>
|
|
<div class="process-item active">SMT</div>
|
|
<div class="process-item">검사</div>
|
|
<div class="process-item">조립</div>
|
|
<div class="process-item">포장</div>
|
|
<div class="process-item">출하검사</div>
|
|
</div>
|
|
<!-- Main -->
|
|
<div class="process-main">
|
|
<div class="process-tabs">
|
|
<div class="process-tab active">접수가능</div>
|
|
<div class="process-tab">진행중</div>
|
|
<div class="process-tab">대기</div>
|
|
<div class="process-tab">완료</div>
|
|
</div>
|
|
<div class="process-content">
|
|
<!-- Work Order Cards -->
|
|
<div class="wo-card active">
|
|
<div class="wo-card-top">
|
|
<span class="wo-product">PCB 모듈 A-100</span>
|
|
<span class="wo-status waiting">접수대기</span>
|
|
</div>
|
|
<div class="wo-card-info">수량: 500 EA · 공정 1/5 · WO-2024-0312</div>
|
|
</div>
|
|
<div class="wo-card">
|
|
<div class="wo-card-top">
|
|
<span class="wo-product">센서보드 B-200</span>
|
|
<span class="wo-status running">진행중</span>
|
|
</div>
|
|
<div class="wo-card-info">수량: 200 EA · 공정 3/5 · WO-2024-0313</div>
|
|
</div>
|
|
|
|
<!-- Work Detail (expanded) -->
|
|
<div class="work-detail">
|
|
<div class="work-detail-title">PCB 모듈 A-100 — SMT 작업</div>
|
|
|
|
<!-- Timer -->
|
|
<div class="timer-bar">
|
|
<div class="timer-item">
|
|
<span class="timer-label">포함시간</span>
|
|
<span class="timer-value">02:34:12</span>
|
|
</div>
|
|
<div class="timer-sep"></div>
|
|
<div class="timer-item">
|
|
<span class="timer-label">순수시간</span>
|
|
<span class="timer-value">01:45:30</span>
|
|
</div>
|
|
<div class="timer-sep"></div>
|
|
<div class="timer-item">
|
|
<span class="timer-label">그룹</span>
|
|
<span class="timer-value" style="font-size:13px">A라인</span>
|
|
</div>
|
|
<button class="timer-start-btn">▶ 시작</button>
|
|
</div>
|
|
|
|
<!-- Checklist -->
|
|
<div class="checklist">
|
|
<div class="checklist-title">체크리스트</div>
|
|
<div class="checklist-item">
|
|
<div class="checklist-check checked">✓</div>
|
|
<span>솔더 페이스트 도포 확인</span>
|
|
</div>
|
|
<div class="checklist-item">
|
|
<div class="checklist-check"></div>
|
|
<span>리플로우 온도 설정 확인</span>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Results -->
|
|
<div class="result-input-row">
|
|
<span class="result-label">양품</span>
|
|
<input class="result-qty" value="480" readonly>
|
|
<span class="result-label">불량</span>
|
|
<input class="result-qty bad" value="20" readonly>
|
|
<span style="font-size:12px;color:#94a3b8">EA</span>
|
|
</div>
|
|
|
|
<!-- Material Section -->
|
|
<div class="config-zone" data-key="materialInput" data-label="자재 투입" data-screen="process" onclick="selectZone(this)">
|
|
<div class="material-section">
|
|
<div class="material-title">📦 자재 투입</div>
|
|
<div class="material-item">
|
|
<span>PCB 기판 (RAW-001)</span>
|
|
<span style="font-weight:700">500 EA</span>
|
|
</div>
|
|
<div class="material-item">
|
|
<span>솔더 페이스트 (MAT-012)</span>
|
|
<span style="font-weight:700">2 KG</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Photo Upload -->
|
|
<div class="config-zone" data-key="photoUpload" data-label="사진 첨부" data-screen="process" onclick="selectZone(this)">
|
|
<div class="photo-upload-zone">
|
|
📎 사진 첨부
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Defect Button -->
|
|
<div class="config-zone" data-key="defectTypes" data-label="불량 유형" data-screen="process" onclick="selectZone(this)">
|
|
<button class="defect-btn">🔴 불량 처리</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- INVENTORY SCREEN (placeholder) -->
|
|
<div id="screen-inventory" class="screen" style="display:none">
|
|
<div class="pop-back-header">
|
|
<button class="back-btn" onclick="navigateTo('home')">←</button>
|
|
<span class="pop-screen-title">재고관리</span>
|
|
</div>
|
|
<div class="pop-content" style="display:flex;align-items:center;justify-content:center;color:#94a3b8;font-size:14px;">
|
|
<div style="text-align:center">
|
|
<div style="font-size:48px;margin-bottom:12px;opacity:0.5">📊</div>
|
|
<div style="font-weight:600">재고관리 화면</div>
|
|
<div style="font-size:13px;margin-top:4px">(미리보기 준비중)</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ══════ RIGHT: SETTINGS PANEL ══════ -->
|
|
<div class="settings-area">
|
|
<div class="settings-header">
|
|
<h2>화면 설정</h2>
|
|
<div class="screen-name" id="settingsScreenName">홈 화면</div>
|
|
</div>
|
|
<div class="settings-body" id="settingsBody">
|
|
<div class="settings-empty" id="settingsEmpty">
|
|
<div class="settings-empty-icon">⚙️</div>
|
|
<div class="settings-empty-text">설정할 영역을 클릭하세요</div>
|
|
<div class="settings-empty-sub">왼쪽 POP 화면에서 설정 가능한 영역에<br>마우스를 올리면 파란 테두리가 표시됩니다</div>
|
|
</div>
|
|
<div id="settingsContent" style="display:none"></div>
|
|
</div>
|
|
<div class="settings-footer">
|
|
<button class="btn" onclick="resetSettings()">기본값 초기화</button>
|
|
<button class="btn btn-save" onclick="saveSettings()">저장</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// ── State ──
|
|
const screenNames = {
|
|
home: '홈 화면',
|
|
inbound: '구매입고 설정',
|
|
outbound: '판매출고 설정',
|
|
process: '생산실행 설정',
|
|
inventory: '재고관리 설정'
|
|
};
|
|
|
|
let currentScreen = 'home';
|
|
let selectedZone = null;
|
|
|
|
// Settings store
|
|
const settings = {
|
|
home: {
|
|
kpiCarousel: { enabled: true, label: 'KPI 캐러셀', desc: '홈 화면 상단에 입고/출고/생산 현황 카드를 표시합니다.' },
|
|
recentActivity: { enabled: true, label: '최근 활동', desc: '홈 화면 하단에 최근 활동 내역을 표시합니다.' }
|
|
},
|
|
inbound: {
|
|
barcodeEnabled: { enabled: true, label: '바코드 스캔', desc: '거래처/품목 선택 시 바코드 스캔 버튼을 표시합니다.' },
|
|
inspectionRequired: { enabled: true, label: '검사 필수 배지', desc: '품목 카드에 검사 필수 여부 배지를 표시합니다.' },
|
|
photoUpload: { enabled: true, label: '사진 첨부', desc: '입고 시 사진 촬영/첨부 영역을 표시합니다.' }
|
|
},
|
|
outbound: {
|
|
barcodeEnabled: { enabled: true, label: '바코드 스캔', desc: '고객사/품목 선택 시 바코드 스캔 버튼을 표시합니다.' },
|
|
photoUpload: { enabled: true, label: '사진 첨부', desc: '출고 시 사진 촬영/첨부 영역을 표시합니다.' }
|
|
},
|
|
process: {
|
|
materialInput: { enabled: true, label: '자재 투입', desc: '작업 상세에서 자재 투입 섹션을 표시합니다.' },
|
|
bomFlexible: { enabled: false, label: 'BOM 유동 투입', desc: 'BOM에 없는 자재도 유동적으로 투입할 수 있습니다.' },
|
|
photoUpload: { enabled: true, label: '사진 첨부', desc: '작업 중 사진 촬영/첨부 영역을 표시합니다.' },
|
|
groupPhotoEnabled: { enabled: false, label: '그룹별 사진', desc: '그룹(라인)별로 별도 사진을 첨부할 수 있습니다.' },
|
|
plcEnabled: { enabled: false, label: 'PLC 연동', desc: 'PLC 장비와 연동하여 자동 데이터 수집합니다.' },
|
|
reworkTargetSelection: { enabled: false, label: '재작업 공정 지정', desc: '불량 발생 시 재작업할 공정을 선택할 수 있습니다.' },
|
|
packagingOptions: { enabled: true, label: '포장 옵션', desc: '포장 유형을 선택할 수 있습니다.', type: 'tags', tags: ['박스', '봉투', '파렛트', '벌크'] },
|
|
defectTypes: { enabled: true, label: '불량 유형', desc: '불량 처리 시 선택 가능한 유형 목록입니다.', type: 'tags', tags: ['외관불량', '치수불량', '기능불량', '혼입', '스크래치'] }
|
|
}
|
|
};
|
|
|
|
// ── Navigation ──
|
|
function navigateTo(screen) {
|
|
// hide all
|
|
document.querySelectorAll('.screen').forEach(s => {
|
|
s.style.display = 'none';
|
|
});
|
|
// show target
|
|
const target = document.getElementById('screen-' + screen);
|
|
if (target) {
|
|
target.style.display = screen === 'process' ? 'flex' : '';
|
|
if (screen !== 'process') target.style.display = '';
|
|
// For process screen, need flex
|
|
if (screen === 'process') {
|
|
target.style.display = 'flex';
|
|
target.style.flexDirection = 'column';
|
|
}
|
|
}
|
|
currentScreen = screen;
|
|
document.getElementById('settingsScreenName').textContent = screenNames[screen] || screen;
|
|
|
|
// Deselect zone
|
|
deselectAllZones();
|
|
showEmptySettings();
|
|
applyAllSettings();
|
|
}
|
|
|
|
function deselectAllZones() {
|
|
document.querySelectorAll('.config-zone.selected').forEach(z => z.classList.remove('selected'));
|
|
selectedZone = null;
|
|
}
|
|
|
|
// ── Zone Selection ──
|
|
function selectZone(el) {
|
|
event.stopPropagation();
|
|
deselectAllZones();
|
|
el.classList.add('selected');
|
|
selectedZone = el;
|
|
const key = el.dataset.key;
|
|
const screen = el.dataset.screen;
|
|
showSettingsFor(screen, key);
|
|
}
|
|
|
|
// ── Settings Rendering ──
|
|
function showEmptySettings() {
|
|
document.getElementById('settingsEmpty').style.display = 'flex';
|
|
document.getElementById('settingsContent').style.display = 'none';
|
|
}
|
|
|
|
function showSettingsFor(screen, key) {
|
|
document.getElementById('settingsEmpty').style.display = 'none';
|
|
const contentEl = document.getElementById('settingsContent');
|
|
contentEl.style.display = 'block';
|
|
|
|
const screenSettings = settings[screen];
|
|
if (!screenSettings) { showEmptySettings(); return; }
|
|
|
|
// Build settings for this zone + all screen toggles
|
|
let html = '';
|
|
|
|
// Selected zone highlight
|
|
const zoneSetting = screenSettings[key];
|
|
if (zoneSetting) {
|
|
html += `<div class="setting-group" style="background:#eff6ff;padding:14px;border-radius:10px;margin-bottom:16px;">`;
|
|
html += `<div class="setting-group-title" style="color:#1d4ed8">${zoneSetting.label}</div>`;
|
|
html += `<div class="setting-group-desc">${zoneSetting.desc}</div>`;
|
|
html += `<div class="toggle-row" style="border:none;padding:6px 0 0;">`;
|
|
html += `<span class="toggle-label">활성화</span>`;
|
|
html += `<div class="toggle-switch ${zoneSetting.enabled ? 'on' : ''}" onclick="toggleSetting('${screen}','${key}',this)"></div>`;
|
|
html += `</div>`;
|
|
|
|
// Tag editor if applicable
|
|
if (zoneSetting.type === 'tags' && zoneSetting.tags) {
|
|
html += renderTagEditor(screen, key, zoneSetting);
|
|
}
|
|
html += `</div>`;
|
|
}
|
|
|
|
// All other settings for this screen
|
|
html += `<div class="setting-group">`;
|
|
html += `<div class="setting-group-title">전체 ${screenNames[screen]} 옵션</div>`;
|
|
html += `<div class="setting-group-desc">이 화면의 모든 설정 가능 옵션</div>`;
|
|
|
|
Object.entries(screenSettings).forEach(([k, v]) => {
|
|
const isSelected = (k === key);
|
|
html += `<div class="toggle-row" style="${isSelected ? 'background:#eff6ff;border-radius:6px;padding:10px 8px;' : ''}">`;
|
|
html += `<span class="toggle-label">${v.label}</span>`;
|
|
html += `<div class="toggle-switch ${v.enabled ? 'on' : ''}" onclick="toggleSetting('${screen}','${k}',this)"></div>`;
|
|
html += `</div>`;
|
|
});
|
|
html += `</div>`;
|
|
|
|
contentEl.innerHTML = html;
|
|
}
|
|
|
|
function renderTagEditor(screen, key, setting) {
|
|
let html = `<div class="tag-editor" style="margin-top:10px;">`;
|
|
html += `<div class="tag-editor-label">항목 관리</div>`;
|
|
html += `<div class="tag-list" id="tags-${screen}-${key}">`;
|
|
setting.tags.forEach((tag, i) => {
|
|
html += `<span class="tag">${tag}<span class="tag-remove" onclick="removeTag('${screen}','${key}',${i})">x</span></span>`;
|
|
});
|
|
html += `</div>`;
|
|
html += `<div class="tag-input-row">`;
|
|
html += `<input class="tag-input" id="tagInput-${screen}-${key}" placeholder="새 항목 입력..." onkeydown="if(event.key==='Enter')addTag('${screen}','${key}')">`;
|
|
html += `<button class="tag-add-btn" onclick="addTag('${screen}','${key}')">추가</button>`;
|
|
html += `</div>`;
|
|
html += `</div>`;
|
|
return html;
|
|
}
|
|
|
|
// ── Toggle ──
|
|
function toggleSetting(screen, key, el) {
|
|
event.stopPropagation();
|
|
settings[screen][key].enabled = !settings[screen][key].enabled;
|
|
el.classList.toggle('on');
|
|
applyAllSettings();
|
|
|
|
// Re-render if this is the selected zone
|
|
if (selectedZone && selectedZone.dataset.key === key && selectedZone.dataset.screen === screen) {
|
|
showSettingsFor(screen, key);
|
|
}
|
|
}
|
|
|
|
// ── Tag Management ──
|
|
function addTag(screen, key) {
|
|
const input = document.getElementById(`tagInput-${screen}-${key}`);
|
|
if (!input || !input.value.trim()) return;
|
|
settings[screen][key].tags.push(input.value.trim());
|
|
input.value = '';
|
|
showSettingsFor(screen, key);
|
|
}
|
|
|
|
function removeTag(screen, key, index) {
|
|
event.stopPropagation();
|
|
settings[screen][key].tags.splice(index, 1);
|
|
showSettingsFor(screen, key);
|
|
}
|
|
|
|
// ── Apply Settings to POP Preview ──
|
|
function applyAllSettings() {
|
|
document.querySelectorAll('.config-zone').forEach(zone => {
|
|
const screen = zone.dataset.screen;
|
|
const key = zone.dataset.key;
|
|
if (!settings[screen] || !settings[screen][key]) return;
|
|
|
|
const enabled = settings[screen][key].enabled;
|
|
|
|
// Remove old overlay
|
|
const oldOverlay = zone.querySelector('.off-overlay');
|
|
if (oldOverlay) oldOverlay.remove();
|
|
|
|
if (!enabled) {
|
|
zone.classList.add('off-state');
|
|
const overlay = document.createElement('div');
|
|
overlay.className = 'off-overlay';
|
|
overlay.innerHTML = '<span>OFF</span>';
|
|
zone.appendChild(overlay);
|
|
} else {
|
|
zone.classList.remove('off-state');
|
|
}
|
|
});
|
|
}
|
|
|
|
// ── Save / Reset ──
|
|
function saveSettings() {
|
|
const json = JSON.stringify(settings, null, 2);
|
|
console.log('Saved settings:', json);
|
|
alert('설정이 저장되었습니다.\n\n(콘솔에서 JSON 확인 가능)');
|
|
}
|
|
|
|
function resetSettings() {
|
|
if (!confirm('모든 설정을 기본값으로 초기화하시겠습니까?')) return;
|
|
// Reset all to enabled=true
|
|
Object.values(settings).forEach(screen => {
|
|
Object.values(screen).forEach(s => { s.enabled = true; });
|
|
});
|
|
// Reset tags
|
|
settings.process.packagingOptions.tags = ['박스', '봉투', '파렛트', '벌크'];
|
|
settings.process.defectTypes.tags = ['외관불량', '치수불량', '기능불량', '혼입', '스크래치'];
|
|
// Keep these false by default
|
|
settings.process.bomFlexible.enabled = false;
|
|
settings.process.groupPhotoEnabled.enabled = false;
|
|
settings.process.plcEnabled.enabled = false;
|
|
settings.process.reworkTargetSelection.enabled = false;
|
|
|
|
applyAllSettings();
|
|
if (selectedZone) {
|
|
showSettingsFor(selectedZone.dataset.screen, selectedZone.dataset.key);
|
|
} else {
|
|
showEmptySettings();
|
|
}
|
|
alert('기본값으로 초기화되었습니다.');
|
|
}
|
|
|
|
// ── Click outside to deselect ──
|
|
document.getElementById('popFrame').addEventListener('click', function(e) {
|
|
if (!e.target.closest('.config-zone') && !e.target.closest('.menu-item') && !e.target.closest('.back-btn')) {
|
|
deselectAllZones();
|
|
showEmptySettings();
|
|
}
|
|
});
|
|
|
|
// ── Init ──
|
|
applyAllSettings();
|
|
</script>
|
|
</body>
|
|
</html> |