@titaui/pc 1.12.0-beta.2 → 1.12.2

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.
Files changed (130) hide show
  1. package/lib/components/button/images/blue.svg +21 -0
  2. package/lib/components/button/images/red.svg +21 -0
  3. package/lib/components/button/images/white.svg +19 -0
  4. package/lib/components/button/rect-btn/index.js +3 -3
  5. package/lib/components/checkbox/index.css +4 -0
  6. package/lib/components/contact-kefu/index.css +10 -0
  7. package/lib/components/contact-kefu/index.js +8 -2
  8. package/lib/components/create-okr-modal/index.js +3 -1
  9. package/lib/components/dynamic/constant.js +1 -1
  10. package/lib/components/dynamic/dynamic-list/index.js +14 -7
  11. package/lib/components/dynamic/index.js +9 -12
  12. package/lib/components/dynamic/request-api.js +7 -68
  13. package/lib/components/nav-top/components/menu/index.js +16 -14
  14. package/lib/components/nav-top/index.js +2 -2
  15. package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +1 -1
  16. package/lib/components/okr-detail/e-list/index.js +2 -2
  17. package/lib/components/period-selector/interface.js +7 -0
  18. package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +16 -10
  19. package/lib/components/search-input/index.css +1 -1
  20. package/lib/components/select-layer/index.css +1 -1
  21. package/lib/components/task-relation-modal/helper.js +139 -2
  22. package/lib/components/task-relation-modal/image/loading.gif +0 -0
  23. package/lib/components/task-relation-modal/index.js +9 -0
  24. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.css +18 -0
  25. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +262 -0
  26. package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +135 -0
  27. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.css +0 -0
  28. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +129 -0
  29. package/lib/components/task-relation-modal/okr-relation/request-api.js +106 -0
  30. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +120 -0
  31. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +185 -0
  32. package/lib/components/task-relation-modal/request-api.js +28 -2
  33. package/lib/components/task-relation-modal/search/okr-status-select.js +3 -3
  34. package/lib/components/task-relation-modal/search/principal.js +36 -19
  35. package/lib/components/task-relation-modal/search/search-dropdown/index.css +2 -1
  36. package/lib/components/task-relation-modal/search/search-dropdown/index.js +1 -1
  37. package/lib/components/{dynamic/dynamic-topping/index.js → task-relation-modal/search/task-relation.js} +45 -44
  38. package/lib/components/task-relation-modal/search/task-status-select.js +87 -0
  39. package/lib/components/{dynamic/dynamic-liking/index.js → task-relation-modal/search/work-relation.js} +43 -39
  40. package/lib/components/task-relation-modal/search/work-status-select.js +74 -0
  41. package/lib/components/task-relation-modal/tree/category-tree/index.css +3 -3
  42. package/lib/components/task-relation-modal/tree/okr-tree/index.css +1 -1
  43. package/lib/components/task-relation-modal/tree/okr-tree/search-form.js +16 -2
  44. package/lib/components/task-relation-modal/tree/task-list/index.css +0 -0
  45. package/lib/components/task-relation-modal/tree/task-list/index.js +1 -0
  46. package/lib/components/task-relation-modal/tree/work-list/index.css +14 -0
  47. package/lib/components/task-relation-modal/tree/work-list/index.js +176 -0
  48. package/lib/components/task-relation-modal/tree/work-list/search-form.js +123 -0
  49. package/lib/components/task-relation-modal/tree/work-tree/index.css +1 -1
  50. package/lib/components/task-relation-modal/tree-node/category-node/index.css +1 -1
  51. package/lib/components/task-relation-modal/tree-node/work-node/index.js +3 -1
  52. package/lib/components/task-relation-modal/work-relation/index.css +0 -0
  53. package/lib/components/task-relation-modal/work-relation/index.js +256 -0
  54. package/lib/components/tooltip/index.js +3 -0
  55. package/lib/components/tooltip/tooltip-rows/index.css +26 -0
  56. package/lib/components/{dynamic/advertise → tooltip/tooltip-rows}/index.js +65 -85
  57. package/lib/components/user-selector/category-selector-panel/index.js +6 -1
  58. package/lib/components/{dynamic/quick-operation/components/create-task/index.js → user-selector/category-selector-panel/subordinate-tree.js} +37 -20
  59. package/lib/components/user-selector/constant.js +10 -2
  60. package/lib/components/user-selector/export-modules/depart-search-selector/index.js +0 -3
  61. package/lib/components/user-selector/export-modules/field-tree-selector/index.js +3 -1
  62. package/lib/components/user-selector/request-apis.js +28 -9
  63. package/lib/components/user-selector/searched-panel/index.js +21 -8
  64. package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +46 -18
  65. package/lib/utils/planDataJson.js +11115 -0
  66. package/package.json +2 -2
  67. package/lib/components/dynamic/advertise/components/next-btn/index.css +0 -27
  68. package/lib/components/dynamic/advertise/components/next-btn/index.js +0 -32
  69. package/lib/components/dynamic/advertise/components/pre-btn/index.css +0 -26
  70. package/lib/components/dynamic/advertise/components/pre-btn/index.js +0 -32
  71. package/lib/components/dynamic/advertise/index.css +0 -21
  72. package/lib/components/dynamic/advertise/interface.js +0 -5
  73. package/lib/components/dynamic/advertise/util.js +0 -28
  74. package/lib/components/dynamic/components/dynamic-search-input/index.css +0 -81
  75. package/lib/components/dynamic/components/dynamic-search-input/index.js +0 -203
  76. package/lib/components/dynamic/components/first-level-tabs/index.css +0 -101
  77. package/lib/components/dynamic/components/first-level-tabs/index.js +0 -131
  78. package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +0 -23
  79. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
  80. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
  81. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
  82. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-empty.png +0 -0
  83. package/lib/components/dynamic/dynamic-like-ranking/index.css +0 -146
  84. package/lib/components/dynamic/dynamic-like-ranking/index.js +0 -180
  85. package/lib/components/dynamic/dynamic-like-ranking/item.js +0 -105
  86. package/lib/components/dynamic/dynamic-like-ranking/mock.js +0 -84
  87. package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +0 -30
  88. package/lib/components/dynamic/dynamic-liking/index.css +0 -81
  89. package/lib/components/dynamic/dynamic-liking/item.js +0 -75
  90. package/lib/components/dynamic/dynamic-liking/mock.js +0 -83
  91. package/lib/components/dynamic/dynamic-topping/image/quotation-mark.svg +0 -16
  92. package/lib/components/dynamic/dynamic-topping/image/top-icon.svg +0 -30
  93. package/lib/components/dynamic/dynamic-topping/index.css +0 -141
  94. package/lib/components/dynamic/dynamic-topping/interface.js +0 -5
  95. package/lib/components/dynamic/dynamic-topping/item.js +0 -153
  96. package/lib/components/dynamic/dynamic-topping/request-api.js +0 -36
  97. package/lib/components/dynamic/dynamic.css +0 -173
  98. package/lib/components/dynamic/dynamic.js +0 -428
  99. package/lib/components/dynamic/export-module/index.js +0 -37
  100. package/lib/components/dynamic/img/dynamic-top.svg +0 -14
  101. package/lib/components/dynamic/my-team/img/add-subordinate.png +0 -0
  102. package/lib/components/dynamic/my-team/img/line.png +0 -0
  103. package/lib/components/dynamic/my-team/img/team.png +0 -0
  104. package/lib/components/dynamic/my-team/index.css +0 -184
  105. package/lib/components/dynamic/my-team/index.js +0 -263
  106. package/lib/components/dynamic/my-team/request-api.js +0 -52
  107. package/lib/components/dynamic/my-team/util.js +0 -20
  108. package/lib/components/dynamic/new-ui.css +0 -192
  109. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.css +0 -58
  110. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.js +0 -68
  111. package/lib/components/dynamic/online-broadcast/data.js +0 -95
  112. package/lib/components/dynamic/online-broadcast/img/broadcast.svg +0 -14
  113. package/lib/components/dynamic/online-broadcast/img/new.png +0 -0
  114. package/lib/components/dynamic/online-broadcast/img/preview.png +0 -0
  115. package/lib/components/dynamic/online-broadcast/index.css +0 -46
  116. package/lib/components/dynamic/online-broadcast/index.js +0 -61
  117. package/lib/components/dynamic/online-broadcast/interfact.js +0 -5
  118. package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +0 -25
  119. package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +0 -39
  120. package/lib/components/dynamic/quick-operation/components/create-okr/index.css +0 -25
  121. package/lib/components/dynamic/quick-operation/components/create-okr/index.js +0 -39
  122. package/lib/components/dynamic/quick-operation/components/create-share/index.css +0 -25
  123. package/lib/components/dynamic/quick-operation/components/create-share/index.js +0 -39
  124. package/lib/components/dynamic/quick-operation/components/create-task/index.css +0 -25
  125. package/lib/components/dynamic/quick-operation/img/new-announcement.png +0 -0
  126. package/lib/components/dynamic/quick-operation/img/new-okr.png +0 -0
  127. package/lib/components/dynamic/quick-operation/img/new-share.png +0 -0
  128. package/lib/components/dynamic/quick-operation/img/new-task.png +0 -0
  129. package/lib/components/dynamic/quick-operation/index.css +0 -51
  130. package/lib/components/dynamic/quick-operation/index.js +0 -120
@@ -0,0 +1,129 @@
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 _dialog = _interopRequireDefault(require("../../../dialog"));
13
+
14
+ var _toast = _interopRequireDefault(require("../../../toast"));
15
+
16
+ var _requestApi = require("../request-api");
17
+
18
+ var _workList = _interopRequireDefault(require("../../tree/work-list"));
19
+
20
+ var _getLocale = require("../../../../utils/getLocale");
21
+
22
+ require("./index.css");
23
+
24
+ var _excluded = ["defaultVisible", "multiple", "onOk", "onCancel", "onRelateSuccess", "krId", "okrId", "isRelationOther", "lastSelected"];
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
+
28
+ 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); }
29
+
30
+ 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; }
31
+
32
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
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
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
47
+
48
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
49
+
50
+ var preCls = 'relation-task';
51
+
52
+ function OkrRelationWorkModal(props) {
53
+ var _props$defaultVisible = props.defaultVisible,
54
+ defaultVisible = _props$defaultVisible === void 0 ? false : _props$defaultVisible,
55
+ _props$multiple = props.multiple,
56
+ multiple = _props$multiple === void 0 ? true : _props$multiple,
57
+ onOk = props.onOk,
58
+ _props$onCancel = props.onCancel,
59
+ onCancel = _props$onCancel === void 0 ? function () {} : _props$onCancel,
60
+ onRelateSuccess = props.onRelateSuccess,
61
+ krId = props.krId,
62
+ okrId = props.okrId,
63
+ _props$isRelationOthe = props.isRelationOther,
64
+ isRelationOther = _props$isRelationOthe === void 0 ? false : _props$isRelationOthe,
65
+ _props$lastSelected = props.lastSelected,
66
+ lastSelected = _props$lastSelected === void 0 ? [] : _props$lastSelected,
67
+ restProps = _objectWithoutProperties(props, _excluded);
68
+
69
+ var _useState = (0, _react.useState)(defaultVisible),
70
+ _useState2 = _slicedToArray(_useState, 2),
71
+ visible = _useState2[0],
72
+ setVisible = _useState2[1];
73
+
74
+ var _useState3 = (0, _react.useState)(lastSelected),
75
+ _useState4 = _slicedToArray(_useState3, 2),
76
+ selected = _useState4[0],
77
+ setSelected = _useState4[1];
78
+
79
+ (0, _react.useEffect)(function () {
80
+ setVisible(defaultVisible);
81
+ }, [defaultVisible]);
82
+
83
+ var onOkHandler = function onOkHandler() {
84
+ if (krId && selected !== null && selected !== void 0 && selected.length) {
85
+ (0, _requestApi.workRelateOkr)(selected, krId, okrId).then(function (res) {
86
+ if (res.Code) {
87
+ _toast["default"].Success((0, _getLocale.getLocale)('Per_Ass_New_Ass_text_Succe'));
88
+
89
+ onRelateSuccess && onRelateSuccess(res.Data);
90
+ }
91
+ });
92
+ }
93
+
94
+ onCancelHandler();
95
+ onOk && onOk(selected);
96
+ setSelected([]);
97
+ };
98
+
99
+ var onCancelHandler = function onCancelHandler() {
100
+ setVisible(false);
101
+ onCancel && onCancel();
102
+ };
103
+
104
+ return /*#__PURE__*/_react["default"].createElement(_dialog["default"], _extends({
105
+ title: '关联项目',
106
+ visible: visible,
107
+ onOk: onOkHandler,
108
+ onCancel: onCancelHandler,
109
+ onClose: onCancelHandler,
110
+ style: {
111
+ height: '590px'
112
+ },
113
+ width: 840,
114
+ zIndex: 1000,
115
+ noHeadLine: true,
116
+ noFooterLine: true // getContainer={getContainer}
117
+ ,
118
+ extraClass: ['pull-screen-ignore', 'tita-user-pop'],
119
+ destroyOnClose: false
120
+ }, restProps), /*#__PURE__*/_react["default"].createElement("div", {
121
+ className: "".concat(preCls, "__content")
122
+ }, /*#__PURE__*/_react["default"].createElement(_workList["default"], {
123
+ selected: selected,
124
+ setSelected: setSelected
125
+ })));
126
+ }
127
+
128
+ var _default = OkrRelationWorkModal;
129
+ exports["default"] = _default;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.workRelateOkr = exports.relateOkr = exports.planTableTask = void 0;
7
+
8
+ var _request = require("@titaui/request");
9
+
10
+ var _helpers = require("../../../utils/helpers");
11
+
12
+ var dealMessage = function dealMessage(res) {
13
+ var Code = res.Code,
14
+ Data = res.Data;
15
+
16
+ if (!!Code) {
17
+ return Data;
18
+ } else {
19
+ return false;
20
+ }
21
+ };
22
+
23
+ var id = (0, _helpers.getLoginUserInfo)().Id;
24
+
25
+ var planTableTask = function planTableTask(params, pageNum, pageSize) {
26
+ var url = "task/search";
27
+ var _params$startDate = params.startDate,
28
+ startDate = _params$startDate === void 0 ? '' : _params$startDate,
29
+ _params$endDate = params.endDate,
30
+ endDate = _params$endDate === void 0 ? '' : _params$endDate,
31
+ _params$keyWords = params.keyWords,
32
+ keyWords = _params$keyWords === void 0 ? '' : _params$keyWords,
33
+ _params$status = params.status,
34
+ status = _params$status === void 0 ? 10 : _params$status,
35
+ _params$planTableId = params.planTableId,
36
+ planTableId = _params$planTableId === void 0 ? '' : _params$planTableId,
37
+ _params$planTableType = params.planTableType,
38
+ planTableType = _params$planTableType === void 0 ? '' : _params$planTableType,
39
+ _params$relation = params.relation,
40
+ relation = _params$relation === void 0 ? 0 : _params$relation;
41
+
42
+ if (status == 10) {
43
+ status = '0,1,2,3,4,6';
44
+ }
45
+
46
+ if (!relation) {
47
+ relation = '1,2,3';
48
+ }
49
+
50
+ return (0, _request.rpost)('v2')(url, {
51
+ type: 'personal',
52
+ to_user_id: id,
53
+ StartDate: startDate,
54
+ EndDate: endDate,
55
+ startNum: pageNum,
56
+ count: pageSize,
57
+ planTableId: planTableId,
58
+ planTableType: planTableType,
59
+ fromLevel: 1,
60
+ toLevel: 1,
61
+ RelationType: relation,
62
+ Status: status,
63
+ FilterKey: keyWords,
64
+ includeCreateFailApprovalOkr: false
65
+ }).then(function (res) {
66
+ return dealMessage(res);
67
+ });
68
+ };
69
+
70
+ exports.planTableTask = planTableTask;
71
+
72
+ var relateOkr = function relateOkr(selected, labelKrId, labelOId) {
73
+ var taskRelationModel = {
74
+ workId: labelOId,
75
+ krId: labelKrId
76
+ };
77
+ var ids = [];
78
+ selected.forEach(function (ele) {
79
+ ids.push(ele.id);
80
+ });
81
+ var url = "task/relateOkrV2";
82
+ return (0, _request.rpost)('v2')(url, {
83
+ taskId: ids.join(','),
84
+ taskRelationModels: [taskRelationModel]
85
+ });
86
+ };
87
+
88
+ exports.relateOkr = relateOkr;
89
+
90
+ var workRelateOkr = function workRelateOkr(selected, labelKrId, labelOId) {
91
+ var taskRelationModel = {
92
+ workId: labelOId,
93
+ krId: labelKrId
94
+ };
95
+ var ids = [];
96
+ selected.forEach(function (ele) {
97
+ ids.push(ele.id);
98
+ });
99
+ var url = "work/batch/relationOkr";
100
+ return (0, _request.rpost)('v2')(url, {
101
+ workId: ids.join(','),
102
+ taskRelationModels: [taskRelationModel]
103
+ });
104
+ };
105
+
106
+ exports.workRelateOkr = workRelateOkr;
@@ -0,0 +1,120 @@
1
+ .okr-relation-tree__empty {
2
+ height: 384px;
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ color: #A4ACB9;
7
+ }
8
+
9
+ .okr-relation-tree__header {
10
+ font-size: 12px;
11
+ font-weight: 400;
12
+ color: #A4ACB9;
13
+ position: relative;
14
+ display: flex;
15
+ align-items: center;
16
+ margin-bottom: 11px;
17
+ }
18
+
19
+ .okr-relation-tree__header-name {
20
+ width: 332px;
21
+ margin-left: 12px;
22
+ }
23
+
24
+ .okr-relation-tree__header-status {
25
+ width: 60px;
26
+ margin-left: 40px;
27
+ }
28
+
29
+ .okr-relation-tree__header-principer {
30
+ width: 60px;
31
+ margin-left: 40px;
32
+ }
33
+
34
+ .okr-relation-tree__header-time {
35
+ width: 176px;
36
+ margin-left: 40px;
37
+ text-align: right;
38
+ }
39
+
40
+ .okr-relation-tree__header::after {
41
+ content: '';
42
+ display: block;
43
+ position: absolute;
44
+ bottom: -11px;
45
+ width: 100%;
46
+ height: 1px;
47
+ background-color: #e9ecf0;
48
+ }
49
+
50
+ .okr-relation-tree__content {
51
+ margin-right: -32px;
52
+ margin-left: -4px;
53
+ height: 305px;
54
+ font-size: 14px;
55
+ font-weight: 400;
56
+ line-height: 22px;
57
+ }
58
+
59
+ .okr-relation-tree__content-item {
60
+ width: 776px;
61
+ display: flex;
62
+ align-items: flex-start;
63
+ padding: 6px 4px;
64
+ border-radius: 8px;
65
+ margin-top: 12px;
66
+ }
67
+
68
+ .okr-relation-tree__content-item:nth-of-type(1) {
69
+ margin-top: 9px;
70
+ }
71
+
72
+ .okr-relation-tree__content-item:hover {
73
+ background-color: #f0f4fa;
74
+ }
75
+
76
+ .okr-relation-tree__content-item-name {
77
+ cursor: pointer;
78
+ display: -webkit-box;
79
+ overflow: hidden;
80
+ text-overflow: ellipsis;
81
+ word-break: break-all;
82
+ -webkit-box-orient: vertical;
83
+ -webkit-line-clamp: 2;
84
+ width: 332px;
85
+ margin-left: 12px;
86
+ }
87
+
88
+ .okr-relation-tree__content-item-name:hover {
89
+ color: #2879ff;
90
+ }
91
+
92
+ .okr-relation-tree__content-item-name:focus-within {
93
+ color: red;
94
+ }
95
+
96
+ .okr-relation-tree__content-item-status {
97
+ width: 60px;
98
+ margin-left: 40px;
99
+ }
100
+
101
+ .okr-relation-tree__content-item-principer {
102
+ width: 60px;
103
+ margin-left: 40px;
104
+ }
105
+
106
+ .okr-relation-tree__content-item-time {
107
+ width: 176px;
108
+ margin-left: 40px;
109
+ text-align: right;
110
+ }
111
+
112
+ .okr-relation-tree__content-pagination {
113
+ margin-top: 14px;
114
+ }
115
+
116
+ .okr-relation-tree__checkbox {
117
+ height: 22px;
118
+ display: inline-flex;
119
+ align-items: center;
120
+ }
@@ -0,0 +1,185 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = exports.TaskTree = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _checkbox = _interopRequireDefault(require("../../../../checkbox"));
11
+
12
+ var _helper = require("../../../helper");
13
+
14
+ var _openData = require("../../../../../utils/open-data");
15
+
16
+ var _tools = require("../../../../../utils/tools");
17
+
18
+ var _tooltipText = _interopRequireDefault(require("../../../../tooltip/tooltip-text"));
19
+
20
+ var _helpers = require("../../../../../utils/helpers");
21
+
22
+ var _scrollbar = _interopRequireDefault(require("../../../../scrollbar"));
23
+
24
+ var _radio = _interopRequireDefault(require("../../../radio"));
25
+
26
+ require("./index.css");
27
+
28
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
+
30
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
31
+
32
+ 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."); }
33
+
34
+ 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); }
35
+
36
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
37
+
38
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
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
+ var preCls = 'okr-relation-tree';
43
+
44
+ var TaskTree = function TaskTree(_ref) {
45
+ var data = _ref.data,
46
+ selected = _ref.selected,
47
+ multiple = _ref.multiple,
48
+ setSelected = _ref.setSelected,
49
+ pageSize = _ref.pageSize,
50
+ _ref$isWork = _ref.isWork,
51
+ isWork = _ref$isWork === void 0 ? false : _ref$isWork;
52
+ var scrollStyle = {
53
+ height: '100%',
54
+ backgroundColor: 'transparent',
55
+ width: '100%'
56
+ };
57
+
58
+ var handleName = function handleName(id) {
59
+ if (isWork) {
60
+ window.open("#work?work_id=".concat(id, "&to_user_id=").concat((0, _helpers.getLoginUserInfo)().Id, "&status=1"));
61
+ } else {
62
+ window.Talent.app.vent.trigger('global-pull-screen', id, 'task');
63
+ }
64
+ };
65
+
66
+ var handlerCheckAll = function handlerCheckAll(checked) {
67
+ if (checked) {
68
+ var ids = [];
69
+ data.forEach(function (item) {
70
+ var obj = {};
71
+ obj['id'] = item.id;
72
+ ids.push(obj);
73
+ });
74
+ setSelected(ids);
75
+ } else {
76
+ setSelected([]);
77
+ }
78
+ };
79
+
80
+ var isSelectedAll = function isSelectedAll() {
81
+ if (selected.length === pageSize) {
82
+ return true;
83
+ } else {
84
+ return false;
85
+ }
86
+ };
87
+
88
+ var onCheckHandler = function onCheckHandler(checked, id) {
89
+ if (checked) {
90
+ if (multiple) {
91
+ setSelected([{
92
+ id: id
93
+ }].concat(_toConsumableArray(selected)));
94
+ } else {
95
+ setSelected([{
96
+ id: id
97
+ }]);
98
+ }
99
+ } else {
100
+ if (multiple) {
101
+ var newArr = selected.filter(function (item) {
102
+ return item.id !== id;
103
+ });
104
+ setSelected(newArr);
105
+ } else {
106
+ setSelected([]);
107
+ }
108
+ }
109
+ };
110
+
111
+ var hasId = function hasId(id) {
112
+ if (!id) return false;
113
+ return !!selected.find(function (item) {
114
+ return item.id === id;
115
+ });
116
+ };
117
+
118
+ if (!(data !== null && data !== void 0 && data.length)) return /*#__PURE__*/_react["default"].createElement("div", {
119
+ className: "".concat(preCls, "__empty")
120
+ }, "\u6682\u65E0", isWork ? '项目' : '任务', "\u6570\u636E");
121
+ return /*#__PURE__*/_react["default"].createElement("div", {
122
+ className: preCls
123
+ }, /*#__PURE__*/_react["default"].createElement("div", {
124
+ className: "".concat(preCls, "__header")
125
+ }, multiple && /*#__PURE__*/_react["default"].createElement("span", {
126
+ className: "".concat(preCls, "__checkbox")
127
+ }, /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
128
+ onChange: handlerCheckAll,
129
+ name: 'all',
130
+ checked: isSelectedAll()
131
+ })), /*#__PURE__*/_react["default"].createElement("span", {
132
+ className: "".concat(preCls, "__header-name")
133
+ }, isWork ? '项目' : '任务'), /*#__PURE__*/_react["default"].createElement("span", {
134
+ className: "".concat(preCls, "__header-status")
135
+ }, "\u72B6\u6001"), /*#__PURE__*/_react["default"].createElement("span", {
136
+ className: "".concat(preCls, "__header-principer")
137
+ }, "\u8D1F\u8D23\u4EBA"), /*#__PURE__*/_react["default"].createElement("span", {
138
+ className: "".concat(preCls, "__header-time")
139
+ }, "\u8D77\u6B62\u65F6\u95F4")), /*#__PURE__*/_react["default"].createElement("div", {
140
+ className: "".concat(preCls, "__content")
141
+ }, /*#__PURE__*/_react["default"].createElement(_scrollbar["default"].Mask, {
142
+ style: scrollStyle,
143
+ maskHeight: 16
144
+ }, data.map(function (item) {
145
+ var _item$principalUser, _item$principalUser2, _item$principalUser3;
146
+
147
+ return /*#__PURE__*/_react["default"].createElement("div", {
148
+ className: "".concat(preCls, "__content-item"),
149
+ key: item.id
150
+ }, multiple && /*#__PURE__*/_react["default"].createElement("span", {
151
+ className: "".concat(preCls, "__checkbox")
152
+ }, /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
153
+ onChange: onCheckHandler,
154
+ name: item.id,
155
+ checked: hasId(item.id)
156
+ })), !multiple && /*#__PURE__*/_react["default"].createElement("span", {
157
+ className: "".concat(preCls, "__checkbox")
158
+ }, /*#__PURE__*/_react["default"].createElement(_radio["default"], {
159
+ onChange: onCheckHandler,
160
+ id: item.id,
161
+ checked: hasId(item.id)
162
+ })), /*#__PURE__*/_react["default"].createElement("div", {
163
+ className: "".concat(preCls, "__content-item-name"),
164
+ onClick: function onClick() {
165
+ return handleName(item.id);
166
+ }
167
+ }, (0, _tools.htmlDecodeByRegExp)(item.name)), /*#__PURE__*/_react["default"].createElement("div", {
168
+ className: "".concat(preCls, "__content-item-status")
169
+ }, item.status), /*#__PURE__*/_react["default"].createElement("div", {
170
+ className: "".concat(preCls, "__content-item-principer")
171
+ }, /*#__PURE__*/_react["default"].createElement(_tooltipText["default"], {
172
+ maxWidth: 60,
173
+ text: /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
174
+ name: (item === null || item === void 0 ? void 0 : (_item$principalUser = item.principalUser) === null || _item$principalUser === void 0 ? void 0 : _item$principalUser.name) || (item === null || item === void 0 ? void 0 : (_item$principalUser2 = item.principalUser) === null || _item$principalUser2 === void 0 ? void 0 : _item$principalUser2.Name),
175
+ id: item === null || item === void 0 ? void 0 : (_item$principalUser3 = item.principalUser) === null || _item$principalUser3 === void 0 ? void 0 : _item$principalUser3.userId
176
+ })
177
+ })), /*#__PURE__*/_react["default"].createElement("div", {
178
+ className: "".concat(preCls, "__content-item-time")
179
+ }, (0, _helper.formatDateStr)(item.startDate), " -", ' ', (0, _helper.formatDateStr)(item.endDate)));
180
+ }))));
181
+ };
182
+
183
+ exports.TaskTree = TaskTree;
184
+ var _default = TaskTree;
185
+ exports["default"] = _default;
@@ -3,10 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.updateLable = exports.relationWorks = exports.okrSearch = exports.getWorks = exports.getUserById = exports.getCategory = void 0;
6
+ exports.workData = exports.updateLable = exports.relationWorks = exports.okrSearch = exports.getWorks = exports.getUserById = exports.getCategory = void 0;
7
7
 
8
8
  var _request = require("../../utils/request");
9
9
 
10
+ var _helpers = require("../../utils/helpers");
11
+
10
12
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
13
 
12
14
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -79,4 +81,28 @@ var getUserById = function getUserById(userId) {
79
81
  });
80
82
  };
81
83
 
82
- exports.getUserById = getUserById;
84
+ exports.getUserById = getUserById;
85
+
86
+ var workData = function workData(params, pageNum, pageSize) {
87
+ var _params$keyWords2 = params.keyWords,
88
+ keyWords = _params$keyWords2 === void 0 ? "" : _params$keyWords2,
89
+ _params$status = params.status,
90
+ status = _params$status === void 0 ? 0 : _params$status,
91
+ _params$relation = params.relation,
92
+ relation = _params$relation === void 0 ? 0 : _params$relation,
93
+ userIds = params.userIds;
94
+ var url = "work/list?toUserId=".concat(userIds || (0, _helpers.getLoginUserInfo)().Id);
95
+ return (0, _request.rpost)("v1")(url, {
96
+ keyWords: keyWords,
97
+ orderType: 1,
98
+ pageNum: pageNum,
99
+ pageSize: pageSize,
100
+ relation: relation,
101
+ status: status,
102
+ userIds: userIds
103
+ }).then(function (res) {
104
+ return res;
105
+ });
106
+ };
107
+
108
+ exports.workData = workData;
@@ -37,7 +37,7 @@ function OkrStatusSelect(props) {
37
37
  var onChange = props.onChange,
38
38
  initValue = props.initValue;
39
39
 
40
- var _useState = (0, _react.useState)((0, _getLocale.getLocale)("OKR_MyO_Butt_AllStates")),
40
+ var _useState = (0, _react.useState)((0, _getLocale.getLocale)("OKR_MyO_E_From_AllStates")),
41
41
  _useState2 = _slicedToArray(_useState, 2),
42
42
  selectText = _useState2[0],
43
43
  setSelectText = _useState2[1];
@@ -48,13 +48,13 @@ function OkrStatusSelect(props) {
48
48
  };
49
49
 
50
50
  var selectOptions = [{
51
- label: (0, _getLocale.getLocale)("OKR_MyO_Butt_AllStates"),
51
+ label: (0, _getLocale.getLocale)("OKR_MyO_E_From_AllStates"),
52
52
  value: 0
53
53
  }, {
54
54
  label: (0, _getLocale.getLocale)("Per_MyRe_text_Inprogress"),
55
55
  value: 1
56
56
  }, {
57
- label: (0, _getLocale.getLocale)("OKR_MyO_Butt_Hasended"),
57
+ label: (0, _getLocale.getLocale)("Pro_page_Sta_Completed"),
58
58
  value: 2
59
59
  }];
60
60
  return /*#__PURE__*/_react["default"].createElement(_selectLayer["default"], {