chore: 同步内网代码

This commit is contained in:
2betop 2023-03-30 20:56:49 +08:00
parent 714a54be5c
commit ce30eb82eb
25 changed files with 234 additions and 180 deletions

View File

@ -51,9 +51,7 @@
> div:first-child {
padding-top: 0;
}
div[data-role='form-item'] > label > span span {
line-height: 20px;
}
.fix-icon-picker-overflow {
input {
width: 0;

View File

@ -107,6 +107,23 @@ export class SubEditor extends React.Component<SubEditorProps> {
subEditorContext?.data
);
}
const variables: any = [
...(manager.config?.variables || []).filter(
item => item.title !== '页面变量'
),
// 解决打开子编辑器 公式输入框汇总没有页面变量的问题
{
name: 'pageParams',
title: '页面变量',
parentId: 'root',
order: 0,
schema: {
type: 'object',
$id: 'pageParams',
properties: {}
}
}
];
return {
size: 'full',
title: store.subEditorContext?.title,
@ -153,6 +170,8 @@ export class SubEditor extends React.Component<SubEditorProps> {
isSubEditor={true}
iframeUrl={config.iframeUrl}
ctx={store.ctx}
schemas={manager.config?.schemas}
variables={variables}
amisEnv={amisEnv || config.amisEnv}
appLocale={config.appLocale}
i18nEnabled={config.i18nEnabled}

View File

@ -1,5 +1,5 @@
import React from 'react';
import {registerEditorPlugin, getEditorPlugins} from 'amis-editor-core';
import {registerEditorPlugin} from 'amis-editor-core';
import {BaseEventContext, BasePlugin} from 'amis-editor-core';
import {getSchemaTpl} from 'amis-editor-core';
import {SchemaObject} from 'amis/lib/Schema';

View File

@ -198,12 +198,11 @@ export class ButtonPlugin extends BasePlugin {
),
form: {
body: [
{
type: 'ae-textareaFormulaControl',
getSchemaTpl('textareaFormulaControl', {
label: '确认内容',
mode: 'normal',
name: 'confirmText'
}
})
]
}
},
@ -216,17 +215,15 @@ export class ButtonPlugin extends BasePlugin {
hidden: isInDropdown,
form: {
body: [
{
type: 'ae-textareaFormulaControl',
getSchemaTpl('textareaFormulaControl', {
name: 'tooltip',
mode: 'normal',
label: tipedLabel(
'正常提示',
'正常状态下的提示内容,不填则不弹出提示。可从数据域变量中取值。'
)
},
{
type: 'ae-textareaFormulaControl',
}),
getSchemaTpl('textareaFormulaControl', {
name: 'disabledTip',
mode: 'normal',
label: tipedLabel(
@ -235,7 +232,7 @@ export class ButtonPlugin extends BasePlugin {
),
clearValueOnHidden: true,
visibleOn: 'data.tooltipTrigger !== "focus"'
},
}),
{
type: 'button-group-select',
name: 'tooltipTrigger',

View File

@ -1339,14 +1339,13 @@ export class CRUDPlugin extends BasePlugin {
mode: 'horizontal'
}
*/
{
getSchemaTpl('formulaControl', {
name: 'query',
label: '查询条件',
type: 'ae-formulaControl',
variables: '${variables}',
size: 'md',
mode: 'horizontal'
}
})
)
},
// {

View File

@ -552,11 +552,10 @@ export class ComboControlPlugin extends BasePlugin {
}
]
},
{
type: 'ae-formulaControl',
getSchemaTpl('formulaControl', {
label: '标题模版',
name: 'tabsLabelTpl'
}
})
]
},
// 表单多行展示

View File

@ -250,6 +250,7 @@ export class RichTextControlPlugin extends BasePlugin {
name: 'options.plugins',
visibleOn: 'data.vendor === "tinymce"',
value: [...tinymceOptions].join(','),
searchable: true,
maxTagCount: 5,
overflowTagPopover: {
title: '插件',
@ -262,6 +263,7 @@ export class RichTextControlPlugin extends BasePlugin {
name: 'options.toolbar',
multiple: true,
label: '工具栏',
searchable: true,
maxTagCount: 5,
overflowTagPopover: {
title: '插件',

View File

@ -197,14 +197,13 @@ export class TreeControlPlugin extends BasePlugin {
mode: 'horizontal'
},
*/
{
getSchemaTpl('formulaControl', {
name: 'openLevel',
label: '展开层级',
type: 'ae-formulaControl',
variables: '${variables}',
size: 'lg',
mode: 'horizontal'
}
})
)
},
{

View File

@ -1,6 +1,7 @@
import {getSchemaTpl} from 'amis-editor-core';
import {registerEditorPlugin} from 'amis-editor-core';
import {BasePlugin, BaseEventContext} from 'amis-editor-core';
import {ValidatorTag} from '../../validator';
export class LocationControlPlugin extends BasePlugin {
// 关联渲染器名字
@ -35,33 +36,95 @@ export class LocationControlPlugin extends BasePlugin {
panelTitle = '地理位置选择';
panelJustify = true;
panelBodyCreator = (context: BaseEventContext) => {
return [
getSchemaTpl('layout:originPosition', {value: 'left-top'}),
getSchemaTpl('clearable'),
const renderer: any = context.info.renderer;
return getSchemaTpl('tabs', [
{
type: 'input-text',
name: 'ak',
label: '百度地图的 AK',
description:
'请从<a href="http://lbsyun.baidu.com/" target="_blank">百度地图开放平台</a>获取'
title: '属性',
body: [
getSchemaTpl('collapseGroup', [
{
title: '基本',
body: [
getSchemaTpl('layout:originPosition', {value: 'left-top'}),
getSchemaTpl('formItemName', {
required: true
}),
getSchemaTpl('label'),
/* :
getSchemaTpl('valueFormula', {
rendererSchema: context?.schema,
}),
*/
{
type: 'input-text',
name: 'ak',
label: '百度地图的 AK',
required: true,
validationErrors: {
isRequired:
'AK不能为空请访问http://lbsyun.baidu.com/获取密钥(AK)'
},
description:
'请从<a href="http://lbsyun.baidu.com/" target="_blank" class="text-sm">百度地图开放平台</a>获取'
},
{
type: 'select',
name: 'coordinatesType',
label: '坐标格式',
value: 'bd09',
options: [
{label: '百度坐标', value: 'bd09'},
{label: '国测局坐标', value: 'gcj02'}
]
},
getSchemaTpl('clearable'),
getSchemaTpl('labelRemark'),
getSchemaTpl('remark'),
getSchemaTpl('placeholder'),
getSchemaTpl('description')
]
},
getSchemaTpl('status', {
isFormItem: true,
readonly: false
}),
getSchemaTpl('validation', {tag: ValidatorTag.Text})
])
]
},
{
type: 'select',
name: 'coordinatesType',
label: '坐标格式',
value: 'bd09',
options: [
{label: '百度坐标', value: 'bd09'},
{label: '国测局坐标', value: 'gcj02'}
title: '外观',
body: [
getSchemaTpl('collapseGroup', [
getSchemaTpl('style:formItem', {renderer}),
getSchemaTpl('theme:classNames', {
schema: [
{
type: 'theme-classname',
label: '控件',
name: 'inputClassName'
},
{
type: 'theme-classname',
label: '表单项',
name: 'className'
},
{
type: 'theme-classname',
label: '静态表单项',
name: 'staticClassName'
}
]
})
])
]
}
/* :
getSchemaTpl('valueFormula', {
rendererSchema: context?.schema,
}),
*/
];
]);
};
}

View File

@ -41,12 +41,11 @@ export class IFramePlugin extends BasePlugin {
title: '基本',
body: [
getSchemaTpl('layout:originPosition', {value: 'left-top'}),
{
type: 'ae-textareaFormulaControl',
getSchemaTpl('textareaFormulaControl', {
name: 'src',
mode: 'normal',
label: '页面地址'
}
})
]
},
getSchemaTpl('status')

View File

@ -62,7 +62,7 @@ export class TableCellPlugin extends BasePlugin {
label: '列分组名称',
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
description:
'当多列的分组名称设置一致时,表格会在显示表头的上层显示超级表头,<a href="https://baidu.github.io/amis/crud/header-group" target="_blank">示例</a>'
'当多列的分组名称设置一致时,表格会在显示表头的上层显示超级表头,<a href="https://baidu.github.io/amis/zh-CN/components/table#%E8%B6%85%E7%BA%A7%E8%A1%A8%E5%A4%B4" target="_blank">示例</a>'
},
getSchemaTpl('switch', {

View File

@ -311,14 +311,13 @@ export class TablePlugin extends BasePlugin {
mode: 'horizontal'
}
*/
{
getSchemaTpl('formulaControl', {
name: 'selected',
label: '选中项',
type: 'ae-formulaControl',
variables: '${variables}',
size: 'lg',
mode: 'horizontal'
}
})
])
},
{

View File

@ -307,14 +307,13 @@ export class Table2Plugin extends BasePlugin {
mode: 'horizontal'
}
*/
{
getSchemaTpl('formulaControl', {
name: 'selected',
label: '选中项',
type: 'ae-formulaControl',
variables: '${variables}',
size: 'lg',
mode: 'horizontal'
}
})
])
},
{
@ -655,11 +654,10 @@ export class Table2Plugin extends BasePlugin {
}
]
},
{
getSchemaTpl('formulaControl', {
name: 'rowSelection.disableOn',
type: 'ae-formulaControl',
label: '行禁用条件'
},
}),
{
name: 'rowSelection.selections',
label: '选择菜单项',
@ -707,12 +705,11 @@ export class Table2Plugin extends BasePlugin {
formType: 'extend',
form: {
body: [
{
getSchemaTpl('formulaControl', {
name: 'expandable.expandableOn',
visibleOn: 'data.expandable',
type: 'ae-formulaControl',
label: '行展开条件'
}
})
]
}
},
@ -813,18 +810,16 @@ export class Table2Plugin extends BasePlugin {
getSchemaTpl('style:classNames', {
isFormItem: true,
schema: [
{
getSchemaTpl('formulaControl', {
name: 'rowClassNameExpr',
type: 'ae-formulaControl',
label: '自定义行样式'
},
}),
{
getSchemaTpl('formulaControl', {
name: 'expandable.expandedRowClassNameExpr',
visibleOn: 'data.expandable',
type: 'ae-formulaControl',
label: '展开行样式'
}
})
]
})
])

View File

@ -388,16 +388,14 @@ export class TableCell2Plugin extends BasePlugin {
}
},
{
getSchemaTpl('formulaControl', {
name: 'rowSpanExpr',
type: 'ae-formulaControl',
label: '合并行'
},
{
}),
getSchemaTpl('formulaControl', {
name: 'colSpanExpr',
type: 'ae-formulaControl',
label: '合并列'
}
})
];
const baseStyle = [

View File

@ -114,14 +114,13 @@ export class TabsPlugin extends BasePlugin {
mode: 'horizontal'
}
*/
{
getSchemaTpl('formulaControl', {
name: 'activeKey',
label: '激活项',
type: 'ae-formulaControl',
variables: '${variables}',
size: 'lg',
mode: 'horizontal'
}
})
)
}
];
@ -190,15 +189,14 @@ export class TabsPlugin extends BasePlugin {
{
title: '高级',
body: [
{
type: 'ae-expressionFormulaControl',
getSchemaTpl('expressionFormulaControl', {
evalMode: true,
label: tipedLabel(
'关联数据',
'根据该数据来动态重复渲染所配置的选项卡'
),
name: 'source'
},
}),
getSchemaTpl('switch', {
name: 'mountOnEnter',
label: tipedLabel(

View File

@ -9,14 +9,16 @@ import {tipedLabel} from 'amis-editor-core';
import {getEventControlConfig} from '../renderer/event-control/helper';
import {ValidatorTag} from '../validator';
setSchemaTpl('tpl:content', {
label: '文字内容',
type: 'ae-textareaFormulaControl',
mode: 'normal',
visibleOn: 'data.wrapperComponent !== undefined',
pipeIn: (value: any, data: any) => value || (data && data.html),
name: 'tpl'
});
setSchemaTpl(
'tpl:content',
getSchemaTpl('textareaFormulaControl', {
label: '文字内容',
mode: 'normal',
visibleOn: 'data.wrapperComponent !== undefined',
pipeIn: (value: any, data: any) => value || (data && data.html),
name: 'tpl'
})
);
setSchemaTpl('tpl:rich-text', {
label: '内容',

View File

@ -268,15 +268,14 @@ export class WizardPlugin extends BasePlugin {
mode: 'horizontal'
}
*/
{
getSchemaTpl('formulaControl', {
name: 'step',
label: '目标步骤',
type: 'ae-formulaControl',
variables: '${variables}',
size: 'lg',
mode: 'horizontal',
required: true
}
})
])
},
{

View File

@ -13,7 +13,8 @@ import {
autobind,
createObject,
tipedLabel,
anyChanged
anyChanged,
getSchemaTpl
} from 'amis-editor-core';
import type {SchemaObject, SchemaCollection, SchemaApi} from 'amis/lib/Schema';
@ -833,11 +834,10 @@ export default class APIControl extends React.Component<
required: true
},
{
getSchemaTpl('DataPickerControl', {
placeholder: 'Value',
type: 'ae-DataPickerControl',
name: 'value'
}
})
]
},
{

View File

@ -1,7 +1,7 @@
import {Renderer} from 'amis';
import type {FormControlProps} from 'amis-core';
import React from 'react';
import {autobind} from 'amis-editor-core';
import {autobind, getSchemaTpl} from 'amis-editor-core';
export interface DataMappingProps extends FormControlProps {
schema?: string;
@ -14,11 +14,10 @@ export class DataMappingControl extends React.Component<DataMappingProps> {
return render(
'value',
{
type: 'ae-DataPickerControl',
getSchemaTpl('DataPickerControl', {
inputOnly: true,
name: 'any'
},
}),
{
value,
onChange

View File

@ -40,6 +40,7 @@ class DataPickerControl extends React.Component<FormControlProps> {
return (
<FormulaPicker
{...this.props}
onPickerOpen={this.handlePickerOpen}
evalMode={false}
onConfirm={this.handleConfirm}

View File

@ -6,7 +6,7 @@ import React from 'react';
import cx from 'classnames';
import {FormItem, Switch, Option} from 'amis';
import {autobind} from 'amis-editor-core';
import {autobind, getSchemaTpl} from 'amis-editor-core';
import {BaseLabelMark} from '../component/BaseControl';
import type {FormControlProps} from 'amis-core';
@ -179,15 +179,14 @@ export class StatusControl extends React.Component<
}
]
},
{
type: 'ae-expressionFormulaControl',
getSchemaTpl('expressionFormulaControl', {
evalMode: false,
label: '表达式',
name: 'expression',
placeholder: `请输入${label}条件`,
visibleOn: 'this.statusType === 2',
onChange: (value: any) => {}
}
})
]
},
{

View File

@ -2,7 +2,12 @@
*
*/
import {PluginActions, RendererPluginAction, tipedLabel} from 'amis-editor-core';
import {
PluginActions,
RendererPluginAction,
tipedLabel,
getSchemaTpl
} from 'amis-editor-core';
import React from 'react';
import {ActionConfig, ComponentInfo} from './types';
import ActionConfigPanel from './action-config-panel';
@ -279,27 +284,28 @@ export default class ActionDialog extends React.Component<ActionDialogProp> {
className: 'action-panel-title',
visibleOn: 'data.actionType'
},
{
getSchemaTpl('expressionFormulaControl', {
name: 'stopPropagation',
label: tipedLabel('阻断条件', '满足条件时,将会阻断当前事件的后续动作的执行'),
type: 'ae-expressionFormulaControl',
label: tipedLabel(
'阻断条件',
'满足条件时,将会阻断当前事件的后续动作的执行'
),
evalMode: true,
variables: '${variables}',
mode: 'horizontal',
size: 'lg',
visibleOn: 'data.actionType'
},
{
}),
getSchemaTpl('expressionFormulaControl', {
name: 'expression',
label: '执行条件',
type: 'ae-expressionFormulaControl',
evalMode: true,
variables: '${variables}',
mode: 'horizontal',
size: 'lg',
placeholder: '默认执行该动作',
visibleOn: 'data.actionType'
}
})
]
}
],

View File

@ -227,17 +227,16 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
visibleOn: 'data.actionType === "url"'
},
*/
{
getSchemaTpl('textareaFormulaControl', {
name: 'url',
label: '页面地址',
type: 'ae-textareaFormulaControl',
variables: '${variables}',
mode: 'horizontal',
// placeholder: 'http://', 长文本暂不支持
size: 'lg',
required: true,
visibleOn: 'data.actionType === "url"'
},
}),
{
type: 'combo',
name: 'params',
@ -263,13 +262,12 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
size: 'xs'
},
*/
{
type: 'ae-formulaControl',
getSchemaTpl('formulaControl', {
variables: '${variables}',
name: 'val',
variableMode: 'tabs',
placeholder: '参数值'
}
})
]
},
{
@ -518,15 +516,14 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
required: true
},
*/
{
getSchemaTpl('textareaFormulaControl', {
name: 'msg',
label: '消息内容',
type: 'ae-textareaFormulaControl',
mode: 'horizontal',
variables: '${variables}',
size: 'lg',
required: true
},
}),
/*
{
name: 'title',
@ -540,14 +537,13 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
mode: 'horizontal'
},
*/
{
getSchemaTpl('textareaFormulaControl', {
name: 'title',
label: '标题内容',
type: 'ae-textareaFormulaControl',
variables: '${variables}',
mode: 'horizontal',
size: 'lg'
},
}),
/*
{
name: 'timeout',
@ -561,10 +557,9 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
mode: 'horizontal'
},
*/
{
getSchemaTpl('formulaControl', {
name: 'timeout',
label: '持续时间(ms)',
type: 'ae-formulaControl',
rendererSchema: {
type: 'input-number'
},
@ -572,7 +567,7 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
variables: '${variables}',
size: 'lg',
mode: 'horizontal'
},
}),
{
type: 'button-group-select',
name: 'position',
@ -853,8 +848,7 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
}
]
},
{
type: 'ae-expressionFormulaControl',
getSchemaTpl('expressionFormulaControl', {
mode: 'horizontal',
label: '表达式',
required: true,
@ -863,7 +857,7 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
evalMode: true,
name: '__actionExpression',
visibleOn: "this.groupType === 'visibility'"
}
})
]
},
{
@ -961,8 +955,7 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
}
]
},
{
type: 'ae-expressionFormulaControl',
getSchemaTpl('expressionFormulaControl', {
mode: 'horizontal',
label: '表达式',
required: true,
@ -970,7 +963,7 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
evalMode: true,
name: '__actionExpression',
visibleOn: "this.groupType === 'usability'"
}
})
]
},
{
@ -1137,16 +1130,15 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
visibleOn: `data.__addParam && data.__customData && data.__containerType === "all" && data.actionType === "reload" && ${IS_DATA_CONTAINER}`
},
*/
{
getSchemaTpl('formulaControl', {
name: '__valueInput',
label: '',
type: 'ae-formulaControl',
variables: '${variables}',
size: 'lg',
mode: 'horizontal',
required: true,
visibleOn: `data.__addParam && data.__customData && data.__containerType === "all" && data.actionType === "reload" && ${IS_DATA_CONTAINER}`
},
}),
{
type: 'combo',
name: '__reloadParams',
@ -1178,12 +1170,11 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
inputMode: 'input-group'
}
*/
{
getSchemaTpl('formulaControl', {
name: 'val',
type: 'ae-formulaControl',
variables: '${variables}',
placeholder: '参数值'
}
})
],
visibleOn: `data.__addParam && data.__customData && data.__containerType === "appoint" && data.actionType === "reload" && ${IS_DATA_CONTAINER}`
},
@ -1399,12 +1390,11 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
inputMode: 'input-group'
}
*/
{
getSchemaTpl('formulaControl', {
name: 'val',
type: 'ae-formulaControl',
variables: '${variables}',
placeholder: '字段值'
}
})
],
visibleOn: `${IS_DATA_CONTAINER} && data.__containerType === 'appoint' || data.__comboType === 'appoint'`
},
@ -1455,11 +1445,10 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
inputMode: 'input-group'
}
*/
{
getSchemaTpl('formulaControl', {
name: 'val',
type: 'ae-formulaControl',
variables: '${variables}'
}
})
]
}
],
@ -1481,17 +1470,15 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
required: true
},
*/
{
getSchemaTpl('formulaControl', {
name: '__valueInput',
label: '',
type: 'ae-formulaControl',
variables: '${variables}',
size: 'lg',
mode: 'horizontal',
visibleOn: `(${IS_DATA_CONTAINER} || ${SHOW_SELECT_PROP}) && data.__containerType === 'all'`,
required: true
},
,
}),
/*
{
name: '__valueInput',
@ -1507,16 +1494,15 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
required: true
}
*/
{
getSchemaTpl('formulaControl', {
name: '__valueInput',
label: '数据设置',
type: 'ae-formulaControl',
variables: '${variables}',
size: 'lg',
mode: 'horizontal',
visibleOn: `data.__rendererName && !${IS_DATA_CONTAINER} && data.__rendererName !== 'combo' && data.__rendererName !== 'input-table'`,
required: true
}
})
]
})
]
@ -1726,16 +1712,15 @@ export const ACTION_TYPE_TREE = (manager: any): RendererPluginAction[] => {
required: true
},
*/
{
getSchemaTpl('textareaFormulaControl', {
name: 'content',
label: '内容模板',
type: 'ae-textareaFormulaControl',
variables: '${variables}',
mode: 'horizontal',
size: 'lg',
visibleOn: 'data.actionType === "copy"',
required: true
},
}),
{
type: 'select',
name: 'copyFormat',
@ -1996,12 +1981,11 @@ export const COMMON_ACTION_SCHEMA_MAP: {
inputMode: 'input-group'
}
*/
{
getSchemaTpl('formulaControl', {
name: 'val',
type: 'ae-formulaControl',
variables: '${variables}',
placeholder: '变量值'
}
})
],
visibleOn: `${IS_DATA_CONTAINER}`
},
@ -2046,11 +2030,10 @@ export const COMMON_ACTION_SCHEMA_MAP: {
inputMode: 'input-group'
}
*/
{
getSchemaTpl('formulaControl', {
name: 'val',
type: 'ae-formulaControl',
variables: '${variables}'
}
})
]
}
],
@ -2071,16 +2054,15 @@ export const COMMON_ACTION_SCHEMA_MAP: {
required: true
}
*/
{
getSchemaTpl('formulaControl', {
name: '__valueInput',
label: '变量赋值',
type: 'ae-formulaControl',
variables: '${variables}',
size: 'lg',
mode: 'horizontal',
visibleOn: `!${IS_DATA_CONTAINER} && data.__rendererName !== 'combo' && data.__rendererName !== 'input-table'`,
required: true
}
})
]
})
},
@ -2815,6 +2797,7 @@ export const getEventControlConfig = (
params: objectToComboArray(action.args?.params)
};
}
if (['setValue'].includes(action.actionType) && action.args?.value) {
!config.args && (config.args = {});
if (Array.isArray(action.args?.value)) {

View File

@ -49,6 +49,7 @@ const FormulaPicker: React.FC<FormulaPickerProps> = props => {
>
<Modal.Body>
<FormulaEditor
{...props}
header="表达式"
variables={variables}
variableMode={variableMode}

View File

@ -5,7 +5,7 @@ import {
isObject,
tipedLabel,
DSField,
EditorManager
EditorManager,
} from 'amis-editor-core';
import {SchemaObject} from 'amis/lib/Schema';
import flatten from 'lodash/flatten';
@ -435,8 +435,7 @@ setSchemaTpl(
mode: mode === 'vertical' ? 'vertical' : 'horizontal',
visibleOn,
body: [
{
type: 'ae-formulaControl',
getSchemaTpl('formulaControl', {
label: label ?? '默认值',
name: name || 'value',
rendererWrapper,
@ -450,7 +449,7 @@ setSchemaTpl(
variableMode,
DateTimeType: DateTimeType ?? FormulaDateType.NotDate,
...rest
}
})
]
};
}
@ -602,8 +601,7 @@ setSchemaTpl(
return variablesArr;
}
return {
type: 'ae-textareaFormulaControl',
return getSchemaTpl('textareaFormulaControl', {
mode: 'normal',
label: tipedLabel(
'选项模板',
@ -613,15 +611,16 @@ setSchemaTpl(
variables: getOptionVars,
requiredDataPropsVariables: true,
...rest
};
});
}
);
setSchemaTpl('menuTpl', {
type: 'ae-textareaFormulaControl',
mode: 'normal',
label: tipedLabel('模板', '自定义选项渲染模板支持JSX、数据域变量使用'),
name: 'menuTpl'
setSchemaTpl('menuTpl', () => {
return getSchemaTpl('textareaFormulaControl', {
mode: 'normal',
label: tipedLabel('模板', '自定义选项渲染模板支持JSX、数据域变量使用'),
name: 'menuTpl'
});
});
setSchemaTpl('expression', {
@ -1210,12 +1209,11 @@ setSchemaTpl('app-page-args', {
inputMode: 'input-group'
}
*/
{
getSchemaTpl('formulaControl', {
name: 'val',
type: 'ae-formulaControl',
variables: '${variables}',
placeholder: '参数值'
}
})
]
});
@ -1273,11 +1271,12 @@ setSchemaTpl('pageSubTitle', {
type: 'textarea'
});
setSchemaTpl('textareaDefaultValue', {
type: 'ae-textareaFormulaControl',
label: '默认值',
name: 'value',
mode: 'normal'
setSchemaTpl('textareaDefaultValue', () => {
return getSchemaTpl('textareaFormulaControl', {
label: '默认值',
name: 'value',
mode: 'normal'
});
});
setSchemaTpl('prefix', {