@titaui/pc 1.10.80 → 1.10.81-beta.1
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/lib/components/button/rect-btn/index.css +25 -11
- package/lib/components/button/rect-btn/index.js +8 -4
- package/lib/components/drawer/index.js +23 -5
- package/lib/components/menus/export-modules/okr-menus/subordinate-menus/index.js +7 -3
- package/lib/components/nav-top/index.js +6 -2
- package/lib/index.js +38 -0
- package/lib/pages/group-management/tree/group-form/index.js +1 -1
- package/lib/pages/new-okr-list/header/common.js +52 -0
- package/lib/pages/new-okr-list/header/index.css +45 -0
- package/lib/pages/new-okr-list/header/index.js +28 -22
- package/lib/pages/new-okr-list/header/operate-record.js +88 -0
- package/lib/pages/new-okr-list/index.js +9 -7
- package/lib/utils/format-time.js +8 -1
- package/lib/utils/open-data.js +5 -1
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
align-items: center;
|
|
14
14
|
justify-content: center;
|
|
15
15
|
min-width: 64px;
|
|
16
|
-
font-size:
|
|
16
|
+
font-size: 14px;
|
|
17
17
|
padding: 0 12px;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -60,21 +60,35 @@
|
|
|
60
60
|
background: #5c8eff;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
.titaui-rect-btn--secondary {
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
font-weight: normal;
|
|
66
|
+
color: #2879ff;
|
|
67
|
+
line-height: 28px;
|
|
68
|
+
background: rgba(40, 121, 255, 0.2);
|
|
69
|
+
margin-right: 16px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.titaui-rect-btn--secondary:hover {
|
|
73
|
+
color: #fff;
|
|
74
|
+
background-color: #2879ff;
|
|
75
|
+
}
|
|
76
|
+
|
|
63
77
|
.titaui-rect-btn--cancel {
|
|
64
|
-
color: #
|
|
65
|
-
border: 1px solid #
|
|
66
|
-
background: #
|
|
78
|
+
color: #6f7886;
|
|
79
|
+
border: 1px solid #dfe3ea;
|
|
80
|
+
background: #ffffff;
|
|
67
81
|
}
|
|
68
82
|
|
|
69
83
|
.titaui-rect-btn--cancel:hover {
|
|
70
|
-
color: #
|
|
71
|
-
border: 1px solid #
|
|
84
|
+
color: #2879ff;
|
|
85
|
+
border: 1px solid #2879ff;
|
|
72
86
|
}
|
|
73
87
|
|
|
74
88
|
.titaui-rect-btn--delete {
|
|
75
|
-
background: #
|
|
76
|
-
color: #
|
|
77
|
-
border: 1px solid #
|
|
89
|
+
background: #ffffff;
|
|
90
|
+
color: #f05e5e;
|
|
91
|
+
border: 1px solid #f05e5e;
|
|
78
92
|
}
|
|
79
93
|
|
|
80
94
|
.titaui-rect-btn--delete:hover {
|
|
@@ -93,10 +107,10 @@
|
|
|
93
107
|
}
|
|
94
108
|
|
|
95
109
|
.titaui-rect-btn--primary.titaui-rect-btn--disabled {
|
|
96
|
-
background: #
|
|
110
|
+
background: #93bcff;
|
|
97
111
|
opacity: 1;
|
|
98
112
|
}
|
|
99
113
|
|
|
100
114
|
.titaui-rect-btn--primary.titaui-rect-btn--disabled:hover {
|
|
101
|
-
background: #
|
|
115
|
+
background: #93bcff;
|
|
102
116
|
}
|
|
@@ -34,7 +34,8 @@ function RectBtn(props) {
|
|
|
34
34
|
className = _props$className === void 0 ? "" : _props$className,
|
|
35
35
|
_props$disabled = props.disabled,
|
|
36
36
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
37
|
-
style = props.style
|
|
37
|
+
style = props.style,
|
|
38
|
+
children = props.children;
|
|
38
39
|
|
|
39
40
|
var renderIcon = function renderIcon() {
|
|
40
41
|
if (typeof icon === "string") {
|
|
@@ -50,16 +51,19 @@ function RectBtn(props) {
|
|
|
50
51
|
}, icon);
|
|
51
52
|
};
|
|
52
53
|
|
|
53
|
-
var onClickHandler = function onClickHandler() {
|
|
54
|
+
var onClickHandler = function onClickHandler(e) {
|
|
54
55
|
if (disabled) return;
|
|
55
|
-
|
|
56
|
+
|
|
57
|
+
if (onClick) {
|
|
58
|
+
onClick(e);
|
|
59
|
+
}
|
|
56
60
|
};
|
|
57
61
|
|
|
58
62
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
59
63
|
className: (0, _classnames["default"])(precls, "".concat(precls, "--").concat(type), "".concat(precls, "--").concat(size), _defineProperty({}, "".concat(precls, "--disabled"), disabled), className),
|
|
60
64
|
style: style,
|
|
61
65
|
onClick: onClickHandler
|
|
62
|
-
}, icon && renderIcon(),
|
|
66
|
+
}, icon && renderIcon(), children || text);
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
var _default = RectBtn;
|
|
@@ -25,7 +25,9 @@ require("./index.css");
|
|
|
25
25
|
|
|
26
26
|
var _context = _interopRequireDefault(require("../drawer-manager/context"));
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _dom = require("./utils/dom");
|
|
29
|
+
|
|
30
|
+
var _excluded = ["visible", "placement", "children", "mask", "width", "className", "contentWrapperStyle", "onClose", "style", "afterVisibleChange", "destroyOnClose", "bodyStyle", "zIndex", "autoClosable"];
|
|
29
31
|
|
|
30
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
33
|
|
|
@@ -54,7 +56,7 @@ var Drawer = function Drawer(props) {
|
|
|
54
56
|
|
|
55
57
|
var visible = props.visible,
|
|
56
58
|
_props$placement = props.placement,
|
|
57
|
-
placement = _props$placement === void 0 ?
|
|
59
|
+
placement = _props$placement === void 0 ? 'right' : _props$placement,
|
|
58
60
|
children = props.children,
|
|
59
61
|
_props$mask = props.mask,
|
|
60
62
|
mask = _props$mask === void 0 ? false : _props$mask,
|
|
@@ -70,6 +72,8 @@ var Drawer = function Drawer(props) {
|
|
|
70
72
|
bodyStyle = props.bodyStyle,
|
|
71
73
|
_props$zIndex = props.zIndex,
|
|
72
74
|
zIndex = _props$zIndex === void 0 ? 1200 : _props$zIndex,
|
|
75
|
+
_props$autoClosable = props.autoClosable,
|
|
76
|
+
autoClosable = _props$autoClosable === void 0 ? false : _props$autoClosable,
|
|
73
77
|
rest = _objectWithoutProperties(props, _excluded);
|
|
74
78
|
|
|
75
79
|
var handleAfterVisibleChange = (0, _react.useCallback)(function (opened) {
|
|
@@ -89,6 +93,20 @@ var Drawer = function Drawer(props) {
|
|
|
89
93
|
return children;
|
|
90
94
|
}
|
|
91
95
|
|
|
96
|
+
var autoClose = function autoClose(e) {
|
|
97
|
+
if ((0, _dom.hasAncestorElement)(e.target, 'document-mouse-event-ignore,rc-tooltip,titaui-popup,rc-dialog-root,common-modal,in-modal,task-hot-add')) return;
|
|
98
|
+
onClose();
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
(0, _react.useEffect)(function () {
|
|
102
|
+
if (autoClosable) {
|
|
103
|
+
document.addEventListener('mousedown', autoClose);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return function () {
|
|
107
|
+
document.removeEventListener('mousedown', autoClose);
|
|
108
|
+
};
|
|
109
|
+
}, []);
|
|
92
110
|
return /*#__PURE__*/_react["default"].createElement(DrawerContext.Provider, {
|
|
93
111
|
value: {
|
|
94
112
|
close: function close() {
|
|
@@ -96,7 +114,7 @@ var Drawer = function Drawer(props) {
|
|
|
96
114
|
}
|
|
97
115
|
}
|
|
98
116
|
}, /*#__PURE__*/_react["default"].createElement(_rcDrawer["default"], _extends({
|
|
99
|
-
className: (0, _classnames["default"])(
|
|
117
|
+
className: (0, _classnames["default"])('titaui-drawer', 'document-mouse-event-ignore', className),
|
|
100
118
|
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
101
119
|
zIndex: zIndex
|
|
102
120
|
})
|
|
@@ -145,7 +163,7 @@ function DrawerHeader(_ref) {
|
|
|
145
163
|
onClick: manager && manager.goBack
|
|
146
164
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
147
165
|
className: "tu-icon-fanhui"
|
|
148
|
-
}), (0, _getLocale.getLocale)(
|
|
166
|
+
}), (0, _getLocale.getLocale)('Mod_Back')), showBackBtn && hasContent && /*#__PURE__*/_react["default"].createElement("div", {
|
|
149
167
|
className: "titaui-drawer-header-divider"
|
|
150
168
|
}), hasContent && content, /*#__PURE__*/_react["default"].createElement("div", {
|
|
151
169
|
style: {
|
|
@@ -154,7 +172,7 @@ function DrawerHeader(_ref) {
|
|
|
154
172
|
}), displayActions.map(function (action) {
|
|
155
173
|
return /*#__PURE__*/_react["default"].createElement(_headerAction["default"], action);
|
|
156
174
|
}), !!collapsedActions.length && /*#__PURE__*/_react["default"].createElement(_headerAction["default"], {
|
|
157
|
-
title: (0, _getLocale.getLocale)(
|
|
175
|
+
title: (0, _getLocale.getLocale)('Mod_MoreOperate'),
|
|
158
176
|
icon: "tu-icon-10",
|
|
159
177
|
children: collapsedActions
|
|
160
178
|
}), showClose && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -97,9 +97,13 @@ function _default(props) {
|
|
|
97
97
|
}, {
|
|
98
98
|
disabledDottedSubordinatesDig: true
|
|
99
99
|
}).then(function (users) {
|
|
100
|
-
var rawTreeData = (0, _helper.transToTreeNode)(users);
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
var rawTreeData = (0, _helper.transToTreeNode)(users); // 要过滤掉那些既是登录者的虚线下级,又是登录者下属的下级,让他默认展开的时候重新获取
|
|
101
|
+
|
|
102
|
+
var newRawTreeData = rawTreeData.filter(function (item) {
|
|
103
|
+
return item.pid === loginUserId;
|
|
104
|
+
});
|
|
105
|
+
setRawTreeData(newRawTreeData);
|
|
106
|
+
setTreeData((0, _utils.toTree)(newRawTreeData));
|
|
103
107
|
setLoading(false);
|
|
104
108
|
});
|
|
105
109
|
}, []);
|
|
@@ -15,6 +15,8 @@ var _bsGlobal = require("../../utils/bs-global");
|
|
|
15
15
|
|
|
16
16
|
var _userOwnMenu = _interopRequireDefault(require("./components/user-own-menu"));
|
|
17
17
|
|
|
18
|
+
var _useGlobalValue = _interopRequireDefault(require("./useGlobalValue"));
|
|
19
|
+
|
|
18
20
|
var _menu = _interopRequireDefault(require("./components/menu"));
|
|
19
21
|
|
|
20
22
|
var _userMessage = _interopRequireDefault(require("./components/user-message"));
|
|
@@ -170,5 +172,7 @@ var NavTop = function NavTop() {
|
|
|
170
172
|
}, /*#__PURE__*/_react["default"].createElement(_userOwnMenu["default"], null)));
|
|
171
173
|
};
|
|
172
174
|
|
|
173
|
-
var _default = NavTop;
|
|
174
|
-
|
|
175
|
+
var _default = NavTop; // @ts-ignore
|
|
176
|
+
|
|
177
|
+
exports["default"] = _default;
|
|
178
|
+
NavTop.useGlobalValue = _useGlobalValue["default"];
|
package/lib/index.js
CHANGED
|
@@ -51,6 +51,12 @@ Object.defineProperty(exports, "Communication", {
|
|
|
51
51
|
return _communication["default"];
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
+
Object.defineProperty(exports, "ConditionRender", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _conditionRender["default"];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
54
60
|
Object.defineProperty(exports, "Confidence", {
|
|
55
61
|
enumerable: true,
|
|
56
62
|
get: function get() {
|
|
@@ -63,6 +69,12 @@ Object.defineProperty(exports, "CreateOkrModal", {
|
|
|
63
69
|
return _createOkrModal["default"];
|
|
64
70
|
}
|
|
65
71
|
});
|
|
72
|
+
Object.defineProperty(exports, "DangerousHtml", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function get() {
|
|
75
|
+
return _dangerousHtml["default"];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
66
78
|
Object.defineProperty(exports, "DatePicker", {
|
|
67
79
|
enumerable: true,
|
|
68
80
|
get: function get() {
|
|
@@ -309,6 +321,12 @@ Object.defineProperty(exports, "OkrcaseLibraryCard", {
|
|
|
309
321
|
return _okrcaseLibraryCard["default"];
|
|
310
322
|
}
|
|
311
323
|
});
|
|
324
|
+
Object.defineProperty(exports, "OpenData", {
|
|
325
|
+
enumerable: true,
|
|
326
|
+
get: function get() {
|
|
327
|
+
return _openData["default"];
|
|
328
|
+
}
|
|
329
|
+
});
|
|
312
330
|
Object.defineProperty(exports, "OperationRecords", {
|
|
313
331
|
enumerable: true,
|
|
314
332
|
get: function get() {
|
|
@@ -375,6 +393,12 @@ Object.defineProperty(exports, "Progress", {
|
|
|
375
393
|
return _progress["default"];
|
|
376
394
|
}
|
|
377
395
|
});
|
|
396
|
+
Object.defineProperty(exports, "PublishDynamicModal", {
|
|
397
|
+
enumerable: true,
|
|
398
|
+
get: function get() {
|
|
399
|
+
return _publishDynamicModal["default"];
|
|
400
|
+
}
|
|
401
|
+
});
|
|
378
402
|
Object.defineProperty(exports, "Radio", {
|
|
379
403
|
enumerable: true,
|
|
380
404
|
get: function get() {
|
|
@@ -465,6 +489,12 @@ Object.defineProperty(exports, "TaskRelationModal", {
|
|
|
465
489
|
return _taskRelationModal["default"];
|
|
466
490
|
}
|
|
467
491
|
});
|
|
492
|
+
Object.defineProperty(exports, "TimeFormat", {
|
|
493
|
+
enumerable: true,
|
|
494
|
+
get: function get() {
|
|
495
|
+
return _formatTime["default"];
|
|
496
|
+
}
|
|
497
|
+
});
|
|
468
498
|
Object.defineProperty(exports, "TitaChart", {
|
|
469
499
|
enumerable: true,
|
|
470
500
|
get: function get() {
|
|
@@ -766,4 +796,12 @@ var _videoModal = _interopRequireDefault(require("./components/video-modal"));
|
|
|
766
796
|
|
|
767
797
|
var _supersetCharts = _interopRequireDefault(require("./components/superset-charts"));
|
|
768
798
|
|
|
799
|
+
var _conditionRender = _interopRequireDefault(require("./components/condition-render"));
|
|
800
|
+
|
|
801
|
+
var _publishDynamicModal = _interopRequireDefault(require("./components/publish-dynamic-modal"));
|
|
802
|
+
|
|
803
|
+
var _dangerousHtml = _interopRequireDefault(require("./components/dangerous-html"));
|
|
804
|
+
|
|
805
|
+
var _formatTime = _interopRequireDefault(require("./utils/format-time"));
|
|
806
|
+
|
|
769
807
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -183,7 +183,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
183
183
|
}), /*#__PURE__*/_react["default"].createElement("label", {
|
|
184
184
|
htmlFor: "total",
|
|
185
185
|
className: "text"
|
|
186
|
-
}, (0, _getLocale.getLocale)("
|
|
186
|
+
}, (0, _getLocale.getLocale)("Backst_Visibletoall"))), /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement(_titaUi.Radio, {
|
|
187
187
|
id: "scope",
|
|
188
188
|
checked: scopeChecked == 1,
|
|
189
189
|
onChange: function onChange() {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatPeriod = void 0;
|
|
7
|
+
|
|
8
|
+
var _getLocale = require("../../../utils/getLocale");
|
|
9
|
+
|
|
10
|
+
var _constant = require("../../../utils/constant");
|
|
11
|
+
|
|
12
|
+
var formatPeriod = function formatPeriod(selected) {
|
|
13
|
+
if (!selected) return "";
|
|
14
|
+
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"))];
|
|
15
|
+
var cycleDate = "";
|
|
16
|
+
var annualNum = Number("".concat(selected.annualNum)) === -1 ? "".concat((0, _getLocale.getLocale)("OKR_MyO_Butt_Allyears")) : "".concat(selected.annualNum).concat(_getLocale.isEn ? "" : "年");
|
|
17
|
+
var month = (0, _constant.getMonth)();
|
|
18
|
+
|
|
19
|
+
switch ("".concat(selected.cycleType)) {
|
|
20
|
+
case "-1":
|
|
21
|
+
cycleDate = "".concat((0, _getLocale.getLocale)("OKR_MyO_Butt_AllStatee"));
|
|
22
|
+
break;
|
|
23
|
+
|
|
24
|
+
case "1":
|
|
25
|
+
cycleDate = "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Year"));
|
|
26
|
+
break;
|
|
27
|
+
|
|
28
|
+
case "2":
|
|
29
|
+
// 季度
|
|
30
|
+
cycleDate = quarter[Number(selected.yqmNum)];
|
|
31
|
+
break;
|
|
32
|
+
|
|
33
|
+
case "3":
|
|
34
|
+
cycleDate = month[Number(selected.yqmNum) - 1];
|
|
35
|
+
break;
|
|
36
|
+
|
|
37
|
+
case "4":
|
|
38
|
+
cycleDate = "".concat(month[Number(selected.yqmNum) - 1], " - ").concat(month[((Number(selected.yqmNum) + 1) % 12 || 12) - 1]);
|
|
39
|
+
break;
|
|
40
|
+
|
|
41
|
+
case "5":
|
|
42
|
+
cycleDate = Number("".concat(selected.yqmNum)) === 1 ? "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Firsthalf")) : "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Secondhalf"));
|
|
43
|
+
break;
|
|
44
|
+
|
|
45
|
+
default:
|
|
46
|
+
cycleDate = "".concat((0, _getLocale.getLocale)("Mod_Customization"));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return "".concat(annualNum, " ").concat(cycleDate);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
exports.formatPeriod = formatPeriod;
|
|
@@ -36,6 +36,51 @@
|
|
|
36
36
|
color: #2879ff;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
.tita-okr-list-v2__header-record {
|
|
40
|
+
display: flex;
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
align-items: center;
|
|
44
|
+
transform: rotate(90deg);
|
|
45
|
+
background: #fff;
|
|
46
|
+
box-shadow: 0px 0px 8px 0px rgba(127, 145, 180, 0.1);
|
|
47
|
+
width: 36px;
|
|
48
|
+
height: 36px;
|
|
49
|
+
margin-left: 12px;
|
|
50
|
+
border-radius: 18px;
|
|
51
|
+
font-size: 20px;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.tita-okr-list-v2__header-record-popup {
|
|
56
|
+
padding: 16px 12px;
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
background: #ffffff;
|
|
59
|
+
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
60
|
+
border-radius: 12px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.tita-okr-list-v2__header-record-item {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
padding: 5px 8px;
|
|
67
|
+
box-sizing: border-box;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
color: #3f4755;
|
|
70
|
+
line-height: 22px;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.tita-okr-list-v2__header-record-item:hover {
|
|
75
|
+
color: #2879ff;
|
|
76
|
+
background: #f7f8fa;
|
|
77
|
+
border-radius: 8px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.tita-okr-list-v2__header-record-item-content {
|
|
81
|
+
margin-left: 8px;
|
|
82
|
+
}
|
|
83
|
+
|
|
39
84
|
.tita-okr-list-v2__header-filter {
|
|
40
85
|
box-sizing: border-box;
|
|
41
86
|
height: 36px;
|
|
@@ -29,6 +29,8 @@ var _filter = _interopRequireDefault(require("./filter"));
|
|
|
29
29
|
|
|
30
30
|
var _comments = _interopRequireDefault(require("./comments"));
|
|
31
31
|
|
|
32
|
+
var _operateRecord = _interopRequireDefault(require("./operate-record"));
|
|
33
|
+
|
|
32
34
|
var _context = require("../context");
|
|
33
35
|
|
|
34
36
|
var _requestApi = require("../request-api");
|
|
@@ -84,9 +86,9 @@ function Header(props, ref) {
|
|
|
84
86
|
setUserInfo = _useState6[1];
|
|
85
87
|
|
|
86
88
|
(0, _react.useEffect)(function () {
|
|
87
|
-
if (toUserId !== undefined || relation
|
|
89
|
+
if (toUserId !== undefined || relation === 1) {
|
|
88
90
|
var userId = toUserId;
|
|
89
|
-
if (relation
|
|
91
|
+
if (relation === 1) userId = (0, _bsGlobal.getUserInfo)().Id;
|
|
90
92
|
userId && (0, _requestApi.getUserInfoById)(userId).then(function (res) {
|
|
91
93
|
setUserInfo(res.Data);
|
|
92
94
|
});
|
|
@@ -116,56 +118,56 @@ function Header(props, ref) {
|
|
|
116
118
|
var rootNode = {
|
|
117
119
|
rootId: 0,
|
|
118
120
|
// @ts-ignore
|
|
119
|
-
rootName: window.BSGlobal.tenantInfo.Name ||
|
|
121
|
+
rootName: window.BSGlobal.tenantInfo.Name || ''
|
|
120
122
|
};
|
|
121
123
|
var level2Selected = {
|
|
122
124
|
id: 0,
|
|
123
125
|
// @ts-ignore
|
|
124
|
-
name: window.BSGlobal.tenantInfo.Name ||
|
|
126
|
+
name: window.BSGlobal.tenantInfo.Name || ''
|
|
125
127
|
};
|
|
126
|
-
var searchType =
|
|
128
|
+
var searchType = 'company';
|
|
127
129
|
|
|
128
|
-
if (departmentId && departmentId
|
|
130
|
+
if (departmentId && departmentId !== -1) {
|
|
129
131
|
rootNode.rootId = departmentId;
|
|
130
|
-
rootNode.rootName = departmentName ||
|
|
131
|
-
searchType =
|
|
132
|
+
rootNode.rootName = departmentName || '';
|
|
133
|
+
searchType = 'depart';
|
|
132
134
|
level2Selected.id = departmentId;
|
|
133
|
-
level2Selected.name = departmentName ||
|
|
135
|
+
level2Selected.name = departmentName || '';
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
if (toUserId) {
|
|
137
139
|
rootNode.rootId = toUserId;
|
|
138
|
-
rootNode.rootName = userInfo.name ||
|
|
139
|
-
searchType =
|
|
140
|
+
rootNode.rootName = userInfo.name || '';
|
|
141
|
+
searchType = 'user';
|
|
140
142
|
level2Selected.id = toUserId;
|
|
141
|
-
level2Selected.name = userInfo.name ||
|
|
143
|
+
level2Selected.name = userInfo.name || '';
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
if (relation
|
|
146
|
+
if (relation === 1) {
|
|
145
147
|
rootNode.rootId = (0, _bsGlobal.getUserInfo)().Id;
|
|
146
|
-
rootNode.rootName = (0, _bsGlobal.getUserInfo)().Name ||
|
|
147
|
-
searchType =
|
|
148
|
+
rootNode.rootName = (0, _bsGlobal.getUserInfo)().Name || '';
|
|
149
|
+
searchType = 'user';
|
|
148
150
|
level2Selected.id = (0, _bsGlobal.getUserInfo)().Id;
|
|
149
|
-
level2Selected.name = (0, _bsGlobal.getUserInfo)().Name ||
|
|
151
|
+
level2Selected.name = (0, _bsGlobal.getUserInfo)().Name || '';
|
|
150
152
|
}
|
|
151
153
|
|
|
152
154
|
var urlQuery = ["searchType=".concat(searchType), "period=".concat(JSON.stringify({
|
|
153
155
|
cycleType: cycleType,
|
|
154
156
|
annualNum: annualNum,
|
|
155
157
|
yqmNum: yqmNum
|
|
156
|
-
})), "rootNode=".concat(JSON.stringify(rootNode)), "level2Selected=".concat(JSON.stringify(level2Selected))].join(
|
|
158
|
+
})), "rootNode=".concat(JSON.stringify(rootNode)), "level2Selected=".concat(JSON.stringify(level2Selected))].join('&');
|
|
157
159
|
var origin = window.location.href.split('#')[0];
|
|
158
160
|
window.location.href = "".concat(origin, "/#okr/map?").concat(urlQuery);
|
|
159
161
|
};
|
|
160
162
|
|
|
161
163
|
var getTitle = function getTitle() {
|
|
162
|
-
if (relation
|
|
164
|
+
if (relation === 1) {
|
|
163
165
|
return /*#__PURE__*/_react["default"].createElement(_userTitle["default"], {
|
|
164
166
|
toUserId: (0, _bsGlobal.getUserInfo)().Id
|
|
165
167
|
});
|
|
166
168
|
}
|
|
167
169
|
|
|
168
|
-
if (relation
|
|
170
|
+
if (relation === 2 || relation === 3) {
|
|
169
171
|
return /*#__PURE__*/_react["default"].createElement(_relationTitle["default"], {
|
|
170
172
|
relation: relation
|
|
171
173
|
});
|
|
@@ -197,11 +199,11 @@ function Header(props, ref) {
|
|
|
197
199
|
className: "".concat(_precls.precls, "__header-item")
|
|
198
200
|
}, getTitle())), /*#__PURE__*/_react["default"].createElement("div", {
|
|
199
201
|
className: "".concat(_precls.precls, "__header-right")
|
|
200
|
-
}, departmentId
|
|
202
|
+
}, departmentId === 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
201
203
|
className: "".concat(_precls.precls, "__header-item")
|
|
202
204
|
}, /*#__PURE__*/_react["default"].createElement(_keywordSearch["default"], {
|
|
203
205
|
onSearch: onSearch
|
|
204
|
-
})), relation
|
|
206
|
+
})), relation !== 2 && relation !== 3 &&
|
|
205
207
|
/*#__PURE__*/
|
|
206
208
|
// 我关注的 我参与的 没有创建按钮
|
|
207
209
|
_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -213,7 +215,7 @@ function Header(props, ref) {
|
|
|
213
215
|
className: "".concat(_precls.precls, "__header-item"),
|
|
214
216
|
onClick: gotoOkrMap
|
|
215
217
|
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
216
|
-
overlay: (0, _getLocale.getLocale)(
|
|
218
|
+
overlay: (0, _getLocale.getLocale)('OKR_MyO_Text_Alignment'),
|
|
217
219
|
placement: "top"
|
|
218
220
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
219
221
|
className: "".concat(_precls.precls, "__header-icon")
|
|
@@ -225,6 +227,10 @@ function Header(props, ref) {
|
|
|
225
227
|
userInfo: userInfo
|
|
226
228
|
}), /*#__PURE__*/_react["default"].createElement(_filter["default"], {
|
|
227
229
|
onSearch: onSearch
|
|
230
|
+
}), /*#__PURE__*/_react["default"].createElement(_operateRecord["default"], {
|
|
231
|
+
toUserId: toUserId,
|
|
232
|
+
userInfo: userInfo,
|
|
233
|
+
relation: relation
|
|
228
234
|
})));
|
|
229
235
|
}
|
|
230
236
|
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _popup = _interopRequireDefault(require("../../../components/popup"));
|
|
13
|
+
|
|
14
|
+
var _getLocale = require("../../../utils/getLocale");
|
|
15
|
+
|
|
16
|
+
var _precls = require("../precls");
|
|
17
|
+
|
|
18
|
+
var _context = require("../context");
|
|
19
|
+
|
|
20
|
+
var _common = require("./common");
|
|
21
|
+
|
|
22
|
+
require("./index.css");
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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
|
+
|
|
30
|
+
var OperateRecord = function OperateRecord(props) {
|
|
31
|
+
var popupRef = (0, _react.useRef)();
|
|
32
|
+
var drawerRef = (0, _react.useRef)();
|
|
33
|
+
var userInfo = props.userInfo,
|
|
34
|
+
toUserId = props.toUserId,
|
|
35
|
+
relation = props.relation;
|
|
36
|
+
|
|
37
|
+
var _useContext = (0, _react.useContext)(_context.Context),
|
|
38
|
+
OkrOperateRecordDrawer = _useContext.OkrOperateRecordDrawer,
|
|
39
|
+
annualNum = _useContext.annualNum,
|
|
40
|
+
cycleType = _useContext.cycleType,
|
|
41
|
+
yqmNum = _useContext.yqmNum;
|
|
42
|
+
|
|
43
|
+
var openOperateRecordPush = function openOperateRecordPush() {
|
|
44
|
+
popupRef.current && popupRef.current.close();
|
|
45
|
+
drawerRef.current && drawerRef.current.showOperateDrawerVisible();
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var popup = /*#__PURE__*/_react["default"].createElement("div", {
|
|
49
|
+
className: "".concat(_precls.precls, "__header-record-popup")
|
|
50
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
51
|
+
className: "".concat(_precls.precls, "__header-record-item"),
|
|
52
|
+
onClick: openOperateRecordPush
|
|
53
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
54
|
+
className: "tu-icon-jinzhan-s"
|
|
55
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
56
|
+
className: "".concat(_precls.precls, "__header-record-item-content")
|
|
57
|
+
}, (0, _getLocale.getLocale)('Per_details_OperationRecord'))));
|
|
58
|
+
|
|
59
|
+
if (!toUserId && relation !== 1) return null;
|
|
60
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_popup["default"], {
|
|
61
|
+
ref: popupRef,
|
|
62
|
+
popup: popup,
|
|
63
|
+
popupAlign: {
|
|
64
|
+
offset: [0, 4]
|
|
65
|
+
}
|
|
66
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
67
|
+
className: "".concat(_precls.precls, "__header-record")
|
|
68
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
69
|
+
className: "tu-icon-more1"
|
|
70
|
+
}))), (toUserId !== undefined || relation === 1) && !!userInfo && /*#__PURE__*/_react["default"].createElement(OkrOperateRecordDrawer, {
|
|
71
|
+
ref: drawerRef,
|
|
72
|
+
userInfo: {
|
|
73
|
+
Id: userInfo.userId,
|
|
74
|
+
Name: userInfo.name,
|
|
75
|
+
Color: userInfo.avatar.color,
|
|
76
|
+
AvatarsUrl: userInfo.avatar.original,
|
|
77
|
+
Type: 1
|
|
78
|
+
},
|
|
79
|
+
okrCycle: "\u300C".concat((0, _common.formatPeriod)({
|
|
80
|
+
annualNum: annualNum,
|
|
81
|
+
cycleType: cycleType,
|
|
82
|
+
yqmNum: yqmNum
|
|
83
|
+
}), "\u300D")
|
|
84
|
+
}));
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
var _default = OperateRecord;
|
|
88
|
+
exports["default"] = _default;
|
|
@@ -85,7 +85,8 @@ var NewOkrList = function NewOkrList(props) {
|
|
|
85
85
|
var OkrListCmp = props.OkrListCmp,
|
|
86
86
|
OkrCommunicationPush = props.OkrCommunicationPush,
|
|
87
87
|
Empty = props.Empty,
|
|
88
|
-
SetCycleModal = props.SetCycleModal
|
|
88
|
+
SetCycleModal = props.SetCycleModal,
|
|
89
|
+
OkrOperateRecordDrawer = props.OkrOperateRecordDrawer;
|
|
89
90
|
var useLocalStorage = new _localStorage.LocalStorage();
|
|
90
91
|
var formFieldValues = useLocalStorage.getItem("okr-filter-values") || {
|
|
91
92
|
targetType: "",
|
|
@@ -176,6 +177,12 @@ var NewOkrList = function NewOkrList(props) {
|
|
|
176
177
|
relation = locationRelation || 0;
|
|
177
178
|
}
|
|
178
179
|
|
|
180
|
+
var handleOnSearch = function handleOnSearch(params) {
|
|
181
|
+
setQuery(_objectSpread(_objectSpread(_objectSpread({}, query), params), {}, {
|
|
182
|
+
pageNum: 1
|
|
183
|
+
}));
|
|
184
|
+
};
|
|
185
|
+
|
|
179
186
|
(0, _react.useEffect)(function () {
|
|
180
187
|
setPageNum(1);
|
|
181
188
|
}, [relation, toUserId, departmentId, query]);
|
|
@@ -232,12 +239,6 @@ var NewOkrList = function NewOkrList(props) {
|
|
|
232
239
|
setPageSize(nowPageSize);
|
|
233
240
|
};
|
|
234
241
|
|
|
235
|
-
var handleOnSearch = function handleOnSearch(params) {
|
|
236
|
-
setQuery(_objectSpread(_objectSpread(_objectSpread({}, query), params), {}, {
|
|
237
|
-
pageNum: 1
|
|
238
|
-
}));
|
|
239
|
-
};
|
|
240
|
-
|
|
241
242
|
var onFrontAddOKR = function onFrontAddOKR(data) {
|
|
242
243
|
setOkrs([data].concat(_toConsumableArray(okrsRef.current || [])));
|
|
243
244
|
};
|
|
@@ -305,6 +306,7 @@ var NewOkrList = function NewOkrList(props) {
|
|
|
305
306
|
return /*#__PURE__*/_react["default"].createElement(_context.Context.Provider, {
|
|
306
307
|
value: _objectSpread({
|
|
307
308
|
OkrCommunicationPush: OkrCommunicationPush,
|
|
309
|
+
OkrOperateRecordDrawer: OkrOperateRecordDrawer,
|
|
308
310
|
relation: relation,
|
|
309
311
|
departmentName: departmentName,
|
|
310
312
|
departmentId: departmentId,
|
package/lib/utils/format-time.js
CHANGED
|
@@ -167,5 +167,12 @@ var showNextMonthFirstDay = function showNextMonthFirstDay() {
|
|
|
167
167
|
};
|
|
168
168
|
|
|
169
169
|
exports.showNextMonthFirstDay = showNextMonthFirstDay;
|
|
170
|
-
var _default =
|
|
170
|
+
var _default = {
|
|
171
|
+
getTimeString: getTimeString,
|
|
172
|
+
timeFormat: timeFormat,
|
|
173
|
+
showWeekFirstDay: showWeekFirstDay,
|
|
174
|
+
showMonthFirstDay: showMonthFirstDay,
|
|
175
|
+
showNextWeekFirstDay: showNextWeekFirstDay,
|
|
176
|
+
showNextMonthFirstDay: showNextMonthFirstDay
|
|
177
|
+
};
|
|
171
178
|
exports["default"] = _default;
|
package/lib/utils/open-data.js
CHANGED
|
@@ -336,6 +336,10 @@ exports.parseHtmlAndTextTag = parseHtmlAndTextTag;
|
|
|
336
336
|
var _default = {
|
|
337
337
|
OpenUserName: OpenUserName,
|
|
338
338
|
OpenDepartmentName: OpenDepartmentName,
|
|
339
|
-
isWechat: isWechat
|
|
339
|
+
isWechat: isWechat,
|
|
340
|
+
isPlatform: isPlatform,
|
|
341
|
+
parseString: parseString,
|
|
342
|
+
parseTag: parseTag,
|
|
343
|
+
parseHtmlAndTextTag: parseHtmlAndTextTag
|
|
340
344
|
};
|
|
341
345
|
exports["default"] = _default;
|