@titaui/pc 1.10.81 → 1.10.82-beta.4
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/drawer/index.js +3 -2
- package/lib/components/okr-detail/detail-header/actions.js +40 -44
- package/lib/components/okr-detail/detail-header/index.css +2 -2
- package/lib/components/okr-detail/detail-header/index.js +204 -194
- package/lib/components/okr-detail/index.js +2 -0
- package/lib/components/wechat-btn/index.css +14 -0
- package/lib/components/wechat-btn/index.js +231 -0
- package/lib/index.js +8 -0
- package/package.json +1 -1
|
@@ -122,7 +122,8 @@ function DrawerHeader(_ref) {
|
|
|
122
122
|
actionMaxCount = _ref$actionMaxCount === void 0 ? 4 : _ref$actionMaxCount,
|
|
123
123
|
content = _ref.content,
|
|
124
124
|
style = _ref.style,
|
|
125
|
-
onClose = _ref.onClose
|
|
125
|
+
onClose = _ref.onClose,
|
|
126
|
+
actionComponent = _ref.actionComponent;
|
|
126
127
|
var drawer = (0, _react.useContext)(DrawerContext);
|
|
127
128
|
var manager = (0, _react.useContext)(_context["default"]);
|
|
128
129
|
var showClose = closable && (!!onClose || !!drawer);
|
|
@@ -151,7 +152,7 @@ function DrawerHeader(_ref) {
|
|
|
151
152
|
style: {
|
|
152
153
|
flex: 1
|
|
153
154
|
}
|
|
154
|
-
}), displayActions.map(function (action) {
|
|
155
|
+
}), /*#__PURE__*/_react["default"].createElement("div", null, actionComponent), displayActions.map(function (action) {
|
|
155
156
|
return /*#__PURE__*/_react["default"].createElement(_headerAction["default"], action);
|
|
156
157
|
}), !!collapsedActions.length && /*#__PURE__*/_react["default"].createElement(_headerAction["default"], {
|
|
157
158
|
title: (0, _getLocale.getLocale)("Mod_MoreOperate"),
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getOkrHeadActions = getOkrHeadActions;
|
|
7
7
|
|
|
8
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
9
|
-
|
|
10
8
|
var _bsGlobal = require("../../../utils/bs-global");
|
|
11
9
|
|
|
12
10
|
var _auth = require("../../../utils/auth");
|
|
@@ -15,36 +13,12 @@ var _enums = require("./enums");
|
|
|
15
13
|
|
|
16
14
|
var _getLocale = require("../../../utils/getLocale");
|
|
17
15
|
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
16
|
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; }
|
|
21
17
|
|
|
22
18
|
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; }
|
|
23
19
|
|
|
24
20
|
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; }
|
|
25
21
|
|
|
26
|
-
function getOkrHeadActions(data) {
|
|
27
|
-
var actions = [];
|
|
28
|
-
var auth = new _auth.OAuth({
|
|
29
|
-
principalUser: data.principalUser,
|
|
30
|
-
createUserId: data.detailInfo.createUserId
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
var dataWithAuth = _objectSpread(_objectSpread({}, data), {}, {
|
|
34
|
-
auth: auth
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
addShareButton(dataWithAuth, actions);
|
|
38
|
-
addVisibilityButton(dataWithAuth, actions);
|
|
39
|
-
addFollowButton(dataWithAuth, actions);
|
|
40
|
-
addExitButton(dataWithAuth, actions);
|
|
41
|
-
addFinishOrReopenButton(dataWithAuth, actions);
|
|
42
|
-
addCopyButton(dataWithAuth, actions);
|
|
43
|
-
addDeleteButton(dataWithAuth, actions); // addDetailButton(dataWithAuth,actions)
|
|
44
|
-
|
|
45
|
-
return actions;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
22
|
var addShareButton = function addShareButton(_ref, actions) {
|
|
49
23
|
var openShareModal = _ref.openShareModal;
|
|
50
24
|
actions.push({
|
|
@@ -81,10 +55,10 @@ var addVisibilityButton = function addVisibilityButton(_ref2, actions) {
|
|
|
81
55
|
}
|
|
82
56
|
}];
|
|
83
57
|
|
|
84
|
-
var editable = auth.hasAuth() && detailInfo.status
|
|
58
|
+
var editable = auth.hasAuth() && detailInfo.status === _enums.OkrStatus.inProgress;
|
|
85
59
|
|
|
86
60
|
actions.push({
|
|
87
|
-
icon: visibility
|
|
61
|
+
icon: visibility !== 1 ? "tu-icon-simi-icon" : "tu-icon-gongkai",
|
|
88
62
|
title: children[visibility - 1].title + (0, _getLocale.getLocale)("OKR_MyO_Text_Visible"),
|
|
89
63
|
children: editable ? children : null
|
|
90
64
|
});
|
|
@@ -92,7 +66,6 @@ var addVisibilityButton = function addVisibilityButton(_ref2, actions) {
|
|
|
92
66
|
|
|
93
67
|
var addFollowButton = function addFollowButton(_ref3, actions) {
|
|
94
68
|
var roleType = _ref3.roleType,
|
|
95
|
-
detailInfo = _ref3.detailInfo,
|
|
96
69
|
onChangeOkrFollow = _ref3.onChangeOkrFollow;
|
|
97
70
|
|
|
98
71
|
// 未开启关注目标功能
|
|
@@ -101,12 +74,12 @@ var addFollowButton = function addFollowButton(_ref3, actions) {
|
|
|
101
74
|
} // 是负责人或是内部成员不能关注目标
|
|
102
75
|
|
|
103
76
|
|
|
104
|
-
if (roleType
|
|
77
|
+
if (roleType === _enums.OkrRole.principal || roleType === _enums.OkrRole.member) {
|
|
105
78
|
return;
|
|
106
79
|
} // 已关注目标
|
|
107
80
|
|
|
108
81
|
|
|
109
|
-
if (roleType
|
|
82
|
+
if (roleType === _enums.OkrRole.follower) {
|
|
110
83
|
actions.push({
|
|
111
84
|
icon: "okr-drawer-header-followed",
|
|
112
85
|
title: (0, _getLocale.getLocale)("OKR_MyO_Butt_Unfollow"),
|
|
@@ -131,7 +104,7 @@ var addExitButton = function addExitButton(_ref4, actions) {
|
|
|
131
104
|
var roleType = _ref4.roleType,
|
|
132
105
|
onQuit = _ref4.onQuit;
|
|
133
106
|
|
|
134
|
-
if (roleType
|
|
107
|
+
if (roleType === _enums.OkrRole.member) {
|
|
135
108
|
actions.push({
|
|
136
109
|
icon: "tu-icon-tuichu",
|
|
137
110
|
title: (0, _getLocale.getLocale)("Pro_Admin_pop_Withdraw"),
|
|
@@ -146,7 +119,7 @@ var addFinishOrReopenButton = function addFinishOrReopenButton(_ref5, actions) {
|
|
|
146
119
|
onFinishOrReOpen = _ref5.onFinishOrReOpen;
|
|
147
120
|
if (!auth.hasAuth()) return;
|
|
148
121
|
|
|
149
|
-
if (detailInfo.status
|
|
122
|
+
if (detailInfo.status === _enums.OkrStatus.inProgress) {
|
|
150
123
|
actions.push({
|
|
151
124
|
icon: "tu-icon-liebiao-jieshu",
|
|
152
125
|
title: (0, _getLocale.getLocale)("OKR_MyO_EndObjective"),
|
|
@@ -185,16 +158,39 @@ var addDeleteButton = function addDeleteButton(_ref7, actions) {
|
|
|
185
158
|
title: (0, _getLocale.getLocale)("OKR_MyO_Butt_DeleteO"),
|
|
186
159
|
onClick: onDeleteOkr
|
|
187
160
|
});
|
|
188
|
-
};
|
|
161
|
+
}; // const addDetailButton: ActionDealFunction = ({ detailInfo }, actions) => {
|
|
162
|
+
// const registerDate = window.BSGlobal.tenantAuthentication.StartDate;
|
|
163
|
+
// dayjs(registerDate).year() < 2021
|
|
164
|
+
// && actions.push({
|
|
165
|
+
// icon: "tu-icon-xiangqing1",
|
|
166
|
+
// title: "目标详情",
|
|
167
|
+
// onClick: () => {
|
|
168
|
+
// window.open(
|
|
169
|
+
// `${location.pathname}#okr/manage?work_id=${detailInfo.workId}`,
|
|
170
|
+
// );
|
|
171
|
+
// },
|
|
172
|
+
// });
|
|
173
|
+
// };
|
|
189
174
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
var
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
onClick: function onClick() {
|
|
197
|
-
window.open("".concat(location.pathname, "#okr/manage?work_id=").concat(detailInfo.workId));
|
|
198
|
-
}
|
|
175
|
+
|
|
176
|
+
function getOkrHeadActions(data) {
|
|
177
|
+
var actions = [];
|
|
178
|
+
var auth = new _auth.OAuth({
|
|
179
|
+
principalUser: data.principalUser,
|
|
180
|
+
createUserId: data.detailInfo.createUserId
|
|
199
181
|
});
|
|
200
|
-
|
|
182
|
+
|
|
183
|
+
var dataWithAuth = _objectSpread(_objectSpread({}, data), {}, {
|
|
184
|
+
auth: auth
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
addShareButton(dataWithAuth, actions);
|
|
188
|
+
addVisibilityButton(dataWithAuth, actions);
|
|
189
|
+
addFollowButton(dataWithAuth, actions);
|
|
190
|
+
addExitButton(dataWithAuth, actions);
|
|
191
|
+
addFinishOrReopenButton(dataWithAuth, actions);
|
|
192
|
+
addCopyButton(dataWithAuth, actions);
|
|
193
|
+
addDeleteButton(dataWithAuth, actions); // addDetailButton(dataWithAuth,actions)
|
|
194
|
+
|
|
195
|
+
return actions;
|
|
196
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
.okr-detail-head-parent {
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
|
-
color: #
|
|
8
|
+
color: #89919f;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.okr-detail-head-parent .tu-icon-liebiao-duiqinubiao {
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.okr-detail-head-parent > span:hover {
|
|
26
|
-
color: #
|
|
26
|
+
color: #2879ff;
|
|
27
27
|
}
|
|
@@ -19,6 +19,8 @@ var _actions = require("./actions");
|
|
|
19
19
|
|
|
20
20
|
var _confirm = _interopRequireDefault(require("./confirm"));
|
|
21
21
|
|
|
22
|
+
var _wechatBtn = _interopRequireDefault(require("../../wechat-btn"));
|
|
23
|
+
|
|
22
24
|
var _toast = _interopRequireDefault(require("../../toast"));
|
|
23
25
|
|
|
24
26
|
var _requestApis = require("../request-apis");
|
|
@@ -109,7 +111,7 @@ function OkrDetailHeader(_ref) {
|
|
|
109
111
|
}));
|
|
110
112
|
|
|
111
113
|
case 3:
|
|
112
|
-
_toast["default"].Success((0, _getLocale.getLocale)(
|
|
114
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
|
|
113
115
|
|
|
114
116
|
context.setGeneralVisibility({
|
|
115
117
|
visibility: visibility,
|
|
@@ -132,229 +134,232 @@ function OkrDetailHeader(_ref) {
|
|
|
132
134
|
setShareVisible(false);
|
|
133
135
|
}, []);
|
|
134
136
|
var actions = (0, _react.useMemo)(function () {
|
|
135
|
-
if (!detailInfo)
|
|
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
|
-
|
|
137
|
+
if (!detailInfo) {
|
|
138
|
+
return [];
|
|
139
|
+
} else {
|
|
140
|
+
return (0, _actions.getOkrHeadActions)({
|
|
141
|
+
roleType: context.generalRoleType,
|
|
142
|
+
principalUser: context.generalPrincipalUser,
|
|
143
|
+
visibility: context.generalVisibility.visibility,
|
|
144
|
+
detailInfo: detailInfo,
|
|
145
|
+
openShareModal: function () {
|
|
146
|
+
var _openShareModal = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
147
|
+
var krss;
|
|
148
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
149
|
+
while (1) {
|
|
150
|
+
switch (_context2.prev = _context2.next) {
|
|
151
|
+
case 0:
|
|
152
|
+
_context2.next = 2;
|
|
153
|
+
return (0, _requestApis.getKrs)({
|
|
154
|
+
okrId: detailInfo.workId
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
case 2:
|
|
158
|
+
krss = _context2.sent;
|
|
159
|
+
setKrs(krss);
|
|
160
|
+
setShareVisible(true);
|
|
161
|
+
|
|
162
|
+
case 5:
|
|
163
|
+
case "end":
|
|
164
|
+
return _context2.stop();
|
|
165
|
+
}
|
|
161
166
|
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}));
|
|
165
|
-
|
|
166
|
-
function openShareModal() {
|
|
167
|
-
return _openShareModal.apply(this, arguments);
|
|
168
|
-
}
|
|
167
|
+
}, _callee2);
|
|
168
|
+
}));
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
changeVisiblilty: function changeVisiblilty(visibility) {
|
|
173
|
-
if (visibility === 4) {
|
|
174
|
-
if (userSelectRef.current) {
|
|
175
|
-
userSelectRef.current.open();
|
|
170
|
+
function openShareModal() {
|
|
171
|
+
return _openShareModal.apply(this, arguments);
|
|
176
172
|
}
|
|
177
173
|
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
},
|
|
186
|
-
onCopyOkr: function onCopyOkr() {
|
|
187
|
-
// @ts-ignore
|
|
188
|
-
window.openCopyOkrModal({
|
|
189
|
-
okrId: detailInfo.workId,
|
|
190
|
-
okrType: detailInfo.okrType
|
|
191
|
-
});
|
|
192
|
-
},
|
|
193
|
-
onChangeOkrFollow: function () {
|
|
194
|
-
var _onChangeOkrFollow = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(follow) {
|
|
195
|
-
var res;
|
|
196
|
-
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
197
|
-
while (1) {
|
|
198
|
-
switch (_context3.prev = _context3.next) {
|
|
199
|
-
case 0:
|
|
200
|
-
_context3.next = 2;
|
|
201
|
-
return (0, _confirm["default"])(follow ? (0, _getLocale.getLocale)("OKR_MyO_Err_Focuson") : (0, _getLocale.getLocale)("OKR_MyO_Err_Unfollow"), follow ? (0, _getLocale.getLocale)("OKR_MyO_Err_Payatten") : (0, _getLocale.getLocale)("OKR_MyO_Err_Progress"));
|
|
202
|
-
|
|
203
|
-
case 2:
|
|
204
|
-
res = _context3.sent;
|
|
174
|
+
return openShareModal;
|
|
175
|
+
}(),
|
|
176
|
+
changeVisiblilty: function changeVisiblilty(visibility) {
|
|
177
|
+
if (visibility === 4) {
|
|
178
|
+
if (userSelectRef.current) {
|
|
179
|
+
userSelectRef.current.open();
|
|
180
|
+
}
|
|
205
181
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
break;
|
|
209
|
-
}
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
210
184
|
|
|
211
|
-
|
|
212
|
-
|
|
185
|
+
changVisiblity(detailInfo.workId, visibility);
|
|
186
|
+
},
|
|
187
|
+
onDeleteOkr: function onDeleteOkr(e) {
|
|
188
|
+
popRef.current.getRef().show(e.target);
|
|
189
|
+
},
|
|
190
|
+
onCopyOkr: function onCopyOkr() {
|
|
191
|
+
// @ts-ignore
|
|
192
|
+
window.openCopyOkrModal({
|
|
193
|
+
okrId: detailInfo.workId,
|
|
194
|
+
okrType: detailInfo.okrType
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
onChangeOkrFollow: function () {
|
|
198
|
+
var _onChangeOkrFollow = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(follow) {
|
|
199
|
+
var res;
|
|
200
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
201
|
+
while (1) {
|
|
202
|
+
switch (_context3.prev = _context3.next) {
|
|
203
|
+
case 0:
|
|
204
|
+
_context3.next = 2;
|
|
205
|
+
return (0, _confirm["default"])(follow ? (0, _getLocale.getLocale)('OKR_MyO_Err_Focuson') : (0, _getLocale.getLocale)('OKR_MyO_Err_Unfollow'), follow ? (0, _getLocale.getLocale)('OKR_MyO_Err_Payatten') : (0, _getLocale.getLocale)('OKR_MyO_Err_Progress'));
|
|
206
|
+
|
|
207
|
+
case 2:
|
|
208
|
+
res = _context3.sent;
|
|
209
|
+
|
|
210
|
+
if (!res) {
|
|
211
|
+
_context3.next = 14;
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if (!follow) {
|
|
216
|
+
_context3.next = 9;
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
_context3.next = 7;
|
|
221
|
+
return (0, _requestApis.addUser)(loginUserId, detailInfo.workId, 3);
|
|
222
|
+
|
|
223
|
+
case 7:
|
|
224
|
+
_context3.next = 11;
|
|
213
225
|
break;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
_context3.next = 7;
|
|
217
|
-
return (0, _requestApis.addUser)(loginUserId, detailInfo.workId, 3);
|
|
218
226
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
227
|
+
case 9:
|
|
228
|
+
_context3.next = 11;
|
|
229
|
+
return (0, _requestApis.deleteUser)(loginUserId, detailInfo.workId, 3);
|
|
222
230
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
return (0, _requestApis.deleteUser)(loginUserId, detailInfo.workId, 3);
|
|
231
|
+
case 11:
|
|
232
|
+
context.setGeneralRoleType(follow ? 3 : 0); // 关注
|
|
226
233
|
|
|
227
|
-
|
|
228
|
-
context.setGeneralRoleType(follow ? 3 : 0); // 关注
|
|
234
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
|
|
229
235
|
|
|
230
|
-
|
|
236
|
+
if (!follow) {
|
|
237
|
+
commonContext.refreshAll();
|
|
238
|
+
}
|
|
231
239
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
case 14:
|
|
237
|
-
case "end":
|
|
238
|
-
return _context3.stop();
|
|
240
|
+
case 14:
|
|
241
|
+
case "end":
|
|
242
|
+
return _context3.stop();
|
|
243
|
+
}
|
|
239
244
|
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}));
|
|
243
|
-
|
|
244
|
-
function onChangeOkrFollow(_x3) {
|
|
245
|
-
return _onChangeOkrFollow.apply(this, arguments);
|
|
246
|
-
}
|
|
245
|
+
}, _callee3);
|
|
246
|
+
}));
|
|
247
247
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
var _onFinishOrReOpen = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(isFinish) {
|
|
252
|
-
var res;
|
|
253
|
-
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
254
|
-
while (1) {
|
|
255
|
-
switch (_context4.prev = _context4.next) {
|
|
256
|
-
case 0:
|
|
257
|
-
_context4.next = 2;
|
|
258
|
-
return (0, _confirm["default"])(isFinish ? (0, _getLocale.getLocale)("OKR_MyO_Areycloseobjective") : (0, _getLocale.getLocale)("OKR_MyO_Err_Restart"));
|
|
259
|
-
|
|
260
|
-
case 2:
|
|
261
|
-
res = _context4.sent;
|
|
262
|
-
|
|
263
|
-
if (!res) {
|
|
264
|
-
_context4.next = 13;
|
|
265
|
-
break;
|
|
266
|
-
}
|
|
248
|
+
function onChangeOkrFollow(_x3) {
|
|
249
|
+
return _onChangeOkrFollow.apply(this, arguments);
|
|
250
|
+
}
|
|
267
251
|
|
|
268
|
-
|
|
269
|
-
|
|
252
|
+
return onChangeOkrFollow;
|
|
253
|
+
}(),
|
|
254
|
+
onFinishOrReOpen: function () {
|
|
255
|
+
var _onFinishOrReOpen = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(isFinish) {
|
|
256
|
+
var res;
|
|
257
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
258
|
+
while (1) {
|
|
259
|
+
switch (_context4.prev = _context4.next) {
|
|
260
|
+
case 0:
|
|
261
|
+
_context4.next = 2;
|
|
262
|
+
return (0, _confirm["default"])(isFinish ? (0, _getLocale.getLocale)('OKR_MyO_Areycloseobjective') : (0, _getLocale.getLocale)('OKR_MyO_Err_Restart'));
|
|
263
|
+
|
|
264
|
+
case 2:
|
|
265
|
+
res = _context4.sent;
|
|
266
|
+
|
|
267
|
+
if (!res) {
|
|
268
|
+
_context4.next = 13;
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
if (!isFinish) {
|
|
273
|
+
_context4.next = 9;
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
_context4.next = 7;
|
|
278
|
+
return (0, _requestApis.close)(detailInfo.workId);
|
|
279
|
+
|
|
280
|
+
case 7:
|
|
281
|
+
_context4.next = 11;
|
|
270
282
|
break;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
_context4.next = 7;
|
|
274
|
-
return (0, _requestApis.close)(detailInfo.workId);
|
|
275
283
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
284
|
+
case 9:
|
|
285
|
+
_context4.next = 11;
|
|
286
|
+
return (0, _requestApis.start)(detailInfo.workId);
|
|
279
287
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return (0, _requestApis.start)(detailInfo.workId);
|
|
288
|
+
case 11:
|
|
289
|
+
commonContext.refreshAll(); // 刷新
|
|
283
290
|
|
|
284
|
-
|
|
285
|
-
commonContext.refreshAll(); // 刷新
|
|
291
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
|
|
286
292
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
return _context4.stop();
|
|
293
|
+
case 13:
|
|
294
|
+
case "end":
|
|
295
|
+
return _context4.stop();
|
|
296
|
+
}
|
|
292
297
|
}
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}));
|
|
298
|
+
}, _callee4);
|
|
299
|
+
}));
|
|
296
300
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
return onFinishOrReOpen;
|
|
302
|
-
}(),
|
|
303
|
-
onQuit: function () {
|
|
304
|
-
var _onQuit = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
305
|
-
var res;
|
|
306
|
-
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
307
|
-
while (1) {
|
|
308
|
-
switch (_context5.prev = _context5.next) {
|
|
309
|
-
case 0:
|
|
310
|
-
_context5.next = 2;
|
|
311
|
-
return (0, _confirm["default"])((0, _getLocale.getLocale)("OKR_MyO_Err_Quit"), (0, _getLocale.getLocale)("OKR_MyO_Err_Inchargec"));
|
|
312
|
-
|
|
313
|
-
case 2:
|
|
314
|
-
res = _context5.sent;
|
|
315
|
-
|
|
316
|
-
if (!res) {
|
|
317
|
-
_context5.next = 8;
|
|
318
|
-
break;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
_context5.next = 6;
|
|
322
|
-
return (0, _requestApis.deleteUser)(loginUserId, detailInfo.workId, 2);
|
|
323
|
-
|
|
324
|
-
case 6:
|
|
325
|
-
// context.setGeneralRoleType(0)
|
|
326
|
-
commonContext.refreshAll(); // 刷新
|
|
327
|
-
|
|
328
|
-
_toast["default"].Success((0, _getLocale.getLocale)("Mod_Successfuloperat"));
|
|
301
|
+
function onFinishOrReOpen(_x4) {
|
|
302
|
+
return _onFinishOrReOpen.apply(this, arguments);
|
|
303
|
+
}
|
|
329
304
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
305
|
+
return onFinishOrReOpen;
|
|
306
|
+
}(),
|
|
307
|
+
onQuit: function () {
|
|
308
|
+
var _onQuit = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
309
|
+
var res;
|
|
310
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
311
|
+
while (1) {
|
|
312
|
+
switch (_context5.prev = _context5.next) {
|
|
313
|
+
case 0:
|
|
314
|
+
_context5.next = 2;
|
|
315
|
+
return (0, _confirm["default"])((0, _getLocale.getLocale)('OKR_MyO_Err_Quit'), (0, _getLocale.getLocale)('OKR_MyO_Err_Inchargec'));
|
|
316
|
+
|
|
317
|
+
case 2:
|
|
318
|
+
res = _context5.sent;
|
|
319
|
+
|
|
320
|
+
if (!res) {
|
|
321
|
+
_context5.next = 8;
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
_context5.next = 6;
|
|
326
|
+
return (0, _requestApis.deleteUser)(loginUserId, detailInfo.workId, 2);
|
|
327
|
+
|
|
328
|
+
case 6:
|
|
329
|
+
// context.setGeneralRoleType(0)
|
|
330
|
+
commonContext.refreshAll(); // 刷新
|
|
331
|
+
|
|
332
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
|
|
333
|
+
|
|
334
|
+
case 8:
|
|
335
|
+
case "end":
|
|
336
|
+
return _context5.stop();
|
|
337
|
+
}
|
|
333
338
|
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}));
|
|
339
|
+
}, _callee5);
|
|
340
|
+
}));
|
|
337
341
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
342
|
+
function onQuit() {
|
|
343
|
+
return _onQuit.apply(this, arguments);
|
|
344
|
+
}
|
|
341
345
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
346
|
+
return onQuit;
|
|
347
|
+
}()
|
|
348
|
+
});
|
|
349
|
+
}
|
|
345
350
|
}, [detailInfo, context.generalRoleType, context.generalPrincipalUser, context.generalVisibility.visibility]);
|
|
346
351
|
var parent = null;
|
|
347
352
|
|
|
348
353
|
if (context.generalParent) {
|
|
349
354
|
if (context.generalParent.parentKr) {
|
|
350
355
|
parent = {
|
|
351
|
-
type:
|
|
356
|
+
type: 'kr',
|
|
352
357
|
id: context.generalParent.parentKr.mileStoneId,
|
|
353
358
|
name: context.generalParent.parentKr.mileStoneName
|
|
354
359
|
};
|
|
355
360
|
} else if (context.generalParent.parentOkr) {
|
|
356
361
|
parent = {
|
|
357
|
-
type:
|
|
362
|
+
type: 'okr',
|
|
358
363
|
id: context.generalParent.parentOkr.workId,
|
|
359
364
|
name: context.generalParent.parentOkr.workName
|
|
360
365
|
};
|
|
@@ -363,19 +368,24 @@ function OkrDetailHeader(_ref) {
|
|
|
363
368
|
|
|
364
369
|
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_drawer["default"].Header, {
|
|
365
370
|
actions: actions,
|
|
371
|
+
actionComponent: /*#__PURE__*/_react["default"].createElement(_wechatBtn["default"], {
|
|
372
|
+
id: detailInfo.workId,
|
|
373
|
+
objType: 62,
|
|
374
|
+
name: detailInfo.workName
|
|
375
|
+
}),
|
|
366
376
|
content: parent ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
367
377
|
className: "okr-detail-head-parent"
|
|
368
378
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
369
379
|
className: "tu-icon-liebiao-duiqinubiao"
|
|
370
380
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
371
381
|
onClick: function onClick() {
|
|
372
|
-
return parent.type ===
|
|
382
|
+
return parent.type === 'okr' ? _drawerManager["default"].open('okrDetail', {
|
|
373
383
|
okrId: parent.id
|
|
374
|
-
}) : _drawerManager["default"].open(
|
|
384
|
+
}) : _drawerManager["default"].open('krDetail', {
|
|
375
385
|
krId: parent.id
|
|
376
386
|
});
|
|
377
387
|
}
|
|
378
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, parent.type ===
|
|
388
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, parent.type === 'okr' ? 'O ' : 'KR '), parent.name)) : null
|
|
379
389
|
}), /*#__PURE__*/_react["default"].createElement(_okrShare["default"], {
|
|
380
390
|
visible: shareVisible,
|
|
381
391
|
onClose: closeShareModal,
|
|
@@ -412,7 +422,7 @@ function OkrDetailHeader(_ref) {
|
|
|
412
422
|
});
|
|
413
423
|
|
|
414
424
|
case 2:
|
|
415
|
-
_toast["default"].Success((0, _getLocale.getLocale)(
|
|
425
|
+
_toast["default"].Success((0, _getLocale.getLocale)('Pro_detail_Deletsuccess'));
|
|
416
426
|
|
|
417
427
|
setTimeout(function () {
|
|
418
428
|
commonContext.refreshAll();
|
|
@@ -436,7 +446,7 @@ function OkrDetailHeader(_ref) {
|
|
|
436
446
|
})
|
|
437
447
|
}, /*#__PURE__*/_react["default"].createElement("span", null)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
438
448
|
style: {
|
|
439
|
-
textAlign:
|
|
449
|
+
textAlign: 'right',
|
|
440
450
|
height: 0
|
|
441
451
|
}
|
|
442
452
|
}, /*#__PURE__*/_react["default"].createElement(_userSelector["default"], {
|
|
@@ -450,9 +460,9 @@ function OkrDetailHeader(_ref) {
|
|
|
450
460
|
selectNodes: context.generalVisibility.visibilityScope || {},
|
|
451
461
|
trigger: /*#__PURE__*/_react["default"].createElement("div", {
|
|
452
462
|
style: {
|
|
453
|
-
visibility:
|
|
463
|
+
visibility: 'hidden',
|
|
454
464
|
zIndex: -1,
|
|
455
|
-
display:
|
|
465
|
+
display: 'inline-block',
|
|
456
466
|
height: 0
|
|
457
467
|
}
|
|
458
468
|
}, "empty select")
|
|
@@ -17,6 +17,8 @@ var _header = _interopRequireDefault(require("./components/header"));
|
|
|
17
17
|
|
|
18
18
|
var _tabs = _interopRequireWildcard(require("../tabs"));
|
|
19
19
|
|
|
20
|
+
var _request = require("../../utils/request");
|
|
21
|
+
|
|
20
22
|
var _tabPanelContent = _interopRequireDefault(require("./components/tab-panel-content"));
|
|
21
23
|
|
|
22
24
|
var _baseInfo = _interopRequireDefault(require("./base-info"));
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
15
|
+
|
|
16
|
+
var _dialogConfirm = _interopRequireWildcard(require("../dialog-confirm"));
|
|
17
|
+
|
|
18
|
+
var _getLocale = require("../../utils/getLocale");
|
|
19
|
+
|
|
20
|
+
var _request = require("../../utils/request");
|
|
21
|
+
|
|
22
|
+
require("./index.css");
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
|
+
|
|
34
|
+
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."); }
|
|
35
|
+
|
|
36
|
+
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); }
|
|
37
|
+
|
|
38
|
+
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; }
|
|
39
|
+
|
|
40
|
+
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; }
|
|
41
|
+
|
|
42
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
43
|
+
|
|
44
|
+
var preCls = 'titaui-wechat-btn';
|
|
45
|
+
|
|
46
|
+
var WeChatBtn = function WeChatBtn(props) {
|
|
47
|
+
var id = props.id,
|
|
48
|
+
objType = props.objType,
|
|
49
|
+
name = props.name;
|
|
50
|
+
|
|
51
|
+
var _useState = (0, _react.useState)(false),
|
|
52
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
53
|
+
isShowWeChat = _useState2[0],
|
|
54
|
+
setIsShowWeChat = _useState2[1];
|
|
55
|
+
|
|
56
|
+
var _useState3 = (0, _react.useState)([]),
|
|
57
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
58
|
+
weChatGroupMember = _useState4[0],
|
|
59
|
+
setWeChatGroupMember = _useState4[1];
|
|
60
|
+
|
|
61
|
+
var _useState5 = (0, _react.useState)('chatId'),
|
|
62
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
63
|
+
chatId = _useState6[0],
|
|
64
|
+
setChatId = _useState6[1];
|
|
65
|
+
|
|
66
|
+
var _useState7 = (0, _react.useState)(),
|
|
67
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
68
|
+
loginUserOpenId = _useState8[0],
|
|
69
|
+
setLoginUserOpenId = _useState8[1];
|
|
70
|
+
|
|
71
|
+
var _useState9 = (0, _react.useState)(''),
|
|
72
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
73
|
+
url = _useState10[0],
|
|
74
|
+
setUrl = _useState10[1];
|
|
75
|
+
|
|
76
|
+
var _useState11 = (0, _react.useState)(false),
|
|
77
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
78
|
+
createWechatVisible = _useState12[0],
|
|
79
|
+
setCreateWechatVisible = _useState12[1];
|
|
80
|
+
|
|
81
|
+
var _useState13 = (0, _react.useState)(''),
|
|
82
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
83
|
+
tooltip = _useState14[0],
|
|
84
|
+
setTooltip = _useState14[1];
|
|
85
|
+
|
|
86
|
+
var _useState15 = (0, _react.useState)("目标"),
|
|
87
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
88
|
+
apply = _useState16[0],
|
|
89
|
+
setApply = _useState16[1];
|
|
90
|
+
|
|
91
|
+
var _useState17 = (0, _react.useState)(false),
|
|
92
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
93
|
+
isHasGroup = _useState18[0],
|
|
94
|
+
setIsHasGroup = _useState18[1];
|
|
95
|
+
|
|
96
|
+
var isWx = navigator.userAgent.match(/wxwork/);
|
|
97
|
+
|
|
98
|
+
var handleClickWechatBtn = function handleClickWechatBtn() {
|
|
99
|
+
if (isWx) {
|
|
100
|
+
//有群了,判断没在群就先进群再打开群
|
|
101
|
+
if (chatId !== null && chatId !== 'chatId') {
|
|
102
|
+
wx.invoke('openExistedChatWithMsg', {
|
|
103
|
+
chatId: chatId
|
|
104
|
+
}, function (res) {
|
|
105
|
+
if (res.err_msg === 'openExistedChatWithMsg:fail_fail_Invalid_chatId') {
|
|
106
|
+
wx.invoke('updateEnterpriseChat', {
|
|
107
|
+
chatId: chatId,
|
|
108
|
+
userIdsToAdd: loginUserOpenId
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
} else {
|
|
113
|
+
setCreateWechatVisible(true);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
var closeCreateWeChatModal = function closeCreateWeChatModal() {
|
|
119
|
+
setCreateWechatVisible(false);
|
|
120
|
+
}; //创建群聊or打开群聊
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
var handleCreateGroupChat = function handleCreateGroupChat() {
|
|
124
|
+
wx.invoke('createChatWithMsg', {
|
|
125
|
+
selectedOpenUserIds: weChatGroupMember,
|
|
126
|
+
chatName: "\u300C".concat(apply, "\u7FA4\u300D").concat(name),
|
|
127
|
+
msg: {
|
|
128
|
+
msgtype: 'link',
|
|
129
|
+
link: {
|
|
130
|
+
title: name,
|
|
131
|
+
desc: '',
|
|
132
|
+
url: url,
|
|
133
|
+
imgUrl: 'https://club.tita.com/wp-content/uploads/2022/03/1648725106-20220331191146996.png'
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}, function (res) {
|
|
137
|
+
if (res.err_msg === 'createChatWithMsg:ok') {
|
|
138
|
+
if (res.chatId) {
|
|
139
|
+
(0, _request.rpost)('v1')('chat/add', {
|
|
140
|
+
objId: id,
|
|
141
|
+
objType: objType,
|
|
142
|
+
chatId: res.chatId
|
|
143
|
+
});
|
|
144
|
+
wx.invoke('openExistedChatWithMsg', {
|
|
145
|
+
chatId: res.chatId
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
setCreateWechatVisible(false);
|
|
151
|
+
}; //chatId 为null表示未创建群聊 chatId为默认值chatId表示不是企业微信工作台,可能是其他浏览器等 chatId有值,表示创建了群聊
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
(0, _react.useEffect)(function () {
|
|
155
|
+
(0, _request.rpost)('v1')('chat/info', {
|
|
156
|
+
objId: id,
|
|
157
|
+
objType: objType
|
|
158
|
+
}).then(function (res) {
|
|
159
|
+
if (res.Message === '没有权限') {
|
|
160
|
+
setIsShowWeChat(false);
|
|
161
|
+
return;
|
|
162
|
+
} else {
|
|
163
|
+
setIsShowWeChat(true);
|
|
164
|
+
|
|
165
|
+
if (res.Data.obj) {
|
|
166
|
+
setIsHasGroup(true);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (isWx) {
|
|
170
|
+
setChatId(res.Data.obj);
|
|
171
|
+
(0, _request.rpost)('v1')('chat/users', {
|
|
172
|
+
objId: id,
|
|
173
|
+
objType: objType
|
|
174
|
+
}).then(function (res) {
|
|
175
|
+
setWeChatGroupMember(res.Data.openUserIds);
|
|
176
|
+
setUrl(res.Data.link);
|
|
177
|
+
});
|
|
178
|
+
(0, _request.rpost)('v1')('chat/user', {
|
|
179
|
+
objId: id,
|
|
180
|
+
objType: objType
|
|
181
|
+
}).then(function (res) {
|
|
182
|
+
setLoginUserOpenId(res.Data.obj);
|
|
183
|
+
});
|
|
184
|
+
} else {
|
|
185
|
+
setIsShowWeChat(true);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}, [chatId]);
|
|
191
|
+
(0, _react.useEffect)(function () {
|
|
192
|
+
if (isShowWeChat && chatId === null) {
|
|
193
|
+
setTooltip((0, _getLocale.getLocale)('OKR_Db_ClickWeComg'));
|
|
194
|
+
} else if (isShowWeChat && chatId !== null && chatId !== 'chatId') {
|
|
195
|
+
setTooltip('进入群聊');
|
|
196
|
+
} else if (isShowWeChat && chatId === 'chatId') {
|
|
197
|
+
setTooltip('浏览器不支持此功能,请到企业微信工作台中使用');
|
|
198
|
+
}
|
|
199
|
+
}, [chatId, isShowWeChat]);
|
|
200
|
+
(0, _react.useEffect)(function () {
|
|
201
|
+
if (objType === 62) {
|
|
202
|
+
setApply("目标");
|
|
203
|
+
} else {
|
|
204
|
+
setApply("任务");
|
|
205
|
+
}
|
|
206
|
+
}, []);
|
|
207
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
208
|
+
overlay: tooltip,
|
|
209
|
+
placement: "bottom"
|
|
210
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
211
|
+
className: (0, _classnames["default"])(preCls, 'tu-icon-qw-chat', _defineProperty({}, "".concat(preCls, "__chat"), isHasGroup)),
|
|
212
|
+
onMouseDown: handleClickWechatBtn
|
|
213
|
+
})), /*#__PURE__*/_react["default"].createElement(_dialogConfirm["default"], {
|
|
214
|
+
zIndex: 1200,
|
|
215
|
+
visible: createWechatVisible,
|
|
216
|
+
type: "warning"
|
|
217
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
218
|
+
type: "title"
|
|
219
|
+
}, "\u786E\u5B9A\u53D1\u8D77\u7FA4\u804A\u5417"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
220
|
+
type: "content"
|
|
221
|
+
}, "\u53EF\u9009\u62E9".concat(apply, "\u76F8\u5173\u4EBA\u5458\u5FEB\u901F\u5EFA\u7FA4\u6C9F\u901A\u3002\u6CE8\u610F\uFF0C\u81F3\u5C11\u9009\u62E9 3 \u4EBA\uFF0C\u624D\u80FD\u6B63\u5E38\u53D1\u8D77\u7FA4\u804A\u3002")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.CancelButton, {
|
|
222
|
+
type: "button",
|
|
223
|
+
onClick: closeCreateWeChatModal
|
|
224
|
+
}, "\u53D6\u6D88"), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.SureButton, {
|
|
225
|
+
type: "button",
|
|
226
|
+
onClick: handleCreateGroupChat
|
|
227
|
+
}, "\u53D1\u8D77\u7FA4\u804A")));
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
var _default = WeChatBtn;
|
|
231
|
+
exports["default"] = _default;
|
package/lib/index.js
CHANGED
|
@@ -531,6 +531,12 @@ Object.defineProperty(exports, "VideoModal", {
|
|
|
531
531
|
return _videoModal["default"];
|
|
532
532
|
}
|
|
533
533
|
});
|
|
534
|
+
Object.defineProperty(exports, "WechatBtn", {
|
|
535
|
+
enumerable: true,
|
|
536
|
+
get: function get() {
|
|
537
|
+
return _wechatBtn["default"];
|
|
538
|
+
}
|
|
539
|
+
});
|
|
534
540
|
Object.defineProperty(exports, "WeeklyReport", {
|
|
535
541
|
enumerable: true,
|
|
536
542
|
get: function get() {
|
|
@@ -766,4 +772,6 @@ var _videoModal = _interopRequireDefault(require("./components/video-modal"));
|
|
|
766
772
|
|
|
767
773
|
var _supersetCharts = _interopRequireDefault(require("./components/superset-charts"));
|
|
768
774
|
|
|
775
|
+
var _wechatBtn = _interopRequireDefault(require("./components/wechat-btn"));
|
|
776
|
+
|
|
769
777
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|