ztxkui 4.2.23-113 → 4.2.23-115

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 (113) hide show
  1. package/README.md +57 -57
  2. package/dist/DemoCom/PrintContainerDemo.js +4 -8
  3. package/dist/TableDemo/index.js +4 -0
  4. package/dist/UI/ChatRoom/index.d.ts +3 -0
  5. package/dist/UI/ChatRoom/index.js +5 -0
  6. package/dist/UI/OCRCom/CommonOcr.d.ts +2 -0
  7. package/dist/UI/OCRCom/CommonOcr.js +34 -0
  8. package/dist/UI/OCRCom/UserOcr.d.ts +2 -0
  9. package/dist/UI/OCRCom/UserOcr.js +39 -0
  10. package/dist/UI/OCRCom/index.d.ts +2 -0
  11. package/dist/UI/OCRCom/index.js +34 -0
  12. package/dist/UI/index.js +17 -1
  13. package/dist/components/Button/button.d.ts +2 -0
  14. package/dist/components/Button/button.js +66 -4
  15. package/dist/components/ChatRoom/components/AntModal.d.ts +8 -0
  16. package/dist/components/ChatRoom/components/AntModal.js +80 -0
  17. package/dist/components/ChatRoom/components/ModalRoom.d.ts +7 -0
  18. package/dist/components/ChatRoom/components/ModalRoom.js +103 -0
  19. package/dist/components/ChatRoom/components/RoomItem.d.ts +6 -0
  20. package/dist/components/ChatRoom/components/RoomItem.js +15 -0
  21. package/dist/components/ChatRoom/components/index.d.ts +3 -0
  22. package/dist/components/ChatRoom/components/index.js +3 -0
  23. package/dist/components/ChatRoom/index.d.ts +6 -0
  24. package/dist/components/ChatRoom/index.js +29 -0
  25. package/dist/components/ChatRoom/utils.d.ts +4 -0
  26. package/dist/components/ChatRoom/utils.js +7 -0
  27. package/dist/components/OCR_COM/Camera/Container.d.ts +4 -0
  28. package/dist/components/OCR_COM/Camera/Container.js +40 -0
  29. package/dist/components/OCR_COM/Camera/Item.d.ts +7 -0
  30. package/dist/components/OCR_COM/Camera/Item.js +10 -0
  31. package/dist/components/OCR_COM/Camera/camera.d.ts +61 -0
  32. package/dist/components/OCR_COM/Camera/camera.js +166 -0
  33. package/dist/components/OCR_COM/Camera/cameraUtils.d.ts +10 -0
  34. package/dist/components/OCR_COM/Camera/cameraUtils.js +109 -0
  35. package/dist/components/OCR_COM/Camera/constants.d.ts +3 -0
  36. package/dist/components/OCR_COM/Camera/constants.js +3 -0
  37. package/dist/components/OCR_COM/Camera/hooks.d.ts +20 -0
  38. package/dist/components/OCR_COM/Camera/hooks.js +129 -0
  39. package/dist/components/OCR_COM/Camera/index.d.ts +11 -0
  40. package/dist/components/OCR_COM/Camera/index.js +38 -0
  41. package/dist/components/OCR_COM/Camera/wsCamera.d.ts +22 -0
  42. package/dist/components/OCR_COM/Camera/wsCamera.js +456 -0
  43. package/dist/components/OCR_COM/canvasUtils.d.ts +11 -0
  44. package/dist/components/OCR_COM/canvasUtils.js +31 -0
  45. package/dist/components/OCR_COM/components/OperationContainer.d.ts +9 -0
  46. package/dist/components/OCR_COM/components/OperationContainer.js +9 -0
  47. package/dist/components/OCR_COM/components/PaginationOcr.d.ts +9 -0
  48. package/dist/components/OCR_COM/components/PaginationOcr.js +10 -0
  49. package/dist/components/OCR_COM/components/Placeholder.d.ts +3 -0
  50. package/dist/components/OCR_COM/components/Placeholder.js +12 -0
  51. package/dist/components/OCR_COM/components/RectifyImg.d.ts +2 -0
  52. package/dist/components/OCR_COM/components/RectifyImg.js +97 -0
  53. package/dist/components/OCR_COM/components/SettingOcr.d.ts +12 -0
  54. package/dist/components/OCR_COM/components/SettingOcr.js +223 -0
  55. package/dist/components/OCR_COM/components/UploadOcr.d.ts +8 -0
  56. package/dist/components/OCR_COM/components/UploadOcr.js +99 -0
  57. package/dist/components/OCR_COM/components/UserList.d.ts +36 -0
  58. package/dist/components/OCR_COM/components/UserList.js +59 -0
  59. package/dist/components/OCR_COM/components/UserOcr.d.ts +14 -0
  60. package/dist/components/OCR_COM/components/UserOcr.js +86 -0
  61. package/dist/components/OCR_COM/components/UserOcrTable.d.ts +14 -0
  62. package/dist/components/OCR_COM/components/UserOcrTable.js +120 -0
  63. package/dist/components/OCR_COM/components/index.d.ts +8 -0
  64. package/dist/components/OCR_COM/components/index.js +8 -0
  65. package/dist/components/OCR_COM/constants.d.ts +1 -0
  66. package/dist/components/OCR_COM/constants.js +2 -0
  67. package/dist/components/OCR_COM/hooks/index.d.ts +12 -0
  68. package/dist/components/OCR_COM/hooks/index.js +12 -0
  69. package/dist/components/OCR_COM/hooks/useCamera.d.ts +2 -0
  70. package/dist/components/OCR_COM/hooks/useCamera.js +5 -0
  71. package/dist/components/OCR_COM/hooks/useDictionary.d.ts +11 -0
  72. package/dist/components/OCR_COM/hooks/useDictionary.js +56 -0
  73. package/dist/components/OCR_COM/hooks/useDrawImgFile.d.ts +28 -0
  74. package/dist/components/OCR_COM/hooks/useDrawImgFile.js +208 -0
  75. package/dist/components/OCR_COM/hooks/useFiles.d.ts +14 -0
  76. package/dist/components/OCR_COM/hooks/useFiles.js +57 -0
  77. package/dist/components/OCR_COM/hooks/useLoading.d.ts +8 -0
  78. package/dist/components/OCR_COM/hooks/useLoading.js +12 -0
  79. package/dist/components/OCR_COM/hooks/useOcrIdentify.d.ts +8 -0
  80. package/dist/components/OCR_COM/hooks/useOcrIdentify.js +42 -0
  81. package/dist/components/OCR_COM/hooks/usePrevious.d.ts +3 -0
  82. package/dist/components/OCR_COM/hooks/usePrevious.js +12 -0
  83. package/dist/components/OCR_COM/hooks/useRectify.d.ts +13 -0
  84. package/dist/components/OCR_COM/hooks/useRectify.js +173 -0
  85. package/dist/components/OCR_COM/hooks/useRectifyServer.d.ts +6 -0
  86. package/dist/components/OCR_COM/hooks/useRectifyServer.js +68 -0
  87. package/dist/components/OCR_COM/hooks/useSetting.d.ts +27 -0
  88. package/dist/components/OCR_COM/hooks/useSetting.js +277 -0
  89. package/dist/components/OCR_COM/hooks/useUser.d.ts +14 -0
  90. package/dist/components/OCR_COM/hooks/useUser.js +110 -0
  91. package/dist/components/OCR_COM/hooks/useUserClickItem.d.ts +7 -0
  92. package/dist/components/OCR_COM/hooks/useUserClickItem.js +35 -0
  93. package/dist/components/OCR_COM/hooks/useUserClickRow.d.ts +7 -0
  94. package/dist/components/OCR_COM/hooks/useUserClickRow.js +38 -0
  95. package/dist/components/OCR_COM/index.d.ts +30 -0
  96. package/dist/components/OCR_COM/index.js +120 -0
  97. package/dist/components/OCR_COM/utils.d.ts +10 -0
  98. package/dist/components/OCR_COM/utils.js +73 -0
  99. package/dist/components/PrintContainer/kkJSBridge.d.ts +20 -0
  100. package/dist/components/PrintContainer/kkJSBridge.js +87 -0
  101. package/dist/components/PrintContainer/print-container.js +2 -0
  102. package/dist/components/PrintContainer/service.d.ts +3 -0
  103. package/dist/components/PrintContainer/service.js +181 -22
  104. package/dist/components/ProTable/hooks.js +7 -0
  105. package/dist/components/Table/hooks/useColumns.d.ts +1 -0
  106. package/dist/components/Table/hooks/useColumns.js +7 -4
  107. package/dist/components/Table/table.d.ts +2 -0
  108. package/dist/components/Table/table.js +8 -7
  109. package/dist/constants.d.ts +1 -1
  110. package/dist/constants.js +1 -1
  111. package/dist/index.css +267 -0
  112. package/dist/index.css.map +1 -1
  113. package/package.json +2 -2
package/README.md CHANGED
@@ -1,57 +1,57 @@
1
- # 前端ui库
2
-
3
- ## 关于 typescript 相关配置说明
4
-
5
- _[tsconfig.json](https://www.tslang.cn/docs/handbook/tsconfig-json.html) 如果一个目录下存在一个 tsconfig.json 文件,那么它意味着这个目录是 TypeScript 项目的根目录。tsconfig.json 文件中指定了用来编译这个项目的根文件和编译选现_
6
-
7
- - compilerOptions 可以忽略,如果忽略 会使用默认值
8
- - outDir 指定的目录下的文件永远会被编译器排除,除非使用 files 包含
9
- - typeRoots 默认所有可见的 @types 包会在编译过程中被包含进来,如果指定了这个配置 只有他下面的包才会被包含进来
10
-
11
- * files 指定一个包含相对或绝对文件路径的列表,优先级最高
12
- * include 需要编译的文件 优先级最低
13
- * exclude 不需要编译的文件 优先级中等
14
- * extends 继承配置 继承的文件会覆盖源文件
15
-
16
- _[eslint](https://eslint.bootcss.com/docs/user-guide/getting-started)ESLint 是在 ECMAScript/JavaScript 代码中识别和报告模式匹配的工具,它的目标是保证代码的一致性和避免错误_
17
-
18
- - parser 解析器(eslint 默认使用 Espree 作为其解析器)
19
- - parserOptions 解析器配置选项
20
- - env 和 globals 环境和全局变量
21
-
22
- * rules 规则(off 或 0,关闭规则;warn 或 1,开启规则;error 或 2,开启规则,并会出错阻止代码运行)
23
- - semi 是否使用分号(当前不使用 错误级别 1)
24
- - no-trailing-spaces 禁止行尾空格
25
- - array-bracket-spacing 强制数组括号内的空格一致
26
- - operator-linebreak 强制操作符使用一致的换行符
27
- - function-paren-newline 强制函数括号内使用一致的换行
28
- * no-magic-numbers 禁止使用魔术数字
29
- - ignoreArrayIndexes 数字可否作为数组的索引
30
- - block-spacing 禁止或强制在代码块中开括号前和闭括号后有空格
31
- - brace-style 大括号风格要求
32
- - no-multiple-empty-lines 最大换行数
33
- - object-curly-spacing 强制在花括号中使用一致的空格
34
- * comma-spacing 强制在逗号周围使用空格
35
- - before false 禁止逗号前使用空格
36
- - after true 要求逗号后使用一个或多个空格
37
- * keyword-spacing 强制关键字周围空格的一致性
38
- - before true (默认) 要求在关键字之前至少有一个空格
39
- - after true (默认) 要求在关键字之后至少有一个空格
40
- * comma-style 逗号风格
41
- - last (默认) 要求逗号放在数组元素、对象属性或变量声明之后,且在同一行
42
- - no-multi-spaces 禁止出现多个空格
43
-
44
- - plugins 插件(插件可以提供处理器 配置在 processor 中 通过 pluginName/parserName)
45
- - overrides 为特定类型的文件指定处理器,请使用 overrides 和 processor 的组合
46
- - extends 拓展 一个配置文件可以被基础配置中的已启用的规则继承
47
- - settings 提供给每一个将被执行的规则
48
- - root 如果为 true 则项目中的 eslint 规则 在根目录中找
49
-
50
- ## 本地调试
51
-
52
- ```json
53
- "peerDependencies": {
54
- "react": ">=16.9.0",
55
- "react-dom": ">=16.9.0"
56
- }
57
- ```
1
+ # 前端ui库
2
+
3
+ ## 关于 typescript 相关配置说明
4
+
5
+ _[tsconfig.json](https://www.tslang.cn/docs/handbook/tsconfig-json.html) 如果一个目录下存在一个 tsconfig.json 文件,那么它意味着这个目录是 TypeScript 项目的根目录。tsconfig.json 文件中指定了用来编译这个项目的根文件和编译选现_
6
+
7
+ - compilerOptions 可以忽略,如果忽略 会使用默认值
8
+ - outDir 指定的目录下的文件永远会被编译器排除,除非使用 files 包含
9
+ - typeRoots 默认所有可见的 @types 包会在编译过程中被包含进来,如果指定了这个配置 只有他下面的包才会被包含进来
10
+
11
+ * files 指定一个包含相对或绝对文件路径的列表,优先级最高
12
+ * include 需要编译的文件 优先级最低
13
+ * exclude 不需要编译的文件 优先级中等
14
+ * extends 继承配置 继承的文件会覆盖源文件
15
+
16
+ _[eslint](https://eslint.bootcss.com/docs/user-guide/getting-started)ESLint 是在 ECMAScript/JavaScript 代码中识别和报告模式匹配的工具,它的目标是保证代码的一致性和避免错误_
17
+
18
+ - parser 解析器(eslint 默认使用 Espree 作为其解析器)
19
+ - parserOptions 解析器配置选项
20
+ - env 和 globals 环境和全局变量
21
+
22
+ * rules 规则(off 或 0,关闭规则;warn 或 1,开启规则;error 或 2,开启规则,并会出错阻止代码运行)
23
+ - semi 是否使用分号(当前不使用 错误级别 1)
24
+ - no-trailing-spaces 禁止行尾空格
25
+ - array-bracket-spacing 强制数组括号内的空格一致
26
+ - operator-linebreak 强制操作符使用一致的换行符
27
+ - function-paren-newline 强制函数括号内使用一致的换行
28
+ * no-magic-numbers 禁止使用魔术数字
29
+ - ignoreArrayIndexes 数字可否作为数组的索引
30
+ - block-spacing 禁止或强制在代码块中开括号前和闭括号后有空格
31
+ - brace-style 大括号风格要求
32
+ - no-multiple-empty-lines 最大换行数
33
+ - object-curly-spacing 强制在花括号中使用一致的空格
34
+ * comma-spacing 强制在逗号周围使用空格
35
+ - before false 禁止逗号前使用空格
36
+ - after true 要求逗号后使用一个或多个空格
37
+ * keyword-spacing 强制关键字周围空格的一致性
38
+ - before true (默认) 要求在关键字之前至少有一个空格
39
+ - after true (默认) 要求在关键字之后至少有一个空格
40
+ * comma-style 逗号风格
41
+ - last (默认) 要求逗号放在数组元素、对象属性或变量声明之后,且在同一行
42
+ - no-multi-spaces 禁止出现多个空格
43
+
44
+ - plugins 插件(插件可以提供处理器 配置在 processor 中 通过 pluginName/parserName)
45
+ - overrides 为特定类型的文件指定处理器,请使用 overrides 和 processor 的组合
46
+ - extends 拓展 一个配置文件可以被基础配置中的已启用的规则继承
47
+ - settings 提供给每一个将被执行的规则
48
+ - root 如果为 true 则项目中的 eslint 规则 在根目录中找
49
+
50
+ ## 本地调试
51
+
52
+ ```json
53
+ "peerDependencies": {
54
+ "react": ">=16.9.0",
55
+ "react-dom": ">=16.9.0"
56
+ }
57
+ ```
@@ -44,7 +44,7 @@ import { token } from '../constants';
44
44
  import Tidan from './tidan';
45
45
  function request(options) {
46
46
  var headers = options.headers, restOptions = __rest(options, ["headers"]);
47
- return axios(__assign({ baseURL: options.baseURL ? options.baseURL : 'http://192.168.0.83:8000', url: options.url, headers: __assign({ 'Zmdms-Auth': "bearer " + token }, options.headers), method: options.method, data: options.data, params: options.params }, restOptions));
47
+ return axios(__assign({ baseURL: options.baseURL ? options.baseURL : 'http://172.55.5.101:33015/', url: options.url, headers: __assign({ 'Zmdms-Auth': "bearer " + token }, options.headers), method: options.method, data: options.data, params: options.params }, restOptions));
48
48
  }
49
49
  // const sealIdList = ['2980019783467188885', '2982231505305256230'];
50
50
  // const keywordList = ['测试一', '测试四'];
@@ -96,7 +96,7 @@ var PrintContainerDemo = function () {
96
96
  useEffect(function () {
97
97
  var image = new Image();
98
98
  image.setAttribute('crossOrigin', 'anonymous');
99
- image.src = createDownloadUrl('http://192.168.0.83:8000', '1559472632642387969');
99
+ image.src = createDownloadUrl('http://172.55.5.101:33015/', '1559472632642387969');
100
100
  image.onload = function () {
101
101
  var canvas = document.createElement('canvas');
102
102
  canvas.width = image.width;
@@ -113,17 +113,13 @@ var PrintContainerDemo = function () {
113
113
  , {
114
114
  // isAddExportPage={true}
115
115
  // loading={loading}
116
- request: request,
117
- // deptId="1295909543961944065"
118
- // flowId="scm_order_contract_cght"
119
- // fileId="1551733945007517697"
116
+ request: request, deptId: "1514842376723976194", flowId: "scm_print_thd", fileId: "1551733945007517697",
120
117
  // // keywordList={keywordList}
121
118
  // imgWaterBg={water}
122
119
  // isSetPosition={false}
123
120
  // showPrintMessage
124
121
  // showAddSeal
125
- apiUrl: "http://192.168.0.83:8000",
126
- // fileBaseUrl="http://192.168.0.83:88"
122
+ isPhone: true, pdfName: "test", apiUrl: "http://172.55.5.101:33015", fileBaseUrl: "http://172.55.5.101:33015",
127
123
  // showAboutExport
128
124
  // aboutExportIds="7476520567474487367,7476520567474487365,7476520567474487366"
129
125
  // aboutExportZipName="测试zip包"
@@ -9,6 +9,10 @@ import React from 'react';
9
9
  // store
10
10
  // 自定义组件
11
11
  import BasicTable from './BasicTable';
12
+ // import EditableTable from './EditableTable';
13
+ // import ModalTable from './ModalTable';
14
+ // import VirtualTable from './VirtualTable';
15
+ // import ElseTable from './ElseTable';
12
16
  // 其他文件
13
17
  var TableDemo = function () {
14
18
  return (React.createElement("div", null,
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const ChatRoomCom: React.FC;
3
+ export default ChatRoomCom;
@@ -0,0 +1,5 @@
1
+ import ChatRoom from '../../components/ChatRoom';
2
+ var ChatRoomCom = function () {
3
+ return React.createElement(ChatRoom, null);
4
+ };
5
+ export default ChatRoomCom;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function Ocr(): JSX.Element;
@@ -0,0 +1,34 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import React from 'react';
24
+ import OCRCom from '../../components/OCR_COM';
25
+ import axios from 'axios';
26
+ import { getToken } from 'ztxkutils/dist/authority';
27
+ function request(options) {
28
+ var headers = options.headers, restOptions = __rest(options, ["headers"]);
29
+ var token = getToken();
30
+ return axios(__assign({ baseURL: options.baseURL ? options.baseURL : 'http://192.168.0.83:8000', url: options.url, headers: __assign({ 'Zmdms-Auth': "bearer " + token }, options.headers), method: options.method, data: options.data, params: options.params }, restOptions));
31
+ }
32
+ export default function Ocr() {
33
+ return React.createElement(OCRCom, { request: request, isCommonOcr: true, tableHeight: 300 });
34
+ }
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function Ocr(): JSX.Element;
@@ -0,0 +1,39 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import React from 'react';
24
+ import OCRCom from '../../components/OCR_COM';
25
+ import axios from 'axios';
26
+ import { getToken } from 'ztxkutils/dist/authority';
27
+ function request(options) {
28
+ var headers = options.headers, restOptions = __rest(options, ["headers"]);
29
+ var token = getToken();
30
+ return axios(__assign({ baseURL: options.baseURL ? options.baseURL : 'http://192.168.0.83:8000', url: options.url, headers: __assign({ 'Zmdms-Auth': "bearer " + token }, options.headers), method: options.method, data: options.data, params: options.params }, restOptions));
31
+ }
32
+ export default function Ocr() {
33
+ var ocrRef = React.useRef();
34
+ return (React.createElement(React.Fragment, null,
35
+ React.createElement("button", { onClick: function () {
36
+ console.log(ocrRef.current.getUserResult());
37
+ } }, "\u83B7\u53D6"),
38
+ React.createElement(OCRCom, { request: request, isUser: true, isCropServer: true, tableHeight: 300, documentId: "7560584210030092299", ref: ocrRef })));
39
+ }
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function Ocr(): JSX.Element;
@@ -0,0 +1,34 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import React from 'react';
24
+ import OCRCom from '../../components/OCR_COM';
25
+ import axios from 'axios';
26
+ import { getToken } from 'ztxkutils/dist/authority';
27
+ function request(options) {
28
+ var headers = options.headers, restOptions = __rest(options, ["headers"]);
29
+ var token = getToken();
30
+ return axios(__assign({ baseURL: options.baseURL ? options.baseURL : 'http://192.168.0.83:8000', url: options.url, headers: __assign({ 'Zmdms-Auth': "bearer " + token }, options.headers), method: options.method, data: options.data, params: options.params }, restOptions));
31
+ }
32
+ export default function Ocr() {
33
+ return (React.createElement(OCRCom, { request: request, isSetting: true, documentId: "7560584210030092299", canvasWidth: 500, tableHeight: 300 }));
34
+ }
package/dist/UI/index.js CHANGED
@@ -6,6 +6,10 @@ import Form from './Form';
6
6
  import Modal from './Modal';
7
7
  import Basic from './Basic';
8
8
  import OCR from './OCR';
9
+ import OCRCom from './OCRCom';
10
+ import CommonOcr from './OCRCom/CommonOcr';
11
+ import UserOcr from './OCRCom/UserOcr';
12
+ import ChatRoom from './ChatRoom';
9
13
  export default function UIComponent() {
10
14
  return (React.createElement("div", { style: { padding: '10px' } },
11
15
  React.createElement(Link, { to: "/ui/default-table", style: { marginRight: '10px' } }, "\u7B80\u5355\u8868\u683C"),
@@ -14,6 +18,10 @@ export default function UIComponent() {
14
18
  React.createElement(Link, { to: "/ui/modal", style: { marginRight: '10px' } }, "\u5F39\u6846"),
15
19
  React.createElement(Link, { to: "/ui/basic", style: { marginRight: '10px' } }, "\u57FA\u7840"),
16
20
  React.createElement(Link, { to: "/ui/ocr", style: { marginRight: '10px' } }, "OCR\u6587\u5B57\u8BC6\u522B"),
21
+ React.createElement(Link, { to: "/ui/ocrCom", style: { marginRight: '10px' } }, "OCR\u914D\u7F6E\u573A\u666F"),
22
+ React.createElement(Link, { to: "/ui/ocrAll", style: { marginRight: '10px' } }, "OCR\u901A\u7528\u8BC6\u522B\u573A\u666F"),
23
+ React.createElement(Link, { to: "/ui/ocrUser", style: { marginRight: '10px' } }, "OCR\u7528\u6237\u4F7F\u7528\u573A\u666F"),
24
+ React.createElement(Link, { to: "/ui/chatRoom", style: { marginRight: '10px' } }, "\u804A\u5929\u5BA4"),
17
25
  React.createElement(Switch, null,
18
26
  React.createElement(Route, { path: "/ui/default-table" },
19
27
  React.createElement(DefaultTable, null)),
@@ -26,5 +34,13 @@ export default function UIComponent() {
26
34
  React.createElement(Route, { path: "/ui/basic" },
27
35
  React.createElement(Basic, null)),
28
36
  React.createElement(Route, { path: "/ui/ocr" },
29
- React.createElement(OCR, null)))));
37
+ React.createElement(OCR, null)),
38
+ React.createElement(Route, { path: "/ui/ocrCom" },
39
+ React.createElement(OCRCom, null)),
40
+ React.createElement(Route, { path: "/ui/ocrAll" },
41
+ React.createElement(CommonOcr, null)),
42
+ React.createElement(Route, { path: "/ui/ocrUser" },
43
+ React.createElement(UserOcr, null)),
44
+ React.createElement(Route, { path: "/ui/chatRoom" },
45
+ React.createElement(ChatRoom, null)))));
30
46
  }
@@ -8,6 +8,8 @@ export interface IProps extends ButtonProps {
8
8
  showCopy?: boolean | string;
9
9
  /** copy容器样式 */
10
10
  copyContainerStyle?: any;
11
+ /** 是否异步按钮 */
12
+ isAsync?: boolean;
11
13
  }
12
14
  declare const Button: React.FC<IProps>;
13
15
  export default Button;
@@ -9,6 +9,42 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (_) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
12
48
  var __rest = (this && this.__rest) || function (s, e) {
13
49
  var t = {};
14
50
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -20,15 +56,16 @@ var __rest = (this && this.__rest) || function (s, e) {
20
56
  }
21
57
  return t;
22
58
  };
23
- import React, { useRef } from 'react';
59
+ import React, { useRef, useState } from 'react';
24
60
  import { Button as AntButton } from 'antd';
25
61
  import classNames from 'classnames';
26
62
  var maxClickTime = 1000;
27
63
  var Button = function (props) {
28
64
  var _a;
29
- var children = props.children, type = props.type, size = props.size, disabled = props.disabled, danger = props.danger, className = props.className, onClick = props.onClick, _b = props.agentClick, agentClick = _b === void 0 ? true : _b, showCopy = props.showCopy, copyContainerStyle = props.copyContainerStyle, restProps = __rest(props, ["children", "type", "size", "disabled", "danger", "className", "onClick", "agentClick", "showCopy", "copyContainerStyle"]);
65
+ var children = props.children, type = props.type, size = props.size, disabled = props.disabled, danger = props.danger, className = props.className, onClick = props.onClick, _b = props.agentClick, agentClick = _b === void 0 ? true : _b, showCopy = props.showCopy, copyContainerStyle = props.copyContainerStyle, isAsync = props.isAsync, restProps = __rest(props, ["children", "type", "size", "disabled", "danger", "className", "onClick", "agentClick", "showCopy", "copyContainerStyle", "isAsync"]);
30
66
  var startTimeRef = useRef(0);
31
67
  var btnRef = useRef();
68
+ var _c = useState(false), loading = _c[0], setLoading = _c[1];
32
69
  var classes = classNames('zt-btn', className, (_a = {},
33
70
  _a["zt-btn-" + type] = type,
34
71
  _a["zt-btn-disabled"] = disabled,
@@ -52,6 +89,31 @@ var Button = function (props) {
52
89
  onClick && onClick(event);
53
90
  }
54
91
  };
92
+ var asyncClick = function (event) { return __awaiter(void 0, void 0, void 0, function () {
93
+ var err_1;
94
+ return __generator(this, function (_a) {
95
+ switch (_a.label) {
96
+ case 0:
97
+ setLoading(true);
98
+ _a.label = 1;
99
+ case 1:
100
+ _a.trys.push([1, 4, , 5]);
101
+ if (!onClick) return [3 /*break*/, 3];
102
+ return [4 /*yield*/, onClick(event)];
103
+ case 2:
104
+ _a.sent();
105
+ _a.label = 3;
106
+ case 3:
107
+ setLoading(false);
108
+ return [3 /*break*/, 5];
109
+ case 4:
110
+ err_1 = _a.sent();
111
+ setLoading(false);
112
+ return [3 /*break*/, 5];
113
+ case 5: return [2 /*return*/];
114
+ }
115
+ });
116
+ }); };
55
117
  // 复制文本内容
56
118
  var onClickHandle = function () {
57
119
  var _a;
@@ -67,12 +129,12 @@ var Button = function (props) {
67
129
  document.body.removeChild(textarea);
68
130
  };
69
131
  return showCopy ? (React.createElement("div", { className: "copy-btn--container", style: copyContainerStyle },
70
- React.createElement(AntButton, __assign({ className: classes, type: type, disabled: disabled, size: size, danger: danger, onClick: myOnClick, ref: btnRef }, restProps), props.children),
132
+ React.createElement(AntButton, __assign({ className: classes, type: type, disabled: disabled, size: size, danger: danger, onClick: isAsync ? asyncClick : myOnClick, ref: btnRef, loading: loading }, restProps), props.children),
71
133
  showCopy && (React.createElement(AntButton, { type: "link", onClick: onClickHandle, style: {
72
134
  paddingLeft: 0,
73
135
  paddingRight: 0,
74
136
  fontSize: '12px',
75
137
  color: '#4285f4',
76
- } }, "\u590D\u5236")))) : (React.createElement(AntButton, __assign({ className: classes, type: type, disabled: disabled, size: size, danger: danger, onClick: myOnClick, ref: btnRef }, restProps), props.children));
138
+ } }, "\u590D\u5236")))) : (React.createElement(AntButton, __assign({ className: classes, type: type, disabled: disabled, size: size, danger: danger, onClick: isAsync ? asyncClick : myOnClick, ref: btnRef, loading: loading }, restProps), props.children));
77
139
  };
78
140
  export default Button;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { ModalProps } from 'antd/lib/modal';
3
+ interface IProps extends ModalProps {
4
+ children: React.ReactNode;
5
+ isDrag?: boolean;
6
+ }
7
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>>;
8
+ export default _default;
@@ -0,0 +1,80 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import React, { useState, useRef, memo, forwardRef, useImperativeHandle, } from 'react';
24
+ import { Modal as AntModal } from 'antd';
25
+ import Draggable from 'react-draggable';
26
+ import classNames from 'classnames';
27
+ function Modal(props, ref) {
28
+ var children = props.children, className = props.className, _a = props.isDrag, isDrag = _a === void 0 ? true : _a, restProps = __rest(props, ["children", "className", "isDrag"]);
29
+ var _b = useState(true), disabled = _b[0], setDisabled = _b[1];
30
+ var _c = useState({
31
+ left: 0,
32
+ top: 0,
33
+ bottom: 0,
34
+ right: 0,
35
+ }), bounds = _c[0], setBounds = _c[1];
36
+ var draggleRef = useRef(null);
37
+ var onStart = function (_event, uiData) {
38
+ var _a;
39
+ var _b = window.document.documentElement, clientWidth = _b.clientWidth, clientHeight = _b.clientHeight;
40
+ var targetRect = (_a = draggleRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
41
+ if (!targetRect) {
42
+ return;
43
+ }
44
+ setBounds({
45
+ left: -targetRect.left + uiData.x,
46
+ right: clientWidth - (targetRect.right - uiData.x),
47
+ top: -targetRect.top + uiData.y,
48
+ bottom: clientHeight - (targetRect.bottom - uiData.y),
49
+ });
50
+ };
51
+ var classes = classNames('zchat-modal', className, {});
52
+ useImperativeHandle(ref, function () {
53
+ return {
54
+ onMouseOver: function () {
55
+ if (disabled) {
56
+ setDisabled(false);
57
+ }
58
+ },
59
+ onMouseOut: function () {
60
+ setDisabled(true);
61
+ },
62
+ // fix eslintjsx-a11y/mouse-events-have-key-events
63
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/mouse-events-have-key-events.md
64
+ onFocus: function () { },
65
+ onBlur: function () { },
66
+ // end
67
+ };
68
+ });
69
+ var modalRender = isDrag
70
+ ? function (modal) { return (React.createElement(Draggable, { disabled: disabled, bounds: bounds, onStart: function (event, uiData) { return onStart(event, uiData); } },
71
+ React.createElement("div", { ref: draggleRef }, modal))); }
72
+ : props.modalRender;
73
+ return (React.createElement(AntModal, __assign({ className: classes, closable: false, footer: null, width: "80%" }, restProps, { modalRender: modalRender }), children));
74
+ }
75
+ Modal.info = AntModal.info;
76
+ Modal.success = AntModal.success;
77
+ Modal.error = AntModal.error;
78
+ Modal.confirm = AntModal.confirm;
79
+ Modal.useModal = AntModal.useModal;
80
+ export default memo(forwardRef(Modal));
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ declare const Modal: ({ isOpen, onClose, children }: {
3
+ isOpen: any;
4
+ onClose: any;
5
+ children: any;
6
+ }) => JSX.Element;
7
+ export default Modal;