@titaui/pc 1.12.95-beta.4 → 1.12.95-beta.7
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/dynamic/dynamic-item/components/okr-progress/index.js +2 -1
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.css +12 -0
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/index.js +12 -3
- package/lib/components/dynamic/dynamic-item/components/table-row-okr/utils.js +58 -0
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/remind-user-view/index.js +2 -27
- package/lib/components/dynamic/dynamic-item/dynamic-new-report/index.js +34 -31
- package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +54 -57
- package/lib/components/menus/export-modules/summary-menus/menus.js +1 -1
- package/lib/components/menus/export-modules/summary-menus/summary-front-menus.js +4 -2
- package/lib/components/rich-editor-at/index.js +50 -6
- package/package.json +1 -1
|
@@ -111,7 +111,8 @@ var OkrProgress = function OkrProgress(_ref) {
|
|
|
111
111
|
return /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement(_tableRowOkr["default"], {
|
|
112
112
|
text: item.Name,
|
|
113
113
|
isO: true,
|
|
114
|
-
id: item.Id
|
|
114
|
+
id: item.Id,
|
|
115
|
+
data: item
|
|
115
116
|
})), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement(_progress["default"], {
|
|
116
117
|
type: "o",
|
|
117
118
|
status: _constant.OkrRiskMapping[item.RiskLevel],
|
|
@@ -20,6 +20,18 @@
|
|
|
20
20
|
margin-top: 4px;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
.titaui-dynamic-summary-table-row-okr__common-time {
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
padding: 1px 8px;
|
|
26
|
+
background-color: rgba(40, 121, 255, 0.16);
|
|
27
|
+
border-radius: 12px;
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
font-weight: 400;
|
|
30
|
+
color: #3F4755;
|
|
31
|
+
line-height: 18px;
|
|
32
|
+
margin-left: 4px;
|
|
33
|
+
}
|
|
34
|
+
|
|
23
35
|
.titaui-dynamic-summary-table-row-okr__kr {
|
|
24
36
|
margin-left: 24px;
|
|
25
37
|
overflow: hidden;
|
|
@@ -13,6 +13,8 @@ var _scrollbar = _interopRequireDefault(require("../../../../scrollbar"));
|
|
|
13
13
|
|
|
14
14
|
var _drawerManager = _interopRequireDefault(require("../../../../drawer-manager"));
|
|
15
15
|
|
|
16
|
+
var _utils = require("./utils");
|
|
17
|
+
|
|
16
18
|
var _openData = require("../../../../../utils/open-data");
|
|
17
19
|
|
|
18
20
|
require("./index.css");
|
|
@@ -29,7 +31,8 @@ var TableRowOKR = function TableRowOKR(_ref) {
|
|
|
29
31
|
_ref$isFirstLevel = _ref.isFirstLevel,
|
|
30
32
|
isFirstLevel = _ref$isFirstLevel === void 0 ? true : _ref$isFirstLevel,
|
|
31
33
|
_ref$order = _ref.order,
|
|
32
|
-
order = _ref$order === void 0 ? 1 : _ref$order
|
|
34
|
+
order = _ref$order === void 0 ? 1 : _ref$order,
|
|
35
|
+
data = _ref.data;
|
|
33
36
|
|
|
34
37
|
var handleClickTitle = function handleClickTitle() {
|
|
35
38
|
if (isO) {
|
|
@@ -54,9 +57,15 @@ var TableRowOKR = function TableRowOKR(_ref) {
|
|
|
54
57
|
onClick: handleClickTitle
|
|
55
58
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
56
59
|
className: "tu-icon-H5-".concat(isO ? "O" : "KR", "-s ").concat(prefix, "__common-icon")
|
|
57
|
-
}), /*#__PURE__*/_react["default"].createElement("span", null, (0, _openData.parseString)(text)), /*#__PURE__*/_react["default"].createElement("span", {
|
|
60
|
+
}), /*#__PURE__*/_react["default"].createElement("p", null, /*#__PURE__*/_react["default"].createElement("span", null, (0, _openData.parseString)(text)), /*#__PURE__*/_react["default"].createElement("span", {
|
|
58
61
|
className: "".concat(prefix, "__common-time")
|
|
59
|
-
},
|
|
62
|
+
}, (0, _utils.formatPeriod)({
|
|
63
|
+
annualNum: data.AnnualNum,
|
|
64
|
+
yqmNum: data.YqmNum,
|
|
65
|
+
cycleType: data.CycleType,
|
|
66
|
+
startDate: data.StartDate,
|
|
67
|
+
endDate: data.EndDate
|
|
68
|
+
})))), !isFirstLevel && /*#__PURE__*/_react["default"].createElement("div", {
|
|
60
69
|
className: (0, _classnames["default"])("".concat(prefix, "__kr")),
|
|
61
70
|
onClick: handleClickTitle
|
|
62
71
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
@@ -0,0 +1,58 @@
|
|
|
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")) : Number("".concat(selected.annualNum)) === 0 ? null : "".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
|
+
var startDate = selected.startDate;
|
|
47
|
+
var endDate = selected.endDate;
|
|
48
|
+
cycleDate = "".concat(startDate, "~").concat(endDate);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (annualNum) {
|
|
52
|
+
return "".concat(annualNum, " ").concat(cycleDate);
|
|
53
|
+
} else {
|
|
54
|
+
return "".concat(cycleDate);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
exports.formatPeriod = formatPeriod;
|
package/lib/components/dynamic/dynamic-item/dynamic-new-report/components/remind-user-view/index.js
CHANGED
|
@@ -7,12 +7,6 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _avatar = _interopRequireDefault(require("../../../../../../components/avatar"));
|
|
11
|
-
|
|
12
|
-
var _getLocale = require("../../../../../../utils/getLocale");
|
|
13
|
-
|
|
14
|
-
var _openData = require("../../../../../../utils/open-data");
|
|
15
|
-
|
|
16
10
|
require("./index.css");
|
|
17
11
|
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -23,29 +17,10 @@ var RemindUserView = function RemindUserView(props) {
|
|
|
23
17
|
var data = props.data,
|
|
24
18
|
curAtUser = props.curAtUser;
|
|
25
19
|
if (!data || !data.length) return null;
|
|
20
|
+
console.log("data", data);
|
|
26
21
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
27
22
|
className: preCls
|
|
28
|
-
}
|
|
29
|
-
className: "".concat(preCls, "__title")
|
|
30
|
-
}, (0, _getLocale.getLocale)("OKR_MyO_himher")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
31
|
-
className: "".concat(preCls, "__list")
|
|
32
|
-
}, data.map(function (item) {
|
|
33
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
34
|
-
className: "".concat(preCls, "__user")
|
|
35
|
-
}, /*#__PURE__*/_react["default"].createElement(_avatar["default"], {
|
|
36
|
-
userId: item.userId,
|
|
37
|
-
name: item.name,
|
|
38
|
-
src: item.avatar.medium,
|
|
39
|
-
color: item.avatar.color
|
|
40
|
-
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
41
|
-
className: "".concat(preCls, "__user-name")
|
|
42
|
-
}, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
|
|
43
|
-
name: item.name,
|
|
44
|
-
id: item.userId
|
|
45
|
-
}), /*#__PURE__*/_react["default"].createElement("i", {
|
|
46
|
-
className: "".concat(preCls, "__user-name-icon ").concat((item.userId === curAtUser || item.hasRead) && "hasRead")
|
|
47
|
-
})));
|
|
48
|
-
})));
|
|
23
|
+
});
|
|
49
24
|
};
|
|
50
25
|
|
|
51
26
|
var _default = RemindUserView;
|
|
@@ -13,8 +13,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
13
13
|
|
|
14
14
|
var _richEditor = _interopRequireWildcard(require("@titaui/rich-editor"));
|
|
15
15
|
|
|
16
|
-
var _reactIntersectionObserver = require("react-intersection-observer");
|
|
17
|
-
|
|
18
16
|
var _tooltip = _interopRequireDefault(require("../../../tooltip"));
|
|
19
17
|
|
|
20
18
|
var _context = require("../../context");
|
|
@@ -108,15 +106,20 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
108
106
|
motionValue = _useState2[0],
|
|
109
107
|
setMotionValue = _useState2[1];
|
|
110
108
|
|
|
111
|
-
var _useState3 = (0, _react.useState)(
|
|
109
|
+
var _useState3 = (0, _react.useState)(null),
|
|
112
110
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
atValue = _useState4[0],
|
|
112
|
+
setAtValue = _useState4[1];
|
|
115
113
|
|
|
116
114
|
var _useState5 = (0, _react.useState)(false),
|
|
117
115
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
showDelete = _useState6[0],
|
|
117
|
+
setShowDelete = _useState6[1];
|
|
118
|
+
|
|
119
|
+
var _useState7 = (0, _react.useState)(false),
|
|
120
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
121
|
+
showEdit = _useState8[0],
|
|
122
|
+
setShowEdit = _useState8[1];
|
|
120
123
|
|
|
121
124
|
var contentRichTextRef = (0, _react.useRef)();
|
|
122
125
|
var workPlanRichTextRef = (0, _react.useRef)();
|
|
@@ -124,10 +127,10 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
124
127
|
var _useContext = (0, _react.useContext)(_context.SearchKeyContext),
|
|
125
128
|
searchKeyWord = _useContext.searchKeyWord;
|
|
126
129
|
|
|
127
|
-
var
|
|
128
|
-
|
|
129
|
-
currentEvalutes =
|
|
130
|
-
setCurrentEvalutes =
|
|
130
|
+
var _useState9 = (0, _react.useState)(evaluates || []),
|
|
131
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
132
|
+
currentEvalutes = _useState10[0],
|
|
133
|
+
setCurrentEvalutes = _useState10[1];
|
|
131
134
|
|
|
132
135
|
var renderSuffix = /*#__PURE__*/_react["default"].createElement("span", {
|
|
133
136
|
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))
|
|
@@ -170,6 +173,12 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
170
173
|
});
|
|
171
174
|
|
|
172
175
|
setMotionValue(motion);
|
|
176
|
+
var atData = dailyContent.find(function (item) {
|
|
177
|
+
return item.contentType === 5;
|
|
178
|
+
});
|
|
179
|
+
if (!(atData !== null && atData !== void 0 && atData.content)) return;
|
|
180
|
+
var atMotion = JSON.parse(atData.content || "{}");
|
|
181
|
+
setAtValue(atMotion);
|
|
173
182
|
}
|
|
174
183
|
}, [dailyContent]);
|
|
175
184
|
(0, _react.useEffect)(function () {
|
|
@@ -177,24 +186,18 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
177
186
|
setShowDelete(true);
|
|
178
187
|
setShowEdit(true);
|
|
179
188
|
}
|
|
180
|
-
}, []);
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return /*#__PURE__*/_react["default"].createElement(_reactIntersectionObserver.InView, {
|
|
194
|
-
triggerOnce: true,
|
|
195
|
-
onChange: handleInView,
|
|
196
|
-
threshold: 0.5
|
|
197
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
189
|
+
}, []); // const handleInView = (inview) => {
|
|
190
|
+
// if (inview) {
|
|
191
|
+
// window.titaTracker("planAction").record({
|
|
192
|
+
// actionName: "查看日报",
|
|
193
|
+
// actionGroup: "动态-查看日报",
|
|
194
|
+
// productName: "动态",
|
|
195
|
+
// feedId,
|
|
196
|
+
// });
|
|
197
|
+
// }
|
|
198
|
+
// }
|
|
199
|
+
|
|
200
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
198
201
|
className: prefix
|
|
199
202
|
}, /*#__PURE__*/_react["default"].createElement(_summaryHeader["default"], _extends({
|
|
200
203
|
data: data
|
|
@@ -259,14 +262,14 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
259
262
|
editable: false,
|
|
260
263
|
enableDelete: false
|
|
261
264
|
})), /*#__PURE__*/_react["default"].createElement(_remindUserView["default"], {
|
|
262
|
-
data:
|
|
265
|
+
data: atValue,
|
|
263
266
|
curAtUser: curAtUser
|
|
264
267
|
}), currentEvalutes && currentEvalutes.length !== 0 && /*#__PURE__*/_react["default"].createElement(_evalute["default"], {
|
|
265
268
|
evaluation: currentEvalutes[0],
|
|
266
269
|
feedId: feedId,
|
|
267
270
|
publishUser: publishUser,
|
|
268
271
|
canEvaluate: canEvaluate
|
|
269
|
-
})))
|
|
272
|
+
})));
|
|
270
273
|
};
|
|
271
274
|
|
|
272
275
|
var _default = DynamicReply;
|
|
@@ -11,8 +11,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var _reactIntersectionObserver = require("react-intersection-observer");
|
|
15
|
-
|
|
16
14
|
var _context = require("../../context");
|
|
17
15
|
|
|
18
16
|
var _header = _interopRequireDefault(require("../components/header"));
|
|
@@ -108,61 +106,60 @@ var DynamicReply = function DynamicReply(_ref) {
|
|
|
108
106
|
parentDom: workPlanRichTextRef.current,
|
|
109
107
|
keyWord: searchKeyWord
|
|
110
108
|
});
|
|
111
|
-
}, [data, searchKeyWord]);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}))))));
|
|
109
|
+
}, [data, searchKeyWord]); // const handleInView = (inview) => {
|
|
110
|
+
// if (inview) {
|
|
111
|
+
// window.titaTracker("planAction").record({
|
|
112
|
+
// actionName: "查看日报",
|
|
113
|
+
// actionGroup: "动态-查看日报",
|
|
114
|
+
// productName: "动态",
|
|
115
|
+
// feedId,
|
|
116
|
+
// });
|
|
117
|
+
// }
|
|
118
|
+
// }
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
/*#__PURE__*/
|
|
122
|
+
// <InView triggerOnce={true} onChange={handleInView} threshold={0.5}>
|
|
123
|
+
_react["default"].createElement("div", {
|
|
124
|
+
className: prefix
|
|
125
|
+
}, /*#__PURE__*/_react["default"].createElement(_header["default"], _extends({
|
|
126
|
+
data: data
|
|
127
|
+
}, restProps, {
|
|
128
|
+
desc: renderDesc,
|
|
129
|
+
user: publishUser,
|
|
130
|
+
suffixContent: renderSuffix
|
|
131
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
132
|
+
className: "".concat(prefix, "__content")
|
|
133
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
134
|
+
className: "".concat(prefix, "__content-title")
|
|
135
|
+
}, /*#__PURE__*/_react["default"].createElement(_title["default"], {
|
|
136
|
+
content: (0, _tools.htmlDecodeByRegExp)(data.name),
|
|
137
|
+
onClickTitle: handleClickTitle,
|
|
138
|
+
type: getEReportType(reportType),
|
|
139
|
+
typeBgColor: "rgba(92, 142, 255, 0.5)",
|
|
140
|
+
titleBgColor: "rgba(92, 142, 255, 0.1)",
|
|
141
|
+
contentColor: "#5C8EFF"
|
|
142
|
+
})), data.contentRichText && /*#__PURE__*/_react["default"].createElement("div", {
|
|
143
|
+
className: "".concat(prefix, "__summary")
|
|
144
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
145
|
+
className: "".concat(prefix, "__block-title")
|
|
146
|
+
}, (0, _getLocale.getLocale)("Rep_Tab_Mys_Summaryobsta")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
147
|
+
className: "".concat(prefix, "__content-text"),
|
|
148
|
+
ref: contentRichTextRef
|
|
149
|
+
}, /*#__PURE__*/_react["default"].createElement(_dangerousHtml["default"], {
|
|
150
|
+
htmlText: data.contentRichText
|
|
151
|
+
}))), data.workPlanRichText && /*#__PURE__*/_react["default"].createElement("div", {
|
|
152
|
+
className: "".concat(prefix, "__work-plan")
|
|
153
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
154
|
+
className: "".concat(prefix, "__block-title")
|
|
155
|
+
}, (0, _getLocale.getLocale)("Rep_Tab_Mys_NextWorkPlans")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
156
|
+
className: "".concat(prefix, "__content-text"),
|
|
157
|
+
ref: workPlanRichTextRef
|
|
158
|
+
}, /*#__PURE__*/_react["default"].createElement(_dangerousHtml["default"], {
|
|
159
|
+
htmlText: data.workPlanRichText
|
|
160
|
+
}))))) // </InView>
|
|
161
|
+
|
|
162
|
+
);
|
|
166
163
|
};
|
|
167
164
|
|
|
168
165
|
var _default = DynamicReply;
|
|
@@ -80,6 +80,7 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
80
80
|
setIsShowShare = _useState8[1];
|
|
81
81
|
|
|
82
82
|
var isShowDepartment = baseAuth.isBoss() || baseAuth.isAssistant() || baseAuth.isPlanDailyManager() || baseAuth.isDepartmentLeader() || baseAuth.isHrbp();
|
|
83
|
+
var isShowDashboard = baseAuth.isBoss() || baseAuth.isAssistant() || baseAuth.isPlanDailyManager() || baseAuth.isHrbp();
|
|
83
84
|
var flipRef = (0, _react.useRef)({
|
|
84
85
|
next: function next() {},
|
|
85
86
|
goback: function goback() {}
|
|
@@ -206,11 +207,12 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
206
207
|
(0, _react.useEffect)(function () {
|
|
207
208
|
var newMenu = new _menus["default"]({
|
|
208
209
|
isShowShare: isShowShare,
|
|
209
|
-
isShowDept: isShowDepartment
|
|
210
|
+
isShowDept: isShowDepartment,
|
|
211
|
+
isShowDashboard: isShowDashboard
|
|
210
212
|
});
|
|
211
213
|
summaryMenusData.current = newMenu;
|
|
212
214
|
setMenus(newMenu.getMenus());
|
|
213
|
-
}, [isShowShare, isShowDepartment]);
|
|
215
|
+
}, [isShowShare, isShowDepartment, isShowDashboard]);
|
|
214
216
|
(0, _react.useEffect)(function () {
|
|
215
217
|
(0, _requestApi.getShareStatus)().then(function (resp) {
|
|
216
218
|
if (resp.Code === 1) {
|
|
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _userSelector = _interopRequireDefault(require("../user-selector"));
|
|
13
13
|
|
|
14
|
+
var _components = _interopRequireDefault(require("./components"));
|
|
15
|
+
|
|
14
16
|
require("./index.css");
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -34,6 +36,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
34
36
|
var prefix = "titaui-rich-editor-at";
|
|
35
37
|
|
|
36
38
|
var RichEditorAt = function RichEditorAt(_ref) {
|
|
39
|
+
var _users$users;
|
|
40
|
+
|
|
37
41
|
var _ref$users = _ref.users,
|
|
38
42
|
users = _ref$users === void 0 ? {
|
|
39
43
|
users: [],
|
|
@@ -47,7 +51,9 @@ var RichEditorAt = function RichEditorAt(_ref) {
|
|
|
47
51
|
isOnlySelectUser = _ref$isOnlySelectUser === void 0 ? true : _ref$isOnlySelectUser;
|
|
48
52
|
console.log(users);
|
|
49
53
|
|
|
50
|
-
var _useState = (0, _react.useState)(
|
|
54
|
+
var _useState = (0, _react.useState)((_users$users = users.users) === null || _users$users === void 0 ? void 0 : _users$users.map(function (item) {
|
|
55
|
+
return item.user;
|
|
56
|
+
})),
|
|
51
57
|
_useState2 = _slicedToArray(_useState, 2),
|
|
52
58
|
selectUsers = _useState2[0],
|
|
53
59
|
setSelectUsers = _useState2[1];
|
|
@@ -109,10 +115,10 @@ var RichEditorAt = function RichEditorAt(_ref) {
|
|
|
109
115
|
};
|
|
110
116
|
|
|
111
117
|
(0, _react.useEffect)(function () {
|
|
112
|
-
if (users && users.users && users.users[0]
|
|
113
|
-
setSelectUsers(
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
if (users && users.users && users.users[0]) {
|
|
119
|
+
setSelectUsers(users.users.map(function (item) {
|
|
120
|
+
return item.user;
|
|
121
|
+
}));
|
|
116
122
|
}
|
|
117
123
|
|
|
118
124
|
setSelectDepartments(users.departments);
|
|
@@ -124,7 +130,45 @@ var RichEditorAt = function RichEditorAt(_ref) {
|
|
|
124
130
|
className: "".concat(prefix, "__title")
|
|
125
131
|
}, text), /*#__PURE__*/_react["default"].createElement("div", {
|
|
126
132
|
className: "".concat(prefix, "__content")
|
|
127
|
-
},
|
|
133
|
+
}, selectUsers && selectUsers[0] && selectUsers.map(function (item) {
|
|
134
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
135
|
+
className: "".concat(prefix, "__content-user")
|
|
136
|
+
}, /*#__PURE__*/_react["default"].createElement(_components["default"], {
|
|
137
|
+
src: item.avatar.original,
|
|
138
|
+
name: item.name,
|
|
139
|
+
userId: item.userId,
|
|
140
|
+
showNameTips: true,
|
|
141
|
+
canDelUser: true,
|
|
142
|
+
onDelUser: function onDelUser() {
|
|
143
|
+
return handleDeleteUser(item);
|
|
144
|
+
},
|
|
145
|
+
color: item.avatar.color
|
|
146
|
+
}));
|
|
147
|
+
}), selectDepartments && selectDepartments.map(function (item) {
|
|
148
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
149
|
+
className: "".concat(prefix, "__content-user")
|
|
150
|
+
}, /*#__PURE__*/_react["default"].createElement(_components["default"], {
|
|
151
|
+
showNameTips: true,
|
|
152
|
+
canDelUser: true,
|
|
153
|
+
onDelUser: function onDelUser() {
|
|
154
|
+
return handleDeleteDepart(item);
|
|
155
|
+
},
|
|
156
|
+
color: '#3296fa',
|
|
157
|
+
name: item.name
|
|
158
|
+
}));
|
|
159
|
+
}), selectGroups && selectGroups.map(function (item) {
|
|
160
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
161
|
+
className: "".concat(prefix, "__content-user")
|
|
162
|
+
}, /*#__PURE__*/_react["default"].createElement(_components["default"], {
|
|
163
|
+
showNameTips: true,
|
|
164
|
+
canDelUser: true,
|
|
165
|
+
onDelUser: function onDelUser() {
|
|
166
|
+
return handleDeleteGroup(item);
|
|
167
|
+
},
|
|
168
|
+
color: 'rgba(90, 216, 166)',
|
|
169
|
+
name: item.name
|
|
170
|
+
}));
|
|
171
|
+
}), /*#__PURE__*/_react["default"].createElement(_userSelector["default"], {
|
|
128
172
|
multiple: true,
|
|
129
173
|
position: "right",
|
|
130
174
|
onOk: handleSelectUser,
|