Commit bcaa9a0740f938b572264f3d39ab9a1d42b7dc14

Authored by qiang.tian
1 parent 0a35b13e

fix: build

1 -import React from "react";  
2 import { createFromIconfontCN } from '@ant-design/icons'; 1 import { createFromIconfontCN } from '@ant-design/icons';
3 import { IconFontProps } from '@ant-design/icons/lib/components/IconFont'; 2 import { IconFontProps } from '@ant-design/icons/lib/components/IconFont';
4 -import IconField from './svg/icon-field.js';  
5 -import IconApp from './svg/icon-app.js';  
6 -import IconBase from './svg/icon-base.js';  
7 -import IconFlow from './svg/icon-flow.js'; 3 +import React from 'react';
  4 +import './svg/icon-app.js';
  5 +import './svg/icon-base.js';
  6 +import './svg/icon-field.js';
  7 +import './svg/icon-flow.js';
8 8
9 /** 9 /**
10 * 使用: 10 * 使用:
@@ -15,11 +15,8 @@ import IconFlow from './svg/icon-flow.js'; @@ -15,11 +15,8 @@ import IconFlow from './svg/icon-flow.js';
15 * 15 *
16 * @type {React.FC<IconFontProps<string>>} 16 * @type {React.FC<IconFontProps<string>>}
17 */ 17 */
18 -export const QxBaseIcon: React.FC<IconFontProps<string>> = createFromIconfontCN({  
19 - scriptUrl: [  
20 - IconField, // 启效表单组件图标  
21 - IconApp, // 应用图标  
22 - IconBase, // 启效基础图标  
23 - IconFlow, // 新版数据流图标  
24 - ],  
25 -}) 18 +export const QxBaseIcon: React.FC<IconFontProps<string>> = createFromIconfontCN(
  19 + {
  20 + scriptUrl: [],
  21 + },
  22 +);
1 import React, { useEffect, useRef, useState } from 'react'; 1 import React, { useEffect, useRef, useState } from 'react';
2 import defaultImg from './img/default_cover.png'; 2 import defaultImg from './img/default_cover.png';
3 import classNames from 'classnames'; 3 import classNames from 'classnames';
4 -import _ from 'lodash'; 4 +import { throttle, cloneDeep } from 'lodash-es';
5 import { 5 import {
6 Image, 6 Image,
7 message, 7 message,
@@ -156,7 +156,7 @@ export const QxIconSelector: React.FC<IconProps> = (props) => { @@ -156,7 +156,7 @@ export const QxIconSelector: React.FC<IconProps> = (props) => {
156 }); 156 });
157 }; 157 };
158 158
159 - const onScrollIconList = _.throttle( 159 + const onScrollIconList = throttle(
160 () => { 160 () => {
161 Object.keys(ICONS).forEach((cfy) => { 161 Object.keys(ICONS).forEach((cfy) => {
162 const iconItemDom: any = document.getElementById(`qx-icon-list-${cfy}`); 162 const iconItemDom: any = document.getElementById(`qx-icon-list-${cfy}`);
@@ -185,7 +185,7 @@ export const QxIconSelector: React.FC<IconProps> = (props) => { @@ -185,7 +185,7 @@ export const QxIconSelector: React.FC<IconProps> = (props) => {
185 185
186 const handleUpload = (file: any) => { 186 const handleUpload = (file: any) => {
187 // console.log('文件对象:',file); 187 // console.log('文件对象:',file);
188 - const imgArr = _.cloneDeep(historyImg); 188 + const imgArr = cloneDeep(historyImg);
189 const formData = { 189 const formData = {
190 file: 'file', 190 file: 'file',
191 appCode: 'my_icon', 191 appCode: 'my_icon',
@@ -241,7 +241,7 @@ export const QxIconSelector: React.FC<IconProps> = (props) => { @@ -241,7 +241,7 @@ export const QxIconSelector: React.FC<IconProps> = (props) => {
241 }; 241 };
242 242
243 const handleDelete = async (fileId: string, index: number) => { 243 const handleDelete = async (fileId: string, index: number) => {
244 - const imgArr = _.cloneDeep(historyImg); 244 + const imgArr = cloneDeep(historyImg);
245 await deleteImg([fileId]); 245 await deleteImg([fileId]);
246 imgArr.splice(index, 1); 246 imgArr.splice(index, 1);
247 setHistoryImg([...imgArr]); 247 setHistoryImg([...imgArr]);