This commit is contained in:
2025-10-01 00:29:21 +08:00
parent 5737973197
commit b3ab17660a
4 changed files with 108 additions and 101 deletions

View File

@@ -118,7 +118,6 @@ export default {
data.sort((a, b) => a.id - b.id);
this.allDevices = data;
this.tableData = this.buildTreeData(data);
console.log('Final tableData:', this.tableData); // 添加这行日志
this.originalTableData = [...this.tableData]; // 保存原始顺序
} catch (err) {
this.error = err.message || '未知错误';

View File

@@ -104,8 +104,9 @@ export default {
this.loading = true;
this.error = null;
try {
const data = await deviceTemplateService.getDeviceTemplates();
this.tableData = data;
const response = await deviceTemplateService.getDeviceTemplates();
// 确保只将数组部分赋值给 tableData
this.tableData = response.data || [];
} catch (err) {
this.error = err.message || '未知错误';
console.error('加载设备模板列表失败:', err);