@titaui/pc 1.12.22 → 1.12.24-beta.1
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/content/index.css +6 -12
- package/lib/components/book-demo/components/pc/components/content/index.js +5 -3
- package/lib/components/book-demo/constant.js +4 -4
- package/lib/components/nav-top/components/app-center/index.js +1 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +1 -1
- package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +1 -1
- package/lib/components/version-change-modal/constant.js +7 -7
- package/lib/components/version-change-modal/images/header-g1.png +0 -0
- package/lib/components/version-change-modal/images/header-p.png +0 -0
- package/lib/components/version-change-modal/images/okr-purple.png +0 -0
- package/lib/components/version-change-modal/images/performance-exam.png +0 -0
- package/lib/components/version-change-modal/index.css +36 -3
- package/lib/components/version-change-modal/index.js +57 -9
- package/lib/utils/open-data.js +88 -47
- package/package.json +1 -1
|
@@ -7,23 +7,12 @@
|
|
|
7
7
|
.titaui-book-demo-pc-content__left {
|
|
8
8
|
width: 358px;
|
|
9
9
|
height: 502px;
|
|
10
|
-
background: linear-gradient(
|
|
10
|
+
background: linear-gradient(180deg, #85adff 0%, #2879ff 100%);
|
|
11
11
|
border-radius: 24px 0px 0px 24px;
|
|
12
12
|
position: relative;
|
|
13
13
|
overflow: hidden;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.titaui-book-demo-pc-content__left__bg {
|
|
17
|
-
position: absolute;
|
|
18
|
-
left: 0;
|
|
19
|
-
right: 0;
|
|
20
|
-
bottom: 0;
|
|
21
|
-
top: 0;
|
|
22
|
-
background-image: url("../../../../img/order-award.png");
|
|
23
|
-
background-size: cover;
|
|
24
|
-
height: 100%;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
16
|
.titaui-book-demo-pc-content__left-title {
|
|
28
17
|
margin: 36px 0 0 32px;
|
|
29
18
|
font-size: 26px;
|
|
@@ -39,6 +28,11 @@
|
|
|
39
28
|
line-height: 22px;
|
|
40
29
|
}
|
|
41
30
|
|
|
31
|
+
.titaui-book-demo-pc-content__left-img {
|
|
32
|
+
margin-top: 30px;
|
|
33
|
+
width: 358px;
|
|
34
|
+
}
|
|
35
|
+
|
|
42
36
|
.titaui-book-demo-pc-content__right {
|
|
43
37
|
flex: 1;
|
|
44
38
|
margin: 48px 0 0 32px;
|
|
@@ -317,13 +317,15 @@ var BookDemoPCContent = function BookDemoPCContent(_ref) {
|
|
|
317
317
|
className: preCls
|
|
318
318
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
319
319
|
className: "".concat(preCls, "__left")
|
|
320
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
321
|
-
className: "".concat(preCls, "__left__bg")
|
|
322
320
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
323
321
|
className: "".concat(preCls, "__left-title")
|
|
324
322
|
}, data.title), /*#__PURE__*/_react["default"].createElement("div", {
|
|
325
323
|
className: "".concat(preCls, "__left-desc")
|
|
326
|
-
}, data.desc)
|
|
324
|
+
}, data.desc), /*#__PURE__*/_react["default"].createElement("img", {
|
|
325
|
+
className: "".concat(preCls, "__left-img"),
|
|
326
|
+
alt: "\u9884\u7EA6\u6F14\u793A",
|
|
327
|
+
src: data.img
|
|
328
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
327
329
|
className: "".concat(preCls, "__right")
|
|
328
330
|
}, /*#__PURE__*/_react["default"].createElement(_scrollbar["default"], {
|
|
329
331
|
style: {
|
|
@@ -7,14 +7,14 @@ exports.trackerInfo = exports.defaultBookDemoJsonValue = exports["default"] = ex
|
|
|
7
7
|
|
|
8
8
|
var _interface = require("./interface");
|
|
9
9
|
|
|
10
|
-
var _orderAward = _interopRequireDefault(require("./img/order-award.png"));
|
|
11
|
-
|
|
12
10
|
var _demoOkr = _interopRequireDefault(require("./img/demo-okr.jpg"));
|
|
13
11
|
|
|
14
12
|
var _demoPerformance = _interopRequireDefault(require("./img/demo-performance.jpg"));
|
|
15
13
|
|
|
16
14
|
var _demoLearning = _interopRequireDefault(require("./img/demo-learning.jpg"));
|
|
17
15
|
|
|
16
|
+
var _demoUniversal = _interopRequireDefault(require("./img/demo-universal.jpg"));
|
|
17
|
+
|
|
18
18
|
var _bookTypeInfo, _trackerInfo, _DemoTypeTextMap;
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -23,8 +23,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
23
23
|
|
|
24
24
|
var bookTypeInfo = (_bookTypeInfo = {}, _defineProperty(_bookTypeInfo, _interface.EDemoType.UniversalBookDemo, {
|
|
25
25
|
title: "立即预约演示",
|
|
26
|
-
desc: "
|
|
27
|
-
img:
|
|
26
|
+
desc: "现在预约你将快速获得免费一对一人工在线演示",
|
|
27
|
+
img: _demoUniversal["default"],
|
|
28
28
|
formField: [{
|
|
29
29
|
name: "姓名",
|
|
30
30
|
type: "text",
|
|
@@ -188,7 +188,7 @@ function OkrRelationTaskModal(props) {
|
|
|
188
188
|
};
|
|
189
189
|
|
|
190
190
|
var onOkHandler = function onOkHandler() {
|
|
191
|
-
if (krId && selected !== null && selected !== void 0 && selected.length) {
|
|
191
|
+
if ((krId || okrId) && selected !== null && selected !== void 0 && selected.length) {
|
|
192
192
|
(0, _requestApi.relateOkr)(selected, krId, okrId).then(function (res) {
|
|
193
193
|
if (res.Code) {
|
|
194
194
|
_toast["default"].Success((0, _getLocale.getLocale)('Per_Ass_New_Ass_text_Succe'));
|
|
@@ -83,7 +83,7 @@ function OkrRelationWorkModal(props) {
|
|
|
83
83
|
}, [defaultVisible]);
|
|
84
84
|
|
|
85
85
|
var onOkHandler = function onOkHandler() {
|
|
86
|
-
if (krId && selected !== null && selected !== void 0 && selected.length) {
|
|
86
|
+
if ((krId || okrId) && selected !== null && selected !== void 0 && selected.length) {
|
|
87
87
|
(0, _requestApi.workRelateOkr)(selected, krId, okrId).then(function (res) {
|
|
88
88
|
if (res.Code) {
|
|
89
89
|
_toast["default"].Success((0, _getLocale.getLocale)('Per_Ass_New_Ass_text_Succe'));
|
|
@@ -28,9 +28,9 @@ var getVersionList = function getVersionList() {
|
|
|
28
28
|
}, {
|
|
29
29
|
version: Versions.WeixinAssess,
|
|
30
30
|
name: (0, _getLocale.getLocale)("Sw_PerformEdition"),
|
|
31
|
-
color: "
|
|
32
|
-
image: require("./images/performance.png"),
|
|
33
|
-
items: [(0, _getLocale.getLocale)("Per_Menu_Title_Assessmenttempla"), (0, _getLocale.getLocale)("
|
|
31
|
+
color: "green",
|
|
32
|
+
image: require("./images/performance-exam.png"),
|
|
33
|
+
items: [(0, _getLocale.getLocale)("Per_Menu_Title_Assessmenttempla"), (0, _getLocale.getLocale)("Ono_Pro_Oneonones"), (0, _getLocale.getLocale)("Sw_360Feedback"), (0, _getLocale.getLocale)("Sw_PeStatistics"), (0, _getLocale.getLocale)("HRBP_Performance_calibration")]
|
|
34
34
|
}, {
|
|
35
35
|
version: Versions.Professional,
|
|
36
36
|
name: (0, _getLocale.getLocale)("Sw_OKRsEdition"),
|
|
@@ -41,10 +41,10 @@ var getVersionList = function getVersionList() {
|
|
|
41
41
|
}, {
|
|
42
42
|
version: Versions.Flagship,
|
|
43
43
|
name: (0, _getLocale.getLocale)("Sw_FlagshipEdit"),
|
|
44
|
-
subName: (0, _getLocale.getLocale)("
|
|
45
|
-
color: "
|
|
46
|
-
image: require("./images/
|
|
47
|
-
items: [(0, _getLocale.getLocale)("
|
|
44
|
+
subName: (0, _getLocale.getLocale)("OKR_Performance_Manage"),
|
|
45
|
+
color: "purple",
|
|
46
|
+
image: require("./images/okr-purple.png"),
|
|
47
|
+
items: [(0, _getLocale.getLocale)("OKR_Flagship_Content")]
|
|
48
48
|
}];
|
|
49
49
|
};
|
|
50
50
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -122,16 +122,25 @@
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.version-change-modal .green .version-item-header {
|
|
125
|
-
background-image: url(./images/header-
|
|
125
|
+
background-image: url(./images/header-g1.png);
|
|
126
126
|
background-size: 100% 100%;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
.version-change-modal .green li::before {
|
|
130
|
-
color: #
|
|
130
|
+
color: #8BE86C;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
.version-change-modal .green .item-button {
|
|
134
|
-
background: linear-gradient(180deg, #
|
|
134
|
+
background: linear-gradient(180deg, #B9E48D 0%, #81C43C 100%);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.version-change-modal .purple .version-item-header {
|
|
138
|
+
background-image: url(./images/header-p.png);
|
|
139
|
+
background-size: 100% 100%;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.version-change-modal .purple .item-button {
|
|
143
|
+
background: linear-gradient(180deg, #C8B4FF 0%, #8056D0 100%);
|
|
135
144
|
}
|
|
136
145
|
|
|
137
146
|
.version-change-modal .version-item-list {
|
|
@@ -149,6 +158,30 @@
|
|
|
149
158
|
opacity: 0.5;
|
|
150
159
|
}
|
|
151
160
|
|
|
161
|
+
.titaui-version-change-modal__flagship-content {
|
|
162
|
+
width: 180px;
|
|
163
|
+
height: 72px;
|
|
164
|
+
text-align: center;
|
|
165
|
+
font-size: 13px;
|
|
166
|
+
font-family: PingFangSC-Regular, PingFang SC;
|
|
167
|
+
font-weight: 400;
|
|
168
|
+
color: #3F4755;
|
|
169
|
+
line-height: 24px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.titaui-version-change-modal__flagship-content a {
|
|
173
|
+
position: relative;
|
|
174
|
+
z-index: 10;
|
|
175
|
+
display: block;
|
|
176
|
+
width: 180px;
|
|
177
|
+
height: 24px;
|
|
178
|
+
font-size: 13px;
|
|
179
|
+
font-family: PingFangSC-Regular, PingFang SC;
|
|
180
|
+
font-weight: 400;
|
|
181
|
+
color: #2879FF;
|
|
182
|
+
line-height: 24px;
|
|
183
|
+
}
|
|
184
|
+
|
|
152
185
|
.titaui-version-change-modal__dialog > .rc-dialog-content {
|
|
153
186
|
background-color: transparent !important;
|
|
154
187
|
}
|
|
@@ -11,6 +11,10 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _dialog = _interopRequireDefault(require("../dialog"));
|
|
13
13
|
|
|
14
|
+
var _bookDemo = _interopRequireDefault(require("../book-demo"));
|
|
15
|
+
|
|
16
|
+
var _interface = require("../../components/help-card/interface");
|
|
17
|
+
|
|
14
18
|
var _bsGlobal = require("../../utils/bs-global");
|
|
15
19
|
|
|
16
20
|
var _requestApi = require("./request-api");
|
|
@@ -63,11 +67,21 @@ var VersionChangeModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
|
|
|
63
67
|
active = _useState4[0],
|
|
64
68
|
setActive = _useState4[1];
|
|
65
69
|
|
|
66
|
-
var _useState5 = (0, _react.useState)((0, _bsGlobal.getBSGlobal)("tenantAuthentication").Version
|
|
70
|
+
var _useState5 = (0, _react.useState)((0, _bsGlobal.getBSGlobal)("tenantAuthentication").Version === 1 && (0, _bsGlobal.getBSGlobal)("userGuides").versionGuide.value && (0, _helpers.getTenantInfo)().tenantType !== 2),
|
|
67
71
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
68
72
|
visible = _useState6[0],
|
|
69
73
|
setVisible = _useState6[1];
|
|
70
74
|
|
|
75
|
+
var bookDemoRef = (0, _react.useRef)(null);
|
|
76
|
+
|
|
77
|
+
var onShow = function onShow() {
|
|
78
|
+
setVisible(true);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
var onHide = function onHide() {
|
|
82
|
+
setVisible(false);
|
|
83
|
+
};
|
|
84
|
+
|
|
71
85
|
var handleCancelGuideClick = function handleCancelGuideClick() {
|
|
72
86
|
(0, _requestApi.cancelGuide)((0, _bsGlobal.getBSGlobal)("userGuides").versionGuide.type);
|
|
73
87
|
onHide();
|
|
@@ -112,12 +126,18 @@ var VersionChangeModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
|
|
|
112
126
|
};
|
|
113
127
|
}();
|
|
114
128
|
|
|
115
|
-
var
|
|
116
|
-
|
|
117
|
-
};
|
|
129
|
+
var getBookDemoVersion = function getBookDemoVersion() {
|
|
130
|
+
var menuVersion = window.BSGlobal.tenantAuthentication.MenuVersion;
|
|
118
131
|
|
|
119
|
-
|
|
120
|
-
|
|
132
|
+
if (menuVersion === _interface.ETrialVersion.OKR) {
|
|
133
|
+
return _bookDemo["default"].DemoType.TryOKR;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (menuVersion === _interface.ETrialVersion.Performance) {
|
|
137
|
+
return _bookDemo["default"].DemoType.TryPerformance;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return _bookDemo["default"].DemoType.UniversalBookDemo;
|
|
121
141
|
};
|
|
122
142
|
|
|
123
143
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
@@ -126,9 +146,33 @@ var VersionChangeModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
|
|
|
126
146
|
onHide: onHide
|
|
127
147
|
};
|
|
128
148
|
});
|
|
149
|
+
|
|
150
|
+
var handlePoint = function handlePoint() {
|
|
151
|
+
if (visible) {
|
|
152
|
+
setVisible(false);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (bookDemoRef.current) {
|
|
156
|
+
bookDemoRef.current.show();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (window.titaTracker) {
|
|
160
|
+
window.titaTracker("action").record({
|
|
161
|
+
actionName: "申请演示",
|
|
162
|
+
actionGroup: "试用版-申请演示",
|
|
163
|
+
productName: "系统内-申请演示"
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
129
168
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
130
169
|
className: prefix
|
|
131
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
170
|
+
}, /*#__PURE__*/_react["default"].createElement(_bookDemo["default"].BookDemoPC, {
|
|
171
|
+
visible: false,
|
|
172
|
+
ref: bookDemoRef,
|
|
173
|
+
type: getBookDemoVersion()
|
|
174
|
+
}), /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
|
|
175
|
+
zIndex: 1199,
|
|
132
176
|
visible: visible,
|
|
133
177
|
noFooter: true,
|
|
134
178
|
style: {
|
|
@@ -156,7 +200,7 @@ var VersionChangeModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
|
|
|
156
200
|
onMouseEnter: function onMouseEnter() {
|
|
157
201
|
return setActive(version.version);
|
|
158
202
|
},
|
|
159
|
-
className: "version-item ".concat(version.color).concat(active
|
|
203
|
+
className: "version-item ".concat(version.color).concat(active === version.version ? " active" : ""),
|
|
160
204
|
style: {
|
|
161
205
|
backgroundImage: "url(".concat(version.image, ")")
|
|
162
206
|
}
|
|
@@ -164,7 +208,11 @@ var VersionChangeModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
|
|
|
164
208
|
className: "version-item-header"
|
|
165
209
|
}, version.name, !!version.subName && /*#__PURE__*/_react["default"].createElement("div", {
|
|
166
210
|
className: "version-item-subname"
|
|
167
|
-
}, version.subName)), /*#__PURE__*/_react["default"].createElement("
|
|
211
|
+
}, version.subName)), version.version === 6 ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
212
|
+
className: "".concat(prefix, "__flagship-content")
|
|
213
|
+
}, version.items[0], /*#__PURE__*/_react["default"].createElement("span", {
|
|
214
|
+
onClick: handlePoint
|
|
215
|
+
}, /*#__PURE__*/_react["default"].createElement("a", null, (0, _getLocale.getLocale)("AppointmentPresentation")))) : /*#__PURE__*/_react["default"].createElement("ul", {
|
|
168
216
|
className: "version-item-list"
|
|
169
217
|
}, version.items.map(function (item, index) {
|
|
170
218
|
return /*#__PURE__*/_react["default"].createElement("li", {
|
package/lib/utils/open-data.js
CHANGED
|
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _bsGlobal = require("./bs-global");
|
|
13
13
|
|
|
14
|
+
var Sentry = _interopRequireWildcard(require("@sentry/browser"));
|
|
15
|
+
|
|
14
16
|
var _openDataPainter = require("../components/open-data-painter");
|
|
15
17
|
|
|
16
18
|
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); }
|
|
@@ -30,12 +32,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
30
32
|
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; }
|
|
31
33
|
|
|
32
34
|
var WX_SOURCE = 860;
|
|
33
|
-
var WX_UA_STR =
|
|
35
|
+
var WX_UA_STR = "micromessenger";
|
|
34
36
|
var FEISHU_SOURCE = 862;
|
|
35
37
|
var DINGTALK_SOURCE = 861;
|
|
36
38
|
|
|
37
39
|
var getSource = function getSource() {
|
|
38
|
-
return (0, _bsGlobal.getBSGlobal)(
|
|
40
|
+
return (0, _bsGlobal.getBSGlobal)("tenantInfo").Source;
|
|
39
41
|
};
|
|
40
42
|
|
|
41
43
|
exports.getSource = getSource;
|
|
@@ -59,10 +61,10 @@ var getUA = function getUA() {
|
|
|
59
61
|
var getOpenId = function getOpenId(id, type) {
|
|
60
62
|
var openIds;
|
|
61
63
|
|
|
62
|
-
if (type ==
|
|
63
|
-
openIds = (0, _bsGlobal.getBSGlobal)(
|
|
64
|
-
} else if (type ==
|
|
65
|
-
openIds = (0, _bsGlobal.getBSGlobal)(
|
|
64
|
+
if (type == "userName") {
|
|
65
|
+
openIds = (0, _bsGlobal.getBSGlobal)("openIds");
|
|
66
|
+
} else if (type == "departmentName") {
|
|
67
|
+
openIds = (0, _bsGlobal.getBSGlobal)("openDepartmentIds");
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
return openIds && openIds[id];
|
|
@@ -73,9 +75,40 @@ exports.getOpenId = getOpenId;
|
|
|
73
75
|
function openData(p) {
|
|
74
76
|
if (getSource() == WX_SOURCE || getUA().includes(WX_UA_STR)) {
|
|
75
77
|
return function (p) {
|
|
76
|
-
if (p.id === undefined && p.corpId === undefined)
|
|
78
|
+
if (p.id === undefined && p.corpId === undefined) {
|
|
79
|
+
Sentry.withScope(function (scope) {
|
|
80
|
+
scope.setTag("error-level", "P1");
|
|
81
|
+
scope.setTag("error-type", "企业微信openData调用失败");
|
|
82
|
+
scope.setExtra("fail_type", p.type);
|
|
83
|
+
scope.setExtra("p_id", p.id);
|
|
84
|
+
scope.setExtra("corp_id", p.corp_id);
|
|
85
|
+
scope.setExtra("p_name", p.name);
|
|
86
|
+
p.callFunc && scope.setExtra("fail_callFunc", p.callFunc);
|
|
87
|
+
p.extra && scope.setExtra("fail_extra", p.extra);
|
|
88
|
+
Sentry.captureException(new Error("企业微信openData调用失败"), scope);
|
|
89
|
+
});
|
|
90
|
+
return p.name || null;
|
|
91
|
+
} // @ts-ignore
|
|
92
|
+
|
|
93
|
+
|
|
77
94
|
var openId = p.corpId || getOpenId(p.id, p.type);
|
|
78
|
-
|
|
95
|
+
|
|
96
|
+
if (!openId) {
|
|
97
|
+
Sentry.withScope(function (scope) {
|
|
98
|
+
scope.setTag("error-level", "P1");
|
|
99
|
+
scope.setTag("error-type", "企业微信openData调用失败");
|
|
100
|
+
scope.setExtra("fail_type", p.type);
|
|
101
|
+
scope.setExtra("p_id", p.id);
|
|
102
|
+
scope.setExtra("p_name", p.name);
|
|
103
|
+
scope.setExtra("corp_id", p.corp_id);
|
|
104
|
+
scope.setExtra('open_id', getOpenId(p.id, p.type));
|
|
105
|
+
p.callFunc && scope.setExtra("fail_callFunc", p.callFunc);
|
|
106
|
+
p.extra && scope.setExtra("fail_extra", p.extra);
|
|
107
|
+
Sentry.captureException(new Error("企业微信openData调用失败"), scope);
|
|
108
|
+
});
|
|
109
|
+
return p.name || p.id || null;
|
|
110
|
+
}
|
|
111
|
+
|
|
79
112
|
var ref = (0, _react.useRef)(null);
|
|
80
113
|
(0, _react.useEffect)(function () {
|
|
81
114
|
var wWOpenData = window.top.WWOpenData; // // 如果当前页面中没有 WWOpenData 则去 top 上尝试获取
|
|
@@ -87,10 +120,10 @@ function openData(p) {
|
|
|
87
120
|
});
|
|
88
121
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
89
122
|
style: {
|
|
90
|
-
display:
|
|
91
|
-
position:
|
|
92
|
-
overflow:
|
|
93
|
-
textOverflow:
|
|
123
|
+
display: "inline",
|
|
124
|
+
position: "relative",
|
|
125
|
+
overflow: "hidden",
|
|
126
|
+
textOverflow: "ellipsis"
|
|
94
127
|
}
|
|
95
128
|
}, /*#__PURE__*/_react["default"].createElement("ww-open-data", {
|
|
96
129
|
ref: ref,
|
|
@@ -98,7 +131,7 @@ function openData(p) {
|
|
|
98
131
|
openid: openId
|
|
99
132
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
100
133
|
style: {
|
|
101
|
-
position:
|
|
134
|
+
position: "absolute",
|
|
102
135
|
top: 0,
|
|
103
136
|
left: 0,
|
|
104
137
|
right: 0,
|
|
@@ -118,7 +151,7 @@ var getOpenData = openData();
|
|
|
118
151
|
|
|
119
152
|
var OpenUserName = function OpenUserName(p) {
|
|
120
153
|
return getOpenData(_objectSpread(_objectSpread({}, p), {}, {
|
|
121
|
-
type:
|
|
154
|
+
type: "userName"
|
|
122
155
|
}));
|
|
123
156
|
};
|
|
124
157
|
|
|
@@ -126,7 +159,7 @@ exports.OpenUserName = OpenUserName;
|
|
|
126
159
|
|
|
127
160
|
var OpenDepartmentName = function OpenDepartmentName(p) {
|
|
128
161
|
return getOpenData(_objectSpread(_objectSpread({}, p), {}, {
|
|
129
|
-
type:
|
|
162
|
+
type: "departmentName"
|
|
130
163
|
}));
|
|
131
164
|
};
|
|
132
165
|
|
|
@@ -137,22 +170,22 @@ var openDataMap = {
|
|
|
137
170
|
}; // name:'wx'|'dd'|'feishu',type:'source'|'env'|'all' = 'all'
|
|
138
171
|
|
|
139
172
|
var isPlatform = function isPlatform(name) {
|
|
140
|
-
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
173
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "all";
|
|
141
174
|
|
|
142
175
|
switch (name) {
|
|
143
|
-
case
|
|
176
|
+
case "wx":
|
|
144
177
|
{
|
|
145
|
-
if (type ==
|
|
146
|
-
if (type ==
|
|
178
|
+
if (type == "source") return getSource() == WX_SOURCE;
|
|
179
|
+
if (type == "env") return getUA().includes(WX_UA_STR);
|
|
147
180
|
return getSource() == WX_SOURCE || getUA().includes(WX_UA_STR);
|
|
148
181
|
}
|
|
149
182
|
|
|
150
|
-
case
|
|
183
|
+
case "dd":
|
|
151
184
|
{
|
|
152
185
|
return getSource() == DINGTALK_SOURCE;
|
|
153
186
|
}
|
|
154
187
|
|
|
155
|
-
case
|
|
188
|
+
case "feishu":
|
|
156
189
|
{
|
|
157
190
|
return getSource() == FEISHU_SOURCE;
|
|
158
191
|
}
|
|
@@ -171,7 +204,7 @@ var parseTag = function parseTag(str) {
|
|
|
171
204
|
// return <span dangerouslySetInnerHTML={{ '__html': str }} />;
|
|
172
205
|
|
|
173
206
|
while (matchStr != null) {
|
|
174
|
-
var OpenDataCompoent = matchStr[1] ==
|
|
207
|
+
var OpenDataCompoent = matchStr[1] == "userId" ? OpenUserName : OpenDepartmentName;
|
|
175
208
|
|
|
176
209
|
if (!OpenDataCompoent) {
|
|
177
210
|
openDatas.push( /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -185,8 +218,8 @@ var parseTag = function parseTag(str) {
|
|
|
185
218
|
} else {
|
|
186
219
|
openDatas.push( /*#__PURE__*/_react["default"].createElement("span", {
|
|
187
220
|
style: {
|
|
188
|
-
color:
|
|
189
|
-
margin:
|
|
221
|
+
color: "#1890ff",
|
|
222
|
+
margin: "0 4px"
|
|
190
223
|
},
|
|
191
224
|
onClick: function onClick(e) {
|
|
192
225
|
return e.stopPropagation();
|
|
@@ -221,11 +254,15 @@ var parseString = function parseString(str) {
|
|
|
221
254
|
// @ts-ignore
|
|
222
255
|
var source = window.BSGlobal.tenantInfo.Source;
|
|
223
256
|
var ua = navigator.userAgent.toLowerCase();
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
257
|
+
|
|
258
|
+
if (source != 860 && ua.indexOf("micromessenger") == -1) {
|
|
259
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
260
|
+
dangerouslySetInnerHTML: {
|
|
261
|
+
__html: str
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
|
|
229
266
|
var reg = /\[(\w+?)\:(\w+?)\]/g;
|
|
230
267
|
var strReg = /\[\w+?\:\w+?\]/;
|
|
231
268
|
var openDatas = [];
|
|
@@ -273,11 +310,15 @@ var parseStringV2 = function parseStringV2(str) {
|
|
|
273
310
|
// @ts-ignore
|
|
274
311
|
var source = window.BSGlobal.tenantInfo.Source;
|
|
275
312
|
var ua = navigator.userAgent.toLowerCase();
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
313
|
+
|
|
314
|
+
if (source != 860 && ua.indexOf("micromessenger") == -1) {
|
|
315
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
316
|
+
dangerouslySetInnerHTML: {
|
|
317
|
+
__html: str
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
|
|
281
322
|
var reg = /\$(userName|departmentName)\=(.+?)\$/g;
|
|
282
323
|
var strReg = /\$(?:userName|departmentName)\=.+?\$/;
|
|
283
324
|
var openDatas = [];
|
|
@@ -332,14 +373,14 @@ var parseOpenDataStringToImg = /*#__PURE__*/function () {
|
|
|
332
373
|
font = _args.length > 1 && _args[1] !== undefined ? _args[1] : {
|
|
333
374
|
lineHeight: 20,
|
|
334
375
|
fontSize: 18,
|
|
335
|
-
fontWeight:
|
|
336
|
-
color:
|
|
376
|
+
fontWeight: "500",
|
|
377
|
+
color: "#3f4755"
|
|
337
378
|
};
|
|
338
379
|
font = _objectSpread(_objectSpread({}, {
|
|
339
380
|
lineHeight: 20,
|
|
340
381
|
fontSize: 18,
|
|
341
|
-
fontWeight:
|
|
342
|
-
color:
|
|
382
|
+
fontWeight: "500",
|
|
383
|
+
color: "#3f4755"
|
|
343
384
|
}), font || {});
|
|
344
385
|
reg = /\$(userName|departmentName)\=(.+?)\$/g;
|
|
345
386
|
strReg = /\$(?:userName|departmentName)\=.+?\$/;
|
|
@@ -405,8 +446,8 @@ var getCanvasImg = /*#__PURE__*/function () {
|
|
|
405
446
|
case 0:
|
|
406
447
|
lineHeight = _ref2.lineHeight, fontSize = _ref2.fontSize, fontWeight = _ref2.fontWeight, color = _ref2.color;
|
|
407
448
|
font = "".concat(fontWeight, " ").concat(fontSize, "px/").concat(lineHeight, "px arial,sans-serif");
|
|
408
|
-
canvas = document.createElement(
|
|
409
|
-
ctx = canvas.getContext(
|
|
449
|
+
canvas = document.createElement("canvas");
|
|
450
|
+
ctx = canvas.getContext("2d");
|
|
410
451
|
|
|
411
452
|
if (ctx) {
|
|
412
453
|
_context2.next = 6;
|
|
@@ -424,16 +465,16 @@ var getCanvasImg = /*#__PURE__*/function () {
|
|
|
424
465
|
|
|
425
466
|
case 8:
|
|
426
467
|
name = _context2.sent;
|
|
427
|
-
img = document.createElement(
|
|
468
|
+
img = document.createElement("img");
|
|
428
469
|
ctx.font = font; // const fitStr = fittingString(ctx, name, 92);
|
|
429
470
|
|
|
430
|
-
_ctx$measureText = ctx.measureText(name ||
|
|
471
|
+
_ctx$measureText = ctx.measureText(name || ""), width = _ctx$measureText.width;
|
|
431
472
|
actualWidth = Math.min(width, 92);
|
|
432
473
|
(0, _openDataPainter.setSize)(canvas, ctx, actualWidth, lineHeight);
|
|
433
|
-
ctx.textBaseline =
|
|
474
|
+
ctx.textBaseline = "middle";
|
|
434
475
|
ctx.font = font;
|
|
435
476
|
ctx.fillStyle = color;
|
|
436
|
-
ctx.fillText(name ||
|
|
477
|
+
ctx.fillText(name || "", 0, lineHeight / 2);
|
|
437
478
|
src = canvas.toDataURL();
|
|
438
479
|
return _context2.abrupt("return", /*#__PURE__*/_react["default"].createElement("img", {
|
|
439
480
|
src: src,
|
|
@@ -464,7 +505,7 @@ var parseHtmlAndTextTag = function parseHtmlAndTextTag(str) {
|
|
|
464
505
|
|
|
465
506
|
while (matchStr != null) {
|
|
466
507
|
if (matchStr) {
|
|
467
|
-
var OpenDataCompoent = matchStr[1] ==
|
|
508
|
+
var OpenDataCompoent = matchStr[1] == "userId" ? OpenUserName : OpenDepartmentName;
|
|
468
509
|
|
|
469
510
|
if (!OpenDataCompoent) {
|
|
470
511
|
var strParsed = parseString(matchStr[0]);
|
|
@@ -472,8 +513,8 @@ var parseHtmlAndTextTag = function parseHtmlAndTextTag(str) {
|
|
|
472
513
|
} else {
|
|
473
514
|
openDatas.push( /*#__PURE__*/_react["default"].createElement("span", {
|
|
474
515
|
style: {
|
|
475
|
-
color:
|
|
476
|
-
margin:
|
|
516
|
+
color: "#1890ff",
|
|
517
|
+
margin: "0 4px"
|
|
477
518
|
},
|
|
478
519
|
onClick: function onClick(e) {
|
|
479
520
|
return e.stopPropagation();
|