fix: set default style for control using executeSetControlProperties #658

This commit is contained in:
Hufe921
2024-06-22 22:45:55 +08:00
parent 885168765d
commit 7b5079c9b6
+8
View File
@@ -42,6 +42,7 @@ import { SelectControl } from './select/SelectControl'
import { TextControl } from './text/TextControl' import { TextControl } from './text/TextControl'
import { DateControl } from './date/DateControl' import { DateControl } from './date/DateControl'
import { MoveDirection } from '../../../dataset/enum/Observer' import { MoveDirection } from '../../../dataset/enum/Observer'
import { CONTROL_STYLE_ATTR } from '../../../dataset/constant/Element'
interface IMoveCursorResult { interface IMoveCursorResult {
newIndex: number newIndex: number
@@ -815,6 +816,13 @@ export class Control {
...properties, ...properties,
value: element.control.value value: element.control.value
} }
// 控件默认样式
CONTROL_STYLE_ATTR.forEach(key => {
const controlStyleProperty = properties[key]
if (controlStyleProperty) {
Reflect.set(element, key, controlStyleProperty)
}
})
// 修改后控件结束索引 // 修改后控件结束索引
let newEndIndex = i let newEndIndex = i
while (newEndIndex < elementList.length) { while (newEndIndex < elementList.length) {