@titaui/pc 1.11.4 → 1.11.5-beta.3
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/create-okr-modal/request-api.js +1 -1
- package/lib/components/drawer/index.js +23 -5
- package/lib/components/nav-top/index.js +6 -2
- package/lib/components/okr-flow/child-node/index.css +46 -10
- package/lib/components/okr-flow/child-node/work-node.js +19 -3
- package/lib/components/okr-flow/export-modal/index.js +26 -2
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +14 -9
- package/lib/components/okr-flow/okr-map/index.js +32 -14
- package/lib/components/okr-flow/request-apis.js +11 -4
- package/lib/components/okr-flow/utils/index.js +68 -28
- package/lib/components/okr-flow/utils/tree-handler.js +9 -1
- package/lib/components/textarea/index.css +120 -0
- package/lib/components/textarea/index.js +257 -0
- package/lib/index.js +40 -0
- 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 -16
- package/lib/pages/new-okr-list/header/operate-record.js +88 -0
- package/lib/pages/new-okr-list/index.js +3 -1
- package/lib/pages/okr-map/export-modules/okr-map/header/index.css +1 -1
- package/lib/pages/okr-map/export-modules/okr-map/header/index.js +29 -4
- package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +27 -17
- package/lib/pages/okr-map/number-select/index.css +0 -1
- 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;
|
|
@@ -46,7 +46,7 @@ var createWidthKr = /*#__PURE__*/function () {
|
|
|
46
46
|
while (1) {
|
|
47
47
|
switch (_context.prev = _context.next) {
|
|
48
48
|
case 0:
|
|
49
|
-
url = "".concat(requestDomain(), "/api/v2/").concat(tenantId, "/").concat(userId, "/
|
|
49
|
+
url = "".concat(requestDomain(), "/api/v2/").concat(tenantId, "/").concat(userId, "/okr/createWithKr");
|
|
50
50
|
_context.next = 3;
|
|
51
51
|
return _axios["default"].post(url, _objectSpread({
|
|
52
52
|
workType: 6
|
|
@@ -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", {
|
|
@@ -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"];
|
|
@@ -37,8 +37,7 @@
|
|
|
37
37
|
.titaui-okr-flow--node {
|
|
38
38
|
position: relative;
|
|
39
39
|
padding: 10px 12px;
|
|
40
|
-
width:
|
|
41
|
-
height: 96px;
|
|
40
|
+
width: 340px;
|
|
42
41
|
background: #ffffff;
|
|
43
42
|
box-shadow: 0px 4px 10px 0px rgba(127, 145, 180, 0.1);
|
|
44
43
|
border-radius: 6px;
|
|
@@ -75,20 +74,57 @@
|
|
|
75
74
|
white-space: unset;
|
|
76
75
|
}
|
|
77
76
|
|
|
77
|
+
.titaui-okr-flow--node-krs {
|
|
78
|
+
margin-top: 12px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.titaui-okr-flow--node-kr {
|
|
82
|
+
display: flex;
|
|
83
|
+
line-height: 20px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.titaui-okr-flow--node-kr-icon {
|
|
87
|
+
color: rgba(40, 121, 255, 0.6);
|
|
88
|
+
margin-right: 8px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.titaui-okr-flow--node-kr-title {
|
|
92
|
+
flex: 1;
|
|
93
|
+
font-size: 13px;
|
|
94
|
+
font-weight: 400;
|
|
95
|
+
color: #3F4755;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.titaui-okr-flow--node-kr-progress {
|
|
99
|
+
width: 32px;
|
|
100
|
+
text-align: right;
|
|
101
|
+
margin-left: 8px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.titaui-okr-flow--node-kr-status--normal {
|
|
105
|
+
color: #2879ff;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.titaui-okr-flow--node-kr-status--risk {
|
|
109
|
+
color: #f6bd16;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.titaui-okr-flow--node-kr-status--expired {
|
|
113
|
+
color: #f05e5e;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.titaui-okr-flow--node-kr-status--complete {
|
|
117
|
+
color: #5ad8a6;
|
|
118
|
+
}
|
|
119
|
+
|
|
78
120
|
.titaui-okr-flow--node-title {
|
|
79
121
|
max-width: 252px;
|
|
80
|
-
height: 44px;
|
|
81
122
|
margin-right: 54px;
|
|
82
123
|
margin-bottom: 8px;
|
|
83
|
-
line-height:
|
|
124
|
+
line-height: 24px;
|
|
84
125
|
color: #141c28;
|
|
85
126
|
font-size: 14px;
|
|
86
|
-
|
|
87
|
-
text-overflow: ellipsis;
|
|
88
|
-
display: -webkit-box;
|
|
89
|
-
text-overflow: ellipsis;
|
|
90
|
-
-webkit-box-orient: vertical;
|
|
91
|
-
-webkit-line-clamp: 2;
|
|
127
|
+
font-weight: 600;
|
|
92
128
|
}
|
|
93
129
|
|
|
94
130
|
.titaui-okr-flow--node-desp {
|
|
@@ -71,6 +71,7 @@ function WorkNode(_ref) {
|
|
|
71
71
|
manualRiskLevel = data.manualRiskLevel,
|
|
72
72
|
progress = data.progress,
|
|
73
73
|
okrClassify = data.okrClassify,
|
|
74
|
+
Krs = data.Krs,
|
|
74
75
|
cycleType = data.cycleType,
|
|
75
76
|
startDate = data.startDate,
|
|
76
77
|
endDate = data.endDate,
|
|
@@ -92,6 +93,8 @@ function WorkNode(_ref) {
|
|
|
92
93
|
imgWidth = _useState6[0],
|
|
93
94
|
setImgWidth = _useState6[1];
|
|
94
95
|
|
|
96
|
+
var bodyr = (0, _react.useRef)();
|
|
97
|
+
|
|
95
98
|
var getOkrTypeMap = function getOkrTypeMap() {
|
|
96
99
|
return {
|
|
97
100
|
1: (0, _getLocale.getLocale)("OKR_MyO_Pop_Individual"),
|
|
@@ -210,12 +213,13 @@ function WorkNode(_ref) {
|
|
|
210
213
|
}; // 1:正常 2:有风险 3:过期 4:完成 5:过期完成 ,
|
|
211
214
|
|
|
212
215
|
|
|
213
|
-
var riskLevelSuffix = ["normal", "normal", "risk", "expired", "complete", "complete_over"];
|
|
216
|
+
var riskLevelSuffix = ["normal", "normal", "risk", "expired", "complete", "complete_over", "normal"];
|
|
214
217
|
if (!MapOkrVisible) return /*#__PURE__*/_react["default"].createElement("div", {
|
|
215
218
|
className: (0, _classnames["default"])("".concat(_precls["default"], "--node"), "".concat(_precls["default"], "--node__private"))
|
|
216
219
|
});
|
|
217
220
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
218
|
-
className: (0, _classnames["default"])("".concat(_precls["default"], "--node"), _defineProperty({}, "".concat(_precls["default"], "--node__search"), isSearchRes))
|
|
221
|
+
className: (0, _classnames["default"])("".concat(_precls["default"], "--node"), _defineProperty({}, "".concat(_precls["default"], "--node__search"), isSearchRes)),
|
|
222
|
+
ref: bodyr
|
|
219
223
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
220
224
|
className: (0, _classnames["default"])("".concat(_precls["default"], "--node-title"))
|
|
221
225
|
}, workName, /*#__PURE__*/_react["default"].createElement(_okrClassify["default"], {
|
|
@@ -230,7 +234,19 @@ function WorkNode(_ref) {
|
|
|
230
234
|
className: (0, _classnames["default"])("".concat(_precls["default"], "--node-type"))
|
|
231
235
|
}, getOkrTypeMap()[okrType])), /*#__PURE__*/_react["default"].createElement("span", {
|
|
232
236
|
className: (0, _classnames["default"])("".concat(_precls["default"], "--node-cycle"))
|
|
233
|
-
}, getCycleTextByType()))), /*#__PURE__*/_react["default"].createElement("
|
|
237
|
+
}, getCycleTextByType()))), !!(Krs !== null && Krs !== void 0 && Krs.length) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
238
|
+
className: (0, _classnames["default"])("".concat(_precls["default"], "--node-krs"))
|
|
239
|
+
}, Krs.map(function (item, key) {
|
|
240
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
241
|
+
className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr"))
|
|
242
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
243
|
+
className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr-icon"))
|
|
244
|
+
}, "KR", item.SortNum + 1), /*#__PURE__*/_react["default"].createElement("div", {
|
|
245
|
+
className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr-title"))
|
|
246
|
+
}, item.mileStoneName), /*#__PURE__*/_react["default"].createElement("div", {
|
|
247
|
+
className: (0, _classnames["default"])("".concat(_precls["default"], "--node-kr-progress ").concat(_precls["default"], "--node-kr-status--").concat(riskLevelSuffix[item.riskLevel]))
|
|
248
|
+
}, item.progress, "%"));
|
|
249
|
+
})), /*#__PURE__*/_react["default"].createElement("span", {
|
|
234
250
|
className: (0, _classnames["default"])("".concat(_precls["default"], "--node-status"), "".concat(_precls["default"], "--node-status__").concat(riskLevelSuffix[manualRiskLevel]))
|
|
235
251
|
}, /*#__PURE__*/_react["default"].createElement(_tooltipText["default"], {
|
|
236
252
|
text: "".concat(progress, "%"),
|
|
@@ -33,6 +33,8 @@ var _precls = _interopRequireDefault(require("../precls"));
|
|
|
33
33
|
|
|
34
34
|
var _getLocale = require("../../../utils/getLocale");
|
|
35
35
|
|
|
36
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
37
|
+
|
|
36
38
|
require("rc-color-picker/assets/index.css");
|
|
37
39
|
|
|
38
40
|
require("./index.css");
|
|
@@ -45,6 +47,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
45
47
|
|
|
46
48
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
47
49
|
|
|
50
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
51
|
+
|
|
52
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
53
|
+
|
|
54
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
55
|
+
|
|
56
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
57
|
+
|
|
48
58
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
49
59
|
|
|
50
60
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -88,6 +98,7 @@ var ExportMapModal = function ExportMapModal(props) {
|
|
|
88
98
|
setIsExport = _useState6[1];
|
|
89
99
|
|
|
90
100
|
var modalRef = (0, _react.useRef)();
|
|
101
|
+
var virtualElements = (0, _react.useRef)([]);
|
|
91
102
|
(0, _react.useEffect)(function () {
|
|
92
103
|
if ((0, _bsGlobal.isWx)() && window.WWOpenData) {
|
|
93
104
|
if (window.WWOpenData.enableCanvasSharing) {
|
|
@@ -236,6 +247,19 @@ var ExportMapModal = function ExportMapModal(props) {
|
|
|
236
247
|
setBgColor(colors ? colors.color : "none");
|
|
237
248
|
};
|
|
238
249
|
|
|
250
|
+
var NodeDebug = function NodeDebug() {
|
|
251
|
+
var elements = (0, _reactFlowRenderer.useStoreState)(function (state) {
|
|
252
|
+
return [].concat(_toConsumableArray(state.nodes), _toConsumableArray(state.edges));
|
|
253
|
+
}, _lodash["default"].isEqual);
|
|
254
|
+
var setElements = (0, _reactFlowRenderer.useStoreActions)(function (actions) {
|
|
255
|
+
return actions.setElements;
|
|
256
|
+
});
|
|
257
|
+
var newElements = (0, _utils.getLayoutedElements)(elements, direction);
|
|
258
|
+
virtualElements = newElements;
|
|
259
|
+
setElements(newElements);
|
|
260
|
+
return null;
|
|
261
|
+
};
|
|
262
|
+
|
|
239
263
|
return /*#__PURE__*/_react["default"].createElement(_dialog["default"], {
|
|
240
264
|
title: (0, _getLocale.getLocale)("OKR_Ali_Exportmap"),
|
|
241
265
|
noFooterLine: true,
|
|
@@ -275,7 +299,7 @@ var ExportMapModal = function ExportMapModal(props) {
|
|
|
275
299
|
nodesDraggable: false,
|
|
276
300
|
nodesConnectable: false,
|
|
277
301
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__export"), _defineProperty({}, "".concat(_precls["default"], "__dark"), darkTheme)),
|
|
278
|
-
elements:
|
|
302
|
+
elements: dataSource,
|
|
279
303
|
nodeTypes: _utils.nodeTypes,
|
|
280
304
|
minZoom: 0.05,
|
|
281
305
|
zoomOnScroll: false,
|
|
@@ -287,7 +311,7 @@ var ExportMapModal = function ExportMapModal(props) {
|
|
|
287
311
|
width: "100%",
|
|
288
312
|
background: bgColor
|
|
289
313
|
}
|
|
290
|
-
}))))));
|
|
314
|
+
}, /*#__PURE__*/_react["default"].createElement(NodeDebug, null)))))));
|
|
291
315
|
};
|
|
292
316
|
|
|
293
317
|
ExportMapModal.defaultProps = {
|
|
@@ -87,6 +87,8 @@ function OkrSearchPanel(props, ref) {
|
|
|
87
87
|
showkr = _props$showkr === void 0 ? true : _props$showkr,
|
|
88
88
|
_props$darkTheme = props.darkTheme,
|
|
89
89
|
darkTheme = _props$darkTheme === void 0 ? false : _props$darkTheme,
|
|
90
|
+
_props$showCardKr = props.showCardKr,
|
|
91
|
+
showCardKr = _props$showCardKr === void 0 ? false : _props$showCardKr,
|
|
90
92
|
onNodeClick = props.onNodeClick;
|
|
91
93
|
|
|
92
94
|
var _useState = (0, _react.useState)(true),
|
|
@@ -111,7 +113,7 @@ function OkrSearchPanel(props, ref) {
|
|
|
111
113
|
|
|
112
114
|
|
|
113
115
|
var getSearchData = (0, _react.useRef)((0, _helper.debounce)( /*#__PURE__*/function () {
|
|
114
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(searchType, rootId, rootName, avatar, cycleType, yqmNum, annualNum, okrType, openLevel, showkr) {
|
|
116
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(searchType, rootId, rootName, avatar, cycleType, yqmNum, annualNum, okrType, openLevel, showkr, showCardKr) {
|
|
115
117
|
var _yield$searchOkrs, works, okrIds, nodes, allNodes, subTreeNodes;
|
|
116
118
|
|
|
117
119
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -155,7 +157,8 @@ function OkrSearchPanel(props, ref) {
|
|
|
155
157
|
return (0, _requestApis.expandNodesByLevel)({
|
|
156
158
|
okrIds: okrIds,
|
|
157
159
|
level: openLevel - 1,
|
|
158
|
-
showKr: showkr ? 0 : 1
|
|
160
|
+
showKr: showkr ? 0 : 1,
|
|
161
|
+
showCardKr: showCardKr ? 0 : 1
|
|
159
162
|
});
|
|
160
163
|
|
|
161
164
|
case 13:
|
|
@@ -188,19 +191,19 @@ function OkrSearchPanel(props, ref) {
|
|
|
188
191
|
}, _callee);
|
|
189
192
|
}));
|
|
190
193
|
|
|
191
|
-
return function (_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10) {
|
|
194
|
+
return function (_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10, _x11) {
|
|
192
195
|
return _ref.apply(this, arguments);
|
|
193
196
|
};
|
|
194
197
|
}(), 500)).current;
|
|
195
198
|
var okrFlow = (0, _react.useRef)();
|
|
196
199
|
(0, _react.useEffect)(function () {
|
|
197
200
|
if (!annualNum) return;
|
|
198
|
-
getSearchData(searchType, rootId, rootName, avatar, cycleType, yqmNum, annualNum, okrType, openLevel, showkr);
|
|
199
|
-
}, [searchType, rootId, rootName, cycleType, yqmNum, annualNum, okrType, openLevel, showkr]);
|
|
201
|
+
getSearchData(searchType, rootId, rootName, avatar, cycleType, yqmNum, annualNum, okrType, openLevel, showkr, showCardKr);
|
|
202
|
+
}, [searchType, rootId, rootName, cycleType, yqmNum, annualNum, okrType, openLevel, showkr, showCardKr]);
|
|
200
203
|
(0, _react.useEffect)(function () {
|
|
201
204
|
var data = (0, _treeHandler.transToMapData)(treeNodes, showkr);
|
|
202
205
|
setDataSource(data.length > 1 ? data : []);
|
|
203
|
-
}, [treeNodes, showkr]);
|
|
206
|
+
}, [treeNodes, showkr, showCardKr]);
|
|
204
207
|
|
|
205
208
|
var handleParentExpand = /*#__PURE__*/function () {
|
|
206
209
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(node) {
|
|
@@ -216,7 +219,8 @@ function OkrSearchPanel(props, ref) {
|
|
|
216
219
|
krId: modelType == "kr" ? id : 0,
|
|
217
220
|
okrId: modelType == "kr" ? data.workId : id,
|
|
218
221
|
okrIdParent: modelType == "work" ? data.parentId : data.workId,
|
|
219
|
-
childRoot: false
|
|
222
|
+
childRoot: false,
|
|
223
|
+
showCardKr: showCardKr ? 0 : 1
|
|
220
224
|
});
|
|
221
225
|
|
|
222
226
|
case 3:
|
|
@@ -249,7 +253,7 @@ function OkrSearchPanel(props, ref) {
|
|
|
249
253
|
}, _callee2);
|
|
250
254
|
}));
|
|
251
255
|
|
|
252
|
-
return function handleParentExpand(
|
|
256
|
+
return function handleParentExpand(_x12) {
|
|
253
257
|
return _ref2.apply(this, arguments);
|
|
254
258
|
};
|
|
255
259
|
}();
|
|
@@ -268,6 +272,7 @@ function OkrSearchPanel(props, ref) {
|
|
|
268
272
|
okrId: modelType == "work" ? id : data.workId,
|
|
269
273
|
okrIdParent: 0,
|
|
270
274
|
childRoot: true,
|
|
275
|
+
showCardKr: showCardKr ? 0 : 1,
|
|
271
276
|
currentOkrRole: modelType == "kr" ? data.mapkrVisible : data.MapOkrVisible
|
|
272
277
|
});
|
|
273
278
|
|
|
@@ -294,7 +299,7 @@ function OkrSearchPanel(props, ref) {
|
|
|
294
299
|
}, _callee3);
|
|
295
300
|
}));
|
|
296
301
|
|
|
297
|
-
return function handleChildExpand(
|
|
302
|
+
return function handleChildExpand(_x13) {
|
|
298
303
|
return _ref3.apply(this, arguments);
|
|
299
304
|
};
|
|
300
305
|
}();
|
|
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _reactFlowRenderer = _interopRequireWildcard(require("@titaui/react-flow-renderer"));
|
|
13
13
|
|
|
14
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
15
|
+
|
|
14
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
17
|
|
|
16
18
|
var _html2canvas = _interopRequireDefault(require("html2canvas"));
|
|
@@ -39,6 +41,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
39
41
|
|
|
40
42
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
41
43
|
|
|
44
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
45
|
+
|
|
46
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
47
|
+
|
|
48
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
49
|
+
|
|
50
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
51
|
+
|
|
42
52
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
43
53
|
|
|
44
54
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -68,16 +78,12 @@ var OkrMap = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
68
78
|
onChildClose = _props$onChildClose === void 0 ? function () {} : _props$onChildClose,
|
|
69
79
|
_props$dataSource = props.dataSource,
|
|
70
80
|
dataSource = _props$dataSource === void 0 ? [] : _props$dataSource;
|
|
81
|
+
var virtualElements = (0, _react.useRef)([]);
|
|
71
82
|
|
|
72
|
-
var _useState = (0, _react.useState)(
|
|
83
|
+
var _useState = (0, _react.useState)(),
|
|
73
84
|
_useState2 = _slicedToArray(_useState, 2),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var _useState3 = (0, _react.useState)(),
|
|
78
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
79
|
-
flowInstance = _useState4[0],
|
|
80
|
-
setFlowInstance = _useState4[1];
|
|
85
|
+
flowInstance = _useState2[0],
|
|
86
|
+
setFlowInstance = _useState2[1];
|
|
81
87
|
|
|
82
88
|
var isMoving = (0, _react.useRef)(false);
|
|
83
89
|
|
|
@@ -89,12 +95,10 @@ var OkrMap = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
89
95
|
onNodeClick & onNodeClick(data);
|
|
90
96
|
};
|
|
91
97
|
|
|
92
|
-
var layoutedElements = (0, _utils.getLayoutedElements)(dataSource, direction);
|
|
93
|
-
|
|
94
98
|
var getDefaultPos = function getDefaultPos() {
|
|
95
99
|
var containerHeight = document.body.clientHeight - 200 - 96;
|
|
96
100
|
var containerWidth = document.body.clientWidth - 180 - 320;
|
|
97
|
-
var rootNode =
|
|
101
|
+
var rootNode = virtualElements[0];
|
|
98
102
|
|
|
99
103
|
if (direction == "horizontal") {
|
|
100
104
|
var targetY = containerHeight / 2;
|
|
@@ -102,13 +106,27 @@ var OkrMap = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
102
106
|
}
|
|
103
107
|
|
|
104
108
|
var targetX = containerWidth / 2;
|
|
105
|
-
return [targetX - rootNode.position.x, -48];
|
|
109
|
+
return [targetX - rootNode.position.x, -48]; // debugger
|
|
110
|
+
// return [0, 0]
|
|
106
111
|
};
|
|
107
112
|
|
|
108
113
|
var onLoad = function onLoad(reactFlowInstance) {
|
|
109
114
|
setFlowInstance(reactFlowInstance);
|
|
110
115
|
};
|
|
111
116
|
|
|
117
|
+
var NodeDebug = function NodeDebug() {
|
|
118
|
+
var elements = (0, _reactFlowRenderer.useStoreState)(function (state) {
|
|
119
|
+
return [].concat(_toConsumableArray(state.nodes), _toConsumableArray(state.edges));
|
|
120
|
+
}, _lodash["default"].isEqual);
|
|
121
|
+
var setElements = (0, _reactFlowRenderer.useStoreActions)(function (actions) {
|
|
122
|
+
return actions.setElements;
|
|
123
|
+
});
|
|
124
|
+
var newElements = (0, _utils.getLayoutedElements)(elements, direction);
|
|
125
|
+
virtualElements = newElements;
|
|
126
|
+
setElements(newElements);
|
|
127
|
+
return null;
|
|
128
|
+
};
|
|
129
|
+
|
|
112
130
|
(0, _react.useEffect)(function () {
|
|
113
131
|
if (flowInstance) {
|
|
114
132
|
var _getDefaultPos = getDefaultPos(),
|
|
@@ -174,7 +192,7 @@ var OkrMap = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
174
192
|
|
|
175
193
|
}, /*#__PURE__*/_react["default"].createElement(_reactFlowRenderer.ReactFlowProvider, null, dataSource.length == 0 ? /*#__PURE__*/_react["default"].createElement(_empty["default"], null) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_reactFlowRenderer["default"], {
|
|
176
194
|
onLoad: onLoad,
|
|
177
|
-
elements:
|
|
195
|
+
elements: dataSource,
|
|
178
196
|
nodesDraggable: false,
|
|
179
197
|
nodesConnectable: false,
|
|
180
198
|
nodeTypes: _utils.nodeTypes,
|
|
@@ -182,7 +200,7 @@ var OkrMap = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
182
200
|
minZoom: 0.25,
|
|
183
201
|
maxZoom: 1.5,
|
|
184
202
|
panOnScroll: true
|
|
185
|
-
}), /*#__PURE__*/_react["default"].createElement(_miniMap["default"], {
|
|
203
|
+
}, /*#__PURE__*/_react["default"].createElement(NodeDebug, null)), /*#__PURE__*/_react["default"].createElement(_miniMap["default"], {
|
|
186
204
|
onMoveStart: function onMoveStart() {
|
|
187
205
|
return isMoving.current = true;
|
|
188
206
|
}
|
|
@@ -78,7 +78,9 @@ var expandNode = function expandNode(params) {
|
|
|
78
78
|
_params$okrIdParent = params.okrIdParent,
|
|
79
79
|
okrIdParent = _params$okrIdParent === void 0 ? 0 : _params$okrIdParent,
|
|
80
80
|
_params$currentOkrRol = params.currentOkrRole,
|
|
81
|
-
currentOkrRole = _params$currentOkrRol === void 0 ? true : _params$currentOkrRol
|
|
81
|
+
currentOkrRole = _params$currentOkrRol === void 0 ? true : _params$currentOkrRol,
|
|
82
|
+
_params$showCardKr = params.showCardKr,
|
|
83
|
+
showCardKr = _params$showCardKr === void 0 ? 1 : _params$showCardKr;
|
|
82
84
|
return _axios["default"].get("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/map/expand"), {
|
|
83
85
|
params: {
|
|
84
86
|
okrId: okrId,
|
|
@@ -87,7 +89,9 @@ var expandNode = function expandNode(params) {
|
|
|
87
89
|
// true: 展开子节点, false: 展开父节点
|
|
88
90
|
okrIdParent: okrIdParent,
|
|
89
91
|
// 当前选中okr 或 当前选中kr 的okrId(kr的父节点是所属okr)
|
|
90
|
-
currentOkrRole: currentOkrRole
|
|
92
|
+
currentOkrRole: currentOkrRole,
|
|
93
|
+
// 查看权限
|
|
94
|
+
showCardKr: showCardKr // o带上kr
|
|
91
95
|
|
|
92
96
|
}
|
|
93
97
|
}).then(function (res) {
|
|
@@ -103,12 +107,15 @@ var expandNodesByLevel = function expandNodesByLevel(_ref2) {
|
|
|
103
107
|
_ref2$okrIds = _ref2.okrIds,
|
|
104
108
|
okrIds = _ref2$okrIds === void 0 ? [] : _ref2$okrIds,
|
|
105
109
|
_ref2$showKr = _ref2.showKr,
|
|
106
|
-
showKr = _ref2$showKr === void 0 ? 0 : _ref2$showKr
|
|
110
|
+
showKr = _ref2$showKr === void 0 ? 0 : _ref2$showKr,
|
|
111
|
+
_ref2$showCardKr = _ref2.showCardKr,
|
|
112
|
+
showCardKr = _ref2$showCardKr === void 0 ? 1 : _ref2$showCardKr;
|
|
107
113
|
return (// const queryStr = qs.stringify({ okrIds, level }, { arrayFormat: 'repeat' });
|
|
108
114
|
_axios["default"].post("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/okr/map/generalview"), {
|
|
109
115
|
okrIds: okrIds,
|
|
110
116
|
level: level,
|
|
111
|
-
showKr: showKr
|
|
117
|
+
showKr: showKr,
|
|
118
|
+
showCardKr: showCardKr
|
|
112
119
|
}).then(function (res) {
|
|
113
120
|
return res.data.Data;
|
|
114
121
|
})
|