@titaui/pc 1.16.6 → 1.16.8
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/button/index.js +5 -4
- package/lib/components/change-okr-modal/Filter.js +69 -65
- package/lib/components/create-okr-modal/createCycle.js +6 -1
- package/lib/components/edit-kr-wight/EditKrWightModal.js +28 -21
- package/lib/components/okr-excel-create/components/kr-confidence/index.css +18 -0
- package/lib/components/okr-excel-create/components/kr-confidence/index.js +61 -0
- package/lib/components/okr-excel-create/components/kr-weight/index.css +10 -0
- package/lib/components/okr-excel-create/components/kr-weight/index.js +114 -0
- package/lib/components/okr-excel-create/components/okr-align/index.css +49 -0
- package/lib/components/okr-excel-create/components/okr-align/index.js +139 -0
- package/lib/components/okr-excel-create/components/okr-classify/index.css +74 -0
- package/lib/components/okr-excel-create/components/okr-classify/index.js +117 -0
- package/lib/components/okr-excel-create/components/okr-cycle/index.css +40 -0
- package/lib/components/okr-excel-create/components/okr-cycle/index.js +85 -0
- package/lib/components/okr-excel-create/components/okr-name/index.css +48 -0
- package/lib/components/okr-excel-create/components/okr-name/index.js +116 -0
- package/lib/components/okr-excel-create/components/okr-principal/index.css +17 -0
- package/lib/components/okr-excel-create/components/okr-principal/index.js +107 -0
- package/lib/components/okr-excel-create/components/okr-progress/components/kr-progress/index.css +13 -0
- package/lib/components/okr-excel-create/components/okr-progress/components/kr-progress/index.js +46 -0
- package/lib/components/okr-excel-create/components/okr-progress/components/o-progress/index.css +13 -0
- package/lib/components/okr-excel-create/components/okr-progress/components/o-progress/index.js +47 -0
- package/lib/components/okr-excel-create/components/okr-progress/components/okr-progress/index.css +196 -0
- package/lib/components/okr-excel-create/components/okr-progress/components/okr-progress/index.js +319 -0
- package/lib/components/okr-excel-create/components/okr-progress/components/okr-progress/request-api.js +20 -0
- package/lib/components/okr-excel-create/components/okr-progress/components/okr-progress/util.js +134 -0
- package/lib/components/okr-excel-create/components/okr-progress/index.css +25 -0
- package/lib/components/okr-excel-create/components/okr-progress/index.js +90 -0
- package/lib/components/okr-excel-create/components/okr-progress/interface.js +5 -0
- package/lib/components/okr-excel-create/components/okr-type/base-okr-type/confirm/buttonv2.js +108 -0
- package/lib/components/okr-excel-create/components/okr-type/base-okr-type/confirm/confirm.js +166 -0
- package/lib/components/okr-excel-create/components/okr-type/base-okr-type/index.css +20 -0
- package/lib/components/okr-excel-create/components/okr-type/base-okr-type/index.js +76 -0
- package/lib/components/okr-excel-create/components/okr-type/base-okr-type/object-type.js +275 -0
- package/lib/components/okr-excel-create/components/okr-type/index.css +30 -0
- package/lib/components/okr-excel-create/components/okr-type/index.js +196 -0
- package/lib/components/okr-excel-create/components/okr-visibility/index.css +53 -0
- package/lib/components/okr-excel-create/components/okr-visibility/index.js +236 -0
- package/lib/components/okr-excel-create/components-new/kr-confidence/index.css +17 -0
- package/lib/components/okr-excel-create/components-new/kr-confidence/index.js +75 -0
- package/lib/components/okr-excel-create/components-new/kr-weight/index.css +25 -0
- package/lib/components/okr-excel-create/components-new/kr-weight/index.js +233 -0
- package/lib/components/okr-excel-create/components-new/okr-align/index.css +52 -0
- package/lib/components/okr-excel-create/components-new/okr-align/index.js +170 -0
- package/lib/components/okr-excel-create/components-new/okr-classify/index.css +74 -0
- package/lib/components/okr-excel-create/components-new/okr-classify/index.js +126 -0
- package/lib/components/okr-excel-create/components-new/okr-cycle/index.css +48 -0
- package/lib/components/okr-excel-create/components-new/okr-cycle/index.js +80 -0
- package/lib/components/okr-excel-create/components-new/okr-name/index.css +93 -0
- package/lib/components/okr-excel-create/components-new/okr-name/index.js +222 -0
- package/lib/components/okr-excel-create/components-new/okr-principal/index.css +17 -0
- package/lib/components/okr-excel-create/components-new/okr-principal/index.js +116 -0
- package/lib/components/okr-excel-create/components-new/okr-progress/components/kr-progress/index.css +13 -0
- package/lib/components/okr-excel-create/components-new/okr-progress/components/kr-progress/index.js +46 -0
- package/lib/components/okr-excel-create/components-new/okr-progress/components/o-progress/index.css +13 -0
- package/lib/components/okr-excel-create/components-new/okr-progress/components/o-progress/index.js +47 -0
- package/lib/components/okr-excel-create/components-new/okr-progress/components/okr-progress/index.css +196 -0
- package/lib/components/okr-excel-create/components-new/okr-progress/components/okr-progress/index.js +319 -0
- package/lib/components/okr-excel-create/components-new/okr-progress/components/okr-progress/request-api.js +20 -0
- package/lib/components/okr-excel-create/components-new/okr-progress/components/okr-progress/util.js +134 -0
- package/lib/components/okr-excel-create/components-new/okr-progress/index.css +25 -0
- package/lib/components/okr-excel-create/components-new/okr-progress/index.js +90 -0
- package/lib/components/okr-excel-create/components-new/okr-progress/interface.js +5 -0
- package/lib/components/okr-excel-create/components-new/okr-type/base-okr-type/confirm/buttonv2.js +108 -0
- package/lib/components/okr-excel-create/components-new/okr-type/base-okr-type/confirm/confirm.js +166 -0
- package/lib/components/okr-excel-create/components-new/okr-type/base-okr-type/index.css +20 -0
- package/lib/components/okr-excel-create/components-new/okr-type/base-okr-type/index.js +76 -0
- package/lib/components/okr-excel-create/components-new/okr-type/base-okr-type/object-type.js +275 -0
- package/lib/components/okr-excel-create/components-new/okr-type/index.css +30 -0
- package/lib/components/okr-excel-create/components-new/okr-type/index.js +205 -0
- package/lib/components/okr-excel-create/components-new/okr-visibility/index.css +53 -0
- package/lib/components/okr-excel-create/components-new/okr-visibility/index.js +252 -0
- package/lib/components/okr-excel-create/constant.js +14 -0
- package/lib/components/okr-excel-create/hooks.js +314 -0
- package/lib/components/okr-excel-create/img/base-info-add.svg +19 -0
- package/lib/components/okr-excel-create/img/desire.svg +61 -0
- package/lib/components/okr-excel-create/img/promise.svg +61 -0
- package/lib/components/okr-excel-create/index-old.js +258 -0
- package/lib/components/okr-excel-create/index.css +73 -0
- package/lib/components/okr-excel-create/index.js +357 -0
- package/lib/components/okr-excel-create/mock.js +169 -0
- package/lib/components/okr-excel-create/setting.js +24 -0
- package/lib/components/okr-excel-create/type.js +5 -0
- package/lib/components/okr-excel-create/utils.js +190 -0
- package/lib/components/okr-guide/index.css +15 -17
- package/lib/components/okr-guide/index.js +3 -1
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +10 -6
- package/lib/components/operation-records/OperationRecordItem.js +7 -3
- package/lib/components/popup-select/index.css +10 -0
- package/lib/components/popup-select/index.js +8 -2
- package/lib/components/table-excel-v2/index.css +93 -0
- package/lib/components/table-excel-v2/index.js +505 -0
- package/lib/components/table-excel-v2/utils.js +22 -0
- package/lib/index.js +8 -0
- package/lib/pages/new-okr-list/header/index.js +103 -13
- package/lib/pages/new-okr-list/header/operate-record.js +9 -49
- package/lib/utils/array.js +26 -0
- package/package.json +1 -1
|
@@ -0,0 +1,357 @@
|
|
|
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 _hooks = require("./hooks");
|
|
13
|
+
|
|
14
|
+
var _utils = require("./utils");
|
|
15
|
+
|
|
16
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
17
|
+
|
|
18
|
+
var _krWeight = _interopRequireDefault(require("./components-new/kr-weight"));
|
|
19
|
+
|
|
20
|
+
var _okrAlign = _interopRequireDefault(require("./components-new/okr-align"));
|
|
21
|
+
|
|
22
|
+
var _okrCycle = _interopRequireDefault(require("./components-new/okr-cycle"));
|
|
23
|
+
|
|
24
|
+
var _okrPrincipal = _interopRequireDefault(require("./components-new/okr-principal"));
|
|
25
|
+
|
|
26
|
+
var _krConfidence = _interopRequireDefault(require("./components-new/kr-confidence"));
|
|
27
|
+
|
|
28
|
+
var _okrClassify = _interopRequireDefault(require("./components-new/okr-classify"));
|
|
29
|
+
|
|
30
|
+
var _okrType = _interopRequireDefault(require("./components-new/okr-type"));
|
|
31
|
+
|
|
32
|
+
var _okrVisibility = _interopRequireDefault(require("./components-new/okr-visibility"));
|
|
33
|
+
|
|
34
|
+
var _okrName = _interopRequireDefault(require("./components-new/okr-name"));
|
|
35
|
+
|
|
36
|
+
var _tableExcelV = _interopRequireDefault(require("../table-excel-v2"));
|
|
37
|
+
|
|
38
|
+
var _getLocale = require("../../utils/getLocale");
|
|
39
|
+
|
|
40
|
+
var _hooks2 = _interopRequireDefault(require("../../utils/hooks"));
|
|
41
|
+
|
|
42
|
+
require("./index.css");
|
|
43
|
+
|
|
44
|
+
var _setting = require("./setting");
|
|
45
|
+
|
|
46
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
47
|
+
|
|
48
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
49
|
+
|
|
50
|
+
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); }
|
|
51
|
+
|
|
52
|
+
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; }
|
|
53
|
+
|
|
54
|
+
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; }
|
|
55
|
+
|
|
56
|
+
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; }
|
|
57
|
+
|
|
58
|
+
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; }
|
|
59
|
+
|
|
60
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
61
|
+
|
|
62
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
63
|
+
|
|
64
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
65
|
+
|
|
66
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
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 preCls = 'tita-okr-excel-create';
|
|
81
|
+
|
|
82
|
+
var getIitDatas = function getIitDatas(props) {
|
|
83
|
+
return [(0, _utils.getIitData)(props), (0, _utils.getIitData)(props), (0, _utils.getIitData)(props)];
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
function filterRemoveItem(data) {
|
|
87
|
+
return data.filter(function (_ref) {
|
|
88
|
+
var isDelete = _ref.isDelete;
|
|
89
|
+
return !isDelete;
|
|
90
|
+
}).map(function (item) {
|
|
91
|
+
item.krs = item.krs.filter(function (_ref2) {
|
|
92
|
+
var isDelete = _ref2.isDelete;
|
|
93
|
+
return !isDelete;
|
|
94
|
+
});
|
|
95
|
+
return item;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
var OKRExcelCreate = function OKRExcelCreate(_ref3) {
|
|
100
|
+
var _ref3$className = _ref3.className,
|
|
101
|
+
className = _ref3$className === void 0 ? '' : _ref3$className,
|
|
102
|
+
_ref3$tableClassName = _ref3.tableClassName,
|
|
103
|
+
tableClassName = _ref3$tableClassName === void 0 ? '' : _ref3$tableClassName,
|
|
104
|
+
okrData = _ref3.okrData,
|
|
105
|
+
onChange = _ref3.onChange;
|
|
106
|
+
|
|
107
|
+
var _useState = (0, _react.useState)({}),
|
|
108
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
109
|
+
dicData = _useState2[0],
|
|
110
|
+
setDicData = _useState2[1];
|
|
111
|
+
|
|
112
|
+
(0, _react.useEffect)(function () {
|
|
113
|
+
setDicData((0, _hooks.dic)());
|
|
114
|
+
}, []);
|
|
115
|
+
var annualNum = (0, _hooks2["default"])('annualNum');
|
|
116
|
+
var cycleType = (0, _hooks2["default"])('cycleType');
|
|
117
|
+
var yqmNum = (0, _hooks2["default"])('yqmNum');
|
|
118
|
+
var cycleData = cycleType !== '-1' && {
|
|
119
|
+
annualNum: annualNum,
|
|
120
|
+
cycleType: cycleType,
|
|
121
|
+
yqmNum: yqmNum
|
|
122
|
+
} || {
|
|
123
|
+
annualNum: "".concat(new Date().getFullYear()),
|
|
124
|
+
cycleType: '2',
|
|
125
|
+
yqmNum: "".concat((0, _moment["default"])().quarter())
|
|
126
|
+
};
|
|
127
|
+
var data = (0, _react.useRef)(okrData && okrData.length ? okrData : getIitDatas(cycleData));
|
|
128
|
+
|
|
129
|
+
var _useState3 = (0, _react.useState)((0, _utils.formatDataToOKRExcelTableData)(data.current)),
|
|
130
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
131
|
+
excelTableData = _useState4[0],
|
|
132
|
+
setExcelTableData = _useState4[1];
|
|
133
|
+
|
|
134
|
+
var _useState5 = (0, _react.useState)(false),
|
|
135
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
136
|
+
isMax = _useState6[0],
|
|
137
|
+
setIsMax = _useState6[1];
|
|
138
|
+
|
|
139
|
+
var _useState7 = (0, _react.useState)(data.current.length <= 1),
|
|
140
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
141
|
+
hiddenRemoveIcon = _useState8[0],
|
|
142
|
+
setHiddenRemoveIcon = _useState8[1];
|
|
143
|
+
|
|
144
|
+
var update = (0, _react.useCallback)(function (_ref4) {
|
|
145
|
+
var type = _ref4.type,
|
|
146
|
+
rowIdx = _ref4.rowIdx,
|
|
147
|
+
rootIdx = _ref4.rootIdx,
|
|
148
|
+
itemData = _ref4.itemData,
|
|
149
|
+
uuid = _ref4.uuid,
|
|
150
|
+
rootUuid = _ref4.rootUuid;
|
|
151
|
+
|
|
152
|
+
if (type === 'update') {
|
|
153
|
+
itemData.krs = _toConsumableArray(itemData.krs);
|
|
154
|
+
var index = data.current.findIndex(function (item) {
|
|
155
|
+
return item.uuid === itemData.uuid;
|
|
156
|
+
});
|
|
157
|
+
data.current[index] = itemData;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (type === 'removeO') {
|
|
161
|
+
var _index = data.current.findIndex(function (item) {
|
|
162
|
+
return item.uuid === uuid;
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
if (data.current[_index].isSaved) {
|
|
166
|
+
data.current[_index].isDelete = true;
|
|
167
|
+
} else {
|
|
168
|
+
data.current.splice(_index, 1);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
setIsMax(data.current.length >= 50); // 如果只剩最后一个了则隐藏删除按钮
|
|
172
|
+
|
|
173
|
+
var effectiveKrs = data.current.filter(function (_ref5) {
|
|
174
|
+
var isDelete = _ref5.isDelete;
|
|
175
|
+
return !isDelete;
|
|
176
|
+
});
|
|
177
|
+
setHiddenRemoveIcon(effectiveKrs.length <= 1);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (type === 'removeKr') {
|
|
181
|
+
var rootIndex = data.current.findIndex(function (item) {
|
|
182
|
+
return item.uuid === rootUuid;
|
|
183
|
+
});
|
|
184
|
+
var krIndex = data.current[rootIndex].krs.findIndex(function (item) {
|
|
185
|
+
return item.uuid === uuid;
|
|
186
|
+
}); // 重新计算最后一个 kr 的权重
|
|
187
|
+
|
|
188
|
+
var _effectiveKrs = data.current[rootIndex].krs.filter(function (_ref6) {
|
|
189
|
+
var isDelete = _ref6.isDelete;
|
|
190
|
+
return !isDelete;
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
var averageWeight = parseFloat((100 / _effectiveKrs.length).toFixed(1));
|
|
194
|
+
data.current[rootIndex].krs.splice(krIndex, 1); // 是否是均分的
|
|
195
|
+
|
|
196
|
+
var isAverage = _effectiveKrs.findIndex(function (item) {
|
|
197
|
+
return item.krWeight !== averageWeight;
|
|
198
|
+
}) === -1;
|
|
199
|
+
|
|
200
|
+
if (isAverage) {
|
|
201
|
+
data.current[rootIndex].krs = data.current[rootIndex].krs.map(function (item) {
|
|
202
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
203
|
+
krWeight: parseFloat((100 / (_effectiveKrs.length - 1)).toFixed(1))
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
} else {
|
|
207
|
+
var newEffectiveKrs = data.current[rootIndex].krs.filter(function (_ref7) {
|
|
208
|
+
var isDelete = _ref7.isDelete;
|
|
209
|
+
return !isDelete;
|
|
210
|
+
});
|
|
211
|
+
var totalWeight = newEffectiveKrs.slice(0, newEffectiveKrs.length - 1).reduce(function (pre, cur) {
|
|
212
|
+
return pre + cur.krWeight;
|
|
213
|
+
}, 0);
|
|
214
|
+
newEffectiveKrs[newEffectiveKrs.length - 1].krWeight = parseFloat((100 - totalWeight).toFixed(1));
|
|
215
|
+
data.current[rootIndex].krs = data.current[rootIndex].krs.map(function (item) {
|
|
216
|
+
return _objectSpread({}, item);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (onChange) onChange(data.current.map(function (item) {
|
|
222
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
223
|
+
childs: null
|
|
224
|
+
});
|
|
225
|
+
}));
|
|
226
|
+
setExcelTableData(filterRemoveItem(data.current));
|
|
227
|
+
}, []);
|
|
228
|
+
var columnsOption = (0, _react.useMemo)(function () {
|
|
229
|
+
return [{
|
|
230
|
+
title: dicData['目标(O)'],
|
|
231
|
+
dataIndex: 'name',
|
|
232
|
+
key: 'name',
|
|
233
|
+
width: 400,
|
|
234
|
+
render: (0, _okrName["default"])(update, true)
|
|
235
|
+
}, {
|
|
236
|
+
title: dicData['目标类型'],
|
|
237
|
+
dataIndex: 'okrType',
|
|
238
|
+
key: 'okrType',
|
|
239
|
+
width: 100,
|
|
240
|
+
hidden: !_setting.showKrType,
|
|
241
|
+
render: (0, _okrType["default"])(update)
|
|
242
|
+
}, {
|
|
243
|
+
title: dicData['目标类别'],
|
|
244
|
+
dataIndex: 'okrClassify',
|
|
245
|
+
key: 'okrClassify',
|
|
246
|
+
width: 120,
|
|
247
|
+
hidden: !_setting.showKrClassify,
|
|
248
|
+
render: (0, _okrClassify["default"])(update)
|
|
249
|
+
}, {
|
|
250
|
+
title: dicData['目标周期'],
|
|
251
|
+
dataIndex: 'cycle',
|
|
252
|
+
key: 'cycle',
|
|
253
|
+
width: 200,
|
|
254
|
+
render: (0, _okrCycle["default"])(update)
|
|
255
|
+
}, {
|
|
256
|
+
title: dicData['对齐目标'],
|
|
257
|
+
dataIndex: 'parentOKR.principalUser.name',
|
|
258
|
+
key: 'parentOKR.principalUser.name',
|
|
259
|
+
width: 300,
|
|
260
|
+
render: (0, _okrAlign["default"])(update)
|
|
261
|
+
}, {
|
|
262
|
+
title: dicData['目标负责人'],
|
|
263
|
+
dataIndex: 'principalUser.name',
|
|
264
|
+
key: 'principalUser.name',
|
|
265
|
+
width: 100,
|
|
266
|
+
render: (0, _okrPrincipal["default"])(update, true)
|
|
267
|
+
}, {
|
|
268
|
+
title: dicData['可见范围'],
|
|
269
|
+
dataIndex: 'visibility',
|
|
270
|
+
key: 'visibility',
|
|
271
|
+
width: 150,
|
|
272
|
+
render: (0, _okrVisibility["default"])(update)
|
|
273
|
+
}, {
|
|
274
|
+
title: dicData['关键成果(KR)'],
|
|
275
|
+
dataIndex: 'name',
|
|
276
|
+
key: 'kr.name',
|
|
277
|
+
width: 400,
|
|
278
|
+
level: 2,
|
|
279
|
+
render: (0, _okrName["default"])(update, false)
|
|
280
|
+
}, {
|
|
281
|
+
title: dicData['KR 负责人'],
|
|
282
|
+
dataIndex: 'user.name',
|
|
283
|
+
key: 'kr.user.name',
|
|
284
|
+
width: 160,
|
|
285
|
+
level: 2,
|
|
286
|
+
render: (0, _okrPrincipal["default"])(update, false)
|
|
287
|
+
}, {
|
|
288
|
+
title: dicData['KR 权重'],
|
|
289
|
+
dataIndex: 'krWeight',
|
|
290
|
+
key: 'krWeight',
|
|
291
|
+
width: 160,
|
|
292
|
+
align: 'center',
|
|
293
|
+
level: 2,
|
|
294
|
+
renderFill: true,
|
|
295
|
+
hidden: !_setting.showKrWeight,
|
|
296
|
+
render: (0, _krWeight["default"])(update)
|
|
297
|
+
}, {
|
|
298
|
+
title: dicData['信心指数'],
|
|
299
|
+
dataIndex: 'confidenceIndex',
|
|
300
|
+
key: 'confidenceIndex',
|
|
301
|
+
width: 160,
|
|
302
|
+
align: 'center',
|
|
303
|
+
level: 2,
|
|
304
|
+
hidden: !_setting.showKrConfidence,
|
|
305
|
+
render: (0, _krConfidence["default"])(update)
|
|
306
|
+
}];
|
|
307
|
+
}, [dicData]);
|
|
308
|
+
|
|
309
|
+
var onAddOHandler = function onAddOHandler() {
|
|
310
|
+
if (isMax) return;
|
|
311
|
+
data.current.push((0, _utils.getIitData)(cycleData));
|
|
312
|
+
setExcelTableData(filterRemoveItem(data.current));
|
|
313
|
+
if (onChange) onChange(data.current.map(function (item) {
|
|
314
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
315
|
+
childs: null
|
|
316
|
+
});
|
|
317
|
+
}));
|
|
318
|
+
setIsMax(data.current.length >= 50); // 如果只剩最后一个了则隐藏删除按钮
|
|
319
|
+
|
|
320
|
+
var effectiveKrs = data.current.filter(function (_ref8) {
|
|
321
|
+
var isDelete = _ref8.isDelete;
|
|
322
|
+
return !isDelete;
|
|
323
|
+
});
|
|
324
|
+
setHiddenRemoveIcon(effectiveKrs.length <= 1);
|
|
325
|
+
}; // {/* <PopupSelect
|
|
326
|
+
// menuData={columnCtlData}
|
|
327
|
+
// popupPlacement="bottomLeft"
|
|
328
|
+
// action="click"
|
|
329
|
+
// mode="checkbox"
|
|
330
|
+
// height={292}
|
|
331
|
+
// onChange={onColumnsHideOrShow}
|
|
332
|
+
// autoClose={false}
|
|
333
|
+
// >
|
|
334
|
+
// <div className={`${preCls}__column-ctl`}>
|
|
335
|
+
// <span className="tu-icon-APP-shezhi" />
|
|
336
|
+
// </div>
|
|
337
|
+
// </PopupSelect> */}
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
console.log('hiddenRemoveIcon', hiddenRemoveIcon);
|
|
341
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
342
|
+
className: "".concat(className)
|
|
343
|
+
}, /*#__PURE__*/_react["default"].createElement(_tableExcelV["default"], {
|
|
344
|
+
className: (0, _classnames["default"])("".concat(preCls, "__table-excel-v2 ").concat(tableClassName), _defineProperty({}, "".concat(preCls, "--disabled-remove"), hiddenRemoveIcon)),
|
|
345
|
+
rowKey: "uuid",
|
|
346
|
+
columns: columnsOption,
|
|
347
|
+
dataSource: excelTableData
|
|
348
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
349
|
+
onClick: onAddOHandler,
|
|
350
|
+
className: "".concat(preCls, "__add-o")
|
|
351
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
352
|
+
className: "tu-icon-add1"
|
|
353
|
+
}), /*#__PURE__*/_react["default"].createElement("p", null, (0, _getLocale.getLocale)(isMax ? 'OKR_ComAll_Supports50' : 'OKR_ComAll_AddObjective'))));
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
var _default = OKRExcelCreate;
|
|
357
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.mockData = void 0;
|
|
7
|
+
var mockData = [{
|
|
8
|
+
uuid: '33391cd2-1fbf-4ebd-9231-62efcb9a6957',
|
|
9
|
+
workId: 0,
|
|
10
|
+
workName: '111',
|
|
11
|
+
workNameRichText: '{"doc":{"type":"doc","content":[{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"111"}]}]},"selection":{"type":"text","anchor":4,"head":4}}',
|
|
12
|
+
visibility: 2,
|
|
13
|
+
departmentId: 0,
|
|
14
|
+
departmentName: '默认部门',
|
|
15
|
+
groupId: 0,
|
|
16
|
+
groupName: '',
|
|
17
|
+
krs: [{
|
|
18
|
+
uuid: 'a5a9731f-3cbf-4ccf-bde6-6d194e69dc30',
|
|
19
|
+
mileStoneId: 0,
|
|
20
|
+
feedId: '',
|
|
21
|
+
workId: 0,
|
|
22
|
+
mileStoneName: '',
|
|
23
|
+
mileStoneNameRichText: '',
|
|
24
|
+
aiteUsers: [],
|
|
25
|
+
mileStoneDescription: '',
|
|
26
|
+
principalId: 0,
|
|
27
|
+
createUserId: 300000008,
|
|
28
|
+
startDate: '',
|
|
29
|
+
endDate: '',
|
|
30
|
+
lastUpdatedDate: '',
|
|
31
|
+
user: {
|
|
32
|
+
userId: 300000008,
|
|
33
|
+
userType: 0,
|
|
34
|
+
name: 'zh',
|
|
35
|
+
email: 'c71a458d-2c4d-4ac0-9a16-e23c38aa880b_220513_133529@virtual.account',
|
|
36
|
+
managerId: 0,
|
|
37
|
+
jobState: 0,
|
|
38
|
+
departmentId: 0,
|
|
39
|
+
departmentName: '默认部门',
|
|
40
|
+
postition: null,
|
|
41
|
+
subType: 0,
|
|
42
|
+
hasSubordinates: true,
|
|
43
|
+
avatar: {
|
|
44
|
+
Original: '//st-web.tita.com/titacn/tita/common/images/default_man.jpg',
|
|
45
|
+
original: '//st-web.tita.com/titacn/tita/common/images/default_man.jpg',
|
|
46
|
+
Small: '//st-web.tita.com/titacn/tita/common/images/default_man_small.jpg',
|
|
47
|
+
small: '//st-web.tita.com/titacn/tita/common/images/default_man_small.jpg',
|
|
48
|
+
Medium: '//st-web.tita.com/titacn/tita/common/images/default_man_middle.jpg',
|
|
49
|
+
medium: '//st-web.tita.com/titacn/tita/common/images/default_man_middle.jpg',
|
|
50
|
+
Big: '',
|
|
51
|
+
Large: '',
|
|
52
|
+
Normal: '',
|
|
53
|
+
HasAvatar: false,
|
|
54
|
+
hasAvatar: false,
|
|
55
|
+
Color: '#79c7b7',
|
|
56
|
+
color: '#79c7b7'
|
|
57
|
+
},
|
|
58
|
+
staffCode: ''
|
|
59
|
+
},
|
|
60
|
+
counter: {
|
|
61
|
+
taskTotal: 0,
|
|
62
|
+
finishTaskTotal: 0,
|
|
63
|
+
workTotal: 0,
|
|
64
|
+
finishWrokTotal: 0,
|
|
65
|
+
eTotal: 0,
|
|
66
|
+
finishETotal: 0,
|
|
67
|
+
subWorkTotal: 0
|
|
68
|
+
},
|
|
69
|
+
departments: '',
|
|
70
|
+
status: 1,
|
|
71
|
+
remainingDays: 0,
|
|
72
|
+
progress: 0,
|
|
73
|
+
progressGrow: 0,
|
|
74
|
+
riskLevel: 0,
|
|
75
|
+
remainingContent: '',
|
|
76
|
+
progressDescription: '',
|
|
77
|
+
editable: false,
|
|
78
|
+
evaluateEditable: true,
|
|
79
|
+
krWeightEditable: false,
|
|
80
|
+
confidenceIndex: 7,
|
|
81
|
+
evaluateValue: 0,
|
|
82
|
+
remark: '',
|
|
83
|
+
confidenceIndexGrow: 0,
|
|
84
|
+
isEvaluate: false,
|
|
85
|
+
krWeight: '40.0',
|
|
86
|
+
okrInfo: '',
|
|
87
|
+
tasks: null,
|
|
88
|
+
mapkrVisible: true,
|
|
89
|
+
CreateDate: '2022/3/14 16:16:36',
|
|
90
|
+
SortNum: 0,
|
|
91
|
+
UpdateProgressWay: 0,
|
|
92
|
+
progressDescriptionDate: null,
|
|
93
|
+
applyState: 0,
|
|
94
|
+
krApprovalType: '',
|
|
95
|
+
KrApprovalTypes: [],
|
|
96
|
+
workName: '1',
|
|
97
|
+
workNameRichText: '{"doc":{"type":"doc","content":[{"type":"paragraph","attrs":{"textAlign":"left"},"content":[{"type":"text","text":"1"}]}]},"selection":{"type":"text","anchor":2,"head":2}}',
|
|
98
|
+
principalUser: {
|
|
99
|
+
userId: 300000009,
|
|
100
|
+
userType: 0,
|
|
101
|
+
name: 'lzz',
|
|
102
|
+
email: 'aa2b217b-5403-4ead-bef1-25bed50944f1_220513_133735@virtual.account',
|
|
103
|
+
managerId: 300000008,
|
|
104
|
+
jobState: 1,
|
|
105
|
+
departmentId: -1,
|
|
106
|
+
departmentName: '默认部门',
|
|
107
|
+
postition: null,
|
|
108
|
+
subType: 0,
|
|
109
|
+
hasSubordinates: false,
|
|
110
|
+
avatar: {
|
|
111
|
+
original: null,
|
|
112
|
+
small: null,
|
|
113
|
+
medium: null,
|
|
114
|
+
big: null,
|
|
115
|
+
normal: null,
|
|
116
|
+
large: null,
|
|
117
|
+
hasAvatar: false,
|
|
118
|
+
color: '#f5b168'
|
|
119
|
+
},
|
|
120
|
+
staffCode: null
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
'0': '5',
|
|
124
|
+
'1': '0',
|
|
125
|
+
'2': '.',
|
|
126
|
+
'3': '0',
|
|
127
|
+
krWeight: '60.0'
|
|
128
|
+
}],
|
|
129
|
+
okrClassify: '1',
|
|
130
|
+
cycleType: -1,
|
|
131
|
+
yqmNum: 1,
|
|
132
|
+
parentId: 0,
|
|
133
|
+
parentKrId: 0,
|
|
134
|
+
annualNum: 2022,
|
|
135
|
+
hasSub: false,
|
|
136
|
+
okrType: 3,
|
|
137
|
+
createUserId: 300000008,
|
|
138
|
+
principalUser: {
|
|
139
|
+
userId: 300000009,
|
|
140
|
+
userType: 0,
|
|
141
|
+
name: 'lzz',
|
|
142
|
+
email: 'aa2b217b-5403-4ead-bef1-25bed50944f1_220513_133735@virtual.account',
|
|
143
|
+
managerId: 300000008,
|
|
144
|
+
jobState: 1,
|
|
145
|
+
departmentId: -1,
|
|
146
|
+
departmentName: '默认部门',
|
|
147
|
+
postition: null,
|
|
148
|
+
subType: 0,
|
|
149
|
+
hasSubordinates: false,
|
|
150
|
+
avatar: {
|
|
151
|
+
original: null,
|
|
152
|
+
small: null,
|
|
153
|
+
medium: null,
|
|
154
|
+
big: null,
|
|
155
|
+
normal: null,
|
|
156
|
+
large: null,
|
|
157
|
+
hasAvatar: false,
|
|
158
|
+
color: '#f5b168'
|
|
159
|
+
},
|
|
160
|
+
staffCode: null
|
|
161
|
+
},
|
|
162
|
+
parentPrincipal: null,
|
|
163
|
+
isShowApprovalOpinion: false,
|
|
164
|
+
childs: null,
|
|
165
|
+
parentWorkId: 10832,
|
|
166
|
+
parentWorkName: ' 测试OKR转交负责人2',
|
|
167
|
+
parentType: 1
|
|
168
|
+
}];
|
|
169
|
+
exports.mockData = mockData;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.showKrWeight = exports.showKrType = exports.showKrProgress = exports.showKrConfidence = exports.showKrClassify = void 0;
|
|
7
|
+
|
|
8
|
+
var _config = require("../okr-flow/utils/config");
|
|
9
|
+
|
|
10
|
+
var showKrConfidence = (0, _config.getBSGlobal)('OkrAdvancedSetting').KRSetting.ShowKrConfidence; // 信心指数开关
|
|
11
|
+
|
|
12
|
+
exports.showKrConfidence = showKrConfidence;
|
|
13
|
+
var showKrProgress = (0, _config.getBSGlobal)('OkrAdvancedSetting').KRSetting.ShowKrProgress; // KR进展开关
|
|
14
|
+
|
|
15
|
+
exports.showKrProgress = showKrProgress;
|
|
16
|
+
var showKrWeight = (0, _config.getBSGlobal)('OkrAdvancedSetting').KRSetting.KrWeight; // KR权重开关
|
|
17
|
+
|
|
18
|
+
exports.showKrWeight = showKrWeight;
|
|
19
|
+
var showKrClassify = (0, _config.getBSGlobal)('OkrAdvancedSetting').KRSetting.OkrClassify; // 目标类别
|
|
20
|
+
|
|
21
|
+
exports.showKrClassify = showKrClassify;
|
|
22
|
+
var showKrType = (0, _config.getBSGlobal)('OkrAdvancedSetting').KRSetting.OkrTypeSetting; // 目标类型
|
|
23
|
+
|
|
24
|
+
exports.showKrType = showKrType;
|