@titaui/pc 1.7.77 → 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.
@@ -17,6 +17,9 @@
17
17
  color: #3f4755;
18
18
  line-height: 24px;
19
19
  cursor: pointer;
20
+ overflow: hidden;
21
+ text-overflow: ellipsis;
22
+ white-space: nowrap;
20
23
  }
21
24
 
22
25
  .titaui-dynamic-share-to-dynamic__content-quoto {
@@ -27,6 +30,13 @@
27
30
  height: 12px;
28
31
  }
29
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
+
30
40
  .titaui-dynamic-share-to-dynamic__share {
31
41
  box-sizing: border-box;
32
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 = "titaui-dynamic-share-to-dynamic";
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 + "__operate-desc"
90
+ className: prefix + '__operate-desc'
91
91
  }, "\u5206\u4EAB\u4E86\u4E00\u5802\u597D\u8BFE"), /*#__PURE__*/_react["default"].createElement("span", {
92
- className: prefix + "-desc-operate-type",
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 !== null) {
118
- if (data.shareContent.charAt(0) === "{") {
119
- setTitle(JSON.parse(data.shareContent).title);
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 + "__content"
131
+ className: prefix + '__content'
134
132
  }, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
135
- className: (0, _classnames["default"])(prefix + "__content-quoto", prefix + "__content-quoto--left"),
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", {
@@ -193,6 +193,7 @@ var MblogAction = /*#__PURE__*/function (_PureComponent) {
193
193
  tips: this.props.atTipText
194
194
  }, /*#__PURE__*/_react["default"].createElement(_UserSelectorPop["default"], {
195
195
  ref: "atSelector",
196
+ stopPropagation: true,
196
197
  popExtraClassName: "pull-screen-ignore",
197
198
  align: userSelectorPopAlign,
198
199
  container: this.context.popContainer,
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _bsGlobal = require("../../../../utils/bs-global");
15
+
14
16
  var _popup = _interopRequireDefault(require("../../../popup"));
15
17
 
16
18
  var _rcOverflow = _interopRequireDefault(require("rc-overflow"));
@@ -53,8 +55,7 @@ var popupAlign = {
53
55
 
54
56
  var Menu = function Menu(_ref) {
55
57
  var menus = _ref.menus,
56
- activeMenuId = _ref.activeMenuId,
57
- isShowTips = _ref.isShowTips;
58
+ activeMenuId = _ref.activeMenuId;
58
59
 
59
60
  var _useState = (0, _react.useState)(false),
60
61
  _useState2 = _slicedToArray(_useState, 2),
@@ -66,11 +67,9 @@ var Menu = function Menu(_ref) {
66
67
  isKnow = _useState4[0],
67
68
  setIsKonw = _useState4[1];
68
69
 
69
- var containerRef = (0, _react.useRef)(); // @ts-ignore
70
-
71
- var apiPath = BSGlobal.apiPath; // @ts-ignore
72
-
73
- 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;
74
73
 
75
74
  var handlePopupVisibleChange = function handlePopupVisibleChange(visible) {
76
75
  setPopupVisible(visible);
@@ -88,7 +87,7 @@ var Menu = function Menu(_ref) {
88
87
 
89
88
  var handleClick = function handleClick() {
90
89
  setIsKonw(true);
91
- localStorage.setItem("isKonwLearning", "true");
90
+ localStorage.setItem("isKonwLearning".concat(userId), "".concat(userId));
92
91
  };
93
92
 
94
93
  var popupAlign2 = {
@@ -100,6 +99,18 @@ var Menu = function Menu(_ref) {
100
99
  targetOffset: [0, 0]
101
100
  };
102
101
 
102
+ var handleClickToLearning = function handleClickToLearning() {
103
+ window.open("".concat(apiPath, "/").concat(userId, "/eLearningHome#/"), "_self");
104
+ };
105
+
106
+ (0, _react.useEffect)(function () {
107
+ var isKnow = localStorage.getItem("isKonwLearning".concat(userId));
108
+
109
+ if (isKnow) {
110
+ setIsKonw(true);
111
+ }
112
+ }, []);
113
+
103
114
  var popup = /*#__PURE__*/_react["default"].createElement("div", {
104
115
  className: "".concat(prefix, "__tips")
105
116
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -130,17 +141,16 @@ var Menu = function Menu(_ref) {
130
141
  }, menu.title)), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
131
142
  condition: menu.id === 44312
132
143
  }, /*#__PURE__*/_react["default"].createElement(_popup["default"], {
133
- popupVisible: isShowTips,
144
+ popupVisible: !isKnow,
134
145
  popup: popup,
135
146
  mask: false,
136
147
  action: ['focus'],
137
148
  popupAlign: popupAlign2
138
- }, /*#__PURE__*/_react["default"].createElement("a", {
149
+ }, /*#__PURE__*/_react["default"].createElement("span", {
139
150
  className: (0, _classnames["default"])("".concat(prefix, "__menu-show"), _defineProperty({}, "".concat(prefix, "__menu-show--active"), activeMenuId == menu.id)),
140
- href: "".concat(apiPath, "/").concat(userId, "/eLearningHome#/"),
141
- target: "_self",
142
151
  onClick: function onClick() {
143
- return handleTracker(menu);
152
+ handleTracker(menu);
153
+ handleClickToLearning();
144
154
  }
145
155
  }, menu.title)), /*#__PURE__*/_react["default"].createElement("img", {
146
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
@@ -103,7 +103,7 @@ var ExportMapModal = function ExportMapModal(props) {
103
103
  while (1) {
104
104
  switch (_context.prev = _context.next) {
105
105
  case 0:
106
- okrMapRef = document.querySelector(".titaui-okr-flow__export");
106
+ okrMapRef = document.querySelector(".titaui-okr-flow__export") || document.createElement('div');
107
107
  width = okrMapRef.clientWidth; //获取dom 宽度
108
108
 
109
109
  height = okrMapRef.clientHeight; //获取dom 高度
@@ -155,6 +155,12 @@ var ExportMapModal = function ExportMapModal(props) {
155
155
  image.setAttribute("crossOrigin", "anonymous");
156
156
 
157
157
  image.onload = function () {
158
+ if (!url.Data.obj) {
159
+ _toast["default"].Error('导出失败,请稍后重试', {
160
+ canClose: false
161
+ });
162
+ }
163
+
158
164
  var a = document.createElement("a"); // 生成一个a元素
159
165
 
160
166
  var event = new MouseEvent("click"); // 创建一个单击事件
@@ -168,7 +174,7 @@ var ExportMapModal = function ExportMapModal(props) {
168
174
  _toast["default"].Success("导出成功");
169
175
 
170
176
  setIsExport(false);
171
- onCloseHandler();
177
+ onCloseHandler && onCloseHandler();
172
178
  };
173
179
 
174
180
  image.src = imgUrl;
@@ -61,7 +61,8 @@ var getDepartments = function getDepartments(_ref) {
61
61
  // 有权时,获取的节点列表可能存在多个根部门
62
62
  var firstRootNodes = [];
63
63
  var hasGetRootNode = false;
64
- var departments = departs.data.Data.departments;
64
+ var _departs$data$Data$de = departs.data.Data.departments,
65
+ departments = _departs$data$Data$de === void 0 ? [] : _departs$data$Data$de;
65
66
 
66
67
  for (var i = 0; i < departments.length; i++) {
67
68
  var it = departments[i];
@@ -123,8 +124,10 @@ var getTreeData = function getTreeData(id, opts, resolve) {
123
124
  isLoadNodes: isLoadNodes
124
125
  }).then(function (res) {
125
126
  var _res$Data = res.Data,
126
- departments = _res$Data.departments,
127
- users = _res$Data.users;
127
+ _res$Data$departments = _res$Data.departments,
128
+ departments = _res$Data$departments === void 0 ? [] : _res$Data$departments,
129
+ _res$Data$users = _res$Data.users,
130
+ users = _res$Data$users === void 0 ? [] : _res$Data$users;
128
131
  var transDeparts = (0, _utils.translateDepartsToTreeNode)(departments || []);
129
132
  var transUsers = (0, _utils.translateUsersToTreeNode)(users || [], id);
130
133
  resolve && resolve([].concat(_toConsumableArray(transUsers), _toConsumableArray(transDeparts)));
@@ -60,7 +60,7 @@ var UserSelectorPop = /*#__PURE__*/function (_PureComponent) {
60
60
  }
61
61
 
62
62
  return _possibleConstructorReturn(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.handleShowPop = function (e) {
63
- if (_this.props.stopPropagation) {
63
+ if (_this.props.stopPropagation && !!e) {
64
64
  e.stopPropagation();
65
65
  e.nativeEvent.stopImmediatePropagation();
66
66
  } //@ts-ignore
@@ -137,7 +137,7 @@ var EmptyText = _styledComponents["default"].p(_templateObject27 || (_templateOb
137
137
 
138
138
  exports.EmptyText = EmptyText;
139
139
 
140
- var Btn = _styledComponents["default"].a(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n display: inline-block;\n color: #36434d;\n background-color: #f5f8fa;\n border-radius: 2px;\n font-size: 12px;\n line-height: 20px;\n padding: 3px 10px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;\n &:hover {\n color: #36434d;\n box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);\n transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;\n }\n"])));
140
+ var Btn = _styledComponents["default"].a(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n display: inline-block;\n color: #36434d;\n background-color: #f5f8fa;\n border-radius: 2px;\n font-size: 12px;\n line-height: 20px;\n padding: 3px 10px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;\n cursor:pointer;\n &:hover {\n color: #36434d;\n box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);\n transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;\n }\n"])));
141
141
 
142
142
  exports.Btn = Btn;
143
143
 
@@ -166,7 +166,7 @@ var _default = function _default(props) {
166
166
  var okrPage = (0, _react.useRef)();
167
167
  (0, _react.useEffect)(function () {
168
168
  (0, _requestApis.checkTenantOkrExist)().then(function (res) {
169
- return setExist(res.obj);
169
+ return setExist(res && res.obj || false);
170
170
  });
171
171
  }, []);
172
172
  (0, _react.useEffect)(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.7.77",
3
+ "version": "1.7.81",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",