@titaui/pc 1.11.52-beta.2 → 1.11.52-beta.20
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/images/blue.svg +21 -0
- package/lib/components/button/images/red.svg +21 -0
- package/lib/components/button/images/white.svg +19 -0
- package/lib/components/button/rect-btn/index.js +3 -3
- package/lib/components/change-okr-modal/Item.js +19 -18
- package/lib/components/change-okr-modal/styledComponents.js +9 -9
- package/lib/components/checkbox/index.css +4 -0
- package/lib/components/contact-kefu/index.css +11 -1
- package/lib/components/contact-kefu/index.js +10 -4
- package/lib/components/create-okr-modal/createSuccessCmp.js +47 -19
- package/lib/components/create-okr-modal/fields/index.css +14 -3
- package/lib/components/create-okr-modal/fields/o-new-name.js +31 -20
- package/lib/components/create-okr-modal/fields/okr-parent.js +7 -5
- package/lib/components/create-okr-modal/index.js +197 -132
- package/lib/components/create-okr-modal/kr-items/index.css +23 -13
- package/lib/components/create-okr-modal/kr-items/krDatas.js +95 -76
- package/lib/components/create-okr-modal/kr-items/krItem.js +54 -57
- package/lib/components/create-okr-modal/style.js +5 -5
- package/lib/components/drop-selector/index.js +1 -2
- package/lib/components/dynamic/components/title/index.js +1 -1
- package/lib/components/dynamic/constant.js +1 -1
- package/lib/components/dynamic/dynamic-item/components/feed-operate/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +17 -17
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +3 -1
- package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +9 -9
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +3 -1
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +3 -1
- package/lib/components/eReport/eReportLists/reportList.js +29 -30
- package/lib/components/eReport/eReportShare/style.js +1 -1
- package/lib/components/edit-kr-wight/EditKrWightModal.js +11 -9
- package/lib/components/menus/export-modules/appraisal-menus/menus.js +11 -9
- package/lib/components/nav-top/components/menu/index.js +18 -16
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +1 -1
- package/lib/components/nav-top/components/user-message/components/todos/todo-item.js +3 -3
- package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +1 -1
- package/lib/components/okr-detail/components/header/edit-name.js +76 -39
- package/lib/components/okr-detail/components/header/index.css +122 -41
- package/lib/components/okr-detail/components/header/index.js +45 -48
- package/lib/components/okr-detail/components/header/o-classify.js +152 -0
- package/lib/components/okr-detail/components/header/o-name.js +7 -5
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-kr-node/index.js +81 -43
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.css +66 -4
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +174 -64
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +9 -9
- package/lib/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +15 -13
- package/lib/components/okr-detail/detail-header/index.js +11 -5
- package/lib/components/okr-detail/e-list/index.js +2 -2
- package/lib/components/okr-detail/okr-list/create-kr-item/index.css +17 -0
- package/lib/components/okr-detail/okr-list/create-kr-item/index.js +75 -53
- package/lib/components/okr-detail/okr-list/index.css +9 -0
- package/lib/components/okr-detail/okr-list/index.js +25 -25
- package/lib/components/okr-detail/request-apis.js +73 -69
- package/lib/components/okr-detail/schedule/components/kr-progress/index.js +3 -1
- package/lib/components/okr-detail/schedule/components/o-progress/index.js +34 -32
- package/lib/components/okr-detail/schedule/components/sub-o-progress/index.js +3 -1
- package/lib/components/okr-flow/child-node/kr-node.js +3 -1
- package/lib/components/okr-flow/child-node/work-node.js +3 -1
- package/lib/components/okr-flow/export-modal/index.js +26 -16
- package/lib/components/okr-progress/components/kr-progress/index.js +5 -3
- package/lib/components/okr-progress/components/o-progress/index.js +3 -1
- package/lib/components/okr-progress/components/sub-o-progress/index.js +3 -1
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +3 -3
- package/lib/components/okr-share/common-painter/openDataPainter.js +9 -6
- package/lib/components/okr-share/common-painter/utils.js +183 -36
- package/lib/components/okr-share/index.css +5 -4
- package/lib/components/okr-share/pink-card/card.js +3 -3
- package/lib/components/okr-share/pink-card/drawKrs.js +93 -18
- package/lib/components/okr-share/pink-card/index.js +20 -12
- package/lib/components/open-data-painter/index.js +6 -5
- package/lib/components/period-selector/interface.js +7 -0
- package/lib/components/progress/circle-progress/index.css +2 -0
- package/lib/components/search-input/index.css +1 -1
- package/lib/components/search-key-handle/index.js +12 -10
- package/lib/components/select-layer/index.css +1 -1
- package/lib/components/task-relation-modal/helper.js +139 -2
- package/lib/components/task-relation-modal/image/loading.gif +0 -0
- package/lib/components/task-relation-modal/index.js +9 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.css +18 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +267 -0
- package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +135 -0
- package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.css +0 -0
- package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +131 -0
- package/lib/components/task-relation-modal/okr-relation/request-api.js +106 -0
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +120 -0
- package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +191 -0
- package/lib/components/task-relation-modal/request-api.js +28 -2
- package/lib/components/task-relation-modal/search/okr-status-select.js +3 -3
- package/lib/components/task-relation-modal/search/principal.js +36 -19
- package/lib/components/task-relation-modal/search/search-dropdown/index.css +2 -1
- package/lib/components/task-relation-modal/search/search-dropdown/index.js +1 -1
- package/lib/components/task-relation-modal/search/task-relation.js +83 -0
- package/lib/components/task-relation-modal/search/task-status-select.js +87 -0
- package/lib/components/task-relation-modal/search/work-relation.js +83 -0
- package/lib/components/task-relation-modal/search/work-status-select.js +74 -0
- package/lib/components/task-relation-modal/tree/category-tree/index.css +3 -3
- package/lib/components/task-relation-modal/tree/okr-tree/index.css +1 -1
- package/lib/components/task-relation-modal/tree/okr-tree/search-form.js +16 -2
- package/lib/components/task-relation-modal/tree/task-list/index.css +0 -0
- package/lib/components/task-relation-modal/tree/task-list/index.js +1 -0
- package/lib/components/task-relation-modal/tree/work-list/index.css +14 -0
- package/lib/components/task-relation-modal/tree/work-list/index.js +176 -0
- package/lib/components/task-relation-modal/tree/work-list/search-form.js +123 -0
- package/lib/components/task-relation-modal/tree/work-tree/index.css +1 -1
- package/lib/components/task-relation-modal/tree-node/category-node/index.css +1 -1
- package/lib/components/task-relation-modal/tree-node/kr-node/index.js +4 -4
- package/lib/components/task-relation-modal/tree-node/o-node/index.js +8 -8
- package/lib/components/task-relation-modal/tree-node/work-node/index.js +3 -1
- package/lib/components/task-relation-modal/work-relation/index.css +0 -0
- package/lib/components/task-relation-modal/work-relation/index.js +256 -0
- package/lib/components/task-tree/task-item-node/index.css +2 -2
- package/lib/components/tooltip/index.js +3 -0
- package/lib/components/tooltip/tooltip-rows/index.css +26 -0
- package/lib/components/tooltip/tooltip-rows/index.js +106 -0
- package/lib/components/upload/components/uploadedPreview.js +18 -18
- package/lib/components/upload/index.js +57 -29
- package/lib/components/user-selector/category-selector-panel/index.js +6 -1
- package/lib/components/user-selector/category-selector-panel/subordinate-tree.js +61 -0
- package/lib/components/user-selector/constant.js +10 -2
- package/lib/components/user-selector/empty/index.css +5 -0
- package/lib/components/user-selector/empty/index.js +9 -3
- package/lib/components/user-selector/export-modules/depart-search-selector/index.js +45 -17
- package/lib/components/user-selector/export-modules/field-tree-selector/index.js +16 -15
- package/lib/components/user-selector/images/no-auth.png +0 -0
- package/lib/components/user-selector/request-apis.js +28 -9
- package/lib/components/user-selector/searched-panel/index.js +32 -12
- package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +46 -18
- package/lib/components/wechat-btn/index.css +5 -1
- package/lib/components-v1/userSelector/components/SingleMode.js +7 -5
- package/lib/pages/home/components/data-list/table/columns/krName.js +3 -1
- package/lib/pages/home/components/data-list/table/columns/okrName.js +4 -2
- package/lib/pages/new-okr-list/header/index.js +16 -18
- package/lib/utils/auth.js +12 -0
- package/lib/utils/hooks.js +19 -5
- package/lib/utils/open-data.js +214 -66
- package/lib/utils/planDataJson.js +11115 -0
- package/lib/utils/tita-okr-cycle.js +24 -0
- package/package.json +2 -1
|
@@ -0,0 +1,152 @@
|
|
|
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 _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _getLocale = require("../../../../utils/getLocale");
|
|
15
|
+
|
|
16
|
+
var _popup = _interopRequireDefault(require("../../../../components/popup"));
|
|
17
|
+
|
|
18
|
+
var _toast = _interopRequireDefault(require("../../../../components/toast"));
|
|
19
|
+
|
|
20
|
+
var _requestApis = require("../../request-apis");
|
|
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
|
+
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); } }
|
|
31
|
+
|
|
32
|
+
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); }); }; }
|
|
33
|
+
|
|
34
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
35
|
+
|
|
36
|
+
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."); }
|
|
37
|
+
|
|
38
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
39
|
+
|
|
40
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
41
|
+
|
|
42
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
43
|
+
|
|
44
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
|
+
|
|
46
|
+
var OClassify = function OClassify(props) {
|
|
47
|
+
var editable = props.editable,
|
|
48
|
+
okrId = props.okrId,
|
|
49
|
+
okrClassify = props.okrClassify,
|
|
50
|
+
onOkrClassifyChange = props.onOkrClassifyChange;
|
|
51
|
+
|
|
52
|
+
var _useState = (0, _react.useState)(false),
|
|
53
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
54
|
+
visible = _useState2[0],
|
|
55
|
+
setVisible = _useState2[1];
|
|
56
|
+
|
|
57
|
+
var updateClassifyHandler = /*#__PURE__*/function () {
|
|
58
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(select) {
|
|
59
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
60
|
+
while (1) {
|
|
61
|
+
switch (_context.prev = _context.next) {
|
|
62
|
+
case 0:
|
|
63
|
+
if (!(select == okrClassify)) {
|
|
64
|
+
_context.next = 3;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
setVisible(false);
|
|
69
|
+
return _context.abrupt("return");
|
|
70
|
+
|
|
71
|
+
case 3:
|
|
72
|
+
_context.next = 5;
|
|
73
|
+
return (0, _requestApis.updateClassify)({
|
|
74
|
+
okrId: okrId,
|
|
75
|
+
okrClassify: select
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
case 5:
|
|
79
|
+
if (onOkrClassifyChange) {
|
|
80
|
+
onOkrClassifyChange(select);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
setVisible(false);
|
|
84
|
+
|
|
85
|
+
_toast["default"].Success('修改成功');
|
|
86
|
+
|
|
87
|
+
case 8:
|
|
88
|
+
case "end":
|
|
89
|
+
return _context.stop();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, _callee);
|
|
93
|
+
}));
|
|
94
|
+
|
|
95
|
+
return function updateClassifyHandler(_x) {
|
|
96
|
+
return _ref.apply(this, arguments);
|
|
97
|
+
};
|
|
98
|
+
}();
|
|
99
|
+
|
|
100
|
+
var renderTrigger = (0, _react.useMemo)(function () {
|
|
101
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
102
|
+
className: (0, _classnames["default"])('okr-drawer-header__classify', {
|
|
103
|
+
'okr-drawer-header__classify--editable': editable,
|
|
104
|
+
'tu-icon-nuo': okrClassify == 1,
|
|
105
|
+
'tu-icon-yuan': okrClassify == 2
|
|
106
|
+
}),
|
|
107
|
+
onClick: function onClick() {
|
|
108
|
+
return editable && setVisible(true);
|
|
109
|
+
}
|
|
110
|
+
}, okrClassify == 1 ? (0, _getLocale.getLocale)('OKR_MyO_Es_Commitment') : (0, _getLocale.getLocale)('OKR_MyO_Es_Visiontype'));
|
|
111
|
+
}, [okrClassify, editable]);
|
|
112
|
+
|
|
113
|
+
if (editable && okrClassify !== 0) {
|
|
114
|
+
var popContent = /*#__PURE__*/_react["default"].createElement("div", {
|
|
115
|
+
className: "okr-drawer-header__classify-popup"
|
|
116
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
117
|
+
className: (0, _classnames["default"])('okr-drawer-header__classify-popup-item', {
|
|
118
|
+
active: okrClassify === 1
|
|
119
|
+
}),
|
|
120
|
+
onClick: function onClick() {
|
|
121
|
+
return updateClassifyHandler(1);
|
|
122
|
+
}
|
|
123
|
+
}, (0, _getLocale.getLocale)('OKR_MyO_Es_Commitment')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
124
|
+
className: (0, _classnames["default"])('okr-drawer-header__classify-popup-item', {
|
|
125
|
+
active: okrClassify === 2
|
|
126
|
+
}),
|
|
127
|
+
onClick: function onClick() {
|
|
128
|
+
return updateClassifyHandler(2);
|
|
129
|
+
}
|
|
130
|
+
}, (0, _getLocale.getLocale)('OKR_MyO_Es_Visiontype')));
|
|
131
|
+
|
|
132
|
+
return /*#__PURE__*/_react["default"].createElement(_popup["default"], {
|
|
133
|
+
popup: popContent,
|
|
134
|
+
popupVisible: visible,
|
|
135
|
+
placement: "bottomLeft",
|
|
136
|
+
popupAlign: {
|
|
137
|
+
offset: [48, 0],
|
|
138
|
+
overflow: {
|
|
139
|
+
adjustX: true,
|
|
140
|
+
adjustY: true
|
|
141
|
+
},
|
|
142
|
+
targetOffset: [0, 0]
|
|
143
|
+
}
|
|
144
|
+
}, renderTrigger);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (okrClassify === 0) return null;
|
|
148
|
+
return renderTrigger;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
var _default = OClassify;
|
|
152
|
+
exports["default"] = _default;
|
|
@@ -13,6 +13,8 @@ var _getLocale = require("../../../../utils/getLocale");
|
|
|
13
13
|
|
|
14
14
|
var _tools = require("../../../../utils/tools");
|
|
15
15
|
|
|
16
|
+
var _openData = require("../../../../utils/open-data");
|
|
17
|
+
|
|
16
18
|
var _helper = require("../../helper");
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -28,7 +30,7 @@ function OName(props) {
|
|
|
28
30
|
OkrAndKrApprovalTypes = props.OkrAndKrApprovalTypes;
|
|
29
31
|
|
|
30
32
|
var handleEditClick = function handleEditClick() {
|
|
31
|
-
if ((0, _helper.getApprovalOkr)(approvalSetting,
|
|
33
|
+
if ((0, _helper.getApprovalOkr)(approvalSetting, 'changeOkrName', applyState, OkrAndKrApprovalTypes)) {
|
|
32
34
|
if (editable) {
|
|
33
35
|
setIsEdit(true);
|
|
34
36
|
}
|
|
@@ -36,15 +38,15 @@ function OName(props) {
|
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
39
|
-
className: (0, _classnames["default"])(
|
|
40
|
-
|
|
41
|
+
className: (0, _classnames["default"])('okr-drawer-header__title', {
|
|
42
|
+
'okr-drawer-header__title--editable': editable
|
|
41
43
|
})
|
|
42
44
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
43
45
|
className: "okr-drawer-header__name",
|
|
44
46
|
onClick: handleEditClick
|
|
45
|
-
}, (0, _tools.htmlDecodeByRegExp)(okrName)), children, Number(okrStatus) === 2 && /*#__PURE__*/_react["default"].createElement("span", {
|
|
47
|
+
}, (0, _openData.parseString)((0, _tools.htmlDecodeByRegExp)(okrName))), children, Number(okrStatus) === 2 && /*#__PURE__*/_react["default"].createElement("span", {
|
|
46
48
|
className: "okr-drawer-header__over-tag"
|
|
47
|
-
}, (0, _getLocale.getLocale)(
|
|
49
|
+
}, (0, _getLocale.getLocale)('OKR_MyO_Butt_Hasended')));
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
var _default = OName;
|
|
@@ -21,6 +21,8 @@ var _precls = _interopRequireDefault(require("../../precls"));
|
|
|
21
21
|
|
|
22
22
|
var _drawerManager = _interopRequireDefault(require("../../../../../drawer-manager"));
|
|
23
23
|
|
|
24
|
+
var _taskRelationModal = _interopRequireDefault(require("../../../../../task-relation-modal"));
|
|
25
|
+
|
|
24
26
|
var _auth = require("../../../../../../utils/auth");
|
|
25
27
|
|
|
26
28
|
var _tooltipText = _interopRequireDefault(require("../../../../../tooltip/tooltip-text"));
|
|
@@ -29,6 +31,8 @@ var _getLocale = require("../../../../../../utils/getLocale");
|
|
|
29
31
|
|
|
30
32
|
var _bsGlobal = require("../../../../../../utils/bs-global");
|
|
31
33
|
|
|
34
|
+
var _openData = require("../../../../../../utils/open-data");
|
|
35
|
+
|
|
32
36
|
require("./index.css");
|
|
33
37
|
|
|
34
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -41,10 +45,25 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
41
45
|
|
|
42
46
|
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); }); }; }
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
49
|
+
|
|
50
|
+
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."); }
|
|
51
|
+
|
|
52
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
53
|
+
|
|
54
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
55
|
+
|
|
56
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
57
|
+
|
|
58
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
59
|
+
|
|
60
|
+
var hasProject = (0, _bsGlobal.hasWebHead)('project');
|
|
61
|
+
var RelationTaskModel = _taskRelationModal["default"].RelationTaskModel,
|
|
62
|
+
RelationWorkModel = _taskRelationModal["default"].RelationWorkModel;
|
|
63
|
+
var baseAuth = new _auth.BaseAuth();
|
|
45
64
|
|
|
46
65
|
var EKrNode = function EKrNode(props) {
|
|
47
|
-
var _okrInfo$authority;
|
|
66
|
+
var _window, _window$BSGlobal, _window$BSGlobal$Work, _window$BSGlobal$Work2, _okrInfo$authority;
|
|
48
67
|
|
|
49
68
|
var index = props.index,
|
|
50
69
|
title = props.title,
|
|
@@ -60,6 +79,19 @@ var EKrNode = function EKrNode(props) {
|
|
|
60
79
|
var _useContext2 = (0, _react.useContext)(_context2.EListContext),
|
|
61
80
|
refreshEList = _useContext2.refreshEList;
|
|
62
81
|
|
|
82
|
+
var _useState = (0, _react.useState)(false),
|
|
83
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
84
|
+
isShowWork = _useState2[0],
|
|
85
|
+
setIsShowWork = _useState2[1];
|
|
86
|
+
|
|
87
|
+
var _useState3 = (0, _react.useState)(false),
|
|
88
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
89
|
+
isShowTask = _useState4[0],
|
|
90
|
+
setIsShowTask = _useState4[1];
|
|
91
|
+
|
|
92
|
+
var onlySuperCreateWork = (_window = window) === null || _window === void 0 ? void 0 : (_window$BSGlobal = _window.BSGlobal) === null || _window$BSGlobal === void 0 ? void 0 : (_window$BSGlobal$Work = _window$BSGlobal.WorkAdvancedSetting) === null || _window$BSGlobal$Work === void 0 ? void 0 : (_window$BSGlobal$Work2 = _window$BSGlobal$Work.WorkFunctionSetting) === null || _window$BSGlobal$Work2 === void 0 ? void 0 : _window$BSGlobal$Work2.WorkCreate; //开启后,仅超管、目标管理员、老板/助理可创建项目
|
|
93
|
+
|
|
94
|
+
var canCreateWork = baseAuth.isBoss() || baseAuth.isManager() || baseAuth.isWorkManager() || baseAuth.isAssistant() || !onlySuperCreateWork;
|
|
63
95
|
var isParticipant = ((_okrInfo$authority = okrInfo.authority) === null || _okrInfo$authority === void 0 ? void 0 : _okrInfo$authority.roleRelation) && okrInfo.authority.roleRelation.roleType === 2;
|
|
64
96
|
var hasRelativeAuth;
|
|
65
97
|
|
|
@@ -85,7 +117,7 @@ var EKrNode = function EKrNode(props) {
|
|
|
85
117
|
while (1) {
|
|
86
118
|
switch (_context.prev = _context.next) {
|
|
87
119
|
case 0:
|
|
88
|
-
if (name ===
|
|
120
|
+
if (name === 'addTask') {
|
|
89
121
|
params = {
|
|
90
122
|
objId: data.workId,
|
|
91
123
|
objType: 4,
|
|
@@ -105,7 +137,7 @@ var EKrNode = function EKrNode(props) {
|
|
|
105
137
|
allowObjectOptions: false
|
|
106
138
|
}
|
|
107
139
|
}).then(function () {
|
|
108
|
-
_toast["default"].Success((0, _getLocale.getLocale)(
|
|
140
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'), {
|
|
109
141
|
canClose: false
|
|
110
142
|
});
|
|
111
143
|
|
|
@@ -116,7 +148,7 @@ var EKrNode = function EKrNode(props) {
|
|
|
116
148
|
okrId: data.workId,
|
|
117
149
|
krId: data.mileStoneId
|
|
118
150
|
}).then(function () {
|
|
119
|
-
_toast["default"].Success((0, _getLocale.getLocale)(
|
|
151
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'), {
|
|
120
152
|
canClose: false
|
|
121
153
|
});
|
|
122
154
|
|
|
@@ -137,38 +169,29 @@ var EKrNode = function EKrNode(props) {
|
|
|
137
169
|
};
|
|
138
170
|
}(), []);
|
|
139
171
|
var openRelatePop = (0, _react.useCallback)(function (name) {
|
|
140
|
-
if (name ===
|
|
141
|
-
|
|
142
|
-
okrId: data.workId,
|
|
143
|
-
krId: data.mileStoneId
|
|
144
|
-
}).then(function () {
|
|
145
|
-
_toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"), {
|
|
146
|
-
canClose: false
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
setTimeout(refreshEList, 2000);
|
|
150
|
-
})["catch"](function (e) {
|
|
151
|
-
_toast["default"].Error(e, {
|
|
152
|
-
canClose: false
|
|
153
|
-
});
|
|
154
|
-
});
|
|
172
|
+
if (name === 'relateTask') {
|
|
173
|
+
setIsShowTask(true);
|
|
155
174
|
} else {
|
|
156
|
-
|
|
157
|
-
okrId: data.workId,
|
|
158
|
-
krId: data.mileStoneId
|
|
159
|
-
}).then(function () {
|
|
160
|
-
_toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"), {
|
|
161
|
-
canClose: false
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
setTimeout(refreshEList, 2000);
|
|
165
|
-
})["catch"](function (e) {
|
|
166
|
-
_toast["default"].Error(e.errorMsg, {
|
|
167
|
-
canClose: false
|
|
168
|
-
});
|
|
169
|
-
});
|
|
175
|
+
setIsShowWork(true);
|
|
170
176
|
}
|
|
171
|
-
});
|
|
177
|
+
}, []);
|
|
178
|
+
|
|
179
|
+
var onModelCancel = function onModelCancel() {
|
|
180
|
+
setIsShowTask(false);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
var onModelWorkCancel = function onModelWorkCancel() {
|
|
184
|
+
setIsShowWork(false);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
var onModelOk = function onModelOk(data) {
|
|
188
|
+
setTimeout(refreshEList, 2000);
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
var onModelWorkOK = function onModelWorkOK(data) {
|
|
192
|
+
setTimeout(refreshEList, 2000);
|
|
193
|
+
};
|
|
194
|
+
|
|
172
195
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
173
196
|
key: index,
|
|
174
197
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node"))
|
|
@@ -180,13 +203,13 @@ var EKrNode = function EKrNode(props) {
|
|
|
180
203
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node-title")),
|
|
181
204
|
onClick: function onClick() {
|
|
182
205
|
if (data.mileStoneId) {
|
|
183
|
-
_drawerManager["default"].open(
|
|
206
|
+
_drawerManager["default"].open('krDetail', {
|
|
184
207
|
krId: data.mileStoneId
|
|
185
208
|
});
|
|
186
209
|
}
|
|
187
210
|
}
|
|
188
211
|
}, /*#__PURE__*/_react["default"].createElement(_tooltipText["default"], {
|
|
189
|
-
text: title,
|
|
212
|
+
text: (0, _openData.parseString)(title),
|
|
190
213
|
minusWidth: 150,
|
|
191
214
|
isPercent: true
|
|
192
215
|
})), okrInfo.status === 1 && (isParticipant || hasRelativeAuth) ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -199,32 +222,47 @@ var EKrNode = function EKrNode(props) {
|
|
|
199
222
|
ref: btnRef
|
|
200
223
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
201
224
|
className: "tu-icon-add1"
|
|
202
|
-
}), (0, _getLocale.getLocale)(
|
|
225
|
+
}), (0, _getLocale.getLocale)('OKR_MyO_E_Butt_Newlybuild'))
|
|
203
226
|
}, /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
|
|
204
227
|
icon: "tu-icon-Add-renwu",
|
|
205
228
|
exIconClass: "e-kr-node-layer-icon",
|
|
206
229
|
name: "addTask"
|
|
207
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)(
|
|
230
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_Addtask'))), hasProject && canCreateWork ? /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
|
|
208
231
|
icon: "tu-icon-Add-xiangmu",
|
|
209
232
|
exIconClass: "e-kr-node-layer-icon",
|
|
210
233
|
name: "addProject"
|
|
211
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)(
|
|
234
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_Addproject'))) : /*#__PURE__*/_react["default"].createElement("span", null)), hasRelation && /*#__PURE__*/_react["default"].createElement(_dropSelector["default"], {
|
|
212
235
|
popupPlacement: "bottomRight",
|
|
213
236
|
onChange: openRelatePop,
|
|
214
237
|
trigger: /*#__PURE__*/_react["default"].createElement("span", {
|
|
215
238
|
className: (0, _classnames["default"])("".concat(_precls["default"], "__e-kr-node-actions-connect"))
|
|
216
239
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
217
240
|
className: "tu-icon-guanlian e-kr-node__guanlian-icon"
|
|
218
|
-
}), (0, _getLocale.getLocale)(
|
|
241
|
+
}), (0, _getLocale.getLocale)('Mod_Associate'))
|
|
219
242
|
}, /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
|
|
220
243
|
icon: "tu-icon-GL-renwu",
|
|
221
244
|
exIconClass: "e-kr-node-layer-icon",
|
|
222
245
|
name: "relateTask"
|
|
223
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)(
|
|
246
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_Assotask'))), hasProject ? /*#__PURE__*/_react["default"].createElement(_dropSelector.IconItem, {
|
|
224
247
|
icon: "tu-icon-GL-xiangmu",
|
|
225
248
|
exIconClass: "e-kr-node-layer-icon",
|
|
226
249
|
name: "relateProject"
|
|
227
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)(
|
|
250
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_E_Butt_AssProjects'))) : /*#__PURE__*/_react["default"].createElement("span", null)), isShowTask && /*#__PURE__*/_react["default"].createElement(RelationTaskModel, {
|
|
251
|
+
noScreen: true,
|
|
252
|
+
zIndex: 2400,
|
|
253
|
+
krId: data === null || data === void 0 ? void 0 : data.mileStoneId,
|
|
254
|
+
okrId: data.workId,
|
|
255
|
+
defaultVisible: true,
|
|
256
|
+
onCancel: onModelCancel,
|
|
257
|
+
onRelateSuccess: onModelOk
|
|
258
|
+
}), isShowWork && /*#__PURE__*/_react["default"].createElement(RelationWorkModel, {
|
|
259
|
+
zIndex: 2400,
|
|
260
|
+
krId: data === null || data === void 0 ? void 0 : data.mileStoneId,
|
|
261
|
+
okrId: data.workId,
|
|
262
|
+
defaultVisible: true,
|
|
263
|
+
onCancel: onModelWorkCancel,
|
|
264
|
+
onRelateSuccess: onModelWorkOK
|
|
265
|
+
})) : null);
|
|
228
266
|
};
|
|
229
267
|
|
|
230
268
|
var _default = EKrNode;
|
|
@@ -71,6 +71,10 @@
|
|
|
71
71
|
color: #f05e5e;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
.tita-okrdt-tree__kr-node-h1 {
|
|
75
|
+
display: flex;
|
|
76
|
+
}
|
|
77
|
+
|
|
74
78
|
.tita-okrdt-tree__kr-node-h2 {
|
|
75
79
|
height: 20px;
|
|
76
80
|
padding-left: 28px;
|
|
@@ -88,18 +92,76 @@
|
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
.tita-okrdt-tree__kr-node-title {
|
|
91
|
-
|
|
95
|
+
max-width: calc(100% - 32px);
|
|
92
96
|
margin-left: 8px;
|
|
93
97
|
font-size: 14px;
|
|
94
|
-
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
95
98
|
font-weight: 600;
|
|
96
|
-
color: #3f4755;
|
|
97
99
|
line-height: 22px;
|
|
100
|
+
color: #3f4755;
|
|
101
|
+
display: inline-flex;
|
|
102
|
+
font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
|
|
98
103
|
vertical-align: top;
|
|
99
|
-
width: calc(100% - 32px);
|
|
100
104
|
white-space: break-spaces;
|
|
101
105
|
}
|
|
102
106
|
|
|
107
|
+
.tita-okrdt-tree__kr-node-title--editing {
|
|
108
|
+
width: calc(100% - 32px);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.tita-okrdt-tree__kr-node-title .tu-icon-bianji2 {
|
|
112
|
+
margin-left: 5px;
|
|
113
|
+
font-size: 13px;
|
|
114
|
+
transition: visibility 0.3s ease;
|
|
115
|
+
color: #89919f;
|
|
116
|
+
visibility: hidden;
|
|
117
|
+
}
|
|
118
|
+
|
|
103
119
|
.tita-okrdt-tree__kr-node-title:hover .tu-icon-bianji2 {
|
|
104
120
|
visibility: visible;
|
|
105
121
|
}
|
|
122
|
+
|
|
123
|
+
.tita-okrdt-tree__kr-node-title .tita-rich-editor {
|
|
124
|
+
flex: 1;
|
|
125
|
+
border: 1px solid #2879ff;
|
|
126
|
+
border-radius: 4px;
|
|
127
|
+
box-shadow: 0px 0px 6px 0px rgba(40, 121, 255, 0.3) inset;
|
|
128
|
+
transition: all 0.3s ease;
|
|
129
|
+
box-sizing: border-box;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.tita-okrdt-tree__kr-node-title .tita-rich-editor .ProseMirror p {
|
|
133
|
+
padding: 2px;
|
|
134
|
+
white-space: nowrap;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.tita-okrdt-tree__kr-node-title .tita-rich-editor--disabled {
|
|
138
|
+
padding: 0;
|
|
139
|
+
flex: unset !important;
|
|
140
|
+
border-color: transparent;
|
|
141
|
+
box-shadow: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.tita-okrdt-tree__kr-node-title .tita-rich-editor--disabled .ProseMirror p {
|
|
145
|
+
padding: 0;
|
|
146
|
+
font-size: 14px;
|
|
147
|
+
font-weight: 600;
|
|
148
|
+
line-height: 20px;
|
|
149
|
+
transition: color 0.3s ease-in 0s;
|
|
150
|
+
color: #3f4755;
|
|
151
|
+
cursor: pointer;
|
|
152
|
+
display: -webkit-box;
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
text-overflow: ellipsis;
|
|
155
|
+
word-break: break-all;
|
|
156
|
+
-webkit-box-orient: vertical;
|
|
157
|
+
-webkit-line-clamp: 2;
|
|
158
|
+
white-space: normal;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.tita-okrdt-tree__kr-node-title .tita-rich-editor--disabled .ProseMirror p:hover {
|
|
162
|
+
color: #2879ff;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.tita-okrdt-tree .rc-tree-treenode {
|
|
166
|
+
overflow: visible !important;
|
|
167
|
+
}
|