fix: set non deletable control value boundary error #595
This commit is contained in:
@@ -650,6 +650,7 @@ export class Control {
|
|||||||
editorOptions: this.options
|
editorOptions: this.options
|
||||||
})
|
})
|
||||||
const text = new TextControl(element, this)
|
const text = new TextControl(element, this)
|
||||||
|
this.activeControl = text
|
||||||
if (value) {
|
if (value) {
|
||||||
text.setValue(formatValue, controlContext, controlRule)
|
text.setValue(formatValue, controlContext, controlRule)
|
||||||
} else {
|
} else {
|
||||||
@@ -657,6 +658,7 @@ export class Control {
|
|||||||
}
|
}
|
||||||
} else if (type === ControlType.SELECT) {
|
} else if (type === ControlType.SELECT) {
|
||||||
const select = new SelectControl(element, this)
|
const select = new SelectControl(element, this)
|
||||||
|
this.activeControl = select
|
||||||
if (value) {
|
if (value) {
|
||||||
select.setSelect(value, controlContext, controlRule)
|
select.setSelect(value, controlContext, controlRule)
|
||||||
} else {
|
} else {
|
||||||
@@ -664,13 +666,17 @@ export class Control {
|
|||||||
}
|
}
|
||||||
} else if (type === ControlType.CHECKBOX) {
|
} else if (type === ControlType.CHECKBOX) {
|
||||||
const checkbox = new CheckboxControl(element, this)
|
const checkbox = new CheckboxControl(element, this)
|
||||||
|
this.activeControl = checkbox
|
||||||
const codes = value?.split(',') || []
|
const codes = value?.split(',') || []
|
||||||
checkbox.setSelect(codes, controlContext, controlRule)
|
checkbox.setSelect(codes, controlContext, controlRule)
|
||||||
} else if (type === ControlType.RADIO) {
|
} else if (type === ControlType.RADIO) {
|
||||||
const radio = new RadioControl(element, this)
|
const radio = new RadioControl(element, this)
|
||||||
|
this.activeControl = radio
|
||||||
const codes = value ? [value] : []
|
const codes = value ? [value] : []
|
||||||
radio.setSelect(codes, controlContext, controlRule)
|
radio.setSelect(codes, controlContext, controlRule)
|
||||||
}
|
}
|
||||||
|
// 模拟控件激活后销毁
|
||||||
|
this.activeControl = null
|
||||||
// 修改后控件结束索引
|
// 修改后控件结束索引
|
||||||
let newEndIndex = i
|
let newEndIndex = i
|
||||||
while (newEndIndex < elementList.length) {
|
while (newEndIndex < elementList.length) {
|
||||||
@@ -681,6 +687,8 @@ export class Control {
|
|||||||
i = newEndIndex
|
i = newEndIndex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 销毁旧控件
|
||||||
|
this.destroyControl()
|
||||||
// 页眉、内容区、页脚同时处理
|
// 页眉、内容区、页脚同时处理
|
||||||
const data = [
|
const data = [
|
||||||
this.draw.getHeaderElementList(),
|
this.draw.getHeaderElementList(),
|
||||||
|
|||||||
Reference in New Issue
Block a user