@titaui/pc 1.9.22 → 1.9.26

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 (35) hide show
  1. package/lib/components/change-okr-modal/Item.js +4 -2
  2. package/lib/components/change-okr-modal/constant.js +5 -9
  3. package/lib/components/form/form-fields/input/index.js +1 -2
  4. package/lib/components/okr-detail/components/header/index.js +7 -5
  5. package/lib/components/okr-detail/components/header/o-score.js +14 -2
  6. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-status-dropdown.js +6 -0
  7. package/lib/components/okr-progress-detail/utils.js +15 -9
  8. package/lib/components/period-selector/common.js +3 -8
  9. package/lib/components/period-selector/components/selector/index.js +3 -1
  10. package/lib/components/upload-photo-modal/constant.js +5 -2
  11. package/lib/components/upload-photo-modal/index.js +6 -4
  12. package/lib/pages/personal-info/components/base-info/index.js +2 -2
  13. package/lib/pages/personal-info/components/edit-base-info/index.js +5 -5
  14. package/lib/pages/personal-info/components/person-photo/index.css +16 -3
  15. package/lib/pages/personal-info/components/person-photo/index.js +8 -3
  16. package/lib/utils/constant.js +14 -0
  17. package/lib/utils/format-time.js +12 -6
  18. package/package.json +1 -1
  19. package/src/components/change-okr-modal/Item.tsx +2 -1
  20. package/src/components/change-okr-modal/constant.ts +1 -17
  21. package/src/components/form/form-fields/input/index.tsx +1 -1
  22. package/src/components/okr-detail/components/header/index.js +2 -2
  23. package/src/components/okr-detail/components/header/o-score.tsx +17 -4
  24. package/src/components/okr-detail/components/okr-tree/tree-node/e-node/e-status-dropdown.js +6 -6
  25. package/src/components/okr-progress-detail/utils.ts +23 -13
  26. package/src/components/period-selector/common.ts +1 -15
  27. package/src/components/period-selector/components/selector/index.tsx +1 -1
  28. package/src/components/upload-photo-modal/constant.ts +3 -3
  29. package/src/components/upload-photo-modal/index.tsx +5 -4
  30. package/src/pages/personal-info/components/base-info/index.tsx +2 -2
  31. package/src/pages/personal-info/components/edit-base-info/index.tsx +5 -5
  32. package/src/pages/personal-info/components/person-photo/index.scss +15 -2
  33. package/src/pages/personal-info/components/person-photo/index.tsx +4 -2
  34. package/src/utils/constant.ts +18 -0
  35. package/src/utils/format-time.ts +13 -7
@@ -15,6 +15,8 @@ var _openData = require("../../utils/open-data");
15
15
 
16
16
  var _constant = require("./constant");
17
17
 
18
+ var _constant2 = require("../../utils/constant");
19
+
18
20
  var _tooltip = _interopRequireDefault(require("../tooltip"));
19
21
 
20
22
  var _getLocale = require("../../utils/getLocale");
@@ -128,10 +130,10 @@ var Item = /*#__PURE__*/function (_PureComponent) {
128
130
  return hzNum[data.yqmnum - 1];
129
131
 
130
132
  case 3:
131
- return (0, _constant.getMonth)()[data.yqmnum - 1];
133
+ return (0, _constant2.getMonth)()[data.yqmnum - 1];
132
134
 
133
135
  case 4:
134
- return "".concat((0, _constant.getMonth)()[data.yqmnum - 1], "-").concat((0, _constant.getMonth)()[((data.yqmnum + 1) % 12 || 12) - 1], "\u6708");
136
+ return "".concat((0, _constant2.getMonth)()[data.yqmnum - 1], "-").concat((0, _constant2.getMonth)()[((data.yqmnum + 1) % 12 || 12) - 1], "\u6708");
135
137
 
136
138
  case 5:
137
139
  return data.yqmnum == 1 ? (0, _getLocale.getLocale)('OKR_MyO_Pop_Firsthalf') : (0, _getLocale.getLocale)('OKR_MyO_Pop_Secondhalf');
@@ -3,7 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getYear = exports.getTypeMap = exports.getStatusType = exports.getPopType = exports.getOkrTypes = exports.getMonthKeyValue = exports.getMonth = exports.getBimonthlyMonthKeyValue = void 0;
6
+ exports.getYear = exports.getTypeMap = exports.getStatusType = exports.getPopType = exports.getOkrTypes = exports.getMonthKeyValue = exports.getBimonthlyMonthKeyValue = void 0;
7
+
8
+ var _constant = require("../../utils/constant");
7
9
 
8
10
  var _getLocale = require("../../utils/getLocale");
9
11
 
@@ -98,7 +100,7 @@ var getBimonthlyMonthKeyValue = function getBimonthlyMonthKeyValue(startMonth) {
98
100
  };
99
101
 
100
102
  var datas = [];
101
- var monthLang = getMonth();
103
+ var monthLang = (0, _constant.getMonth)();
102
104
 
103
105
  if (!_getLocale.isEn) {
104
106
  datas.push({
@@ -135,14 +137,8 @@ var getBimonthlyMonthKeyValue = function getBimonthlyMonthKeyValue(startMonth) {
135
137
 
136
138
  exports.getBimonthlyMonthKeyValue = getBimonthlyMonthKeyValue;
137
139
 
138
- var getMonth = function getMonth() {
139
- return [(0, _getLocale.getLocale)("Mod_Jan"), (0, _getLocale.getLocale)("Mod_Feb"), (0, _getLocale.getLocale)("Mod_Mar"), (0, _getLocale.getLocale)("Mod_Apr"), (0, _getLocale.getLocale)("Mod_May"), (0, _getLocale.getLocale)("Mod_Jun"), (0, _getLocale.getLocale)("Mod_Jul"), (0, _getLocale.getLocale)("Mod_Aug"), (0, _getLocale.getLocale)("Mod_Sept"), (0, _getLocale.getLocale)("Mod_Oct"), (0, _getLocale.getLocale)("Mod_Nov"), (0, _getLocale.getLocale)("Mod_Dec")];
140
- };
141
-
142
- exports.getMonth = getMonth;
143
-
144
140
  var getMonthKeyValue = function getMonthKeyValue() {
145
- var month = getMonth();
141
+ var month = (0, _constant.getMonth)();
146
142
  return [{
147
143
  title: month[0],
148
144
  value: "3,1"
@@ -152,8 +152,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
152
152
 
153
153
  if (errors.length) {
154
154
  setHasError(true);
155
- setTip(errors[0].tip);
156
- inputRef.current.focus();
155
+ setTip(errors[0].tip); // inputRef.current.focus();
157
156
  }
158
157
 
159
158
  return errors;
@@ -64,6 +64,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
64
64
  var precls = "okr-drawer-header";
65
65
 
66
66
  var Header = function Header(props) {
67
+ var _window, _window$BSGlobal, _window$BSGlobal$OkrA, _window$BSGlobal$OkrA2;
68
+
67
69
  // 外部取到的 headInfo
68
70
  var okrInfo = props.okrInfo;
69
71
 
@@ -85,7 +87,7 @@ var Header = function Header(props) {
85
87
  setGeneralOkrClassify = _useContext.setGeneralOkrClassify,
86
88
  showOkrEvalute = _useContext.showOkrEvalute;
87
89
 
88
- var showOScore = window.BSGlobal.OkrAdvancedSetting.KRSetting.OScore;
90
+ var showOScore = (_window = window) === null || _window === void 0 ? void 0 : (_window$BSGlobal = _window.BSGlobal) === null || _window$BSGlobal === void 0 ? void 0 : (_window$BSGlobal$OkrA = _window$BSGlobal.OkrAdvancedSetting) === null || _window$BSGlobal$OkrA === void 0 ? void 0 : (_window$BSGlobal$OkrA2 = _window$BSGlobal$OkrA.KRSetting) === null || _window$BSGlobal$OkrA2 === void 0 ? void 0 : _window$BSGlobal$OkrA2.OScore;
89
91
  var _okrInfo$progressGrow = okrInfo.progressGrow,
90
92
  progressGrow = _okrInfo$progressGrow === void 0 ? 0 : _okrInfo$progressGrow,
91
93
  progress = okrInfo.progress;
@@ -184,11 +186,11 @@ var Header = function Header(props) {
184
186
  okrId: okrInfo.workId
185
187
  })), /*#__PURE__*/_react["default"].createElement("span", {
186
188
  className: "".concat(precls, "__action-item")
187
- }, (showOkrEvalute || showOScore) && /*#__PURE__*/_react["default"].createElement(_oScore["default"], {
188
- editable: editable,
189
+ }, (showOkrEvalute || showOScore || okrInfo.manualEvaluateValue) && /*#__PURE__*/_react["default"].createElement(_oScore["default"], {
190
+ editable: editable && showOScore,
189
191
  okrId: okrInfo.workId,
190
- score: okrInfo.evaluateValue,
191
- isEvaluate: okrInfo.manualEvaluateValue || !!okrInfo.evaluateValue
192
+ score: showOkrEvalute || okrInfo.manualEvaluateValue ? okrInfo.evaluateValue : 0,
193
+ isEvaluate: okrInfo.manualEvaluateValue || showOkrEvalute && !!okrInfo.evaluateValue
192
194
  }))), /*#__PURE__*/_react["default"].createElement(_oProgressUpdate["default"], {
193
195
  okrInfo: okrInfo,
194
196
  renderContent: renderContent
@@ -75,8 +75,7 @@ var OScore = function OScore(props) {
75
75
  refreshAll = _useContext.refreshAll;
76
76
 
77
77
  var _useState3 = (0, _react.useState)({
78
- score: score.toFixed(2),
79
- describe: ""
78
+ score: score == 1 ? '1' : Number(score).toFixed(2) * 1
80
79
  }),
81
80
  _useState4 = _slicedToArray(_useState3, 2),
82
81
  formFiedlsValue = _useState4[0],
@@ -84,6 +83,11 @@ var OScore = function OScore(props) {
84
83
 
85
84
  var formContainerRef = (0, _react.useRef)();
86
85
  var formRef = (0, _react.useRef)();
86
+ (0, _react.useEffect)(function () {
87
+ setFormFiedlsValue({
88
+ score: score == 1 ? '1' : Number(score).toFixed(2) * 1
89
+ });
90
+ }, [score]);
87
91
 
88
92
  var changeOScore = function changeOScore() {
89
93
  setVisible(true);
@@ -93,7 +97,15 @@ var OScore = function OScore(props) {
93
97
  setVisible(false);
94
98
  };
95
99
 
100
+ var checkForm = function checkForm() {
101
+ // @ts-ignore
102
+ var errors = formRef.current.verifing();
103
+ if (errors.length) return false;
104
+ return true;
105
+ };
106
+
96
107
  var handleOk = function handleOk() {
108
+ if (!checkForm()) return;
97
109
  (0, _requestApis.updateOScore)(formFiedlsValue.score, okrId).then(function (res) {
98
110
  if (!!res.Code) {
99
111
  _toast["default"].Success("".concat((0, _getLocale.getLocale)("OKR_MyO_Ew_Success")));
@@ -72,21 +72,27 @@ var _default = function _default(props) {
72
72
  })
73
73
  }, /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
74
74
  name: "tu-icon-finished",
75
+ icon: "tu-icon-finished",
75
76
  exIconClass: "e-node-status-icon"
76
77
  }, (0, _getLocale.getLocale)('OKR_MyO_E_From_Completed')), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
77
78
  name: "tu-icon-running",
79
+ icon: "tu-icon-running",
78
80
  exIconClass: "e-node-status-icon"
79
81
  }, (0, _getLocale.getLocale)('Per_MyRe_text_Inprogress')), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
80
82
  name: "tu-icon-canceled",
83
+ icon: "tu-icon-canceled",
81
84
  exIconClass: "e-node-status-icon"
82
85
  }, (0, _getLocale.getLocale)('OKR_MyO_E_From_Cancelled')), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
83
86
  name: "tu-icon-deferred",
87
+ icon: "tu-icon-deferred",
84
88
  exIconClass: "e-node-status-icon"
85
89
  }, (0, _getLocale.getLocale)('OKR_MyO_E_From_Delayed')), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
86
90
  name: "tu-icon-paused",
91
+ icon: "tu-icon-paused",
87
92
  exIconClass: "e-node-status-icon"
88
93
  }, (0, _getLocale.getLocale)('OKR_MyO_E_From_Suspended')), /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
89
94
  name: "tu-icon-notstart",
95
+ icon: "tu-icon-notstart",
90
96
  exIconClass: "e-node-status-icon"
91
97
  }, (0, _getLocale.getLocale)('OKR_MyO_E_From_NotStarted'))));
92
98
  };
@@ -5,15 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getTimeString = exports.getProgressState = void 0;
7
7
 
8
+ var _constant = require("../../utils/constant");
9
+
8
10
  var _getLocale = require("../../utils/getLocale");
9
11
 
10
- var _constant = require("./constant");
12
+ var _constant2 = require("./constant");
11
13
 
12
14
  var getTimeString = function getTimeString(time, nowTime) {
13
15
  if (!time) {
14
16
  return (0, _getLocale.getLocale)('OKR_MyO_KRP_Notupdated');
15
17
  }
16
18
 
19
+ var months = (0, _constant.getMonth)();
17
20
  var timeDateObj = new Date(time);
18
21
  var timeMilliSecond = timeDateObj.getTime();
19
22
  var timeYear = timeDateObj.getFullYear();
@@ -31,30 +34,33 @@ var getTimeString = function getTimeString(time, nowTime) {
31
34
  }
32
35
 
33
36
  if (secondDiff < 60) {
34
- return "".concat(secondDiff, "\u79D2\u524D");
37
+ return "".concat(secondDiff).concat((0, _getLocale.getLocale)('Mood_secago'));
35
38
  }
36
39
 
37
40
  if (secondDiff < 60 * 60) {
38
- return "".concat(Math.floor(secondDiff / 60), "\u5206\u949F\u524D");
41
+ return "".concat(Math.floor(secondDiff / 60)).concat((0, _getLocale.getLocale)('Tasks_Tab_MyS_minuteago'));
39
42
  }
40
43
 
41
44
  if (secondDiff < 60 * 60 * 24) {
42
- return "".concat(Math.floor(secondDiff / (60 * 60)), "\u5C0F\u65F6\u524D");
45
+ return "".concat(Math.floor(secondDiff / (60 * 60))).concat((0, _getLocale.getLocale)('Mood_hoursago'));
43
46
  }
44
47
 
45
48
  if (secondDiff < 60 * 60 * 24 * 2 && nowDate - 1 === timeDate) {
46
- return "".concat((0, _getLocale.getLocale)('OKR_MyO_Pr_Text_Yesterday'), " ").concat(timeHours + ':' + timeMinutes);
49
+ return "".concat((0, _getLocale.getLocale)('OKR_MyO_Pr_Text_Yesterday'), " ").concat(timeHours + ":" + timeMinutes);
47
50
  }
48
51
 
49
52
  if (secondDiff < 60 * 60 * 24 * 3 && nowDate - 2 === timeDate) {
50
- return "\u524D\u5929 ".concat(timeHours + ':' + timeMinutes);
53
+ return "".concat((0, _getLocale.getLocale)('Mood_2daysago'), " ").concat(timeHours + ":" + timeMinutes);
51
54
  }
52
55
 
53
56
  if (timeYear === nowYear) {
54
- return "".concat(timeMonth, "\u6708").concat(timeDate, "\u65E5 ").concat(timeHours < 10 ? '0' + timeHours : timeHours, ":").concat(timeMinutes < 10 ? '0' + timeMinutes : timeMinutes);
57
+ var _dateStr = months[timeMonth - 1] + (_getLocale.isEn ? " ".concat(timeDate, " ") : "".concat(timeDate, "\u65E5"));
58
+
59
+ return "".concat(_dateStr, " ").concat(timeHours < 10 ? "0" + timeHours : timeHours, ":").concat(timeMinutes < 10 ? "0" + timeMinutes : timeMinutes);
55
60
  }
56
61
 
57
- return "".concat(timeYear, "\u5E74").concat(timeMonth, "\u6708").concat(timeDate, "\u65E5 ").concat(timeHours < 10 ? '0' + timeHours : timeHours, ":").concat(timeMinutes < 10 ? '0' + timeMinutes : timeMinutes);
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" + timeHours : timeHours, ":").concat(timeMinutes < 10 ? "0" + timeMinutes : timeMinutes);
58
64
  };
59
65
 
60
66
  exports.getTimeString = getTimeString;
@@ -64,7 +70,7 @@ var getProgressState = function getProgressState(oStatus, riskLevel) {
64
70
  if (oStatus === 2) {
65
71
  return 'end';
66
72
  } else {
67
- return _constant.OkrRiskMapping[riskLevel] ? _constant.OkrRiskMapping[riskLevel] : 'normal';
73
+ return _constant2.OkrRiskMapping[riskLevel] ? _constant2.OkrRiskMapping[riskLevel] : 'normal';
68
74
  }
69
75
  };
70
76
 
@@ -5,13 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getDateRangeByCycle = exports.formatPeriod = exports.dealYearsRange = exports.dealSelectedPeriodData = exports.computeYearIndex = void 0;
7
7
  exports.getDefalutCycle = getDefalutCycle;
8
- exports.getMonth = void 0;
9
8
  exports.getQuaterNum = getQuaterNum;
10
9
 
11
10
  var _getLocale = require("../../utils/getLocale");
12
11
 
13
12
  var _moment = _interopRequireDefault(require("moment"));
14
13
 
14
+ var _constant = require("../../utils/constant");
15
+
15
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
16
17
 
17
18
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -20,12 +21,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
20
21
 
21
22
  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; }
22
23
 
23
- var getMonth = function getMonth() {
24
- return [(0, _getLocale.getLocale)("Mod_Jan"), (0, _getLocale.getLocale)("Mod_Feb"), (0, _getLocale.getLocale)("Mod_Mar"), (0, _getLocale.getLocale)("Mod_Apr"), (0, _getLocale.getLocale)("Mod_May"), (0, _getLocale.getLocale)("Mod_Jun"), (0, _getLocale.getLocale)("Mod_Jul"), (0, _getLocale.getLocale)("Mod_Aug"), (0, _getLocale.getLocale)("Mod_Sept"), (0, _getLocale.getLocale)("Mod_Oct"), (0, _getLocale.getLocale)("Mod_Nov"), (0, _getLocale.getLocale)("Mod_Dec")];
25
- };
26
-
27
- exports.getMonth = getMonth;
28
-
29
24
  var dealSelectedPeriodData = function dealSelectedPeriodData(period) {
30
25
  var option = {};
31
26
  option.cycleType = period == "-1" ? "-1" : period.substring(0, 1);
@@ -76,7 +71,7 @@ var formatPeriod = function formatPeriod(selected) {
76
71
  var quarter = ["", "".concat((0, _getLocale.getLocale)('OKR_MyO_Pop_1stQuarter')), "".concat((0, _getLocale.getLocale)('OKR_MyO_Pop_2ndQuarter')), "".concat((0, _getLocale.getLocale)('OKR_MyO_Pop_3rdQuarter')), "".concat((0, _getLocale.getLocale)('OKR_MyO_Pop_4thQuarter'))];
77
72
  var cycleDate = "";
78
73
  var annualNum = selected.annualNum == "-1" ? "".concat((0, _getLocale.getLocale)('OKR_MyO_Butt_Allyears')) : selected.annualNum + "".concat(_getLocale.isEn ? '' : '年');
79
- var month = getMonth();
74
+ var month = (0, _constant.getMonth)();
80
75
 
81
76
  switch ("".concat(selected.cycleType)) {
82
77
  case "-1":
@@ -19,6 +19,8 @@ var _style = require("./style");
19
19
 
20
20
  var _helper = require("../../helper");
21
21
 
22
+ var _constant = require("../../../../utils/constant");
23
+
22
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); }
23
25
 
24
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; }
@@ -95,7 +97,7 @@ function getDoubleMonthData(startMonth) {
95
97
  };
96
98
 
97
99
  var datas = [];
98
- var monthLang = (0, _common.getMonth)();
100
+ var monthLang = (0, _constant.getMonth)();
99
101
 
100
102
  if (!i18nInfo || i18nInfo.I18NOpen && i18nInfo.I18NUserLang === "zh_CN") {
101
103
  datas.push({
@@ -4,13 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.List = void 0;
7
+
8
+ var _getLocale = require("../../utils/getLocale");
9
+
7
10
  var List = [{
8
11
  id: 'person',
9
12
  accept: '.jpg,.jpeg,.png',
10
13
  autoCropArea: 1,
11
14
  initialAspectRatio: 1,
12
- tips: '仅支持 jpg、jpeg、png 格式 建议图片最小尺寸 150*150px',
13
- previewTitle: '预览',
15
+ tips: "".concat((0, _getLocale.getLocale)('Set_PI_Onlyjpgsize'), " 150*150px"),
16
+ previewTitle: (0, _getLocale.getLocale)('Mod_Preview'),
14
17
  minCropBoxHeight: 60,
15
18
  minCropBoxWidth: 60
16
19
  }, {
@@ -23,6 +23,8 @@ var _dialog = _interopRequireDefault(require("../../components/dialog"));
23
23
 
24
24
  var _constant = require("./constant");
25
25
 
26
+ var _getLocale = require("../../utils/getLocale");
27
+
26
28
  require("cropperjs/dist/cropper.css");
27
29
 
28
30
  require("./index.css");
@@ -198,12 +200,12 @@ var ChangePhoto = function ChangePhoto(props) {
198
200
  width: 480,
199
201
  mask: true,
200
202
  centered: true,
201
- title: '上传头像',
203
+ title: (0, _getLocale.getLocale)('Set_PI_Uploadavatar'),
202
204
  noHeadLine: true,
203
205
  maskClosable: false,
204
206
  onClose: handleCancel,
205
207
  onCancel: handleCancel,
206
- okText: "\u4FDD\u5B58",
208
+ okText: (0, _getLocale.getLocale)('Mod_Save'),
207
209
  noFooterLine: true,
208
210
  onOk: handleSaveInfo
209
211
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -223,7 +225,7 @@ var ChangePhoto = function ChangePhoto(props) {
223
225
  accept: item === null || item === void 0 ? void 0 : item.accept
224
226
  }), /*#__PURE__*/_react["default"].createElement("span", {
225
227
  className: "".concat(preCls, "__upload-right-title")
226
- }, "\u70B9\u51FB\u4E0A\u4F20"), /*#__PURE__*/_react["default"].createElement("span", {
228
+ }, (0, _getLocale.getLocale)('Pro_detail_ClickUpload')), /*#__PURE__*/_react["default"].createElement("span", {
227
229
  className: "".concat(preCls, "__upload-right-tips")
228
230
  }, item === null || item === void 0 ? void 0 : item.tips))), /*#__PURE__*/_react["default"].createElement("div", {
229
231
  className: "".concat(preCls, "__upload-left")
@@ -300,7 +302,7 @@ var ChangePhoto = function ChangePhoto(props) {
300
302
  onMouseLeave: handleLeaveAgain
301
303
  }), /*#__PURE__*/_react["default"].createElement("span", {
302
304
  className: (0, _classnames["default"])("".concat(preCls, "__title-again"), _defineProperty({}, "".concat(preCls, "__title-again--show"), image), _defineProperty({}, "".concat(preCls, "__title-again--hover"), isEnter))
303
- }, "\u91CD\u65B0\u4E0A\u4F20"), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
305
+ }, (0, _getLocale.getLocale)('Set_PI_Reupload')), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
304
306
  condition: type === 'person'
305
307
  }, /*#__PURE__*/_react["default"].createElement("span", {
306
308
  className: "".concat(preCls, "__title-preview")
@@ -112,13 +112,13 @@ var BaseInfo = function BaseInfo() {
112
112
  className: "".concat(prefix, "__form")
113
113
  }, /*#__PURE__*/_react["default"].createElement("div", {
114
114
  className: "".concat(prefix, "__form-title")
115
- }, "\u624B\u673A\u53F7\u7801"), /*#__PURE__*/_react["default"].createElement("span", {
115
+ }, (0, _getLocale.getLocale)('Set_PI_PhoneNumber')), /*#__PURE__*/_react["default"].createElement("span", {
116
116
  className: "".concat(prefix, "__form-value")
117
117
  }, userInfo.mobile ? userInfo.mobile : (0, _getLocale.getLocale)('Data_Notset'))), /*#__PURE__*/_react["default"].createElement("div", {
118
118
  className: "".concat(prefix, "__form")
119
119
  }, /*#__PURE__*/_react["default"].createElement("div", {
120
120
  className: "".concat(prefix, "__form-title")
121
- }, "\u7535\u5B50\u90AE\u7BB1"), /*#__PURE__*/_react["default"].createElement("span", {
121
+ }, (0, _getLocale.getLocale)('Set_PI_Email')), /*#__PURE__*/_react["default"].createElement("span", {
122
122
  className: "".concat(prefix, "__form-value")
123
123
  }, userInfo.email ? userInfo.email : (0, _getLocale.getLocale)('Data_Notset'))));
124
124
  };
@@ -153,7 +153,7 @@ var EditBaseInfo = function EditBaseInfo(props) {
153
153
  width: 480,
154
154
  mask: true,
155
155
  centered: true,
156
- title: "基本信息设置",
156
+ title: (0, _getLocale.getLocale)('Set_PI_BasicInSettings'),
157
157
  noHeadLine: true,
158
158
  maskClosable: false,
159
159
  onClose: function onClose() {
@@ -197,7 +197,7 @@ var EditBaseInfo = function EditBaseInfo(props) {
197
197
  tip: (0, _getLocale.getLocale)('OKR_MyO_Ew_Namecant'),
198
198
  test: /^[\s\S]+$/
199
199
  }, {
200
- tip: "姓名只能为中文,英文字母和数字及下划线的组合",
200
+ tip: (0, _getLocale.getLocale)('Set_PI_Thenameonly'),
201
201
  test: /^((?!(\uff08|\uff09)).)*$/g
202
202
  }, {
203
203
  tip: (0, _i18nFrontTranslate.i18nLimitCharacters)(50),
@@ -208,16 +208,16 @@ var EditBaseInfo = function EditBaseInfo(props) {
208
208
  }), /*#__PURE__*/_react["default"].createElement(Fields.Input, {
209
209
  name: "phone",
210
210
  type: "text",
211
- label: "手机号码",
211
+ label: (0, _getLocale.getLocale)('Set_PI_PhoneNumber'),
212
212
  placeholder: (0, _getLocale.getLocale)('Pro_page_Ext_Tab_PhoneNumber'),
213
213
  require: true,
214
214
  layout: "row",
215
215
  value: userInfo.mobile,
216
216
  verifies: [{
217
- tip: "手机号不能为空",
217
+ tip: (0, _getLocale.getLocale)('OKR_MyO_Ew_MobileNum'),
218
218
  test: /^[\s\S]+$/
219
219
  }, {
220
- tip: "格式错误,海外手机格式如:(+852)52345678",
220
+ tip: (0, _getLocale.getLocale)('OKR_MyO_Ew_FormatErr'),
221
221
  test: /^1[3456789]\d{9}$/
222
222
  }],
223
223
  onChange: handlePhoneChange
@@ -1,5 +1,3 @@
1
- @charset "UTF-8";
2
-
3
1
  .titaui-personal-info-person-photo {
4
2
  background: #ffffff;
5
3
  box-shadow: 0px 0px 8px 0px rgba(127, 145, 180, 0.1);
@@ -39,6 +37,7 @@
39
37
  }
40
38
 
41
39
  .titaui-personal-info-person-photo__main {
40
+ position: relative;
42
41
  display: flex;
43
42
  align-items: center;
44
43
  }
@@ -55,6 +54,20 @@
55
54
  line-height: 18px;
56
55
  }
57
56
 
57
+ .titaui-personal-info-person-photo__main-change {
58
+ position: absolute;
59
+ bottom: 7px;
60
+ width: 160px;
61
+ height: 32px;
62
+ color: #FFFFFF;
63
+ font-size: 12px;
64
+ line-height: 18px;
65
+ text-align: center;
66
+ box-sizing: border-box;
67
+ padding: 7px 0;
68
+ cursor: pointer;
69
+ }
70
+
58
71
  .titaui-personal-info-person-photo__main-tip {
59
72
  margin-left: 32px;
60
73
  font-size: 12px;
@@ -83,7 +96,7 @@
83
96
  position: absolute;
84
97
  bottom: 0;
85
98
  display: block;
86
- content: "点击修改";
99
+ content: "";
87
100
  width: 160px;
88
101
  height: 32px;
89
102
  background: rgba(20, 28, 40, 0.5);
@@ -15,6 +15,8 @@ var _avatar = _interopRequireDefault(require("../../../../components/avatar"));
15
15
 
16
16
  var _uploadPhotoModal = _interopRequireDefault(require("../../../../components/upload-photo-modal"));
17
17
 
18
+ var _getLocale = require("../../../../utils/getLocale");
19
+
18
20
  require("./index.css");
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -74,7 +76,7 @@ var PersonPhoto = function PersonPhoto() {
74
76
  className: "".concat(prefix, "__header")
75
77
  }, /*#__PURE__*/_react["default"].createElement("span", {
76
78
  className: "".concat(prefix, "__header-title")
77
- }, "\u4E0A\u4F20\u5934\u50CF")), /*#__PURE__*/_react["default"].createElement("div", {
79
+ }, (0, _getLocale.getLocale)('Set_PI_Uploadavatar'))), /*#__PURE__*/_react["default"].createElement("div", {
78
80
  className: "".concat(prefix, "__main")
79
81
  }, /*#__PURE__*/_react["default"].createElement(_avatar["default"], {
80
82
  userId: Id,
@@ -87,9 +89,12 @@ var PersonPhoto = function PersonPhoto() {
87
89
  fontSize: 24
88
90
  },
89
91
  onClick: handleChangePhoto
90
- }), /*#__PURE__*/_react["default"].createElement("span", {
92
+ }), /*#__PURE__*/_react["default"].createElement("div", {
93
+ className: "".concat(prefix, "__main-change"),
94
+ onClick: handleChangePhoto
95
+ }, (0, _getLocale.getLocale)('Set_PI_Clicktomodify')), /*#__PURE__*/_react["default"].createElement("span", {
91
96
  className: "".concat(prefix, "__main-tip")
92
- }, "\u5EFA\u8BAE\u56FE\u7247\u6700\u5C0F\u5C3A\u5BF8 150*150px")), /*#__PURE__*/_react["default"].createElement(_uploadPhotoModal["default"], {
97
+ }, (0, _getLocale.getLocale)('Set_PI_Suggestedsize'), " 150*150px")), /*#__PURE__*/_react["default"].createElement(_uploadPhotoModal["default"], {
93
98
  visible: visible,
94
99
  onCancel: handleCancel,
95
100
  type: "person",
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getMonth = void 0;
7
+
8
+ var _getLocale = require("./getLocale");
9
+
10
+ var getMonth = function getMonth() {
11
+ return [(0, _getLocale.getLocale)("Mod_Jan"), (0, _getLocale.getLocale)("Mod_Feb"), (0, _getLocale.getLocale)("Mod_Mar"), (0, _getLocale.getLocale)("Mod_Apr"), (0, _getLocale.getLocale)("Mod_May"), (0, _getLocale.getLocale)("Mod_Jun"), (0, _getLocale.getLocale)("Mod_Jul"), (0, _getLocale.getLocale)("Mod_Aug"), (0, _getLocale.getLocale)("Mod_Sept"), (0, _getLocale.getLocale)("Mod_Oct"), (0, _getLocale.getLocale)("Mod_Nov"), (0, _getLocale.getLocale)("Mod_Dec")];
12
+ };
13
+
14
+ exports.getMonth = getMonth;
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.timeFormat = exports.showWeekLastDay = exports.showWeekFirstDay = exports.showNextWeekFirstDay = exports.showNextMonthFirstDay = exports.showMonthLastDay = exports.showMonthFirstDay = exports.getTimeString = exports.getNextDayOfYear = exports.getFirstDayOfYear = void 0;
7
7
 
8
+ var _constant = require("./constant");
9
+
8
10
  var _getLocale = require("./getLocale");
9
11
 
10
12
  var getTimeString = function getTimeString(time, nowTime) {
@@ -12,6 +14,7 @@ var getTimeString = function getTimeString(time, nowTime) {
12
14
  return (0, _getLocale.getLocale)('OKR_MyO_KRP_Notupdated');
13
15
  }
14
16
 
17
+ var months = (0, _constant.getMonth)();
15
18
  var timeDateObj = new Date(time);
16
19
  var timeMilliSecond = timeDateObj.getTime();
17
20
  var timeYear = timeDateObj.getFullYear();
@@ -29,15 +32,15 @@ var getTimeString = function getTimeString(time, nowTime) {
29
32
  }
30
33
 
31
34
  if (secondDiff < 60) {
32
- return "".concat(secondDiff, "\u79D2\u524D");
35
+ return "".concat(secondDiff).concat((0, _getLocale.getLocale)('Mood_secago'));
33
36
  }
34
37
 
35
38
  if (secondDiff < 60 * 60) {
36
- return "".concat(Math.floor(secondDiff / 60), "\u5206\u949F\u524D");
39
+ return "".concat(Math.floor(secondDiff / 60)).concat((0, _getLocale.getLocale)('Tasks_Tab_MyS_minuteago'));
37
40
  }
38
41
 
39
42
  if (secondDiff < 60 * 60 * 24) {
40
- return "".concat(Math.floor(secondDiff / (60 * 60)), "\u5C0F\u65F6\u524D");
43
+ return "".concat(Math.floor(secondDiff / (60 * 60))).concat((0, _getLocale.getLocale)('Mood_hoursago'));
41
44
  }
42
45
 
43
46
  if (secondDiff < 60 * 60 * 24 * 2 && nowDate - 1 === timeDate) {
@@ -45,14 +48,17 @@ var getTimeString = function getTimeString(time, nowTime) {
45
48
  }
46
49
 
47
50
  if (secondDiff < 60 * 60 * 24 * 3 && nowDate - 2 === timeDate) {
48
- return "\u524D\u5929 ".concat(timeHours + ":" + timeMinutes);
51
+ return "".concat((0, _getLocale.getLocale)('Mood_2daysago'), " ").concat(timeHours + ":" + timeMinutes);
49
52
  }
50
53
 
51
54
  if (timeYear === nowYear) {
52
- return "".concat(timeMonth, "\u6708").concat(timeDate, "\u65E5 ").concat(timeHours < 10 ? "0" + timeHours : timeHours, ":").concat(timeMinutes < 10 ? "0" + timeMinutes : timeMinutes);
55
+ var _dateStr = months[timeMonth - 1] + (_getLocale.isEn ? " ".concat(timeDate, " ") : "".concat(timeDate, "\u65E5"));
56
+
57
+ return "".concat(_dateStr, " ").concat(timeHours < 10 ? "0" + timeHours : timeHours, ":").concat(timeMinutes < 10 ? "0" + timeMinutes : timeMinutes);
53
58
  }
54
59
 
55
- return "".concat(timeYear, "\u5E74").concat(timeMonth, "\u6708").concat(timeDate, "\u65E5 ").concat(timeHours < 10 ? "0" + timeHours : timeHours, ":").concat(timeMinutes < 10 ? "0" + timeMinutes : timeMinutes);
60
+ var dateStr = (_getLocale.isEn ? '' : "".concat(timeYear, "\u5E74")) + months[timeMonth - 1] + (_getLocale.isEn ? " ".concat(timeDate, " ") : "".concat(timeDate, "\u65E5")) + (_getLocale.isEn ? ",".concat(timeYear) : '');
61
+ return "".concat(dateStr, " ").concat(timeHours < 10 ? "0" + timeHours : timeHours, ":").concat(timeMinutes < 10 ? "0" + timeMinutes : timeMinutes);
56
62
  }; // 日期格式化,返回值形式为yy-mm-dd
57
63
 
58
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.9.22",
3
+ "version": "1.9.26",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "src/index.js",
@@ -3,7 +3,8 @@ import { ItemWrapper, Radio, Tag, ItemObjectiveContainer, ItemKrContainer, ItemT
3
3
  import { OkrData } from './types';
4
4
  import { OpenUserName } from '../../utils/open-data';
5
5
  import drawerManager from '../../components/drawer-manager'
6
- import { getMonth, getTypeMap } from './constant';
6
+ import { getTypeMap } from './constant';
7
+ import { getMonth }from '../../utils/constant';
7
8
  import Tooltip from '../tooltip';
8
9
  import { getLocale } from '../../utils/getLocale';
9
10
  import { isEn } from '../../utils/getLocale';
@@ -1,4 +1,4 @@
1
- import { getBSGlobal } from "&/utils/bs-global";
1
+ import { getMonth } from "../../utils/constant";
2
2
  import { getLocale, isEn } from "../../utils/getLocale";
3
3
 
4
4
  export const getYear = () => {
@@ -118,22 +118,6 @@ export const getBimonthlyMonthKeyValue = (startMonth) => {
118
118
  return datas;
119
119
  };
120
120
 
121
- export const getMonth = () => {
122
- return [
123
- getLocale("Mod_Jan"),
124
- getLocale("Mod_Feb"),
125
- getLocale("Mod_Mar"),
126
- getLocale("Mod_Apr"),
127
- getLocale("Mod_May"),
128
- getLocale("Mod_Jun"),
129
- getLocale("Mod_Jul"),
130
- getLocale("Mod_Aug"),
131
- getLocale("Mod_Sept"),
132
- getLocale("Mod_Oct"),
133
- getLocale("Mod_Nov"),
134
- getLocale("Mod_Dec"),
135
- ];
136
- };
137
121
 
138
122
  export const getMonthKeyValue = () => {
139
123
  const month = getMonth();
@@ -108,7 +108,7 @@ export default forwardRef((props: Props, ref) => {
108
108
  if (errors.length) {
109
109
  setHasError(true);
110
110
  setTip(errors[0].tip);
111
- inputRef.current.focus();
111
+ // inputRef.current.focus();
112
112
  }
113
113
  return errors;
114
114
  }
@@ -34,7 +34,7 @@ const Header = (props) => {
34
34
  setGeneralOkrClassify,
35
35
  showOkrEvalute,
36
36
  } = useContext(GeneralDataContext);
37
- const showOScore = window.BSGlobal.OkrAdvancedSetting.KRSetting.OScore
37
+ const showOScore = window?.BSGlobal?.OkrAdvancedSetting?.KRSetting?.OScore
38
38
  const { progressGrow = 0, progress } = okrInfo;
39
39
 
40
40
  const [auth, setAuth] = useState(false);
@@ -149,7 +149,7 @@ const Header = (props) => {
149
149
  <OCycle editable={editable} okrId={okrInfo.workId} />
150
150
  </span>
151
151
  <span className={`${precls}__action-item`}>
152
- {(showOkrEvalute || showOScore) && <Score editable={editable} okrId={okrInfo.workId} score={okrInfo.evaluateValue} isEvaluate={okrInfo.manualEvaluateValue||!!okrInfo.evaluateValue} />}
152
+ {(showOkrEvalute || showOScore || okrInfo.manualEvaluateValue) && <Score editable={editable&&showOScore} okrId={okrInfo.workId} score={showOkrEvalute || okrInfo.manualEvaluateValue ? okrInfo.evaluateValue:0} isEvaluate={okrInfo.manualEvaluateValue || (showOkrEvalute && !!okrInfo.evaluateValue)} />}
153
153
  </span>
154
154
  </span>
155
155
  <OProgressUpdate okrInfo={okrInfo} renderContent={renderContent} />
@@ -1,4 +1,4 @@
1
- import React, { Fragment, useState, useRef, useContext } from "react";
1
+ import React, { Fragment, useState, useRef,useEffect, useContext } from "react";
2
2
  import { CommonContext } from "../../context";
3
3
  import { getLocale } from "../../../../utils/getLocale";
4
4
  import Score from "../score";
@@ -18,18 +18,23 @@ interface IOScoreProps {
18
18
  }
19
19
  interface FormFields {
20
20
  score: string | number;
21
- describe: string;
22
21
  }
23
22
  const OScore = (props: IOScoreProps) => {
24
23
  const { score, okrId, editable, ...restProps } = props;
25
24
  const [visible, setVisible] = useState(false);
26
25
  const { refreshAll } = useContext(CommonContext);
27
26
  const [formFiedlsValue, setFormFiedlsValue] = useState<FormFields>({
28
- score: score.toFixed(2),
29
- describe: "",
27
+ score: score == 1 ? '1': Number(score).toFixed(2) * 1
30
28
  });
31
29
  const formContainerRef = useRef<any>();
32
30
  const formRef = useRef<any>();
31
+
32
+ useEffect(()=>{
33
+ setFormFiedlsValue({
34
+ score: score == 1 ? '1': Number(score).toFixed(2) * 1
35
+ })
36
+ },[score])
37
+
33
38
  const changeOScore = () => {
34
39
  setVisible(true);
35
40
  };
@@ -38,7 +43,15 @@ const OScore = (props: IOScoreProps) => {
38
43
  setVisible(false);
39
44
  };
40
45
 
46
+ const checkForm = () => {
47
+ // @ts-ignore
48
+ const errors = formRef.current.verifing();
49
+ if (errors.length) return false;
50
+ return true;
51
+ };
52
+
41
53
  const handleOk = () => {
54
+ if (!checkForm()) return;
42
55
  updateOScore(formFiedlsValue.score, okrId)
43
56
  .then((res) => {
44
57
  if (!!res.Code) {
@@ -36,12 +36,12 @@ export default props => {
36
36
  </span>
37
37
  }
38
38
  >
39
- <IconItem name="tu-icon-finished" exIconClass='e-node-status-icon'>{getLocale('OKR_MyO_E_From_Completed')}</IconItem>
40
- <IconItem name="tu-icon-running" exIconClass='e-node-status-icon'>{getLocale('Per_MyRe_text_Inprogress')}</IconItem>
41
- <IconItem name="tu-icon-canceled" exIconClass='e-node-status-icon'>{getLocale('OKR_MyO_E_From_Cancelled')}</IconItem>
42
- <IconItem name="tu-icon-deferred" exIconClass='e-node-status-icon'>{getLocale('OKR_MyO_E_From_Delayed')}</IconItem>
43
- <IconItem name="tu-icon-paused" exIconClass='e-node-status-icon'>{getLocale('OKR_MyO_E_From_Suspended')}</IconItem>
44
- <IconItem name="tu-icon-notstart" exIconClass='e-node-status-icon'>{getLocale('OKR_MyO_E_From_NotStarted')}</IconItem>
39
+ <IconItem name="tu-icon-finished" icon="tu-icon-finished" exIconClass='e-node-status-icon'>{getLocale('OKR_MyO_E_From_Completed')}</IconItem>
40
+ <IconItem name="tu-icon-running" icon="tu-icon-running" exIconClass='e-node-status-icon'>{getLocale('Per_MyRe_text_Inprogress')}</IconItem>
41
+ <IconItem name="tu-icon-canceled" icon="tu-icon-canceled" exIconClass='e-node-status-icon'>{getLocale('OKR_MyO_E_From_Cancelled')}</IconItem>
42
+ <IconItem name="tu-icon-deferred" icon="tu-icon-deferred" exIconClass='e-node-status-icon'>{getLocale('OKR_MyO_E_From_Delayed')}</IconItem>
43
+ <IconItem name="tu-icon-paused" icon="tu-icon-paused" exIconClass='e-node-status-icon'>{getLocale('OKR_MyO_E_From_Suspended')}</IconItem>
44
+ <IconItem name="tu-icon-notstart" icon="tu-icon-notstart" exIconClass='e-node-status-icon'>{getLocale('OKR_MyO_E_From_NotStarted')}</IconItem>
45
45
  </DropSelector>
46
46
  </React.Fragment>
47
47
  }
@@ -1,46 +1,56 @@
1
- import { getLocale } from "../../utils/getLocale";
1
+ import { getMonth } from "../../utils/constant";
2
+ import { getLocale, isEn } from "../../utils/getLocale";
2
3
  import { OkrRiskMapping } from "./constant";
3
4
 
4
5
  export const getTimeString = (time: string, nowTime): string => {
5
6
  if (!time) {
6
7
  return getLocale('OKR_MyO_KRP_Notupdated');
7
8
  }
9
+
10
+ const months = getMonth();
11
+
8
12
  const timeDateObj = new Date(time);
9
13
  const timeMilliSecond = timeDateObj.getTime();
10
14
  const timeYear = timeDateObj.getFullYear();
11
15
  const timeMonth = timeDateObj.getMonth() + 1;
12
- const timeDate = timeDateObj.getDate();
16
+ const timeDate = timeDateObj.getDate();
13
17
  const timeHours = timeDateObj.getHours();
14
18
  const timeMinutes = timeDateObj.getMinutes();
15
19
 
16
- const nowMilliSecond = nowTime.getTime();
20
+ const nowMilliSecond = nowTime.getTime();
17
21
  const nowYear = nowTime.getFullYear();
18
22
  const nowDate = nowTime.getDate();
19
-
23
+
20
24
  const secondDiff = Math.floor((nowMilliSecond - timeMilliSecond) / 1000);
21
25
  if (secondDiff <= 3) {
22
26
  return getLocale('Pro_page_Int_Justnow');
23
27
  }
24
28
  if (secondDiff < 60) {
25
- return `${secondDiff}秒前`;
29
+ return `${secondDiff}${getLocale('Mood_secago')}`;
26
30
  }
27
31
  if (secondDiff < 60 * 60) {
28
- return `${Math.floor(secondDiff / 60)}分钟前`;
32
+ return `${Math.floor(secondDiff / 60)}${getLocale('Tasks_Tab_MyS_minuteago')}`;
29
33
  }
30
34
  if (secondDiff < 60 * 60 * 24) {
31
- return `${Math.floor(secondDiff / (60 * 60))}小时前`;
35
+ return `${Math.floor(secondDiff / (60 * 60))}${getLocale('Mood_hoursago')}`;
32
36
  }
33
37
  if (secondDiff < 60 * 60 * 24 * 2 && nowDate - 1 === timeDate) {
34
- return `${getLocale('OKR_MyO_Pr_Text_Yesterday')} ${timeHours + ':' + timeMinutes}`;
38
+ return `${getLocale('OKR_MyO_Pr_Text_Yesterday')} ${timeHours + ":" + timeMinutes}`;
35
39
  }
36
40
  if (secondDiff < 60 * 60 * 24 * 3 && nowDate - 2 === timeDate) {
37
- return `前天 ${timeHours + ':' + timeMinutes}`;
41
+ return `${getLocale('Mood_2daysago')} ${timeHours + ":" + timeMinutes}`;
38
42
  }
39
43
  if (timeYear === nowYear) {
40
- return `${timeMonth}月${timeDate}日 ${timeHours < 10 ? '0' + timeHours : timeHours}:${timeMinutes < 10 ? '0' + timeMinutes : timeMinutes}`;
41
- }
42
- return `${timeYear}年${timeMonth}月${timeDate}日 ${timeHours < 10 ? '0' + timeHours : timeHours}:${timeMinutes < 10 ? '0' + timeMinutes : timeMinutes}`;
43
- }
44
+ const dateStr = months[timeMonth-1] + (isEn ? ` ${timeDate} ` : `${timeDate}日`)
45
+ return `${dateStr} ${
46
+ timeHours < 10 ? "0" + timeHours : timeHours
47
+ }:${timeMinutes < 10 ? "0" + timeMinutes : timeMinutes}`;
48
+ }
49
+ const dateStr = (isEn ? '' : `${timeYear}年`) + months[timeMonth-1] + (isEn ? ` ${timeDate} ` : `${timeDate}日`) + (isEn ? `,${timeYear}` : '');
50
+ return `${dateStr} ${
51
+ timeHours < 10 ? "0" + timeHours : timeHours
52
+ }:${timeMinutes < 10 ? "0" + timeMinutes : timeMinutes}`;
53
+ };
44
54
 
45
55
  export const getProgressState = (oStatus, riskLevel) => {
46
56
  // 2代表已结束
@@ -1,21 +1,7 @@
1
1
  import { getLocale, isEn } from "../../utils/getLocale";
2
2
  import { SelectedInterface, PeriodObj } from "./type";
3
3
  import moment from "moment";
4
-
5
- export const getMonth = () => [
6
- getLocale("Mod_Jan"),
7
- getLocale("Mod_Feb"),
8
- getLocale("Mod_Mar"),
9
- getLocale("Mod_Apr"),
10
- getLocale("Mod_May"),
11
- getLocale("Mod_Jun"),
12
- getLocale("Mod_Jul"),
13
- getLocale("Mod_Aug"),
14
- getLocale("Mod_Sept"),
15
- getLocale("Mod_Oct"),
16
- getLocale("Mod_Nov"),
17
- getLocale("Mod_Dec"),
18
- ];
4
+ import { getMonth } from "../../utils/constant";
19
5
 
20
6
  export const dealSelectedPeriodData = (period: string) => {
21
7
  let option: any = {};
@@ -5,12 +5,12 @@ import {
5
5
  dealSelectedPeriodData,
6
6
  dealYearsRange,
7
7
  getDateRangeByCycle,
8
- getMonth,
9
8
  } from "../../common";
10
9
  import { getMockMonth, getMockPeriod, getMockQuarter } from "../../mockData";
11
10
  import { PeriodObj, SelectedInterface } from "../../type";
12
11
  import { Head, List, Item, Icon, Title, Wrapper, PlaceHolder } from "./style";
13
12
  import { getBSGlobal } from "../../helper";
13
+ import { getMonth } from "../../../../utils/constant";
14
14
 
15
15
  const i18nInfo = getBSGlobal("I18NInfo");
16
16
 
@@ -1,12 +1,12 @@
1
-
1
+ import { getLocale } from "../../utils/getLocale";
2
2
  export const List = [
3
3
  {
4
4
  id: 'person',
5
5
  accept: '.jpg,.jpeg,.png',
6
6
  autoCropArea: 1,
7
7
  initialAspectRatio: 1,
8
- tips: '仅支持 jpg、jpeg、png 格式 建议图片最小尺寸 150*150px',
9
- previewTitle: '预览',
8
+ tips: `${getLocale('Set_PI_Onlyjpgsize')} 150*150px`,
9
+ previewTitle: getLocale('Mod_Preview'),
10
10
  minCropBoxHeight: 60,
11
11
  minCropBoxWidth: 60,
12
12
  },
@@ -6,6 +6,7 @@ import ConditionRender from '../condition-render';
6
6
  import { saveTenantLogo, saveBrowserIcon, saveUserPhoto } from './request-api';
7
7
  import Dialog from '../../components/dialog';
8
8
  import { List } from './constant';
9
+ import { getLocale } from '../../utils/getLocale'
9
10
  import 'cropperjs/dist/cropper.css';
10
11
  import './index.scss';
11
12
 
@@ -130,12 +131,12 @@ const ChangePhoto = (props: Props) => {
130
131
  width={480}
131
132
  mask
132
133
  centered
133
- title={'上传头像'}
134
+ title={getLocale('Set_PI_Uploadavatar')}
134
135
  noHeadLine
135
136
  maskClosable={false}
136
137
  onClose={handleCancel}
137
138
  onCancel={handleCancel}
138
- okText="保存"
139
+ okText={getLocale('Mod_Save')}
139
140
  noFooterLine
140
141
  onOk={handleSaveInfo}
141
142
  >
@@ -151,7 +152,7 @@ const ChangePhoto = (props: Props) => {
151
152
  className={`${preCls}__upload-right-input`}
152
153
  accept={item?.accept}
153
154
  />
154
- <span className={`${preCls}__upload-right-title`}>点击上传</span>
155
+ <span className={`${preCls}__upload-right-title`}>{getLocale('Pro_detail_ClickUpload')}</span>
155
156
  <span className={`${preCls}__upload-right-tips`}>
156
157
  {item?.tips}
157
158
  </span>
@@ -214,7 +215,7 @@ const ChangePhoto = (props: Props) => {
214
215
  onMouseLeave={handleLeaveAgain}
215
216
  />
216
217
  <span className={classNames(`${preCls}__title-again`, { [`${preCls}__title-again--show`]: image },{ [`${preCls}__title-again--hover`]: isEnter })}>
217
- 重新上传
218
+ {getLocale('Set_PI_Reupload')}
218
219
  </span>
219
220
  <ConditionRender condition={type === 'person'}>
220
221
  <span className={`${preCls}__title-preview`}>{item?.previewTitle}</span>
@@ -64,13 +64,13 @@ const BaseInfo: FC = () => {
64
64
  </span>
65
65
  </div>
66
66
  <div className={`${prefix}__form`}>
67
- <div className={`${prefix}__form-title`}>手机号码</div>
67
+ <div className={`${prefix}__form-title`}>{getLocale('Set_PI_PhoneNumber')}</div>
68
68
  <span className={`${prefix}__form-value`}>
69
69
  {userInfo.mobile ? userInfo.mobile : getLocale('Data_Notset')}
70
70
  </span>
71
71
  </div>
72
72
  <div className={`${prefix}__form`}>
73
- <div className={`${prefix}__form-title`}>电子邮箱</div>
73
+ <div className={`${prefix}__form-title`}>{getLocale('Set_PI_Email')}</div>
74
74
  <span className={`${prefix}__form-value`}>
75
75
  {userInfo.email ? userInfo.email : getLocale('Data_Notset')}
76
76
  </span>
@@ -88,7 +88,7 @@ const EditBaseInfo = (props) => {
88
88
  width={480}
89
89
  mask
90
90
  centered
91
- title={"基本信息设置"}
91
+ title={getLocale('Set_PI_BasicInSettings')}
92
92
  noHeadLine
93
93
  maskClosable={false}
94
94
  onClose={() => {
@@ -127,7 +127,7 @@ const EditBaseInfo = (props) => {
127
127
  test: /^[\s\S]+$/,
128
128
  },
129
129
  {
130
- tip: "姓名只能为中文,英文字母和数字及下划线的组合",
130
+ tip: getLocale('Set_PI_Thenameonly'),
131
131
  test: /^((?!(\uff08|\uff09)).)*$/g,
132
132
  },
133
133
  {
@@ -141,18 +141,18 @@ const EditBaseInfo = (props) => {
141
141
  <Fields.Input
142
142
  name="phone"
143
143
  type="text"
144
- label={"手机号码"}
144
+ label={getLocale('Set_PI_PhoneNumber')}
145
145
  placeholder={getLocale('Pro_page_Ext_Tab_PhoneNumber')}
146
146
  require
147
147
  layout="row"
148
148
  value={userInfo.mobile}
149
149
  verifies={[
150
150
  {
151
- tip: "手机号不能为空",
151
+ tip: getLocale('OKR_MyO_Ew_MobileNum'),
152
152
  test: /^[\s\S]+$/,
153
153
  },
154
154
  {
155
- tip: "格式错误,海外手机格式如:(+852)52345678",
155
+ tip: getLocale('OKR_MyO_Ew_FormatErr'),
156
156
  test: /^1[3456789]\d{9}$/,
157
157
  },
158
158
  ]}
@@ -32,6 +32,7 @@
32
32
  }
33
33
  }
34
34
  &__main {
35
+ position: relative;
35
36
  display: flex;
36
37
  align-items: center;
37
38
  &-mask {
@@ -41,11 +42,23 @@
41
42
  box-sizing: border-box;
42
43
  padding: 7px 52px;
43
44
  background: rgba(20, 28, 40, 0.5);
44
- // filter: blur(4px);
45
45
  font-size: 12px;
46
46
  color: #FFFFFF;
47
47
  line-height: 18px;
48
48
  }
49
+ &-change {
50
+ position: absolute;
51
+ bottom: 7px;
52
+ width: 160px;
53
+ height: 32px;
54
+ color: #FFFFFF;
55
+ font-size: 12px;
56
+ line-height: 18px;
57
+ text-align: center;
58
+ box-sizing: border-box;
59
+ padding: 7px 0;
60
+ cursor: pointer;
61
+ }
49
62
  &-tip {
50
63
  margin-left: 32px;
51
64
  font-size: 12px;
@@ -73,7 +86,7 @@
73
86
  position: absolute;
74
87
  bottom:0;
75
88
  display: block;
76
- content: "点击修改";
89
+ content: "";
77
90
  width: 160px;
78
91
  height: 32px;
79
92
  background: rgba(20, 28, 40, 0.5);
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
2
2
  import { getUserInfo } from '../../../../utils/bs-global';
3
3
  import Avatar from '../../../../components/avatar';
4
4
  import ChangePhotoModal from '../../../../components/upload-photo-modal';
5
+ import { getLocale } from '../../../../utils/getLocale';
5
6
  import './index.scss';
6
7
 
7
8
  const prefix = 'titaui-personal-info-person-photo';
@@ -32,7 +33,7 @@ const PersonPhoto = () => {
32
33
  return (
33
34
  <div className={prefix}>
34
35
  <div className={`${prefix}__header`}>
35
- <span className={`${prefix}__header-title`}>上传头像</span>
36
+ <span className={`${prefix}__header-title`}>{getLocale('Set_PI_Uploadavatar')}</span>
36
37
  </div>
37
38
  <div className={`${prefix}__main`}>
38
39
  <Avatar
@@ -47,7 +48,8 @@ const PersonPhoto = () => {
47
48
  }}
48
49
  onClick={handleChangePhoto}
49
50
  />
50
- <span className={`${prefix}__main-tip`}>建议图片最小尺寸 150*150px</span>
51
+ <div className={`${prefix}__main-change`} onClick={handleChangePhoto}>{getLocale('Set_PI_Clicktomodify')}</div>
52
+ <span className={`${prefix}__main-tip`}>{getLocale('Set_PI_Suggestedsize')} 150*150px</span>
51
53
  </div>
52
54
  <ChangePhotoModal visible={visible} onCancel={handleCancel} type="person" handleSuccessUploadPhoto={handleSuccessUploadPhoto}/>
53
55
  </div>
@@ -0,0 +1,18 @@
1
+ import { getLocale } from "./getLocale";
2
+
3
+ export const getMonth = () => {
4
+ return [
5
+ getLocale("Mod_Jan"),
6
+ getLocale("Mod_Feb"),
7
+ getLocale("Mod_Mar"),
8
+ getLocale("Mod_Apr"),
9
+ getLocale("Mod_May"),
10
+ getLocale("Mod_Jun"),
11
+ getLocale("Mod_Jul"),
12
+ getLocale("Mod_Aug"),
13
+ getLocale("Mod_Sept"),
14
+ getLocale("Mod_Oct"),
15
+ getLocale("Mod_Nov"),
16
+ getLocale("Mod_Dec"),
17
+ ];
18
+ };
@@ -1,9 +1,13 @@
1
- import { getLocale } from "./getLocale";
1
+ import { getMonth } from "./constant";
2
+ import { getLocale, isEn } from "./getLocale";
2
3
 
3
4
  export const getTimeString = (time: string, nowTime): string => {
4
5
  if (!time) {
5
6
  return getLocale('OKR_MyO_KRP_Notupdated');
6
7
  }
8
+
9
+ const months = getMonth();
10
+
7
11
  const timeDateObj = new Date(time);
8
12
  const timeMilliSecond = timeDateObj.getTime();
9
13
  const timeYear = timeDateObj.getFullYear();
@@ -21,26 +25,28 @@ export const getTimeString = (time: string, nowTime): string => {
21
25
  return getLocale('Pro_page_Int_Justnow');
22
26
  }
23
27
  if (secondDiff < 60) {
24
- return `${secondDiff}秒前`;
28
+ return `${secondDiff}${getLocale('Mood_secago')}`;
25
29
  }
26
30
  if (secondDiff < 60 * 60) {
27
- return `${Math.floor(secondDiff / 60)}分钟前`;
31
+ return `${Math.floor(secondDiff / 60)}${getLocale('Tasks_Tab_MyS_minuteago')}`;
28
32
  }
29
33
  if (secondDiff < 60 * 60 * 24) {
30
- return `${Math.floor(secondDiff / (60 * 60))}小时前`;
34
+ return `${Math.floor(secondDiff / (60 * 60))}${getLocale('Mood_hoursago')}`;
31
35
  }
32
36
  if (secondDiff < 60 * 60 * 24 * 2 && nowDate - 1 === timeDate) {
33
37
  return `${getLocale('OKR_MyO_Pr_Text_Yesterday')} ${timeHours + ":" + timeMinutes}`;
34
38
  }
35
39
  if (secondDiff < 60 * 60 * 24 * 3 && nowDate - 2 === timeDate) {
36
- return `前天 ${timeHours + ":" + timeMinutes}`;
40
+ return `${getLocale('Mood_2daysago')} ${timeHours + ":" + timeMinutes}`;
37
41
  }
38
42
  if (timeYear === nowYear) {
39
- return `${timeMonth}月${timeDate} ${
43
+ const dateStr = months[timeMonth-1] + (isEn ? ` ${timeDate} ` : `${timeDate}日`)
44
+ return `${dateStr} ${
40
45
  timeHours < 10 ? "0" + timeHours : timeHours
41
46
  }:${timeMinutes < 10 ? "0" + timeMinutes : timeMinutes}`;
42
47
  }
43
- return `${timeYear}年${timeMonth}月${timeDate} ${
48
+ const dateStr = (isEn ? '' : `${timeYear}年`) + months[timeMonth-1] + (isEn ? ` ${timeDate} ` : `${timeDate}日`) + (isEn ? `,${timeYear}` : '');
49
+ return `${dateStr} ${
44
50
  timeHours < 10 ? "0" + timeHours : timeHours
45
51
  }:${timeMinutes < 10 ? "0" + timeMinutes : timeMinutes}`;
46
52
  };