Showing
3 changed files
with
7 additions
and
4 deletions
... | ... | @@ -10,8 +10,8 @@ import React, { |
10 | 10 | useState, |
11 | 11 | } from 'react'; |
12 | 12 | import { FunctionProps } from '../index'; |
13 | +import emptyImg from '../svg/custom_chart_null.png'; | |
13 | 14 | import { handleHighlight } from './var-picker'; |
14 | -const emptyImg = require('../svg/custom_chart_null.png'); | |
15 | 15 | type PickProps = { |
16 | 16 | dataSource: FunctionProps[]; |
17 | 17 | onHover: (nodeData: FunctionProps | null) => void; | ... | ... |
... | ... | @@ -11,8 +11,8 @@ import React, { |
11 | 11 | useState, |
12 | 12 | } from 'react'; |
13 | 13 | import { ColsTreeSelectProps } from '../index'; |
14 | +import emptyImg from '../svg/custom_chart_null.png'; | |
14 | 15 | import { widgetMapping } from '../util'; |
15 | -const emptyImg = require('../svg/custom_chart_null.png'); | |
16 | 16 | |
17 | 17 | type VarProps = { |
18 | 18 | dataSource: ColsTreeSelectProps[]; | ... | ... |
... | ... | @@ -134,7 +134,7 @@ export const QxFunctionOperation: React.FC<QxFunOperationProps> = ({ |
134 | 134 | if (isScriptEditMode) setScriptEdit(isScriptEditMode); |
135 | 135 | }, [isScriptEditMode]); |
136 | 136 | |
137 | - const dealFunctionList = (originData: any = []) => { | |
137 | + const dealFunctionList = (originData: any) => { | |
138 | 138 | // const titleEnum: any = { |
139 | 139 | // TEXT: '文本函数', |
140 | 140 | // MATH: '数学函数', |
... | ... | @@ -145,7 +145,10 @@ export const QxFunctionOperation: React.FC<QxFunOperationProps> = ({ |
145 | 145 | // CUSTOM: '自定义', |
146 | 146 | // COMMON: '常用函数', |
147 | 147 | // }; |
148 | - const funcList = originData.map( | |
148 | + if (!_.isArray(originData)) { | |
149 | + return; | |
150 | + } | |
151 | + const funcList = originData?.map( | |
149 | 152 | (item: { name: string; code: string; details?: any[] }) => { |
150 | 153 | return { |
151 | 154 | key: item.code, | ... | ... |