@titaui/pc 1.7.100 → 1.8.2
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/lib/components/dialog/index.css +4 -0
- package/lib/components/dialog/index.js +7 -6
- package/lib/components/form/form-fields/input/index.css +19 -5
- package/lib/components/form/form-fields/input/index.js +11 -8
- package/lib/components/form/form-fields/input-verification-code/index.css +117 -0
- package/lib/components/form/form-fields/input-verification-code/index.js +230 -0
- package/lib/components/form/form-fields/password/index.css +2 -2
- package/lib/components/form/form-fields/radios/index.js +1 -1
- package/lib/components/form/index.js +4 -1
- package/lib/components/grid-layout/near-visitors/index.js +4 -2
- package/lib/components/grid-layout/okr-align/index.js +4 -4
- package/lib/components/grid-layout/okr-progress/index.js +6 -6
- package/lib/components/grid-layout/okr-target/index.js +2 -2
- package/lib/components/grid-layout/over-view/index.js +1 -1
- package/lib/components/grid-layout/personal-info/index.js +5 -3
- package/lib/components/grid-layout/sub-employee-okr/index.js +1 -1
- package/lib/components/grid-layout/week-task/index.js +4 -4
- package/lib/components/grid-layout/words-cloud/index.js +5 -3
- package/lib/components/grid-page/personal-info/index.js +5 -3
- package/lib/components/img-viewer/index.js +1 -1
- package/lib/components/mblog/style.js +4 -4
- package/lib/components/nav-top/components/user-message/components/empty/index.js +4 -2
- package/lib/components/nav-top/components/user-message/msg/index.js +1 -1
- package/lib/components/okr-detail/base-info/base-info.js +4 -3
- package/lib/components/okr-detail/base-info/o-desc/index.js +2 -8
- package/lib/components/point-demo/constant.js +1 -3
- package/lib/components/point-demo/drop-down-box/index.js +1 -3
- package/lib/components/point-demo/index.js +8 -10
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.css +1 -1
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +2 -1
- package/lib/components/table/index.css +4 -0
- package/lib/components/table/index.js +3 -0
- package/lib/components/upload-photo-modal/constant.js +99 -0
- package/lib/components/upload-photo-modal/img/browser-preview-bgc.png +0 -0
- package/lib/components/upload-photo-modal/index.css +276 -0
- package/lib/components/upload-photo-modal/index.js +332 -0
- package/lib/components/upload-photo-modal/request-api.js +44 -0
- package/lib/components/user-selector/category-selector-panel/depart-tree.js +3 -0
- package/lib/components/user-selector/export-modules/field-tree-selector/index.css +1 -1
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +2 -0
- package/lib/components/user-selector/request-apis.js +1 -1
- package/lib/components/word-cloud/index.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/CommonList.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/DepartmentList.js +1 -1
- package/lib/components-v1/userSelector/components/MultiMode/SubsList.js +1 -1
- package/lib/components-v1/userSelector/components/SingleMode.js +1 -1
- package/lib/index.js +8 -0
- package/lib/pages/home/components/data-list/index.js +2 -2
- package/lib/pages/home/components/data-list/nav-selector/index.js +2 -2
- package/lib/pages/home/components/data-list/table/columns/index.js +1 -1
- package/lib/pages/home/components/guide/index.js +14 -12
- package/lib/pages/home/components/header/index.js +3 -1
- package/lib/pages/home-page-data-list/index.js +2 -2
- package/lib/pages/personal-info/components/base-info/index.css +36 -1
- package/lib/pages/personal-info/components/base-info/index.js +22 -90
- package/lib/pages/personal-info/components/edit-info/index.js +192 -0
- package/lib/pages/personal-info/components/edit-info/input/index.css +89 -0
- package/lib/pages/personal-info/components/edit-info/input/index.js +199 -0
- package/lib/pages/personal-info/components/person-photo/index.css +88 -0
- package/lib/pages/personal-info/components/person-photo/index.js +86 -0
- package/lib/pages/personal-info/index.js +3 -1
- package/package.json +3 -1
- package/src/components/dialog/index.js +2 -1
- package/src/components/dialog/index.scss +3 -0
- package/src/components/form/form-fields/input/index.scss +16 -5
- package/src/components/form/form-fields/input/index.tsx +9 -4
- package/src/components/form/form-fields/input-verification-code/index.scss +108 -0
- package/src/components/form/form-fields/input-verification-code/index.tsx +171 -0
- package/src/components/form/form-fields/password/index.scss +2 -2
- package/src/components/form/form-fields/radios/index.tsx +2 -2
- package/src/components/form/index.tsx +2 -0
- package/src/components/grid-layout/near-visitors/index.tsx +3 -2
- package/src/components/grid-layout/okr-align/index.tsx +4 -4
- package/src/components/grid-layout/okr-progress/index.tsx +6 -6
- package/src/components/grid-layout/okr-target/index.tsx +2 -2
- package/src/components/grid-layout/over-view/index.tsx +1 -1
- package/src/components/grid-layout/personal-info/index.tsx +4 -3
- package/src/components/grid-layout/sub-employee-okr/index.tsx +1 -1
- package/src/components/grid-layout/week-task/index.tsx +3 -3
- package/src/components/grid-layout/words-cloud/index.tsx +4 -3
- package/src/components/grid-page/personal-info/index.tsx +4 -3
- package/src/components/img-viewer/index.tsx +1 -1
- package/src/components/mblog/style.ts +5 -5
- package/src/components/nav-top/components/user-message/components/empty/index.tsx +3 -2
- package/src/components/nav-top/components/user-message/msg/index.tsx +1 -1
- package/src/components/okr-detail/base-info/base-info.tsx +2 -4
- package/src/components/okr-detail/base-info/o-desc/index.tsx +0 -7
- package/src/components/point-demo/constant.ts +1 -3
- package/src/components/point-demo/drop-down-box/index.js +1 -2
- package/src/components/point-demo/index.js +8 -9
- package/src/components/publish-dynamic-modal/publish-dynamic-modal.scss +1 -1
- package/src/components/publish-dynamic-modal/publish-dynamic-modal.tsx +1 -0
- package/src/components/table/index.js +1 -0
- package/src/components/table/index.scss +5 -0
- package/src/components/upload-photo-modal/constant.ts +71 -0
- package/src/components/upload-photo-modal/img/browser-preview-bgc.png +0 -0
- package/src/components/upload-photo-modal/index.scss +248 -0
- package/src/components/upload-photo-modal/index.tsx +236 -0
- package/src/components/upload-photo-modal/request-api.ts +23 -0
- package/src/components/user-selector/category-selector-panel/depart-tree.tsx +3 -2
- package/src/components/user-selector/export-modules/field-tree-selector/index.scss +1 -1
- package/src/components/user-selector/export-modules/field-tree-selector/index.tsx +3 -0
- package/src/components/user-selector/request-apis.js +1 -1
- package/src/components/word-cloud/index.js +1 -1
- package/src/components-v1/userSelector/components/MultiMode/CommonList.tsx +1 -1
- package/src/components-v1/userSelector/components/MultiMode/DepartmentList.tsx +1 -1
- package/src/components-v1/userSelector/components/MultiMode/SubsList.tsx +1 -1
- package/src/components-v1/userSelector/components/SingleMode.tsx +1 -1
- package/src/index.js +1 -0
- package/src/pages/home/components/data-list/index.tsx +2 -2
- package/src/pages/home/components/data-list/nav-selector/index.tsx +2 -2
- package/src/pages/home/components/data-list/table/columns/index.tsx +1 -1
- package/src/pages/home/components/guide/index.tsx +13 -12
- package/src/pages/home/components/header/index.tsx +2 -1
- package/src/pages/home-page-data-list/index.tsx +2 -2
- package/src/pages/personal-info/components/base-info/index.scss +30 -1
- package/src/pages/personal-info/components/base-info/index.tsx +26 -97
- package/src/pages/personal-info/components/edit-info/index.tsx +152 -0
- package/src/pages/personal-info/components/edit-info/input/index.scss +82 -0
- package/src/pages/personal-info/components/edit-info/input/index.tsx +145 -0
- package/src/pages/personal-info/components/person-photo/index.scss +80 -0
- package/src/pages/personal-info/components/person-photo/index.tsx +49 -0
- package/src/pages/personal-info/index.tsx +2 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
.tita-ui-change-person-photo__img {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
padding: 0 32px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.tita-ui-change-person-photo__img .cropper-wrap-box {
|
|
9
|
+
border-radius: 12px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.tita-ui-change-person-photo__img .cropper-canvas {
|
|
13
|
+
border-radius: 12px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.tita-ui-change-person-photo__img .cropper-crop {
|
|
17
|
+
border-radius: 12px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.tita-ui-change-person-photo__upload {
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
padding: 0 32px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.tita-ui-change-person-photo__upload-preview {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
align-items: center;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.tita-ui-change-person-photo__upload-right {
|
|
34
|
+
position: relative;
|
|
35
|
+
width: 240px;
|
|
36
|
+
height: 240px;
|
|
37
|
+
background: #f0f2f5;
|
|
38
|
+
border-radius: 12px;
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
padding: 30px;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
align-items: center;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.tita-ui-change-person-photo__upload-right-input {
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 76px;
|
|
49
|
+
width: 240px;
|
|
50
|
+
height: 60px;
|
|
51
|
+
opacity: 0;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.tita-ui-change-person-photo__upload-right-icon {
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
margin-top: 46px;
|
|
58
|
+
font-size: 32px;
|
|
59
|
+
color: #2879ff;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.tita-ui-change-person-photo__upload-right-title {
|
|
63
|
+
margin-top: 4px;
|
|
64
|
+
font-size: 12px;
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
color: #2879ff;
|
|
67
|
+
line-height: 18px;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.tita-ui-change-person-photo__upload-right-tips {
|
|
72
|
+
margin-top: 8px;
|
|
73
|
+
font-size: 12px;
|
|
74
|
+
font-weight: 400;
|
|
75
|
+
color: #a4acb9;
|
|
76
|
+
line-height: 18px;
|
|
77
|
+
text-align: center;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.tita-ui-change-person-photo__upload-left {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
align-items: center;
|
|
84
|
+
margin-left: 36px;
|
|
85
|
+
width: 136px;
|
|
86
|
+
height: 100%;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.tita-ui-change-person-photo__upload-left-box1 {
|
|
90
|
+
width: 136px;
|
|
91
|
+
height: 136px;
|
|
92
|
+
background: #f0f2f5;
|
|
93
|
+
border-radius: 50%;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.tita-ui-change-person-photo__upload-left-box2 {
|
|
97
|
+
width: 48px;
|
|
98
|
+
height: 48px;
|
|
99
|
+
background: #f0f2f5;
|
|
100
|
+
border-radius: 50%;
|
|
101
|
+
margin-top: 14px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.tita-ui-change-person-photo__upload-left-box3 {
|
|
105
|
+
width: 28px;
|
|
106
|
+
height: 28px;
|
|
107
|
+
background: #f0f2f5;
|
|
108
|
+
border-radius: 50%;
|
|
109
|
+
margin-top: 14px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.tita-ui-change-person-photo__upload-left-box {
|
|
113
|
+
width: 160px;
|
|
114
|
+
height: 32px;
|
|
115
|
+
background: #F0F2F5;
|
|
116
|
+
border-radius: 2px;
|
|
117
|
+
border: 1px solid #E9ECF0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.tita-ui-change-person-photo__upload-left-preview {
|
|
121
|
+
margin-top: 8px;
|
|
122
|
+
font-size: 14px;
|
|
123
|
+
font-weight: 400;
|
|
124
|
+
color: #3F4755;
|
|
125
|
+
line-height: 22px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.tita-ui-change-person-photo__preview {
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
overflow: hidden;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.tita-ui-change-person-photo__preview-box {
|
|
136
|
+
position: relative;
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.tita-ui-change-person-photo__preview-box-bgc {
|
|
143
|
+
width: 160px;
|
|
144
|
+
height: 32px;
|
|
145
|
+
background: #2879FF;
|
|
146
|
+
border-radius: 2px;
|
|
147
|
+
border: 1px solid #E9ECF0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.tita-ui-change-person-photo__preview-box-browser {
|
|
151
|
+
margin-left: 16px;
|
|
152
|
+
width: 176px;
|
|
153
|
+
height: 48px;
|
|
154
|
+
background: #F0F2F5;
|
|
155
|
+
border-radius: 2px;
|
|
156
|
+
border: 1px solid #E9ECF0;
|
|
157
|
+
background-image: url("./img/browser-preview-bgc.png");
|
|
158
|
+
background-size: 170px 28px;
|
|
159
|
+
background-position: center center;
|
|
160
|
+
background-repeat: no-repeat;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.tita-ui-change-person-photo__preview-box1 {
|
|
164
|
+
width: 136px;
|
|
165
|
+
height: 136px;
|
|
166
|
+
border-radius: 50%;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.tita-ui-change-person-photo__preview-box2 {
|
|
170
|
+
margin-top: 14px;
|
|
171
|
+
width: 48px;
|
|
172
|
+
height: 48px;
|
|
173
|
+
border-radius: 50%;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.tita-ui-change-person-photo__preview-box3 {
|
|
177
|
+
margin-top: 14px;
|
|
178
|
+
width: 28px;
|
|
179
|
+
height: 28px;
|
|
180
|
+
border-radius: 50%;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.tita-ui-change-person-photo__preview-enterprise-img {
|
|
184
|
+
position: absolute;
|
|
185
|
+
top: 2px;
|
|
186
|
+
right: 45px;
|
|
187
|
+
width: 70px;
|
|
188
|
+
height: 28px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.tita-ui-change-person-photo__preview-enterprise-title {
|
|
192
|
+
margin-top: 36px;
|
|
193
|
+
font-size: 14px;
|
|
194
|
+
font-weight: 400;
|
|
195
|
+
color: #3F4755;
|
|
196
|
+
line-height: 22px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.tita-ui-change-person-photo__preview-browser-img {
|
|
200
|
+
position: absolute;
|
|
201
|
+
top: 15px;
|
|
202
|
+
left: 16px;
|
|
203
|
+
width: 18px;
|
|
204
|
+
height: 18px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.tita-ui-change-person-photo__preview-browser-name {
|
|
208
|
+
position: absolute;
|
|
209
|
+
top: 15px;
|
|
210
|
+
right: 10px;
|
|
211
|
+
font-size: 12px;
|
|
212
|
+
font-weight: 400;
|
|
213
|
+
color: #3F4755;
|
|
214
|
+
line-height: 18px;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.tita-ui-change-person-photo__preview-browser-title {
|
|
218
|
+
margin-top: 58px;
|
|
219
|
+
font-size: 14px;
|
|
220
|
+
font-weight: 400;
|
|
221
|
+
color: #3F4755;
|
|
222
|
+
line-height: 22px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.tita-ui-change-person-photo__preview-title {
|
|
226
|
+
margin-top: 8px;
|
|
227
|
+
font-size: 14px;
|
|
228
|
+
font-weight: 400;
|
|
229
|
+
color: #6f7886;
|
|
230
|
+
line-height: 22px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.tita-ui-change-person-photo__title {
|
|
234
|
+
position: relative;
|
|
235
|
+
display: flex;
|
|
236
|
+
align-items: center;
|
|
237
|
+
justify-content: space-between;
|
|
238
|
+
box-sizing: border-box;
|
|
239
|
+
padding: 8px 32px 0 32px;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.tita-ui-change-person-photo__title-input {
|
|
243
|
+
display: none;
|
|
244
|
+
position: absolute;
|
|
245
|
+
width: 240px;
|
|
246
|
+
height: 30px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.tita-ui-change-person-photo__title-input--show {
|
|
250
|
+
display: block;
|
|
251
|
+
opacity: 0;
|
|
252
|
+
cursor: pointer;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.tita-ui-change-person-photo__title-again {
|
|
256
|
+
margin-left: 92px;
|
|
257
|
+
margin-top: 8px;
|
|
258
|
+
font-size: 14px;
|
|
259
|
+
font-weight: 400;
|
|
260
|
+
color: #bfc7d5;
|
|
261
|
+
line-height: 22px;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.tita-ui-change-person-photo__title-again--show {
|
|
265
|
+
cursor: pointer;
|
|
266
|
+
color: #2879ff;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.tita-ui-change-person-photo__title-preview {
|
|
270
|
+
margin-right: 54px;
|
|
271
|
+
margin-top: 8px;
|
|
272
|
+
font-size: 14px;
|
|
273
|
+
font-weight: 400;
|
|
274
|
+
color: #6f7886;
|
|
275
|
+
line-height: 22px;
|
|
276
|
+
}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _reactCropper = _interopRequireDefault(require("react-cropper"));
|
|
15
|
+
|
|
16
|
+
require("cropperjs/dist/cropper.css");
|
|
17
|
+
|
|
18
|
+
var _toast = _interopRequireDefault(require("../../components/toast"));
|
|
19
|
+
|
|
20
|
+
var _conditionRender = _interopRequireDefault(require("../condition-render"));
|
|
21
|
+
|
|
22
|
+
var _requestApi = require("./request-api");
|
|
23
|
+
|
|
24
|
+
var _dialog = _interopRequireDefault(require("../../components/dialog"));
|
|
25
|
+
|
|
26
|
+
var _constant = require("./constant");
|
|
27
|
+
|
|
28
|
+
require("./index.css");
|
|
29
|
+
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
|
+
|
|
32
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
|
+
|
|
34
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
+
|
|
36
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
37
|
+
|
|
38
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
39
|
+
|
|
40
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
41
|
+
|
|
42
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
43
|
+
|
|
44
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
45
|
+
|
|
46
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
47
|
+
|
|
48
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
|
+
|
|
50
|
+
var preCls = 'tita-ui-change-person-photo';
|
|
51
|
+
|
|
52
|
+
var ChangePhoto = function ChangePhoto(props) {
|
|
53
|
+
var visible = props.visible,
|
|
54
|
+
onCancel = props.onCancel,
|
|
55
|
+
_props$type = props.type,
|
|
56
|
+
type = _props$type === void 0 ? 'browser' : _props$type;
|
|
57
|
+
var modalRef = (0, _react.useRef)();
|
|
58
|
+
|
|
59
|
+
var _useState = (0, _react.useState)(),
|
|
60
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
61
|
+
image = _useState2[0],
|
|
62
|
+
setImage = _useState2[1];
|
|
63
|
+
|
|
64
|
+
var _useState3 = (0, _react.useState)(),
|
|
65
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
66
|
+
cropper = _useState4[0],
|
|
67
|
+
setCropper = _useState4[1];
|
|
68
|
+
|
|
69
|
+
var _useState5 = (0, _react.useState)('#'),
|
|
70
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
71
|
+
cropData = _useState6[0],
|
|
72
|
+
setCropData = _useState6[1];
|
|
73
|
+
|
|
74
|
+
var _useState7 = (0, _react.useState)({
|
|
75
|
+
Avatar: ''
|
|
76
|
+
}),
|
|
77
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
78
|
+
userInfo = _useState8[0],
|
|
79
|
+
setUserInfo = _useState8[1];
|
|
80
|
+
|
|
81
|
+
var _useState9 = (0, _react.useState)(_constant.List.find(function (item) {
|
|
82
|
+
return item.id === type;
|
|
83
|
+
})),
|
|
84
|
+
_useState10 = _slicedToArray(_useState9, 1),
|
|
85
|
+
item = _useState10[0];
|
|
86
|
+
|
|
87
|
+
var cropperRef = (0, _react.useRef)(null);
|
|
88
|
+
|
|
89
|
+
var onChange = function onChange(e) {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
var files;
|
|
92
|
+
|
|
93
|
+
if (e.dataTransfer) {
|
|
94
|
+
files = e.dataTransfer.files;
|
|
95
|
+
} else if (e.target) {
|
|
96
|
+
files = e.target.files;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
var reader = new FileReader();
|
|
100
|
+
|
|
101
|
+
reader.onload = function () {
|
|
102
|
+
setImage(reader.result);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
reader.readAsDataURL(files[0]);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
var onCrop = function onCrop() {
|
|
109
|
+
var imageElement = cropperRef.current;
|
|
110
|
+
var cropper = imageElement.cropper;
|
|
111
|
+
setCropData(cropper.getCroppedCanvas().toDataURL());
|
|
112
|
+
setUserInfo(cropper.getCroppedCanvas().toDataURL());
|
|
113
|
+
var base64Url = cropper.getCroppedCanvas().toDataURL(); //将base64转换成blob
|
|
114
|
+
|
|
115
|
+
var FileOrBlob = dataURLtoBlob(base64Url); //添加到formdata
|
|
116
|
+
|
|
117
|
+
var formData = new FormData();
|
|
118
|
+
formData.append('file', FileOrBlob, "file_" + Date.parse(new Date()) + ".png");
|
|
119
|
+
setCropper(formData);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
var dataURLtoBlob = function dataURLtoBlob(urlData) {
|
|
123
|
+
var bytes = window.atob(urlData.split(',')[1]);
|
|
124
|
+
var ab = new ArrayBuffer(bytes.length);
|
|
125
|
+
var ia = new Uint8Array(ab);
|
|
126
|
+
|
|
127
|
+
for (var i = 0; i < bytes.length; i++) {
|
|
128
|
+
ia[i] = bytes.charCodeAt(i);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return new Blob([ab], {
|
|
132
|
+
type: 'image/png'
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
var handleSaveUserInfo = function handleSaveUserInfo() {
|
|
137
|
+
if (!image) {
|
|
138
|
+
return;
|
|
139
|
+
} else {
|
|
140
|
+
(0, _requestApi.saveUserInfo)({
|
|
141
|
+
data: userInfo
|
|
142
|
+
}).then(function (resp) {
|
|
143
|
+
if (resp.Code === 1) {
|
|
144
|
+
_toast["default"].Success('保存成功', {
|
|
145
|
+
canClose: false
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
onCancel();
|
|
149
|
+
} else {
|
|
150
|
+
_toast["default"].Error(resp.Message, {
|
|
151
|
+
canClose: false
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
var handleSaveInfo = function handleSaveInfo() {
|
|
159
|
+
if (!image) {
|
|
160
|
+
return;
|
|
161
|
+
} else {
|
|
162
|
+
(0, _requestApi.saveTenantLogo)(cropData).then(function (resp) {
|
|
163
|
+
if (resp.Code === 1) {
|
|
164
|
+
_toast["default"].Success('保存成功', {
|
|
165
|
+
canClose: false
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
onCancel();
|
|
169
|
+
} else {
|
|
170
|
+
_toast["default"].Error(resp.Message, {
|
|
171
|
+
canClose: false
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
var handleBrowserIconSaveInfo = function handleBrowserIconSaveInfo() {
|
|
179
|
+
if (!image) {
|
|
180
|
+
return;
|
|
181
|
+
} else {
|
|
182
|
+
console.log(cropper);
|
|
183
|
+
(0, _requestApi.saveBrowserIcon)(cropper).then(function (resp) {
|
|
184
|
+
if (resp.Code === 1) {
|
|
185
|
+
_toast["default"].Success('保存成功', {
|
|
186
|
+
canClose: false
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
onCancel();
|
|
190
|
+
} else {
|
|
191
|
+
_toast["default"].Error(resp.Message, {
|
|
192
|
+
canClose: false
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
return /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
|
|
200
|
+
visible: visible,
|
|
201
|
+
ref: modalRef,
|
|
202
|
+
width: 480,
|
|
203
|
+
mask: true,
|
|
204
|
+
centered: true,
|
|
205
|
+
title: '上传头像',
|
|
206
|
+
noHeadLine: true,
|
|
207
|
+
maskClosable: false,
|
|
208
|
+
onClose: onCancel,
|
|
209
|
+
onCancel: onCancel,
|
|
210
|
+
okText: "\u4FDD\u5B58",
|
|
211
|
+
noFooterLine: true,
|
|
212
|
+
onOk: handleBrowserIconSaveInfo
|
|
213
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
214
|
+
className: preCls
|
|
215
|
+
}, !image ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
216
|
+
className: "".concat(preCls, "__upload")
|
|
217
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
218
|
+
className: "".concat(preCls, "__upload-preview")
|
|
219
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
220
|
+
className: "".concat(preCls, "__upload-right")
|
|
221
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
222
|
+
className: (0, _classnames["default"])("".concat(preCls, "__upload-right-icon"), 'tu-icon-upload')
|
|
223
|
+
}), /*#__PURE__*/_react["default"].createElement("input", {
|
|
224
|
+
type: "file",
|
|
225
|
+
onChange: onChange,
|
|
226
|
+
className: "".concat(preCls, "__upload-right-input"),
|
|
227
|
+
accept: item === null || item === void 0 ? void 0 : item.accept
|
|
228
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
229
|
+
className: "".concat(preCls, "__upload-right-title")
|
|
230
|
+
}, "\u70B9\u51FB\u4E0A\u4F20"), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
231
|
+
condition: type === 'person'
|
|
232
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
233
|
+
className: "".concat(preCls, "__upload-right-tips")
|
|
234
|
+
}, item === null || item === void 0 ? void 0 : item.tips)), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
235
|
+
condition: type === 'enterprise'
|
|
236
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
237
|
+
className: "".concat(preCls, "__upload-right-tips")
|
|
238
|
+
}, item === null || item === void 0 ? void 0 : item.tips)), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
239
|
+
condition: type === 'browser'
|
|
240
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
241
|
+
className: "".concat(preCls, "__upload-right-tips")
|
|
242
|
+
}, item === null || item === void 0 ? void 0 : item.tips)))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
243
|
+
className: "".concat(preCls, "__upload-left")
|
|
244
|
+
}, /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
245
|
+
condition: type === 'person'
|
|
246
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
247
|
+
className: "".concat(preCls, "__upload-left-box1")
|
|
248
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
249
|
+
className: "".concat(preCls, "__upload-left-box2")
|
|
250
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
251
|
+
className: "".concat(preCls, "__upload-left-box3")
|
|
252
|
+
})), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
253
|
+
condition: type === 'enterprise'
|
|
254
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
255
|
+
className: "".concat(preCls, "__upload-left-box")
|
|
256
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
257
|
+
className: "".concat(preCls, "__upload-left-preview")
|
|
258
|
+
}, item === null || item === void 0 ? void 0 : item.previewTitle)), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
259
|
+
condition: type === 'browser'
|
|
260
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
261
|
+
className: "".concat(preCls, "__upload-left-box")
|
|
262
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
263
|
+
className: "".concat(preCls, "__upload-left-preview")
|
|
264
|
+
}, item === null || item === void 0 ? void 0 : item.previewTitle)))) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
265
|
+
className: "".concat(preCls, "__img")
|
|
266
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactCropper["default"], {
|
|
267
|
+
src: image,
|
|
268
|
+
style: {
|
|
269
|
+
height: 240,
|
|
270
|
+
width: 240
|
|
271
|
+
},
|
|
272
|
+
background: false,
|
|
273
|
+
responsive: true,
|
|
274
|
+
autoCropArea: item === null || item === void 0 ? void 0 : item.autoCropArea,
|
|
275
|
+
checkOrientation: true,
|
|
276
|
+
minCropBoxHeight: 10,
|
|
277
|
+
minCropBoxWidth: 10,
|
|
278
|
+
initialAspectRatio: item === null || item === void 0 ? void 0 : item.initialAspectRatio,
|
|
279
|
+
guides: true,
|
|
280
|
+
preview: ".img-preview",
|
|
281
|
+
ref: cropperRef // onInitialized={(instance) => {
|
|
282
|
+
// setCropper(instance);
|
|
283
|
+
// }}
|
|
284
|
+
,
|
|
285
|
+
crop: onCrop
|
|
286
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
287
|
+
className: (0, _classnames["default"])("".concat(preCls, "__preview-box"), _defineProperty({}, "".concat(preCls, "__preview-box-bgc"), type === "enterprise"), _defineProperty({}, "".concat(preCls, "__preview-box-browser"), type === "browser"))
|
|
288
|
+
}, /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
289
|
+
condition: type === "person"
|
|
290
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
291
|
+
src: cropData,
|
|
292
|
+
className: "".concat(preCls, "__preview-box1")
|
|
293
|
+
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
294
|
+
src: cropData,
|
|
295
|
+
className: "".concat(preCls, "__preview-box2")
|
|
296
|
+
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
297
|
+
src: cropData,
|
|
298
|
+
className: "".concat(preCls, "__preview-box3")
|
|
299
|
+
})), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
300
|
+
condition: type === "enterprise"
|
|
301
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
302
|
+
src: cropData,
|
|
303
|
+
className: "".concat(preCls, "__preview-enterprise-img")
|
|
304
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
305
|
+
className: "".concat(preCls, "__preview-enterprise-title")
|
|
306
|
+
}, item === null || item === void 0 ? void 0 : item.previewTitle)), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
307
|
+
condition: type === "browser"
|
|
308
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
309
|
+
src: cropData,
|
|
310
|
+
className: "".concat(preCls, "__preview-browser-img")
|
|
311
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
312
|
+
className: "".concat(preCls, "__preview-browser-name")
|
|
313
|
+
}, "\u4E00\u4F53\u5316\u4EBA\u624D\u7BA1\u7406\u4E91\u5E73\u53F0"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
314
|
+
className: "".concat(preCls, "__preview-browser-title")
|
|
315
|
+
}, item === null || item === void 0 ? void 0 : item.previewTitle)))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
316
|
+
className: "".concat(preCls, "__title")
|
|
317
|
+
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
318
|
+
accept: item === null || item === void 0 ? void 0 : item.accept,
|
|
319
|
+
type: "file",
|
|
320
|
+
onChange: onChange,
|
|
321
|
+
className: (0, _classnames["default"])("".concat(preCls, "__title-input"), _defineProperty({}, "".concat(preCls, "__title-input--show"), image))
|
|
322
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
323
|
+
className: (0, _classnames["default"])("".concat(preCls, "__title-again"), _defineProperty({}, "".concat(preCls, "__title-again--show"), image))
|
|
324
|
+
}, "\u91CD\u65B0\u4E0A\u4F20"), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
325
|
+
condition: type === 'person'
|
|
326
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
327
|
+
className: "".concat(preCls, "__title-preview")
|
|
328
|
+
}, item === null || item === void 0 ? void 0 : item.previewTitle)))));
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
var _default = ChangePhoto;
|
|
332
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.saveUserInfo = exports.saveTenantLogo = exports.saveBrowserIcon = exports.getUserInfoFun = void 0;
|
|
7
|
+
|
|
8
|
+
var _qs = _interopRequireDefault(require("qs"));
|
|
9
|
+
|
|
10
|
+
var _request = require("../../utils/request");
|
|
11
|
+
|
|
12
|
+
var _bsGlobal = require("../../utils/bs-global");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
|
|
16
|
+
var getUserInfoFun = function getUserInfoFun() {
|
|
17
|
+
return (0, _request.rpost)("v1")("manage/user/profile?toUserId=".concat((0, _bsGlobal.getUserInfo)().Id));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.getUserInfoFun = getUserInfoFun;
|
|
21
|
+
|
|
22
|
+
var saveUserInfo = function saveUserInfo(_ref) {
|
|
23
|
+
var data = _ref.data;
|
|
24
|
+
return (0, _request.rput)("v1")("manage/user/update", data, {
|
|
25
|
+
"headers": {
|
|
26
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
27
|
+
},
|
|
28
|
+
"transformRequest": _qs["default"].stringify
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.saveUserInfo = saveUserInfo;
|
|
33
|
+
|
|
34
|
+
var saveTenantLogo = function saveTenantLogo(params) {
|
|
35
|
+
return (0, _request.rpost)("v1")("tenant/update/logo", params);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
exports.saveTenantLogo = saveTenantLogo;
|
|
39
|
+
|
|
40
|
+
var saveBrowserIcon = function saveBrowserIcon(params) {
|
|
41
|
+
return (0, _request.rpost)("v1")("tenant/update/browerIcon", params);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.saveBrowserIcon = saveBrowserIcon;
|
|
@@ -34,6 +34,7 @@ var _default = function _default(props) {
|
|
|
34
34
|
departOnly = _useContext.departOnly,
|
|
35
35
|
sourceFrom = _useContext.sourceFrom,
|
|
36
36
|
auth = _useContext.auth,
|
|
37
|
+
authType = _useContext.authType,
|
|
37
38
|
isGetRoot = _useContext.isGetRoot,
|
|
38
39
|
disabledDepartSelect = _useContext.disabledDepartSelect;
|
|
39
40
|
|
|
@@ -41,6 +42,7 @@ var _default = function _default(props) {
|
|
|
41
42
|
return (0, _requestApis.getTreeData)('-1', {
|
|
42
43
|
departOnly: departOnly,
|
|
43
44
|
auth: auth,
|
|
45
|
+
authType: authType,
|
|
44
46
|
isGetRoot: isGetRoot,
|
|
45
47
|
sourceFrom: sourceFrom
|
|
46
48
|
});
|
|
@@ -50,6 +52,7 @@ var _default = function _default(props) {
|
|
|
50
52
|
return (0, _requestApis.getTreeData)(nodeId, {
|
|
51
53
|
departOnly: departOnly,
|
|
52
54
|
auth: auth,
|
|
55
|
+
authType: authType,
|
|
53
56
|
isGetRoot: isGetRoot,
|
|
54
57
|
sourceFrom: sourceFrom,
|
|
55
58
|
'isLoadNodes': true
|
|
@@ -68,6 +68,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
68
68
|
auth = _props$auth === void 0 ? false : _props$auth,
|
|
69
69
|
_props$placeholder = props.placeholder,
|
|
70
70
|
placeholder = _props$placeholder === void 0 ? (0, _getLocale.getLocale)('Mod_Pleaseselect') : _props$placeholder,
|
|
71
|
+
authType = props.authType,
|
|
71
72
|
getDepartRoot = props.getDepartRoot,
|
|
72
73
|
_props$destroyPopupOn = props.destroyPopupOnHide,
|
|
73
74
|
destroyPopupOnHide = _props$destroyPopupOn === void 0 ? true : _props$destroyPopupOn,
|
|
@@ -291,6 +292,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
291
292
|
sourceFrom: sourceFrom,
|
|
292
293
|
departOnly: departOnly,
|
|
293
294
|
auth: auth,
|
|
295
|
+
authType: authType,
|
|
294
296
|
isGetRoot: isGetRoot,
|
|
295
297
|
disabledDepartSelect: disabledDepartSelect,
|
|
296
298
|
panes: panes,
|