diff --git a/Release/database/XNSim.db b/Release/database/XNSim.db index ce1090b..8513819 100644 Binary files a/Release/database/XNSim.db and b/Release/database/XNSim.db differ diff --git a/XNSimHtml/components/data-collection.js b/XNSimHtml/components/data-collection.js index bf7b0f3..e5db94b 100644 --- a/XNSimHtml/components/data-collection.js +++ b/XNSimHtml/components/data-collection.js @@ -498,11 +498,44 @@ class DataCollection extends HTMLElement { .left-panel { width: 320px; min-width: 280px; + flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; height: 100%; } + .right-panel { + flex: 1 1 0; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-width: 0; + min-height: 200px; + background: #fff; + border-radius: 8px; + box-shadow: 0 2px 8px rgba(0,0,0,0.06); + margin-bottom: 16px; + } + .loading-spinner { + border: 6px solid #f3f3f3; + border-top: 6px solid #1890ff; + border-radius: 50%; + width: 48px; + height: 48px; + animation: spin 1s linear infinite; + margin-bottom: 12px; + } + @keyframes spin { + 0% { transform: rotate(0deg);} + 100% { transform: rotate(360deg);} + } + .loading-text { + color: #1890ff; + font-size: 16px; + font-weight: bold; + margin-top: 0; + } .panel-section { background: #fff; border-radius: 8px; @@ -607,9 +640,15 @@ class DataCollection extends HTMLElement { display: flex; align-items: center; } + .input-row-abs { + position: relative; + width: 100%; + display: flex; + align-items: center; + } .input-box { width: 100%; - padding: 0 8px; + padding-right: 36px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; @@ -628,6 +667,22 @@ class DataCollection extends HTMLElement { background-color: #f5f5f5; cursor: not-allowed; } + .input-unit { + position: absolute; + right: 8px; + top: 50%; + transform: translateY(-50%); + font-size: 16px; + color: #888; + white-space: nowrap; + } + .action-btn.icon-btn { + position: absolute; + right: 4px; + top: 50%; + transform: translateY(-50%); + margin-left: 0; + } .tree-section { background: #fff; border-radius: 8px; @@ -726,7 +781,7 @@ class DataCollection extends HTMLElement {
- +
@@ -735,18 +790,24 @@ class DataCollection extends HTMLElement {
-
采集频率 (Hz)
- +
采集频率
+
+ + Hz +
-
采集时长 (秒)
- +
采集时长
+
+ + +
输出文件
-
+
-
@@ -774,6 +835,12 @@ class DataCollection extends HTMLElement {
+
+ ${this.collectStatus === 2 ? ` +
+
数据采集中...
+ ` : ''} +
`; @@ -789,7 +856,6 @@ class DataCollection extends HTMLElement { itemEl.ondblclick = (e) => { const name = itemEl.getAttribute('data-interfacename'); const struct = itemEl.getAttribute('data-modelstructname'); - console.log('双击接口:', name, struct); // 添加调试日志 this.handleInterfaceDblClick(name, struct); }; }); @@ -971,6 +1037,7 @@ class DataCollection extends HTMLElement { console.error('加载采集数据失败:', error); alert('加载采集数据失败: ' + error.message); } + this.render(); } else { throw new Error(result.message); } @@ -998,6 +1065,12 @@ class DataCollection extends HTMLElement { const result = await response.json(); if (result.success) { + // 关闭所有浮动窗口 + this.chartWindows.forEach((window, windowId) => { + window.dispatchEvent(new CustomEvent('close')); + window.remove(); + }); + this.chartWindows.clear(); // 更新采集状态 this.collectStatus = 2; // 设置为采集中 // 更新按钮状态 @@ -1007,6 +1080,7 @@ class DataCollection extends HTMLElement { loadScriptBtn.disabled = true; // 禁用下载按钮 if (downloadBtn) downloadBtn.disabled = true; + this.render(); } else { throw new Error(result.message); }