refactor: integrate software assets into unified schema and optimize backend API

This commit is contained in:
2026-04-30 09:34:29 +09:00
parent 68cb5f9767
commit 2af79cdad3
6 changed files with 363 additions and 451 deletions

View File

@@ -25,8 +25,7 @@ export function renderSwDashboard(container: HTMLElement) {
const allSw = [...state.masterData.subSw, ...state.masterData.permSw];
allSw.forEach(sw => {
const userMapping = state.masterData.swUsers.find(u => u.sw_id === sw.id);
const assigned = userMapping ? (userMapping.userData ? userMapping.userData.length : 0) : 0;
const assigned = state.masterData.swUsers.filter(u => u.sw_id === sw.id).length;
const qty = typeof sw. === 'number' ? sw.수량 : parseInt(sw.||'0', 10);
const priceStr = sw. ? String(sw.).replace(/,/g, '') : '0';
const price = parseInt(priceStr, 10) || 0;

View File

@@ -95,8 +95,7 @@ export function renderSwList(container: HTMLElement) {
}
filtered.forEach((asset, idx) => {
const mapping = state.masterData.swUsers.find(u => u.sw_id === asset.id);
const assigned = mapping ? (mapping.userData || []).length : 0;
const assigned = state.masterData.swUsers.filter(u => u.sw_id === asset.id).length;
const qty = typeof asset. === 'number' ? asset.수량 : parseInt(asset.||'0', 10);
const avail = qty - assigned;