ls-pro-common 3.0.14 → 3.0.15

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 (111) hide show
  1. package/CHANGELOG.md +746 -0
  2. package/es/components/404.d.ts +3 -0
  3. package/es/components/404.jpg +0 -0
  4. package/es/components/404.js +9 -0
  5. package/es/components/AreaCascader.d.ts +4 -0
  6. package/es/components/AreaCascader.js +76 -0
  7. package/es/components/AreaCascaderPanel.d.ts +5 -0
  8. package/es/components/AreaCascaderPanel.js +230 -0
  9. package/es/components/DescritionCard.d.ts +11 -0
  10. package/es/components/DescritionCard.js +79 -0
  11. package/es/components/DtlLayout.d.ts +44 -0
  12. package/es/components/DtlLayout.js +116 -0
  13. package/es/components/GroupTip.d.ts +10 -0
  14. package/es/components/GroupTip.js +31 -0
  15. package/es/components/IconBack.d.ts +3 -0
  16. package/es/components/IconBack.js +20 -0
  17. package/es/components/IconBell.d.ts +3 -0
  18. package/es/components/IconBell.js +22 -0
  19. package/es/components/IconQuestion.d.ts +3 -0
  20. package/es/components/IconQuestion.js +26 -0
  21. package/es/components/IconSearch.d.ts +3 -0
  22. package/es/components/IconSearch.js +22 -0
  23. package/es/components/IconSelector.d.ts +14 -0
  24. package/es/components/IconSelector.js +222 -0
  25. package/es/components/IconText.d.ts +3 -0
  26. package/es/components/IconText.js +30 -0
  27. package/es/components/ImageSelector.d.ts +31 -0
  28. package/es/components/ImageSelector.js +437 -0
  29. package/es/components/InputMultiLine.d.ts +46 -0
  30. package/es/components/InputMultiLine.js +139 -0
  31. package/es/components/InputTable.d.ts +106 -0
  32. package/es/components/InputTable.js +473 -0
  33. package/es/components/Loading.d.ts +8 -0
  34. package/es/components/Loading.js +20 -0
  35. package/es/components/Permission.d.ts +6 -0
  36. package/es/components/Permission.js +13 -0
  37. package/es/components/antd-custom.less +356 -0
  38. package/es/components/common.less +474 -0
  39. package/es/hooks/useDtl/index.d.ts +47 -0
  40. package/es/hooks/useDtl/index.js +949 -0
  41. package/es/hooks/useGetState.d.ts +1 -0
  42. package/es/hooks/useGetState.js +17 -0
  43. package/es/hooks/usePermission/index.d.ts +15 -0
  44. package/es/hooks/usePermission/index.js +58 -0
  45. package/es/hooks/useSingle/index.d.ts +54 -0
  46. package/es/hooks/useSingle/index.js +662 -0
  47. package/es/http/index.d.ts +53 -0
  48. package/es/http/index.js +309 -0
  49. package/es/index.d.ts +32 -0
  50. package/es/index.js +26 -0
  51. package/es/service/BaseService.d.ts +24 -0
  52. package/es/service/BaseService.js +214 -0
  53. package/es/typing.d.ts +53 -0
  54. package/es/typing.js +1 -0
  55. package/es/utils/index.d.ts +258 -0
  56. package/es/utils/index.js +682 -0
  57. package/lib/components/404.d.ts +3 -0
  58. package/lib/components/404.jpg +0 -0
  59. package/lib/components/404.js +17 -0
  60. package/lib/components/AreaCascader.d.ts +4 -0
  61. package/lib/components/AreaCascader.js +85 -0
  62. package/lib/components/AreaCascaderPanel.d.ts +5 -0
  63. package/lib/components/AreaCascaderPanel.js +239 -0
  64. package/lib/components/DescritionCard.d.ts +11 -0
  65. package/lib/components/DescritionCard.js +88 -0
  66. package/lib/components/DtlLayout.d.ts +44 -0
  67. package/lib/components/DtlLayout.js +125 -0
  68. package/lib/components/GroupTip.d.ts +10 -0
  69. package/lib/components/GroupTip.js +39 -0
  70. package/lib/components/IconBack.d.ts +3 -0
  71. package/lib/components/IconBack.js +28 -0
  72. package/lib/components/IconBell.d.ts +3 -0
  73. package/lib/components/IconBell.js +30 -0
  74. package/lib/components/IconQuestion.d.ts +3 -0
  75. package/lib/components/IconQuestion.js +34 -0
  76. package/lib/components/IconSearch.d.ts +3 -0
  77. package/lib/components/IconSearch.js +30 -0
  78. package/lib/components/IconSelector.d.ts +14 -0
  79. package/lib/components/IconSelector.js +230 -0
  80. package/lib/components/IconText.d.ts +3 -0
  81. package/lib/components/IconText.js +38 -0
  82. package/lib/components/ImageSelector.d.ts +31 -0
  83. package/lib/components/ImageSelector.js +445 -0
  84. package/lib/components/InputMultiLine.d.ts +46 -0
  85. package/lib/components/InputMultiLine.js +148 -0
  86. package/lib/components/InputTable.d.ts +106 -0
  87. package/lib/components/InputTable.js +482 -0
  88. package/lib/components/Loading.d.ts +8 -0
  89. package/lib/components/Loading.js +28 -0
  90. package/lib/components/Permission.d.ts +6 -0
  91. package/lib/components/Permission.js +21 -0
  92. package/lib/components/antd-custom.less +356 -0
  93. package/lib/components/common.less +474 -0
  94. package/lib/hooks/useDtl/index.d.ts +47 -0
  95. package/lib/hooks/useDtl/index.js +957 -0
  96. package/lib/hooks/useGetState.d.ts +1 -0
  97. package/lib/hooks/useGetState.js +24 -0
  98. package/lib/hooks/usePermission/index.d.ts +15 -0
  99. package/lib/hooks/usePermission/index.js +65 -0
  100. package/lib/hooks/useSingle/index.d.ts +54 -0
  101. package/lib/hooks/useSingle/index.js +670 -0
  102. package/lib/http/index.d.ts +53 -0
  103. package/lib/http/index.js +323 -0
  104. package/lib/index.d.ts +32 -0
  105. package/lib/service/BaseService.d.ts +24 -0
  106. package/lib/service/BaseService.js +222 -0
  107. package/lib/typing.d.ts +53 -0
  108. package/lib/typing.js +5 -0
  109. package/lib/utils/index.d.ts +258 -0
  110. package/lib/utils/index.js +779 -0
  111. package/package.json +5 -13
@@ -0,0 +1,474 @@
1
+ body {
2
+
3
+ --bg-color: #F9FAFB;
4
+
5
+
6
+ --ant-primary-color: #1869ED;
7
+ --ant-primary-color-hover: #418efa;
8
+ --ant-primary-color-active: #0a4cc7;
9
+ --ant-primary-color-outline: rgba(24, 105, 237, 0.4);
10
+ --ant-primary-1: #e6f4ff;
11
+ --ant-primary-2: #bddfff;
12
+ --ant-primary-3: #94c8ff;
13
+ --ant-primary-4: #6baeff;
14
+ --ant-primary-5: #418efa;
15
+ --ant-primary-6: #1869ED;
16
+ --ant-primary-7: #0a4cc7;
17
+ --ant-primary-color-deprecated-pure: #bed5fa;
18
+ --ant-primary-color-deprecated-l-35: #bed5fa;
19
+ --ant-primary-color-deprecated-l-20: #77a6f4;
20
+ --ant-primary-color-deprecated-t-20: #4687f1;
21
+ --ant-primary-color-deprecated-t-50: #8cb4f6;
22
+ --ant-primary-color-deprecated-f-12: rgba(24, 105, 237, 0.12);
23
+ --ant-primary-color-active-deprecated-f-30: rgba(230, 244, 255, 0.3);
24
+ --ant-primary-color-active-deprecated-d-02: #dcf0ff;
25
+ --ant-success-color: #52c41a;
26
+ --ant-success-color-hover: #73d13d;
27
+ --ant-success-color-active: #389e0d;
28
+ --ant-success-color-outline: rgba(82, 196, 26, 0.2);
29
+ --ant-success-color-deprecated-bg: #f6ffed;
30
+ --ant-success-color-deprecated-border: #b7eb8f;
31
+ --ant-error-color: #ff4d4f;
32
+ --ant-error-color-hover: #ff7875;
33
+ --ant-error-color-active: #d9363e;
34
+ --ant-error-color-outline: rgba(255, 77, 79, 0.2);
35
+ --ant-error-color-deprecated-bg: #fff2f0;
36
+ --ant-error-color-deprecated-border: #ffccc7;
37
+ --ant-warning-color: #faad14;
38
+ --ant-warning-color-hover: #ffc53d;
39
+ --ant-warning-color-active: #d48806;
40
+ --ant-warning-color-outline: rgba(250, 173, 20, 0.2);
41
+ --ant-warning-color-deprecated-bg: #fffbe6;
42
+ --ant-warning-color-deprecated-border: #ffe58f;
43
+ --ant-info-color: #1869ED;
44
+ --ant-info-color-deprecated-bg: #e6f4ff;
45
+ --ant-info-color-deprecated-border: #94c8ff;
46
+
47
+ }
48
+
49
+ * ::-webkit-scrollbar-thumb {
50
+ background-color: #EFF2F4;
51
+ border-radius: 6px;
52
+
53
+ &:hover {
54
+ background-color: #E4E7EA;
55
+ border-radius: 6px;
56
+ }
57
+ }
58
+
59
+ * ::-webkit-scrollbar {
60
+ width: 8px;
61
+ height: 8px;
62
+ background-color: transparent;
63
+ }
64
+
65
+ * {
66
+ scrollbar-width: thin;
67
+ }
68
+
69
+
70
+ body.theme-yellow {
71
+ --ant-primary-color: #fa8500;
72
+ --ant-primary-color-hover: #ffa229;
73
+ --ant-primary-color-active: #d46a00;
74
+ --ant-primary-color-outline: rgba(250, 133, 0, 0.4);
75
+ --ant-primary-bg: #fff;
76
+ --ant-primary-side: #fff7e6;
77
+ --ant-primary-0: #ffd9ad;
78
+ --ant-primary-1: #fff7e6;
79
+ --ant-primary-2: #ffe0a3;
80
+ --ant-primary-3: #ffce7a;
81
+ --ant-primary-4: #ffba52;
82
+ --ant-primary-5: #ffa229;
83
+ --ant-primary-6: #fa8500;
84
+ --ant-primary-7: #d46a00;
85
+ --ant-primary-color-deprecated-pure: #ffd9ad;
86
+ --ant-primary-color-deprecated-l-35: #ffd9ad;
87
+ --ant-primary-color-deprecated-l-20: #ffb561;
88
+ --ant-primary-color-deprecated-t-20: #fb9d33;
89
+ --ant-primary-color-deprecated-t-50: #fdc280;
90
+ --ant-primary-color-deprecated-f-12: rgba(250, 133, 0, 0.12);
91
+ --ant-primary-color-active-deprecated-f-30: rgba(255, 247, 230, 0.3);
92
+ --ant-primary-color-active-deprecated-d-02: #fff4dc;
93
+ --ant-success-color: #52c41a;
94
+ --ant-success-color-hover: #73d13d;
95
+ --ant-success-color-active: #389e0d;
96
+ --ant-success-color-outline: rgba(82, 196, 26, 0.2);
97
+ --ant-success-color-deprecated-bg: #f6ffed;
98
+ --ant-success-color-deprecated-border: #b7eb8f;
99
+ --ant-error-color: #ff4d4f;
100
+ --ant-error-color-hover: #ff7875;
101
+ --ant-error-color-active: #d9363e;
102
+ --ant-error-color-outline: rgba(255, 77, 79, 0.2);
103
+ --ant-error-color-deprecated-bg: #fff2f0;
104
+ --ant-error-color-deprecated-border: #ffccc7;
105
+ --ant-warning-color: #faad14;
106
+ --ant-warning-color-hover: #ffc53d;
107
+ --ant-warning-color-active: #d48806;
108
+ --ant-warning-color-outline: rgba(250, 173, 20, 0.2);
109
+ --ant-warning-color-deprecated-bg: #fffbe6;
110
+ --ant-warning-color-deprecated-border: #ffe58f;
111
+ --ant-info-color: #fa8500;
112
+ --ant-info-color-deprecated-bg: #fff7e6;
113
+ --ant-info-color-deprecated-border: #ffce7a;
114
+ --antd-wave-shadow-color: #fa8500;
115
+
116
+ .ant-table-cell,
117
+ .ant-pro-table-alert-info-content {
118
+ a {
119
+ color: var(--ant-primary-color);
120
+ }
121
+
122
+ a:hover {
123
+ color: var(--ant-primary-color-hover);
124
+ }
125
+
126
+ a:active {
127
+ color: var(--ant-primary-color-active);
128
+ }
129
+ }
130
+ }
131
+
132
+ .dtl-layout {
133
+ position: absolute;
134
+ top: 0;
135
+ left: 0;
136
+ right: 0;
137
+ bottom: 0;
138
+ background: var(--bg-color, #f9fafb);
139
+ display: flex;
140
+ flex-direction: column;
141
+ z-index: 50;
142
+
143
+ .dtl-header {
144
+ display: flex;
145
+ justify-items: center;
146
+ padding: 8px 20px;
147
+ background: #fff;
148
+ // border-bottom: 1px solid #f0f0f0;
149
+
150
+ // .dtl-back {
151
+ // display : flex;
152
+ // align-items : center;
153
+ // padding-right: 5px;
154
+
155
+ // >span {
156
+ // padding : 3px;
157
+ // border-radius: 2px;
158
+
159
+ // &:hover {
160
+ // background: var(--ant-primary-2);
161
+ // color : var(--ant-primary-color)
162
+ // }
163
+ // }
164
+ // }
165
+
166
+ .dtl-title {
167
+ font-size: 16px;
168
+ font-weight: 700;
169
+ position: relative;
170
+ }
171
+
172
+ .dtl-btns {
173
+ flex: 1;
174
+ text-align: right;
175
+ }
176
+ }
177
+
178
+ .dtl-body {
179
+ height: 0;
180
+ flex: 1;
181
+ overflow: auto;
182
+ }
183
+
184
+ .dtl-flex {
185
+ display: flex;
186
+ flex-direction: column;
187
+ }
188
+ }
189
+
190
+ .flex {
191
+ flex: 1;
192
+ }
193
+
194
+ .flex-column {
195
+ display: flex;
196
+ flex-direction: column;
197
+
198
+ .flex {
199
+ height: 0;
200
+ }
201
+ }
202
+
203
+ .flex-row {
204
+ display: flex;
205
+ flex-direction: row;
206
+
207
+ .flex {
208
+ width: 0;
209
+ }
210
+ }
211
+
212
+ .page404 {
213
+ width: 100%;
214
+ height: 100%;
215
+ text-align: center;
216
+ padding-top: 10%;
217
+ font-size: 15px;
218
+ font-weight: 600;
219
+ color: gray;
220
+ background-color: #fff;
221
+
222
+ img {
223
+ vertical-align: bottom;
224
+ padding-right: 5px;
225
+ }
226
+ }
227
+
228
+ .loading {
229
+ height: 100%;
230
+ width: 100%;
231
+ position: absolute;
232
+ display: flex;
233
+ align-items: center;
234
+ justify-content: center;
235
+ background: #fff;
236
+ }
237
+
238
+ #myloading {
239
+ position: fixed;
240
+ top: 0;
241
+ left: 0;
242
+ bottom: 0;
243
+ right: 0;
244
+ z-index: 9999;
245
+ display: flex;
246
+ align-items: center;
247
+ background-color: rgba(226, 227, 231, 0.35);
248
+ justify-content: center;
249
+
250
+ .load-text {
251
+ padding: 4px 20px;
252
+ background-color: #fff;
253
+ border-radius: 4px;
254
+ }
255
+ }
256
+
257
+
258
+ a {
259
+ color: var(--ant-primary-color);
260
+ }
261
+
262
+ a:hover {
263
+ color: var(--ant-primary-5);
264
+ }
265
+
266
+ .image-selector,
267
+ .icon-selector {
268
+ .img-upload {
269
+ width: 40px;
270
+ height: 40px;
271
+ }
272
+
273
+ .ant-upload-select {
274
+
275
+ .img-wrapper {
276
+ position: relative;
277
+
278
+ .clear-btn {
279
+ position: absolute;
280
+ left: 0;
281
+ top: 0;
282
+ width: 100%;
283
+ height: 100%;
284
+ background: rgba(199, 202, 212, 0.9);
285
+ display: flex;
286
+ align-items: flex-start;
287
+ padding: 4px;
288
+ color: #1f4265;
289
+ justify-content: end;
290
+ display: none;
291
+ }
292
+
293
+ &:hover {
294
+ .clear-btn {
295
+ display: flex;
296
+ }
297
+ }
298
+
299
+ .img-preview {
300
+ max-width: 150px;
301
+ max-height: 150px;
302
+ }
303
+ }
304
+ }
305
+
306
+
307
+
308
+ .img-choose {
309
+ margin: 8px 0;
310
+ }
311
+
312
+ .img-desc {
313
+ color: rgba(69, 77, 100, 0.7)
314
+ }
315
+
316
+ .ant-modal-body {
317
+ padding: 8px;
318
+ max-height: calc(100vh - 180px);
319
+ overflow-y: auto;
320
+ }
321
+ }
322
+
323
+
324
+ .description-card {
325
+
326
+ .ant-pro-card-header {
327
+ height: 50px;
328
+ }
329
+
330
+ .ant-pro-card-body {
331
+ padding: 12px 24px 2px;
332
+ }
333
+
334
+ .ant-pro-card-header-border {
335
+ border-bottom: 1px solid #dbeafa;
336
+ }
337
+ }
338
+
339
+ .has-background {
340
+ background: #f6fafe;
341
+
342
+ .ant-descriptions-row>td,
343
+ .ant-descriptions-row>th {
344
+ padding-bottom: 10px
345
+ }
346
+ }
347
+
348
+
349
+ .ls-group-tip {
350
+ display: flex;
351
+ position: relative;
352
+ width: 100%;
353
+ align-items: center;
354
+ background: #fff;
355
+ padding-bottom: 12px;
356
+
357
+ .ls-group-divider {
358
+ height: 14px;
359
+ border-right: 2px solid var(--ant-primary-color);
360
+ }
361
+
362
+ .ls-group-text {
363
+ font-size: 14px;
364
+ color: #181818;
365
+ padding-left: 8px;
366
+ }
367
+ }
368
+
369
+ .ls-input-table {
370
+ .ant-pro-table-search {
371
+ box-shadow: none !important;
372
+ padding: 0 !important;
373
+ }
374
+
375
+ .ant-pro-table-list-toolbar {
376
+ padding-top: 0px;
377
+ min-height: 30px;
378
+ }
379
+ }
380
+
381
+
382
+ //-------------------省市区组件样式-----------
383
+ //最外层盒子
384
+ .ls-area-cascaded-box {
385
+ width: 600px;
386
+ display: flex;
387
+ flex-direction: column;
388
+ transition: all 0.3s;
389
+
390
+ .ls-area-cascaded-header {
391
+ width: 100%;
392
+ padding: 2px 0 6px;
393
+ border-bottom: 1px solid #f0f0f0;
394
+ display: flex;
395
+ flex-direction: row;
396
+ justify-content: space-around;
397
+ justify-content: center;
398
+
399
+ .ls-word-box-display {
400
+ margin: 0 10px;
401
+ font-size: 14px;
402
+ font-weight: 100;
403
+
404
+ button {
405
+ border: none;
406
+ background-color: var(--ant-primary-2, #f0f9ff);
407
+
408
+ &[disabled] {
409
+ background-color: #fafafa !important;
410
+
411
+ .ls-myself-select-title-style {
412
+ color: var(--ant-primary-4, #a3d7ff);
413
+ transition: all 0.3s;
414
+ }
415
+ }
416
+ }
417
+
418
+ .ls-myself-select-title-style {
419
+ color: var(--ant-primary-color, rgb(69, 154, 220));
420
+ font-size: 14px;
421
+ font-weight: 600;
422
+ transition: all 0.3s;
423
+ }
424
+ }
425
+
426
+ .ls-icon-box-display {
427
+ display: flex;
428
+ align-items: center;
429
+ }
430
+ }
431
+
432
+ .ls-area-cascaded-body {
433
+ width: 100%;
434
+ min-height: 100px;
435
+ max-height: 350px;
436
+ overflow: auto;
437
+ padding: 8px 12px 4px;
438
+ display: grid;
439
+ grid-template-columns: repeat(4, 1fr);
440
+ gap: 4px;
441
+ justify-content: start;
442
+ align-content: flex-start;
443
+ align-items: center;
444
+
445
+ .ls-area-cascaded-span {
446
+ text-align: center;
447
+ padding: 6px 10px;
448
+
449
+ //文字不换行,超出省略
450
+ overflow: hidden;
451
+ text-overflow: ellipsis;
452
+ white-space: nowrap;
453
+ cursor: pointer;
454
+
455
+ &.ls-area-selected,
456
+ &:hover {
457
+ color: var(--ant-primary-color, rgb(69, 154, 220));
458
+ transition: all 0.3s;
459
+ }
460
+ }
461
+ }
462
+ }
463
+
464
+ //手动指定盒子位置
465
+ .ls-area-box-position {
466
+ .ls-ant-select-dropdown {
467
+ top: 36px !important;
468
+ }
469
+ }
470
+
471
+
472
+ @import url('./antd-custom.less');
473
+
474
+ //-------------------省市区组件样式-----------
@@ -0,0 +1,47 @@
1
+ import type { ActionType } from 'ls-pro-table';
2
+ import type { ProFormInstance } from 'ls-pro-form';
3
+ import type { SingleParamType } from '../useSingle';
4
+ export declare type DtlParamType = SingleParamType & {
5
+ /**重置主表对象方法 */
6
+ setMaster?: (item: any) => void;
7
+ /**@name 主表主键字段 */
8
+ mstKeyField: string;
9
+ /**@name 从表服务 */
10
+ dtlService: any;
11
+ /**@name 从表关联字段 */
12
+ relationField: string;
13
+ /**@name 从表新增行时默认值 */
14
+ dtlItem: any;
15
+ /**@name 从表名,主从表一起保存时必传参 */
16
+ dtlName?: string;
17
+ /**@name 单据类型,主从表一起保存时必传参 */
18
+ billType?: string;
19
+ /**@name 动态编码规则字段,主从表一起保存传参 */
20
+ codeRuleDynamicField?: string;
21
+ /** 是否查询历史数据,通过主表查询面板用户受控组件传入 */
22
+ ifHistory?: 0 | 1;
23
+ };
24
+ declare function useDtl(dtlParam: DtlParamType): {
25
+ formRef: import("react").MutableRefObject<ProFormInstance<any> | undefined>;
26
+ tableRef: import("react").MutableRefObject<ActionType | undefined>;
27
+ dtlFormRef: import("react").MutableRefObject<ProFormInstance<any> | undefined>;
28
+ selectedRows: any;
29
+ showEdit: boolean;
30
+ editItem: any;
31
+ tableTools: (boolean | JSX.Element)[];
32
+ setSelectedRows: import("react").Dispatch<any>;
33
+ setShowEdit: import("react").Dispatch<import("react").SetStateAction<boolean>>;
34
+ setEditItem: import("react").Dispatch<any>;
35
+ onRemoveDtl: (rows?: any) => void;
36
+ onSaveDtl: (formData: any) => Promise<boolean>;
37
+ onLoadDtl: (params: Record<string, any>, sort: Record<string, any>, filter: Record<string, any>) => Promise<any>;
38
+ onAddDtl: (item?: any) => Promise<boolean>;
39
+ onEditDtl: (item?: any) => Promise<boolean>;
40
+ onSaveMst: (values: any) => Promise<boolean>;
41
+ onSaveMstDtl: (isDelete?: boolean) => Promise<boolean | undefined>;
42
+ onRemoveMst: () => Promise<boolean | undefined>;
43
+ onExportDtl: (url: string, param: any) => Promise<boolean>;
44
+ isAudit: () => boolean;
45
+ onAudit: () => Promise<void>;
46
+ };
47
+ export default useDtl;