mirror of
https://gitee.com/hoslay/ddei-editor.git
synced 2025-12-06 17:18:36 +08:00
控件创建和权限API优化
This commit is contained in:
parent
02daec008a
commit
3e0843ed74
@ -137,8 +137,11 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const options2 = markRaw({
|
const options2 = markRaw({
|
||||||
|
|
||||||
config: {
|
config: {
|
||||||
"readonly": true,
|
EXT_STAGE_WIDTH:false,
|
||||||
|
// "readonly": true,
|
||||||
|
access:{"DEL":false},
|
||||||
"paper":"A5",
|
"paper":"A5",
|
||||||
"ruler": true,
|
"ruler": true,
|
||||||
controls: [
|
controls: [
|
||||||
|
|||||||
@ -98,8 +98,22 @@ export default {
|
|||||||
this.editor.bindEvent();
|
this.editor.bindEvent();
|
||||||
this.editor.changeTheme('');
|
this.editor.changeTheme('');
|
||||||
DDeiEditorUtil.getControlIcons(this.editor);
|
DDeiEditorUtil.getControlIcons(this.editor);
|
||||||
|
|
||||||
|
//初始化控件
|
||||||
if(this.options?.config?.controls){
|
if(this.options?.config?.controls){
|
||||||
this.editor.addControls(this.options?.config?.controls)
|
//调用转换器,将输入内容转换为设计器能够识别的格式
|
||||||
|
let controls = this.options?.config?.controls;
|
||||||
|
let converters = this.editor.getEnabledConverters(controls, 1);
|
||||||
|
//依次调用converters
|
||||||
|
converters?.forEach(converter => {
|
||||||
|
controls = converter.input(controls)
|
||||||
|
});
|
||||||
|
this.editor.addControls(controls)
|
||||||
|
}
|
||||||
|
if (this.options?.config?.access){
|
||||||
|
this.editor.setAccessInfo(this.options?.config?.access)
|
||||||
|
} else if (this.options?.config?.readonly == true || this.options?.config?.readonly == false) {
|
||||||
|
this.editor.setEditable(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化拦截器
|
//初始化拦截器
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user