refactor: 统一代码风格并迁移至 ESLint 新配置

style(backend): 格式化模型文件代码
style(frontend): 调整组件代码格式
chore: 删除旧 ESLint 配置并添加新配置
refactor(backend): 重构模型定义语法
style: 统一箭头函数和对象属性简写
This commit is contained in:
zhang1106
2026-03-27 19:12:16 +08:00
parent 6a8d4144ff
commit 63f0cb570e
166 changed files with 15483 additions and 11170 deletions
@@ -120,7 +120,17 @@ async function updateExistingLogs() {
try {
const consumables = await Consumable.findAll({
attributes: ['consumableId', 'category', 'unit', 'unitPrice', 'supplier', 'location', 'minStock', 'maxStock', 'status']
attributes: [
'consumableId',
'category',
'unit',
'unitPrice',
'supplier',
'location',
'minStock',
'maxStock',
'status',
],
});
const consumableMap = new Map();
@@ -133,14 +143,14 @@ async function updateExistingLogs() {
location: c.location,
minStock: c.minStock,
maxStock: c.maxStock,
status: c.status
status: c.status,
});
});
const logs = await ConsumableLog.findAll({
where: {
consumableSnapshot: null
}
consumableSnapshot: null,
},
});
let updatedCount = 0;
@@ -155,10 +165,9 @@ async function updateExistingLogs() {
console.log(`✓ 更新了 ${updatedCount} 条日志的快照信息`);
const deletedLogsCount = await ConsumableLog.count({
where: { operationType: 'delete' }
where: { operationType: 'delete' },
});
console.log(`✓ 当前有 ${deletedLogsCount} 条删除类型日志`);
} catch (error) {
console.log('! 更新现有日志数据时出错:', error.message);
}