@titaui/pc 1.11.41 → 1.11.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/avatar/name-avatar/index.css +1 -0
- package/lib/components/avatar/name-avatar/index.js +22 -13
- package/lib/components/button/rect-btn/index.css +45 -11
- package/lib/components/button/rect-btn/index.js +12 -6
- package/lib/components/change-okr-modal/index.js +2 -1
- package/lib/components/checkbox/index.css +3 -3
- package/lib/components/create-okr-modal/index.js +45 -41
- package/lib/components/create-okr-modal/request-api.js +1 -1
- package/lib/components/dialog-confirm/index.css +2 -2
- package/lib/components/drawer/headerAction.js +5 -1
- package/lib/components/drawer/headerDrop.js +42 -4
- package/lib/components/drawer/index.css +33 -0
- package/lib/components/drawer/index.js +26 -3
- package/lib/components/dynamic/new-ui.css +4 -4
- package/lib/components/dynamic/online-broadcast/data.js +19 -1
- package/lib/components/e-priority/index.css +4 -4
- package/lib/components/e-priority/index.js +10 -2
- package/lib/components/mblog/components/MblogContent.js +5 -2
- package/lib/components/nav-top/components/user-message/components/todos/index.css +1 -0
- package/lib/components/nav-top/index.js +6 -2
- package/lib/components/okr-detail/base-info/other-infos/date-cycle/index.js +20 -4
- package/lib/components/okr-detail/base-info/other-infos/principal/index.js +9 -1
- package/lib/components/okr-detail/components/header/index.js +10 -3
- package/lib/components/okr-detail/components/header/o-name.js +10 -3
- package/lib/components/okr-detail/components/o-classify.js +5 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +13 -14
- package/lib/components/okr-detail/detail-header/constant.js +53 -0
- package/lib/components/okr-detail/detail-header/delete-confirm/delete-confirm.js +111 -54
- package/lib/components/okr-detail/detail-header/delete-confirm/index.css +59 -0
- package/lib/components/okr-detail/detail-header/index.css +11 -0
- package/lib/components/okr-detail/detail-header/index.js +228 -234
- package/lib/components/okr-detail/helper.js +108 -0
- package/lib/components/okr-detail/index.js +21 -4
- package/lib/components/okr-detail/okr-list/index.js +8 -3
- package/lib/components/okr-detail/request-apis.js +14 -8
- package/lib/components/okr-period-selector/index.js +9 -5
- package/lib/components/okr-period-selector/select-cycle.js +23 -19
- package/lib/components/operation-records/index.js +1 -1
- package/lib/components/operation-records/style.js +1 -1
- package/lib/components/task-relation-modal/index.js +0 -1
- package/lib/components/task-relation-modal/request-api.js +2 -1
- package/lib/components/task-tree/task-item-node/constant.js +13 -1
- package/lib/components/textarea/index.css +142 -0
- package/lib/components/textarea/index.js +259 -0
- package/lib/components/toast/index.js +5 -3
- package/lib/index.js +40 -0
- package/lib/pages/new-okr-list/header/common.js +52 -0
- package/lib/pages/new-okr-list/header/index.css +45 -0
- package/lib/pages/new-okr-list/header/index.js +51 -29
- package/lib/pages/new-okr-list/header/operate-record.js +129 -0
- package/lib/pages/new-okr-list/index.js +4 -2
- package/lib/pages/new-okr-list/list/index.js +19 -2
- package/lib/pages/new-okr-list/request-api.js +8 -2
- package/lib/pages/okr-map/unsupport-ie/index.js +3 -5
- package/lib/utils/format-time.js +8 -1
- package/lib/utils/open-data.js +5 -1
- package/package.json +1 -1
- package/lib/components/okr-detail/detail-header/delete-confirm/style.js +0 -38
|
@@ -0,0 +1,259 @@
|
|
|
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
|
+
require("./index.css");
|
|
15
|
+
|
|
16
|
+
var _excluded = ["disabled", "onFocus", "onBlur", "inputRef", "onChange", "className", "value", "placeholder", "maxLine", "maxLength", "initValue", "onErrorChange", "validator", "onKeyDown"];
|
|
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 _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); }
|
|
25
|
+
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
+
|
|
28
|
+
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."); }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
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; }
|
|
39
|
+
|
|
40
|
+
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; }
|
|
41
|
+
|
|
42
|
+
var Textarea = function Textarea(p) {
|
|
43
|
+
var disabled = p.disabled,
|
|
44
|
+
_onFocus = p.onFocus,
|
|
45
|
+
_onBlur = p.onBlur,
|
|
46
|
+
inputRef = p.inputRef,
|
|
47
|
+
_onChange = p.onChange,
|
|
48
|
+
className = p.className,
|
|
49
|
+
value = p.value,
|
|
50
|
+
placeholder = p.placeholder,
|
|
51
|
+
_p$maxLine = p.maxLine,
|
|
52
|
+
maxLine = _p$maxLine === void 0 ? 4 : _p$maxLine,
|
|
53
|
+
maxLength = p.maxLength,
|
|
54
|
+
initValue = p.initValue,
|
|
55
|
+
onErrorChange = p.onErrorChange,
|
|
56
|
+
validator = p.validator,
|
|
57
|
+
_onKeyDown = p.onKeyDown,
|
|
58
|
+
others = _objectWithoutProperties(p, _excluded);
|
|
59
|
+
|
|
60
|
+
var prefixCls = "titaui-textArea";
|
|
61
|
+
|
|
62
|
+
var _useState = (0, _react.useState)(false),
|
|
63
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
64
|
+
active = _useState2[0],
|
|
65
|
+
setActive = _useState2[1];
|
|
66
|
+
|
|
67
|
+
var _useState3 = (0, _react.useState)(initValue || ""),
|
|
68
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
69
|
+
selfValue = _useState4[0],
|
|
70
|
+
setSelfValue = _useState4[1];
|
|
71
|
+
|
|
72
|
+
var selfInputRef = (0, _react.useRef)();
|
|
73
|
+
var realInputRef = inputRef || selfInputRef;
|
|
74
|
+
var isControlled = ("value" in p);
|
|
75
|
+
var realValue = isControlled ? value : selfValue;
|
|
76
|
+
|
|
77
|
+
var _useState5 = (0, _react.useState)(false),
|
|
78
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
79
|
+
error = _useState6[0],
|
|
80
|
+
setError = _useState6[1];
|
|
81
|
+
|
|
82
|
+
var _useState7 = (0, _react.useState)(""),
|
|
83
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
84
|
+
errorText = _useState8[0],
|
|
85
|
+
setErrorText = _useState8[1];
|
|
86
|
+
|
|
87
|
+
var wrapperRef = (0, _react.useRef)();
|
|
88
|
+
|
|
89
|
+
var _useState9 = (0, _react.useState)(false),
|
|
90
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
91
|
+
validateEnable = _useState10[0],
|
|
92
|
+
setvalidateEnable = _useState10[1];
|
|
93
|
+
|
|
94
|
+
var _useState11 = (0, _react.useState)(false),
|
|
95
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
96
|
+
isTrue = _useState12[0],
|
|
97
|
+
setIsTrue = _useState12[1];
|
|
98
|
+
|
|
99
|
+
var _useState13 = (0, _react.useState)(1),
|
|
100
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
101
|
+
textAreaRows = _useState14[0],
|
|
102
|
+
setTextAreaRows = _useState14[1];
|
|
103
|
+
|
|
104
|
+
var _useState15 = (0, _react.useState)(false),
|
|
105
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
106
|
+
showTopShadow = _useState16[0],
|
|
107
|
+
setShowTopShadow = _useState16[1];
|
|
108
|
+
|
|
109
|
+
var _useState17 = (0, _react.useState)(false),
|
|
110
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
111
|
+
showBottomShadow = _useState18[0],
|
|
112
|
+
setShowBottomShadow = _useState18[1];
|
|
113
|
+
|
|
114
|
+
(0, _react.useEffect)(function () {
|
|
115
|
+
if (!validateEnable) return;
|
|
116
|
+
var hasError = false;
|
|
117
|
+
var eText = "";
|
|
118
|
+
|
|
119
|
+
if (maxLength !== undefined) {
|
|
120
|
+
if (realValue.length > maxLength) {
|
|
121
|
+
hasError = true;
|
|
122
|
+
eText = "\u5DF2\u8F93\u5165 ".concat(realValue.length, " \u4E2A\u5B57\uFF0C\u6700\u591A\u53EF\u8F93\u5165 ").concat(maxLength, " \u4E2A\u5B57");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (!hasError && validator) {
|
|
127
|
+
var _validator = validator(realValue),
|
|
128
|
+
isValid = _validator.isValid,
|
|
129
|
+
_errorText = _validator.errorText;
|
|
130
|
+
|
|
131
|
+
if (!isValid) {
|
|
132
|
+
hasError = true;
|
|
133
|
+
eText = _errorText || "";
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
setErrorText(eText);
|
|
138
|
+
|
|
139
|
+
if (hasError !== error) {
|
|
140
|
+
if (onErrorChange) {
|
|
141
|
+
onErrorChange(hasError);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
setError(hasError);
|
|
145
|
+
}
|
|
146
|
+
}, [realValue]);
|
|
147
|
+
|
|
148
|
+
var handleShadowVisible = function handleShadowVisible() {
|
|
149
|
+
setTimeout(function () {
|
|
150
|
+
if (realInputRef.current) {
|
|
151
|
+
if (Math.abs(realInputRef.current.scrollHeight - realInputRef.current.offsetHeight) <= 3) {
|
|
152
|
+
setShowTopShadow(false);
|
|
153
|
+
setShowBottomShadow(false);
|
|
154
|
+
} else if (realInputRef.current.scrollTop > 0 && Math.abs(realInputRef.current.scrollHeight - realInputRef.current.scrollTop - realInputRef.current.offsetHeight) > 3) {
|
|
155
|
+
setShowTopShadow(true);
|
|
156
|
+
setShowBottomShadow(true);
|
|
157
|
+
} else if (realInputRef.current.scrollTop > 0) {
|
|
158
|
+
setShowTopShadow(true);
|
|
159
|
+
setShowBottomShadow(false);
|
|
160
|
+
} else {
|
|
161
|
+
setShowTopShadow(false);
|
|
162
|
+
setShowBottomShadow(true);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}, 0);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
var resetTextareaHeight = function resetTextareaHeight() {
|
|
169
|
+
setTimeout(function () {
|
|
170
|
+
var rows = realInputRef.current && Math.ceil(realInputRef.current.scrollHeight / 22);
|
|
171
|
+
|
|
172
|
+
if (rows && rows <= maxLine) {
|
|
173
|
+
setTextAreaRows(rows);
|
|
174
|
+
} else {
|
|
175
|
+
setTextAreaRows(maxLine);
|
|
176
|
+
}
|
|
177
|
+
}, 0);
|
|
178
|
+
}; // 鼠标移入
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
var changeMoveOver = function changeMoveOver() {
|
|
182
|
+
setIsTrue(true);
|
|
183
|
+
}; // 鼠标移出
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
var changeMoveOut = function changeMoveOut() {
|
|
187
|
+
setIsTrue(false);
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
var areaNormal = isTrue ? "area-focus" : "area-normal";
|
|
191
|
+
var areaFocus = active ? "area-focus" : areaNormal;
|
|
192
|
+
var areaError = error ? "area-error" : areaFocus;
|
|
193
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
194
|
+
className: "\n ".concat(prefixCls, "\n ").concat(areaError, "\n ").concat(disabled ? " disabled" : "", "\n "),
|
|
195
|
+
onFocus: function onFocus() {},
|
|
196
|
+
onBlur: function onBlur() {},
|
|
197
|
+
onMouseOver: changeMoveOver,
|
|
198
|
+
onMouseOut: changeMoveOut,
|
|
199
|
+
ref: wrapperRef,
|
|
200
|
+
onClick: function onClick() {
|
|
201
|
+
var _realInputRef$current;
|
|
202
|
+
|
|
203
|
+
(_realInputRef$current = realInputRef.current) === null || _realInputRef$current === void 0 ? void 0 : _realInputRef$current.focus();
|
|
204
|
+
}
|
|
205
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
206
|
+
className: (0, _classnames["default"])("inner scrollbar-size-sm", {
|
|
207
|
+
commonTextAreaWrapperTopShadow: showTopShadow,
|
|
208
|
+
commonTextAreaWrapperBottomShadow: showBottomShadow
|
|
209
|
+
})
|
|
210
|
+
}, /*#__PURE__*/_react["default"].createElement("textarea", _extends({
|
|
211
|
+
className: "".concat(className, " scrollbar-size-sm"),
|
|
212
|
+
disabled: disabled,
|
|
213
|
+
ref: realInputRef,
|
|
214
|
+
value: realValue,
|
|
215
|
+
rows: textAreaRows,
|
|
216
|
+
placeholder: placeholder,
|
|
217
|
+
onScroll: handleShadowVisible,
|
|
218
|
+
onChange: function onChange(e) {
|
|
219
|
+
if (!isControlled) {
|
|
220
|
+
setSelfValue(e.target.value);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (_onChange) {
|
|
224
|
+
_onChange(e);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
resetTextareaHeight();
|
|
228
|
+
setvalidateEnable(true);
|
|
229
|
+
},
|
|
230
|
+
onFocus: function onFocus(e) {
|
|
231
|
+
setActive(true);
|
|
232
|
+
|
|
233
|
+
if (_onFocus) {
|
|
234
|
+
_onFocus(e);
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
onKeyDown: function onKeyDown(e) {
|
|
238
|
+
if (_onKeyDown) {
|
|
239
|
+
_onKeyDown(e);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (e.keyCode === 13) {
|
|
243
|
+
e.preventDefault();
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
onBlur: function onBlur(e) {
|
|
247
|
+
setActive(false);
|
|
248
|
+
|
|
249
|
+
if (_onBlur) {
|
|
250
|
+
_onBlur(e);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}, others)))), error && /*#__PURE__*/_react["default"].createElement("div", {
|
|
254
|
+
className: "err-color"
|
|
255
|
+
}, errorText));
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
var _default = Textarea;
|
|
259
|
+
exports["default"] = _default;
|
|
@@ -168,6 +168,7 @@ var Toast = /*#__PURE__*/function () {
|
|
|
168
168
|
var options,
|
|
169
169
|
key,
|
|
170
170
|
ins,
|
|
171
|
+
canClose,
|
|
171
172
|
_args3 = arguments;
|
|
172
173
|
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
173
174
|
while (1) {
|
|
@@ -180,14 +181,15 @@ var Toast = /*#__PURE__*/function () {
|
|
|
180
181
|
|
|
181
182
|
case 4:
|
|
182
183
|
ins = _context3.sent;
|
|
184
|
+
canClose = options.canClose !== undefined ? options.canClose : false;
|
|
183
185
|
ins.notice({
|
|
184
|
-
content: (0, _SuccessRender.RenderError)(msg, key,
|
|
186
|
+
content: (0, _SuccessRender.RenderError)(msg, key, canClose, ins),
|
|
185
187
|
style: options.style,
|
|
186
|
-
duration: options.duration ||
|
|
188
|
+
duration: options.duration || canClose === false ? 3 : 3000,
|
|
187
189
|
key: key
|
|
188
190
|
});
|
|
189
191
|
|
|
190
|
-
case
|
|
192
|
+
case 7:
|
|
191
193
|
case "end":
|
|
192
194
|
return _context3.stop();
|
|
193
195
|
}
|
package/lib/index.js
CHANGED
|
@@ -51,6 +51,12 @@ Object.defineProperty(exports, "Communication", {
|
|
|
51
51
|
return _communication["default"];
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
+
Object.defineProperty(exports, "ConditionRender", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _conditionRender["default"];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
54
60
|
Object.defineProperty(exports, "Confidence", {
|
|
55
61
|
enumerable: true,
|
|
56
62
|
get: function get() {
|
|
@@ -63,6 +69,12 @@ Object.defineProperty(exports, "CreateOkrModal", {
|
|
|
63
69
|
return _createOkrModal["default"];
|
|
64
70
|
}
|
|
65
71
|
});
|
|
72
|
+
Object.defineProperty(exports, "DangerousHtml", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function get() {
|
|
75
|
+
return _dangerousHtml["default"];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
66
78
|
Object.defineProperty(exports, "DatePicker", {
|
|
67
79
|
enumerable: true,
|
|
68
80
|
get: function get() {
|
|
@@ -159,6 +171,12 @@ Object.defineProperty(exports, "Form", {
|
|
|
159
171
|
return _form["default"];
|
|
160
172
|
}
|
|
161
173
|
});
|
|
174
|
+
Object.defineProperty(exports, "FormatTime", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function get() {
|
|
177
|
+
return _formatTime["default"];
|
|
178
|
+
}
|
|
179
|
+
});
|
|
162
180
|
Object.defineProperty(exports, "GridLayout", {
|
|
163
181
|
enumerable: true,
|
|
164
182
|
get: function get() {
|
|
@@ -375,6 +393,12 @@ Object.defineProperty(exports, "Progress", {
|
|
|
375
393
|
return _progress["default"];
|
|
376
394
|
}
|
|
377
395
|
});
|
|
396
|
+
Object.defineProperty(exports, "PublishDynamicModal", {
|
|
397
|
+
enumerable: true,
|
|
398
|
+
get: function get() {
|
|
399
|
+
return _publishDynamicModal["default"];
|
|
400
|
+
}
|
|
401
|
+
});
|
|
378
402
|
Object.defineProperty(exports, "Radio", {
|
|
379
403
|
enumerable: true,
|
|
380
404
|
get: function get() {
|
|
@@ -477,6 +501,12 @@ Object.defineProperty(exports, "TaskRelationModal", {
|
|
|
477
501
|
return _taskRelationModal["default"];
|
|
478
502
|
}
|
|
479
503
|
});
|
|
504
|
+
Object.defineProperty(exports, "Textarea", {
|
|
505
|
+
enumerable: true,
|
|
506
|
+
get: function get() {
|
|
507
|
+
return _textarea["default"];
|
|
508
|
+
}
|
|
509
|
+
});
|
|
480
510
|
Object.defineProperty(exports, "TitaChart", {
|
|
481
511
|
enumerable: true,
|
|
482
512
|
get: function get() {
|
|
@@ -602,6 +632,8 @@ var _button = _interopRequireDefault(require("./components/button"));
|
|
|
602
632
|
|
|
603
633
|
var _bookDemo = _interopRequireDefault(require("./components/book-demo"));
|
|
604
634
|
|
|
635
|
+
var _conditionRender = _interopRequireDefault(require("./components/condition-render"));
|
|
636
|
+
|
|
605
637
|
var _confidence = _interopRequireDefault(require("./components/confidence"));
|
|
606
638
|
|
|
607
639
|
var _communication = _interopRequireDefault(require("./components/communication"));
|
|
@@ -616,6 +648,8 @@ var _createOkrModal = _interopRequireDefault(require("./components/create-okr-mo
|
|
|
616
648
|
|
|
617
649
|
var _dialog = _interopRequireDefault(require("./components/dialog"));
|
|
618
650
|
|
|
651
|
+
var _dangerousHtml = _interopRequireDefault(require("./components/dangerous-html"));
|
|
652
|
+
|
|
619
653
|
var _datePicker = _interopRequireDefault(require("./components/date-picker"));
|
|
620
654
|
|
|
621
655
|
var _demoFree = _interopRequireDefault(require("./pages/demo-free"));
|
|
@@ -642,6 +676,8 @@ var _errorBoundary = _interopRequireDefault(require("./components/error-boundary
|
|
|
642
676
|
|
|
643
677
|
var _errorLevel = _interopRequireDefault(require("./utils/error-level"));
|
|
644
678
|
|
|
679
|
+
var _formatTime = _interopRequireDefault(require("./utils/format-time"));
|
|
680
|
+
|
|
645
681
|
var _fileList = _interopRequireDefault(require("./components/file-list"));
|
|
646
682
|
|
|
647
683
|
var _firework = _interopRequireDefault(require("./components/firework"));
|
|
@@ -714,6 +750,8 @@ var _periodSelector = _interopRequireDefault(require("./components/period-select
|
|
|
714
750
|
|
|
715
751
|
var _pagination = _interopRequireDefault(require("./components/pagination"));
|
|
716
752
|
|
|
753
|
+
var _publishDynamicModal = _interopRequireDefault(require("./components/publish-dynamic-modal"));
|
|
754
|
+
|
|
717
755
|
var _passwordInput = _interopRequireDefault(require("./components/password-input"));
|
|
718
756
|
|
|
719
757
|
var _photoCard = _interopRequireDefault(require("./components/photo-card"));
|
|
@@ -768,6 +806,8 @@ var _titaChart = _interopRequireDefault(require("./components/tita-chart"));
|
|
|
768
806
|
|
|
769
807
|
var _tooltip = _interopRequireDefault(require("./components/tooltip"));
|
|
770
808
|
|
|
809
|
+
var _textarea = _interopRequireDefault(require("./components/textarea"));
|
|
810
|
+
|
|
771
811
|
var _tooltipText = _interopRequireDefault(require("./components/tooltip/tooltip-text"));
|
|
772
812
|
|
|
773
813
|
var _userSelector = _interopRequireDefault(require("./components/user-selector"));
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatPeriod = void 0;
|
|
7
|
+
|
|
8
|
+
var _getLocale = require("../../../utils/getLocale");
|
|
9
|
+
|
|
10
|
+
var _constant = require("../../../utils/constant");
|
|
11
|
+
|
|
12
|
+
var formatPeriod = function formatPeriod(selected) {
|
|
13
|
+
if (!selected) return "";
|
|
14
|
+
var quarter = ["", "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_1stQuarter")), "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_2ndQuarter")), "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_3rdQuarter")), "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_4thQuarter"))];
|
|
15
|
+
var cycleDate = "";
|
|
16
|
+
var annualNum = Number("".concat(selected.annualNum)) === -1 ? "".concat((0, _getLocale.getLocale)("OKR_MyO_Butt_Allyears")) : "".concat(selected.annualNum).concat(_getLocale.isEn ? "" : "年");
|
|
17
|
+
var month = (0, _constant.getMonth)();
|
|
18
|
+
|
|
19
|
+
switch ("".concat(selected.cycleType)) {
|
|
20
|
+
case "-1":
|
|
21
|
+
cycleDate = "".concat((0, _getLocale.getLocale)("OKR_MyO_Butt_AllStatee"));
|
|
22
|
+
break;
|
|
23
|
+
|
|
24
|
+
case "1":
|
|
25
|
+
cycleDate = "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Year"));
|
|
26
|
+
break;
|
|
27
|
+
|
|
28
|
+
case "2":
|
|
29
|
+
// 季度
|
|
30
|
+
cycleDate = quarter[Number(selected.yqmNum)];
|
|
31
|
+
break;
|
|
32
|
+
|
|
33
|
+
case "3":
|
|
34
|
+
cycleDate = month[Number(selected.yqmNum) - 1];
|
|
35
|
+
break;
|
|
36
|
+
|
|
37
|
+
case "4":
|
|
38
|
+
cycleDate = "".concat(month[Number(selected.yqmNum) - 1], " - ").concat(month[((Number(selected.yqmNum) + 1) % 12 || 12) - 1]);
|
|
39
|
+
break;
|
|
40
|
+
|
|
41
|
+
case "5":
|
|
42
|
+
cycleDate = Number("".concat(selected.yqmNum)) === 1 ? "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Firsthalf")) : "".concat((0, _getLocale.getLocale)("OKR_MyO_Pop_Secondhalf"));
|
|
43
|
+
break;
|
|
44
|
+
|
|
45
|
+
default:
|
|
46
|
+
cycleDate = "".concat((0, _getLocale.getLocale)("Mod_Customization"));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return "".concat(annualNum, " ").concat(cycleDate);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
exports.formatPeriod = formatPeriod;
|
|
@@ -36,6 +36,51 @@
|
|
|
36
36
|
color: #2879ff;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
.tita-okr-list-v2__header-record {
|
|
40
|
+
display: flex;
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
align-items: center;
|
|
44
|
+
transform: rotate(90deg);
|
|
45
|
+
background: #fff;
|
|
46
|
+
box-shadow: 0px 0px 8px 0px rgba(127, 145, 180, 0.1);
|
|
47
|
+
width: 36px;
|
|
48
|
+
height: 36px;
|
|
49
|
+
margin-left: 12px;
|
|
50
|
+
border-radius: 18px;
|
|
51
|
+
font-size: 20px;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.tita-okr-list-v2__header-record-popup {
|
|
56
|
+
padding: 16px 12px;
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
background: #ffffff;
|
|
59
|
+
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
60
|
+
border-radius: 12px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.tita-okr-list-v2__header-record-item {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
padding: 5px 8px;
|
|
67
|
+
box-sizing: border-box;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
color: #3f4755;
|
|
70
|
+
line-height: 22px;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.tita-okr-list-v2__header-record-item:hover {
|
|
75
|
+
color: #2879ff;
|
|
76
|
+
background: #f7f8fa;
|
|
77
|
+
border-radius: 8px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.tita-okr-list-v2__header-record-item-content {
|
|
81
|
+
margin-left: 8px;
|
|
82
|
+
}
|
|
83
|
+
|
|
39
84
|
.tita-okr-list-v2__header-filter {
|
|
40
85
|
box-sizing: border-box;
|
|
41
86
|
height: 36px;
|
|
@@ -29,6 +29,8 @@ var _filter = _interopRequireDefault(require("./filter"));
|
|
|
29
29
|
|
|
30
30
|
var _comments = _interopRequireDefault(require("./comments"));
|
|
31
31
|
|
|
32
|
+
var _operateRecord = _interopRequireDefault(require("./operate-record"));
|
|
33
|
+
|
|
32
34
|
var _context = require("../context");
|
|
33
35
|
|
|
34
36
|
var _requestApi = require("../request-api");
|
|
@@ -65,6 +67,7 @@ function Header(props, ref) {
|
|
|
65
67
|
cycleType = _useContext.cycleType,
|
|
66
68
|
yqmNum = _useContext.yqmNum;
|
|
67
69
|
|
|
70
|
+
var relationShip = parseInt(relation, 10);
|
|
68
71
|
var onSearch = props.onSearch,
|
|
69
72
|
onFrontAddOKR = props.onFrontAddOKR;
|
|
70
73
|
|
|
@@ -84,21 +87,26 @@ function Header(props, ref) {
|
|
|
84
87
|
setUserInfo = _useState6[1];
|
|
85
88
|
|
|
86
89
|
(0, _react.useEffect)(function () {
|
|
87
|
-
if (toUserId !== undefined ||
|
|
90
|
+
if (toUserId !== undefined || relationShip === 1) {
|
|
88
91
|
var userId = toUserId;
|
|
89
|
-
if (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
if (relationShip === 1) userId = (0, _bsGlobal.getUserInfo)().Id;
|
|
93
|
+
|
|
94
|
+
if (userId) {
|
|
95
|
+
(0, _requestApi.getUserInfoById)(userId).then(function (res) {
|
|
96
|
+
setUserInfo(res.Data);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
93
99
|
}
|
|
94
100
|
}, [toUserId, relation]);
|
|
95
101
|
(0, _react.useEffect)(function () {
|
|
96
102
|
setInit(true);
|
|
97
103
|
}, []);
|
|
98
104
|
(0, _react.useEffect)(function () {
|
|
99
|
-
init
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
if (init) {
|
|
106
|
+
onSearch({
|
|
107
|
+
onlyThisDept: onlyThisDept
|
|
108
|
+
});
|
|
109
|
+
}
|
|
102
110
|
}, [onlyThisDept]);
|
|
103
111
|
var createOkrRef = (0, _react.useRef)();
|
|
104
112
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
@@ -116,56 +124,56 @@ function Header(props, ref) {
|
|
|
116
124
|
var rootNode = {
|
|
117
125
|
rootId: 0,
|
|
118
126
|
// @ts-ignore
|
|
119
|
-
rootName: window.BSGlobal.tenantInfo.Name ||
|
|
127
|
+
rootName: window.BSGlobal.tenantInfo.Name || ''
|
|
120
128
|
};
|
|
121
129
|
var level2Selected = {
|
|
122
130
|
id: 0,
|
|
123
131
|
// @ts-ignore
|
|
124
|
-
name: window.BSGlobal.tenantInfo.Name ||
|
|
132
|
+
name: window.BSGlobal.tenantInfo.Name || ''
|
|
125
133
|
};
|
|
126
|
-
var searchType =
|
|
134
|
+
var searchType = 'company';
|
|
127
135
|
|
|
128
|
-
if (departmentId && departmentId
|
|
136
|
+
if (departmentId && departmentId !== -1) {
|
|
129
137
|
rootNode.rootId = departmentId;
|
|
130
|
-
rootNode.rootName = departmentName ||
|
|
131
|
-
searchType =
|
|
138
|
+
rootNode.rootName = departmentName || '';
|
|
139
|
+
searchType = 'depart';
|
|
132
140
|
level2Selected.id = departmentId;
|
|
133
|
-
level2Selected.name = departmentName ||
|
|
141
|
+
level2Selected.name = departmentName || '';
|
|
134
142
|
}
|
|
135
143
|
|
|
136
144
|
if (toUserId) {
|
|
137
145
|
rootNode.rootId = toUserId;
|
|
138
|
-
rootNode.rootName = userInfo.name ||
|
|
139
|
-
searchType =
|
|
146
|
+
rootNode.rootName = userInfo.name || '';
|
|
147
|
+
searchType = 'user';
|
|
140
148
|
level2Selected.id = toUserId;
|
|
141
|
-
level2Selected.name = userInfo.name ||
|
|
149
|
+
level2Selected.name = userInfo.name || '';
|
|
142
150
|
}
|
|
143
151
|
|
|
144
|
-
if (relation
|
|
152
|
+
if (parseInt(relation, 10) === 1) {
|
|
145
153
|
rootNode.rootId = (0, _bsGlobal.getUserInfo)().Id;
|
|
146
|
-
rootNode.rootName = (0, _bsGlobal.getUserInfo)().Name ||
|
|
147
|
-
searchType =
|
|
154
|
+
rootNode.rootName = (0, _bsGlobal.getUserInfo)().Name || '';
|
|
155
|
+
searchType = 'user';
|
|
148
156
|
level2Selected.id = (0, _bsGlobal.getUserInfo)().Id;
|
|
149
|
-
level2Selected.name = (0, _bsGlobal.getUserInfo)().Name ||
|
|
157
|
+
level2Selected.name = (0, _bsGlobal.getUserInfo)().Name || '';
|
|
150
158
|
}
|
|
151
159
|
|
|
152
160
|
var urlQuery = ["searchType=".concat(searchType), "period=".concat(JSON.stringify({
|
|
153
161
|
cycleType: cycleType,
|
|
154
162
|
annualNum: annualNum,
|
|
155
163
|
yqmNum: yqmNum
|
|
156
|
-
})), "rootNode=".concat(JSON.stringify(rootNode)), "level2Selected=".concat(JSON.stringify(level2Selected))].join(
|
|
164
|
+
})), "rootNode=".concat(JSON.stringify(rootNode)), "level2Selected=".concat(JSON.stringify(level2Selected))].join('&');
|
|
157
165
|
var origin = window.location.href.split('#')[0];
|
|
158
166
|
window.location.href = "".concat(origin, "/#okr/map?").concat(urlQuery);
|
|
159
167
|
};
|
|
160
168
|
|
|
161
169
|
var getTitle = function getTitle() {
|
|
162
|
-
if (
|
|
170
|
+
if (relationShip === 1) {
|
|
163
171
|
return /*#__PURE__*/_react["default"].createElement(_userTitle["default"], {
|
|
164
172
|
toUserId: (0, _bsGlobal.getUserInfo)().Id
|
|
165
173
|
});
|
|
166
174
|
}
|
|
167
175
|
|
|
168
|
-
if (
|
|
176
|
+
if (relationShip === 2 || relationShip === 3) {
|
|
169
177
|
return /*#__PURE__*/_react["default"].createElement(_relationTitle["default"], {
|
|
170
178
|
relation: relation
|
|
171
179
|
});
|
|
@@ -197,11 +205,11 @@ function Header(props, ref) {
|
|
|
197
205
|
className: "".concat(_precls.precls, "__header-item")
|
|
198
206
|
}, getTitle())), /*#__PURE__*/_react["default"].createElement("div", {
|
|
199
207
|
className: "".concat(_precls.precls, "__header-right")
|
|
200
|
-
}, departmentId
|
|
208
|
+
}, Number(departmentId) === 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
201
209
|
className: "".concat(_precls.precls, "__header-item")
|
|
202
210
|
}, /*#__PURE__*/_react["default"].createElement(_keywordSearch["default"], {
|
|
203
211
|
onSearch: onSearch
|
|
204
|
-
})),
|
|
212
|
+
})), relationShip !== 2 && relationShip !== 3 &&
|
|
205
213
|
/*#__PURE__*/
|
|
206
214
|
// 我关注的 我参与的 没有创建按钮
|
|
207
215
|
_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -213,7 +221,7 @@ function Header(props, ref) {
|
|
|
213
221
|
className: "".concat(_precls.precls, "__header-item"),
|
|
214
222
|
onClick: gotoOkrMap
|
|
215
223
|
}, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
216
|
-
overlay: (0, _getLocale.getLocale)(
|
|
224
|
+
overlay: (0, _getLocale.getLocale)('OKR_MyO_Text_Alignment'),
|
|
217
225
|
placement: "top"
|
|
218
226
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
219
227
|
className: "".concat(_precls.precls, "__header-icon")
|
|
@@ -221,10 +229,24 @@ function Header(props, ref) {
|
|
|
221
229
|
className: "tu-icon-yangshi-ditu"
|
|
222
230
|
}))))), /*#__PURE__*/_react["default"].createElement(_comments["default"], {
|
|
223
231
|
toUserId: toUserId,
|
|
224
|
-
relation:
|
|
232
|
+
relation: relationShip,
|
|
225
233
|
userInfo: userInfo
|
|
226
234
|
}), /*#__PURE__*/_react["default"].createElement(_filter["default"], {
|
|
227
235
|
onSearch: onSearch
|
|
236
|
+
}), Number(cycleType) !== -1 && relation === "1" && /*#__PURE__*/_react["default"].createElement(_operateRecord["default"], {
|
|
237
|
+
toUserId: toUserId,
|
|
238
|
+
userInfo: userInfo,
|
|
239
|
+
relation: relationShip,
|
|
240
|
+
okrFeedParams: {
|
|
241
|
+
objId: departmentId === undefined ? Number(toUserId || (0, _bsGlobal.getUserInfo)().Id) : Number(departmentId),
|
|
242
|
+
// 人员或部门Id
|
|
243
|
+
objType: departmentId === undefined ? 1 : 2,
|
|
244
|
+
// 1:负责人,2:部门
|
|
245
|
+
cycleType: Number(cycleType),
|
|
246
|
+
// 目标周期:0-自定义,1-年度,2-季度,3-月度
|
|
247
|
+
yqmNum: Number(yqmNum),
|
|
248
|
+
annualNum: Number(annualNum)
|
|
249
|
+
}
|
|
228
250
|
})));
|
|
229
251
|
}
|
|
230
252
|
|