@titaui/pc 1.10.82-beta.6 → 1.10.82-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/.husky/pre-commit
CHANGED
|
@@ -371,7 +371,8 @@ function OkrDetailHeader(_ref) {
|
|
|
371
371
|
actionComponent: /*#__PURE__*/_react["default"].createElement(_wechatBtn["default"], {
|
|
372
372
|
id: detailInfo.workId,
|
|
373
373
|
objType: 62,
|
|
374
|
-
name: detailInfo.workName
|
|
374
|
+
name: detailInfo.workName,
|
|
375
|
+
principalUser: detailInfo.principalUser
|
|
375
376
|
}),
|
|
376
377
|
content: parent ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
377
378
|
className: "okr-detail-head-parent"
|
|
@@ -46,7 +46,8 @@ var preCls = 'titaui-wechat-btn';
|
|
|
46
46
|
var WeChatBtn = function WeChatBtn(props) {
|
|
47
47
|
var id = props.id,
|
|
48
48
|
objType = props.objType,
|
|
49
|
-
name = props.name
|
|
49
|
+
name = props.name,
|
|
50
|
+
principalUser = props.principalUser;
|
|
50
51
|
|
|
51
52
|
var _useState = (0, _react.useState)(false),
|
|
52
53
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -83,7 +84,7 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
83
84
|
tooltip = _useState14[0],
|
|
84
85
|
setTooltip = _useState14[1];
|
|
85
86
|
|
|
86
|
-
var _useState15 = (0, _react.useState)(
|
|
87
|
+
var _useState15 = (0, _react.useState)('目标'),
|
|
87
88
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
88
89
|
apply = _useState16[0],
|
|
89
90
|
setApply = _useState16[1];
|
|
@@ -93,37 +94,53 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
93
94
|
isHasGroup = _useState18[0],
|
|
94
95
|
setIsHasGroup = _useState18[1];
|
|
95
96
|
|
|
97
|
+
var _useState19 = (0, _react.useState)(false),
|
|
98
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
99
|
+
macWarnModalVisible = _useState20[0],
|
|
100
|
+
setMacWarnModalVisible = _useState20[1];
|
|
101
|
+
|
|
102
|
+
var _useState21 = (0, _react.useState)(false),
|
|
103
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
104
|
+
principalUserModalVisible = _useState22[0],
|
|
105
|
+
setPrincipalUserModalVisible = _useState22[1];
|
|
106
|
+
|
|
107
|
+
var _useState23 = (0, _react.useState)(false),
|
|
108
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
109
|
+
memberVisible = _useState24[0],
|
|
110
|
+
setMemberVisible = _useState24[1];
|
|
111
|
+
|
|
96
112
|
var isWx = navigator.userAgent.match(/wxwork/);
|
|
113
|
+
var isMac = navigator.userAgent.match(/Mac/);
|
|
97
114
|
|
|
98
115
|
var handleClickWechatBtn = function handleClickWechatBtn() {
|
|
99
116
|
if (isWx) {
|
|
100
117
|
//有群了,判断没在群就先进群再打开群
|
|
101
118
|
if (chatId !== null && chatId !== 'chatId') {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
// {
|
|
105
|
-
// chatId: chatId,
|
|
106
|
-
// },
|
|
107
|
-
// function (res) {
|
|
108
|
-
// if (
|
|
109
|
-
// res.err_msg === 'openExistedChatWithMsg:fail_fail_Invalid_chatId'
|
|
110
|
-
// ) {
|
|
111
|
-
// wx.invoke(
|
|
112
|
-
// 'updateEnterpriseChat',
|
|
113
|
-
// {
|
|
114
|
-
// chatId: chatId,
|
|
115
|
-
// userIdsToAdd: loginUserOpenId,
|
|
116
|
-
// },
|
|
117
|
-
// )
|
|
118
|
-
// }
|
|
119
|
-
// },
|
|
120
|
-
// )
|
|
121
|
-
wx.invoke('updateEnterpriseChat', {
|
|
122
|
-
chatId: chatId,
|
|
123
|
-
userIdsToAdd: loginUserOpenId
|
|
119
|
+
wx.invoke('openExistedChatWithMsg', {
|
|
120
|
+
chatId: chatId
|
|
124
121
|
}, function (res) {
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
if (res.err_msg === 'openExistedChatWithMsg:ok') {
|
|
123
|
+
console.log("打开群成功");
|
|
124
|
+
} else {
|
|
125
|
+
if (isMac) {
|
|
126
|
+
setMacWarnModalVisible(true);
|
|
127
|
+
} else {
|
|
128
|
+
wx.invoke('updateEnterpriseChat', {
|
|
129
|
+
chatId: chatId,
|
|
130
|
+
userIdsToAdd: loginUserOpenId
|
|
131
|
+
}, function (res) {
|
|
132
|
+
if (res.err_msg == 'updateEnterpriseChat:ok') {
|
|
133
|
+
console.log('加入成功');
|
|
134
|
+
} else {
|
|
135
|
+
if (loginUserOpenId !== principalUser.userId) {
|
|
136
|
+
setPrincipalUserModalVisible(true);
|
|
137
|
+
} else {
|
|
138
|
+
setMemberVisible(true);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
127
144
|
});
|
|
128
145
|
} else {
|
|
129
146
|
setCreateWechatVisible(true);
|
|
@@ -164,6 +181,19 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
164
181
|
}
|
|
165
182
|
});
|
|
166
183
|
setCreateWechatVisible(false);
|
|
184
|
+
setPrincipalUserModalVisible(false);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
var handleKnowMacWarn = function handleKnowMacWarn() {
|
|
188
|
+
setMacWarnModalVisible(false);
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
var closeprincipalUserModal = function closeprincipalUserModal() {
|
|
192
|
+
setPrincipalUserModalVisible(false);
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
var handleMemberVisible = function handleMemberVisible() {
|
|
196
|
+
setMemberVisible(false);
|
|
167
197
|
}; //chatId 为null表示未创建群聊 chatId为默认值chatId表示不是企业微信工作台,可能是其他浏览器等 chatId有值,表示创建了群聊
|
|
168
198
|
|
|
169
199
|
|
|
@@ -215,16 +245,16 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
215
245
|
}, [chatId, isShowWeChat]);
|
|
216
246
|
(0, _react.useEffect)(function () {
|
|
217
247
|
if (objType === 62) {
|
|
218
|
-
setApply(
|
|
248
|
+
setApply('目标');
|
|
219
249
|
} else {
|
|
220
|
-
setApply(
|
|
250
|
+
setApply('任务');
|
|
221
251
|
}
|
|
222
252
|
}, []);
|
|
223
253
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
224
254
|
overlay: tooltip,
|
|
225
255
|
placement: "bottom"
|
|
226
256
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
227
|
-
className: (0, _classnames["default"])(preCls,
|
|
257
|
+
className: (0, _classnames["default"])(preCls, _defineProperty({}, "".concat(preCls, "__chat"), isHasGroup), _defineProperty({}, 'tu-icon-qw-chat', isShowWeChat)),
|
|
228
258
|
onMouseDown: handleClickWechatBtn
|
|
229
259
|
})), /*#__PURE__*/_react["default"].createElement(_dialogConfirm["default"], {
|
|
230
260
|
zIndex: 1200,
|
|
@@ -240,7 +270,43 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
240
270
|
}, "\u53D6\u6D88"), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.SureButton, {
|
|
241
271
|
type: "button",
|
|
242
272
|
onClick: handleCreateGroupChat
|
|
243
|
-
}, "\u53D1\u8D77\u7FA4\u804A"))
|
|
273
|
+
}, "\u53D1\u8D77\u7FA4\u804A")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm["default"], {
|
|
274
|
+
zIndex: 1200,
|
|
275
|
+
visible: macWarnModalVisible,
|
|
276
|
+
type: "warning"
|
|
277
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
278
|
+
type: "title"
|
|
279
|
+
}, "\u8BF7\u6CE8\u610F"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
280
|
+
type: "content"
|
|
281
|
+
}, "\u8BE5\u4F01\u4E1A\u5FAE\u4FE1\u7248\u672C\u4E0D\u652F\u6301\u81EA\u52A8\u52A0\u5165\uFF0C\u8BF7\u8054\u7CFB".concat(apply, "\u8D1F\u8D23\u4EBA\u624B\u52A8\u52A0\u4F60\u5165\u7FA4")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.SureButton, {
|
|
282
|
+
type: "button",
|
|
283
|
+
onClick: handleKnowMacWarn
|
|
284
|
+
}, "\u6211\u77E5\u9053\u4E86")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm["default"], {
|
|
285
|
+
zIndex: 1200,
|
|
286
|
+
visible: principalUserModalVisible,
|
|
287
|
+
type: "warning"
|
|
288
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
289
|
+
type: "title"
|
|
290
|
+
}, "\u8BF7\u6CE8\u610F"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
291
|
+
type: "content"
|
|
292
|
+
}, "\u4F60\u5DF2\u9000\u7FA4\u6216\u8BE5\u7FA4\u5DF2\u89E3\u6563\u3002\u53EF\u4EE5\u8054\u7CFB".concat(apply, "\u6210\u5458\u62C9\u4F60\u5165\u7FA4\u3002\u4F60\u4E5F\u53EF\u4EE5\u91CD\u65B0\u5EFA\u7FA4\u3002")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.CancelButton, {
|
|
293
|
+
type: "button",
|
|
294
|
+
onClick: closeprincipalUserModal
|
|
295
|
+
}, "\u53D6\u6D88"), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.SureButton, {
|
|
296
|
+
type: "button",
|
|
297
|
+
onClick: handleCreateGroupChat
|
|
298
|
+
}, "\u53D1\u8D77\u7FA4\u804A")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm["default"], {
|
|
299
|
+
zIndex: 1200,
|
|
300
|
+
visible: memberVisible,
|
|
301
|
+
type: "warning"
|
|
302
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
303
|
+
type: "title"
|
|
304
|
+
}, "\u8BF7\u6CE8\u610F"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
305
|
+
type: "content"
|
|
306
|
+
}, "\u4F60\u5DF2\u9000\u7FA4\u6216\u8BE5\u7FA4\u5DF2\u89E3\u6563\u3002\u53EF\u4EE5\u8054\u7CFB".concat(apply, "\u6210\u5458\u62C9\u4F60\u5165\u7FA4\u3002")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.SureButton, {
|
|
307
|
+
type: "button",
|
|
308
|
+
onClick: handleMemberVisible
|
|
309
|
+
}, "\u6211\u77E5\u9053\u4E86")));
|
|
244
310
|
};
|
|
245
311
|
|
|
246
312
|
var _default = WeChatBtn;
|