linkmore-design 1.0.67 → 1.0.68

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 (281) hide show
  1. package/dist/Approval/handle.d.ts +11 -0
  2. package/dist/Approval/type.d.ts +39 -8
  3. package/dist/Approval/util.d.ts +26 -0
  4. package/dist/AutoComplete/index.d.ts +2 -1
  5. package/dist/Calendar/demos/basic.d.ts +2 -0
  6. package/dist/Calendar/index.d.ts +4 -0
  7. package/dist/Calendar/style/index.d.ts +1 -0
  8. package/dist/CardTable/hooks/usePagination.d.ts +1 -1
  9. package/dist/CardTable/utils.d.ts +2 -2
  10. package/dist/Carousel/demos/basic.d.ts +2 -0
  11. package/dist/Carousel/index.d.ts +3 -0
  12. package/dist/Carousel/style/index.d.ts +1 -0
  13. package/dist/CkFilter/components/CascaderFilter.d.ts +1 -1
  14. package/dist/Collapse/demos/basic.d.ts +2 -0
  15. package/dist/Collapse/index.d.ts +3 -0
  16. package/dist/Collapse/style/index.d.ts +1 -0
  17. package/dist/Comment/demos/basic.d.ts +2 -0
  18. package/dist/Comment/index.d.ts +3 -0
  19. package/dist/Comment/style/index.d.ts +1 -0
  20. package/dist/LmFilter/components/CascaderFilter.d.ts +1 -1
  21. package/dist/LmFilter/components/CheckboxFilter.d.ts +1 -1
  22. package/dist/LmFilter/components/DateFilter.d.ts +1 -1
  23. package/dist/LmFilter/components/SelectFilter.d.ts +1 -1
  24. package/dist/LmSelect/useCheckboxOptions.d.ts +1 -1
  25. package/dist/LmTable/components/DndContainer.d.ts +5 -0
  26. package/dist/LmTable/components/sortableBoxCol.d.ts +5 -0
  27. package/dist/LmTable/components/sortableItemCol.d.ts +1 -0
  28. package/dist/LmTable/demos/tableColSort.d.ts +2 -0
  29. package/dist/LmUpload/LmUpload.d.ts +4 -1
  30. package/dist/LmUpload/UploadList/index.d.ts +1 -1
  31. package/dist/LmUpload/body/Progress.d.ts +4 -0
  32. package/dist/LmUpload/fns/index.d.ts +4 -1
  33. package/dist/Modal/index.d.ts +1 -1
  34. package/dist/Popconfirm/demos/basic.d.ts +2 -0
  35. package/dist/Popconfirm/index.d.ts +3 -0
  36. package/dist/Popconfirm/style/index.d.ts +1 -0
  37. package/dist/Progress/demos/basic.d.ts +2 -0
  38. package/dist/Progress/demos/circle.d.ts +2 -0
  39. package/dist/Progress/demos/dynamic.d.ts +2 -0
  40. package/dist/Progress/demos/small.d.ts +2 -0
  41. package/dist/Progress/index.d.ts +3 -0
  42. package/dist/Progress/style/index.d.ts +1 -0
  43. package/dist/Segmented/demos/basic.d.ts +2 -0
  44. package/dist/Segmented/index.d.ts +3 -0
  45. package/dist/Segmented/style/index.d.ts +1 -0
  46. package/dist/Slider/demos/basic.d.ts +2 -0
  47. package/dist/Slider/index.d.ts +2 -0
  48. package/dist/Slider/style/index.d.ts +1 -0
  49. package/dist/Statistic/demos/basic.d.ts +2 -0
  50. package/dist/Statistic/index.d.ts +3 -0
  51. package/dist/Statistic/style/index.d.ts +1 -0
  52. package/dist/TimePicker/demos/basic.d.ts +3 -0
  53. package/dist/TimePicker/index.d.ts +3 -0
  54. package/dist/TimePicker/style/index.d.ts +1 -0
  55. package/dist/Timeline/demos/basic.d.ts +2 -0
  56. package/dist/Timeline/index.d.ts +3 -0
  57. package/dist/Timeline/style/index.d.ts +1 -0
  58. package/dist/Transfer/demos/basic.d.ts +2 -0
  59. package/dist/Transfer/index.d.ts +3 -0
  60. package/dist/Transfer/style/index.d.ts +1 -0
  61. package/dist/TreeSelect/demos/basic.d.ts +2 -0
  62. package/dist/TreeSelect/index.d.ts +3 -0
  63. package/dist/TreeSelect/style/index.d.ts +1 -0
  64. package/dist/hooks/useFullscreen/demos/useInModal.d.ts +2 -0
  65. package/dist/index.d.ts +18 -0
  66. package/dist/index.umd.js +3780 -1343
  67. package/dist/index.umd.min.js +6 -6
  68. package/es/Alert/index.js +27 -5
  69. package/es/Alert/style/index.css +1 -1
  70. package/es/Approval/handle.d.ts +11 -0
  71. package/es/Approval/handle.js +138 -0
  72. package/es/Approval/index.js +279 -121
  73. package/es/Approval/style/index.css +42 -4
  74. package/es/Approval/type.d.ts +39 -8
  75. package/es/Approval/type.js +97 -1
  76. package/es/Approval/util.d.ts +26 -0
  77. package/es/Approval/util.js +132 -0
  78. package/es/AutoComplete/index.d.ts +2 -1
  79. package/es/Calendar/index.d.ts +4 -0
  80. package/es/Calendar/index.js +3 -0
  81. package/es/Calendar/style/index.css +505 -0
  82. package/es/Calendar/style/index.d.ts +1 -0
  83. package/es/Calendar/style/index.js +1 -0
  84. package/es/Carousel/index.d.ts +3 -0
  85. package/es/Carousel/index.js +3 -0
  86. package/es/Carousel/style/index.css +505 -0
  87. package/es/Carousel/style/index.d.ts +1 -0
  88. package/es/Carousel/style/index.js +1 -0
  89. package/es/Collapse/index.d.ts +3 -0
  90. package/es/Collapse/index.js +3 -0
  91. package/es/Collapse/style/index.css +505 -0
  92. package/es/Collapse/style/index.d.ts +1 -0
  93. package/es/Collapse/style/index.js +1 -0
  94. package/es/Comment/index.d.ts +3 -0
  95. package/es/Comment/index.js +3 -0
  96. package/es/Comment/style/index.css +505 -0
  97. package/es/Comment/style/index.d.ts +1 -0
  98. package/es/Comment/style/index.js +1 -0
  99. package/es/LmEditTable/EditTable.js +5 -3
  100. package/es/LmEditTable/style/index.css +6 -0
  101. package/es/LmFilter/customFilter/index.js +2 -1
  102. package/es/LmFilter/customFilter/saveModal.js +5 -6
  103. package/es/LmFilter/filterFns/index.js +0 -1
  104. package/es/LmSelect/useCheckboxOptions.d.ts +1 -1
  105. package/es/LmTable/Table.js +79 -45
  106. package/es/LmTable/components/DndContainer.d.ts +5 -0
  107. package/es/LmTable/components/DndContainer.js +35 -0
  108. package/es/LmTable/components/sortableBoxCol.js +24 -0
  109. package/es/LmTable/components/sortableItemCol.js +54 -0
  110. package/es/LmUpload/LmUpload.d.ts +4 -1
  111. package/es/LmUpload/LmUpload.js +30 -6
  112. package/es/LmUpload/UploadList/ItemPictureCard.js +67 -10
  113. package/es/LmUpload/UploadList/index.d.ts +1 -1
  114. package/es/LmUpload/UploadList/index.js +3 -2
  115. package/es/LmUpload/body/Progress.d.ts +4 -0
  116. package/es/LmUpload/body/Progress.js +16 -0
  117. package/es/LmUpload/body/UploadCore.js +16 -10
  118. package/es/LmUpload/body/UploadPicture.js +12 -4
  119. package/es/LmUpload/fns/index.d.ts +3 -0
  120. package/es/LmUpload/fns/index.js +135 -25
  121. package/es/LmUpload/style/index.css +20 -3
  122. package/es/LmUpload/wrapper/reducer.js +7 -1
  123. package/es/Modal/index.d.ts +1 -1
  124. package/es/Popconfirm/index.d.ts +3 -0
  125. package/es/Popconfirm/index.js +3 -0
  126. package/es/Popconfirm/style/index.css +505 -0
  127. package/es/Popconfirm/style/index.d.ts +1 -0
  128. package/es/Popconfirm/style/index.js +1 -0
  129. package/es/Progress/index.d.ts +3 -0
  130. package/es/Progress/index.js +3 -0
  131. package/es/Progress/style/index.css +505 -0
  132. package/es/Progress/style/index.d.ts +1 -0
  133. package/es/Progress/style/index.js +1 -0
  134. package/es/Segmented/index.d.ts +3 -0
  135. package/es/Segmented/index.js +3 -0
  136. package/es/Segmented/style/index.css +505 -0
  137. package/es/Segmented/style/index.d.ts +1 -0
  138. package/es/Segmented/style/index.js +1 -0
  139. package/es/Slider/index.d.ts +2 -0
  140. package/es/Slider/index.js +3 -0
  141. package/es/Slider/style/index.css +505 -0
  142. package/es/Slider/style/index.d.ts +1 -0
  143. package/es/Slider/style/index.js +1 -0
  144. package/es/Statistic/index.d.ts +3 -0
  145. package/es/Statistic/index.js +3 -0
  146. package/es/Statistic/style/index.css +505 -0
  147. package/es/Statistic/style/index.d.ts +1 -0
  148. package/es/Statistic/style/index.js +1 -0
  149. package/es/TimePicker/index.d.ts +3 -0
  150. package/es/TimePicker/index.js +3 -0
  151. package/es/TimePicker/style/index.css +505 -0
  152. package/es/TimePicker/style/index.d.ts +1 -0
  153. package/es/TimePicker/style/index.js +1 -0
  154. package/es/Timeline/index.d.ts +3 -0
  155. package/es/Timeline/index.js +3 -0
  156. package/es/Timeline/style/index.css +505 -0
  157. package/es/Timeline/style/index.d.ts +1 -0
  158. package/es/Timeline/style/index.js +1 -0
  159. package/es/Transfer/index.d.ts +3 -0
  160. package/es/Transfer/index.js +3 -0
  161. package/es/Transfer/style/index.css +505 -0
  162. package/es/Transfer/style/index.d.ts +1 -0
  163. package/es/Transfer/style/index.js +1 -0
  164. package/es/TreeSelect/index.d.ts +3 -0
  165. package/es/TreeSelect/index.js +3 -0
  166. package/es/TreeSelect/style/index.css +505 -0
  167. package/es/TreeSelect/style/index.d.ts +1 -0
  168. package/es/TreeSelect/style/index.js +1 -0
  169. package/es/hooks/useFullscreen/index.js +6 -8
  170. package/es/index.d.ts +18 -0
  171. package/es/index.js +10 -1
  172. package/lib/Alert/index.js +27 -5
  173. package/lib/Alert/style/index.css +1 -1
  174. package/lib/Approval/handle.d.ts +11 -0
  175. package/lib/Approval/handle.js +160 -0
  176. package/lib/Approval/index.js +286 -121
  177. package/lib/Approval/style/index.css +42 -4
  178. package/lib/Approval/type.d.ts +39 -8
  179. package/lib/Approval/type.js +101 -1
  180. package/lib/Approval/util.d.ts +26 -0
  181. package/lib/Approval/util.js +148 -0
  182. package/lib/AutoComplete/index.d.ts +2 -1
  183. package/lib/Calendar/index.d.ts +4 -0
  184. package/lib/Calendar/index.js +15 -0
  185. package/lib/Calendar/style/index.css +505 -0
  186. package/lib/Calendar/style/index.d.ts +1 -0
  187. package/lib/Calendar/style/index.js +3 -0
  188. package/lib/Carousel/index.d.ts +3 -0
  189. package/lib/Carousel/index.js +15 -0
  190. package/lib/Carousel/style/index.css +505 -0
  191. package/lib/Carousel/style/index.d.ts +1 -0
  192. package/lib/Carousel/style/index.js +3 -0
  193. package/lib/Collapse/index.d.ts +3 -0
  194. package/lib/Collapse/index.js +15 -0
  195. package/lib/Collapse/style/index.css +505 -0
  196. package/lib/Collapse/style/index.d.ts +1 -0
  197. package/lib/Collapse/style/index.js +3 -0
  198. package/lib/Comment/index.d.ts +3 -0
  199. package/lib/Comment/index.js +15 -0
  200. package/lib/Comment/style/index.css +505 -0
  201. package/lib/Comment/style/index.d.ts +1 -0
  202. package/lib/Comment/style/index.js +3 -0
  203. package/lib/LmEditTable/EditTable.js +5 -3
  204. package/lib/LmEditTable/style/index.css +6 -0
  205. package/lib/LmFilter/customFilter/index.js +2 -1
  206. package/lib/LmFilter/customFilter/saveModal.js +5 -6
  207. package/lib/LmFilter/filterFns/index.js +0 -1
  208. package/lib/LmSelect/useCheckboxOptions.d.ts +1 -1
  209. package/lib/LmTable/Table.js +79 -45
  210. package/lib/LmTable/components/DndContainer.d.ts +5 -0
  211. package/lib/LmTable/components/DndContainer.js +49 -0
  212. package/lib/LmTable/components/sortableBoxCol.js +24 -0
  213. package/lib/LmTable/components/sortableItemCol.js +54 -0
  214. package/lib/LmUpload/LmUpload.d.ts +4 -1
  215. package/lib/LmUpload/LmUpload.js +31 -6
  216. package/lib/LmUpload/UploadList/ItemPictureCard.js +66 -10
  217. package/lib/LmUpload/UploadList/index.d.ts +1 -1
  218. package/lib/LmUpload/UploadList/index.js +6 -2
  219. package/lib/LmUpload/body/Progress.d.ts +4 -0
  220. package/lib/LmUpload/body/{UploadDrag.js → Progress.js} +10 -5
  221. package/lib/LmUpload/body/UploadCore.js +16 -10
  222. package/lib/LmUpload/body/UploadPicture.js +14 -3
  223. package/lib/LmUpload/fns/index.d.ts +3 -0
  224. package/lib/LmUpload/fns/index.js +141 -29
  225. package/lib/LmUpload/style/index.css +20 -3
  226. package/lib/LmUpload/wrapper/reducer.js +7 -1
  227. package/lib/Modal/index.d.ts +1 -1
  228. package/lib/Popconfirm/index.d.ts +3 -0
  229. package/lib/Popconfirm/index.js +15 -0
  230. package/lib/Popconfirm/style/index.css +505 -0
  231. package/lib/Popconfirm/style/index.d.ts +1 -0
  232. package/lib/Popconfirm/style/index.js +3 -0
  233. package/lib/Progress/index.d.ts +3 -0
  234. package/lib/Progress/index.js +15 -0
  235. package/lib/Progress/style/index.css +505 -0
  236. package/lib/Progress/style/index.d.ts +1 -0
  237. package/lib/Progress/style/index.js +3 -0
  238. package/lib/Segmented/index.d.ts +3 -0
  239. package/lib/Segmented/index.js +15 -0
  240. package/lib/Segmented/style/index.css +505 -0
  241. package/lib/Segmented/style/index.d.ts +1 -0
  242. package/lib/Segmented/style/index.js +3 -0
  243. package/lib/Slider/index.d.ts +2 -0
  244. package/lib/Slider/index.js +15 -0
  245. package/lib/Slider/style/index.css +505 -0
  246. package/lib/Slider/style/index.d.ts +1 -0
  247. package/lib/Slider/style/index.js +3 -0
  248. package/lib/Statistic/index.d.ts +3 -0
  249. package/lib/Statistic/index.js +15 -0
  250. package/lib/Statistic/style/index.css +505 -0
  251. package/lib/Statistic/style/index.d.ts +1 -0
  252. package/lib/Statistic/style/index.js +3 -0
  253. package/lib/TimePicker/index.d.ts +3 -0
  254. package/lib/TimePicker/index.js +15 -0
  255. package/lib/TimePicker/style/index.css +505 -0
  256. package/lib/TimePicker/style/index.d.ts +1 -0
  257. package/lib/TimePicker/style/index.js +3 -0
  258. package/lib/Timeline/index.d.ts +3 -0
  259. package/lib/Timeline/index.js +15 -0
  260. package/lib/Timeline/style/index.css +505 -0
  261. package/lib/Timeline/style/index.d.ts +1 -0
  262. package/lib/Timeline/style/index.js +3 -0
  263. package/lib/Transfer/index.d.ts +3 -0
  264. package/lib/Transfer/index.js +15 -0
  265. package/lib/Transfer/style/index.css +505 -0
  266. package/lib/Transfer/style/index.d.ts +1 -0
  267. package/lib/Transfer/style/index.js +3 -0
  268. package/lib/TreeSelect/index.d.ts +3 -0
  269. package/lib/TreeSelect/index.js +15 -0
  270. package/lib/TreeSelect/style/index.css +505 -0
  271. package/lib/TreeSelect/style/index.d.ts +1 -0
  272. package/lib/TreeSelect/style/index.js +3 -0
  273. package/lib/hooks/useFullscreen/index.js +6 -10
  274. package/lib/index.d.ts +18 -0
  275. package/lib/index.js +73 -1
  276. package/package.json +2 -1
  277. package/typings/index.d.ts +1 -1
  278. package/dist/LmUpload/body/UploadDrag.d.ts +0 -4
  279. package/es/LmUpload/body/UploadDrag.d.ts +0 -4
  280. package/es/LmUpload/body/UploadDrag.js +0 -10
  281. package/lib/LmUpload/body/UploadDrag.d.ts +0 -4
@@ -1,24 +1,55 @@
1
1
  /// <reference types="react" />
2
2
  export declare type VoidFunction = () => void;
3
+ export declare enum ApprovalType {
4
+ START = "START",
5
+ APPROVAL = "APPROVAL",
6
+ CARBON_COPY = "CARBON_COPY",
7
+ ONLY_COMMENT = "ONLY_COMMENT"
8
+ }
9
+ export declare enum StatusType {
10
+ AGREE = "AGREE",
11
+ REFUSE = "REFUSE",
12
+ PENDING = "PENDING"
13
+ }
14
+ export declare namespace ApprovalType {
15
+ function isAgree(type: ApprovalType, status: StatusType): boolean;
16
+ function isPending(type: ApprovalType, status: StatusType): boolean;
17
+ function isRefuse(type: ApprovalType, status: StatusType): boolean;
18
+ function isCC(type: ApprovalType): boolean;
19
+ function isOnlyComment(type: ApprovalType): boolean;
20
+ function isApproval(type: ApprovalType): boolean;
21
+ function toText(type: ApprovalType, status: StatusType): "" | "审核中" | "未通过" | "已审核" | "仅评论";
22
+ }
3
23
  export interface IApprovalItemProps {
4
24
  avator?: string;
5
25
  name?: string;
6
26
  time?: string;
7
- type?: 'start' | 'comment' | 'carbonCopy' | 'agree' | 'refuse' | 'pending';
27
+ urge?: boolean;
28
+ type?: ApprovalType;
29
+ approvalStatus?: StatusType;
8
30
  everyoneAgree?: boolean;
9
- approverList: Array<string>;
31
+ approverList?: Array<string>;
32
+ agreeList?: Array<string>;
33
+ refuse?: string;
34
+ carbonCopyList?: Array<string>;
35
+ isCarbonCopy?: boolean;
36
+ comment?: string;
10
37
  [prop: string]: any;
11
38
  }
12
39
  export interface IApprovalProps {
13
40
  visible?: boolean;
14
41
  title?: string;
15
- close?: () => void;
16
42
  className?: string;
17
43
  style?: React.CSSProperties;
18
- userType?: 'self' | 'approver';
19
- status?: 1 | 2 | 3;
44
+ proposer: string;
45
+ user: string;
20
46
  steps?: Array<IApprovalItemProps>;
21
- onComment: VoidFunction;
22
- onRefuse: VoidFunction;
23
- onAgree: VoidFunction;
47
+ onClose?: VoidFunction;
48
+ onComment?: VoidFunction;
49
+ onRefuse?: VoidFunction;
50
+ onAgree?: VoidFunction;
51
+ onUrge?: (approvalItem: IApprovalItemProps, i: number, list: Array<IApprovalItemProps>) => void;
52
+ onCarbonCopy?: (approvalItem: IApprovalItemProps, i: number, list: Array<IApprovalItemProps>) => void;
53
+ onDeleteComment?: (approvalItem: IApprovalItemProps, i: number, list: Array<IApprovalItemProps>) => void;
54
+ __update?: boolean;
24
55
  }
@@ -1 +1,97 @@
1
- export {};
1
+ // 节点类型
2
+ export var ApprovalType;
3
+
4
+ (function (ApprovalType) {
5
+ ApprovalType["START"] = "START";
6
+ ApprovalType["APPROVAL"] = "APPROVAL";
7
+ ApprovalType["CARBON_COPY"] = "CARBON_COPY";
8
+ ApprovalType["ONLY_COMMENT"] = "ONLY_COMMENT";
9
+ })(ApprovalType || (ApprovalType = {}));
10
+
11
+ export var StatusType;
12
+
13
+ (function (StatusType) {
14
+ StatusType["AGREE"] = "AGREE";
15
+ StatusType["REFUSE"] = "REFUSE";
16
+ StatusType["PENDING"] = "PENDING";
17
+ })(StatusType || (StatusType = {}));
18
+
19
+ (function (ApprovalType) {
20
+ function isAgree(type, status) {
21
+ if (type === ApprovalType.APPROVAL && status === StatusType.AGREE) {
22
+ return true;
23
+ }
24
+
25
+ return false;
26
+ }
27
+
28
+ ApprovalType.isAgree = isAgree;
29
+
30
+ function isPending(type, status) {
31
+ if (type === ApprovalType.APPROVAL && status === StatusType.PENDING) {
32
+ return true;
33
+ }
34
+
35
+ return false;
36
+ }
37
+
38
+ ApprovalType.isPending = isPending;
39
+
40
+ function isRefuse(type, status) {
41
+ if (type === ApprovalType.APPROVAL && status === StatusType.REFUSE) {
42
+ return true;
43
+ }
44
+
45
+ return false;
46
+ }
47
+
48
+ ApprovalType.isRefuse = isRefuse;
49
+
50
+ function isCC(type) {
51
+ if (type === ApprovalType.CARBON_COPY) {
52
+ return true;
53
+ }
54
+
55
+ return false;
56
+ }
57
+
58
+ ApprovalType.isCC = isCC;
59
+
60
+ function isOnlyComment(type) {
61
+ if (type === ApprovalType.ONLY_COMMENT) {
62
+ return true;
63
+ }
64
+
65
+ return false;
66
+ }
67
+
68
+ ApprovalType.isOnlyComment = isOnlyComment;
69
+
70
+ function isApproval(type) {
71
+ if (type === ApprovalType.APPROVAL) {
72
+ return true;
73
+ }
74
+
75
+ return false;
76
+ }
77
+
78
+ ApprovalType.isApproval = isApproval;
79
+
80
+ function toText(type, status) {
81
+ if (type === ApprovalType.APPROVAL) {
82
+ if (status === StatusType.PENDING) {
83
+ return '审核中';
84
+ } else if (status === StatusType.REFUSE) {
85
+ return '未通过';
86
+ } else if (status === StatusType.AGREE) {
87
+ return '已审核';
88
+ }
89
+ } else if (type === ApprovalType.ONLY_COMMENT) {
90
+ return '仅评论';
91
+ }
92
+
93
+ return '';
94
+ }
95
+
96
+ ApprovalType.toText = toText;
97
+ })(ApprovalType || (ApprovalType = {}));
@@ -0,0 +1,26 @@
1
+ import { IApprovalItemProps, StatusType } from "./type";
2
+ /**
3
+ * 当前用户是否可以审批
4
+ * @param steps
5
+ * @param user
6
+ */
7
+ export declare function currentUserIsApprover(steps: Array<IApprovalItemProps>, user: string): boolean;
8
+ /**
9
+ * 当前用户是否是提议发起者
10
+ * @param proposer
11
+ * @param user
12
+ */
13
+ export declare function currentUserIsProposer(proposer: string, user: string): boolean;
14
+ /**
15
+ * 审批节点是否通过
16
+ * @param approverList 审批人列表
17
+ * @param agreeList 已通过列表
18
+ * @param everyoneAgree 是否需要所有人都通过
19
+ */
20
+ export declare function isAgreeOfApproverNode(approverList: Array<string>, agreeList: Array<string>, everyoneAgree: boolean): boolean;
21
+ /**
22
+ * 获取当前审批单状态
23
+ * @param steps
24
+ * @returns
25
+ */
26
+ export declare function getStatus(steps: Array<IApprovalItemProps>): StatusType;
@@ -0,0 +1,132 @@
1
+ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
2
+ import { ApprovalType, StatusType } from "./type";
3
+ /**
4
+ * 当前用户是否可以审批
5
+ * @param steps
6
+ * @param user
7
+ */
8
+
9
+ export function currentUserIsApprover(steps, user) {
10
+ var _iterator = _createForOfIteratorHelper(steps),
11
+ _step;
12
+
13
+ try {
14
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
15
+ var step = _step.value;
16
+
17
+ // 审核中
18
+ if (ApprovalType.isPending(step.type, step.approvalStatus)) {
19
+ if (step.everyoneAgree) {
20
+ var index = step.agreeList.length;
21
+
22
+ if (index < step.approverList.length && step.approverList[index] === user) {
23
+ return true;
24
+ }
25
+ } else {
26
+ if (step.approverList.indexOf(user) !== -1) {
27
+ return true;
28
+ }
29
+ }
30
+
31
+ break;
32
+ }
33
+ }
34
+ } catch (err) {
35
+ _iterator.e(err);
36
+ } finally {
37
+ _iterator.f();
38
+ }
39
+
40
+ return false;
41
+ }
42
+ /**
43
+ * 当前用户是否是提议发起者
44
+ * @param proposer
45
+ * @param user
46
+ */
47
+
48
+ export function currentUserIsProposer(proposer, user) {
49
+ return proposer && proposer === user;
50
+ }
51
+ /**
52
+ * 审批节点是否通过
53
+ * @param approverList 审批人列表
54
+ * @param agreeList 已通过列表
55
+ * @param everyoneAgree 是否需要所有人都通过
56
+ */
57
+
58
+ export function isAgreeOfApproverNode(approverList, agreeList, everyoneAgree) {
59
+ if (!approverList.length) {
60
+ return false;
61
+ }
62
+
63
+ if (everyoneAgree) {
64
+ var _iterator2 = _createForOfIteratorHelper(approverList),
65
+ _step2;
66
+
67
+ try {
68
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
69
+ var value = _step2.value;
70
+
71
+ if (agreeList.indexOf(value) === -1) {
72
+ return false;
73
+ }
74
+ }
75
+ } catch (err) {
76
+ _iterator2.e(err);
77
+ } finally {
78
+ _iterator2.f();
79
+ }
80
+
81
+ return true;
82
+ } else {
83
+ var _iterator3 = _createForOfIteratorHelper(agreeList),
84
+ _step3;
85
+
86
+ try {
87
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
88
+ var _value = _step3.value;
89
+
90
+ if (approverList.indexOf(_value) !== -1) {
91
+ return true;
92
+ }
93
+ }
94
+ } catch (err) {
95
+ _iterator3.e(err);
96
+ } finally {
97
+ _iterator3.f();
98
+ }
99
+
100
+ return false;
101
+ }
102
+ }
103
+ /**
104
+ * 获取当前审批单状态
105
+ * @param steps
106
+ * @returns
107
+ */
108
+
109
+ export function getStatus(steps) {
110
+ var _iterator4 = _createForOfIteratorHelper(steps),
111
+ _step4;
112
+
113
+ try {
114
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
115
+ var step = _step4.value;
116
+
117
+ if (ApprovalType.isPending(step.type, step.approvalStatus)) {
118
+ return StatusType.PENDING;
119
+ }
120
+
121
+ if (ApprovalType.isRefuse(step.type, step.approvalStatus)) {
122
+ return StatusType.REFUSE;
123
+ }
124
+ }
125
+ } catch (err) {
126
+ _iterator4.e(err);
127
+ } finally {
128
+ _iterator4.f();
129
+ }
130
+
131
+ return StatusType.AGREE;
132
+ }
@@ -10,6 +10,7 @@ import * as React from 'react';
10
10
  import type { BaseOptionType, DefaultOptionType, InternalSelectProps } from 'antd/es/select';
11
11
  import type { InputStatus } from '../_util/statusUtils';
12
12
  import { AutoComplete as AntdAutoComplete } from 'antd';
13
+ declare const Option: import("rc-select/lib/Option").OptionFC;
13
14
  export interface DataSourceItemObject {
14
15
  value: string;
15
16
  text: string;
@@ -24,7 +25,7 @@ declare const RefAutoComplete: (<ValueType = any, OptionType extends DefaultOpti
24
25
  } & {
25
26
  ref?: React.Ref<BaseSelectRef>;
26
27
  }) => React.ReactElement) & {
27
- Option: import("rc-select/lib/Option").OptionFC;
28
+ Option: typeof Option;
28
29
  AntdAutoComplete: typeof AntdAutoComplete;
29
30
  };
30
31
  export default RefAutoComplete;
@@ -0,0 +1,4 @@
1
+ import { Calendar } from 'antd';
2
+ export type { CalendarProps } from 'antd';
3
+ export type { CalendarMode } from 'antd/es/calendar/generateCalendar';
4
+ export default Calendar;
@@ -0,0 +1,3 @@
1
+ import "antd/es/calendar/style";
2
+ import _Calendar from "antd/es/calendar";
3
+ export default _Calendar;