@fmdeui/fmui 1.0.11 → 1.0.13

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.
@@ -4,3 +4,5 @@ export * from './useVxeTableOptionsHook';
4
4
  export * from './sysInfo';
5
5
  export * from './useInfo';
6
6
  export * from './dateTimeShortCust';
7
+ export * from './idleTimeout';
8
+ export * from './useVxeTableOptionsHook';
package/es/index.mjs CHANGED
@@ -21,6 +21,7 @@ export { base64ToFile, blobToFile, dataURLtoBlob, fileToBase64, urlToBase64 } fr
21
21
  export { buildLocaleContext, buildTranslator, translate, useLocale } from './packages/hooks/useLocale.mjs';
22
22
  export { clone, isObjectValueEqual, judgementSameArr, removeDuplicate } from './packages/utils/arrayOperation.mjs';
23
23
  export { configureRoutes, setPathPrefix } from './packages/router/route.mjs';
24
+ export { destroyIdleTimeout, initIdleTimeout, updateIdleTimeout } from './packages/hooks/idleTimeout.mjs';
24
25
  export { downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadStreamFile, getFileName, openWindow } from './packages/utils/download.mjs';
25
26
  export { default as en } from './packages/locale/lang/en.mjs';
26
27
  export { exportExcel } from './packages/utils/exportExcel.mjs';
@@ -34,6 +35,7 @@ export { initFrontEndControlRoutes } from './packages/router/frontEnd.mjs';
34
35
  export { judgementIdCard, verifiyNumberInteger, verifyAccount, verifyAndSpace, verifyCarNum, verifyCnAndSpace, verifyEmail, verifyEnAndSpace, verifyFullName, verifyIPAddress, verifyIdCard, verifyNumberCnUppercase, verifyNumberComma, verifyNumberIntegerAndFloat, verifyNumberPercentage, verifyNumberPercentageFloat, verifyPassword, verifyPasswordPowerful, verifyPasswordStrength, verifyPhone, verifyPostalCode, verifyTelPhone, verifyTextColor, verifyUrl } from './packages/utils/toolsValidate.mjs';
35
36
  export { loadSysInfo, updateFavicon } from './packages/hooks/sysInfo.mjs';
36
37
  export { saulVModel } from './packages/utils/saulVModel.mjs';
38
+ export { signalR } from './packages/utils/signalR.mjs';
37
39
  export { signatureByKSort } from './packages/utils/data-signature.mjs';
38
40
  export { useApi, useBaseApi } from './packages/api/base/index.mjs';
39
41
  export { useChangeColor } from './packages/utils/theme.mjs';
@@ -4,3 +4,4 @@ export { useVxeTable } from './useVxeTableOptionsHook.mjs';
4
4
  export { loadSysInfo, updateFavicon } from './sysInfo.mjs';
5
5
  export { hasPrivilege, hasRoleCode, isAdmin, isMember, isNormalUser, isSupperAdmin, isTenantAdmin, orgId, orgName, posId, posName, roles, tenantId, userAccount, userEmail, userFriendName, userId, userName, userPhone } from './useInfo.mjs';
6
6
  export { useDateTimeShortCust } from './dateTimeShortCust.mjs';
7
+ export { destroyIdleTimeout, initIdleTimeout, updateIdleTimeout } from './idleTimeout.mjs';
@@ -18,3 +18,4 @@ export { saulVModel } from './saulVModel.mjs';
18
18
  export { Local, Session } from './storage.mjs';
19
19
  export { useChangeColor } from './theme.mjs';
20
20
  export { judgementIdCard, verifiyNumberInteger, verifyAccount, verifyAndSpace, verifyCarNum, verifyCnAndSpace, verifyEmail, verifyEnAndSpace, verifyFullName, verifyIPAddress, verifyIdCard, verifyNumberCnUppercase, verifyNumberComma, verifyNumberIntegerAndFloat, verifyNumberPercentage, verifyNumberPercentageFloat, verifyPassword, verifyPasswordPowerful, verifyPasswordStrength, verifyPhone, verifyPostalCode, verifyTelPhone, verifyTextColor, verifyUrl } from './toolsValidate.mjs';
21
+ export { signalR } from './signalR.mjs';
@@ -18,3 +18,4 @@ export * from './saulVModel';
18
18
  export * from './storage';
19
19
  export * from './theme';
20
20
  export * from './toolsValidate';
21
+ export * from './signalR';
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
- /*! fmdeui-fmui v1.0.11 */
1
+ /*! fmdeui-fmui v1.0.13 */
2
2
  (function (global, factory) {
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('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
- typeof define === 'function' && define.amd ? define(['exports', 'pinia', 'crypto-js', 'xlsx-js-style', 'element-plus', 'vue', '@element-plus/icons-vue', 'axios', 'js-cookie', '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) :
5
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.fmdeuifmui = {}, global.Pinia, global.CryptoJS, global.XLSX, global.ElementPlus, global.Vue, global.ElementPlusIconsVue, global.axios, global.Cookies, global.VxeUITable, global.VxeUIPluginRenderElement, global.VxeUIPluginExportXLSX, global.VxeUIExport, global.vueI18n, global.ExcelJS, global._, global.VueUse, global.mitt, global.vueRouter, global.NProgress));
6
- })(this, (function (exports, pinia$1, CryptoJS, XLSXS, elementPlus, vue, svg, axios, Cookies, VxeUITable, VxeUIPluginRenderElement, VxeUIPluginExportXLSX, VxeUI, vueI18n, ExcelJS, lodashEs, core, mitt, vueRouter, NProgress) { 'use strict';
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
+ 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) :
5
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.fmdeuifmui = {}, global.Pinia, global.CryptoJS, global.XLSX, global.ElementPlus, global.Vue, global.ElementPlusIconsVue, global.axios, global.Cookies, global.SignalR, global.VxeUITable, global.VxeUIPluginRenderElement, global.VxeUIPluginExportXLSX, global.VxeUIExport, global.vueI18n, global.ExcelJS, global._, global.VueUse, global.mitt, global.vueRouter, global.NProgress));
6
+ })(this, (function (exports, pinia$1, CryptoJS, XLSXS, elementPlus, vue, svg, axios, Cookies, SignalR, VxeUITable, VxeUIPluginRenderElement, VxeUIPluginExportXLSX, VxeUI, vueI18n, ExcelJS, lodashEs, core, mitt, vueRouter, NProgress) { 'use strict';
7
7
 
8
8
  function _interopNamespaceDefault(e) {
9
9
  var n = Object.create(null);
@@ -23,6 +23,7 @@
23
23
  }
24
24
 
25
25
  var svg__namespace = /*#__PURE__*/_interopNamespaceDefault(svg);
26
+ var SignalR__namespace = /*#__PURE__*/_interopNamespaceDefault(SignalR);
26
27
 
27
28
  const pinia = pinia$1.createPinia();
28
29
 
@@ -510,9 +511,9 @@
510
511
  return value;
511
512
  };
512
513
 
513
- var __defProp = Object.defineProperty;
514
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
515
- var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
514
+ var __defProp$1 = Object.defineProperty;
515
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
516
+ var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, key + "" , value);
516
517
  const DEFAULT_CONFIG = {
517
518
  lock: true,
518
519
  text: "",
@@ -525,7 +526,7 @@
525
526
  };
526
527
  class FlowLoadingManager {
527
528
  constructor() {
528
- __publicField(this, "instance", null);
529
+ __publicField$1(this, "instance", null);
529
530
  }
530
531
  // 2. 统一返回类型
531
532
  start(options) {
@@ -1651,6 +1652,53 @@
1651
1652
  return entity;
1652
1653
  }
1653
1654
 
1655
+ 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({
1656
+ nextRetryDelayInMilliseconds: () => {
1657
+ return 5e3;
1658
+ }
1659
+ }).build();
1660
+ connection.keepAliveIntervalInMilliseconds = 15 * 1e3;
1661
+ connection.serverTimeoutInMilliseconds = 30 * 1e3;
1662
+ connection.start().then(() => {
1663
+ });
1664
+ connection.onclose(async () => {
1665
+ });
1666
+ connection.onreconnecting(() => {
1667
+ elementPlus.ElNotification({
1668
+ title: "\u63D0\u793A",
1669
+ message: "\u8FDE\u63A5\u5DF2\u65AD\u5F00 >>>>>",
1670
+ type: "error",
1671
+ position: "bottom-right"
1672
+ });
1673
+ });
1674
+ connection.onreconnected(() => {
1675
+ elementPlus.ElNotification({
1676
+ title: "\u63D0\u793A",
1677
+ message: "\u8FDE\u63A5\u5DF2\u6062\u590D >>>>>",
1678
+ type: "success",
1679
+ position: "bottom-right"
1680
+ });
1681
+ });
1682
+ connection.on("OnlineUserList", () => {
1683
+ });
1684
+ connection.on("ReceiveMessage", (message) => {
1685
+ var tmpMsg = `<div style="white-space: pre-wrap;">${message.message}<div><br/>`;
1686
+ tmpMsg += `<p style="color:#808080; font-size:10px;float:right"> ${message.sendUserName} ${message.sendTime}<p>`;
1687
+ elementPlus.ElNotification({
1688
+ title: `${message.title}`,
1689
+ message: tmpMsg,
1690
+ type: message.messageType.toString().toLowerCase(),
1691
+ position: "top-right",
1692
+ dangerouslyUseHTMLString: true,
1693
+ duration: 5e3
1694
+ });
1695
+ });
1696
+
1697
+ var signalR$1 = /*#__PURE__*/Object.freeze({
1698
+ __proto__: null,
1699
+ signalR: connection
1700
+ });
1701
+
1654
1702
  const setWatermark = (str) => {
1655
1703
  const id = "1.23452384164.123412416";
1656
1704
  if (document.getElementById(id) !== null) document.body.removeChild(document.getElementById(id));
@@ -18705,7 +18753,120 @@
18705
18753
 
18706
18754
  var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABBCAYAAACO98lFAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFwmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgKF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cuuDZYaR5xAWG8meXnaP7SG6VkhtqCIC1+fmCYr0r40WFNcZ4+ab88yWcckqNeFaaVpWZptFNStOmTUjRZKQnqzNTNKoMHMdUjABODyNYSFp02AOC1+LjGbOXEz+b/7Nb8kfuWwKCHOWUGnAcw7Fdz94aY+XoewXhh0I/mj+HRqPbIGAY9j88X5w73RopXgAAAABJRU5ErkJggg==";
18707
18755
 
18756
+ var __defProp = Object.defineProperty;
18757
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18758
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
18759
+ let signalR;
18760
+ async function loadSignalR() {
18761
+ if (!signalR) {
18762
+ const module = await Promise.resolve().then(function () { return signalR$1; });
18763
+ signalR = module.signalR;
18764
+ }
18765
+ return signalR;
18766
+ }
18708
18767
  const { t } = useLocale();
18768
+ class IdleTimeoutManager {
18769
+ constructor(config = {}) {
18770
+ __publicField(this, "timerId", null);
18771
+ __publicField(this, "config");
18772
+ __publicField(this, "debouncedReset");
18773
+ /** 检查闲置超时时间间隔 */
18774
+ __publicField(this, "checkTimeoutInterval", 2 * 1e3);
18775
+ __publicField(this, "handleVisibilityChange", () => {
18776
+ if (document.visibilityState === "visible") {
18777
+ this.setLastActivityTime();
18778
+ }
18779
+ });
18780
+ this.config = {
18781
+ timeout: 30 * 60,
18782
+ events: ["mousewheel", "keydown", "click"],
18783
+ onTimeout: this.timeOutExec.bind(this),
18784
+ debounceInterval: 200,
18785
+ ...config
18786
+ };
18787
+ this.debouncedReset = this.config.debounceInterval > 0 ? lodashEs.debounce(this.setLastActivityTime.bind(this), this.config.debounceInterval) : this.setLastActivityTime.bind(this);
18788
+ this.init();
18789
+ }
18790
+ init() {
18791
+ this.config.events.forEach((event) => {
18792
+ window.addEventListener(event, this.debouncedReset);
18793
+ });
18794
+ document.addEventListener("visibilitychange", this.handleVisibilityChange);
18795
+ this.setLastActivityTime();
18796
+ this.updateIdleTimeout(this.config.timeout);
18797
+ }
18798
+ /** 设置最后活动时间 */
18799
+ setLastActivityTime() {
18800
+ Local.set("lastActivityTime", (/* @__PURE__ */ new Date()).getTime());
18801
+ }
18802
+ /**
18803
+ * 更新空闲超时时间
18804
+ * @param timeout - 新的超时时间(毫秒)
18805
+ */
18806
+ updateIdleTimeout(timeout) {
18807
+ this.config.timeout = timeout;
18808
+ if (this.config.timeout > 0 && this.timerId == null) {
18809
+ this.timerId = window.setInterval(this.checkTimeout.bind(this), this.checkTimeoutInterval);
18810
+ } else if (this.config.timeout == 0 && this.timerId != null) {
18811
+ window.clearInterval(this.timerId);
18812
+ this.timerId = null;
18813
+ }
18814
+ }
18815
+ /** 检查是否超时 */
18816
+ checkTimeout() {
18817
+ const currentTime = (/* @__PURE__ */ new Date()).getTime();
18818
+ const lastActivityTime = Number(Local.get("lastActivityTime"));
18819
+ if (lastActivityTime == 0) return;
18820
+ const accessToken = Local.get(accessTokenKey);
18821
+ if (!accessToken || accessToken == "invalid_token") return;
18822
+ const timeout = this.config.timeout * 1e3;
18823
+ if (currentTime - lastActivityTime > timeout) {
18824
+ this.destroy();
18825
+ this.config.onTimeout();
18826
+ }
18827
+ }
18828
+ /** 销毁实例 */
18829
+ destroy() {
18830
+ this.config.events.forEach((event) => {
18831
+ window.removeEventListener(event, this.debouncedReset);
18832
+ });
18833
+ document.removeEventListener("visibilitychange", this.handleVisibilityChange);
18834
+ if (this.timerId !== null) {
18835
+ window.clearInterval(this.timerId);
18836
+ this.timerId = null;
18837
+ }
18838
+ }
18839
+ /** 超时时执行 */
18840
+ timeOutExec() {
18841
+ const appEl = document.getElementById("app");
18842
+ appEl == null ? void 0 : appEl.remove();
18843
+ loadSignalR().then((signalR2) => {
18844
+ signalR2.stop();
18845
+ });
18846
+ Local.remove(accessTokenKey);
18847
+ Local.remove(refreshAccessTokenKey);
18848
+ Session.clear();
18849
+ elementPlus.ElMessageBox.alert(t("plus.list.idleTimeoutMessage"), t("plus.list.sysMessage"), {
18850
+ type: "warning",
18851
+ draggable: true,
18852
+ callback: () => {
18853
+ window.location.reload();
18854
+ }
18855
+ });
18856
+ }
18857
+ }
18858
+ function initIdleTimeout(config) {
18859
+ if (!window.__IDLE_TIMEOUT__) {
18860
+ window.__IDLE_TIMEOUT__ = new IdleTimeoutManager(config);
18861
+ }
18862
+ return window.__IDLE_TIMEOUT__;
18863
+ }
18864
+ function destroyIdleTimeout() {
18865
+ if (window.__IDLE_TIMEOUT__) {
18866
+ window.__IDLE_TIMEOUT__.destroy();
18867
+ window.__IDLE_TIMEOUT__ = void 0;
18868
+ }
18869
+ }
18709
18870
  function updateIdleTimeout(timeout) {
18710
18871
  if (window.__IDLE_TIMEOUT__) {
18711
18872
  window.__IDLE_TIMEOUT__.updateIdleTimeout(timeout);
@@ -22847,6 +23008,7 @@
22847
23008
  exports.dataURLtoBlob = dataURLtoBlob;
22848
23009
  exports.decryptJWT = decryptJWT;
22849
23010
  exports.default = installer;
23011
+ exports.destroyIdleTimeout = destroyIdleTimeout;
22850
23012
  exports.downloadByBase64 = downloadByBase64;
22851
23013
  exports.downloadByData = downloadByData;
22852
23014
  exports.downloadByOnlineUrl = downloadByOnlineUrl;
@@ -22875,6 +23037,7 @@
22875
23037
  exports.i18n = i18n;
22876
23038
  exports.initBackEndControlRoutes = initBackEndControlRoutes;
22877
23039
  exports.initFrontEndControlRoutes = initFrontEndControlRoutes;
23040
+ exports.initIdleTimeout = initIdleTimeout;
22878
23041
  exports.initRouter = initRouter;
22879
23042
  exports.install = install;
22880
23043
  exports.isAdmin = isAdmin;
@@ -22909,12 +23072,14 @@
22909
23072
  exports.setJsCdn = setJsCdn;
22910
23073
  exports.setPathPrefix = setPathPrefix;
22911
23074
  exports.setupI18n = setupI18n;
23075
+ exports.signalR = connection;
22912
23076
  exports.signatureByKSort = signatureByKSort;
22913
23077
  exports.sleep = sleep;
22914
23078
  exports.tansParams = tansParams;
22915
23079
  exports.tenantId = tenantId;
22916
23080
  exports.translate = translate;
22917
23081
  exports.updateFavicon = updateFavicon;
23082
+ exports.updateIdleTimeout = updateIdleTimeout;
22918
23083
  exports.urlToBase64 = urlToBase64;
22919
23084
  exports.useApi = useApi;
22920
23085
  exports.useBaseApi = useBaseApi;