feat: v9.0 업그레이드 — CS 작업 탭 개편 + 밀크런/자사몰 행사 모듈

CS 통합 프로그램.ZIP(로컬 개발본 v9.0)의 기능 소스를 반영.
DB 스키마는 기존과 동일해 마이그레이션 없이 그대로 사용한다.

가져온 것
- main.py / cafe24_api.py / templates / static: v9.0 기능 코드
- routers/coupang_milkrun.py, routers/mall_event.py (신규)
- static/js/mall_event.js, static/js/milkrun_gsheet.js (신규)

운영 설정은 기존 것을 유지·재적용
- DB/카페24/네이버 접속정보를 하드코딩 대신 환경변수 기반으로 복원
- SSO(AuthGuardMiddleware, SessionMiddleware), /login, /logout, /health/db 복원
- APP_ROOT_PATH 서브경로 호스팅(root_path 템플릿 변수, app.js fetch 래퍼) 복원
- 구글시트 설정 인메모리 캐시(TTL 10분)와 /api/config/refresh 복원

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-31 23:56:17 +09:00
parent a2a5d53d9b
commit 065e81bf97
11 changed files with 9830 additions and 1392 deletions
+853 -30
View File
@@ -107,13 +107,47 @@ p {
}
.nav-links li {
/* 탭 글자 크기 */
padding: 11px 10px;
/* 탭 글자 크기 — 사이드바(130px)에서 모든 메뉴가 한 줄에 들어가는 크기.
메뉴는 전부 이 크기 하나로 통일한다. */
padding: 11px 8px;
cursor: pointer;
font-weight: 200;
font-size: 1.0rem;
font-size: 0.8rem;
transition: var(--transition);
border-left: 3px solid transparent;
/* 어떤 경우에도 두 줄로 넘어가지 않게 */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* 메뉴 아이콘: 글자 크기와 무관하게 원래 크기(1rem)를 유지한다.
1em이 아니라 rem으로 고정해야 메뉴 글자를 줄여도 아이콘이 같이 작아지지 않는다.
width는 글자 크기가 아니라 아이콘 칸 너비로, 메뉴 글자 시작선을 맞추는 용도. */
.nav-links li .nav-icon {
font-size: 1rem;
line-height: 1;
display: inline-block;
width: 1.25rem;
margin-right: 5px;
text-align: center;
font-style: normal;
vertical-align: -0.1em;
flex-shrink: 0;
/* 흑백 글리프로 떨어지지 않도록 컬러 이모지 폰트를 우선 지정 */
font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif;
}
/* '준비중' 같은 상태 뱃지도 좁은 사이드바에 맞춰 축소 */
.nav-links li .nav-badge {
font-size: 0.5rem;
background: #e53e3e;
color: #fff;
padding: 1px 2px;
border-radius: 4px;
margin-left: 3px;
flex-shrink: 0;
white-space: nowrap;
}
.nav-links li:hover {
@@ -158,52 +192,787 @@ p {
.main-grid {
display: grid;
grid-template-columns: 1fr 525px;
grid-template-rows: minmax(0, 1fr);
gap: 10px;
height: calc(100vh - 45px);
overflow: hidden;
}
/* ★★★ CSS Multi-Column 레이아웃 적용 ★★★ */
/* 빈틈없이 차례대로 컬럼을 채우는 가장 강력한 속성 */
.left-col {
.order-workspace {
min-width: 0;
height: 100%;
display: flex;
flex-direction: column;
flex-wrap: wrap;
align-content: flex-start;
overflow: hidden;
}
.order-category-panel {
padding: 8px;
flex-shrink: 0;
background: rgba(255, 255, 255, 0.82);
border: 1px solid rgba(203, 213, 224, 0.9);
border-radius: 8px;
}
.order-category-heading {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 6px;
color: #2d3748;
}
.order-category-heading strong {
font-size: 0.82rem;
}
.order-category-heading span {
color: #4a5568;
font-size: 0.68rem;
}
.order-group-buttons {
display: flex;
flex-wrap: wrap;
gap: 5px;
}
.order-group-button {
min-height: 28px;
padding: 4px 9px;
display: inline-flex;
align-items: center;
gap: 5px;
border: 1px solid #cbd5e0;
border-radius: 4px;
background: #fff;
color: #2d3748;
cursor: pointer;
font-size: 0.75rem;
font-weight: 700;
}
.order-group-button:hover,
.order-group-button.has-selection,
.order-group-button.is-active {
border-color: var(--primary-color);
background: #ebf8ff;
}
.order-group-count {
min-width: 18px;
height: 18px;
padding: 0 4px;
display: none;
align-items: center;
justify-content: center;
border-radius: 9px;
background: var(--primary-color);
color: #fff;
font-size: 0.65rem;
line-height: 1;
}
.order-group-button.has-selection .order-group-count {
display: inline-flex;
}
.order-workspace-body {
min-height: 0;
flex: 1;
display: grid;
grid-template-columns: minmax(180px, 1fr) minmax(270px, 38%);
gap: 10px;
margin-top: 8px;
}
.order-summary-column {
min-width: 0;
min-height: 0;
display: flex;
flex-direction: column;
}
.order-summary-column .order-selected-panel {
flex: 1;
}
.new-cs-options-slot {
display: none;
}
.order-items-inline-host {
min-width: 0;
min-height: 0;
padding: 8px;
overflow: hidden;
border: 1px solid #cbd5e0;
border-radius: 8px;
background: rgba(255, 255, 255, 0.32);
}
.order-items-inline-empty {
height: 100%;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 5px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 7px;
color: #4a5568;
font-size: 0.78rem;
text-align: center;
}
.left-col::-webkit-scrollbar {
width: 5px;
.order-items-inline-empty span:first-child {
font-size: 2rem;
}
.left-col::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.2);
.order-selected-panel {
min-width: 0;
min-height: 0;
display: flex;
flex-direction: column;
padding: 9px;
border: 1px solid #cbd5e0;
border-radius: 8px;
background: rgba(255, 255, 255, 0.82);
overflow: hidden;
}
.order-selected-heading {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 6px;
border-bottom: 2px solid var(--primary-color);
}
.order-selected-heading h3 {
margin: 0;
padding: 0;
border: 0;
font-size: 0.85rem;
}
.order-selected-heading span {
color: #2b6cb0;
font-size: 0.72rem;
font-weight: 700;
}
.order-selected-items {
min-height: 0;
flex: 1;
padding-top: 5px;
overflow-y: auto;
}
.order-selected-empty {
padding: 20px 5px;
color: #718096;
font-size: 0.72rem;
text-align: center;
}
.order-selected-row {
display: grid;
grid-template-columns: 20px minmax(0, 1fr) auto auto;
gap: 8px;
align-items: center;
padding: 6px 3px;
border-bottom: 1px solid #e2e8f0;
font-size: 0.72rem;
}
.order-selected-remove {
width: 18px;
height: 18px;
display: inline-flex;
align-items: center;
justify-content: center;
border: 0;
border-radius: 3px;
background: transparent;
color: #e53e3e;
font-size: 1rem;
line-height: 1;
cursor: pointer;
}
.order-selected-remove:hover {
background: #fff5f5;
}
.order-selected-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 700;
}
.order-selected-qty {
width: 58px;
height: 24px;
padding: 1px 3px;
border: 1px solid #cbd5e0;
border-radius: 4px;
background: #fff;
color: #2b6cb0;
font-size: 0.7rem;
font-weight: 700;
white-space: nowrap;
}
.order-selected-price {
min-width: 68px;
color: #2d3748;
font-weight: 700;
text-align: right;
white-space: nowrap;
}
.order-selected-totals {
padding: 8px 2px;
border-top: 2px solid #cbd5e0;
flex-shrink: 0;
}
.order-selected-totals > div {
display: flex;
align-items: center;
justify-content: space-between;
padding: 3px 1px;
font-size: 0.78rem;
}
.order-selected-totals strong {
color: #e53e3e;
font-size: 0.85rem;
}
.order-selected-totals > .order-summary-adjustments {
display: block;
padding: 0;
}
.order-summary-adjustments > div {
display: flex;
align-items: center;
justify-content: space-between;
padding: 2px 1px;
color: #4a5568;
font-size: 0.72rem;
}
.order-summary-adjustments b {
color: #2d3748;
}
.order-selected-totals > .order-summary-final {
margin-top: 3px;
padding-top: 5px;
border-top: 1px dashed #cbd5e0;
}
.order-preview-button {
width: 100%;
padding: 7px;
flex-shrink: 0;
}
.order-items-inline-host .order-item-group {
width: 100%;
height: 100%;
display: none;
flex-direction: column;
padding: 8px;
overflow: hidden;
background: rgba(255, 255, 255, 0.9);
}
.order-items-inline-host .order-item-group.is-active {
display: flex;
}
.order-item-group .order-popup-header {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 6px;
border-bottom: 2px solid var(--primary-color);
flex-shrink: 0;
}
.order-item-group .order-popup-header h3 {
margin: 0;
padding: 0;
border: 0;
font-size: 0.9rem;
}
.order-item-group .item-list {
min-height: 0;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 3px 8px;
padding: 8px 3px 2px 0;
overflow-y: auto;
}
.order-item-subgroup {
display: contents;
}
.order-item-subgroup-title {
display: none;
}
.classic-product-column {
display: contents;
}
.order-item-group .item-row {
min-width: 0;
background: #f7fafc;
}
.sms-preview-modal {
position: fixed;
z-index: 2600;
inset: 0;
display: none;
align-items: center;
justify-content: center;
padding: 20px;
background: rgba(0, 0, 0, 0.52);
}
.sms-preview-modal.is-open {
display: flex;
}
.sms-preview-dialog {
width: min(520px, calc(100vw - 30px));
height: min(760px, calc(100vh - 40px));
display: flex;
flex-direction: column;
padding: 12px;
overflow: hidden;
background: #fff;
}
.sms-preview-heading {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding-bottom: 8px;
border-bottom: 2px solid var(--primary-color);
flex-shrink: 0;
}
.sms-preview-heading h3 {
margin: 0;
padding: 0;
border: 0;
font-size: 1rem;
}
#sms-preview {
min-height: 0;
flex: 1;
margin-top: 10px;
overflow-y: auto;
}
.right-col {
display: grid;
grid-template-columns: 260px 250px;
grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
gap: 15px;
height: 100%;
}
.right-panel-col1 {
display: flex;
flex-direction: column;
gap: 8px;
display: contents;
}
.right-panel-col2 {
display: contents;
}
.right-col .customer-info {
grid-column: 2;
grid-row: 1;
min-height: 0;
}
.right-col .history-box {
grid-column: 1;
grid-row: 1;
height: auto !important;
min-height: 0;
margin-bottom: 0 !important;
}
.right-col .manual-history-box {
grid-column: 1;
grid-row: 2;
height: auto !important;
min-height: 0;
}
.right-col .sms-options {
grid-column: 2;
grid-row: 2;
align-self: end;
}
/* New CS 전용 배치: 기존 CS 작업 화면과 입력 요소를 공유합니다. */
#order-tab.order-view-new .main-grid {
grid-template-columns: minmax(0, 1fr) 260px;
}
#order-tab.order-view-new .order-category-heading strong {
font-size: 0.98rem;
}
#order-tab.order-view-new .order-category-heading span {
font-size: 0.82rem;
}
#order-tab.order-view-new .order-group-button {
min-height: 34px;
padding: 5px 11px;
font-size: 0.9rem;
}
#order-tab.order-view-new .order-group-count {
min-width: 21px;
height: 21px;
border-radius: 11px;
font-size: 0.78rem;
}
#order-tab.order-view-new .order-workspace-body {
grid-template-columns: minmax(0, 1fr) 370px;
}
#order-tab.order-view-new .order-summary-column {
width: 370px;
gap: 10px;
}
#order-tab.order-view-new .new-cs-options-slot {
display: block;
flex: 0 0 auto;
}
#order-tab.order-view-new .new-cs-options-slot .sms-options {
width: 370px;
}
#order-tab.order-view-new .right-col {
display: block;
min-width: 0;
}
#order-tab.order-view-new .right-panel-col1 {
height: 100%;
display: grid;
grid-template-rows: 370px minmax(0, 1fr) minmax(0, 1fr);
gap: 10px;
}
#order-tab.order-view-new .right-col .customer-info,
#order-tab.order-view-new .right-col .history-box,
#order-tab.order-view-new .right-col .manual-history-box {
grid-column: 1;
min-height: 0;
height: auto !important;
margin: 0 !important;
}
#order-tab.order-view-new .right-col .customer-info {
grid-row: 1;
height: 370px !important;
overflow-y: auto;
}
#order-tab.order-view-new .customer-info > h3 {
margin-bottom: 4px !important;
}
#order-tab.order-view-new .customer-info .form-group {
margin-bottom: 3px;
}
#order-tab.order-view-new .customer-info .form-group input {
padding-top: 3px;
padding-bottom: 3px;
}
#order-tab.order-view-new .customer-info .radio-group.mt-1,
#order-tab.order-view-new .customer-info .action-buttons.mt-1 {
margin-top: 2px;
}
#order-tab.order-view-new .customer-info .btn {
padding-top: 5px;
padding-bottom: 5px;
}
#order-tab.order-view-new .right-col .history-box {
grid-row: 2;
}
#order-tab.order-view-new .right-col .manual-history-box {
grid-row: 3;
}
#order-tab.order-view-new #cust-address {
height: 100px;
min-height: 100px;
resize: vertical;
}
#order-tab.order-view-new .order-item-group .item-list {
grid-template-columns: repeat(var(--subgroup-count, 1), minmax(0, 250px));
align-items: start;
justify-content: start;
gap: 12px;
overflow-x: auto;
}
#order-tab.order-view-new .order-item-subgroup {
width: 100%;
min-width: 180px;
max-width: 250px;
display: flex;
flex-direction: column;
gap: 8px;
gap: 3px;
padding: 6px;
overflow: hidden;
border: 1px solid #cbd5e0;
border-radius: 7px;
background: #f8fafc;
box-shadow: 0 1px 3px rgba(45, 55, 72, 0.08);
}
#order-tab.order-view-new .order-item-subgroup-title {
min-height: 28px;
display: flex;
align-items: center;
margin: -6px -6px 3px;
padding: 5px 8px;
overflow: hidden;
border-bottom: 1px solid #bee3f8;
border-left: 4px solid #3182ce;
background: #ebf8ff;
color: #2d3748;
font-size: 0.78rem;
font-weight: 700;
text-overflow: ellipsis;
white-space: nowrap;
}
#order-tab.order-view-new .order-item-subgroup-title-text {
min-width: 0;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#order-tab.order-view-new .order-item-subgroup-edit {
width: 24px;
height: 22px;
flex: 0 0 24px;
display: inline-flex;
align-items: center;
justify-content: center;
margin-left: 5px;
padding: 0;
border: 1px solid transparent;
border-radius: 4px;
background: transparent;
font-size: 0.78rem;
cursor: pointer;
}
#order-tab.order-view-new .order-item-subgroup-edit:hover,
#order-tab.order-view-new .order-item-subgroup-edit:focus-visible {
border-color: #90cdf4;
background: #fff;
outline: none;
}
#order-tab.order-view-new .order-item-subgroup-title-input {
width: 100%;
height: 24px;
padding: 2px 6px;
border: 1px solid #3182ce;
border-radius: 4px;
background: #fff;
color: #1a202c;
font-size: 0.78rem;
font-weight: 700;
outline: none;
}
#order-tab.order-view-new .order-preview-button {
border: 1px solid #cbd5e0;
background: #e2e8f0;
color: #4a5568;
}
#order-tab.order-view-new .order-preview-button:hover {
background: #cbd5e0;
}
/* CS 작업: 상품 전체가 펼쳐지는 기존 UI */
#order-tab.order-view-classic .order-category-panel,
#order-tab.order-view-classic .order-summary-column {
display: none;
}
#order-tab.order-view-classic .order-workspace-body {
height: 100%;
display: block;
margin-top: 0;
}
#order-tab.order-view-classic .order-items-inline-host {
width: 100%;
height: 100%;
display: grid;
grid-template-columns: repeat(6, max-content);
align-content: start;
align-items: start;
gap: 8px;
padding: 0;
overflow: auto;
border: 0;
border-radius: 0;
background: transparent;
}
#order-tab.order-view-classic .classic-product-column {
width: max-content;
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
}
#order-tab.order-view-classic .order-items-inline-empty {
display: none !important;
}
#order-tab.order-view-classic .order-items-inline-host .order-item-group {
width: max-content;
max-width: none;
height: auto;
display: flex;
padding: 8px;
}
#order-tab.order-view-classic .order-item-group .item-list,
#order-tab.order-view-classic .order-item-subgroup {
display: flex;
flex-direction: column;
gap: 1px;
}
#order-tab.order-view-classic .order-item-subgroup + .order-item-subgroup {
margin-top: 8px;
padding-top: 8px;
border-top: 1.5px dashed #1a202c;
}
#order-tab.order-view-classic .right-col {
display: grid;
grid-template-columns: 260px 250px;
grid-template-rows: minmax(0, 1fr);
gap: 15px;
}
#order-tab.order-view-classic .right-panel-col1,
#order-tab.order-view-classic .right-panel-col2 {
min-width: 0;
min-height: 0;
display: flex;
flex-direction: column;
gap: 10px;
height: 100%;
}
#order-tab.order-view-classic .right-panel-col1 {
grid-column: 1;
grid-row: 1;
}
#order-tab.order-view-classic .right-panel-col2 {
grid-column: 2;
grid-row: 1;
}
#order-tab.order-view-classic .right-col .customer-info {
width: 100%;
height: 330px !important;
flex: 0 0 330px;
}
#order-tab.order-view-classic .right-col .history-box {
width: 100%;
height: 260px !important;
flex: 0 0 260px;
}
#order-tab.order-view-classic .right-col .manual-history-box {
width: 100%;
height: auto !important;
flex: 1 1 0;
}
#order-tab.order-view-classic .sms-preview-modal {
position: static;
width: 100%;
height: auto;
flex: 1 1 0;
min-height: 0;
display: block;
padding: 8px;
overflow: hidden;
border: 1px solid var(--card-border);
border-radius: 8px;
background: var(--card-bg);
box-shadow: var(--card-shadow);
}
#order-tab.order-view-classic .sms-preview-dialog {
width: 100%;
height: 100%;
padding: 0;
border: 0;
border-radius: 4px;
background: transparent;
box-shadow: none;
}
#order-tab.order-view-classic .sms-preview-heading {
display: none;
}
#order-tab.order-view-classic #sms-preview {
height: 100%;
margin: 0;
}
#order-tab.order-view-classic .right-col .sms-options {
width: 100%;
flex: 0 0 auto;
align-self: auto;
}
.right-col::-webkit-scrollbar {
@@ -732,6 +1501,11 @@ p {
border-left-color: transparent;
border-bottom-color: var(--primary-color);
}
/* 가로 스크롤 메뉴에서는 아이콘 칸을 좁혀 폭을 아낀다 */
.nav-links li .nav-icon {
width: auto;
margin-right: 4px;
}
/* 3. Main Grid & Left Col (Product List) */
.main-grid {
@@ -740,16 +1514,13 @@ p {
height: auto;
gap: 15px;
}
.left-col {
height: 45vh; /* Fixed height with internal scroll */
flex-direction: column;
flex-wrap: nowrap;
overflow-y: auto;
overflow-x: hidden;
border: 1px solid rgba(0, 0, 0, 0.1);
padding: 5px;
border-radius: 8px;
background: rgba(255, 255, 255, 0.5);
.order-workspace {
height: auto;
min-height: 80vh;
}
.order-workspace-body {
grid-template-columns: 1fr;
grid-template-rows: minmax(45vh, 1fr) minmax(35vh, auto);
}
.item-group-card {
width: 100%;
@@ -764,6 +1535,9 @@ p {
gap: 15px;
}
.right-panel-col1, .right-panel-col2 {
display: flex;
flex-direction: column;
gap: 15px;
width: 100%;
height: auto;
}
@@ -1096,4 +1870,53 @@ p {
.toggle-switch input:checked + .switch-label:before {
transform: translateX(26px);
}
}
/* 반품 송장 일괄 입력: 편집기처럼 입력 줄과 함께 움직이는 줄 번호 */
.bulk-tracking-editor {
--bulk-tracking-border: #cbd5e0;
position: relative;
width: 100%;
}
.bulk-tracking-line-numbers {
position: absolute;
z-index: 1;
top: 1px;
bottom: 1px;
left: 1px;
width: 38px;
padding: 10px 7px 10px 4px;
overflow: hidden;
border-right: 1px solid var(--bulk-tracking-border);
border-radius: 3px 0 0 3px;
background: #f7fafc;
color: #718096;
font-family: monospace;
font-size: 13px;
line-height: 20px;
text-align: right;
white-space: pre;
user-select: none;
pointer-events: none;
}
.bulk-tracking-input {
display: block;
width: 100%;
height: 200px;
padding: 10px 10px 10px 48px;
overflow: auto;
border: 1px solid var(--bulk-tracking-border);
border-radius: 4px;
resize: vertical;
font-family: monospace;
font-size: 13px;
line-height: 20px;
white-space: pre;
}
.bulk-tracking-input:focus {
outline: none;
border-color: var(--bulk-tracking-border);
}