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
+32 -28
View File
@@ -1,35 +1,39 @@
const { DataTypes } = require('sequelize');
const { sequelize } = require('../db');
const ConsumableCategory = sequelize.define('ConsumableCategory', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
const ConsumableCategory = sequelize.define(
'ConsumableCategory',
{
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
name: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
comment: '分类名称',
},
description: {
type: DataTypes.STRING,
comment: '分类描述',
},
sortOrder: {
type: DataTypes.INTEGER,
defaultValue: 0,
comment: '排序顺序',
},
status: {
type: DataTypes.STRING,
defaultValue: 'active',
comment: '状态: active-启用, inactive-停用',
},
},
name: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
comment: '分类名称'
},
description: {
type: DataTypes.STRING,
comment: '分类描述'
},
sortOrder: {
type: DataTypes.INTEGER,
defaultValue: 0,
comment: '排序顺序'
},
status: {
type: DataTypes.STRING,
defaultValue: 'active',
comment: '状态: active-启用, inactive-停用'
{
tableName: 'consumable_categories',
timestamps: true,
}
}, {
tableName: 'consumable_categories',
timestamps: true
});
);
module.exports = ConsumableCategory;