@titaui/pc 1.11.2 → 1.11.3-2.beta-1

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 (182) hide show
  1. package/lib/components/avatar/text-avatar/index.css +7 -0
  2. package/lib/components/avatar/text-avatar/index.js +32 -7
  3. package/lib/components/button/icon-btn/index.js +17 -8
  4. package/lib/components/button/rect-btn/index.js +7 -7
  5. package/lib/components/change-okr-modal/Item.js +15 -15
  6. package/lib/components/communication/index.js +30 -29
  7. package/lib/components/drawer/index.js +7 -6
  8. package/lib/components/drop-selector/index.js +25 -10
  9. package/lib/components/dynamic/constant.js +43 -36
  10. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/dynamic-footer.js +243 -0
  11. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +6 -2
  12. package/lib/components/dynamic/dynamic-item/dynamic-interview/img/wifi.svg +24 -0
  13. package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +51 -0
  14. package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +50 -0
  15. package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +65 -0
  16. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/img/wifi.svg +24 -0
  17. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.css +61 -0
  18. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.js +61 -0
  19. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/interview-content.js +69 -0
  20. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +6 -6
  21. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +7 -7
  22. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +11 -11
  23. package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +14 -14
  24. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +10 -10
  25. package/lib/components/dynamic/dynamic-item/index.js +70 -41
  26. package/lib/components/dynamic/dynamic-list/index.js +5 -13
  27. package/lib/components/e-priority/index.js +18 -12
  28. package/lib/components/eReport/eReportShare/index.js +12 -12
  29. package/lib/components/file-list/components/single-file/index.js +11 -11
  30. package/lib/components/form/form-fields/date/index.css +24 -0
  31. package/lib/components/form/form-fields/date/index.js +102 -0
  32. package/lib/components/form/form-fields/input/index.js +10 -10
  33. package/lib/components/form/form-fields/user/index.css +23 -3
  34. package/lib/components/form/form-fields/user/index.js +18 -8
  35. package/lib/components/form/form-fields/user/user-input.js +15 -6
  36. package/lib/components/form/index.js +10 -3
  37. package/lib/components/grid-layout/sub-employee-okr/person-okr.js +11 -5
  38. package/lib/components/icon-button-list/index.css +2 -57
  39. package/lib/components/icon-button-list/index.js +10 -7
  40. package/lib/components/img-viewer/index.css +10 -3
  41. package/lib/components/img-viewer/index.js +57 -18
  42. package/lib/components/mblog/components/MblogContent.js +5 -2
  43. package/lib/components/mblog/index.js +31 -30
  44. package/lib/components/menus/components/menu-tree/images/interview-menu/my-interview.svg +16 -0
  45. package/lib/components/menus/components/menu-tree/images/interview-menu/template.svg +16 -0
  46. package/lib/components/menus/components/menu-tree/images/interview-menu/todo.svg +16 -0
  47. package/lib/components/menus/components/menu-tree/index.css +4 -2
  48. package/lib/components/menus/components/menu-tree/tree-node/index.css +85 -1
  49. package/lib/components/menus/export-modules/interview-menus/constant.js +30 -0
  50. package/lib/components/menus/export-modules/interview-menus/handle-highlight.js +63 -0
  51. package/lib/components/menus/export-modules/interview-menus/index.css +7 -0
  52. package/lib/components/menus/export-modules/interview-menus/index.js +128 -0
  53. package/lib/components/menus/index.js +11 -5
  54. package/lib/components/nav-top/components/menu/index.js +14 -14
  55. package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +25 -19
  56. package/lib/components/nav-top/components/user-message/components/remind/remind-item.js +48 -10
  57. package/lib/components/nav-top/components/user-message/constant.js +1 -0
  58. package/lib/components/nav-top/components/user-message/hrMessage.js +22 -19
  59. package/lib/components/nav-top/components/user-message/index.js +23 -20
  60. package/lib/components/nav-top/request.apis.js +3 -1
  61. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +7 -7
  62. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +3 -2
  63. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +10 -0
  64. package/lib/components/okr-detail/detail-header/actions.js +62 -66
  65. package/lib/components/okr-detail/detail-header/index.css +2 -2
  66. package/lib/components/okr-detail/detail-header/index.js +205 -194
  67. package/lib/components/okr-detail/index.js +21 -19
  68. package/lib/components/okr-detail/okr-list/index.js +5 -3
  69. package/lib/components/okr-flow/child-node/index.css +67 -21
  70. package/lib/components/okr-flow/child-node/work-node.js +61 -24
  71. package/lib/components/okr-flow/empty/index.css +8 -1
  72. package/lib/components/okr-flow/export-modal/index.js +63 -21
  73. package/lib/components/okr-flow/export-modules/okr-search-panel/index.css +3 -1
  74. package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +30 -24
  75. package/lib/components/okr-flow/images/loading-light.gif +0 -0
  76. package/lib/components/okr-flow/okr-map/index.js +43 -22
  77. package/lib/components/okr-flow/request-apis.js +15 -8
  78. package/lib/components/okr-flow/root-node/index.css +2 -2
  79. package/lib/components/okr-flow/root-node/index.js +26 -25
  80. package/lib/components/okr-flow/utils/index.js +45 -29
  81. package/lib/components/okr-flow/utils/tree-handler.js +29 -18
  82. package/lib/components/okr-progress-modal/index.css +1 -1
  83. package/lib/components/okrcase-library/index.css +6 -4
  84. package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +36 -30
  85. package/lib/components/pagination/index.css +3 -3
  86. package/lib/components/pagination/select.css +58 -23
  87. package/lib/components/period-selector/index.css +9 -3
  88. package/lib/components/period-selector/index.js +14 -11
  89. package/lib/components/picker/components/panels/date-panel/date-body.js +118 -0
  90. package/lib/components/picker/components/panels/date-panel/date-head.js +87 -0
  91. package/lib/components/picker/components/panels/date-panel/index.css +14 -0
  92. package/lib/components/picker/components/panels/date-panel/index.js +49 -0
  93. package/lib/components/picker/components/panels/month-panel/index.css +27 -0
  94. package/lib/components/picker/components/panels/month-panel/index.js +63 -0
  95. package/lib/components/picker/components/panels/month-panel/month-body.js +89 -0
  96. package/lib/components/picker/components/panels/month-panel/month-head.js +47 -0
  97. package/lib/components/picker/components/panels/panel-body/index.js +53 -0
  98. package/lib/components/picker/components/panels/panel-head/index.js +48 -0
  99. package/lib/components/picker/components/panels/year-panel/index.css +23 -0
  100. package/lib/components/picker/components/panels/year-panel/index.js +65 -0
  101. package/lib/components/picker/components/panels/year-panel/year-body.js +92 -0
  102. package/lib/components/picker/components/panels/year-panel/year-head.js +35 -0
  103. package/lib/components/picker/components/picker-trigger/index.css +57 -0
  104. package/lib/components/picker/components/picker-trigger/index.js +94 -0
  105. package/lib/components/picker/context.js +15 -0
  106. package/lib/components/picker/index.css +121 -0
  107. package/lib/components/picker/index.js +13 -0
  108. package/lib/components/picker/picker-panels.js +182 -0
  109. package/lib/components/picker/picker.js +132 -0
  110. package/lib/components/picker/type.js +5 -0
  111. package/lib/components/picker/utils.js +28 -0
  112. package/lib/components/popup/index.js +4 -4
  113. package/lib/components/radio/index.css +9 -9
  114. package/lib/components/scroll-container/index.js +423 -0
  115. package/lib/components/scroll-container/style.css +35 -0
  116. package/lib/components/scrollbar/scroll-mask/index.js +1 -1
  117. package/lib/components/superset-charts/components/chart/index.js +1 -1
  118. package/lib/components/superset-charts/utils/axios.js +5 -13
  119. package/lib/components/survey-model/contact.js +93 -0
  120. package/lib/components/survey-model/index.css +141 -0
  121. package/lib/components/survey-model/index.js +268 -0
  122. package/lib/components/survey-model/instance.js +86 -0
  123. package/lib/components/survey-model/request-api.js +80 -0
  124. package/lib/components/task-tree/helper.js +61 -0
  125. package/lib/components/task-tree/images/P1.svg +15 -0
  126. package/lib/components/task-tree/images/P2.svg +15 -0
  127. package/lib/components/task-tree/images/P3.svg +15 -0
  128. package/lib/components/task-tree/images/P4.svg +15 -0
  129. package/lib/components/task-tree/images/P5.svg +15 -0
  130. package/lib/components/task-tree/images/arrow.svg +9 -0
  131. package/lib/components/task-tree/images/empty-131.png +0 -0
  132. package/lib/components/task-tree/images/followed.svg +33 -0
  133. package/lib/components/task-tree/images/nice.svg +108 -0
  134. package/lib/components/task-tree/images/struc12.png +0 -0
  135. package/lib/components/task-tree/images/struc2.png +0 -0
  136. package/lib/components/task-tree/images/xialat-s.svg +13 -0
  137. package/lib/components/task-tree/index.js +22 -0
  138. package/lib/components/task-tree/mock.js +944 -0
  139. package/lib/components/task-tree/precls.js +8 -0
  140. package/lib/components/task-tree/request-apis.js +88 -0
  141. package/lib/components/task-tree/task-item-node/constant.js +45 -0
  142. package/lib/components/task-tree/task-item-node/e-empty.js +29 -0
  143. package/lib/components/task-tree/task-item-node/e-project.js +212 -0
  144. package/lib/components/task-tree/task-item-node/e-status-dropdown.js +94 -0
  145. package/lib/components/task-tree/task-item-node/e-task.js +426 -0
  146. package/lib/components/task-tree/task-item-node/get-process-color.js +62 -0
  147. package/lib/components/task-tree/task-item-node/index.css +289 -0
  148. package/lib/components/task-tree/task-item-node/task-node-render.js +43 -0
  149. package/lib/components/task-tree/task-tree.css +16 -0
  150. package/lib/components/task-tree/task-tree.js +49 -0
  151. package/lib/components/time-picker/index.css +123 -0
  152. package/lib/components/time-picker/index.js +13 -0
  153. package/lib/components/time-picker/time-picker-selector.js +138 -0
  154. package/lib/components/time-picker/time-picker.js +336 -0
  155. package/lib/components/time-picker/timer-picker-input.js +96 -0
  156. package/lib/components/time-picker/utils.js +52 -0
  157. package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.css +1 -0
  158. package/lib/components/wechat-btn/index.css +14 -0
  159. package/lib/components/wechat-btn/index.js +338 -0
  160. package/lib/components-v1/radio/radio.js +3 -3
  161. package/lib/components-v1/radio/style/index.css +8 -8
  162. package/lib/index.js +101 -77
  163. package/lib/pages/aha2021/index.js +5 -1
  164. package/lib/pages/okr-map/export-modules/okr-map/header/index.css +7 -2
  165. package/lib/pages/okr-map/export-modules/okr-map/header/index.js +73 -34
  166. package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +65 -42
  167. package/lib/pages/okr-map/export-modules/share-okr-page/header/index.css +26 -14
  168. package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +58 -13
  169. package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +28 -20
  170. package/lib/pages/okr-map/number-select/index.css +12 -9
  171. package/lib/pages/okr-map/number-select/index.js +3 -3
  172. package/lib/utils/auth.js +65 -8
  173. package/lib/utils/bs-global.js +18 -6
  174. package/lib/utils/hooks.js +72 -0
  175. package/lib/utils/open-data.js +63 -43
  176. package/package.json +6 -2
  177. package/.eslintignore +0 -3
  178. package/.eslintrc.js +0 -223
  179. package/.husky/pre-commit +0 -4
  180. package/.prettierignore +0 -31
  181. package/.prettierrc.js +0 -90
  182. package/.vscode/settings.json +0 -5
@@ -0,0 +1,426 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
14
+ var _toast = _interopRequireDefault(require("../../toast"));
15
+
16
+ var _avatar = _interopRequireDefault(require("../../avatar"));
17
+
18
+ var _progress = _interopRequireDefault(require("../../progress"));
19
+
20
+ var _tooltip = _interopRequireDefault(require("../../tooltip"));
21
+
22
+ var _statusTime = _interopRequireDefault(require("../../status-time"));
23
+
24
+ var _drawerManager = _interopRequireDefault(require("../../drawer-manager"));
25
+
26
+ var _ePriority = _interopRequireDefault(require("../../e-priority"));
27
+
28
+ var _dialogConfirm = _interopRequireWildcard(require("../../dialog-confirm"));
29
+
30
+ var _eStatusDropdown = _interopRequireDefault(require("./e-status-dropdown"));
31
+
32
+ var _requestApis = require("../request-apis");
33
+
34
+ var _constant = require("./constant");
35
+
36
+ var _getProcessColor = _interopRequireDefault(require("./get-process-color"));
37
+
38
+ var _getLocale = require("../../../utils/getLocale");
39
+
40
+ var _platform = require("../../../utils/platform");
41
+
42
+ var _bsGlobal = require("../../../utils/bs-global");
43
+
44
+ var _helpers = require("../../../utils/helpers");
45
+
46
+ var _auth = require("../../../utils/auth");
47
+
48
+ var _precls = _interopRequireDefault(require("../precls"));
49
+
50
+ require("./index.css");
51
+
52
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
53
+
54
+ 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); }
55
+
56
+ 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; }
57
+
58
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
59
+
60
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
61
+
62
+ 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; }
63
+
64
+ 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; }
65
+
66
+ 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; }
67
+
68
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
69
+
70
+ 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."); }
71
+
72
+ 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); }
73
+
74
+ 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; }
75
+
76
+ 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; }
77
+
78
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
79
+
80
+ var TooltipText = _tooltip["default"].Text; // status=3 已过期 status=2 已完成
81
+
82
+ function ETaskNode(props) {
83
+ var _okrInfo$authority;
84
+
85
+ var index = props.index,
86
+ title = props.title,
87
+ data = props.data,
88
+ _props$createUserId = props.createUserId,
89
+ createUserId = _props$createUserId === void 0 ? {} : _props$createUserId,
90
+ _props$krUser = props.krUser,
91
+ krUser = _props$krUser === void 0 ? {} : _props$krUser,
92
+ _props$hasProgress = props.hasProgress,
93
+ hasProgress = _props$hasProgress === void 0 ? true : _props$hasProgress,
94
+ _props$hasRelation = props.hasRelation,
95
+ hasRelation = _props$hasRelation === void 0 ? true : _props$hasRelation,
96
+ _props$isPushScreen = props.isPushScreen,
97
+ isPushScreen = _props$isPushScreen === void 0 ? true : _props$isPushScreen,
98
+ _props$hasPrinciple = props.hasPrinciple,
99
+ hasPrinciple = _props$hasPrinciple === void 0 ? true : _props$hasPrinciple;
100
+
101
+ var _useState = (0, _react.useState)(false),
102
+ _useState2 = _slicedToArray(_useState, 2),
103
+ unConnectVisible = _useState2[0],
104
+ setUnConnectVisible = _useState2[1];
105
+
106
+ var _useState3 = (0, _react.useState)(data.progress),
107
+ _useState4 = _slicedToArray(_useState3, 1),
108
+ progress = _useState4[0];
109
+
110
+ var _useState5 = (0, _react.useState)(data.principalUser || {}),
111
+ _useState6 = _slicedToArray(_useState5, 2),
112
+ user = _useState6[0],
113
+ setUser = _useState6[1];
114
+
115
+ var _useState7 = (0, _react.useState)(data.status === 2),
116
+ _useState8 = _slicedToArray(_useState7, 2),
117
+ isGray = _useState8[0],
118
+ setIsGray = _useState8[1];
119
+
120
+ var _useState9 = (0, _react.useState)(data.status === 4),
121
+ _useState10 = _slicedToArray(_useState9, 2),
122
+ isCancel = _useState10[0],
123
+ setIsCancel = _useState10[1];
124
+
125
+ var _useState11 = (0, _react.useState)("".concat(data.priority)),
126
+ _useState12 = _slicedToArray(_useState11, 2),
127
+ priority = _useState12[0],
128
+ setPriority = _useState12[1];
129
+
130
+ var _useState13 = (0, _react.useState)({
131
+ deadLine: data.deadLine,
132
+ isLongTerm: data.isLongTerm,
133
+ status: data.status,
134
+ riskLevel: data.riskLevel
135
+ }),
136
+ _useState14 = _slicedToArray(_useState13, 2),
137
+ dataInfo = _useState14[0],
138
+ setDataInfo = _useState14[1];
139
+
140
+ var _useState15 = (0, _react.useState)(function () {
141
+ return (0, _bsGlobal.getBSGlobal)("TaskAdvancedSetting").TaskFunctionSetting.TaskPriority;
142
+ }),
143
+ _useState16 = _slicedToArray(_useState15, 1),
144
+ isShowPriority = _useState16[0];
145
+
146
+ var okrInfo = {}; // extraEditAuth = new KRAuth({ user: krUser, createUserId }).hasAuth()
147
+ // || new OAuth({
148
+ // principalUser: okrInfo.principalUser,
149
+ // createUserId: okrInfo.createUserId,
150
+ // }).hasAuth()
151
+
152
+ var hasEditAuth = new _auth.EAuth({
153
+ principalUser: data.principalUser,
154
+ user: data.user
155
+ }).hasAuth() // || extraEditAuth
156
+ && data.status !== 5;
157
+ var isParticipant = ((_okrInfo$authority = okrInfo.authority) === null || _okrInfo$authority === void 0 ? void 0 : _okrInfo$authority.roleRelation) && okrInfo.authority.roleRelation.roleType === 2;
158
+ var hasRelativeAuth = new _auth.KRAuth({
159
+ user: krUser,
160
+ createUserId: createUserId
161
+ }).hasAuth() || new _auth.OAuth({
162
+ principalUser: okrInfo.principalUser,
163
+ createUserId: okrInfo.createUserId
164
+ }).hasAuth();
165
+
166
+ var onEditUserHandler = function onEditUserHandler(_ref) {
167
+ var _ref2 = _slicedToArray(_ref, 1),
168
+ user = _ref2[0];
169
+
170
+ (0, _requestApis.updateTaskPrincipal)({
171
+ taskId: data.taskId,
172
+ toUserId: Number(user.id)
173
+ }).then(function (data) {
174
+ if (data.Code === 1) {
175
+ setUser(user.data);
176
+
177
+ _toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"), {
178
+ canClose: false
179
+ });
180
+ } else {
181
+ _toast["default"].Error(data.Message, {
182
+ canClose: false
183
+ });
184
+ }
185
+ })["catch"](function () {
186
+ _toast["default"].Error("网络异常", {
187
+ canClose: false
188
+ });
189
+ });
190
+ };
191
+
192
+ var onEStatusChangeHandler = function onEStatusChangeHandler(statusType) {
193
+ (0, _requestApis.updateTaskStatus)({
194
+ taskId: data.taskId,
195
+ status: _constant.EStatusClass2StatusType[statusType]
196
+ }).then(function (resp) {
197
+ if (resp.Code === 1) {
198
+ _toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"), {
199
+ canClose: false
200
+ });
201
+
202
+ setDataInfo(_objectSpread(_objectSpread({}, dataInfo), {}, {
203
+ status: _constant.EStatusClass2StatusType[statusType]
204
+ }));
205
+ setIsGray(_constant.EStatusClass2StatusType[statusType] === 2);
206
+ setIsCancel(_constant.EStatusClass2StatusType[statusType] === 4);
207
+ } else {
208
+ _toast["default"].Error(resp.Message, {
209
+ canClose: false
210
+ });
211
+ }
212
+ })["catch"](function () {
213
+ _toast["default"].Error("网络异常", {
214
+ canClose: false
215
+ });
216
+ });
217
+ };
218
+
219
+ var onSureUnConnectHandler = function onSureUnConnectHandler() {
220
+ (0, _requestApis.cancelRel)({
221
+ krId: data.mileStoneId,
222
+ objType: data.objType,
223
+ okrId: okrInfo.workId,
224
+ taskId: data.taskId
225
+ }).then(function (resp) {
226
+ if (resp.Code === 1) {
227
+ _toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"), {
228
+ canClose: false
229
+ });
230
+ } else {
231
+ _toast["default"].Error(resp.Message, {
232
+ canClose: false
233
+ });
234
+ }
235
+ })["catch"](function () {
236
+ _toast["default"].Error("网络异常", {
237
+ canClose: false
238
+ });
239
+ })["finally"](setUnConnectVisible(false));
240
+ };
241
+
242
+ var updateDateHandler = /*#__PURE__*/function () {
243
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(e) {
244
+ var res;
245
+ return regeneratorRuntime.wrap(function _callee$(_context) {
246
+ while (1) {
247
+ switch (_context.prev = _context.next) {
248
+ case 0:
249
+ if (!(!hasEditAuth || dataInfo.status === 2)) {
250
+ _context.next = 2;
251
+ break;
252
+ }
253
+
254
+ return _context.abrupt("return");
255
+
256
+ case 2:
257
+ _context.next = 4;
258
+ return window.openDatePicker(e.target, {
259
+ isShowCycleView: false,
260
+ rangepickerOptions: {
261
+ startDate: dataInfo.startDate,
262
+ endDate: dataInfo.deadLine
263
+ }
264
+ });
265
+
266
+ case 4:
267
+ res = _context.sent;
268
+ _context.next = 7;
269
+ return (0, _requestApis.updateTaskDate)({
270
+ taskId: data.taskId,
271
+ startDate: res.startDate,
272
+ endDate: res.endDate,
273
+ isLongTerm: res.isLongTerm
274
+ }).then(function (resp) {
275
+ if (resp.Code === 1) {
276
+ setDataInfo(_objectSpread(_objectSpread({}, dataInfo), {}, {
277
+ deadLine: resp.Data.deadLine,
278
+ isLongTerm: resp.Data.isLongTerm,
279
+ status: resp.Data.status
280
+ }));
281
+
282
+ _toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"), {
283
+ canClose: false
284
+ });
285
+ } else {
286
+ _toast["default"].Error(resp.Message, {
287
+ canClose: false
288
+ });
289
+ }
290
+ })["catch"](function () {
291
+ _toast["default"].Error("网络异常", {
292
+ canClose: false
293
+ });
294
+ });
295
+
296
+ case 7:
297
+ case "end":
298
+ return _context.stop();
299
+ }
300
+ }
301
+ }, _callee);
302
+ }));
303
+
304
+ return function updateDateHandler(_x) {
305
+ return _ref3.apply(this, arguments);
306
+ };
307
+ }();
308
+
309
+ var onEPriorityChangeHandler = function onEPriorityChangeHandler(selectPriority) {
310
+ (0, _requestApis.setTaskPriority)({
311
+ taskId: data.taskId,
312
+ priority: selectPriority
313
+ }).then(function (resp) {
314
+ if (resp.Code === 1) {
315
+ _toast["default"].Success(resp.Message);
316
+
317
+ setPriority(selectPriority);
318
+ } else {
319
+ _toast["default"].Error(resp.Message);
320
+ }
321
+ });
322
+ };
323
+
324
+ var handleShowTaskDetail = function handleShowTaskDetail() {
325
+ if ((0, _platform.isPlatform)("dd")) {
326
+ _drawerManager["default"].close();
327
+ }
328
+
329
+ if (isPushScreen) {
330
+ var _window$Talent, _window$Talent2;
331
+
332
+ (_window$Talent = window.Talent) === null || _window$Talent === void 0 ? void 0 : _window$Talent.app.vent.off("global-pull-screen:closed:".concat(data.taskId));
333
+ (_window$Talent2 = window.Talent) === null || _window$Talent2 === void 0 ? void 0 : _window$Talent2.app.vent.on("global-pull-screen:closed:".concat(data.taskId), function () {// refreshEList && refreshEList();
334
+ }); // 任务:打开推屏
335
+
336
+ window.Talent.app.vent.trigger("global-pull-screen", data.taskId, "task");
337
+ } else {
338
+ window.open("//".concat(window.location.host).concat(window.location.pathname, "#more/taskinfo?id=").concat(data.taskId));
339
+ }
340
+ };
341
+
342
+ return /*#__PURE__*/_react["default"].createElement("div", {
343
+ key: index,
344
+ className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node"))
345
+ }, /*#__PURE__*/_react["default"].createElement("span", {
346
+ className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-prefix"))
347
+ }, /*#__PURE__*/_react["default"].createElement(_eStatusDropdown["default"], {
348
+ onChange: onEStatusChangeHandler,
349
+ checked: _constant.EStatusStatus2ClassType[dataInfo.status],
350
+ hasAuth: hasEditAuth
351
+ })), isShowPriority && /*#__PURE__*/_react["default"].createElement("span", {
352
+ className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-priority"))
353
+ }, /*#__PURE__*/_react["default"].createElement(_ePriority["default"], {
354
+ onChange: onEPriorityChangeHandler,
355
+ checked: priority,
356
+ hasAuth: hasEditAuth,
357
+ status: data.status
358
+ })), /*#__PURE__*/_react["default"].createElement("span", {
359
+ className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-title ").concat(isCancel ? "".concat(_precls["default"], "__e-project-node-gray") : "")),
360
+ onClick: handleShowTaskDetail
361
+ }, /*#__PURE__*/_react["default"].createElement(TooltipText, {
362
+ text: (0, _helpers.escapeHtml)(title),
363
+ isPercent: true
364
+ })), /*#__PURE__*/_react["default"].createElement("span", {
365
+ className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-actions"))
366
+ }, hasPrinciple && /*#__PURE__*/_react["default"].createElement("span", {
367
+ className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-actions-user"))
368
+ }, /*#__PURE__*/_react["default"].createElement(_avatar["default"].Text, {
369
+ name: user === null || user === void 0 ? void 0 : user.name,
370
+ id: user === null || user === void 0 ? void 0 : user.userId,
371
+ width: 92,
372
+ editable: dataInfo.status !== 2 && hasEditAuth,
373
+ onEditUser: onEditUserHandler,
374
+ isGetRoot: true,
375
+ showAvatar: true,
376
+ avatar: user === null || user === void 0 ? void 0 : user.avatar,
377
+ extraCls: (isCancel || isGray) && "".concat(_precls["default"], "__e-project-node-gray")
378
+ })), /*#__PURE__*/_react["default"].createElement("span", {
379
+ className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-actions-date")),
380
+ onClick: updateDateHandler
381
+ }, /*#__PURE__*/_react["default"].createElement(_statusTime["default"], {
382
+ deadLine: dataInfo.deadLine,
383
+ isLongTerm: dataInfo.isLongTerm,
384
+ isCancel: dataInfo.status === 4,
385
+ isComplete: dataInfo.status === 2
386
+ })), hasProgress && /*#__PURE__*/_react["default"].createElement("span", {
387
+ className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-actions-progress ").concat((isGray || isCancel) && "".concat(_precls["default"], "__e-project-node-gray")))
388
+ }, /*#__PURE__*/_react["default"].createElement(_progress["default"].Circle, {
389
+ size: 22,
390
+ width: 3,
391
+ percent: progress,
392
+ linear: true,
393
+ linearId: data.taskId,
394
+ linearStartColor: (0, _getProcessColor["default"])(dataInfo.riskLevel, "linearStartColor", dataInfo.status),
395
+ linearEndColor: (0, _getProcessColor["default"])(dataInfo.riskLevel, "linearEndColor", dataInfo.status),
396
+ backgroundColor: (0, _getProcessColor["default"])(dataInfo.riskLevel, "backgroundColor", dataInfo.status)
397
+ })), okrInfo.status === 1 && hasRelation && (hasRelativeAuth || isParticipant) ? /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
398
+ overlay: (0, _getLocale.getLocale)("OKR_MyO_Text_Cancel"),
399
+ placement: "top"
400
+ }, /*#__PURE__*/_react["default"].createElement("span", {
401
+ className: (0, _classnames["default"])("".concat(_precls["default"], "__e-task-node-actions-connect")),
402
+ onClick: function onClick() {
403
+ return setUnConnectVisible(true);
404
+ }
405
+ }, /*#__PURE__*/_react["default"].createElement("span", {
406
+ className: "tu-icon-quxiaoguanlian e-node-status-icon"
407
+ }))) : null), /*#__PURE__*/_react["default"].createElement(_dialogConfirm["default"], {
408
+ visible: unConnectVisible,
409
+ type: "warning"
410
+ }, /*#__PURE__*/_react["default"].createElement("span", {
411
+ type: "title"
412
+ }, (0, _getLocale.getLocale)("OKR_MyO_Text_Cancelass")), /*#__PURE__*/_react["default"].createElement("span", {
413
+ type: "content"
414
+ }, (0, _getLocale.getLocale)("OKR_MyO_Text_TtasknotO")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.CancelButton, {
415
+ type: "button",
416
+ onClick: function onClick() {
417
+ return setUnConnectVisible(false);
418
+ }
419
+ }, (0, _getLocale.getLocale)("Mod_Cancel")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.SureButton, {
420
+ type: "button",
421
+ onClick: onSureUnConnectHandler
422
+ }, (0, _getLocale.getLocale)("OKR_MyO_Butt_Determine"))));
423
+ }
424
+
425
+ var _default = ETaskNode;
426
+ exports["default"] = _default;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var getProcessColor = function getProcessColor(level, type, status) {
9
+ var cancelColor = {
10
+ linearStartColor: "#e1e5ec",
11
+ linearEndColor: "#bfc7d5",
12
+ backgroundColor: "rgba(40, 121, 255, 0.11)"
13
+ };
14
+
15
+ if (status === 2) {
16
+ return cancelColor[type];
17
+ }
18
+
19
+ if (status === 4) {
20
+ return cancelColor[type];
21
+ }
22
+
23
+ var processColor = {
24
+ 1: {
25
+ riskLevel: 1,
26
+ linearStartColor: "#9fbfff",
27
+ linearEndColor: "#2879ff",
28
+ backgroundColor: "rgba(40, 121, 255, 0.11)"
29
+ },
30
+ 2: {
31
+ riskLevel: 2,
32
+ linearStartColor: "#9fbfff",
33
+ linearEndColor: "#2879ff",
34
+ backgroundColor: "rgba(40, 121, 255, 0.11)"
35
+ },
36
+ 3: {
37
+ riskLevel: 3,
38
+ linearStartColor: "#FFA5A5",
39
+ linearEndColor: "#F05E5E",
40
+ backgroundColor: "rgba(222, 89, 89, 0.1)"
41
+ },
42
+ 4: {
43
+ riskLevel: 4,
44
+ linearStartColor: "#93eed2",
45
+ linearEndColor: "#5ad8a6",
46
+ backgroundColor: "rgba(40, 121, 255, 0.11)"
47
+ },
48
+ 5: {
49
+ riskLevel: 5,
50
+ linearStartColor: "#93eed2",
51
+ linearEndColor: "#5ad8a6",
52
+ backgroundColor: "rgba(40, 121, 255, 0.11)"
53
+ }
54
+ };
55
+ var color = processColor["".concat(level)];
56
+ if (level === 0) color = processColor["1"];
57
+ if (!color) return {};
58
+ return color[type];
59
+ };
60
+
61
+ var _default = getProcessColor;
62
+ exports["default"] = _default;