@titaui/pc 1.10.82-beta.13 → 1.10.82-beta.16
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/file-list/components/single-file/index.js +11 -11
- package/lib/components/icon-button-list/index.css +1 -1
- package/lib/components/img-viewer/index.css +1 -0
- package/lib/components/nav-top/index.js +6 -2
- package/lib/components/okr-flow/child-node/index.css +52 -13
- 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/root-node/index.css +1 -1
- package/lib/components/okr-flow/utils/index.js +68 -28
- package/lib/components/okr-flow/utils/tree-handler.js +9 -1
- package/lib/components/period-selector/index.js +3 -0
- 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 +6 -1
- package/lib/pages/okr-map/export-modules/okr-map/header/index.js +47 -13
- package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +27 -17
- package/lib/pages/okr-map/number-select/index.css +4 -1
- package/lib/pages/okr-map/number-select/index.js +1 -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/
|
|
49
|
+
url = "".concat(requestDomain(), "/api/v1/").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
|
})
|
|
@@ -146,7 +164,7 @@ function DrawerHeader(_ref) {
|
|
|
146
164
|
onClick: manager && manager.goBack
|
|
147
165
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
148
166
|
className: "tu-icon-fanhui"
|
|
149
|
-
}), (0, _getLocale.getLocale)(
|
|
167
|
+
}), (0, _getLocale.getLocale)('Mod_Back')), showBackBtn && hasContent && /*#__PURE__*/_react["default"].createElement("div", {
|
|
150
168
|
className: "titaui-drawer-header-divider"
|
|
151
169
|
}), hasContent && content, /*#__PURE__*/_react["default"].createElement("div", {
|
|
152
170
|
style: {
|
|
@@ -155,7 +173,7 @@ function DrawerHeader(_ref) {
|
|
|
155
173
|
}), /*#__PURE__*/_react["default"].createElement("div", null, actionComponent), displayActions.map(function (action) {
|
|
156
174
|
return /*#__PURE__*/_react["default"].createElement(_headerAction["default"], action);
|
|
157
175
|
}), !!collapsedActions.length && /*#__PURE__*/_react["default"].createElement(_headerAction["default"], {
|
|
158
|
-
title: (0, _getLocale.getLocale)(
|
|
176
|
+
title: (0, _getLocale.getLocale)('Mod_MoreOperate'),
|
|
159
177
|
icon: "tu-icon-10",
|
|
160
178
|
children: collapsedActions
|
|
161
179
|
}), showClose && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -39,7 +39,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
39
39
|
|
|
40
40
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
41
|
|
|
42
|
-
var prefix =
|
|
42
|
+
var prefix = 'titaui-new-file-list-single-file';
|
|
43
43
|
|
|
44
44
|
var SingleFile = function SingleFile(_ref) {
|
|
45
45
|
var data = _ref.data,
|
|
@@ -75,24 +75,24 @@ var SingleFile = function SingleFile(_ref) {
|
|
|
75
75
|
}, isMouseEnter && /*#__PURE__*/_react["default"].createElement("div", {
|
|
76
76
|
className: "".concat(prefix, "__operate"),
|
|
77
77
|
onMouseLeave: handleMouseLeave
|
|
78
|
-
},
|
|
78
|
+
}, showDownload && /*#__PURE__*/_react["default"].createElement("a", {
|
|
79
|
+
className: (0, _classnames["default"])("".concat(prefix, "__operate-item"), _defineProperty({}, "".concat(prefix, "__not-preview"), !canPreview || !data.previewUrl)),
|
|
80
|
+
href: data.downloadUrl
|
|
81
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
82
|
+
className: (0, _classnames["default"])('tu-icon-APP-xiazai', "".concat(prefix, "__operate-item-icon"))
|
|
83
|
+
}), (0, _getLocale.getLocale)('Mod_Download')), !isImg && canPreview && data.previewUrl && /*#__PURE__*/_react["default"].createElement("a", {
|
|
79
84
|
className: (0, _classnames["default"])("".concat(prefix, "__operate-item"), _defineProperty({}, "".concat(prefix, "__operate-item--only"), !showDownload)),
|
|
80
85
|
href: data.previewUrl,
|
|
81
86
|
target: "_blank",
|
|
82
87
|
rel: "noreferrer"
|
|
83
88
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
84
|
-
className: (0, _classnames["default"])(
|
|
85
|
-
}), (0, _getLocale.getLocale)(
|
|
89
|
+
className: (0, _classnames["default"])('tu-icon-yulan', "".concat(prefix, "__operate-item-icon"))
|
|
90
|
+
}), (0, _getLocale.getLocale)('Mod_Preview')), isImg && data.previewUrl && /*#__PURE__*/_react["default"].createElement("a", {
|
|
86
91
|
className: (0, _classnames["default"])("".concat(prefix, "__operate-item"), _defineProperty({}, "".concat(prefix, "__operate-item--only"), !showDownload)),
|
|
87
92
|
onClick: handlePreviewImg
|
|
88
93
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
89
|
-
className: (0, _classnames["default"])(
|
|
90
|
-
}), (0, _getLocale.getLocale)(
|
|
91
|
-
className: (0, _classnames["default"])("".concat(prefix, "__operate-item"), _defineProperty({}, "".concat(prefix, "__not-preview"), !canPreview || !data.previewUrl)),
|
|
92
|
-
href: data.downloadUrl
|
|
93
|
-
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
94
|
-
className: (0, _classnames["default"])("tu-icon-APP-xiazai", "".concat(prefix, "__operate-item-icon"))
|
|
95
|
-
}), (0, _getLocale.getLocale)("Mod_Download"))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
94
|
+
className: (0, _classnames["default"])('tu-icon-yulan', "".concat(prefix, "__operate-item-icon"))
|
|
95
|
+
}), (0, _getLocale.getLocale)('Mod_Preview'))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
96
96
|
className: (0, _classnames["default"])("".concat(prefix, "__file-preview")),
|
|
97
97
|
onMouseEnter: handleMouseEnter,
|
|
98
98
|
style: {
|
|
@@ -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"];
|
|
@@ -36,12 +36,11 @@
|
|
|
36
36
|
|
|
37
37
|
.titaui-okr-flow--node {
|
|
38
38
|
position: relative;
|
|
39
|
-
padding:
|
|
40
|
-
width:
|
|
41
|
-
height: 96px;
|
|
39
|
+
padding: 12px 12px;
|
|
40
|
+
width: 340px;
|
|
42
41
|
background: #ffffff;
|
|
43
42
|
box-shadow: 0px 4px 10px 0px rgba(127, 145, 180, 0.1);
|
|
44
|
-
border-radius:
|
|
43
|
+
border-radius: 12px;
|
|
45
44
|
box-sizing: border-box;
|
|
46
45
|
}
|
|
47
46
|
|
|
@@ -75,20 +74,60 @@
|
|
|
75
74
|
white-space: unset;
|
|
76
75
|
}
|
|
77
76
|
|
|
77
|
+
.titaui-okr-flow--node-krs {
|
|
78
|
+
margin-top: 16px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.titaui-okr-flow--node-kr {
|
|
82
|
+
display: flex;
|
|
83
|
+
line-height: 20px;
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
margin-top: 8px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.titaui-okr-flow--node-kr-icon {
|
|
89
|
+
color: rgba(40, 121, 255, 0.6);
|
|
90
|
+
margin-right: 8px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.titaui-okr-flow--node-kr-title {
|
|
94
|
+
flex: 1;
|
|
95
|
+
font-size: 13px;
|
|
96
|
+
font-weight: 400;
|
|
97
|
+
color: #3F4755;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.titaui-okr-flow--node-kr-progress {
|
|
101
|
+
width: 32px;
|
|
102
|
+
text-align: right;
|
|
103
|
+
margin-left: 8px;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.titaui-okr-flow--node-kr-status--normal {
|
|
108
|
+
color: #2879ff;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.titaui-okr-flow--node-kr-status--risk {
|
|
112
|
+
color: #f6bd16;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.titaui-okr-flow--node-kr-status--expired {
|
|
116
|
+
color: #f05e5e;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.titaui-okr-flow--node-kr-status--complete {
|
|
120
|
+
color: #5ad8a6;
|
|
121
|
+
}
|
|
122
|
+
|
|
78
123
|
.titaui-okr-flow--node-title {
|
|
79
124
|
max-width: 252px;
|
|
80
|
-
height: 44px;
|
|
81
125
|
margin-right: 54px;
|
|
82
126
|
margin-bottom: 8px;
|
|
83
|
-
line-height:
|
|
127
|
+
line-height: 24px;
|
|
84
128
|
color: #141c28;
|
|
85
129
|
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;
|
|
130
|
+
font-weight: 600;
|
|
92
131
|
}
|
|
93
132
|
|
|
94
133
|
.titaui-okr-flow--node-desp {
|
|
@@ -118,7 +157,7 @@
|
|
|
118
157
|
overflow: hidden;
|
|
119
158
|
text-overflow: ellipsis;
|
|
120
159
|
white-space: nowrap;
|
|
121
|
-
line-height:
|
|
160
|
+
line-height: 20px;
|
|
122
161
|
max-width: 96px;
|
|
123
162
|
}
|
|
124
163
|
|
|
@@ -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
|
}();
|