@cloudbase/weda-ui 3.4.11 → 3.4.12
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/dist/configs/components/common/form-input-required.js +3 -3
- package/dist/configs/components/customer-service.js +3 -0
- package/dist/configs/components/dataView.js +20 -10
- package/dist/configs/components/form-checkbox.js +15 -2
- package/dist/configs/components/form-email.js +17 -2
- package/dist/configs/components/form-input.js +17 -2
- package/dist/configs/components/form-phone.js +17 -2
- package/dist/configs/components/form-radio.js +15 -2
- package/dist/configs/components/form-select-multiple.js +362 -0
- package/dist/configs/components/form-switch.js +15 -2
- package/dist/configs/components/form-text-area.js +15 -2
- package/dist/configs/components/form-url.js +17 -2
- package/dist/configs/components/form-user-tree-select.js +13 -0
- package/dist/configs/components/listView.js +32 -49
- package/dist/configs/components/table.json +1 -54
- package/dist/configs/components/wd-bubble.js +46 -8
- package/dist/configs/components/wd-button.js +3 -0
- package/dist/configs/components/wd-checkbox.js +464 -0
- package/dist/configs/components/wd-form.js +66 -10
- package/dist/configs/components/wd-input-email.js +37 -0
- package/dist/configs/components/wd-input-phone.js +43 -0
- package/dist/configs/components/wd-input-url.js +37 -0
- package/dist/configs/components/wd-input.js +94 -0
- package/dist/configs/components/wd-official-account.js +87 -0
- package/dist/configs/components/wd-radio.js +443 -0
- package/dist/configs/components/wd-switch.js +315 -0
- package/dist/configs/components/wd-table.js +8 -56
- package/dist/configs/components/wd-textarea.js +82 -0
- package/dist/configs/components/wd-tree.js +443 -0
- package/dist/configs/components/web-view.js +3 -0
- package/dist/configs/index.js +24 -1
- package/dist/configs/type-utils/type-form.js +681 -0
- package/dist/docs/common/components/json-schema-view.js +1 -1
- package/dist/docs/common/components/methods-view.js +1 -1
- package/dist/docs/common/components/properties-view.js +3 -1
- package/dist/docs/common/format.js +7 -7
- package/dist/docs/common/tableView.js +3 -1
- package/dist/enum/index.js +196 -0
- package/dist/style/index.scss +1 -1
- package/dist/web/actions/showMessage/index.js +4 -1
- package/dist/web/components/carousel/index.js +1 -1
- package/dist/web/components/customer-service/customer-service.js +19 -2
- package/dist/web/components/dataView/index.js +16 -3
- package/dist/web/components/flow/common/hooks/useCommonFlowData/flow-get.js +5 -1
- package/dist/web/components/flow/common/request.js +5 -5
- package/dist/web/components/flow/modules/operations/controls-items/flow-task-info-modal.js +90 -0
- package/dist/web/components/form/formcell/index.css +13 -1
- package/dist/web/components/form/formcell/index.js +1 -1
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +1 -1
- package/dist/web/components/form/select/dropdown-select/index.js +7 -1
- package/dist/web/components/form/select/h5.js +18 -8
- package/dist/web/components/form/select/index.js +9 -9
- package/dist/web/components/form/select/region/index.js +1 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/h5.js +111 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/index.css +270 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/index.js +206 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/pc.js +115 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/ui.js +113 -0
- package/dist/web/components/form/selectMultiple/h5.js +40 -0
- package/dist/web/components/form/selectMultiple/index.js +94 -0
- package/dist/web/components/form/selectMultiple/request.js +76 -0
- package/dist/web/components/form/selectMultiple/status/allEmpty.js +5 -0
- package/dist/web/components/form/selectMultiple/status/empty.js +19 -0
- package/dist/web/components/form/selectMultiple/status/index.css +63 -0
- package/dist/web/components/form/selectMultiple/status/index.js +7 -0
- package/dist/web/components/form/selectMultiple/status/loading.js +19 -0
- package/dist/web/components/form/selectMultiple/status/propsType.js +1 -0
- package/dist/web/components/form/selectMultiple/status/retry.js +19 -0
- package/dist/web/components/form/tips/index.css +9 -3
- package/dist/web/components/form/uploader/index.css +10 -0
- package/dist/web/components/form/uploader/uploader.h5.js +60 -62
- package/dist/web/components/form/uploader/uploader.pc.js +48 -41
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +8 -33
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +8 -37
- package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +76 -50
- package/dist/web/components/form/userOrgSelect/common/utils.js +24 -8
- package/dist/web/components/form/userOrgSelect/component/depart-select/depart-select-pc.js +3 -8
- package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +14 -18
- package/dist/web/components/form/userOrgSelect/component/depart-select/org-modal-pc.js +20 -14
- package/dist/web/components/form/userOrgSelect/component/modal-select-h5.js +1 -1
- package/dist/web/components/form/userOrgSelect/component/org-tree.js +21 -9
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +57 -10
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +2 -7
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.js +6 -4
- package/dist/web/components/form/userOrgSelect/component/userOrgSelect.css +8 -2
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +25 -51
- package/dist/web/components/form/userOrgSelect/hooks/use-depart-data.js +3 -3
- package/dist/web/components/form-input-hooks/index.js +39 -14
- package/dist/web/components/form-select-multiple/index.js +26 -0
- package/dist/web/components/form-user-tree-select/index.js +2 -2
- package/dist/web/components/formdetail/index.css +31 -1
- package/dist/web/components/formdetail/index.js +30 -0
- package/dist/web/components/index.js +17 -1
- package/dist/web/components/listView/index.js +20 -5
- package/dist/web/components/phone/index.js +26 -1
- package/dist/web/components/phoneCode/index.js +3 -1
- package/dist/web/components/richText/index.css +70 -67
- package/dist/web/components/richText/index.js +311 -251
- package/dist/web/components/richText/richtext.module.css +1 -0
- package/dist/web/components/richTextView/index.css +39 -0
- package/dist/web/components/richTextView/index.js +1 -1
- package/dist/web/components/share/index.js +26 -1
- package/dist/web/components/wd-checkbox/checkbox.js +34 -0
- package/dist/web/components/wd-checkbox/index.js +3 -0
- package/dist/web/components/wd-checkbox-list/checkboxList.js +140 -0
- package/dist/web/components/wd-checkbox-list/index.js +3 -0
- package/dist/web/components/wd-form/index.js +25 -12
- package/dist/web/components/wd-form/wd-form.js +42 -0
- package/dist/web/components/wd-form-cell/index.js +3 -0
- package/dist/web/components/wd-form-cell/wd-form-cell.js +42 -0
- package/dist/web/components/wd-form-item/index.js +4 -0
- package/dist/web/components/wd-form-item/wd-form-item.js +55 -0
- package/dist/web/components/wd-form-item/wd-input-group.js +24 -0
- package/dist/web/components/wd-input/index.js +3 -0
- package/dist/web/components/wd-input/wd-input.js +155 -0
- package/dist/web/components/wd-input-email/index.js +3 -0
- package/dist/web/components/wd-input-email/wd-input-email.js +13 -0
- package/dist/web/components/wd-input-group/index.js +3 -0
- package/dist/web/components/wd-input-group/wd-input-group.js +10 -0
- package/dist/web/components/wd-input-phone/index.js +3 -0
- package/dist/web/components/wd-input-phone/wd-input-phone.js +14 -0
- package/dist/web/components/wd-input-url/index.js +3 -0
- package/dist/web/components/wd-input-url/wd-input-url.js +13 -0
- package/dist/web/components/wd-input-wrap/index.js +3 -0
- package/dist/web/components/wd-input-wrap/wd-input-wrap.js +18 -0
- package/dist/web/components/wd-official-account/index.css +29 -0
- package/dist/web/components/wd-official-account/index.js +36 -0
- package/dist/web/components/wd-radio/index.js +3 -0
- package/dist/web/components/wd-radio/wd-radio.js +30 -0
- package/dist/web/components/wd-radio-list/index.js +3 -0
- package/dist/web/components/wd-radio-list/wd-radio-list.js +104 -0
- package/dist/web/components/wd-switch/index.js +3 -0
- package/dist/web/components/wd-switch/wd-switch.js +52 -0
- package/dist/web/components/wd-table/components/FieldRender/index.js +5 -4
- package/dist/web/components/wd-table/components/Table/index.js +12 -2
- package/dist/web/components/wd-table/hooks/useQueryParams.js +4 -1
- package/dist/web/components/wd-table/utils/index.js +6 -2
- package/dist/web/components/wd-table/wd-table.js +70 -57
- package/dist/web/components/wd-textarea/index.js +3 -0
- package/dist/web/components/wd-textarea/wd-textarea.js +78 -0
- package/dist/web/components/wd-tree/index.js +3 -0
- package/dist/web/components/wd-tree/utils.js +291 -0
- package/dist/web/components/wd-tree/wd-tree.js +193 -0
- package/dist/web/utils/constant.js +16 -0
- package/dist/web/utils/datasource.js +2 -2
- package/dist/web/utils/date.js +3 -3
- package/dist/web/utils/hooks/useFormLegacy.js +111 -0
- package/dist/web/utils/tool.js +12 -2
- package/dist/web/weda-ui.css +193 -3
- package/package.json +6 -5
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
.weda-ui-custom-search {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
height: 40px;
|
|
5
|
+
margin: 8px 16px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.weda-ui-custom-search-box {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
flex: 1 1 0px;
|
|
12
|
+
background-color: #f1f2f5;
|
|
13
|
+
border-radius: 4px;
|
|
14
|
+
height: 100%;
|
|
15
|
+
position: relative;
|
|
16
|
+
transition: all 0.5s linear;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.weda-ui-custom-search .weda-ui-input {
|
|
20
|
+
display: block;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
border: 0;
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
line-height: 24px;
|
|
26
|
+
background-color: inherit;
|
|
27
|
+
padding: 0 40px 0 40px;
|
|
28
|
+
caret-color: #0052d9;
|
|
29
|
+
color: rgba(0, 0, 0, 0.9);
|
|
30
|
+
border-radius: 4px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.weda-ui-custom-search-box__label.multiple {
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 0;
|
|
36
|
+
left: 10%;
|
|
37
|
+
transform: translateX(-50%);
|
|
38
|
+
height: 100%;
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
color: rgba(0, 0, 0, 0.4);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.weda-ui-custom-search-box__search-icon {
|
|
45
|
+
width: 24px;
|
|
46
|
+
height: 24px;
|
|
47
|
+
margin-right: 4px;
|
|
48
|
+
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjUiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNSAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE0Ljc2NTUgMTUuMzI3OUMxMy41Mzc4IDE2LjMyMjEgMTEuOTc0MSAxNi45MTc2IDEwLjI3MTQgMTYuOTE3NkM2LjMyNDUzIDE2LjkxNzYgMy4xMjUgMTMuNzE4MSAzLjEyNSA5Ljc3MTMyQzMuMTI1IDUuODI0NTEgNi4zMjQ1MyAyLjYyNSAxMC4yNzE0IDIuNjI1QzE0LjIxODIgMi42MjUgMTcuNDE3NyA1LjgyNDUxIDE3LjQxNzcgOS43NzEzMkMxNy40MTc3IDExLjQ3NDEgMTYuODIyMSAxMy4wMzc4IDE1LjgyOCAxNC4yNjU1TDIxLjEyNSAxOS41NjI1TDIwLjA2MjYgMjAuNjI1TDE0Ljc2NTUgMTUuMzI3OVpNMTUuOTE1MiA5Ljc3MTMyQzE1LjkxNTIgNi42NTQzNCAxMy4zODg0IDQuMTI3NTIgMTAuMjcxNCA0LjEyNzUyQzcuMTU0MzUgNC4xMjc1MiA0LjYyNzUyIDYuNjU0MzQgNC42Mjc1MiA5Ljc3MTMyQzQuNjI3NTIgMTIuODg4MyA3LjE1NDM1IDE1LjQxNTEgMTAuMjcxNCAxNS40MTUxQzEzLjM4ODQgMTUuNDE1MSAxNS45MTUyIDEyLjg4ODMgMTUuOTE1MiA5Ljc3MTMyWiIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC40Ii8+Cjwvc3ZnPgo=);
|
|
49
|
+
background-repeat: no-repeat;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.weda-ui-custom-search-box__dismiss-icon {
|
|
53
|
+
position: absolute;
|
|
54
|
+
right: 12px;
|
|
55
|
+
width: 24px;
|
|
56
|
+
height: 24px;
|
|
57
|
+
background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4IiBmaWxsPSJub25lIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNy43NSA5QzE3Ljc1IDQuMTY3NTEgMTMuODMyNSAwLjI1MDAwMSA5IDAuMjVDNC4xNjc1MSAwLjI0OTk5NyAwLjI1MDAwMSA0LjE2NzUxIDAuMjUgOUMwLjI0OTk5NyAxMy44MzI1IDQuMTY3NTEgMTcuNzUgOSAxNy43NUMxMy44MzI1IDE3Ljc1IDE3Ljc1IDEzLjgzMjUgMTcuNzUgOVpNNi4wODg2MyA1LjE4NDQyTDkuMDAwMDIgOC4xMTM0NEwxMS45MTE0IDUuMTg0NDJMMTIuNzk3OSA2LjA2NTYzTDkuODgxMjQgOUwxMi43OTc5IDExLjkzNDRMMTEuOTExNCAxMi44MTU2TDkuMDAwMDEgOS44ODY1N0w2LjA4ODY0IDEyLjgxNTZMNS4yMDIxIDExLjkzNDRMOC4xMTg3OSA5TDUuMjAyMDggNi4wNjU2M0w2LjA4ODYzIDUuMTg0NDJaIiBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIwLjkiLz4KPC9zdmc+)
|
|
58
|
+
no-repeat center;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.weda-ui-custom-search__btn-cancle {
|
|
62
|
+
flex: 0 0 auto;
|
|
63
|
+
display: none;
|
|
64
|
+
margin-left: 16px;
|
|
65
|
+
color: #0052d9;
|
|
66
|
+
background-color: transparent;
|
|
67
|
+
border: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* 获取焦点后 */
|
|
71
|
+
.weda-ui-custom-search.is-focused .weda-ui-custom-search__btn-cancle {
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.weda-ui-custom-search.is-focused .weda-ui-custom-search-box__label {
|
|
76
|
+
left: 12px;
|
|
77
|
+
transform: translateX(0);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.weda-ui-custom-search.is-focused
|
|
81
|
+
.weda-ui-custom-search-box__search-placeholder {
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.weda-ui-custom-picker__cloumn-item.is-current {
|
|
86
|
+
color: rgba(0, 0, 0, 0.9);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.weda-ui-custom-picker__cloumns.weda-ui-custom-picker__cloumns--select-multiple
|
|
90
|
+
.weda-ui-custom-picker__cloumn-item {
|
|
91
|
+
height: 56px;
|
|
92
|
+
justify-content: flex-start;
|
|
93
|
+
color: rgba(0, 0, 0, 0.9);
|
|
94
|
+
position: relative;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.weda-ui-custom-picker__cloumns.weda-ui-custom-picker__cloumns--select-multiple
|
|
98
|
+
.weda-ui-custom-picker__cloumn-item::before {
|
|
99
|
+
content: '';
|
|
100
|
+
position: absolute;
|
|
101
|
+
bottom: 0;
|
|
102
|
+
background-color: #e7e7e7;
|
|
103
|
+
width: 100%;
|
|
104
|
+
height: 1px;
|
|
105
|
+
transform: scaleY(0.5);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.weda-ui-custom-picker__cloumns.weda-ui-custom-picker__cloumns--select-multiple
|
|
109
|
+
.weda-ui-custom-picker__cloumn-item.is-selected {
|
|
110
|
+
color: rgba(0, 0, 0, 0.9);
|
|
111
|
+
}
|
|
112
|
+
.weda-ui-custom-picker__cloumns.weda-ui-custom-picker__cloumns--select-multiple
|
|
113
|
+
.weda-ui-custom-picker__cloumn-item::after {
|
|
114
|
+
content: '';
|
|
115
|
+
width: 20px;
|
|
116
|
+
height: 20px;
|
|
117
|
+
border: 1px solid #dcdcdc;
|
|
118
|
+
border-radius: 3px;
|
|
119
|
+
display: block;
|
|
120
|
+
position: absolute;
|
|
121
|
+
left: 0px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.weda-ui-custom-picker__cloumns.weda-ui-custom-picker__cloumns--select-multiple
|
|
125
|
+
.weda-ui-custom-picker__cloumn-item.is-selected::after {
|
|
126
|
+
content: '';
|
|
127
|
+
width: 21px;
|
|
128
|
+
height: 21px;
|
|
129
|
+
border: none;
|
|
130
|
+
border-radius: 3px;
|
|
131
|
+
display: block;
|
|
132
|
+
position: absolute;
|
|
133
|
+
left: 0px;
|
|
134
|
+
background-color: #0052d9;
|
|
135
|
+
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTAiIHZpZXdCb3g9IjAgMCAxNCAxMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNDAxNDYgNy45NDI3QzMuNDAxNCA3Ljk0MjY0IDMuNDAxNTMgNy45NDI3NiAzLjQwMTQ2IDcuOTQyN0wwLjc1IDUuMjkxMjNMMi41NDM0OSAzLjU0OTE5TDUuMTcyMSA2LjE3NzhMMTEuMzY4NyAwTDEzLjEyNDQgMS43NTU3TDYuOTI3OCA3LjkzMzVMNi45MzcxOCA3Ljk0Mjg5TDYuOTExMDkgNy45NjgyM0M2Ljg1NyA4LjAyMDc3IDYuODAxMTQgOC4wNzAzNyA2Ljc0MzcxIDguMTE3MDRMNi4wNDEyMyA4LjgxNzM4QzUuNTUyODYgOS4zMDQyNyA0Ljc2MjQ0IDkuMzAzNjcgNC4yNzQ4MSA4LjgxNjA0TDMuNDAxNDYgNy45NDI3WiIgZmlsbD0id2hpdGUiIGZpbGwtb3BhY2l0eT0iMC45Ii8+Cjwvc3ZnPg==);
|
|
136
|
+
background-repeat: no-repeat;
|
|
137
|
+
background-position: center;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.weda-ui-custom-picker__cloumns.weda-ui-custom-picker__cloumns--select-multiple
|
|
141
|
+
.weda-ui-custom-picker__cloumn-item.is-disabled {
|
|
142
|
+
color: rgba(0, 0, 0, 0.26);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* 下拉选择类型 */
|
|
146
|
+
.weda-ui-custom-picker__cloumns.weda-ui-custom-picker__cloumns--select-multiple {
|
|
147
|
+
padding: 0 0 0 16px;
|
|
148
|
+
height: 280px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.weda-ui-custom-picker__cloumns.weda-ui-custom-picker__cloumns--select-multiple::before,
|
|
152
|
+
.weda-ui-custom-picker__cloumns.weda-ui-custom-picker__cloumns--select-multiple::after {
|
|
153
|
+
display: none;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.weda-ui-custom-picker__cloumns--select-multiple
|
|
157
|
+
.weda-ui-custom-picker__cloumn {
|
|
158
|
+
height: 250px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.form-select-multiple-pc {
|
|
162
|
+
position: relative;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.form-select-multiple-pc .pc-clear {
|
|
166
|
+
position: absolute;
|
|
167
|
+
right: 22px;
|
|
168
|
+
top: 25%;
|
|
169
|
+
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iIzg4OCIgZD0iTTggMWE3IDcgMCAxIDAgMCAxNEE3IDcgMCAwIDAgOCAxem0zLjUzNiA5LjEyMWwtMS40MTQgMS40MTRMOCA5LjQxNGwtMi4xMjEgMi4xMjEtMS40MTQtMS40MTRMNi41ODYgOCA0LjQ2NCA1Ljg3OWwxLjQxNC0xLjQxNEw4IDYuNTg2bDIuMTIxLTIuMTIxIDEuNDE0IDEuNDE0TDkuNDE0IDhsMi4xMjIgMi4xMjF6Ii8+PC9zdmc+) !important;
|
|
170
|
+
background-repeat: no-repeat;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.wedatea2td-search--simple .wedatea2td-input--search {
|
|
174
|
+
caret-color: #000000;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.weda-ui-custom-picker__cloumn-item-text-multiple {
|
|
178
|
+
overflow: hidden;
|
|
179
|
+
text-overflow: ellipsis;
|
|
180
|
+
white-space: nowrap;
|
|
181
|
+
margin-left: 30px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.weda-ui input.weui-input .multiple {
|
|
185
|
+
color: transparent;
|
|
186
|
+
}
|
|
187
|
+
.weui-tag {
|
|
188
|
+
height: 56px;
|
|
189
|
+
position: relative;
|
|
190
|
+
line-height: 56px;
|
|
191
|
+
width: 100%;
|
|
192
|
+
}
|
|
193
|
+
.weui-tag span {
|
|
194
|
+
position: relative;
|
|
195
|
+
background-color: #eee;
|
|
196
|
+
color: rgba(0, 0, 0, 0.9);
|
|
197
|
+
margin: 0px 4px 0 0;
|
|
198
|
+
padding: 5px 10px 5px 10px;
|
|
199
|
+
height: auto;
|
|
200
|
+
line-height: 18px;
|
|
201
|
+
vertical-align: middle;
|
|
202
|
+
border: 1px solid #eee;
|
|
203
|
+
border-radius: 3px;
|
|
204
|
+
}
|
|
205
|
+
.weui-tag span {
|
|
206
|
+
display: inline-block;
|
|
207
|
+
white-space: nowrap;
|
|
208
|
+
word-wrap: break-word;
|
|
209
|
+
word-break: break-word;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.weda-ui-show-label {
|
|
213
|
+
text-overflow: ellipsis;
|
|
214
|
+
white-space: nowrap;
|
|
215
|
+
overflow: hidden;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.weda-ui-custom-picker__header {
|
|
219
|
+
justify-content: space-between;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.wedatea2td-list.wedatea2td-list--option.wedatea2td-list--checkoption
|
|
223
|
+
.wedatea2td-list__status
|
|
224
|
+
.wedatea2td-action-state
|
|
225
|
+
.wedatea2td-action-state__text {
|
|
226
|
+
display: none;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.wedatea2td-list.wedatea2td-list--option.wedatea2td-list--checkoption
|
|
230
|
+
.wedatea2td-list__status
|
|
231
|
+
.weda-ui-custom-picker__status--empty {
|
|
232
|
+
margin: 0 0 10px 10px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.select-picker .weui-input-clear {
|
|
236
|
+
margin: auto 0;
|
|
237
|
+
width: 24px;
|
|
238
|
+
height: 24px;
|
|
239
|
+
background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4IiBmaWxsPSJub25lIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNy43NSA5QzE3Ljc1IDQuMTY3NTEgMTMuODMyNSAwLjI1MDAwMSA5IDAuMjVDNC4xNjc1MSAwLjI0OTk5NyAwLjI1MDAwMSA0LjE2NzUxIDAuMjUgOUMwLjI0OTk5NyAxMy44MzI1IDQuMTY3NTEgMTcuNzUgOSAxNy43NUMxMy44MzI1IDE3Ljc1IDE3Ljc1IDEzLjgzMjUgMTcuNzUgOVpNNi4wODg2MyA1LjE4NDQyTDkuMDAwMDIgOC4xMTM0NEwxMS45MTE0IDUuMTg0NDJMMTIuNzk3OSA2LjA2NTYzTDkuODgxMjQgOUwxMi43OTc5IDExLjkzNDRMMTEuOTExNCAxMi44MTU2TDkuMDAwMDEgOS44ODY1N0w2LjA4ODY0IDEyLjgxNTZMNS4yMDIxIDExLjkzNDRMOC4xMTg3OSA5TDUuMjAyMDggNi4wNjU2M0w2LjA4ODYzIDUuMTg0NDJaIiBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIwLjkiLz4KPC9zdmc+')
|
|
240
|
+
no-repeat center;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.is-disabled
|
|
244
|
+
.wedatea2td-dropdown-link
|
|
245
|
+
.wedatea2td-dropdown__value
|
|
246
|
+
.wedatea2td-icon-arrowdown,
|
|
247
|
+
.is-disabled .wedatea2td-dropdown__header .wedatea2td-icon-arrowdown {
|
|
248
|
+
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+Y2hldnJvbi1kb3duPC90aXRsZT4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJJY29ucyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTIyNC4wMDAwMDAsIC05NTEuMDAwMDAwKSI+CiAgICAgICAgICAgIDxnIGlkPSJjaGV2cm9uLWRvd24iIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIyNC4wMDAwMDAsIDk1MS4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNiwwIEwxNiwxNiBMMCwxNiBMMCwwIEwxNiwwIFoiIGlkPSLnn6nlvaIiIG9wYWNpdHk9IjAuNjAwMDAwMDI0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNC40NTk2MTM1Niw1LjU0MDQwNTI3IEw3Ljk5OTk5NDI4LDkuMDgwNzg1NzUgTDExLjU0MDM3NDgsNS41NDA0MDUyNyBMMTIuNDU5NjEzOCw2LjQ1OTY0NDA4IEw3Ljk5OTk5NDI4LDEwLjkxOTI2MzQgTDMuNTQwMzc0NzYsNi40NTk2NDQwOCBMNC40NTk2MTM1Niw1LjU0MDQwNTI3IFoiIGlkPSLot6/lvoQtNC0oU3Ryb2tlKSIgZmlsbD0iIzAwMDAwMCI+PC9wYXRoPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.weda-ui-custom-picker__header-confirm {
|
|
252
|
+
flex: 0 0 auto;
|
|
253
|
+
padding: 0 20px;
|
|
254
|
+
font-size: 16px;
|
|
255
|
+
color: #0052d9;
|
|
256
|
+
cursor: pointer;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.form-select-multiple-pc .wedatea2td-tag {
|
|
260
|
+
margin: 2px 4px 0 0;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.weda-ui-tag-close-icon {
|
|
264
|
+
margin: 5px 0;
|
|
265
|
+
width: 8px;
|
|
266
|
+
height: 8px;
|
|
267
|
+
margin-left: 6px;
|
|
268
|
+
background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiIHZpZXdCb3g9IjAgMCA4IDgiIGZpbGw9Im5vbmUiPgo8cGF0aCBkPSJNNC4wMDAwMSA0LjgwNTMxTDYuNjk0NjkgNy40OTk5OEw3LjUgNi42OTQ2N0w0LjgwNTMyIDRMNy41IDEuMzA1MzNMNi42OTQ2OSAwLjUwMDAyM0w0LjAwMDAxIDMuMTk0NjlMMS4zMDUzMSAwLjVMMC41IDEuMzA1MzFMMy4xOTQ3IDRMMC41IDYuNjk0NjlMMS4zMDUzMSA3LjVMNC4wMDAwMSA0LjgwNTMxWiIgZmlsbD0iYmxhY2siIGZpbGwtb3BhY2l0eT0iMC45Ii8+Cjwvc3ZnPg==)
|
|
269
|
+
no-repeat center;
|
|
270
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { SelectPickerH5 } from './h5';
|
|
4
|
+
import { formatNeedDataFetch, PAGE_SIZE, requestFatherRelatedOption, RequestOptionType, transFormatTeaSelectKey, } from '../request';
|
|
5
|
+
import SelectPickerPc from './pc';
|
|
6
|
+
import { usePlatform } from '../../../../utils/platform';
|
|
7
|
+
import { Status } from '../status';
|
|
8
|
+
import { useDeepCompareEffect } from '@react-hookz/web';
|
|
9
|
+
export function PureSelect({ params, selectedValue, updateValue, placeholder, size, disabled, isShow, closeModal, allOption, }) {
|
|
10
|
+
const isRequestingRef = useRef(false);
|
|
11
|
+
const [status, setStatus] = useState(Status.ALl_EMPTY);
|
|
12
|
+
const [options, setOptions] = useState([]);
|
|
13
|
+
const [page, setPage] = useState(1);
|
|
14
|
+
const [searchOptions, setSearchOptions] = useState([]);
|
|
15
|
+
const [searchPage, setSearchPage] = useState(1);
|
|
16
|
+
const [searchValue, setSearchValue] = useState('');
|
|
17
|
+
const [searchStatus, setSearchStatus] = useState(Status.FINISH);
|
|
18
|
+
const [format, setFormat] = useState('');
|
|
19
|
+
const [isTurnPages, setIsTurnPages] = useState(false);
|
|
20
|
+
const platform = usePlatform();
|
|
21
|
+
const isSearch = useMemo(() => searchValue !== '', [searchValue]);
|
|
22
|
+
useDeepCompareEffect(() => {
|
|
23
|
+
const { format, controlledValue } = params || {
|
|
24
|
+
format: '',
|
|
25
|
+
controlledValue: [],
|
|
26
|
+
};
|
|
27
|
+
const isTurnPages = format === 'one-many' || format === 'many-many';
|
|
28
|
+
setFormat(format);
|
|
29
|
+
setIsTurnPages(isTurnPages);
|
|
30
|
+
// 手动配置
|
|
31
|
+
if (!formatNeedDataFetch.includes(format)) {
|
|
32
|
+
if (controlledValue.length === 0) {
|
|
33
|
+
setStatus(Status.ALl_EMPTY);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
setStatus(Status.FINISH);
|
|
37
|
+
}
|
|
38
|
+
setOptions(controlledValue);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
// 接口请求
|
|
42
|
+
if (isTurnPages) {
|
|
43
|
+
setStatus(Status.LOADING);
|
|
44
|
+
requestFatherRelatedOption(params, 1, RequestOptionType.ALL)
|
|
45
|
+
.then((value) => {
|
|
46
|
+
setOptions(value.option);
|
|
47
|
+
if (value.option.length === 0) {
|
|
48
|
+
setStatus(platform === 'pc' ? Status.EMPTY : Status.ALl_EMPTY);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
setStatus(value.isLoadMore ? Status.LOADING : Status.FINISH);
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
.catch(() => {
|
|
55
|
+
setStatus(Status.ERROR);
|
|
56
|
+
})
|
|
57
|
+
.finally(() => (isRequestingRef.current = false));
|
|
58
|
+
}
|
|
59
|
+
}, [params]);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (page > 1) {
|
|
62
|
+
requestFatherRelated(page);
|
|
63
|
+
}
|
|
64
|
+
}, [page]);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (searchPage > 1) {
|
|
67
|
+
requestFatherRelated(searchPage, searchValue);
|
|
68
|
+
}
|
|
69
|
+
}, [searchPage]);
|
|
70
|
+
const requestFatherRelated = (pageNo, searchValue) => {
|
|
71
|
+
requestFatherRelatedOption(params, pageNo, RequestOptionType.SEARCH, searchValue)
|
|
72
|
+
.then((value) => {
|
|
73
|
+
if (isSearch) {
|
|
74
|
+
setSearchOptions((opt) => opt.concat(value.option));
|
|
75
|
+
if (pageNo === 1 && value.option.length === 0) {
|
|
76
|
+
setSearchStatus(Status.EMPTY);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
setSearchStatus(value.isLoadMore ? Status.LOADING : Status.FINISH);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
setOptions((opt) => opt.concat(value.option));
|
|
84
|
+
if (pageNo === 1 && value.option.length === 0) {
|
|
85
|
+
setStatus(Status.EMPTY);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
setStatus(value.isLoadMore ? Status.LOADING : Status.FINISH);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
.catch(() => isSearch ? setSearchStatus(Status.ERROR) : setStatus(Status.ERROR))
|
|
93
|
+
.finally(() => (isRequestingRef.current = false));
|
|
94
|
+
};
|
|
95
|
+
const currentStatus = useMemo(() => {
|
|
96
|
+
return isSearch ? searchStatus : status;
|
|
97
|
+
}, [isSearch, searchStatus, status]);
|
|
98
|
+
const currentOption = useMemo(() => {
|
|
99
|
+
const option = isSearch ? searchOptions : options;
|
|
100
|
+
return platform === 'h5' ? option : transFormatTeaSelectKey(option);
|
|
101
|
+
}, [isSearch, searchOptions, options, platform]);
|
|
102
|
+
const allOptions = useMemo(() => {
|
|
103
|
+
return transFormatTeaSelectKey(options);
|
|
104
|
+
}, [options]);
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
allOption(options);
|
|
107
|
+
}, [options]);
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
// 本地搜索
|
|
110
|
+
if (!isTurnPages || options.length < PAGE_SIZE) {
|
|
111
|
+
const searchOpt = options.filter((item) => {
|
|
112
|
+
if (item.label) {
|
|
113
|
+
return item.label.toString().includes(searchValue);
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
});
|
|
117
|
+
if (searchOpt.length > 0) {
|
|
118
|
+
setSearchOptions(searchOpt);
|
|
119
|
+
setSearchStatus(Status.FINISH);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
setSearchOptions([]);
|
|
123
|
+
setSearchStatus(Status.EMPTY);
|
|
124
|
+
}
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
// 远程搜索
|
|
128
|
+
if (searchValue.trim().length > 0) {
|
|
129
|
+
// eslint-disable-next-line rulesdir/no-timer
|
|
130
|
+
const timer = setTimeout(() => {
|
|
131
|
+
requestFatherRelated(1, searchValue);
|
|
132
|
+
}, 1000);
|
|
133
|
+
return () => clearTimeout(timer);
|
|
134
|
+
}
|
|
135
|
+
}, [searchValue]);
|
|
136
|
+
// 加载更多
|
|
137
|
+
const loadMore = () => {
|
|
138
|
+
if (!isRequestingRef.current &&
|
|
139
|
+
isTurnPages &&
|
|
140
|
+
currentStatus !== Status.FINISH) {
|
|
141
|
+
if (isSearch) {
|
|
142
|
+
if (searchOptions.length >= PAGE_SIZE) {
|
|
143
|
+
isRequestingRef.current = true;
|
|
144
|
+
setSearchPage((page) => page + 1);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
if (options.length >= PAGE_SIZE) {
|
|
149
|
+
isRequestingRef.current = true;
|
|
150
|
+
setPage((page) => page + 1);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
// 重试
|
|
156
|
+
const reTry = () => {
|
|
157
|
+
if (!isRequestingRef.current) {
|
|
158
|
+
isRequestingRef.current = true;
|
|
159
|
+
if (isSearch) {
|
|
160
|
+
setSearchStatus(Status.LOADING);
|
|
161
|
+
requestFatherRelated(searchPage, searchValue);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
setStatus(Status.LOADING);
|
|
165
|
+
requestFatherRelated(page);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
const onSearchValue = (value) => {
|
|
170
|
+
setSearchPage(1);
|
|
171
|
+
setSearchStatus(Status.LOADING);
|
|
172
|
+
setSearchOptions([]);
|
|
173
|
+
setSearchValue(value);
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* 精确查找
|
|
177
|
+
*/
|
|
178
|
+
// const findData = async () => {
|
|
179
|
+
// if (params?.dataSourceName === undefined || params?.viewId === undefined) {
|
|
180
|
+
// return undefined;
|
|
181
|
+
// }
|
|
182
|
+
// return requestFatherRelatedOption(
|
|
183
|
+
// params,
|
|
184
|
+
// 1,
|
|
185
|
+
// RequestOptionType.EQUAL,
|
|
186
|
+
// selectedValue
|
|
187
|
+
// ).then((value) => {
|
|
188
|
+
// if (value && value.option.length > 0) {
|
|
189
|
+
// if (
|
|
190
|
+
// platform === 'pc' &&
|
|
191
|
+
// options.length > 0 &&
|
|
192
|
+
// options[0].value != selectedValue
|
|
193
|
+
// ) {
|
|
194
|
+
// setOptions((opt) => value.option.concat(opt));
|
|
195
|
+
// }
|
|
196
|
+
// return options[0].value;
|
|
197
|
+
// } else {
|
|
198
|
+
// return undefined;
|
|
199
|
+
// }
|
|
200
|
+
// });
|
|
201
|
+
// };
|
|
202
|
+
const getIsShow = () => {
|
|
203
|
+
closeModal();
|
|
204
|
+
};
|
|
205
|
+
return platform === 'h5' ? (_jsx(SelectPickerH5, { updateValue: updateValue, options: currentOption, loadMore: loadMore, reTry: reTry, isTurnPages: isTurnPages, status: currentStatus, onSearchValue: onSearchValue, isShow: isShow, selectedValue: selectedValue, getIsShow: getIsShow })) : (_jsx(SelectPickerPc, { placeholder: placeholder, size: size, selectedValue: selectedValue, disabled: disabled, updateValue: updateValue, reTry: reTry, loadMore: loadMore, format: format, status: currentStatus, options: currentOption, allOptions: allOptions, onSearchValue: onSearchValue, defaultSearchValue: '' }));
|
|
206
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState, useRef } from 'react';
|
|
3
|
+
import { useDeepCompareEffect } from '@react-hookz/web';
|
|
4
|
+
import { SelectMultiple, ConfigProvider } from 'tea-component';
|
|
5
|
+
import Loading from '../status/loading';
|
|
6
|
+
import Retry from '../status/retry';
|
|
7
|
+
import { Status } from '../status';
|
|
8
|
+
import Empty from '../status/empty';
|
|
9
|
+
import './index.css';
|
|
10
|
+
export default function SelectPickerPc({ format, selectedValue, updateValue, placeholder, size, disabled, reTry, loadMore, status, options, allOptions, onSearchValue, defaultSearchValue, }) {
|
|
11
|
+
const [optList, setOptList] = useState(options);
|
|
12
|
+
const findDataRef = useRef(undefined);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (findDataRef.current && findDataRef.current.value) {
|
|
15
|
+
const opt = options.filter((item, index) => {
|
|
16
|
+
if (index === 0) {
|
|
17
|
+
// 有回显的数据,回显数据通过findData插入在第一个,所以第一个不能过滤掉
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
// 如果是第一个后面的数据,发现和选中项的 value 一样,则忽略,因为index === 0已经加进去了
|
|
22
|
+
return item.value !== findDataRef.current.value;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
setOptList(opt);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
setOptList(options);
|
|
29
|
+
}
|
|
30
|
+
}, [options]);
|
|
31
|
+
useDeepCompareEffect(() => {
|
|
32
|
+
if (status === Status.ALl_EMPTY) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
// // 没有数据
|
|
36
|
+
// if (optList?.length === 0) {
|
|
37
|
+
// updateValue && updateValue(undefined);
|
|
38
|
+
// return;
|
|
39
|
+
// }
|
|
40
|
+
//有数据
|
|
41
|
+
if (selectedValue) {
|
|
42
|
+
updateValue(selectedValue);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
// 用户自动输入 '' , undefined , null三种状态清空
|
|
46
|
+
updateValue && updateValue(selectedValue);
|
|
47
|
+
}
|
|
48
|
+
}, [optList, selectedValue, status]);
|
|
49
|
+
const isShowBottomTips = useMemo(() => {
|
|
50
|
+
if (status === Status.LOADING) {
|
|
51
|
+
return _jsx(Loading, {});
|
|
52
|
+
}
|
|
53
|
+
else if (status === Status.ERROR) {
|
|
54
|
+
return _jsx(Retry, { reTry: reTry });
|
|
55
|
+
}
|
|
56
|
+
else if (status === Status.EMPTY) {
|
|
57
|
+
return _jsx(Empty, {});
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return '';
|
|
61
|
+
}
|
|
62
|
+
}, [format, status, optList]);
|
|
63
|
+
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsx("div", { className: 'form-select-multiple-pc', "data-testid": "form-item-select-multiple-pc", children: _jsx(SelectMultiple, { searchable: true, staging: false, autoClearSearchValue: true, clearable: true, matchButtonWidth: true, defaultSearchValue: defaultSearchValue, value: selectedValue, placeholder: placeholder, appearance: 'button', bottomTips: isShowBottomTips, size: size, disabled: disabled, options: optList, onChange: updateValue, onScrollBottom: loadMore, button: (selectedValue) => {
|
|
64
|
+
let str = '';
|
|
65
|
+
selectedValue.forEach((item) => {
|
|
66
|
+
const obj = allOptions.find((el) => el.value === item.value);
|
|
67
|
+
(obj === null || obj === void 0 ? void 0 : obj.text) ? (str = `${str},${obj.text}`) : null;
|
|
68
|
+
});
|
|
69
|
+
return selectedValue.length ? (_jsx("div", { className: 'weda-ui-show-label', children: str.substring(1, str.length) })) : (
|
|
70
|
+
// <div>
|
|
71
|
+
// <Tag.Group>
|
|
72
|
+
// {selectedValue.length > 0 &&
|
|
73
|
+
// [selectedValue[0]].map((o) => {
|
|
74
|
+
// const obj = allOptions.find(
|
|
75
|
+
// (item) => item.value === o.value
|
|
76
|
+
// );
|
|
77
|
+
// return (
|
|
78
|
+
// <Tag key="0">
|
|
79
|
+
// <span>
|
|
80
|
+
// {obj?.text}
|
|
81
|
+
// {/* <span className="weda-ui-tag-close-icon"></span> */}
|
|
82
|
+
// </span>
|
|
83
|
+
// </Tag>
|
|
84
|
+
// );
|
|
85
|
+
// })}
|
|
86
|
+
// {selectedValue.length > 1 && (
|
|
87
|
+
// <Tag key="1">+{selectedValue.length - 1}</Tag>
|
|
88
|
+
// )}
|
|
89
|
+
// </Tag.Group>
|
|
90
|
+
// </div>
|
|
91
|
+
_jsx("div", { style: { color: 'rgba(0,0,0,.26)' }, children: placeholder }));
|
|
92
|
+
}, onOpen: () => {
|
|
93
|
+
onSearchValue('');
|
|
94
|
+
}, onSearch: (value, context) => {
|
|
95
|
+
const tValue = value.trim();
|
|
96
|
+
if (context.event.type === 'click') {
|
|
97
|
+
if (tValue !== '') {
|
|
98
|
+
// 手动点击搜索
|
|
99
|
+
onSearchValue(tValue);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
// 清空
|
|
103
|
+
onSearchValue('');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else if (tValue !== '') {
|
|
107
|
+
// 动态输入搜索
|
|
108
|
+
onSearchValue(tValue);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
// 逐个删除
|
|
112
|
+
onSearchValue('');
|
|
113
|
+
}
|
|
114
|
+
} }) }) }));
|
|
115
|
+
}
|