zy-react-library 1.1.2 → 1.1.3

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 (72) hide show
  1. package/components/Cascader/Area/index.js +1 -20
  2. package/components/Cascader/Basic/index.js +1 -57
  3. package/components/Cascader/Dictionary/index.js +1 -42
  4. package/components/Cascader/Industry/index.js +1 -21
  5. package/components/Editor/index.js +1 -82
  6. package/components/FormBuilder/FormBuilder.js +1 -97
  7. package/components/FormBuilder/FormItemsRenderer.js +1 -589
  8. package/components/FormBuilder/index.js +1 -5
  9. package/components/HeaderBack/index.js +1 -44
  10. package/components/HiddenInfo/gwj/index.js +1 -586
  11. package/components/Icon/AddIcon/index.js +1 -9
  12. package/components/Icon/BackIcon/index.js +1 -9
  13. package/components/Icon/DeleteIcon/index.js +1 -9
  14. package/components/Icon/DownloadIcon/index.js +1 -9
  15. package/components/Icon/EditIcon/index.js +1 -9
  16. package/components/Icon/ExportIcon/index.js +1 -9
  17. package/components/Icon/ImportIcon/index.js +1 -9
  18. package/components/Icon/LocationIcon/index.js +1 -9
  19. package/components/Icon/PrintIcon/index.js +1 -9
  20. package/components/Icon/ResetIcon/index.js +1 -9
  21. package/components/Icon/SearchIcon/index.js +1 -9
  22. package/components/Icon/VideoIcon/index.js +1 -9
  23. package/components/Icon/ViewIcon/index.js +1 -9
  24. package/components/ImportFile/index.js +1 -94
  25. package/components/LeftTree/Area/index.js +1 -15
  26. package/components/LeftTree/Basic/index.js +1 -160
  27. package/components/LeftTree/Department/Gwj/index.js +1 -29
  28. package/components/LeftTree/Dictionary/index.js +1 -42
  29. package/components/Map/MapSelector.js +1 -280
  30. package/components/Map/index.js +1 -90
  31. package/components/Page/index.js +1 -59
  32. package/components/Pdf/index.js +1 -136
  33. package/components/PreviewImg/index.js +1 -26
  34. package/components/PreviewPdf/index.js +1 -78
  35. package/components/Search/index.js +1 -147
  36. package/components/Select/Basic/index.js +1 -70
  37. package/components/Select/Dictionary/index.js +1 -42
  38. package/components/Select/Personnel/Gwj/index.js +1 -45
  39. package/components/SelectCreate/index.js +1 -48
  40. package/components/SelectTree/Area/index.js +1 -20
  41. package/components/SelectTree/Basic/index.js +1 -105
  42. package/components/SelectTree/Department/Gwj/index.js +1 -40
  43. package/components/SelectTree/Dictionary/index.js +1 -42
  44. package/components/SelectTree/HiddenLevel/Gwj/index.js +1 -70
  45. package/components/SelectTree/HiddenPart/Gwj/index.js +1 -36
  46. package/components/SelectTree/Industry/index.js +1 -21
  47. package/components/Signature/index.js +1 -100
  48. package/components/Table/index.js +1 -77
  49. package/components/TooltipPreviewImg/index.js +1 -28
  50. package/components/Upload/index.js +1 -229
  51. package/components/Video/AliPlayer.js +1 -182
  52. package/components/Video/index.js +1 -71
  53. package/enum/dictionary/index.js +1 -9
  54. package/enum/formItemRender/index.js +1 -39
  55. package/enum/hidden/gwj/index.js +1 -70
  56. package/enum/uploadFile/gwj/index.js +1 -258
  57. package/hooks/useDeleteFile/index.js +1 -95
  58. package/hooks/useDictionary/index.js +1 -64
  59. package/hooks/useDownloadBlob/index.js +1 -80
  60. package/hooks/useDownloadFile/index.js +1 -78
  61. package/hooks/useGetFile/index.js +1 -74
  62. package/hooks/useGetUrlQuery/index.js +1 -15
  63. package/hooks/useGetUserInfo/index.js +1 -42
  64. package/hooks/useIdle/index.js +1 -65
  65. package/hooks/useImportFile/index.js +1 -61
  66. package/hooks/useIsExistenceDuplicateSelection/index.js +1 -27
  67. package/hooks/useTable/index.js +1 -124
  68. package/hooks/useUploadFile/index.js +1 -144
  69. package/hooks/useUrlQueryCriteria/index.js +1 -84
  70. package/package.json +5 -1
  71. package/regular/index.js +1 -56
  72. package/utils/index.js +1 -591
@@ -1,9 +1 @@
1
- import { ExportOutlined } from '@ant-design/icons';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- const ExportIcon = props => /*#__PURE__*/jsx(ExportOutlined, {
5
- ...props
6
- });
7
- ExportIcon.displayName = "ExportIcon";
8
-
9
- export { ExportIcon as default };
1
+ import{ExportOutlined as o}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const r=r=>t(o,{...r});r.displayName="ExportIcon";export{r as default};
@@ -1,9 +1 @@
1
- import { ImportOutlined } from '@ant-design/icons';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- const ImportIcon = props => /*#__PURE__*/jsx(ImportOutlined, {
5
- ...props
6
- });
7
- ImportIcon.displayName = "ImportIcon";
8
-
9
- export { ImportIcon as default };
1
+ import{ImportOutlined as o}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const r=r=>t(o,{...r});r.displayName="ImportIcon";export{r as default};
@@ -1,9 +1 @@
1
- import { EnvironmentOutlined } from '@ant-design/icons';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- const LocationIcon = props => /*#__PURE__*/jsx(EnvironmentOutlined, {
5
- ...props
6
- });
7
- LocationIcon.displayName = "LocationIcon";
8
-
9
- export { LocationIcon as default };
1
+ import{EnvironmentOutlined as o}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const a=a=>t(o,{...a});a.displayName="LocationIcon";export{a as default};
@@ -1,9 +1 @@
1
- import { PrinterOutlined } from '@ant-design/icons';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- const PrintIcon = props => /*#__PURE__*/jsx(PrinterOutlined, {
5
- ...props
6
- });
7
- PrintIcon.displayName = "PrintIcon";
8
-
9
- export { PrintIcon as default };
1
+ import{PrinterOutlined as t}from"@ant-design/icons";import{jsx as o}from"react/jsx-runtime";const r=r=>o(t,{...r});r.displayName="PrintIcon";export{r as default};
@@ -1,9 +1 @@
1
- import { ReloadOutlined } from '@ant-design/icons';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- const ResetIcon = props => /*#__PURE__*/jsx(ReloadOutlined, {
5
- ...props
6
- });
7
- ResetIcon.displayName = "ResetIcon";
8
-
9
- export { ResetIcon as default };
1
+ import{ReloadOutlined as t}from"@ant-design/icons";import{jsx as e}from"react/jsx-runtime";const o=o=>e(t,{...o});o.displayName="ResetIcon";export{o as default};
@@ -1,9 +1 @@
1
- import { SearchOutlined } from '@ant-design/icons';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- const SearchIcon = props => /*#__PURE__*/jsx(SearchOutlined, {
5
- ...props
6
- });
7
- SearchIcon.displayName = "SearchIcon";
8
-
9
- export { SearchIcon as default };
1
+ import{SearchOutlined as o}from"@ant-design/icons";import{jsx as r}from"react/jsx-runtime";const t=t=>r(o,{...t});t.displayName="SearchIcon";export{t as default};
@@ -1,9 +1 @@
1
- import { PlayCircleOutlined } from '@ant-design/icons';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- const VideoIcon = props => /*#__PURE__*/jsx(PlayCircleOutlined, {
5
- ...props
6
- });
7
- VideoIcon.displayName = "VideoIcon";
8
-
9
- export { VideoIcon as default };
1
+ import{PlayCircleOutlined as o}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const e=e=>t(o,{...e});e.displayName="VideoIcon";export{e as default};
@@ -1,9 +1 @@
1
- import { EyeOutlined } from '@ant-design/icons';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- const ViewIcon = props => /*#__PURE__*/jsx(EyeOutlined, {
5
- ...props
6
- });
7
- ViewIcon.displayName = "ViewIcon";
8
-
9
- export { ViewIcon as default };
1
+ import{EyeOutlined as o}from"@ant-design/icons";import{jsx as t}from"react/jsx-runtime";const e=e=>t(o,{...e});e.displayName="ViewIcon";export{e as default};
@@ -1,94 +1 @@
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
+ import{Form as e,Modal as t,Button as o}from"antd";import{getFileUrl as l}from"../../utils/index.js";import n from"../Upload/index.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";const s=s=>{const{visible:a,onCancel:c,onConfirm:m,title:p="导入",templateUrl:d,labelCol:x={span:4},children:f,exportTemplateButtonText:u="导出模板",extraButtons:C,...h}=s,[b]=e.useForm(),k=()=>{b.resetFields(),c()};return r(t,{title:p,open:a,onCancel:k,width:600,maskClosable:!1,footer:[d&&r(o,{onClick:()=>{t.confirm({title:"提示",content:"确定要下载excel模板吗?",okText:"确定",cancelText:"取消",onOk:()=>{const e=l();window.open(e+d)}})},children:u},"export"),...C||[],r(o,{onClick:k,children:"取消"},"cancel"),r(o,{type:"primary",onClick:b.submit,children:"确定"},"submit")],children:i(e,{form:b,labelCol:x,wrapperCol:{span:24-x.span},scrollToFirstError:!0,onFinish:e=>{m(e),k()},...h,children:[f&&"function"==typeof f?f({form:b}):f,r(e.Item,{label:"附件",name:"file",rules:[{required:!0,message:"附件不能为空"}],children:r(n,{accept:".xls,.xlsx",listType:"text",maxCount:1})})]})})};s.displayName="ImportFile";export{s as default};
@@ -1,15 +1 @@
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
+ import e from"../../../json/area.json";import r from"../Basic/index.js";import{jsx as a}from"react/jsx-runtime";function t(t){return a(r,{treeData:e,nameKey:"label",idKey:"value",...t})}t.displayName="AreaLeftTree";export{t as default};
@@ -1,160 +1 @@
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';
5
-
6
- const {
7
- Search
8
- } = Input;
9
-
10
- /**
11
- * 基础左侧树组件(不建议直接使用此组件,二次继承使用)
12
- */
13
- const BasicLeftTree = props => {
14
- const {
15
- onGetData,
16
- onSelect,
17
- onGetNodePaths,
18
- onGetNodePathsIsIncludeOneself = true,
19
- expandedKeys: externalExpandedKeys,
20
- treeData = [],
21
- nameKey = "name",
22
- idKey = "id",
23
- childrenKey = "children",
24
- ...restProps
25
- } = props;
26
- const [expandedKeys, setExpandedKeys] = useState([]);
27
- const [searchValue, setSearchValue] = useState("");
28
- const [autoExpandParent, setAutoExpandParent] = useState(true);
29
- useEffect(() => {
30
- setExpandedKeys(externalExpandedKeys);
31
- }, [externalExpandedKeys]);
32
-
33
- // 展开所有包含匹配项的父节点
34
- const getAllExpandedKeys = (data, searchValue, keys = []) => {
35
- data.forEach(node => {
36
- if (node[childrenKey]) {
37
- if (node[nameKey].includes(searchValue) || node[childrenKey].some(child => child[nameKey].includes(searchValue))) {
38
- keys.push(node[idKey]);
39
- }
40
- getAllExpandedKeys(node[childrenKey], searchValue, keys);
41
- }
42
- });
43
- return keys;
44
- };
45
-
46
- // 过滤树数据,只保留匹配的节点
47
- const filterTreeData = (data, searchValue) => {
48
- if (!searchValue) {
49
- return data;
50
- }
51
- return data.reduce((acc, node) => {
52
- // 检查当前节点是否匹配
53
- const isMatch = node[nameKey].includes(searchValue);
54
-
55
- // 递归处理子节点
56
- const filteredChildren = node[childrenKey] ? filterTreeData(node[childrenKey], searchValue) : [];
57
-
58
- // 如果当前节点匹配或者有匹配的子节点,则保留该节点
59
- if (isMatch || filteredChildren.length > 0) {
60
- acc.push({
61
- ...node,
62
- [childrenKey]: filteredChildren.length > 0 ? filteredChildren : undefined
63
- });
64
- }
65
- return acc;
66
- }, []);
67
- };
68
- const handleExpand = newExpandedKeys => {
69
- setExpandedKeys(newExpandedKeys);
70
- setAutoExpandParent(false);
71
- };
72
- const handleSelect = (selectedKeys, event) => {
73
- if (selectedKeys.length > 0) {
74
- const selectedNodeId = selectedKeys[0];
75
- const parentNodes = getTreeNodePaths({
76
- data: treeData,
77
- targetId: selectedNodeId,
78
- idKey,
79
- childrenKey,
80
- isIncludeOneself: onGetNodePathsIsIncludeOneself
81
- });
82
- onGetNodePaths?.(parentNodes);
83
- }
84
- onSelect?.(selectedKeys, event);
85
- };
86
- const onFilterTreeData = value => {
87
- setSearchValue(value);
88
- setAutoExpandParent(true);
89
- if (!value) {
90
- setExpandedKeys([]);
91
- return;
92
- }
93
- const expandedKeys = getAllExpandedKeys(treeData, value);
94
- setExpandedKeys(expandedKeys);
95
- };
96
- const onSearch = async value => {
97
- if (value === searchValue) return;
98
- onFilterTreeData(value);
99
- };
100
-
101
- // 渲染带高亮的标题
102
- const renderTitle = name => {
103
- if (!searchValue) return name;
104
- const index = name.indexOf(searchValue);
105
- if (index === -1) return name;
106
- const beforeStr = name.substring(0, index);
107
- const afterStr = name.substring(index + searchValue.length);
108
- return /*#__PURE__*/jsxs("span", {
109
- children: [beforeStr, /*#__PURE__*/jsx("span", {
110
- style: {
111
- color: "#f50"
112
- },
113
- children: searchValue
114
- }), afterStr]
115
- });
116
- };
117
-
118
- // 递归处理树节点标题显示
119
- const processTreeData = data => {
120
- return data.map(node => ({
121
- ...node,
122
- [nameKey]: renderTitle(node[nameKey]),
123
- [childrenKey]: node[childrenKey] ? processTreeData(node[childrenKey]) : undefined
124
- }));
125
- };
126
-
127
- // 过滤并处理树数据
128
- const filteredTreeData = filterTreeData(treeData, searchValue);
129
- const processedTreeData = processTreeData(filteredTreeData);
130
- useEffect(() => {
131
- onGetData?.(treeData);
132
- }, [treeData]);
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
- });
157
- };
158
- BasicLeftTree.displayName = "BasicLeftTree";
159
-
160
- export { BasicLeftTree as default };
1
+ import{Input as e,Tree as t}from"antd";import{useState as n,useEffect as r}from"react";import{getTreeNodePaths as s}from"../../../utils/index.js";import{jsxs as d,jsx as i}from"react/jsx-runtime";const{Search:a}=e,o=e=>{const{onGetData:o,onSelect:c,onGetNodePaths:l,onGetNodePathsIsIncludeOneself:h=!0,expandedKeys:u,treeData:m=[],nameKey:f="name",idKey:p="id",childrenKey:y="children",...g}=e,[x,K]=n([]),[v,I]=n(""),[N,S]=n(!0);r(()=>{K(u)},[u]);const D=(e,t,n=[])=>(e.forEach(e=>{e[y]&&((e[f].includes(t)||e[y].some(e=>e[f].includes(t)))&&n.push(e[p]),D(e[y],t,n))}),n),E=(e,t)=>t?e.reduce((e,n)=>{const r=n[f].includes(t),s=n[y]?E(n[y],t):[];return(r||s.length>0)&&e.push({...n,[y]:s.length>0?s:void 0}),e},[]):e,G=e=>{if(!v)return e;const t=e.indexOf(v);if(-1===t)return e;const n=e.substring(0,t),r=e.substring(t+v.length);return d("span",{children:[n,i("span",{style:{color:"#f50"},children:v}),r]})},O=e=>e.map(e=>({...e,[f]:G(e[f]),[y]:e[y]?O(e[y]):void 0})),P=E(m,v),b=O(P);return r(()=>{o?.(m)},[m]),d("div",{style:{width:300},children:[i(a,{style:{marginBottom:8},placeholder:"输入关键字进行过滤",onSearch:async e=>{e!==v&&(e=>{if(I(e),S(!0),!e)return void K([]);const t=D(m,e);K(t)})(e)}}),i(t,{onExpand:e=>{K(e),S(!1)},onSelect:(e,t)=>{if(e.length>0){const t=e[0],n=s({data:m,targetId:t,idKey:p,childrenKey:y,isIncludeOneself:h});l?.(n)}c?.(e,t)},autoExpandParent:N,expandedKeys:x,treeData:b,fieldNames:{title:f,key:p,children:y},...g})]})};o.displayName="BasicLeftTree";export{o as default};
@@ -1,29 +1 @@
1
- import { request } from '@cqsjjb/jjb-common-lib/http';
2
- import { useState, useEffect } from 'react';
3
- import BasicLeftTree from '../../Basic/index.js';
4
- import { jsx } from 'react/jsx-runtime';
5
-
6
- function DepartmentLeftTree(props) {
7
- const {
8
- params = {},
9
- ...restProps
10
- } = props;
11
- const [treeData, setTreeData] = useState([]);
12
- const getData = async () => {
13
- const {
14
- data
15
- } = await request("/basicInfo/department/listTree", "post", params);
16
- setTreeData(data);
17
- };
18
- useEffect(() => {
19
- getData();
20
- }, []);
21
- return /*#__PURE__*/jsx(BasicLeftTree, {
22
- treeData: treeData,
23
- childrenKey: "childrenList",
24
- ...restProps
25
- });
26
- }
27
- DepartmentLeftTree.displayName = "DepartmentLeftTree";
28
-
29
- export { DepartmentLeftTree as default };
1
+ import{request as t}from"@cqsjjb/jjb-common-lib/http";import{useState as e,useEffect as r}from"react";import a from"../../Basic/index.js";import{jsx as i}from"react/jsx-runtime";function o(o){const{params:m={},...n}=o,[s,c]=e([]);return r(()=>{(async()=>{const{data:e}=await t("/basicInfo/department/listTree","post",m);c(e)})()},[]),i(a,{treeData:s,childrenKey:"childrenList",...n})}o.displayName="DepartmentLeftTree";export{o as default};
@@ -1,42 +1 @@
1
- import { request } from '@cqsjjb/jjb-common-lib/http';
2
- import { useState, useEffect } from 'react';
3
- import { DICTIONARY_APP_KEY_ENUM } from '../../../enum/dictionary/index.js';
4
- import BasicLeftTree from '../Basic/index.js';
5
- import { jsx } from 'react/jsx-runtime';
6
-
7
- function DictionaryLeftTree(props) {
8
- const {
9
- appKey = DICTIONARY_APP_KEY_ENUM.DEFAULT,
10
- dictValue = "",
11
- nameKey = "dictLabel",
12
- idKey = "dictValue",
13
- ...restProps
14
- } = props;
15
- const [treeData, setTreeData] = useState([]);
16
- const getData = async () => {
17
- if (!Object.values(DICTIONARY_APP_KEY_ENUM).includes(appKey)) {
18
- console.error("传入的 appKey 不在 DICTIONARY_APP_KEY_ENUM 中");
19
- return;
20
- }
21
- setTreeData([]);
22
- const {
23
- data
24
- } = await request("/config/dict-trees/list/by/dictValues", "get", {
25
- appKey,
26
- dictValue
27
- });
28
- setTreeData(data);
29
- };
30
- useEffect(() => {
31
- dictValue && getData();
32
- }, [dictValue]);
33
- return /*#__PURE__*/jsx(BasicLeftTree, {
34
- treeData: treeData,
35
- nameKey: nameKey,
36
- idKey: idKey,
37
- ...restProps
38
- });
39
- }
40
- DictionaryLeftTree.displayName = "DictionaryLeftTree";
41
-
42
- export { DictionaryLeftTree as default };
1
+ import{request as e}from"@cqsjjb/jjb-common-lib/http";import{useState as t,useEffect as i}from"react";import{DICTIONARY_APP_KEY_ENUM as a}from"../../../enum/dictionary/index.js";import r from"../Basic/index.js";import{jsx as o}from"react/jsx-runtime";function c(c){const{appKey:n=a.DEFAULT,dictValue:m="",nameKey:d="dictLabel",idKey:s="dictValue",...p}=c,[l,u]=t([]);return i(()=>{m&&(async()=>{if(!Object.values(a).includes(n))return void console.error("传入的 appKey 不在 DICTIONARY_APP_KEY_ENUM 中");u([]);const{data:t}=await e("/config/dict-trees/list/by/dictValues","get",{appKey:n,dictValue:m});u(t)})()},[m]),o(r,{treeData:l,nameKey:d,idKey:s,...p})}c.displayName="DictionaryLeftTree";export{c as default};