@chaoswise/ui 3.0.12 → 3.0.14
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/AbreastLayout/index.js +2 -2
- package/lib/AdaptiveLayout/index.js +2 -2
- package/lib/Antd5/_util/transButton.js +2 -2
- package/lib/Antd5/alert/Alert.js +2 -2
- package/lib/Antd5/app/style/index.js +2 -1
- package/lib/Antd5/avatar/avatar.js +2 -2
- package/lib/Antd5/badge/ScrollNumber.js +2 -2
- package/lib/Antd5/badge/index.js +2 -2
- package/lib/Antd5/breadcrumb/Breadcrumb.js +2 -2
- package/lib/Antd5/breadcrumb/BreadcrumbItem.js +2 -2
- package/lib/Antd5/breadcrumb/useItemRender.js +2 -2
- package/lib/Antd5/breadcrumb/useItems.js +2 -2
- package/lib/Antd5/button/button-group.js +2 -2
- package/lib/Antd5/button/button.js +2 -2
- package/lib/Antd5/card/Card.js +2 -2
- package/lib/Antd5/card/Grid.js +2 -2
- package/lib/Antd5/card/Meta.js +2 -2
- package/lib/Antd5/carousel/index.js +2 -2
- package/lib/Antd5/cascader/index.js +2 -2
- package/lib/Antd5/checkbox/Checkbox.js +2 -2
- package/lib/Antd5/checkbox/Group.js +2 -2
- package/lib/Antd5/color-picker/ColorPicker.js +2 -2
- package/lib/Antd5/color-picker/ColorPickerPanel.js +2 -2
- package/lib/Antd5/color-picker/components/ColorTrigger.js +2 -2
- package/lib/Antd5/color-picker/components/PanelPicker.js +2 -2
- package/lib/Antd5/config-provider/index.js +2 -2
- package/lib/Antd5/date-picker/generatePicker/generateRangePicker.js +2 -2
- package/lib/Antd5/date-picker/generatePicker/generateSinglePicker.js +2 -2
- package/lib/Antd5/descriptions/hooks/useItems.js +2 -2
- package/lib/Antd5/descriptions/index.js +2 -2
- package/lib/Antd5/divider/index.js +2 -2
- package/lib/Antd5/drawer/index.js +2 -2
- package/lib/Antd5/dropdown/dropdown-button.js +2 -2
- package/lib/Antd5/empty/index.js +2 -2
- package/lib/Antd5/flex/index.js +2 -2
- package/lib/Antd5/float-button/BackTop.js +2 -2
- package/lib/Antd5/float-button/FloatButton.js +2 -2
- package/lib/Antd5/float-button/FloatButtonGroup.js +2 -2
- package/lib/Antd5/float-button/PurePanel.js +2 -2
- package/lib/Antd5/form/Form.js +2 -2
- package/lib/Antd5/form/FormItem/ItemHolder.js +2 -2
- package/lib/Antd5/form/FormItemLabel.js +2 -2
- package/lib/Antd5/form/FormList.js +2 -2
- package/lib/Antd5/grid/col.js +2 -2
- package/lib/Antd5/grid/row.js +2 -2
- package/lib/Antd5/image/PreviewGroup.js +2 -2
- package/lib/Antd5/image/index.js +2 -2
- package/lib/Antd5/input/Input.js +2 -2
- package/lib/Antd5/input/OTP/OTPInput.js +2 -2
- package/lib/Antd5/input/OTP/index.js +2 -2
- package/lib/Antd5/input/Password.js +2 -2
- package/lib/Antd5/input/Search.js +2 -2
- package/lib/Antd5/input/TextArea.js +2 -2
- package/lib/Antd5/input-number/index.js +2 -2
- package/lib/Antd5/layout/Sider.js +2 -2
- package/lib/Antd5/layout/layout.js +2 -2
- package/lib/Antd5/list/Item.js +2 -2
- package/lib/Antd5/list/index.js +2 -2
- package/lib/Antd5/mentions/index.js +2 -2
- package/lib/Antd5/menu/MenuDivider.js +2 -2
- package/lib/Antd5/menu/OverrideContext.js +2 -2
- package/lib/Antd5/menu/menu.js +2 -2
- package/lib/Antd5/message/PurePanel.js +2 -2
- package/lib/Antd5/message/useMessage.js +2 -2
- package/lib/Antd5/modal/ConfirmDialog.js +2 -2
- package/lib/Antd5/modal/Modal.js +2 -2
- package/lib/Antd5/modal/PurePanel.js +2 -2
- package/lib/Antd5/modal/useModal/HookModal.js +2 -2
- package/lib/Antd5/notification/PurePanel.js +2 -2
- package/lib/Antd5/notification/useNotification.js +2 -2
- package/lib/Antd5/pagination/Pagination.js +2 -2
- package/lib/Antd5/popconfirm/PurePanel.js +2 -2
- package/lib/Antd5/popconfirm/index.js +2 -2
- package/lib/Antd5/popover/PurePanel.js +2 -2
- package/lib/Antd5/popover/index.js +2 -2
- package/lib/Antd5/progress/Line.js +2 -2
- package/lib/Antd5/progress/progress.js +2 -2
- package/lib/Antd5/radio/radio.js +2 -2
- package/lib/Antd5/radio/radioButton.js +2 -2
- package/lib/Antd5/rate/index.js +2 -2
- package/lib/Antd5/segmented/index.js +2 -2
- package/lib/Antd5/select/index.js +2 -2
- package/lib/Antd5/slider/index.js +2 -2
- package/lib/Antd5/space/Compact.js +2 -2
- package/lib/Antd5/space/index.js +2 -2
- package/lib/Antd5/spin/index.js +2 -2
- package/lib/Antd5/statistic/Countdown.js +2 -2
- package/lib/Antd5/statistic/Statistic.js +2 -2
- package/lib/Antd5/steps/index.js +2 -2
- package/lib/Antd5/switch/index.js +2 -2
- package/lib/Antd5/table/hooks/usePagination.js +2 -2
- package/lib/Antd5/tabs/hooks/useLegacyItems.js +2 -2
- package/lib/Antd5/tabs/index.js +2 -2
- package/lib/Antd5/tag/CheckableTag.js +2 -2
- package/lib/Antd5/tag/index.js +2 -2
- package/lib/Antd5/theme/useToken.js +2 -2
- package/lib/Antd5/theme/util/alias.js +2 -2
- package/lib/Antd5/time-picker/index.js +2 -2
- package/lib/Antd5/timeline/Timeline.js +2 -2
- package/lib/Antd5/timeline/TimelineItem.js +2 -2
- package/lib/Antd5/timeline/TimelineItemList.js +2 -2
- package/lib/Antd5/tooltip/index.js +2 -2
- package/lib/Antd5/tour/PurePanel.js +2 -2
- package/lib/Antd5/tour/index.js +2 -2
- package/lib/Antd5/tree/DirectoryTree.js +2 -2
- package/lib/Antd5/tree-select/index.js +2 -2
- package/lib/Antd5/typography/Base/index.js +2 -2
- package/lib/Antd5/typography/Link.js +2 -2
- package/lib/Antd5/typography/Text.js +2 -2
- package/lib/Antd5/typography/Title.js +2 -2
- package/lib/Antd5/typography/Typography.js +2 -2
- package/lib/Antd5/upload/Dragger.js +2 -2
- package/lib/Antd5/upload/Upload.js +1 -1
- package/lib/AppHolder/index.js +19 -0
- package/lib/Badge/index.style.js +42 -10
- package/lib/BasicLayout/Breadcrumb.js +2 -2
- package/lib/BasicLayout/Footer.js +2 -2
- package/lib/BasicLayout/Sider.js +8 -4
- package/lib/BasicLayout/style/sider.js +53 -49
- package/lib/Button/index.js +2 -2
- package/lib/CWCascader/Cascader/index.js +2 -2
- package/lib/CWCascader/rc-cascader/Cascader.js +2 -2
- package/lib/CWMessage/MessageContent/TabList/index.js +2 -2
- package/lib/CWMessage/MessageContent/index.js +6 -6
- package/lib/CWMessage/index.js +82 -92
- package/lib/CWMessage/index.style.js +2 -4
- package/lib/CWRadioTabs/index.js +2 -2
- package/lib/CWRangePicker/DropdownMenu/index.js +41 -37
- package/lib/CWRangePicker/DropdownMenu/index.style.js +129 -130
- package/lib/CWRangePicker/Refresh/index.js +8 -4
- package/lib/CWRangePicker/Refresh/index.style.js +16 -19
- package/lib/CWRangePicker/TimeSpan/index.js +7 -2
- package/lib/CWRangePicker/TimeSpan/index.style.js +9 -12
- package/lib/CWRangePicker/index.js +8 -4
- package/lib/CWRangePicker/index.style.js +47 -52
- package/lib/CWTable/CWTable.js +3 -3
- package/lib/CWTable/header.js +2 -2
- package/lib/CWTree/index.js +8 -4
- package/lib/CWTree/index.style.js +97 -99
- package/lib/CardSelect/index.js +2 -2
- package/lib/ChangeIcon/index.js +1 -1
- package/lib/Collapse/index.js +2 -2
- package/lib/ConfigProvider/ConfigProvider.js +17 -5
- package/lib/CustomScrollBar/index.js +2 -2
- package/lib/Drawer/index.js +2 -2
- package/lib/Dropdown/DropdownButton.js +2 -2
- package/lib/Dropdown/index.js +2 -2
- package/lib/EchartsArea/index.js +2 -2
- package/lib/EchartsBar/index.js +2 -2
- package/lib/EchartsBarRow/index.js +2 -2
- package/lib/EchartsBase/index.js +2 -2
- package/lib/EchartsLine/index.js +2 -2
- package/lib/EchartsPie/index.js +2 -2
- package/lib/EchartsRing/index.js +2 -2
- package/lib/Empty/index.js +2 -2
- package/lib/Exception/index.js +1 -1
- package/lib/FilterDropDown/index.js +1 -1
- package/lib/Flow/BasicLayout/Chain.js +2 -2
- package/lib/Flow/Flow.js +2 -2
- package/lib/Form/FormItem.js +2 -2
- package/lib/Form/index.js +2 -2
- package/lib/FormItemWrapper/index.js +2 -2
- package/lib/GlobalTabs/index.js +2 -2
- package/lib/Header/CommonDropMenu.js +2 -2
- package/lib/Header/LocaleSwitcher.js +2 -2
- package/lib/Header/Message/index.js +2 -2
- package/lib/Header/TopNavigationMenu/index.js +1 -1
- package/lib/Header/UserSetting/index.js +1 -1
- package/lib/Header/index.js +1 -1
- package/lib/Icon/index.js +2 -2
- package/lib/IconSelect/index.js +1 -1
- package/lib/Input/InputComponent.js +2 -2
- package/lib/InputNumber/index.js +2 -2
- package/lib/Joyride/index.js +2 -2
- package/lib/LayoutBreadcrumb/index.js +2 -2
- package/lib/LayoutWrapper/Footer.js +7 -3
- package/lib/LayoutWrapper/Header.js +7 -3
- package/lib/LayoutWrapper/index.js +5 -2
- package/lib/LeftNavigation/index.js +1 -1
- package/lib/Modal/Modal.js +2 -2
- package/lib/Modal/index.js +2 -2
- package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +2 -2
- package/lib/ModuleTitle/index.js +2 -2
- package/lib/Pagination/index.js +2 -2
- package/lib/QuickRangePicker/index.js +2 -2
- package/lib/QuickTransfer/index.js +7 -3
- package/lib/ScrollLoad/index.js +2 -2
- package/lib/SearchBar/index.js +3 -3
- package/lib/SiderMenu/index.js +2 -2
- package/lib/SimpleCard/index.js +2 -2
- package/lib/SimplePagination/index.js +1 -1
- package/lib/SingleSpa/index.js +2 -2
- package/lib/Slider/index.js +2 -2
- package/lib/Tabs/index.js +2 -2
- package/lib/Tag/CheckableTag.js +2 -2
- package/lib/Tag/index.js +2 -2
- package/lib/Tag/index.style.js +41 -9
- package/lib/ThemeProvider/main.js +2 -2
- package/lib/Tooltip/index.js +4 -4
- package/lib/TooltipText/index.js +3 -3
- package/lib/UniversalLayout/index.js +5 -1
- package/lib/WangEditor/editor4.js +2 -2
- package/lib/WangEditor/index.js +2 -2
- package/lib/antd-style/factories/createStyleProvider/index.js +2 -2
- package/lib/antd-style/factories/createStyles/index.js +2 -2
- package/lib/antd-style/factories/createThemeProvider/AntdProvider.js +2 -2
- package/lib/antd-style/factories/createThemeProvider/TokenContainer.js +2 -2
- package/lib/antd-style/factories/createThemeProvider/index.js +2 -2
- package/lib/antd-style/functions/index.js +6 -5
- package/lib/configHoc/index.js +2 -2
- package/lib/locales/en_US.json +1 -0
- package/lib/locales/zh_CN.json +1 -0
- package/lib/locales/zh_TW.json +1 -0
- package/package.json +1 -1
package/lib/CWMessage/index.js
CHANGED
|
@@ -13,8 +13,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
13
13
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
14
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
15
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
17
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
16
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
17
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
18
18
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
19
19
|
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."); }
|
|
20
20
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -99,6 +99,8 @@ function Message(props) {
|
|
|
99
99
|
setTotal = _useState8[1];
|
|
100
100
|
// 保存消息配置
|
|
101
101
|
var messageOptionRef = useRef({});
|
|
102
|
+
// 获取socket信息
|
|
103
|
+
var socketConnectInfo = useRef();
|
|
102
104
|
// 分页配置初始化
|
|
103
105
|
var _useState9 = useState({
|
|
104
106
|
current: 1,
|
|
@@ -124,6 +126,11 @@ function Message(props) {
|
|
|
124
126
|
useEffect(function () {
|
|
125
127
|
getMessageQuerySettings();
|
|
126
128
|
connectSocket();
|
|
129
|
+
return function () {
|
|
130
|
+
if (socketConnectInfo.current) {
|
|
131
|
+
socketConnectInfo.current.disconnect && socketConnectInfo.current.disconnect();
|
|
132
|
+
}
|
|
133
|
+
};
|
|
127
134
|
}, []);
|
|
128
135
|
useEffect(function () {
|
|
129
136
|
setPageInfo(function (pre) {
|
|
@@ -166,9 +173,9 @@ function Message(props) {
|
|
|
166
173
|
userMessageId: id,
|
|
167
174
|
clientType: "BROWSER"
|
|
168
175
|
};
|
|
169
|
-
resRequestApi = _getMessageDetailApi
|
|
176
|
+
resRequestApi = _getMessageDetailApi || getMessageDetailApi;
|
|
170
177
|
_context.next = 4;
|
|
171
|
-
return resRequestApi;
|
|
178
|
+
return resRequestApi(params, gatewayPrefix);
|
|
172
179
|
case 4:
|
|
173
180
|
res = _context.sent;
|
|
174
181
|
if (res && res.status == "success") {
|
|
@@ -203,24 +210,13 @@ function Message(props) {
|
|
|
203
210
|
}();
|
|
204
211
|
var readInnerMessage = /*#__PURE__*/function () {
|
|
205
212
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
206
|
-
var resRequestApi
|
|
213
|
+
var resRequestApi;
|
|
207
214
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
208
215
|
while (1) switch (_context2.prev = _context2.next) {
|
|
209
216
|
case 0:
|
|
210
|
-
resRequestApi = _readInnerMessageApi
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
case 3:
|
|
214
|
-
res = _context2.sent;
|
|
215
|
-
if (res.status == "success") {
|
|
216
|
-
// if (pageInfo.current > 1 && dataSource.length === 1) {
|
|
217
|
-
// let _params = { current: pageInfo.current - 1 };
|
|
218
|
-
// setPageInfo((pre) => ({ ...pre, current: pre.current - 1 }));
|
|
219
|
-
// conditionsRef.current = { ...conditionsRef.current, ..._params };
|
|
220
|
-
// }
|
|
221
|
-
// 已读消息
|
|
222
|
-
}
|
|
223
|
-
case 5:
|
|
217
|
+
resRequestApi = _readInnerMessageApi || readInnerMessageApi;
|
|
218
|
+
resRequestApi(params, gatewayPrefix);
|
|
219
|
+
case 2:
|
|
224
220
|
case "end":
|
|
225
221
|
return _context2.stop();
|
|
226
222
|
}
|
|
@@ -230,17 +226,53 @@ function Message(props) {
|
|
|
230
226
|
return _ref3.apply(this, arguments);
|
|
231
227
|
};
|
|
232
228
|
}();
|
|
229
|
+
var getSocketPostMessage = function getSocketPostMessage(data) {
|
|
230
|
+
var _JSON$parse = JSON.parse(data),
|
|
231
|
+
count = _JSON$parse.count,
|
|
232
|
+
message = _JSON$parse.message;
|
|
233
|
+
var _ref4 = count || {},
|
|
234
|
+
_ref4$total = _ref4.total,
|
|
235
|
+
total = _ref4$total === void 0 ? 0 : _ref4$total;
|
|
236
|
+
setMessageTotal(total);
|
|
237
|
+
onSocketChange(JSON.parse(data));
|
|
238
|
+
if (message) {
|
|
239
|
+
var noticeMessage = message.noticeMessage,
|
|
240
|
+
action = message.action;
|
|
241
|
+
var _ref5 = noticeMessage || {},
|
|
242
|
+
userMessageId = _ref5.id,
|
|
243
|
+
type = _ref5.type;
|
|
244
|
+
if (!userMessageId) return;
|
|
245
|
+
if (action && action.mode === "recall") {
|
|
246
|
+
// 销毁强提醒
|
|
247
|
+
api.destroy(userMessageId);
|
|
248
|
+
// 销毁后如果弹窗开启关闭弹窗
|
|
249
|
+
setVisible(false);
|
|
250
|
+
} else {
|
|
251
|
+
// 生成强提醒
|
|
252
|
+
var _ref6 = messageOptionRef.current[type] || {},
|
|
253
|
+
enable = _ref6.enable,
|
|
254
|
+
_mode = _ref6.mode,
|
|
255
|
+
_ref6$time = _ref6.time,
|
|
256
|
+
time = _ref6$time === void 0 ? 5 : _ref6$time;
|
|
257
|
+
setMode(_mode);
|
|
258
|
+
if (enable) {
|
|
259
|
+
openNotification(time, userMessageId);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
};
|
|
233
264
|
var connectSocket = /*#__PURE__*/function () {
|
|
234
|
-
var
|
|
265
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
235
266
|
var resRequestApi, res, finalOrigin, socket;
|
|
236
|
-
return _regeneratorRuntime().wrap(function
|
|
237
|
-
while (1) switch (
|
|
267
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
268
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
238
269
|
case 0:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
270
|
+
// 获取sessionId
|
|
271
|
+
resRequestApi = _getSessionId || getSessionId;
|
|
272
|
+
_context4.next = 3;
|
|
273
|
+
return resRequestApi(gatewayPrefix);
|
|
242
274
|
case 3:
|
|
243
|
-
res =
|
|
275
|
+
res = _context4.sent;
|
|
244
276
|
if (res && res.status == "success") {
|
|
245
277
|
finalOrigin = socketOrigin ? socketOrigin : "ws://".concat(window.location.host);
|
|
246
278
|
socket = io(finalOrigin, {
|
|
@@ -250,62 +282,20 @@ function Message(props) {
|
|
|
250
282
|
sessionId: res.data,
|
|
251
283
|
clientType: "BROWSER"
|
|
252
284
|
}
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
258
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
259
|
-
case 0:
|
|
260
|
-
_JSON$parse = JSON.parse(data), count = _JSON$parse.count, message = _JSON$parse.message;
|
|
261
|
-
_ref6 = count || {}, _ref6$total = _ref6.total, total = _ref6$total === void 0 ? 0 : _ref6$total;
|
|
262
|
-
setMessageTotal(total);
|
|
263
|
-
onSocketChange(JSON.parse(data));
|
|
264
|
-
if (!message) {
|
|
265
|
-
_context3.next = 10;
|
|
266
|
-
break;
|
|
267
|
-
}
|
|
268
|
-
noticeMessage = message.noticeMessage, action = message.action;
|
|
269
|
-
_ref7 = noticeMessage || {}, userMessageId = _ref7.id, type = _ref7.type;
|
|
270
|
-
if (userMessageId) {
|
|
271
|
-
_context3.next = 9;
|
|
272
|
-
break;
|
|
273
|
-
}
|
|
274
|
-
return _context3.abrupt("return");
|
|
275
|
-
case 9:
|
|
276
|
-
if (action && action.mode === "recall") {
|
|
277
|
-
// 销毁强提醒
|
|
278
|
-
api.destroy(userMessageId);
|
|
279
|
-
// 销毁后如果弹窗开启关闭弹窗
|
|
280
|
-
setVisible(false);
|
|
281
|
-
} else {
|
|
282
|
-
// 生成强提醒
|
|
283
|
-
_ref8 = messageOptionRef.current[type] || {}, enable = _ref8.enable, _mode = _ref8.mode, _ref8$time = _ref8.time, time = _ref8$time === void 0 ? 5 : _ref8$time;
|
|
284
|
-
setMode(_mode);
|
|
285
|
-
if (enable) {
|
|
286
|
-
openNotification(time, userMessageId);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
case 10:
|
|
290
|
-
case "end":
|
|
291
|
-
return _context3.stop();
|
|
292
|
-
}
|
|
293
|
-
}, _callee3);
|
|
294
|
-
}));
|
|
295
|
-
return function (_x4) {
|
|
296
|
-
return _ref5.apply(this, arguments);
|
|
297
|
-
};
|
|
298
|
-
}());
|
|
285
|
+
}); // 记录socket连接信息,用于关闭socket连接
|
|
286
|
+
socketConnectInfo.current = socket;
|
|
287
|
+
// 监听从服务器传来的消息
|
|
288
|
+
socket.on("push", getSocketPostMessage);
|
|
299
289
|
// socket重连
|
|
300
|
-
socket.on("reconnect_attempt", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
290
|
+
socket.on("reconnect_attempt", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
301
291
|
var res;
|
|
302
|
-
return _regeneratorRuntime().wrap(function
|
|
303
|
-
while (1) switch (
|
|
292
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
293
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
304
294
|
case 0:
|
|
305
|
-
|
|
295
|
+
_context3.next = 2;
|
|
306
296
|
return resRequestApi;
|
|
307
297
|
case 2:
|
|
308
|
-
res =
|
|
298
|
+
res = _context3.sent;
|
|
309
299
|
if (res && res.status == "success") {
|
|
310
300
|
socket.io.opts.query = {
|
|
311
301
|
sessionId: res.data,
|
|
@@ -314,44 +304,44 @@ function Message(props) {
|
|
|
314
304
|
}
|
|
315
305
|
case 4:
|
|
316
306
|
case "end":
|
|
317
|
-
return
|
|
307
|
+
return _context3.stop();
|
|
318
308
|
}
|
|
319
|
-
},
|
|
309
|
+
}, _callee3);
|
|
320
310
|
})));
|
|
321
311
|
}
|
|
322
312
|
case 5:
|
|
323
313
|
case "end":
|
|
324
|
-
return
|
|
314
|
+
return _context4.stop();
|
|
325
315
|
}
|
|
326
|
-
},
|
|
316
|
+
}, _callee4);
|
|
327
317
|
}));
|
|
328
318
|
return function connectSocket() {
|
|
329
|
-
return
|
|
319
|
+
return _ref7.apply(this, arguments);
|
|
330
320
|
};
|
|
331
321
|
}();
|
|
332
322
|
var getMessageQuerySettings = /*#__PURE__*/function () {
|
|
333
|
-
var
|
|
323
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
334
324
|
var resRequestApi, res, data;
|
|
335
|
-
return _regeneratorRuntime().wrap(function
|
|
336
|
-
while (1) switch (
|
|
325
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
326
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
337
327
|
case 0:
|
|
338
|
-
resRequestApi = _getMessageQuerySettingsApi
|
|
339
|
-
|
|
340
|
-
return resRequestApi;
|
|
328
|
+
resRequestApi = _getMessageQuerySettingsApi || getMessageQuerySettingsApi;
|
|
329
|
+
_context5.next = 3;
|
|
330
|
+
return resRequestApi(gatewayPrefix);
|
|
341
331
|
case 3:
|
|
342
|
-
res =
|
|
332
|
+
res = _context5.sent;
|
|
343
333
|
if (res && res.status === "success") {
|
|
344
334
|
data = res.data;
|
|
345
335
|
messageOptionRef.current = data || {};
|
|
346
336
|
}
|
|
347
337
|
case 5:
|
|
348
338
|
case "end":
|
|
349
|
-
return
|
|
339
|
+
return _context5.stop();
|
|
350
340
|
}
|
|
351
|
-
},
|
|
341
|
+
}, _callee5);
|
|
352
342
|
}));
|
|
353
343
|
return function getMessageQuerySettings() {
|
|
354
|
-
return
|
|
344
|
+
return _ref9.apply(this, arguments);
|
|
355
345
|
};
|
|
356
346
|
}();
|
|
357
347
|
return wrapCSSVar( /*#__PURE__*/React.createElement("div", {
|
|
@@ -126,9 +126,7 @@ var genCustomCWMessageStyle = function genCustomCWMessageStyle(token) {
|
|
|
126
126
|
}
|
|
127
127
|
})), "".concat(messagePrefixCls, "-content-tabs-list"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
128
128
|
paddingTop: "16px"
|
|
129
|
-
}, "&".concat(messagePrefixCls, "-content-tabs-list-invalid"), _defineProperty({
|
|
130
|
-
color: "red"
|
|
131
|
-
}, "".concat(messagePrefixCls, "-content-tabs-list-title,").concat(messagePrefixCls, "-content-tabs-list-desc,").concat(messagePrefixCls, "-content-tabs-list-date"), {
|
|
129
|
+
}, "&".concat(messagePrefixCls, "-content-tabs-list-invalid"), _defineProperty({}, "".concat(messagePrefixCls, "-content-tabs-list-title,").concat(messagePrefixCls, "-content-tabs-list-desc,").concat(messagePrefixCls, "-content-tabs-list-date"), {
|
|
132
130
|
color: token.colorTextDisabled,
|
|
133
131
|
"&:hover": {
|
|
134
132
|
color: token.colorTextDisabled
|
|
@@ -157,7 +155,7 @@ var genCustomCWMessageStyle = function genCustomCWMessageStyle(token) {
|
|
|
157
155
|
WebkitBoxOrient: "vertical",
|
|
158
156
|
marginTop: "8px",
|
|
159
157
|
marginBottom: "4px",
|
|
160
|
-
height: "40px",
|
|
158
|
+
// height: "40px",
|
|
161
159
|
lineHeight: "20px",
|
|
162
160
|
color: token.colorTextSecondary,
|
|
163
161
|
whiteSpace: "pre-wrap"
|
package/lib/CWRadioTabs/index.js
CHANGED
|
@@ -10,8 +10,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
10
10
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
14
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
13
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
15
15
|
import React, { forwardRef, useState, useEffect, useMemo } from "react";
|
|
16
16
|
import { EllipsisOutlined } from "@ant-design/icons";
|
|
17
17
|
import PropTypes from "prop-types";
|
|
@@ -11,26 +11,27 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
11
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
13
13
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
15
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
14
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
15
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
16
16
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
17
17
|
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."); }
|
|
18
18
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
19
19
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
20
20
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
21
21
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
22
|
-
import React from
|
|
23
|
-
import { RightOutlined } from
|
|
24
|
-
import classnames from
|
|
25
|
-
import CalendarSvg from
|
|
26
|
-
import Calendar2Svg from
|
|
27
|
-
import LiveSvg from
|
|
28
|
-
import MoreSvg from
|
|
29
|
-
import MoreTimeList from
|
|
30
|
-
import MoreHistoryList from
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
import
|
|
22
|
+
import React from "react";
|
|
23
|
+
import { RightOutlined } from "@ant-design/icons";
|
|
24
|
+
import classnames from "classnames";
|
|
25
|
+
import CalendarSvg from "../assets/Calendar";
|
|
26
|
+
import Calendar2Svg from "../assets/Calendar2";
|
|
27
|
+
import LiveSvg from "../assets/live";
|
|
28
|
+
import MoreSvg from "../assets/more";
|
|
29
|
+
import MoreTimeList from "./MoreTimeList";
|
|
30
|
+
import MoreHistoryList from "./MoreHistoryList";
|
|
31
|
+
import useConfigContext from "../../useConfigContext";
|
|
32
|
+
import { judgeType, funcValueChangeArrayValue, getCorrectValue, getHistoryInfo } from "../utils";
|
|
33
|
+
import { useIntl } from "../../locales";
|
|
34
|
+
import useStyle from "./index.style";
|
|
34
35
|
var DropdownMenu = function DropdownMenu(props) {
|
|
35
36
|
var dataSource = props.dataSource,
|
|
36
37
|
regroupDataSource = props.regroupDataSource,
|
|
@@ -46,7 +47,10 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
46
47
|
setHistoryList = props.setHistoryList,
|
|
47
48
|
format = props.format,
|
|
48
49
|
timeSpanOption = props.timeSpanOption;
|
|
49
|
-
var
|
|
50
|
+
var _useConfigContext = useConfigContext(),
|
|
51
|
+
getPrefixCls = _useConfigContext.getPrefixCls;
|
|
52
|
+
var prefixCls = getPrefixCls();
|
|
53
|
+
var _useStyle = useStyle("".concat(prefixCls, "-cw-dropdown-menu")),
|
|
50
54
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
51
55
|
wrapCSSVar = _useStyle2[0],
|
|
52
56
|
hashId = _useStyle2[1],
|
|
@@ -54,7 +58,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
54
58
|
var intl = useIntl();
|
|
55
59
|
var _ref = (intl === null || intl === void 0 ? void 0 : intl.options) || {},
|
|
56
60
|
_ref$currentLocale = _ref.currentLocale,
|
|
57
|
-
locale = _ref$currentLocale === void 0 ?
|
|
61
|
+
locale = _ref$currentLocale === void 0 ? "zh_CN" : _ref$currentLocale;
|
|
58
62
|
var _timeSpanOption$timeS = timeSpanOption.timeSpanBoundary,
|
|
59
63
|
timeSpanBoundary = _timeSpanOption$timeS === void 0 ? 94608000 : _timeSpanOption$timeS;
|
|
60
64
|
var _menuOption$showCalen = menuOption.showCalendar,
|
|
@@ -66,7 +70,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
66
70
|
_menuOption$showDefau2 = menuOption.showDefaultHistoryCount,
|
|
67
71
|
showDefaultHistoryCount = _menuOption$showDefau2 === void 0 ? 5 : _menuOption$showDefau2,
|
|
68
72
|
_menuOption$moreHisto = menuOption.moreHistoryDropdownPosition,
|
|
69
|
-
moreHistoryDropdownPosition = _menuOption$moreHisto === void 0 ?
|
|
73
|
+
moreHistoryDropdownPosition = _menuOption$moreHisto === void 0 ? "left" : _menuOption$moreHisto;
|
|
70
74
|
// 点击Menu.Item中切换选项列表
|
|
71
75
|
var onClickItem = function onClickItem(item) {
|
|
72
76
|
var timeDomain = recordDateValue.timeDomain,
|
|
@@ -137,7 +141,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
137
141
|
setHistoryList([]);
|
|
138
142
|
};
|
|
139
143
|
return wrapCSSVar( /*#__PURE__*/React.createElement("div", {
|
|
140
|
-
className: classnames(hashId, cssVarCls,
|
|
144
|
+
className: classnames(hashId, cssVarCls, "".concat(prefixCls, "-cw-dropdown-menu-wrapper"))
|
|
141
145
|
}, dataSource === null || dataSource === void 0 ? void 0 : dataSource.slice(0, showDefaultCount).map(function (item) {
|
|
142
146
|
var values = item.value;
|
|
143
147
|
var _judgeType = judgeType(item),
|
|
@@ -148,8 +152,8 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
148
152
|
isHasDate = false;
|
|
149
153
|
}
|
|
150
154
|
return /*#__PURE__*/React.createElement("div", {
|
|
151
|
-
className: classnames(
|
|
152
|
-
|
|
155
|
+
className: classnames("cw-dropdown-menu-_item", {
|
|
156
|
+
"cw-dropdown-menu-item-selected": (recordDateValue === null || recordDateValue === void 0 ? void 0 : recordDateValue.key) === item.key
|
|
153
157
|
}),
|
|
154
158
|
key: item.key,
|
|
155
159
|
onClick: function onClick() {
|
|
@@ -159,7 +163,7 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
159
163
|
className: "cw-range-picker-prefix-icon"
|
|
160
164
|
}) : /*#__PURE__*/React.createElement(LiveSvg, null), /*#__PURE__*/React.createElement("span", {
|
|
161
165
|
style: {
|
|
162
|
-
marginLeft:
|
|
166
|
+
marginLeft: "4px"
|
|
163
167
|
}
|
|
164
168
|
}, item.render ? item.render(item) : item.title));
|
|
165
169
|
}), (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > showDefaultCount && /*#__PURE__*/React.createElement(_Dropdown, {
|
|
@@ -168,28 +172,28 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
168
172
|
recordDateValue: recordDateValue,
|
|
169
173
|
onClickItem: onClickItem
|
|
170
174
|
}),
|
|
171
|
-
overlayClassName: classnames(
|
|
172
|
-
|
|
175
|
+
overlayClassName: classnames("cw-dropdown-menu-more-wrapper", {
|
|
176
|
+
"cw-dropdown-menu-more-wrapper-left": moreItemDropdownPosition === "left"
|
|
173
177
|
}),
|
|
174
178
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
175
179
|
return triggerNode;
|
|
176
180
|
}
|
|
177
181
|
}, /*#__PURE__*/React.createElement("div", {
|
|
178
|
-
className: classnames(
|
|
182
|
+
className: classnames("cw-dropdown-menu-_item", "cw-dropdown-menu-item-more")
|
|
179
183
|
}, /*#__PURE__*/React.createElement("div", {
|
|
180
184
|
style: {
|
|
181
|
-
display:
|
|
182
|
-
alignItems:
|
|
185
|
+
display: "flex",
|
|
186
|
+
alignItems: "center"
|
|
183
187
|
}
|
|
184
188
|
}, /*#__PURE__*/React.createElement(MoreSvg, {
|
|
185
189
|
className: "cw-range-picker-prefix-icon"
|
|
186
190
|
}), /*#__PURE__*/React.createElement("span", {
|
|
187
191
|
style: {
|
|
188
|
-
marginLeft:
|
|
192
|
+
marginLeft: "4px"
|
|
189
193
|
}
|
|
190
|
-
}, intl.get(
|
|
191
|
-
className: classnames(
|
|
192
|
-
key:
|
|
194
|
+
}, intl.get("a30db643-5238-42bc-bc5e-98a9d0c7df51").d("更多"))), /*#__PURE__*/React.createElement(RightOutlined, null))), showCalendar && /*#__PURE__*/React.createElement("div", {
|
|
195
|
+
className: classnames("cw-dropdown-menu-_item"),
|
|
196
|
+
key: "unique-calendar",
|
|
193
197
|
onClick: onClickSelectCalendar
|
|
194
198
|
}, /*#__PURE__*/React.createElement("div", {
|
|
195
199
|
className: "cw-range-picker-menu-item-calendar"
|
|
@@ -197,28 +201,28 @@ var DropdownMenu = function DropdownMenu(props) {
|
|
|
197
201
|
className: "cw-range-picker-prefix-icon"
|
|
198
202
|
})), /*#__PURE__*/React.createElement("span", {
|
|
199
203
|
style: {
|
|
200
|
-
marginLeft:
|
|
204
|
+
marginLeft: "4px"
|
|
201
205
|
}
|
|
202
|
-
}, intl.get(
|
|
206
|
+
}, intl.get("711fdb26-65b9-48da-ba3c-363f5ab8218c").d("日历选择"))), showHistoryList && Boolean(historyList.length) && /*#__PURE__*/React.createElement(_Dropdown, {
|
|
203
207
|
overlay: /*#__PURE__*/React.createElement(MoreHistoryList, {
|
|
204
208
|
historyList: historyList,
|
|
205
209
|
onClickTag: onClickTag,
|
|
206
210
|
onCloseTag: onCloseTag,
|
|
207
211
|
onCloseAllTag: onCloseAllTag
|
|
208
212
|
}),
|
|
209
|
-
overlayClassName: classnames(
|
|
210
|
-
|
|
213
|
+
overlayClassName: classnames("cw-dropdown-menu-history-more-wrapper", {
|
|
214
|
+
"cw-dropdown-menu-history-more-wrapper-left": moreHistoryDropdownPosition === "left"
|
|
211
215
|
}),
|
|
212
216
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
213
217
|
return triggerNode;
|
|
214
218
|
}
|
|
215
219
|
}, /*#__PURE__*/React.createElement("div", {
|
|
216
|
-
className: classnames(
|
|
220
|
+
className: classnames("cw-dropdown-menu-history-outer-wrapper")
|
|
217
221
|
}, /*#__PURE__*/React.createElement("div", {
|
|
218
|
-
className: classnames(
|
|
222
|
+
className: classnames("cw-dropdown-menu-history-wrapper")
|
|
219
223
|
}, /*#__PURE__*/React.createElement("span", {
|
|
220
224
|
className: "cw-dropdown-menu-history-title"
|
|
221
|
-
}, intl.get(
|
|
225
|
+
}, intl.get("294afc43-e2de-4d72-ba99-1f25d6f7a1d7").d("历史记录")), historyList.slice(0, showDefaultHistoryCount).map(function (tag) {
|
|
222
226
|
return /*#__PURE__*/React.createElement(_Tag, {
|
|
223
227
|
type: "custom_type01",
|
|
224
228
|
closable: true,
|