From 56b17bd6bbd93f835bd437d62e242810733393dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=99=93=E9=9D=99?= <17600756968@163.com> Date: Mon, 20 Jul 2020 10:50:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E7=BC=96=E8=BE=91=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/base/edit/onBlurFn.tsx | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 components/apolloTable/component/base/edit/onBlurFn.tsx diff --git a/components/apolloTable/component/base/edit/onBlurFn.tsx b/components/apolloTable/component/base/edit/onBlurFn.tsx new file mode 100644 index 0000000..c915358 --- /dev/null +++ b/components/apolloTable/component/base/edit/onBlurFn.tsx @@ -0,0 +1,20 @@ +import { setFormat } from '../index'; +import { config } from '../config'; + +export const onBlurFn = (props: any) => { + const { columnConfig, rowId, onBlurFn, value } = props; + const { type } = columnConfig + const extraData: any[] = [] + if (typeof onBlurFn === 'function') { + const newVal = setFormat(config[type], columnConfig, value) + extraData.push({ + columnCode: columnConfig.columnName, + cellValueList: newVal, + }); + onBlurFn({ + rowId, + value: extraData, + }, newVal); + } +}; + -- 2.21.0