@titaui/pc 1.8.3 → 1.8.7

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.
@@ -159,7 +159,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
159
159
  });
160
160
  return /*#__PURE__*/_react["default"].createElement("div", {
161
161
  className: (0, _classnames["default"])(preCls, _defineProperty({}, "".concat(preCls, "-row"), layout === 'row'), className)
162
- }, /*#__PURE__*/_react["default"].createElement("div", {
162
+ }, !!label && /*#__PURE__*/_react["default"].createElement("div", {
163
163
  className: (0, _classnames["default"])("".concat(preCls, "__label"))
164
164
  }, /*#__PURE__*/_react["default"].createElement("span", {
165
165
  className: (0, _classnames["default"])("".concat(preCls, "__label-text"))
@@ -1,7 +1,5 @@
1
1
  .titaui-nav-top-version__version-info {
2
- width: 120px;
3
2
  height: 24px;
4
- background: url("../../images/version.png") no-repeat;
5
3
  background-size: 120px 24px;
6
4
  margin-right: 20px;
7
5
  font-size: 12px;
@@ -15,8 +13,18 @@
15
13
 
16
14
  .titaui-nav-top-version__version-info-name {
17
15
  margin-left: 8px;
16
+ background: linear-gradient(0deg, #FFC449 0%, #FFEFCD 53%, #FFC74B 100%);
17
+ border-radius: 12px;
18
+ padding: 3px 10px 3px 8px;
19
+ position: relative;
20
+ z-index: 2;
18
21
  }
19
22
 
20
23
  .titaui-nav-top-version__version-info-countdown {
21
- margin-left: 16px;
24
+ background: linear-gradient(90deg, #FFAA00 0%, #FFE099 100%);
25
+ box-shadow: 0px 0px 4px #ffffff inset;
26
+ border-radius: 0 12px 12px 0;
27
+ filter: blur(0px);
28
+ margin-left: -10px;
29
+ padding: 3px 8px 3px 16px;
22
30
  }
@@ -17,8 +17,6 @@ var _constant = require("../../../version-change-modal/constant");
17
17
 
18
18
  var _constant2 = require("../../constant");
19
19
 
20
- var _getLocale = require("../../../../utils/getLocale");
21
-
22
20
  require("./index.css");
23
21
 
24
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -27,6 +25,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
27
25
 
28
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; }
29
27
 
28
+ var i18nInfo = (0, _bsGlobal.getBSGlobal)("I18NInfo");
29
+ var isEn = i18nInfo && i18nInfo.I18NOpen && i18nInfo.I18NUserLang === "en_US";
30
30
  var prefix = "titaui-nav-top-version";
31
31
 
32
32
  var Version = function Version() {
@@ -44,9 +44,9 @@ var Version = function Version() {
44
44
  onClick: handleShowVersionSelector
45
45
  }, /*#__PURE__*/_react["default"].createElement("span", {
46
46
  className: "".concat(prefix, "__version-info-name")
47
- }, _constant2.versionTextMap[versionInfo.MenuVersion || _constant.Versions.Flagship]), /*#__PURE__*/_react["default"].createElement("span", {
47
+ }, (0, _constant2.getVersionTextMap)()[versionInfo.MenuVersion || _constant.Versions.Flagship]), /*#__PURE__*/_react["default"].createElement("span", {
48
48
  className: "".concat(prefix, "__version-info-countdown")
49
- }, (0, _getLocale.getLocale)('OKR_MyO_E_Remaining'), versionInfo.Day, "\u5929")), /*#__PURE__*/_react["default"].createElement(_versionChangeModal["default"], {
49
+ }, isEn ? "".concat(versionInfo.Day, " day(s)") : "\u5269\u4F59".concat(versionInfo.Day, "\u5929"))), /*#__PURE__*/_react["default"].createElement(_versionChangeModal["default"], {
50
50
  ref: versionChangeModalRef
51
51
  }));
52
52
  };
@@ -3,14 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.versionTextMap = exports.userId = exports.tm = exports.popupAlignPhoto = exports.apiServer = void 0;
6
+ exports.userId = exports.tm = exports.popupAlignPhoto = exports.getVersionTextMap = exports.apiServer = void 0;
7
+
8
+ var _getLocale = require("../../utils/getLocale");
7
9
 
8
10
  var _bsGlobal = require("../../utils/bs-global");
9
11
 
10
12
  var _constant = require("../version-change-modal/constant");
11
13
 
12
- var _versionTextMap;
13
-
14
14
  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; }
15
15
 
16
16
  var userId = (0, _bsGlobal.getUserInfo)().Id;
@@ -28,5 +28,11 @@ var popupAlignPhoto = {
28
28
  targetOffset: [0, 0]
29
29
  };
30
30
  exports.popupAlignPhoto = popupAlignPhoto;
31
- var versionTextMap = (_versionTextMap = {}, _defineProperty(_versionTextMap, _constant.Versions.Standard, "项目版"), _defineProperty(_versionTextMap, _constant.Versions.WeixinAssess, "绩效版"), _defineProperty(_versionTextMap, _constant.Versions.Professional, "OKR版"), _defineProperty(_versionTextMap, _constant.Versions.Flagship, "旗舰版"), _versionTextMap);
32
- exports.versionTextMap = versionTextMap;
31
+
32
+ var getVersionTextMap = function getVersionTextMap() {
33
+ var _ref;
34
+
35
+ return _ref = {}, _defineProperty(_ref, _constant.Versions.Standard, (0, _getLocale.getLocale)('Sw_ProEdit')), _defineProperty(_ref, _constant.Versions.WeixinAssess, (0, _getLocale.getLocale)('Sw_PerEdit')), _defineProperty(_ref, _constant.Versions.Professional, (0, _getLocale.getLocale)('Sw_OKREdit')), _defineProperty(_ref, _constant.Versions.Flagship, (0, _getLocale.getLocale)('Sw_Flagship')), _ref;
36
+ };
37
+
38
+ exports.getVersionTextMap = getVersionTextMap;
@@ -98,11 +98,11 @@ var formatPeriod = function formatPeriod(selected) {
98
98
  break;
99
99
 
100
100
  case "3":
101
- cycleDate = "".concat(isEn ? month[Number(selected.yqmNum) - 1] : selected.yqmNum + "月");
101
+ cycleDate = month[Number(selected.yqmNum) - 1];
102
102
  break;
103
103
 
104
104
  case "4":
105
- cycleDate = "".concat(month[Number(selected.yqmNum) - 1], " - ").concat(month[((Number(selected.yqmNum) + 1) % 12 || 12) - 1]).concat(isEn ? '' : '月');
105
+ cycleDate = "".concat(month[Number(selected.yqmNum) - 1], " - ").concat(month[((Number(selected.yqmNum) + 1) % 12 || 12) - 1]);
106
106
  break;
107
107
 
108
108
  case "5":
@@ -9,6 +9,7 @@
9
9
  .tita-pc__table {
10
10
  width: 100%;
11
11
  overflow: auto;
12
+ min-height: 200px;
12
13
  }
13
14
 
14
15
  .tita-pc__table-pagination {
@@ -7,23 +7,29 @@ exports.List = void 0;
7
7
  var List = [{
8
8
  id: 'person',
9
9
  accept: '.jpg,.jpeg,.gif,.png',
10
- autoCropArea: 0.5,
10
+ autoCropArea: 1,
11
11
  initialAspectRatio: 1,
12
12
  tips: '仅支持 jpg、jpeg、gif、png 格式 建议图片最小尺寸 150*150px',
13
- previewTitle: '预览'
13
+ previewTitle: '预览',
14
+ minCropBoxHeight: 200,
15
+ minCropBoxWidth: 200
14
16
  }, {
15
17
  id: 'enterprise',
16
18
  accept: '.jpg,.jpeg,.gif,.png',
17
19
  autoCropArea: 1,
18
20
  initialAspectRatio: 5,
19
21
  tips: '建议 logo 尺寸 400*80 logo 最佳适配颜色为白色 仅支持 jpg、jpeg、gif、png 格式',
20
- previewTitle: 'logo 预览'
22
+ previewTitle: 'logo 预览',
23
+ minCropBoxHeight: 20,
24
+ minCropBoxWidth: 20
21
25
  }, {
22
26
  id: 'browser',
23
27
  accept: '',
24
28
  autoCropArea: 0.5,
25
29
  initialAspectRatio: 1,
26
30
  tips: '图标尺寸 18*18,超过将被浏览器压缩',
27
- previewTitle: '浏览器图标预览'
31
+ previewTitle: '浏览器图标预览',
32
+ minCropBoxHeight: 20,
33
+ minCropBoxWidth: 20
28
34
  }];
29
35
  exports.List = List;
@@ -27,8 +27,6 @@ var _constant = require("./constant");
27
27
 
28
28
  require("./index.css");
29
29
 
30
- var _uuid = _interopRequireDefault(require("uuid"));
31
-
32
30
  var _bsGlobal = require("../../utils/bs-global");
33
31
 
34
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -37,10 +35,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
37
35
 
38
36
  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; }
39
37
 
40
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
41
-
42
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
43
-
44
38
  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; }
45
39
 
46
40
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -82,28 +76,21 @@ var ChangePhoto = function ChangePhoto(props) {
82
76
  cropData = _useState6[0],
83
77
  setCropData = _useState6[1];
84
78
 
85
- var _useState7 = (0, _react.useState)({
86
- Avatar: ''
87
- }),
88
- _useState8 = _slicedToArray(_useState7, 2),
89
- userInfo = _useState8[0],
90
- setUserInfo = _useState8[1];
91
-
92
- var _useState9 = (0, _react.useState)(_constant.List.find(function (item) {
79
+ var _useState7 = (0, _react.useState)(_constant.List.find(function (item) {
93
80
  return item.id === type;
94
81
  })),
95
- _useState10 = _slicedToArray(_useState9, 1),
96
- item = _useState10[0];
82
+ _useState8 = _slicedToArray(_useState7, 1),
83
+ item = _useState8[0];
97
84
 
98
- var _useState11 = (0, _react.useState)(false),
99
- _useState12 = _slicedToArray(_useState11, 2),
100
- isEnter = _useState12[0],
101
- setIsEnter = _useState12[1];
85
+ var _useState9 = (0, _react.useState)(false),
86
+ _useState10 = _slicedToArray(_useState9, 2),
87
+ isEnter = _useState10[0],
88
+ setIsEnter = _useState10[1];
102
89
 
103
- var _useState13 = (0, _react.useState)(''),
104
- _useState14 = _slicedToArray(_useState13, 2),
105
- fileName = _useState14[0],
106
- setFileName = _useState14[1];
90
+ var _useState11 = (0, _react.useState)(''),
91
+ _useState12 = _slicedToArray(_useState11, 2),
92
+ fileName = _useState12[0],
93
+ setFileName = _useState12[1];
107
94
 
108
95
  var cropperRef = (0, _react.useRef)(null);
109
96
 
@@ -147,19 +134,14 @@ var ChangePhoto = function ChangePhoto(props) {
147
134
  var imageElement = cropperRef.current;
148
135
  var cropper = imageElement.cropper;
149
136
  setCropData(cropper.getCroppedCanvas().toDataURL());
150
- setUserInfo(cropper.getCroppedCanvas().toDataURL());
151
137
  var base64Url = cropper.getCroppedCanvas().toDataURL();
152
138
  var newFile = dataURLtoFile(base64Url, fileName);
153
- console.log(newFile);
154
139
  var formData = new FormData();
155
140
  formData.append('file', newFile);
156
- console.log(formData);
157
141
  setCropper(formData);
158
142
  };
159
143
 
160
144
  var handleSaveInfo = function handleSaveInfo() {
161
- var timestamp = new Date().getTime(); // 给每个文件加一个时间戳
162
-
163
145
  if (!image) {
164
146
  return;
165
147
  } else {
@@ -178,7 +160,6 @@ var ChangePhoto = function ChangePhoto(props) {
178
160
  }
179
161
  });
180
162
  } else if (type === "enterprise") {
181
- // console.log(cropper);
182
163
  (0, _requestApi.saveTenantLogo)(cropper).then(function (resp) {
183
164
  if (resp.Code === 1) {
184
165
  _toast["default"].Success('保存成功', {
@@ -191,13 +172,7 @@ var ChangePhoto = function ChangePhoto(props) {
191
172
  canClose: false
192
173
  });
193
174
  }
194
- }); // axios({headers: {
195
- // 'Content-Type': 'multipart/form-data',
196
- // },
197
- // method: 'post',
198
- // data: cropper,
199
- // url: `${apiServer}/api/v1/${tenantId}/${userid}/tenant/update/logo?format=json&timestamp=${timestamp}`})
200
- // dealSelectFiles(image)
175
+ });
201
176
  } else {
202
177
  (0, _requestApi.saveBrowserIcon)(cropper).then(function (resp) {
203
178
  if (resp.Code === 1) {
@@ -216,83 +191,6 @@ var ChangePhoto = function ChangePhoto(props) {
216
191
  }
217
192
  };
218
193
 
219
- var _useState15 = (0, _react.useState)(),
220
- _useState16 = _slicedToArray(_useState15, 2),
221
- uploadSuccessFile = _useState16[0],
222
- setUploadSuccessFile = _useState16[1];
223
-
224
- var dealSelectFiles = function dealSelectFiles(uploadSelectFile) {
225
- var uploadStartFiles = []; // 开始上传的文件
226
-
227
- var formData = new FormData(); // FormData 对象
228
-
229
- var uploadStartFile;
230
- var timestamp = new Date().getTime(); // 给每个文件加一个时间戳
231
- // let uploadFileType = uploadSelectFile.name.substring(uploadSelectFile.name.lastIndexOf('.') + 1);
232
-
233
- uploadStartFile = {
234
- FileName: uploadSelectFile.name,
235
- // FileType: _dealAttachmentType(uploadFileType).FileType,
236
- FileSize: uploadSelectFile.size,
237
- FileLastModified: uploadSelectFile.lastModified,
238
- // IsImage: _dealAttachmentType(uploadFileType).IsImage,
239
- percentComplete: 0,
240
- uploadStatus: 1,
241
- // 开始上传
242
- IsSuccess: false,
243
- uid: (0, _uuid["default"])(),
244
- _smallImageUrl: '',
245
- _bigImageUrl: '',
246
- MediaType: '',
247
- UserId: 0,
248
- MaxDocCount: 0,
249
- DfsPath: '',
250
- ClientUrl: '',
251
- SmallImageUrl: '',
252
- BigImageUrl: '',
253
- DownloadUrl: '',
254
- Msg: '',
255
- AllowUploadAttachmentSize: 50,
256
- Deleteable: true,
257
- requestXHR: new XMLHttpRequest() //在这创建是为了取消用
258
-
259
- }; // uploadStartFiles.push(uploadStartFile);
260
- // _dealUploadStart(uploadStartFiles); // 处理开始上传的文件
261
-
262
- formData.append('file', uploadSelectFile);
263
- var url = "".concat(apiServer, "/api/v1/").concat(tenantId, "/").concat(userid, "/tenant/update/logo");
264
-
265
- _dealUploadXHRRequest(formData, url, uploadStartFile);
266
- };
267
- /**
268
- * 处理文件上传请求
269
- *
270
- * @formData
271
- * @url 上传文件请求地址
272
- * @uploadStartFile 上传的文件
273
- *
274
- * @memberof Upload
275
- */
276
-
277
-
278
- var _dealUploadXHRRequest = function _dealUploadXHRRequest(formData, url, uploadStartFile) {
279
- var xhr = uploadStartFile.requestXHR;
280
-
281
- xhr.onreadystatechange = function () {
282
- if (xhr.readyState == 4 && xhr.status == 200) {
283
- var result = Object.assign({}, _objectSpread({}, JSON.parse(xhr.responseText).Result[0])); // 上传成功接口返回数据
284
-
285
- result.percentComplete = 100;
286
- result.IsSuccess = !!result.IsSuccess;
287
- result.uploadStatus = result.IsSuccess ? 3 : 4; // 3上传成功;4上传失败
288
- // _dealUploadSuccess({ ...uploadStartFile, ...result });
289
- }
290
- };
291
-
292
- xhr.open('POST', url, true);
293
- xhr.send(formData); //开始上传,发送form数据
294
- };
295
-
296
194
  var handleEnterAgain = function handleEnterAgain() {
297
195
  setIsEnter(true);
298
196
  };
@@ -378,15 +276,12 @@ var ChangePhoto = function ChangePhoto(props) {
378
276
  responsive: true,
379
277
  autoCropArea: item === null || item === void 0 ? void 0 : item.autoCropArea,
380
278
  checkOrientation: true,
381
- minCropBoxHeight: 10,
382
- minCropBoxWidth: 10,
279
+ minCropBoxHeight: item === null || item === void 0 ? void 0 : item.minCropBoxHeight,
280
+ minCropBoxWidth: item === null || item === void 0 ? void 0 : item.minCropBoxWidth,
383
281
  initialAspectRatio: item === null || item === void 0 ? void 0 : item.initialAspectRatio,
384
282
  guides: true,
385
283
  preview: ".img-preview",
386
- ref: cropperRef // onInitialized={(instance) => {
387
- // setCropper(instance);
388
- // }}
389
- ,
284
+ ref: cropperRef,
390
285
  crop: onCrop
391
286
  }), /*#__PURE__*/_react["default"].createElement("div", {
392
287
  className: (0, _classnames["default"])("".concat(preCls, "__preview-box"), _defineProperty({}, "".concat(preCls, "__preview-box-bgc"), type === "enterprise"), _defineProperty({}, "".concat(preCls, "__preview-box-browser"), type === "browser"))
@@ -21,30 +21,30 @@ exports.Versions = Versions;
21
21
  var getVersionList = function getVersionList() {
22
22
  return [{
23
23
  version: Versions.Standard,
24
- name: "项目管理版",
24
+ name: (0, _getLocale.getLocale)("Sw_ProEdition"),
25
25
  color: "blue",
26
26
  image: require("./images/project.png"),
27
- items: [(0, _getLocale.getLocale)('Pro_card_ProjectMilestone'), "项目看板管理", "项目任务分解", "项目报表统计", "工作计划&统计"]
27
+ items: [(0, _getLocale.getLocale)("Pro_card_ProjectMilestone"), (0, _getLocale.getLocale)("Sw_ProManagement"), (0, _getLocale.getLocale)("Sw_ProBreakdown"), (0, _getLocale.getLocale)("Sw_RepStatistics"), (0, _getLocale.getLocale)("Sw_WorkStatistics")]
28
28
  }, {
29
29
  version: Versions.WeixinAssess,
30
- name: "绩效考核版",
30
+ name: (0, _getLocale.getLocale)("Sw_PerformEdition"),
31
31
  color: "blue",
32
32
  image: require("./images/performance.png"),
33
- items: [(0, _getLocale.getLocale)('Per_Menu_Title_Assessmenttempla'), (0, _getLocale.getLocale)('Per_Menu_Title_AssessmentMana'), "360 评价", "绩效统计", "绩效结果校准"]
33
+ items: [(0, _getLocale.getLocale)("Per_Menu_Title_Assessmenttempla"), (0, _getLocale.getLocale)("Per_Menu_Title_AssessmentMana"), (0, _getLocale.getLocale)("Sw_360Feedback"), (0, _getLocale.getLocale)('Sw_PeStatistics'), (0, _getLocale.getLocale)('Sw_PerCalibration')]
34
34
  }, {
35
35
  version: Versions.Professional,
36
- name: "OKRs-E 专业版",
36
+ name: (0, _getLocale.getLocale)('Sw_OKRsEdition'),
37
37
  // subName:'包含以下 2 个版本全部功能',
38
38
  color: "yellow",
39
39
  image: require("./images/okre.png"),
40
- items: ["OKR 目标管理版", "OKR 目标地图", (0, _getLocale.getLocale)('OKR_Menu_Title_OKRWork'), (0, _getLocale.getLocale)('OKR_Menu_Title_Dashboard'), "项目与计划管理"]
40
+ items: [(0, _getLocale.getLocale)('Sw_OKRManagement'), (0, _getLocale.getLocale)('Sw_OKRAlignment'), (0, _getLocale.getLocale)("OKR_Menu_Title_OKRWork"), (0, _getLocale.getLocale)("OKR_Menu_Title_Dashboard"), (0, _getLocale.getLocale)('Sw_ProjectsPrograms')]
41
41
  }, {
42
42
  version: Versions.Flagship,
43
- name: "旗舰版",
44
- subName: "包含以下 2 个版本全部功能",
43
+ name: (0, _getLocale.getLocale)('Sw_FlagshipEdit'),
44
+ subName: (0, _getLocale.getLocale)('Sw_Includes2s'),
45
45
  color: "green",
46
46
  image: require("./images/performancePlus.png"),
47
- items: ["OKRs-E 专业版", "绩效考核版"]
47
+ items: [(0, _getLocale.getLocale)('Sw_OKRsEdition'), (0, _getLocale.getLocale)('Sw_PerformEdition')]
48
48
  }];
49
49
  };
50
50
 
@@ -17,10 +17,12 @@ var _requestApi = require("./request-api");
17
17
 
18
18
  var _constant = require("./constant");
19
19
 
20
- require("./index.css");
21
-
22
20
  var _helpers = require("../../utils/helpers");
23
21
 
22
+ var _getLocale = require("../../utils/getLocale");
23
+
24
+ require("./index.css");
25
+
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
27
 
26
28
  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); }
@@ -186,7 +188,7 @@ var VersionChangeModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
186
188
  }
187
189
  }, _callee2);
188
190
  }))
189
- }, "\u514D\u8D39\u8BD5\u7528")));
191
+ }, (0, _getLocale.getLocale)('Sw_FreeTrial'))));
190
192
  })))));
191
193
  });
192
194
  var _default = VersionChangeModal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.8.3",
3
+ "version": "1.8.7",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "src/index.js",
@@ -110,10 +110,10 @@ export default forwardRef((props: Props, ref) => {
110
110
  }))
111
111
 
112
112
  return <div className={classNames(preCls,{[`${preCls}-row`]:layout==='row'},className)}>
113
- <div className={classNames(`${preCls}__label`)}>
113
+ {!!label && <div className={classNames(`${preCls}__label`)}>
114
114
  <span className={classNames(`${preCls}__label-text`)}>{label}</span>
115
115
  {require && <span className={classNames(`${preCls}__label-require`)}>*</span>}
116
- </div>
116
+ </div>}
117
117
  <div className={classNames(`${preCls}__border`, {
118
118
  [`${preCls}__border--error`]: hasError,
119
119
  [`${preCls}__border--active`]: hasActive,
@@ -1,8 +1,6 @@
1
1
  .titaui-nav-top-version {
2
2
  &__version-info {
3
- width: 120px;
4
3
  height: 24px;
5
- background: url("../../images/version.png") no-repeat;
6
4
  background-size: 120px 24px;
7
5
  margin-right: 20px;
8
6
  font-size: 12px;
@@ -14,9 +12,19 @@
14
12
  cursor: pointer;
15
13
  &-name {
16
14
  margin-left: 8px;
15
+ background: linear-gradient(0deg, #FFC449 0%, #FFEFCD 53%, #FFC74B 100%);
16
+ border-radius: 12px;
17
+ padding: 3px 10px 3px 8px;
18
+ position: relative;
19
+ z-index: 2;
17
20
  }
18
21
  &-countdown {
19
- margin-left: 16px;
22
+ background: linear-gradient(90deg, #FFAA00 0%, #FFE099 100%);
23
+ box-shadow: 0px 0px 4px #ffffff inset;
24
+ border-radius: 0 12px 12px 0;
25
+ filter: blur(0px);
26
+ margin-left: -10px;
27
+ padding: 3px 8px 3px 16px;
20
28
  }
21
29
  }
22
30
  }
@@ -2,10 +2,12 @@ import React, { FC, useRef } from "react";
2
2
  import { getBSGlobal } from "../../../../utils/bs-global";
3
3
  import VersionChangeModal from "../../../version-change-modal";
4
4
  import { Versions } from "../../../version-change-modal/constant";
5
- import { versionTextMap } from "../../constant";
6
- import { getLocale } from "../../../../utils/getLocale";
5
+ import { getVersionTextMap } from "../../constant";
7
6
  import "./index.scss";
8
7
 
8
+ const i18nInfo = getBSGlobal("I18NInfo");
9
+ const isEn = i18nInfo && i18nInfo.I18NOpen && i18nInfo.I18NUserLang === "en_US";
10
+
9
11
  const prefix = "titaui-nav-top-version";
10
12
 
11
13
  const Version: FC = () => {
@@ -23,8 +25,8 @@ const Version: FC = () => {
23
25
  className={`${prefix}__version-info`}
24
26
  onClick={handleShowVersionSelector}
25
27
  >
26
- <span className={`${prefix}__version-info-name`}>{versionTextMap[versionInfo.MenuVersion || Versions.Flagship]}</span>
27
- <span className={`${prefix}__version-info-countdown`}>{getLocale('OKR_MyO_E_Remaining')}{versionInfo.Day}天</span>
28
+ <span className={`${prefix}__version-info-name`}>{getVersionTextMap()[versionInfo.MenuVersion || Versions.Flagship]}</span>
29
+ <span className={`${prefix}__version-info-countdown`}>{isEn ? `${versionInfo.Day} day(s)` : `剩余${versionInfo.Day}天`}</span>
28
30
  </div>
29
31
  <VersionChangeModal
30
32
  ref={versionChangeModalRef}
@@ -1,5 +1,5 @@
1
+ import { getLocale } from "../../utils/getLocale";
1
2
  import { getUserInfo, getBSGlobal } from "../../utils/bs-global";
2
-
3
3
  import { Versions } from "../version-change-modal/constant";
4
4
 
5
5
  export const userId = getUserInfo().Id;
@@ -12,9 +12,9 @@ export const popupAlignPhoto = {
12
12
  targetOffset: [0, 0],
13
13
  };
14
14
 
15
- export const versionTextMap = {
16
- [Versions.Standard]: "项目版",
17
- [Versions.WeixinAssess]: "绩效版",
18
- [Versions.Professional]: "OKR版",
19
- [Versions.Flagship]: "旗舰版",
20
- };
15
+ export const getVersionTextMap = () => ({
16
+ [Versions.Standard]: getLocale('Sw_ProEdit'),
17
+ [Versions.WeixinAssess]: getLocale('Sw_PerEdit'),
18
+ [Versions.Professional]: getLocale('Sw_OKREdit'),
19
+ [Versions.Flagship]: getLocale('Sw_Flagship'),
20
+ });
@@ -84,12 +84,12 @@ export const formatPeriod = (selected: SelectedInterface) => {
84
84
  cycleDate = quarter[Number(selected.yqmNum)];
85
85
  break;
86
86
  case "3":
87
- cycleDate = `${isEn ? month[Number(selected.yqmNum) - 1] : selected.yqmNum + "月"}`;
87
+ cycleDate = month[Number(selected.yqmNum) - 1];
88
88
  break;
89
89
  case "4":
90
90
  cycleDate = `${month[Number(selected.yqmNum)-1]} - ${
91
91
  month[((Number(selected.yqmNum) + 1) % 12 || 12)-1]
92
- }${isEn ? '' : '月'}`;
92
+ }`;
93
93
  break;
94
94
  case "5":
95
95
  cycleDate = selected.yqmNum == "1" ? `${getLocale('OKR_MyO_Pop_Firsthalf')}` : `${getLocale('OKR_MyO_Pop_Secondhalf')}`;
@@ -9,6 +9,7 @@
9
9
  &__table {
10
10
  width: 100%;
11
11
  overflow: auto;
12
+ min-height: 200px;
12
13
  &-pagination {
13
14
  padding: 10px 0 0 0;
14
15
  display: flex;
@@ -3,10 +3,12 @@ export const List = [
3
3
  {
4
4
  id: 'person',
5
5
  accept: '.jpg,.jpeg,.gif,.png',
6
- autoCropArea: 0.5,
6
+ autoCropArea: 1,
7
7
  initialAspectRatio: 1,
8
8
  tips: '仅支持 jpg、jpeg、gif、png 格式 建议图片最小尺寸 150*150px',
9
9
  previewTitle: '预览',
10
+ minCropBoxHeight: 200,
11
+ minCropBoxWidth: 200,
10
12
  },
11
13
  {
12
14
  id: 'enterprise',
@@ -15,6 +17,8 @@ export const List = [
15
17
  initialAspectRatio: 5,
16
18
  tips: '建议 logo 尺寸 400*80 logo 最佳适配颜色为白色 仅支持 jpg、jpeg、gif、png 格式',
17
19
  previewTitle: 'logo 预览',
20
+ minCropBoxHeight: 20,
21
+ minCropBoxWidth: 20,
18
22
  },
19
23
  {
20
24
  id: 'browser',
@@ -23,5 +27,7 @@ export const List = [
23
27
  initialAspectRatio: 1,
24
28
  tips: '图标尺寸 18*18,超过将被浏览器压缩',
25
29
  previewTitle: '浏览器图标预览',
30
+ minCropBoxHeight: 20,
31
+ minCropBoxWidth: 20,
26
32
  }
27
33
  ];
@@ -4,13 +4,11 @@ import Cropper from 'react-cropper';
4
4
  import 'cropperjs/dist/cropper.css';
5
5
  import Toast from '../../components/toast';
6
6
  import ConditionRender from '../condition-render';
7
- import { saveUserInfo, saveTenantLogo, saveBrowserIcon, saveUserPhoto } from './request-api';
7
+ import { saveTenantLogo, saveBrowserIcon, saveUserPhoto } from './request-api';
8
8
  import Dialog from '../../components/dialog';
9
9
  import { List } from './constant'
10
10
  import './index.scss';
11
11
  import uuid from 'uuid';
12
- import { rput, rpost } from "../../utils/request";
13
- import axios from 'axios';
14
12
  import { getBSGlobal, getUserInfo, getTenantInfo } from '../../utils/bs-global';
15
13
  const apiServer = getBSGlobal("apiPath")
16
14
  const userid = getUserInfo().Id;
@@ -33,25 +31,24 @@ const ChangePhoto = (props: Props) => {
33
31
  const [ image, setImage ] = useState('');
34
32
  const [ cropper, setCropper ] = useState<any>();
35
33
  const [ cropData, setCropData ] = useState('#');
36
- const [ userInfo, setUserInfo ] = useState({ Avatar: '' });
37
34
  const [item] = useState(List.find(item => item.id === type));
38
35
  const [isEnter, setIsEnter] = useState(false);
39
36
  const [fileName, setFileName] = useState('')
40
37
 
41
38
  const cropperRef = useRef<HTMLImageElement>(null);
42
39
 
43
- const onChange = (e: any) => {
40
+ const onChange = (e: any) => {
44
41
  e.preventDefault();
45
42
  let files;
46
43
  if (e.dataTransfer) {
47
44
  files = e.dataTransfer.files;
48
45
  } else if (e.target) {
49
46
  files = e.target.files;
50
- }
47
+ }
51
48
  setFileName(files[0].name)
52
49
  const reader = new FileReader();
53
50
  reader.onload = () => {
54
- setImage(reader.result as any);
51
+ setImage(reader.result as any);
55
52
  };
56
53
  reader.readAsDataURL(files[0]);
57
54
  };
@@ -67,30 +64,24 @@ const ChangePhoto = (props: Props) => {
67
64
  }
68
65
 
69
66
 
70
- const onCrop = () => {
71
-
67
+ const onCrop = () => {
72
68
  const imageElement: any = cropperRef.current;
73
- const cropper: any = imageElement.cropper;
69
+ const cropper: any = imageElement.cropper;
74
70
 
75
71
  setCropData(cropper.getCroppedCanvas().toDataURL());
76
- setUserInfo(cropper.getCroppedCanvas().toDataURL());
77
-
78
- let base64Url = cropper.getCroppedCanvas().toDataURL();
79
-
80
- const newFile = dataURLtoFile(base64Url, fileName);
81
- console.log(newFile);
82
72
 
73
+ let base64Url = cropper.getCroppedCanvas().toDataURL();
74
+
75
+ const newFile = dataURLtoFile(base64Url, fileName);
83
76
 
84
77
  let formData = new FormData();
85
78
 
86
79
  formData.append('file', newFile);
87
80
 
88
- console.log(formData);
89
81
  setCropper(formData);
90
82
  };
91
83
 
92
84
  const handleSaveInfo = () => {
93
- let timestamp = new Date().getTime(); // 给每个文件加一个时间戳
94
85
  if (!image) {
95
86
  return;
96
87
  } else {
@@ -104,7 +95,6 @@ const ChangePhoto = (props: Props) => {
104
95
  }
105
96
  });
106
97
  } else if(type === "enterprise") {
107
- // console.log(cropper);
108
98
  saveTenantLogo( cropper ).then((resp) => {
109
99
  if (resp.Code === 1) {
110
100
  Toast.Success('保存成功', { canClose: false });
@@ -113,13 +103,6 @@ const ChangePhoto = (props: Props) => {
113
103
  Toast.Error(resp.Message, { canClose: false });
114
104
  }
115
105
  });
116
- // axios({headers: {
117
- // 'Content-Type': 'multipart/form-data',
118
- // },
119
- // method: 'post',
120
- // data: cropper,
121
- // url: `${apiServer}/api/v1/${tenantId}/${userid}/tenant/update/logo?format=json&timestamp=${timestamp}`})
122
- // dealSelectFiles(image)
123
106
  } else {
124
107
  saveBrowserIcon( cropper ).then((resp) => {
125
108
  if (resp.Code === 1) {
@@ -133,74 +116,6 @@ const ChangePhoto = (props: Props) => {
133
116
  }
134
117
  };
135
118
 
136
- const [uploadSuccessFile, setUploadSuccessFile] = useState();
137
-
138
-
139
- const dealSelectFiles = (uploadSelectFile) => {
140
-
141
- let uploadStartFiles = []; // 开始上传的文件
142
- let formData = new FormData(); // FormData 对象
143
- let uploadStartFile;
144
- let timestamp = new Date().getTime(); // 给每个文件加一个时间戳
145
- // let uploadFileType = uploadSelectFile.name.substring(uploadSelectFile.name.lastIndexOf('.') + 1);
146
-
147
- uploadStartFile = {
148
- FileName: uploadSelectFile.name,
149
- // FileType: _dealAttachmentType(uploadFileType).FileType,
150
- FileSize: uploadSelectFile.size,
151
- FileLastModified: uploadSelectFile.lastModified,
152
- // IsImage: _dealAttachmentType(uploadFileType).IsImage,
153
- percentComplete: 0,
154
- uploadStatus: 1, // 开始上传
155
- IsSuccess: false,
156
- uid: uuid(),
157
- _smallImageUrl: '',
158
- _bigImageUrl: '',
159
- MediaType: '',
160
- UserId: 0,
161
- MaxDocCount: 0,
162
- DfsPath: '',
163
- ClientUrl: '',
164
- SmallImageUrl: '',
165
- BigImageUrl: '',
166
- DownloadUrl: '',
167
- Msg: '',
168
- AllowUploadAttachmentSize: 50,
169
- Deleteable: true,
170
- requestXHR: new XMLHttpRequest(), //在这创建是为了取消用
171
- };
172
-
173
- // uploadStartFiles.push(uploadStartFile);
174
- // _dealUploadStart(uploadStartFiles); // 处理开始上传的文件
175
- formData.append('file', uploadSelectFile);
176
- let url = `${apiServer}/api/v1/${tenantId}/${userid}/tenant/update/logo`;
177
- _dealUploadXHRRequest(formData, url, uploadStartFile);
178
- };
179
-
180
- /**
181
- * 处理文件上传请求
182
- *
183
- * @formData
184
- * @url 上传文件请求地址
185
- * @uploadStartFile 上传的文件
186
- *
187
- * @memberof Upload
188
- */
189
- const _dealUploadXHRRequest = (formData: any, url: string, uploadStartFile) => {
190
- let xhr = uploadStartFile.requestXHR;
191
- xhr.onreadystatechange = () => {
192
- if (xhr.readyState == 4 && xhr.status == 200) {
193
- let result = Object.assign({}, { ...JSON.parse(xhr.responseText).Result[0] }); // 上传成功接口返回数据
194
- result.percentComplete = 100;
195
- result.IsSuccess = !!result.IsSuccess;
196
- result.uploadStatus = result.IsSuccess ? 3 : 4; // 3上传成功;4上传失败
197
- // _dealUploadSuccess({ ...uploadStartFile, ...result });
198
- }
199
- };
200
- xhr.open('POST', url, true);
201
- xhr.send(formData); //开始上传,发送form数据
202
- };
203
-
204
119
  const handleEnterAgain = () => {
205
120
  setIsEnter(true);
206
121
  }
@@ -278,15 +193,12 @@ const ChangePhoto = (props: Props) => {
278
193
  responsive={true}
279
194
  autoCropArea={item?.autoCropArea}
280
195
  checkOrientation={true}
281
- minCropBoxHeight={10}
282
- minCropBoxWidth={10}
196
+ minCropBoxHeight={item?.minCropBoxHeight}
197
+ minCropBoxWidth={item?.minCropBoxWidth}
283
198
  initialAspectRatio={item?.initialAspectRatio}
284
199
  guides={true}
285
200
  preview=".img-preview"
286
201
  ref={cropperRef}
287
- // onInitialized={(instance) => {
288
- // setCropper(instance);
289
- // }}
290
202
  crop={onCrop}
291
203
  />
292
204
  <div className={classNames(`${preCls}__preview-box`, {[`${preCls}__preview-box-bgc`]:type === "enterprise"}, {[`${preCls}__preview-box-browser`]:type === "browser"})}>
@@ -27,45 +27,51 @@ export const getVersionList = () => {
27
27
  return [
28
28
  {
29
29
  version: Versions.Standard,
30
- name: "项目管理版",
30
+ name: getLocale("Sw_ProEdition"),
31
31
  color: "blue",
32
32
  image: require("./images/project.png"),
33
33
  items: [
34
- getLocale('Pro_card_ProjectMilestone'),
35
- "项目看板管理",
36
- "项目任务分解",
37
- "项目报表统计",
38
- "工作计划&统计",
34
+ getLocale("Pro_card_ProjectMilestone"),
35
+ getLocale("Sw_ProManagement"),
36
+ getLocale("Sw_ProBreakdown"),
37
+ getLocale("Sw_RepStatistics"),
38
+ getLocale("Sw_WorkStatistics"),
39
39
  ],
40
40
  },
41
41
  {
42
42
  version: Versions.WeixinAssess,
43
- name: "绩效考核版",
43
+ name: getLocale("Sw_PerformEdition"),
44
44
  color: "blue",
45
45
  image: require("./images/performance.png"),
46
- items: [getLocale('Per_Menu_Title_Assessmenttempla'), getLocale('Per_Menu_Title_AssessmentMana'), "360 评价", "绩效统计", "绩效结果校准"],
46
+ items: [
47
+ getLocale("Per_Menu_Title_Assessmenttempla"),
48
+ getLocale("Per_Menu_Title_AssessmentMana"),
49
+ getLocale("Sw_360Feedback"),
50
+ getLocale('Sw_PeStatistics'),
51
+ getLocale('Sw_PerCalibration'),
52
+ ],
47
53
  },
48
54
  {
49
55
  version: Versions.Professional,
50
- name: "OKRs-E 专业版",
56
+ name: getLocale('Sw_OKRsEdition'),
51
57
  // subName:'包含以下 2 个版本全部功能',
52
58
  color: "yellow",
53
59
  image: require("./images/okre.png"),
54
60
  items: [
55
- "OKR 目标管理版",
56
- "OKR 目标地图",
57
- getLocale('OKR_Menu_Title_OKRWork'),
58
- getLocale('OKR_Menu_Title_Dashboard'),
59
- "项目与计划管理",
61
+ getLocale('Sw_OKRManagement'),
62
+ getLocale('Sw_OKRAlignment'),
63
+ getLocale("OKR_Menu_Title_OKRWork"),
64
+ getLocale("OKR_Menu_Title_Dashboard"),
65
+ getLocale('Sw_ProjectsPrograms'),
60
66
  ],
61
67
  },
62
68
  {
63
69
  version: Versions.Flagship,
64
- name: "旗舰版",
65
- subName: "包含以下 2 个版本全部功能",
70
+ name: getLocale('Sw_FlagshipEdit'),
71
+ subName: getLocale('Sw_Includes2s'),
66
72
  color: "green",
67
73
  image: require("./images/performancePlus.png"),
68
- items: ["OKRs-E 专业版", "绩效考核版"],
74
+ items: [getLocale('Sw_OKRsEdition'), getLocale('Sw_PerformEdition')],
69
75
  },
70
- ]
76
+ ];
71
77
  };
@@ -9,8 +9,9 @@ import Dialog from "../dialog";
9
9
  import { getBSGlobal } from "../../utils/bs-global";
10
10
  import { cancelGuide, setVersion } from "./request-api";
11
11
  import { getVersionList, Versions } from "./constant";
12
- import "./index.scss";
13
12
  import { getTenantInfo } from "../../utils/helpers";
13
+ import { getLocale } from "../../utils/getLocale";
14
+ import "./index.scss";
14
15
 
15
16
  const prefix = "titaui-version-change-modal";
16
17
 
@@ -115,7 +116,7 @@ const VersionChangeModal: FC<any> = forwardRef(
115
116
  await handleTryToUseClick(version);
116
117
  }}
117
118
  >
118
- 免费试用
119
+ {getLocale('Sw_FreeTrial')}
119
120
  </a>
120
121
  </div>
121
122
  </div>