ls-pro-common 3.1.6 → 3.1.8

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.
@@ -4,28 +4,6 @@
4
4
  http://jedwatson.github.io/classnames
5
5
  */
6
6
 
7
- /*!
8
- Copyright (c) 2011, Yahoo! Inc. All rights reserved.
9
- Code licensed under the BSD License:
10
- http://developer.yahoo.com/yui/license.html
11
- version: 2.9.0
12
- */
13
-
14
- /*! *****************************************************************************
15
- Copyright (c) Microsoft Corporation. All rights reserved.
16
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
17
- this file except in compliance with the License. You may obtain a copy of the
18
- License at http://www.apache.org/licenses/LICENSE-2.0
19
-
20
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
22
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
23
- MERCHANTABLITY OR NON-INFRINGEMENT.
24
-
25
- See the Apache Version 2.0 License for specific language governing permissions
26
- and limitations under the License.
27
- ***************************************************************************** */
28
-
29
7
  /*! *****************************************************************************
30
8
  Copyright (c) Microsoft Corporation.
31
9
 
@@ -43,15 +21,6 @@ PERFORMANCE OF THIS SOFTWARE.
43
21
 
44
22
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
45
23
 
46
- /**
47
- * @fileOverview
48
- * @name asn1-1.0.js
49
- * @author Kenji Urushima kenji.urushima@gmail.com
50
- * @version asn1 1.0.13 (2017-Jun-02)
51
- * @since jsrsasign 2.1
52
- * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
53
- */
54
-
55
24
  /**
56
25
  * @license
57
26
  * Lodash <https://lodash.com/>
@@ -13,7 +13,7 @@ import { showWarn } from '../utils';
13
13
  */
14
14
  export var useBaseDict = function useBaseDict(props) {
15
15
  var _props$url = props.url,
16
- url = _props$url === void 0 ? '/lesoon-integration/sysDictDtl?lesoon-tenant=1' : _props$url,
16
+ url = _props$url === void 0 ? '/lesoon-petrel-integration-api/sysDictDtl/page' : _props$url,
17
17
  _props$method = props.method,
18
18
  method = _props$method === void 0 ? 'GET' : _props$method,
19
19
  _props$dictValue = props.dictValue,
@@ -49,9 +49,12 @@ export declare function httpDelete(url: string, data: any, needGateWay?: boolean
49
49
  * @param dictCode 字典编码
50
50
  * @param showValue 是否显示值
51
51
  * @param needGateWay 是否需要网关 默认为true
52
+ * @param timeout 超时时间,默认60000毫秒
53
+ * @param isGet 是否Get请求
54
+ * @param valueIsNumber 返回值是否为数字,默认false
52
55
  * @returns Promise<Record<string,string>[]>
53
56
  */
54
- export declare function getDict(dictCode: string, showValue?: boolean, needGateWay?: boolean, timeout?: number): Promise<any>;
57
+ export declare function getDict(dictCodes: string, showValue?: boolean, needGateWay?: boolean, timeout?: number, isGet?: boolean, valueIsNumber?: boolean): Promise<any>;
55
58
  /**
56
59
  * 加载下拉框的数据源
57
60
  *
@@ -61,7 +64,10 @@ export declare function getDict(dictCode: string, showValue?: boolean, needGateW
61
64
  * @param labelField 显示字段
62
65
  * @param showValue 显示值
63
66
  * @param needGateWay 是否需要网关 默认为true
67
+ * @param timeout
68
+ * @param isGet = true 是否get请求,默认true
69
+ * @param valueIsNumber 返回值是否为数字,默认false
64
70
  * @returns
65
71
  */
66
- export declare function fetchOptions(url: string, param: any, valueField: string, labelField: string, showValue?: boolean, needGateWay?: boolean, timeout?: number): Promise<any>;
72
+ export declare function fetchOptions(url: string, param: any, valueField: string, labelField: string, showValue?: boolean, needGateWay?: boolean, timeout?: number, isGet?: boolean, valueIsNumber?: boolean): Promise<any>;
67
73
  export default request;
package/es/http/index.js CHANGED
@@ -324,17 +324,22 @@ export function httpDelete(url, data) {
324
324
  * @param dictCode 字典编码
325
325
  * @param showValue 是否显示值
326
326
  * @param needGateWay 是否需要网关 默认为true
327
+ * @param timeout 超时时间,默认60000毫秒
328
+ * @param isGet 是否Get请求
329
+ * @param valueIsNumber 返回值是否为数字,默认false
327
330
  * @returns Promise<Record<string,string>[]>
328
331
  */
329
- export function getDict(dictCode) {
332
+ export function getDict(dictCodes) {
330
333
  var showValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
331
334
  var needGateWay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
332
335
  var timeout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 60000;
333
- var api = '/lesoon-integration/sysDictDtl/listByProperties';
336
+ var isGet = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
337
+ var valueIsNumber = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
338
+ var api = '/lesoon-petrel-integration-api/sysDictDtl/listByProperties';
334
339
  var param = {
335
- dictCode: dictCode
340
+ dictCodes: (dictCodes || '').split(',')
336
341
  };
337
- return fetchOptions(api, param, 'dictValue', 'displayName', showValue, needGateWay, timeout);
342
+ return fetchOptions(api, param, 'dictValue', 'displayName', showValue, needGateWay, timeout, isGet, valueIsNumber);
338
343
  }
339
344
  /**
340
345
  * 加载下拉框的数据源
@@ -345,6 +350,9 @@ export function getDict(dictCode) {
345
350
  * @param labelField 显示字段
346
351
  * @param showValue 显示值
347
352
  * @param needGateWay 是否需要网关 默认为true
353
+ * @param timeout
354
+ * @param isGet = true 是否get请求,默认true
355
+ * @param valueIsNumber 返回值是否为数字,默认false
348
356
  * @returns
349
357
  */
350
358
  export function fetchOptions(_x3, _x4, _x5, _x6) {
@@ -355,8 +363,8 @@ function _fetchOptions() {
355
363
  var showValue,
356
364
  needGateWay,
357
365
  timeout,
358
- _yield$httpGet,
359
- _yield$httpGet$rows,
366
+ isGet,
367
+ valueIsNumber,
360
368
  rows,
361
369
  data,
362
370
  _args2 = arguments;
@@ -366,21 +374,47 @@ function _fetchOptions() {
366
374
  showValue = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : true;
367
375
  needGateWay = _args2.length > 5 && _args2[5] !== undefined ? _args2[5] : true;
368
376
  timeout = _args2.length > 6 && _args2[6] !== undefined ? _args2[6] : 60000;
369
- _context2.next = 5;
377
+ isGet = _args2.length > 7 && _args2[7] !== undefined ? _args2[7] : true;
378
+ valueIsNumber = _args2.length > 8 && _args2[8] !== undefined ? _args2[8] : false;
379
+ if (!isGet) {
380
+ _context2.next = 14;
381
+ break;
382
+ }
383
+ _context2.next = 8;
370
384
  return httpGet(url, param, needGateWay, timeout);
371
- case 5:
372
- _yield$httpGet = _context2.sent;
373
- _yield$httpGet$rows = _yield$httpGet.rows;
374
- rows = _yield$httpGet$rows === void 0 ? [] : _yield$httpGet$rows;
385
+ case 8:
386
+ _context2.t0 = _context2.sent.rows;
387
+ if (_context2.t0) {
388
+ _context2.next = 11;
389
+ break;
390
+ }
391
+ _context2.t0 = [];
392
+ case 11:
393
+ rows = _context2.t0;
394
+ _context2.next = 20;
395
+ break;
396
+ case 14:
397
+ _context2.next = 16;
398
+ return httpPost(url, param, true, needGateWay, timeout);
399
+ case 16:
400
+ _context2.t1 = _context2.sent.rows;
401
+ if (_context2.t1) {
402
+ _context2.next = 19;
403
+ break;
404
+ }
405
+ _context2.t1 = [];
406
+ case 19:
407
+ rows = _context2.t1;
408
+ case 20:
375
409
  data = (rows || []).map(function (o) {
376
410
  return _objectSpread(_objectSpread({}, o), {}, {
377
- value: o[valueField],
411
+ value: valueIsNumber && !isNaN(o[valueField]) ? Number(o[valueField]) : o[valueField],
378
412
  text: o[labelField],
379
413
  label: (showValue ? o[valueField] + '→' : '') + o[labelField]
380
414
  });
381
415
  });
382
416
  return _context2.abrupt("return", data);
383
- case 10:
417
+ case 22:
384
418
  case "end":
385
419
  return _context2.stop();
386
420
  }
@@ -13,7 +13,7 @@ import { showWarn } from '../utils';
13
13
  */
14
14
  export var useBaseDict = function useBaseDict(props) {
15
15
  var _props$url = props.url,
16
- url = _props$url === void 0 ? '/lesoon-integration/sysDictDtl?lesoon-tenant=1' : _props$url,
16
+ url = _props$url === void 0 ? '/lesoon-petrel-integration-api/sysDictDtl/page' : _props$url,
17
17
  _props$method = props.method,
18
18
  method = _props$method === void 0 ? 'GET' : _props$method,
19
19
  _props$dictValue = props.dictValue,
@@ -49,9 +49,12 @@ export declare function httpDelete(url: string, data: any, needGateWay?: boolean
49
49
  * @param dictCode 字典编码
50
50
  * @param showValue 是否显示值
51
51
  * @param needGateWay 是否需要网关 默认为true
52
+ * @param timeout 超时时间,默认60000毫秒
53
+ * @param isGet 是否Get请求
54
+ * @param valueIsNumber 返回值是否为数字,默认false
52
55
  * @returns Promise<Record<string,string>[]>
53
56
  */
54
- export declare function getDict(dictCode: string, showValue?: boolean, needGateWay?: boolean, timeout?: number): Promise<any>;
57
+ export declare function getDict(dictCodes: string, showValue?: boolean, needGateWay?: boolean, timeout?: number, isGet?: boolean, valueIsNumber?: boolean): Promise<any>;
55
58
  /**
56
59
  * 加载下拉框的数据源
57
60
  *
@@ -61,7 +64,10 @@ export declare function getDict(dictCode: string, showValue?: boolean, needGateW
61
64
  * @param labelField 显示字段
62
65
  * @param showValue 显示值
63
66
  * @param needGateWay 是否需要网关 默认为true
67
+ * @param timeout
68
+ * @param isGet = true 是否get请求,默认true
69
+ * @param valueIsNumber 返回值是否为数字,默认false
64
70
  * @returns
65
71
  */
66
- export declare function fetchOptions(url: string, param: any, valueField: string, labelField: string, showValue?: boolean, needGateWay?: boolean, timeout?: number): Promise<any>;
72
+ export declare function fetchOptions(url: string, param: any, valueField: string, labelField: string, showValue?: boolean, needGateWay?: boolean, timeout?: number, isGet?: boolean, valueIsNumber?: boolean): Promise<any>;
67
73
  export default request;
package/lib/http/index.js CHANGED
@@ -324,17 +324,22 @@ export function httpDelete(url, data) {
324
324
  * @param dictCode 字典编码
325
325
  * @param showValue 是否显示值
326
326
  * @param needGateWay 是否需要网关 默认为true
327
+ * @param timeout 超时时间,默认60000毫秒
328
+ * @param isGet 是否Get请求
329
+ * @param valueIsNumber 返回值是否为数字,默认false
327
330
  * @returns Promise<Record<string,string>[]>
328
331
  */
329
- export function getDict(dictCode) {
332
+ export function getDict(dictCodes) {
330
333
  var showValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
331
334
  var needGateWay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
332
335
  var timeout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 60000;
333
- var api = '/lesoon-integration/sysDictDtl/listByProperties';
336
+ var isGet = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
337
+ var valueIsNumber = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
338
+ var api = '/lesoon-petrel-integration-api/sysDictDtl/listByProperties';
334
339
  var param = {
335
- dictCode: dictCode
340
+ dictCodes: (dictCodes || '').split(',')
336
341
  };
337
- return fetchOptions(api, param, 'dictValue', 'displayName', showValue, needGateWay, timeout);
342
+ return fetchOptions(api, param, 'dictValue', 'displayName', showValue, needGateWay, timeout, isGet, valueIsNumber);
338
343
  }
339
344
  /**
340
345
  * 加载下拉框的数据源
@@ -345,6 +350,9 @@ export function getDict(dictCode) {
345
350
  * @param labelField 显示字段
346
351
  * @param showValue 显示值
347
352
  * @param needGateWay 是否需要网关 默认为true
353
+ * @param timeout
354
+ * @param isGet = true 是否get请求,默认true
355
+ * @param valueIsNumber 返回值是否为数字,默认false
348
356
  * @returns
349
357
  */
350
358
  export function fetchOptions(_x3, _x4, _x5, _x6) {
@@ -355,8 +363,8 @@ function _fetchOptions() {
355
363
  var showValue,
356
364
  needGateWay,
357
365
  timeout,
358
- _yield$httpGet,
359
- _yield$httpGet$rows,
366
+ isGet,
367
+ valueIsNumber,
360
368
  rows,
361
369
  data,
362
370
  _args2 = arguments;
@@ -366,21 +374,47 @@ function _fetchOptions() {
366
374
  showValue = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : true;
367
375
  needGateWay = _args2.length > 5 && _args2[5] !== undefined ? _args2[5] : true;
368
376
  timeout = _args2.length > 6 && _args2[6] !== undefined ? _args2[6] : 60000;
369
- _context2.next = 5;
377
+ isGet = _args2.length > 7 && _args2[7] !== undefined ? _args2[7] : true;
378
+ valueIsNumber = _args2.length > 8 && _args2[8] !== undefined ? _args2[8] : false;
379
+ if (!isGet) {
380
+ _context2.next = 14;
381
+ break;
382
+ }
383
+ _context2.next = 8;
370
384
  return httpGet(url, param, needGateWay, timeout);
371
- case 5:
372
- _yield$httpGet = _context2.sent;
373
- _yield$httpGet$rows = _yield$httpGet.rows;
374
- rows = _yield$httpGet$rows === void 0 ? [] : _yield$httpGet$rows;
385
+ case 8:
386
+ _context2.t0 = _context2.sent.rows;
387
+ if (_context2.t0) {
388
+ _context2.next = 11;
389
+ break;
390
+ }
391
+ _context2.t0 = [];
392
+ case 11:
393
+ rows = _context2.t0;
394
+ _context2.next = 20;
395
+ break;
396
+ case 14:
397
+ _context2.next = 16;
398
+ return httpPost(url, param, true, needGateWay, timeout);
399
+ case 16:
400
+ _context2.t1 = _context2.sent.rows;
401
+ if (_context2.t1) {
402
+ _context2.next = 19;
403
+ break;
404
+ }
405
+ _context2.t1 = [];
406
+ case 19:
407
+ rows = _context2.t1;
408
+ case 20:
375
409
  data = (rows || []).map(function (o) {
376
410
  return _objectSpread(_objectSpread({}, o), {}, {
377
- value: o[valueField],
411
+ value: valueIsNumber && !isNaN(o[valueField]) ? Number(o[valueField]) : o[valueField],
378
412
  text: o[labelField],
379
413
  label: (showValue ? o[valueField] + '→' : '') + o[labelField]
380
414
  });
381
415
  });
382
416
  return _context2.abrupt("return", data);
383
- case 10:
417
+ case 22:
384
418
  case "end":
385
419
  return _context2.stop();
386
420
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-pro-common",
3
- "version": "3.1.6",
3
+ "version": "3.1.8",
4
4
  "description": "ls-pro-common",
5
5
  "license": "MIT",
6
6
  "sideEffects": [