@titaui/pc 1.12.57-beta.2 → 1.12.60

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.
@@ -35,11 +35,6 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
35
35
 
36
36
  var preCls = 'titaui-pc__guide-tip';
37
37
  var GuideTip = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
38
- var popupRef = (0, _react.useRef)({
39
- open: function open() {},
40
- close: function close() {}
41
- });
42
-
43
38
  var _props$type = props.type,
44
39
  type = _props$type === void 0 ? 'default' : _props$type,
45
40
  _props$width = props.width,
@@ -52,13 +47,19 @@ var GuideTip = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
52
47
  _props$classnames = props.classnames,
53
48
  classnames = _props$classnames === void 0 ? "".concat(preCls, "__popup") : _props$classnames,
54
49
  content = props.content,
55
- onClickClose = props.onClickClose,
50
+ _props$onClickClose = props.onClickClose,
51
+ onClickClose = _props$onClickClose === void 0 ? function () {} : _props$onClickClose,
56
52
  _props$buttonTitle = props.buttonTitle,
57
53
  buttonTitle = _props$buttonTitle === void 0 ? '好哒' : _props$buttonTitle,
58
54
  _props$visible = props.visible,
59
55
  visible = _props$visible === void 0 ? false : _props$visible,
60
56
  restProps = _objectWithoutProperties(props, _excluded);
61
57
 
58
+ var popupRef = (0, _react.useRef)({
59
+ open: function open() {},
60
+ close: function close() {}
61
+ });
62
+
62
63
  var handleCloseGuidePopup = function handleCloseGuidePopup() {
63
64
  onClickClose();
64
65
  popupRef.current.close();
@@ -21,7 +21,11 @@ function _default(props) {
21
21
 
22
22
  var onNodeClickHandler = function onNodeClickHandler() {
23
23
  if (data.href) {
24
- window.location.href = data.href;
24
+ if (data.openBlank) {
25
+ window.open(data.href, '_blank');
26
+ } else {
27
+ window.location.href = data.href;
28
+ }
25
29
  }
26
30
  };
27
31
 
@@ -21,6 +21,7 @@ var EManagerType;
21
21
  EManagerType[EManagerType["Supervisor"] = 2] = "Supervisor";
22
22
  EManagerType[EManagerType["ReCharge"] = 3] = "ReCharge";
23
23
  EManagerType[EManagerType["DemoFreeReadOnly"] = 4] = "DemoFreeReadOnly";
24
+ EManagerType[EManagerType["ReadOnlyAll"] = 5] = "ReadOnlyAll";
24
25
  })(EManagerType || (EManagerType = {}));
25
26
 
26
27
  var defaultRefObject = {
@@ -104,7 +105,7 @@ var DemoMenuData = /*#__PURE__*/function () {
104
105
  label: "公海资源",
105
106
  key: "customer",
106
107
  href: "#/demofree/customer/public",
107
- isShow: true,
108
+ isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager,
108
109
  children: [{
109
110
  icon: "",
110
111
  label: "全部客户",
@@ -129,19 +130,19 @@ var DemoMenuData = /*#__PURE__*/function () {
129
130
  label: "客户续费",
130
131
  key: "recharge",
131
132
  href: "#/demofree/recharge",
132
- isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager,
133
+ isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager || this.isManager === EManagerType.ReadOnlyAll,
133
134
  children: [{
134
135
  icon: "",
135
136
  label: "客户",
136
137
  key: PAGE_RECHARGE_LIST,
137
138
  href: "#/demofree/recharge/list",
138
- isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager
139
+ isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager || this.isManager === EManagerType.ReadOnlyAll
139
140
  }, {
140
141
  icon: "",
141
142
  label: "到期订单",
142
143
  key: PAGE_DUEDATE_ORDER,
143
144
  href: "#/demofree/recharge/order",
144
- isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager
145
+ isShow: this.isManager === EManagerType.ReCharge || this.isManager === EManagerType.Manager || this.isManager === EManagerType.ReadOnlyAll
145
146
  }]
146
147
  }];
147
148
  }
@@ -111,7 +111,8 @@ var summaryMenus = /*#__PURE__*/function () {
111
111
  key: PAGE_SUMMARY_ROLE,
112
112
  type: _index.MENU_ITEM_NOE,
113
113
  href: "#/enterprise/manage?reactRouterName=daily",
114
- isShow: isShowManage
114
+ isShow: isShowManage,
115
+ openBlank: true
115
116
  }];
116
117
  }
117
118
 
@@ -121,8 +121,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
121
121
 
122
122
  onSelect(node); // 处理菜单选中
123
123
 
124
- if (!selectedKyes.length) return;
125
- setSelectedMenuKeys(selectedKyes);
124
+ if (!selectedKyes.length) return; // setSelectedMenuKeys(selectedKyes) // 为了点总结管理规定的时候不高亮这个菜单,这个菜单新页面打开的,自测没影响,有影响了再说
126
125
  }; // 获取下属数据列表
127
126
 
128
127
 
@@ -230,6 +230,7 @@ var AppCenter = function AppCenter(props) {
230
230
  className: "".concat(precls, "__app-guide-content")
231
231
  }, (0, _bsGlobal.hasWebHead)('okr') ? '🎉 总结升级!全新推出 OKR 总结模版,用总结来实现 OKR闭环!' : '总结升级!查看总结与书写总结都更加轻便啦!'),
232
232
  type: 'button',
233
+ popupPlacement: "bottom",
233
234
  classnames: "".concat(precls, "__app-guide"),
234
235
  onClickClose: handleCloseSummaryGuide
235
236
  }, renderAppItem(app))), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
@@ -117,6 +117,17 @@
117
117
  position: relative;
118
118
  }
119
119
 
120
+ .titaui-nav-top-menu__guide .titaui-pc__guide-tip__popup-triangle {
121
+ top: -5px;
122
+ transform: rotate(180deg);
123
+ }
124
+
125
+ .titaui-nav-top-menu__guide-content {
126
+ font-size: 14px;
127
+ color: #FFFFFF;
128
+ line-height: 22px;
129
+ }
130
+
120
131
  .titaui-nav-top-menu__tips {
121
132
  position: relative;
122
133
  }
@@ -21,6 +21,8 @@ var _conditionRender = _interopRequireDefault(require("../../../../components/co
21
21
 
22
22
  var _useGlobalValue3 = _interopRequireDefault(require("../../useGlobalValue"));
23
23
 
24
+ var _guideTip = _interopRequireDefault(require("../../../guide-tip"));
25
+
24
26
  var _new = _interopRequireDefault(require("./img/new.svg"));
25
27
 
26
28
  require("./index.css");
@@ -45,7 +47,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
45
47
 
46
48
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
47
49
 
48
- var prefix = "titaui-nav-top-menu";
50
+ var prefix = 'titaui-nav-top-menu';
49
51
  var popupAlign = {
50
52
  offset: [0, 5],
51
53
  overflow: {
@@ -54,15 +56,7 @@ var popupAlign = {
54
56
  },
55
57
  targetOffset: [0, 0]
56
58
  };
57
- var NewFeatureGuidePopupAlign = {
58
- offset: [104, -5],
59
- overflow: {
60
- adjustX: true,
61
- adjustY: true
62
- },
63
- targetOffset: [0, 0]
64
- };
65
- var NEWMENUS = "#/interview";
59
+ var NEWMENUS = '#summary/my';
66
60
 
67
61
  var Menu = function Menu(_ref) {
68
62
  var menus = _ref.menus,
@@ -70,8 +64,8 @@ var Menu = function Menu(_ref) {
70
64
 
71
65
  var _useState = (0, _react.useState)(false),
72
66
  _useState2 = _slicedToArray(_useState, 2),
73
- isKnow = _useState2[0],
74
- setIsKonw = _useState2[1];
67
+ guideVisible = _useState2[0],
68
+ setGuideVisible = _useState2[1];
75
69
 
76
70
  var _useState3 = (0, _react.useState)(false),
77
71
  _useState4 = _slicedToArray(_useState3, 2),
@@ -83,7 +77,7 @@ var Menu = function Menu(_ref) {
83
77
  feedNum = _useGlobalValue2[0];
84
78
 
85
79
  var containerRef = (0, _react.useRef)();
86
- var apiPath = (0, _bsGlobal.getBSGlobal)("apiPath");
80
+ var apiPath = (0, _bsGlobal.getBSGlobal)('apiPath');
87
81
  var userId = (0, _bsGlobal.getUserInfo)().Id;
88
82
 
89
83
  var handlePopupVisibleChange = function handlePopupVisibleChange(visible) {
@@ -92,52 +86,37 @@ var Menu = function Menu(_ref) {
92
86
 
93
87
  var handleTracker = function handleTracker(menu) {
94
88
  if (window.titaTracker) {
95
- window.titaTracker("action").record({
89
+ window.titaTracker('action').record({
96
90
  actionName: "\u5BFC\u822A\u83DC\u5355__".concat(menu.title),
97
- actionGroup: "导航菜单",
98
- productName: "导航菜单"
91
+ actionGroup: '导航菜单',
92
+ productName: '导航菜单'
99
93
  });
100
94
  }
101
95
 
102
- if (menu.code === "dynamic" && feedNum > 0) {
96
+ if (menu.code === 'dynamic' && feedNum > 0) {
103
97
  window.location.reload();
104
98
  }
105
99
  };
106
100
 
107
- var handleClick = function handleClick() {
108
- setIsKonw(true);
109
- localStorage.setItem("isNewMenuItem__".concat(userId), "".concat(userId));
101
+ var handleClickClose = function handleClickClose() {
102
+ setGuideVisible(false);
103
+ localStorage.setItem("isKnowNewSummary__".concat(userId), "".concat(userId));
110
104
  };
111
105
 
112
106
  (0, _react.useEffect)(function () {
113
- var cacheIsKnow = localStorage.getItem("isNewMenuItem__".concat(userId));
107
+ var cacheIsKnow = localStorage.getItem("isKnowNewSummary__".concat(userId));
114
108
 
115
109
  if (cacheIsKnow) {
116
- setIsKonw(true);
110
+ setGuideVisible(false);
111
+ } else {
112
+ setGuideVisible(true);
117
113
  }
118
114
  }, []);
119
115
 
120
- var popup = /*#__PURE__*/_react["default"].createElement("div", {
121
- className: "".concat(prefix, "__tips")
122
- }, /*#__PURE__*/_react["default"].createElement("div", {
123
- className: (0, _classnames["default"])("".concat(prefix, "__tips-box"), _defineProperty({}, "".concat(prefix, "__tips-hide"), isKnow))
124
- }, /*#__PURE__*/_react["default"].createElement("div", {
125
- className: "".concat(prefix, "__tips-box-head")
126
- }, /*#__PURE__*/_react["default"].createElement("h2", {
127
- className: "".concat(prefix, "__tips-box-title")
128
- }, "1 : 1 \u9762\u8C08\uFF08\u4E00\u5BF9\u4E00\u9762\u8C08\uFF09\u4E0A\u7EBF\u5566\uFF01"), /*#__PURE__*/_react["default"].createElement("p", {
129
- className: "".concat(prefix, "__tips-box-content")
130
- }, "\u52A9\u529B\u7ECF\u7406\u548C\u4E0B\u7EA7\u8FDB\u884C\u6301\u7EED\u6C9F\u901A\uFF0C\u4E3A\u4E0D\u540C\u573A\u666F\u63D0\u4F9B\u4E30\u5BCC\u7684\u6C9F\u901A\u6A21\u677F\uFF0C\u5373\u523B\u4E86\u89E3\uFF0CGo~")), /*#__PURE__*/_react["default"].createElement("div", {
131
- className: "".concat(prefix, "__tips-box-ok"),
132
- onClick: handleClick
133
- }, "\u597D\u54D2")), /*#__PURE__*/_react["default"].createElement("div", {
134
- className: (0, _classnames["default"])("".concat(prefix, "__tips-triangle"), _defineProperty({}, "".concat(prefix, "__tips-hide"), isKnow))
135
- }));
136
-
137
116
  var renderRawItem = function renderRawItem(menu) {
138
117
  var href = menu.href;
139
118
 
140
- if (menu.title === "Learning" || menu.code === "learning") {
119
+ if (menu.title === 'Learning' || menu.code === 'learning') {
141
120
  href = "".concat(apiPath, "/").concat(href);
142
121
  }
143
122
 
@@ -145,13 +124,17 @@ var Menu = function Menu(_ref) {
145
124
  component: "span"
146
125
  }, /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
147
126
  condition: menu.id
148
- }, /*#__PURE__*/_react["default"].createElement(_popup["default"], {
149
- popupVisible: !isKnow,
150
- popup: menu.href === NEWMENUS ? popup : null,
151
- mask: false,
152
- action: ["focus"],
153
- popupAlign: NewFeatureGuidePopupAlign,
154
- zIndex: 1000
127
+ }, menu.href === NEWMENUS && /*#__PURE__*/_react["default"].createElement(_guideTip["default"], {
128
+ visible: guideVisible,
129
+ classnames: "".concat(prefix, "__guide"),
130
+ type: "button",
131
+ content: /*#__PURE__*/_react["default"].createElement("span", {
132
+ className: "".concat(prefix, "__guide-content")
133
+ }, (0, _bsGlobal.hasWebHead)('okr') ? '🎉 总结升级!全新推出 OKR 总结模版,用总结来实现 OKR闭环!' : '总结升级!查看总结与书写总结都更加轻便啦!'),
134
+ popupAlign: {
135
+ offset: [0, 140]
136
+ },
137
+ onClickClose: handleClickClose
155
138
  }, /*#__PURE__*/_react["default"].createElement("a", {
156
139
  className: (0, _classnames["default"])("".concat(prefix, "__menu-show"), _defineProperty({}, "".concat(prefix, "__menu-show--active"), activeMenuId === menu.id)),
157
140
  href: href,
@@ -159,13 +142,20 @@ var Menu = function Menu(_ref) {
159
142
  onClick: function onClick() {
160
143
  return handleTracker(menu);
161
144
  }
162
- }, menu.title, menu.href === "#dynamic" && feedNum > 0 && /*#__PURE__*/_react["default"].createElement("div", {
163
- className: (0, _classnames["default"])("".concat(prefix, "__menu--hasNum"), _defineProperty({}, "".concat(prefix, "__menu--hasNum-active"), activeMenuId === menu.id && menu.href === "#dynamic"))
164
- }, feedNum > 100 ? "99+" : feedNum), menu.href === NEWMENUS && /*#__PURE__*/_react["default"].createElement("img", {
145
+ }, menu.title, /*#__PURE__*/_react["default"].createElement("img", {
165
146
  src: _new["default"],
166
147
  alt: "",
167
148
  className: "".concat(prefix, "__tips-new")
168
- })))));
149
+ }))), menu.href !== NEWMENUS && /*#__PURE__*/_react["default"].createElement("a", {
150
+ className: (0, _classnames["default"])("".concat(prefix, "__menu-show"), _defineProperty({}, "".concat(prefix, "__menu-show--active"), activeMenuId === menu.id)),
151
+ href: href,
152
+ target: "_self",
153
+ onClick: function onClick() {
154
+ return handleTracker(menu);
155
+ }
156
+ }, menu.title, menu.href === '#dynamic' && feedNum > 0 && /*#__PURE__*/_react["default"].createElement("div", {
157
+ className: (0, _classnames["default"])("".concat(prefix, "__menu--hasNum"), _defineProperty({}, "".concat(prefix, "__menu--hasNum-active"), activeMenuId === menu.id && menu.href === '#dynamic'))
158
+ }, feedNum > 100 ? '99+' : feedNum))));
169
159
  };
170
160
 
171
161
  var renderRest = function renderRest(items) {
@@ -179,7 +169,7 @@ var Menu = function Menu(_ref) {
179
169
  }, items.map(function (menu) {
180
170
  var href = menu.href;
181
171
 
182
- if (menu.title === "Learning" || menu.code === "learning") {
172
+ if (menu.title === 'Learning' || menu.code === 'learning') {
183
173
  href = "".concat(apiPath, "/").concat(href);
184
174
  }
185
175
 
@@ -200,7 +190,7 @@ var Menu = function Menu(_ref) {
200
190
  popupPlacement: "bottomLeft",
201
191
  popupAlign: popupAlign
202
192
  }, /*#__PURE__*/_react["default"].createElement("span", {
203
- className: (0, _classnames["default"])("tu-icon-diot", "".concat(prefix, "__more-icon"), _defineProperty({}, "".concat(prefix, "__more-icon--active"), isActiveHideMeun))
193
+ className: (0, _classnames["default"])('tu-icon-diot', "".concat(prefix, "__more-icon"), _defineProperty({}, "".concat(prefix, "__more-icon--active"), isActiveHideMeun))
204
194
  }));
205
195
  };
206
196
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.12.57-beta.2",
3
+ "version": "1.12.60",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",