diff --git a/public/demo/compare/compareSidePanel.css b/public/demo/compare/dxfComparePanel.css similarity index 98% rename from public/demo/compare/compareSidePanel.css rename to public/demo/compare/dxfComparePanel.css index 11b5c23..d545c3b 100644 --- a/public/demo/compare/compareSidePanel.css +++ b/public/demo/compare/dxfComparePanel.css @@ -9,7 +9,7 @@ b { .compare-panel-container { position: absolute; top: 80px; - right: 0; + right: 10px; width: 160px; height: auto; min-height: 200px; diff --git a/public/demo/compare/compareSidePanel.js b/public/demo/compare/dxfComparePanel.js similarity index 85% rename from public/demo/compare/compareSidePanel.js rename to public/demo/compare/dxfComparePanel.js index 0392a59..47de732 100644 --- a/public/demo/compare/compareSidePanel.js +++ b/public/demo/compare/dxfComparePanel.js @@ -1,5 +1,5 @@ /* eslint-disable no-undef */ -export default class CompareSidePanel { +export default class DxfComparePanel { compareDetail; container; viewer; @@ -29,13 +29,16 @@ export default class CompareSidePanel { panelContainer.appendChild(compareDetail); this.compareDetail = compareDetail; - const changes = this.viewer.changes; + const changes = this.viewer.getCompareChanges(); + if (!changes) { + return; + } const changesValues = Object.values(changes); header.innerHTML = `差异列表(${changesValues.length})`; const addedChangesValues = changesValues.filter((val) => val.type === "Added"); - const deletedChangeValues = changesValues.filter((val) => val.type === "Deleted"); + const deletedChangeValues = changesValues.filter((val) => val.type === "Removed"); const modifiedChanageValues = changesValues.filter((val) => val.type === "Modified"); if (addedChangesValues.length > 0) { @@ -62,7 +65,7 @@ export default class CompareSidePanel { let listFragment = ""; changesValues.forEach((val) => { - listFragment += `