替换几个组件属性配置面板 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: [ body: [
{ {
children: ( children: (
<Button <div className="mb-3">
level="info" <Button
size="sm" level="info"
className="m-b-sm" size="sm"
block className="m-b-sm"
onClick={this.editDetail.bind(this, context.id)} block
> onClick={this.editDetail.bind(this, context.id)}
>
</Button>
</Button>
</div>
) )
}, },
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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