Compare commits
19 Commits
b9d28736e2
...
HW_Dashboa
| Author | SHA1 | Date | |
|---|---|---|---|
| d1378d127a | |||
| f656f0a439 | |||
| 1d32a0350b | |||
| abc531a41e | |||
| 8451101325 | |||
| 3e69e74bc9 | |||
| 723c4723f6 | |||
| a44283281f | |||
| fa87f383e2 | |||
| 6118141f6e | |||
| 05e23883b8 | |||
| 8c406fd0b8 | |||
| e678f9d653 | |||
| 132e37d0d3 | |||
| d6e75f8b2c | |||
| c35f57acab | |||
| 97cecb8b50 | |||
| a4b620099c | |||
| 407b9ba531 |
@@ -9,9 +9,6 @@
|
|||||||
- 기존 동작 방식과 성능을 기준(Baseline)으로 삼고, 수정 후에도 **기존의 모든 기능이 무결하게 유지되는지 반드시 테스트하여 입증**한다.
|
- 기존 동작 방식과 성능을 기준(Baseline)으로 삼고, 수정 후에도 **기존의 모든 기능이 무결하게 유지되는지 반드시 테스트하여 입증**한다.
|
||||||
- 검증 결과를 바탕으로 "무엇을, 왜, 어떻게" 바꿀지 상세 보고 후, 사용자로부터 **'진행시켜'** 승인을 얻은 뒤에만 집행한다.
|
- 검증 결과를 바탕으로 "무엇을, 왜, 어떻게" 바꿀지 상세 보고 후, 사용자로부터 **'진행시켜'** 승인을 얻은 뒤에만 집행한다.
|
||||||
4. **선보고 후승인**: 모든 기능 수정 및 코드 변경 전에는 예상 방안을 먼저 보고하고 승인 절차를 거친다.
|
4. **선보고 후승인**: 모든 기능 수정 및 코드 변경 전에는 예상 방안을 먼저 보고하고 승인 절차를 거친다.
|
||||||
5. **DB 삭제 및 초기화 절대 엄금 (Strict DB Deletion Policy)**:
|
|
||||||
- 어떠한 경우에도 `DELETE`, `DROP`, `TRUNCATE` 등 데이터를 삭제하거나 테이블을 초기화하는 작업은 사전에 사용자에게 상세 사유를 보고하고 **명시적 승인**을 얻은 후에만 시행한다.
|
|
||||||
- 기존 데이터의 가치를 최우선으로 하며, 작업 전 백업 여부를 반드시 확인한다.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
# 📝 작업 보고서 (2026-06-15)
|
|
||||||
|
|
||||||
## 1. 서버 및 개발 환경 설정
|
|
||||||
- **백엔드 서버 구동**: 3000번 포트(DB 서버) 정상 구동 완료.
|
|
||||||
- **프론트엔드 서버 구동**: 8080번 포트 정상 구동 완료.
|
|
||||||
- **브랜치 전환**: \`db_setting\` 브랜치로 전환 및 최신 코드 Pull 완료.
|
|
||||||
|
|
||||||
## 2. 데이터베이스 정제 및 보강 (Surgical Update)
|
|
||||||
- **사용자 정보(system_users) 업데이트**:
|
|
||||||
- 엑셀(\`system_User (20260615).xlsx\`) 기반 987건 신규 입력.
|
|
||||||
- 기존 백업 데이터(212건)와 병합하여 총 1,199건의 사용자 DB 구축.
|
|
||||||
- **PC 자산(asset_pc) 데이터 입력**:
|
|
||||||
- 엑셀(\`asset_pc (2026.06.15).xlsx\`) 기반 1,030건 입력 완료.
|
|
||||||
- **용량 정제**: 괄호 제거 및 4자리 GB 단위를 TB로 자동 변환 (예: 1863GB -> 1.86TB).
|
|
||||||
- **구매일 보강**: 연도 데이터에 월/일 추가 (\`YYYY-12-01\` 형식으로 통일).
|
|
||||||
- **자산번호 재매핑**: \`PC-YYYY12-NNNN\` 형식으로 전수 재부여 및 기존 번호와의 연속성 유지.
|
|
||||||
|
|
||||||
## 3. 부서 및 자산 유형 정상화
|
|
||||||
- **부서명 통합**: '총괄기획실', '기술개발센터', '한맥', '장헌', 'PTC', '현타' 등을 제외한 1,045건의 부서명을 **'삼안'**으로 일괄 통합.
|
|
||||||
- **자산 유형 교정 (핵심)**:
|
|
||||||
- 엑셀의 오기입과 상관없이 **사번(emp_no) 존재 여부**를 기준으로 자산 유형을 재분류.
|
|
||||||
- 사번이 있는 991건 -> **개인PC**로 정상화.
|
|
||||||
- 사번이 없는 39건 -> **공용PC**로 지정 및 사용자명 '공용'으로 정리.
|
|
||||||
|
|
||||||
## 4. 운영 규칙 업데이트
|
|
||||||
- **README.md 수정**: 'DB 삭제 및 초기화 절대 엄금 (Rule 5)' 항목 추가.
|
|
||||||
|
|
||||||
---
|
|
||||||
**보고자**: Gemini CLI
|
|
||||||
**상태**: 소스 코드 수정 없음, 데이터베이스 정제 완료.
|
|
||||||
Binary file not shown.
@@ -1,24 +0,0 @@
|
|||||||
const mysql = require('mysql2/promise');
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
async function analyzeCodes() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: process.env.DB_HOST,
|
|
||||||
user: process.env.DB_USER,
|
|
||||||
password: process.env.DB_PASS,
|
|
||||||
database: process.env.DB_NAME,
|
|
||||||
port: parseInt(process.env.DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
// 새 자산들의 연도 분포 확인
|
|
||||||
const [years] = await connection.query('SELECT DISTINCT purchase_date FROM asset_core WHERE id LIKE "PC_20260615_%"');
|
|
||||||
console.log('New assets years:', years.map(y => y.purchase_date));
|
|
||||||
|
|
||||||
// 기존 자산 코드 패턴 확인
|
|
||||||
const [existing] = await connection.query('SELECT asset_code FROM asset_core WHERE asset_code LIKE "PC-%" LIMIT 5');
|
|
||||||
console.log('Existing code sample:', existing);
|
|
||||||
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
analyzeCodes().catch(console.error);
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
const XLSX = require('xlsx');
|
|
||||||
const workbook = XLSX.readFile('backupDB_20260602.xlsx');
|
|
||||||
console.log('Sheet Names:', workbook.SheetNames);
|
|
||||||
if (workbook.SheetNames.includes('system_users')) {
|
|
||||||
const sheet = workbook.Sheets['system_users'];
|
|
||||||
const data = XLSX.utils.sheet_to_json(sheet);
|
|
||||||
console.log('system_users found! Count:', data.length);
|
|
||||||
console.log('Sample:', data.slice(0, 2));
|
|
||||||
} else {
|
|
||||||
console.log('system_users sheet not found in backupDB_20260602.xlsx');
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
const mysql = require('mysql2/promise');
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
async function checkCodes() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: process.env.DB_HOST,
|
|
||||||
user: process.env.DB_USER,
|
|
||||||
password: process.env.DB_PASS,
|
|
||||||
database: process.env.DB_NAME,
|
|
||||||
port: parseInt(process.env.DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('--- Asset Codes Sample ---');
|
|
||||||
const [rows] = await connection.query('SELECT id, asset_code, purchase_date FROM asset_core WHERE id LIKE "PC_20260615_%" LIMIT 10');
|
|
||||||
console.log(rows);
|
|
||||||
|
|
||||||
console.log('\n--- Other Asset Codes Sample ---');
|
|
||||||
const [rows2] = await connection.query('SELECT id, asset_code, purchase_date FROM asset_core WHERE id NOT LIKE "PC_20260615_%" AND asset_code IS NOT NULL LIMIT 5');
|
|
||||||
console.log(rows2);
|
|
||||||
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
checkCodes().catch(console.error);
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
const mysql = require('mysql2/promise');
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
async function checkPublicPCs() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: process.env.DB_HOST,
|
|
||||||
user: process.env.DB_USER,
|
|
||||||
password: process.env.DB_PASS,
|
|
||||||
database: process.env.DB_NAME,
|
|
||||||
port: parseInt(process.env.DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('🔍 공용 PC(Public PC)로 추정되는 자산 조회 중...');
|
|
||||||
|
|
||||||
// 사번이 없거나, 사용자명에 '공용'이 포함된 데이터 조회
|
|
||||||
const [rows] = await connection.query(`
|
|
||||||
SELECT id, asset_code, user_current, emp_no, current_dept, asset_type
|
|
||||||
FROM asset_core
|
|
||||||
WHERE (emp_no IS NULL OR emp_no = '' OR user_current LIKE '%공용%')
|
|
||||||
AND id LIKE 'PC_20260615_%'
|
|
||||||
`);
|
|
||||||
|
|
||||||
console.log(`📊 발견된 공용 PC 후보: ${rows.length}건`);
|
|
||||||
|
|
||||||
if (rows.length > 0) {
|
|
||||||
console.table(rows.slice(0, 20)); // 상위 20개 샘플 출력
|
|
||||||
|
|
||||||
// 요약 통계
|
|
||||||
const summary = {
|
|
||||||
only_no_emp: rows.filter(r => (!r.emp_no) && !r.user_current.includes('공용')).length,
|
|
||||||
only_public_name: rows.filter(r => r.emp_no && r.user_current.includes('공용')).length,
|
|
||||||
both: rows.filter(r => (!r.emp_no) && r.user_current.includes('공용')).length
|
|
||||||
};
|
|
||||||
console.log('\n📈 요약 통계:', summary);
|
|
||||||
}
|
|
||||||
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
checkPublicPCs().catch(console.error);
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
const mysql = require('mysql2/promise');
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
async function updateAndCompare() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: process.env.DB_HOST,
|
|
||||||
user: process.env.DB_USER,
|
|
||||||
password: process.env.DB_PASS,
|
|
||||||
database: process.env.DB_NAME,
|
|
||||||
port: parseInt(process.env.DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('🚀 [Step 1 & 2] "undefined" 사번 및 빈 사용자명 정리 중...');
|
|
||||||
const [updateResult] = await connection.query(`
|
|
||||||
UPDATE asset_core
|
|
||||||
SET user_current = '공용', emp_no = NULL
|
|
||||||
WHERE id LIKE "PC_20260615_%" AND (emp_no = 'undefined' OR emp_no IS NULL OR emp_no = '')
|
|
||||||
`);
|
|
||||||
console.log(`✅ 업데이트 완료: ${updateResult.affectedRows}건`);
|
|
||||||
|
|
||||||
console.log('\n🔍 [Step 3] 엑셀 데이터와 DB asset_type 비교 분석 중...');
|
|
||||||
const XLSX = require('xlsx');
|
|
||||||
const workbook = XLSX.readFile('asset_pc (2026.06.15).xlsx');
|
|
||||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
|
||||||
const excelData = XLSX.utils.sheet_to_json(sheet);
|
|
||||||
|
|
||||||
// DB 데이터 로드
|
|
||||||
const [dbRows] = await connection.query('SELECT id, asset_type, user_current, emp_no FROM asset_core WHERE id LIKE "PC_20260615_%"');
|
|
||||||
const dbMap = new Map();
|
|
||||||
dbRows.forEach(r => dbMap.set(r.id, r));
|
|
||||||
|
|
||||||
const mismatches = [];
|
|
||||||
const publicButExcelPersonal = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < excelData.length; i++) {
|
|
||||||
const excelRow = excelData[i];
|
|
||||||
const assetId = `PC_20260615_${String(i + 1).padStart(4, '0')}`;
|
|
||||||
const dbRow = dbMap.get(assetId);
|
|
||||||
|
|
||||||
if (!dbRow) continue;
|
|
||||||
|
|
||||||
const excelType = excelRow.asset_type || '개인PC';
|
|
||||||
|
|
||||||
// 1. 단순 타입 불일치 체크
|
|
||||||
if (dbRow.asset_type !== excelType) {
|
|
||||||
mismatches.push({
|
|
||||||
id: assetId,
|
|
||||||
excel_type: excelType,
|
|
||||||
db_type: dbRow.asset_type,
|
|
||||||
user: dbRow.user_current
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. 엑셀은 '개인PC'인데 데이터는 공용(사번없음)인 경우 탐색
|
|
||||||
if (excelType === '개인PC' && (!dbRow.emp_no || dbRow.user_current === '공용')) {
|
|
||||||
publicButExcelPersonal.push({
|
|
||||||
id: assetId,
|
|
||||||
excel_user: excelRow.user_current,
|
|
||||||
excel_dept: excelRow.current_dept,
|
|
||||||
db_user: dbRow.user_current
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`\n📊 분석 결과:`);
|
|
||||||
console.log(`- 엑셀과 DB의 asset_type 불일치: ${mismatches.length}건`);
|
|
||||||
console.log(`- 엑셀은 '개인PC'이나 사번이 없어 '공용'으로 잡힌 항목: ${publicButExcelPersonal.length}건`);
|
|
||||||
|
|
||||||
if (publicButExcelPersonal.length > 0) {
|
|
||||||
console.log('\n⚠️ 엑셀은 개인PC이나 데이터가 미비한 항목 (상위 10개):');
|
|
||||||
console.table(publicButExcelPersonal.slice(0, 10));
|
|
||||||
}
|
|
||||||
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
updateAndCompare().catch(console.error);
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
const mysql = require('mysql2/promise');
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
async function debugPublic() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: process.env.DB_HOST,
|
|
||||||
user: process.env.DB_USER,
|
|
||||||
password: process.env.DB_PASS,
|
|
||||||
database: process.env.DB_NAME,
|
|
||||||
port: parseInt(process.env.DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
const [rows] = await connection.query(`
|
|
||||||
SELECT user_current, emp_no, COUNT(*) as count
|
|
||||||
FROM asset_core
|
|
||||||
WHERE id LIKE "PC_20260615_%"
|
|
||||||
GROUP BY user_current, emp_no
|
|
||||||
HAVING emp_no IS NULL OR emp_no = '' OR user_current LIKE '%공용%' OR user_current = ''
|
|
||||||
`);
|
|
||||||
|
|
||||||
console.table(rows);
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
debugPublic().catch(console.error);
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
const XLSX = require('xlsx');
|
|
||||||
const mysql = require('mysql2/promise');
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
async function deepAudit() {
|
|
||||||
const workbook = XLSX.readFile('asset_pc (2026.06.15).xlsx');
|
|
||||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
|
||||||
const excelData = XLSX.utils.sheet_to_json(sheet);
|
|
||||||
|
|
||||||
console.log('📊 [Excel Audit] Total Rows:', excelData.length);
|
|
||||||
|
|
||||||
// 1. 엑셀 내 asset_type 종류 확인
|
|
||||||
const excelTypes = new Set();
|
|
||||||
excelData.forEach(r => excelTypes.add(r.asset_type));
|
|
||||||
console.log('Excel Asset Types:', Array.from(excelTypes));
|
|
||||||
|
|
||||||
// 2. '공용' 키워드가 들어간 모든 행 추출
|
|
||||||
const publicKeywords = ['공용', '공통', '테스트', 'TEST'];
|
|
||||||
const potentialPublicInExcel = excelData.filter(r => {
|
|
||||||
const name = String(r.user_current || '');
|
|
||||||
const type = String(r.asset_type || '');
|
|
||||||
const memo = String(r.memo || '');
|
|
||||||
return publicKeywords.some(k => name.includes(k) || type.includes(k) || memo.includes(k)) || !r.emp_no;
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`\n🔍 [Potential Public/Issue Rows in Excel]: ${potentialPublicInExcel.length}건`);
|
|
||||||
console.table(potentialPublicInExcel.slice(0, 30).map(r => ({
|
|
||||||
emp_no: r.emp_no,
|
|
||||||
user: r.user_current,
|
|
||||||
dept: r.current_dept,
|
|
||||||
type: r.asset_type,
|
|
||||||
memo: r.memo
|
|
||||||
})));
|
|
||||||
|
|
||||||
// 3. DB와 대조 (특히 엑셀엔 사번이 있는데 DB엔 공용으로 된 게 있는지)
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: process.env.DB_HOST,
|
|
||||||
user: process.env.DB_USER,
|
|
||||||
password: process.env.DB_PASS,
|
|
||||||
database: process.env.DB_NAME,
|
|
||||||
port: parseInt(process.env.DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
const [dbRows] = await connection.query('SELECT id, user_current, emp_no, asset_type FROM asset_core WHERE id LIKE "PC_20260615_%"');
|
|
||||||
|
|
||||||
// 엑셀은 개인PC인데 DB는 공용인 경우 (또는 그 반대)
|
|
||||||
const issues = [];
|
|
||||||
for (let i = 0; i < excelData.length; i++) {
|
|
||||||
const ex = excelData[i];
|
|
||||||
const id = `PC_20260615_${String(i + 1).padStart(4, '0')}`;
|
|
||||||
const db = dbRows.find(r => r.id === id);
|
|
||||||
|
|
||||||
if (!db) continue;
|
|
||||||
|
|
||||||
const isExcelPublic = !ex.emp_no || String(ex.user_current).includes('공용');
|
|
||||||
const isDbPublic = !db.emp_no || String(db.user_current).includes('공용');
|
|
||||||
|
|
||||||
if (isExcelPublic !== isDbPublic) {
|
|
||||||
issues.push({ id, excel_user: ex.user_current, db_user: db.user_current, excel_emp: ex.emp_no, db_emp: db.emp_no });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`\n⚠️ [Consistency Issues]: ${issues.length}건`);
|
|
||||||
if (issues.length > 0) console.table(issues);
|
|
||||||
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
deepAudit().catch(console.error);
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
const XLSX = require('xlsx');
|
|
||||||
const mysql = require('mysql2/promise');
|
|
||||||
const dotenv = require('dotenv');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
dotenv.config({ path: path.join(__dirname, '../.env') });
|
|
||||||
|
|
||||||
const { DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT } = process.env;
|
|
||||||
|
|
||||||
async function extractFailures() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: DB_HOST,
|
|
||||||
user: DB_USER,
|
|
||||||
password: DB_PASS,
|
|
||||||
database: DB_NAME,
|
|
||||||
port: parseInt(DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('🔍 실패 데이터 추출 중...');
|
|
||||||
|
|
||||||
const workbook = XLSX.readFile('asset_pc (2026.06.15).xlsx');
|
|
||||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
|
||||||
const rawData = XLSX.utils.sheet_to_json(sheet);
|
|
||||||
|
|
||||||
// 현재 DB에 존재하는 모든 asset_core ID 조회
|
|
||||||
const [existingRows] = await connection.query('SELECT id FROM asset_core');
|
|
||||||
const existingIds = new Set(existingRows.map(r => r.id));
|
|
||||||
|
|
||||||
const failures = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < rawData.length; i++) {
|
|
||||||
const row = rawData[i];
|
|
||||||
const assetId = `PC_20260615_${String(i + 1).padStart(4, '0')}`;
|
|
||||||
|
|
||||||
// DB에 해당 ID가 없는 경우 = 실패(충돌 등의 이유로 입력되지 않음) 또는 스킵된 데이터
|
|
||||||
// 하지만 이전 로그에서 'Duplicate entry'로 에러가 났던 항목들을 찾는 것이 목적
|
|
||||||
// 로직상 ID 생성 규칙에 따라 해당 ID가 DB에 없으면 입력에 실패한 행임
|
|
||||||
if (!existingIds.has(assetId)) {
|
|
||||||
failures.push({
|
|
||||||
excel_row: i + 2,
|
|
||||||
generated_id: assetId,
|
|
||||||
...row
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (failures.length > 0) {
|
|
||||||
const newWb = XLSX.utils.book_new();
|
|
||||||
const newWs = XLSX.utils.json_to_sheet(failures);
|
|
||||||
XLSX.utils.book_append_sheet(newWb, newWs, 'Failures');
|
|
||||||
const fileName = 'asset_pc_failures_20260615.xlsx';
|
|
||||||
XLSX.writeFile(newWb, fileName);
|
|
||||||
console.log(`✅ 추출 완료: ${failures.length}건의 실패 데이터를 ${fileName}에 저장했습니다.`);
|
|
||||||
} else {
|
|
||||||
console.log('입력되지 않은 데이터가 없습니다.');
|
|
||||||
}
|
|
||||||
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
extractFailures().catch(console.error);
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
const mysql = require('mysql2/promise');
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
async function findPotentialPublic() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: process.env.DB_HOST,
|
|
||||||
user: process.env.DB_USER,
|
|
||||||
password: process.env.DB_PASS,
|
|
||||||
database: process.env.DB_NAME,
|
|
||||||
port: parseInt(process.env.DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('--- Searching for rows with no emp_no or "공용" in user_current ---');
|
|
||||||
|
|
||||||
// 사번이 'undefined', 'null', 빈값, 또는 사용자명에 '공용'이 들어간 데이터
|
|
||||||
const [rows] = await connection.query(`
|
|
||||||
SELECT id, user_current, emp_no
|
|
||||||
FROM asset_core
|
|
||||||
WHERE id LIKE "PC_20260615_%"
|
|
||||||
AND (emp_no IS NULL OR emp_no = '' OR emp_no = 'undefined' OR user_current LIKE '%공용%')
|
|
||||||
`);
|
|
||||||
|
|
||||||
console.log('Count:', rows.length);
|
|
||||||
if (rows.length > 0) console.table(rows);
|
|
||||||
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
findPotentialPublic().catch(console.error);
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
const mysql = require('mysql2/promise');
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
async function fixAssetTypes() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: process.env.DB_HOST,
|
|
||||||
user: process.env.DB_USER,
|
|
||||||
password: process.env.DB_PASS,
|
|
||||||
database: process.env.DB_NAME,
|
|
||||||
port: parseInt(process.env.DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('🚀 [데이터 정상화] 사번 기준 자산 유형 재설정 시작...');
|
|
||||||
|
|
||||||
// 1. 사번이 있는 모든 신규 자산을 '개인PC'로 강제 전환
|
|
||||||
const [personalResult] = await connection.query(`
|
|
||||||
UPDATE asset_core
|
|
||||||
SET asset_type = '개인PC'
|
|
||||||
WHERE id LIKE "PC_20260615_%"
|
|
||||||
AND emp_no IS NOT NULL
|
|
||||||
AND emp_no != ''
|
|
||||||
`);
|
|
||||||
console.log(`✅ 개인PC 정상화 완료: ${personalResult.affectedRows}건 (사번 존재 항목)`);
|
|
||||||
|
|
||||||
// 2. 사번이 없는 모든 신규 자산을 '공용PC'로 강제 전환
|
|
||||||
const [publicResult] = await connection.query(`
|
|
||||||
UPDATE asset_core
|
|
||||||
SET asset_type = '공용PC', user_current = '공용'
|
|
||||||
WHERE id LIKE "PC_20260615_%"
|
|
||||||
AND (emp_no IS NULL OR emp_no = '')
|
|
||||||
`);
|
|
||||||
console.log(`✅ 공용PC 정상화 완료: ${publicResult.affectedRows}건 (사번 부재 항목)`);
|
|
||||||
|
|
||||||
// 3. 최종 결과 확인
|
|
||||||
const [rows] = await connection.query(`
|
|
||||||
SELECT asset_type, COUNT(*) as count
|
|
||||||
FROM asset_core
|
|
||||||
WHERE id LIKE "PC_20260615_%"
|
|
||||||
GROUP BY asset_type
|
|
||||||
`);
|
|
||||||
console.log('\n📊 최종 자산 유형 분포:');
|
|
||||||
console.table(rows);
|
|
||||||
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
fixAssetTypes().catch(console.error);
|
|
||||||
@@ -1,122 +0,0 @@
|
|||||||
const XLSX = require('xlsx');
|
|
||||||
const mysql = require('mysql2/promise');
|
|
||||||
const dotenv = require('dotenv');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
dotenv.config({ path: path.join(__dirname, '../.env') });
|
|
||||||
|
|
||||||
const { DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT } = process.env;
|
|
||||||
|
|
||||||
async function importAssets() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: DB_HOST,
|
|
||||||
user: DB_USER,
|
|
||||||
password: DB_PASS,
|
|
||||||
database: DB_NAME,
|
|
||||||
port: parseInt(DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('🚀 [Step 1] 데이터 로드 및 사전 준비...');
|
|
||||||
|
|
||||||
// 1. 엑셀 파일 로드
|
|
||||||
const workbook = XLSX.readFile('asset_pc (2026.06.15).xlsx');
|
|
||||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
|
||||||
const rawData = XLSX.utils.sheet_to_json(sheet);
|
|
||||||
|
|
||||||
// 2. system_users 데이터 맵 생성 (사번 기준 빠른 조회를 위함)
|
|
||||||
const [userRows] = await connection.query('SELECT emp_no, user_name, dept_name, position, status FROM system_users');
|
|
||||||
const userMap = new Map();
|
|
||||||
userRows.forEach(u => userMap.set(String(u.emp_no), u));
|
|
||||||
|
|
||||||
// 3. 기존 자산 중복 체크용 맵 생성 (emp_no + asset_type + category)
|
|
||||||
const [existingAssets] = await connection.query('SELECT emp_no, asset_type, category FROM asset_core');
|
|
||||||
const existingSet = new Set();
|
|
||||||
existingAssets.forEach(a => {
|
|
||||||
existingSet.add(`${a.emp_no}|${a.asset_type}|${a.category}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`📊 처리 대상 데이터: ${rawData.length}건`);
|
|
||||||
|
|
||||||
let skipCount = 0;
|
|
||||||
let insertCount = 0;
|
|
||||||
|
|
||||||
for (let i = 0; i < rawData.length; i++) {
|
|
||||||
const row = rawData[i];
|
|
||||||
const empNo = String(row.emp_no);
|
|
||||||
const assetType = row.asset_type || '개인PC';
|
|
||||||
const category = row.category || 'PC';
|
|
||||||
|
|
||||||
// 중복 체크
|
|
||||||
if (existingSet.has(`${empNo}|${assetType}|${category}`)) {
|
|
||||||
skipCount++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// [Step 2] 데이터 정제
|
|
||||||
// 1. 사용자 정보 매칭
|
|
||||||
const matchedUser = userMap.get(empNo);
|
|
||||||
const userName = matchedUser ? matchedUser.user_name : row.user_current;
|
|
||||||
const deptName = matchedUser ? matchedUser.dept_name : row.current_dept;
|
|
||||||
const position = matchedUser ? matchedUser.position : '';
|
|
||||||
|
|
||||||
// 2. 날짜 최적화 (purchase_date_1, purchase_date_2 중 최신값)
|
|
||||||
const d1 = parseInt(row.purchase_date_1) || 0;
|
|
||||||
const d2 = parseInt(row.purchase_date_2) || 0;
|
|
||||||
const latestDate = Math.max(d1, d2);
|
|
||||||
const purchaseDate = latestDate > 0 ? String(latestDate) : '';
|
|
||||||
|
|
||||||
// 3. 고유 ID 생성
|
|
||||||
const assetId = `PC_20260615_${String(i + 1).padStart(4, '0')}`;
|
|
||||||
const now = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
|
||||||
|
|
||||||
try {
|
|
||||||
// [Step 3] DB 입력
|
|
||||||
// A. asset_core 입력
|
|
||||||
await connection.query(
|
|
||||||
`INSERT INTO asset_core (id, asset_code, category, asset_type, current_role, asset_purpose, service_type,
|
|
||||||
purchase_corp, purchase_date, memo, manager_primary, current_dept, user_current, emp_no, user_position, created_at, updated_at)
|
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
||||||
[assetId, assetId, category, assetType, row.current_role, row.asset_purpose, row.service_type,
|
|
||||||
'', purchaseDate, row.memo || '', '', deptName, userName, empNo, position, now, now]
|
|
||||||
);
|
|
||||||
|
|
||||||
// B. asset_spec 입력
|
|
||||||
await connection.query(
|
|
||||||
`INSERT INTO asset_spec (asset_id, model_name, mainboard, cpu, ram, gpu) VALUES (?, ?, ?, ?, ?, ?)`,
|
|
||||||
[assetId, '', row.mainboard || '', row.cpu || '', row.ram || '', row.gpu || '']
|
|
||||||
);
|
|
||||||
|
|
||||||
// C. asset_volume 입력 (SSD1, SSD2, HDD1~4)
|
|
||||||
const volumes = [
|
|
||||||
{ type: 'SSD', cap: row.SDD1, slot: 1 },
|
|
||||||
{ type: 'SSD', cap: row.SDD2, slot: 2 },
|
|
||||||
{ type: 'HDD', cap: row.HDD1, slot: 3 },
|
|
||||||
{ type: 'HDD', cap: row.HDD2, slot: 4 },
|
|
||||||
{ type: 'HDD', cap: row.HDD3, slot: 5 },
|
|
||||||
{ type: 'HDD', cap: row.HDD4, slot: 6 }
|
|
||||||
];
|
|
||||||
|
|
||||||
for (const vol of volumes) {
|
|
||||||
if (vol.cap && vol.cap !== '0' && vol.cap !== 0) {
|
|
||||||
await connection.query(
|
|
||||||
`INSERT INTO asset_volume (asset_id, disk_type, capacity, slot_no) VALUES (?, ?, ?, ?)`,
|
|
||||||
[assetId, vol.type, String(vol.cap), vol.slot]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
insertCount++;
|
|
||||||
existingSet.add(`${empNo}|${assetType}|${category}`); // 실시간 중복 방지 추가
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`❌ [${empNo}] 처리 중 오류:`, err.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`\n✨ 작업 완료!`);
|
|
||||||
console.log(`- 신규 입력: ${insertCount}건`);
|
|
||||||
console.log(`- 중복 스킵: ${skipCount}건`);
|
|
||||||
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
importAssets().catch(console.error);
|
|
||||||
@@ -1,164 +0,0 @@
|
|||||||
const XLSX = require('xlsx');
|
|
||||||
const mysql = require('mysql2/promise');
|
|
||||||
const dotenv = require('dotenv');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
dotenv.config({ path: path.join(__dirname, '../.env') });
|
|
||||||
|
|
||||||
const { DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT } = process.env;
|
|
||||||
|
|
||||||
// 용량 정제 함수
|
|
||||||
function parseCapacity(val) {
|
|
||||||
if (!val || val === '0' || val === 0) return null;
|
|
||||||
|
|
||||||
let str = String(val).toUpperCase();
|
|
||||||
|
|
||||||
// 1. 괄호와 그 안의 내용 제거
|
|
||||||
str = str.replace(/\(.*\)/g, '').trim();
|
|
||||||
|
|
||||||
// 2. 숫자와 단위 분리
|
|
||||||
const numMatch = str.match(/[\d.]+/);
|
|
||||||
if (!numMatch) return null;
|
|
||||||
|
|
||||||
let num = parseFloat(numMatch[0]);
|
|
||||||
let unit = 'GB'; // 기본 단위
|
|
||||||
|
|
||||||
if (str.includes('TB')) {
|
|
||||||
unit = 'TB';
|
|
||||||
} else if (str.includes('GB')) {
|
|
||||||
// 4자리수 GB인 경우 TB로 전환 (지시사항 1번)
|
|
||||||
if (num >= 1000) {
|
|
||||||
num = num / 1000;
|
|
||||||
unit = 'TB';
|
|
||||||
} else {
|
|
||||||
unit = 'GB';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 단위가 명시되지 않은 경우 숫자의 크기로 판단
|
|
||||||
if (num >= 1000) {
|
|
||||||
num = num / 1000;
|
|
||||||
unit = 'TB';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
capacity: parseFloat(num.toFixed(2)),
|
|
||||||
unit: unit
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
async function importAssets() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: DB_HOST,
|
|
||||||
user: DB_USER,
|
|
||||||
password: DB_PASS,
|
|
||||||
database: DB_NAME,
|
|
||||||
port: parseInt(DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('🚀 [Step 1] 데이터 로드 및 사전 준비 (정제 로직 강화)...');
|
|
||||||
|
|
||||||
const workbook = XLSX.readFile('asset_pc (2026.06.15).xlsx');
|
|
||||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
|
||||||
const rawData = XLSX.utils.sheet_to_json(sheet);
|
|
||||||
|
|
||||||
// system_users 데이터 맵
|
|
||||||
const [userRows] = await connection.query('SELECT emp_no, user_name, dept_name, position, status FROM system_users');
|
|
||||||
const userMap = new Map();
|
|
||||||
userRows.forEach(u => userMap.set(String(u.emp_no), u));
|
|
||||||
|
|
||||||
// 기존 자산 중복 체크용 (emp_no + asset_type + category + user_current)
|
|
||||||
const [existingAssets] = await connection.query('SELECT emp_no, asset_type, category, user_current FROM asset_core');
|
|
||||||
const existingSet = new Set();
|
|
||||||
existingAssets.forEach(a => {
|
|
||||||
existingSet.add(`${a.emp_no || ''}|${a.asset_type}|${a.category}|${a.user_current}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`📊 처리 대상 데이터: ${rawData.length}건`);
|
|
||||||
|
|
||||||
let skipCount = 0;
|
|
||||||
let insertCount = 0;
|
|
||||||
let errorCount = 0;
|
|
||||||
|
|
||||||
for (let i = 0; i < rawData.length; i++) {
|
|
||||||
const row = rawData[i];
|
|
||||||
const empNo = row.emp_no ? String(row.emp_no) : ''; // 사번 없는 행 처리 (지시사항 3번)
|
|
||||||
const assetType = row.asset_type || '개인PC';
|
|
||||||
const category = row.category || 'PC';
|
|
||||||
const userCurrent = row.user_current || '';
|
|
||||||
|
|
||||||
// 중복 체크
|
|
||||||
const dupKey = `${empNo}|${assetType}|${category}|${userCurrent}`;
|
|
||||||
if (existingSet.has(dupKey)) {
|
|
||||||
skipCount++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// [Step 2] 데이터 정제
|
|
||||||
const matchedUser = empNo ? userMap.get(empNo) : null;
|
|
||||||
const userName = matchedUser ? matchedUser.user_name : userCurrent;
|
|
||||||
const deptName = matchedUser ? matchedUser.dept_name : (row.current_dept || '');
|
|
||||||
const position = matchedUser ? matchedUser.position : '';
|
|
||||||
|
|
||||||
const d1 = parseInt(row.purchase_date_1) || 0;
|
|
||||||
const d2 = parseInt(row.purchase_date_2) || 0;
|
|
||||||
const purchaseDate = Math.max(d1, d2) > 0 ? String(Math.max(d1, d2)) : '';
|
|
||||||
|
|
||||||
const assetId = `PC_20260615_${String(i + 1).padStart(4, '0')}`;
|
|
||||||
const now = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
|
||||||
|
|
||||||
try {
|
|
||||||
// [Step 3] DB 입력
|
|
||||||
// A. asset_core
|
|
||||||
await connection.query(
|
|
||||||
`INSERT INTO asset_core (id, asset_code, category, asset_type, current_role, asset_purpose, service_type,
|
|
||||||
purchase_date, memo, current_dept, user_current, emp_no, user_position, created_at, updated_at)
|
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
||||||
[assetId, assetId, category, assetType, row.current_role || '', row.asset_purpose || '', row.service_type || '',
|
|
||||||
purchaseDate, row.memo || '', deptName, userName, empNo, position, now, now]
|
|
||||||
);
|
|
||||||
|
|
||||||
// B. asset_spec
|
|
||||||
await connection.query(
|
|
||||||
`INSERT INTO asset_spec (asset_id, mainboard, cpu, ram, gpu) VALUES (?, ?, ?, ?, ?)`,
|
|
||||||
[assetId, row.mainboard || '', row.cpu || '', row.ram || '', row.gpu || '']
|
|
||||||
);
|
|
||||||
|
|
||||||
// C. asset_volume
|
|
||||||
const volCols = [
|
|
||||||
{ key: 'SDD1', type: 'SSD', slot: 1 },
|
|
||||||
{ key: 'SDD2', type: 'SSD', slot: 2 },
|
|
||||||
{ key: 'HDD1', type: 'HDD', slot: 3 },
|
|
||||||
{ key: 'HDD2', type: 'HDD', slot: 4 },
|
|
||||||
{ key: 'HDD3', type: 'HDD', slot: 5 },
|
|
||||||
{ key: 'HDD4', type: 'HDD', slot: 6 }
|
|
||||||
];
|
|
||||||
|
|
||||||
for (const col of volCols) {
|
|
||||||
const rawVol = row[col.key];
|
|
||||||
const parsed = parseCapacity(rawVol);
|
|
||||||
if (parsed) {
|
|
||||||
await connection.query(
|
|
||||||
`INSERT INTO asset_volume (asset_id, disk_type, capacity, unit, slot_no) VALUES (?, ?, ?, ?, ?)`,
|
|
||||||
[assetId, col.type, parsed.capacity, parsed.unit, col.slot]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
insertCount++;
|
|
||||||
existingSet.add(dupKey);
|
|
||||||
} catch (err) {
|
|
||||||
errorCount++;
|
|
||||||
console.error(`❌ [Row ${i + 2}] ${empNo || 'Public'}: ${err.message}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`\n✨ 작업 완료!`);
|
|
||||||
console.log(`- 신규 입력: ${insertCount}건`);
|
|
||||||
console.log(`- 중복 스킵: ${skipCount}건`);
|
|
||||||
console.log(`- 오류 실패: ${errorCount}건`);
|
|
||||||
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
importAssets().catch(console.error);
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
const XLSX = require('xlsx');
|
|
||||||
const mysql = require('mysql2/promise');
|
|
||||||
const dotenv = require('dotenv');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
dotenv.config({ path: path.join(__dirname, '../.env') });
|
|
||||||
|
|
||||||
const { DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT } = process.env;
|
|
||||||
|
|
||||||
async function importUsers() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: DB_HOST,
|
|
||||||
user: DB_USER,
|
|
||||||
password: DB_PASS,
|
|
||||||
database: DB_NAME,
|
|
||||||
port: parseInt(DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('🚀 Excel 데이터 로드 중...');
|
|
||||||
const workbook = XLSX.readFile('system_User (20260615).xlsx');
|
|
||||||
const sheetName = workbook.SheetNames[0];
|
|
||||||
const sheet = workbook.Sheets[sheetName];
|
|
||||||
const data = XLSX.utils.sheet_to_json(sheet);
|
|
||||||
|
|
||||||
console.log(`📊 총 ${data.length}개의 데이터를 찾았습니다.`);
|
|
||||||
|
|
||||||
// 기존 데이터 삭제 여부 (사용자 요구사항에 따라 결정 가능하지만, 보통 초기화 후 재입입)
|
|
||||||
// 여기서는 중복 방지를 위해 기존 데이터를 삭제하고 새로 넣는 방식을 취하겠습니다.
|
|
||||||
console.log('🧹 기존 system_users 데이터 삭제 중...');
|
|
||||||
await connection.query('DELETE FROM system_users');
|
|
||||||
|
|
||||||
console.log('📥 데이터 삽입 중...');
|
|
||||||
let successCount = 0;
|
|
||||||
|
|
||||||
for (let i = 0; i < data.length; i++) {
|
|
||||||
const row = data[i];
|
|
||||||
const { emp_no, user_name, dept_name, position, status } = row;
|
|
||||||
|
|
||||||
// ID 생성 (USR_ + 인덱스 001 형식)
|
|
||||||
const id = `USR_${String(i + 1).padStart(3, '0')}`;
|
|
||||||
const createdAt = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
|
||||||
|
|
||||||
try {
|
|
||||||
await connection.query(
|
|
||||||
'INSERT INTO system_users (id, emp_no, user_name, dept_name, position, status, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)',
|
|
||||||
[id, String(emp_no), user_name, dept_name, position, status, createdAt]
|
|
||||||
);
|
|
||||||
successCount++;
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`❌ 삽입 실패 (Row ${i + 2}):`, err.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`✅ 완료: ${successCount}개의 사용자가 성공적으로 등록되었습니다.`);
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
importUsers().catch(err => {
|
|
||||||
console.error('❌ 작업 중 오류 발생:', err);
|
|
||||||
process.exit(1);
|
|
||||||
});
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
const XLSX = require('xlsx');
|
|
||||||
const workbook = XLSX.readFile('asset_pc (2026.06.15).xlsx');
|
|
||||||
const sheetName = workbook.SheetNames[0];
|
|
||||||
const sheet = workbook.Sheets[sheetName];
|
|
||||||
const data = XLSX.utils.sheet_to_json(sheet, { header: 1 });
|
|
||||||
console.log('Headers:', JSON.stringify(data[0], null, 2));
|
|
||||||
console.log('Sample Row 1:', JSON.stringify(data[1], null, 2));
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
const XLSX = require('xlsx');
|
|
||||||
const workbook = XLSX.readFile('system_User (20260615).xlsx');
|
|
||||||
const sheetName = workbook.SheetNames[0];
|
|
||||||
const sheet = workbook.Sheets[sheetName];
|
|
||||||
const data = XLSX.utils.sheet_to_json(sheet, { header: 1 });
|
|
||||||
console.log(JSON.stringify(data.slice(0, 5), null, 2));
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
const mysql = require('mysql2/promise');
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
async function rawCheck() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: process.env.DB_HOST,
|
|
||||||
user: process.env.DB_USER,
|
|
||||||
password: process.env.DB_PASS,
|
|
||||||
database: process.env.DB_NAME,
|
|
||||||
port: parseInt(process.env.DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
const [rows] = await connection.query('SELECT user_current, emp_no FROM asset_core WHERE id LIKE "PC_20260615_%" LIMIT 10');
|
|
||||||
console.log(rows);
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
rawCheck().catch(console.error);
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
const mysql = require('mysql2/promise');
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
async function rebuildAssetCodes() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: process.env.DB_HOST,
|
|
||||||
user: process.env.DB_USER,
|
|
||||||
password: process.env.DB_PASS,
|
|
||||||
database: process.env.DB_NAME,
|
|
||||||
port: parseInt(process.env.DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('🚀 [Step 1] 신규 자산 구매일 업데이트 (YYYY-12-01)...');
|
|
||||||
|
|
||||||
// 1. 오늘 입력한 자산들 조회
|
|
||||||
const [rows] = await connection.query(
|
|
||||||
'SELECT id, purchase_date FROM asset_core WHERE id LIKE "PC_20260615_%"'
|
|
||||||
);
|
|
||||||
console.log(`대상 자산: ${rows.length}건`);
|
|
||||||
|
|
||||||
// 2. 구매일자 업데이트 (연도만 있는 경우 -12-01 추가)
|
|
||||||
for (const row of rows) {
|
|
||||||
if (row.purchase_date && row.purchase_date.length === 4) {
|
|
||||||
const newDate = `${row.purchase_date}-12-01`;
|
|
||||||
await connection.query(
|
|
||||||
'UPDATE asset_core SET purchase_date = ? WHERE id = ?',
|
|
||||||
[newDate, row.id]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log('✅ 구매일 업데이트 완료.');
|
|
||||||
|
|
||||||
console.log('\n🚀 [Step 2] 자산번호(asset_code) 재매핑 시작...');
|
|
||||||
|
|
||||||
// 3. 연도별로 그룹화하여 자산번호 부여
|
|
||||||
// 연도 목록 추출
|
|
||||||
const [yearRows] = await connection.query(
|
|
||||||
'SELECT DISTINCT LEFT(purchase_date, 4) as year FROM asset_core WHERE id LIKE "PC_20260615_%" ORDER BY year'
|
|
||||||
);
|
|
||||||
|
|
||||||
for (const yRow of yearRows) {
|
|
||||||
const year = yRow.year;
|
|
||||||
const yearMonth = `${year}12`;
|
|
||||||
const pattern = `PC-${yearMonth}-%`;
|
|
||||||
|
|
||||||
console.log(`--- [${year}년] 처리 중 ---`);
|
|
||||||
|
|
||||||
// 해당 연도/월의 기존 최대 순번 조회
|
|
||||||
const [maxRows] = await connection.query(
|
|
||||||
'SELECT asset_code FROM asset_core WHERE asset_code LIKE ? AND id NOT LIKE "PC_20260615_%"',
|
|
||||||
[pattern]
|
|
||||||
);
|
|
||||||
|
|
||||||
let maxSeq = 0;
|
|
||||||
maxRows.forEach(r => {
|
|
||||||
const parts = r.asset_code.split('-');
|
|
||||||
const seq = parseInt(parts[2]);
|
|
||||||
if (seq > maxSeq) maxSeq = seq;
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`기존 최대 순번: ${maxSeq}`);
|
|
||||||
|
|
||||||
// 해당 연도 자산들 순차적으로 번호 부여
|
|
||||||
const [assetsOfYear] = await connection.query(
|
|
||||||
'SELECT id FROM asset_core WHERE id LIKE "PC_20260615_%" AND purchase_date LIKE ? ORDER BY id',
|
|
||||||
[`${year}-12%`]
|
|
||||||
);
|
|
||||||
|
|
||||||
let currentSeq = maxSeq + 1;
|
|
||||||
for (const asset of assetsOfYear) {
|
|
||||||
const newCode = `PC-${yearMonth}-${String(currentSeq).padStart(4, '0')}`;
|
|
||||||
await connection.query(
|
|
||||||
'UPDATE asset_core SET asset_code = ? WHERE id = ?',
|
|
||||||
[newCode, asset.id]
|
|
||||||
);
|
|
||||||
currentSeq++;
|
|
||||||
}
|
|
||||||
console.log(`신규 부여 완료: ${assetsOfYear.length}건 (순번 ${maxSeq + 1} ~ ${currentSeq - 1})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('\n✨ 모든 작업이 완료되었습니다.');
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
rebuildAssetCodes().catch(console.error);
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
const XLSX = require('xlsx');
|
|
||||||
const mysql = require('mysql2/promise');
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
async function reexamineData() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: process.env.DB_HOST,
|
|
||||||
user: process.env.DB_USER,
|
|
||||||
password: process.env.DB_PASS,
|
|
||||||
database: process.env.DB_NAME,
|
|
||||||
port: parseInt(process.env.DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('🧐 [전수 조사] 엑셀 vs DB 데이터 비교 분석...');
|
|
||||||
|
|
||||||
// 1. 엑셀 데이터 로드
|
|
||||||
const workbook = XLSX.readFile('asset_pc (2026.06.15).xlsx');
|
|
||||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
|
||||||
const excelRows = XLSX.utils.sheet_to_json(sheet);
|
|
||||||
|
|
||||||
// 2. DB 데이터 로드
|
|
||||||
const [dbRows] = await connection.query(`
|
|
||||||
SELECT id, asset_code, asset_type, user_current, emp_no, current_dept
|
|
||||||
FROM asset_core
|
|
||||||
WHERE id LIKE "PC_20260615_%"
|
|
||||||
`);
|
|
||||||
const dbMap = new Map();
|
|
||||||
dbRows.forEach(r => dbMap.set(r.id, r));
|
|
||||||
|
|
||||||
const report = {
|
|
||||||
total: excelRows.length,
|
|
||||||
publicInExcelWithEmpNo: [], // 엑셀은 공용PC인데 사번이 있는 경우
|
|
||||||
personalInExcelNoEmpNo: [], // 엑셀은 개인PC인데 사번이 없는 경우
|
|
||||||
typeMismatch: [], // 엑셀과 DB의 asset_type이 다른 경우
|
|
||||||
userMismatch: [] // 사용자명이 크게 다른 경우
|
|
||||||
};
|
|
||||||
|
|
||||||
for (let i = 0; i < excelRows.length; i++) {
|
|
||||||
const ex = excelRows[i];
|
|
||||||
const id = `PC_20260615_${String(i + 1).padStart(4, '0')}`;
|
|
||||||
const db = dbMap.get(id);
|
|
||||||
|
|
||||||
if (!db) continue;
|
|
||||||
|
|
||||||
const exType = ex.asset_type || '개인PC';
|
|
||||||
const exEmpNo = ex.emp_no ? String(ex.emp_no) : null;
|
|
||||||
const exUser = ex.user_current || '';
|
|
||||||
|
|
||||||
// A. 공용PC인데 사번이 있는 경우 (가장 큰 혼란 포인트)
|
|
||||||
if (exType === '공용PC' && exEmpNo) {
|
|
||||||
report.publicInExcelWithEmpNo.push({ id, exUser, exEmpNo, exDept: ex.current_dept });
|
|
||||||
}
|
|
||||||
|
|
||||||
// B. 개인PC인데 사번이 없는 경우
|
|
||||||
if (exType === '개인PC' && !exEmpNo) {
|
|
||||||
report.personalInExcelNoEmpNo.push({ id, exUser, exDept: ex.current_dept });
|
|
||||||
}
|
|
||||||
|
|
||||||
// C. DB와의 타입 불일치 (현재 DB 상태 체크)
|
|
||||||
if (db.asset_type !== exType) {
|
|
||||||
report.typeMismatch.push({ id, exType, dbType: db.asset_type, user: db.user_current });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('\n================================================');
|
|
||||||
console.log(`📊 전수 조사 요약 (총 ${report.total}건)`);
|
|
||||||
console.log(`1. 엑셀은 '공용PC'이나 '사번'이 있는 항목: ${report.publicInExcelWithEmpNo.length}건`);
|
|
||||||
console.log(`2. 엑셀은 '개인PC'이나 '사번'이 없는 항목: ${report.personalInExcelNoEmpNo.length}건`);
|
|
||||||
console.log(`3. 현재 DB와 엑셀의 '자산유형' 불일치: ${report.typeMismatch.length}건`);
|
|
||||||
console.log('================================================\n');
|
|
||||||
|
|
||||||
if (report.publicInExcelWithEmpNo.length > 0) {
|
|
||||||
console.log('⚠️ [그룹 1] 공용PC인데 실사용자/관리자가 지정된 사례 (샘플 15건):');
|
|
||||||
console.table(report.publicInExcelWithEmpNo.slice(0, 15));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (report.personalInExcelNoEmpNo.length > 0) {
|
|
||||||
console.log('\n⚠️ [그룹 2] 개인PC인데 사번 정보가 누락된 사례 (샘플 15건):');
|
|
||||||
console.table(report.personalInExcelNoEmpNo.slice(0, 15));
|
|
||||||
}
|
|
||||||
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
reexamineData().catch(console.error);
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
const XLSX = require('xlsx');
|
|
||||||
const mysql = require('mysql2/promise');
|
|
||||||
const dotenv = require('dotenv');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
dotenv.config({ path: path.join(__dirname, '../.env') });
|
|
||||||
|
|
||||||
const { DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT } = process.env;
|
|
||||||
|
|
||||||
async function restoreAndMerge() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: DB_HOST,
|
|
||||||
user: DB_USER,
|
|
||||||
password: DB_PASS,
|
|
||||||
database: DB_NAME,
|
|
||||||
port: parseInt(DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('🔄 데이터 복구 및 병합 시작...');
|
|
||||||
|
|
||||||
// 1. 백업 파일에서 기존 데이터(212건) 로드
|
|
||||||
const workbookBackup = XLSX.readFile('backupDB_20260602.xlsx');
|
|
||||||
const oldUsers = XLSX.utils.sheet_to_json(workbookBackup.Sheets['system_users']);
|
|
||||||
|
|
||||||
// 2. 신규 파일에서 데이터(987건) 로드
|
|
||||||
const workbookNew = XLSX.readFile('system_User (20260615).xlsx');
|
|
||||||
const newUsers = XLSX.utils.sheet_to_json(workbookNew.Sheets[workbookNew.SheetNames[0]]);
|
|
||||||
|
|
||||||
console.log(`기본 백업 데이터: ${oldUsers.length}건`);
|
|
||||||
console.log(`신규 추가 데이터: ${newUsers.length}건`);
|
|
||||||
|
|
||||||
// 테이블 비우기 (실수를 바로잡기 위해 다시 시작)
|
|
||||||
await connection.query('DELETE FROM system_users');
|
|
||||||
|
|
||||||
const insertedEmpNos = new Set();
|
|
||||||
let restoreCount = 0;
|
|
||||||
let addCount = 0;
|
|
||||||
|
|
||||||
// 3. 기존 데이터 복구 (ID 보존 시도)
|
|
||||||
for (const user of oldUsers) {
|
|
||||||
const { id, emp_no, user_name, dept_name, position, status, created_at } = user;
|
|
||||||
|
|
||||||
// 엑셀 날짜 처리 (숫자로 되어 있을 경우)
|
|
||||||
let finalCreatedAt = created_at;
|
|
||||||
if (typeof created_at === 'number') {
|
|
||||||
const date = new Date((created_at - 25569) * 86400 * 1000);
|
|
||||||
finalCreatedAt = date.toISOString().replace('T', ' ').substring(0, 19);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
await connection.query(
|
|
||||||
'INSERT INTO system_users (id, emp_no, user_name, dept_name, position, status, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)',
|
|
||||||
[id, String(emp_no), user_name, dept_name, position, status, finalCreatedAt]
|
|
||||||
);
|
|
||||||
insertedEmpNos.add(String(emp_no));
|
|
||||||
restoreCount++;
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`❌ 복구 실패 (emp_no: ${emp_no}):`, err.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. 신규 데이터 추가 (중복 제외)
|
|
||||||
for (let i = 0; i < newUsers.length; i++) {
|
|
||||||
const user = newUsers[i];
|
|
||||||
const { emp_no, user_name, dept_name, position, status } = user;
|
|
||||||
const strEmpNo = String(emp_no);
|
|
||||||
|
|
||||||
if (insertedEmpNos.has(strEmpNo)) {
|
|
||||||
continue; // 이미 복구된 데이터는 스킵
|
|
||||||
}
|
|
||||||
|
|
||||||
// 신규 데이터용 ID 생성 (기존 ID와 겹치지 않게 'NEW_' 접두어 또는 시퀀스 사용)
|
|
||||||
// 여기서는 단순히 시퀀스로 처리 (최대 ID 확인 후 +1 하는 방식이 좋으나 여기선 간단히)
|
|
||||||
const id = `USR_N_${String(i + 1).padStart(4, '0')}`;
|
|
||||||
const createdAt = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
|
||||||
|
|
||||||
try {
|
|
||||||
await connection.query(
|
|
||||||
'INSERT INTO system_users (id, emp_no, user_name, dept_name, position, status, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)',
|
|
||||||
[id, strEmpNo, user_name, dept_name, position, status, createdAt]
|
|
||||||
);
|
|
||||||
addCount++;
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`❌ 추가 실패 (emp_no: ${emp_no}):`, err.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`✅ 복구 완료: 기존 ${restoreCount}건 복구, 신규 ${addCount}건 추가 (총 ${restoreCount + addCount}건)`);
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
restoreAndMerge().catch(console.error);
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
const mysql = require('mysql2/promise');
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
async function updateDepartments() {
|
|
||||||
const connection = await mysql.createConnection({
|
|
||||||
host: process.env.DB_HOST,
|
|
||||||
user: process.env.DB_USER,
|
|
||||||
password: process.env.DB_PASS,
|
|
||||||
database: process.env.DB_NAME,
|
|
||||||
port: parseInt(process.env.DB_PORT || '3306')
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log("🚀 부서명 '삼안' 통합 업데이트 시작...");
|
|
||||||
|
|
||||||
const [result] = await connection.query(`
|
|
||||||
UPDATE asset_core
|
|
||||||
SET current_dept = '삼안'
|
|
||||||
WHERE current_dept NOT IN ('총괄기획실', '기술개발센터', '현타', '장헌', '한맥', 'PTC', '', '삼안')
|
|
||||||
AND current_dept IS NOT NULL
|
|
||||||
`);
|
|
||||||
|
|
||||||
console.log(`✅ 업데이트 완료: ${result.affectedRows}건의 부서명이 '삼안'으로 변경되었습니다.`);
|
|
||||||
|
|
||||||
// 최종 확인용 카운트
|
|
||||||
const [rows] = await connection.query('SELECT current_dept, COUNT(*) as count FROM asset_core GROUP BY current_dept');
|
|
||||||
console.log('\n📊 최종 부서 분포:');
|
|
||||||
console.table(rows);
|
|
||||||
|
|
||||||
await connection.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
updateDepartments().catch(console.error);
|
|
||||||
86
server.js
86
server.js
@@ -28,6 +28,40 @@ const pool = mysql.createPool({
|
|||||||
queueLimit: 0
|
queueLimit: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Database startup check (ensure job_spec_standards table exists)
|
||||||
|
(async () => {
|
||||||
|
let connection;
|
||||||
|
try {
|
||||||
|
connection = await pool.getConnection();
|
||||||
|
await connection.query(`
|
||||||
|
CREATE TABLE IF NOT EXISTS job_spec_standards (
|
||||||
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
job_name VARCHAR(100) UNIQUE NOT NULL,
|
||||||
|
cpu_standard VARCHAR(255),
|
||||||
|
ram_standard VARCHAR(100),
|
||||||
|
gpu_standard VARCHAR(100),
|
||||||
|
min_score INT DEFAULT 0,
|
||||||
|
required_grade VARCHAR(50) DEFAULT '중급',
|
||||||
|
remarks TEXT,
|
||||||
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
`);
|
||||||
|
|
||||||
|
// 테이블이 이미 존재할 경우를 대비하여 required_grade 컬럼 안전 추가
|
||||||
|
try {
|
||||||
|
await connection.query("ALTER TABLE job_spec_standards ADD COLUMN required_grade VARCHAR(50) DEFAULT '중급'");
|
||||||
|
} catch (err) {
|
||||||
|
// 이미 컬럼이 존재하면 에러가 나므로 통과합니다.
|
||||||
|
}
|
||||||
|
console.log('✅ job_spec_standards table verification completed.');
|
||||||
|
} catch (err) {
|
||||||
|
console.error('❌ Failed to verify/create job_spec_standards table:', err);
|
||||||
|
} finally {
|
||||||
|
if (connection) connection.release();
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
// Error Handler
|
// Error Handler
|
||||||
const handleError = (res, err, label) => {
|
const handleError = (res, err, label) => {
|
||||||
console.error(`❌ [${label}] Error:`, err);
|
console.error(`❌ [${label}] Error:`, err);
|
||||||
@@ -151,6 +185,7 @@ app.get('/api/assets/master', async (req, res) => {
|
|||||||
const [users] = await connection.query('SELECT * FROM system_users');
|
const [users] = await connection.query('SELECT * FROM system_users');
|
||||||
const [logs] = await connection.query('SELECT * FROM asset_history ORDER BY created_at DESC');
|
const [logs] = await connection.query('SELECT * FROM asset_history ORDER BY created_at DESC');
|
||||||
const [partsMaster] = await connection.query('SELECT * FROM hardware_components_master ORDER BY category, component_name');
|
const [partsMaster] = await connection.query('SELECT * FROM hardware_components_master ORDER BY category, component_name');
|
||||||
|
const [jobSpecs] = await connection.query('SELECT * FROM job_spec_standards ORDER BY job_name');
|
||||||
|
|
||||||
masterData.swInternal = swInternal;
|
masterData.swInternal = swInternal;
|
||||||
masterData.swExternal = swExternal;
|
masterData.swExternal = swExternal;
|
||||||
@@ -158,6 +193,7 @@ app.get('/api/assets/master', async (req, res) => {
|
|||||||
masterData.users = users;
|
masterData.users = users;
|
||||||
masterData.logs = logs;
|
masterData.logs = logs;
|
||||||
masterData.partsMaster = partsMaster;
|
masterData.partsMaster = partsMaster;
|
||||||
|
masterData.jobSpecs = jobSpecs;
|
||||||
|
|
||||||
res.json(masterData);
|
res.json(masterData);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -546,6 +582,56 @@ app.delete('/api/hardware-components/:id', async (req, res) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 6.7.1. Get Job Spec Standards
|
||||||
|
app.get('/api/job-specs', async (req, res) => {
|
||||||
|
try {
|
||||||
|
const [rows] = await pool.query('SELECT * FROM job_spec_standards ORDER BY job_name');
|
||||||
|
res.json(rows);
|
||||||
|
} catch (err) {
|
||||||
|
handleError(res, err, 'GET JOB SPECS');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 6.7.2. Save Job Spec Standard (Add or Update)
|
||||||
|
app.post('/api/job-specs/save', async (req, res) => {
|
||||||
|
const { id, job_name, cpu_standard, ram_standard, gpu_standard, min_score, required_grade, remarks } = req.body;
|
||||||
|
let connection;
|
||||||
|
try {
|
||||||
|
connection = await pool.getConnection();
|
||||||
|
if (id) {
|
||||||
|
await connection.query(
|
||||||
|
'UPDATE job_spec_standards SET job_name = ?, cpu_standard = ?, ram_standard = ?, gpu_standard = ?, min_score = ?, required_grade = ?, remarks = ? WHERE id = ?',
|
||||||
|
[job_name, cpu_standard || '', ram_standard || '', gpu_standard || '', min_score || 0, required_grade || '중급', remarks || '', id]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
await connection.query(
|
||||||
|
'INSERT INTO job_spec_standards (job_name, cpu_standard, ram_standard, gpu_standard, min_score, required_grade, remarks) VALUES (?, ?, ?, ?, ?, ?, ?)',
|
||||||
|
[job_name, cpu_standard || '', ram_standard || '', gpu_standard || '', min_score || 0, required_grade || '중급', remarks || '']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
res.json({ success: true });
|
||||||
|
} catch (err) {
|
||||||
|
handleError(res, err, 'SAVE JOB SPEC');
|
||||||
|
} finally {
|
||||||
|
if (connection) connection.release();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 6.7.3. Delete Job Spec Standard
|
||||||
|
app.delete('/api/job-specs/:id', async (req, res) => {
|
||||||
|
const { id } = req.params;
|
||||||
|
let connection;
|
||||||
|
try {
|
||||||
|
connection = await pool.getConnection();
|
||||||
|
await connection.query('DELETE FROM job_spec_standards WHERE id = ?', [id]);
|
||||||
|
res.json({ success: true });
|
||||||
|
} catch (err) {
|
||||||
|
handleError(res, err, 'DELETE JOB SPEC');
|
||||||
|
} finally {
|
||||||
|
if (connection) connection.release();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 6.8. Get System Users List
|
// 6.8. Get System Users List
|
||||||
app.get('/api/system-users', async (req, res) => {
|
app.get('/api/system-users', async (req, res) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
177
src/components/Modal/JobSpecModal.ts
Normal file
177
src/components/Modal/JobSpecModal.ts
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
import { state, saveJobSpec, deleteJobSpec } from '../../core/state';
|
||||||
|
import { BaseModal } from './BaseModal';
|
||||||
|
import { setFieldValue } from './ModalUtils';
|
||||||
|
import { UI_TEXT } from '../../core/schema';
|
||||||
|
import { calculatePcScoreDeductive } from '../../core/utils';
|
||||||
|
|
||||||
|
class JobSpecModal extends BaseModal {
|
||||||
|
constructor() {
|
||||||
|
super('job-spec', '직무별 기준 사양');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected renderFrameHTML(): string {
|
||||||
|
return `
|
||||||
|
<div id="job-spec-asset-modal" class="modal-overlay hidden">
|
||||||
|
<div class="modal-content narrow">
|
||||||
|
<div class="modal-header">
|
||||||
|
<div class="header-left">
|
||||||
|
<h2 id="job-spec-modal-title" class="modal-title">\${this.title}</h2>
|
||||||
|
<div id="job-spec-header-identity" class="header-identity"></div>
|
||||||
|
</div>
|
||||||
|
<button id="btn-close-job-spec-modal" class="btn-icon" aria-label="닫기">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form id="job-spec-asset-form" class="grid-form vertical-form">
|
||||||
|
<input type="hidden" id="job-spec-id" name="id" />
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>직무명</label>
|
||||||
|
<input type="text" id="job-spec-job-name" name="job_name" placeholder="예: BIM 모델러, 개발자, 엔지니어" required />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>요구 PC 등급</label>
|
||||||
|
<select id="job-spec-required-grade" name="required_grade" style="width: 100%; padding: 8px 12px; border: 1px solid var(--border-color, #E2E8F0); border-radius: 6px; background-color: white; font-size: 14px; font-weight: 600; color: #334155;" required>
|
||||||
|
<option value="최상급">최상급 (85점 이상)</option>
|
||||||
|
<option value="상급" selected>상급 (70점 이상)</option>
|
||||||
|
<option value="중급">중급 (40점 이상)</option>
|
||||||
|
<option value="보급">보급 (20점 이상)</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>비고 (메모)</label>
|
||||||
|
<textarea id="job-spec-remarks" name="remarks" placeholder="기타 필요 사양 및 안내 사항" rows="3"></textarea>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button id="btn-delete-job-spec-asset" class="btn btn-outline btn-danger">삭제</button>
|
||||||
|
<div class="footer-actions">
|
||||||
|
<button id="btn-revert-job-spec-edit" class="btn btn-outline hidden">수정 취소</button>
|
||||||
|
<button id="btn-cancel-job-spec-modal" class="btn btn-outline">닫기</button>
|
||||||
|
<button id="btn-save-job-spec-asset" class="btn btn-primary">수정</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected initChildLogic(onSave: () => void, closeModals: () => void): void {
|
||||||
|
const saveBtn = document.getElementById('btn-save-job-spec-asset')!;
|
||||||
|
const revertBtn = document.getElementById('btn-revert-job-spec-edit')!;
|
||||||
|
const deleteBtn = document.getElementById('btn-delete-job-spec-asset')!;
|
||||||
|
|
||||||
|
saveBtn.addEventListener('click', async () => {
|
||||||
|
if (!this.currentAsset) return;
|
||||||
|
if (!this.isEditMode) {
|
||||||
|
this.setEditLockMode('edit');
|
||||||
|
this.isEditMode = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const jobName = (document.getElementById('job-spec-job-name') as HTMLInputElement).value.trim();
|
||||||
|
const requiredGrade = (document.getElementById('job-spec-required-grade') as HTMLSelectElement).value;
|
||||||
|
const remarks = (document.getElementById('job-spec-remarks') as HTMLTextAreaElement).value.trim();
|
||||||
|
|
||||||
|
if (!jobName) {
|
||||||
|
alert('직무명을 입력해 주세요.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const updated = {
|
||||||
|
id: this.currentAsset.id || null,
|
||||||
|
job_name: jobName,
|
||||||
|
cpu_standard: '',
|
||||||
|
ram_standard: '',
|
||||||
|
gpu_standard: '',
|
||||||
|
min_score: 0,
|
||||||
|
required_grade: requiredGrade,
|
||||||
|
remarks: remarks
|
||||||
|
};
|
||||||
|
|
||||||
|
if (await saveJobSpec(updated)) {
|
||||||
|
alert(UI_TEXT.MESSAGES.SAVE_SUCCESS);
|
||||||
|
onSave(); this.close(); closeModals();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
revertBtn.addEventListener('click', () => {
|
||||||
|
this.setEditLockMode('view');
|
||||||
|
if (this.currentAsset) this.fillFormData(this.currentAsset);
|
||||||
|
});
|
||||||
|
|
||||||
|
deleteBtn.addEventListener('click', async () => {
|
||||||
|
if (!this.currentAsset || !this.currentAsset.id) return;
|
||||||
|
if (!confirm('정말로 이 직무별 기준 사양을 삭제하시겠습니까?')) return;
|
||||||
|
|
||||||
|
if (await deleteJobSpec(this.currentAsset.id)) {
|
||||||
|
alert('성공적으로 삭제되었습니다.');
|
||||||
|
onSave(); this.close(); closeModals();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected fillFormData(asset: any): void {
|
||||||
|
setFieldValue('job-spec-id', asset.id || '');
|
||||||
|
setFieldValue('job-spec-job-name', asset.job_name || '');
|
||||||
|
setFieldValue('job-spec-required-grade', asset.required_grade || '중급');
|
||||||
|
setFieldValue('job-spec-remarks', asset.remarks || '');
|
||||||
|
this.updateHeaderIdentity(asset);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected onAfterOpen(asset: any, mode: string): void {
|
||||||
|
const titleEl = document.getElementById('job-spec-modal-title');
|
||||||
|
|
||||||
|
if (titleEl) {
|
||||||
|
if (mode === 'add') {
|
||||||
|
titleEl.textContent = '신규 직무별 기준 사양 등록';
|
||||||
|
} else {
|
||||||
|
titleEl.textContent = '직무별 기준 사양 상세 편집';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteBtn = document.getElementById('btn-delete-job-spec-asset')!;
|
||||||
|
const saveBtn = document.getElementById('btn-save-job-spec-asset')!;
|
||||||
|
|
||||||
|
deleteBtn.style.display = (mode === 'add') ? 'none' : 'block';
|
||||||
|
|
||||||
|
if (mode === 'add' || mode === 'edit') {
|
||||||
|
saveBtn.textContent = (mode === 'add') ? '등록' : '저장';
|
||||||
|
saveBtn.style.display = 'block';
|
||||||
|
} else {
|
||||||
|
saveBtn.textContent = '수정';
|
||||||
|
saveBtn.style.display = 'block';
|
||||||
|
}
|
||||||
|
this.updateHeaderIdentity(asset);
|
||||||
|
}
|
||||||
|
|
||||||
|
private updateHeaderIdentity(asset: any) {
|
||||||
|
const container = document.getElementById('job-spec-header-identity');
|
||||||
|
if (!container) return;
|
||||||
|
|
||||||
|
if (this.currentMode === 'add') {
|
||||||
|
container.innerHTML = '<span class="badge badge-primary">신규 등록</span>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const jobName = asset.job_name || '';
|
||||||
|
const reqGrade = asset.required_grade || '중급';
|
||||||
|
|
||||||
|
container.innerHTML = `
|
||||||
|
<span class="asset-code-title">${jobName}</span>
|
||||||
|
<span class="service-type-badge">${reqGrade} 요구</span>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const jobSpecModal = new JobSpecModal();
|
||||||
|
|
||||||
|
export function initJobSpecModal(onSave: () => void, closeModals: () => void) {
|
||||||
|
jobSpecModal.init(onSave, closeModals);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function openJobSpecModal(asset: any, mode: 'view' | 'edit' | 'add' = 'view') {
|
||||||
|
jobSpecModal.open(asset, mode);
|
||||||
|
}
|
||||||
@@ -10,55 +10,57 @@ class UserModal extends BaseModal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected renderFrameHTML(): string {
|
protected renderFrameHTML(): string {
|
||||||
const sharedStyle = 'height: 38px !important; box-sizing: border-box !important; font-size: 13px; margin: 0;';
|
|
||||||
const inputStyle = sharedStyle;
|
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<div id="user-asset-modal" class="modal-overlay hidden">
|
<div id="user-asset-modal" class="modal-overlay hidden">
|
||||||
<div class="modal-content" style="max-width: 500px; width: 100%;">
|
<div class="modal-content narrow">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h2 id="user-modal-title" style="margin: 0; font-size: 18px; font-weight: 800; color: white;">\${this.title}</h2>
|
<div class="header-left">
|
||||||
<button id="btn-close-user-modal" class="btn-icon" aria-label="닫기" style="font-size: 28px; color: white; background: none; border: none; cursor: pointer; line-height: 1;">×</button>
|
<h2 id="user-modal-title" class="modal-title">${this.title}</h2>
|
||||||
|
<div id="user-header-identity" class="header-identity"></div>
|
||||||
|
</div>
|
||||||
|
<button id="btn-close-user-modal" class="btn-icon" aria-label="닫기">×</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body" style="padding: 24px; overflow-y: auto;">
|
<div class="modal-body">
|
||||||
<form id="user-asset-form" class="grid-form" style="display: flex; flex-direction: column; gap: 16px;">
|
<form id="user-asset-form" class="grid-form vertical-form">
|
||||||
<input type="hidden" id="user-id" name="id" />
|
<input type="hidden" id="user-id" name="id" />
|
||||||
|
|
||||||
<div class="form-group" style="display: flex; flex-direction: column; gap: 6px;">
|
<div class="form-group">
|
||||||
<label style="font-size: 11px; font-weight: 700; color: var(--text-muted);">사번</label>
|
<label>사번</label>
|
||||||
<input type="text" id="user-emp-no" name="emp_no" placeholder="예: HM202601" required style="\${inputStyle} width: 100%;" />
|
<input type="text" id="user-emp-no" name="emp_no" placeholder="예: HM202601" required />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" style="display: flex; flex-direction: column; gap: 6px;">
|
<div class="form-group">
|
||||||
<label style="font-size: 11px; font-weight: 700; color: var(--text-muted);">사용자명</label>
|
<label>사용자명</label>
|
||||||
<input type="text" id="user-name-input" name="user_name" placeholder="예: 홍길동" required style="\${inputStyle} width: 100%;" />
|
<input type="text" id="user-name-input" name="user_name" placeholder="예: 홍길동" required />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" style="display: flex; flex-direction: column; gap: 6px;">
|
<div class="form-group">
|
||||||
<label style="font-size: 11px; font-weight: 700; color: var(--text-muted);">사용조직 (부서)</label>
|
<label>사용조직 (부서)</label>
|
||||||
<input type="text" id="user-dept" name="dept_name" placeholder="예: 기술개발센터" required style="\${inputStyle} width: 100%;" />
|
<input type="text" id="user-dept" name="dept_name" placeholder="예: 기술개발센터" required />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" style="display: flex; flex-direction: column; gap: 6px;">
|
<div class="form-group">
|
||||||
<label style="font-size: 11px; font-weight: 700; color: var(--text-muted);">직무 (직급)</label>
|
<label>직무</label>
|
||||||
<input type="text" id="user-position-input" name="position" placeholder="예: BIM모델러" required style="\${inputStyle} width: 100%;" />
|
<select id="user-position-input" name="position" required>
|
||||||
|
<option value="">직무 선택</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" style="display: flex; flex-direction: column; gap: 6px;">
|
<div class="form-group">
|
||||||
<label style="font-size: 11px; font-weight: 700; color: var(--text-muted);">상태</label>
|
<label>상태</label>
|
||||||
<select id="user-status" name="status" style="\${sharedStyle}">
|
<select id="user-status" name="status">
|
||||||
<option value="재직">재직</option>
|
<option value="재직">재직</option>
|
||||||
<option value="퇴직">퇴직</option>
|
<option value="퇴직">퇴직</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer" style="display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: #f8fafc; border-top: 1px solid var(--border-color);">
|
<div class="modal-footer">
|
||||||
<button id="btn-delete-user-asset" class="btn btn-outline btn-danger" style="height: 42px;">삭제</button>
|
<button id="btn-delete-user-asset" class="btn btn-outline btn-danger">삭제</button>
|
||||||
<div class="footer-actions" style="display: flex; gap: 8px;">
|
<div class="footer-actions">
|
||||||
<button id="btn-revert-user-edit" class="btn btn-outline hidden" style="height: 42px;">수정 취소</button>
|
<button id="btn-revert-user-edit" class="btn btn-outline hidden">수정 취소</button>
|
||||||
<button id="btn-cancel-user-modal" class="btn btn-outline" style="height: 42px;">닫기</button>
|
<button id="btn-cancel-user-modal" class="btn btn-outline">닫기</button>
|
||||||
<button id="btn-save-user-asset" class="btn btn-primary" style="height: 42px;">수정</button>
|
<button id="btn-save-user-asset" class="btn btn-primary">수정</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -82,7 +84,7 @@ class UserModal extends BaseModal {
|
|||||||
const empNo = (document.getElementById('user-emp-no') as HTMLInputElement).value.trim();
|
const empNo = (document.getElementById('user-emp-no') as HTMLInputElement).value.trim();
|
||||||
const userName = (document.getElementById('user-name-input') as HTMLInputElement).value.trim();
|
const userName = (document.getElementById('user-name-input') as HTMLInputElement).value.trim();
|
||||||
const deptName = (document.getElementById('user-dept') as HTMLInputElement).value.trim();
|
const deptName = (document.getElementById('user-dept') as HTMLInputElement).value.trim();
|
||||||
const position = (document.getElementById('user-position-input') as HTMLInputElement).value.trim();
|
const position = (document.getElementById('user-position-input') as HTMLSelectElement).value.trim();
|
||||||
const status = (document.getElementById('user-status') as HTMLSelectElement).value;
|
const status = (document.getElementById('user-status') as HTMLSelectElement).value;
|
||||||
|
|
||||||
if (!empNo || !userName || !deptName || !position) {
|
if (!empNo || !userName || !deptName || !position) {
|
||||||
@@ -119,53 +121,75 @@ class UserModal extends BaseModal {
|
|||||||
onSave(); this.close(); closeModals();
|
onSave(); this.close(); closeModals();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
createIcons({ icons: { Save, X } });
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fillFormData(asset: any): void {
|
protected fillFormData(asset: any): void {
|
||||||
|
const positionSelect = document.getElementById('user-position-input') as HTMLSelectElement;
|
||||||
|
if (positionSelect) {
|
||||||
|
positionSelect.innerHTML = '<option value="">직무 선택</option>';
|
||||||
|
if (state.masterData.jobSpecs) {
|
||||||
|
state.masterData.jobSpecs.forEach((spec: any) => {
|
||||||
|
const option = document.createElement('option');
|
||||||
|
option.value = spec.job_name;
|
||||||
|
option.textContent = spec.job_name;
|
||||||
|
positionSelect.appendChild(option);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setFieldValue('user-id', asset.id || '');
|
setFieldValue('user-id', asset.id || '');
|
||||||
setFieldValue('user-emp-no', asset.emp_no || '');
|
setFieldValue('user-emp-no', asset.emp_no || '');
|
||||||
setFieldValue('user-name-input', asset.user_name || '');
|
setFieldValue('user-name-input', asset.user_name || '');
|
||||||
setFieldValue('user-dept', asset.dept_name || '');
|
setFieldValue('user-dept', asset.dept_name || '');
|
||||||
setFieldValue('user-position-input', asset.position || '');
|
setFieldValue('user-position-input', asset.position || '');
|
||||||
setFieldValue('user-status', asset.status || '재직');
|
setFieldValue('user-status', asset.status || '재직');
|
||||||
|
this.updateHeaderIdentity(asset);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected onAfterOpen(asset: any, mode: string): void {
|
protected onAfterOpen(asset: any, mode: string): void {
|
||||||
const titleEl = document.getElementById('user-modal-title');
|
const titleEl = document.getElementById('user-modal-title');
|
||||||
|
|
||||||
if (titleEl) {
|
if (titleEl) {
|
||||||
if (mode === 'add') {
|
titleEl.textContent = (mode === 'add') ? '신규 임직원 등록' : '임직원 정보 수정';
|
||||||
titleEl.textContent = '신규 임직원 등록';
|
|
||||||
} else {
|
|
||||||
titleEl.textContent = '임직원 정보 수정';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteBtn = document.getElementById('btn-delete-user-asset')!;
|
const deleteBtn = document.getElementById('btn-delete-user-asset')!;
|
||||||
const saveBtn = document.getElementById('btn-save-user-asset')!;
|
const saveBtn = document.getElementById('btn-save-user-asset')!;
|
||||||
|
|
||||||
deleteBtn.style.display = (mode === 'add') ? 'none' : 'block';
|
deleteBtn.style.display = (mode === 'add') ? 'none' : 'block';
|
||||||
|
|
||||||
if (mode === 'add') {
|
if (mode === 'add' || mode === 'edit') {
|
||||||
this.setEditLockMode('edit');
|
saveBtn.textContent = mode === 'add' ? '등록' : '저장';
|
||||||
this.isEditMode = true;
|
|
||||||
saveBtn.textContent = '등록';
|
|
||||||
saveBtn.style.display = 'block';
|
saveBtn.style.display = 'block';
|
||||||
} else {
|
} else {
|
||||||
this.setEditLockMode('view');
|
|
||||||
this.isEditMode = false;
|
|
||||||
saveBtn.textContent = '수정';
|
saveBtn.textContent = '수정';
|
||||||
saveBtn.style.display = 'block';
|
saveBtn.style.display = 'block';
|
||||||
}
|
}
|
||||||
|
this.updateHeaderIdentity(asset);
|
||||||
|
}
|
||||||
|
|
||||||
|
private updateHeaderIdentity(asset: any) {
|
||||||
|
const container = document.getElementById('user-header-identity');
|
||||||
|
if (!container) return;
|
||||||
|
|
||||||
|
if (this.currentMode === 'add') {
|
||||||
|
container.innerHTML = '<span class="badge badge-primary">신규 등록</span>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const empNo = asset.emp_no || '';
|
||||||
|
const userName = asset.user_name || '';
|
||||||
|
const dept = asset.dept_name || '';
|
||||||
|
|
||||||
|
container.innerHTML = `
|
||||||
|
<span class="asset-code-title">${userName}</span>
|
||||||
|
<span class="service-type-badge">${empNo}</span>
|
||||||
|
<span class="asset-type-label">${dept}</span>
|
||||||
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const userModal = new UserModal();
|
export const userModal = new UserModal();
|
||||||
|
export function initUserModal(onSave: () => void, closeModals: () => void) { userModal.init(onSave, closeModals); }
|
||||||
export function initUserModal(onSave: () => void, closeModals: () => void) {
|
export function openUserModal(asset: any, mode: 'view' | 'edit' | 'add' = 'view') { userModal.open(asset, mode); }
|
||||||
userModal.init(onSave, closeModals);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function openUserModal(asset: any, mode: 'view' | 'edit' | 'add' = 'view') {
|
|
||||||
userModal.open(asset, mode);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { ASSET_SCHEMA, UI_TEXT } from './schema';
|
import { ASSET_SCHEMA, UI_TEXT } from './schema';
|
||||||
import { getActionButtonsHTML } from './utils';
|
|
||||||
import { generateOptionsHTML } from '../components/Modal/ModalUtils';
|
import { generateOptionsHTML } from '../components/Modal/ModalUtils';
|
||||||
import { CORP_LIST } from '../components/Modal/SharedData';
|
import { CORP_LIST } from '../components/Modal/SharedData';
|
||||||
|
|
||||||
@@ -16,9 +15,18 @@ export interface FilterOptions {
|
|||||||
showField?: boolean;
|
showField?: boolean;
|
||||||
showType?: boolean;
|
showType?: boolean;
|
||||||
showStatus?: boolean;
|
showStatus?: boolean;
|
||||||
|
showPosition?: boolean;
|
||||||
extraHTML?: string;
|
extraHTML?: string;
|
||||||
onFilterChange: (filters: any) => void;
|
onFilterChange: (filters: any) => void;
|
||||||
initialFilters?: any;
|
initialFilters?: any;
|
||||||
|
fullList?: any[]; // For populating dynamic filters
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 전역 액션 버튼 그룹 생성 (자산 추가 등)
|
||||||
|
*/
|
||||||
|
export function getActionButtonsHTML(): string {
|
||||||
|
return `<div id="filter-bar-actions" class="header-action-group"></div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function renderFilterBar(container: HTMLElement, options: FilterOptions) {
|
export function renderFilterBar(container: HTMLElement, options: FilterOptions) {
|
||||||
@@ -30,11 +38,31 @@ export function renderFilterBar(container: HTMLElement, options: FilterOptions)
|
|||||||
showField = false,
|
showField = false,
|
||||||
showType = false,
|
showType = false,
|
||||||
showStatus = false,
|
showStatus = false,
|
||||||
|
showPosition = false,
|
||||||
extraHTML = '',
|
extraHTML = '',
|
||||||
onFilterChange,
|
onFilterChange,
|
||||||
initialFilters = { keyword: '', corp: '', dept: '', loc: '', field: '', type: '', status: '' }
|
initialFilters = { keyword: '', corp: '', dept: '', loc: '', field: '', type: '', status: '', position: '' },
|
||||||
|
fullList = []
|
||||||
} = options;
|
} = options;
|
||||||
|
|
||||||
|
container.classList.add('search-bar'); // Restored class
|
||||||
|
|
||||||
|
// Helper to get unique sorted values
|
||||||
|
const getUnique = (key: keyof typeof ASSET_SCHEMA | string) => {
|
||||||
|
const schemaItem = (ASSET_SCHEMA as any)[key];
|
||||||
|
const fieldKey = schemaItem ? schemaItem.key : key;
|
||||||
|
const dbKey = schemaItem ? schemaItem.db : null;
|
||||||
|
return Array.from(new Set(fullList.map(item => {
|
||||||
|
const val = item[fieldKey];
|
||||||
|
if (val !== undefined && val !== null) return val;
|
||||||
|
if (dbKey) return item[dbKey];
|
||||||
|
return null;
|
||||||
|
}).filter(Boolean))).sort() as string[];
|
||||||
|
};
|
||||||
|
|
||||||
|
const hasDeptName = fullList.some(item => 'dept_name' in item);
|
||||||
|
const deptUniqueKey = hasDeptName ? 'dept_name' : 'CURRENT_DEPT';
|
||||||
|
|
||||||
container.innerHTML = `
|
container.innerHTML = `
|
||||||
<div class="search-item flex-1">
|
<div class="search-item flex-1">
|
||||||
<label>${keywordLabel}</label>
|
<label>${keywordLabel}</label>
|
||||||
@@ -45,6 +73,7 @@ export function renderFilterBar(container: HTMLElement, options: FilterOptions)
|
|||||||
<label>${ASSET_SCHEMA.ASSET_TYPE.ui}</label>
|
<label>${ASSET_SCHEMA.ASSET_TYPE.ui}</label>
|
||||||
<select id="filter-type">
|
<select id="filter-type">
|
||||||
<option value="">전체 유형</option>
|
<option value="">전체 유형</option>
|
||||||
|
${getUnique('ASSET_TYPE').map(v => `<option value="${v}" ${initialFilters.type === v ? 'selected' : ''}>${v}</option>`).join('')}
|
||||||
</select>
|
</select>
|
||||||
</div>` : ''}
|
</div>` : ''}
|
||||||
${showStatus ? `
|
${showStatus ? `
|
||||||
@@ -52,6 +81,7 @@ export function renderFilterBar(container: HTMLElement, options: FilterOptions)
|
|||||||
<label>${ASSET_SCHEMA.HW_STATUS.ui}</label>
|
<label>${ASSET_SCHEMA.HW_STATUS.ui}</label>
|
||||||
<select id="filter-status">
|
<select id="filter-status">
|
||||||
<option value="">전체 상태</option>
|
<option value="">전체 상태</option>
|
||||||
|
${getUnique('HW_STATUS').map(v => `<option value="${v}" ${initialFilters.status === v ? 'selected' : ''}>${v}</option>`).join('')}
|
||||||
</select>
|
</select>
|
||||||
</div>` : ''}
|
</div>` : ''}
|
||||||
${showField ? `
|
${showField ? `
|
||||||
@@ -73,16 +103,30 @@ export function renderFilterBar(container: HTMLElement, options: FilterOptions)
|
|||||||
${showLoc ? `
|
${showLoc ? `
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<label>${ASSET_SCHEMA.LOCATION.ui}</label>
|
<label>${ASSET_SCHEMA.LOCATION.ui}</label>
|
||||||
<select id="filter-loc"><option value="">전체 위치</option></select>
|
<select id="filter-loc">
|
||||||
|
<option value="">전체 위치</option>
|
||||||
|
${getUnique('LOCATION').map(v => `<option value="${v}" ${initialFilters.loc === v ? 'selected' : ''}>${v}</option>`).join('')}
|
||||||
|
</select>
|
||||||
</div>` : ''}
|
</div>` : ''}
|
||||||
${showDept ? `
|
${showDept ? `
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<label>${ASSET_SCHEMA.CURRENT_DEPT.ui}</label>
|
<label>조직</label>
|
||||||
<select id="filter-dept"><option value="">전체 조직</option></select>
|
<select id="filter-dept">
|
||||||
|
<option value="">전체 조직</option>
|
||||||
|
${getUnique(deptUniqueKey).map(v => `<option value="${v}" ${initialFilters.dept === v ? 'selected' : ''}>${v}</option>`).join('')}
|
||||||
|
</select>
|
||||||
|
</div>` : ''}
|
||||||
|
${showPosition ? `
|
||||||
|
<div class="search-item">
|
||||||
|
<label>직무</label>
|
||||||
|
<select id="filter-position">
|
||||||
|
<option value="">전체 직무</option>
|
||||||
|
${getUnique('position').map(v => `<option value="${v}" ${initialFilters.position === v ? 'selected' : ''}>${v}</option>`).join('')}
|
||||||
|
</select>
|
||||||
</div>` : ''}
|
</div>` : ''}
|
||||||
${extraHTML}
|
${extraHTML}
|
||||||
<button id="btn-reset-filters" class="btn btn-outline btn-reset">
|
<button id="btn-reset-filters" class="btn btn-outline btn-reset">
|
||||||
<i data-lucide="refresh-ccw"></i> ${UI_TEXT.ACTION.RESET_FILTER}
|
<i data-lucide="refresh-ccw" class="icon-sm"></i> ${UI_TEXT.ACTION.RESET_FILTER}
|
||||||
</button>
|
</button>
|
||||||
${getActionButtonsHTML()}
|
${getActionButtonsHTML()}
|
||||||
`;
|
`;
|
||||||
@@ -96,7 +140,8 @@ export function renderFilterBar(container: HTMLElement, options: FilterOptions)
|
|||||||
loc: (container.querySelector('#filter-loc') as HTMLSelectElement)?.value || '',
|
loc: (container.querySelector('#filter-loc') as HTMLSelectElement)?.value || '',
|
||||||
field: (container.querySelector('#filter-field') as HTMLSelectElement)?.value || '',
|
field: (container.querySelector('#filter-field') as HTMLSelectElement)?.value || '',
|
||||||
type: (container.querySelector('#filter-type') as HTMLSelectElement)?.value || '',
|
type: (container.querySelector('#filter-type') as HTMLSelectElement)?.value || '',
|
||||||
status: (container.querySelector('#filter-status') as HTMLSelectElement)?.value || ''
|
status: (container.querySelector('#filter-status') as HTMLSelectElement)?.value || '',
|
||||||
|
position: (container.querySelector('#filter-position') as HTMLSelectElement)?.value || ''
|
||||||
};
|
};
|
||||||
onFilterChange(filters);
|
onFilterChange(filters);
|
||||||
};
|
};
|
||||||
@@ -108,9 +153,10 @@ export function renderFilterBar(container: HTMLElement, options: FilterOptions)
|
|||||||
container.querySelector('#filter-field')?.addEventListener('change', triggerChange);
|
container.querySelector('#filter-field')?.addEventListener('change', triggerChange);
|
||||||
container.querySelector('#filter-type')?.addEventListener('change', triggerChange);
|
container.querySelector('#filter-type')?.addEventListener('change', triggerChange);
|
||||||
container.querySelector('#filter-status')?.addEventListener('change', triggerChange);
|
container.querySelector('#filter-status')?.addEventListener('change', triggerChange);
|
||||||
|
container.querySelector('#filter-position')?.addEventListener('change', triggerChange);
|
||||||
|
|
||||||
container.querySelector('#btn-reset-filters')?.addEventListener('click', () => {
|
container.querySelector('#btn-reset-filters')?.addEventListener('click', () => {
|
||||||
['filter-keyword', 'filter-corp', 'filter-dept', 'filter-loc', 'filter-field', 'filter-type', 'filter-status'].forEach(id => {
|
['filter-keyword', 'filter-corp', 'filter-dept', 'filter-loc', 'filter-field', 'filter-type', 'filter-status', 'filter-position'].forEach(id => {
|
||||||
const el = container.querySelector(`#${id}`);
|
const el = container.querySelector(`#${id}`);
|
||||||
if (el) (el as any).value = '';
|
if (el) (el as any).value = '';
|
||||||
});
|
});
|
||||||
@@ -121,18 +167,37 @@ export function renderFilterBar(container: HTMLElement, options: FilterOptions)
|
|||||||
/**
|
/**
|
||||||
* 공통 필터링 로직
|
* 공통 필터링 로직
|
||||||
*/
|
*/
|
||||||
export function applyCommonFilters(list: any[], filters: any, searchKeys: (keyof typeof ASSET_SCHEMA)[]) {
|
export function applyCommonFilters(list: any[], filters: any, searchKeys: any[]) {
|
||||||
return list.filter(item => {
|
return list.filter(item => {
|
||||||
const matchKeyword = !filters.keyword || searchKeys.some(key =>
|
// 1. 키워드 검색
|
||||||
String(item[ASSET_SCHEMA[key].key] || item[ASSET_SCHEMA[key].db] || '').toLowerCase().includes(filters.keyword)
|
const matchKeyword = !filters.keyword || searchKeys.some(key => {
|
||||||
);
|
const schemaItem = (ASSET_SCHEMA as any)[key];
|
||||||
|
if (schemaItem) {
|
||||||
|
return String(item[schemaItem.key] || item[schemaItem.db] || '').toLowerCase().includes(filters.keyword);
|
||||||
|
}
|
||||||
|
return String(item[key] || '').toLowerCase().includes(filters.keyword);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 2. 부서 필터링 (사용자 페이지 dept_name, 자산 페이지 current_dept)
|
||||||
|
let matchDept = true;
|
||||||
|
if (filters.dept) {
|
||||||
|
const itemDept = item.dept_name || item[ASSET_SCHEMA.CURRENT_DEPT.key] || item[ASSET_SCHEMA.CURRENT_DEPT.db];
|
||||||
|
matchDept = itemDept === filters.dept;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 직무 필터링
|
||||||
|
let matchPosition = true;
|
||||||
|
if (filters.position) {
|
||||||
|
matchPosition = item.position === filters.position;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 나머지 필터링
|
||||||
const matchCorp = !filters.corp || (item[ASSET_SCHEMA.PURCHASE_CORP.key] || item[ASSET_SCHEMA.PURCHASE_CORP.db]) === filters.corp;
|
const matchCorp = !filters.corp || (item[ASSET_SCHEMA.PURCHASE_CORP.key] || item[ASSET_SCHEMA.PURCHASE_CORP.db]) === filters.corp;
|
||||||
const matchDept = !filters.dept || (item[ASSET_SCHEMA.CURRENT_DEPT.key] || item[ASSET_SCHEMA.CURRENT_DEPT.db]) === filters.dept;
|
|
||||||
const matchLoc = !filters.loc || (item[ASSET_SCHEMA.LOCATION.key] || item[ASSET_SCHEMA.LOCATION.db]) === filters.loc;
|
const matchLoc = !filters.loc || (item[ASSET_SCHEMA.LOCATION.key] || item[ASSET_SCHEMA.LOCATION.db]) === filters.loc;
|
||||||
const matchField = !filters.field || (item[ASSET_SCHEMA.SW_FIELD.key] || item[ASSET_SCHEMA.SW_FIELD.db]) === filters.field;
|
const matchField = !filters.field || (item[ASSET_SCHEMA.SW_FIELD.key] || item[ASSET_SCHEMA.SW_FIELD.db]) === filters.field;
|
||||||
const matchType = !filters.type || (item[ASSET_SCHEMA.ASSET_TYPE.key] || item[ASSET_SCHEMA.ASSET_TYPE.db]) === filters.type;
|
const matchType = !filters.type || (item[ASSET_SCHEMA.ASSET_TYPE.key] || item[ASSET_SCHEMA.ASSET_TYPE.db]) === filters.type;
|
||||||
const matchStatus = !filters.status || (item[ASSET_SCHEMA.HW_STATUS.key] || item[ASSET_SCHEMA.HW_STATUS.db]) === filters.status;
|
const matchStatus = !filters.status || (item[ASSET_SCHEMA.HW_STATUS.key] || item[ASSET_SCHEMA.HW_STATUS.db]) === filters.status;
|
||||||
|
|
||||||
return matchKeyword && matchCorp && matchDept && matchLoc && matchField && matchType && matchStatus;
|
return matchKeyword && matchCorp && matchDept && matchLoc && matchField && matchType && matchStatus && matchPosition;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,6 +160,16 @@ export const PAGE_DESCRIPTIONS: Record<string, { title: string; description: str
|
|||||||
title: '임직원 사용자 관리',
|
title: '임직원 사용자 관리',
|
||||||
description: 'IT 자산 할당 및 관리의 기준이 되는 사내 임직원(사용자) 정보를 데이터베이스 기반으로 직접 등록하고 수정합니다.',
|
description: 'IT 자산 할당 및 관리의 기준이 되는 사내 임직원(사용자) 정보를 데이터베이스 기반으로 직접 등록하고 수정합니다.',
|
||||||
icon: 'users'
|
icon: 'users'
|
||||||
|
},
|
||||||
|
'부품 마스터': {
|
||||||
|
title: '부품 표준 정보 관리',
|
||||||
|
description: 'PC 사양 적정성 평가의 기준이 되는 부품 표준 정보 및 등급별 감점 점수를 관리합니다.',
|
||||||
|
icon: 'cpu'
|
||||||
|
},
|
||||||
|
'직무별 기준 사양': {
|
||||||
|
title: '직무별 기준 사양 관리',
|
||||||
|
description: 'BIM 모델러, 개발자, 엔지니어 등 사내 직무별 권장 하드웨어 기준 및 성능 합격 점수를 관리합니다.',
|
||||||
|
icon: 'sliders'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export interface MasterAssetData {
|
|||||||
vip: any[];
|
vip: any[];
|
||||||
mobile?: any[]; // Legacy mobile support
|
mobile?: any[]; // Legacy mobile support
|
||||||
equip?: any[]; // Backward compat
|
equip?: any[]; // Backward compat
|
||||||
|
jobSpecs?: any[];
|
||||||
|
|
||||||
// Backward compatibility
|
// Backward compatibility
|
||||||
subSw: any[];
|
subSw: any[];
|
||||||
@@ -61,7 +62,8 @@ export const state: AppState = {
|
|||||||
cost: [], vip: [],
|
cost: [], vip: [],
|
||||||
subSw: [], permSw: [],
|
subSw: [], permSw: [],
|
||||||
hw: [], sw: [],
|
hw: [], sw: [],
|
||||||
swUsers: [], logs: []
|
swUsers: [], logs: [],
|
||||||
|
jobSpecs: []
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -79,6 +81,7 @@ export async function loadMasterDataFromDB() {
|
|||||||
state.masterData = {
|
state.masterData = {
|
||||||
...state.masterData,
|
...state.masterData,
|
||||||
...data,
|
...data,
|
||||||
|
jobSpecs: data.jobSpecs || [],
|
||||||
logs: (data.logs || []).map((l: any) => ({
|
logs: (data.logs || []).map((l: any) => ({
|
||||||
...l,
|
...l,
|
||||||
assetId: l.asset_id || l.assetId,
|
assetId: l.asset_id || l.assetId,
|
||||||
@@ -229,3 +232,38 @@ export async function deleteSystemUser(id: string) {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function saveJobSpec(spec: any) {
|
||||||
|
try {
|
||||||
|
const url = `${API_BASE_URL}/api/job-specs/save`;
|
||||||
|
const response = await fetch(url, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify(spec)
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.ok) {
|
||||||
|
await loadMasterDataFromDB(); // 전역 상태 갱신
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('직무별 기준 사양 저장 실패:', err);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function deleteJobSpec(id: number) {
|
||||||
|
try {
|
||||||
|
const url = `${API_BASE_URL}/api/job-specs/${id}`;
|
||||||
|
const response = await fetch(url, { method: 'DELETE' });
|
||||||
|
|
||||||
|
if (response.ok) {
|
||||||
|
await loadMasterDataFromDB(); // 전역 상태 갱신
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('직무별 기준 사양 삭제 실패:', err);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -242,7 +242,8 @@ export function calculatePcScoreDeductive(cpu: string, ram: string, gpu: string,
|
|||||||
gpuDeduction = 0;
|
gpuDeduction = 0;
|
||||||
} else if (
|
} else if (
|
||||||
gpuUpper.includes('RTX 3070') || gpuUpper.includes('RTX 3060') || gpuUpper.includes('RTX 2060') ||
|
gpuUpper.includes('RTX 3070') || gpuUpper.includes('RTX 3060') || gpuUpper.includes('RTX 2060') ||
|
||||||
gpuUpper.includes('RTX A2000') || gpuUpper.includes('RTX A3000') || gpuUpper.includes('QUADRO')
|
gpuUpper.includes('RTX A2000') || gpuUpper.includes('RTX A3000') || gpuUpper.includes('QUADRO') ||
|
||||||
|
gpuUpper.includes('RTX 4060') || gpuUpper.includes('RTX 4050')
|
||||||
) {
|
) {
|
||||||
gpuDeduction = 5;
|
gpuDeduction = 5;
|
||||||
} else if (
|
} else if (
|
||||||
@@ -288,11 +289,14 @@ export function calculatePcScoreDeductive(cpu: string, ram: string, gpu: string,
|
|||||||
/**
|
/**
|
||||||
* 성능 점수 기준 등급 뱃지 메타 정보 가져오기
|
* 성능 점수 기준 등급 뱃지 메타 정보 가져오기
|
||||||
*/
|
*/
|
||||||
export function getPcGrade(score: number): { name: string; class: string; color: string } {
|
export function getPcGrade(score: number, isWin11Incompatible?: boolean): { name: string; class: string; color: string } {
|
||||||
|
// Windows 11 업그레이드 불가 PC는 성능 점수와 무관하게 교체 대상으로 분류
|
||||||
|
if (isWin11Incompatible) return { name: '교체 대상', class: 'badge-danger', color: '#EF4444' };
|
||||||
if (score >= 85) return { name: '최상급', class: 'b-purple', color: '#7C3AED' };
|
if (score >= 85) return { name: '최상급', class: 'b-purple', color: '#7C3AED' };
|
||||||
if (score >= 70) return { name: '상급', class: 'b-primary', color: '#4F46E5' };
|
if (score >= 70) return { name: '상급', class: 'b-primary', color: '#4F46E5' };
|
||||||
if (score >= 40) return { name: '중급', class: 'b-green', color: '#10B981' };
|
if (score >= 40) return { name: '중급', class: 'b-green', color: '#10B981' };
|
||||||
return { name: '보급', class: 'b-yellow', color: '#F59E0B' };
|
if (score >= 20) return { name: '보급', class: 'b-yellow', color: '#F59E0B' };
|
||||||
|
return { name: '교체 대상', class: 'badge-danger', color: '#EF4444' };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ import { initSwModal, openSwModal } from './components/Modal/SWModal';
|
|||||||
import { initSwUserModal } from './components/Modal/SWUserModal';
|
import { initSwUserModal } from './components/Modal/SWUserModal';
|
||||||
import { initDomainModal, openDomainModal } from './components/Modal/DomainModal';
|
import { initDomainModal, openDomainModal } from './components/Modal/DomainModal';
|
||||||
import { initPartsMasterModal, openPartsMasterModal } from './components/Modal/PartsMasterModal';
|
import { initPartsMasterModal, openPartsMasterModal } from './components/Modal/PartsMasterModal';
|
||||||
|
import { initJobSpecModal, openJobSpecModal } from './components/Modal/JobSpecModal';
|
||||||
import { initUserModal, openUserModal } from './components/Modal/UserModal';
|
import { initUserModal, openUserModal } from './components/Modal/UserModal';
|
||||||
|
import { activePartsMasterSubTab } from './views/List/PartsMasterListView';
|
||||||
import { initDashboardDetailModal } from './components/Modal/DashboardDetailModal';
|
import { initDashboardDetailModal } from './components/Modal/DashboardDetailModal';
|
||||||
import { initGuide } from './components/Guide';
|
import { initGuide } from './components/Guide';
|
||||||
import { pcFlowModal } from './components/Modal/PCFlowModal';
|
import { pcFlowModal } from './components/Modal/PCFlowModal';
|
||||||
@@ -85,6 +87,7 @@ function initApp() {
|
|||||||
}, closeAllModals);
|
}, closeAllModals);
|
||||||
initDomainModal(() => refreshAllData(), closeAllModals);
|
initDomainModal(() => refreshAllData(), closeAllModals);
|
||||||
initPartsMasterModal(() => refreshAllData(), closeAllModals);
|
initPartsMasterModal(() => refreshAllData(), closeAllModals);
|
||||||
|
initJobSpecModal(() => refreshAllData(), closeAllModals);
|
||||||
initUserModal(() => refreshAllData(), closeAllModals);
|
initUserModal(() => refreshAllData(), closeAllModals);
|
||||||
|
|
||||||
initDashboardDetailModal();
|
initDashboardDetailModal();
|
||||||
@@ -114,7 +117,11 @@ function initApp() {
|
|||||||
|
|
||||||
if (cat === 'hw') {
|
if (cat === 'hw') {
|
||||||
if (tab === '부품 마스터') {
|
if (tab === '부품 마스터') {
|
||||||
openPartsMasterModal({ id: '' } as any, 'add');
|
if (activePartsMasterSubTab === 'job-spec') {
|
||||||
|
openJobSpecModal({ id: '' } as any, 'add');
|
||||||
|
} else {
|
||||||
|
openPartsMasterModal({ id: '' } as any, 'add');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
openHwModal({ id: newId, asset_code: '', category: tab } as any, 'add');
|
openHwModal({ id: newId, asset_code: '', category: tab } as any, 'add');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,51 +1,48 @@
|
|||||||
:root {
|
:root {
|
||||||
/* --- System Colors --- */
|
/* --- Vercel Stark Palette --- */
|
||||||
--color-red: #F21D0D;
|
--primary: #171717;
|
||||||
--color-pink: #E8175E;
|
--on-primary: #ffffff;
|
||||||
--color-magenta: #B92ED1;
|
--body: #4d4d4d;
|
||||||
--color-purple: #6D3DC2;
|
--mute: #888888;
|
||||||
--color-navy: #4255bd;
|
--hairline: #ebebeb;
|
||||||
--color-blue: #0D8DF2;
|
--hairline-strong: #a1a1a1;
|
||||||
--color-cyan: #03AEFC;
|
--canvas: #ffffff;
|
||||||
--color-green: #4DB251;
|
--canvas-soft: #fafafa;
|
||||||
--color-yellow: #FFBF00;
|
--canvas-soft-2: #f5f5f5;
|
||||||
--color-orange: #FF9800;
|
|
||||||
--color-dahong: #FF3D00;
|
/* --- Brand Accents --- */
|
||||||
--color-brown: #A0705F;
|
--color-blue: #0070f3;
|
||||||
--color-iron: #7F7F7F;
|
--color-cyan: #50e3c2;
|
||||||
--color-steel: #688897;
|
--color-pink: #ff0080;
|
||||||
|
--color-violet: #7928ca;
|
||||||
|
--color-orange: #f5a623;
|
||||||
|
|
||||||
/* --- Primary Brand Levels --- */
|
/* --- Semantic Alignment --- */
|
||||||
--primary-lv-0: #E9EEED;
|
--primary-color: var(--primary);
|
||||||
--primary-lv-1: #D2DCDB;
|
--primary-hover: #000000;
|
||||||
--primary-lv-2: #A5B9B6;
|
--primary-light: var(--canvas-soft-2);
|
||||||
--primary-lv-3: #789792;
|
--text-main: var(--primary);
|
||||||
--primary-lv-4: #4B746D;
|
--text-muted: var(--body);
|
||||||
--primary-lv-5: #35635C;
|
--border-color: var(--hairline);
|
||||||
--primary-lv-6: #1E5149;
|
--bg-color: var(--canvas-soft);
|
||||||
--primary-lv-7: #1B443D;
|
--bg-light: var(--canvas-soft-2);
|
||||||
--primary-lv-8: #193833;
|
|
||||||
--primary-lv-9: #162A27;
|
|
||||||
|
|
||||||
/* --- Semantic Colors --- */
|
|
||||||
--primary-color: var(--primary-lv-6);
|
|
||||||
--primary-hover: var(--primary-lv-5);
|
|
||||||
--primary-light: var(--primary-lv-0);
|
|
||||||
|
|
||||||
--edit-mode-color: var(--color-dahong);
|
|
||||||
--edit-mode-light: rgba(255, 61, 0, 0.1);
|
|
||||||
--edit-mode-focus: rgba(255, 61, 0, 0.3);
|
|
||||||
--edit-mode-dark: #cc3100;
|
|
||||||
|
|
||||||
--text-main: #111827;
|
|
||||||
--text-muted: #6B7280;
|
|
||||||
--border-color: #E5E7EB;
|
|
||||||
--bg-color: #F9FAFB;
|
|
||||||
--bg-light: #FAFAFA;
|
|
||||||
--white: #FFFFFF;
|
--white: #FFFFFF;
|
||||||
--danger: var(--color-red);
|
--danger: #ee0000;
|
||||||
--success: var(--color-green);
|
--success: #0070f3;
|
||||||
--header-height: 52px;
|
--header-height: 64px;
|
||||||
|
|
||||||
|
/* --- Global Typography Scale (Tighter Clamps) --- */
|
||||||
|
--fs-xs: clamp(10px, 1vmin + 0.1vw, 13px);
|
||||||
|
--fs-sm: clamp(12px, 1.2vmin + 0.2vw, 15px);
|
||||||
|
--fs-base: clamp(13px, 1.4vmin + 0.2vw, 16px);
|
||||||
|
--fs-md: clamp(16px, 2vmin + 0.3vw, 24px);
|
||||||
|
--fs-lg: clamp(20px, 3vmin + 0.4vw, 32px);
|
||||||
|
--fs-xl: clamp(28px, 5vmin + 0.6vw, 48px);
|
||||||
|
|
||||||
|
/* --- Layout Units --- */
|
||||||
|
--header-height: 64px;
|
||||||
|
--spacing-base: 1.5rem;
|
||||||
|
--radius-base: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
@@ -56,12 +53,26 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: 'Pretendard Variable', Pretendard, sans-serif;
|
font-family: 'Pretendard Variable', 'Pretendard', -apple-system, sans-serif;
|
||||||
color: var(--text-main);
|
color: var(--text-main);
|
||||||
background-color: var(--bg-color);
|
background-color: var(--bg-color);
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
font-size: 14px;
|
font-size: var(--fs-base);
|
||||||
|
height: 100vh;
|
||||||
|
width: 100vw;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
input, textarea {
|
||||||
|
-webkit-user-select: text;
|
||||||
|
-moz-user-select: text;
|
||||||
|
-ms-user-select: text;
|
||||||
|
user-select: text;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-layout {
|
.app-layout {
|
||||||
@@ -69,67 +80,52 @@ body {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- Header --- */
|
/* --- Header --- */
|
||||||
.main-header {
|
.main-header {
|
||||||
background-color: var(--white);
|
background-color: var(--canvas);
|
||||||
border-bottom: 1px solid var(--border-color);
|
border-bottom: 1px solid var(--border-color);
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
height: var(--header-height);
|
height: var(--header-height);
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
|
||||||
|
|
||||||
.header-container {
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 1.5rem;
|
padding: 0 1.5rem;
|
||||||
gap: 1.5rem;
|
}
|
||||||
|
|
||||||
|
.header-container {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.brand { display: flex; align-items: center; gap: 0.75rem; }
|
.brand { display: flex; align-items: center; gap: 0.75rem; }
|
||||||
.main-logo { height: 34px; width: auto; }
|
.main-logo { height: clamp(28px, 4vmin, 40px); width: auto; }
|
||||||
.brand h1 { font-size: 1.1rem; font-weight: 800; color: var(--text-main); white-space: nowrap; }
|
.brand h1 { font-size: clamp(0.85rem, 1.4vmin, 1.05rem); font-weight: 600; color: var(--text-main); }
|
||||||
.brand h1 .sub-title { font-size: 0.85rem; color: var(--primary-color); font-weight: 600; margin-left: 0.25rem; }
|
|
||||||
|
|
||||||
.integrated-nav { flex: 1; height: 100%; display: flex; align-items: center; gap: 0.25rem; overflow: hidden; }
|
.integrated-nav { flex: 1; display: flex; align-items: center; margin-left: 2rem; gap: 0.5rem; }
|
||||||
.nav-group { display: flex; align-items: center; height: 100%; position: relative; flex-shrink: 0; }
|
.gnb-trigger {
|
||||||
.gnb-trigger { font-size: 14px; font-weight: 700; color: var(--text-muted); padding: 0 0.75rem; cursor: pointer; height: 100%; display: flex; align-items: center; white-space: nowrap; transition: color 0.2s; }
|
font-size: var(--fs-xs);
|
||||||
.nav-group.active .gnb-trigger, .nav-group:hover .gnb-trigger { color: var(--text-main); }
|
font-weight: 500;
|
||||||
.lnb-shelf { display: none; align-items: center; gap: 0.2rem; padding: 0 0.5rem; height: 60%; border-left: 1px solid var(--border-color); margin-left: 0.2rem; }
|
color: var(--text-muted);
|
||||||
|
padding: 0.4rem 0.75rem;
|
||||||
/* 기본적으로 활성 탭의 서브메뉴 표시 */
|
cursor: pointer;
|
||||||
.nav-group.active.is-showing-shelf .lnb-shelf { display: flex; }
|
border-radius: 9999px;
|
||||||
|
transition: all 0.2s;
|
||||||
/* GNB 전체 영역에 마우스가 올라가면 활성 탭의 서브메뉴를 일단 숨김 (다른 메뉴 탐색 우선) */
|
}
|
||||||
.integrated-nav:hover .nav-group.active.is-showing-shelf .lnb-shelf { display: none; }
|
.gnb-trigger:hover { color: var(--text-main); background: var(--canvas-soft-2); }
|
||||||
|
.gnb-trigger.active { color: var(--text-main); font-weight: 600; background: var(--canvas-soft-2); }
|
||||||
/* 마우스가 올라간 메뉴의 서브메뉴만 표시 */
|
|
||||||
.nav-group:hover .lnb-shelf { display: flex !important; }
|
|
||||||
|
|
||||||
.lnb-item { font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; padding: 0.2rem 0.6rem; border-radius: 4px; white-space: nowrap; transition: all 0.2s; }
|
|
||||||
.lnb-item:hover { color: var(--primary-color); background-color: var(--primary-light); }
|
|
||||||
.lnb-item.active { color: var(--primary-color); background-color: var(--primary-light); font-weight: 700; }
|
|
||||||
|
|
||||||
.header-actions { display: flex; align-items: center; gap: 1rem; }
|
|
||||||
.role-switcher { display: flex; align-items: center; gap: 0.75rem; padding: 0 0.75rem; border-right: 1px solid var(--border-color); height: 24px; }
|
|
||||||
.role-label { font-size: 11px; font-weight: 700; color: var(--text-muted); }
|
|
||||||
.role-label.active { color: var(--primary-color); }
|
|
||||||
.switch { position: relative; display: inline-block; width: 34px; height: 18px; }
|
|
||||||
.switch input { opacity: 0; width: 0; height: 0; }
|
|
||||||
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
|
|
||||||
.slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
|
|
||||||
input:checked + .slider { background-color: var(--color-orange); }
|
|
||||||
input:checked + .slider:before { transform: translateX(16px); }
|
|
||||||
|
|
||||||
/* --- Layout Content --- */
|
/* --- Layout Content --- */
|
||||||
.content-area {
|
.content-area {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 1.25rem 2rem 0;
|
padding: 0;
|
||||||
overflow: hidden;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.view-container {
|
.view-container {
|
||||||
@@ -142,163 +138,507 @@ input:checked + .slider:before { transform: translateX(16px); }
|
|||||||
|
|
||||||
.view-content-wrapper {
|
.view-content-wrapper {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow-y: auto;
|
display: flex;
|
||||||
padding-bottom: 2rem;
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- View Toggle --- */
|
/* --- View Toggle (Vercel Tab Style) --- */
|
||||||
.view-toggle-container { margin-bottom: 1rem; display: flex; justify-content: flex-start; }
|
.view-toggle {
|
||||||
.view-toggle { display: inline-flex; background-color: var(--primary-lv-0); padding: 4px; border-radius: 8px; border: 1px solid var(--border-color); }
|
display: inline-flex;
|
||||||
.toggle-btn { padding: 6px 16px; font-size: 13px; font-weight: 600; color: var(--text-muted); background: none; border: none; border-radius: 6px; cursor: pointer; }
|
background: var(--canvas-soft-2);
|
||||||
.toggle-btn.active { background-color: var(--white); color: var(--primary-color); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
|
padding: 0.2rem;
|
||||||
|
border: 1px solid var(--hairline);
|
||||||
|
gap: 0.1rem;
|
||||||
|
border-radius: var(--radius-base);
|
||||||
|
}
|
||||||
|
|
||||||
/* --- System Status List (Docker Style) --- */
|
.toggle-btn {
|
||||||
.system-status-list { display: flex; flex-direction: column; gap: 0.5rem; }
|
padding: 0.35rem 1rem;
|
||||||
.system-list-header { display: flex; align-items: center; padding: 0.75rem 1.25rem; background-color: var(--bg-light); border-bottom: 1px solid var(--border-color); font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
|
border: none;
|
||||||
.system-row { display: flex; align-items: center; padding: 1rem 1.25rem; background-color: var(--white); border: 1px solid var(--border-color); border-radius: 6px; transition: all 0.2s; }
|
background: transparent;
|
||||||
.system-row:hover { border-color: var(--primary-lv-3); box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
|
font-size: var(--fs-xs);
|
||||||
.col-status { width: 100px; display: flex; align-items: center; gap: 0.5rem; }
|
font-weight: 500;
|
||||||
.col-info { flex: 1.5; }
|
color: var(--text-muted);
|
||||||
.col-network { flex: 1; }
|
cursor: pointer;
|
||||||
.col-remote { flex: 1; display: flex; align-items: center; gap: 0.5rem; }
|
transition: all 0.1s;
|
||||||
.col-traffic { flex: 1.2; }
|
border-radius: calc(var(--radius-base) - 2px);
|
||||||
.col-actions { width: 120px; display: flex; justify-content: flex-end; }
|
}
|
||||||
.status-dot { width: 10px; height: 10px; border-radius: 50%; }
|
|
||||||
.status-dot.online { background-color: var(--success); box-shadow: 0 0 6px var(--success); }
|
|
||||||
.status-text { font-size: 11px; font-weight: 600; color: var(--success); }
|
|
||||||
.asset-primary { font-weight: 700; font-size: 14px; }
|
|
||||||
.asset-secondary { font-size: 12px; color: var(--text-muted); }
|
|
||||||
.ip-address { font-weight: 600; font-family: monospace; color: var(--primary-color); }
|
|
||||||
.traffic-mini-chart { display: flex; flex-direction: column; gap: 4px; }
|
|
||||||
.traffic-info { display: flex; justify-content: space-between; font-size: 11px; }
|
|
||||||
.progress-bg { height: 4px; background: var(--primary-lv-0); border-radius: 2px; overflow: hidden; }
|
|
||||||
.progress-fill { height: 100%; background: var(--primary-color); }
|
|
||||||
.icon-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 4px; border: 1px solid var(--border-color); background: var(--white); color: var(--text-muted); cursor: pointer; }
|
|
||||||
.icon-btn:hover { background-color: var(--primary-light); border-color: var(--primary-color); color: var(--primary-color); }
|
|
||||||
|
|
||||||
/* --- Footer --- */
|
.toggle-btn:hover { color: var(--text-main); }
|
||||||
.main-footer {
|
.toggle-btn.active {
|
||||||
height: 28px;
|
background: var(--canvas);
|
||||||
background-color: var(--white);
|
color: var(--text-main);
|
||||||
border-top: 1px solid var(--border-color);
|
box-shadow: 0 1px 2px rgba(0,0,0,0.1);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Role Toggle Switch --- */
|
||||||
|
.role-toggle-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
gap: 0.75rem;
|
||||||
padding: 0 1.5rem;
|
background: var(--canvas-soft-2);
|
||||||
flex-shrink: 0;
|
padding: 0.35rem 0.75rem;
|
||||||
|
border-radius: 9999px;
|
||||||
|
border: 1px solid var(--hairline);
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-footer p {
|
.role-label {
|
||||||
font-family: 'Pretendard Variable', Pretendard, sans-serif;
|
font-size: var(--fs-xs);
|
||||||
font-size: 0.75rem;
|
font-weight: 500;
|
||||||
font-weight: 300;
|
color: var(--mute);
|
||||||
line-height: 1.25rem;
|
transition: all 0.2s;
|
||||||
letter-spacing: -0.0175rem;
|
}
|
||||||
color: #777777;
|
|
||||||
user-select: none;
|
.role-label.active {
|
||||||
pointer-events: all;
|
color: var(--primary);
|
||||||
-webkit-user-drag: none;
|
font-weight: 700;
|
||||||
margin: 0;
|
}
|
||||||
padding: 0;
|
|
||||||
|
.role-toggle {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 40px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.role-toggle input {
|
||||||
|
opacity: 0;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.role-slider {
|
||||||
|
position: absolute;
|
||||||
|
cursor: pointer;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: var(--hairline-strong);
|
||||||
|
transition: .4s;
|
||||||
|
border-radius: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.role-slider:before {
|
||||||
|
position: absolute;
|
||||||
|
content: "";
|
||||||
|
height: 16px;
|
||||||
|
width: 16px;
|
||||||
|
left: 2px;
|
||||||
|
bottom: 2px;
|
||||||
|
background-color: white;
|
||||||
|
transition: .4s;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .role-slider {
|
||||||
|
background-color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked + .role-slider:before {
|
||||||
|
transform: translateX(20px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Utility Styles (The Standard) --- */
|
||||||
|
.btn {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 0.4rem;
|
||||||
|
padding: 0 1.25rem;
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
font-weight: 500;
|
||||||
|
border-radius: 9999px;
|
||||||
|
cursor: pointer;
|
||||||
|
height: clamp(32px, 4.5vmin, 44px);
|
||||||
|
transition: all 0.2s;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary { background-color: var(--primary); color: var(--on-primary); }
|
||||||
|
.btn-primary:hover { background-color: #000; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
|
||||||
|
|
||||||
|
.btn-outline { background-color: var(--canvas); color: var(--text-main); border: 1px solid var(--hairline); }
|
||||||
|
.btn-outline:hover { border-color: var(--hairline-strong); background: var(--canvas-soft); }
|
||||||
|
|
||||||
|
.btn-sm { height: clamp(28px, 3.5vmin, 36px); padding: 0 1rem; font-size: var(--fs-xs); }
|
||||||
|
.btn-danger { color: var(--danger) !important; border-color: var(--danger) !important; }
|
||||||
|
|
||||||
|
/* --- Form Elements --- */
|
||||||
|
.form-select-sm {
|
||||||
|
height: clamp(28px, 3.5vmin, 36px);
|
||||||
|
padding: 0 0.5rem;
|
||||||
|
border: 1px solid var(--hairline);
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
outline: none;
|
||||||
|
background-color: var(--canvas);
|
||||||
|
color: var(--primary);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-select-sm:focus {
|
||||||
|
border-color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 2px 8px;
|
||||||
|
border-radius: 9999px;
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.badge-primary { background-color: var(--primary); color: var(--on-primary); }
|
||||||
|
|
||||||
|
/* --- Badge Color Variants (성능 등급 등 컬러 뱃지) --- */
|
||||||
|
.b-purple { background-color: #EDE9FE; color: #6D28D9; } /* 최상급 - 보라 */
|
||||||
|
.b-primary { background-color: #E0E7FF; color: #3730A3; } /* 상급 - 인디고 */
|
||||||
|
.b-green { background-color: #D1FAE5; color: #065F46; } /* 중급 - 초록 */
|
||||||
|
.b-yellow { background-color: #FEF3C7; color: #B45309; } /* 보급 - 노랑/주황 */
|
||||||
|
.badge-danger { background-color: #FFE4E6; color: #BE123C; } /* 교체대상 - 빨강 */
|
||||||
|
.badge-muted { background-color: #F1F5F9; color: #64748B; } /* 폐기 - 회색 */
|
||||||
|
.badge-light { background-color: #F8FAFC; color: #94A3B8; } /* 기타 - 연회색 */
|
||||||
|
|
||||||
|
/* --- Form Elements Extra --- */
|
||||||
|
.input-with-icon {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-with-icon input {
|
||||||
|
padding-left: 2.5rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-with-icon i,
|
||||||
|
.input-with-icon .icon-sm {
|
||||||
|
position: absolute;
|
||||||
|
left: 12px;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
color: var(--mute);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.autocomplete-list {
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
max-height: 250px;
|
||||||
|
overflow-y: auto;
|
||||||
|
background: var(--canvas);
|
||||||
|
border: 1px solid var(--hairline);
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0 12px 30px rgba(0,0,0,0.12);
|
||||||
|
z-index: 1100;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.autocomplete-item {
|
||||||
|
padding: 10px 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-bottom: 1px solid var(--hairline-soft, #f5f5f5);
|
||||||
|
transition: background 0.1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.autocomplete-item:hover {
|
||||||
|
background: var(--canvas-soft-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.autocomplete-item-empty {
|
||||||
|
padding: 1rem;
|
||||||
|
color: var(--mute);
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.suggestion-name {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
color: var(--primary);
|
||||||
|
margin-bottom: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.suggestion-meta {
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
color: var(--mute);
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Summary & Selection Cards --- */
|
||||||
|
.summary-info-card {
|
||||||
|
padding: 1.25rem;
|
||||||
|
background: var(--canvas-soft);
|
||||||
|
border: 1px solid var(--hairline);
|
||||||
|
border-radius: 8px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-pc-selection-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.5rem;
|
||||||
|
max-height: 250px;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-pc-item {
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid var(--hairline);
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
background: var(--canvas);
|
||||||
|
transition: all 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-pc-item:hover {
|
||||||
|
border-color: var(--hairline-strong);
|
||||||
|
background: var(--canvas-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-pc-item.selected {
|
||||||
|
border-color: var(--primary);
|
||||||
|
background: var(--primary-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pc-item-code {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pc-item-meta {
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
color: var(--mute);
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-list-message {
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
color: var(--mute);
|
||||||
|
padding: 1rem 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Global Utilities --- */
|
||||||
|
.hidden { display: none !important; }
|
||||||
|
.clickable { cursor: pointer; transition: opacity 0.2s; }
|
||||||
|
.clickable:hover { opacity: 0.8; }
|
||||||
|
|
||||||
|
/* Flexbox & Grid Utilities */
|
||||||
|
.flex { display: flex; }
|
||||||
|
.flex-col { display: flex; flex-direction: column; }
|
||||||
|
.flex-row { display: flex; flex-direction: row; }
|
||||||
|
.items-center { align-items: center; }
|
||||||
|
.justify-between { justify-content: space-between; }
|
||||||
|
.justify-center { justify-content: center; }
|
||||||
|
.gap-1 { gap: 0.25rem; }
|
||||||
|
.gap-2 { gap: 0.5rem; }
|
||||||
|
.gap-3 { gap: 0.75rem; }
|
||||||
|
.gap-4 { gap: 1rem; }
|
||||||
|
.gap-6 { gap: 1.5rem; }
|
||||||
|
.gap-y-3 { row-gap: 0.75rem; }
|
||||||
|
.gap-x-4 { column-gap: 1rem; }
|
||||||
|
.mb-0 { margin-bottom: 0 !important; }
|
||||||
|
.mb-4 { margin-bottom: 1rem !important; }
|
||||||
|
.mb-6 { margin-bottom: 1.5rem !important; }
|
||||||
|
.pb-4 { padding-bottom: 1rem !important; }
|
||||||
|
.p-4 { padding: 1rem !important; }
|
||||||
|
.p-2 { padding: 0.5rem !important; }
|
||||||
|
.p-8 { padding: 2rem !important; }
|
||||||
|
.ml-auto { margin-left: auto !important; }
|
||||||
|
.self-end { align-self: flex-end !important; }
|
||||||
|
.font-medium { font-weight: 500; }
|
||||||
|
.text-muted { color: var(--mute) !important; }
|
||||||
|
.mt-12 { margin-top: 3rem !important; }
|
||||||
|
.icon-sm { width: 16px; height: 16px; }
|
||||||
|
.h-90vh { height: 90vh !important; }
|
||||||
|
.pt-0 { padding-top: 0 !important; }
|
||||||
|
.font-semibold { font-weight: 600; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.w-full { width: 100%; }
|
||||||
|
.h-full { height: 100%; }
|
||||||
|
|
||||||
|
/* Text Utilities */
|
||||||
|
.text-center { text-align: center !important; }
|
||||||
|
.text-right { text-align: right !important; }
|
||||||
|
.text-left { text-align: left !important; }
|
||||||
|
.font-bold { font-weight: 700; }
|
||||||
|
.bg-primary-light { background-color: var(--primary-light) !important; }
|
||||||
|
.text-success { color: var(--success) !important; }
|
||||||
|
.text-danger { color: var(--danger) !important; }
|
||||||
|
.text-blue { color: var(--color-blue) !important; }
|
||||||
|
.text-orange { color: var(--color-orange) !important; }
|
||||||
|
/* --- Unified Search & Filter Bar --- */
|
||||||
|
.search-bar {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: var(--spacing-base);
|
||||||
|
padding: 1.25rem var(--spacing-base);
|
||||||
|
border-bottom: 1px solid var(--hairline);
|
||||||
|
align-items: flex-end;
|
||||||
|
background: var(--canvas);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden {
|
.search-item {
|
||||||
display: none !important;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.5rem;
|
||||||
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-nowrap {
|
.search-item.flex-1 {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-item label {
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--mute);
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-item input,
|
||||||
|
.search-item select {
|
||||||
|
height: clamp(34px, 4.5vmin, 44px);
|
||||||
|
padding: 0 0.75rem;
|
||||||
|
border: 1px solid var(--hairline);
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: var(--fs-sm);
|
||||||
|
outline: none;
|
||||||
|
background-color: var(--canvas);
|
||||||
|
color: var(--primary);
|
||||||
|
transition: border-color 0.2s;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-item select {
|
||||||
|
cursor: pointer;
|
||||||
|
min-width: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-item input:focus,
|
||||||
|
.search-item select:focus {
|
||||||
|
border-color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-action-group {
|
||||||
|
margin-left: auto;
|
||||||
|
align-self: flex-end;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-view-toggle-label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--primary);
|
||||||
|
height: clamp(34px, 4.5vmin, 44px);
|
||||||
|
padding: 0 0.5rem;
|
||||||
|
font-size: var(--fs-sm);
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-view-toggle-label input[type="checkbox"] {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map-pagination-group {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.75rem;
|
||||||
|
margin-left: 0.5rem;
|
||||||
|
padding-left: 1rem;
|
||||||
|
border-left: 1px solid var(--hairline);
|
||||||
|
height: clamp(34px, 4.5vmin, 44px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-info {
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
color: var(--mute);
|
||||||
|
font-weight: 500;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- Utility Styles --- */
|
|
||||||
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; padding: 0 0.8rem; font-size: 12px; font-weight: 600; border-radius: 4px; cursor: pointer; height: 28px; }
|
|
||||||
.btn-primary { background-color: var(--primary-color); color: var(--white); border: none; }
|
|
||||||
.btn-outline { background-color: transparent; color: var(--text-muted); border: 1px solid var(--border-color); }
|
|
||||||
|
|
||||||
.badge {
|
/* --- Modal & View Header Layouts --- */
|
||||||
padding: 2px 6px;
|
.header-left {
|
||||||
border-radius: 4px;
|
display: flex;
|
||||||
font-size: 16px;
|
align-items: center;
|
||||||
font-weight: 700;
|
gap: 1rem;
|
||||||
white-space: nowrap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.badge-primary {
|
/* --- Asset Identity & Header Styling (Global) --- */
|
||||||
background-color: var(--primary-color);
|
.header-identity {
|
||||||
color: white;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
flex: 1;
|
||||||
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.badge-muted {
|
.asset-code-title {
|
||||||
background-color: #9CA3AF;
|
font-size: var(--fs-md);
|
||||||
color: white;
|
font-weight: 600;
|
||||||
|
color: var(--primary);
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.badge-light {
|
.service-type-badge {
|
||||||
background: var(--bg-color);
|
font-size: var(--fs-xs);
|
||||||
color: var(--text-muted);
|
font-weight: 600;
|
||||||
border: 1px solid var(--border-color);
|
color: var(--on-primary);
|
||||||
|
background: var(--primary);
|
||||||
|
padding: 4px 8px;
|
||||||
|
border-radius: 9999px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PC 성능 등급 뱃지 컬러 스타일 */
|
.asset-type-label {
|
||||||
.badge.b-purple {
|
font-size: var(--fs-sm);
|
||||||
background-color: #EDE9FE;
|
font-weight: 500;
|
||||||
color: #7C3AED;
|
color: var(--mute);
|
||||||
border: 1px solid #DDD6FE;
|
line-height: 1;
|
||||||
font-size: 11px;
|
|
||||||
padding: 2px 6px;
|
|
||||||
}
|
|
||||||
.badge.b-primary {
|
|
||||||
background-color: #DBEAFE;
|
|
||||||
color: #1D4ED8;
|
|
||||||
border: 1px solid #BFDBFE;
|
|
||||||
font-size: 11px;
|
|
||||||
padding: 2px 6px;
|
|
||||||
}
|
|
||||||
.badge.b-green {
|
|
||||||
background-color: #D1FAE5;
|
|
||||||
color: #047857;
|
|
||||||
border: 1px solid #A7F3D0;
|
|
||||||
font-size: 11px;
|
|
||||||
padding: 2px 6px;
|
|
||||||
}
|
|
||||||
.badge.b-yellow {
|
|
||||||
background-color: #FEF3C7;
|
|
||||||
color: #D97706;
|
|
||||||
border: 1px solid #FDE68A;
|
|
||||||
font-size: 11px;
|
|
||||||
padding: 2px 6px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-tag {
|
.main-footer {
|
||||||
color: var(--text-muted);
|
border-top: 1px solid var(--border-color);
|
||||||
font-size: 16px;
|
background-color: var(--canvas);
|
||||||
padding: 1px 5px;
|
color: var(--mute);
|
||||||
border: 1px solid var(--border-color);
|
padding: 1rem 2rem;
|
||||||
border-radius: 3px;
|
text-align: right;
|
||||||
background-color: var(--bg-light);
|
font-size: var(--fs-xs);
|
||||||
|
flex-shrink: 0;
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
.font-bold {
|
.main-footer p {
|
||||||
font-weight: 700;
|
margin: 0;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- Responsive Design (Tablet & Mobile) --- */
|
|
||||||
@media (max-width: 1200px) {
|
|
||||||
.header-container { gap: 0.75rem; padding: 0 1rem; }
|
|
||||||
.brand h1 { font-size: 1rem; }
|
|
||||||
.brand h1 .sub-title { font-size: 0.75rem; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 992px) {
|
|
||||||
.main-header { height: auto; padding: 0.5rem 0; }
|
|
||||||
.header-container { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
|
|
||||||
.integrated-nav { width: 100%; justify-content: flex-start; border-top: 1px solid var(--border-color); padding-top: 0.5rem; }
|
|
||||||
.header-actions { width: 100%; justify-content: flex-end; padding-top: 0.5rem; }
|
|
||||||
.content-area { padding: 0 1rem; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
.brand h1 .sub-title { display: none; }
|
|
||||||
.header-actions .btn span { display: none; }
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,526 +1,503 @@
|
|||||||
/* --- Premium Executive Dashboard View Specific Styles --- */
|
/* --- Vercel Inspired Premium Dashboard --- */
|
||||||
.dashboard-section-title {
|
.dashboard-section-title {
|
||||||
padding: 0 0 0 8px;
|
padding: 0;
|
||||||
font-size: 1.55rem;
|
font-size: var(--fs-lg);
|
||||||
font-weight: 800;
|
font-weight: 600;
|
||||||
color: var(--text-main);
|
color: var(--primary);
|
||||||
letter-spacing: -0.02em;
|
letter-spacing: -0.02em;
|
||||||
border-left: 4px solid var(--primary-color);
|
margin-bottom: clamp(0.5rem, 1.5vmin, 1.5rem);
|
||||||
margin-bottom: 1rem;
|
line-height: 1;
|
||||||
line-height: 1.2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dashboard-grid {
|
/* Background Mesh Gradient for Stats Row */
|
||||||
display: grid;
|
.dashboard-stats-row {
|
||||||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
display: flex;
|
||||||
gap: 1.5rem;
|
flex-wrap: wrap;
|
||||||
margin-bottom: 2rem;
|
border-bottom: 1px solid var(--hairline);
|
||||||
|
padding: 0;
|
||||||
|
margin-bottom: clamp(1rem, 2vmin, 2rem);
|
||||||
|
background: radial-gradient(at 0% 0%, rgba(80, 227, 194, 0.05) 0px, transparent 50%),
|
||||||
|
radial-gradient(at 100% 0%, rgba(121, 40, 202, 0.05) 0px, transparent 50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Premium Executive Divider-based Style (Line-based Division) */
|
.stat-group-item {
|
||||||
.dashboard-card, .stat-card {
|
flex: 1;
|
||||||
background: transparent;
|
min-width: 250px;
|
||||||
backdrop-filter: none;
|
|
||||||
-webkit-backdrop-filter: none;
|
|
||||||
border: none;
|
|
||||||
border-bottom: 1px solid var(--border-color);
|
|
||||||
box-shadow: none;
|
|
||||||
border-radius: 0;
|
|
||||||
padding: 1.5rem 0.5rem;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
transition: opacity 0.2s ease;
|
padding: var(--spacing-base);
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dashboard-card:hover, .stat-card:hover {
|
.stat-group-item.bordered {
|
||||||
transform: none;
|
border-left: 1px solid var(--hairline);
|
||||||
box-shadow: none;
|
|
||||||
opacity: 0.85;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dashboard-layout-2col {
|
.stat-group-item .stat-label {
|
||||||
display: grid;
|
font-size: var(--fs-xs);
|
||||||
grid-template-columns: repeat(2, 1fr);
|
font-weight: 500;
|
||||||
|
color: var(--mute);
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-group-item .stat-value {
|
||||||
|
font-size: var(--fs-xl);
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--primary);
|
||||||
|
line-height: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-group-item .stat-value span {
|
||||||
|
font-size: var(--fs-base);
|
||||||
|
font-weight: 400;
|
||||||
|
margin-left: 6px;
|
||||||
|
color: var(--mute);
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-group-item .stat-sub {
|
||||||
|
display: flex;
|
||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
|
font-size: var(--fs-sm);
|
||||||
|
color: var(--body);
|
||||||
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dashboard-layout-3col {
|
/* --- Technical Data Alignment --- */
|
||||||
display: grid;
|
.text-primary {
|
||||||
grid-template-columns: repeat(3, 1fr);
|
color: var(--color-blue) !important;
|
||||||
gap: 1.5rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dashboard-card {
|
.detail-stat-header {
|
||||||
min-height: 380px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-card canvas {
|
|
||||||
flex: 1;
|
|
||||||
width: 100% !important;
|
|
||||||
max-height: 280px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Premium KPI Value Styling */
|
|
||||||
.stat-value {
|
|
||||||
font-size: 2.41rem;
|
|
||||||
font-weight: 800;
|
|
||||||
background: linear-gradient(135deg, #1E5149 0%, #3B82F6 100%);
|
|
||||||
-webkit-background-clip: text;
|
|
||||||
-webkit-text-fill-color: transparent;
|
|
||||||
margin-top: 0.5rem;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-value-danger {
|
.stat-title {
|
||||||
background: linear-gradient(135deg, #E11D48 0%, #F59E0B 100%);
|
font-size: var(--fs-base);
|
||||||
-webkit-background-clip: text;
|
|
||||||
-webkit-text-fill-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-label {
|
|
||||||
font-size: 1.36rem;
|
|
||||||
color: var(--text-muted);
|
|
||||||
font-weight: 700;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.05em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-icon {
|
|
||||||
width: 48px;
|
|
||||||
height: 48px;
|
|
||||||
border-radius: 12px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-blue { background: rgba(59, 130, 246, 0.1); color: #3B82F6; }
|
|
||||||
.icon-green { background: rgba(30, 81, 73, 0.1); color: #1E5149; }
|
|
||||||
.icon-red { background: rgba(225, 29, 72, 0.1); color: #E11D48; }
|
|
||||||
.icon-yellow { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
|
|
||||||
|
|
||||||
.table-premium {
|
|
||||||
background: white;
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow: 0 4px 15px rgba(0,0,0,0.05);
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-premium table {
|
|
||||||
width: 100%;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-premium th {
|
|
||||||
background: #F8FAFC;
|
|
||||||
color: #475569;
|
|
||||||
font-weight: 700;
|
|
||||||
padding: 1rem;
|
|
||||||
text-transform: uppercase;
|
|
||||||
font-size: 0.96rem;
|
|
||||||
letter-spacing: 0.05em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-premium td {
|
|
||||||
padding: 1rem;
|
|
||||||
border-bottom: 1px solid #E2E8F0;
|
|
||||||
color: #1E293B;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-premium tr:hover td {
|
|
||||||
background: #F1F5F9;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- Slider/Carousel Specific Styles --- */
|
|
||||||
.dashboard-header-wrapper {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.slider-controls {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.slider-nav-btn {
|
|
||||||
background: white;
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
|
|
||||||
border-radius: 50%;
|
|
||||||
width: 36px;
|
|
||||||
height: 36px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
cursor: pointer;
|
|
||||||
color: var(--text-main);
|
|
||||||
transition: all 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.slider-nav-btn:hover {
|
|
||||||
background: var(--primary-color);
|
|
||||||
color: white;
|
|
||||||
border-color: var(--primary-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.slider-nav-btn:disabled {
|
|
||||||
opacity: 0.5;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-info {
|
|
||||||
font-size: 0.96rem;
|
|
||||||
color: var(--text-muted);
|
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
color: var(--primary);
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-btns button {
|
.detail-stat-body {
|
||||||
padding: 0.3rem 0.75rem;
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
background: var(--white);
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 0.96rem;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-btns button:disabled {
|
|
||||||
opacity: 0.5;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.slider-indicator {
|
|
||||||
font-weight: 700;
|
|
||||||
color: var(--text-muted);
|
|
||||||
font-size: 1.41rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-slider-viewport {
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 0.5rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-slider-track {
|
|
||||||
display: flex;
|
|
||||||
transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
||||||
width: 400%; /* For 4 pages */
|
|
||||||
}
|
|
||||||
|
|
||||||
.dashboard-slide {
|
|
||||||
width: 25%; /* 100% / 4 pages */
|
|
||||||
flex-shrink: 0;
|
|
||||||
padding: 0 2px; /* Slight padding to avoid cutting off box-shadows */
|
|
||||||
height: calc(100vh - 150px);
|
|
||||||
min-height: 520px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
box-sizing: border-box;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- Location View Styles --- */
|
.loc-summary {
|
||||||
.location-layout {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1.2fr 1fr;
|
|
||||||
gap: 2rem;
|
|
||||||
height: calc(100vh - 180px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.map-section, .asset-section {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-title {
|
|
||||||
font-size: 1.125rem;
|
|
||||||
font-weight: 700;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
color: var(--text-main);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.map-wrapper {
|
|
||||||
flex: 1;
|
|
||||||
background: #f8fafc;
|
|
||||||
box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
.location-box {
|
|
||||||
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
||||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.location-box:hover {
|
|
||||||
background: rgba(30, 81, 73, 0.2) !important;
|
|
||||||
transform: scale(1.02);
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
.location-box:active {
|
|
||||||
transform: scale(0.98);
|
|
||||||
}
|
|
||||||
|
|
||||||
.asset-section .table-container {
|
|
||||||
flex: 1;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status-tag {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 0.25rem 0.625rem;
|
|
||||||
border-radius: 9999px;
|
|
||||||
font-size: 0.75rem;
|
|
||||||
font-weight: 600;
|
|
||||||
background: #ecfdf5;
|
|
||||||
color: #059669;
|
|
||||||
border: 1px solid #d1fae5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.view-toggle-btn:hover {
|
|
||||||
border-color: var(--primary-color) !important;
|
|
||||||
color: var(--primary-color) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.view-toggle-btn.active:hover {
|
|
||||||
color: white !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- View Toggle Header --- */
|
|
||||||
.view-header {
|
|
||||||
padding: 0.5rem 1.5rem;
|
|
||||||
background: var(--white);
|
|
||||||
border-bottom: 1px solid var(--border-color);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.view-toggle-container {
|
.loc-summary span {
|
||||||
display: flex;
|
font-size: var(--fs-sm);
|
||||||
background: #f1f5f9;
|
color: var(--mute);
|
||||||
padding: 0.25rem;
|
|
||||||
border-radius: 8px;
|
|
||||||
gap: 0.25rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mode-toggle-btn {
|
.loc-summary span strong {
|
||||||
padding: 0.5rem 1rem;
|
color: var(--primary);
|
||||||
border: none;
|
font-size: var(--fs-base);
|
||||||
background: transparent;
|
|
||||||
border-radius: 6px;
|
|
||||||
font-size: 0.8125rem;
|
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--text-muted);
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.2s ease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mode-toggle-btn:hover {
|
.type-summary {
|
||||||
color: var(--text-main);
|
display: flex;
|
||||||
|
gap: 0.8rem;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
opacity: 0.9;
|
||||||
|
border-top: 1px dashed var(--hairline);
|
||||||
|
padding-top: 8px;
|
||||||
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mode-toggle-btn.active {
|
.type-summary span {
|
||||||
background: var(--white);
|
cursor: help;
|
||||||
color: var(--primary-color);
|
font-size: var(--fs-xs);
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
color: var(--mute);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- Enhanced Location View --- */
|
.type-summary span strong {
|
||||||
|
color: var(--primary);
|
||||||
|
font-size: var(--fs-sm);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Enhanced Location View Layout --- */
|
||||||
.location-view-wrapper {
|
.location-view-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: calc(100vh - 120px);
|
height: 100%;
|
||||||
|
background: var(--canvas);
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.location-filter-bar {
|
.location-filter-bar {
|
||||||
padding: 1rem 1.5rem;
|
/* Inherit from .search-bar in common.css */
|
||||||
background: var(--white);
|
|
||||||
border-bottom: 1px solid var(--border-color);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 2rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-group {
|
.filter-group label {
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--mute);
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-group label {
|
|
||||||
font-size: 0.8125rem;
|
|
||||||
font-weight: 700;
|
|
||||||
color: var(--text-main);
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter-group select {
|
|
||||||
padding: 0.4rem 0.75rem;
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
border-radius: 6px;
|
|
||||||
font-size: 0.8125rem;
|
|
||||||
color: var(--text-main);
|
|
||||||
background: var(--white);
|
|
||||||
min-width: 140px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.map-pagination {
|
|
||||||
margin-left: auto;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.location-main-content {
|
.location-main-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1.4fr 1fr;
|
grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
|
||||||
gap: 1.5rem;
|
background: var(--canvas);
|
||||||
padding: 1.5rem;
|
gap: 0;
|
||||||
|
padding: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
align-items: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
.map-container-section {
|
.map-container-section {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
align-items: center;
|
||||||
overflow: auto;
|
justify-content: center;
|
||||||
|
background: var(--canvas);
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map-frame-wrapper {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map-image {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
object-fit: contain;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map-overlay {
|
||||||
|
position: absolute;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-map-message {
|
||||||
|
padding: 5rem;
|
||||||
|
text-align: center;
|
||||||
|
color: var(--mute);
|
||||||
|
font-size: var(--fs-base);
|
||||||
}
|
}
|
||||||
|
|
||||||
.location-box-point {
|
.location-box-point {
|
||||||
|
position: absolute;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.box-label-text {
|
/* --- Asset Detail Sidebar --- */
|
||||||
font-size: 0.65rem;
|
|
||||||
font-weight: 800;
|
|
||||||
color: var(--primary-color);
|
|
||||||
pointer-events: none;
|
|
||||||
text-shadow: 0 0 2px white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.asset-list-section {
|
.asset-list-section {
|
||||||
background: var(--white);
|
|
||||||
border-radius: 12px;
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
background: var(--canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
.asset-list-section .section-header {
|
.section-header {
|
||||||
padding: 1rem 1.25rem;
|
padding: 1.5rem;
|
||||||
border-bottom: 1px solid var(--border-color);
|
border-bottom: 1px solid var(--hairline);
|
||||||
background: #f8fafc;
|
background: var(--canvas);
|
||||||
}
|
flex-shrink: 0;
|
||||||
|
|
||||||
.asset-list-section h4 {
|
|
||||||
margin: 0;
|
|
||||||
font-size: 0.9375rem;
|
|
||||||
color: var(--text-main);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mini-table-wrapper {
|
.mini-table-wrapper {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.compact-table {
|
.sidebar-title {
|
||||||
width: 100%;
|
margin: 0;
|
||||||
border-collapse: collapse;
|
font-size: var(--fs-base);
|
||||||
}
|
|
||||||
|
|
||||||
.compact-table th {
|
|
||||||
position: sticky;
|
|
||||||
top: 0;
|
|
||||||
background: var(--white);
|
|
||||||
padding: 0.75rem 1rem;
|
|
||||||
text-align: left;
|
|
||||||
font-size: 0.75rem;
|
|
||||||
font-weight: 700;
|
|
||||||
color: var(--text-muted);
|
|
||||||
border-bottom: 1px solid var(--border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.compact-table td {
|
|
||||||
padding: 0.75rem 1rem;
|
|
||||||
font-size: 0.8125rem;
|
|
||||||
border-bottom: 1px solid #f1f5f9;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
max-width: 150px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.compact-table tr.clickable-row:hover {
|
|
||||||
background: #f1f5f9;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- Asset Detail Sidebar (LocationView) --- */
|
|
||||||
.asset-detail-sidebar {
|
|
||||||
padding-top: 1rem;
|
|
||||||
background: var(--white);
|
|
||||||
height: 100%;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-section {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
padding: 0 1.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-section-title {
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 700;
|
|
||||||
color: var(--primary-color);
|
|
||||||
border-bottom: 1px solid var(--border-color);
|
|
||||||
padding-bottom: 6px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-grid {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(2, minmax(80px, auto) 1fr);
|
|
||||||
gap: 8px 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-label {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--text-muted);
|
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
display: flex;
|
color: var(--primary);
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-value {
|
|
||||||
font-size: 14px;
|
|
||||||
color: var(--text-main);
|
|
||||||
font-weight: 500;
|
|
||||||
word-break: break-all;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.detail-header-actions {
|
.detail-header-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
justify-content: space-between;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.detail-header-title {
|
.header-identity {
|
||||||
|
display: flex;
|
||||||
|
align-items: center; /* Changed from baseline to center for perfect vertical alignment */
|
||||||
|
gap: 8px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: 0.95rem;
|
flex-wrap: wrap; /* Allow wrapping on very small screens */
|
||||||
|
}
|
||||||
|
|
||||||
|
.asset-code-title {
|
||||||
|
font-size: var(--fs-md);
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--primary);
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
line-height: 1; /* Reset line-height to prevent baseline shifts */
|
||||||
|
}
|
||||||
|
|
||||||
|
.service-type-badge {
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--on-primary);
|
||||||
|
background: var(--primary);
|
||||||
|
padding: 4px 8px; /* Adjusted padding for better vertical centering */
|
||||||
|
border-radius: 9999px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
line-height: 1; /* Match line-height */
|
||||||
|
}
|
||||||
|
|
||||||
|
.asset-type-label {
|
||||||
|
font-size: var(--fs-sm);
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--mute);
|
||||||
|
line-height: 1; /* Match line-height */
|
||||||
|
}
|
||||||
|
|
||||||
|
.asset-detail-sidebar {
|
||||||
|
padding: 1.5rem 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-section {
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
padding: 0 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-section-title {
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--mute);
|
||||||
|
border-bottom: 1px solid var(--hairline);
|
||||||
|
padding-bottom: 8px;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-grid-2col {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
gap: 1rem 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-item.full-width {
|
||||||
|
grid-column: span 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-label-sm {
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
color: var(--mute);
|
||||||
|
font-weight: 500;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-layout-2col {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
gap: 0;
|
||||||
|
padding: 0 2rem 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-card {
|
||||||
|
background: var(--canvas);
|
||||||
|
border: none;
|
||||||
|
border-radius: 0;
|
||||||
|
padding: 2rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1rem;
|
||||||
|
transition: all 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-card.clickable:hover {
|
||||||
|
background-color: var(--canvas-soft-2);
|
||||||
|
border-color: var(--hairline-strong);
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-progress-bar {
|
||||||
|
height: 8px;
|
||||||
|
background: var(--canvas-soft-2);
|
||||||
|
border-radius: 9999px;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-fill {
|
||||||
|
height: 100%;
|
||||||
|
background: var(--primary);
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-card .stat-label {
|
||||||
|
font-size: var(--fs-xs);
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--mute);
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-card .stat-value {
|
||||||
|
font-size: var(--fs-xl);
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-card .stat-sub {
|
||||||
|
font-size: var(--fs-sm);
|
||||||
|
color: var(--body);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-soft {
|
||||||
|
background-color: var(--canvas-soft) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart-placeholder {
|
||||||
|
width: 140px;
|
||||||
|
height: 140px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circular-progress {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: conic-gradient(var(--primary) calc(var(--val) * 1%), var(--hairline) 0);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circular-progress::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
width: 70px;
|
||||||
|
height: 70px;
|
||||||
|
background: var(--canvas);
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circular-progress::after {
|
||||||
|
content: attr(style); /* This is a hack to get the value, but we'll use innerHTML in TS if needed */
|
||||||
|
position: absolute;
|
||||||
|
font-size: var(--fs-sm);
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.system-dashboard {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.warning-badge-orange { background-color: var(--color-orange); color: var(--white); padding: 2px 8px; border-radius: 9999px; font-size: var(--fs-xs); font-weight: 600; }
|
||||||
|
.warning-badge { background-color: var(--danger); color: var(--white); padding: 2px 8px; border-radius: 9999px; font-size: var(--fs-xs); font-weight: 600; }
|
||||||
|
|
||||||
|
.list-section {
|
||||||
|
flex: 1.3;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 0;
|
||||||
|
padding: 1rem 1.5rem 0 0;
|
||||||
|
border-right: 1px solid var(--hairline);
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-panel {
|
||||||
|
flex: 0.7;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 0;
|
||||||
|
padding: 1rem 0 0 1.5rem;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-empty-state {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
color: var(--mute);
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-photo-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
position: relative;
|
||||||
|
border: 1px solid var(--hairline);
|
||||||
|
background: #f0f0f0;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-photo-state {
|
||||||
|
padding: 3rem;
|
||||||
|
text-align: center;
|
||||||
|
color: var(--mute);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Responsive Overrides */
|
||||||
|
@media (max-width: 1440px) {
|
||||||
|
.location-main-content {
|
||||||
|
grid-template-columns: 1.5fr 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1024px) {
|
||||||
|
.location-main-content {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
grid-template-rows: auto 1fr;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
.map-container-section {
|
||||||
|
height: 400px;
|
||||||
|
border-right: none;
|
||||||
|
border-bottom: 1px solid var(--hairline);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -13,13 +13,13 @@ export function renderSwDashboard(container: HTMLElement) {
|
|||||||
// 통합 SW 데이터
|
// 통합 SW 데이터
|
||||||
const allSw = [...state.masterData.swExternal, ...state.masterData.swInternal];
|
const allSw = [...state.masterData.swExternal, ...state.masterData.swInternal];
|
||||||
|
|
||||||
allSw.forEach(sw => {
|
allSw.forEach((sw: any) => {
|
||||||
const assigned = state.masterData.swUsers.filter(u => u.sw_id === sw.id).length;
|
const assigned = state.masterData.swUsers.filter(u => u.sw_id === sw.id).length;
|
||||||
const qty = typeof sw[ASSET_SCHEMA.ASSET_COUNT.key] === 'number' ? sw[ASSET_SCHEMA.ASSET_COUNT.key] : parseInt(sw[ASSET_SCHEMA.ASSET_COUNT.key]||'0', 10);
|
const qty = typeof sw[ASSET_SCHEMA.ASSET_COUNT.key] === 'number' ? sw[ASSET_SCHEMA.ASSET_COUNT.key] : parseInt(sw[ASSET_SCHEMA.ASSET_COUNT.key]||'0', 10);
|
||||||
const priceStr = sw[ASSET_SCHEMA.PURCHASE_AMOUNT.key] ? String(sw[ASSET_SCHEMA.PURCHASE_AMOUNT.key]).replace(/,/g, '') : '0';
|
const priceStr = sw[ASSET_SCHEMA.PURCHASE_AMOUNT.key] ? String(sw[ASSET_SCHEMA.PURCHASE_AMOUNT.key]).replace(/,/g, '') : '0';
|
||||||
const price = parseInt(priceStr, 10) || 0;
|
const price = parseInt(priceStr, 10) || 0;
|
||||||
|
|
||||||
if (sw.asset_type === '외부SW' || sw.type === '외부SW') {
|
if (sw.asset_type === '외부SW') {
|
||||||
extQty += qty; extUsed += assigned; extTotal++;
|
extQty += qty; extUsed += assigned; extTotal++;
|
||||||
if (isSWExpiring(sw)) extExp++;
|
if (isSWExpiring(sw)) extExp++;
|
||||||
if (sw[ASSET_SCHEMA.PURCHASE_DATE.key]?.startsWith('2026')) extCost2026 += price;
|
if (sw[ASSET_SCHEMA.PURCHASE_DATE.key]?.startsWith('2026')) extCost2026 += price;
|
||||||
@@ -33,38 +33,38 @@ export function renderSwDashboard(container: HTMLElement) {
|
|||||||
const intPer = intQty > 0 ? Math.round((intUsed/intQty)*100) : 0;
|
const intPer = intQty > 0 ? Math.round((intUsed/intQty)*100) : 0;
|
||||||
|
|
||||||
container.innerHTML = `
|
container.innerHTML = `
|
||||||
<div class="view-container">
|
<div class="view-container" style="background-color: var(--canvas); padding: 1.5rem 0;">
|
||||||
<h3 class="dashboard-section-title">소프트웨어 라이선스 현황</h3>
|
<h3 class="dashboard-section-title" style="padding: 0 2rem; margin-bottom: 1rem;">소프트웨어 라이선스 현황</h3>
|
||||||
|
|
||||||
<div class="dashboard-layout-2col" style="margin-bottom: 1.5rem;">
|
<div class="dashboard-layout-2col mb-6">
|
||||||
<div class="dashboard-card" data-action="ext-usage" style="cursor:pointer; min-height:auto;">
|
<div class="dashboard-card clickable" data-action="ext-usage">
|
||||||
<span style="font-size:1.21rem; font-weight:700; color:var(--text-main);">외부 소프트웨어 사용율</span>
|
<div class="stat-label">외부 소프트웨어 사용율</div>
|
||||||
<div style="font-size: 1.02rem; color:var(--text-muted); margin-bottom: 1rem;">${extQty}카피 중 ${extUsed}개 할당</div>
|
<div class="stat-sub">${extQty}카피 중 ${extUsed}개 할당</div>
|
||||||
<div style="font-size: 2.21rem; font-weight:700; color:var(--dash-primary);">${extPer}%</div>
|
<div class="stat-value text-primary">${extPer}%</div>
|
||||||
<div style="width: 100%; height: 4px; background-color: var(--border-color); border-radius: 2px; overflow: hidden; margin-top: 0.5rem;">
|
<div class="stat-progress-bar">
|
||||||
<div style="width: ${extPer}%; height: 100%; background-color: var(--dash-primary);"></div>
|
<div class="progress-fill" style="width: ${extPer}%;"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dashboard-card" data-action="int-usage" style="cursor:pointer; min-height:auto;">
|
<div class="dashboard-card clickable" data-action="int-usage">
|
||||||
<span style="font-size:1.21rem; font-weight:700; color:var(--text-main);">내부 소프트웨어 현황</span>
|
<div class="stat-label">내부 소프트웨어 현황</div>
|
||||||
<div style="font-size: 1.02rem; color:var(--text-muted); margin-bottom: 1rem;">등록된 내부 솔루션: ${intTotal}개</div>
|
<div class="stat-sub">등록된 내부 솔루션: ${intTotal}개</div>
|
||||||
<div style="font-size: 2.21rem; font-weight:700; color:var(--dash-primary);">${intPer}%</div>
|
<div class="stat-value text-primary">${intPer}%</div>
|
||||||
<div style="width: 100%; height: 4px; background-color: var(--border-color); border-radius: 2px; overflow: hidden; margin-top: 0.5rem;">
|
<div class="stat-progress-bar">
|
||||||
<div style="width: ${intPer}%; height: 100%; background-color: var(--dash-primary);"></div>
|
<div class="progress-fill" style="width: ${intPer}%;"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 class="dashboard-section-title">2026년 누적 도입 비용 분석</h3>
|
<h3 class="dashboard-section-title" style="padding: 0 2rem; margin-bottom: 1rem;">2026년 누적 도입 비용 분석</h3>
|
||||||
|
|
||||||
<div style="display:grid; grid-template-columns: repeat(2, 1fr); gap:1.5rem; margin-bottom:1.5rem;">
|
<div class="dashboard-layout-2col">
|
||||||
<div class="dashboard-card" style="min-height:auto;">
|
<div class="dashboard-card">
|
||||||
<span style="font-size:1.21rem; font-weight:700; color:var(--text-main);">외부 SW 누적 비용 (2026)</span>
|
<div class="stat-label">외부 SW 누적 비용 (2026)</div>
|
||||||
<div style="font-size: 2.21rem; font-weight:700; color:var(--dash-primary);">₩ ${extCost2026.toLocaleString()}</div>
|
<div class="stat-value text-primary">₩ ${extCost2026.toLocaleString()}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dashboard-card" style="min-height:auto;">
|
<div class="dashboard-card">
|
||||||
<span style="font-size:1.21rem; font-weight:700; color:var(--text-main);">내부 SW 누적 비용 (2026)</span>
|
<div class="stat-label">내부 SW 누적 비용 (2026)</div>
|
||||||
<div style="font-size: 2.21rem; font-weight:700; color:#3b82f6;">₩ ${intCost2026.toLocaleString()}</div>
|
<div class="stat-value text-blue">₩ ${intCost2026.toLocaleString()}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,66 +1,179 @@
|
|||||||
import { state } from '../../core/state';
|
import { state } from '../../core/state';
|
||||||
import { openPartsMasterModal } from '../../components/Modal/PartsMasterModal';
|
import { openPartsMasterModal } from '../../components/Modal/PartsMasterModal';
|
||||||
|
import { openJobSpecModal } from '../../components/Modal/JobSpecModal';
|
||||||
import { formatInline } from '../../core/utils';
|
import { formatInline } from '../../core/utils';
|
||||||
import { createListView } from './ListFactory';
|
import { createListView } from './ListFactory';
|
||||||
|
|
||||||
|
export let activePartsMasterSubTab: 'parts-master' | 'job-spec' = 'parts-master';
|
||||||
|
|
||||||
export function renderPartsMasterList(container: HTMLElement) {
|
export function renderPartsMasterList(container: HTMLElement) {
|
||||||
createListView(container, {
|
if (activePartsMasterSubTab === 'parts-master') {
|
||||||
title: '부품 마스터',
|
createListView(container, {
|
||||||
dataSource: () => state.masterData.partsMaster || [],
|
title: '부품 마스터',
|
||||||
searchKeys: ['component_name', 'category', 'score_tier'],
|
dataSource: () => state.masterData.partsMaster || [],
|
||||||
filterOptions: {
|
searchKeys: ['component_name', 'category', 'score_tier'],
|
||||||
keywordLabel: '부품명 / 등급 검색',
|
filterOptions: {
|
||||||
showLoc: false,
|
keywordLabel: '부품명 / 등급 검색',
|
||||||
showDept: false,
|
showLoc: false,
|
||||||
showType: false
|
showDept: false,
|
||||||
},
|
showType: false
|
||||||
onRowClick: (component) => openPartsMasterModal(component, 'view'),
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
header: 'ID',
|
|
||||||
sortKey: 'id',
|
|
||||||
align: 'center',
|
|
||||||
width: '5%',
|
|
||||||
render: c => c.id.toString()
|
|
||||||
},
|
},
|
||||||
{
|
onRowClick: (component) => openPartsMasterModal(component, 'view'),
|
||||||
header: '분류',
|
columns: [
|
||||||
sortKey: 'category',
|
{
|
||||||
align: 'center',
|
header: 'ID',
|
||||||
width: '15%',
|
sortKey: 'id',
|
||||||
render: c => {
|
align: 'center',
|
||||||
let badgeClass = 'badge-primary';
|
width: '5%',
|
||||||
if (c.category === 'CPU') badgeClass = 'b-primary';
|
render: c => c.id.toString()
|
||||||
else if (c.category === 'GPU') badgeClass = 'b-purple';
|
},
|
||||||
else if (c.category === 'RAM') badgeClass = 'b-green';
|
{
|
||||||
return `<span class="badge ${badgeClass}">${c.category}</span>`;
|
header: '분류',
|
||||||
|
sortKey: 'category',
|
||||||
|
align: 'center',
|
||||||
|
width: '15%',
|
||||||
|
render: c => {
|
||||||
|
let badgeClass = 'badge-primary';
|
||||||
|
if (c.category === 'CPU') badgeClass = 'badge-primary';
|
||||||
|
else if (c.category === 'GPU') badgeClass = 'badge-success';
|
||||||
|
else if (c.category === 'RAM') badgeClass = 'badge-warning';
|
||||||
|
return `<span class="badge ${badgeClass}">${c.category}</span>`;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
header: '부품 표준 명칭',
|
||||||
|
sortKey: 'component_name',
|
||||||
|
render: c => formatInline(c.component_name || '-')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
header: '성능 등급',
|
||||||
|
sortKey: 'score_tier',
|
||||||
|
align: 'center',
|
||||||
|
width: '15%',
|
||||||
|
render: c => c.score_tier || '-'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
header: '감점 점수',
|
||||||
|
sortKey: 'deduction',
|
||||||
|
align: 'center',
|
||||||
|
width: '15%',
|
||||||
|
render: c => {
|
||||||
|
const score = c.deduction || 0;
|
||||||
|
let color = '#3b82f6'; // blue
|
||||||
|
if (score >= 20) color = '#ef4444'; // red
|
||||||
|
else if (score >= 10) color = '#f59e0b'; // orange
|
||||||
|
return `<strong style="color: ${color}; font-size: 14px;">-${score}점</strong>`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
createListView(container, {
|
||||||
|
title: '직무별 기준 사양',
|
||||||
|
dataSource: () => state.masterData.jobSpecs || [],
|
||||||
|
searchKeys: ['job_name', 'cpu_standard', 'ram_standard', 'gpu_standard', 'remarks'],
|
||||||
|
filterOptions: {
|
||||||
|
keywordLabel: '직무명 / 사양 검색',
|
||||||
|
showLoc: false,
|
||||||
|
showDept: false,
|
||||||
|
showType: false
|
||||||
},
|
},
|
||||||
{
|
onRowClick: (jobSpec) => openJobSpecModal(jobSpec, 'view'),
|
||||||
header: '부품 표준 명칭',
|
columns: [
|
||||||
sortKey: 'component_name',
|
{
|
||||||
render: c => formatInline(c.component_name || '-')
|
header: 'ID',
|
||||||
},
|
sortKey: 'id',
|
||||||
{
|
align: 'center',
|
||||||
header: '성능 등급',
|
width: '5%',
|
||||||
sortKey: 'score_tier',
|
render: j => j.id.toString()
|
||||||
align: 'center',
|
},
|
||||||
width: '15%',
|
{
|
||||||
render: c => c.score_tier || '-'
|
header: '직무명',
|
||||||
},
|
sortKey: 'job_name',
|
||||||
{
|
width: '25%',
|
||||||
header: '감점 점수',
|
render: j => `<strong style="color: var(--primary-color); font-size: 14px;">${formatInline(j.job_name || '-')}</strong>`
|
||||||
sortKey: 'deduction',
|
},
|
||||||
align: 'center',
|
{
|
||||||
width: '15%',
|
header: '요구 PC 등급',
|
||||||
render: c => {
|
sortKey: 'required_grade',
|
||||||
const score = c.deduction || 0;
|
align: 'center',
|
||||||
let color = '#3b82f6'; // blue
|
width: '20%',
|
||||||
if (score >= 20) color = '#ef4444'; // red
|
render: j => {
|
||||||
else if (score >= 10) color = '#f59e0b'; // orange
|
const grade = j.required_grade || '중급';
|
||||||
return `<strong style="color: ${color}; font-size: 14px;">-${score}점</strong>`;
|
let badgeClass = 'b-green';
|
||||||
|
let style = 'background-color: #10B981; color: white;';
|
||||||
|
if (grade === '최상급') {
|
||||||
|
badgeClass = 'b-purple';
|
||||||
|
style = 'background-color: #7C3AED; color: white;';
|
||||||
|
} else if (grade === '상급') {
|
||||||
|
badgeClass = 'b-primary';
|
||||||
|
style = 'background-color: #4F46E5; color: white;';
|
||||||
|
} else if (grade === '보급') {
|
||||||
|
badgeClass = 'b-yellow';
|
||||||
|
style = 'background-color: #F59E0B; color: white;';
|
||||||
|
}
|
||||||
|
return `<span class="badge ${badgeClass}" style="${style} padding: 4px 10px; font-size: 0.85rem; font-weight: 700;">${grade}</span>`;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
header: '비고',
|
||||||
|
sortKey: 'remarks',
|
||||||
|
width: '50%',
|
||||||
|
render: j => formatInline(j.remarks || '-')
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
]
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
renderSubTabs(container);
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderSubTabs(container: HTMLElement) {
|
||||||
|
const searchBar = container.querySelector('.search-bar');
|
||||||
|
if (!searchBar) return;
|
||||||
|
|
||||||
|
// 기존에 생성된 탭 바가 있다면 제거하여 중복 방지 (스타일만 수정하는 최소 침습 방식)
|
||||||
|
const existingTabs = container.querySelector('.sub-tab-container');
|
||||||
|
if (existingTabs) existingTabs.remove();
|
||||||
|
|
||||||
|
const tabContainer = document.createElement('div');
|
||||||
|
tabContainer.className = 'sub-tab-container';
|
||||||
|
tabContainer.style.cssText = 'display: flex; justify-content: space-between; align-items: center; padding: 0 2rem; border-bottom: 1px solid var(--hairline); background: var(--canvas);';
|
||||||
|
|
||||||
|
const tab1Active = activePartsMasterSubTab === 'parts-master';
|
||||||
|
const tab2Active = activePartsMasterSubTab === 'job-spec';
|
||||||
|
|
||||||
|
tabContainer.innerHTML = `
|
||||||
|
<div style="display: flex; gap: 1rem;">
|
||||||
|
<button id="tab-parts-master" class="sub-tab-btn ${tab1Active ? 'active' : ''}" style="padding: 1rem 0.5rem; border: none; background: none; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; color: ${tab1Active ? 'var(--primary)' : 'var(--mute)'}; position: relative; border-bottom: 2px solid ${tab1Active ? 'var(--primary)' : 'transparent'}; margin-bottom: -1px;">
|
||||||
|
부품 표준 등급
|
||||||
|
</button>
|
||||||
|
<button id="tab-job-spec" class="sub-tab-btn ${tab2Active ? 'active' : ''}" style="padding: 1rem 0.5rem; border: none; background: none; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; color: ${tab2Active ? 'var(--primary)' : 'var(--mute)'}; position: relative; border-bottom: 2px solid ${tab2Active ? 'var(--primary)' : 'transparent'}; margin-bottom: -1px;">
|
||||||
|
직무별 기준 사양
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div style="font-size: 0.8rem; color: #4B5563; font-weight: 700; display: flex; align-items: center; gap: 4px; background: #F3F4F6; padding: 5px 12px; border-radius: 6px; border: 1px dashed #D1D5DB; margin-bottom: 4px;">
|
||||||
|
<span>💡</span>
|
||||||
|
<span>${tab2Active ? '우측 상단의 [기준 사양 추가] 버튼을 누르거나, 테이블의 행을 클릭하여 관리할 수 있습니다.' : '우측 상단의 [표준 부품 추가] 버튼을 누르거나, 테이블의 행을 클릭하여 관리할 수 있습니다.'}</span>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
searchBar.parentNode!.insertBefore(tabContainer, searchBar);
|
||||||
|
|
||||||
|
const tabPartsMaster = tabContainer.querySelector('#tab-parts-master')!;
|
||||||
|
const tabJobSpec = tabContainer.querySelector('#tab-job-spec')!;
|
||||||
|
|
||||||
|
tabPartsMaster.addEventListener('click', () => {
|
||||||
|
if (activePartsMasterSubTab !== 'parts-master') {
|
||||||
|
activePartsMasterSubTab = 'parts-master';
|
||||||
|
renderPartsMasterList(container);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
tabJobSpec.addEventListener('click', () => {
|
||||||
|
if (activePartsMasterSubTab !== 'job-spec') {
|
||||||
|
activePartsMasterSubTab = 'job-spec';
|
||||||
|
renderPartsMasterList(container);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,29 @@
|
|||||||
import { state } from '../../core/state';
|
import { state } from '../../core/state';
|
||||||
import { openHwModal } from '../../components/Modal/HWModal';
|
import { openHwModal } from '../../components/Modal/HWModal';
|
||||||
import { sortAssets, formatInline, calculatePcScoreDeductive, getPcGrade } from '../../core/utils';
|
import { sortAssets, formatInline, calculatePcScoreDeductive, getPcGrade, isWindows11Incompatible } from '../../core/utils';
|
||||||
import { ASSET_SCHEMA } from '../../core/schema';
|
import { ASSET_SCHEMA } from '../../core/schema';
|
||||||
import { createListView } from './ListFactory';
|
import { createListView } from './ListFactory';
|
||||||
|
import { SortState } from '../../core/tableHandler';
|
||||||
|
|
||||||
|
let persistentSortState: SortState = { key: 'updated_at', direction: 'desc' };
|
||||||
|
|
||||||
export function renderPcList(container: HTMLElement) {
|
export function renderPcList(container: HTMLElement) {
|
||||||
createListView(container, {
|
createListView(container, {
|
||||||
title: 'PC',
|
title: 'PC',
|
||||||
|
persistentSortState,
|
||||||
dataSource: () => {
|
dataSource: () => {
|
||||||
const list = (state.masterData.pc || []).filter((a: any) => a.asset_type !== '서버PC');
|
const list = (state.masterData.pc || []).filter((a: any) => a.asset_type !== '서버PC');
|
||||||
list.forEach((a: any) => {
|
list.forEach((a: any) => {
|
||||||
a['_pc_score'] = calculatePcScoreDeductive(a[ASSET_SCHEMA.CPU.key], a[ASSET_SCHEMA.RAM.key], a[ASSET_SCHEMA.GPU.key], a.purchase_date);
|
a['_pc_score'] = calculatePcScoreDeductive(a[ASSET_SCHEMA.CPU.key], a[ASSET_SCHEMA.RAM.key], a[ASSET_SCHEMA.GPU.key], a.purchase_date);
|
||||||
});
|
});
|
||||||
return sortAssets(list);
|
// 변경일시(updated_at) 내림차순 정렬 (최신 변경 항목이 맨 위로)
|
||||||
|
return list.sort((a: any, b: any) => {
|
||||||
|
const dateA = a.updated_at || a.created_at || '';
|
||||||
|
const dateB = b.updated_at || b.created_at || '';
|
||||||
|
if (dateA < dateB) return 1;
|
||||||
|
if (dateA > dateB) return -1;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
searchKeys: ['CURRENT_DEPT', 'CURRENT_USER', 'MODEL_NAME', 'MAC_ADDR', 'MANAGER_MAIN', 'ASSET_TYPE'],
|
searchKeys: ['CURRENT_DEPT', 'CURRENT_USER', 'MODEL_NAME', 'MAC_ADDR', 'MANAGER_MAIN', 'ASSET_TYPE'],
|
||||||
filterOptions: {
|
filterOptions: {
|
||||||
@@ -93,7 +104,8 @@ export function renderPcList(container: HTMLElement) {
|
|||||||
width: '8%',
|
width: '8%',
|
||||||
render: a => {
|
render: a => {
|
||||||
const score = a._pc_score !== undefined ? a._pc_score : calculatePcScoreDeductive(a[ASSET_SCHEMA.CPU.key], a[ASSET_SCHEMA.RAM.key], a[ASSET_SCHEMA.GPU.key], a.purchase_date);
|
const score = a._pc_score !== undefined ? a._pc_score : calculatePcScoreDeductive(a[ASSET_SCHEMA.CPU.key], a[ASSET_SCHEMA.RAM.key], a[ASSET_SCHEMA.GPU.key], a.purchase_date);
|
||||||
const grade = getPcGrade(score);
|
const isWin11Incompatible = isWindows11Incompatible(a[ASSET_SCHEMA.CPU.key], a[ASSET_SCHEMA.RAM.key]);
|
||||||
|
const grade = getPcGrade(score, isWin11Incompatible);
|
||||||
return `<span class="badge ${grade.class}" title="성능 점수: ${score}점">${grade.name}</span>`;
|
return `<span class="badge ${grade.class}" title="성능 점수: ${score}점">${grade.name}</span>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,9 +9,10 @@ export function renderUserList(container: HTMLElement) {
|
|||||||
dataSource: () => state.masterData.users || [],
|
dataSource: () => state.masterData.users || [],
|
||||||
searchKeys: ['emp_no', 'user_name', 'dept_name', 'position', 'status'],
|
searchKeys: ['emp_no', 'user_name', 'dept_name', 'position', 'status'],
|
||||||
filterOptions: {
|
filterOptions: {
|
||||||
keywordLabel: '사번/이름/부서/직급 검색',
|
keywordLabel: '사번/이름/조직/직무 검색',
|
||||||
showCorp: false,
|
showCorp: false,
|
||||||
showDept: true,
|
showDept: true,
|
||||||
|
showPosition: true,
|
||||||
showType: false
|
showType: false
|
||||||
},
|
},
|
||||||
onRowClick: (user) => openUserModal(user, 'view'),
|
onRowClick: (user) => openUserModal(user, 'view'),
|
||||||
@@ -38,7 +39,7 @@ export function renderUserList(container: HTMLElement) {
|
|||||||
render: u => formatInline(u.dept_name || '-')
|
render: u => formatInline(u.dept_name || '-')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
header: '직급 (직무)',
|
header: '직무',
|
||||||
sortKey: 'position',
|
sortKey: 'position',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
width: '25%',
|
width: '25%',
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user