@titaui/pc 1.11.52 → 1.11.55

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 (117) 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/create-okr-modal/index.js +3 -1
  7. package/lib/components/dynamic/dynamic-list/index.js +14 -7
  8. package/lib/components/dynamic/index.js +9 -12
  9. package/lib/components/dynamic/request-api.js +7 -68
  10. package/lib/components/nav-top/index.js +2 -2
  11. package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +1 -1
  12. package/lib/components/okr-detail/e-list/index.js +2 -2
  13. package/lib/components/period-selector/interface.js +7 -0
  14. package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +16 -10
  15. package/lib/components/search-input/index.css +1 -1
  16. package/lib/components/select-layer/index.css +1 -1
  17. package/lib/components/task-relation-modal/helper.js +139 -2
  18. package/lib/components/task-relation-modal/image/loading.gif +0 -0
  19. package/lib/components/task-relation-modal/index.js +9 -0
  20. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.css +18 -0
  21. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +262 -0
  22. package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +135 -0
  23. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.css +0 -0
  24. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +129 -0
  25. package/lib/components/task-relation-modal/okr-relation/request-api.js +106 -0
  26. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +120 -0
  27. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +185 -0
  28. package/lib/components/task-relation-modal/request-api.js +28 -2
  29. package/lib/components/task-relation-modal/search/okr-status-select.js +3 -3
  30. package/lib/components/task-relation-modal/search/principal.js +20 -5
  31. package/lib/components/task-relation-modal/search/search-dropdown/index.css +2 -1
  32. package/lib/components/task-relation-modal/search/search-dropdown/index.js +1 -1
  33. package/lib/components/{dynamic/dynamic-topping/index.js → task-relation-modal/search/task-relation.js} +45 -44
  34. package/lib/components/task-relation-modal/search/task-status-select.js +87 -0
  35. package/lib/components/{dynamic/dynamic-liking/index.js → task-relation-modal/search/work-relation.js} +43 -39
  36. package/lib/components/task-relation-modal/search/work-status-select.js +74 -0
  37. package/lib/components/task-relation-modal/tree/okr-tree/index.css +1 -1
  38. package/lib/components/task-relation-modal/tree/okr-tree/search-form.js +16 -2
  39. package/lib/components/task-relation-modal/tree/task-list/index.css +0 -0
  40. package/lib/components/task-relation-modal/tree/task-list/index.js +1 -0
  41. package/lib/components/task-relation-modal/tree/work-list/index.css +14 -0
  42. package/lib/components/task-relation-modal/tree/work-list/index.js +176 -0
  43. package/lib/components/task-relation-modal/tree/work-list/search-form.js +123 -0
  44. package/lib/components/task-relation-modal/tree-node/work-node/index.js +3 -1
  45. package/lib/components/task-relation-modal/work-relation/index.css +0 -0
  46. package/lib/components/task-relation-modal/work-relation/index.js +256 -0
  47. package/lib/components/tooltip/index.js +3 -0
  48. package/lib/components/tooltip/tooltip-rows/index.css +26 -0
  49. package/lib/components/{dynamic/advertise → tooltip/tooltip-rows}/index.js +65 -85
  50. package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +46 -18
  51. package/lib/utils/planDataJson.js +11115 -0
  52. package/package.json +2 -2
  53. package/lib/components/dynamic/advertise/components/next-btn/index.css +0 -27
  54. package/lib/components/dynamic/advertise/components/next-btn/index.js +0 -32
  55. package/lib/components/dynamic/advertise/components/pre-btn/index.css +0 -26
  56. package/lib/components/dynamic/advertise/components/pre-btn/index.js +0 -32
  57. package/lib/components/dynamic/advertise/index.css +0 -21
  58. package/lib/components/dynamic/advertise/interface.js +0 -5
  59. package/lib/components/dynamic/advertise/util.js +0 -28
  60. package/lib/components/dynamic/components/dynamic-search-input/index.css +0 -81
  61. package/lib/components/dynamic/components/dynamic-search-input/index.js +0 -203
  62. package/lib/components/dynamic/components/first-level-tabs/index.css +0 -101
  63. package/lib/components/dynamic/components/first-level-tabs/index.js +0 -131
  64. package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +0 -23
  65. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
  66. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
  67. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
  68. package/lib/components/dynamic/dynamic-like-ranking/image/ranking-empty.png +0 -0
  69. package/lib/components/dynamic/dynamic-like-ranking/index.css +0 -146
  70. package/lib/components/dynamic/dynamic-like-ranking/index.js +0 -180
  71. package/lib/components/dynamic/dynamic-like-ranking/item.js +0 -105
  72. package/lib/components/dynamic/dynamic-like-ranking/mock.js +0 -84
  73. package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +0 -30
  74. package/lib/components/dynamic/dynamic-liking/index.css +0 -81
  75. package/lib/components/dynamic/dynamic-liking/item.js +0 -75
  76. package/lib/components/dynamic/dynamic-liking/mock.js +0 -83
  77. package/lib/components/dynamic/dynamic-topping/image/quotation-mark.svg +0 -16
  78. package/lib/components/dynamic/dynamic-topping/image/top-icon.svg +0 -30
  79. package/lib/components/dynamic/dynamic-topping/index.css +0 -141
  80. package/lib/components/dynamic/dynamic-topping/interface.js +0 -5
  81. package/lib/components/dynamic/dynamic-topping/item.js +0 -153
  82. package/lib/components/dynamic/dynamic-topping/request-api.js +0 -36
  83. package/lib/components/dynamic/dynamic.css +0 -173
  84. package/lib/components/dynamic/dynamic.js +0 -428
  85. package/lib/components/dynamic/export-module/index.js +0 -37
  86. package/lib/components/dynamic/img/dynamic-top.svg +0 -14
  87. package/lib/components/dynamic/my-team/img/add-subordinate.png +0 -0
  88. package/lib/components/dynamic/my-team/img/line.png +0 -0
  89. package/lib/components/dynamic/my-team/img/team.png +0 -0
  90. package/lib/components/dynamic/my-team/index.css +0 -184
  91. package/lib/components/dynamic/my-team/index.js +0 -263
  92. package/lib/components/dynamic/my-team/request-api.js +0 -52
  93. package/lib/components/dynamic/my-team/util.js +0 -20
  94. package/lib/components/dynamic/new-ui.css +0 -192
  95. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.css +0 -58
  96. package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.js +0 -68
  97. package/lib/components/dynamic/online-broadcast/data.js +0 -95
  98. package/lib/components/dynamic/online-broadcast/img/broadcast.svg +0 -14
  99. package/lib/components/dynamic/online-broadcast/img/new.png +0 -0
  100. package/lib/components/dynamic/online-broadcast/img/preview.png +0 -0
  101. package/lib/components/dynamic/online-broadcast/index.css +0 -46
  102. package/lib/components/dynamic/online-broadcast/index.js +0 -61
  103. package/lib/components/dynamic/online-broadcast/interfact.js +0 -5
  104. package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +0 -25
  105. package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +0 -39
  106. package/lib/components/dynamic/quick-operation/components/create-okr/index.css +0 -25
  107. package/lib/components/dynamic/quick-operation/components/create-okr/index.js +0 -39
  108. package/lib/components/dynamic/quick-operation/components/create-share/index.css +0 -25
  109. package/lib/components/dynamic/quick-operation/components/create-share/index.js +0 -39
  110. package/lib/components/dynamic/quick-operation/components/create-task/index.css +0 -25
  111. package/lib/components/dynamic/quick-operation/components/create-task/index.js +0 -44
  112. package/lib/components/dynamic/quick-operation/img/new-announcement.png +0 -0
  113. package/lib/components/dynamic/quick-operation/img/new-okr.png +0 -0
  114. package/lib/components/dynamic/quick-operation/img/new-share.png +0 -0
  115. package/lib/components/dynamic/quick-operation/img/new-task.png +0 -0
  116. package/lib/components/dynamic/quick-operation/index.css +0 -51
  117. package/lib/components/dynamic/quick-operation/index.js +0 -120
@@ -0,0 +1,262 @@
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"] = exports.Context = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _dialog = _interopRequireDefault(require("../../../dialog"));
13
+
14
+ var _pagination = _interopRequireDefault(require("../../../pagination"));
15
+
16
+ var _toast = _interopRequireDefault(require("../../../toast"));
17
+
18
+ var _searchForm = _interopRequireDefault(require("./search-form"));
19
+
20
+ var _taskTree = require("../tree/task-tree");
21
+
22
+ var _helper = require("../../helper");
23
+
24
+ var _requestApi = require("../request-api");
25
+
26
+ var _loading = _interopRequireDefault(require("../../image/loading.gif"));
27
+
28
+ var _getLocale = require("../../../../utils/getLocale");
29
+
30
+ require("./index.css");
31
+
32
+ var _excluded = ["defaultVisible", "multiple", "onOk", "onCancel", "krId", "okrId", "isRelationOther", "onRelateSuccess", "lastSelected"];
33
+
34
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
+
36
+ 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); }
37
+
38
+ 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; }
39
+
40
+ 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); }
41
+
42
+ 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; }
43
+
44
+ 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; }
45
+
46
+ 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
+
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
+ 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; }
61
+
62
+ 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; }
63
+
64
+ var Context = /*#__PURE__*/_react["default"].createContext({});
65
+
66
+ exports.Context = Context;
67
+ var preCls = 'relation-task';
68
+
69
+ function OkrRelationTaskModal(props) {
70
+ var _props$defaultVisible = props.defaultVisible,
71
+ defaultVisible = _props$defaultVisible === void 0 ? false : _props$defaultVisible,
72
+ _props$multiple = props.multiple,
73
+ multiple = _props$multiple === void 0 ? true : _props$multiple,
74
+ onOk = props.onOk,
75
+ _props$onCancel = props.onCancel,
76
+ onCancel = _props$onCancel === void 0 ? function () {} : _props$onCancel,
77
+ krId = props.krId,
78
+ okrId = props.okrId,
79
+ _props$isRelationOthe = props.isRelationOther,
80
+ isRelationOther = _props$isRelationOthe === void 0 ? false : _props$isRelationOthe,
81
+ onRelateSuccess = props.onRelateSuccess,
82
+ _props$lastSelected = props.lastSelected,
83
+ lastSelected = _props$lastSelected === void 0 ? [] : _props$lastSelected,
84
+ restProps = _objectWithoutProperties(props, _excluded);
85
+
86
+ var _useState = (0, _react.useState)(defaultVisible),
87
+ _useState2 = _slicedToArray(_useState, 2),
88
+ visible = _useState2[0],
89
+ setVisible = _useState2[1];
90
+
91
+ var _useState3 = (0, _react.useState)([]),
92
+ _useState4 = _slicedToArray(_useState3, 2),
93
+ taskData = _useState4[0],
94
+ setTaskData = _useState4[1];
95
+
96
+ var _useState5 = (0, _react.useState)(lastSelected),
97
+ _useState6 = _slicedToArray(_useState5, 2),
98
+ selected = _useState6[0],
99
+ setSelected = _useState6[1];
100
+
101
+ var _useState7 = (0, _react.useState)(false),
102
+ _useState8 = _slicedToArray(_useState7, 2),
103
+ isQuery = _useState8[0],
104
+ setIsQuery = _useState8[1];
105
+
106
+ var _useState9 = (0, _react.useState)({}),
107
+ _useState10 = _slicedToArray(_useState9, 2),
108
+ query = _useState10[0],
109
+ setQuery = _useState10[1];
110
+
111
+ var _useState11 = (0, _react.useState)(1),
112
+ _useState12 = _slicedToArray(_useState11, 2),
113
+ total = _useState12[0],
114
+ setTotal = _useState12[1];
115
+
116
+ var _useState13 = (0, _react.useState)(10),
117
+ _useState14 = _slicedToArray(_useState13, 2),
118
+ pageSize = _useState14[0],
119
+ setPageSize = _useState14[1];
120
+
121
+ var _useState15 = (0, _react.useState)(1),
122
+ _useState16 = _slicedToArray(_useState15, 2),
123
+ pageNum = _useState16[0],
124
+ setPageNum = _useState16[1];
125
+
126
+ var _useState17 = (0, _react.useState)(false),
127
+ _useState18 = _slicedToArray(_useState17, 2),
128
+ isloading = _useState18[0],
129
+ setIsLoading = _useState18[1]; // useEffect(() => {
130
+ // // const roots = selected.reduce((res, cur) => [...res, cur.workId], []);
131
+ // // setSelectedRoots(roots);
132
+ // console.log(selected)
133
+ // }, [selected])
134
+
135
+
136
+ (0, _react.useEffect)(function () {
137
+ setVisible(defaultVisible);
138
+ }, [defaultVisible]);
139
+
140
+ var formatData = function formatData(data) {
141
+ var newData = [];
142
+ data.forEach(function (item) {
143
+ var obj = {};
144
+ obj['id'] = item === null || item === void 0 ? void 0 : item.taskId;
145
+ obj['name'] = item === null || item === void 0 ? void 0 : item.taskName;
146
+ obj['status'] = (0, _helper.okrStatus)(item === null || item === void 0 ? void 0 : item.status);
147
+ obj['principalUser'] = item === null || item === void 0 ? void 0 : item.principalUser;
148
+ obj['startDate'] = item === null || item === void 0 ? void 0 : item.startDate;
149
+ obj['endDate'] = item === null || item === void 0 ? void 0 : item.deadLine;
150
+ newData.push(obj);
151
+ });
152
+ return newData || [];
153
+ };
154
+
155
+ var getTaskData = function getTaskData() {
156
+ setIsLoading(true);
157
+ (0, _requestApi.planTableTask)(query, pageNum, pageSize).then(function (res) {
158
+ setIsLoading(false);
159
+
160
+ if (res) {
161
+ var tasks = res.tasks,
162
+ _total = res.total;
163
+
164
+ if (tasks !== null && tasks !== void 0 && tasks.length) {
165
+ var newData = formatData(tasks);
166
+ setTaskData(newData);
167
+ setTotal(_total);
168
+ } else {
169
+ setTaskData([]);
170
+ setTotal(0);
171
+ }
172
+ }
173
+ });
174
+ };
175
+
176
+ (0, _react.useEffect)(function () {
177
+ isQuery && getTaskData();
178
+ }, [query, pageNum, pageSize]);
179
+
180
+ var onPageChangeHandler = function onPageChangeHandler(current, pageSize) {
181
+ setSelected([]);
182
+ setPageNum(current);
183
+ setPageSize(pageSize);
184
+ };
185
+
186
+ var onOkHandler = function onOkHandler() {
187
+ if (krId && selected !== null && selected !== void 0 && selected.length) {
188
+ (0, _requestApi.relateOkr)(selected, krId, okrId).then(function (res) {
189
+ if (res.Code) {
190
+ _toast["default"].Success((0, _getLocale.getLocale)('Per_Ass_New_Ass_text_Succe'));
191
+
192
+ onRelateSuccess && onRelateSuccess(res.Data);
193
+ }
194
+ });
195
+ }
196
+
197
+ onCancelHandler();
198
+ onOk && onOk(selected);
199
+ setSelected([]);
200
+ };
201
+
202
+ var onCancelHandler = function onCancelHandler() {
203
+ setVisible(false);
204
+ onCancel && onCancel();
205
+ };
206
+
207
+ var onQueryChangeHandler = function onQueryChangeHandler(values) {
208
+ setIsQuery(true);
209
+ setPageNum(1);
210
+ setQuery(_objectSpread(_objectSpread({}, query), values));
211
+ };
212
+
213
+ return /*#__PURE__*/_react["default"].createElement(_dialog["default"], _extends({
214
+ title: '关联任务',
215
+ visible: visible,
216
+ onOk: onOkHandler,
217
+ onCancel: onCancelHandler,
218
+ onClose: onCancelHandler,
219
+ style: {
220
+ height: '590px'
221
+ },
222
+ width: 840,
223
+ zIndex: 1000,
224
+ noHeadLine: true,
225
+ noFooterLine: true // getContainer={getContainer}
226
+ ,
227
+ extraClass: ['parent-target-pop-index', 'document-mouse-event-ignore'],
228
+ destroyOnClose: false
229
+ }, restProps), /*#__PURE__*/_react["default"].createElement("div", {
230
+ className: "".concat(preCls, "__content"),
231
+ onClick: function onClick(e) {
232
+ e.stopPropagation();
233
+ e.nativeEvent.stopImmediatePropagation();
234
+ }
235
+ }, /*#__PURE__*/_react["default"].createElement(_searchForm["default"], {
236
+ onChange: onQueryChangeHandler
237
+ }), isloading ? /*#__PURE__*/_react["default"].createElement("div", {
238
+ className: "".concat(preCls, "__content-empty")
239
+ }, /*#__PURE__*/_react["default"].createElement("img", {
240
+ src: _loading["default"],
241
+ alt: ""
242
+ })) : /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
243
+ className: "".concat(preCls, "__content-tree")
244
+ }, /*#__PURE__*/_react["default"].createElement(_taskTree.TaskTree, {
245
+ selected: selected,
246
+ setSelected: setSelected,
247
+ data: taskData,
248
+ multiple: true,
249
+ pageSize: pageSize
250
+ })), !!total && /*#__PURE__*/_react["default"].createElement("div", {
251
+ className: "".concat(preCls, "__content-pagination")
252
+ }, /*#__PURE__*/_react["default"].createElement(_pagination["default"], {
253
+ size: "sm",
254
+ total: total,
255
+ onChange: onPageChangeHandler,
256
+ current: pageNum,
257
+ pageSize: pageSize
258
+ })))));
259
+ }
260
+
261
+ var _default = OkrRelationTaskModal;
262
+ exports["default"] = _default;
@@ -0,0 +1,135 @@
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 _searchInput = _interopRequireDefault(require("../../../search-input"));
13
+
14
+ var _periodSelector = _interopRequireDefault(require("../../../period-selector"));
15
+
16
+ var _common = require("../../../period-selector/common");
17
+
18
+ var _searchDropdown = _interopRequireDefault(require("../../search/search-dropdown"));
19
+
20
+ var _taskStatusSelect = _interopRequireDefault(require("../../search/task-status-select"));
21
+
22
+ var _taskRelation = _interopRequireDefault(require("../../search/task-relation"));
23
+
24
+ var _helper = require("../../helper");
25
+
26
+ var _formatTime = require("../../../../utils/format-time");
27
+
28
+ var _getLocale = require("../../../../utils/getLocale");
29
+
30
+ require("./index.css");
31
+
32
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
+
34
+ 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); }
35
+
36
+ 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; }
37
+
38
+ 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; }
39
+
40
+ 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; }
41
+
42
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
43
+
44
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
45
+
46
+ 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."); }
47
+
48
+ 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); }
49
+
50
+ 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; }
51
+
52
+ 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; }
53
+
54
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
55
+
56
+ function SearchForm(props) {
57
+ var onChange = props.onChange;
58
+
59
+ var _useState = (0, _react.useState)({
60
+ annualNum: new Date().getFullYear(),
61
+ // 默认当前年份全部周期
62
+ yqmNum: 0,
63
+ cycleType: '1',
64
+ startDate: (0, _formatTime.getFirstDayOfYear)(),
65
+ endDate: (0, _formatTime.getNextDayOfYear)()
66
+ }),
67
+ _useState2 = _slicedToArray(_useState, 2),
68
+ cycle = _useState2[0],
69
+ setCycle = _useState2[1];
70
+
71
+ var _useState3 = (0, _react.useState)(10),
72
+ _useState4 = _slicedToArray(_useState3, 2),
73
+ status = _useState4[0],
74
+ setStatus = _useState4[1];
75
+
76
+ var _useState5 = (0, _react.useState)(''),
77
+ _useState6 = _slicedToArray(_useState5, 2),
78
+ keyWords = _useState6[0],
79
+ setKeyWords = _useState6[1];
80
+
81
+ var _useState7 = (0, _react.useState)(0),
82
+ _useState8 = _slicedToArray(_useState7, 2),
83
+ relation = _useState8[0],
84
+ setRelation = _useState8[1];
85
+
86
+ var dilagRef = (0, _react.useRef)(document.createElement('div'));
87
+ (0, _react.useEffect)(function () {
88
+ var planCycle = (0, _helper.formatPeriodPlanData)(cycle);
89
+ onChange(_objectSpread({
90
+ status: status,
91
+ keyWords: keyWords,
92
+ relation: relation
93
+ }, planCycle));
94
+ }, [status, keyWords, cycle, relation]);
95
+ return /*#__PURE__*/_react["default"].createElement("div", {
96
+ ref: dilagRef
97
+ }, /*#__PURE__*/_react["default"].createElement("div", {
98
+ className: "rel-okr-tree__search-item"
99
+ }, /*#__PURE__*/_react["default"].createElement(_periodSelector["default"], {
100
+ selected: cycle,
101
+ yearsRange: [2019, new Date().getFullYear() + 10],
102
+ isFetch: false,
103
+ showBimonthly: false,
104
+ showHalfYear: false,
105
+ showCustom: false,
106
+ showFullCycle: false,
107
+ onChange: setCycle,
108
+ getPopupContainer: function getPopupContainer() {
109
+ return dilagRef.current;
110
+ },
111
+ popClass: "pull-screen-ignore"
112
+ }, /*#__PURE__*/_react["default"].createElement(_searchDropdown["default"], null, (0, _common.formatPeriod)(cycle)))), /*#__PURE__*/_react["default"].createElement("div", {
113
+ className: "rel-okr-tree__search-item"
114
+ }, /*#__PURE__*/_react["default"].createElement(_taskStatusSelect["default"], {
115
+ onChange: setStatus,
116
+ initValue: status
117
+ })), /*#__PURE__*/_react["default"].createElement("div", {
118
+ className: "rel-okr-tree__search-item"
119
+ }, /*#__PURE__*/_react["default"].createElement(_taskRelation["default"], {
120
+ onChange: setRelation,
121
+ initValue: relation
122
+ })), /*#__PURE__*/_react["default"].createElement("div", {
123
+ className: "rel-okr-tree__search-item-keyword"
124
+ }, /*#__PURE__*/_react["default"].createElement(_searchInput["default"], {
125
+ onSearch: setKeyWords,
126
+ placeholder: (0, _getLocale.getLocale)('Mod_Enterkeywords'),
127
+ style: {
128
+ height: 32,
129
+ width: 240
130
+ }
131
+ })));
132
+ }
133
+
134
+ var _default = SearchForm;
135
+ exports["default"] = _default;
@@ -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;