@fmdeui/fmui 1.0.8 → 1.0.10

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.
@@ -1,8 +1,6 @@
1
- import { default as commonFunction } from './commonFunction';
2
1
  export * from './useLocale';
3
2
  export * from './authFunction';
4
3
  export * from './useVxeTableOptionsHook';
5
4
  export * from './sysInfo';
6
5
  export * from './useInfo';
7
6
  export * from './dateTimeShortCust';
8
- export { commonFunction };
package/es/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import { default as installer } from './defaults';
2
- import { default as mittBus } from './utils/mitt';
3
- import { default as setIntroduction } from './utils/setIconfont';
2
+ import { default as setIntroduction, setCssCdn, setJsCdn } from './utils/setIconfont';
3
+ import { default as emitter } from './utils/mitt';
4
+ import { default as commonFunction } from './hooks/commonFunction';
5
+ import { EmptyArrayType } from './types';
6
+ import { MessageHandler } from 'element-plus';
4
7
  import { App } from 'vue';
5
- export { mittBus, setIntroduction };
6
8
  export * from './types';
7
9
  export * from './api';
8
10
  export * from './utils';
@@ -10,6 +12,29 @@ export * from './stores';
10
12
  export * from './hooks';
11
13
  export * from './router';
12
14
  export * from './locale';
15
+ declare const commonFun: {
16
+ percentFormat: (row: EmptyArrayType, column: number, cellValue: string) => string;
17
+ dateFormatYMD: (row: EmptyArrayType, column: number, cellValue: string) => string;
18
+ dateFormatYMDHMS: (row: EmptyArrayType, column: number, cellValue: string) => string;
19
+ dateFormatHMS: (row: EmptyArrayType, column: number, cellValue: string) => string;
20
+ scaleFormat: (value?: string, scale?: number) => string;
21
+ scale2Format: (value?: string) => string;
22
+ groupSeparator: (value: number, minimumFractionDigits?: number) => string;
23
+ copyText: (text: string) => Promise<unknown>;
24
+ removeHtmlSub: (value: string) => string;
25
+ removeHtml: (value: string) => string;
26
+ getEnumDesc: (key: any, lstEnum: any) => any;
27
+ appendQueryParams: (url: string, params: {
28
+ [key: string]: any;
29
+ }) => string;
30
+ getNameAbbr: (text: string, callback?: (abbr: any) => void) => Promise<any> | MessageHandler | undefined;
31
+ handleConditionalClear: (condition: boolean, fieldValue: any, clearValue?: any) => any;
32
+ getTimeRangePickerShortcuts: () => {
33
+ text: string;
34
+ value: () => Date[];
35
+ }[];
36
+ };
37
+ export { setIntroduction, emitter as mittBus, commonFunction, commonFun, setCssCdn, setJsCdn };
13
38
  export { version } from './version';
14
39
  export declare const install: (app: App) => void;
15
40
  export default installer;
package/es/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import installer from './defaults.mjs';
2
- export { default as mittBus } from './packages/utils/mitt.mjs';
3
2
  export { setCssCdn, default as setIntroduction, setJsCdn } from './packages/utils/setIconfont.mjs';
3
+ export { default as mittBus } from './packages/utils/mitt.mjs';
4
+ import commonFunction from './packages/hooks/commonFunction.mjs';
4
5
  import './packages/types/index.mjs';
5
6
  export { AccountTypeEnum, HttpMethodEnum, JobCreateTypeEnum } from './packages/api/index.mjs';
6
7
  import './packages/utils/index.mjs';
@@ -17,7 +18,6 @@ export { auth, authAll, auths, hAuth, hAuthAll, hAuths } from './packages/hooks/
17
18
  export { base64ToFile, blobToFile, dataURLtoBlob, fileToBase64, urlToBase64 } from './packages/utils/base64Conver.mjs';
18
19
  export { buildLocaleContext, buildTranslator, translate, useLocale } from './packages/hooks/useLocale.mjs';
19
20
  export { clone, isObjectValueEqual, judgementSameArr, removeDuplicate } from './packages/utils/arrayOperation.mjs';
20
- export { default as commonFunction } from './packages/hooks/commonFunction.mjs';
21
21
  export { configureRoutes, setPathPrefix } from './packages/router/route.mjs';
22
22
  export { downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadStreamFile, getFileName, openWindow } from './packages/utils/download.mjs';
23
23
  export { default as en } from './packages/locale/lang/en.mjs';
@@ -47,6 +47,7 @@ export { useVxeTable } from './packages/hooks/useVxeTableOptionsHook.mjs';
47
47
  export { validateFormWithScroll, validateFormWithScrollCallback } from './packages/utils/formValidate.mjs';
48
48
  export { default as zhCn } from './packages/locale/lang/zh-cn.mjs';
49
49
 
50
+ const commonFun = commonFunction();
50
51
  const install = installer.install;
51
52
 
52
- export { installer as default, install };
53
+ export { commonFun, commonFunction, installer as default, install };
@@ -4,4 +4,3 @@ 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 { default as commonFunction } from './commonFunction.mjs';
@@ -13,10 +13,8 @@ export { gcj02ToBd09, wgs84ToBd09, wgs84ToGcj02 } from './gpsConvertor.mjs';
13
13
  export { StringToObj } from './json-utils.mjs';
14
14
  export { NextLoading } from './loading.mjs';
15
15
  import './md5Signature.mjs';
16
- import './mitt.mjs';
17
16
  export { accessTokenKey, axiosInstance, cancelAllRequest, cancelRequest, clearAccessTokens, clearTokens, decryptJWT, getHeader, getJWTDate, getToken, reLoadLoginAccessToken, refreshAccessTokenKey, request2, default as service, sleep, tansParams } from './request.mjs';
18
17
  export { saulVModel } from './saulVModel.mjs';
19
- export { setCssCdn, setJsCdn } from './setIconfont.mjs';
20
18
  export { Local, Session } from './storage.mjs';
21
19
  export { useChangeColor } from './theme.mjs';
22
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';
@@ -13,10 +13,8 @@ export * from './gpsConvertor';
13
13
  export * from './json-utils';
14
14
  export * from './loading';
15
15
  export * from './md5Signature';
16
- export * from './mitt';
17
16
  export * from './request';
18
17
  export * from './saulVModel';
19
- export * from './setIconfont';
20
18
  export * from './storage';
21
19
  export * from './theme';
22
20
  export * from './toolsValidate';
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
- /*! fmdeui-fmui v1.0.8 */
1
+ /*! fmdeui-fmui v1.0.10 */
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('mitt'), 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('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', 'mitt', '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', '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.mitt, global.axios, global.Cookies, global.VxeUITable, global.VxeUIPluginRenderElement, global.VxeUIPluginExportXLSX, global.VxeUIExport, global.vueI18n, global.ExcelJS, global._, global.VueUse, global.vueRouter, global.NProgress));
6
- })(this, (function (exports, pinia$1, CryptoJS, XLSXS, elementPlus, vue, svg, mitt, axios, Cookies, VxeUITable, VxeUIPluginRenderElement, VxeUIPluginExportXLSX, VxeUI, vueI18n, ExcelJS, lodashEs, core, 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('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';
7
7
 
8
8
  const pinia = pinia$1.createPinia();
9
9
 
@@ -1163,8 +1163,6 @@
1163
1163
  }
1164
1164
  };
1165
1165
 
1166
- const emitter = mitt();
1167
-
1168
1166
  const Local = {
1169
1167
  // 查看 v2.4.3版本更新日志
1170
1168
  setKey(key) {
@@ -1445,41 +1443,6 @@
1445
1443
  });
1446
1444
  };
1447
1445
 
1448
- const cssCdnUrlList = [
1449
- // 调整为从本地引入,注释下面的 url
1450
- // '//at.alicdn.com/t/c/font_2298093_rnp72ifj3ba.css',
1451
- // '//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css',
1452
- ];
1453
- const jsCdnUrlList = [];
1454
- function setCssCdn() {
1455
- if (cssCdnUrlList.length <= 0) return false;
1456
- cssCdnUrlList.map((v) => {
1457
- let link = document.createElement("link");
1458
- link.rel = "stylesheet";
1459
- link.href = v;
1460
- link.crossOrigin = "anonymous";
1461
- document.getElementsByTagName("head")[0].appendChild(link);
1462
- });
1463
- }
1464
- function setJsCdn() {
1465
- if (jsCdnUrlList.length <= 0) return false;
1466
- jsCdnUrlList.map((v) => {
1467
- let link = document.createElement("script");
1468
- link.src = v;
1469
- document.body.appendChild(link);
1470
- });
1471
- }
1472
- const setIntroduction = {
1473
- // 设置css
1474
- cssCdn: () => {
1475
- setCssCdn();
1476
- },
1477
- // 设置js
1478
- jsCdn: () => {
1479
- setJsCdn();
1480
- }
1481
- };
1482
-
1483
1446
  function useChangeColor() {
1484
1447
  const hexToRgb = (str) => {
1485
1448
  let hexs = "";
@@ -18860,177 +18823,6 @@
18860
18823
  ];
18861
18824
  };
18862
18825
 
18863
- const themeStore = useThemeConfig();
18864
- function commonFunction() {
18865
- const { t } = vueI18n.useI18n();
18866
- const { copy, isSupported } = core.useClipboard();
18867
- const percentFormat = (row, column, cellValue) => {
18868
- return cellValue ? `${cellValue}%` : "-";
18869
- };
18870
- const dateFormatYMD = (row, column, cellValue) => {
18871
- if (!cellValue) return "-";
18872
- return formatDate(new Date(cellValue), "YYYY-mm-dd");
18873
- };
18874
- const dateFormatYMDHMS = (row, column, cellValue) => {
18875
- if (!cellValue) return "-";
18876
- return formatDate(new Date(cellValue), "YYYY-mm-dd HH:MM:SS");
18877
- };
18878
- const dateFormatHMS = (row, column, cellValue) => {
18879
- if (!cellValue) return "-";
18880
- let time = 0;
18881
- if (typeof row === "number") time = row;
18882
- if (typeof cellValue === "number") time = cellValue;
18883
- return formatDate(new Date(time * 1e3), "HH:MM:SS");
18884
- };
18885
- const scaleFormat = (value = "0", scale = 4) => {
18886
- return Number.parseFloat(value).toFixed(scale);
18887
- };
18888
- const scale2Format = (value = "0") => {
18889
- return Number.parseFloat(value).toFixed(2);
18890
- };
18891
- const groupSeparator = (value, minimumFractionDigits = 2) => {
18892
- return value.toLocaleString("en-US", {
18893
- minimumFractionDigits,
18894
- maximumFractionDigits: 2
18895
- });
18896
- };
18897
- const copyText = (text) => {
18898
- return new Promise((resolve, reject) => {
18899
- try {
18900
- if (!isSupported.value) {
18901
- console.error("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
18902
- reject("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
18903
- } else {
18904
- copy(text);
18905
- elementPlus.ElMessage.success(t("message.layout.copyTextSuccess"));
18906
- resolve(text);
18907
- }
18908
- } catch (e) {
18909
- elementPlus.ElMessage.error(t("message.layout.copyTextError"));
18910
- reject(e);
18911
- }
18912
- });
18913
- };
18914
- const removeHtmlSub = (value) => {
18915
- var str = value.replace(/<[^>]+>/g, "");
18916
- if (str.length > 50) return str.substring(0, 50) + "......";
18917
- else return str;
18918
- };
18919
- const removeHtml = (value) => {
18920
- return value.replace(/<[^>]+>/g, "");
18921
- };
18922
- const getEnumDesc = (key, lstEnum) => {
18923
- var _a;
18924
- return (_a = lstEnum.find((x) => x.value == key)) == null ? void 0 : _a.describe;
18925
- };
18926
- const appendQueryParams = (url, params) => {
18927
- if (!params || Object.keys(params).length == 0) return url;
18928
- const queryString = Object.keys(params).map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`).join("&");
18929
- return `${url}${url.includes("?") ? "&" : "?"}${queryString}`;
18930
- };
18931
- const getNameAbbr = (text, callback) => {
18932
- if (!text) return elementPlus.ElMessage.error("\u83B7\u53D6\u7B80\u79F0\u6587\u672C\u4E0D\u80FD\u4E3A\u7A7A");
18933
- try {
18934
- return useBaseApi("sysCommon").post({ text }, "nameAbbr").then((res) => {
18935
- if (callback) callback(res.data.result);
18936
- return res.data.result;
18937
- });
18938
- } catch (e) {
18939
- elementPlus.ElMessage.error("\u83B7\u53D6\u5931\u8D25");
18940
- }
18941
- };
18942
- const handleConditionalClear = (condition, fieldValue, clearValue = void 0) => {
18943
- if (condition) {
18944
- return clearValue;
18945
- }
18946
- return fieldValue;
18947
- };
18948
- const getTimeRangePickerShortcuts = () => {
18949
- return [
18950
- {
18951
- text: "\u8FD1\u4E00\u5468",
18952
- value: () => {
18953
- const now = new Date(themeStore.themeConfig.serverTime);
18954
- const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
18955
- const start = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 7);
18956
- return [start, end];
18957
- }
18958
- },
18959
- {
18960
- text: "\u8FD1\u4E00\u6708",
18961
- value: () => {
18962
- const now = new Date(themeStore.themeConfig.serverTime);
18963
- const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
18964
- const start = new Date(now.getFullYear(), now.getMonth() - 1, now.getDate());
18965
- return [start, end];
18966
- }
18967
- },
18968
- {
18969
- text: "\u8FD1\u4E09\u6708",
18970
- value: () => {
18971
- const now = new Date(themeStore.themeConfig.serverTime);
18972
- const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
18973
- const start = new Date(now.getFullYear(), now.getMonth() - 3, now.getDate());
18974
- return [start, end];
18975
- }
18976
- },
18977
- {
18978
- text: "\u8FD1\u534A\u5E74",
18979
- value: () => {
18980
- const now = new Date(themeStore.themeConfig.serverTime);
18981
- const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
18982
- const start = new Date(now.getFullYear(), now.getMonth() - 6, now.getDate());
18983
- return [start, end];
18984
- }
18985
- },
18986
- {
18987
- text: "\u672C\u5E74",
18988
- value: () => {
18989
- const now = new Date(themeStore.themeConfig.serverTime);
18990
- const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
18991
- const start = new Date(now.getFullYear(), 0, 1);
18992
- return [start, end];
18993
- }
18994
- },
18995
- {
18996
- text: "\u8FD1\u4E24\u5E74",
18997
- value: () => {
18998
- const now = new Date(themeStore.themeConfig.serverTime);
18999
- const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
19000
- const start = new Date(now.getFullYear() - 1, 0, 1);
19001
- return [start, end];
19002
- }
19003
- },
19004
- {
19005
- text: "\u8FD1\u4E09\u5E74",
19006
- value: () => {
19007
- const now = new Date(themeStore.themeConfig.serverTime);
19008
- const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
19009
- const start = new Date(now.getFullYear() - 2, 0, 1);
19010
- return [start, end];
19011
- }
19012
- }
19013
- ];
19014
- };
19015
- return {
19016
- percentFormat,
19017
- dateFormatYMD,
19018
- dateFormatYMDHMS,
19019
- dateFormatHMS,
19020
- scaleFormat,
19021
- scale2Format,
19022
- groupSeparator,
19023
- copyText,
19024
- removeHtmlSub,
19025
- removeHtml,
19026
- getEnumDesc,
19027
- appendQueryParams,
19028
- getNameAbbr,
19029
- handleConditionalClear,
19030
- getTimeRangePickerShortcuts
19031
- };
19032
- }
19033
-
19034
18826
  const _hoisted_1$6 = { key: 0 };
19035
18827
  const _hoisted_2$3 = { key: 0 };
19036
18828
  var _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
@@ -22186,6 +21978,214 @@
22186
21978
 
22187
21979
  var installer = makeInstaller([...plugins]);
22188
21980
 
21981
+ const cssCdnUrlList = [
21982
+ // 调整为从本地引入,注释下面的 url
21983
+ // '//at.alicdn.com/t/c/font_2298093_rnp72ifj3ba.css',
21984
+ // '//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css',
21985
+ ];
21986
+ const jsCdnUrlList = [];
21987
+ function setCssCdn() {
21988
+ if (cssCdnUrlList.length <= 0) return false;
21989
+ cssCdnUrlList.map((v) => {
21990
+ let link = document.createElement("link");
21991
+ link.rel = "stylesheet";
21992
+ link.href = v;
21993
+ link.crossOrigin = "anonymous";
21994
+ document.getElementsByTagName("head")[0].appendChild(link);
21995
+ });
21996
+ }
21997
+ function setJsCdn() {
21998
+ if (jsCdnUrlList.length <= 0) return false;
21999
+ jsCdnUrlList.map((v) => {
22000
+ let link = document.createElement("script");
22001
+ link.src = v;
22002
+ document.body.appendChild(link);
22003
+ });
22004
+ }
22005
+ const setIntroduction = {
22006
+ // 设置css
22007
+ cssCdn: () => {
22008
+ setCssCdn();
22009
+ },
22010
+ // 设置js
22011
+ jsCdn: () => {
22012
+ setJsCdn();
22013
+ }
22014
+ };
22015
+
22016
+ const emitter = mitt();
22017
+
22018
+ const themeStore = useThemeConfig();
22019
+ function commonFunction() {
22020
+ const { t } = vueI18n.useI18n();
22021
+ const { copy, isSupported } = core.useClipboard();
22022
+ const percentFormat = (row, column, cellValue) => {
22023
+ return cellValue ? `${cellValue}%` : "-";
22024
+ };
22025
+ const dateFormatYMD = (row, column, cellValue) => {
22026
+ if (!cellValue) return "-";
22027
+ return formatDate(new Date(cellValue), "YYYY-mm-dd");
22028
+ };
22029
+ const dateFormatYMDHMS = (row, column, cellValue) => {
22030
+ if (!cellValue) return "-";
22031
+ return formatDate(new Date(cellValue), "YYYY-mm-dd HH:MM:SS");
22032
+ };
22033
+ const dateFormatHMS = (row, column, cellValue) => {
22034
+ if (!cellValue) return "-";
22035
+ let time = 0;
22036
+ if (typeof row === "number") time = row;
22037
+ if (typeof cellValue === "number") time = cellValue;
22038
+ return formatDate(new Date(time * 1e3), "HH:MM:SS");
22039
+ };
22040
+ const scaleFormat = (value = "0", scale = 4) => {
22041
+ return Number.parseFloat(value).toFixed(scale);
22042
+ };
22043
+ const scale2Format = (value = "0") => {
22044
+ return Number.parseFloat(value).toFixed(2);
22045
+ };
22046
+ const groupSeparator = (value, minimumFractionDigits = 2) => {
22047
+ return value.toLocaleString("en-US", {
22048
+ minimumFractionDigits,
22049
+ maximumFractionDigits: 2
22050
+ });
22051
+ };
22052
+ const copyText = (text) => {
22053
+ return new Promise((resolve, reject) => {
22054
+ try {
22055
+ if (!isSupported.value) {
22056
+ console.error("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
22057
+ reject("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
22058
+ } else {
22059
+ copy(text);
22060
+ elementPlus.ElMessage.success(t("message.layout.copyTextSuccess"));
22061
+ resolve(text);
22062
+ }
22063
+ } catch (e) {
22064
+ elementPlus.ElMessage.error(t("message.layout.copyTextError"));
22065
+ reject(e);
22066
+ }
22067
+ });
22068
+ };
22069
+ const removeHtmlSub = (value) => {
22070
+ var str = value.replace(/<[^>]+>/g, "");
22071
+ if (str.length > 50) return str.substring(0, 50) + "......";
22072
+ else return str;
22073
+ };
22074
+ const removeHtml = (value) => {
22075
+ return value.replace(/<[^>]+>/g, "");
22076
+ };
22077
+ const getEnumDesc = (key, lstEnum) => {
22078
+ var _a;
22079
+ return (_a = lstEnum.find((x) => x.value == key)) == null ? void 0 : _a.describe;
22080
+ };
22081
+ const appendQueryParams = (url, params) => {
22082
+ if (!params || Object.keys(params).length == 0) return url;
22083
+ const queryString = Object.keys(params).map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`).join("&");
22084
+ return `${url}${url.includes("?") ? "&" : "?"}${queryString}`;
22085
+ };
22086
+ const getNameAbbr = (text, callback) => {
22087
+ if (!text) return elementPlus.ElMessage.error("\u83B7\u53D6\u7B80\u79F0\u6587\u672C\u4E0D\u80FD\u4E3A\u7A7A");
22088
+ try {
22089
+ return useBaseApi("sysCommon").post({ text }, "nameAbbr").then((res) => {
22090
+ if (callback) callback(res.data.result);
22091
+ return res.data.result;
22092
+ });
22093
+ } catch (e) {
22094
+ elementPlus.ElMessage.error("\u83B7\u53D6\u5931\u8D25");
22095
+ }
22096
+ };
22097
+ const handleConditionalClear = (condition, fieldValue, clearValue = void 0) => {
22098
+ if (condition) {
22099
+ return clearValue;
22100
+ }
22101
+ return fieldValue;
22102
+ };
22103
+ const getTimeRangePickerShortcuts = () => {
22104
+ return [
22105
+ {
22106
+ text: "\u8FD1\u4E00\u5468",
22107
+ value: () => {
22108
+ const now = new Date(themeStore.themeConfig.serverTime);
22109
+ const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
22110
+ const start = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 7);
22111
+ return [start, end];
22112
+ }
22113
+ },
22114
+ {
22115
+ text: "\u8FD1\u4E00\u6708",
22116
+ value: () => {
22117
+ const now = new Date(themeStore.themeConfig.serverTime);
22118
+ const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
22119
+ const start = new Date(now.getFullYear(), now.getMonth() - 1, now.getDate());
22120
+ return [start, end];
22121
+ }
22122
+ },
22123
+ {
22124
+ text: "\u8FD1\u4E09\u6708",
22125
+ value: () => {
22126
+ const now = new Date(themeStore.themeConfig.serverTime);
22127
+ const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
22128
+ const start = new Date(now.getFullYear(), now.getMonth() - 3, now.getDate());
22129
+ return [start, end];
22130
+ }
22131
+ },
22132
+ {
22133
+ text: "\u8FD1\u534A\u5E74",
22134
+ value: () => {
22135
+ const now = new Date(themeStore.themeConfig.serverTime);
22136
+ const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
22137
+ const start = new Date(now.getFullYear(), now.getMonth() - 6, now.getDate());
22138
+ return [start, end];
22139
+ }
22140
+ },
22141
+ {
22142
+ text: "\u672C\u5E74",
22143
+ value: () => {
22144
+ const now = new Date(themeStore.themeConfig.serverTime);
22145
+ const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
22146
+ const start = new Date(now.getFullYear(), 0, 1);
22147
+ return [start, end];
22148
+ }
22149
+ },
22150
+ {
22151
+ text: "\u8FD1\u4E24\u5E74",
22152
+ value: () => {
22153
+ const now = new Date(themeStore.themeConfig.serverTime);
22154
+ const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
22155
+ const start = new Date(now.getFullYear() - 1, 0, 1);
22156
+ return [start, end];
22157
+ }
22158
+ },
22159
+ {
22160
+ text: "\u8FD1\u4E09\u5E74",
22161
+ value: () => {
22162
+ const now = new Date(themeStore.themeConfig.serverTime);
22163
+ const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
22164
+ const start = new Date(now.getFullYear() - 2, 0, 1);
22165
+ return [start, end];
22166
+ }
22167
+ }
22168
+ ];
22169
+ };
22170
+ return {
22171
+ percentFormat,
22172
+ dateFormatYMD,
22173
+ dateFormatYMDHMS,
22174
+ dateFormatHMS,
22175
+ scaleFormat,
22176
+ scale2Format,
22177
+ groupSeparator,
22178
+ copyText,
22179
+ removeHtmlSub,
22180
+ removeHtml,
22181
+ getEnumDesc,
22182
+ appendQueryParams,
22183
+ getNameAbbr,
22184
+ handleConditionalClear,
22185
+ getTimeRangePickerShortcuts
22186
+ };
22187
+ }
22188
+
22189
22189
  let pathPrefix = "/@";
22190
22190
  function setPathPrefix(prefix) {
22191
22191
  pathPrefix = prefix;
@@ -22564,6 +22564,7 @@
22564
22564
 
22565
22565
  const version = "1.0.0";
22566
22566
 
22567
+ const commonFun = commonFunction();
22567
22568
  const install = installer.install;
22568
22569
 
22569
22570
  exports.AccountTypeEnum = AccountTypeEnum;
@@ -22587,6 +22588,7 @@
22587
22588
  exports.clearAccessTokens = clearAccessTokens;
22588
22589
  exports.clearTokens = clearTokens;
22589
22590
  exports.clone = clone;
22591
+ exports.commonFun = commonFun;
22590
22592
  exports.commonFunction = commonFunction;
22591
22593
  exports.configureRoutes = configureRoutes;
22592
22594
  exports.dataURLtoBlob = dataURLtoBlob;