ls-pro-common 1.0.61 → 1.0.63

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 (47) hide show
  1. package/CHANGELOG.md +746 -746
  2. package/README.md +22 -22
  3. package/dist/common.css +101 -22
  4. package/dist/common.js +1 -1
  5. package/dist/common.min.css +101 -22
  6. package/dist/common.min.js +1 -1
  7. package/es/components/IconSelector.d.ts +2 -8
  8. package/es/components/IconSelector.js +114 -207
  9. package/es/components/ImageSelector.d.ts +3 -0
  10. package/es/components/ImageSelector.js +128 -24
  11. package/es/components/InputMultiLine.js +1 -1
  12. package/es/components/InputTable.d.ts +5 -0
  13. package/es/components/InputTable.js +26 -4
  14. package/es/components/common.less +176 -119
  15. package/es/hooks/useDtl/index.d.ts +13 -0
  16. package/es/hooks/useDtl/index.js +388 -235
  17. package/es/hooks/usePermission/index.d.ts +1 -0
  18. package/es/hooks/usePermission/index.js +23 -1
  19. package/es/hooks/useSingle/index.d.ts +1 -0
  20. package/es/hooks/useSingle/index.js +3 -1
  21. package/es/http/index.js +27 -8
  22. package/es/service/BaseService.d.ts +8 -0
  23. package/es/service/BaseService.js +69 -26
  24. package/es/typing.d.ts +4 -0
  25. package/es/utils/index.d.ts +49 -0
  26. package/es/utils/index.js +142 -1
  27. package/lib/components/IconSelector.d.ts +2 -8
  28. package/lib/components/IconSelector.js +112 -214
  29. package/lib/components/ImageSelector.d.ts +3 -0
  30. package/lib/components/ImageSelector.js +125 -24
  31. package/lib/components/InputMultiLine.js +1 -1
  32. package/lib/components/InputTable.d.ts +5 -0
  33. package/lib/components/InputTable.js +26 -4
  34. package/lib/components/common.less +176 -119
  35. package/lib/hooks/useDtl/index.d.ts +13 -0
  36. package/lib/hooks/useDtl/index.js +388 -235
  37. package/lib/hooks/usePermission/index.d.ts +1 -0
  38. package/lib/hooks/usePermission/index.js +23 -0
  39. package/lib/hooks/useSingle/index.d.ts +1 -0
  40. package/lib/hooks/useSingle/index.js +3 -1
  41. package/lib/http/index.js +25 -7
  42. package/lib/service/BaseService.d.ts +8 -0
  43. package/lib/service/BaseService.js +69 -26
  44. package/lib/typing.d.ts +4 -0
  45. package/lib/utils/index.d.ts +49 -0
  46. package/lib/utils/index.js +163 -3
  47. package/package.json +2 -2
@@ -4,29 +4,31 @@ import "antd/es/empty/style";
4
4
  import _Empty from "antd/es/empty";
5
5
  import "antd/es/card/style";
6
6
  import _Card from "antd/es/card";
7
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
8
- import "antd/es/upload/style";
9
- import _Upload from "antd/es/upload";
10
7
  import "antd/es/button/style";
11
8
  import _Button from "antd/es/button";
9
+ import "antd/es/upload/style";
10
+ import _Upload from "antd/es/upload";
12
11
  import "antd/es/input/style";
13
12
  import _Input from "antd/es/input";
14
13
  import _extends from "@babel/runtime/helpers/esm/extends";
14
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
15
15
  import _regeneratorRuntime from "@babel/runtime/regenerator";
16
16
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
17
17
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
18
18
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
19
19
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
20
- var _excluded = ["type", "uploadable", "readonly", "allowClear", "title", "modalWidth", "name", "maxSize", "modalProps", "code"];
20
+ var _excluded = ["type", "uploadable", "readonly", "allowClear", "title", "modalWidth", "name", "maxSize", "modalProps", "code", "isInput", "desc", "imageClass"];
21
21
  import React from "react";
22
- import { useMemo, useState, useEffect, useContext } from 'react';
22
+ import { useMemo, useState, useEffect, useContext, useRef } from 'react';
23
23
  import { ProFormText, ProFormContext } from 'ls-pro-form';
24
- import { PlusOutlined, UploadOutlined, SearchOutlined } from '@ant-design/icons';
24
+ import { PlusOutlined, UploadOutlined, SearchOutlined, CloseOutlined } from '@ant-design/icons';
25
25
  import { httpGet } from '../http';
26
26
  import { getCache, showError, showWarn, showSuccess } from '../utils';
27
27
  var fileCenter = getCache('ossPath') || '/petrel/petrel-file-center-api/lesoon/oss/file/';
28
28
 
29
29
  function ImageSelector(prop) {
30
+ var _rest$fieldProps3;
31
+
30
32
  //@ts-ignore?
31
33
  var _useContext = useContext(ProFormContext),
32
34
  formRef = _useContext.formRef;
@@ -56,12 +58,15 @@ function ImageSelector(prop) {
56
58
  nextMarker = _useState10[0],
57
59
  setNextMarker = _useState10[1];
58
60
 
61
+ var inputRef = useRef();
62
+
59
63
  var type = prop.type,
60
64
  _prop$uploadable = prop.uploadable,
61
65
  uploadable = _prop$uploadable === void 0 ? true : _prop$uploadable,
62
66
  _prop$readonly = prop.readonly,
63
67
  readonly = _prop$readonly === void 0 ? true : _prop$readonly,
64
- allowClear = prop.allowClear,
68
+ _prop$allowClear = prop.allowClear,
69
+ allowClear = _prop$allowClear === void 0 ? true : _prop$allowClear,
65
70
  _prop$title = prop.title,
66
71
  title = _prop$title === void 0 ? "选择图标" : _prop$title,
67
72
  _prop$modalWidth = prop.modalWidth,
@@ -72,6 +77,12 @@ function ImageSelector(prop) {
72
77
  modalProps = prop.modalProps,
73
78
  _prop$code = prop.code,
74
79
  code = _prop$code === void 0 ? 'RETAIL' : _prop$code,
80
+ _prop$isInput = prop.isInput,
81
+ isInput = _prop$isInput === void 0 ? true : _prop$isInput,
82
+ _prop$desc = prop.desc,
83
+ desc = _prop$desc === void 0 ? '支持 png | jpg | gif 格式图片' : _prop$desc,
84
+ _prop$imageClass = prop.imageClass,
85
+ imageClass = _prop$imageClass === void 0 ? '' : _prop$imageClass,
75
86
  rest = _objectWithoutProperties(prop, _excluded); // 上传地址
76
87
 
77
88
 
@@ -174,13 +185,29 @@ function ImageSelector(prop) {
174
185
 
175
186
 
176
187
  var onUpload = function onUpload(info) {
188
+ var isDirect = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
189
+
177
190
  if (info.file.status === 'done') {
178
191
  var _result$flag;
179
192
 
180
193
  var result = info.file.response;
181
194
 
182
195
  if ((result === null || result === void 0 ? void 0 : (_result$flag = result.flag) === null || _result$flag === void 0 ? void 0 : _result$flag.retCode) === '0') {
183
- showSuccess(result.flag.retMsg);
196
+ showSuccess(result.flag.retMsg); // 直接上传
197
+
198
+ if (isDirect) {
199
+ var _result$rows$;
200
+
201
+ var img = showImgApi + '?fileName=' + (result === null || result === void 0 ? void 0 : (_result$rows$ = result.rows[0]) === null || _result$rows$ === void 0 ? void 0 : _result$rows$.newFileId);
202
+ setImgUrl(img);
203
+ var formVal = formRef.current.getFieldsValue();
204
+
205
+ var val = _objectSpread({}, formVal); //@ts-ignore
206
+
207
+
208
+ val[name] = img;
209
+ formRef.current.setFieldsValue(val);
210
+ }
184
211
  } else {
185
212
  var _result$flag2;
186
213
 
@@ -190,16 +217,55 @@ function ImageSelector(prop) {
190
217
  showError('上传数据失败,请联系管理员');
191
218
  }
192
219
 
193
- if (!info.fileList.filter(function (o) {
220
+ if (!isDirect && !info.fileList.filter(function (o) {
194
221
  return o.status === 'uploading';
195
222
  }).length) {
196
223
  loadData(searchKey);
197
224
  }
198
225
  };
199
226
 
227
+ var showSelect = function showSelect() {
228
+ var _rest$fieldProps;
229
+
230
+ if ((rest === null || rest === void 0 ? void 0 : rest.disabled) || (rest === null || rest === void 0 ? void 0 : (_rest$fieldProps = rest.fieldProps) === null || _rest$fieldProps === void 0 ? void 0 : _rest$fieldProps.disabled)) {
231
+ return;
232
+ }
233
+
234
+ setVisible(true);
235
+ };
236
+
237
+ useEffect(function () {
238
+ var _rest$fieldProps2;
239
+
240
+ if ((rest === null || rest === void 0 ? void 0 : rest.disabled) || (rest === null || rest === void 0 ? void 0 : (_rest$fieldProps2 = rest.fieldProps) === null || _rest$fieldProps2 === void 0 ? void 0 : _rest$fieldProps2.disabled)) return;
241
+
242
+ try {
243
+ if (!inputRef.current) return;
244
+ var el = inputRef.current.clearableInput.containerRef.current.querySelector('.ant-input-clear-icon');
245
+ if (!el) return;
246
+
247
+ if (imgUrl) {
248
+ el.classList.remove('ant-input-clear-icon-hidden');
249
+ } else {
250
+ el.classList.add('ant-input-clear-icon-hidden');
251
+ }
252
+ } catch (e) {}
253
+ }, [imgUrl]);
254
+
255
+ var clearValue = function clearValue(e) {
256
+ if (!e || !e.target.value) {
257
+ var _formRef$current;
258
+
259
+ setImgUrl('');
260
+ var formValue = formRef === null || formRef === void 0 ? void 0 : (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.getFieldsValue();
261
+ formValue[name] = '';
262
+ formRef.current.setFieldsValue(_objectSpread({}, formValue));
263
+ }
264
+ };
265
+
200
266
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ProFormText, _extends({
201
267
  name: name
202
- }, rest), /*#__PURE__*/React.createElement(_Input, _extends({
268
+ }, rest), isInput ? /*#__PURE__*/React.createElement(_Input, _extends({
203
269
  addonAfter: imgUrl ? /*#__PURE__*/React.createElement("img", {
204
270
  style: {
205
271
  maxWidth: 22,
@@ -207,23 +273,60 @@ function ImageSelector(prop) {
207
273
  },
208
274
  src: imgUrl,
209
275
  onClick: function onClick() {
210
- return setVisible(true);
276
+ return showSelect();
211
277
  }
212
278
  }) : /*#__PURE__*/React.createElement(PlusOutlined, {
213
279
  onClick: function onClick() {
214
- var _rest$fieldProps;
215
-
216
- if ((rest === null || rest === void 0 ? void 0 : rest.disabled) || (rest === null || rest === void 0 ? void 0 : (_rest$fieldProps = rest.fieldProps) === null || _rest$fieldProps === void 0 ? void 0 : _rest$fieldProps.disabled)) {
217
- return;
218
- }
219
-
220
- setVisible(true);
280
+ return showSelect();
221
281
  }
222
282
  })
223
283
  }, rest.fieldProps, {
224
284
  readOnly: readonly,
225
- allowClear: allowClear
226
- }))), /*#__PURE__*/React.createElement(_Modal, _extends({
285
+ allowClear: allowClear,
286
+ ref: inputRef,
287
+ onChange: clearValue
288
+ })) : /*#__PURE__*/React.createElement("div", {
289
+ className: "image-selector"
290
+ }, /*#__PURE__*/React.createElement(_Upload, {
291
+ beforeUpload: beforeUpload,
292
+ onChange: function onChange(info) {
293
+ return onUpload(info, true);
294
+ },
295
+ action: uploadImgApi,
296
+ showUploadList: false,
297
+ name: "file",
298
+ maxCount: 1,
299
+ multiple: false,
300
+ headers: {
301
+ token: localStorage.getItem('token') || ''
302
+ },
303
+ accept: ".png,.gif,.jpg,.jpeg,.bmp"
304
+ }, imgUrl ? /*#__PURE__*/React.createElement("div", {
305
+ className: "img-wrapper"
306
+ }, /*#__PURE__*/React.createElement("img", {
307
+ className: "img-preview ".concat(imageClass),
308
+ src: imgUrl
309
+ }), (rest === null || rest === void 0 ? void 0 : rest.disabled) !== true && (rest === null || rest === void 0 ? void 0 : (_rest$fieldProps3 = rest.fieldProps) === null || _rest$fieldProps3 === void 0 ? void 0 : _rest$fieldProps3.disabled) !== true && /*#__PURE__*/React.createElement("div", {
310
+ className: "clear-btn"
311
+ }, /*#__PURE__*/React.createElement(CloseOutlined, {
312
+ title: "\u6E05\u7A7A",
313
+ onClick: function onClick(e) {
314
+ e.preventDefault();
315
+ e.stopPropagation();
316
+ clearValue(undefined);
317
+ }
318
+ }))) : /*#__PURE__*/React.createElement("img", {
319
+ className: "img-upload",
320
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABGCAYAAABxLuKEAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAABB9SURBVHhe7ZyJV1THtsb5F1+Sm0Gj8SZOiVFUVBBFmhkZBGRukKmbbqbuZp5EJpFmUFEZFKPxOiT3Je8ac2OuCgLf21+dPs3p9oDNYDTxnrW+RfepOlW7frVr167TLsPguxaXlvBsfgn3/72I0R8X0XVvEc13F+G+AyXXd0DDSrq95Jfr9qJoAe7ZeXhm5+TvHFzyuWF2wad5dY9iuapzS+rc0ussam19p2u5n3q5r8vYZ4AM9YPFMVAcT6Oo8x/A1Z+AH38H5hd8IHy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ement("div", {
322
+ className: "img-choose"
323
+ }, /*#__PURE__*/React.createElement("a", {
324
+ onClick: function onClick() {
325
+ return showSelect();
326
+ }
327
+ }, "\u9009\u62E9\u5DF2\u6709\u56FE\u7247")), /*#__PURE__*/React.createElement("div", {
328
+ className: "img-desc"
329
+ }, desc))), /*#__PURE__*/React.createElement(_Modal, _extends({
227
330
  title: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, title), /*#__PURE__*/React.createElement("span", {
228
331
  style: {
229
332
  display: 'inline-block',
@@ -246,9 +349,8 @@ function ImageSelector(prop) {
246
349
  onCancel: function onCancel() {
247
350
  return setVisible(false);
248
351
  },
249
- bodyStyle: {
250
- padding: 8
251
- },
352
+ className: "image-selector",
353
+ centered: true,
252
354
  footer: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
253
355
  style: {
254
356
  display: 'inline-block',
@@ -256,7 +358,9 @@ function ImageSelector(prop) {
256
358
  }
257
359
  }, /*#__PURE__*/React.createElement(_Upload, {
258
360
  beforeUpload: beforeUpload,
259
- onChange: onUpload,
361
+ onChange: function onChange(info) {
362
+ return onUpload(info, false);
363
+ },
260
364
  action: uploadImgApi,
261
365
  showUploadList: false,
262
366
  name: "file",
@@ -50,7 +50,7 @@ var InputMultiLine = /*#__PURE__*/React.forwardRef(function (prop, ref) {
50
50
  allowClear = _prop$allowClear === void 0 ? true : _prop$allowClear,
51
51
  _prop$getPopupContain = prop.getPopupContainer,
52
52
  getPopupContainer = _prop$getPopupContain === void 0 ? function (triggerNode) {
53
- return document.body;
53
+ return triggerNode.parentNode.parentNode.parentNode.parentNode;
54
54
  } : _prop$getPopupContain,
55
55
  rest = _objectWithoutProperties(prop, _excluded); // 设置初始值
56
56
 
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { InputProps } from 'antd';
3
3
  import type { ProFormItemProps } from 'ls-pro-form';
4
+ import { TooltipPlacement } from 'antd/lib/tooltip';
4
5
  export declare type InputTableProps = ProFormItemProps<InputProps> & {
5
6
  /**@name 弹框选择表格列配置 */
6
7
  columns: any[];
@@ -35,6 +36,8 @@ export declare type InputTableProps = ProFormItemProps<InputProps> & {
35
36
  /**@name 输入后检查数据的触发方式,默认为entry回车触发 */
36
37
  triggerCheck?: 'entry' | 'blur';
37
38
  loadOnShow?: boolean;
39
+ placement?: TooltipPlacement;
40
+ arrowPointAtCenter?: boolean;
38
41
  /**@name 选择行事件 */
39
42
  onSelectChange?: (item: any, formRef?: any) => void;
40
43
  /**@name 加载之前事件,param为查询条件对象,可以通过此方法调整 */
@@ -86,6 +89,8 @@ declare const InputTable: React.ForwardRefExoticComponent<{
86
89
  /**@name 输入后检查数据的触发方式,默认为entry回车触发 */
87
90
  triggerCheck?: "entry" | "blur" | undefined;
88
91
  loadOnShow?: boolean | undefined;
92
+ placement?: TooltipPlacement | undefined;
93
+ arrowPointAtCenter?: boolean | undefined;
89
94
  /**@name 选择行事件 */
90
95
  onSelectChange?: ((item: any, formRef?: any) => void) | undefined;
91
96
  /**@name 加载之前事件,param为查询条件对象,可以通过此方法调整 */
@@ -10,7 +10,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
11
11
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
12
12
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
13
- var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange", "beforeLoad", "afterLoad", "isV2", "allowClear", "keepSelect", "fieldProps", "searchField", "fillMap", "loadOnShow", "triggerCheck", "getPopupContainer"],
13
+ var _excluded = ["columns", "url", "textName", "name", "tableConfig", "tableHeight", "tableWidth", "readonly", "multiple", "valueField", "labelWidth", "textField", "onSelectChange", "beforeLoad", "afterLoad", "isV2", "allowClear", "keepSelect", "fieldProps", "searchField", "fillMap", "loadOnShow", "triggerCheck", "getPopupContainer", "placement", "arrowPointAtCenter"],
14
14
  _excluded2 = ["current", "pageSize"];
15
15
  import React, { useRef, useState, useEffect, useContext, useMemo, useImperativeHandle } from 'react';
16
16
  import ProTable from 'ls-pro-table';
@@ -79,8 +79,12 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
79
79
  triggerCheck = _prop$triggerCheck === void 0 ? 'entry' : _prop$triggerCheck,
80
80
  _prop$getPopupContain = prop.getPopupContainer,
81
81
  getPopupContainer = _prop$getPopupContain === void 0 ? function (triggerNode) {
82
- return document.body;
82
+ return triggerNode.parentNode.parentNode.parentNode.parentNode;
83
83
  } : _prop$getPopupContain,
84
+ _prop$placement = prop.placement,
85
+ placement = _prop$placement === void 0 ? 'bottom' : _prop$placement,
86
+ _prop$arrowPointAtCen = prop.arrowPointAtCenter,
87
+ arrowPointAtCenter = _prop$arrowPointAtCen === void 0 ? true : _prop$arrowPointAtCen,
84
88
  rest = _objectWithoutProperties(prop, _excluded); //显示输入框绑定的name,如果不设置textName,设置为$name__text
85
89
 
86
90
 
@@ -332,6 +336,20 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
332
336
  },
333
337
  headerTitle: "\u53CC\u51FB\u9009\u4E2D\u5F53\u524D\u884C\u6570\u636E"
334
338
  }, tableConfig));
339
+ useEffect(function () {
340
+ if (rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled)) return;
341
+
342
+ try {
343
+ var el = inputRef.current.clearableInput.containerRef.current.querySelector('.ant-input-clear-icon');
344
+ if (!el) return;
345
+
346
+ if (text) {
347
+ el.classList.remove('ant-input-clear-icon-hidden');
348
+ } else {
349
+ el.classList.add('ant-input-clear-icon-hidden');
350
+ }
351
+ } catch (e) {}
352
+ }, [text, rest, fieldProps]);
335
353
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
336
354
  style: {
337
355
  display: 'none'
@@ -353,7 +371,9 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
353
371
  trigger: "click",
354
372
  visible: rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) ? false : visible,
355
373
  onVisibleChange: setVisible,
356
- getPopupContainer: getPopupContainer
374
+ getPopupContainer: getPopupContainer,
375
+ placement: placement,
376
+ arrowPointAtCenter: arrowPointAtCenter
357
377
  }, /*#__PURE__*/React.createElement(MoreOutlined, {
358
378
  onClick: function onClick(e) {
359
379
  setVisible(true);
@@ -391,7 +411,9 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
391
411
  trigger: "click",
392
412
  visible: rest.disabled || (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.disabled) ? false : visible,
393
413
  onVisibleChange: setVisible,
394
- getPopupContainer: getPopupContainer
414
+ getPopupContainer: getPopupContainer,
415
+ placement: placement,
416
+ arrowPointAtCenter: arrowPointAtCenter
395
417
  }, /*#__PURE__*/React.createElement(MoreOutlined, {
396
418
  onClick: function onClick(e) {
397
419
  setVisible(true);