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
+42 -40
View File
@@ -1,47 +1,49 @@
const { DataTypes } = require('sequelize');
const { sequelize } = require('../db');
const SystemSetting = sequelize.define('SystemSetting', {
settingKey: {
type: DataTypes.STRING(100),
primaryKey: true,
allowNull: false,
comment: '设置键名'
const SystemSetting = sequelize.define(
'SystemSetting',
{
settingKey: {
type: DataTypes.STRING(100),
primaryKey: true,
allowNull: false,
comment: '设置键名',
},
settingValue: {
type: DataTypes.TEXT,
allowNull: true,
comment: '设置值(JSON格式)',
},
settingType: {
type: DataTypes.STRING(20),
allowNull: false,
defaultValue: 'string',
comment: '设置类型: string, number, boolean, json, array',
},
category: {
type: DataTypes.STRING(50),
allowNull: false,
defaultValue: 'general',
comment: '设置分类: general, appearance, backup, about',
},
description: {
type: DataTypes.STRING(255),
allowNull: true,
comment: '设置描述',
},
isEditable: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true,
comment: '是否可编辑',
},
},
settingValue: {
type: DataTypes.TEXT,
allowNull: true,
comment: '设置值(JSON格式)'
},
settingType: {
type: DataTypes.STRING(20),
allowNull: false,
defaultValue: 'string',
comment: '设置类型: string, number, boolean, json, array'
},
category: {
type: DataTypes.STRING(50),
allowNull: false,
defaultValue: 'general',
comment: '设置分类: general, appearance, backup, about'
},
description: {
type: DataTypes.STRING(255),
allowNull: true,
comment: '设置描述'
},
isEditable: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true,
comment: '是否可编辑'
{
tableName: 'system_settings',
timestamps: true,
indexes: [{ fields: ['category'] }],
}
}, {
tableName: 'system_settings',
timestamps: true,
indexes: [
{ fields: ['category'] }
]
});
);
module.exports = SystemSetting;