@titaui/pc 1.10.6-3.beta-10 → 1.10.6-3.beta-15

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.
Files changed (26) hide show
  1. package/.husky/pre-commit +1 -1
  2. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +1 -5
  3. package/lib/components/dynamic/dynamic-list/index.js +1 -1
  4. package/lib/components/dynamic/dynamic.js +4 -1
  5. package/lib/components/dynamic/online-broadcast/data.js +13 -1
  6. package/lib/components/menus/export-modules/okr-menus/subordinate-menus/index.js +21 -6
  7. package/lib/components/okr-detail/components/header/o-name.js +11 -4
  8. package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.css +25 -11
  9. package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +4 -2
  10. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +4 -2
  11. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +4 -2
  12. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/index.css +10 -10
  13. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +1 -1
  14. package/lib/components/okr-detail/e-list/index.js +6 -9
  15. package/lib/components/okr-flow/root-node/index.js +14 -1
  16. package/lib/components/okr-progress-detail/index.css +11 -10
  17. package/lib/components/okr-progress-detail/utils.js +4 -4
  18. package/lib/components/scrollbar/index.js +67 -9
  19. package/lib/components/scrollbar/scroll-mask/index.css +29 -0
  20. package/lib/components/scrollbar/scroll-mask/index.js +152 -0
  21. package/lib/components/superset-charts/fetch-assets-and-append/get-assets-with-cache.js +23 -12
  22. package/lib/components/superset-charts/utils/axios.js +3 -3
  23. package/lib/components/tree/index.css +3 -2
  24. package/lib/pages/new-okr-list/index.js +7 -11
  25. package/lib/utils/auth.js +15 -5
  26. package/package.json +1 -1
package/.husky/pre-commit CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/bin/sh
2
2
  . "$(dirname "$0")/_/husky.sh"
3
3
 
4
- # npm run lint-staged
4
+ npm run lint-staged
@@ -13,8 +13,6 @@ var _utils = require("../dynamic-chart/utils");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
 
16
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
-
18
16
  var prefixCls = "titaui-dynamic-item";
19
17
 
20
18
  var DynamicAIDialy = function DynamicAIDialy(_ref) {
@@ -22,9 +20,7 @@ var DynamicAIDialy = function DynamicAIDialy(_ref) {
22
20
  var chartQuery = (0, _utils.getChartProps)(data.biId);
23
21
  return /*#__PURE__*/_react["default"].createElement("div", {
24
22
  className: prefixCls
25
- }, /*#__PURE__*/_react["default"].createElement(_supersetCharts["default"], _extends({
26
- layout: "feed-card"
27
- }, chartQuery)));
23
+ }, /*#__PURE__*/_react["default"].createElement(_supersetCharts["default"], chartQuery));
28
24
  };
29
25
 
30
26
  var _default = DynamicAIDialy;
@@ -73,7 +73,7 @@ var DynamicList = function DynamicList(_ref) {
73
73
  return /*#__PURE__*/_react["default"].createElement("div", {
74
74
  className: "".concat(prefix, "__item-wrapper"),
75
75
  key: item.feedId
76
- }, item.shareType === _constant.EShareType.BiShare && item.biId && ((_JSON$parse = JSON.parse(item.biId)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.type) === "AIDialyFeed" ? /*#__PURE__*/_react["default"].createElement(_dynamicAiDialy["default"], {
76
+ }, item.shareType === _constant.EShareType.BiShare && item.biId && ((_JSON$parse = JSON.parse(item.biId)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.type) === "titaPlanReport" ? /*#__PURE__*/_react["default"].createElement(_dynamicAiDialy["default"], {
77
77
  data: item
78
78
  }) : /*#__PURE__*/_react["default"].createElement(_dynamicItem["default"], {
79
79
  data: item,
@@ -221,7 +221,10 @@ var Dynamic = function Dynamic() {
221
221
  setNoMoreData(resp.Data.isEnd);
222
222
 
223
223
  if (needResetValue) {
224
- setDynamicData(resp.Data.feeds);
224
+ setDynamicData([]);
225
+ setTimeout(function () {
226
+ setDynamicData(resp.Data.feeds);
227
+ }, 0);
225
228
  } else {
226
229
  setDynamicData(JSON.parse(JSON.stringify([].concat(_toConsumableArray(dynamicData), _toConsumableArray(resp.Data.feeds)))));
227
230
  }
@@ -18,10 +18,22 @@ exports.onlineBroadcastData = exports["default"] = void 0;
18
18
  // href = "https://wiki.tita.com/pages/viewpage.action?pageId=15697741";
19
19
  // }
20
20
  var onlineBroadcastData = [{
21
+ hasOnline: true,
22
+ preContent: "「OKR 工作法」体验优化 ",
23
+ preHref: "https://wiki.tita.com/x/jIOeAQ",
24
+ isNew: true,
25
+ date: "3/29"
26
+ }, {
27
+ hasOnline: true,
28
+ preContent: "新增「同步钉钉待办」,工作实时掌握",
29
+ preHref: "https://wiki.tita.com/x/DIOeAQ",
30
+ isNew: true,
31
+ date: "3/18"
32
+ }, {
21
33
  hasOnline: true,
22
34
  preContent: "「考核」支持建立企业指标库",
23
35
  preHref: "https://wiki.tita.com/x/vYGeAQ",
24
- isNew: true,
36
+ isNew: false,
25
37
  date: "2/17"
26
38
  }, {
27
39
  hasOnline: true,
@@ -105,12 +105,21 @@ function _default(props) {
105
105
  }, []);
106
106
 
107
107
  var loadNodes = function loadNodes(nodeId) {
108
- return (// 钻去隔级的直接下级
109
- (0, _requestApis.getSubordinates)({
110
- toUserId: nodeId,
111
- relationIds: "1"
112
- })
113
- );
108
+ // 钻去隔级的直接下级
109
+ return (0, _requestApis.getSubordinates)({
110
+ toUserId: nodeId,
111
+ relationIds: "1"
112
+ });
113
+ };
114
+
115
+ var filterData = function filterData(childNode, grandNode) {
116
+ var mark = {};
117
+ childNode.forEach(function (item) {
118
+ mark[item.id] = true;
119
+ });
120
+ return grandNode.filter(function (item) {
121
+ !mark[item.userId];
122
+ });
114
123
  };
115
124
 
116
125
  var onLoadTreeNodeDataHandler = function onLoadTreeNodeDataHandler(treeNode) {
@@ -119,6 +128,12 @@ function _default(props) {
119
128
  var promise = loadNodes(treeNode.id);
120
129
  if (!promise) return resolve(true);
121
130
  promise.then(function (nodes) {
131
+ var _treeNode$children;
132
+
133
+ if (treeNode !== null && treeNode !== void 0 && (_treeNode$children = treeNode.children) !== null && _treeNode$children !== void 0 && _treeNode$children.length) {
134
+ nodes = filterData(treeNode.children, nodes);
135
+ }
136
+
122
137
  if (!nodes.length) return null;
123
138
  (0, _helper.transToTreeNode)(nodes).forEach(function (it) {
124
139
  return rawTreeData.push(it);
@@ -11,6 +11,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
 
12
12
  var _getLocale = require("../../../../utils/getLocale");
13
13
 
14
+ var _tools = require("../../../../utils/tools");
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
17
 
16
18
  function OName(props) {
@@ -19,16 +21,21 @@ function OName(props) {
19
21
  setIsEdit = props.setIsEdit,
20
22
  okrStatus = props.okrStatus,
21
23
  children = props.children;
24
+
25
+ var handleEditClick = function handleEditClick() {
26
+ if (editable) {
27
+ setIsEdit(true);
28
+ }
29
+ };
30
+
22
31
  return /*#__PURE__*/_react["default"].createElement("div", {
23
32
  className: (0, _classnames["default"])("okr-drawer-header__title", {
24
33
  "okr-drawer-header__title--editable": editable
25
34
  })
26
35
  }, /*#__PURE__*/_react["default"].createElement("span", {
27
36
  className: "okr-drawer-header__name",
28
- onClick: function onClick() {
29
- editable && setIsEdit(true);
30
- }
31
- }, okrName), children, okrStatus == 2 && /*#__PURE__*/_react["default"].createElement("span", {
37
+ onClick: handleEditClick
38
+ }, (0, _tools.htmlDecodeByRegExp)(okrName)), children, Number(okrStatus) === 2 && /*#__PURE__*/_react["default"].createElement("span", {
32
39
  className: "okr-drawer-header__over-tag"
33
40
  }, (0, _getLocale.getLocale)("OKR_MyO_Butt_Hasended")));
34
41
  }
@@ -5,35 +5,49 @@
5
5
  display: flex;
6
6
  }
7
7
 
8
+ .tita-okrdt-tree__e-kr-node:hover .tita-okrdt-tree__e-kr-node-actions {
9
+ opacity: 1;
10
+ transition: all 0.2s linear;
11
+ }
12
+
13
+ .tita-okrdt-tree__e-kr-node-preicon {
14
+ display: inline-block;
15
+ line-height: 18px;
16
+ color: #2879ff;
17
+ font-size: 16px;
18
+ }
19
+
8
20
  .tita-okrdt-tree__e-kr-node-prefix {
9
21
  display: inline-block;
10
- height: 22px;
11
- font-size: 14px;
22
+ height: 18px;
23
+ font-size: 12px;
12
24
  font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
13
25
  color: #2879ff;
14
- line-height: 22px;
26
+ line-height: 18px;
15
27
  }
16
28
 
17
29
  .tita-okrdt-tree__e-kr-node-title {
18
30
  display: inline-block;
19
31
  margin-left: 4px;
20
- height: 22px;
21
- font-size: 14px;
32
+ height: 18px;
33
+ font-size: 12px;
22
34
  font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
23
35
  color: #89919f;
24
- line-height: 22px;
36
+ line-height: 18px;
25
37
  width: 100%;
26
38
  }
27
39
 
28
40
  .tita-okrdt-tree__e-kr-node-actions {
29
41
  display: inline-block;
42
+ opacity: 0;
30
43
  position: absolute;
31
44
  right: 0;
45
+ transition: all 0.2s linear;
32
46
  }
33
47
 
34
48
  .tita-okrdt-tree__e-kr-node-actions-create {
35
49
  height: 18px;
36
- font-size: 13px;
50
+ font-size: 12px;
37
51
  font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
38
52
  color: #2879ff;
39
53
  line-height: 18px;
@@ -43,7 +57,7 @@
43
57
  }
44
58
 
45
59
  .tita-okrdt-tree__e-kr-node-actions-create:hover {
46
- color: #5C8EFF;
60
+ color: #5c8eff;
47
61
  }
48
62
 
49
63
  .tita-okrdt-tree__e-kr-node-actions-create .tu-icon-add1 {
@@ -52,7 +66,7 @@
52
66
 
53
67
  .tita-okrdt-tree__e-kr-node-actions-connect {
54
68
  height: 18px;
55
- font-size: 13px;
69
+ font-size: 12px;
56
70
  font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
57
71
  color: #2879ff;
58
72
  line-height: 18px;
@@ -63,11 +77,11 @@
63
77
  }
64
78
 
65
79
  .tita-okrdt-tree__e-kr-node-actions-connect:hover {
66
- color: #5C8EFF;
80
+ color: #5c8eff;
67
81
  }
68
82
 
69
83
  .e-kr-node-layer-icon {
70
- color: #89919F;
84
+ color: #89919f;
71
85
  }
72
86
 
73
87
  .e-kr-node__guanlian-icon {
@@ -172,9 +172,11 @@ var EKrNode = function EKrNode(props) {
172
172
  return /*#__PURE__*/_react["default"].createElement("div", {
173
173
  key: index,
174
174
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node"))
175
- }, isOTask ? null : /*#__PURE__*/_react["default"].createElement("span", {
175
+ }, isOTask ? /*#__PURE__*/_react["default"].createElement("span", {
176
+ className: (0, _classnames["default"])("tu-icon-O ".concat(_precls["default"], "__e-kr-node-preicon"))
177
+ }) : /*#__PURE__*/_react["default"].createElement("span", {
176
178
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node-prefix"))
177
- }, "KR", index + 1), /*#__PURE__*/_react["default"].createElement("span", {
179
+ }, "KR", data.SortNum ? data.SortNum + 1 : index + 1), /*#__PURE__*/_react["default"].createElement("span", {
178
180
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node-title")),
179
181
  onClick: function onClick() {
180
182
  if (data.mileStoneId) {
@@ -71,7 +71,9 @@ function _default(props) {
71
71
  _props$hasProgress = props.hasProgress,
72
72
  hasProgress = _props$hasProgress === void 0 ? true : _props$hasProgress,
73
73
  _props$hasRelation = props.hasRelation,
74
- hasRelation = _props$hasRelation === void 0 ? true : _props$hasRelation;
74
+ hasRelation = _props$hasRelation === void 0 ? true : _props$hasRelation,
75
+ _props$hasPrinciple = props.hasPrinciple,
76
+ hasPrinciple = _props$hasPrinciple === void 0 ? true : _props$hasPrinciple;
75
77
 
76
78
  var _useState = (0, _react.useState)(false),
77
79
  _useState2 = _slicedToArray(_useState, 2),
@@ -146,7 +148,7 @@ function _default(props) {
146
148
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-project-node-title-approvaling"))
147
149
  }, (0, _getLocale.getLocale)('Pro_MyS_Establishment'))), /*#__PURE__*/_react["default"].createElement("div", {
148
150
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-project-node-actions"))
149
- }, /*#__PURE__*/_react["default"].createElement("span", {
151
+ }, hasPrinciple && /*#__PURE__*/_react["default"].createElement("span", {
150
152
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-project-node-actions-user"))
151
153
  }, /*#__PURE__*/_react["default"].createElement(_avatar["default"].Text, {
152
154
  name: data === null || data === void 0 ? void 0 : (_data$principalUser = data.principalUser) === null || _data$principalUser === void 0 ? void 0 : _data$principalUser.name,
@@ -95,7 +95,9 @@ function ETaskNode(props) {
95
95
  _props$hasRelation = props.hasRelation,
96
96
  hasRelation = _props$hasRelation === void 0 ? true : _props$hasRelation,
97
97
  _props$isPushScreen = props.isPushScreen,
98
- isPushScreen = _props$isPushScreen === void 0 ? false : _props$isPushScreen;
98
+ isPushScreen = _props$isPushScreen === void 0 ? false : _props$isPushScreen,
99
+ _props$hasPrinciple = props.hasPrinciple,
100
+ hasPrinciple = _props$hasPrinciple === void 0 ? true : _props$hasPrinciple;
99
101
 
100
102
  var _useState = (0, _react.useState)(false),
101
103
  _useState2 = _slicedToArray(_useState, 2),
@@ -370,7 +372,7 @@ function ETaskNode(props) {
370
372
  isPercent: true
371
373
  })), /*#__PURE__*/_react["default"].createElement("span", {
372
374
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-actions"))
373
- }, /*#__PURE__*/_react["default"].createElement("span", {
375
+ }, hasPrinciple && /*#__PURE__*/_react["default"].createElement("span", {
374
376
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-actions-user"))
375
377
  }, /*#__PURE__*/_react["default"].createElement(_avatar["default"].Text, {
376
378
  name: user === null || user === void 0 ? void 0 : user.name,
@@ -84,13 +84,13 @@
84
84
  line-height: 18px;
85
85
  display: inline-flex;
86
86
  align-items: center;
87
+ justify-content: flex-end;
87
88
  box-sizing: border-box;
88
89
  width: 78px;
89
90
  height: 26px;
90
91
  padding: 4px;
91
92
  text-align: left;
92
93
  line-height: 26px;
93
- margin-left: 16px;
94
94
  }
95
95
 
96
96
  .tita-okrdt-tree__e-task-node-actions-date > span {
@@ -103,7 +103,7 @@
103
103
  color: #89919f;
104
104
  cursor: auto;
105
105
  width: 64px;
106
- margin-left: 4px;
106
+ margin-left: 16px;
107
107
  margin-right: 4px;
108
108
  }
109
109
 
@@ -171,14 +171,14 @@
171
171
  height: 20px;
172
172
  font-size: 12px;
173
173
  font-weight: 400;
174
- color: #F05E5E;
174
+ color: #f05e5e;
175
175
  background: rgba(240, 94, 94, 0.1);
176
176
  border-radius: 10px;
177
177
  margin-left: 8px;
178
178
  }
179
179
 
180
180
  .tita-okrdt-tree__e-project-node-gray {
181
- color: #BFC7D5 !important;
181
+ color: #bfc7d5 !important;
182
182
  }
183
183
 
184
184
  .tita-okrdt-tree__e-project-node-priority {
@@ -235,13 +235,13 @@
235
235
  line-height: 18px;
236
236
  display: inline-flex;
237
237
  align-items: center;
238
+ justify-content: flex-end;
238
239
  box-sizing: border-box;
239
240
  width: 78px;
240
241
  height: 26px;
241
242
  padding: 4px;
242
243
  text-align: left;
243
244
  line-height: 26px;
244
- margin-left: 16px;
245
245
  }
246
246
 
247
247
  .tita-okrdt-tree__e-project-node-actions-date > span {
@@ -254,7 +254,7 @@
254
254
  color: #89919f;
255
255
  cursor: auto;
256
256
  width: 64px;
257
- margin-left: 4px;
257
+ margin-left: 16px;
258
258
  margin-right: 4px;
259
259
  }
260
260
 
@@ -357,13 +357,13 @@
357
357
  line-height: 18px;
358
358
  display: inline-flex;
359
359
  align-items: center;
360
+ justify-content: flex-end;
360
361
  box-sizing: border-box;
361
362
  width: 78px;
362
363
  height: 26px;
363
364
  padding: 4px;
364
365
  text-align: left;
365
366
  line-height: 26px;
366
- margin-left: 16px;
367
367
  }
368
368
 
369
369
  .tita-okrdt-tree__e-task-level2-node-actions-date > span {
@@ -376,7 +376,7 @@
376
376
  color: #89919f;
377
377
  cursor: auto;
378
378
  width: 64px;
379
- margin-left: 4px;
379
+ margin-left: 16px;
380
380
  margin-right: 4px;
381
381
  }
382
382
 
@@ -398,7 +398,7 @@
398
398
  .tita-okrdt-tree__e-empty-node {
399
399
  font-size: 12px;
400
400
  font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
401
- color: #A4ACB9;
401
+ color: #a4acb9;
402
402
  line-height: 18px;
403
403
  padding-left: 12px;
404
404
  }
@@ -408,5 +408,5 @@
408
408
  }
409
409
 
410
410
  .e-node-status-icon {
411
- color: #89919F;
411
+ color: #89919f;
412
412
  }
@@ -332,7 +332,7 @@ function _default(props) {
332
332
  editable: krCanEdit,
333
333
  onEditUser: onEditUserHandler,
334
334
  nameTips: function nameTips(name) {
335
- return /*#__PURE__*/_react["default"].createElement("span", null, "\u8D1F\u8D23\u4EBA\uFF1A");
335
+ return /*#__PURE__*/_react["default"].createElement("span", null, "\u8D1F\u8D23\u4EBA\uFF1A", name);
336
336
  }
337
337
  })), showKrWeight && /*#__PURE__*/_react["default"].createElement(OkrRowColumn, {
338
338
  width: 60,
@@ -183,13 +183,6 @@ function Elist(props, ref) {
183
183
  setTotalDataNum(totalLength);
184
184
  setIsEmpty && setIsEmpty(!totalLength);
185
185
  }, [krList, oEList]);
186
- var krsTree = (0, _react.useCallback)(function (kr) {
187
- return /*#__PURE__*/_react["default"].createElement(_okrTree["default"], {
188
- key: Math.random(),
189
- data: [kr],
190
- defaultExpandedKeys: expandedKrEs
191
- });
192
- }, [expandedKrEs, krList]);
193
186
  return /*#__PURE__*/_react["default"].createElement(_context.EListContext.Provider, {
194
187
  value: {
195
188
  refreshEList: function refreshEList() {
@@ -214,11 +207,15 @@ function Elist(props, ref) {
214
207
  }, krList.map(function (kr, index) {
215
208
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_paddingLayout["default"], {
216
209
  padding: layoutPadding
217
- }, krsTree(kr)), // kr左后一个节点 && 没有 OE 时,不显示横线
210
+ }, /*#__PURE__*/_react["default"].createElement(_okrTree["default"], {
211
+ key: Math.random(),
212
+ data: [kr],
213
+ defaultExpandedKeys: expandedKrEs
214
+ })), // kr左后一个节点 && 没有 OE 时,不显示横线
218
215
  !(index + 1 == krList.length && oEList.length == 0) && hasdivider && /*#__PURE__*/_react["default"].createElement("div", {
219
216
  className: "e__divider"
220
217
  }));
221
- }), oEList.map(function (kr) {
218
+ }), !!oEList && !!oEList.length && oEList.map(function (kr) {
222
219
  return /*#__PURE__*/_react["default"].createElement(_paddingLayout["default"], {
223
220
  padding: layoutPadding
224
221
  }, /*#__PURE__*/_react["default"].createElement(_okrTree["default"], {
@@ -102,7 +102,20 @@ function RootNode(props) {
102
102
  style: {
103
103
  backgroundColor: color
104
104
  }
105
- }, rootName[0]);
105
+ }, /*#__PURE__*/_react["default"].createElement("div", {
106
+ style: {
107
+ height: '24px',
108
+ width: '12px',
109
+ overflow: 'hidden',
110
+ margin: '0px auto'
111
+ }
112
+ }, /*#__PURE__*/_react["default"].createElement("img", {
113
+ src: whiteRootImg,
114
+ style: {
115
+ maxWidth: 268
116
+ },
117
+ width: imgWidth
118
+ })));
106
119
  }
107
120
 
108
121
  if (searchType == "depart") {
@@ -6,6 +6,7 @@
6
6
  display: flex;
7
7
  align-items: center;
8
8
  position: relative;
9
+ height: 24px;
9
10
  }
10
11
 
11
12
  .okr-progress-item-wrapper .okr-progress-item-content__icon-state {
@@ -15,7 +16,7 @@
15
16
  .okr-progress-item-wrapper .okr-progress-item__percent {
16
17
  font-size: 16px;
17
18
  font-weight: 600;
18
- color: #3F4755;
19
+ color: #3f4755;
19
20
  line-height: 24px;
20
21
  margin-left: 12px;
21
22
  }
@@ -28,11 +29,11 @@
28
29
  }
29
30
 
30
31
  .okr-progress-item-wrapper .okr-progress-item__percent--advance {
31
- color: #5AD8A6;
32
+ color: #5ad8a6;
32
33
  }
33
34
 
34
35
  .okr-progress-item-wrapper .okr-progress-item__percent--delay {
35
- color: #F05E5E;
36
+ color: #f05e5e;
36
37
  }
37
38
 
38
39
  .okr-progress-item-wrapper .okr-progress-item-content--edit {
@@ -42,7 +43,7 @@
42
43
  }
43
44
 
44
45
  .okr-progress-item-wrapper .okr-progress-item-content--edit:hover {
45
- background: #F7F8FA;
46
+ background: #f7f8fa;
46
47
  }
47
48
 
48
49
  .okr-progress-item-wrapper .okr-progress-item-content__body-wrapper {
@@ -60,7 +61,7 @@
60
61
 
61
62
  .okr-progress-item-wrapper .okr-progress-item-content__body-wrapper .okr-progress-item-content__body .okr-progress-item__content {
62
63
  font-size: 14px;
63
- color: #3F4755;
64
+ color: #3f4755;
64
65
  line-height: 22px;
65
66
  white-space: pre-wrap;
66
67
  }
@@ -73,7 +74,7 @@
73
74
 
74
75
  .okr-progress-item-wrapper .okr-progress-item__content-bottom {
75
76
  font-size: 12px;
76
- color: #A4ACB9;
77
+ color: #a4acb9;
77
78
  line-height: 18px;
78
79
  margin-top: 6px;
79
80
  display: flex;
@@ -88,12 +89,12 @@
88
89
  }
89
90
 
90
91
  .okr-progress-item-wrapper .okr-progress-item__content-bottom .okr-progress-item__bottom-func-btns .okr-progress-item__bottom-btn--edit:hover {
91
- color: #2879FF;
92
+ color: #2879ff;
92
93
  cursor: pointer;
93
94
  }
94
95
 
95
96
  .okr-progress-item-wrapper .okr-progress-item__content-bottom .okr-progress-item__bottom-func-btns .okr-progress-item__bottom-btn--delete:hover {
96
- color: #F05E5E;
97
+ color: #f05e5e;
97
98
  cursor: pointer;
98
99
  }
99
100
 
@@ -106,7 +107,7 @@
106
107
  display: inline-block;
107
108
  width: 1px;
108
109
  height: 16px;
109
- background: linear-gradient(180deg, rgba(213, 219, 226, 0) 0%, #D5DBE2 49%, rgba(213, 219, 226, 0) 100%);
110
+ background: linear-gradient(180deg, rgba(213, 219, 226, 0) 0%, #d5dbe2 49%, rgba(213, 219, 226, 0) 100%);
110
111
  border-radius: 2px;
111
112
  }
112
113
 
@@ -129,7 +130,7 @@
129
130
  right: 0;
130
131
  font-size: 12px;
131
132
  font-weight: 400;
132
- color: #A4ACB9;
133
+ color: #a4acb9;
133
134
  line-height: 24px;
134
135
  padding-right: 16px;
135
136
  }
@@ -22,8 +22,8 @@ var getTimeString = function getTimeString(time, nowTime) {
22
22
  var timeYear = timeDateObj.getFullYear();
23
23
  var timeMonth = timeDateObj.getMonth() + 1;
24
24
  var timeDate = timeDateObj.getDate();
25
- var timeHours = timeDateObj.getHours();
26
- var timeMinutes = timeDateObj.getMinutes();
25
+ var timeHours = timeDateObj.getHours() < 10 ? "0".concat(timeDateObj.getHours()) : timeDateObj.getHours();
26
+ var timeMinutes = timeDateObj.getMinutes() < 10 ? "0".concat(timeDateObj.getMinutes()) : timeDateObj.getMinutes();
27
27
  var nowMilliSecond = nowTime.getTime();
28
28
  var nowYear = nowTime.getFullYear();
29
29
  var nowDate = nowTime.getDate();
@@ -56,11 +56,11 @@ var getTimeString = function getTimeString(time, nowTime) {
56
56
  if (timeYear === nowYear) {
57
57
  var _dateStr = months[timeMonth - 1] + (_getLocale.isEn ? " ".concat(timeDate, " ") : "".concat(timeDate, "\u65E5"));
58
58
 
59
- return "".concat(_dateStr, " ").concat(timeHours < 10 ? "0".concat(timeHours) : timeHours, ":").concat(timeMinutes < 10 ? "0".concat(timeMinutes) : timeMinutes);
59
+ return "".concat(_dateStr, " ", "".concat(timeHours, ":").concat(timeMinutes));
60
60
  }
61
61
 
62
62
  var dateStr = (_getLocale.isEn ? "" : "".concat(timeYear, "\u5E74")) + months[timeMonth - 1] + (_getLocale.isEn ? " ".concat(timeDate, " ") : "".concat(timeDate, "\u65E5")) + (_getLocale.isEn ? ",".concat(timeYear) : "");
63
- return "".concat(dateStr, " ").concat(timeHours < 10 ? "0".concat(timeHours) : timeHours, ":").concat(timeMinutes < 10 ? "0".concat(timeMinutes) : timeMinutes);
63
+ return "".concat(dateStr, " ", "".concat(timeHours, ":").concat(timeMinutes));
64
64
  };
65
65
 
66
66
  exports.getTimeString = getTimeString;
@@ -1,39 +1,97 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
- exports["default"] = _default;
8
+ exports["default"] = void 0;
7
9
 
8
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
9
11
 
10
12
  var _classnames = _interopRequireDefault(require("classnames"));
11
13
 
12
14
  var _simplebarReact = _interopRequireDefault(require("./simplebar-react"));
13
15
 
16
+ var _scrollMask = _interopRequireDefault(require("./scroll-mask"));
17
+
14
18
  require("./index.css");
15
19
 
16
20
  var _excluded = ["children", "style"];
17
21
 
18
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
23
 
24
+ 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); }
25
+
26
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
+
20
28
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
29
 
30
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
31
+
32
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
33
+
34
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
35
+
36
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
37
+
38
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
39
+
40
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
41
+
22
42
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
23
43
 
24
44
  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; }
25
45
 
26
46
  var preCls = "titaui-scrollbar";
27
-
28
- function _default(props) {
47
+ var ScrollBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
29
48
  var children = props.children,
30
- style = props.style,
31
- restProps = _objectWithoutProperties(props, _excluded); // @ts-ignore
49
+ _props$style = props.style,
50
+ style = _props$style === void 0 ? {
51
+ height: "100%"
52
+ } : _props$style,
53
+ restProps = _objectWithoutProperties(props, _excluded);
54
+
55
+ var _useState = (0, _react.useState)(),
56
+ _useState2 = _slicedToArray(_useState, 2),
57
+ scrollElement = _useState2[0],
58
+ setScrollElement = _useState2[1];
32
59
 
60
+ var _useState3 = (0, _react.useState)(),
61
+ _useState4 = _slicedToArray(_useState3, 2),
62
+ contentElement = _useState4[0],
63
+ setContentElement = _useState4[1];
33
64
 
34
- return /*#__PURE__*/_react["default"].createElement(_simplebarReact["default"], _extends({
65
+ var simpleBarRef = (0, _react.useRef)();
66
+ (0, _react.useImperativeHandle)(ref, function () {
67
+ return {
68
+ scrollElement: scrollElement,
69
+ contentElement: contentElement
70
+ };
71
+ });
72
+ (0, _react.useEffect)(function () {
73
+ // @ts-ignore
74
+ setScrollElement(simpleBarRef === null || simpleBarRef === void 0 ? void 0 : simpleBarRef.current.getScrollElement()); // @ts-ignore
75
+
76
+ setContentElement(simpleBarRef === null || simpleBarRef === void 0 ? void 0 : simpleBarRef.current.getContentElement());
77
+ }, []);
78
+ return /*#__PURE__*/_react["default"].createElement("div", {
79
+ style: {
80
+ height: "100%"
81
+ }
82
+ }, /*#__PURE__*/_react["default"].createElement(_simplebarReact["default"], _extends({
83
+ ref: simpleBarRef,
35
84
  className: (0, _classnames["default"])(preCls),
36
85
  timeout: 800,
37
86
  style: style
38
- }, restProps), children);
39
- }
87
+ }, restProps), children));
88
+ });
89
+ ScrollBar.defaultProps = {
90
+ style: {
91
+ height: "100%"
92
+ }
93
+ }; // @ts-ignore
94
+
95
+ ScrollBar.Mask = _scrollMask["default"];
96
+ var _default = ScrollBar;
97
+ exports["default"] = _default;
@@ -0,0 +1,29 @@
1
+ .titaui-scroll-mask {
2
+ width: 100%;
3
+ height: calc(100% - 16px);
4
+ position: relative;
5
+ }
6
+
7
+ .titaui-scroll-mask__top {
8
+ position: absolute;
9
+ top: 0;
10
+ width: 100%;
11
+ pointer-events: none;
12
+ background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
13
+ }
14
+
15
+ .titaui-scroll-mask__top--hide {
16
+ display: none;
17
+ }
18
+
19
+ .titaui-scroll-mask__bottom {
20
+ position: absolute;
21
+ bottom: 0;
22
+ width: 100%;
23
+ pointer-events: none;
24
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
25
+ }
26
+
27
+ .titaui-scroll-mask__bottom--hide {
28
+ display: none;
29
+ }
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
14
+ var _scrollbar = _interopRequireDefault(require("../../scrollbar"));
15
+
16
+ require("./index.css");
17
+
18
+ var _excluded = ["children", "maskHeight", "style"];
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
+
22
+ 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); }
23
+
24
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
+
26
+ 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; }
27
+
28
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
29
+
30
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
31
+
32
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
33
+
34
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
35
+
36
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
37
+
38
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
39
+
40
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
41
+
42
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
43
+
44
+ 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; }
45
+
46
+ var preCls = "titaui-scroll-mask";
47
+
48
+ var ScrollBarMask = function ScrollBarMask(_ref) {
49
+ var _scrollRef$current, _scrollRef$current2;
50
+
51
+ var children = _ref.children,
52
+ maskHeight = _ref.maskHeight,
53
+ _ref$style = _ref.style,
54
+ style = _ref$style === void 0 ? {
55
+ height: "100%"
56
+ } : _ref$style,
57
+ restProps = _objectWithoutProperties(_ref, _excluded);
58
+
59
+ var _useState = (0, _react.useState)(true),
60
+ _useState2 = _slicedToArray(_useState, 2),
61
+ isScrollToTop = _useState2[0],
62
+ setIsScrollToTop = _useState2[1];
63
+
64
+ var _useState3 = (0, _react.useState)(false),
65
+ _useState4 = _slicedToArray(_useState3, 2),
66
+ isScrollToBottom = _useState4[0],
67
+ setIsScrollToBottom = _useState4[1];
68
+
69
+ var _useState5 = (0, _react.useState)(false),
70
+ _useState6 = _slicedToArray(_useState5, 2),
71
+ isOverFlow = _useState6[0],
72
+ setIsOverFlow = _useState6[1];
73
+
74
+ var scrollRef = (0, _react.useRef)(); // @ts-ignore
75
+
76
+ var scrollElement = (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.scrollElement; // @ts-ignore
77
+
78
+ var contentElement = (_scrollRef$current2 = scrollRef.current) === null || _scrollRef$current2 === void 0 ? void 0 : _scrollRef$current2.contentElement;
79
+
80
+ var handleScroll = function handleScroll() {
81
+ // 判断是否滚动到顶部
82
+ if (!(scrollElement !== null && scrollElement !== void 0 && scrollElement.scrollTop)) {
83
+ setIsScrollToTop(true);
84
+ } else {
85
+ setIsScrollToTop(false);
86
+ } // 判断是否滚动到底部
87
+
88
+
89
+ if (scrollElement.scrollTop + scrollElement.offsetHeight === scrollElement.scrollHeight) {
90
+ setIsScrollToBottom(true);
91
+ } else {
92
+ setIsScrollToBottom(false);
93
+ }
94
+ };
95
+
96
+ (0, _react.useEffect)(function () {
97
+ // 判断是否出现滚动条
98
+ if ((scrollElement === null || scrollElement === void 0 ? void 0 : scrollElement.offsetHeight) < (scrollElement === null || scrollElement === void 0 ? void 0 : scrollElement.scrollHeight)) {
99
+ setIsOverFlow(true);
100
+ }
101
+ }, [scrollElement === null || scrollElement === void 0 ? void 0 : scrollElement.scrollHeight]);
102
+ (0, _react.useEffect)(function () {
103
+ var mutation;
104
+
105
+ if (contentElement) {
106
+ var config = {
107
+ characterData: true,
108
+ // 监听元素内的数据变动
109
+ childList: true,
110
+ // 监听子元素数量变动(子元素的属性变化不会触发事件)(只针对一级子元素,孙子元素的数量变化不会触发事件)
111
+ subtree: true // 将observer事件下发到目标元素的所有子元素,相当于对子元素也进行了observer
112
+
113
+ };
114
+
115
+ var recalculate = function recalculate() {
116
+ if (contentElement.scrollHeight > scrollElement.offsetHeight) {
117
+ setIsOverFlow(true);
118
+ } else {
119
+ setIsOverFlow(false);
120
+ }
121
+ };
122
+
123
+ mutation = new MutationObserver(recalculate);
124
+ mutation.observe(contentElement, config);
125
+ }
126
+ }, [contentElement]);
127
+ return /*#__PURE__*/_react["default"].createElement("div", {
128
+ className: preCls,
129
+ onScroll: handleScroll
130
+ }, /*#__PURE__*/_react["default"].createElement(_scrollbar["default"], _extends({
131
+ ref: scrollRef,
132
+ style: style
133
+ }, restProps), children), isOverFlow && /*#__PURE__*/_react["default"].createElement("div", {
134
+ className: (0, _classnames["default"])(_defineProperty({}, "".concat(preCls, "__top--hide"), isScrollToTop), _defineProperty({}, "".concat(preCls, "__top"), !isScrollToTop)),
135
+ style: {
136
+ height: "".concat(maskHeight, "px")
137
+ }
138
+ }), isOverFlow && /*#__PURE__*/_react["default"].createElement("div", {
139
+ className: (0, _classnames["default"])(_defineProperty({}, "".concat(preCls, "__bottom--hide"), isScrollToBottom), _defineProperty({}, "".concat(preCls, "__bottom"), !isScrollToBottom)),
140
+ style: {
141
+ height: "".concat(maskHeight, "px")
142
+ }
143
+ }));
144
+ };
145
+
146
+ ScrollBarMask.defaultProps = {
147
+ style: {
148
+ height: "100%"
149
+ }
150
+ };
151
+ var _default = ScrollBarMask;
152
+ exports["default"] = _default;
@@ -13,7 +13,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
13
13
 
14
14
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
15
15
 
16
- var domain = "https://tracker.tita.com";
16
+ var domain = "https://skynet-apis.tita.cloud"; // const domain = 'http://127.0.0.1:8080'
17
+
17
18
  exports.domain = domain;
18
19
 
19
20
  var transMetasToTableData = function transMetasToTableData() {
@@ -40,7 +41,7 @@ var fetchAssetsVersion = function fetchAssetsVersion() {
40
41
  fields: [],
41
42
  order: {
42
43
  name: "create_time_unix",
43
- operator: "desc"
44
+ orderBy: "desc"
44
45
  },
45
46
  limit: 1
46
47
  },
@@ -63,13 +64,13 @@ var fetchAssetsUri = function fetchAssetsUri(version) {
63
64
  }],
64
65
  order: {
65
66
  name: "create_time_unix",
66
- operator: "desc"
67
+ orderBy: "desc"
67
68
  },
68
69
  limit: 20
69
70
  },
70
71
  objectName: "superset_assets"
71
72
  }).then(function (res) {
72
- localStorage.setItem("".concat(storageKey, "version"), JSON.stringify(transMetasToTableData(res.data.list)));
73
+ sessionStorage.setItem("".concat(storageKey, "version"), JSON.stringify(transMetasToTableData(res.data.list)));
73
74
  return transMetasToTableData(res.data.list);
74
75
  });
75
76
  };
@@ -79,13 +80,15 @@ exports.fetchAssetsUri = fetchAssetsUri;
79
80
  var hasCachedAssets = function hasCachedAssets(resVersion) {
80
81
  var _JSON$parse$;
81
82
 
82
- var cacheAssets = localStorage.getItem("".concat(storageKey, "version"));
83
+ var cacheAssets = sessionStorage.getItem("".concat(storageKey, "version"));
83
84
  var cacheVersion = cacheAssets && ((_JSON$parse$ = JSON.parse(cacheAssets)[0]) === null || _JSON$parse$ === void 0 ? void 0 : _JSON$parse$.version);
84
85
  return cacheAssets !== null && cacheVersion === resVersion;
85
86
  };
86
87
 
87
88
  var getAssetsWithCache = /*#__PURE__*/function () {
88
89
  var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
90
+ var _res$;
91
+
89
92
  var res, cacheAssets, resVersion, assetsUri;
90
93
  return regeneratorRuntime.wrap(function _callee$(_context) {
91
94
  while (1) {
@@ -96,25 +99,33 @@ var getAssetsWithCache = /*#__PURE__*/function () {
96
99
 
97
100
  case 2:
98
101
  res = _context.sent;
99
- cacheAssets = localStorage.getItem("".concat(storageKey, "version"));
100
- resVersion = res[0].version;
102
+ cacheAssets = sessionStorage.getItem("".concat(storageKey, "version"));
103
+ resVersion = res === null || res === void 0 ? void 0 : (_res$ = res[0]) === null || _res$ === void 0 ? void 0 : _res$.version;
101
104
 
102
- if (!hasCachedAssets(resVersion)) {
105
+ if (resVersion) {
103
106
  _context.next = 7;
104
107
  break;
105
108
  }
106
109
 
107
- return _context.abrupt("return", JSON.parse(cacheAssets));
110
+ return _context.abrupt("return", []);
108
111
 
109
112
  case 7:
110
- _context.next = 9;
111
- return fetchAssetsUri(resVersion);
113
+ if (!hasCachedAssets(resVersion)) {
114
+ _context.next = 9;
115
+ break;
116
+ }
117
+
118
+ return _context.abrupt("return", JSON.parse(cacheAssets));
112
119
 
113
120
  case 9:
121
+ _context.next = 11;
122
+ return fetchAssetsUri(resVersion);
123
+
124
+ case 11:
114
125
  assetsUri = _context.sent;
115
126
  return _context.abrupt("return", assetsUri);
116
127
 
117
- case 11:
128
+ case 13:
118
129
  case "end":
119
130
  return _context.stop();
120
131
  }
@@ -25,15 +25,15 @@ var tenantId = window.BSGlobal && window.BSGlobal.tenantInfo.Id || 0;
25
25
  var userId = window.BSGlobal && window.BSGlobal.loginUserInfo.Id || 0;
26
26
 
27
27
  function getToken() {
28
- return localStorage.getItem("DEMOFREE_TOKEN") || "";
28
+ return sessionStorage.getItem("DEMOFREE_TOKEN") || "";
29
29
  }
30
30
 
31
31
  function clearToken() {
32
- localStorage.removeItem("DEMOFREE_TOKEN");
32
+ sessionStorage.removeItem("DEMOFREE_TOKEN");
33
33
  }
34
34
 
35
35
  function setToken(token) {
36
- localStorage.setItem("DEMOFREE_TOKEN", token);
36
+ sessionStorage.setItem("DEMOFREE_TOKEN", token);
37
37
  }
38
38
 
39
39
  var getJwtToken = function getJwtToken() {
@@ -37,7 +37,7 @@
37
37
  position: absolute;
38
38
  width: 100%;
39
39
  bottom: 0;
40
- content: "";
40
+ content: '';
41
41
  border-bottom: 2px solid #2879ff;
42
42
  z-index: 1;
43
43
  }
@@ -51,7 +51,7 @@
51
51
  position: absolute;
52
52
  width: 100%;
53
53
  top: 0;
54
- content: "";
54
+ content: '';
55
55
  border-top: 2px solid #2879ff;
56
56
  z-index: 1;
57
57
  }
@@ -61,6 +61,7 @@
61
61
  align-items: center;
62
62
  line-height: unset;
63
63
  overflow: hidden;
64
+ border-radius: 8px;
64
65
  }
65
66
 
66
67
  .titaui-tree .rc-tree .rc-tree-treenode .rc-tree-node-content-wrapper {
@@ -178,7 +178,12 @@ var NewOkrList = function NewOkrList(props) {
178
178
 
179
179
  (0, _react.useEffect)(function () {
180
180
  setPageNum(1);
181
- }, [relation, toUserId, departmentId, query]); // 记录访问者数据
181
+ }, [relation, toUserId, departmentId, query]);
182
+ (0, _react.useEffect)(function () {
183
+ handleOnSearch({
184
+ keyWords: ""
185
+ });
186
+ }, [relation, toUserId, departmentId]); // 记录访问者数据
182
187
 
183
188
  var recordVisitUser = function recordVisitUser() {
184
189
  if (toUserId) {
@@ -209,18 +214,9 @@ var NewOkrList = function NewOkrList(props) {
209
214
  params.keyWords = "";
210
215
  }
211
216
 
212
- var request;
213
-
214
- if (!relation) {
215
- request = (0, _requestApi.okrSearch)(params);
216
- } else {
217
- // request = okrList(params);
218
- request = (0, _requestApi.okrSearch)(params);
219
- }
220
-
221
217
  setLoading(true);
222
218
  recordVisitUser();
223
- request.then(function (res) {
219
+ (0, _requestApi.okrSearch)(params).then(function (res) {
224
220
  setOkrs(res.works || []);
225
221
  setTotal(res.total);
226
222
  setLoading(false);
package/lib/utils/auth.js CHANGED
@@ -92,8 +92,10 @@ var OAuth = /*#__PURE__*/function (_BaseAuth) {
92
92
  }, {
93
93
  key: "isPrincipalUser",
94
94
  value: function isPrincipalUser() {
95
+ var _this$principalUser;
96
+
95
97
  // console.log('o isp', this.userId, this.principalUser.userId)
96
- return this.userId == this.principalUser.userId;
98
+ return this.userId == ((_this$principalUser = this.principalUser) === null || _this$principalUser === void 0 ? void 0 : _this$principalUser.userId);
97
99
  } // 有操作OKR的權限
98
100
 
99
101
  }, {
@@ -139,8 +141,10 @@ var KRAuth = /*#__PURE__*/function (_BaseAuth2) {
139
141
  }, {
140
142
  key: "isPrincipalUser",
141
143
  value: function isPrincipalUser() {
144
+ var _this$user;
145
+
142
146
  // console.log('kr isp', this.userId, this.user.userId)
143
- return this.userId == this.user.userId;
147
+ return this.userId == ((_this$user = this.user) === null || _this$user === void 0 ? void 0 : _this$user.userId);
144
148
  } // 有操作KR的權限
145
149
 
146
150
  }, {
@@ -178,15 +182,19 @@ var EAuth = /*#__PURE__*/function (_BaseAuth3) {
178
182
  _createClass(EAuth, [{
179
183
  key: "isCreater",
180
184
  value: function isCreater() {
185
+ var _this$user2;
186
+
181
187
  // console.log('e iscreater', this.userId, this.user.userId)
182
- return this.userId == this.user.userId;
188
+ return this.userId == ((_this$user2 = this.user) === null || _this$user2 === void 0 ? void 0 : _this$user2.userId);
183
189
  } // 負責人
184
190
 
185
191
  }, {
186
192
  key: "isPrincipalUser",
187
193
  value: function isPrincipalUser() {
194
+ var _this$principalUser2;
195
+
188
196
  // console.log('e isp', this.userId, this.principalUser.userId)
189
- return this.userId == this.principalUser.userId;
197
+ return this.userId == ((_this$principalUser2 = this.principalUser) === null || _this$principalUser2 === void 0 ? void 0 : _this$principalUser2.userId);
190
198
  } // 有操作KR的權限
191
199
 
192
200
  }, {
@@ -268,7 +276,9 @@ var ChildAuth = /*#__PURE__*/function (_BaseAuth5) {
268
276
  _createClass(ChildAuth, [{
269
277
  key: "isPrincipalUser",
270
278
  value: function isPrincipalUser() {
271
- return this.userId == this.principalUser.userId;
279
+ var _this$principalUser3;
280
+
281
+ return this.userId == ((_this$principalUser3 = this.principalUser) === null || _this$principalUser3 === void 0 ? void 0 : _this$principalUser3.userId);
272
282
  } // 超管、助理、目标管理员以及目标负责人可以修改此目标下对齐子目标的权重;
273
283
 
274
284
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.10.63.beta-10",
3
+ "version": "1.10.63.beta-15",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",