@titaui/pc 1.9.76 → 1.9.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +7 -5
- package/lib/components/change-okr-modal/Item.js +26 -24
- package/lib/components/change-okr-modal/styledComponents.js +5 -5
- package/lib/components/mblog/style.js +2 -2
- package/lib/components/okr-detail/detail-header/confirm.js +2 -1
- package/lib/components/okr-detail/detail-header/index.js +13 -10
- package/lib/components/okr-flow/export-modal/index.js +65 -41
- package/lib/components/okr-progress-modal/helper.js +59 -45
- package/lib/components/okr-progress-modal/index.js +19 -14
- package/lib/components/okr-share/index.js +7 -2
- package/lib/components/period-selector/common.js +18 -10
- package/lib/pages/okr-map/export-modules/okr-map/header/index.css +12 -11
- package/package.json +2 -1
- package/src/components/change-okr-modal/Item.tsx +22 -22
- package/src/components/change-okr-modal/styledComponents.ts +11 -5
- package/src/components/mblog/style.ts +4 -5
- package/src/components/okr-detail/detail-header/confirm.tsx +1 -1
- package/src/components/okr-detail/detail-header/index.tsx +19 -13
- package/src/components/okr-flow/export-modal/index.tsx +52 -39
- package/src/components/okr-progress-modal/helper.js +49 -41
- package/src/components/okr-progress-modal/index.tsx +17 -16
- package/src/components/okr-share/index.tsx +9 -4
- package/src/components/period-selector/common.ts +16 -10
- package/src/pages/okr-map/export-modules/okr-map/header/index.scss +24 -19
- package/yarn-error.log +0 -103
|
@@ -52,6 +52,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
52
52
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
53
|
|
|
54
54
|
var ProgressModal = function ProgressModal(props) {
|
|
55
|
+
var _window, _window$BSGlobal, _window$BSGlobal$OkrA, _window$BSGlobal$OkrA2;
|
|
56
|
+
|
|
55
57
|
var maxLength = props.maxLength,
|
|
56
58
|
okrInfo = props.okrInfo,
|
|
57
59
|
onClose = props.onClose,
|
|
@@ -60,7 +62,7 @@ var ProgressModal = function ProgressModal(props) {
|
|
|
60
62
|
title = _props$title === void 0 ? window.getLocale("OKR_MyO_Prog_Butt_Update") : _props$title,
|
|
61
63
|
visible = props.visible,
|
|
62
64
|
isKr = props.isKr;
|
|
63
|
-
var configure = isKr ? (0, _helper.
|
|
65
|
+
var configure = isKr ? (0, _helper.getKrSetting)() : (0, _helper.getOSetting)();
|
|
64
66
|
var reg = /^[0-9]*[1-9][0-9]*$/;
|
|
65
67
|
|
|
66
68
|
var _useState = (0, _react.useState)(false),
|
|
@@ -95,11 +97,7 @@ var ProgressModal = function ProgressModal(props) {
|
|
|
95
97
|
selected = _useState12[0],
|
|
96
98
|
setSelected = _useState12[1];
|
|
97
99
|
|
|
98
|
-
var _useState13 = (0, _react.useState)(
|
|
99
|
-
return (// @ts-ignore
|
|
100
|
-
window.BSGlobal.OkrAdvancedSetting.KRSetting.ShowKrProgress
|
|
101
|
-
);
|
|
102
|
-
}),
|
|
100
|
+
var _useState13 = (0, _react.useState)((_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.ShowKrProgress),
|
|
103
101
|
_useState14 = _slicedToArray(_useState13, 1),
|
|
104
102
|
ShowKrProgress = _useState14[0];
|
|
105
103
|
|
|
@@ -136,11 +134,11 @@ var ProgressModal = function ProgressModal(props) {
|
|
|
136
134
|
case 3:
|
|
137
135
|
data = _context.sent;
|
|
138
136
|
|
|
139
|
-
if (data.Code
|
|
137
|
+
if (data.Code === 1) {
|
|
140
138
|
_data$Data = data.Data, UpdateProgressWay = _data$Data.UpdateProgressWay, Progress = _data$Data.Progress;
|
|
141
139
|
setRecommandProgressObj(data.Data);
|
|
142
|
-
setUpdate(UpdateProgressWay
|
|
143
|
-
setUpdateWay(UpdateProgressWay
|
|
140
|
+
setUpdate(UpdateProgressWay !== 0);
|
|
141
|
+
setUpdateWay(UpdateProgressWay === 0 ? 1 : UpdateProgressWay);
|
|
144
142
|
setProgress(Progress);
|
|
145
143
|
}
|
|
146
144
|
|
|
@@ -169,8 +167,14 @@ var ProgressModal = function ProgressModal(props) {
|
|
|
169
167
|
var childOkrProgress = recommandProgressObj.childOkrProgress,
|
|
170
168
|
childkrProgress = recommandProgressObj.childkrProgress,
|
|
171
169
|
childEProgress = recommandProgressObj.childEProgress;
|
|
172
|
-
|
|
173
|
-
updateWay
|
|
170
|
+
|
|
171
|
+
if (updateWay === 1) {
|
|
172
|
+
setProgress(isKr ? (0, _helper.transProgress)(childEProgress) : (0, _helper.transProgress)(childkrProgress));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (updateWay === 2) {
|
|
176
|
+
setProgress((0, _helper.transProgress)(childOkrProgress));
|
|
177
|
+
}
|
|
174
178
|
}, [updateWay, autoUpdate, recommandProgressObj]);
|
|
175
179
|
|
|
176
180
|
var descriptionText = /*#__PURE__*/_react["default"].createElement(_style.Item, null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -229,7 +233,8 @@ var ProgressModal = function ProgressModal(props) {
|
|
|
229
233
|
okDisabled: errorProgress || errorRemark,
|
|
230
234
|
title: title,
|
|
231
235
|
visible: visible,
|
|
232
|
-
width: 600
|
|
236
|
+
width: 600,
|
|
237
|
+
zIndex: 2400
|
|
233
238
|
}, /*#__PURE__*/_react["default"].createElement(_style.List, null, /*#__PURE__*/_react["default"].createElement(_style.Item, null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
234
239
|
className: "auto-update__item-label"
|
|
235
240
|
}, (0, _getLocale.getLocale)("OKR_MyO_Pop_Upd_Progresss1")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -259,7 +264,7 @@ var ProgressModal = function ProgressModal(props) {
|
|
|
259
264
|
}
|
|
260
265
|
}, /*#__PURE__*/_react["default"].createElement(_style.Icon, {
|
|
261
266
|
color: option.color,
|
|
262
|
-
className: selected
|
|
267
|
+
className: selected === option.id ? "tu-icon-singlebox-avtive" : "tu-icon-singlebox-have"
|
|
263
268
|
}), /*#__PURE__*/_react["default"].createElement("p", null, option.text));
|
|
264
269
|
}))), descriptionText, /*#__PURE__*/_react["default"].createElement("div", {
|
|
265
270
|
className: "auto-update-setting"
|
|
@@ -278,7 +283,7 @@ var ProgressModal = function ProgressModal(props) {
|
|
|
278
283
|
},
|
|
279
284
|
className: "auto-update-setting__option"
|
|
280
285
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
281
|
-
className: (0, _classnames["default"])("auto-update-setting__radio", "auto-update-setting__radio".concat(updateWay
|
|
286
|
+
className: (0, _classnames["default"])("auto-update-setting__radio", "auto-update-setting__radio".concat(updateWay === option.key ? "--selected" : ""))
|
|
282
287
|
}), /*#__PURE__*/_react["default"].createElement("span", null, option.label), /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
283
288
|
content: option.tooltip,
|
|
284
289
|
container: document.body,
|
|
@@ -76,7 +76,8 @@ var ShareContent = function ShareContent(_ref) {
|
|
|
76
76
|
var OkrShare = function OkrShare(_ref2) {
|
|
77
77
|
var data = _ref2.data,
|
|
78
78
|
visible = _ref2.visible,
|
|
79
|
-
onClose = _ref2.onClose
|
|
79
|
+
onClose = _ref2.onClose,
|
|
80
|
+
zIndex = _ref2.zIndex;
|
|
80
81
|
var modalRef = (0, _react.useRef)();
|
|
81
82
|
return /*#__PURE__*/_react["default"].createElement(_titaUi.Modal, {
|
|
82
83
|
visible: visible,
|
|
@@ -87,7 +88,8 @@ var OkrShare = function OkrShare(_ref2) {
|
|
|
87
88
|
onCancel: function onCancel() {
|
|
88
89
|
return onClose();
|
|
89
90
|
},
|
|
90
|
-
ref: modalRef
|
|
91
|
+
ref: modalRef,
|
|
92
|
+
zIndex: zIndex
|
|
91
93
|
}, visible ? /*#__PURE__*/_react["default"].createElement(ShareContent, {
|
|
92
94
|
closeModal: function closeModal() {
|
|
93
95
|
return onClose();
|
|
@@ -99,5 +101,8 @@ var OkrShare = function OkrShare(_ref2) {
|
|
|
99
101
|
}) : null);
|
|
100
102
|
};
|
|
101
103
|
|
|
104
|
+
OkrShare.defaultProps = {
|
|
105
|
+
zIndex: 1300
|
|
106
|
+
};
|
|
102
107
|
var _default = OkrShare;
|
|
103
108
|
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
|
|
27
|
-
option.yqmNum = 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
|
|
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
|
|
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)
|
|
114
|
+
return Number(item.title) === currentYear;
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
-
if (computeType
|
|
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
|
|
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
|
|
230
|
-
month -= month % 2
|
|
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 #
|
|
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: #
|
|
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: #
|
|
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: #
|
|
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: #
|
|
154
|
+
background: #ffffff;
|
|
155
155
|
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
156
|
-
border: 1px solid #
|
|
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: #
|
|
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: #
|
|
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: #
|
|
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: #
|
|
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.
|
|
3
|
+
"version": "1.9.81",
|
|
4
4
|
"nameCN": "",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"react-content-loader": "^6.0.3",
|
|
117
117
|
"react-cropper": "^2.1.8",
|
|
118
118
|
"react-custom-scrollbars": "^4.2.1",
|
|
119
|
+
"react-dom": "^17.0.2",
|
|
119
120
|
"react-grid-layout": "^1.2.5",
|
|
120
121
|
"react-perfect-scrollbar": "^1.5.8",
|
|
121
122
|
"react-sizeme": "^3.0.1",
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
} from "./styledComponents";
|
|
5
5
|
import { OkrData } from "./types";
|
|
6
6
|
import { OpenUserName } from "../../utils/open-data";
|
|
7
|
-
import drawerManager from "../../components/drawer-manager";
|
|
8
7
|
import { getTypeMap } from "./constant";
|
|
9
8
|
import { getMonth } from "../../utils/constant";
|
|
10
9
|
import Tooltip from "../tooltip";
|
|
@@ -28,6 +27,9 @@ const colorMap = {
|
|
|
28
27
|
};
|
|
29
28
|
|
|
30
29
|
export default class Item extends PureComponent<Props, State> {
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
isObjectiveRelevanceKr: boolean = window.BSGlobal.OkrAdvancedSetting.KRSetting.ObjectiveRelevanceKr;
|
|
32
|
+
|
|
31
33
|
constructor(props: Props) {
|
|
32
34
|
super(props);
|
|
33
35
|
this.state = {
|
|
@@ -35,9 +37,6 @@ export default class Item extends PureComponent<Props, State> {
|
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
isObjectiveRelevanceKr: boolean = BSGlobal.OkrAdvancedSetting.KRSetting.ObjectiveRelevanceKr;
|
|
40
|
-
|
|
41
40
|
componentDidMount() {
|
|
42
41
|
this.isExtend();
|
|
43
42
|
}
|
|
@@ -66,7 +65,7 @@ export default class Item extends PureComponent<Props, State> {
|
|
|
66
65
|
const { data, active } = this.props;
|
|
67
66
|
const { isExpand } = this.state;
|
|
68
67
|
if (data.Krs.length > 0) {
|
|
69
|
-
const isRelatedKr = data.Krs.some((item) => item.mileStoneId
|
|
68
|
+
const isRelatedKr = data.Krs.some((item) => item.mileStoneId === (active.workId || active.mileStoneId));
|
|
70
69
|
this.setState({
|
|
71
70
|
isExpand: isRelatedKr ? true : isExpand || data.isOpen,
|
|
72
71
|
});
|
|
@@ -76,8 +75,8 @@ export default class Item extends PureComponent<Props, State> {
|
|
|
76
75
|
htmlToText = (text) => {
|
|
77
76
|
const div = document.createElement("div");
|
|
78
77
|
div.innerHTML = text;
|
|
79
|
-
|
|
80
|
-
return
|
|
78
|
+
const newtext = div.innerText || div.textContent;
|
|
79
|
+
return newtext;
|
|
81
80
|
};
|
|
82
81
|
|
|
83
82
|
getCycleText = () => {
|
|
@@ -93,7 +92,7 @@ export default class Item extends PureComponent<Props, State> {
|
|
|
93
92
|
case 2: return hzNum[data.yqmnum - 1];
|
|
94
93
|
case 3: return getMonth()[data.yqmnum - 1];
|
|
95
94
|
case 4: return `${getMonth()[data.yqmnum - 1]}-${getMonth()[((data.yqmnum + 1) % 12 || 12) - 1]}月`;
|
|
96
|
-
case 5: return data.yqmnum
|
|
95
|
+
case 5: return data.yqmnum === 1 ? getLocale("OKR_MyO_Pop_Firsthalf") : getLocale("OKR_MyO_Pop_Secondhalf");
|
|
97
96
|
default: return getLocale("Mod_Customization");
|
|
98
97
|
}
|
|
99
98
|
};
|
|
@@ -111,17 +110,18 @@ export default class Item extends PureComponent<Props, State> {
|
|
|
111
110
|
return newstr;
|
|
112
111
|
};
|
|
113
112
|
|
|
114
|
-
|
|
113
|
+
dealOkrData = (data: OkrData, keyWords: string) => {
|
|
114
|
+
const newData = data;
|
|
115
115
|
if (keyWords) {
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
newData.workName = this.formatKeywordsFunc(data.workName, keyWords);
|
|
117
|
+
newData.Krs.forEach((item) => {
|
|
118
118
|
item.mileStoneName = this.formatKeywordsFunc(item.mileStoneName, keyWords);
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
return data;
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
-
okrData: any = this.
|
|
124
|
+
okrData: any = this.dealOkrData(this.props.data, this.props.keywords);
|
|
125
125
|
|
|
126
126
|
render() {
|
|
127
127
|
const { data, active, isShowKr } = this.props;
|
|
@@ -130,12 +130,12 @@ export default class Item extends PureComponent<Props, State> {
|
|
|
130
130
|
<ItemWrapper>
|
|
131
131
|
<ItemObjectiveContainer onClick={() => this.setState({ isExpand: !isExpand })}>
|
|
132
132
|
<ItemTop>
|
|
133
|
-
<Radio onClick={(e: any) => this.onSelect(e, data)} active={active && data.workId
|
|
133
|
+
<Radio onClick={(e: any) => this.onSelect(e, data)} active={active && data.workId === active.workId} />
|
|
134
134
|
<Tag color={colorMap[data.cycleType] || colorMap[4]}>{this.getCycleText()}</Tag>
|
|
135
135
|
<WorkNameWrapper isShowKr={isShowKr}>
|
|
136
|
-
<Tooltip
|
|
136
|
+
<Tooltip placement="top" overlay={this.htmlToText(this.okrData.workName)}>
|
|
137
137
|
<OkrName isKr={false} isShowKr={isShowKr} dangerouslySetInnerHTML={{ __html: this.okrData.workName }} />
|
|
138
|
-
</Tooltip
|
|
138
|
+
</Tooltip>
|
|
139
139
|
</WorkNameWrapper>
|
|
140
140
|
{this.isObjectiveRelevanceKr && isShowKr && data.Krs.length > 0 && <span className={`${this.state.isExpand ? "tu-icon-arrow-up" : "tu-icon-arrow-down"}`} />}
|
|
141
141
|
</ItemTop>
|
|
@@ -167,20 +167,20 @@ export default class Item extends PureComponent<Props, State> {
|
|
|
167
167
|
{
|
|
168
168
|
this.okrData.Krs.length > 0 && this.okrData.Krs.map((item: any, index: number) => (this.isObjectiveRelevanceKr ? (
|
|
169
169
|
<ItemTop key={item.mileStoneId}>
|
|
170
|
-
<Radio onClick={(e: any) => this.onSelect(e, data.Krs[index])} active={active && item.mileStoneId
|
|
170
|
+
<Radio onClick={(e: any) => this.onSelect(e, data.Krs[index])} active={active && item.mileStoneId === (active.workId || active.mileStoneId)} />
|
|
171
171
|
<WorkNameWrapper isShowKr={isShowKr}>
|
|
172
|
-
<Tooltip
|
|
172
|
+
<Tooltip placement="top" overlay={this.htmlToText(item.mileStoneName)}>
|
|
173
173
|
<OkrName isKr isShowKr={isShowKr} dangerouslySetInnerHTML={{ __html: `KR${index + 1}:${item.mileStoneName}` }} />
|
|
174
|
-
</Tooltip
|
|
174
|
+
</Tooltip>
|
|
175
175
|
</WorkNameWrapper>
|
|
176
176
|
</ItemTop>
|
|
177
|
-
) : active && item.mileStoneId
|
|
177
|
+
) : active && item.mileStoneId === (active.workId || active.mileStoneId) ? (
|
|
178
178
|
<ItemTop key={item.mileStoneId}>
|
|
179
|
-
<Radio onClick={(e: any) => this.onSelect(e, data.Krs[index])} active={active && item.mileStoneId
|
|
179
|
+
<Radio onClick={(e: any) => this.onSelect(e, data.Krs[index])} active={active && item.mileStoneId === (active.workId || active.mileStoneId)} />
|
|
180
180
|
<WorkNameWrapper isShowKr={isShowKr}>
|
|
181
|
-
<Tooltip
|
|
181
|
+
<Tooltip placement="top" overlay={this.htmlToText(item.mileStoneName)}>
|
|
182
182
|
<OkrName isKr isShowKr={isShowKr} dangerouslySetInnerHTML={{ __html: `KR${index + 1}:${item.mileStoneName}` }} />
|
|
183
|
-
</Tooltip
|
|
183
|
+
</Tooltip>
|
|
184
184
|
</WorkNameWrapper>
|
|
185
185
|
</ItemTop>
|
|
186
186
|
) : ""))
|
|
@@ -3,7 +3,7 @@ import styled from "styled-components";
|
|
|
3
3
|
export const Wrapper = styled.div`
|
|
4
4
|
width: 589px;
|
|
5
5
|
height: 488px;
|
|
6
|
-
margin-top: ${(p: any) => (p.okrPopType
|
|
6
|
+
margin-top: ${(p: any) => (p.okrPopType === 1 ? 0 : "32px")};
|
|
7
7
|
background: #ffffff;
|
|
8
8
|
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.2);
|
|
9
9
|
border-radius: 4px;
|
|
@@ -230,11 +230,17 @@ export const Tag = styled.div`
|
|
|
230
230
|
margin: 0 12px 0 9px;
|
|
231
231
|
`;
|
|
232
232
|
export const OkrName = styled.span`
|
|
233
|
+
display: inline-block
|
|
233
234
|
flex: 1;
|
|
234
|
-
width:
|
|
235
|
+
max-width: 400px;
|
|
235
236
|
font-size: 13px;
|
|
236
237
|
font-weight: ${(p: any) => (p.isShowKr ? "normal" : "600")};
|
|
237
238
|
color: #33383d;
|
|
239
|
+
white-space: nowrap;
|
|
240
|
+
overflow: hidden;
|
|
241
|
+
word-break: keep-all;
|
|
242
|
+
text-overflow: ellipsis;
|
|
243
|
+
line-height: 1;
|
|
238
244
|
`;
|
|
239
245
|
export const ItemBottom = styled.div`
|
|
240
246
|
padding-left: 102px;
|
|
@@ -274,14 +280,14 @@ export const Button = styled.a`
|
|
|
274
280
|
padding: 0 15px;
|
|
275
281
|
box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.21);
|
|
276
282
|
border-radius: 2px;
|
|
277
|
-
background-color: ${(p: any) => (p.type
|
|
278
|
-
color: ${(p: any) => (p.type
|
|
283
|
+
background-color: ${(p: any) => (p.type !== "confirm" ? "#FAFBFC" : p.disabled ? "#E7EEF3" : "#2879FF")};
|
|
284
|
+
color: ${(p: any) => (p.type !== "confirm" ? "#565E66" : "#FFF")};
|
|
279
285
|
cursor: pointer;
|
|
280
286
|
text-align: center;
|
|
281
287
|
white-space: nowrap;
|
|
282
288
|
line-height: 27px;
|
|
283
289
|
&:hover {
|
|
284
|
-
color: ${(p: any) => (p.type
|
|
290
|
+
color: ${(p: any) => (p.type !== "confirm" ? "#565E66" : "#FFF")};
|
|
285
291
|
}
|
|
286
292
|
`;
|
|
287
293
|
export const KrItemWrapper = styled.div`
|
|
@@ -61,19 +61,18 @@ export const Textarea = styled.textarea`
|
|
|
61
61
|
word-break: break-all;
|
|
62
62
|
word-wrap: break-word;
|
|
63
63
|
height: 160px;
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
line-height: 22px;
|
|
64
66
|
|
|
65
67
|
&.textarea-setheight {
|
|
66
68
|
visibility: hidden;
|
|
67
69
|
position: absolute;
|
|
68
70
|
}
|
|
69
|
-
/*
|
|
70
|
-
&.private__bg {
|
|
71
|
-
background: url(${require("./assets/lock-radius.png")}) no-repeat right top;
|
|
72
|
-
} */
|
|
73
71
|
`;
|
|
74
72
|
|
|
75
73
|
export const Tips = styled.div`
|
|
76
|
-
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
line-height: 22px;
|
|
77
76
|
color: ${(p: any) => p.color};
|
|
78
77
|
text-align: right;
|
|
79
78
|
`;
|
|
@@ -18,7 +18,7 @@ function OkrDetailHeaderConfirm({ onConfirm, title = "", content = "" }: Props):
|
|
|
18
18
|
}, []);
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
|
-
<Confirm visible={visible} type="warning">
|
|
21
|
+
<Confirm visible={visible} type="warning" zIndex={2400}>
|
|
22
22
|
{
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
<span type="title">{title}</span>
|
|
@@ -71,13 +71,15 @@ function OkrDetailHeader({ detailInfo }: Props): ReactElement {
|
|
|
71
71
|
visibility: context.generalVisibility.visibility,
|
|
72
72
|
detailInfo,
|
|
73
73
|
openShareModal: async () => {
|
|
74
|
-
const
|
|
75
|
-
setKrs(
|
|
74
|
+
const krss = await getKrs({ okrId: detailInfo.workId });
|
|
75
|
+
setKrs(krss);
|
|
76
76
|
setShareVisible(true);
|
|
77
77
|
},
|
|
78
78
|
changeVisiblilty: (visibility) => {
|
|
79
|
-
if (visibility
|
|
80
|
-
|
|
79
|
+
if (visibility === 4) {
|
|
80
|
+
if (userSelectRef.current) {
|
|
81
|
+
userSelectRef.current.open();
|
|
82
|
+
}
|
|
81
83
|
return;
|
|
82
84
|
}
|
|
83
85
|
changVisiblity(detailInfo.workId, visibility);
|
|
@@ -100,10 +102,11 @@ function OkrDetailHeader({ detailInfo }: Props): ReactElement {
|
|
|
100
102
|
: getLocale("OKR_MyO_Err_Progress"),
|
|
101
103
|
);
|
|
102
104
|
if (res) {
|
|
103
|
-
follow
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
if (follow) {
|
|
106
|
+
await addUser(loginUserId, detailInfo.workId, 3);
|
|
107
|
+
} else {
|
|
108
|
+
await deleteUser(loginUserId, detailInfo.workId, 3);
|
|
109
|
+
}
|
|
107
110
|
context.setGeneralRoleType(follow ? 3 : 0);
|
|
108
111
|
// 关注
|
|
109
112
|
Toast.Success(getLocale("Mod_Successfuloperat"));
|
|
@@ -117,9 +120,11 @@ function OkrDetailHeader({ detailInfo }: Props): ReactElement {
|
|
|
117
120
|
isFinish ? getLocale("OKR_MyO_Areycloseobjective") : getLocale("OKR_MyO_Err_Restart"),
|
|
118
121
|
);
|
|
119
122
|
if (res) {
|
|
120
|
-
isFinish
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
if (isFinish) {
|
|
124
|
+
await close(detailInfo.workId);
|
|
125
|
+
} else {
|
|
126
|
+
await start(detailInfo.workId);
|
|
127
|
+
}
|
|
123
128
|
commonContext.refreshAll();
|
|
124
129
|
// 刷新
|
|
125
130
|
Toast.Success(getLocale("Mod_Successfuloperat"));
|
|
@@ -172,7 +177,7 @@ function OkrDetailHeader({ detailInfo }: Props): ReactElement {
|
|
|
172
177
|
<span className="okr-detail-head-parent">
|
|
173
178
|
<i className="tu-icon-liebiao-duiqinubiao" />
|
|
174
179
|
<span
|
|
175
|
-
onClick={() => (parent.type
|
|
180
|
+
onClick={() => (parent.type === "okr"
|
|
176
181
|
? drawerManager.open("okrDetail", {
|
|
177
182
|
okrId: parent.id,
|
|
178
183
|
})
|
|
@@ -180,7 +185,7 @@ function OkrDetailHeader({ detailInfo }: Props): ReactElement {
|
|
|
180
185
|
krId: parent.id,
|
|
181
186
|
}))}
|
|
182
187
|
>
|
|
183
|
-
<span>{parent.type
|
|
188
|
+
<span>{parent.type === "okr" ? "O " : "KR "}</span>
|
|
184
189
|
{parent.name}
|
|
185
190
|
</span>
|
|
186
191
|
</span>
|
|
@@ -202,6 +207,7 @@ function OkrDetailHeader({ detailInfo }: Props): ReactElement {
|
|
|
202
207
|
},
|
|
203
208
|
},
|
|
204
209
|
}}
|
|
210
|
+
zIndex={2400}
|
|
205
211
|
/>
|
|
206
212
|
<PopConfirm
|
|
207
213
|
ref={popRef}
|