@bit-sun/business-component 2.0.12 → 2.0.13

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 (68) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +4 -4
  3. package/.gitlab-ci.yml +174 -135
  4. package/.prettierignore +7 -7
  5. package/.prettierrc +11 -11
  6. package/.umirc.ts +74 -90
  7. package/README.md +27 -27
  8. package/dist/components/Business/SearchSelect/index.d.ts +1 -1
  9. package/dist/components/Functional/SearchSelect/index.d.ts +1 -2
  10. package/dist/index.d.ts +0 -1
  11. package/dist/index.esm.js +6794 -7350
  12. package/dist/index.js +6793 -7348
  13. package/docs/index.md +21 -21
  14. package/package.json +51 -60
  15. package/src/components/Business/AddSelectBusiness/index.md +41 -41
  16. package/src/components/Business/AddSelectBusiness/index.tsx +288 -300
  17. package/src/components/Business/CommodityEntry/index.md +69 -69
  18. package/src/components/Business/CommodityEntry/index.tsx +78 -78
  19. package/src/components/Business/SearchSelect/BusinessUtils.ts +1445 -1445
  20. package/src/components/Business/SearchSelect/common.ts +53 -53
  21. package/src/components/Business/SearchSelect/index.md +1137 -1136
  22. package/src/components/Business/SearchSelect/index.tsx +44 -49
  23. package/src/components/Business/SearchSelect/utils.ts +99 -99
  24. package/src/components/Business/TreeSearchSelect/index.md +126 -126
  25. package/src/components/Business/TreeSearchSelect/index.tsx +34 -34
  26. package/src/components/Business/TreeSearchSelect/utils.ts +60 -60
  27. package/src/components/Functional/AddSelect/index.less +367 -352
  28. package/src/components/Functional/AddSelect/index.md +120 -120
  29. package/src/components/Functional/AddSelect/index.tsx +952 -896
  30. package/src/components/Functional/BillEntry/index.less +371 -371
  31. package/src/components/Functional/BillEntry/index.md +37 -37
  32. package/src/components/Functional/BillEntry/index.tsx +547 -561
  33. package/src/components/Functional/DataImport/index.less +63 -63
  34. package/src/components/Functional/DataImport/index.md +44 -44
  35. package/src/components/Functional/DataImport/index.tsx +689 -689
  36. package/src/components/Functional/DataValidation/index.less +63 -63
  37. package/src/components/Functional/DataValidation/index.md +38 -38
  38. package/src/components/Functional/DataValidation/index.tsx +680 -680
  39. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  40. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  41. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  42. package/src/components/Functional/SearchSelect/index.less +115 -115
  43. package/src/components/Functional/SearchSelect/index.md +141 -141
  44. package/src/components/Functional/SearchSelect/index.tsx +732 -791
  45. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  46. package/src/components/Functional/TreeSearchSelect/index.tsx +149 -149
  47. package/src/index.ts +22 -22
  48. package/src/utils/CheckOneUser/index.md +39 -39
  49. package/src/utils/CheckOneUser/index.ts +51 -51
  50. package/src/utils/requestUtils.ts +32 -32
  51. package/tsconfig.json +29 -29
  52. package/typings.d.ts +2 -2
  53. package/Dockerfile +0 -11
  54. package/dist/app.d.ts +0 -0
  55. package/dist/components/sulaQueryTable/BsSulaQueryTable.d.ts +0 -2
  56. package/dist/components/sulaQueryTable/draggableTable.d.ts +0 -22
  57. package/dist/components/sulaQueryTable/statusComponent.d.ts +0 -2
  58. package/dist/components/sulaQueryTable/utils.d.ts +0 -41
  59. package/nginx.conf +0 -43
  60. package/src/app.tsx +0 -3
  61. package/src/components/sulaQueryTable/BsSulaQueryTable.tsx +0 -368
  62. package/src/components/sulaQueryTable/draggableTable.tsx +0 -111
  63. package/src/components/sulaQueryTable/index.md +0 -271
  64. package/src/components/sulaQueryTable/status-component.less +0 -8
  65. package/src/components/sulaQueryTable/statusComponent.tsx +0 -42
  66. package/src/components/sulaQueryTable/utils.less +0 -48
  67. package/src/components/sulaQueryTable/utils.tsx +0 -336
  68. package/src/global.less +0 -97
@@ -1,69 +1,69 @@
1
- ---
2
- nav:
3
- title: '组件'
4
- order: 1
5
- group:
6
- title: 业务组件
7
- order: 1
8
- title: 商品录入器
9
- order: 0
10
- ---
11
-
12
- # CommodityEntry
13
-
14
- ## 商品录入器
15
-
16
- ```tsx
17
- import React, { useState } from 'react';
18
- import { CommodityEntry } from '../../../index';
19
-
20
- export default () => {
21
- const [choosedSku, setChoosedSku] = useState([]);
22
-
23
- const callbackHideModal = () => {
24
- console.log('关闭弹窗处理函数回调,可以处理刷新表格等操作(非必传)')
25
- }
26
-
27
- const callbackHandleOk = (resultData, callback) => {
28
- console.log('确定操作,可获取到成功录入的商品,做一系列操作')
29
- console.log(resultData)
30
- // 一般拿到导入数据是做请求接口操作
31
- // import {request} from "bssula";
32
- // request({
33
- // url: `/bop/api/sku/import/save`,
34
- // method: "POST",
35
- // successMessage: "操作成功",
36
- // convertParams: () => {
37
- // const targetData = resultData.successData;
38
- // return {
39
- // columns: ['skuCode', 'quantity', 'price'],
40
- // data: targetData
41
- // };
42
- // },
43
- // converter: () => {
44
- // props.hideModal()
45
- // },
46
- // });
47
-
48
- // 示例处理
49
- setChoosedSku(resultData.successData.map((i: any) => i.skuCode))
50
-
51
- callback()
52
- }
53
-
54
- const props = {
55
- callbackHideModal,
56
- callbackHandleOk
57
- }
58
-
59
- return (
60
- <div>
61
- <CommodityEntry {...props} />
62
- <br />
63
- <div>已录入sku有:{choosedSku.join(',')}</div>
64
- </div>
65
- );
66
- };
67
- ```
68
-
69
- More skills for writing demo: https://d.umijs.org/guide/demo-principle
1
+ ---
2
+ nav:
3
+ title: '组件'
4
+ order: 1
5
+ group:
6
+ title: 业务组件
7
+ order: 1
8
+ title: 商品录入器
9
+ order: 0
10
+ ---
11
+
12
+ # CommodityEntry
13
+
14
+ ## 商品录入器
15
+
16
+ ```tsx
17
+ import React, { useState } from 'react';
18
+ import { CommodityEntry } from '../../../index';
19
+
20
+ export default () => {
21
+ const [choosedSku, setChoosedSku] = useState([]);
22
+
23
+ const callbackHideModal = () => {
24
+ console.log('关闭弹窗处理函数回调,可以处理刷新表格等操作(非必传)')
25
+ }
26
+
27
+ const callbackHandleOk = (resultData, callback) => {
28
+ console.log('确定操作,可获取到成功录入的商品,做一系列操作')
29
+ console.log(resultData)
30
+ // 一般拿到导入数据是做请求接口操作
31
+ // import {request} from "bssula";
32
+ // request({
33
+ // url: `/bop/api/sku/import/save`,
34
+ // method: "POST",
35
+ // successMessage: "操作成功",
36
+ // convertParams: () => {
37
+ // const targetData = resultData.successData;
38
+ // return {
39
+ // columns: ['skuCode', 'quantity', 'price'],
40
+ // data: targetData
41
+ // };
42
+ // },
43
+ // converter: () => {
44
+ // props.hideModal()
45
+ // },
46
+ // });
47
+
48
+ // 示例处理
49
+ setChoosedSku(resultData.successData.map((i: any) => i.skuCode))
50
+
51
+ callback()
52
+ }
53
+
54
+ const props = {
55
+ callbackHideModal,
56
+ callbackHandleOk
57
+ }
58
+
59
+ return (
60
+ <div>
61
+ <CommodityEntry {...props} />
62
+ <br />
63
+ <div>已录入sku有:{choosedSku.join(',')}</div>
64
+ </div>
65
+ );
66
+ };
67
+ ```
68
+
69
+ More skills for writing demo: https://d.umijs.org/guide/demo-principle
@@ -1,78 +1,78 @@
1
- // @ts-nocheck
2
- import React, { useRef, useState } from 'react';
3
- import { Modal, Button, message } from 'antd';
4
- import DataValidation from '@/components/Functional/DataValidation';
5
-
6
- const CommodityEntry = (props: any) => {
7
- let dataValidationRef: DataValidation = useRef();
8
-
9
- const {
10
- buttonName=' + 录入商品',
11
- modalTitle = '录入商品',
12
- buttonProps = {},
13
- callbackHideModal,
14
- callbackHandleOk,
15
- columns=["skuCode", "quantity", "price"],
16
- validDataUrl="/items/sku/import/check",
17
- isBrandAuth = true // 默认做品牌过滤
18
- } = props;
19
-
20
- const [modalProps, setModalProps]: any = useState({
21
- maskClosable: false,
22
- width: 800,
23
- visible: false,
24
- title: modalTitle,
25
- okText: '确定',
26
- cancelText: '取消',
27
- hideModal: () => {
28
- setModalProps(() => ({ ...modalProps, visible: false }));
29
- callbackHideModal && callbackHideModal()
30
- },
31
- });
32
-
33
- const handleOk = () => {
34
- // 方法获取当前组件内部的数据,然后进行自身的业务操作
35
- const resultData = dataValidationRef.getValidateData();
36
-
37
- if (!resultData.successData.length) {
38
- message.error("无校验通过数据,请校验数据");
39
- return;
40
- }
41
-
42
- if (resultData.failData.length) {
43
- message.error(`有${resultData.failData.length}条校验失败数据`);
44
- return;
45
- }
46
-
47
- callbackHandleOk(resultData, () => {
48
- modalProps.hideModal()
49
- })
50
-
51
- }
52
-
53
- const handleShowModal = () => {
54
- setModalProps({ ...modalProps, visible: true})
55
- }
56
-
57
- const handleCancel = () => {
58
- modalProps.hideModal()
59
- }
60
-
61
- return (
62
- <div>
63
- <Button onClick={handleShowModal} {...buttonProps}>{buttonName}</Button>
64
- {modalProps.visible && (
65
- <Modal {...modalProps} onOk={handleOk} onCancel={handleCancel} destroyOnClose={true} zIndex={15}>
66
- <DataValidation
67
- onRef={(ref) => { dataValidationRef = ref }}
68
- columns={columns}
69
- validDataUrl={validDataUrl}
70
- isBrandAuth={isBrandAuth}
71
- />
72
- </Modal>
73
- ) || ''}
74
- </div>
75
- );
76
- };
77
-
78
- export default CommodityEntry;
1
+ // @ts-nocheck
2
+ import React, { useRef, useState } from 'react';
3
+ import { Modal, Button, message } from 'antd';
4
+ import DataValidation from '@/components/Functional/DataValidation';
5
+
6
+ const CommodityEntry = (props: any) => {
7
+ let dataValidationRef: DataValidation = useRef();
8
+
9
+ const {
10
+ buttonName=' + 录入商品',
11
+ modalTitle = '录入商品',
12
+ buttonProps = {},
13
+ callbackHideModal,
14
+ callbackHandleOk,
15
+ columns=["skuCode", "quantity", "price"],
16
+ validDataUrl="/items/sku/import/check",
17
+ isBrandAuth = true // 默认做品牌过滤
18
+ } = props;
19
+
20
+ const [modalProps, setModalProps]: any = useState({
21
+ maskClosable: false,
22
+ width: 800,
23
+ visible: false,
24
+ title: modalTitle,
25
+ okText: '确定',
26
+ cancelText: '取消',
27
+ hideModal: () => {
28
+ setModalProps(() => ({ ...modalProps, visible: false }));
29
+ callbackHideModal && callbackHideModal()
30
+ },
31
+ });
32
+
33
+ const handleOk = () => {
34
+ // 方法获取当前组件内部的数据,然后进行自身的业务操作
35
+ const resultData = dataValidationRef.getValidateData();
36
+
37
+ if (!resultData.successData.length) {
38
+ message.error("无校验通过数据,请校验数据");
39
+ return;
40
+ }
41
+
42
+ if (resultData.failData.length) {
43
+ message.error(`有${resultData.failData.length}条校验失败数据`);
44
+ return;
45
+ }
46
+
47
+ callbackHandleOk(resultData, () => {
48
+ modalProps.hideModal()
49
+ })
50
+
51
+ }
52
+
53
+ const handleShowModal = () => {
54
+ setModalProps({ ...modalProps, visible: true})
55
+ }
56
+
57
+ const handleCancel = () => {
58
+ modalProps.hideModal()
59
+ }
60
+
61
+ return (
62
+ <div>
63
+ <Button onClick={handleShowModal} {...buttonProps}>{buttonName}</Button>
64
+ {modalProps.visible && (
65
+ <Modal {...modalProps} onOk={handleOk} onCancel={handleCancel} destroyOnClose={true} zIndex={15}>
66
+ <DataValidation
67
+ onRef={(ref) => { dataValidationRef = ref }}
68
+ columns={columns}
69
+ validDataUrl={validDataUrl}
70
+ isBrandAuth={isBrandAuth}
71
+ />
72
+ </Modal>
73
+ ) || ''}
74
+ </div>
75
+ );
76
+ };
77
+
78
+ export default CommodityEntry;