@titaui/pc 1.11.52 → 1.11.53

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 (44) 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/okr-detail/components/base-okr-type/confirm/confirm.js +1 -1
  7. package/lib/components/okr-detail/e-list/index.js +2 -2
  8. package/lib/components/period-selector/interface.js +7 -0
  9. package/lib/components/search-input/index.css +1 -1
  10. package/lib/components/select-layer/index.css +1 -1
  11. package/lib/components/task-relation-modal/helper.js +139 -2
  12. package/lib/components/task-relation-modal/image/loading.gif +0 -0
  13. package/lib/components/task-relation-modal/index.js +9 -0
  14. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.css +18 -0
  15. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +256 -0
  16. package/lib/components/task-relation-modal/okr-relation/relation-task-model/search-form.js +135 -0
  17. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.css +0 -0
  18. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +129 -0
  19. package/lib/components/task-relation-modal/okr-relation/request-api.js +106 -0
  20. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.css +120 -0
  21. package/lib/components/task-relation-modal/okr-relation/tree/task-tree/index.js +185 -0
  22. package/lib/components/task-relation-modal/request-api.js +28 -2
  23. package/lib/components/task-relation-modal/search/okr-status-select.js +3 -3
  24. package/lib/components/task-relation-modal/search/principal.js +20 -5
  25. package/lib/components/task-relation-modal/search/search-dropdown/index.css +2 -1
  26. package/lib/components/task-relation-modal/search/search-dropdown/index.js +1 -1
  27. package/lib/components/task-relation-modal/search/task-status-select.js +87 -0
  28. package/lib/components/task-relation-modal/search/work-relation.js +83 -0
  29. package/lib/components/task-relation-modal/search/work-status-select.js +74 -0
  30. package/lib/components/task-relation-modal/tree/okr-tree/search-form.js +16 -2
  31. package/lib/components/task-relation-modal/tree/task-list/index.css +0 -0
  32. package/lib/components/task-relation-modal/tree/task-list/index.js +1 -0
  33. package/lib/components/task-relation-modal/tree/work-list/index.css +14 -0
  34. package/lib/components/task-relation-modal/tree/work-list/index.js +176 -0
  35. package/lib/components/task-relation-modal/tree/work-list/search-form.js +123 -0
  36. package/lib/components/task-relation-modal/tree-node/work-node/index.js +3 -1
  37. package/lib/components/task-relation-modal/work-relation/index.css +0 -0
  38. package/lib/components/task-relation-modal/work-relation/index.js +256 -0
  39. package/lib/components/tooltip/index.js +3 -0
  40. package/lib/components/tooltip/tooltip-rows/index.css +26 -0
  41. package/lib/components/tooltip/tooltip-rows/index.js +106 -0
  42. package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +46 -18
  43. package/lib/utils/planDataJson.js +11115 -0
  44. package/package.json +1 -1
@@ -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"], {
@@ -41,7 +41,9 @@ function Principal(props) {
41
41
  initValue = _props$initValue === void 0 ? [] : _props$initValue,
42
42
  setRelation = props.setRelation,
43
43
  _props$position = props.position,
44
- position = _props$position === void 0 ? "bottom" : _props$position;
44
+ position = _props$position === void 0 ? "bottom" : _props$position,
45
+ _props$multiple = props.multiple,
46
+ multiple = _props$multiple === void 0 ? true : _props$multiple;
45
47
 
46
48
  var _useState = (0, _react.useState)(initValue),
47
49
  _useState2 = _slicedToArray(_useState, 2),
@@ -60,17 +62,29 @@ function Principal(props) {
60
62
 
61
63
  var userSelectorRef = (0, _react.useRef)(document.createElement("div"));
62
64
 
65
+ var singleSelect = function singleSelect(users) {
66
+ var _users$;
67
+
68
+ if (multiple || !users || !((_users$ = users[0]) !== null && _users$ !== void 0 && _users$.data)) return;
69
+ var user = users[0];
70
+ var data = user.data;
71
+ setUsers([{
72
+ avatar: data.avatar,
73
+ name: data.name,
74
+ userId: data.userId
75
+ }]);
76
+ };
77
+
63
78
  var onSelectUser = function onSelectUser(_ref) {
64
79
  var users = _ref.users;
65
- return setUsers(users);
80
+ setUsers(users);
66
81
  };
67
82
 
68
83
  (0, _react.useEffect)(function () {
69
84
  setIsInit(true);
70
85
  }, []);
71
86
  (0, _react.useEffect)(function () {
72
- setRelation(0);
73
- console.log(users);
87
+ setRelation(0); // console.log(users);
74
88
 
75
89
  if (users.length > 0) {
76
90
  var text = ""; // 我在拼name
@@ -92,10 +106,11 @@ function Principal(props) {
92
106
  return /*#__PURE__*/_react["default"].createElement("div", {
93
107
  ref: userSelectorRef
94
108
  }, /*#__PURE__*/_react["default"].createElement(_userSelector["default"], {
95
- multiple: true,
109
+ multiple: multiple,
96
110
  selectNodes: {
97
111
  users: users
98
112
  },
113
+ onSelect: singleSelect,
99
114
  onOk: onSelectUser,
100
115
  position: position,
101
116
  disabledDepartSelect: true,
@@ -6,7 +6,7 @@
6
6
  border: 1px solid #e9ecf0;
7
7
  padding: 7px 28px 7px 12px;
8
8
  position: relative;
9
- border-radius: 4px;
9
+ border-radius: 16px;
10
10
  font-size: 0;
11
11
  cursor: pointer;
12
12
  transition: color 0.3s ease, border 0.3s ease;
@@ -41,6 +41,7 @@
41
41
  }
42
42
 
43
43
  .titaui-search-dropdown .tu-icon-sort-down {
44
+ color: #6F7886;
44
45
  font-size: 14px;
45
46
  position: absolute;
46
47
  right: 12px;
@@ -24,7 +24,7 @@ function SearchDropDown(props) {
24
24
  maxWidth: maxWidth
25
25
  }
26
26
  }, children), /*#__PURE__*/_react["default"].createElement("span", {
27
- className: "tu-icon-sort-down"
27
+ className: "".concat(preCls, "__icon tu-icon-sort-down")
28
28
  }));
29
29
  }
30
30
 
@@ -0,0 +1,87 @@
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 _selectLayer = _interopRequireDefault(require("../../select-layer"));
13
+
14
+ var _getLocale = require("../../../utils/getLocale");
15
+
16
+ require("./search-dropdown/index.css");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ 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); }
21
+
22
+ 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; }
23
+
24
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
25
+
26
+ 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."); }
27
+
28
+ 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); }
29
+
30
+ 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; }
31
+
32
+ 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; }
33
+
34
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
35
+
36
+ function TaskStatusSelect(props) {
37
+ var onChange = props.onChange,
38
+ initValue = props.initValue;
39
+
40
+ var _useState = (0, _react.useState)((0, _getLocale.getLocale)('OKR_MyO_E_From_AllStates')),
41
+ _useState2 = _slicedToArray(_useState, 2),
42
+ selectText = _useState2[0],
43
+ setSelectText = _useState2[1];
44
+
45
+ var onChangeHandler = function onChangeHandler(key) {
46
+ setSelectText(key.label);
47
+ onChange(key.value);
48
+ };
49
+
50
+ var selectOptions = [{
51
+ label: (0, _getLocale.getLocale)('OKR_MyO_E_From_AllStates'),
52
+ value: 10 //理应是不传
53
+
54
+ }, {
55
+ label: (0, _getLocale.getLocale)('Pro_page_Sta_Completed'),
56
+ value: 2
57
+ }, {
58
+ label: (0, _getLocale.getLocale)('Per_MyRe_text_Inprogress'),
59
+ value: 1
60
+ }, {
61
+ label: (0, _getLocale.getLocale)('OKR_MyO_E_From_Cancelled'),
62
+ value: 4
63
+ }, {
64
+ label: (0, _getLocale.getLocale)('OKR_MyO_E_From_Delayed'),
65
+ value: 3
66
+ }, {
67
+ label: (0, _getLocale.getLocale)('OKR_MyO_E_From_Suspended'),
68
+ value: 6
69
+ }, {
70
+ label: (0, _getLocale.getLocale)('OKR_MyO_E_From_NotStarted'),
71
+ value: 0
72
+ }];
73
+ return /*#__PURE__*/_react["default"].createElement(_selectLayer["default"], {
74
+ onChangeSelect: onChangeHandler,
75
+ items: selectOptions,
76
+ initValue: initValue
77
+ }, /*#__PURE__*/_react["default"].createElement("div", {
78
+ className: "titaui-search-dropdown"
79
+ }, /*#__PURE__*/_react["default"].createElement("span", {
80
+ className: "titaui-search-dropdown__text"
81
+ }, selectText), /*#__PURE__*/_react["default"].createElement("span", {
82
+ className: "tu-icon-sort-down"
83
+ })));
84
+ }
85
+
86
+ var _default = TaskStatusSelect;
87
+ exports["default"] = _default;
@@ -0,0 +1,83 @@
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 _getLocale = require("../../../utils/getLocale");
13
+
14
+ var _selectLayer = _interopRequireDefault(require("../../select-layer"));
15
+
16
+ require("./search-dropdown/index.css");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ 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); }
21
+
22
+ 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; }
23
+
24
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
25
+
26
+ 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."); }
27
+
28
+ 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); }
29
+
30
+ 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; }
31
+
32
+ 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; }
33
+
34
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
35
+
36
+ function Relation(props) {
37
+ var onChange = props.onChange,
38
+ initValue = props.initValue;
39
+
40
+ var _useState = (0, _react.useState)((0, _getLocale.getLocale)("Pro_page_Plan_FullRange")),
41
+ _useState2 = _slicedToArray(_useState, 2),
42
+ selectText = _useState2[0],
43
+ setSelectText = _useState2[1];
44
+
45
+ (0, _react.useEffect)(function () {
46
+ if (initValue === 0) {
47
+ setSelectText((0, _getLocale.getLocale)("Pro_page_Plan_FullRange"));
48
+ }
49
+ }, [initValue]);
50
+
51
+ var onChangeHandler = function onChangeHandler(key) {
52
+ setSelectText(key.label);
53
+ onChange(key.value);
54
+ };
55
+
56
+ var selectOptions = [{
57
+ label: (0, _getLocale.getLocale)("Pro_page_Plan_FullRange"),
58
+ value: 0
59
+ }, {
60
+ label: (0, _getLocale.getLocale)("OKR_MyO_Err_Owned"),
61
+ value: 1
62
+ }, {
63
+ label: (0, _getLocale.getLocale)("OKR_MyO_Err_Attended"),
64
+ value: 2
65
+ }, {
66
+ label: (0, _getLocale.getLocale)("OKR_MyO_Err_Fllowed"),
67
+ value: 3
68
+ }];
69
+ return /*#__PURE__*/_react["default"].createElement(_selectLayer["default"], {
70
+ onChangeSelect: onChangeHandler,
71
+ items: selectOptions,
72
+ initValue: initValue
73
+ }, /*#__PURE__*/_react["default"].createElement("div", {
74
+ className: "titaui-search-dropdown"
75
+ }, /*#__PURE__*/_react["default"].createElement("span", {
76
+ className: "titaui-search-dropdown__text"
77
+ }, selectText), /*#__PURE__*/_react["default"].createElement("span", {
78
+ className: "tu-icon-sort-down"
79
+ })));
80
+ }
81
+
82
+ var _default = Relation;
83
+ exports["default"] = _default;
@@ -0,0 +1,74 @@
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 _selectLayer = _interopRequireDefault(require("../../select-layer"));
13
+
14
+ var _getLocale = require("../../../utils/getLocale");
15
+
16
+ require("./search-dropdown/index.css");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ 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); }
21
+
22
+ 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; }
23
+
24
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
25
+
26
+ 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."); }
27
+
28
+ 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); }
29
+
30
+ 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; }
31
+
32
+ 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; }
33
+
34
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
35
+
36
+ function TaskStatusSelect(props) {
37
+ var onChange = props.onChange,
38
+ initValue = props.initValue;
39
+
40
+ var _useState = (0, _react.useState)((0, _getLocale.getLocale)('OKR_MyO_E_From_AllStates')),
41
+ _useState2 = _slicedToArray(_useState, 2),
42
+ selectText = _useState2[0],
43
+ setSelectText = _useState2[1];
44
+
45
+ var onChangeHandler = function onChangeHandler(key) {
46
+ setSelectText(key.label);
47
+ onChange(key.value);
48
+ };
49
+
50
+ var selectOptions = [{
51
+ label: (0, _getLocale.getLocale)('OKR_MyO_E_From_AllStates'),
52
+ value: 0
53
+ }, {
54
+ label: (0, _getLocale.getLocale)('Pro_page_Sta_Completed'),
55
+ value: 2
56
+ }, {
57
+ label: (0, _getLocale.getLocale)('Per_MyRe_text_Inprogress'),
58
+ value: 1
59
+ }];
60
+ return /*#__PURE__*/_react["default"].createElement(_selectLayer["default"], {
61
+ onChangeSelect: onChangeHandler,
62
+ items: selectOptions,
63
+ initValue: initValue
64
+ }, /*#__PURE__*/_react["default"].createElement("div", {
65
+ className: "titaui-search-dropdown"
66
+ }, /*#__PURE__*/_react["default"].createElement("span", {
67
+ className: "titaui-search-dropdown__text"
68
+ }, selectText), /*#__PURE__*/_react["default"].createElement("span", {
69
+ className: "tu-icon-sort-down"
70
+ })));
71
+ }
72
+
73
+ var _default = TaskStatusSelect;
74
+ exports["default"] = _default;
@@ -23,6 +23,8 @@ var _principal = _interopRequireDefault(require("../../search/principal"));
23
23
 
24
24
  var _relation = _interopRequireDefault(require("../../search/relation"));
25
25
 
26
+ var _helpers = require("../../../../utils/helpers");
27
+
26
28
  var _getLocale = require("../../../../utils/getLocale");
27
29
 
28
30
  require("./index.css");
@@ -52,6 +54,18 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
52
54
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
53
55
 
54
56
  function SearchForm(props) {
57
+ var _loginUser$UserAvatar, _loginUser$UserAvatar2, _loginUser$UserAvatar3;
58
+
59
+ var loginUser = (0, _helpers.getLoginUserInfo)();
60
+ var user = {
61
+ userId: loginUser.Id,
62
+ name: loginUser.Name,
63
+ avatar: {
64
+ original: loginUser === null || loginUser === void 0 ? void 0 : (_loginUser$UserAvatar = loginUser.UserAvatar) === null || _loginUser$UserAvatar === void 0 ? void 0 : _loginUser$UserAvatar.Original,
65
+ color: loginUser === null || loginUser === void 0 ? void 0 : (_loginUser$UserAvatar2 = loginUser.UserAvatar) === null || _loginUser$UserAvatar2 === void 0 ? void 0 : _loginUser$UserAvatar2.Color,
66
+ hasAvatar: loginUser === null || loginUser === void 0 ? void 0 : (_loginUser$UserAvatar3 = loginUser.UserAvatar) === null || _loginUser$UserAvatar3 === void 0 ? void 0 : _loginUser$UserAvatar3.HasAvatar
67
+ }
68
+ };
55
69
  var onChange = props.onChange;
56
70
 
57
71
  var _useState = (0, _react.useState)({
@@ -69,7 +83,7 @@ function SearchForm(props) {
69
83
  okrType = _useState4[0],
70
84
  setOkrType = _useState4[1];
71
85
 
72
- var _useState5 = (0, _react.useState)([]),
86
+ var _useState5 = (0, _react.useState)([user]),
73
87
  _useState6 = _slicedToArray(_useState5, 2),
74
88
  users = _useState6[0],
75
89
  setUsers = _useState6[1];
@@ -117,7 +131,7 @@ function SearchForm(props) {
117
131
  className: "rel-okr-tree__search-item"
118
132
  }, /*#__PURE__*/_react["default"].createElement(_principal["default"], {
119
133
  onChange: setUsers,
120
- initValue: [],
134
+ initValue: users,
121
135
  setRelation: setRelation
122
136
  })), /*#__PURE__*/_react["default"].createElement("div", {
123
137
  className: "rel-okr-tree__search-item"
@@ -0,0 +1,14 @@
1
+ .relation-work__content-tree {
2
+ margin-top: 16px;
3
+ }
4
+
5
+ .relation-work__content-empty {
6
+ height: 382px;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ }
11
+
12
+ .relation-work__content-empty > img {
13
+ width: 60px;
14
+ }
@@ -0,0 +1,176 @@
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 _pagination = _interopRequireDefault(require("../../../pagination"));
13
+
14
+ var _helper = require("../../helper");
15
+
16
+ var _searchForm = _interopRequireDefault(require("./search-form"));
17
+
18
+ var _taskTree = require("../../okr-relation/tree/task-tree");
19
+
20
+ var _loading = _interopRequireDefault(require("../../image/loading.gif"));
21
+
22
+ var _requestApi = require("../../request-api");
23
+
24
+ require("./index.css");
25
+
26
+ var _excluded = ["selected", "setSelected", "multiple"];
27
+
28
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
+
30
+ 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); }
31
+
32
+ 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; }
33
+
34
+ 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; }
35
+
36
+ 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; }
37
+
38
+ 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; }
39
+
40
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
41
+
42
+ 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."); }
43
+
44
+ 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); }
45
+
46
+ 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; }
47
+
48
+ 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; }
49
+
50
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
51
+
52
+ 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; }
53
+
54
+ 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; }
55
+
56
+ var preCls = 'relation-work';
57
+
58
+ function WorkList(props) {
59
+ var selected = props.selected,
60
+ setSelected = props.setSelected,
61
+ _props$multiple = props.multiple,
62
+ multiple = _props$multiple === void 0 ? true : _props$multiple,
63
+ restProps = _objectWithoutProperties(props, _excluded);
64
+
65
+ var _useState = (0, _react.useState)([]),
66
+ _useState2 = _slicedToArray(_useState, 2),
67
+ taskData = _useState2[0],
68
+ setTaskData = _useState2[1]; // const [selected, setSelected] = useState(lastSelected)
69
+
70
+
71
+ var _useState3 = (0, _react.useState)({}),
72
+ _useState4 = _slicedToArray(_useState3, 2),
73
+ query = _useState4[0],
74
+ setQuery = _useState4[1];
75
+
76
+ var _useState5 = (0, _react.useState)(1),
77
+ _useState6 = _slicedToArray(_useState5, 2),
78
+ total = _useState6[0],
79
+ setTotal = _useState6[1];
80
+
81
+ var _useState7 = (0, _react.useState)(10),
82
+ _useState8 = _slicedToArray(_useState7, 2),
83
+ pageSize = _useState8[0],
84
+ setPageSize = _useState8[1];
85
+
86
+ var _useState9 = (0, _react.useState)(1),
87
+ _useState10 = _slicedToArray(_useState9, 2),
88
+ pageNum = _useState10[0],
89
+ setPageNum = _useState10[1];
90
+
91
+ var _useState11 = (0, _react.useState)(false),
92
+ _useState12 = _slicedToArray(_useState11, 2),
93
+ isQuery = _useState12[0],
94
+ setIsQuery = _useState12[1];
95
+
96
+ var _useState13 = (0, _react.useState)(false),
97
+ _useState14 = _slicedToArray(_useState13, 2),
98
+ lodaing = _useState14[0],
99
+ setLoading = _useState14[1];
100
+
101
+ var formatData = function formatData(data) {
102
+ var newData = [];
103
+ data.forEach(function (item) {
104
+ var obj = {};
105
+ obj['id'] = item === null || item === void 0 ? void 0 : item.workId;
106
+ obj['name'] = item === null || item === void 0 ? void 0 : item.workName;
107
+ obj['status'] = (0, _helper.workStatus)()[item === null || item === void 0 ? void 0 : item.status] || (item === null || item === void 0 ? void 0 : item.status);
108
+ obj['principalUser'] = item === null || item === void 0 ? void 0 : item.principalUser;
109
+ obj['startDate'] = item === null || item === void 0 ? void 0 : item.startDate;
110
+ obj['endDate'] = item === null || item === void 0 ? void 0 : item.endDate;
111
+ newData.push(obj);
112
+ });
113
+ return newData || [];
114
+ };
115
+
116
+ var onPageChangeHandler = function onPageChangeHandler(current, pageSize) {
117
+ setSelected([]);
118
+ setPageNum(current);
119
+ setPageSize(pageSize);
120
+ };
121
+
122
+ var getWorkData = function getWorkData() {
123
+ setLoading(true);
124
+ (0, _requestApi.workData)(query, pageNum, pageSize).then(function (res) {
125
+ setLoading(false);
126
+
127
+ if (!!res.Code) {
128
+ var _res$Data = res.Data,
129
+ works = _res$Data.works,
130
+ _total = _res$Data.total;
131
+ var newData = formatData(works);
132
+ setTaskData(newData);
133
+ setTotal(_total);
134
+ }
135
+ });
136
+ };
137
+
138
+ (0, _react.useEffect)(function () {
139
+ isQuery && getWorkData();
140
+ }, [query, pageNum, pageSize]);
141
+
142
+ var onQueryChangeHandler = function onQueryChangeHandler(values) {
143
+ setIsQuery(true);
144
+ setPageNum(1);
145
+ setQuery(_objectSpread(_objectSpread({}, query), values));
146
+ };
147
+
148
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_searchForm["default"], {
149
+ onChange: onQueryChangeHandler
150
+ }), lodaing ? /*#__PURE__*/_react["default"].createElement("div", {
151
+ className: "".concat(preCls, "__content-empty")
152
+ }, /*#__PURE__*/_react["default"].createElement("img", {
153
+ src: _loading["default"],
154
+ alt: ""
155
+ })) : /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
156
+ className: "".concat(preCls, "__content-tree")
157
+ }, /*#__PURE__*/_react["default"].createElement(_taskTree.TaskTree, {
158
+ selected: selected,
159
+ setSelected: setSelected,
160
+ data: taskData,
161
+ multiple: multiple,
162
+ isWork: true,
163
+ pageSize: pageSize
164
+ })), /*#__PURE__*/_react["default"].createElement("div", {
165
+ className: "".concat(preCls, "__content-pagination")
166
+ }, /*#__PURE__*/_react["default"].createElement(_pagination["default"], {
167
+ size: "sm",
168
+ total: total,
169
+ onChange: onPageChangeHandler,
170
+ current: pageNum,
171
+ pageSize: pageSize
172
+ }))));
173
+ }
174
+
175
+ var _default = WorkList;
176
+ exports["default"] = _default;