替换几个组件属性配置面板 amis-saas-6892

Change-Id: I7d8e05a1d96bd05b2e3fb32d6df70b00f9d69181
This commit is contained in:
jiatianqi 2022-11-17 11:09:36 +08:00
parent 29c315acff
commit 72bef5693b
9 changed files with 69 additions and 46 deletions

View File

@ -61,15 +61,17 @@ export class DropDownButtonPlugin extends BasePlugin {
body: [
{
children: (
<Button
level="info"
size="sm"
className="m-b-sm"
block
onClick={this.editDetail.bind(this, context.id)}
>
</Button>
<div className="mb-3">
<Button
level="info"
size="sm"
className="m-b-sm"
block
onClick={this.editDetail.bind(this, context.id)}
>
</Button>
</div>
)
},
{

View File

@ -136,6 +136,7 @@ export class CheckboxControlPlugin extends BasePlugin {
...context?.schema,
type: 'switch'
},
needDeleteProps: ['option'],
label: '默认勾选',
rendererWrapper: true, // 浅色线框包裹一下,增加边界感
valueType: 'boolean',

View File

@ -335,9 +335,9 @@ export class DateControlPlugin extends BasePlugin {
}),
getSchemaTpl('valueFormula', {
rendererSchema: {
...context?.schema,
placeholder: '请选择静态值'
...context?.schema
},
placeholder: '请选择静态值',
header: '表达式或相对值',
DateTimeType: FormulaDateType.IsDate,
label: tipedLabel('默认值', dateTooltip)
@ -348,9 +348,9 @@ export class DateControlPlugin extends BasePlugin {
DateTimeType: FormulaDateType.IsDate,
rendererSchema: {
...context?.schema,
value: context?.schema.minDate,
placeholder: '请选择静态值'
value: context?.schema.minDate
},
placeholder: '请选择静态值',
needDeleteProps: ['minDate'], // 避免自我限制
label: tipedLabel('最小值', dateTooltip)
}),
@ -360,8 +360,7 @@ export class DateControlPlugin extends BasePlugin {
DateTimeType: FormulaDateType.IsDate,
rendererSchema: {
...context?.schema,
value: context?.schema.maxDate,
placeholder: '请选择静态值'
value: context?.schema.maxDate
},
needDeleteProps: ['maxDate'], // 避免自我限制
label: tipedLabel('最大值', dateTooltip)

View File

@ -122,10 +122,16 @@ export class TextareaControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('valueFormula', {
rendererSchema: context?.schema,
mode: 'vertical' // 改成上下展示模式
}),
// getSchemaTpl('valueFormula', {
// rendererSchema: context?.schema,
// mode: 'vertical' // 改成上下展示模式
// }),
{
type: 'ae-textareaFormulaControl',
label: '默认值',
name: 'value',
mode: 'normal'
},
getSchemaTpl('switch', {
name: 'trimContents',
pipeIn: defaultValue(true),

View File

@ -266,11 +266,9 @@ export class TransferPlugin extends BasePlugin {
name: 'searchable'
}),
getSchemaTpl('menuTpl', {
label: tipedLabel(
'模板',
'左侧选项渲染模板支持JSX变量使用\\${xx}'
),
getSchemaTpl('optionsMenuTpl', {
manager: this.manager,
onChange: (value: any) => {},
visibleOn: 'data.selectMode !== "table"'
}),
@ -317,12 +315,10 @@ export class TransferPlugin extends BasePlugin {
'data.selectMode === "list" && !data.resultListModeFollowSelect'
}),
getSchemaTpl('menuTpl', {
getSchemaTpl('optionsMenuTpl', {
name: 'valueTpl',
label: tipedLabel(
'模板',
'结果选项渲染模板支持JSX变量使用\\${xx}'
),
manager: this.manager,
onChange: (value: any) => {},
visibleOn:
'!(data.selectMode === "table" && data.resultListModeFollowSelect)'
}),

View File

@ -41,9 +41,10 @@ export class IFramePlugin extends BasePlugin {
title: '基本',
body: [
{
type: 'ae-textareaFormulaControl',
name: 'src',
label: '页面地址',
type: 'input-text'
mode: 'normal',
label: '页面地址'
}
]
},

View File

@ -22,7 +22,8 @@ export class ProgressPlugin extends BasePlugin {
scaffold = {
type: 'progress',
value: 66,
strokeWidth: 6
strokeWidth: 6,
valueTpl: '${value}%'
};
previewSchema = {
...this.scaffold
@ -46,7 +47,7 @@ export class ProgressPlugin extends BasePlugin {
name: 'mode',
type: 'select',
option: '继承',
value: 'line',
pipeIn: defaultValue('line'),
tiled: true,
options: [
{
@ -80,12 +81,32 @@ export class ProgressPlugin extends BasePlugin {
}
},
getSchemaTpl('valueFormula', {
type: 'input-number'
// rendererSchema: context?.schema,
// valueType: 'number' // 期望数值类型,不过 amis中会尝试字符串 trans 数值类型
rendererSchema: {
...context?.schema,
type: 'input-number'
},
needDeleteProps: ['placeholder'],
valueType: 'number' // 期望数值类型,不过 amis中会尝试字符串 trans 数值类型
}),
getSchemaTpl('menuTpl', {
name: 'valueTpl'
label: tipedLabel(
'数值模板',
'值渲染模板支持JSX、数据域变量使用, 默认 ${value}%'
),
name: 'valueTpl',
variables: [
{
label: '值字段',
children: [
{
label: '进度值',
value: 'value',
tag: 'number'
}
]
}
],
requiredDataPropsVariables: true
}),
getSchemaTpl('switch', {

View File

@ -173,10 +173,11 @@ export class TabsPlugin extends BasePlugin {
title: '高级',
body: [
{
type: 'ae-formulaControl',
type: 'ae-expressionFormulaControl',
evalMode: true,
label: tipedLabel(
'关联数据',
'可用<code>\\${xxx}</code>取值,根据该数据来动态重复渲染所配置的选项卡'
'根据该数据来动态重复渲染所配置的选项卡'
),
name: 'source'
},

View File

@ -5,13 +5,9 @@ import {tipedLabel} from 'amis-editor-core';
import {ValidatorTag} from '../validator';
setSchemaTpl('tpl:content', {
label: tipedLabel(
'文字内容',
'支持使用 <code>\\${xxx}</code> 来获取变量,或者用 lodash.template 语法来写模板逻辑。<a target="_blank" href="/amis/zh-CN/docs/concepts/template">详情</a>'
),
type: 'textarea',
minRows: 5,
language: 'html',
label: '文字内容',
type: 'ae-textareaFormulaControl',
mode: 'normal',
visibleOn: 'data.wrapperComponent !== undefined',
pipeIn: (value: any, data: any) => value || (data && data.html),
name: 'tpl'