From 5872244b9a2f11dc3956d92e7c587c6dcae0ec5f Mon Sep 17 00:00:00 2001 From: zhangwenshuai Date: Thu, 6 Aug 2020 18:02:06 +0800 Subject: [PATCH] update --- .../apolloTable/component/base/_utils/setFormatter.tsx | 1 + components/apolloTable/component/base/edit/rate/index.tsx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/apolloTable/component/base/_utils/setFormatter.tsx b/components/apolloTable/component/base/_utils/setFormatter.tsx index aacfc49..bf48c90 100644 --- a/components/apolloTable/component/base/_utils/setFormatter.tsx +++ b/components/apolloTable/component/base/_utils/setFormatter.tsx @@ -80,6 +80,7 @@ export const SetFormatter = { return SetFormatter.SEARCH(val); }, RATE: (val) => { + if (!isNumber(val)) return emptyModel; return [{ value: val, text: val }]; }, NUMBER: (val, config) => { diff --git a/components/apolloTable/component/base/edit/rate/index.tsx b/components/apolloTable/component/base/edit/rate/index.tsx index 4b5d13c..f405c44 100644 --- a/components/apolloTable/component/base/edit/rate/index.tsx +++ b/components/apolloTable/component/base/edit/rate/index.tsx @@ -6,7 +6,7 @@ import { ApolloRateProps } from '../editInterface'; import { onBlurFn } from '../onBlurFn'; export const ApolloRate = (props: ApolloRateProps) => { - const { onChange } = props; + const { onChange, columnConfig } = props; const selfProps = antiAssign(props, [ 'columnConfig', 'onChange', @@ -26,6 +26,9 @@ export const ApolloRate = (props: ApolloRateProps) => { onChange(value); } }; + if (columnConfig.requiredFlag) { + selfProps.allowClear = false; + } return (