@titaui/pc 1.10.6-3.beta-5 → 1.10.6-3.beta-8

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.
@@ -44,16 +44,15 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
44
44
  var hasProject = (0, _bsGlobal.hasWebHead)("project");
45
45
 
46
46
  var EKrNode = function EKrNode(props) {
47
+ var _okrInfo$authority;
48
+
47
49
  var index = props.index,
48
50
  title = props.title,
49
51
  data = props.data,
50
52
  isOTask = props.isOTask,
51
- _props$hasAddProject = props.hasAddProject,
52
- hasAddProject = _props$hasAddProject === void 0 ? true : _props$hasAddProject,
53
53
  _props$hasRelation = props.hasRelation,
54
54
  hasRelation = _props$hasRelation === void 0 ? true : _props$hasRelation;
55
55
  var btnRef = (0, _react.useRef)();
56
- hasProject = hasProject && hasAddProject;
57
56
 
58
57
  var _useContext = (0, _react.useContext)(_context2.CommonContext),
59
58
  okrInfo = _useContext.okrInfo;
@@ -61,7 +60,7 @@ var EKrNode = function EKrNode(props) {
61
60
  var _useContext2 = (0, _react.useContext)(_context2.EListContext),
62
61
  refreshEList = _useContext2.refreshEList;
63
62
 
64
- var isParticipant = okrInfo.authority.roleRelation && okrInfo.authority.roleRelation.roleType === 2;
63
+ var isParticipant = ((_okrInfo$authority = okrInfo.authority) === null || _okrInfo$authority === void 0 ? void 0 : _okrInfo$authority.roleRelation) && okrInfo.authority.roleRelation.roleType === 2;
65
64
  var hasRelativeAuth;
66
65
 
67
66
  if (isOTask) {
@@ -62,12 +62,16 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
62
62
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
63
63
 
64
64
  function _default(props) {
65
- var _data$principalUser, _data$principalUser2;
65
+ var _okrInfo$authority, _data$principalUser, _data$principalUser2;
66
66
 
67
67
  var index = props.index,
68
68
  title = props.title,
69
69
  data = props.data,
70
- createUserId = props.createUserId;
70
+ createUserId = props.createUserId,
71
+ _props$hasProgress = props.hasProgress,
72
+ hasProgress = _props$hasProgress === void 0 ? true : _props$hasProgress,
73
+ _props$hasRelation = props.hasRelation,
74
+ hasRelation = _props$hasRelation === void 0 ? true : _props$hasRelation;
71
75
 
72
76
  var _useState = (0, _react.useState)(false),
73
77
  _useState2 = _slicedToArray(_useState, 2),
@@ -84,7 +88,7 @@ function _default(props) {
84
88
  var _useContext2 = (0, _react.useContext)(_context.EListContext),
85
89
  refreshEList = _useContext2.refreshEList;
86
90
 
87
- var isParticipant = okrInfo.authority.roleRelation && okrInfo.authority.roleRelation.roleType === 2;
91
+ var isParticipant = ((_okrInfo$authority = okrInfo.authority) === null || _okrInfo$authority === void 0 ? void 0 : _okrInfo$authority.roleRelation) && okrInfo.authority.roleRelation.roleType === 2;
88
92
  var hasRelativeAuth = new _auth.KRAuth({
89
93
  user: data.user,
90
94
  createUserId: createUserId
@@ -154,7 +158,7 @@ function _default(props) {
154
158
  }, /*#__PURE__*/_react["default"].createElement(_statusTime["default"], {
155
159
  deadLine: data.deadLine,
156
160
  isComplete: data.status === 2
157
- })), /*#__PURE__*/_react["default"].createElement("span", {
161
+ })), hasProgress && /*#__PURE__*/_react["default"].createElement("span", {
158
162
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-project-node-actions-progress ").concat(isGray && "".concat(_precls["default"], "__e-project-node-gray")))
159
163
  }, /*#__PURE__*/_react["default"].createElement(_progress["default"].Circle, {
160
164
  size: 22,
@@ -165,7 +169,7 @@ function _default(props) {
165
169
  linearStartColor: (0, _getProcessColor["default"])(data.riskLevel, "linearStartColor", data.status),
166
170
  linearEndColor: (0, _getProcessColor["default"])(data.riskLevel, "linearEndColor", data.status),
167
171
  backgroundColor: (0, _getProcessColor["default"])(data.riskLevel, "backgroundColor", data.status)
168
- })), okrInfo.status === 1 && (hasRelativeAuth || isParticipant) ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
172
+ })), okrInfo.status === 1 && hasRelation && (hasRelativeAuth || isParticipant) ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
169
173
  overlay: (0, _getLocale.getLocale)("OKR_MyO_Text_Cancel"),
170
174
  placement: "top"
171
175
  }, /*#__PURE__*/_react["default"].createElement("span", {
@@ -82,6 +82,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
82
82
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
83
83
 
84
84
  function _default(props) {
85
+ var _okrInfo$authority;
86
+
85
87
  var index = props.index,
86
88
  title = props.title,
87
89
  data = props.data,
@@ -147,7 +149,7 @@ function _default(props) {
147
149
  principalUser: okrInfo.principalUser,
148
150
  createUserId: okrInfo.createUserId
149
151
  }).hasAuth()) && data.status !== 5;
150
- var isParticipant = okrInfo.authority.roleRelation && okrInfo.authority.roleRelation.roleType === 2;
152
+ var isParticipant = ((_okrInfo$authority = okrInfo.authority) === null || _okrInfo$authority === void 0 ? void 0 : _okrInfo$authority.roleRelation) && okrInfo.authority.roleRelation.roleType === 2;
151
153
  var hasRelativeAuth = new _auth.KRAuth({
152
154
  user: data.user,
153
155
  createUserId: createUserId
@@ -83,6 +83,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
83
83
 
84
84
  // status=3 已过期 status=2 已完成
85
85
  function ETaskNode(props) {
86
+ var _okrInfo$authority;
87
+
86
88
  var index = props.index,
87
89
  title = props.title,
88
90
  data = props.data,
@@ -91,7 +93,9 @@ function ETaskNode(props) {
91
93
  _props$hasProgress = props.hasProgress,
92
94
  hasProgress = _props$hasProgress === void 0 ? true : _props$hasProgress,
93
95
  _props$hasRelation = props.hasRelation,
94
- hasRelation = _props$hasRelation === void 0 ? true : _props$hasRelation;
96
+ hasRelation = _props$hasRelation === void 0 ? true : _props$hasRelation,
97
+ _props$isPushScreen = props.isPushScreen,
98
+ isPushScreen = _props$isPushScreen === void 0 ? false : _props$isPushScreen;
95
99
 
96
100
  var _useState = (0, _react.useState)(false),
97
101
  _useState2 = _slicedToArray(_useState, 2),
@@ -154,7 +158,7 @@ function ETaskNode(props) {
154
158
  principalUser: okrInfo.principalUser,
155
159
  createUserId: okrInfo.createUserId
156
160
  }).hasAuth()) && data.status !== 5;
157
- var isParticipant = okrInfo.authority.roleRelation && okrInfo.authority.roleRelation.roleType === 2;
161
+ var isParticipant = ((_okrInfo$authority = okrInfo.authority) === null || _okrInfo$authority === void 0 ? void 0 : _okrInfo$authority.roleRelation) && okrInfo.authority.roleRelation.roleType === 2;
158
162
  var hasRelativeAuth = new _auth.KRAuth({
159
163
  user: krUser,
160
164
  createUserId: createUserId
@@ -328,7 +332,18 @@ function ETaskNode(props) {
328
332
  _drawerManager["default"].close();
329
333
  }
330
334
 
331
- window.open("//".concat(window.location.host).concat(window.location.pathname, "#more/taskinfo?id=").concat(data.taskId));
335
+ if (isPushScreen) {
336
+ var _window$Talent, _window$Talent2;
337
+
338
+ (_window$Talent = window.Talent) === null || _window$Talent === void 0 ? void 0 : _window$Talent.app.vent.off("global-pull-screen:closed:".concat(data.taskId));
339
+ (_window$Talent2 = window.Talent) === null || _window$Talent2 === void 0 ? void 0 : _window$Talent2.app.vent.on("global-pull-screen:closed:".concat(data.taskId), function () {
340
+ refreshEList && refreshEList();
341
+ }); // 任务:打开推屏
342
+
343
+ window.Talent.app.vent.trigger('global-pull-screen', data.taskId, 'task');
344
+ } else {
345
+ window.open("//".concat(window.location.host).concat(window.location.pathname, "#more/taskinfo?id=").concat(data.taskId));
346
+ }
332
347
  };
333
348
 
334
349
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = _default;
8
+ exports["default"] = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
@@ -51,7 +51,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
51
51
 
52
52
  var preCls = "okr-detail-e";
53
53
 
54
- function _default(props) {
54
+ function Elist(props, ref) {
55
55
  var okrId = props.okrId,
56
56
  _props$hasSearch = props.hasSearch,
57
57
  hasSearch = _props$hasSearch === void 0 ? true : _props$hasSearch,
@@ -66,15 +66,14 @@ function _default(props) {
66
66
  _props$hasdivider = props.hasdivider,
67
67
  hasdivider = _props$hasdivider === void 0 ? false : _props$hasdivider,
68
68
  className = props.className,
69
- changeData = props.changeData,
70
- _props$includeWork = props.includeWork,
71
- includeWork = _props$includeWork === void 0 ? true : _props$includeWork,
72
69
  _props$IncludeNoTaskK = props.IncludeNoTaskKr,
73
70
  IncludeNoTaskKr = _props$IncludeNoTaskK === void 0 ? true : _props$IncludeNoTaskK,
74
71
  _props$hasLoading = props.hasLoading,
75
72
  hasLoading = _props$hasLoading === void 0 ? true : _props$hasLoading,
76
73
  _props$IsDateFilter = props.IsDateFilter,
77
- IsDateFilter = _props$IsDateFilter === void 0 ? false : _props$IsDateFilter;
74
+ IsDateFilter = _props$IsDateFilter === void 0 ? false : _props$IsDateFilter,
75
+ emptyPage = props.emptyPage,
76
+ setIsEmpty = props.setIsEmpty;
78
77
  var loginUser = (0, _bsGlobal.getUserInfo)().Id;
79
78
  var hasCondition = hasSearch && localStorage.getItem("hasRememberCondition".concat(loginUser));
80
79
 
@@ -148,35 +147,47 @@ function _default(props) {
148
147
  startDate: startDate,
149
148
  endDate: endDate,
150
149
  toLevel: toLevel,
151
- includeWork: includeWork,
152
150
  IncludeNoTaskKr: IncludeNoTaskKr,
153
151
  IsDateFilter: IsDateFilter
154
152
  })
155
153
  }).then(function (krs) {
156
- debugger;
157
154
  var formatKrs = formatEList(krs, okrId, (0, _util.getIfInitCondition)(selectName, checkedStatus, selectUsers, searchKey));
158
- var expandedKrEs = (formatKrs.krsEList || []).map(function (it) {
155
+ var newexpandedKrEs = (formatKrs.krsEList || []).map(function (it) {
159
156
  return it.key;
160
157
  });
161
- var expandedOEs = (formatKrs.oEList[0] || []).map(function (it) {
158
+ var newexpandedOEs = (formatKrs.oEList[0] || []).map(function (it) {
162
159
  return it.key;
163
160
  });
164
- setExpandedKrEs(expandedKrEs);
165
- setExpandedOEs(expandedOEs);
161
+ setExpandedKrEs(newexpandedKrEs);
162
+ setExpandedOEs(newexpandedOEs);
166
163
  setKrList(formatKrs.krsEList);
167
164
  setOEList(formatKrs.oEList);
168
165
  setLoading(false);
169
166
  });
170
167
  };
171
168
 
169
+ (0, _react.useImperativeHandle)(ref, function () {
170
+ return {
171
+ getKrEsData: getKrEsData
172
+ };
173
+ });
172
174
  (0, _react.useEffect)(function () {
173
175
  // 可以接收一个格式化方法
174
176
  getKrEsData(formatTree);
175
- }, [noteOrder, searchKey, selectName, checkedStatus, selectUsers]);
177
+ }, [noteOrder, searchKey, selectName, checkedStatus, selectUsers, startDate, endDate, okrId]);
176
178
  (0, _react.useEffect)(function () {
177
179
  var oElistLength = oEList[0] && oEList[0].length || 0;
178
- setTotalDataNum(krList.length + oElistLength);
180
+ var totalLength = krList.length + oElistLength;
181
+ setTotalDataNum(totalLength);
182
+ setIsEmpty && setIsEmpty(!totalLength);
179
183
  }, [krList, oEList]);
184
+ var krsTree = (0, _react.useCallback)(function (kr) {
185
+ return /*#__PURE__*/_react["default"].createElement(_okrTree["default"], {
186
+ key: Math.random(),
187
+ data: [kr],
188
+ defaultExpandedKeys: expandedKrEs
189
+ });
190
+ }, [expandedKrEs, krList]);
180
191
  return /*#__PURE__*/_react["default"].createElement(_context.EListContext.Provider, {
181
192
  value: {
182
193
  refreshEList: function refreshEList() {
@@ -201,10 +212,7 @@ function _default(props) {
201
212
  }, krList.map(function (kr, index) {
202
213
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_paddingLayout["default"], {
203
214
  padding: "0 32px 0 18px"
204
- }, /*#__PURE__*/_react["default"].createElement(_okrTree["default"], {
205
- data: [kr],
206
- defaultExpandedKeys: expandedKrEs
207
- })), // kr左后一个节点 && 没有 OE 时,不显示横线
215
+ }, krsTree(kr)), // kr左后一个节点 && 没有 OE 时,不显示横线
208
216
  !(index + 1 == krList.length && oEList.length == 0) && hasdivider && /*#__PURE__*/_react["default"].createElement("div", {
209
217
  className: "e__divider"
210
218
  }));
@@ -217,7 +225,7 @@ function _default(props) {
217
225
  }));
218
226
  })), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
219
227
  condition: totalDataNum === 0
220
- }, /*#__PURE__*/_react["default"].createElement("div", {
228
+ }, emptyPage ? emptyPage() : /*#__PURE__*/_react["default"].createElement("div", {
221
229
  className: "".concat(preCls, "__empty")
222
230
  }, /*#__PURE__*/_react["default"].createElement("img", {
223
231
  className: "".concat(preCls, "__empty-img"),
@@ -227,4 +235,9 @@ function _default(props) {
227
235
  }, "\u6CA1\u6709\u641C\u7D22\u5230\u7B26\u5408\u6761\u4EF6\u7684E-\u6267\u884C")))) : /*#__PURE__*/_react["default"].createElement(_loading["default"], {
228
236
  type: "panel"
229
237
  })));
230
- }
238
+ } // @ts-ignore
239
+
240
+
241
+ Elist = /*#__PURE__*/(0, _react.forwardRef)(Elist);
242
+ var _default = Elist;
243
+ exports["default"] = _default;
@@ -167,7 +167,6 @@ var formatCondition = function formatCondition(_ref) {
167
167
  startDate = _ref.startDate,
168
168
  endDate = _ref.endDate,
169
169
  toLevel = _ref.toLevel,
170
- includeWork = _ref.includeWork,
171
170
  IncludeNoTaskKr = _ref.IncludeNoTaskKr,
172
171
  IsDateFilter = _ref.IsDateFilter;
173
172
  var resultStatus = [];
@@ -201,7 +200,6 @@ var formatCondition = function formatCondition(_ref) {
201
200
  FilterKey: keyWord,
202
201
  startDate: startDate || '',
203
202
  endDate: endDate || '',
204
- includeWork: includeWork,
205
203
  IncludeNoTaskKr: IncludeNoTaskKr,
206
204
  IsDateFilter: IsDateFilter,
207
205
  status: resultStatus.join(","),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.10.63.beta-5",
3
+ "version": "1.10.63.beta-8",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",