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