mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-18 21:38:14 +00:00
Merge branch 'components-panel' of gitlab.alibaba-inc.com:ali-lowcode/ali-lowcode-engine into components-panel
This commit is contained in:
commit
7ecf137800
@ -19,12 +19,14 @@
|
|||||||
"value": "function() {\n \t\tconsole.log('will umount');\n\t}"
|
"value": "function() {\n \t\tconsole.log('will umount');\n\t}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"methods": {
|
"methods": {
|
||||||
"testFunc": {
|
"testFunc": {
|
||||||
"type": "JSFunction",
|
"type": "JSFunction",
|
||||||
"value": "function() { console.log('test func');}"
|
"value": "function() {console.log('test func');}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"props": {
|
"props": {
|
||||||
"ref": "outterView",
|
"ref": "outterView",
|
||||||
"autoLoading": true,
|
"autoLoading": true,
|
||||||
|
|||||||
@ -268,9 +268,19 @@ export default class EventsSetter extends Component<{
|
|||||||
|
|
||||||
onRelatedEventNameClick = (eventName:String) => {
|
onRelatedEventNameClick = (eventName:String) => {
|
||||||
const {editor} = this.props.field;
|
const {editor} = this.props.field;
|
||||||
editor.emit('sourceEditor.focusByFunction',{
|
|
||||||
functionName:eventName
|
editor.get('skeleton').getPanel('sourceEditor').show();
|
||||||
})
|
|
||||||
|
setTimeout(()=>{
|
||||||
|
editor.emit('sourceEditor.focusByFunction',{
|
||||||
|
functionName:eventName
|
||||||
|
})
|
||||||
|
},300)
|
||||||
|
|
||||||
|
|
||||||
|
// editor.emit('sourceEditor.focusByFunction',{
|
||||||
|
// functionName:eventName
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
closeEventMenu = () => {
|
closeEventMenu = () => {
|
||||||
@ -324,6 +334,7 @@ export default class EventsSetter extends Component<{
|
|||||||
eventDataList
|
eventDataList
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
this.props.onChange(eventDataList);
|
this.props.onChange(eventDataList);
|
||||||
|
|
||||||
//this.closeDialog();
|
//this.closeDialog();
|
||||||
|
|||||||
@ -99,16 +99,6 @@ export default class SourceEditor extends Component<{
|
|||||||
//});
|
//});
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {}
|
|
||||||
|
|
||||||
openPluginPannel = () => {
|
|
||||||
const { editor } = this.props;
|
|
||||||
// 判断面板是否处于激活状态
|
|
||||||
if (!editor.leftNav || editor.leftNav != 'sourceEditor') {
|
|
||||||
// 打开面板
|
|
||||||
editor.emit('leftNav.change', 'sourceEditor');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行编辑器事件
|
* 执行编辑器事件
|
||||||
@ -122,7 +112,6 @@ export default class SourceEditor extends Component<{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
debugger;
|
|
||||||
if (this.state.selectTab == TAB_KEY.CSS_TAB) {
|
if (this.state.selectTab == TAB_KEY.CSS_TAB) {
|
||||||
this.setState({
|
this.setState({
|
||||||
selectTab: TAB_KEY.JS_TAB,
|
selectTab: TAB_KEY.JS_TAB,
|
||||||
@ -173,7 +162,6 @@ export default class SourceEditor extends Component<{
|
|||||||
this.monocoEditor.focus();
|
this.monocoEditor.focus();
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
debugger;
|
|
||||||
|
|
||||||
this.updateCode(this.monocoEditor.getModel().getValue());
|
this.updateCode(this.monocoEditor.getModel().getValue());
|
||||||
}
|
}
|
||||||
@ -213,6 +201,10 @@ export default class SourceEditor extends Component<{
|
|||||||
}
|
}
|
||||||
|
|
||||||
onTabChange = (key) => {
|
onTabChange = (key) => {
|
||||||
|
const { editor } = this.props;
|
||||||
|
let schema = editor.get('designer').project.getSchema();
|
||||||
|
console.log(schema);
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
selectTab: key,
|
selectTab: key,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -59,7 +59,15 @@ const transfrom = {
|
|||||||
|
|
||||||
setFunction2Schema(functionMap,schema){
|
setFunction2Schema(functionMap,schema){
|
||||||
let pageNode = schema.componentsTree[0];
|
let pageNode = schema.componentsTree[0];
|
||||||
pageNode.state = functionMap.state;
|
for (let key in functionMap){
|
||||||
|
if (key == 'state'){
|
||||||
|
pageNode.state = functionMap[key];
|
||||||
|
}else{
|
||||||
|
if (LIFECYCLES_FUNCTION_MAP.react.indexOf(key)>=0){
|
||||||
|
// 判断有没有lifecycles节点
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -104,7 +112,7 @@ function initMethodsCode(componentSchema: Object) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createFunctionCode(functionName: String, functionNode: Object) {
|
function createFunctionCode(functionName: String, functionNode: Object) {
|
||||||
if (functionNode.type === 'JSExpression') {
|
if (functionNode.type === 'JSExpression' || functionNode.type === 'JSFunction') {
|
||||||
let functionCode = functionNode.value;
|
let functionCode = functionNode.value;
|
||||||
functionCode = functionCode.replace(/function/, functionName);
|
functionCode = functionCode.replace(/function/, functionName);
|
||||||
return functionCode;
|
return functionCode;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user