feat: 拖拽布局-优化问题

flex-api
lichaojun 1 month ago
parent 0006edd64e
commit 64babb1a99

@ -27,38 +27,3 @@
* 有任何不确认的地方,请先向我确认再执行任务
* 请任何时候使用中文与我沟通或者确认,包括项目中使用注释也使用中文
* 不要更改之前的代码逻辑,包括删除注释等,只允许添加代码,或者当老代码不能满足需求的时候才允许修改
## 任务
* 在index.js中conputedInitData函数当type为save的时候帮我处理带有下划线的数据数据结构参考data.json和下面示例(xxx为省略结果不代表真实值)
```
mainData = {
xxx,
children: [{
"focusedStyle_background": "",
"focusedStyle_border_width": 0,
"focusedStyle_border_color": "",
"focusedStyle_scale": 1,
...这里后续还有可能扩展(例如)
"other_name": "",
}]
}
最终转换为(最终转换的结果需要保留原址类似focusedStyle_background)
mainData = {
xxx,
children: [{
focusedStyle: {
background: xxx,
border: {
width: xxx,
color: xxx
},
scale: xxx
},
...这里后续还有扩展也保持一样的转换(例如)
other: {
name: xxx
}
}]
}
```

@ -85,6 +85,48 @@
下次用户打开页面时流程会从第1步重新开始但这次会从 localStorage 加载上次保存的数据,从而恢复之前的布局状态。
## 历史任务
* 在index.js中conputedInitData函数当type为save的时候帮我处理带有下划线的数据数据结构参考data.json和下面示例(xxx为省略结果不代表真实值)
```
mainData = {
xxx,
children: [{
"focusedStyle_background": "",
"focusedStyle_border_width": 0,
"focusedStyle_border_color": "",
"focusedStyle_scale": 1,
...这里后续还有可能扩展(例如)
"other_name": "",
}]
}
最终转换为(最终转换的结果需要保留原址类似focusedStyle_background)
mainData = {
xxx,
children: [{
focusedStyle: {
background: xxx,
border: {
width: xxx,
color: xxx
},
scale: xxx
},
...这里后续还有扩展也保持一样的转换(例如)
other: {
name: xxx
}
}]
}
```
## 对话记录
### 本次会话总结
- **任务**: 在 `js/index.js``conputedInitData` 函数中,当 `type` 为 'save' 时,处理带有下划线的属性(例如 `focusedStyle_background`),将其转换为嵌套对象结构(例如 `focusedStyle: { background: xxx }`),并保留原始带下划线的属性。

@ -48,7 +48,7 @@
</div>
</div>
<div class="component-item grid-stack-item">
<div class="grid-stack-item-content"><span></span></div>
<div class="grid-stack-item-content"><span></span></div>
</div>
</div>
<div

@ -545,6 +545,7 @@
.hide();
// 处理右侧面板的显示/隐藏
currentComponent = null;
hidePropsPanel();
});
};

Loading…
Cancel
Save