zy-react-library 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +5 -1
  2. package/components/Cascader/Area/index.js +11 -11
  3. package/components/Cascader/Basic/index.js +23 -30
  4. package/components/Cascader/Dictionary/index.js +42 -42
  5. package/components/Cascader/Industry/index.js +12 -11
  6. package/components/Editor/index.js +43 -63
  7. package/components/FormBuilder/FormBuilder.js +97 -87
  8. package/components/FormBuilder/FormItemsRenderer.js +579 -581
  9. package/components/FormBuilder/index.js +5 -3
  10. package/components/HeaderBack/index.js +39 -32
  11. package/components/HiddenInfo/gwj/index.js +507 -439
  12. package/components/Icon/AddIcon/index.js +6 -6
  13. package/components/Icon/BackIcon/index.js +6 -6
  14. package/components/Icon/DeleteIcon/index.js +6 -6
  15. package/components/Icon/DownloadIcon/index.js +6 -6
  16. package/components/Icon/EditIcon/index.js +6 -6
  17. package/components/Icon/ExportIcon/index.js +6 -6
  18. package/components/Icon/ImportIcon/index.js +6 -6
  19. package/components/Icon/LocationIcon/index.js +6 -6
  20. package/components/Icon/PrintIcon/index.js +6 -6
  21. package/components/Icon/ResetIcon/index.js +6 -6
  22. package/components/Icon/SearchIcon/index.js +6 -6
  23. package/components/Icon/VideoIcon/index.js +6 -6
  24. package/components/Icon/ViewIcon/index.js +6 -6
  25. package/components/ImportFile/index.js +94 -91
  26. package/components/LeftTree/Area/index.js +15 -15
  27. package/components/LeftTree/Basic/index.js +54 -65
  28. package/components/LeftTree/Department/Gwj/index.js +29 -32
  29. package/components/LeftTree/Dictionary/index.js +42 -42
  30. package/components/Map/MapSelector.js +280 -254
  31. package/components/Map/index.js +90 -77
  32. package/components/Page/index.js +43 -34
  33. package/components/Pdf/index.js +92 -90
  34. package/components/PreviewImg/index.js +26 -32
  35. package/components/PreviewPdf/index.js +78 -86
  36. package/components/Search/index.js +147 -141
  37. package/components/Select/Basic/index.js +70 -76
  38. package/components/Select/Dictionary/index.js +42 -42
  39. package/components/Select/Personnel/Gwj/index.js +45 -49
  40. package/components/SelectCreate/index.js +33 -40
  41. package/components/SelectTree/Area/index.js +11 -17
  42. package/components/SelectTree/Basic/index.js +105 -102
  43. package/components/SelectTree/Department/Gwj/index.js +40 -46
  44. package/components/SelectTree/Dictionary/index.js +42 -42
  45. package/components/SelectTree/HiddenLevel/Gwj/index.js +33 -35
  46. package/components/SelectTree/HiddenPart/Gwj/index.js +16 -19
  47. package/components/SelectTree/Industry/index.js +12 -18
  48. package/components/Signature/index.js +68 -62
  49. package/components/Table/index.js +77 -73
  50. package/components/Table/index.less +7 -1
  51. package/components/TooltipPreviewImg/index.js +28 -27
  52. package/components/Upload/index.js +229 -275
  53. package/components/Video/AliPlayer.js +182 -160
  54. package/components/Video/index.js +71 -90
  55. package/css/common.less +4 -0
  56. package/enum/dictionary/index.js +5 -3
  57. package/enum/formItemRender/index.js +37 -35
  58. package/enum/hidden/gwj/index.js +65 -26
  59. package/enum/uploadFile/gwj/index.js +166 -84
  60. package/hooks/useDeleteFile/index.js +24 -30
  61. package/hooks/useDictionary/index.js +28 -30
  62. package/hooks/useDownloadBlob/index.js +78 -77
  63. package/hooks/useDownloadFile/index.js +76 -79
  64. package/hooks/useGetFile/index.js +32 -32
  65. package/hooks/useGetUrlQuery/index.js +1 -2
  66. package/hooks/useGetUserInfo/index.js +19 -26
  67. package/hooks/useIdle/index.js +9 -11
  68. package/hooks/useImportFile/index.js +30 -28
  69. package/hooks/useIsExistenceDuplicateSelection/index.js +25 -18
  70. package/hooks/useTable/index.js +49 -38
  71. package/hooks/useUploadFile/index.js +142 -147
  72. package/hooks/useUrlQueryCriteria/index.js +20 -13
  73. package/package.json +14 -1
  74. package/regular/index.js +34 -39
  75. package/utils/index.js +515 -511
@@ -1,9 +1,9 @@
1
- import { PlusOutlined } from "@ant-design/icons";
2
-
3
- const AddIcon = props => (
4
- <PlusOutlined {...props} />
5
- );
1
+ import { PlusOutlined } from '@ant-design/icons';
2
+ import { jsx } from 'react/jsx-runtime';
6
3
 
4
+ const AddIcon = props => /*#__PURE__*/jsx(PlusOutlined, {
5
+ ...props
6
+ });
7
7
  AddIcon.displayName = "AddIcon";
8
8
 
9
- export default AddIcon;
9
+ export { AddIcon as default };
@@ -1,9 +1,9 @@
1
- import { ArrowLeftOutlined } from "@ant-design/icons";
2
-
3
- const BackIcon = props => (
4
- <ArrowLeftOutlined {...props} />
5
- );
1
+ import { ArrowLeftOutlined } from '@ant-design/icons';
2
+ import { jsx } from 'react/jsx-runtime';
6
3
 
4
+ const BackIcon = props => /*#__PURE__*/jsx(ArrowLeftOutlined, {
5
+ ...props
6
+ });
7
7
  BackIcon.displayName = "BackIcon";
8
8
 
9
- export default BackIcon;
9
+ export { BackIcon as default };
@@ -1,9 +1,9 @@
1
- import { DeleteOutlined } from "@ant-design/icons";
2
-
3
- const DeleteIcon = props => (
4
- <DeleteOutlined {...props} />
5
- );
1
+ import { DeleteOutlined } from '@ant-design/icons';
2
+ import { jsx } from 'react/jsx-runtime';
6
3
 
4
+ const DeleteIcon = props => /*#__PURE__*/jsx(DeleteOutlined, {
5
+ ...props
6
+ });
7
7
  DeleteIcon.displayName = "DeleteIcon";
8
8
 
9
- export default DeleteIcon;
9
+ export { DeleteIcon as default };
@@ -1,9 +1,9 @@
1
- import { DownloadOutlined } from "@ant-design/icons";
2
-
3
- const DownloadIcon = props => (
4
- <DownloadOutlined {...props} />
5
- );
1
+ import { DownloadOutlined } from '@ant-design/icons';
2
+ import { jsx } from 'react/jsx-runtime';
6
3
 
4
+ const DownloadIcon = props => /*#__PURE__*/jsx(DownloadOutlined, {
5
+ ...props
6
+ });
7
7
  DownloadIcon.displayName = "DownloadIcon";
8
8
 
9
- export default DownloadIcon;
9
+ export { DownloadIcon as default };
@@ -1,9 +1,9 @@
1
- import { EditOutlined } from "@ant-design/icons";
2
-
3
- const EditIcon = props => (
4
- <EditOutlined {...props} />
5
- );
1
+ import { EditOutlined } from '@ant-design/icons';
2
+ import { jsx } from 'react/jsx-runtime';
6
3
 
4
+ const EditIcon = props => /*#__PURE__*/jsx(EditOutlined, {
5
+ ...props
6
+ });
7
7
  EditIcon.displayName = "EditIcon";
8
8
 
9
- export default EditIcon;
9
+ export { EditIcon as default };
@@ -1,9 +1,9 @@
1
- import { ExportOutlined } from "@ant-design/icons";
2
-
3
- const ExportIcon = props => (
4
- <ExportOutlined {...props} />
5
- );
1
+ import { ExportOutlined } from '@ant-design/icons';
2
+ import { jsx } from 'react/jsx-runtime';
6
3
 
4
+ const ExportIcon = props => /*#__PURE__*/jsx(ExportOutlined, {
5
+ ...props
6
+ });
7
7
  ExportIcon.displayName = "ExportIcon";
8
8
 
9
- export default ExportIcon;
9
+ export { ExportIcon as default };
@@ -1,9 +1,9 @@
1
- import { ImportOutlined } from "@ant-design/icons";
2
-
3
- const ImportIcon = props => (
4
- <ImportOutlined {...props} />
5
- );
1
+ import { ImportOutlined } from '@ant-design/icons';
2
+ import { jsx } from 'react/jsx-runtime';
6
3
 
4
+ const ImportIcon = props => /*#__PURE__*/jsx(ImportOutlined, {
5
+ ...props
6
+ });
7
7
  ImportIcon.displayName = "ImportIcon";
8
8
 
9
- export default ImportIcon;
9
+ export { ImportIcon as default };
@@ -1,9 +1,9 @@
1
- import { EnvironmentOutlined } from "@ant-design/icons";
2
-
3
- const LocationIcon = props => (
4
- <EnvironmentOutlined {...props} />
5
- );
1
+ import { EnvironmentOutlined } from '@ant-design/icons';
2
+ import { jsx } from 'react/jsx-runtime';
6
3
 
4
+ const LocationIcon = props => /*#__PURE__*/jsx(EnvironmentOutlined, {
5
+ ...props
6
+ });
7
7
  LocationIcon.displayName = "LocationIcon";
8
8
 
9
- export default LocationIcon;
9
+ export { LocationIcon as default };
@@ -1,9 +1,9 @@
1
- import { PrinterOutlined } from "@ant-design/icons";
2
-
3
- const PrintIcon = props => (
4
- <PrinterOutlined {...props} />
5
- );
1
+ import { PrinterOutlined } from '@ant-design/icons';
2
+ import { jsx } from 'react/jsx-runtime';
6
3
 
4
+ const PrintIcon = props => /*#__PURE__*/jsx(PrinterOutlined, {
5
+ ...props
6
+ });
7
7
  PrintIcon.displayName = "PrintIcon";
8
8
 
9
- export default PrintIcon;
9
+ export { PrintIcon as default };
@@ -1,9 +1,9 @@
1
- import { ReloadOutlined } from "@ant-design/icons";
2
-
3
- const ResetIcon = props => (
4
- <ReloadOutlined {...props} />
5
- );
1
+ import { ReloadOutlined } from '@ant-design/icons';
2
+ import { jsx } from 'react/jsx-runtime';
6
3
 
4
+ const ResetIcon = props => /*#__PURE__*/jsx(ReloadOutlined, {
5
+ ...props
6
+ });
7
7
  ResetIcon.displayName = "ResetIcon";
8
8
 
9
- export default ResetIcon;
9
+ export { ResetIcon as default };
@@ -1,9 +1,9 @@
1
- import { SearchOutlined } from "@ant-design/icons";
2
-
3
- const SearchIcon = props => (
4
- <SearchOutlined {...props} />
5
- );
1
+ import { SearchOutlined } from '@ant-design/icons';
2
+ import { jsx } from 'react/jsx-runtime';
6
3
 
4
+ const SearchIcon = props => /*#__PURE__*/jsx(SearchOutlined, {
5
+ ...props
6
+ });
7
7
  SearchIcon.displayName = "SearchIcon";
8
8
 
9
- export default SearchIcon;
9
+ export { SearchIcon as default };
@@ -1,9 +1,9 @@
1
- import { PlayCircleOutlined } from "@ant-design/icons";
2
-
3
- const VideoIcon = props => (
4
- <PlayCircleOutlined {...props} />
5
- );
1
+ import { PlayCircleOutlined } from '@ant-design/icons';
2
+ import { jsx } from 'react/jsx-runtime';
6
3
 
4
+ const VideoIcon = props => /*#__PURE__*/jsx(PlayCircleOutlined, {
5
+ ...props
6
+ });
7
7
  VideoIcon.displayName = "VideoIcon";
8
8
 
9
- export default VideoIcon;
9
+ export { VideoIcon as default };
@@ -1,9 +1,9 @@
1
- import { EyeOutlined } from "@ant-design/icons";
2
-
3
- const ViewIcon = props => (
4
- <EyeOutlined {...props} />
5
- );
1
+ import { EyeOutlined } from '@ant-design/icons';
2
+ import { jsx } from 'react/jsx-runtime';
6
3
 
4
+ const ViewIcon = props => /*#__PURE__*/jsx(EyeOutlined, {
5
+ ...props
6
+ });
7
7
  ViewIcon.displayName = "ViewIcon";
8
8
 
9
- export default ViewIcon;
9
+ export { ViewIcon as default };
@@ -1,91 +1,94 @@
1
- import { Button, Form, Modal } from "antd";
2
- import { getFileUrl } from "../../utils";
3
- import Upload from "../Upload";
4
-
5
- /**
6
- * 导入文件组件
7
- */
8
- const ImportFile = (props) => {
9
- const {
10
- visible,
11
- onCancel,
12
- onConfirm,
13
- title = "导入",
14
- templateUrl,
15
- labelCol = { span: 4 },
16
- children,
17
- exportTemplateButtonText = "导出模板",
18
- extraButtons,
19
- ...restProps
20
- } = props;
21
-
22
- const [form] = Form.useForm();
23
-
24
- // 关闭弹窗
25
- const handleClose = () => {
26
- form.resetFields();
27
- onCancel();
28
- };
29
-
30
- // 提交表单
31
- const handleSubmit = (values) => {
32
- onConfirm(values);
33
- handleClose();
34
- };
35
-
36
- // 导出模板
37
- const handleExportTemplate = () => {
38
- Modal.confirm({
39
- title: "提示",
40
- content: "确定要下载excel模板吗?",
41
- okText: "确定",
42
- cancelText: "取消",
43
- onOk: () => {
44
- const fileUrl = getFileUrl();
45
- window.open(fileUrl + templateUrl);
46
- },
47
- });
48
- };
49
-
50
- return (
51
- <Modal
52
- title={title}
53
- open={visible}
54
- onCancel={handleClose}
55
- width={600}
56
- maskClosable={false}
57
- footer={[
58
- templateUrl && (
59
- <Button key="export" onClick={handleExportTemplate}>
60
- {exportTemplateButtonText}
61
- </Button>
62
- ),
63
- ...(extraButtons || []),
64
- <Button key="cancel" onClick={handleClose}>
65
- 取消
66
- </Button>,
67
- <Button key="submit" type="primary" onClick={form.submit}>
68
- 确定
69
- </Button>,
70
- ]}
71
- >
72
- <Form
73
- form={form}
74
- labelCol={labelCol}
75
- wrapperCol={{ span: 24 - labelCol.span }}
76
- scrollToFirstError
77
- onFinish={handleSubmit}
78
- {...restProps}
79
- >
80
- {children && typeof children === "function" ? children({ form }) : children}
81
- <Form.Item label="附件" name="file" rules={[{ required: true, message: "附件不能为空" }]}>
82
- <Upload accept=".xls,.xlsx" listType="text" maxCount={1} />
83
- </Form.Item>
84
- </Form>
85
- </Modal>
86
- );
87
- };
88
-
89
- ImportFile.displayName = "ImportFile";
90
-
91
- export default ImportFile;
1
+ import { Form, Modal, Button } from 'antd';
2
+ import { getFileUrl } from '../../utils/index.js';
3
+ import Upload from '../Upload/index.js';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
5
+
6
+ const ImportFile = props => {
7
+ const {
8
+ visible,
9
+ onCancel,
10
+ onConfirm,
11
+ title = "导入",
12
+ templateUrl,
13
+ labelCol = {
14
+ span: 4
15
+ },
16
+ children,
17
+ exportTemplateButtonText = "导出模板",
18
+ extraButtons,
19
+ ...restProps
20
+ } = props;
21
+ const [form] = Form.useForm();
22
+
23
+ // 关闭弹窗
24
+ const handleClose = () => {
25
+ form.resetFields();
26
+ onCancel();
27
+ };
28
+
29
+ // 提交表单
30
+ const handleSubmit = values => {
31
+ onConfirm(values);
32
+ handleClose();
33
+ };
34
+
35
+ // 导出模板
36
+ const handleExportTemplate = () => {
37
+ Modal.confirm({
38
+ title: "提示",
39
+ content: "确定要下载excel模板吗?",
40
+ okText: "确定",
41
+ cancelText: "取消",
42
+ onOk: () => {
43
+ const fileUrl = getFileUrl();
44
+ window.open(fileUrl + templateUrl);
45
+ }
46
+ });
47
+ };
48
+ return /*#__PURE__*/jsx(Modal, {
49
+ title: title,
50
+ open: visible,
51
+ onCancel: handleClose,
52
+ width: 600,
53
+ maskClosable: false,
54
+ footer: [templateUrl && /*#__PURE__*/jsx(Button, {
55
+ onClick: handleExportTemplate,
56
+ children: exportTemplateButtonText
57
+ }, "export"), ...(extraButtons || []), /*#__PURE__*/jsx(Button, {
58
+ onClick: handleClose,
59
+ children: "\u53D6\u6D88"
60
+ }, "cancel"), /*#__PURE__*/jsx(Button, {
61
+ type: "primary",
62
+ onClick: form.submit,
63
+ children: "\u786E\u5B9A"
64
+ }, "submit")],
65
+ children: /*#__PURE__*/jsxs(Form, {
66
+ form: form,
67
+ labelCol: labelCol,
68
+ wrapperCol: {
69
+ span: 24 - labelCol.span
70
+ },
71
+ scrollToFirstError: true,
72
+ onFinish: handleSubmit,
73
+ ...restProps,
74
+ children: [children && typeof children === "function" ? children({
75
+ form
76
+ }) : children, /*#__PURE__*/jsx(Form.Item, {
77
+ label: "\u9644\u4EF6",
78
+ name: "file",
79
+ rules: [{
80
+ required: true,
81
+ message: "附件不能为空"
82
+ }],
83
+ children: /*#__PURE__*/jsx(Upload, {
84
+ accept: ".xls,.xlsx",
85
+ listType: "text",
86
+ maxCount: 1
87
+ })
88
+ })]
89
+ })
90
+ });
91
+ };
92
+ ImportFile.displayName = "ImportFile";
93
+
94
+ export { ImportFile as default };
@@ -1,15 +1,15 @@
1
- import Area from "../../../json/area.json";
2
- import BasicLeftTree from "../Basic";
3
-
4
- /**
5
- * 属地左侧树组件
6
- */
7
- function AreaLeftTree(props) {
8
- return (
9
- <BasicLeftTree treeData={Area} nameKey="label" idKey="value" {...props} />
10
- );
11
- }
12
-
13
- AreaLeftTree.displayName = "AreaLeftTree";
14
-
15
- export default AreaLeftTree;
1
+ import Area from '../../../json/area.json';
2
+ import BasicLeftTree from '../Basic/index.js';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ function AreaLeftTree(props) {
6
+ return /*#__PURE__*/jsx(BasicLeftTree, {
7
+ treeData: Area,
8
+ nameKey: "label",
9
+ idKey: "value",
10
+ ...props
11
+ });
12
+ }
13
+ AreaLeftTree.displayName = "AreaLeftTree";
14
+
15
+ export { AreaLeftTree as default };
@@ -1,13 +1,16 @@
1
- import { Input, Tree } from "antd";
2
- import { useEffect, useState } from "react";
3
- import { getTreeNodePaths } from "../../../utils";
1
+ import { Input, Tree } from 'antd';
2
+ import { useState, useEffect } from 'react';
3
+ import { getTreeNodePaths } from '../../../utils/index.js';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
5
 
5
- const { Search } = Input;
6
+ const {
7
+ Search
8
+ } = Input;
6
9
 
7
10
  /**
8
11
  * 基础左侧树组件(不建议直接使用此组件,二次继承使用)
9
12
  */
10
- const BasicLeftTree = (props) => {
13
+ const BasicLeftTree = props => {
11
14
  const {
12
15
  onGetData,
13
16
  onSelect,
@@ -20,21 +23,18 @@ const BasicLeftTree = (props) => {
20
23
  childrenKey = "children",
21
24
  ...restProps
22
25
  } = props;
23
-
24
26
  const [expandedKeys, setExpandedKeys] = useState([]);
25
27
  const [searchValue, setSearchValue] = useState("");
26
28
  const [autoExpandParent, setAutoExpandParent] = useState(true);
27
-
28
29
  useEffect(() => {
29
30
  setExpandedKeys(externalExpandedKeys);
30
31
  }, [externalExpandedKeys]);
31
32
 
32
33
  // 展开所有包含匹配项的父节点
33
34
  const getAllExpandedKeys = (data, searchValue, keys = []) => {
34
- data.forEach((node) => {
35
+ data.forEach(node => {
35
36
  if (node[childrenKey]) {
36
- if (node[nameKey].includes(searchValue)
37
- || node[childrenKey].some(child => child[nameKey].includes(searchValue))) {
37
+ if (node[nameKey].includes(searchValue) || node[childrenKey].some(child => child[nameKey].includes(searchValue))) {
38
38
  keys.push(node[idKey]);
39
39
  }
40
40
  getAllExpandedKeys(node[childrenKey], searchValue, keys);
@@ -48,7 +48,6 @@ const BasicLeftTree = (props) => {
48
48
  if (!searchValue) {
49
49
  return data;
50
50
  }
51
-
52
51
  return data.reduce((acc, node) => {
53
52
  // 检查当前节点是否匹配
54
53
  const isMatch = node[nameKey].includes(searchValue);
@@ -60,19 +59,16 @@ const BasicLeftTree = (props) => {
60
59
  if (isMatch || filteredChildren.length > 0) {
61
60
  acc.push({
62
61
  ...node,
63
- [childrenKey]: filteredChildren.length > 0 ? filteredChildren : undefined,
62
+ [childrenKey]: filteredChildren.length > 0 ? filteredChildren : undefined
64
63
  });
65
64
  }
66
-
67
65
  return acc;
68
66
  }, []);
69
67
  };
70
-
71
- const handleExpand = (newExpandedKeys) => {
68
+ const handleExpand = newExpandedKeys => {
72
69
  setExpandedKeys(newExpandedKeys);
73
70
  setAutoExpandParent(false);
74
71
  };
75
-
76
72
  const handleSelect = (selectedKeys, event) => {
77
73
  if (selectedKeys.length > 0) {
78
74
  const selectedNodeId = selectedKeys[0];
@@ -81,91 +77,84 @@ const BasicLeftTree = (props) => {
81
77
  targetId: selectedNodeId,
82
78
  idKey,
83
79
  childrenKey,
84
- isIncludeOneself: onGetNodePathsIsIncludeOneself,
80
+ isIncludeOneself: onGetNodePathsIsIncludeOneself
85
81
  });
86
82
  onGetNodePaths?.(parentNodes);
87
83
  }
88
84
  onSelect?.(selectedKeys, event);
89
85
  };
90
-
91
- const onFilterTreeData = (value) => {
86
+ const onFilterTreeData = value => {
92
87
  setSearchValue(value);
93
88
  setAutoExpandParent(true);
94
-
95
89
  if (!value) {
96
90
  setExpandedKeys([]);
97
91
  return;
98
92
  }
99
-
100
93
  const expandedKeys = getAllExpandedKeys(treeData, value);
101
-
102
94
  setExpandedKeys(expandedKeys);
103
95
  };
104
-
105
- const onSearch = async (value) => {
106
- if (value === searchValue)
107
- return;
96
+ const onSearch = async value => {
97
+ if (value === searchValue) return;
108
98
  onFilterTreeData(value);
109
99
  };
110
100
 
111
101
  // 渲染带高亮的标题
112
- const renderTitle = (name) => {
113
- if (!searchValue)
114
- return name;
115
-
102
+ const renderTitle = name => {
103
+ if (!searchValue) return name;
116
104
  const index = name.indexOf(searchValue);
117
- if (index === -1)
118
- return name;
119
-
105
+ if (index === -1) return name;
120
106
  const beforeStr = name.substring(0, index);
121
107
  const afterStr = name.substring(index + searchValue.length);
122
-
123
- return (
124
- <span>
125
- {beforeStr}
126
- <span style={{ color: "#f50" }}>{searchValue}</span>
127
- {afterStr}
128
- </span>
129
- );
108
+ return /*#__PURE__*/jsxs("span", {
109
+ children: [beforeStr, /*#__PURE__*/jsx("span", {
110
+ style: {
111
+ color: "#f50"
112
+ },
113
+ children: searchValue
114
+ }), afterStr]
115
+ });
130
116
  };
131
117
 
132
118
  // 递归处理树节点标题显示
133
- const processTreeData = (data) => {
119
+ const processTreeData = data => {
134
120
  return data.map(node => ({
135
121
  ...node,
136
122
  [nameKey]: renderTitle(node[nameKey]),
137
- [childrenKey]: node[childrenKey] ? processTreeData(node[childrenKey]) : undefined,
123
+ [childrenKey]: node[childrenKey] ? processTreeData(node[childrenKey]) : undefined
138
124
  }));
139
125
  };
140
126
 
141
127
  // 过滤并处理树数据
142
128
  const filteredTreeData = filterTreeData(treeData, searchValue);
143
129
  const processedTreeData = processTreeData(filteredTreeData);
144
-
145
130
  useEffect(() => {
146
131
  onGetData?.(treeData);
147
132
  }, [treeData]);
148
-
149
- return (
150
- <div style={{ width: 300 }}>
151
- <Search
152
- style={{ marginBottom: 8 }}
153
- placeholder="输入关键字进行过滤"
154
- onSearch={onSearch}
155
- />
156
- <Tree
157
- onExpand={handleExpand}
158
- onSelect={handleSelect}
159
- autoExpandParent={autoExpandParent}
160
- expandedKeys={expandedKeys}
161
- treeData={processedTreeData}
162
- fieldNames={{ title: nameKey, key: idKey, children: childrenKey }}
163
- {...restProps}
164
- />
165
- </div>
166
- );
133
+ return /*#__PURE__*/jsxs("div", {
134
+ style: {
135
+ width: 300
136
+ },
137
+ children: [/*#__PURE__*/jsx(Search, {
138
+ style: {
139
+ marginBottom: 8
140
+ },
141
+ placeholder: "\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u8FC7\u6EE4",
142
+ onSearch: onSearch
143
+ }), /*#__PURE__*/jsx(Tree, {
144
+ onExpand: handleExpand,
145
+ onSelect: handleSelect,
146
+ autoExpandParent: autoExpandParent,
147
+ expandedKeys: expandedKeys,
148
+ treeData: processedTreeData,
149
+ fieldNames: {
150
+ title: nameKey,
151
+ key: idKey,
152
+ children: childrenKey
153
+ },
154
+ ...restProps
155
+ })]
156
+ });
167
157
  };
168
-
169
158
  BasicLeftTree.displayName = "BasicLeftTree";
170
159
 
171
- export default BasicLeftTree;
160
+ export { BasicLeftTree as default };