@titaui/pc 1.7.80 → 1.7.81
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/dynamic/dynamic-item/dynamic-share-to-dynamic/index.css +7 -0
- package/lib/components/dynamic/dynamic-item/dynamic-share-to-dynamic/index.js +10 -11
- package/lib/components/nav-top/components/menu/index.js +13 -13
- package/lib/components/nav-top/index.js +1 -12
- package/package.json +1 -1
|
@@ -30,6 +30,13 @@
|
|
|
30
30
|
height: 12px;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
.titaui-dynamic-share-to-dynamic__content-title {
|
|
34
|
+
width: 100%;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
text-overflow: ellipsis;
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
}
|
|
39
|
+
|
|
33
40
|
.titaui-dynamic-share-to-dynamic__share {
|
|
34
41
|
box-sizing: border-box;
|
|
35
42
|
height: 104px;
|
|
@@ -55,7 +55,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
55
55
|
|
|
56
56
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
57
57
|
|
|
58
|
-
var prefix =
|
|
58
|
+
var prefix = 'titaui-dynamic-share-to-dynamic';
|
|
59
59
|
var userId = (0, _bsGlobal.getUserInfo)().Id;
|
|
60
60
|
|
|
61
61
|
var DynamicShare = function DynamicShare(_ref) {
|
|
@@ -87,9 +87,9 @@ var DynamicShare = function DynamicShare(_ref) {
|
|
|
87
87
|
|
|
88
88
|
var renderDesc = (0, _react.useMemo)(function () {
|
|
89
89
|
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
90
|
-
className: prefix +
|
|
90
|
+
className: prefix + '__operate-desc'
|
|
91
91
|
}, "\u5206\u4EAB\u4E86\u4E00\u5802\u597D\u8BFE"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
92
|
-
className: prefix +
|
|
92
|
+
className: prefix + '-desc-operate-type',
|
|
93
93
|
style: {
|
|
94
94
|
background: feedTypeColor
|
|
95
95
|
}
|
|
@@ -114,11 +114,9 @@ var DynamicShare = function DynamicShare(_ref) {
|
|
|
114
114
|
});
|
|
115
115
|
}, [data, searchKeyWord]);
|
|
116
116
|
(0, _react.useEffect)(function () {
|
|
117
|
-
if (data.shareContent
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
setContent(htmlToText(JSON.parse(data.shareContent).content));
|
|
121
|
-
}
|
|
117
|
+
if (data.shareContent && typeof data.shareContent === 'string' && data.shareContent.substr(0, 1) === '{') {
|
|
118
|
+
setTitle(JSON.parse(data.shareContent).title);
|
|
119
|
+
setContent(htmlToText(JSON.parse(data.shareContent).content));
|
|
122
120
|
}
|
|
123
121
|
}, []);
|
|
124
122
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -130,12 +128,13 @@ var DynamicShare = function DynamicShare(_ref) {
|
|
|
130
128
|
showTopping: hasDynamicOpereateAuth,
|
|
131
129
|
user: data.publishUser
|
|
132
130
|
}, restProps)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
133
|
-
className: prefix +
|
|
131
|
+
className: prefix + '__content'
|
|
134
132
|
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
|
|
135
|
-
className: (0, _classnames["default"])(prefix +
|
|
133
|
+
className: (0, _classnames["default"])(prefix + '__content-quoto', prefix + '__content-quoto--left'),
|
|
136
134
|
src: _dynamicLeftQuoto["default"]
|
|
137
135
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
138
|
-
ref: contentRef
|
|
136
|
+
ref: contentRef,
|
|
137
|
+
className: "".concat(prefix, "__content-title")
|
|
139
138
|
}, /*#__PURE__*/_react["default"].createElement(_dangerousHtml["default"], {
|
|
140
139
|
htmlText: data.content
|
|
141
140
|
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -44,7 +44,6 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
44
44
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
45
|
|
|
46
46
|
var prefix = 'titaui-nav-top-menu';
|
|
47
|
-
var userId = (0, _bsGlobal.getUserInfo)().Id;
|
|
48
47
|
var popupAlign = {
|
|
49
48
|
offset: [0, 5],
|
|
50
49
|
overflow: {
|
|
@@ -56,8 +55,7 @@ var popupAlign = {
|
|
|
56
55
|
|
|
57
56
|
var Menu = function Menu(_ref) {
|
|
58
57
|
var menus = _ref.menus,
|
|
59
|
-
activeMenuId = _ref.activeMenuId
|
|
60
|
-
isShowTips = _ref.isShowTips;
|
|
58
|
+
activeMenuId = _ref.activeMenuId;
|
|
61
59
|
|
|
62
60
|
var _useState = (0, _react.useState)(false),
|
|
63
61
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -69,11 +67,9 @@ var Menu = function Menu(_ref) {
|
|
|
69
67
|
isKnow = _useState4[0],
|
|
70
68
|
setIsKonw = _useState4[1];
|
|
71
69
|
|
|
72
|
-
var containerRef = (0, _react.useRef)();
|
|
73
|
-
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
var userId = BSGlobal.loginUserInfo.Id;
|
|
70
|
+
var containerRef = (0, _react.useRef)();
|
|
71
|
+
var apiPath = (0, _bsGlobal.getBSGlobal)("apiPath");
|
|
72
|
+
var userId = (0, _bsGlobal.getUserInfo)().Id;
|
|
77
73
|
|
|
78
74
|
var handlePopupVisibleChange = function handlePopupVisibleChange(visible) {
|
|
79
75
|
setPopupVisible(visible);
|
|
@@ -102,6 +98,11 @@ var Menu = function Menu(_ref) {
|
|
|
102
98
|
},
|
|
103
99
|
targetOffset: [0, 0]
|
|
104
100
|
};
|
|
101
|
+
|
|
102
|
+
var handleClickToLearning = function handleClickToLearning() {
|
|
103
|
+
window.open("".concat(apiPath, "/").concat(userId, "/eLearningHome#/"), "_self");
|
|
104
|
+
};
|
|
105
|
+
|
|
105
106
|
(0, _react.useEffect)(function () {
|
|
106
107
|
var isKnow = localStorage.getItem("isKonwLearning".concat(userId));
|
|
107
108
|
|
|
@@ -140,17 +141,16 @@ var Menu = function Menu(_ref) {
|
|
|
140
141
|
}, menu.title)), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
|
|
141
142
|
condition: menu.id === 44312
|
|
142
143
|
}, /*#__PURE__*/_react["default"].createElement(_popup["default"], {
|
|
143
|
-
popupVisible:
|
|
144
|
+
popupVisible: !isKnow,
|
|
144
145
|
popup: popup,
|
|
145
146
|
mask: false,
|
|
146
147
|
action: ['focus'],
|
|
147
148
|
popupAlign: popupAlign2
|
|
148
|
-
}, /*#__PURE__*/_react["default"].createElement("
|
|
149
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
149
150
|
className: (0, _classnames["default"])("".concat(prefix, "__menu-show"), _defineProperty({}, "".concat(prefix, "__menu-show--active"), activeMenuId == menu.id)),
|
|
150
|
-
href: "".concat(apiPath, "/").concat(userId, "/eLearningHome#/"),
|
|
151
|
-
target: "_self",
|
|
152
151
|
onClick: function onClick() {
|
|
153
|
-
|
|
152
|
+
handleTracker(menu);
|
|
153
|
+
handleClickToLearning();
|
|
154
154
|
}
|
|
155
155
|
}, menu.title)), /*#__PURE__*/_react["default"].createElement("img", {
|
|
156
156
|
src: _new["default"],
|
|
@@ -72,11 +72,6 @@ var NavTop = function NavTop() {
|
|
|
72
72
|
activeMenuId = _useState4[0],
|
|
73
73
|
setActiveMenuId = _useState4[1];
|
|
74
74
|
|
|
75
|
-
var _useState5 = (0, _react.useState)(true),
|
|
76
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
77
|
-
isShowTips = _useState6[0],
|
|
78
|
-
setIsShowTips = _useState6[1];
|
|
79
|
-
|
|
80
75
|
var ua = navigator.userAgent.toLowerCase();
|
|
81
76
|
var showWxInvite = (0, _bsGlobal.getTenantInfo)().mainCorpId && ua.indexOf("micromessenger") != -1;
|
|
82
77
|
var openWxInvite = (0, _react.useCallback)(function () {
|
|
@@ -135,11 +130,6 @@ var NavTop = function NavTop() {
|
|
|
135
130
|
(0, _react.useEffect)(function () {
|
|
136
131
|
handleHashChange();
|
|
137
132
|
window.addEventListener("hashchange", handleHashChange);
|
|
138
|
-
|
|
139
|
-
if (!localStorage.getItem("isKonwLearning")) {
|
|
140
|
-
setIsShowTips(false);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
133
|
return function () {
|
|
144
134
|
window.removeEventListener("hashchange", handleHashChange);
|
|
145
135
|
};
|
|
@@ -163,8 +153,7 @@ var NavTop = function NavTop() {
|
|
|
163
153
|
className: (0, _classnames["default"])("".concat(preCls, "__middle"))
|
|
164
154
|
}, /*#__PURE__*/_react["default"].createElement(_menu["default"], {
|
|
165
155
|
menus: menu,
|
|
166
|
-
activeMenuId: activeMenuId
|
|
167
|
-
isShowTips: isShowTips
|
|
156
|
+
activeMenuId: activeMenuId
|
|
168
157
|
})), showWxInvite && /*#__PURE__*/_react["default"].createElement("div", {
|
|
169
158
|
className: (0, _classnames["default"])("".concat(preCls, "__invite")),
|
|
170
159
|
onClick: openWxInvite
|