@titaui/pc 1.9.74 → 1.9.78

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.
@@ -69,8 +69,9 @@
69
69
 
70
70
  .danamic-like-ranking__content-table-items {
71
71
  display: grid;
72
- grid-template-columns: auto auto auto auto;
72
+ grid-template-columns: auto 28px auto auto;
73
73
  grid-row-gap: 16px;
74
+ margin-left: -8px;
74
75
  }
75
76
 
76
77
  .danamic-like-ranking__item:last-of-type {
@@ -92,10 +93,6 @@
92
93
  font-size: 14px;
93
94
  }
94
95
 
95
- .danamic-like-ranking__item-avatar {
96
- margin-left: 9px;
97
- }
98
-
99
96
  .danamic-like-ranking__item-avatar .titaui-pc-avator-container {
100
97
  display: inline-flex !important;
101
98
  }
@@ -185,9 +185,14 @@ var Dynamic = function Dynamic() {
185
185
  };
186
186
 
187
187
  var handleDeleteFeed = function handleDeleteFeed(feedId) {
188
- setDynamicData(_toConsumableArray(dynamicData.filter(function (item) {
188
+ var newDatas = dynamicData.filter(function (item) {
189
189
  return item.feedId !== feedId;
190
- })));
190
+ });
191
+ setDynamicData([]); // 动画效果如果直接设置新的数据,diff时间会比较长,所以直接清空再赋值,这样不会出现删除时等待长时间空白
192
+
193
+ setTimeout(function () {
194
+ setDynamicData(_toConsumableArray(newDatas));
195
+ }, 0);
191
196
  };
192
197
 
193
198
  var getDynamicData = function getDynamicData(needResetValue) {
@@ -18,7 +18,7 @@ var MBlogBox = _styledComponents["default"].div(_templateObject || (_templateObj
18
18
 
19
19
  exports.MBlogBox = MBlogBox;
20
20
 
21
- var DivMblogContent = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 8px 10px 6px;\n border: 1px solid #DFE3EA;\n border-radius: 8px;\n background-color: #fff;\n position: relative;\n transition: all .2s ease-in-out;\n height: 124px;\n box-sizing: border-box;\n\n &.input_default-active {\n box-shadow: inset 0px 0px 4px 0px rgba(40, 121, 255, 0.3);\n border-color: #2879ff;\n }\n"])));
21
+ var DivMblogContent = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 8px 10px 6px;\n border: 1px solid #DFE3EA;\n border-radius: 8px;\n background-color: #fff;\n position: relative;\n transition: all .2s ease-in-out;\n height: 200px;\n box-sizing: border-box;\n\n &.input_default-active {\n box-shadow: inset 0px 0px 4px 0px rgba(40, 121, 255, 0.3);\n border-color: #2879ff;\n }\n"])));
22
22
 
23
23
  exports.DivMblogContent = DivMblogContent;
24
24
 
@@ -36,7 +36,7 @@ var TextareaWrapper = _styledComponents["default"].div(_templateObject5 || (_tem
36
36
 
37
37
  exports.TextareaWrapper = TextareaWrapper;
38
38
 
39
- var Textarea = _styledComponents["default"].textarea(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 100%;\n padding: 0;\n border: 0 none;\n background-color: transparent;\n color: #3F4755;\n resize: none;\n word-break: break-all;\n word-wrap: break-word;\n height: 86px;\n\n &.textarea-setheight {\n visibility: hidden;\n position: absolute;\n }\n/* \n &.private__bg {\n background: url(", ") no-repeat right top;\n } */\n"])), require("./assets/lock-radius.png"));
39
+ var Textarea = _styledComponents["default"].textarea(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 100%;\n padding: 0;\n border: 0 none;\n background-color: transparent;\n color: #3F4755;\n resize: none;\n word-break: break-all;\n word-wrap: break-word;\n height: 160px;\n\n &.textarea-setheight {\n visibility: hidden;\n position: absolute;\n }\n"])));
40
40
 
41
41
  exports.Textarea = Textarea;
42
42
 
@@ -61,7 +61,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
61
61
 
62
62
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
63
63
 
64
- function ExportMapModal(props) {
64
+ var ExportMapModal = function ExportMapModal(props) {
65
65
  var _props$visible = props.visible,
66
66
  visible = _props$visible === void 0 ? false : _props$visible,
67
67
  onCloseHandler = props.onCloseHandler,
@@ -89,18 +89,25 @@ function ExportMapModal(props) {
89
89
 
90
90
  var modalRef = (0, _react.useRef)();
91
91
  (0, _react.useEffect)(function () {
92
- if ((0, _bsGlobal.isWx)()) {
93
- window.WWOpenData && window.WWOpenData.enableCanvasSharing && window.WWOpenData.enableCanvasSharing();
94
- window.WWOpenData && window.WWOpenData.initCanvas && window.WWOpenData.initCanvas();
92
+ if ((0, _bsGlobal.isWx)() && window.WWOpenData) {
93
+ if (window.WWOpenData.enableCanvasSharing) {
94
+ window.WWOpenData.enableCanvasSharing();
95
+ }
96
+
97
+ if (window.WWOpenData.initCanvas) {
98
+ window.WWOpenData.initCanvas();
99
+ }
95
100
  }
96
101
  }, []);
97
102
  (0, _react.useEffect)(function () {
98
- visible && mapInstance && mapInstance.fitView();
103
+ if (visible && mapInstance) {
104
+ mapInstance.fitView();
105
+ }
99
106
  }, [visible, mapInstance]);
100
107
 
101
108
  var downloadImg = /*#__PURE__*/function () {
102
109
  var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
103
- var okrMapRef, width, height, canvas, scale, opts, result, imgUrl, url, image;
110
+ var okrMapRef, width, height, canvas, scale, opts;
104
111
  return regeneratorRuntime.wrap(function _callee$(_context) {
105
112
  while (1) {
106
113
  switch (_context.prev = _context.next) {
@@ -136,52 +143,66 @@ function ExportMapModal(props) {
136
143
 
137
144
  };
138
145
  _context.next = 12;
139
- return (0, _html2canvas["default"])(okrMapRef, opts);
146
+ return (0, _html2canvas["default"])(okrMapRef, opts).then(function (result) {
147
+ if ((0, _bsGlobal.isWx)() && window.WWOpenData) {
148
+ if (window.WWOpenData.enableCanvasSharing) {
149
+ window.WWOpenData.enableCanvasSharing();
150
+ }
151
+
152
+ if (window.WWOpenData.initCanvas) {
153
+ window.WWOpenData.initCanvas();
154
+ }
155
+ }
140
156
 
141
- case 12:
142
- result = _context.sent;
157
+ var imgUrl = result.toDataURL("image/png"); // 得到图片的base64编码数据
143
158
 
144
- if ((0, _bsGlobal.isWx)()) {
145
- window.WWOpenData && window.WWOpenData.enableCanvasSharing && window.WWOpenData.enableCanvasSharing();
146
- window.WWOpenData && window.WWOpenData.initCanvas && window.WWOpenData.initCanvas();
147
- }
159
+ // 得到图片的base64编码数据
160
+ (0, _requestApis.getBase64DownloadUrl)(imgUrl.split(",")[1]).then(function (url) {
161
+ var image = new Image();
162
+ image.setAttribute("crossOrigin", "anonymous");
148
163
 
149
- imgUrl = result.toDataURL("image/png"); // 得到图片的base64编码数据
164
+ image.onload = function () {
165
+ if (!url.Data.obj) {
166
+ _toast["default"].Error("导出失败,请稍后重试", {
167
+ canClose: false
168
+ });
169
+ }
150
170
 
151
- _context.next = 17;
152
- return (0, _requestApis.getBase64DownloadUrl)(imgUrl.split(",")[1]);
171
+ var a = document.createElement("a"); // 生成一个a元素
153
172
 
154
- case 17:
155
- url = _context.sent;
156
- image = new Image();
157
- image.setAttribute("crossOrigin", "anonymous");
173
+ // 生成一个a元素
174
+ var event = new MouseEvent("click"); // 创建一个单击事件
158
175
 
159
- image.onload = function () {
160
- if (!url.Data.obj) {
161
- _toast["default"].Error("导出失败,请稍后重试", {
162
- canClose: false
163
- });
164
- }
176
+ // 创建一个单击事件
177
+ a.download = "okr地图"; // 设置图片名称
165
178
 
166
- var a = document.createElement("a"); // 生成一个a元素
179
+ // 设置图片名称
180
+ a.href = url.Data.obj; // 将生成的URL设置为a.href属性
167
181
 
168
- var event = new MouseEvent("click"); // 创建一个单击事件
182
+ // 将生成的URL设置为a.href属性
183
+ a.dispatchEvent(event); // 触发a的单击事件
169
184
 
170
- a.download = "okr地图"; // 设置图片名称
185
+ // 触发a的单击事件
186
+ _toast["default"].Success("导出成功");
171
187
 
172
- a.href = url.Data.obj; // 将生成的URL设置为a.href属性
188
+ setIsExport(false);
173
189
 
174
- a.dispatchEvent(event); // 触发a的单击事件
175
-
176
- _toast["default"].Success("导出成功");
190
+ if (onCloseHandler) {
191
+ onCloseHandler();
192
+ }
193
+ };
177
194
 
195
+ image.src = imgUrl;
196
+ });
197
+ })["catch"](function (err) {
178
198
  setIsExport(false);
179
- onCloseHandler && onCloseHandler();
180
- };
181
199
 
182
- image.src = imgUrl;
200
+ _toast["default"].Error(err, {
201
+ canClose: false
202
+ });
203
+ });
183
204
 
184
- case 22:
205
+ case 12:
185
206
  case "end":
186
207
  return _context.stop();
187
208
  }
@@ -267,7 +288,10 @@ function ExportMapModal(props) {
267
288
  background: bgColor
268
289
  }
269
290
  }))))));
270
- }
291
+ };
271
292
 
293
+ ExportMapModal.defaultProps = {
294
+ onCloseHandler: function onCloseHandler() {}
295
+ };
272
296
  var _default = ExportMapModal;
273
297
  exports["default"] = _default;
@@ -140,7 +140,7 @@
140
140
  }
141
141
 
142
142
  .okr-cases-library__navFirst__item-active::after {
143
- content: "";
143
+ content: '';
144
144
  position: absolute;
145
145
  bottom: -14px;
146
146
  left: 0;
@@ -277,6 +277,7 @@
277
277
  }
278
278
 
279
279
  .okr-cases-library__cardList__card__title__btn {
280
+ font-size: 14px;
280
281
  position: absolute;
281
282
  right: 15px;
282
283
  top: 60px;
@@ -289,6 +290,7 @@
289
290
  cursor: pointer;
290
291
  opacity: 0;
291
292
  transition: all 0.5s;
293
+ font-weight: 500;
292
294
  }
293
295
 
294
296
  .okr-cases-library__cardList__card__title__btn-show {
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _localStorage = require("../../utils/local-storage");
13
13
 
14
+ var _notAllowData = require("./not-allow-data");
15
+
14
16
  require("./index.css");
15
17
 
16
18
  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); }
@@ -31,6 +33,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
33
 
32
34
  var preCls = "part-notice";
33
35
  var storage = new _localStorage.LocalStorage();
36
+ var tenantId = window.BSGlobal.tenantInfo.Id;
34
37
 
35
38
  var PartNotice = function PartNotice(_ref) {
36
39
  var storageName = _ref.storageName,
@@ -69,6 +72,9 @@ var PartNotice = function PartNotice(_ref) {
69
72
  window.open(link, "_target");
70
73
  };
71
74
 
75
+ if (!_notAllowData.notAllowData.find(function (item) {
76
+ return item === tenantId;
77
+ })) return /*#__PURE__*/_react["default"].createElement("span", null);
72
78
  if (!visible) return /*#__PURE__*/_react["default"].createElement("span", null);
73
79
  return /*#__PURE__*/_react["default"].createElement("div", {
74
80
  className: "".concat(preCls)
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.notAllowData = exports["default"] = void 0;
7
+ var notAllowData = [366131, 307425, 386434, 318995, 516911, 520530, 529247, 283929, 521974, 525553, 524783, 533197, 506389, 541245, 265530, 542555, 322665, 388103, 523558, 521070, 547650, 527324, 543000, 536771, 377798, 548066, 541479, 538509, 509148, 383549, 533456, 395251, 516682, 546877, 521818, 552965, 551336, 518051, 544736, 552455, 534044, 529329, 554018, 518791, 392024, 553462, 504585, 551576, 547861, 504087, 555603, 526408, 536559, 555641, 553800, 553083, 554654, 552158, 542587, 379998, 510788, 553836, 529906, 511358, 551913, 543085, 514568, 397292, 556796, 538802, 546456, 549378, 542520, 560327, 548612, 522327, 555225, 530370, 565991, 547082, 564585, 535986, 502385, 391420, 560552, 558317, 564416, 552974, 318867, 570075, 560793, 565994, 533855, 375844, 549354, 571823, 537982, 528567, 568168, 569066, 515852, 566360, 548969, 553532, 352728, 562259, 521375];
8
+ exports.notAllowData = notAllowData;
9
+ var _default = notAllowData;
10
+ exports["default"] = _default;
@@ -23,8 +23,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
23
23
 
24
24
  var dealSelectedPeriodData = function dealSelectedPeriodData(period) {
25
25
  var option = {};
26
- option.cycleType = period == "-1" ? "-1" : period.substring(0, 1);
27
- option.yqmNum = period.substring(2) == "" ? "0" : period.substring(2);
26
+ option.cycleType = Number(period) === -1 ? "-1" : period.substring(0, 1);
27
+ option.yqmNum = period.substring(2) === "" ? "0" : period.substring(2);
28
28
  return option;
29
29
  };
30
30
 
@@ -45,7 +45,7 @@ var dealYearsRange = function dealYearsRange(yearsRange, showAllYears) {
45
45
  var startYear = yearsRange[0];
46
46
  var endYear = yearsRange[yearsRange.length - 1];
47
47
 
48
- for (var i = startYear; i <= endYear; i++) {
48
+ for (var i = startYear; i <= endYear; i += 1) {
49
49
  yearsData.push({
50
50
  checked: false,
51
51
  order: ["".concat(i)],
@@ -70,7 +70,7 @@ var formatPeriod = function formatPeriod(selected) {
70
70
  if (!selected) return "";
71
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"))];
72
72
  var cycleDate = "";
73
- var annualNum = selected.annualNum == "-1" ? "".concat((0, _getLocale.getLocale)("OKR_MyO_Butt_Allyears")) : "".concat(selected.annualNum).concat(_getLocale.isEn ? "" : "年");
73
+ var annualNum = Number("".concat(selected.annualNum)) === -1 ? "".concat((0, _getLocale.getLocale)("OKR_MyO_Butt_Allyears")) : "".concat(selected.annualNum).concat(_getLocale.isEn ? "" : "年");
74
74
  var month = (0, _constant.getMonth)();
75
75
 
76
76
  switch ("".concat(selected.cycleType)) {
@@ -96,7 +96,7 @@ var formatPeriod = function formatPeriod(selected) {
96
96
  break;
97
97
 
98
98
  case "5":
99
- cycleDate = selected.yqmNum == "1" ? "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Firsthalf")) : "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Secondhalf"));
99
+ cycleDate = Number("".concat(selected.yqmNum)) === 1 ? "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Firsthalf")) : "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Secondhalf"));
100
100
  break;
101
101
 
102
102
  default:
@@ -111,10 +111,10 @@ exports.formatPeriod = formatPeriod;
111
111
  var computeYearIndex = function computeYearIndex(currentYear, yearsData, computeType) {
112
112
  var newIndex;
113
113
  var currentYearIndex = yearsData.findIndex(function (item) {
114
- return Number(item.title) == currentYear;
114
+ return Number(item.title) === currentYear;
115
115
  });
116
116
 
117
- if (computeType == "add") {
117
+ if (computeType === "add") {
118
118
  newIndex = currentYearIndex + 1;
119
119
  } else {
120
120
  newIndex = currentYearIndex - 1;
@@ -137,6 +137,14 @@ var getDateRangeByCycle = function getDateRangeByCycle(cycle) {
137
137
  }
138
138
 
139
139
  switch (cycle.cycleType) {
140
+ case "-1":
141
+ {
142
+ return {
143
+ startDate: "",
144
+ endDate: ""
145
+ };
146
+ }
147
+
140
148
  case "1":
141
149
  {
142
150
  var _start = (0, _moment["default"])().year(Number(cycle.annualNum)).month(startMonth - 1).date(1);
@@ -179,7 +187,7 @@ var getDateRangeByCycle = function getDateRangeByCycle(cycle) {
179
187
  {
180
188
  var _start3 = (0, _moment["default"])().year(Number(cycle.annualNum)).month(startMonth - 1).date(1);
181
189
 
182
- if (cycle.yqmNum == "2") _start3.add(6, "M");
190
+ if (cycle.yqmNum === "2") _start3.add(6, "M");
183
191
  return {
184
192
  startDate: _start3.format("YYYY/MM/DD"),
185
193
  endDate: _start3.add(5, "month").endOf("M").format("YYYY/MM/DD")
@@ -226,8 +234,8 @@ function getDefalutCycle(setting) {
226
234
  if (setting.isOpenBimonthly) {
227
235
  var month = new Date().getMonth() + 1;
228
236
 
229
- if (setting.yearStartMonth % 2 == 1) {
230
- month -= month % 2 == 1 ? 0 : 1;
237
+ if (setting.yearStartMonth % 2 === 1) {
238
+ month -= month % 2 === 1 ? 0 : 1;
231
239
  } else {
232
240
  month = month - month % 2 || 12;
233
241
  }
@@ -3,7 +3,7 @@
3
3
  background: #ffffff;
4
4
  box-shadow: 0px 0px 8px 0px #e9eef3;
5
5
  position: relative;
6
- border-bottom: 1px solid #E9ECF0;
6
+ border-bottom: 1px solid #e9ecf0;
7
7
  }
8
8
 
9
9
  .titapage-okr-map__header__folded {
@@ -68,7 +68,7 @@
68
68
  }
69
69
 
70
70
  .titapage-okr-map__header-theme:hover {
71
- color: #2879FF;
71
+ color: #2879ff;
72
72
  }
73
73
 
74
74
  .titapage-okr-map__header-theme:hover:before {
@@ -113,7 +113,7 @@
113
113
  }
114
114
 
115
115
  .titapage-okr-map__header-action-showkr:hover, .titapage-okr-map__header-action-level:hover {
116
- background: #F7F8FA;
116
+ background: #f7f8fa;
117
117
  }
118
118
 
119
119
  .titapage-okr-map__header-action--show-more {
@@ -125,7 +125,7 @@
125
125
  height: 30px;
126
126
  line-height: 30px;
127
127
  cursor: pointer;
128
- color: #3F4755;
128
+ color: #3f4755;
129
129
  font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
130
130
  font-size: 12px;
131
131
  }
@@ -134,7 +134,7 @@
134
134
  position: absolute;
135
135
  display: inline-block;
136
136
  background: url("../../../images/line-down-arrow.svg") transparent no-repeat 50% 50%;
137
- content: "";
137
+ content: '';
138
138
  height: 6px;
139
139
  width: 10px;
140
140
  right: 0;
@@ -151,9 +151,9 @@
151
151
 
152
152
  .titapage-okr-map__show-more-popup {
153
153
  padding: 11px 0;
154
- background: #FFFFFF;
154
+ background: #ffffff;
155
155
  box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
156
- border: 1px solid #E9ECF0;
156
+ border: 1px solid #e9ecf0;
157
157
  border-radius: 2px;
158
158
  }
159
159
 
@@ -226,7 +226,7 @@
226
226
  }
227
227
 
228
228
  .titapage-okr-map__dark .titapage-okr-map__header .titaui-period-selector button:hover {
229
- background: #5c8EFF;
229
+ background: #5c8eff;
230
230
  }
231
231
 
232
232
  .titapage-okr-map__dark .titapage-okr-map__header .titaui-period-selector .titaui-period-selector__down-arrow {
@@ -262,7 +262,7 @@
262
262
  }
263
263
 
264
264
  .titapage-okr-map__dark .titapage-okr-map__header .titaui-icon-button-list__btn:hover {
265
- background-color: #515A69;
265
+ background-color: #515a69;
266
266
  }
267
267
 
268
268
  .titapage-okr-map__dark .rc-select-selection-item {
@@ -286,7 +286,7 @@
286
286
  content: 'i';
287
287
  width: 16px;
288
288
  height: 16px;
289
- background-color: #FFBC00;
289
+ background-color: #ffbc00;
290
290
  color: #fff;
291
291
  text-align: center;
292
292
  line-height: 16px;
@@ -299,7 +299,8 @@
299
299
  .titapage-okr-map--kr-dialog--content {
300
300
  font-size: 14px;
301
301
  font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
302
- color: #6F7886;
302
+ color: #6f7886;
303
303
  line-height: 20px;
304
304
  padding: 0 32px;
305
+ display: block;
305
306
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.9.74",
3
+ "version": "1.9.78",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "src/index.js",
@@ -66,8 +66,9 @@
66
66
  }
67
67
  &-items {
68
68
  display: grid;
69
- grid-template-columns: auto auto auto auto;
69
+ grid-template-columns: auto 28px auto auto;
70
70
  grid-row-gap: 16px;
71
+ margin-left: -8px;
71
72
  }
72
73
  }
73
74
  }
@@ -93,8 +94,6 @@
93
94
  }
94
95
 
95
96
  &-avatar {
96
- margin-left: 9px;
97
-
98
97
  .titaui-pc-avator-container {
99
98
  display: inline-flex !important;
100
99
  }
@@ -80,9 +80,14 @@ const Dynamic: FC = () => {
80
80
  };
81
81
 
82
82
  const handleDeleteFeed = (feedId) => {
83
- setDynamicData([
84
- ...dynamicData.filter((item: any) => item.feedId !== feedId),
85
- ]);
83
+ const newDatas = dynamicData.filter((item: any) => item.feedId !== feedId);
84
+ setDynamicData([]);
85
+ // 动画效果如果直接设置新的数据,diff时间会比较长,所以直接清空再赋值,这样不会出现删除时等待长时间空白
86
+ setTimeout(() => {
87
+ setDynamicData([
88
+ ...newDatas,
89
+ ]);
90
+ }, 0);
86
91
  };
87
92
 
88
93
  const getDynamicData = (needResetValue) => {
@@ -26,7 +26,7 @@ export const DivMblogContent = styled.div`
26
26
  background-color: #fff;
27
27
  position: relative;
28
28
  transition: all .2s ease-in-out;
29
- height: 124px;
29
+ height: 200px;
30
30
  box-sizing: border-box;
31
31
 
32
32
  &.input_default-active {
@@ -60,16 +60,12 @@ export const Textarea = styled.textarea`
60
60
  resize: none;
61
61
  word-break: break-all;
62
62
  word-wrap: break-word;
63
- height: 86px;
63
+ height: 160px;
64
64
 
65
65
  &.textarea-setheight {
66
66
  visibility: hidden;
67
67
  position: absolute;
68
68
  }
69
- /*
70
- &.private__bg {
71
- background: url(${require("./assets/lock-radius.png")}) no-repeat right top;
72
- } */
73
69
  `;
74
70
 
75
71
  export const Tips = styled.div`
@@ -1,5 +1,5 @@
1
1
  import React, {
2
- useState, useEffect, useRef, Fragment,
2
+ useState, useEffect, useRef, FC,
3
3
  } from "react";
4
4
  import classNames from "classnames";
5
5
  import Html2Canvas from "html2canvas";
@@ -25,7 +25,7 @@ interface IProps {
25
25
  showkr: boolean;
26
26
  }
27
27
 
28
- function ExportMapModal(props: IProps) {
28
+ const ExportMapModal: FC<IProps> = (props: IProps) => {
29
29
  const {
30
30
  visible = false,
31
31
  onCloseHandler,
@@ -39,17 +39,19 @@ function ExportMapModal(props: IProps) {
39
39
  const [isExport, setIsExport] = useState(false);
40
40
  const modalRef = useRef();
41
41
  useEffect(() => {
42
- if (isWx()) {
43
- window.WWOpenData
44
- && window.WWOpenData.enableCanvasSharing
45
- && window.WWOpenData.enableCanvasSharing();
46
- window.WWOpenData
47
- && window.WWOpenData.initCanvas
48
- && window.WWOpenData.initCanvas();
42
+ if (isWx() && window.WWOpenData) {
43
+ if (window.WWOpenData.enableCanvasSharing) {
44
+ window.WWOpenData.enableCanvasSharing();
45
+ }
46
+ if (window.WWOpenData.initCanvas) {
47
+ window.WWOpenData.initCanvas();
48
+ }
49
49
  }
50
50
  }, []);
51
51
  useEffect(() => {
52
- visible && mapInstance && mapInstance.fitView();
52
+ if (visible && mapInstance) {
53
+ mapInstance.fitView();
54
+ }
53
55
  }, [visible, mapInstance]);
54
56
 
55
57
  const downloadImg = async () => {
@@ -72,34 +74,41 @@ function ExportMapModal(props: IProps) {
72
74
  useCORS: true, // 【重要】开启跨域配置
73
75
  };
74
76
 
75
- const result = await Html2Canvas(okrMapRef, opts);
76
- if (isWx()) {
77
- window.WWOpenData
78
- && window.WWOpenData.enableCanvasSharing
79
- && window.WWOpenData.enableCanvasSharing();
80
- window.WWOpenData
81
- && window.WWOpenData.initCanvas
82
- && window.WWOpenData.initCanvas();
83
- }
84
- const imgUrl = result.toDataURL("image/png"); // 得到图片的base64编码数据
85
- const url = await getBase64DownloadUrl(imgUrl.split(",")[1]);
86
- const image = new Image();
87
-
88
- image.setAttribute("crossOrigin", "anonymous");
89
- image.onload = () => {
90
- if (!url.Data.obj) {
91
- Toast.Error("导出失败,请稍后重试", { canClose: false });
77
+ await Html2Canvas(okrMapRef, opts).then((result) => {
78
+ if (isWx() && window.WWOpenData) {
79
+ if (window.WWOpenData.enableCanvasSharing) {
80
+ window.WWOpenData.enableCanvasSharing();
81
+ }
82
+ if (window.WWOpenData.initCanvas) {
83
+ window.WWOpenData.initCanvas();
84
+ }
92
85
  }
93
- const a = document.createElement("a"); // 生成一个a元素
94
- const event = new MouseEvent("click"); // 创建一个单击事件
95
- a.download = "okr地图"; // 设置图片名称
96
- a.href = url.Data.obj; // 将生成的URL设置为a.href属性
97
- a.dispatchEvent(event); // 触发a的单击事件
98
- Toast.Success("导出成功");
86
+ const imgUrl = result.toDataURL("image/png"); // 得到图片的base64编码数据
87
+ getBase64DownloadUrl(imgUrl.split(",")[1]).then((url) => {
88
+ const image = new Image();
89
+
90
+ image.setAttribute("crossOrigin", "anonymous");
91
+ image.onload = () => {
92
+ if (!url.Data.obj) {
93
+ Toast.Error("导出失败,请稍后重试", { canClose: false });
94
+ }
95
+ const a = document.createElement("a"); // 生成一个a元素
96
+ const event = new MouseEvent("click"); // 创建一个单击事件
97
+ a.download = "okr地图"; // 设置图片名称
98
+ a.href = url.Data.obj; // 将生成的URL设置为a.href属性
99
+ a.dispatchEvent(event); // 触发a的单击事件
100
+ Toast.Success("导出成功");
101
+ setIsExport(false);
102
+ if (onCloseHandler) {
103
+ onCloseHandler();
104
+ }
105
+ };
106
+ image.src = imgUrl;
107
+ });
108
+ }).catch((err) => {
99
109
  setIsExport(false);
100
- onCloseHandler && onCloseHandler();
101
- };
102
- image.src = imgUrl;
110
+ Toast.Error(err, { canClose: false });
111
+ });
103
112
  };
104
113
 
105
114
  const confirmHandler = () => {
@@ -178,5 +187,9 @@ function ExportMapModal(props: IProps) {
178
187
  </>
179
188
  </Dialog>
180
189
  );
181
- }
190
+ };
191
+
192
+ ExportMapModal.defaultProps = {
193
+ onCloseHandler: () => {},
194
+ };
182
195
  export default ExportMapModal;
@@ -25,7 +25,7 @@
25
25
  // url("./image/head-background-right1.png");
26
26
  background-repeat: no-repeat;
27
27
  // background-position: center bottom, left bottom, right bottom;
28
- background-image: url("./image/head-background.png");
28
+ background-image: url('./image/head-background.png');
29
29
  background-position: center top;
30
30
  // &-mask {
31
31
  // height: 100%;
@@ -135,7 +135,7 @@
135
135
  position: relative;
136
136
  font-weight: 600;
137
137
  &::after {
138
- content: "";
138
+ content: '';
139
139
  position: absolute;
140
140
  bottom: -14px;
141
141
  left: 0;
@@ -253,6 +253,7 @@
253
253
  font-weight: 600;
254
254
  }
255
255
  &__btn {
256
+ font-size: 14px;
256
257
  position: absolute;
257
258
  right: 15px;
258
259
  top: 60px;
@@ -265,6 +266,7 @@
265
266
  cursor: pointer;
266
267
  opacity: 0;
267
268
  transition: all 0.5s;
269
+ font-weight: 500;
268
270
  &-show {
269
271
  top: 37px;
270
272
  opacity: 1;
@@ -287,12 +289,12 @@
287
289
  }
288
290
  }
289
291
  &-blue {
290
- background-image: url("./image/蓝.png");
292
+ background-image: url('./image/蓝.png');
291
293
  background-color: #f4f8ff;
292
294
  color: #2879ff;
293
295
  }
294
296
  &-red {
295
- background-image: url("./image/红.png");
297
+ background-image: url('./image/红.png');
296
298
  background-color: rgba(240, 94, 94, 0.1);
297
299
  color: #f05e5e;
298
300
  }
@@ -415,7 +417,7 @@
415
417
  height: 64px;
416
418
  box-shadow: 0px 0px 8px 0px rgba(127, 145, 180, 0.1);
417
419
  border-radius: 6px;
418
- background-image: url("./image/会员背景.png");
420
+ background-image: url('./image/会员背景.png');
419
421
  background-size: 100%;
420
422
  background-repeat: no-repeat;
421
423
  background-position: center;
@@ -439,7 +441,7 @@
439
441
  width: 100%;
440
442
  height: 114px;
441
443
  background-color: #fff;
442
- background-image: url("./image/广告图片.png");
444
+ background-image: url('./image/广告图片.png');
443
445
  background-size: 100%;
444
446
  background-repeat: no-repeat;
445
447
  background-position: center;
@@ -536,7 +538,7 @@
536
538
  flex-direction: column;
537
539
  justify-content: start;
538
540
  align-items: center;
539
- background-image: url("./image/支付背景.svg");
541
+ background-image: url('./image/支付背景.svg');
540
542
  background-repeat: no-repeat;
541
543
  background-position: center;
542
544
  background-size: 100%;
@@ -1,5 +1,6 @@
1
1
  import React, { FC, useState, useCallback } from "react";
2
2
  import { LocalStorage } from "../../utils/local-storage";
3
+ import { notAllowData } from "./not-allow-data";
3
4
  import "./index.scss";
4
5
 
5
6
  interface Props {
@@ -10,6 +11,7 @@ interface Props {
10
11
 
11
12
  const preCls = "part-notice";
12
13
  const storage = new LocalStorage();
14
+ const tenantId = window.BSGlobal.tenantInfo.Id;
13
15
 
14
16
  const PartNotice: FC<Props> = ({ storageName, text, link }) => {
15
17
  const [visible, setVisible] = useState(() => {
@@ -33,6 +35,7 @@ const PartNotice: FC<Props> = ({ storageName, text, link }) => {
33
35
  const handleOpenLink = () => {
34
36
  window.open(link, "_target");
35
37
  };
38
+ if (!notAllowData.find((item) => item === tenantId)) return <span />;
36
39
  if (!visible) return <span />;
37
40
  return (
38
41
  <div className={`${preCls}`}>
@@ -0,0 +1,110 @@
1
+ export const notAllowData = [
2
+ 366131,
3
+ 307425,
4
+ 386434,
5
+ 318995,
6
+ 516911,
7
+ 520530,
8
+ 529247,
9
+ 283929,
10
+ 521974,
11
+ 525553,
12
+ 524783,
13
+ 533197,
14
+ 506389,
15
+ 541245,
16
+ 265530,
17
+ 542555,
18
+ 322665,
19
+ 388103,
20
+ 523558,
21
+ 521070,
22
+ 547650,
23
+ 527324,
24
+ 543000,
25
+ 536771,
26
+ 377798,
27
+ 548066,
28
+ 541479,
29
+ 538509,
30
+ 509148,
31
+ 383549,
32
+ 533456,
33
+ 395251,
34
+ 516682,
35
+ 546877,
36
+ 521818,
37
+ 552965,
38
+ 551336,
39
+ 518051,
40
+ 544736,
41
+ 552455,
42
+ 534044,
43
+ 529329,
44
+ 554018,
45
+ 518791,
46
+ 392024,
47
+ 553462,
48
+ 504585,
49
+ 551576,
50
+ 547861,
51
+ 504087,
52
+ 555603,
53
+ 526408,
54
+ 536559,
55
+ 555641,
56
+ 553800,
57
+ 553083,
58
+ 554654,
59
+ 552158,
60
+ 542587,
61
+ 379998,
62
+ 510788,
63
+ 553836,
64
+ 529906,
65
+ 511358,
66
+ 551913,
67
+ 543085,
68
+ 514568,
69
+ 397292,
70
+ 556796,
71
+ 538802,
72
+ 546456,
73
+ 549378,
74
+ 542520,
75
+ 560327,
76
+ 548612,
77
+ 522327,
78
+ 555225,
79
+ 530370,
80
+ 565991,
81
+ 547082,
82
+ 564585,
83
+ 535986,
84
+ 502385,
85
+ 391420,
86
+ 560552,
87
+ 558317,
88
+ 564416,
89
+ 552974,
90
+ 318867,
91
+ 570075,
92
+ 560793,
93
+ 565994,
94
+ 533855,
95
+ 375844,
96
+ 549354,
97
+ 571823,
98
+ 537982,
99
+ 528567,
100
+ 568168,
101
+ 569066,
102
+ 515852,
103
+ 566360,
104
+ 548969,
105
+ 553532,
106
+ 352728,
107
+ 562259,
108
+ 521375,
109
+ ];
110
+ export default notAllowData;
@@ -5,8 +5,8 @@ import { getMonth } from "../../utils/constant";
5
5
 
6
6
  export const dealSelectedPeriodData = (period: string) => {
7
7
  const option: any = {};
8
- option.cycleType = period == "-1" ? "-1" : period.substring(0, 1);
9
- option.yqmNum = period.substring(2) == "" ? "0" : period.substring(2);
8
+ option.cycleType = Number(period) === -1 ? "-1" : period.substring(0, 1);
9
+ option.yqmNum = period.substring(2) === "" ? "0" : period.substring(2);
10
10
  return option;
11
11
  };
12
12
 
@@ -27,7 +27,7 @@ export const dealYearsRange = (
27
27
  }
28
28
  const startYear = yearsRange[0];
29
29
  const endYear = yearsRange[yearsRange.length - 1];
30
- for (let i = startYear; i <= endYear; i++) {
30
+ for (let i = startYear; i <= endYear; i += 1) {
31
31
  yearsData.push({
32
32
  checked: false,
33
33
  order: [`${i}`],
@@ -51,7 +51,7 @@ export const formatPeriod = (selected: SelectedInterface) => {
51
51
  if (!selected) return "";
52
52
  const quarter = ["", `${getLocale("OKR_MyO_Pop_1stQuarter")}`, `${getLocale("OKR_MyO_Pop_2ndQuarter")}`, `${getLocale("OKR_MyO_Pop_3rdQuarter")}`, `${getLocale("OKR_MyO_Pop_4thQuarter")}`];
53
53
  let cycleDate = "";
54
- const annualNum = selected.annualNum == "-1" ? `${getLocale("OKR_MyO_Butt_Allyears")}` : `${selected.annualNum}${isEn ? "" : "年"}`;
54
+ const annualNum = Number(`${selected.annualNum}`) === -1 ? `${getLocale("OKR_MyO_Butt_Allyears")}` : `${selected.annualNum}${isEn ? "" : "年"}`;
55
55
  const month = getMonth();
56
56
  switch (`${selected.cycleType}`) {
57
57
  case "-1":
@@ -73,7 +73,7 @@ export const formatPeriod = (selected: SelectedInterface) => {
73
73
  }`;
74
74
  break;
75
75
  case "5":
76
- cycleDate = selected.yqmNum == "1" ? `${getLocale("OKR_MyO_Pop_Firsthalf")}` : `${getLocale("OKR_MyO_Pop_Secondhalf")}`;
76
+ cycleDate = Number(`${selected.yqmNum}`) === 1 ? `${getLocale("OKR_MyO_Pop_Firsthalf")}` : `${getLocale("OKR_MyO_Pop_Secondhalf")}`;
77
77
  break;
78
78
  default:
79
79
  cycleDate = `${getLocale("Mod_Customization")}`;
@@ -88,9 +88,9 @@ export const computeYearIndex = (
88
88
  ) => {
89
89
  let newIndex;
90
90
  const currentYearIndex = yearsData.findIndex(
91
- (item) => Number(item.title) == currentYear,
91
+ (item) => Number(item.title) === currentYear,
92
92
  );
93
- if (computeType == "add") {
93
+ if (computeType === "add") {
94
94
  newIndex = currentYearIndex + 1;
95
95
  } else {
96
96
  newIndex = currentYearIndex - 1;
@@ -112,6 +112,12 @@ export const getDateRangeByCycle = (cycle: ICycle, startMonth: number = 1) => {
112
112
  };
113
113
  }
114
114
  switch (cycle.cycleType) {
115
+ case "-1": {
116
+ return {
117
+ startDate: "",
118
+ endDate: "",
119
+ };
120
+ }
115
121
  case "1": {
116
122
  const start = moment()
117
123
  .year(Number(cycle.annualNum))
@@ -159,7 +165,7 @@ export const getDateRangeByCycle = (cycle: ICycle, startMonth: number = 1) => {
159
165
  .year(Number(cycle.annualNum))
160
166
  .month(startMonth - 1)
161
167
  .date(1);
162
- if (cycle.yqmNum == "2") start.add(6, "M");
168
+ if (cycle.yqmNum === "2") start.add(6, "M");
163
169
  return {
164
170
  startDate: start.format("YYYY/MM/DD"),
165
171
  endDate: start.add(5, "month").endOf("M").format("YYYY/MM/DD"),
@@ -210,8 +216,8 @@ export function getDefalutCycle(setting) {
210
216
  };
211
217
  } if (setting.isOpenBimonthly) {
212
218
  let month = new Date().getMonth() + 1;
213
- if (setting.yearStartMonth % 2 == 1) {
214
- month -= (month % 2 == 1 ? 0 : 1);
219
+ if (setting.yearStartMonth % 2 === 1) {
220
+ month -= (month % 2 === 1 ? 0 : 1);
215
221
  } else {
216
222
  month = month - (month % 2) || 12;
217
223
  }
@@ -1,4 +1,5 @@
1
- $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
1
+ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica,
2
+ sans-serif, PingFang SC, Microsoft YaHei;
2
3
 
3
4
  .titapage-okr-map {
4
5
  &__header {
@@ -6,7 +7,7 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
6
7
  background: #ffffff;
7
8
  box-shadow: 0px 0px 8px 0px #e9eef3;
8
9
  position: relative;
9
- border-bottom: 1px solid #E9ECF0;
10
+ border-bottom: 1px solid #e9ecf0;
10
11
  &__folded {
11
12
  // top: -114px;
12
13
  height: 0;
@@ -65,7 +66,7 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
65
66
  vertical-align: middle;
66
67
  }
67
68
  &:hover {
68
- color: #2879FF;
69
+ color: #2879ff;
69
70
  &:before {
70
71
  background-image: url('../../../images/trigger-hover.svg');
71
72
  }
@@ -103,11 +104,11 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
103
104
  }
104
105
  }
105
106
  }
106
- &-showkr,&-level {
107
-
107
+ &-showkr,
108
+ &-level {
108
109
  padding: 5px 20px;
109
110
  &:hover {
110
- background: #F7F8FA;
111
+ background: #f7f8fa;
111
112
  }
112
113
  }
113
114
  &--show-more {
@@ -119,21 +120,22 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
119
120
  height: 30px;
120
121
  line-height: 30px;
121
122
  cursor: pointer;
122
- color: #3F4755;
123
+ color: #3f4755;
123
124
  font-family: $font-family;
124
125
  font-size: 12px;
125
126
  &:after {
126
127
  position: absolute;
127
128
  display: inline-block;
128
- background: url('../../../images/line-down-arrow.svg') transparent no-repeat 50% 50%;
129
- content: "";
129
+ background: url('../../../images/line-down-arrow.svg') transparent
130
+ no-repeat 50% 50%;
131
+ content: '';
130
132
  height: 6px;
131
133
  width: 10px;
132
134
  right: 0;
133
135
  top: calc(50% - 3px);
134
136
  }
135
137
  }
136
-
138
+
137
139
  &-btns {
138
140
  position: absolute;
139
141
  vertical-align: middle;
@@ -145,22 +147,24 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
145
147
  }
146
148
  &__show-more-popup {
147
149
  padding: 11px 0;
148
- background: #FFFFFF;
150
+ background: #ffffff;
149
151
  box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
150
- border: 1px solid #E9ECF0;
152
+ border: 1px solid #e9ecf0;
151
153
  border-radius: 2px;
152
154
  }
153
155
  }
154
156
  .titapage-okr-map__dark {
155
157
  .titapage-okr-map__content-search {
156
158
  &:before {
157
- background: url(../../../images/line-down-arrow-dark.svg) transparent no-repeat 50% 50%;
159
+ background: url(../../../images/line-down-arrow-dark.svg) transparent
160
+ no-repeat 50% 50%;
158
161
  background-size: 100%;
159
162
  }
160
163
  }
161
164
  .tui-select-selector {
162
165
  &:before {
163
- background: url(../../../images/down-arrow-dark.svg) transparent no-repeat 50% 50%;
166
+ background: url(../../../images/down-arrow-dark.svg) transparent no-repeat
167
+ 50% 50%;
164
168
  background-size: 100%;
165
169
  }
166
170
  }
@@ -212,7 +216,7 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
212
216
  border: none;
213
217
  color: #fff;
214
218
  &:hover {
215
- background: #5c8EFF;
219
+ background: #5c8eff;
216
220
  }
217
221
  }
218
222
  .titaui-period-selector__down-arrow {
@@ -242,7 +246,7 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
242
246
  }
243
247
  }
244
248
  &:hover {
245
- background-color: #515A69;
249
+ background-color: #515a69;
246
250
  }
247
251
  }
248
252
  }
@@ -261,14 +265,14 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
261
265
  top: 0;
262
266
  bottom: 0;
263
267
  }
264
- .titapage-okr-map--kr-dialog{
268
+ .titapage-okr-map--kr-dialog {
265
269
  &--title {
266
270
  &:before {
267
271
  display: inline-block;
268
272
  content: 'i';
269
273
  width: 16px;
270
274
  height: 16px;
271
- background-color: #FFBC00;
275
+ background-color: #ffbc00;
272
276
  color: #fff;
273
277
  text-align: center;
274
278
  line-height: 16px;
@@ -281,8 +285,9 @@ $font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-ser
281
285
  &--content {
282
286
  font-size: 14px;
283
287
  font-family: $font-family;
284
- color: #6F7886;
288
+ color: #6f7886;
285
289
  line-height: 20px;
286
290
  padding: 0 32px;
291
+ display: block;
287
292
  }
288
293
  }