Skip to content

Commit

Permalink
fix: 评审问题处理
Browse files Browse the repository at this point in the history
  • Loading branch information
yxh01132861 committed Oct 20, 2023
1 parent 2522b2d commit 70721d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ const CustomMappingColor = (props: CustomMappingColorProps) => {
const deletePaletteRangeItem = (index: number, position: string | null) => {
if (dataType === 'number') {
const _value = customRanges[index];

const list = customRanges
// @ts-ignore
const list: CustomMappingColorItem[] = customRanges
.map((item, _index) => {
if (index === _index) {
return undefined;
Expand Down Expand Up @@ -115,7 +115,7 @@ const CustomMappingColor = (props: CustomMappingColorProps) => {
return item;
}
})
.filter((item) => !isEmpty(item)) as CustomMappingColor[];
.filter((item) => !isEmpty(item));

setCustomRanges(list);
} else {
Expand All @@ -126,7 +126,7 @@ const CustomMappingColor = (props: CustomMappingColorProps) => {
const onChangePaletteRangeItem = (value: (string | number | null)[], color: string, index: number) => {
if (dataType === 'number') {
// @ts-ignore
const list: CustomMappingColor[] = customRanges.map((item, _index) => {
const list: CustomMappingColorItem[] = customRanges.map((item, _index) => {
if (index === _index) {
return {
...item,
Expand Down Expand Up @@ -155,7 +155,7 @@ const CustomMappingColor = (props: CustomMappingColorProps) => {
setCustomRanges(list);
} else {
// @ts-ignore
const list: CustomMappingColor[] = customRanges.map((item, _index) => {
const list: CustomMappingColorItem[] = customRanges.map((item, _index) => {
if (index === _index) {
return {
...item,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const getScaleDataByMappingColors = (list: CustomMappingColorItem[]) => {
const mapList: { color: string; value: string }[] = [];
list.forEach((item) => {
item.value.forEach((_item) => {
mapList.push({ color: item.color, value: typeof _item === 'string' ? _item : _item.toString() });
if (_item) {
mapList.push({ color: item.color, value: typeof _item === 'string' ? _item : _item.toString() });
}
});
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type CustomMappingColorItem = {
color: string;
value: (string | number)[];
value: (string | number | null)[];
id?: string;
};

Expand Down

0 comments on commit 70721d3

Please sign in to comment.