1
|
1
|
import React, { useEffect, useRef, useState } from 'react';
|
2
|
2
|
import defaultImg from './img/default_cover.png';
|
3
|
3
|
import classNames from 'classnames';
|
4
|
|
-import _ from 'lodash';
|
|
4
|
+import { throttle, cloneDeep } from 'lodash-es';
|
5
|
5
|
import {
|
6
|
6
|
Image,
|
7
|
7
|
message,
|
...
|
...
|
@@ -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
|
161
|
Object.keys(ICONS).forEach((cfy) => {
|
162
|
162
|
const iconItemDom: any = document.getElementById(`qx-icon-list-${cfy}`);
|
...
|
...
|
@@ -185,7 +185,7 @@ export const QxIconSelector: React.FC<IconProps> = (props) => { |
185
|
185
|
|
186
|
186
|
const handleUpload = (file: any) => {
|
187
|
187
|
// console.log('文件对象:',file);
|
188
|
|
- const imgArr = _.cloneDeep(historyImg);
|
|
188
|
+ const imgArr = cloneDeep(historyImg);
|
189
|
189
|
const formData = {
|
190
|
190
|
file: 'file',
|
191
|
191
|
appCode: 'my_icon',
|
...
|
...
|
@@ -241,7 +241,7 @@ export const QxIconSelector: React.FC<IconProps> = (props) => { |
241
|
241
|
};
|
242
|
242
|
|
243
|
243
|
const handleDelete = async (fileId: string, index: number) => {
|
244
|
|
- const imgArr = _.cloneDeep(historyImg);
|
|
244
|
+ const imgArr = cloneDeep(historyImg);
|
245
|
245
|
await deleteImg([fileId]);
|
246
|
246
|
imgArr.splice(index, 1);
|
247
|
247
|
setHistoryImg([...imgArr]);
|
...
|
...
|
|