feat(系统设置): 新增系统设置模块

- 添加SystemSetting模型用于存储系统配置
- 实现系统设置API路由,支持CRUD操作
- 新增系统设置前端页面,包含全局配置、外观设置、数据备份和关于页面
- 设备批量操作增强,支持批量移动、状态变更和导出
- 工单模型允许deviceId为空
This commit is contained in:
zhang1106
2025-12-29 16:10:42 +08:00
parent b7f806f7d3
commit a7499de748
10 changed files with 2089 additions and 136 deletions
+47
View File
@@ -0,0 +1,47 @@
const { DataTypes } = require('sequelize');
const { sequelize } = require('../db');
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: '是否可编辑'
}
}, {
tableName: 'system_settings',
timestamps: true,
indexes: [
{ fields: ['category'] }
]
});
module.exports = SystemSetting;