Skip to content

Commit

Permalink
fix: 问题处理
Browse files Browse the repository at this point in the history
  • Loading branch information
yxh01132861 committed Oct 18, 2023
1 parent 1c9c36f commit 2db02ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,18 @@ const schema = {
type: 'object',
properties: {
fillColorScale: {
type: 'string',
title: '颜色划分----',
type: 'number',
title: '颜色划分',
default: {
type: 'cat',
domain: [5, 5.6, undefined, 5.7, undefined, 7.9, undefined, 5.8],
colors: ['#63759a', '#e61486'],
type: 'threshold',
domain: [5, 5.6, 5.7],
colors: ['#63759a', '#e61486', '#f00', '#0f0'],
},
'x-decorator': 'FormItem',
'x-component': 'ScaleSelector',
'x-component-props': {
placeholder: '请选择',
type: 'string', //选择的筛选字段的类型
type: 'number', //选择的筛选字段的类型
dataset: {
min: 5,
max: 7.9,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ const Internal = (props: ScaleSelectorProps) => {
if (checked) {
setType(THRESHOLD);
setCustomOpen(true);
const _defaultValue = getDefault(fieldType, dataset, defaultColors);
// @ts-ignore
props?.onChange({
..._defaultValue,
});
if (!defaultValue.list) {
const _defaultValue = getDefault(fieldType, dataset, defaultColors);
// @ts-ignore
props?.onChange({
..._defaultValue,
});
}
} else {
setCustomOpen(false);
if (props.onChange) {
Expand Down

0 comments on commit 2db02ce

Please sign in to comment.