feat: 优化3D可视化性能并更新文档
- 实现3D可视化性能优化(降低DPR、阴影贴图、简化光源) - 实现LOD多级细节系统,根据相机距离自动切换 - 添加设备弹出动画开关,默认关闭 - 修复设备缩放时位置偏移问题 - 更新README添加项目截图占位符 - 精简DEPLOYMENT.md文档,添加Gitee仓库支持 - 更新CHANGELOG.md记录v1.1.0版本
This commit is contained in:
@@ -83,15 +83,27 @@ router.post('/config', async (req, res) => {
|
||||
// 批量更新字段配置
|
||||
const updatedFields = [];
|
||||
for (const config of fieldConfigs) {
|
||||
// 使用fieldName作为更新条件,因为这是唯一的
|
||||
const [updated] = await DeviceField.update(
|
||||
{ visible: config.visible },
|
||||
{ where: { fieldName: config.fieldName } }
|
||||
);
|
||||
// 检查字段是否存在
|
||||
const existingField = await DeviceField.findOne({ where: { fieldName: config.fieldName } });
|
||||
|
||||
if (updated) {
|
||||
const updatedField = await DeviceField.findOne({ where: { fieldName: config.fieldName } });
|
||||
updatedFields.push(updatedField);
|
||||
if (existingField) {
|
||||
// 更新现有字段
|
||||
await existingField.update({
|
||||
visible: config.visible,
|
||||
displayName: config.displayName // 同时更新显示名称,以防变化
|
||||
});
|
||||
updatedFields.push(existingField);
|
||||
} else {
|
||||
// 创建新字段
|
||||
const newField = await DeviceField.create({
|
||||
fieldName: config.fieldName,
|
||||
visible: config.visible,
|
||||
displayName: config.displayName,
|
||||
fieldType: config.fieldType || 'text',
|
||||
required: false, // 默认为非必填
|
||||
order: 0 // 默认顺序
|
||||
});
|
||||
updatedFields.push(newField);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user