@titaui/pc 1.12.17-beta.8 → 1.12.17-beta.9
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/color-date-picker/index.css +1 -2
- package/lib/components/dynamic/dynamic-item/components/summary-header/index.js +12 -20
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/evalute/index.js +3 -2
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.js +28 -28
- package/lib/components/import-modal/search/relation.js +13 -4
- package/lib/components/import-modal/tree/okr-tree/search-form.js +8 -8
- package/lib/components/menus/export-modules/summary-menus/depart-menus/index.js +23 -26
- package/package.json +2 -2
|
@@ -79,14 +79,12 @@ var DynamicItemHeader = function DynamicItemHeader(_ref) {
|
|
|
79
79
|
desc = _ref$desc === void 0 ? "" : _ref$desc,
|
|
80
80
|
user = _ref.user,
|
|
81
81
|
_ref$suffixContent = _ref.suffixContent,
|
|
82
|
-
suffixContent = _ref$suffixContent === void 0 ? "" : _ref$suffixContent
|
|
82
|
+
suffixContent = _ref$suffixContent === void 0 ? "" : _ref$suffixContent,
|
|
83
|
+
canEvaluate = _ref.canEvaluate;
|
|
83
84
|
var createDate = data.createDate,
|
|
84
85
|
feedId = data.feedId,
|
|
85
86
|
_data$isCollect = data.isCollect,
|
|
86
87
|
isCollect = _data$isCollect === void 0 ? false : _data$isCollect,
|
|
87
|
-
feedType = data.feedType,
|
|
88
|
-
newSummary = data.newSummary,
|
|
89
|
-
canEvaluate = data.canEvaluate,
|
|
90
88
|
dailyContent = data.dailyContent,
|
|
91
89
|
dailyDate = data.dailyDate,
|
|
92
90
|
reportType = data.reportType;
|
|
@@ -179,21 +177,15 @@ var DynamicItemHeader = function DynamicItemHeader(_ref) {
|
|
|
179
177
|
};
|
|
180
178
|
|
|
181
179
|
var enSureDeleteDynamic = function enSureDeleteDynamic() {
|
|
182
|
-
(
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
_toast["default"].Success((0, _getLocale.getLocale)("Pro_detail_Deletsuccess"), {
|
|
187
|
-
canClose: false
|
|
188
|
-
});
|
|
180
|
+
// deleteDynamic({ feedId }).then((resp) => {
|
|
181
|
+
// if (resp.Code === 1) {
|
|
182
|
+
// Toast.Success(getLocale("Pro_detail_Deletsuccess"), { canClose: false });
|
|
183
|
+
setShowDialogConfirm(false);
|
|
189
184
|
|
|
190
|
-
|
|
185
|
+
if (onDeleteFeed) {
|
|
186
|
+
onDeleteFeed(feedId);
|
|
187
|
+
} // });
|
|
191
188
|
|
|
192
|
-
if (onDeleteFeed) {
|
|
193
|
-
onDeleteFeed(feedId);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
189
|
};
|
|
198
190
|
|
|
199
191
|
var cancelDeleteDynamic = function cancelDeleteDynamic() {
|
|
@@ -227,9 +219,9 @@ var DynamicItemHeader = function DynamicItemHeader(_ref) {
|
|
|
227
219
|
type: "warning"
|
|
228
220
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
229
221
|
type: "title"
|
|
230
|
-
}, (0, _getLocale.getLocale)(
|
|
222
|
+
}, (0, _getLocale.getLocale)("OKR_MyO_Pleasenote")), /*#__PURE__*/_react["default"].createElement("span", {
|
|
231
223
|
type: "content"
|
|
232
|
-
}, (0, _getLocale.getLocale)(
|
|
224
|
+
}, (0, _getLocale.getLocale)("Mod_cannotberecovered")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.CancelButton, {
|
|
233
225
|
type: "button",
|
|
234
226
|
onClick: cancelDeleteDynamic
|
|
235
227
|
}, (0, _getLocale.getLocale)("Mod_Cancel")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.WarningButton, {
|
|
@@ -286,7 +278,7 @@ var DynamicItemHeader = function DynamicItemHeader(_ref) {
|
|
|
286
278
|
name: user.name,
|
|
287
279
|
id: user.userId
|
|
288
280
|
})
|
|
289
|
-
})), desc, suffixContent), canEvaluate &&
|
|
281
|
+
})), desc, suffixContent), canEvaluate && /*#__PURE__*/_react["default"].createElement("div", {
|
|
290
282
|
className: "".concat(prefix, "__evalute"),
|
|
291
283
|
onClick: handleClickEvaluate
|
|
292
284
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
@@ -98,7 +98,8 @@ var getRemarkTypeList = function getRemarkTypeList() {
|
|
|
98
98
|
var EvaluteCard = function EvaluteCard(props) {
|
|
99
99
|
var evaluation = props.evaluation,
|
|
100
100
|
feedId = props.feedId,
|
|
101
|
-
publishUser = props.publishUser
|
|
101
|
+
publishUser = props.publishUser,
|
|
102
|
+
canEvaluate = props.canEvaluate;
|
|
102
103
|
var value = evaluation.value,
|
|
103
104
|
type = evaluation.type,
|
|
104
105
|
remark = evaluation.remark,
|
|
@@ -182,7 +183,7 @@ var EvaluteCard = function EvaluteCard(props) {
|
|
|
182
183
|
className: "".concat(preCls, "__bgc-img"),
|
|
183
184
|
alt: ""
|
|
184
185
|
});
|
|
185
|
-
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
186
|
+
}), canEvaluate && /*#__PURE__*/_react["default"].createElement("div", {
|
|
186
187
|
className: "".concat(preCls, "__evalute")
|
|
187
188
|
}, type === 1 && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("img", {
|
|
188
189
|
src: _veryGoodWrite["default"],
|
|
@@ -69,14 +69,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
69
69
|
|
|
70
70
|
var getEReportType = function getEReportType(type) {
|
|
71
71
|
var reportTextMap = {
|
|
72
|
-
8: (0, _getLocale.getLocale)(
|
|
73
|
-
26: (0, _getLocale.getLocale)(
|
|
74
|
-
27: (0, _getLocale.getLocale)(
|
|
72
|
+
8: (0, _getLocale.getLocale)("Rep_Tab_Dailynewspaper"),
|
|
73
|
+
26: (0, _getLocale.getLocale)("Rep_Tab_Weeklynewspaper"),
|
|
74
|
+
27: (0, _getLocale.getLocale)("Rep_Tab_MonthlyReport")
|
|
75
75
|
};
|
|
76
76
|
return reportTextMap[type];
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
var prefix =
|
|
79
|
+
var prefix = "titaui-dynamic-new-report-item";
|
|
80
80
|
|
|
81
81
|
var DynamicReply = function DynamicReply(_ref) {
|
|
82
82
|
var data = _ref.data,
|
|
@@ -90,10 +90,11 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
90
90
|
dailyContent = data.dailyContent,
|
|
91
91
|
atUsers = data.atUsers,
|
|
92
92
|
attachments = data.attachments,
|
|
93
|
-
evaluates = data.evaluates
|
|
93
|
+
evaluates = data.evaluates,
|
|
94
|
+
canEvaluate = data.canEvaluate;
|
|
94
95
|
var files = (0, _util.formatAttachments)(attachments);
|
|
95
96
|
|
|
96
|
-
var _useState = (0, _react.useState)(
|
|
97
|
+
var _useState = (0, _react.useState)(""),
|
|
97
98
|
_useState2 = _slicedToArray(_useState, 2),
|
|
98
99
|
mindImg = _useState2[0],
|
|
99
100
|
setMindImg = _useState2[1];
|
|
@@ -108,12 +109,12 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
108
109
|
taskTableData = _useState6[0],
|
|
109
110
|
setTasktableData = _useState6[1];
|
|
110
111
|
|
|
111
|
-
var _useState7 = (0, _react.useState)(
|
|
112
|
+
var _useState7 = (0, _react.useState)(""),
|
|
112
113
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
113
114
|
okrTableTitle = _useState8[0],
|
|
114
115
|
setOkrtableTitle = _useState8[1];
|
|
115
116
|
|
|
116
|
-
var _useState9 = (0, _react.useState)(
|
|
117
|
+
var _useState9 = (0, _react.useState)(""),
|
|
117
118
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
118
119
|
taskTableTitle = _useState10[0],
|
|
119
120
|
setTasktableTitle = _useState10[1];
|
|
@@ -136,13 +137,13 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
136
137
|
className: (0, _classnames["default"])("".concat(prefix, "__complete-type"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "__complete-type--normal"), submitState === 1), _defineProperty(_classNames, "".concat(prefix, "__complete-type--delay"), submitState === 2), _classNames))
|
|
137
138
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
138
139
|
className: (0, _classnames["default"])("".concat(prefix, "__complete-type-icon"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefix, "__complete-type-icon--normal"), submitState === 1), _defineProperty(_classNames2, "".concat(prefix, "__complete-type-icon--delay"), submitState === 2), _classNames2))
|
|
139
|
-
}), submitState === 1 && (0, _getLocale.getLocale)(
|
|
140
|
+
}), submitState === 1 && (0, _getLocale.getLocale)("Rep_Tab_Mys_Submitontime"), submitState === 2 && (0, _getLocale.getLocale)("Tasks_Tab_DelaSubmission"));
|
|
140
141
|
}, []);
|
|
141
142
|
var renderDesc = (0, _react.useMemo)(function () {
|
|
142
143
|
var reportTextMap = {
|
|
143
|
-
8: (0, _getLocale.getLocale)(
|
|
144
|
-
26: (0, _getLocale.getLocale)(
|
|
145
|
-
27: (0, _getLocale.getLocale)(
|
|
144
|
+
8: (0, _getLocale.getLocale)("Rep_Tab_Mys_Dailynewsp"),
|
|
145
|
+
26: (0, _getLocale.getLocale)("Rep_Tab_Mys_sweeklyReport"),
|
|
146
|
+
27: (0, _getLocale.getLocale)("Rep_Tab_Sub_monthlyeport")
|
|
146
147
|
};
|
|
147
148
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
148
149
|
className: "".concat(prefix, "__operate-desc")
|
|
@@ -160,31 +161,28 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
160
161
|
}, [data, searchKeyWord]);
|
|
161
162
|
(0, _react.useEffect)(function () {
|
|
162
163
|
if (dailyContent) {
|
|
163
|
-
var _dailyContent$filter$, _dailyContent$filter$2, _dailyContent$filter$3, _dailyContent$filter$4,
|
|
164
|
+
var _dailyContent$filter$, _dailyContent$filter$2, _dailyContent$filter$3, _dailyContent$filter$4, _mindData$, _mindData$2;
|
|
164
165
|
|
|
165
166
|
var mindData = dailyContent.filter(function (item) {
|
|
166
167
|
return (item === null || item === void 0 ? void 0 : item.contentType) === 1;
|
|
167
168
|
});
|
|
168
|
-
|
|
169
|
+
setOkrtableData(((_dailyContent$filter$ = dailyContent.filter(function (item) {
|
|
169
170
|
return (item === null || item === void 0 ? void 0 : item.contentType) === 2;
|
|
170
|
-
})[0]) === null || _dailyContent$filter$ === void 0 ? void 0 : _dailyContent$filter$.content);
|
|
171
|
-
|
|
171
|
+
})[0]) === null || _dailyContent$filter$ === void 0 ? void 0 : _dailyContent$filter$.content) || null);
|
|
172
|
+
setOkrtableTitle((_dailyContent$filter$2 = dailyContent.filter(function (item) {
|
|
172
173
|
return (item === null || item === void 0 ? void 0 : item.contentType) === 2;
|
|
173
|
-
})[0]) === null || _dailyContent$filter$2 === void 0 ? void 0 : _dailyContent$filter$2.
|
|
174
|
-
|
|
175
|
-
return (item === null || item === void 0 ? void 0 : item.contentType) === 2;
|
|
176
|
-
})[0]) === null || _dailyContent$filter$3 === void 0 ? void 0 : _dailyContent$filter$3.title);
|
|
177
|
-
setTasktableData(((_dailyContent$filter$4 = dailyContent.filter(function (item) {
|
|
174
|
+
})[0]) === null || _dailyContent$filter$2 === void 0 ? void 0 : _dailyContent$filter$2.title);
|
|
175
|
+
setTasktableData(((_dailyContent$filter$3 = dailyContent.filter(function (item) {
|
|
178
176
|
return (item === null || item === void 0 ? void 0 : item.contentType) === 3;
|
|
179
|
-
})[0]) === null || _dailyContent$filter$
|
|
180
|
-
setTasktableTitle((_dailyContent$filter$
|
|
177
|
+
})[0]) === null || _dailyContent$filter$3 === void 0 ? void 0 : _dailyContent$filter$3.content) || null);
|
|
178
|
+
setTasktableTitle((_dailyContent$filter$4 = dailyContent.filter(function (item) {
|
|
181
179
|
return (item === null || item === void 0 ? void 0 : item.contentType) === 3;
|
|
182
|
-
})[0]) === null || _dailyContent$filter$
|
|
180
|
+
})[0]) === null || _dailyContent$filter$4 === void 0 ? void 0 : _dailyContent$filter$4.title);
|
|
183
181
|
setRichTextData(dailyContent.filter(function (item) {
|
|
184
182
|
return (item === null || item === void 0 ? void 0 : item.contentType) === _constant.dailyContentType.richText;
|
|
185
183
|
}));
|
|
186
184
|
|
|
187
|
-
if (typeof ((_mindData$ = mindData[0]) === null || _mindData$ === void 0 ? void 0 : _mindData$.content) ===
|
|
185
|
+
if (typeof ((_mindData$ = mindData[0]) === null || _mindData$ === void 0 ? void 0 : _mindData$.content) === "string" && ((_mindData$2 = mindData[0]) === null || _mindData$2 === void 0 ? void 0 : _mindData$2.content) !== "") {
|
|
188
186
|
setMindImg(_constant.Motion.filter(function (item) {
|
|
189
187
|
return item.id === JSON.parse(mindData[0].content).SelectedValues[0];
|
|
190
188
|
})[0].img);
|
|
@@ -200,7 +198,8 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
200
198
|
user: publishUser,
|
|
201
199
|
suffixContent: renderSuffix,
|
|
202
200
|
showDelete: true,
|
|
203
|
-
showCollect: showCollect
|
|
201
|
+
showCollect: showCollect,
|
|
202
|
+
canEvaluate: canEvaluate && evaluates.length === 0
|
|
204
203
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
205
204
|
className: "".concat(prefix, "__content")
|
|
206
205
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -216,7 +215,7 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
216
215
|
className: "".concat(prefix, "__content-mind"),
|
|
217
216
|
alt: ""
|
|
218
217
|
})), (richTextData === null || richTextData === void 0 ? void 0 : richTextData.length) !== 0 && (richTextData === null || richTextData === void 0 ? void 0 : richTextData.map(function (item) {
|
|
219
|
-
return item.richContent !==
|
|
218
|
+
return item.richContent !== "" && typeof item.richContent === "string" && /*#__PURE__*/_react["default"].createElement("div", {
|
|
220
219
|
className: "".concat(prefix, "__work")
|
|
221
220
|
}, item.title, /*#__PURE__*/_react["default"].createElement(_richEditor["default"].Editor, {
|
|
222
221
|
defaultState: JSON.parse(item.richContent),
|
|
@@ -240,7 +239,8 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
240
239
|
}), evaluates.length !== 0 && /*#__PURE__*/_react["default"].createElement(_evalute["default"], {
|
|
241
240
|
evaluation: evaluates[0],
|
|
242
241
|
feedId: feedId,
|
|
243
|
-
publishUser: publishUser
|
|
242
|
+
publishUser: publishUser,
|
|
243
|
+
canEvaluate: canEvaluate
|
|
244
244
|
})));
|
|
245
245
|
};
|
|
246
246
|
|
|
@@ -34,22 +34,31 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
34
34
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
35
35
|
|
|
36
36
|
function Relation(props) {
|
|
37
|
+
// eslint-disable-next-line react/prop-types
|
|
37
38
|
var onChange = props.onChange,
|
|
38
39
|
initValue = props.initValue;
|
|
39
40
|
|
|
40
|
-
var _useState = (0, _react.useState)(
|
|
41
|
+
var _useState = (0, _react.useState)(initValue),
|
|
41
42
|
_useState2 = _slicedToArray(_useState, 2),
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
value = _useState2[0],
|
|
44
|
+
setValue = _useState2[1];
|
|
45
|
+
|
|
46
|
+
var _useState3 = (0, _react.useState)((0, _getLocale.getLocale)("OKR_Menu_Title03_Owned")),
|
|
47
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
48
|
+
selectText = _useState4[0],
|
|
49
|
+
setSelectText = _useState4[1];
|
|
44
50
|
|
|
45
51
|
(0, _react.useEffect)(function () {
|
|
46
52
|
if (initValue === 0) {
|
|
47
53
|
setSelectText((0, _getLocale.getLocale)("Pro_page_Plan_FullRange"));
|
|
54
|
+
} else if (initValue === 1) {
|
|
55
|
+
setSelectText((0, _getLocale.getLocale)("OKR_Menu_Title03_Owned"));
|
|
48
56
|
}
|
|
49
57
|
}, [initValue]);
|
|
50
58
|
|
|
51
59
|
var onChangeHandler = function onChangeHandler(key) {
|
|
52
60
|
setSelectText(key.label);
|
|
61
|
+
setValue(key.value);
|
|
53
62
|
onChange(key.value);
|
|
54
63
|
};
|
|
55
64
|
|
|
@@ -66,7 +75,7 @@ function Relation(props) {
|
|
|
66
75
|
return /*#__PURE__*/_react["default"].createElement(_selectLayer["default"], {
|
|
67
76
|
onChangeSelect: onChangeHandler,
|
|
68
77
|
items: selectOptions,
|
|
69
|
-
initValue:
|
|
78
|
+
initValue: value
|
|
70
79
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
71
80
|
className: "titaui-search-dropdown"
|
|
72
81
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -76,13 +76,13 @@ function SearchForm(props) {
|
|
|
76
76
|
annualNum: year || new Date().getFullYear(),
|
|
77
77
|
// 默认当前年份全部周期
|
|
78
78
|
yqmNum: 0,
|
|
79
|
-
cycleType:
|
|
79
|
+
cycleType: "-1"
|
|
80
80
|
}),
|
|
81
81
|
_useState2 = _slicedToArray(_useState, 2),
|
|
82
82
|
cycle = _useState2[0],
|
|
83
83
|
setCycle = _useState2[1];
|
|
84
84
|
|
|
85
|
-
var _useState3 = (0, _react.useState)(
|
|
85
|
+
var _useState3 = (0, _react.useState)(""),
|
|
86
86
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
87
87
|
okrType = _useState4[0],
|
|
88
88
|
setOkrType = _useState4[1];
|
|
@@ -91,12 +91,12 @@ function SearchForm(props) {
|
|
|
91
91
|
_useState6 = _slicedToArray(_useState5, 1),
|
|
92
92
|
users = _useState6[0];
|
|
93
93
|
|
|
94
|
-
var _useState7 = (0, _react.useState)(
|
|
94
|
+
var _useState7 = (0, _react.useState)(""),
|
|
95
95
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
96
96
|
keyWords = _useState8[0],
|
|
97
97
|
setKeyWords = _useState8[1];
|
|
98
98
|
|
|
99
|
-
var _useState9 = (0, _react.useState)(
|
|
99
|
+
var _useState9 = (0, _react.useState)(1),
|
|
100
100
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
101
101
|
relation = _useState10[0],
|
|
102
102
|
setRelation = _useState10[1];
|
|
@@ -106,14 +106,14 @@ function SearchForm(props) {
|
|
|
106
106
|
classify = _useState12[0],
|
|
107
107
|
setClassify = _useState12[1];
|
|
108
108
|
|
|
109
|
-
var dilagRef = (0, _react.useRef)(document.createElement(
|
|
109
|
+
var dilagRef = (0, _react.useRef)(document.createElement("div"));
|
|
110
110
|
(0, _react.useEffect)(function () {
|
|
111
111
|
onChange(_objectSpread({
|
|
112
112
|
okrType: okrType,
|
|
113
113
|
status: 0,
|
|
114
114
|
userIds: users.reduce(function (res, cur, index) {
|
|
115
|
-
return "".concat(res).concat(index
|
|
116
|
-
},
|
|
115
|
+
return "".concat(res).concat(index === 0 ? "" : ",").concat(cur.userId);
|
|
116
|
+
}, ""),
|
|
117
117
|
keyWords: keyWords,
|
|
118
118
|
relation: relation,
|
|
119
119
|
okrClassify: classify
|
|
@@ -157,7 +157,7 @@ function SearchForm(props) {
|
|
|
157
157
|
className: "rel-okr-tree__search-item-keyword"
|
|
158
158
|
}, /*#__PURE__*/_react["default"].createElement(_searchInput["default"], {
|
|
159
159
|
onSearch: setKeyWords,
|
|
160
|
-
placeholder: (0, _getLocale.getLocale)(
|
|
160
|
+
placeholder: (0, _getLocale.getLocale)("Mod_Enterkeywords"),
|
|
161
161
|
style: {
|
|
162
162
|
height: 32,
|
|
163
163
|
width: 240
|
|
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports["default"] =
|
|
8
|
+
exports["default"] = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
@@ -33,6 +33,8 @@ require("../../../index.css");
|
|
|
33
33
|
|
|
34
34
|
require("./index.css");
|
|
35
35
|
|
|
36
|
+
var _helper = require("./helper");
|
|
37
|
+
|
|
36
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
37
39
|
|
|
38
40
|
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); }
|
|
@@ -61,7 +63,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
61
63
|
|
|
62
64
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
63
65
|
|
|
64
|
-
function _default() {
|
|
66
|
+
var _default = function _default() {
|
|
65
67
|
var loadedNode = (0, _react.useRef)([]);
|
|
66
68
|
|
|
67
69
|
var _useState = (0, _react.useState)([]),
|
|
@@ -74,7 +76,7 @@ function _default() {
|
|
|
74
76
|
rawTreeData = _useState4[0],
|
|
75
77
|
setRawTreeData = _useState4[1];
|
|
76
78
|
|
|
77
|
-
var _useState5 = (0, _react.useState)([
|
|
79
|
+
var _useState5 = (0, _react.useState)(["-1"]),
|
|
78
80
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
79
81
|
selectedMenuKeys = _useState6[0],
|
|
80
82
|
setSelectedMenuKeys = _useState6[1];
|
|
@@ -95,18 +97,14 @@ function _default() {
|
|
|
95
97
|
itemHeight = _useState12[0];
|
|
96
98
|
|
|
97
99
|
var isBoss = (0, _bsGlobal.getUserInfo)().IsBoss;
|
|
98
|
-
|
|
99
|
-
var _useState13 = (0, _react.useState)(window.BSGlobal.OkrAdvancedSetting.KRSetting.OkrDepsShowUser),
|
|
100
|
-
_useState14 = _slicedToArray(_useState13, 1),
|
|
101
|
-
isGetUser = _useState14[0];
|
|
102
|
-
|
|
103
100
|
(0, _react.useEffect)(function () {
|
|
104
101
|
if (isBoss) {
|
|
105
|
-
location.href =
|
|
102
|
+
window.location.href = "#/summary/manage?departmentName=公司全部&departmentId=0";
|
|
106
103
|
|
|
107
104
|
var allDepartmentText = window.getLocale && window.getLocale(_i18n.locale.menu_alldeparment) || _i18n.locale.menu_alldeparment;
|
|
108
105
|
|
|
109
|
-
(0, _requestApis.getDepsAndUsers)(-1,
|
|
106
|
+
(0, _requestApis.getDepsAndUsers)(-1, false).then(function (rawTreeData) {
|
|
107
|
+
var transNodes = (0, _helper.translateDepartsToTreeNode)(rawTreeData);
|
|
110
108
|
var rootNode = {
|
|
111
109
|
async: true,
|
|
112
110
|
data: {
|
|
@@ -114,34 +112,31 @@ function _default() {
|
|
|
114
112
|
name: allDepartmentText
|
|
115
113
|
},
|
|
116
114
|
pid: -1,
|
|
117
|
-
id:
|
|
118
|
-
key:
|
|
115
|
+
id: "0",
|
|
116
|
+
key: "0",
|
|
119
117
|
isLeaf: true,
|
|
120
118
|
nodeType: _index.DEPART_NODE,
|
|
121
119
|
title: allDepartmentText
|
|
122
120
|
};
|
|
123
|
-
setRawTreeData([rootNode].concat(_toConsumableArray(
|
|
124
|
-
setTreeData((0, _utils.toTree)([rootNode].concat(_toConsumableArray(
|
|
121
|
+
setRawTreeData([rootNode].concat(_toConsumableArray(transNodes)));
|
|
122
|
+
setTreeData((0, _utils.toTree)([rootNode].concat(_toConsumableArray(transNodes))));
|
|
125
123
|
setLoading(false);
|
|
126
124
|
});
|
|
127
125
|
} else {
|
|
128
126
|
(0, _requestApis.getMyDepartMent)().then(function (res) {
|
|
129
127
|
location.href = "#/summary/manage?departmentName=".concat(res.Data[0].name, "&departmentId=").concat(res.Data[0].id);
|
|
130
|
-
var rawTreeData = res.Data;
|
|
128
|
+
var rawTreeData = (0, _helper.translateDepartsToTreeNode)(res.Data);
|
|
131
129
|
var rootNode = {
|
|
132
130
|
async: true,
|
|
133
131
|
data: {
|
|
134
|
-
id:
|
|
135
|
-
name:
|
|
136
|
-
isOpen: rawTreeData[0].isOpen,
|
|
137
|
-
hasChild: rawTreeData[0].hasChild
|
|
132
|
+
id: -1,
|
|
133
|
+
name: "全部管理部门"
|
|
138
134
|
},
|
|
139
|
-
pid:
|
|
135
|
+
pid: 0,
|
|
140
136
|
id: rawTreeData[0].id,
|
|
141
|
-
key:
|
|
142
|
-
// isLeaf: !rawTreeData[0].hasChild,
|
|
137
|
+
key: -1,
|
|
143
138
|
nodeType: _index.DEPART_NODE,
|
|
144
|
-
title:
|
|
139
|
+
title: "全部管理部门"
|
|
145
140
|
};
|
|
146
141
|
setRawTreeData([rootNode].concat(_toConsumableArray(rawTreeData)));
|
|
147
142
|
setTreeData((0, _utils.toTree)([rootNode].concat(_toConsumableArray(rawTreeData))));
|
|
@@ -223,9 +218,11 @@ function _default() {
|
|
|
223
218
|
data: treeData,
|
|
224
219
|
itemHeight: itemHeight,
|
|
225
220
|
virtual: true,
|
|
226
|
-
onSelect: onSelectHandler
|
|
227
|
-
|
|
221
|
+
onSelect: onSelectHandler // defaultExpandedKeys={["0"]}
|
|
222
|
+
,
|
|
228
223
|
selectedKeys: selectedMenuKeys,
|
|
229
224
|
loadData: onLoadTreeNodeDataHandler
|
|
230
225
|
})));
|
|
231
|
-
}
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
exports["default"] = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@titaui/pc",
|
|
3
|
-
"version": "1.12.17-beta.
|
|
3
|
+
"version": "1.12.17-beta.9",
|
|
4
4
|
"nameCN": "",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@titaui/rc-trigger": "5.2.5",
|
|
79
79
|
"@titaui/react-flow-renderer": "9.5.4",
|
|
80
80
|
"@titaui/request": "^1.0.1",
|
|
81
|
-
"@titaui/rich-editor": "^0.1.
|
|
81
|
+
"@titaui/rich-editor": "^0.1.48",
|
|
82
82
|
"@titaui/toast": "1.0.0",
|
|
83
83
|
"@types/color": "3.0.3",
|
|
84
84
|
"@types/prosemirror-commands": "1.0.4",
|