fix: resolve all TypeScript build errors after Setting branch merge
This commit is contained in:
@@ -77,10 +77,10 @@ export function renderHwDashboard(container: HTMLElement) {
|
||||
</div>
|
||||
<div class="dashboard-card stat-card">
|
||||
<div class="stat-label">최신 도입 모델 (${latestYear}년)</div>
|
||||
<div class="stat-value" style="font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" title="${latestAsset?.모델명 || '정보 없음'}">
|
||||
${latestAsset?.모델명 || '정보 없음'}
|
||||
<div class="stat-value" style="font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" title="${(latestAsset as any)?.모델명 || '정보 없음'}">
|
||||
${(latestAsset as any)?.모델명 || '정보 없음'}
|
||||
</div>
|
||||
<div class="stat-footer">가장 최근 자산번호: ${latestAsset?.자산코드 || '-'}</div>
|
||||
<div class="stat-footer">가장 최근 자산번호: ${(latestAsset as any)?.자산코드 || '-'}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ export function renderDashboard(mainContent: HTMLElement) {
|
||||
|
||||
// 기존 차트 리소스 해제
|
||||
if (state.activeCharts) {
|
||||
state.activeCharts.forEach(c => {
|
||||
state.activeCharts.forEach((c: any) => {
|
||||
if (c && typeof c.destroy === 'function') c.destroy();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ export function renderStorageList(container: HTMLElement) {
|
||||
const filterBar = document.createElement('div');
|
||||
filterBar.className = 'search-bar';
|
||||
|
||||
const corps = Array.from(new Set(fullList.map(a => a[ASSET_SCHEMA.CORP.key]))).filter(Boolean).sort();
|
||||
const orgUnits = Array.from(new Set(fullList.map(a => a[ASSET_SCHEMA.ORG.key]))).filter(Boolean).sort();
|
||||
const corps = Array.from(new Set(fullList.map(a => (a as any)[ASSET_SCHEMA.CORP.key]))).filter(Boolean).sort();
|
||||
const orgUnits = Array.from(new Set(fullList.map(a => (a as any)[ASSET_SCHEMA.ORG.key]))).filter(Boolean).sort();
|
||||
|
||||
filterBar.innerHTML = `
|
||||
<div class="search-item flex-1">
|
||||
@@ -70,10 +70,10 @@ export function renderStorageList(container: HTMLElement) {
|
||||
|
||||
const filtered = fullList.filter(asset => {
|
||||
const matchKeyword = !keyword ||
|
||||
String(asset[ASSET_SCHEMA.ASSET_CODE.key]||'').toLowerCase().includes(keyword) ||
|
||||
String(asset[ASSET_SCHEMA.ORG.key]||'').toLowerCase().includes(keyword);
|
||||
const matchCorp = !corp || asset[ASSET_SCHEMA.CORP.key] === corp;
|
||||
const matchOrg = !orgUnit || asset[ASSET_SCHEMA.ORG.key] === orgUnit;
|
||||
String((asset as any)[ASSET_SCHEMA.ASSET_CODE.key]||'').toLowerCase().includes(keyword) ||
|
||||
String((asset as any)[ASSET_SCHEMA.ORG.key]||'').toLowerCase().includes(keyword);
|
||||
const matchCorp = !corp || (asset as any)[ASSET_SCHEMA.CORP.key] === corp;
|
||||
const matchOrg = !orgUnit || (asset as any)[ASSET_SCHEMA.ORG.key] === orgUnit;
|
||||
return matchKeyword && matchCorp && matchOrg;
|
||||
});
|
||||
|
||||
@@ -87,8 +87,8 @@ export function renderStorageList(container: HTMLElement) {
|
||||
const tr = document.createElement('tr');
|
||||
tr.style.cursor = 'pointer';
|
||||
|
||||
const mainManager = asset[ASSET_SCHEMA.MANAGER_MAIN.key] || '';
|
||||
const subManager = asset[ASSET_SCHEMA.MANAGER_SUB.key] || '';
|
||||
const mainManager = (asset as any)[ASSET_SCHEMA.MANAGER_MAIN.key] || '';
|
||||
const subManager = (asset as any)[ASSET_SCHEMA.MANAGER_SUB.key] || '';
|
||||
const managerHtml = [
|
||||
mainManager ? `${createBadge('정', 'primary')} ${mainManager}` : '',
|
||||
subManager ? `${createBadge('부', 'muted')} ${subManager}` : ''
|
||||
@@ -96,12 +96,12 @@ export function renderStorageList(container: HTMLElement) {
|
||||
|
||||
tr.innerHTML = `
|
||||
<td class="text-center">${idx+1}</td>
|
||||
<td class="text-center">${asset[ASSET_SCHEMA.CORP.key]}</td>
|
||||
<td class="text-center">${asset[ASSET_SCHEMA.ORG.key]||'-'}</td>
|
||||
<td class="text-center">${asset[ASSET_SCHEMA.ASSET_CODE.key]}</td>
|
||||
<td class="text-center">${(asset as any)[ASSET_SCHEMA.CORP.key]}</td>
|
||||
<td class="text-center">${(asset as any)[ASSET_SCHEMA.ORG.key]||'-'}</td>
|
||||
<td class="text-center">${(asset as any)[ASSET_SCHEMA.ASSET_CODE.key]}</td>
|
||||
<td>${formatInline(asset.용도)}</td>
|
||||
<td>${formatInline(asset.상세)}</td>
|
||||
<td class="text-center">${formatInline(asset[ASSET_SCHEMA.LOCATION.key])}</td>
|
||||
<td class="text-center">${formatInline((asset as any)[ASSET_SCHEMA.LOCATION.key])}</td>
|
||||
<td class="text-center">${managerHtml || '-'}</td>
|
||||
`;
|
||||
tr.addEventListener('click', () => openHwModal(asset, 'view'));
|
||||
|
||||
@@ -76,9 +76,9 @@ export function renderSwList(container: HTMLElement) {
|
||||
const corp = corpSelect ? corpSelect.value : '';
|
||||
|
||||
const filtered = fullList.filter(asset => {
|
||||
const matchKeyword = !keyword || (asset[ASSET_SCHEMA.PRODUCT.key] || '').toLowerCase().includes(keyword) || (asset.부서 || '').toLowerCase().includes(keyword);
|
||||
const matchKeyword = !keyword || ((asset as any)[ASSET_SCHEMA.PRODUCT.key] || '').toLowerCase().includes(keyword) || (asset.부서 || '').toLowerCase().includes(keyword);
|
||||
const matchField = !field || asset.분야 === field;
|
||||
const matchCorp = !corp || asset[ASSET_SCHEMA.CORP.key] === corp;
|
||||
const matchCorp = !corp || (asset as any)[ASSET_SCHEMA.CORP.key] === corp;
|
||||
return matchKeyword && matchField && matchCorp;
|
||||
});
|
||||
|
||||
@@ -90,14 +90,14 @@ export function renderSwList(container: HTMLElement) {
|
||||
|
||||
filtered.forEach((asset, idx) => {
|
||||
const assigned = state.masterData.swUsers.filter(u => u.sw_id === asset.id).length;
|
||||
const qty = typeof asset[ASSET_SCHEMA.QTY.key] === 'number' ? asset[ASSET_SCHEMA.QTY.key] : parseInt(asset[ASSET_SCHEMA.QTY.key]||'0', 10);
|
||||
const qty = typeof (asset as any)[ASSET_SCHEMA.QTY.key] === 'number' ? (asset as any)[ASSET_SCHEMA.QTY.key] : parseInt((asset as any)[ASSET_SCHEMA.QTY.key]||'0', 10);
|
||||
const avail = qty - assigned;
|
||||
|
||||
let statusBadge = '';
|
||||
if (isSub) {
|
||||
let isExpired = false;
|
||||
if (asset[ASSET_SCHEMA.EXPIRY.key]) {
|
||||
const parts = asset[ASSET_SCHEMA.EXPIRY.key].split('~');
|
||||
if ((asset as any)[ASSET_SCHEMA.EXPIRY.key]) {
|
||||
const parts = (asset as any)[ASSET_SCHEMA.EXPIRY.key].split('~');
|
||||
const endDateStr = parts[parts.length - 1].trim().replace(/\./g, '-');
|
||||
const endDate = new Date(endDateStr);
|
||||
if (!isNaN(endDate.getTime())) {
|
||||
@@ -117,12 +117,12 @@ export function renderSwList(container: HTMLElement) {
|
||||
<td style="text-align:center;">${idx+1}</td>
|
||||
<td style="text-align:center;">${statusBadge}</td>
|
||||
<td style="text-align:center;">${asset.분야||''}</td>
|
||||
<td style="text-align:center;">${asset[ASSET_SCHEMA.CORP.key]}</td>
|
||||
<td style="text-align:center;">${(asset as any)[ASSET_SCHEMA.CORP.key]}</td>
|
||||
<td style="text-align:center;">${asset.부서||''}</td>
|
||||
<td>${asset[ASSET_SCHEMA.PRODUCT.key]}</td>
|
||||
<td style="text-align:center;">${asset[ASSET_SCHEMA.PURCHASE_YM.key]||''}</td>
|
||||
${isSub ? `<td style="text-align:center;">${asset[ASSET_SCHEMA.EXPIRY.key]||''}</td>` : ''}
|
||||
<td style="text-align:right;">${Number(asset[ASSET_SCHEMA.PRICE.key]||0).toLocaleString()}</td>
|
||||
<td>${(asset as any)[ASSET_SCHEMA.PRODUCT.key]}</td>
|
||||
<td style="text-align:center;">${(asset as any)[ASSET_SCHEMA.PURCHASE_YM.key]||''}</td>
|
||||
${isSub ? `<td style="text-align:center;">${(asset as any)[ASSET_SCHEMA.EXPIRY.key]||''}</td>` : ''}
|
||||
<td style="text-align:right;">${Number((asset as any)[ASSET_SCHEMA.PRICE.key]||0).toLocaleString()}</td>
|
||||
<td style="text-align:center;">${qty}</td>
|
||||
<td style="text-align:center;"><strong style="color: ${avail > 0 ? 'var(--primary-color)' : 'var(--danger)'}">${avail}</strong></td>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user