yootd 0.0.4 → 0.0.6
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.
- package/LICENSE +21 -21
- package/dist/Preview/index.scss +35 -35
- package/dist/approval-process/index.scss +95 -95
- package/dist/areas/index.scss +21 -21
- package/dist/button/index.scss +30 -30
- package/dist/dropdown/assets/arrow-down.svg +5 -5
- package/dist/empty/index.scss +15 -15
- package/dist/group-title/index.scss +31 -31
- package/dist/image/index.scss +26 -26
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/modal/index.scss +65 -65
- package/dist/pagination/index.scss +47 -47
- package/dist/school/index.js +1 -1
- package/dist/school/index.scss +21 -21
- package/dist/state/index.scss +89 -89
- package/dist/steps/index.scss +32 -32
- package/dist/student-dropdown/index.d.ts +3 -0
- package/dist/student-dropdown/index.js +66 -0
- package/dist/student-dropdown/types/types.d.ts +44 -0
- package/dist/table/components/primary-header-row/index.scss +58 -58
- package/dist/table/components/primary-tbody-row/index.scss +5 -5
- package/dist/table/index.module.scss +9 -9
- package/dist/table/index.scss +33 -33
- package/dist/tree/index.scss +25 -25
- package/dist/upload/index.scss +115 -115
- package/dist/user-dropdown/index.js +3 -3
- package/dist/user-dropdown/types/types.d.ts +1 -1
- package/dist/year-term/index.scss +21 -21
- package/dist/year-term/types/types.d.ts +28 -28
- package/dist/zones/index.module.scss +23 -23
- package/package.json +1 -1
package/dist/modal/index.scss
CHANGED
@@ -1,65 +1,65 @@
|
|
1
|
-
.yot-modal {
|
2
|
-
padding-top: 13px;
|
3
|
-
position: relative;
|
4
|
-
max-width: calc(2 / 3 * 100vw) !important;
|
5
|
-
|
6
|
-
& > div:first-child {
|
7
|
-
box-sizing: border-box;
|
8
|
-
padding: 4px;
|
9
|
-
background: linear-gradient(180deg, #3a8cff 0%, #c4ddff 100%);
|
10
|
-
border-radius: 24px;
|
11
|
-
}
|
12
|
-
|
13
|
-
.ant-modal-header {
|
14
|
-
width: 100%;
|
15
|
-
position: absolute;
|
16
|
-
left: 0;
|
17
|
-
top: -13px;
|
18
|
-
background-color: transparent;
|
19
|
-
}
|
20
|
-
|
21
|
-
.ant-modal-content {
|
22
|
-
padding: var(--ant-margin-xl);
|
23
|
-
padding-top: 71px;
|
24
|
-
border-radius: 24px;
|
25
|
-
}
|
26
|
-
|
27
|
-
.ant-modal-body {
|
28
|
-
max-height: 529px;
|
29
|
-
overflow-y: auto;
|
30
|
-
}
|
31
|
-
|
32
|
-
.ant-modal-footer {
|
33
|
-
margin-top: 40px;
|
34
|
-
}
|
35
|
-
|
36
|
-
&-title {
|
37
|
-
&-content {
|
38
|
-
width: 100%;
|
39
|
-
display: flex;
|
40
|
-
justify-content: center;
|
41
|
-
align-items: center;
|
42
|
-
|
43
|
-
&__body {
|
44
|
-
position: absolute;
|
45
|
-
color: var(--ant-color-bg-base);
|
46
|
-
font-size: var(--ant-font-size-heading-3);
|
47
|
-
}
|
48
|
-
|
49
|
-
&__icon {
|
50
|
-
.path-1 {
|
51
|
-
fill: var(--yot-modal-color-tertiary);
|
52
|
-
}
|
53
|
-
.path-2 {
|
54
|
-
fill: var(--yot-modal-color-tertiary);
|
55
|
-
}
|
56
|
-
.stop-color-1 {
|
57
|
-
stop-color: var(--yot-modal-color-secondary);
|
58
|
-
}
|
59
|
-
.stop-color-2 {
|
60
|
-
stop-color: var(--yot-modal-color-primary);
|
61
|
-
}
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
65
|
-
}
|
1
|
+
.yot-modal {
|
2
|
+
padding-top: 13px;
|
3
|
+
position: relative;
|
4
|
+
max-width: calc(2 / 3 * 100vw) !important;
|
5
|
+
|
6
|
+
& > div:first-child {
|
7
|
+
box-sizing: border-box;
|
8
|
+
padding: 4px;
|
9
|
+
background: linear-gradient(180deg, #3a8cff 0%, #c4ddff 100%);
|
10
|
+
border-radius: 24px;
|
11
|
+
}
|
12
|
+
|
13
|
+
.ant-modal-header {
|
14
|
+
width: 100%;
|
15
|
+
position: absolute;
|
16
|
+
left: 0;
|
17
|
+
top: -13px;
|
18
|
+
background-color: transparent;
|
19
|
+
}
|
20
|
+
|
21
|
+
.ant-modal-content {
|
22
|
+
padding: var(--ant-margin-xl);
|
23
|
+
padding-top: 71px;
|
24
|
+
border-radius: 24px;
|
25
|
+
}
|
26
|
+
|
27
|
+
.ant-modal-body {
|
28
|
+
max-height: 529px;
|
29
|
+
overflow-y: auto;
|
30
|
+
}
|
31
|
+
|
32
|
+
.ant-modal-footer {
|
33
|
+
margin-top: 40px;
|
34
|
+
}
|
35
|
+
|
36
|
+
&-title {
|
37
|
+
&-content {
|
38
|
+
width: 100%;
|
39
|
+
display: flex;
|
40
|
+
justify-content: center;
|
41
|
+
align-items: center;
|
42
|
+
|
43
|
+
&__body {
|
44
|
+
position: absolute;
|
45
|
+
color: var(--ant-color-bg-base);
|
46
|
+
font-size: var(--ant-font-size-heading-3);
|
47
|
+
}
|
48
|
+
|
49
|
+
&__icon {
|
50
|
+
.path-1 {
|
51
|
+
fill: var(--yot-modal-color-tertiary);
|
52
|
+
}
|
53
|
+
.path-2 {
|
54
|
+
fill: var(--yot-modal-color-tertiary);
|
55
|
+
}
|
56
|
+
.stop-color-1 {
|
57
|
+
stop-color: var(--yot-modal-color-secondary);
|
58
|
+
}
|
59
|
+
.stop-color-2 {
|
60
|
+
stop-color: var(--yot-modal-color-primary);
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
@@ -1,47 +1,47 @@
|
|
1
|
-
.yot-pagination {
|
2
|
-
&--small {
|
3
|
-
.ant-pagination-item-active {
|
4
|
-
border-color: var(--ant-color-primary);
|
5
|
-
a {
|
6
|
-
color: var(--ant-color-primary);
|
7
|
-
}
|
8
|
-
}
|
9
|
-
.ant-select-selection-item {
|
10
|
-
color: var(--ant-color-text-secondary);
|
11
|
-
}
|
12
|
-
.ant-pagination-options-quick-jumper {
|
13
|
-
color: var(--ant-color-text-secondary);
|
14
|
-
}
|
15
|
-
.ant-pagination-item-link {
|
16
|
-
color: var(--ant-color-text-secondary);
|
17
|
-
}
|
18
|
-
}
|
19
|
-
|
20
|
-
&--default {
|
21
|
-
.ant-pagination-total-text {
|
22
|
-
color: var(--ant-color-text-secondary);
|
23
|
-
}
|
24
|
-
.ant-pagination-item-active {
|
25
|
-
background-color: var(--ant-color-primary);
|
26
|
-
border-color: var(--ant-color-primary);
|
27
|
-
a {
|
28
|
-
color: var(--ant-color-white);
|
29
|
-
transition: none;
|
30
|
-
}
|
31
|
-
}
|
32
|
-
.ant-pagination-item-active:hover {
|
33
|
-
a {
|
34
|
-
color: var(--ant-color-white);
|
35
|
-
}
|
36
|
-
}
|
37
|
-
.ant-select-selection-item {
|
38
|
-
color: var(--ant-color-text-secondary);
|
39
|
-
}
|
40
|
-
.ant-pagination-options-quick-jumper {
|
41
|
-
color: var(--ant-color-text-secondary);
|
42
|
-
}
|
43
|
-
.ant-pagination-item-link {
|
44
|
-
color: var(--ant-color-text-secondary);
|
45
|
-
}
|
46
|
-
}
|
47
|
-
}
|
1
|
+
.yot-pagination {
|
2
|
+
&--small {
|
3
|
+
.ant-pagination-item-active {
|
4
|
+
border-color: var(--ant-color-primary);
|
5
|
+
a {
|
6
|
+
color: var(--ant-color-primary);
|
7
|
+
}
|
8
|
+
}
|
9
|
+
.ant-select-selection-item {
|
10
|
+
color: var(--ant-color-text-secondary);
|
11
|
+
}
|
12
|
+
.ant-pagination-options-quick-jumper {
|
13
|
+
color: var(--ant-color-text-secondary);
|
14
|
+
}
|
15
|
+
.ant-pagination-item-link {
|
16
|
+
color: var(--ant-color-text-secondary);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
&--default {
|
21
|
+
.ant-pagination-total-text {
|
22
|
+
color: var(--ant-color-text-secondary);
|
23
|
+
}
|
24
|
+
.ant-pagination-item-active {
|
25
|
+
background-color: var(--ant-color-primary);
|
26
|
+
border-color: var(--ant-color-primary);
|
27
|
+
a {
|
28
|
+
color: var(--ant-color-white);
|
29
|
+
transition: none;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
.ant-pagination-item-active:hover {
|
33
|
+
a {
|
34
|
+
color: var(--ant-color-white);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
.ant-select-selection-item {
|
38
|
+
color: var(--ant-color-text-secondary);
|
39
|
+
}
|
40
|
+
.ant-pagination-options-quick-jumper {
|
41
|
+
color: var(--ant-color-text-secondary);
|
42
|
+
}
|
43
|
+
.ant-pagination-item-link {
|
44
|
+
color: var(--ant-color-text-secondary);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
package/dist/school/index.js
CHANGED
@@ -184,7 +184,7 @@ export var School = function School(_ref) {
|
|
184
184
|
return gradeId != null ? (_allGradeAndClassOpti = allGradeAndClassOptions === null || allGradeAndClassOptions === void 0 ? void 0 : allGradeAndClassOptions[gradeId]) !== null && _allGradeAndClassOpti !== void 0 ? _allGradeAndClassOpti : [] : allClassOptions;
|
185
185
|
}
|
186
186
|
return [];
|
187
|
-
}, [type, collegeId, gradeId,
|
187
|
+
}, [type, collegeId, gradeId, allCollegeAndMajorOptions, allMajorOptions, allGradeAndClassOptions, allClassOptions]);
|
188
188
|
// 第一个下拉框的placeholder
|
189
189
|
var firstSelectPlaceholder = useMemo(function () {
|
190
190
|
if (type === 'collegeMajor' || type === 'college') {
|
package/dist/school/index.scss
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
.yot-School {
|
2
|
-
border: var(--ant-line-width) var(--ant-line-type) var(--ant-color-border);
|
3
|
-
border-radius: var(--ant-border-radius);
|
4
|
-
&-school-select::after {
|
5
|
-
content: '';
|
6
|
-
position: absolute;
|
7
|
-
right: 0;
|
8
|
-
top: 50%; /* 从中间开始 */
|
9
|
-
width: 1px; /* 边框宽度 */
|
10
|
-
height: 50%; /* 设为盒子高度的百分之五十 */
|
11
|
-
background-color: var(--ant-color-border); /* 边框颜色 */
|
12
|
-
transform: translateY(-50%);
|
13
|
-
}
|
14
|
-
.ant-select.ant-select-outlined.css-var-yootd.ant-select-css-var.ant-select-single.ant-select-allow-clear.ant-select-show-arrow {
|
15
|
-
.ant-select-selector {
|
16
|
-
padding-left: var(--ant-padding);
|
17
|
-
padding-right: var(--ant-padding);
|
18
|
-
border: 0;
|
19
|
-
}
|
20
|
-
}
|
21
|
-
}
|
1
|
+
.yot-School {
|
2
|
+
border: var(--ant-line-width) var(--ant-line-type) var(--ant-color-border);
|
3
|
+
border-radius: var(--ant-border-radius);
|
4
|
+
&-school-select::after {
|
5
|
+
content: '';
|
6
|
+
position: absolute;
|
7
|
+
right: 0;
|
8
|
+
top: 50%; /* 从中间开始 */
|
9
|
+
width: 1px; /* 边框宽度 */
|
10
|
+
height: 50%; /* 设为盒子高度的百分之五十 */
|
11
|
+
background-color: var(--ant-color-border); /* 边框颜色 */
|
12
|
+
transform: translateY(-50%);
|
13
|
+
}
|
14
|
+
.ant-select.ant-select-outlined.css-var-yootd.ant-select-css-var.ant-select-single.ant-select-allow-clear.ant-select-show-arrow {
|
15
|
+
.ant-select-selector {
|
16
|
+
padding-left: var(--ant-padding);
|
17
|
+
padding-right: var(--ant-padding);
|
18
|
+
border: 0;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
package/dist/state/index.scss
CHANGED
@@ -1,89 +1,89 @@
|
|
1
|
-
.yot-state {
|
2
|
-
&--circle {
|
3
|
-
.ant-badge.success {
|
4
|
-
.ant-badge-status-success {
|
5
|
-
background-color: var(--ant-color-success);
|
6
|
-
}
|
7
|
-
.ant-badge-status-text {
|
8
|
-
color: var(--ant-color-success);
|
9
|
-
}
|
10
|
-
}
|
11
|
-
.ant-badge.error {
|
12
|
-
.ant-badge-status-error {
|
13
|
-
background-color: var(--ant-color-error);
|
14
|
-
}
|
15
|
-
.ant-badge-status-text {
|
16
|
-
color: var(--ant-color-error);
|
17
|
-
}
|
18
|
-
}
|
19
|
-
.ant-badge.warning {
|
20
|
-
.ant-badge-status-warning {
|
21
|
-
background-color: var(--ant-color-warning);
|
22
|
-
}
|
23
|
-
.ant-badge-status-text {
|
24
|
-
color: var(--ant-color-warning);
|
25
|
-
}
|
26
|
-
}
|
27
|
-
.ant-badge.default {
|
28
|
-
.ant-badge-status-default {
|
29
|
-
background-color: var(--ant-color-text-placeholder);
|
30
|
-
}
|
31
|
-
.ant-badge-status-text {
|
32
|
-
color: var(--ant-color-text-placeholder);
|
33
|
-
}
|
34
|
-
}
|
35
|
-
.ant-badge.processing {
|
36
|
-
.ant-badge-status-processing {
|
37
|
-
background-color: var(--ant-color-primary);
|
38
|
-
}
|
39
|
-
.ant-badge-status-text {
|
40
|
-
color: var(--ant-color-primary);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
}
|
44
|
-
&--card {
|
45
|
-
.ant-tag.ant-tag-success {
|
46
|
-
background-color: var(--ant-color-success);
|
47
|
-
color: var(--ant-color-white);
|
48
|
-
}
|
49
|
-
.ant-tag.ant-tag-error {
|
50
|
-
background-color: var(--ant-color-error);
|
51
|
-
color: var(--ant-color-white);
|
52
|
-
}
|
53
|
-
.ant-tag.ant-tag-warning {
|
54
|
-
background-color: var(--ant-color-warning);
|
55
|
-
color: var(--ant-color-white);
|
56
|
-
}
|
57
|
-
.ant-tag.ant-tag-default {
|
58
|
-
background-color: var(--ant-color-text-placeholder);
|
59
|
-
color: var(--ant-color-white);
|
60
|
-
}
|
61
|
-
.ant-tag.ant-tag-processing {
|
62
|
-
background-color: var(--ant-color-primary);
|
63
|
-
color: var(--ant-color-white);
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
&--process {
|
68
|
-
.ant-tag.ant-tag-success {
|
69
|
-
background-color: var(--ant-color-success-bg);
|
70
|
-
color: var(--ant-color-success);
|
71
|
-
}
|
72
|
-
.ant-tag.ant-tag-error {
|
73
|
-
background-color: var(--ant-color-error-bg);
|
74
|
-
color: var(--ant-color-error);
|
75
|
-
}
|
76
|
-
.ant-tag.ant-tag-warning {
|
77
|
-
background-color: var(--ant-color-warning-bg);
|
78
|
-
color: var(--ant-color-warning);
|
79
|
-
}
|
80
|
-
.ant-tag.ant-tag-default {
|
81
|
-
background-color: var(--ant-color-border-secondary);
|
82
|
-
color: var(--ant-color-border);
|
83
|
-
}
|
84
|
-
.ant-tag.ant-tag-processing {
|
85
|
-
background-color: var(--ant-color-primary-bg);
|
86
|
-
color: var(--ant-color-primary);
|
87
|
-
}
|
88
|
-
}
|
89
|
-
}
|
1
|
+
.yot-state {
|
2
|
+
&--circle {
|
3
|
+
.ant-badge.success {
|
4
|
+
.ant-badge-status-success {
|
5
|
+
background-color: var(--ant-color-success);
|
6
|
+
}
|
7
|
+
.ant-badge-status-text {
|
8
|
+
color: var(--ant-color-success);
|
9
|
+
}
|
10
|
+
}
|
11
|
+
.ant-badge.error {
|
12
|
+
.ant-badge-status-error {
|
13
|
+
background-color: var(--ant-color-error);
|
14
|
+
}
|
15
|
+
.ant-badge-status-text {
|
16
|
+
color: var(--ant-color-error);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
.ant-badge.warning {
|
20
|
+
.ant-badge-status-warning {
|
21
|
+
background-color: var(--ant-color-warning);
|
22
|
+
}
|
23
|
+
.ant-badge-status-text {
|
24
|
+
color: var(--ant-color-warning);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
.ant-badge.default {
|
28
|
+
.ant-badge-status-default {
|
29
|
+
background-color: var(--ant-color-text-placeholder);
|
30
|
+
}
|
31
|
+
.ant-badge-status-text {
|
32
|
+
color: var(--ant-color-text-placeholder);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
.ant-badge.processing {
|
36
|
+
.ant-badge-status-processing {
|
37
|
+
background-color: var(--ant-color-primary);
|
38
|
+
}
|
39
|
+
.ant-badge-status-text {
|
40
|
+
color: var(--ant-color-primary);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
&--card {
|
45
|
+
.ant-tag.ant-tag-success {
|
46
|
+
background-color: var(--ant-color-success);
|
47
|
+
color: var(--ant-color-white);
|
48
|
+
}
|
49
|
+
.ant-tag.ant-tag-error {
|
50
|
+
background-color: var(--ant-color-error);
|
51
|
+
color: var(--ant-color-white);
|
52
|
+
}
|
53
|
+
.ant-tag.ant-tag-warning {
|
54
|
+
background-color: var(--ant-color-warning);
|
55
|
+
color: var(--ant-color-white);
|
56
|
+
}
|
57
|
+
.ant-tag.ant-tag-default {
|
58
|
+
background-color: var(--ant-color-text-placeholder);
|
59
|
+
color: var(--ant-color-white);
|
60
|
+
}
|
61
|
+
.ant-tag.ant-tag-processing {
|
62
|
+
background-color: var(--ant-color-primary);
|
63
|
+
color: var(--ant-color-white);
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
&--process {
|
68
|
+
.ant-tag.ant-tag-success {
|
69
|
+
background-color: var(--ant-color-success-bg);
|
70
|
+
color: var(--ant-color-success);
|
71
|
+
}
|
72
|
+
.ant-tag.ant-tag-error {
|
73
|
+
background-color: var(--ant-color-error-bg);
|
74
|
+
color: var(--ant-color-error);
|
75
|
+
}
|
76
|
+
.ant-tag.ant-tag-warning {
|
77
|
+
background-color: var(--ant-color-warning-bg);
|
78
|
+
color: var(--ant-color-warning);
|
79
|
+
}
|
80
|
+
.ant-tag.ant-tag-default {
|
81
|
+
background-color: var(--ant-color-border-secondary);
|
82
|
+
color: var(--ant-color-border);
|
83
|
+
}
|
84
|
+
.ant-tag.ant-tag-processing {
|
85
|
+
background-color: var(--ant-color-primary-bg);
|
86
|
+
color: var(--ant-color-primary);
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
package/dist/steps/index.scss
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
.yot-steps{
|
2
|
-
&-content{
|
3
|
-
.ant-steps-item.ant-steps-item-finish{
|
4
|
-
.ant-steps-item-icon{
|
5
|
-
background-color: var(--ant-color-primary);
|
6
|
-
.ant-steps-finish-icon{
|
7
|
-
svg{
|
8
|
-
fill: var(--ant-color-white);
|
9
|
-
}
|
10
|
-
}
|
11
|
-
}
|
12
|
-
}
|
13
|
-
.ant-steps-item{
|
14
|
-
.ant-steps-item-container{
|
15
|
-
.ant-steps-item-content{
|
16
|
-
.ant-steps-item-title::after{
|
17
|
-
background: repeating-linear-gradient(to right, var(--ant-color-fill), var(--ant-color-fill) 3px, transparent 3px, transparent 6px);
|
18
|
-
}
|
19
|
-
}
|
20
|
-
}
|
21
|
-
}
|
22
|
-
.ant-steps-item.ant-steps-item-finish{
|
23
|
-
.ant-steps-item-container{
|
24
|
-
.ant-steps-item-content{
|
25
|
-
.ant-steps-item-title::after{
|
26
|
-
background: repeating-linear-gradient(to right, var(--ant-color-fill), var(--ant-color-fill) 3px, transparent 3px, transparent 6px);
|
27
|
-
}
|
28
|
-
}
|
29
|
-
}
|
30
|
-
}
|
31
|
-
}
|
32
|
-
}
|
1
|
+
.yot-steps{
|
2
|
+
&-content{
|
3
|
+
.ant-steps-item.ant-steps-item-finish{
|
4
|
+
.ant-steps-item-icon{
|
5
|
+
background-color: var(--ant-color-primary);
|
6
|
+
.ant-steps-finish-icon{
|
7
|
+
svg{
|
8
|
+
fill: var(--ant-color-white);
|
9
|
+
}
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
13
|
+
.ant-steps-item{
|
14
|
+
.ant-steps-item-container{
|
15
|
+
.ant-steps-item-content{
|
16
|
+
.ant-steps-item-title::after{
|
17
|
+
background: repeating-linear-gradient(to right, var(--ant-color-fill), var(--ant-color-fill) 3px, transparent 3px, transparent 6px);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
.ant-steps-item.ant-steps-item-finish{
|
23
|
+
.ant-steps-item-container{
|
24
|
+
.ant-steps-item-content{
|
25
|
+
.ant-steps-item-title::after{
|
26
|
+
background: repeating-linear-gradient(to right, var(--ant-color-fill), var(--ant-color-fill) 3px, transparent 3px, transparent 6px);
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
+
var _excluded = ["label", "connectors", "showSearch", "optionFilterProp", "teacher_id"];
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
11
|
+
import { useQuery } from '@tanstack/react-query';
|
12
|
+
import React, { useMemo } from 'react';
|
13
|
+
import { Select } from "./..";
|
14
|
+
import { useRequest } from "../hooks/useRequest";
|
15
|
+
export var StudentDropdown = function StudentDropdown(_ref) {
|
16
|
+
var _ref$label = _ref.label,
|
17
|
+
label = _ref$label === void 0 ? ['personalName', 'genderName', 'uniqueNumber'] : _ref$label,
|
18
|
+
_ref$connectors = _ref.connectors,
|
19
|
+
connectors = _ref$connectors === void 0 ? '~' : _ref$connectors,
|
20
|
+
_ref$showSearch = _ref.showSearch,
|
21
|
+
showSearch = _ref$showSearch === void 0 ? true : _ref$showSearch,
|
22
|
+
_ref$optionFilterProp = _ref.optionFilterProp,
|
23
|
+
optionFilterProp = _ref$optionFilterProp === void 0 ? 'label' : _ref$optionFilterProp,
|
24
|
+
teacher_id = _ref.teacher_id,
|
25
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
26
|
+
var request = useRequest();
|
27
|
+
// 查询学生数据
|
28
|
+
var _useQuery = useQuery({
|
29
|
+
queryKey: ['teacherData', teacher_id],
|
30
|
+
queryFn: function queryFn() {
|
31
|
+
return request('v1/users/by/name_no', {
|
32
|
+
params: {
|
33
|
+
user_type: 1,
|
34
|
+
teacher_id: teacher_id
|
35
|
+
}
|
36
|
+
});
|
37
|
+
},
|
38
|
+
enabled: teacher_id != null
|
39
|
+
}),
|
40
|
+
userData = _useQuery.data,
|
41
|
+
userLoading = _useQuery.isLoading;
|
42
|
+
// 将搜索到的数据处理成下拉框
|
43
|
+
var allUserOptions = useMemo(function () {
|
44
|
+
var _userData$content;
|
45
|
+
var userLabel = userData === null || userData === void 0 || (_userData$content = userData.content) === null || _userData$content === void 0 ? void 0 : _userData$content.map(function (item) {
|
46
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
47
|
+
genderName: item.gender != null ? item.gender === 1 ? '男' : '女' : '性别未知'
|
48
|
+
});
|
49
|
+
});
|
50
|
+
return userLabel === null || userLabel === void 0 ? void 0 : userLabel.map(function (item) {
|
51
|
+
var _label$map$join;
|
52
|
+
return {
|
53
|
+
label: label === null || label === void 0 || (_label$map$join = label.map(function (key) {
|
54
|
+
return item[key];
|
55
|
+
}).join(connectors)) === null || _label$map$join === void 0 || (_label$map$join = _label$map$join.replace(new RegExp("^".concat(connectors, "+|").concat(connectors, "+$"), 'g'), '')) === null || _label$map$join === void 0 ? void 0 : _label$map$join.replace(new RegExp("".concat(connectors, "{2,}"), 'g'), connectors),
|
56
|
+
value: item.userId
|
57
|
+
};
|
58
|
+
});
|
59
|
+
}, [userData]);
|
60
|
+
return /*#__PURE__*/React.createElement(Select, _extends({
|
61
|
+
loading: userLoading,
|
62
|
+
showSearch: showSearch,
|
63
|
+
optionFilterProp: optionFilterProp,
|
64
|
+
options: allUserOptions
|
65
|
+
}, rest));
|
66
|
+
};
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { SelectProps } from 'yootd';
|
2
|
+
|
3
|
+
export interface PageData<T> {
|
4
|
+
content: T[];
|
5
|
+
page: {
|
6
|
+
number: number;
|
7
|
+
size: number;
|
8
|
+
totalElements: number;
|
9
|
+
totalPages: number;
|
10
|
+
};
|
11
|
+
}
|
12
|
+
type LabelOptions =
|
13
|
+
| 'uniqueNumber'
|
14
|
+
| 'personalName'
|
15
|
+
| 'majorName'
|
16
|
+
| 'collegeMajorName'
|
17
|
+
| 'className'
|
18
|
+
| 'gradeName'
|
19
|
+
| 'genderName'
|
20
|
+
| 'deptName'
|
21
|
+
| 'credentialsNo'
|
22
|
+
| 'personalMobile';
|
23
|
+
export type StudentDropdownProps = SelectProps & {
|
24
|
+
label?: LabelOptions[];
|
25
|
+
connectors?: string;
|
26
|
+
teacher_id: number;
|
27
|
+
};
|
28
|
+
export interface IuserItem {
|
29
|
+
userId: string; // ID
|
30
|
+
uniqueNumber?: string; // 学号/工号
|
31
|
+
personalName: string; // 姓名
|
32
|
+
personalPhoto?: string; // 照片
|
33
|
+
userFaceType?: number; // 人脸类型(1白名单2黑名单3红名单)
|
34
|
+
majorName?: string; // 专业名称
|
35
|
+
collegeMajorName?: string; // 院系名称
|
36
|
+
className?: string; // 班级名称
|
37
|
+
gradeName?: string; // 年级名称
|
38
|
+
genderName?: string; // 性别
|
39
|
+
deptId?: number; // 部门ID
|
40
|
+
deptName?: string; // 部门名称
|
41
|
+
gender?: number; // 性别
|
42
|
+
credentialsNo?: string; // 证件号
|
43
|
+
personalMobile?: string; // 手机号
|
44
|
+
}
|