mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-20 15:38:32 +00:00
fix: fix function-setter bug
This commit is contained in:
parent
f81932b4bc
commit
dced647917
@ -62,10 +62,14 @@ export default class FunctionSetter extends PureComponent<FunctionSetterProps, {
|
|||||||
parseFunctionName = (functionString: String) => {
|
parseFunctionName = (functionString: String) => {
|
||||||
// 因为函数格式是固定的,所以可以按照字符换去匹配获取函数名
|
// 因为函数格式是固定的,所以可以按照字符换去匹配获取函数名
|
||||||
let funNameStr = functionString.split('.')[1];
|
let funNameStr = functionString.split('.')[1];
|
||||||
|
|
||||||
|
|
||||||
|
if (funNameStr){
|
||||||
let endIndex = funNameStr.indexOf('(');
|
let endIndex = funNameStr.indexOf('(');
|
||||||
|
|
||||||
return funNameStr.substr(0, endIndex);
|
return funNameStr.substr(0, endIndex);
|
||||||
|
}else{
|
||||||
|
return '匿名函数'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,8 +1,34 @@
|
|||||||
import { Component, isValidElement, ReactElement, ReactNode } from 'react';
|
import { Component, isValidElement, ReactElement, ReactNode } from 'react';
|
||||||
import { Dialog, Search, Input } from '@alifd/next';
|
import { Dialog, Search, Input } from '@alifd/next';
|
||||||
import { PluginProps } from '@ali/lowcode-types';
|
import { PluginProps } from '@ali/lowcode-types';
|
||||||
|
import MonacoEditor from 'react-monaco-editor';
|
||||||
import './index.scss';
|
import './index.scss';
|
||||||
|
|
||||||
|
|
||||||
|
const defaultEditorOption = {
|
||||||
|
width: '100%',
|
||||||
|
height: '319px',
|
||||||
|
options: {
|
||||||
|
readOnly: false,
|
||||||
|
automaticLayout: true,
|
||||||
|
folding: true, //默认开启折叠代码功能
|
||||||
|
lineNumbers: 'on',
|
||||||
|
wordWrap: 'off',
|
||||||
|
formatOnPaste: true,
|
||||||
|
fontSize: 12,
|
||||||
|
tabSize: 2,
|
||||||
|
scrollBeyondLastLine: false,
|
||||||
|
fixedOverflowWidgets: false,
|
||||||
|
snippetSuggestions: 'top',
|
||||||
|
minimap: {
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
|
scrollbar: {
|
||||||
|
vertical: 'auto',
|
||||||
|
horizontal: 'auto',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
export default class EventBindDialog extends Component<PluginProps> {
|
export default class EventBindDialog extends Component<PluginProps> {
|
||||||
private eventList: any[] = [
|
private eventList: any[] = [
|
||||||
// {
|
// {
|
||||||
@ -180,7 +206,13 @@ export default class EventBindDialog extends Component<PluginProps> {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="dialog-small-title">参数设置</div>
|
<div className="dialog-small-title">参数设置</div>
|
||||||
<Input.TextArea style={{ width: '100%', height: '319px' }} />
|
<MonacoEditor
|
||||||
|
value={'{}'}
|
||||||
|
{...defaultEditorOption}
|
||||||
|
{...{ language: 'json' }}
|
||||||
|
// onChange={(newCode) => this.updateCode(newCode)}
|
||||||
|
// editorDidMount={(editor, monaco) => this.editorDidMount.call(this, editor, monaco, TAB_KEY.JS_TAB)}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user