ls-pro-common 3.0.80 → 3.0.82

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 (39) hide show
  1. package/dist/common.css +21 -0
  2. package/dist/common.js +1 -1
  3. package/dist/common.min.css +21 -0
  4. package/dist/common.min.js +1 -1
  5. package/es/components/common.less +23 -0
  6. package/es/hooks/useBaseDict.d.ts +35 -0
  7. package/es/hooks/useBaseDict.js +104 -0
  8. package/es/hooks/useDtl/index.js +7 -5
  9. package/es/hooks/useFilterBack.d.ts +9 -10
  10. package/es/hooks/useFilterBack.js +6 -6
  11. package/es/hooks/useSelectOptions.d.ts +81 -0
  12. package/es/hooks/useSelectOptions.js +210 -0
  13. package/es/hooks/useShowConfirm.d.ts +9 -0
  14. package/es/hooks/useShowConfirm.js +23 -0
  15. package/es/hooks/useSingle/index.js +5 -3
  16. package/es/index.d.ts +6 -2
  17. package/es/index.js +6 -2
  18. package/es/utils/exportProcess.d.ts +8 -0
  19. package/es/utils/exportProcess.js +153 -0
  20. package/es/utils/index.d.ts +2 -0
  21. package/es/utils/index.js +18 -0
  22. package/lib/components/common.less +23 -0
  23. package/lib/hooks/useBaseDict.d.ts +35 -0
  24. package/lib/hooks/useBaseDict.js +104 -0
  25. package/lib/hooks/useDtl/index.js +7 -5
  26. package/lib/hooks/useFilterBack.d.ts +9 -10
  27. package/lib/hooks/useFilterBack.js +6 -6
  28. package/lib/hooks/useSelectOptions.d.ts +81 -0
  29. package/lib/hooks/useSelectOptions.js +210 -0
  30. package/lib/hooks/useShowConfirm.d.ts +9 -0
  31. package/lib/hooks/useShowConfirm.js +23 -0
  32. package/lib/hooks/useSingle/index.js +5 -3
  33. package/lib/index.d.ts +6 -2
  34. package/lib/index.js +6 -2
  35. package/lib/utils/exportProcess.d.ts +8 -0
  36. package/lib/utils/exportProcess.js +153 -0
  37. package/lib/utils/index.d.ts +2 -0
  38. package/lib/utils/index.js +18 -0
  39. package/package.json +1 -1
package/es/index.js CHANGED
@@ -20,11 +20,15 @@ import ViewOffice from './components/ViewOffice';
20
20
  import BaseService from './service/BaseService';
21
21
  import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
22
22
  import * as utils from './utils';
23
+ import exportProcess from './utils/exportProcess';
23
24
  /** Hooks */
24
25
  import useSingle from './hooks/useSingle';
25
26
  import useDtl from './hooks/useDtl';
26
27
  import usePermission from './hooks/usePermission';
27
28
  import useGetState from './hooks/useGetState';
28
- import { useFilterLocal } from './hooks/useFilterBack';
29
+ import useFilterLocal from './hooks/useFilterBack';
30
+ import useBaseDict from './hooks/useBaseDict';
31
+ import useSelectOptions from './hooks/useSelectOptions';
32
+ import showConfirmFun from './hooks/useShowConfirm';
29
33
  import useQueue from './hooks/useQueue';
30
- export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, GroupTip, ViewOffice, IconBack, IconText, IconBell, IconQuestion, IconSearch, TagCheck, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission, useGetState, useFilterLocal, useQueue };
34
+ export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, GroupTip, ViewOffice, IconBack, IconText, IconBell, IconQuestion, IconSearch, TagCheck, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission, useGetState, useFilterLocal, useQueue, useBaseDict, useSelectOptions, showConfirmFun, exportProcess };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 导出进度查看
3
+ *
4
+ * @param apiResult 导出接口返回数据,
5
+ * @returns
6
+ */
7
+ declare const exportProcess: (apiResult: any) => void;
8
+ export default exportProcess;
@@ -0,0 +1,153 @@
1
+ import "antd/es/progress/style";
2
+ import _Progress from "antd/es/progress";
3
+ import "antd/es/notification/style";
4
+ import _notification from "antd/es/notification";
5
+ import React from "react";
6
+ import { showSuccess, showError, sleep, downloadFile } from '.';
7
+ import { httpGet } from '../http';
8
+ /**
9
+ * 导出进度查看
10
+ *
11
+ * @param apiResult 导出接口返回数据,
12
+ * @returns
13
+ */
14
+ var exportProcess = function exportProcess(apiResult) {
15
+ var taskId = apiResult.taskId,
16
+ flag = apiResult.flag;
17
+ if (!taskId) {
18
+ showSuccess((flag === null || flag === void 0 ? void 0 : flag.retMsg) || '导出成功');
19
+ return;
20
+ }
21
+ var time = 0;
22
+ var exit = false;
23
+ var win = top || window;
24
+ var errorTryCount = 3;
25
+ var key = 'task' + taskId;
26
+ var dom = null;
27
+ var moveState = {
28
+ isMove: false,
29
+ startLeft: 0,
30
+ startTop: 0,
31
+ startX: 0,
32
+ startY: 0,
33
+ h: 88,
34
+ w: 250 //组件宽度
35
+ };
36
+
37
+ var onMove = function onMove(e) {
38
+ requestAnimationFrame(function () {
39
+ var startLeft = moveState.startLeft,
40
+ startTop = moveState.startTop,
41
+ startX = moveState.startX,
42
+ startY = moveState.startY,
43
+ isMove = moveState.isMove,
44
+ h = moveState.h,
45
+ w = moveState.w;
46
+ if (!isMove || !dom) return;
47
+ // 通过计算鼠标的移动距离,计算出组件新的坐标。
48
+ var deltaX = document.body.clientWidth - (e.clientX - startX + startLeft) - w;
49
+ var deltaY = e.clientY - startY + startTop;
50
+ var top = Math.max(0, Math.min(document.body.clientHeight - h, deltaY));
51
+ var right = Math.max(0, Math.min(document.body.clientWidth - w - 30, deltaX));
52
+ dom.style.top = top + 'px';
53
+ dom.style.right = right + 'px';
54
+ });
55
+ };
56
+ var onUp = function onUp() {
57
+ moveState.isMove = false;
58
+ document.body.classList.remove('move-unselect');
59
+ document.removeEventListener('mouseup', onUp);
60
+ document.removeEventListener('mousemove', onMove);
61
+ };
62
+ var loading = function loading(percent) {
63
+ _notification.open({
64
+ className: 'export-process-notification',
65
+ placement: 'topRight',
66
+ key: key,
67
+ duration: 0,
68
+ message: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
69
+ className: "export-process-handle",
70
+ onMouseDown: function onMouseDown(e) {
71
+ dom = e.target.closest('.ant-notification-topRight');
72
+ if (!dom) return;
73
+ var rect = dom.getBoundingClientRect();
74
+ moveState.isMove = true;
75
+ moveState.startX = e.clientX;
76
+ moveState.startY = e.clientY;
77
+ moveState.startLeft = rect.left;
78
+ moveState.startTop = rect.top;
79
+ document.body.classList.add('move-unselect');
80
+ document.addEventListener('mouseup', onUp);
81
+ document.addEventListener('mousemove', onMove);
82
+ }
83
+ }, "\u6B63\u5728\u5BFC\u51FA..."), /*#__PURE__*/React.createElement(_Progress, {
84
+ percent: percent
85
+ })),
86
+ onClose: function onClose() {
87
+ exit = true;
88
+ document.removeEventListener('mouseup', onUp);
89
+ document.removeEventListener('mousemove', onMove);
90
+ }
91
+ });
92
+ };
93
+ loading(0);
94
+ var getResult = function getResult() {
95
+ if (exit) return;
96
+ httpGet('/petrel-poi-center-api/sysPoiExportManage/page', {
97
+ 'page.pn': 1,
98
+ 'page.size': 1,
99
+ 'search.id': apiResult.taskId
100
+ }).then(function (result) {
101
+ var _result$rows = result.rows,
102
+ rows = _result$rows === void 0 ? [] : _result$rows;
103
+ var row = rows === null || rows === void 0 ? void 0 : rows[0];
104
+ if (!row) {
105
+ if (time < errorTryCount) {
106
+ time++;
107
+ sleep(5).then(function () {
108
+ return getResult();
109
+ });
110
+ } else {
111
+ showError('获取导出进度失败,请在消息中心查看导出结果');
112
+ win.postMessage({
113
+ type: 'exportError'
114
+ });
115
+ _notification.close(key);
116
+ }
117
+ } else {
118
+ var status = row.status,
119
+ downloadUrl = row.downloadUrl,
120
+ progress = row.progress;
121
+ //导出中
122
+ if (status < 30) {
123
+ loading(progress);
124
+ sleep(5).then(function () {
125
+ return getResult();
126
+ });
127
+ } else {
128
+ //导出成功
129
+ if (status === 30 && downloadUrl) {
130
+ downloadFile(downloadUrl);
131
+ } else {
132
+ //导出失败
133
+ showError('导出异常,请在消息中心查看失败原因');
134
+ win.postMessage({
135
+ type: 'exportError'
136
+ });
137
+ }
138
+ _notification.close(key);
139
+ }
140
+ }
141
+ }).catch(function () {
142
+ showError('获取导出进度失败,请在消息中心查看导出结果');
143
+ _notification.close(key);
144
+ win.postMessage({
145
+ type: 'exportError'
146
+ });
147
+ });
148
+ };
149
+ sleep(1).then(function () {
150
+ return getResult();
151
+ });
152
+ };
153
+ export default exportProcess;
@@ -314,3 +314,5 @@ export declare const openPageInMain: (option: {
314
314
  export declare const showLoading: (text?: string) => void;
315
315
  export declare const exitLoading: () => void;
316
316
  export declare const handleTheme: () => void;
317
+ export declare const sleep: (secord: number) => Promise<unknown>;
318
+ export declare const downloadFile: (url: string, fileName?: string | undefined) => void;
package/es/utils/index.js CHANGED
@@ -889,4 +889,22 @@ export var handleTheme = function handleTheme() {
889
889
  if (theme) {
890
890
  document.body.classList.add('theme-' + theme);
891
891
  }
892
+ };
893
+ export var sleep = function sleep(secord) {
894
+ return new Promise(function (resolve) {
895
+ setTimeout(function () {
896
+ resolve(true);
897
+ }, secord * 1000);
898
+ });
899
+ };
900
+ export var downloadFile = function downloadFile(url, fileName) {
901
+ var a = document.createElement('a');
902
+ a.href = url;
903
+ // a.target = '_blank'; // 新开屏有闪烁
904
+ if (fileName) {
905
+ a.setAttribute('download', fileName);
906
+ }
907
+ document.body.appendChild(a);
908
+ a.click();
909
+ document.body.removeChild(a);
892
910
  };
@@ -524,3 +524,26 @@ a:hover {
524
524
  @import url('./antd-custom.less');
525
525
 
526
526
  //-------------------省市区组件样式-----------
527
+
528
+ .ant-notification-notice.export-process-notification {
529
+ width: 250px;
530
+ padding: 12px;
531
+ .ant-notification-notice-message {
532
+ margin-bottom: 0;
533
+ padding-right: 12px;
534
+ font-size: 14px;
535
+ }
536
+ .ant-notification-notice-close {
537
+ top: 12px;
538
+ right: 12px;
539
+ }
540
+ .export-process-handle {
541
+ display: inline-block;
542
+ width: 100%;
543
+ cursor: move;
544
+ }
545
+ }
546
+
547
+ .move-unselect {
548
+ user-select: none;
549
+ }
@@ -0,0 +1,35 @@
1
+ /** @name 请求字典 */
2
+ interface useSelectOptionsType {
3
+ /** @name 字典item的value */
4
+ dictValue?: string;
5
+ /** @name 字典item的label */
6
+ dictLabel?: string;
7
+ /**
8
+ * @default GET
9
+ * @name 请求方式
10
+ */
11
+ method?: 'GET' | 'POST';
12
+ /** @name 请求的url */
13
+ url?: string;
14
+ /**
15
+ * @default true
16
+ * @name 是否需要网关
17
+ */
18
+ needGateWay?: boolean;
19
+ /**
20
+ * @default true
21
+ * @name 是否是JSON post中会使用
22
+ */
23
+ isJson?: boolean;
24
+ /** @name 请求参数 */
25
+ params?: any;
26
+ /** @name 1label返回中文带箭头 2label返回中文不带箭头 */
27
+ type?: '1' | '2';
28
+ }
29
+ /**
30
+ * @param props
31
+ * @name 动态请求select的options
32
+ * @returns
33
+ */
34
+ export declare const useBaseDict: (props: useSelectOptionsType) => [any[], (options: any[]) => void];
35
+ export default useBaseDict;
@@ -0,0 +1,104 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
+ /** @name 请求字典 */
6
+ import { useEffect, useState } from 'react';
7
+ import { httpGet, httpPost } from '../http';
8
+ import { showWarn } from '../utils';
9
+ /**
10
+ * @param props
11
+ * @name 动态请求select的options
12
+ * @returns
13
+ */
14
+ export var useBaseDict = function useBaseDict(props) {
15
+ var _props$url = props.url,
16
+ url = _props$url === void 0 ? '/lesoon-integration/sysDictDtl?lesoon-tenant=1' : _props$url,
17
+ _props$method = props.method,
18
+ method = _props$method === void 0 ? 'GET' : _props$method,
19
+ _props$dictValue = props.dictValue,
20
+ dictValue = _props$dictValue === void 0 ? 'dictValue' : _props$dictValue,
21
+ _props$dictLabel = props.dictLabel,
22
+ dictLabel = _props$dictLabel === void 0 ? 'displayName' : _props$dictLabel,
23
+ _props$needGateWay = props.needGateWay,
24
+ needGateWay = _props$needGateWay === void 0 ? true : _props$needGateWay,
25
+ _props$isJson = props.isJson,
26
+ isJson = _props$isJson === void 0 ? true : _props$isJson,
27
+ _props$params = props.params,
28
+ params = _props$params === void 0 ? {} : _props$params,
29
+ _props$type = props.type,
30
+ type = _props$type === void 0 ? '1' : _props$type;
31
+ var _useState = useState([]),
32
+ _useState2 = _slicedToArray(_useState, 2),
33
+ options = _useState2[0],
34
+ setOptions = _useState2[1];
35
+ /** @name 下拉框请求数据 */
36
+ var requestOptions = /*#__PURE__*/function () {
37
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
38
+ var _res;
39
+ var val,
40
+ res,
41
+ baseParams,
42
+ data,
43
+ _args = arguments;
44
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
45
+ while (1) switch (_context.prev = _context.next) {
46
+ case 0:
47
+ val = _args.length > 0 && _args[0] !== undefined ? _args[0] : '';
48
+ if (url) {
49
+ _context.next = 4;
50
+ break;
51
+ }
52
+ showWarn('请配置url');
53
+ return _context.abrupt("return");
54
+ case 4:
55
+ baseParams = _objectSpread({
56
+ page: 1,
57
+ pageSize: 999
58
+ }, params);
59
+ if (!(method === 'GET')) {
60
+ _context.next = 11;
61
+ break;
62
+ }
63
+ _context.next = 8;
64
+ return httpGet(url, baseParams, needGateWay);
65
+ case 8:
66
+ res = _context.sent;
67
+ _context.next = 15;
68
+ break;
69
+ case 11:
70
+ if (!(method === 'POST')) {
71
+ _context.next = 15;
72
+ break;
73
+ }
74
+ _context.next = 14;
75
+ return httpPost(url, baseParams, isJson, needGateWay);
76
+ case 14:
77
+ res = _context.sent;
78
+ case 15:
79
+ data = (((_res = res) === null || _res === void 0 ? void 0 : _res.rows) || []).map(function (item) {
80
+ return {
81
+ value: item === null || item === void 0 ? void 0 : item[dictValue],
82
+ text: item === null || item === void 0 ? void 0 : item[dictLabel],
83
+ label: type === '1' ? (item === null || item === void 0 ? void 0 : item[dictValue]) + '→' + (item === null || item === void 0 ? void 0 : item[dictLabel]) : item === null || item === void 0 ? void 0 : item[dictLabel],
84
+ children: item === null || item === void 0 ? void 0 : item.children,
85
+ items: item
86
+ };
87
+ });
88
+ setOptions(data);
89
+ case 17:
90
+ case "end":
91
+ return _context.stop();
92
+ }
93
+ }, _callee);
94
+ }));
95
+ return function requestOptions() {
96
+ return _ref.apply(this, arguments);
97
+ };
98
+ }();
99
+ useEffect(function () {
100
+ requestOptions();
101
+ }, []);
102
+ return [options, setOptions];
103
+ };
104
+ export default useBaseDict;
@@ -12,6 +12,7 @@ import { PlusCircleOutlined, EditOutlined, DeleteOutlined, ImportOutlined, Expor
12
12
  import { showConfirm, showWarn, showError, showSuccess } from '../../utils';
13
13
  import { httpPost } from '../../http';
14
14
  import usePermission from '../usePermission';
15
+ import exportProcess from '../../utils/exportProcess';
15
16
  function useDtl(dtlParam) {
16
17
  var mstService = dtlParam.service,
17
18
  masterObject = dtlParam.initItem,
@@ -729,7 +730,7 @@ function useDtl(dtlParam) {
729
730
  var onExportDtl = /*#__PURE__*/function () {
730
731
  var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(url, param) {
731
732
  var _param$exportColumns;
732
- var searchArr, arr, otherArr, whereArr, where, _result$flag6, result, _result$flag7, _result$flag8;
733
+ var searchArr, arr, otherArr, whereArr, where, _result$flag6, result, _result$flag7;
733
734
  return _regeneratorRuntime.wrap(function _callee9$(_context9) {
734
735
  while (1) switch (_context9.prev = _context9.next) {
735
736
  case 0:
@@ -802,10 +803,11 @@ function useDtl(dtlParam) {
802
803
  _context9.next = 19;
803
804
  break;
804
805
  }
805
- showSuccess(((_result$flag7 = result.flag) === null || _result$flag7 === void 0 ? void 0 : _result$flag7.retMsg) || '导出成功');
806
+ exportProcess(result);
807
+ // showSuccess(result.flag?.retMsg || '导出成功');
806
808
  return _context9.abrupt("return", true);
807
809
  case 19:
808
- showError(((_result$flag8 = result.flag) === null || _result$flag8 === void 0 ? void 0 : _result$flag8.retMsg) || '导出失败,请联系系统管理员');
810
+ showError(((_result$flag7 = result.flag) === null || _result$flag7 === void 0 ? void 0 : _result$flag7.retMsg) || '导出失败,请联系系统管理员');
809
811
  return _context9.abrupt("return", false);
810
812
  case 21:
811
813
  _context9.next = 27;
@@ -828,7 +830,7 @@ function useDtl(dtlParam) {
828
830
  /** 审核按钮事件 */
829
831
  var onAudit = /*#__PURE__*/function () {
830
832
  var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
831
- var obj, _result$flag9, result;
833
+ var obj, _result$flag8, result;
832
834
  return _regeneratorRuntime.wrap(function _callee10$(_context10) {
833
835
  while (1) switch (_context10.prev = _context10.next) {
834
836
  case 0:
@@ -898,7 +900,7 @@ function useDtl(dtlParam) {
898
900
  }
899
901
  return _context10.abrupt("return");
900
902
  case 36:
901
- if ((result === null || result === void 0 ? void 0 : (_result$flag9 = result.flag) === null || _result$flag9 === void 0 ? void 0 : _result$flag9.retCode) === '0') {
903
+ if ((result === null || result === void 0 ? void 0 : (_result$flag8 = result.flag) === null || _result$flag8 === void 0 ? void 0 : _result$flag8.retCode) === '0') {
902
904
  showSuccess(result.flag.retMsg || '审核成功');
903
905
  Object.assign(masterObject, result.data);
904
906
  }
@@ -1,23 +1,22 @@
1
- /**
2
- * @name 本地查询字段清空
3
- */
1
+ /** @name 本地查询字段清空 */
4
2
  interface useFilterLocalType {
5
- /**@name 表格的actionRef */
3
+ /** @name 表格的actionRef */
6
4
  tableRef: any;
7
5
  }
8
6
  interface useFilterBack {
9
- /**@name 已存在过滤字段数量 */
7
+ /** @name 已存在过滤字段数量 */
10
8
  filterLocal: number;
11
- /**@name 设置已存在过滤数量 */
9
+ /** @name 设置已存在过滤数量 */
12
10
  setFilterLocal: any;
13
- /**@name 根据filter中的值设置filterLocal */
11
+ /** @name 根据filter中的值设置filterLocal */
14
12
  changeFilterFun: (val: any) => void;
15
13
  }
16
14
  /**
17
- * @name 本地过滤条件清空图标
18
- * @description 结合table中的onChange第二个参数filter使用, 可直接使用changeFilterFun(filter)
15
+ * 结合table中的onChange第二个参数filter使用, 可直接使用changeFilterFun(filter)
16
+ *
19
17
  * @param props
18
+ * @name 本地过滤条件清空图标
20
19
  * @returns
21
20
  */
22
21
  export declare const useFilterLocal: (props: useFilterLocalType) => useFilterBack;
23
- export {};
22
+ export default useFilterLocal;
@@ -3,17 +3,16 @@ import _Tooltip from "antd/es/tooltip";
3
3
  import "antd/es/badge/style";
4
4
  import _Badge from "antd/es/badge";
5
5
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
- /**
7
- * @name 本地查询字段清空
8
- */
6
+ /** @name 本地查询字段清空 */
9
7
  import { useEffect, useState } from 'react';
10
8
  import { ClearOutlined } from '@ant-design/icons';
11
9
  import React from 'react';
12
10
  import ReactDOM from 'react-dom';
13
11
  /**
14
- * @name 本地过滤条件清空图标
15
- * @description 结合table中的onChange第二个参数filter使用, 可直接使用changeFilterFun(filter)
12
+ * 结合table中的onChange第二个参数filter使用, 可直接使用changeFilterFun(filter)
13
+ *
16
14
  * @param props
15
+ * @name 本地过滤条件清空图标
17
16
  * @returns
18
17
  */
19
18
  export var useFilterLocal = function useFilterLocal(props) {
@@ -75,4 +74,5 @@ export var useFilterLocal = function useFilterLocal(props) {
75
74
  filterLocal: filterLocal,
76
75
  changeFilterFun: changeFilterFun
77
76
  };
78
- };
77
+ };
78
+ export default useFilterLocal;
@@ -0,0 +1,81 @@
1
+ /** @name 请求select的options */
2
+ interface useSelectOptionsType {
3
+ /** @name 请求前操作,可直接返回false */
4
+ beforeLoad?: (val: Record<string, any>, setOptions: (options: any[]) => any) => Promise<boolean>;
5
+ /** @name 请求后操作,针对返回的res操作 */
6
+ afterLoad?: (val?: any) => Promise<any[]>;
7
+ /** @name 字段名 */
8
+ name?: any;
9
+ /** @name 请求配置 */
10
+ requestProps?: {
11
+ /** @name 字典item的value */
12
+ dictValue?: string;
13
+ /** @name 字典item的label */
14
+ dictLabel?: string;
15
+ /**
16
+ * @default GET
17
+ * @name 请求方式
18
+ */
19
+ method?: 'GET' | 'POST';
20
+ /**
21
+ * @param val 搜索的值
22
+ * @name 更改params
23
+ * @returns
24
+ */
25
+ changeParams?: (val?: string) => any;
26
+ /** @name 请求的url */
27
+ url?: string;
28
+ /**
29
+ * @default true
30
+ * @name 是否需要网关
31
+ */
32
+ needGateWay?: boolean;
33
+ /**
34
+ * @default true
35
+ * @name 是否是JSON post中会使用
36
+ */
37
+ isJson?: boolean;
38
+ };
39
+ /**
40
+ * @default 500
41
+ * @name 防抖时间
42
+ */
43
+ debounceTime?: number;
44
+ /**
45
+ * @default true
46
+ * @name 自动第一次请求
47
+ */
48
+ autoLoad?: boolean;
49
+ /** @name 1label返回中文带箭头 2label返回中文不带箭头 */
50
+ type?: '1' | '2';
51
+ }
52
+ interface useSelectOptionsBack {
53
+ /** @name 请求到的枚举字典 */
54
+ options: any[];
55
+ /** @name 设置请求到的枚举字典 */
56
+ setOptions: (options: any[]) => any;
57
+ /** @name 防抖请求 */
58
+ nameSearchFun: (val?: string) => void;
59
+ /** @name 直接请求 */
60
+ requestOptions: (val?: string) => void;
61
+ /** @name 设置本地搜索的枚举字典 */
62
+ setLocalSearch: (options: any[]) => any;
63
+ /** @name 本地搜索的枚举字典 */
64
+ localSearch: any[];
65
+ /** @name 请求到的枚举字典+本地搜索的枚举字典组合后的值 */
66
+ totalDataAll: any[];
67
+ }
68
+ /**
69
+ * @param fn
70
+ * @param delay
71
+ * @name 防抖
72
+ * @returns
73
+ */
74
+ export declare const debounce: (fn: any, delay?: number) => (...rest: any) => void;
75
+ /**
76
+ * @param props
77
+ * @name 动态请求select的options
78
+ * @returns
79
+ */
80
+ export declare const useSelectOptions: (props: useSelectOptionsType) => useSelectOptionsBack;
81
+ export default useSelectOptions;