@fmdeui/fmui 1.0.22 → 1.0.24
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/es/packages/hooks/idleTimeout.mjs +5 -7
- package/es/packages/utils/signalR.mjs +43 -39
- package/es/utils/signalR.d.ts +6 -2
- package/index.js +49 -52
- package/index.min.js +4 -4
- package/index.min.mjs +4 -4
- package/index.mjs +49 -52
- package/lib/packages/hooks/idleTimeout.js +5 -7
- package/lib/packages/utils/signalR.js +43 -39
- package/lib/utils/signalR.d.ts +6 -2
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/package.json +1 -1
- /package/{lib → es}/index.css +0 -0
- /package/{es/defaults.css → lib/component.css} +0 -0
|
@@ -7,13 +7,11 @@ import { useLocale } from './useLocale.mjs';
|
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
9
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
10
|
-
let signalR;
|
|
11
10
|
async function loadSignalR() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
signalR = module.signalR;
|
|
11
|
+
while (!window.__SIGNALR_INSTANCE__) {
|
|
12
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
15
13
|
}
|
|
16
|
-
return
|
|
14
|
+
return window.__SIGNALR_INSTANCE__;
|
|
17
15
|
}
|
|
18
16
|
const { t } = useLocale();
|
|
19
17
|
class IdleTimeoutManager {
|
|
@@ -91,8 +89,8 @@ class IdleTimeoutManager {
|
|
|
91
89
|
timeOutExec() {
|
|
92
90
|
const appEl = document.getElementById("app");
|
|
93
91
|
appEl == null ? void 0 : appEl.remove();
|
|
94
|
-
loadSignalR().then((
|
|
95
|
-
|
|
92
|
+
loadSignalR().then((signalR) => {
|
|
93
|
+
signalR.stop();
|
|
96
94
|
});
|
|
97
95
|
Local.remove(accessTokenKey);
|
|
98
96
|
Local.remove(refreshAccessTokenKey);
|
|
@@ -2,46 +2,50 @@ import * as SignalR from '@microsoft/signalr';
|
|
|
2
2
|
import { ElNotification } from 'element-plus';
|
|
3
3
|
import { getToken } from './request.mjs';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
connection.
|
|
12
|
-
connection.
|
|
13
|
-
|
|
14
|
-
connection.onclose(async () => {
|
|
15
|
-
});
|
|
16
|
-
connection.onreconnecting(() => {
|
|
17
|
-
ElNotification({
|
|
18
|
-
title: "\u63D0\u793A",
|
|
19
|
-
message: "\u8FDE\u63A5\u5DF2\u65AD\u5F00 >>>>>",
|
|
20
|
-
type: "error",
|
|
21
|
-
position: "bottom-right"
|
|
5
|
+
if (!window.__SIGNALR_INSTANCE__) {
|
|
6
|
+
const connection = new SignalR.HubConnectionBuilder().configureLogging(SignalR.LogLevel.Warning).withUrl(`${window.__env__.VITE_API_URL}/hubs/onlineUser?token=${getToken()}`, { transport: SignalR.HttpTransportType.WebSockets, skipNegotiation: true }).withAutomaticReconnect({
|
|
7
|
+
nextRetryDelayInMilliseconds: () => {
|
|
8
|
+
return 5e3;
|
|
9
|
+
}
|
|
10
|
+
}).build();
|
|
11
|
+
connection.keepAliveIntervalInMilliseconds = 15 * 1e3;
|
|
12
|
+
connection.serverTimeoutInMilliseconds = 30 * 1e3;
|
|
13
|
+
connection.start().then(() => {
|
|
22
14
|
});
|
|
23
|
-
|
|
24
|
-
connection.onreconnected(() => {
|
|
25
|
-
ElNotification({
|
|
26
|
-
title: "\u63D0\u793A",
|
|
27
|
-
message: "\u8FDE\u63A5\u5DF2\u6062\u590D >>>>>",
|
|
28
|
-
type: "success",
|
|
29
|
-
position: "bottom-right"
|
|
15
|
+
connection.onclose(async () => {
|
|
30
16
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
title: `${message.title}`,
|
|
39
|
-
message: tmpMsg,
|
|
40
|
-
type: message.messageType.toString().toLowerCase(),
|
|
41
|
-
position: "top-right",
|
|
42
|
-
dangerouslyUseHTMLString: true,
|
|
43
|
-
duration: 5e3
|
|
17
|
+
connection.onreconnecting(() => {
|
|
18
|
+
ElNotification({
|
|
19
|
+
title: "\u63D0\u793A",
|
|
20
|
+
message: "\u8FDE\u63A5\u5DF2\u65AD\u5F00 >>>>>",
|
|
21
|
+
type: "error",
|
|
22
|
+
position: "bottom-right"
|
|
23
|
+
});
|
|
44
24
|
});
|
|
45
|
-
|
|
25
|
+
connection.onreconnected(() => {
|
|
26
|
+
ElNotification({
|
|
27
|
+
title: "\u63D0\u793A",
|
|
28
|
+
message: "\u8FDE\u63A5\u5DF2\u6062\u590D >>>>>",
|
|
29
|
+
type: "success",
|
|
30
|
+
position: "bottom-right"
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
connection.on("OnlineUserList", () => {
|
|
34
|
+
});
|
|
35
|
+
connection.on("ReceiveMessage", (message) => {
|
|
36
|
+
var tmpMsg = `<div style="white-space: pre-wrap;">${message.message}<div><br/>`;
|
|
37
|
+
tmpMsg += `<p style="color:#808080; font-size:10px;float:right"> ${message.sendUserName} ${message.sendTime}<p>`;
|
|
38
|
+
ElNotification({
|
|
39
|
+
title: `${message.title}`,
|
|
40
|
+
message: tmpMsg,
|
|
41
|
+
type: message.messageType.toString().toLowerCase(),
|
|
42
|
+
position: "top-right",
|
|
43
|
+
dangerouslyUseHTMLString: true,
|
|
44
|
+
duration: 5e3
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
window.__SIGNALR_INSTANCE__ = connection;
|
|
48
|
+
}
|
|
49
|
+
const signalR = window.__SIGNALR_INSTANCE__;
|
|
46
50
|
|
|
47
|
-
export {
|
|
51
|
+
export { signalR };
|
package/es/utils/signalR.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import * as SignalR from '@microsoft/signalr';
|
|
2
|
-
declare const
|
|
3
|
-
|
|
2
|
+
export declare const signalR: SignalR.HubConnection;
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
__SIGNALR_INSTANCE__: SignalR.HubConnection;
|
|
6
|
+
}
|
|
7
|
+
}
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.24 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('pinia'), require('crypto-js'), require('xlsx-js-style'), require('element-plus'), require('vue'), require('@element-plus/icons-vue'), require('axios'), require('js-cookie'), require('@microsoft/signalr'), require('vxe-table'), require('@vxe-ui/plugin-render-element'), require('@vxe-ui/plugin-export-xlsx'), require('vxe-pc-ui'), require('vue-i18n'), require('exceljs'), require('lodash-es'), require('@vueuse/core'), require('mitt'), require('vue-router'), require('nprogress')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'pinia', 'crypto-js', 'xlsx-js-style', 'element-plus', 'vue', '@element-plus/icons-vue', 'axios', 'js-cookie', '@microsoft/signalr', 'vxe-table', '@vxe-ui/plugin-render-element', '@vxe-ui/plugin-export-xlsx', 'vxe-pc-ui', 'vue-i18n', 'exceljs', 'lodash-es', '@vueuse/core', 'mitt', 'vue-router', 'nprogress'], factory) :
|
|
@@ -1690,52 +1690,51 @@
|
|
|
1690
1690
|
return entity;
|
|
1691
1691
|
}
|
|
1692
1692
|
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
connection.onclose(async () => {
|
|
1703
|
-
});
|
|
1704
|
-
connection.onreconnecting(() => {
|
|
1705
|
-
elementPlus.ElNotification({
|
|
1706
|
-
title: "\u63D0\u793A",
|
|
1707
|
-
message: "\u8FDE\u63A5\u5DF2\u65AD\u5F00 >>>>>",
|
|
1708
|
-
type: "error",
|
|
1709
|
-
position: "bottom-right"
|
|
1693
|
+
if (!window.__SIGNALR_INSTANCE__) {
|
|
1694
|
+
const connection = new SignalR__namespace.HubConnectionBuilder().configureLogging(SignalR__namespace.LogLevel.Warning).withUrl(`${window.__env__.VITE_API_URL}/hubs/onlineUser?token=${getToken()}`, { transport: SignalR__namespace.HttpTransportType.WebSockets, skipNegotiation: true }).withAutomaticReconnect({
|
|
1695
|
+
nextRetryDelayInMilliseconds: () => {
|
|
1696
|
+
return 5e3;
|
|
1697
|
+
}
|
|
1698
|
+
}).build();
|
|
1699
|
+
connection.keepAliveIntervalInMilliseconds = 15 * 1e3;
|
|
1700
|
+
connection.serverTimeoutInMilliseconds = 30 * 1e3;
|
|
1701
|
+
connection.start().then(() => {
|
|
1710
1702
|
});
|
|
1711
|
-
|
|
1712
|
-
connection.onreconnected(() => {
|
|
1713
|
-
elementPlus.ElNotification({
|
|
1714
|
-
title: "\u63D0\u793A",
|
|
1715
|
-
message: "\u8FDE\u63A5\u5DF2\u6062\u590D >>>>>",
|
|
1716
|
-
type: "success",
|
|
1717
|
-
position: "bottom-right"
|
|
1703
|
+
connection.onclose(async () => {
|
|
1718
1704
|
});
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
title: `${message.title}`,
|
|
1727
|
-
message: tmpMsg,
|
|
1728
|
-
type: message.messageType.toString().toLowerCase(),
|
|
1729
|
-
position: "top-right",
|
|
1730
|
-
dangerouslyUseHTMLString: true,
|
|
1731
|
-
duration: 5e3
|
|
1705
|
+
connection.onreconnecting(() => {
|
|
1706
|
+
elementPlus.ElNotification({
|
|
1707
|
+
title: "\u63D0\u793A",
|
|
1708
|
+
message: "\u8FDE\u63A5\u5DF2\u65AD\u5F00 >>>>>",
|
|
1709
|
+
type: "error",
|
|
1710
|
+
position: "bottom-right"
|
|
1711
|
+
});
|
|
1732
1712
|
});
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1713
|
+
connection.onreconnected(() => {
|
|
1714
|
+
elementPlus.ElNotification({
|
|
1715
|
+
title: "\u63D0\u793A",
|
|
1716
|
+
message: "\u8FDE\u63A5\u5DF2\u6062\u590D >>>>>",
|
|
1717
|
+
type: "success",
|
|
1718
|
+
position: "bottom-right"
|
|
1719
|
+
});
|
|
1720
|
+
});
|
|
1721
|
+
connection.on("OnlineUserList", () => {
|
|
1722
|
+
});
|
|
1723
|
+
connection.on("ReceiveMessage", (message) => {
|
|
1724
|
+
var tmpMsg = `<div style="white-space: pre-wrap;">${message.message}<div><br/>`;
|
|
1725
|
+
tmpMsg += `<p style="color:#808080; font-size:10px;float:right"> ${message.sendUserName} ${message.sendTime}<p>`;
|
|
1726
|
+
elementPlus.ElNotification({
|
|
1727
|
+
title: `${message.title}`,
|
|
1728
|
+
message: tmpMsg,
|
|
1729
|
+
type: message.messageType.toString().toLowerCase(),
|
|
1730
|
+
position: "top-right",
|
|
1731
|
+
dangerouslyUseHTMLString: true,
|
|
1732
|
+
duration: 5e3
|
|
1733
|
+
});
|
|
1734
|
+
});
|
|
1735
|
+
window.__SIGNALR_INSTANCE__ = connection;
|
|
1736
|
+
}
|
|
1737
|
+
const signalR = window.__SIGNALR_INSTANCE__;
|
|
1739
1738
|
|
|
1740
1739
|
const setWatermark = (str) => {
|
|
1741
1740
|
const id = "1.23452384164.123412416";
|
|
@@ -18794,13 +18793,11 @@
|
|
|
18794
18793
|
var __defProp = Object.defineProperty;
|
|
18795
18794
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18796
18795
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18797
|
-
let signalR;
|
|
18798
18796
|
async function loadSignalR() {
|
|
18799
|
-
|
|
18800
|
-
|
|
18801
|
-
signalR = module.signalR;
|
|
18797
|
+
while (!window.__SIGNALR_INSTANCE__) {
|
|
18798
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
18802
18799
|
}
|
|
18803
|
-
return
|
|
18800
|
+
return window.__SIGNALR_INSTANCE__;
|
|
18804
18801
|
}
|
|
18805
18802
|
const { t } = useLocale();
|
|
18806
18803
|
class IdleTimeoutManager {
|
|
@@ -18878,8 +18875,8 @@
|
|
|
18878
18875
|
timeOutExec() {
|
|
18879
18876
|
const appEl = document.getElementById("app");
|
|
18880
18877
|
appEl == null ? void 0 : appEl.remove();
|
|
18881
|
-
loadSignalR().then((
|
|
18882
|
-
|
|
18878
|
+
loadSignalR().then((signalR) => {
|
|
18879
|
+
signalR.stop();
|
|
18883
18880
|
});
|
|
18884
18881
|
Local.remove(accessTokenKey);
|
|
18885
18882
|
Local.remove(refreshAccessTokenKey);
|
|
@@ -23155,7 +23152,7 @@
|
|
|
23155
23152
|
exports.setJsCdn = setJsCdn;
|
|
23156
23153
|
exports.setPathPrefix = setPathPrefix;
|
|
23157
23154
|
exports.setupI18n = setupI18n;
|
|
23158
|
-
exports.signalR =
|
|
23155
|
+
exports.signalR = signalR;
|
|
23159
23156
|
exports.signatureByKSort = signatureByKSort;
|
|
23160
23157
|
exports.sleep = sleep;
|
|
23161
23158
|
exports.tansParams = tansParams;
|