@titaui/pc 1.9.115 → 1.9.119
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/book-demo/components/pc/components/checkbox/index.css +1 -0
- package/lib/components/book-demo/components/pc/components/content/index.js +16 -5
- package/lib/components/book-demo/components/pc/index.js +27 -0
- package/lib/components/dialog/index.css +4 -0
- package/lib/components/upload-photo-modal/index.css +16 -14
- package/lib/components/upload-photo-modal/index.js +29 -21
- package/lib/index.js +6 -6
- package/lib/pages/personal-info/components/person-photo/index.js +3 -2
- package/package.json +1 -1
|
@@ -81,7 +81,8 @@ var BookDemoPCContent = function BookDemoPCContent(_ref) {
|
|
|
81
81
|
var type = _ref.type,
|
|
82
82
|
onSubmitSuccess = _ref.onSubmitSuccess,
|
|
83
83
|
_ref$source = _ref.source,
|
|
84
|
-
source = _ref$source === void 0 ? 0 : _ref$source
|
|
84
|
+
source = _ref$source === void 0 ? 0 : _ref$source,
|
|
85
|
+
onChange = _ref.onChange;
|
|
85
86
|
|
|
86
87
|
var _useState = (0, _react.useState)((0, _utils.getTypeData)(type)),
|
|
87
88
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -127,6 +128,10 @@ var BookDemoPCContent = function BookDemoPCContent(_ref) {
|
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
setResult(_toConsumableArray(result));
|
|
131
|
+
|
|
132
|
+
if (onChange) {
|
|
133
|
+
onChange(result);
|
|
134
|
+
}
|
|
130
135
|
};
|
|
131
136
|
|
|
132
137
|
var emptyFun = function emptyFun() {};
|
|
@@ -158,7 +163,7 @@ var BookDemoPCContent = function BookDemoPCContent(_ref) {
|
|
|
158
163
|
if (res.data.Code) {
|
|
159
164
|
_toast["default"].Success("提交成功");
|
|
160
165
|
|
|
161
|
-
onSubmitSuccess(
|
|
166
|
+
onSubmitSuccess();
|
|
162
167
|
localStorage.setItem("isSubmitted", "1");
|
|
163
168
|
} else {
|
|
164
169
|
handelChangeImage();
|
|
@@ -249,7 +254,7 @@ var BookDemoPCContent = function BookDemoPCContent(_ref) {
|
|
|
249
254
|
});
|
|
250
255
|
data.formField = formField;
|
|
251
256
|
setData(_objectSpread({}, data));
|
|
252
|
-
|
|
257
|
+
var initResult = formField.map(function (item) {
|
|
253
258
|
return {
|
|
254
259
|
name: item.name,
|
|
255
260
|
value: item.value,
|
|
@@ -258,7 +263,12 @@ var BookDemoPCContent = function BookDemoPCContent(_ref) {
|
|
|
258
263
|
required: item.required,
|
|
259
264
|
type: item.type
|
|
260
265
|
};
|
|
261
|
-
})
|
|
266
|
+
});
|
|
267
|
+
setResult(initResult);
|
|
268
|
+
|
|
269
|
+
if (onChange) {
|
|
270
|
+
onChange(initResult);
|
|
271
|
+
}
|
|
262
272
|
}, []);
|
|
263
273
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
264
274
|
className: preCls
|
|
@@ -305,7 +315,8 @@ var BookDemoPCContent = function BookDemoPCContent(_ref) {
|
|
|
305
315
|
};
|
|
306
316
|
|
|
307
317
|
BookDemoPCContent.defaultProps = {
|
|
308
|
-
source: 0
|
|
318
|
+
source: 0,
|
|
319
|
+
onChange: function onChange() {}
|
|
309
320
|
};
|
|
310
321
|
var _default = BookDemoPCContent;
|
|
311
322
|
exports["default"] = _default;
|
|
@@ -17,6 +17,8 @@ var _content = _interopRequireDefault(require("./components/content"));
|
|
|
17
17
|
|
|
18
18
|
var _demoClose = _interopRequireDefault(require("../../img/demo-close.svg"));
|
|
19
19
|
|
|
20
|
+
var _utils = require("../../utils");
|
|
21
|
+
|
|
20
22
|
require("./index.css");
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -43,6 +45,9 @@ var role = window.BSGlobal && window.BSGlobal.loginUserInfo.Role;
|
|
|
43
45
|
var isSubmitted = localStorage.getItem("isSubmitted");
|
|
44
46
|
var time = Number(localStorage.getItem("pointDemoTime"));
|
|
45
47
|
var newDate = new Date().getTime();
|
|
48
|
+
var uname = window.BSGlobal && window.BSGlobal.loginUserInfo.Name || "";
|
|
49
|
+
var uid = window.BSGlobal && window.BSGlobal.tenantInfo.Id || "";
|
|
50
|
+
var Source = window.BSGlobal && window.BSGlobal.tenantInfo.Source || (0, _utils.getSource)();
|
|
46
51
|
var BookDemoPC = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
47
52
|
var type = _ref.type,
|
|
48
53
|
visible = _ref.visible,
|
|
@@ -56,12 +61,33 @@ var BookDemoPC = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
56
61
|
dialogVisible = _useState2[0],
|
|
57
62
|
setDialogVisible = _useState2[1];
|
|
58
63
|
|
|
64
|
+
var _useState3 = (0, _react.useState)([]),
|
|
65
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
66
|
+
data = _useState4[0],
|
|
67
|
+
setData = _useState4[1];
|
|
68
|
+
|
|
59
69
|
var handleCloseBookDemo = function handleCloseBookDemo() {
|
|
70
|
+
var content = uid ? "\u79DF\u6237ID\uFF1A".concat(uid, "\uFF0C\u79DF\u6237\u8D26\u53F7\u540D\u79F0\uFF1A").concat(uname, ",") : "";
|
|
71
|
+
data.forEach(function (item) {
|
|
72
|
+
content += "".concat(item.name, ": ").concat(Array.isArray(item.value) ? item.value.join(",") : item.value, ",");
|
|
73
|
+
});
|
|
74
|
+
content += "source: ".concat(source || Source);
|
|
60
75
|
setDialogVisible(false);
|
|
61
76
|
|
|
62
77
|
if (visibleChange) {
|
|
63
78
|
visibleChange(false);
|
|
64
79
|
}
|
|
80
|
+
|
|
81
|
+
if (window.titaTracker) {
|
|
82
|
+
window.titaTracker("action").record({
|
|
83
|
+
action_group: "申请演示__取消提交",
|
|
84
|
+
action_name: "\u586B\u5199\u60C5\u51B5\uFF1A".concat(content)
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var handleChangeData = function handleChangeData(result) {
|
|
90
|
+
setData(result);
|
|
65
91
|
};
|
|
66
92
|
|
|
67
93
|
var handleShowBookDemo = function handleShowBookDemo() {
|
|
@@ -123,6 +149,7 @@ var BookDemoPC = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
123
149
|
src: _demoClose["default"],
|
|
124
150
|
className: (0, _classnames["default"])("".concat(preCls, "__close-icon"))
|
|
125
151
|
})), /*#__PURE__*/_react["default"].createElement(_content["default"], {
|
|
152
|
+
onChange: handleChangeData,
|
|
126
153
|
source: source,
|
|
127
154
|
type: type,
|
|
128
155
|
onSubmitSuccess: handleCloseBookDemo
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
|
|
46
46
|
.tita-ui-change-person-photo__upload-right-input {
|
|
47
47
|
position: absolute;
|
|
48
|
-
top:
|
|
48
|
+
top: 0;
|
|
49
49
|
width: 240px;
|
|
50
|
-
height:
|
|
50
|
+
height: 240px;
|
|
51
51
|
opacity: 0;
|
|
52
52
|
cursor: pointer;
|
|
53
53
|
}
|
|
@@ -112,16 +112,16 @@
|
|
|
112
112
|
.tita-ui-change-person-photo__upload-left-box {
|
|
113
113
|
width: 160px;
|
|
114
114
|
height: 32px;
|
|
115
|
-
background: #
|
|
115
|
+
background: #f0f2f5;
|
|
116
116
|
border-radius: 2px;
|
|
117
|
-
border: 1px solid #
|
|
117
|
+
border: 1px solid #e9ecf0;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
.tita-ui-change-person-photo__upload-left-preview {
|
|
121
121
|
margin-top: 8px;
|
|
122
122
|
font-size: 14px;
|
|
123
123
|
font-weight: 400;
|
|
124
|
-
color: #
|
|
124
|
+
color: #3f4755;
|
|
125
125
|
line-height: 22px;
|
|
126
126
|
}
|
|
127
127
|
|
|
@@ -142,18 +142,18 @@
|
|
|
142
142
|
.tita-ui-change-person-photo__preview-box-bgc {
|
|
143
143
|
width: 160px;
|
|
144
144
|
height: 32px;
|
|
145
|
-
background: #
|
|
145
|
+
background: #2879ff;
|
|
146
146
|
border-radius: 2px;
|
|
147
|
-
border: 1px solid #
|
|
147
|
+
border: 1px solid #e9ecf0;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
.tita-ui-change-person-photo__preview-box-browser {
|
|
151
151
|
margin-left: 16px;
|
|
152
152
|
width: 176px;
|
|
153
153
|
height: 48px;
|
|
154
|
-
background: #
|
|
154
|
+
background: #f0f2f5;
|
|
155
155
|
border-radius: 2px;
|
|
156
|
-
border: 1px solid #
|
|
156
|
+
border: 1px solid #e9ecf0;
|
|
157
157
|
background-image: url("./img/browser-preview-bgc.png");
|
|
158
158
|
background-size: 170px 28px;
|
|
159
159
|
background-position: center center;
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
margin-top: 36px;
|
|
192
192
|
font-size: 14px;
|
|
193
193
|
font-weight: 400;
|
|
194
|
-
color: #
|
|
194
|
+
color: #3f4755;
|
|
195
195
|
line-height: 22px;
|
|
196
196
|
}
|
|
197
197
|
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
right: 10px;
|
|
210
210
|
font-size: 12px;
|
|
211
211
|
font-weight: 400;
|
|
212
|
-
color: #
|
|
212
|
+
color: #3f4755;
|
|
213
213
|
line-height: 18px;
|
|
214
214
|
}
|
|
215
215
|
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
margin-top: 58px;
|
|
218
218
|
font-size: 14px;
|
|
219
219
|
font-weight: 400;
|
|
220
|
-
color: #
|
|
220
|
+
color: #3f4755;
|
|
221
221
|
line-height: 22px;
|
|
222
222
|
}
|
|
223
223
|
|
|
@@ -255,6 +255,7 @@
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
.tita-ui-change-person-photo__title-again {
|
|
258
|
+
opacity: 0;
|
|
258
259
|
margin-left: 92px;
|
|
259
260
|
margin-top: 8px;
|
|
260
261
|
font-size: 14px;
|
|
@@ -264,15 +265,16 @@
|
|
|
264
265
|
}
|
|
265
266
|
|
|
266
267
|
.tita-ui-change-person-photo__title-again--show {
|
|
268
|
+
opacity: 1;
|
|
267
269
|
color: #2879ff;
|
|
268
270
|
}
|
|
269
271
|
|
|
270
272
|
.tita-ui-change-person-photo__title-again--show:hover {
|
|
271
|
-
color: #
|
|
273
|
+
color: #5c8eff;
|
|
272
274
|
}
|
|
273
275
|
|
|
274
276
|
.tita-ui-change-person-photo__title-again--hover {
|
|
275
|
-
color: #
|
|
277
|
+
color: #5c8eff;
|
|
276
278
|
}
|
|
277
279
|
|
|
278
280
|
.tita-ui-change-person-photo__title-preview {
|
|
@@ -56,7 +56,8 @@ function ChangePhoto(props) {
|
|
|
56
56
|
onCancel = props.onCancel,
|
|
57
57
|
_props$type = props.type,
|
|
58
58
|
type = _props$type === void 0 ? "person" : _props$type,
|
|
59
|
-
handleSuccessUploadPhoto = props.handleSuccessUploadPhoto
|
|
59
|
+
handleSuccessUploadPhoto = props.handleSuccessUploadPhoto,
|
|
60
|
+
title = props.title;
|
|
60
61
|
var modalRef = (0, _react.useRef)();
|
|
61
62
|
var cropperRef = (0, _react.useRef)(null);
|
|
62
63
|
|
|
@@ -115,8 +116,8 @@ function ChangePhoto(props) {
|
|
|
115
116
|
var n = bstr.length;
|
|
116
117
|
var u8arr = new Uint8Array(n);
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
u8arr[
|
|
119
|
+
for (var i = n; i > 0; i -= 1) {
|
|
120
|
+
u8arr[i] = bstr.charCodeAt(i);
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
return new File([u8arr], filename, {
|
|
@@ -162,18 +163,20 @@ function ChangePhoto(props) {
|
|
|
162
163
|
};
|
|
163
164
|
|
|
164
165
|
var handleSaveInfo = function handleSaveInfo() {
|
|
165
|
-
if (
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
166
|
+
if (image) {
|
|
167
|
+
if (type === "person") {
|
|
168
|
+
(0, _requestApi.saveUserPhoto)(cropper).then(function (resp) {
|
|
169
|
+
handleSuccessSave(resp);
|
|
170
|
+
});
|
|
171
|
+
} else if (type === "enterprise") {
|
|
172
|
+
(0, _requestApi.saveTenantLogo)(cropper).then(function (resp) {
|
|
173
|
+
handleSuccessSave(resp);
|
|
174
|
+
});
|
|
175
|
+
} else {
|
|
176
|
+
(0, _requestApi.saveBrowserIcon)(cropper).then(function (resp) {
|
|
177
|
+
handleSuccessSave(resp);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
177
180
|
}
|
|
178
181
|
};
|
|
179
182
|
|
|
@@ -196,7 +199,7 @@ function ChangePhoto(props) {
|
|
|
196
199
|
width: 480,
|
|
197
200
|
mask: true,
|
|
198
201
|
centered: true,
|
|
199
|
-
title:
|
|
202
|
+
title: title,
|
|
200
203
|
noHeadLine: true,
|
|
201
204
|
maskClosable: false,
|
|
202
205
|
onClose: handleCancel,
|
|
@@ -264,25 +267,30 @@ function ChangePhoto(props) {
|
|
|
264
267
|
condition: type === "person"
|
|
265
268
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
266
269
|
src: cropData,
|
|
267
|
-
className: "".concat(preCls, "__preview-box1")
|
|
270
|
+
className: "".concat(preCls, "__preview-box1"),
|
|
271
|
+
alt: "bigImage"
|
|
268
272
|
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
269
273
|
src: cropData,
|
|
270
|
-
className: "".concat(preCls, "__preview-box2")
|
|
274
|
+
className: "".concat(preCls, "__preview-box2"),
|
|
275
|
+
alt: "middleImage"
|
|
271
276
|
}), /*#__PURE__*/_react["default"].createElement("img", {
|
|
272
277
|
src: cropData,
|
|
273
|
-
className: "".concat(preCls, "__preview-box3")
|
|
278
|
+
className: "".concat(preCls, "__preview-box3"),
|
|
279
|
+
alt: "smallImage"
|
|
274
280
|
})), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
275
281
|
condition: type === "enterprise"
|
|
276
282
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
277
283
|
src: cropData,
|
|
278
|
-
className: "".concat(preCls, "__preview-enterprise-img")
|
|
284
|
+
className: "".concat(preCls, "__preview-enterprise-img"),
|
|
285
|
+
alt: "previewImage"
|
|
279
286
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
280
287
|
className: "".concat(preCls, "__preview-enterprise-title")
|
|
281
288
|
}, item === null || item === void 0 ? void 0 : item.previewTitle)), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
282
289
|
condition: type === "browser"
|
|
283
290
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
284
291
|
src: cropData,
|
|
285
|
-
className: "".concat(preCls, "__preview-browser-img")
|
|
292
|
+
className: "".concat(preCls, "__preview-browser-img"),
|
|
293
|
+
alt: "previewImage"
|
|
286
294
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
287
295
|
className: "".concat(preCls, "__preview-browser-name")
|
|
288
296
|
}, "Tita"), /*#__PURE__*/_react["default"].createElement("span", {
|
package/lib/index.js
CHANGED
|
@@ -477,6 +477,12 @@ Object.defineProperty(exports, "UpdateModal", {
|
|
|
477
477
|
return _updateModal["default"];
|
|
478
478
|
}
|
|
479
479
|
});
|
|
480
|
+
Object.defineProperty(exports, "UploadPhotoModal", {
|
|
481
|
+
enumerable: true,
|
|
482
|
+
get: function get() {
|
|
483
|
+
return _uploadPhotoModal["default"];
|
|
484
|
+
}
|
|
485
|
+
});
|
|
480
486
|
Object.defineProperty(exports, "Upvote", {
|
|
481
487
|
enumerable: true,
|
|
482
488
|
get: function get() {
|
|
@@ -531,12 +537,6 @@ Object.defineProperty(exports, "requestApi", {
|
|
|
531
537
|
return _request["default"];
|
|
532
538
|
}
|
|
533
539
|
});
|
|
534
|
-
Object.defineProperty(exports, "tasUploadPhotoModal", {
|
|
535
|
-
enumerable: true,
|
|
536
|
-
get: function get() {
|
|
537
|
-
return _uploadPhotoModal["default"];
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
540
|
Object.defineProperty(exports, "upload", {
|
|
541
541
|
enumerable: true,
|
|
542
542
|
get: function get() {
|
|
@@ -94,11 +94,12 @@ function PersonPhoto() {
|
|
|
94
94
|
onClick: handleChangePhoto
|
|
95
95
|
}, (0, _getLocale.getLocale)("Set_PI_Clicktomodify")), /*#__PURE__*/_react["default"].createElement("span", {
|
|
96
96
|
className: "".concat(prefix, "__main-tip")
|
|
97
|
-
}, (0, _getLocale.getLocale)("Set_PI_Suggestedsize"), "
|
|
97
|
+
}, (0, _getLocale.getLocale)("Set_PI_Suggestedsize"), "150*150px")), /*#__PURE__*/_react["default"].createElement(_uploadPhotoModal["default"], {
|
|
98
98
|
visible: visible,
|
|
99
99
|
onCancel: handleCancel,
|
|
100
100
|
type: "person",
|
|
101
|
-
handleSuccessUploadPhoto: handleSuccessUploadPhoto
|
|
101
|
+
handleSuccessUploadPhoto: handleSuccessUploadPhoto,
|
|
102
|
+
title: (0, _getLocale.getLocale)("Set_PI_Uploadavatar")
|
|
102
103
|
}));
|
|
103
104
|
}
|
|
104
105
|
|