mirror of
https://gitee.com/hoslay/ddei-editor.git
synced 2025-12-06 09:08:44 +08:00
将CREATE_BEFORE的传入参数统一为model而非modelDefine
This commit is contained in:
parent
949389538a
commit
9ace402379
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ddei-editor",
|
||||
"version": "1.2.43-4",
|
||||
"version": "1.2.43-6",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
"author": "hoslay <3697355039@qq.com>",
|
||||
|
||||
@ -238,7 +238,6 @@ export default {
|
||||
*/
|
||||
createControlPrepare(group, e) {
|
||||
let control = group.currentControl ? group.currentControl : group.controls?.length > 0 ? group.controls[0] : null
|
||||
|
||||
|
||||
let editMode = group.editMode
|
||||
//获取当前实例
|
||||
@ -458,23 +457,23 @@ export default {
|
||||
if ((layer.display == 0 && !layer.tempDisplay) || layer.lock) {
|
||||
return;
|
||||
}
|
||||
let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_CREATE_BEFORE", DDeiEnumOperateType.CREATE, { models: [control] }, ddInstance, e)
|
||||
if (rsState == 0 || rsState == 1) {
|
||||
let controlInitJSON = DDeiEditorUtil.getModelInitJSON(this.editor.ddInstance, null, [{ model: control.id }])
|
||||
let controlInitJSON = DDeiEditorUtil.getModelInitJSON(this.editor.ddInstance, null, [{ model: control.id }])
|
||||
if (controlInitJSON){
|
||||
let models = this.editor.addControls(controlInitJSON)
|
||||
let pushDatas = []
|
||||
models.forEach((model, key) => {
|
||||
pushDatas.push({ id: model.id, value: DDeiEnumControlState.SELECTED });
|
||||
});
|
||||
this.editor.ddInstance?.bus?.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, e);
|
||||
this.editor.ddInstance?.bus?.push(DDeiEnumBusCommandType.ModelChangeSelect, pushDatas, e);
|
||||
this.editor.ddInstance?.bus?.push(DDeiEnumBusCommandType.StageChangeSelectModels);
|
||||
this.editor.bus.executeAll()
|
||||
this.editor.changeState(DDeiEditorState.DESIGNING);
|
||||
DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_CREATE_AFTER", DDeiEnumOperateType.CREATE, { models: models }, ddInstance, e)
|
||||
}
|
||||
|
||||
let rsState = DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_CREATE_BEFORE", DDeiEnumOperateType.CREATE, { models: models }, ddInstance, e)
|
||||
if (rsState == 0 || rsState == 1) {
|
||||
let pushDatas = []
|
||||
models.forEach((model, key) => {
|
||||
pushDatas.push({ id: model.id, value: DDeiEnumControlState.SELECTED });
|
||||
});
|
||||
this.editor.ddInstance?.bus?.push(DDeiEnumBusCommandType.CancelCurLevelSelectedModels, null, e);
|
||||
this.editor.ddInstance?.bus?.push(DDeiEnumBusCommandType.ModelChangeSelect, pushDatas, e);
|
||||
this.editor.ddInstance?.bus?.push(DDeiEnumBusCommandType.StageChangeSelectModels);
|
||||
this.editor.bus.executeAll()
|
||||
this.editor.changeState(DDeiEditorState.DESIGNING);
|
||||
DDeiUtil.invokeCallbackFunc("EVENT_CONTROL_CREATE_AFTER", DDeiEnumOperateType.CREATE, { models: models }, ddInstance, e)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ export default defineComponent({
|
||||
data() {
|
||||
|
||||
const options = markRaw({
|
||||
// currentLayout: "ddei-core-layout-simple",
|
||||
currentLayout: "ddei-core-layout-simple",
|
||||
config: {
|
||||
ratio: 1.2, //默认缩放比例为120%
|
||||
pixel:2, //调整渲染质量
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user