fix(audit): 실사 승인 대기 목록 필터링 오류 수정 및 승인완료 배지 표시 추가
- GET /api/audit/pending API에서 PENDING 상태인 내역만 반환하도록 SQL 쿼리 수정 - 실사 승인 및 맵 저장 시 asset_location.location_detail에 표준 상세 위치가 저장되도록 개선 - 실사 승인 완료된 자산에 대해 상세 모달, 위치 보기, 목록 보기에 '승인완료' 배지 노출 처리 - 목록 보기에서 기존 위치 표시 형식 및 툴팁을 훼손하지 않도록 배지를 분리하여 렌더링
This commit is contained in:
@@ -681,7 +681,19 @@ export function createListView(container: HTMLElement, config: ListViewConfig) {
|
||||
const rendered = col.render(asset);
|
||||
const rawText = rendered.replace(/<[^>]*>/g, '').trim();
|
||||
const titleAttr = rawText && rawText !== '-' ? `title="${rawText.replace(/"/g, '"')}"` : '';
|
||||
return `<td class="${alignmentClass} ${customClass}" style="${col.width ? `width:${col.width};` : ''}" ${titleAttr}>${rendered}</td>`;
|
||||
|
||||
let displayContent = rendered;
|
||||
if (col.header === ASSET_SCHEMA.LOCATION.ui && asset.is_audit_approved) {
|
||||
const justify = col.align === 'center' ? 'center' : (col.align === 'right' ? 'flex-end' : 'flex-start');
|
||||
displayContent = `
|
||||
<div style="display: inline-flex; align-items: center; gap: 6px; justify-content: ${justify}; width: 100%;">
|
||||
<span>${rendered}</span>
|
||||
<span style="display: inline-flex; align-items: center; background-color: rgba(16, 185, 129, 0.08); color: #059669; border: 1px solid rgba(16, 185, 129, 0.18); padding: 1px 4px; border-radius: 4px; font-size: 10px; font-weight: 600; white-space: nowrap; line-height: 1.2; vertical-align: middle;">승인완료</span>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
return `<td class="${alignmentClass} ${customClass}" style="${col.width ? `width:${col.width};` : ''}" ${titleAttr}>${displayContent}</td>`;
|
||||
}).join('')}</tr>`).join('');
|
||||
|
||||
tbody.querySelectorAll('.asset-row').forEach((tr, idx) => { tr.addEventListener('click', () => config.onRowClick && config.onRowClick(filtered[idx])); });
|
||||
|
||||
@@ -241,7 +241,10 @@ export async function renderLocationView(container: HTMLElement) {
|
||||
<span class="service-type-badge">${asset.service_type || '운영'}</span>
|
||||
<span class="asset-type-label">${asset.asset_type || 'PC'}</span>
|
||||
</div>
|
||||
<button id="btn-view-from-loc" class="btn btn-primary btn-sm">조회</button>
|
||||
<div style="display: inline-flex; align-items: center; gap: 0.5rem;">
|
||||
${asset.is_audit_approved ? `<span style="display: inline-flex; align-items: center; background-color: rgba(16, 185, 129, 0.08); color: #059669; border: 1px solid rgba(16, 185, 129, 0.18); padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; height: 18px; line-height: 1; white-space: nowrap; vertical-align: middle;">승인완료</span>` : ''}
|
||||
<button id="btn-view-from-loc" class="btn btn-primary btn-sm">조회</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user