mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
fix(editor): 值格式设置文本1后自动转为了数字1
This commit is contained in:
parent
79a29f93bd
commit
b2520daef9
@ -40,6 +40,7 @@ export function valuePipeOut(value: any) {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 文本1会被转为数字1,值格式慎用
|
||||||
return JSON.parse(value);
|
return JSON.parse(value);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return value;
|
return value;
|
||||||
|
@ -7,7 +7,8 @@ import {
|
|||||||
getSchemaTpl,
|
getSchemaTpl,
|
||||||
BasePlugin,
|
BasePlugin,
|
||||||
tipedLabel,
|
tipedLabel,
|
||||||
JSONPipeOut
|
JSONPipeOut,
|
||||||
|
undefinedPipeOut
|
||||||
} from 'amis-editor-core';
|
} from 'amis-editor-core';
|
||||||
|
|
||||||
import {ValidatorTag} from '../../validator';
|
import {ValidatorTag} from '../../validator';
|
||||||
@ -221,9 +222,6 @@ export class SelectControlPlugin extends BasePlugin {
|
|||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
getSchemaTpl('checkAll'),
|
getSchemaTpl('checkAll'),
|
||||||
getSchemaTpl('valueFormula', {
|
|
||||||
rendererSchema: (schema: Schema) => schema
|
|
||||||
}),
|
|
||||||
getSchemaTpl('labelRemark'),
|
getSchemaTpl('labelRemark'),
|
||||||
getSchemaTpl('remark'),
|
getSchemaTpl('remark'),
|
||||||
getSchemaTpl('placeholder'),
|
getSchemaTpl('placeholder'),
|
||||||
@ -234,7 +232,28 @@ export class SelectControlPlugin extends BasePlugin {
|
|||||||
title: '选项',
|
title: '选项',
|
||||||
body: [
|
body: [
|
||||||
getSchemaTpl('optionControlV2'),
|
getSchemaTpl('optionControlV2'),
|
||||||
getSchemaTpl('selectFirst'),
|
getSchemaTpl('selectFirst', {
|
||||||
|
onChange: (
|
||||||
|
value: any,
|
||||||
|
oldValue: any,
|
||||||
|
model: any,
|
||||||
|
form: any
|
||||||
|
) => {
|
||||||
|
if (value) {
|
||||||
|
form.deleteValueByName('value');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
getSchemaTpl('valueFormula', {
|
||||||
|
rendererSchema: (schema: Schema) => ({
|
||||||
|
...schema,
|
||||||
|
type: 'input-text'
|
||||||
|
}),
|
||||||
|
pipeOut: undefinedPipeOut,
|
||||||
|
// 默认值组件设计有些问题,自动发起了请求,接口数据作为了默认值选项,接口形式应该是设置静态值或者FX
|
||||||
|
needDeleteProps: ['source'],
|
||||||
|
hiddenOn: 'this.selectFirst === true'
|
||||||
|
}),
|
||||||
getSchemaTpl(
|
getSchemaTpl(
|
||||||
'loadingConfig',
|
'loadingConfig',
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user