@titaui/pc 1.10.82-beta.2 → 1.10.82-beta.3
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.
|
@@ -27,6 +27,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
27
27
|
|
|
28
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
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
|
+
|
|
30
32
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
33
|
|
|
32
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."); }
|
|
@@ -81,6 +83,16 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
81
83
|
tooltip = _useState14[0],
|
|
82
84
|
setTooltip = _useState14[1];
|
|
83
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
|
+
|
|
84
96
|
var isWx = navigator.userAgent.match(/wxwork/);
|
|
85
97
|
|
|
86
98
|
var handleClickWechatBtn = function handleClickWechatBtn() {
|
|
@@ -88,31 +100,18 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
88
100
|
//有群了,判断没在群就先进群再打开群
|
|
89
101
|
if (chatId !== null && chatId !== 'chatId') {
|
|
90
102
|
wx.invoke('openExistedChatWithMsg', {
|
|
91
|
-
chatId: chatId
|
|
92
|
-
msg: {
|
|
93
|
-
msgtype: 'link',
|
|
94
|
-
link: {
|
|
95
|
-
title: name,
|
|
96
|
-
desc: 'desc1',
|
|
97
|
-
url: 'link1',
|
|
98
|
-
imgUrl: 'imgurl1'
|
|
99
|
-
}
|
|
100
|
-
}
|
|
103
|
+
chatId: chatId
|
|
101
104
|
}, function (res) {
|
|
102
105
|
if (res.err_msg === 'openExistedChatWithMsg:fail_fail_Invalid_chatId') {
|
|
103
106
|
wx.invoke('updateEnterpriseChat', {
|
|
104
107
|
chatId: chatId,
|
|
105
108
|
userIdsToAdd: loginUserOpenId
|
|
106
|
-
}, function (res) {
|
|
107
|
-
if (res.err_msg === 'updateEnterpriseChat:ok') {}
|
|
108
109
|
});
|
|
109
110
|
}
|
|
110
111
|
});
|
|
111
112
|
} else {
|
|
112
113
|
setCreateWechatVisible(true);
|
|
113
114
|
}
|
|
114
|
-
} else {
|
|
115
|
-
return;
|
|
116
115
|
}
|
|
117
116
|
};
|
|
118
117
|
|
|
@@ -128,14 +127,14 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
128
127
|
msg: {
|
|
129
128
|
msgtype: 'link',
|
|
130
129
|
link: {
|
|
131
|
-
title: name,
|
|
130
|
+
title: "\u300C".concat(apply, "\u7FA4\u300D").concat(name),
|
|
132
131
|
desc: '',
|
|
133
132
|
url: url,
|
|
134
133
|
imgUrl: 'https://club.tita.com/wp-content/uploads/2022/03/1648725106-20220331191146996.png'
|
|
135
134
|
}
|
|
136
135
|
}
|
|
137
136
|
}, function (res) {
|
|
138
|
-
if (res.err_msg
|
|
137
|
+
if (res.err_msg === 'createChatWithMsg:ok') {
|
|
139
138
|
if (res.chatId) {
|
|
140
139
|
(0, _request.rpost)('v1')('chat/add', {
|
|
141
140
|
objId: id,
|
|
@@ -143,18 +142,7 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
143
142
|
chatId: res.chatId
|
|
144
143
|
});
|
|
145
144
|
wx.invoke('openExistedChatWithMsg', {
|
|
146
|
-
chatId: res.chatId
|
|
147
|
-
msg: {
|
|
148
|
-
msgtype: 'link',
|
|
149
|
-
link: {
|
|
150
|
-
title: name,
|
|
151
|
-
desc: 'desc1',
|
|
152
|
-
url: url,
|
|
153
|
-
imgUrl: 'imgurl1'
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}, function (res) {
|
|
157
|
-
if (res.err_msg === 'openExistedChatWithMsg:ok') {}
|
|
145
|
+
chatId: res.chatId
|
|
158
146
|
});
|
|
159
147
|
}
|
|
160
148
|
}
|
|
@@ -174,6 +162,10 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
174
162
|
} else {
|
|
175
163
|
setIsShowWeChat(true);
|
|
176
164
|
|
|
165
|
+
if (res.Data.obj) {
|
|
166
|
+
setIsHasGroup(true);
|
|
167
|
+
}
|
|
168
|
+
|
|
177
169
|
if (isWx) {
|
|
178
170
|
setChatId(res.Data.obj);
|
|
179
171
|
(0, _request.rpost)('v1')('chat/users', {
|
|
@@ -205,11 +197,18 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
205
197
|
setTooltip('浏览器不支持此功能,请到企业微信工作台中使用');
|
|
206
198
|
}
|
|
207
199
|
}, [chatId, isShowWeChat]);
|
|
200
|
+
(0, _react.useEffect)(function () {
|
|
201
|
+
if (objType === 62) {
|
|
202
|
+
setApply("目标");
|
|
203
|
+
} else {
|
|
204
|
+
setApply("任务");
|
|
205
|
+
}
|
|
206
|
+
}, []);
|
|
208
207
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
209
208
|
overlay: tooltip,
|
|
210
209
|
placement: "bottom"
|
|
211
210
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
212
|
-
className: (0, _classnames["default"])(preCls, 'tu-icon-qw-chat'),
|
|
211
|
+
className: (0, _classnames["default"])(preCls, 'tu-icon-qw-chat', _defineProperty({}, "".concat(preCls, "__chat"), isHasGroup)),
|
|
213
212
|
onMouseDown: handleClickWechatBtn
|
|
214
213
|
})), /*#__PURE__*/_react["default"].createElement(_dialogConfirm["default"], {
|
|
215
214
|
zIndex: 1200,
|
|
@@ -219,7 +218,7 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
219
218
|
type: "title"
|
|
220
219
|
}, "\u786E\u5B9A\u53D1\u8D77\u7FA4\u804A\u5417"), /*#__PURE__*/_react["default"].createElement("span", {
|
|
221
220
|
type: "content"
|
|
222
|
-
},
|
|
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, {
|
|
223
222
|
type: "button",
|
|
224
223
|
onClick: closeCreateWeChatModal
|
|
225
224
|
}, "\u53D6\u6D88"), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.SureButton, {
|