@bit-sun/business-component 1.1.37 → 1.2.0

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 (33) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +4 -4
  3. package/.gitlab-ci.yml +174 -174
  4. package/.prettierignore +7 -7
  5. package/.prettierrc +11 -11
  6. package/.umirc.ts +59 -28
  7. package/README.md +27 -27
  8. package/dist/index.esm.js +2525 -3854
  9. package/dist/index.js +2525 -3854
  10. package/dist/utils/CheckOneUser/index.d.ts +1 -1
  11. package/docs/index.md +21 -21
  12. package/package.json +50 -50
  13. package/src/components/Business/CommodityEntry/index.md +69 -69
  14. package/src/components/Business/CommodityEntry/index.tsx +75 -75
  15. package/src/components/Business/SearchSelect/BusinessUtils.ts +1365 -1148
  16. package/src/components/Business/SearchSelect/common.ts +34 -34
  17. package/src/components/Business/SearchSelect/index.md +1107 -1061
  18. package/src/components/Business/SearchSelect/index.tsx +43 -43
  19. package/src/components/Business/SearchSelect/utils.ts +74 -74
  20. package/src/components/Functional/DataValidation/index.less +63 -63
  21. package/src/components/Functional/DataValidation/index.md +38 -38
  22. package/src/components/Functional/DataValidation/index.tsx +672 -668
  23. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  24. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  25. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  26. package/src/components/Functional/SearchSelect/index.less +115 -115
  27. package/src/components/Functional/SearchSelect/index.md +141 -141
  28. package/src/components/Functional/SearchSelect/index.tsx +715 -714
  29. package/src/index.ts +21 -21
  30. package/src/utils/CheckOneUser/index.md +39 -39
  31. package/src/utils/CheckOneUser/index.ts +51 -51
  32. package/tsconfig.json +29 -29
  33. package/typings.d.ts +2 -2
@@ -1,2 +1,2 @@
1
- declare const _default: (storageKeyString: string, seconds?: number, tipsCallFunction?: () => {}) => void;
1
+ declare const _default: (storageKeyString: string, seconds?: number, tipsCallFunction?: (() => {}) | undefined) => void;
2
2
  export default _default;
package/docs/index.md CHANGED
@@ -1,21 +1,21 @@
1
- ---
2
- hero:
3
- title: business-component
4
- desc: business-component site example
5
- actions:
6
- - text: Getting Started
7
- link: /components
8
- features:
9
- - icon: https://gw.alipayobjects.com/zos/bmw-prod/881dc458-f20b-407b-947a-95104b5ec82b/k79dm8ih_w144_h144.png
10
- title: Feature 1
11
- desc: Balabala
12
- - icon: https://gw.alipayobjects.com/zos/bmw-prod/d60657df-0822-4631-9d7c-e7a869c2f21c/k79dmz3q_w126_h126.png
13
- title: Feature 2
14
- desc: Balabala
15
- - icon: https://gw.alipayobjects.com/zos/bmw-prod/d1ee0c6f-5aed-4a45-a507-339a4bfe076c/k7bjsocq_w144_h144.png
16
- title: Feature 3
17
- desc: Balabala
18
- footer: Open-source MIT Licensed | Copyright © 2020<br />Powered by [dumi](https://d.umijs.org)
19
- ---
20
-
21
- ## Hello business-component!
1
+ ---
2
+ hero:
3
+ title: business-component
4
+ desc: business-component site example
5
+ actions:
6
+ - text: Getting Started
7
+ link: /components
8
+ features:
9
+ - icon: https://gw.alipayobjects.com/zos/bmw-prod/881dc458-f20b-407b-947a-95104b5ec82b/k79dm8ih_w144_h144.png
10
+ title: Feature 1
11
+ desc: Balabala
12
+ - icon: https://gw.alipayobjects.com/zos/bmw-prod/d60657df-0822-4631-9d7c-e7a869c2f21c/k79dmz3q_w126_h126.png
13
+ title: Feature 2
14
+ desc: Balabala
15
+ - icon: https://gw.alipayobjects.com/zos/bmw-prod/d1ee0c6f-5aed-4a45-a507-339a4bfe076c/k7bjsocq_w144_h144.png
16
+ title: Feature 3
17
+ desc: Balabala
18
+ footer: Open-source MIT Licensed | Copyright © 2020<br />Powered by [dumi](https://d.umijs.org)
19
+ ---
20
+
21
+ ## Hello business-component!
package/package.json CHANGED
@@ -1,50 +1,50 @@
1
- {
2
- "name": "@bit-sun/business-component",
3
- "version": "1.1.37",
4
- "scripts": {
5
- "start": "dumi dev",
6
- "docs:build": "dumi build",
7
- "docs:deploy": "gh-pages -d docs-dist",
8
- "build": "father-build",
9
- "deploy": "npm run docs:build && npm run docs:deploy",
10
- "release": "npm run build && npm publish",
11
- "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
12
- "test": "umi-test",
13
- "test:coverage": "umi-test --coverage"
14
- },
15
- "main": "dist/index.js",
16
- "module": "dist/index.esm.js",
17
- "typings": "dist/index.d.ts",
18
- "gitHooks": {
19
- "pre-commit": "lint-staged"
20
- },
21
- "lint-staged": {
22
- "*.{js,jsx,less,md,json}": [
23
- "prettier --write"
24
- ],
25
- "*.ts?(x)": [
26
- "prettier --parser=typescript --write"
27
- ]
28
- },
29
- "dependencies": {
30
- "ahooks": "^3.1.2",
31
- "antd": "4.17.2",
32
- "axios": "^0.24.0",
33
- "classnames": "^2.3.1",
34
- "loadsh": "^0.0.4",
35
- "querystring": "^0.2.1",
36
- "react": "^16.12.0",
37
- "react-beautiful-dnd": "10.0.0"
38
- },
39
- "devDependencies": {
40
- "@umijs/test": "^3.0.5",
41
- "dumi": "^1.0.14",
42
- "father-build": "^1.17.2",
43
- "gh-pages": "^3.0.0",
44
- "lint-staged": "^10.0.7",
45
- "prettier": "^2.2.1"
46
- },
47
- "publishConfig": {
48
- "access": "public"
49
- }
50
- }
1
+ {
2
+ "name": "@bit-sun/business-component",
3
+ "version": "1.2.0",
4
+ "scripts": {
5
+ "start": "dumi dev",
6
+ "docs:build": "dumi build",
7
+ "docs:deploy": "gh-pages -d docs-dist",
8
+ "build": "father-build",
9
+ "deploy": "npm run docs:build && npm run docs:deploy",
10
+ "release": "npm run build && npm publish",
11
+ "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
12
+ "test": "umi-test",
13
+ "test:coverage": "umi-test --coverage"
14
+ },
15
+ "main": "dist/index.js",
16
+ "module": "dist/index.esm.js",
17
+ "typings": "dist/index.d.ts",
18
+ "gitHooks": {
19
+ "pre-commit": "lint-staged"
20
+ },
21
+ "lint-staged": {
22
+ "*.{js,jsx,less,md,json}": [
23
+ "prettier --write"
24
+ ],
25
+ "*.ts?(x)": [
26
+ "prettier --parser=typescript --write"
27
+ ]
28
+ },
29
+ "dependencies": {
30
+ "ahooks": "^3.1.2",
31
+ "antd": "4.17.2",
32
+ "axios": "^0.24.0",
33
+ "classnames": "^2.3.1",
34
+ "loadsh": "^0.0.4",
35
+ "querystring": "^0.2.1",
36
+ "react": "^16.12.0",
37
+ "react-beautiful-dnd": "10.0.0"
38
+ },
39
+ "devDependencies": {
40
+ "@umijs/test": "^3.0.5",
41
+ "dumi": "^1.0.14",
42
+ "father-build": "^1.17.2",
43
+ "gh-pages": "^3.0.0",
44
+ "lint-staged": "^10.0.7",
45
+ "prettier": "^2.2.1"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ }
50
+ }
@@ -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
- alert('关闭弹窗处理函数回调,可以处理刷新表格等操作(非必传)')
25
- }
26
-
27
- const callbackHandleOk = (resultData, callback) => {
28
- alert('确定操作,可获取到成功录入的商品,做一系列操作')
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
+ alert('关闭弹窗处理函数回调,可以处理刷新表格等操作(非必传)')
25
+ }
26
+
27
+ const callbackHandleOk = (resultData, callback) => {
28
+ alert('确定操作,可获取到成功录入的商品,做一系列操作')
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,75 +1,75 @@
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
- callbackHideModal,
13
- callbackHandleOk,
14
- columns=["skuCode", "quantity", "price"],
15
- validDataUrl="/bop/api/recordDetailImport/check"
16
- } = props;
17
-
18
- const [modalProps, setModalProps]: any = useState({
19
- maskClosable: false,
20
- width: 800,
21
- visible: false,
22
- title: modalTitle,
23
- okText: '确定',
24
- cancelText: '取消',
25
- hideModal: () => {
26
- setModalProps(() => ({ ...modalProps, visible: false }));
27
- callbackHideModal && callbackHideModal()
28
- },
29
- });
30
-
31
- const handleOk = () => {
32
- // 方法获取当前组件内部的数据,然后进行自身的业务操作
33
- const resultData = dataValidationRef.getValidateData();
34
-
35
- if (!resultData.successData.length) {
36
- message.error("无校验通过数据,请校验数据");
37
- return;
38
- }
39
-
40
- if (resultData.failData.length) {
41
- message.error(`有${resultData.failData.length}条校验失败数据`);
42
- return;
43
- }
44
-
45
- callbackHandleOk(resultData, () => {
46
- modalProps.hideModal()
47
- })
48
-
49
- }
50
-
51
- const handleShowModal = () => {
52
- setModalProps({ ...modalProps, visible: true})
53
- }
54
-
55
- const handleCancel = () => {
56
- modalProps.hideModal()
57
- }
58
-
59
- return (
60
- <div>
61
- <Button onClick={handleShowModal}>{buttonName}</Button>
62
- {modalProps.visible && (
63
- <Modal {...modalProps} onOk={handleOk} onCancel={handleCancel} destroyOnClose={true} zIndex={15}>
64
- <DataValidation
65
- onRef={(ref) => { dataValidationRef = ref }}
66
- columns={columns}
67
- validDataUrl={validDataUrl}
68
- />
69
- </Modal>
70
- ) || ''}
71
- </div>
72
- );
73
- };
74
-
75
- 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
+ callbackHideModal,
13
+ callbackHandleOk,
14
+ columns=["skuCode", "quantity", "price"],
15
+ validDataUrl="/bop/api/recordDetailImport/check"
16
+ } = props;
17
+
18
+ const [modalProps, setModalProps]: any = useState({
19
+ maskClosable: false,
20
+ width: 800,
21
+ visible: false,
22
+ title: modalTitle,
23
+ okText: '确定',
24
+ cancelText: '取消',
25
+ hideModal: () => {
26
+ setModalProps(() => ({ ...modalProps, visible: false }));
27
+ callbackHideModal && callbackHideModal()
28
+ },
29
+ });
30
+
31
+ const handleOk = () => {
32
+ // 方法获取当前组件内部的数据,然后进行自身的业务操作
33
+ const resultData = dataValidationRef.getValidateData();
34
+
35
+ if (!resultData.successData.length) {
36
+ message.error("无校验通过数据,请校验数据");
37
+ return;
38
+ }
39
+
40
+ if (resultData.failData.length) {
41
+ message.error(`有${resultData.failData.length}条校验失败数据`);
42
+ return;
43
+ }
44
+
45
+ callbackHandleOk(resultData, () => {
46
+ modalProps.hideModal()
47
+ })
48
+
49
+ }
50
+
51
+ const handleShowModal = () => {
52
+ setModalProps({ ...modalProps, visible: true})
53
+ }
54
+
55
+ const handleCancel = () => {
56
+ modalProps.hideModal()
57
+ }
58
+
59
+ return (
60
+ <div>
61
+ <Button onClick={handleShowModal}>{buttonName}</Button>
62
+ {modalProps.visible && (
63
+ <Modal {...modalProps} onOk={handleOk} onCancel={handleCancel} destroyOnClose={true} zIndex={15}>
64
+ <DataValidation
65
+ onRef={(ref) => { dataValidationRef = ref }}
66
+ columns={columns}
67
+ validDataUrl={validDataUrl}
68
+ />
69
+ </Modal>
70
+ ) || ''}
71
+ </div>
72
+ );
73
+ };
74
+
75
+ export default CommodityEntry;