@titaui/pc 1.9.133 → 1.9.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.js CHANGED
@@ -36,7 +36,7 @@ module.exports = {
36
36
  "no-restricted-globals": 2,
37
37
  "guard-for-in": 2,
38
38
  "no-restricted-syntax": 2,
39
- "prefer-destructuring": 2,
39
+ "prefer-destructuring": 1,
40
40
  "no-param-reassign": 2,
41
41
  "import/extensions": 0,
42
42
  "import/no-unresolved": 1,
@@ -176,7 +176,7 @@ var BookDemoPCContent = function BookDemoPCContent(_ref) {
176
176
  source: source > 0 ? source : Source
177
177
  }).then(function (res) {
178
178
  if (res.data.Code) {
179
- (0, _request.sendBookDemoJson)((0, _utils.bookDemoTransformDataToJson)(result, source > 0 ? source : Source, _constant.DemoTypeTextMap[type]));
179
+ (0, _request.sendBookDemoJson)((0, _utils.bookDemoTransformDataToJson)(result, source > 0 ? source : Source, _constant.DemoTypeTextMap[type], content));
180
180
 
181
181
  _toast["default"].Success("提交成功");
182
182
 
@@ -810,7 +810,8 @@ var defaultBookDemoJsonValue = {
810
810
  interestLearningTutoring: 0,
811
811
  hasUseOKRManage: "",
812
812
  hasCompanyDonePerAppraisals: "",
813
- isCompanyHasPerSystem: ""
813
+ isCompanyHasPerSystem: "",
814
+ content: ""
814
815
  };
815
816
  exports.defaultBookDemoJsonValue = defaultBookDemoJsonValue;
816
817
  var _default = bookTypeInfo;
@@ -33,12 +33,20 @@ var getSource = function getSource() {
33
33
 
34
34
  exports.getSource = getSource;
35
35
 
36
- var bookDemoTransformDataToJson = function bookDemoTransformDataToJson(data, source, appliedProduct) {
36
+ var bookDemoTransformDataToJson = function bookDemoTransformDataToJson(data, source, appliedProduct, content) {
37
37
  var result = _objectSpread({}, _constant.defaultBookDemoJsonValue);
38
38
 
39
39
  data.forEach(function (item) {
40
40
  if (typeof item.value === "string") {
41
- result[item.id] = item.value;
41
+ if (item.id === "employeeRange") {
42
+ if (/-/.test(item.value)) {
43
+ result.employeeCount = item.value.split("-")[1];
44
+ } else {
45
+ result.employeeCount = item.value;
46
+ }
47
+ } else {
48
+ result[item.id] = item.value;
49
+ }
42
50
  } else if (item.type === "checkbox" && item.multiSelect) {
43
51
  Object.keys(item.value).forEach(function (key) {
44
52
  result[key] = item.value[key].isSelected ? 1 : 0;
@@ -57,6 +65,7 @@ var bookDemoTransformDataToJson = function bookDemoTransformDataToJson(data, sou
57
65
  });
58
66
  result.source = source;
59
67
  result.appliedProduct = appliedProduct;
68
+ result.content = content;
60
69
  delete result.verificationCode;
61
70
  return result;
62
71
  };
@@ -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
 
@@ -80,12 +80,10 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
80
80
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
81
81
 
82
82
  // status=3 已过期 status=2 已完成
83
- function _default(props) {
83
+ function ETaskNode(props) {
84
84
  var index = props.index,
85
85
  title = props.title,
86
86
  data = props.data,
87
- level = props.level,
88
- isLeaf = props.isLeaf,
89
87
  createUserId = props.createUserId,
90
88
  krUser = props.krUser;
91
89
 
@@ -95,9 +93,8 @@ function _default(props) {
95
93
  setUnConnectVisible = _useState2[1];
96
94
 
97
95
  var _useState3 = (0, _react.useState)(data.progress),
98
- _useState4 = _slicedToArray(_useState3, 2),
99
- progress = _useState4[0],
100
- setProgress = _useState4[1];
96
+ _useState4 = _slicedToArray(_useState3, 1),
97
+ progress = _useState4[0];
101
98
 
102
99
  var _useState5 = (0, _react.useState)(data.principalUser || {}),
103
100
  _useState6 = _slicedToArray(_useState5, 2),
@@ -126,8 +123,8 @@ function _default(props) {
126
123
  riskLevel: data.riskLevel
127
124
  }),
128
125
  _useState14 = _slicedToArray(_useState13, 2),
129
- dateInfo = _useState14[0],
130
- setDateInfo = _useState14[1];
126
+ dataInfo = _useState14[0],
127
+ setDataInfo = _useState14[1];
131
128
 
132
129
  var _useContext = (0, _react.useContext)(_context2.CommonContext),
133
130
  okrInfo = _useContext.okrInfo;
@@ -190,7 +187,7 @@ function _default(props) {
190
187
  canClose: false
191
188
  });
192
189
 
193
- setDateInfo(_objectSpread(_objectSpread({}, dateInfo), {}, {
190
+ setDataInfo(_objectSpread(_objectSpread({}, dataInfo), {}, {
194
191
  status: _constant.EStatusClass2StatusType[statusType]
195
192
  }));
196
193
  setIsGray(_constant.EStatusClass2StatusType[statusType] === 2);
@@ -239,7 +236,7 @@ function _default(props) {
239
236
  while (1) {
240
237
  switch (_context.prev = _context.next) {
241
238
  case 0:
242
- if (hasEditAuth) {
239
+ if (!(!hasEditAuth || dataInfo.status === 2)) {
243
240
  _context.next = 2;
244
241
  break;
245
242
  }
@@ -251,8 +248,8 @@ function _default(props) {
251
248
  return window.openDatePicker(e.target, {
252
249
  isShowCycleView: false,
253
250
  rangepickerOptions: {
254
- startDate: dateInfo.startDate,
255
- endDate: dateInfo.deadLine
251
+ startDate: dataInfo.startDate,
252
+ endDate: dataInfo.deadLine
256
253
  }
257
254
  });
258
255
 
@@ -266,7 +263,7 @@ function _default(props) {
266
263
  isLongTerm: res.isLongTerm
267
264
  }).then(function (resp) {
268
265
  if (resp.Code === 1) {
269
- setDateInfo(_objectSpread(_objectSpread({}, dateInfo), {}, {
266
+ setDataInfo(_objectSpread(_objectSpread({}, dataInfo), {}, {
270
267
  deadLine: resp.Data.deadLine,
271
268
  isLongTerm: resp.Data.isLongTerm,
272
269
  status: resp.Data.status
@@ -319,7 +316,7 @@ function _default(props) {
319
316
  _drawerManager["default"].close();
320
317
  }
321
318
 
322
- window.open("//".concat(location.host).concat(location.pathname, "#more/taskinfo?id=").concat(data.taskId));
319
+ window.open("//".concat(window.location.host).concat(window.location.pathname, "#more/taskinfo?id=").concat(data.taskId));
323
320
  };
324
321
 
325
322
  return /*#__PURE__*/_react["default"].createElement("div", {
@@ -329,7 +326,7 @@ function _default(props) {
329
326
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-prefix"))
330
327
  }, /*#__PURE__*/_react["default"].createElement(_eStatusDropdown["default"], {
331
328
  onChange: onEStatusChangeHandler,
332
- checked: _constant.EStatusStatus2ClassType[dateInfo.status],
329
+ checked: _constant.EStatusStatus2ClassType[dataInfo.status],
333
330
  hasAuth: hasEditAuth
334
331
  })), /*#__PURE__*/_react["default"].createElement("span", {
335
332
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-priority"))
@@ -352,7 +349,7 @@ function _default(props) {
352
349
  name: user === null || user === void 0 ? void 0 : user.name,
353
350
  id: user === null || user === void 0 ? void 0 : user.userId,
354
351
  width: 64,
355
- editable: hasEditAuth,
352
+ editable: dataInfo.status !== 2 && hasEditAuth,
356
353
  onEditUser: onEditUserHandler,
357
354
  isGetRoot: true,
358
355
  extraCls: (isCancel || isGray) && "".concat(_precls["default"], "__e-project-node-gray")
@@ -360,10 +357,10 @@ function _default(props) {
360
357
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-actions-date")),
361
358
  onClick: updateDateHandler
362
359
  }, /*#__PURE__*/_react["default"].createElement(_statusTime["default"], {
363
- deadLine: dateInfo.deadLine,
364
- isLongTerm: dateInfo.isLongTerm,
365
- isCancel: dateInfo.status === 4,
366
- isComplete: dateInfo.status === 2
360
+ deadLine: dataInfo.deadLine,
361
+ isLongTerm: dataInfo.isLongTerm,
362
+ isCancel: dataInfo.status === 4,
363
+ isComplete: dataInfo.status === 2
367
364
  })), /*#__PURE__*/_react["default"].createElement("span", {
368
365
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-actions-progress ").concat((isGray || isCancel) && "".concat(_precls["default"], "__e-project-node-gray")))
369
366
  }, /*#__PURE__*/_react["default"].createElement(_progress["default"].Circle, {
@@ -372,9 +369,9 @@ function _default(props) {
372
369
  percent: progress,
373
370
  linear: true,
374
371
  linearId: data.taskId,
375
- linearStartColor: (0, _getProcessColor["default"])(dateInfo.riskLevel, "linearStartColor", dateInfo.status),
376
- linearEndColor: (0, _getProcessColor["default"])(dateInfo.riskLevel, "linearEndColor", dateInfo.status),
377
- backgroundColor: (0, _getProcessColor["default"])(dateInfo.riskLevel, "backgroundColor", dateInfo.status)
372
+ linearStartColor: (0, _getProcessColor["default"])(dataInfo.riskLevel, "linearStartColor", dataInfo.status),
373
+ linearEndColor: (0, _getProcessColor["default"])(dataInfo.riskLevel, "linearEndColor", dataInfo.status),
374
+ backgroundColor: (0, _getProcessColor["default"])(dataInfo.riskLevel, "backgroundColor", dataInfo.status)
378
375
  })), okrInfo.status === 1 && (hasRelativeAuth || isParticipant) ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
379
376
  overlay: (0, _getLocale.getLocale)("OKR_MyO_Text_Cancel"),
380
377
  placement: "top"
@@ -401,4 +398,7 @@ function _default(props) {
401
398
  type: "button",
402
399
  onClick: onSureUnConnectHandler
403
400
  }, (0, _getLocale.getLocale)("OKR_MyO_Butt_Determine"))));
404
- }
401
+ }
402
+
403
+ var _default = ETaskNode;
404
+ exports["default"] = _default;
@@ -116,7 +116,7 @@ function ChangePhoto(props) {
116
116
  var n = bstr.length;
117
117
  var u8arr = new Uint8Array(n);
118
118
 
119
- for (var i = n; i > 0; i -= 1) {
119
+ for (var i = n; i >= 0; i -= 1) {
120
120
  u8arr[i] = bstr.charCodeAt(i);
121
121
  }
122
122
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.9.133",
3
+ "version": "1.9.136",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",