ls-pro-common 3.0.97 → 3.0.98

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 (54) hide show
  1. package/dist/common.css +63 -0
  2. package/dist/common.js +1 -1
  3. package/dist/common.less +2 -1
  4. package/dist/common.min.css +63 -0
  5. package/dist/common.min.js +1 -1
  6. package/es/components/InputTable.js +47 -21
  7. package/es/components/ProButton/index.d.ts +10 -0
  8. package/es/components/ProButton/index.js +40 -0
  9. package/es/components/RecordLog/index.d.ts +16 -0
  10. package/es/components/RecordLog/index.js +114 -0
  11. package/es/components/RecordLog/index.less +71 -0
  12. package/es/hooks/useMdm.d.ts +7 -0
  13. package/es/hooks/useMdm.js +47 -0
  14. package/es/http/index.d.ts +2 -1
  15. package/es/http/index.js +2 -7
  16. package/es/http/mdmRequest.d.ts +184 -0
  17. package/es/http/mdmRequest.js +351 -0
  18. package/es/index.d.ts +6 -2
  19. package/es/index.js +6 -2
  20. package/es/utils/array.d.ts +26 -0
  21. package/es/utils/array.js +74 -0
  22. package/es/utils/format.d.ts +82 -0
  23. package/es/utils/format.js +148 -0
  24. package/es/utils/index.d.ts +6 -132
  25. package/es/utils/index.js +9 -511
  26. package/es/utils/modal.d.ts +43 -0
  27. package/es/utils/modal.js +225 -0
  28. package/es/utils/size.d.ts +9 -0
  29. package/es/utils/size.js +81 -0
  30. package/lib/components/InputTable.js +47 -21
  31. package/lib/components/ProButton/index.d.ts +10 -0
  32. package/lib/components/ProButton/index.js +40 -0
  33. package/lib/components/RecordLog/index.d.ts +16 -0
  34. package/lib/components/RecordLog/index.js +114 -0
  35. package/lib/components/RecordLog/index.less +71 -0
  36. package/lib/hooks/useMdm.d.ts +7 -0
  37. package/lib/hooks/useMdm.js +47 -0
  38. package/lib/http/index.d.ts +2 -1
  39. package/lib/http/index.js +2 -7
  40. package/lib/http/mdmRequest.d.ts +184 -0
  41. package/lib/http/mdmRequest.js +351 -0
  42. package/lib/index.d.ts +6 -2
  43. package/lib/index.js +6 -2
  44. package/lib/utils/array.d.ts +26 -0
  45. package/lib/utils/array.js +74 -0
  46. package/lib/utils/format.d.ts +82 -0
  47. package/lib/utils/format.js +148 -0
  48. package/lib/utils/index.d.ts +6 -132
  49. package/lib/utils/index.js +9 -511
  50. package/lib/utils/modal.d.ts +43 -0
  51. package/lib/utils/modal.js +225 -0
  52. package/lib/utils/size.d.ts +9 -0
  53. package/lib/utils/size.js +81 -0
  54. package/package.json +2 -1
@@ -0,0 +1,351 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ import { httpGet } from '.';
4
+ import { getCache, setCache } from '../utils';
5
+ function setPageSize() {
6
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7
+ if (params && params.pageSize === undefined) {
8
+ params.pageSize = 50000;
9
+ }
10
+ }
11
+ function httpGetWithCache(_x, _x2) {
12
+ return _httpGetWithCache.apply(this, arguments);
13
+ }
14
+ /**
15
+ * @param params 请求参数
16
+ * @name 获取主数据货主数据,调用接口/lesoon-mdm-center-api/bmOwner/findAll
17
+ * @returns
18
+ */
19
+ function _httpGetWithCache() {
20
+ _httpGetWithCache = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(type, url) {
21
+ var _result$flag;
22
+ var params,
23
+ cacheKey,
24
+ cacheData,
25
+ result,
26
+ _args2 = arguments;
27
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
28
+ while (1) switch (_context2.prev = _context2.next) {
29
+ case 0:
30
+ params = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
31
+ cacheKey = "mdm-".concat(type, "-").concat(JSON.stringify(params));
32
+ cacheData = getCache(cacheKey, true);
33
+ if (!cacheData) {
34
+ _context2.next = 5;
35
+ break;
36
+ }
37
+ return _context2.abrupt("return", cacheData);
38
+ case 5:
39
+ _context2.next = 7;
40
+ return httpGet(url, params);
41
+ case 7:
42
+ result = _context2.sent;
43
+ if ((result === null || result === void 0 ? void 0 : (_result$flag = result.flag) === null || _result$flag === void 0 ? void 0 : _result$flag.retCode) === '0') {
44
+ setCache(cacheKey, result, true);
45
+ }
46
+ return _context2.abrupt("return", result);
47
+ case 10:
48
+ case "end":
49
+ return _context2.stop();
50
+ }
51
+ }, _callee2);
52
+ }));
53
+ return _httpGetWithCache.apply(this, arguments);
54
+ }
55
+ export var getOwner = /*#__PURE__*/function () {
56
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
57
+ var params,
58
+ url,
59
+ _args = arguments;
60
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
61
+ while (1) switch (_context.prev = _context.next) {
62
+ case 0:
63
+ params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
64
+ url = '/lesoon-mdm-center-api/bmOwner/findAll';
65
+ return _context.abrupt("return", httpGetWithCache('owner', url, params));
66
+ case 3:
67
+ case "end":
68
+ return _context.stop();
69
+ }
70
+ }, _callee);
71
+ }));
72
+ return function getOwner() {
73
+ return _ref.apply(this, arguments);
74
+ };
75
+ }();
76
+ /**
77
+ * @param params 请求参数
78
+ * @name 获取主数据仓库数据,调用接口/lesoon-mdm-center-api/bmStore/findAll
79
+ * @returns
80
+ */
81
+ export var getStore = function getStore() {
82
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
83
+ var url = '/lesoon-mdm-center-api/bmStore/findAll';
84
+ return httpGetWithCache('store', url, params);
85
+ };
86
+ /**
87
+ * @param params 请求参数
88
+ * @name 获取主数据品牌部数据,调用接口/lesoon-mdm-center-api/bmBrandDept/findAll
89
+ * @returns
90
+ */
91
+ export var getBrandDept = function getBrandDept() {
92
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
93
+ var url = '/lesoon-mdm-center-api/bmBrandDept/findAll';
94
+ return httpGetWithCache('brandDept', url, params);
95
+ };
96
+ /**
97
+ * @param params 请求参数
98
+ * @name 获取主数据物流大区数据,调用接口/lesoon-mdm-center-api/bmLogisticRegion/findAll
99
+ * @returns
100
+ */
101
+ export var getLogisticRegion = function getLogisticRegion() {
102
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
103
+ var url = '/lesoon-mdm-center-api/bmLogisticRegion/findAll';
104
+ return httpGetWithCache('region', url, params);
105
+ };
106
+ /**
107
+ * @param where: {forwarderLevel: 1 // 承运商级别 1:一级 2:二级 , forwarderType: 1 // 承运商类型 0:货运公司 1:快递公司 }
108
+ * @name 获取快递/快运承运商,调用接口/lesoon-mdm-center-api/bmForwarder/findAll
109
+ * @returns
110
+ */
111
+ export var getExpressCompany = function getExpressCompany() {
112
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
113
+ var url = '/lesoon-mdm-center-api/bmForwarder/findAll';
114
+ return httpGetWithCache('forwarder', url, params);
115
+ };
116
+ /**
117
+ * @name 分页获取快递公司/承运商,调用接口/lesoon-mdm-center-api/bmForwarder/pageVo
118
+ * @returns
119
+ */
120
+ export var getExpressCompanyPage = function getExpressCompanyPage() {
121
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
122
+ setPageSize(params);
123
+ var url = '/lesoon-mdm-center-api/bmForwarder/pageVo';
124
+ return httpGetWithCache('forwarder', url, params);
125
+ };
126
+ /**
127
+ * @name 实体仓,调用接口/lesoon-mdm-center-api/bmPhysicalStore/findAll
128
+ * @returns
129
+ */
130
+ export var getPhysicalStore = function getPhysicalStore() {
131
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
132
+ var url = '/lesoon-mdm-center-api/bmPhysicalStore/findAll';
133
+ return httpGetWithCache('physicalStore', url, params);
134
+ };
135
+ /**
136
+ * @param params
137
+ * @name 结算大类,调用接口/lesoon-mdm-center-api/bmSettlementCate/findAll
138
+ * @returns
139
+ */
140
+ export var getSettleCategory = function getSettleCategory() {
141
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
142
+ var url = '/lesoon-mdm-center-api/bmSettlementCate/findAll';
143
+ return httpGetWithCache('settlementCate', url, params);
144
+ };
145
+ /**
146
+ * @param param
147
+ * @name 获取损益主体,调用接口/lesoon-mdm-center-api/bmProfitLossMain/findAll
148
+ * @returns
149
+ */
150
+ export var getProfitLossMain = function getProfitLossMain() {
151
+ var param = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
152
+ var url = '/lesoon-mdm-center-api/bmProfitLossMain/findAll';
153
+ return httpGetWithCache('profitLossMain', url, param);
154
+ };
155
+ /**
156
+ * @param params
157
+ * @name 结算公司,调用接口/lesoon-mdm-center-api/bmSettleCompany/findAll
158
+ * @returns
159
+ */
160
+ export var getSettleCompany = function getSettleCompany() {
161
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
162
+ var url = '/lesoon-mdm-center-api/bmSettleCompany/findAll';
163
+ return httpGetWithCache('settleCompany', url, params);
164
+ };
165
+ /**
166
+ * @param params
167
+ * @name 货权,调用接口/lesoon-mdm-center-api/bmPowerUnit/findAll
168
+ * @returns
169
+ */
170
+ export var getPowerUnit = function getPowerUnit() {
171
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
172
+ var url = '/lesoon-mdm-center-api/bmPowerUnit/findAll';
173
+ return httpGetWithCache('powerUnit', url, params);
174
+ };
175
+ /**
176
+ * @param params
177
+ * @name 结算账号,调用接口/lesoon-mdm-center-api/bmSettleAccount/findAll
178
+ * @returns
179
+ */
180
+ export var getSettleAccount = function getSettleAccount() {
181
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
182
+ var url = '/lesoon-mdm-center-api/bmSettleAccount/findAll';
183
+ return httpGetWithCache('settleAccount', url, params);
184
+ };
185
+ /**
186
+ * @name 获取物流大类,调用接口/lesoon-mdm-center-api/bmLogisticCategory/findAll
187
+ * @returns
188
+ */
189
+ export var getLogisticCategory = function getLogisticCategory() {
190
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
191
+ var url = '/lesoon-mdm-center-api/bmLogisticCategory/findAll';
192
+ return httpGetWithCache('logisticCategory', url, params);
193
+ };
194
+ /**
195
+ * @param param
196
+ * @name 管理城市,调用接口/lesoon-mdm-center-api/bmManagingCity/findAll
197
+ * @returns
198
+ */
199
+ export var getManagingCity = function getManagingCity() {
200
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
201
+ var url = '/lesoon-mdm-center-api/bmManagingCity/findAll';
202
+ return httpGetWithCache('managingCity', url, params);
203
+ };
204
+ /**
205
+ * @param {where: {level:'province'}} level Province=省,city=市,district=区
206
+ * @name 获取省市区,调用接口/lesoon-mdm-center-api/sysAdministrativeDivision/findAll
207
+ * @returns
208
+ */
209
+ export var getArea = function getArea() {
210
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
211
+ var url = '/lesoon-mdm-center-api/sysAdministrativeDivision/findAll';
212
+ return httpGetWithCache('area', url, params);
213
+ };
214
+ /**
215
+ * @param param
216
+ * @name 获取集散中心,调用接口/lesoon-mdm-center-api/tmsTransportLocno/findAll
217
+ * @returns
218
+ */
219
+ export var getTransportLocno = function getTransportLocno() {
220
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
221
+ var url = '/lesoon-mdm-center-api/tmsTransportLocno/findAll';
222
+ return httpGetWithCache('transportLocno', url, params);
223
+ };
224
+ /**
225
+ * @param param
226
+ * @name 分页获取配送点,调用接口/lesoon-mdm-center-api/tmsTransportPoint/getTransportPointByPage
227
+ * @returns
228
+ */
229
+ export var getTransportPointPage = function getTransportPointPage() {
230
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
231
+ setPageSize(params);
232
+ var url = '/lesoon-mdm-center-api/tmsTransportPoint/getTransportPointByPage';
233
+ return httpGetWithCache('transportPoint', url, params);
234
+ };
235
+ /**
236
+ * @param param
237
+ * @name 分页获取卸货点,调用接口/lesoon-mdm-center-api/tmsUploadPoint/findTmpUploadPintList
238
+ * @returns
239
+ */
240
+ export var getUploadPointPage = function getUploadPointPage() {
241
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
242
+ setPageSize(params);
243
+ var url = '/lesoon-mdm-center-api/tmsUploadPoint/findTmpUploadPintList';
244
+ return httpGetWithCache('uploadPoint', url, params);
245
+ };
246
+ /**
247
+ * @param param
248
+ * @name 分页获取店铺,调用接口/lesoon-mdm-center-api/bmShop/pageVo
249
+ * @returns
250
+ */
251
+ export var getShopPage = function getShopPage() {
252
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
253
+ setPageSize(params);
254
+ var url = '/lesoon-mdm-center-api/bmShop/pageVo';
255
+ return httpGetWithCache('shop', url, params);
256
+ };
257
+ /**
258
+ * @param param
259
+ * @name 获取颜色,调用接口/lesoon-mdm-center-api/bmColor/findAll
260
+ * @returns
261
+ */
262
+ export var getColor = function getColor() {
263
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
264
+ var url = '/lesoon-mdm-center-api/bmColor/findAll';
265
+ return httpGetWithCache('color', url, params);
266
+ };
267
+ /**
268
+ * @param param
269
+ * @name 获取尺码类型,调用接口/lesoon-mdm-center-api/bmSizeType/findAll
270
+ * @returns
271
+ */
272
+ export var getSizeType = function getSizeType() {
273
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
274
+ var url = '/lesoon-mdm-center-api/bmSizeType/findAll';
275
+ return httpGetWithCache('sizeType', url, params);
276
+ };
277
+ /**
278
+ * @param param
279
+ * @name 获取性别,调用接口/lesoon-mdm-center-api/bmGender/findAll
280
+ * @returns
281
+ */
282
+ export var getGender = function getGender() {
283
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
284
+ var url = '/lesoon-mdm-center-api/bmGender/findAll';
285
+ return httpGetWithCache('gender', url, params);
286
+ };
287
+ /**
288
+ * @param param
289
+ * @name 获取年份,调用接口/lesoon-mdm-center-api/bmYear/findAll
290
+ * @returns
291
+ */
292
+ export var getYear = function getYear() {
293
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
294
+ var url = '/lesoon-mdm-center-api/bmYear/findAll';
295
+ return httpGetWithCache('year', url, params);
296
+ };
297
+ /**
298
+ * @param param
299
+ * @name 获取季节,调用接口/lesoon-mdm-center-api/bmSeason/findAll
300
+ * @returns
301
+ */
302
+ export var getSeason = function getSeason() {
303
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
304
+ var url = '/lesoon-mdm-center-api/bmSeason/findAll';
305
+ return httpGetWithCache('season', url, params);
306
+ };
307
+ /**
308
+ * @param param
309
+ * @name 获取品类,调用接口/lesoon-mdm-center-api/bmCategory/findAll
310
+ * @returns
311
+ */
312
+ export var getCategory = function getCategory() {
313
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
314
+ var url = '/lesoon-mdm-center-api/bmCategory/findAll';
315
+ return httpGetWithCache('category', url, params);
316
+ };
317
+ var mdmMap = {
318
+ owner: getOwner,
319
+ store: getStore,
320
+ brandDept: getBrandDept,
321
+ logisticRegion: getLogisticRegion,
322
+ expressCompany: getExpressCompany,
323
+ expressCompanyPage: getExpressCompanyPage,
324
+ physicalStore: getPhysicalStore,
325
+ settleCategory: getSettleCategory,
326
+ profitLossMain: getProfitLossMain,
327
+ settleCompany: getSettleCompany,
328
+ powerUnit: getPowerUnit,
329
+ settleAccount: getSettleAccount,
330
+ logisticCategory: getLogisticCategory,
331
+ managingCity: getManagingCity,
332
+ area: getArea,
333
+ transportLocno: getTransportLocno,
334
+ transportPointPage: getTransportPointPage,
335
+ uploadPointPage: getUploadPointPage,
336
+ shopPage: getShopPage,
337
+ color: getColor,
338
+ sizeType: getSizeType,
339
+ gender: getGender,
340
+ year: getYear,
341
+ season: getSeason,
342
+ category: getCategory
343
+ };
344
+ export var getMdmData = function getMdmData(type) {
345
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
346
+ var fn = mdmMap[type];
347
+ if (!fn) {
348
+ throw new Error("".concat(type, " \u4E0D\u5B58\u5728"));
349
+ }
350
+ return fn(params);
351
+ };
package/lib/index.d.ts CHANGED
@@ -17,8 +17,11 @@ import IconBell from './components/IconBell';
17
17
  import IconSearch from './components/IconSearch';
18
18
  import TagCheck from './components/TagCheck';
19
19
  import ViewOffice from './components/ViewOffice';
20
- import BaseService from './service/BaseService';
20
+ import ProButton from './components/ProButton';
21
+ import RecordLog from './components/RecordLog';
21
22
  import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
23
+ import BaseService from './service/BaseService';
24
+ import * as mdmRequest from './http/mdmRequest';
22
25
  import * as utils from './utils';
23
26
  import exportProcess from './utils/exportProcess';
24
27
  /** Hooks */
@@ -32,6 +35,7 @@ import useSelectOptions from './hooks/useSelectOptions';
32
35
  import showConfirmFun from './hooks/useShowConfirm';
33
36
  import useQueue from './hooks/useQueue';
34
37
  import { useDict } from './hooks/useDict';
38
+ import useMdm from './hooks/useMdm';
35
39
  /** Type */
36
40
  import type { ApiResponse, TableToolbar, BaseApiType, MethodType } from './typing';
37
41
  import type { DtlLyaoutProps } from './components/DtlLayout';
@@ -39,4 +43,4 @@ import type { DescritionCardProps } from './components/DescritionCard';
39
43
  import type { PermissionProps } from './components/Permission';
40
44
  import type { TDict } from './hooks/useDict';
41
45
  export type { ApiResponse, TableToolbar, BaseApiType, MethodType, DtlLyaoutProps, DescritionCardProps, PermissionProps, TDict, };
42
- 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, useDict, showConfirmFun, exportProcess, };
46
+ 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, useDict, useMdm, showConfirmFun, exportProcess, mdmRequest, ProButton, RecordLog, };
package/lib/index.js CHANGED
@@ -17,8 +17,11 @@ import IconBell from './components/IconBell';
17
17
  import IconSearch from './components/IconSearch';
18
18
  import TagCheck from './components/TagCheck';
19
19
  import ViewOffice from './components/ViewOffice';
20
- import BaseService from './service/BaseService';
20
+ import ProButton from './components/ProButton';
21
+ import RecordLog from './components/RecordLog';
21
22
  import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
23
+ import BaseService from './service/BaseService';
24
+ import * as mdmRequest from './http/mdmRequest';
22
25
  import * as utils from './utils';
23
26
  import exportProcess from './utils/exportProcess';
24
27
  /** Hooks */
@@ -32,4 +35,5 @@ import useSelectOptions from './hooks/useSelectOptions';
32
35
  import showConfirmFun from './hooks/useShowConfirm';
33
36
  import useQueue from './hooks/useQueue';
34
37
  import { useDict } from './hooks/useDict';
35
- 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, useDict, showConfirmFun, exportProcess };
38
+ import useMdm from './hooks/useMdm';
39
+ 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, useDict, useMdm, showConfirmFun, exportProcess, mdmRequest, ProButton, RecordLog };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 数组去重
3
+ *
4
+ * @param arr 原始数组
5
+ * @param property 按照什么属性去重 默认value
6
+ * @returns
7
+ */
8
+ export declare const uniqueByProperty: (arr: any[], property?: string) => any;
9
+ /**
10
+ * 遍历树
11
+ *
12
+ * @param list 树对象
13
+ * @param fn 回调函数
14
+ * @param children 树属性字段
15
+ */
16
+ export declare const treeEach: (list: any[], fn: (item: any, index: any, list: any[]) => void, children?: string) => void;
17
+ /**
18
+ * 查询数
19
+ *
20
+ * @param list 树对象
21
+ * @param key 查询属性
22
+ * @param val 查询值
23
+ * @param children 树属性字段
24
+ * @returns 返回符合条件的第一条对象
25
+ */
26
+ export declare const treeFind: (list: any[], key: string, val: any, children?: string) => any;
@@ -0,0 +1,74 @@
1
+ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
2
+ /**
3
+ * 数组去重
4
+ *
5
+ * @param arr 原始数组
6
+ * @param property 按照什么属性去重 默认value
7
+ * @returns
8
+ */
9
+ export var uniqueByProperty = function uniqueByProperty(arr) {
10
+ var property = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'value';
11
+ if (!Array.isArray(arr)) {
12
+ return [];
13
+ }
14
+ return arr.reduce(function (acc, item) {
15
+ if (!acc.some(function (i) {
16
+ return i[property] === item[property];
17
+ })) {
18
+ acc.push(item);
19
+ }
20
+ return acc;
21
+ }, []);
22
+ };
23
+ /**
24
+ * 遍历树
25
+ *
26
+ * @param list 树对象
27
+ * @param fn 回调函数
28
+ * @param children 树属性字段
29
+ */
30
+ export var treeEach = function treeEach(list, fn) {
31
+ var children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';
32
+ list.forEach(function (item, index) {
33
+ fn(item, index, list);
34
+ // @ts-ignore
35
+ if (Array.isArray(item[children]) && item[children].length) {
36
+ // @ts-ignore
37
+ treeEach(item[children], fn, children);
38
+ }
39
+ });
40
+ };
41
+ /**
42
+ * 查询数
43
+ *
44
+ * @param list 树对象
45
+ * @param key 查询属性
46
+ * @param val 查询值
47
+ * @param children 树属性字段
48
+ * @returns 返回符合条件的第一条对象
49
+ */
50
+ export var treeFind = function treeFind(list, key, val) {
51
+ var children = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'children';
52
+ var item = null;
53
+ var _iterator = _createForOfIteratorHelper(list),
54
+ _step;
55
+ try {
56
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
57
+ var row = _step.value;
58
+ if (row[key] === val) {
59
+ item = row;
60
+ break;
61
+ } else if (row[children] && row[children].length) {
62
+ item = treeFind(row[children], key, val);
63
+ if (item) {
64
+ break;
65
+ }
66
+ }
67
+ }
68
+ } catch (err) {
69
+ _iterator.e(err);
70
+ } finally {
71
+ _iterator.f();
72
+ }
73
+ return item;
74
+ };
@@ -0,0 +1,82 @@
1
+ /**
2
+ * 千位符格式化数值,不处理小数点
3
+ *
4
+ * @param num 数值
5
+ * @returns Xx,xxx.xxxx
6
+ */
7
+ export declare const formatNumber: (num: number | string, decimal?: number | undefined) => string;
8
+ /**
9
+ * 千位符格式化数值
10
+ *
11
+ * @param num 数值
12
+ * @param dec 小数位数,默认为2位小数
13
+ * @returns Xx,xxx.xx
14
+ */
15
+ export declare const formatMoney: (num: number | string, dec?: number) => string;
16
+ /**
17
+ * 日期格式化
18
+ *
19
+ * @param dt 日期
20
+ * @param showTime 是否显示时间 默认为 true
21
+ * @returns YYYY-MM-DD
22
+ */
23
+ export declare const dateFormat: (dt?: Date | null | undefined, showTime?: boolean) => string;
24
+ /**
25
+ * 日期格式化
26
+ *
27
+ * @param dt 日期
28
+ * @param showTime 是否显示时间 默认true
29
+ * @returns YYYY-MM-DD hh:mm:ss
30
+ */
31
+ export declare const formatDate: (dt?: Date | null | undefined, showTime?: boolean) => string;
32
+ /**
33
+ * 返回当前日期
34
+ *
35
+ * @returns YYYY-MM-DD
36
+ */
37
+ export declare const today: () => string;
38
+ /**
39
+ * 返回当前日期时间
40
+ *
41
+ * @returns YYYY-MM-DD hh:mm:ss
42
+ */
43
+ export declare const now: () => string;
44
+ /**
45
+ * 时间加减
46
+ *
47
+ * @param dt 原始时间,传 null 为当前时间
48
+ * @param addDay 添加添数,可为负数
49
+ * @param addMonth 添加月数,可为负数
50
+ * @param addYear 添加年数,可以负责
51
+ * @returns YYYY-MM-DD hh:mm:ss
52
+ */
53
+ export declare const dateAdd: (dt: Date | null, addDay: number, addMonth?: number, addYear?: number) => string;
54
+ /**
55
+ * 当前时间加减
56
+ *
57
+ * @param addDay 添加添数,可为负数
58
+ * @param addMonth 添加月数,可为负数
59
+ * @param addYear 添加年数,可以负责
60
+ * @returns YYYY-MM-DD hh:mm:ss
61
+ */
62
+ export declare const nowAdd: (addDay: number, addMonth?: number, addYear?: number) => string;
63
+ /**
64
+ * 当前日期加减
65
+ *
66
+ * @param addDay 添加添数,可为负数
67
+ * @param addMonth 添加月数,可为负数
68
+ * @param addYear 添加年数,可以负责
69
+ * @returns YYYY-MM-DD
70
+ */
71
+ export declare const todayAdd: (addDay: number, addMonth?: number, addYear?: number) => string;
72
+ /**
73
+ * 加载下拉框的数据源
74
+ *
75
+ * @param rows 数组
76
+ * @param valueField 值字段
77
+ * @param labelField 显示字段
78
+ * @param showValue 显示值 默认为true
79
+ * @param showValueField 显示值字段 默认为valueField
80
+ * @returns 下拉框数据源
81
+ */
82
+ export declare const mapOptions: (rows: any[], valueField: string, labelField: string, showValue?: boolean, showValueField?: string) => any[];