@fmdeui/fmui 1.0.7 → 1.0.8
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/hooks/commonFunction.d.ts +24 -0
- package/es/hooks/index.d.ts +2 -0
- package/es/index.d.ts +3 -0
- package/es/index.mjs +3 -1
- package/es/packages/hooks/commonFunction.mjs +182 -0
- package/es/packages/hooks/index.mjs +1 -0
- package/es/types/layout/index.d.ts +47 -1
- package/es/types/pinia/index.d.ts +1 -0
- package/index.js +186 -2
- package/index.min.js +4 -4
- package/index.min.mjs +4 -4
- package/index.mjs +186 -5
- package/lib/hooks/commonFunction.d.ts +24 -0
- package/lib/hooks/index.d.ts +2 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +8 -3
- package/lib/packages/hooks/commonFunction.js +186 -0
- package/lib/packages/hooks/index.js +2 -0
- package/lib/types/layout/index.d.ts +47 -1
- package/lib/types/pinia/index.d.ts +1 -0
- 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/es/{make-installer.css → defaults.css} +0 -0
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.8 */
|
|
2
2
|
import { createPinia, defineStore, storeToRefs } from 'pinia';
|
|
3
3
|
import CryptoJS from 'crypto-js';
|
|
4
4
|
import XLSXS from 'xlsx-js-style';
|
|
@@ -12,10 +12,10 @@ import VxeUITable from 'vxe-table';
|
|
|
12
12
|
import VxeUIPluginRenderElement from '@vxe-ui/plugin-render-element';
|
|
13
13
|
import VxeUIPluginExportXLSX from '@vxe-ui/plugin-export-xlsx';
|
|
14
14
|
import VxeUI from 'vxe-pc-ui';
|
|
15
|
-
import { createI18n } from 'vue-i18n';
|
|
15
|
+
import { createI18n, useI18n } from 'vue-i18n';
|
|
16
16
|
import ExcelJS from 'exceljs';
|
|
17
17
|
import { get, merge } from 'lodash-es';
|
|
18
|
-
import { isClient, useResizeObserver } from '@vueuse/core';
|
|
18
|
+
import { useClipboard, isClient, useResizeObserver } from '@vueuse/core';
|
|
19
19
|
import { createRouter, createWebHashHistory } from 'vue-router';
|
|
20
20
|
import NProgress from 'nprogress';
|
|
21
21
|
|
|
@@ -1177,7 +1177,7 @@ const NextLoading = {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
};
|
|
1179
1179
|
|
|
1180
|
-
mitt();
|
|
1180
|
+
const emitter = mitt();
|
|
1181
1181
|
|
|
1182
1182
|
const Local = {
|
|
1183
1183
|
// 查看 v2.4.3版本更新日志
|
|
@@ -1483,6 +1483,16 @@ function setJsCdn() {
|
|
|
1483
1483
|
document.body.appendChild(link);
|
|
1484
1484
|
});
|
|
1485
1485
|
}
|
|
1486
|
+
const setIntroduction = {
|
|
1487
|
+
// 设置css
|
|
1488
|
+
cssCdn: () => {
|
|
1489
|
+
setCssCdn();
|
|
1490
|
+
},
|
|
1491
|
+
// 设置js
|
|
1492
|
+
jsCdn: () => {
|
|
1493
|
+
setJsCdn();
|
|
1494
|
+
}
|
|
1495
|
+
};
|
|
1486
1496
|
|
|
1487
1497
|
function useChangeColor() {
|
|
1488
1498
|
const hexToRgb = (str) => {
|
|
@@ -18864,6 +18874,177 @@ const useDateTimeShortCust = () => {
|
|
|
18864
18874
|
];
|
|
18865
18875
|
};
|
|
18866
18876
|
|
|
18877
|
+
const themeStore = useThemeConfig();
|
|
18878
|
+
function commonFunction() {
|
|
18879
|
+
const { t } = useI18n();
|
|
18880
|
+
const { copy, isSupported } = useClipboard();
|
|
18881
|
+
const percentFormat = (row, column, cellValue) => {
|
|
18882
|
+
return cellValue ? `${cellValue}%` : "-";
|
|
18883
|
+
};
|
|
18884
|
+
const dateFormatYMD = (row, column, cellValue) => {
|
|
18885
|
+
if (!cellValue) return "-";
|
|
18886
|
+
return formatDate(new Date(cellValue), "YYYY-mm-dd");
|
|
18887
|
+
};
|
|
18888
|
+
const dateFormatYMDHMS = (row, column, cellValue) => {
|
|
18889
|
+
if (!cellValue) return "-";
|
|
18890
|
+
return formatDate(new Date(cellValue), "YYYY-mm-dd HH:MM:SS");
|
|
18891
|
+
};
|
|
18892
|
+
const dateFormatHMS = (row, column, cellValue) => {
|
|
18893
|
+
if (!cellValue) return "-";
|
|
18894
|
+
let time = 0;
|
|
18895
|
+
if (typeof row === "number") time = row;
|
|
18896
|
+
if (typeof cellValue === "number") time = cellValue;
|
|
18897
|
+
return formatDate(new Date(time * 1e3), "HH:MM:SS");
|
|
18898
|
+
};
|
|
18899
|
+
const scaleFormat = (value = "0", scale = 4) => {
|
|
18900
|
+
return Number.parseFloat(value).toFixed(scale);
|
|
18901
|
+
};
|
|
18902
|
+
const scale2Format = (value = "0") => {
|
|
18903
|
+
return Number.parseFloat(value).toFixed(2);
|
|
18904
|
+
};
|
|
18905
|
+
const groupSeparator = (value, minimumFractionDigits = 2) => {
|
|
18906
|
+
return value.toLocaleString("en-US", {
|
|
18907
|
+
minimumFractionDigits,
|
|
18908
|
+
maximumFractionDigits: 2
|
|
18909
|
+
});
|
|
18910
|
+
};
|
|
18911
|
+
const copyText = (text) => {
|
|
18912
|
+
return new Promise((resolve, reject) => {
|
|
18913
|
+
try {
|
|
18914
|
+
if (!isSupported.value) {
|
|
18915
|
+
console.error("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
|
|
18916
|
+
reject("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
|
|
18917
|
+
} else {
|
|
18918
|
+
copy(text);
|
|
18919
|
+
ElMessage.success(t("message.layout.copyTextSuccess"));
|
|
18920
|
+
resolve(text);
|
|
18921
|
+
}
|
|
18922
|
+
} catch (e) {
|
|
18923
|
+
ElMessage.error(t("message.layout.copyTextError"));
|
|
18924
|
+
reject(e);
|
|
18925
|
+
}
|
|
18926
|
+
});
|
|
18927
|
+
};
|
|
18928
|
+
const removeHtmlSub = (value) => {
|
|
18929
|
+
var str = value.replace(/<[^>]+>/g, "");
|
|
18930
|
+
if (str.length > 50) return str.substring(0, 50) + "......";
|
|
18931
|
+
else return str;
|
|
18932
|
+
};
|
|
18933
|
+
const removeHtml = (value) => {
|
|
18934
|
+
return value.replace(/<[^>]+>/g, "");
|
|
18935
|
+
};
|
|
18936
|
+
const getEnumDesc = (key, lstEnum) => {
|
|
18937
|
+
var _a;
|
|
18938
|
+
return (_a = lstEnum.find((x) => x.value == key)) == null ? void 0 : _a.describe;
|
|
18939
|
+
};
|
|
18940
|
+
const appendQueryParams = (url, params) => {
|
|
18941
|
+
if (!params || Object.keys(params).length == 0) return url;
|
|
18942
|
+
const queryString = Object.keys(params).map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`).join("&");
|
|
18943
|
+
return `${url}${url.includes("?") ? "&" : "?"}${queryString}`;
|
|
18944
|
+
};
|
|
18945
|
+
const getNameAbbr = (text, callback) => {
|
|
18946
|
+
if (!text) return ElMessage.error("\u83B7\u53D6\u7B80\u79F0\u6587\u672C\u4E0D\u80FD\u4E3A\u7A7A");
|
|
18947
|
+
try {
|
|
18948
|
+
return useBaseApi("sysCommon").post({ text }, "nameAbbr").then((res) => {
|
|
18949
|
+
if (callback) callback(res.data.result);
|
|
18950
|
+
return res.data.result;
|
|
18951
|
+
});
|
|
18952
|
+
} catch (e) {
|
|
18953
|
+
ElMessage.error("\u83B7\u53D6\u5931\u8D25");
|
|
18954
|
+
}
|
|
18955
|
+
};
|
|
18956
|
+
const handleConditionalClear = (condition, fieldValue, clearValue = void 0) => {
|
|
18957
|
+
if (condition) {
|
|
18958
|
+
return clearValue;
|
|
18959
|
+
}
|
|
18960
|
+
return fieldValue;
|
|
18961
|
+
};
|
|
18962
|
+
const getTimeRangePickerShortcuts = () => {
|
|
18963
|
+
return [
|
|
18964
|
+
{
|
|
18965
|
+
text: "\u8FD1\u4E00\u5468",
|
|
18966
|
+
value: () => {
|
|
18967
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18968
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
18969
|
+
const start = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 7);
|
|
18970
|
+
return [start, end];
|
|
18971
|
+
}
|
|
18972
|
+
},
|
|
18973
|
+
{
|
|
18974
|
+
text: "\u8FD1\u4E00\u6708",
|
|
18975
|
+
value: () => {
|
|
18976
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18977
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
18978
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 1, now.getDate());
|
|
18979
|
+
return [start, end];
|
|
18980
|
+
}
|
|
18981
|
+
},
|
|
18982
|
+
{
|
|
18983
|
+
text: "\u8FD1\u4E09\u6708",
|
|
18984
|
+
value: () => {
|
|
18985
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18986
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
18987
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 3, now.getDate());
|
|
18988
|
+
return [start, end];
|
|
18989
|
+
}
|
|
18990
|
+
},
|
|
18991
|
+
{
|
|
18992
|
+
text: "\u8FD1\u534A\u5E74",
|
|
18993
|
+
value: () => {
|
|
18994
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18995
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
18996
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 6, now.getDate());
|
|
18997
|
+
return [start, end];
|
|
18998
|
+
}
|
|
18999
|
+
},
|
|
19000
|
+
{
|
|
19001
|
+
text: "\u672C\u5E74",
|
|
19002
|
+
value: () => {
|
|
19003
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
19004
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
19005
|
+
const start = new Date(now.getFullYear(), 0, 1);
|
|
19006
|
+
return [start, end];
|
|
19007
|
+
}
|
|
19008
|
+
},
|
|
19009
|
+
{
|
|
19010
|
+
text: "\u8FD1\u4E24\u5E74",
|
|
19011
|
+
value: () => {
|
|
19012
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
19013
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
19014
|
+
const start = new Date(now.getFullYear() - 1, 0, 1);
|
|
19015
|
+
return [start, end];
|
|
19016
|
+
}
|
|
19017
|
+
},
|
|
19018
|
+
{
|
|
19019
|
+
text: "\u8FD1\u4E09\u5E74",
|
|
19020
|
+
value: () => {
|
|
19021
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
19022
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
19023
|
+
const start = new Date(now.getFullYear() - 2, 0, 1);
|
|
19024
|
+
return [start, end];
|
|
19025
|
+
}
|
|
19026
|
+
}
|
|
19027
|
+
];
|
|
19028
|
+
};
|
|
19029
|
+
return {
|
|
19030
|
+
percentFormat,
|
|
19031
|
+
dateFormatYMD,
|
|
19032
|
+
dateFormatYMDHMS,
|
|
19033
|
+
dateFormatHMS,
|
|
19034
|
+
scaleFormat,
|
|
19035
|
+
scale2Format,
|
|
19036
|
+
groupSeparator,
|
|
19037
|
+
copyText,
|
|
19038
|
+
removeHtmlSub,
|
|
19039
|
+
removeHtml,
|
|
19040
|
+
getEnumDesc,
|
|
19041
|
+
appendQueryParams,
|
|
19042
|
+
getNameAbbr,
|
|
19043
|
+
handleConditionalClear,
|
|
19044
|
+
getTimeRangePickerShortcuts
|
|
19045
|
+
};
|
|
19046
|
+
}
|
|
19047
|
+
|
|
18867
19048
|
const _hoisted_1$6 = { key: 0 };
|
|
18868
19049
|
const _hoisted_2$3 = { key: 0 };
|
|
18869
19050
|
var _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
@@ -22399,4 +22580,4 @@ const version = "1.0.0";
|
|
|
22399
22580
|
|
|
22400
22581
|
const install = installer.install;
|
|
22401
22582
|
|
|
22402
|
-
export { AccountTypeEnum, HttpMethodEnum, JobCreateTypeEnum, Local, NextLoading, Session, StringToObj, accessTokenKey, auth, authAll, auths, axiosInstance, base64ToFile, blobToFile, buildLocaleContext, buildTranslator, cancelAllRequest, cancelRequest, clearAccessTokens, clearTokens, clone, configureRoutes, dataURLtoBlob, decryptJWT, installer as default, downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadStreamFile, en, exportExcel, feature, fileToBase64, flowLoading, formatAxis, formatDate, formatPast, gcj02ToBd09, getCountryCode, getFileName, getHeader, getJWTDate, getToken, getWeek, hAuth, hAuthAll, hAuths, hasPrivilege, hasRoleCode, i18n, initBackEndControlRoutes, initFrontEndControlRoutes, initRouter, install, isAdmin, isMember, isNormalUser, isObjectValueEqual, isSupperAdmin, isTenantAdmin, iso_3166_1_CountryList, judgementIdCard, judgementSameArr, languageList, loadSysInfo, mergMessage, openWindow, orgId, orgName, posId, posName, reLoadLoginAccessToken, refreshAccessTokenKey, removeDuplicate, request2, roles, saulVModel, service, setCssCdn, setDynamicViewsModules, setJsCdn, setPathPrefix, setupI18n, signatureByKSort, sleep, tansParams, tenantId, translate, updateFavicon, urlToBase64, useApi, useBaseApi, useChangeColor, useDateTimeShortCust, useFormRulePresets, useKeepALiveNames, useLocale, useRequestOldRoutes, useRoutesList, useSysApi, useTagsViewRoutes, useThemeConfig, useUserInfo, useVxeTable, userAccount, userEmail, userFriendName, userId, userName, userPhone, validateFormWithScroll, validateFormWithScrollCallback, verifiyNumberInteger, verifyAccount, verifyAndSpace, verifyCarNum, verifyCnAndSpace, verifyEmail, verifyEnAndSpace, verifyFullName, verifyIPAddress, verifyIdCard, verifyNumberCnUppercase, verifyNumberComma, verifyNumberIntegerAndFloat, verifyNumberPercentage, verifyNumberPercentageFloat, verifyPassword, verifyPasswordPowerful, verifyPasswordStrength, verifyPhone, verifyPostalCode, verifyTelPhone, verifyTextColor, verifyUrl, version, wgs84ToBd09, wgs84ToGcj02, plusZhCn as zhCn };
|
|
22583
|
+
export { AccountTypeEnum, HttpMethodEnum, JobCreateTypeEnum, Local, NextLoading, Session, StringToObj, accessTokenKey, auth, authAll, auths, axiosInstance, base64ToFile, blobToFile, buildLocaleContext, buildTranslator, cancelAllRequest, cancelRequest, clearAccessTokens, clearTokens, clone, commonFunction, configureRoutes, dataURLtoBlob, decryptJWT, installer as default, downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadStreamFile, en, exportExcel, feature, fileToBase64, flowLoading, formatAxis, formatDate, formatPast, gcj02ToBd09, getCountryCode, getFileName, getHeader, getJWTDate, getToken, getWeek, hAuth, hAuthAll, hAuths, hasPrivilege, hasRoleCode, i18n, initBackEndControlRoutes, initFrontEndControlRoutes, initRouter, install, isAdmin, isMember, isNormalUser, isObjectValueEqual, isSupperAdmin, isTenantAdmin, iso_3166_1_CountryList, judgementIdCard, judgementSameArr, languageList, loadSysInfo, mergMessage, emitter as mittBus, openWindow, orgId, orgName, posId, posName, reLoadLoginAccessToken, refreshAccessTokenKey, removeDuplicate, request2, roles, saulVModel, service, setCssCdn, setDynamicViewsModules, setIntroduction, setJsCdn, setPathPrefix, setupI18n, signatureByKSort, sleep, tansParams, tenantId, translate, updateFavicon, urlToBase64, useApi, useBaseApi, useChangeColor, useDateTimeShortCust, useFormRulePresets, useKeepALiveNames, useLocale, useRequestOldRoutes, useRoutesList, useSysApi, useTagsViewRoutes, useThemeConfig, useUserInfo, useVxeTable, userAccount, userEmail, userFriendName, userId, userName, userPhone, validateFormWithScroll, validateFormWithScrollCallback, verifiyNumberInteger, verifyAccount, verifyAndSpace, verifyCarNum, verifyCnAndSpace, verifyEmail, verifyEnAndSpace, verifyFullName, verifyIPAddress, verifyIdCard, verifyNumberCnUppercase, verifyNumberComma, verifyNumberIntegerAndFloat, verifyNumberPercentage, verifyNumberPercentageFloat, verifyPassword, verifyPasswordPowerful, verifyPasswordStrength, verifyPhone, verifyPostalCode, verifyTelPhone, verifyTextColor, verifyUrl, version, wgs84ToBd09, wgs84ToGcj02, plusZhCn as zhCn };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EmptyArrayType } from 'fmdeui-fmui/es/types';
|
|
2
|
+
import { MessageHandler } from 'element-plus';
|
|
3
|
+
export default function (): {
|
|
4
|
+
percentFormat: (row: EmptyArrayType, column: number, cellValue: string) => string;
|
|
5
|
+
dateFormatYMD: (row: EmptyArrayType, column: number, cellValue: string) => string;
|
|
6
|
+
dateFormatYMDHMS: (row: EmptyArrayType, column: number, cellValue: string) => string;
|
|
7
|
+
dateFormatHMS: (row: EmptyArrayType, column: number, cellValue: string) => string;
|
|
8
|
+
scaleFormat: (value?: string, scale?: number) => string;
|
|
9
|
+
scale2Format: (value?: string) => string;
|
|
10
|
+
groupSeparator: (value: number, minimumFractionDigits?: number) => string;
|
|
11
|
+
copyText: (text: string) => Promise<unknown>;
|
|
12
|
+
removeHtmlSub: (value: string) => string;
|
|
13
|
+
removeHtml: (value: string) => string;
|
|
14
|
+
getEnumDesc: (key: any, lstEnum: any) => any;
|
|
15
|
+
appendQueryParams: (url: string, params: {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}) => string;
|
|
18
|
+
getNameAbbr: (text: string, callback?: (abbr: any) => void) => Promise<any> | MessageHandler | undefined;
|
|
19
|
+
handleConditionalClear: (condition: boolean, fieldValue: any, clearValue?: any) => any;
|
|
20
|
+
getTimeRangePickerShortcuts: () => {
|
|
21
|
+
text: string;
|
|
22
|
+
value: () => Date[];
|
|
23
|
+
}[];
|
|
24
|
+
};
|
package/lib/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { default as commonFunction } from './commonFunction';
|
|
1
2
|
export * from './useLocale';
|
|
2
3
|
export * from './authFunction';
|
|
3
4
|
export * from './useVxeTableOptionsHook';
|
|
4
5
|
export * from './sysInfo';
|
|
5
6
|
export * from './useInfo';
|
|
6
7
|
export * from './dateTimeShortCust';
|
|
8
|
+
export { commonFunction };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
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
4
|
import { App } from 'vue';
|
|
5
|
+
export { mittBus, setIntroduction };
|
|
3
6
|
export * from './types';
|
|
4
7
|
export * from './api';
|
|
5
8
|
export * from './utils';
|
package/lib/index.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var defaults = require('./defaults.js');
|
|
6
|
+
var mitt = require('./packages/utils/mitt.js');
|
|
7
|
+
var setIconfont = require('./packages/utils/setIconfont.js');
|
|
6
8
|
require('./packages/types/index.js');
|
|
7
9
|
var index = require('./packages/api/index.js');
|
|
8
10
|
require('./packages/utils/index.js');
|
|
@@ -19,6 +21,7 @@ var authFunction = require('./packages/hooks/authFunction.js');
|
|
|
19
21
|
var base64Conver = require('./packages/utils/base64Conver.js');
|
|
20
22
|
var useLocale = require('./packages/hooks/useLocale.js');
|
|
21
23
|
var arrayOperation = require('./packages/utils/arrayOperation.js');
|
|
24
|
+
var commonFunction = require('./packages/hooks/commonFunction.js');
|
|
22
25
|
var route = require('./packages/router/route.js');
|
|
23
26
|
var download = require('./packages/utils/download.js');
|
|
24
27
|
var en = require('./packages/locale/lang/en.js');
|
|
@@ -33,7 +36,6 @@ var frontEnd = require('./packages/router/frontEnd.js');
|
|
|
33
36
|
var toolsValidate = require('./packages/utils/toolsValidate.js');
|
|
34
37
|
var sysInfo = require('./packages/hooks/sysInfo.js');
|
|
35
38
|
var saulVModel = require('./packages/utils/saulVModel.js');
|
|
36
|
-
var setIconfont = require('./packages/utils/setIconfont.js');
|
|
37
39
|
var dataSignature = require('./packages/utils/data-signature.js');
|
|
38
40
|
var index$4 = require('./packages/api/base/index.js');
|
|
39
41
|
var theme = require('./packages/utils/theme.js');
|
|
@@ -52,6 +54,10 @@ var zhCn = require('./packages/locale/lang/zh-cn.js');
|
|
|
52
54
|
const install = defaults.default.install;
|
|
53
55
|
|
|
54
56
|
exports.default = defaults.default;
|
|
57
|
+
exports.mittBus = mitt.default;
|
|
58
|
+
exports.setCssCdn = setIconfont.setCssCdn;
|
|
59
|
+
exports.setIntroduction = setIconfont.default;
|
|
60
|
+
exports.setJsCdn = setIconfont.setJsCdn;
|
|
55
61
|
exports.AccountTypeEnum = index.AccountTypeEnum;
|
|
56
62
|
exports.HttpMethodEnum = index.HttpMethodEnum;
|
|
57
63
|
exports.JobCreateTypeEnum = index.JobCreateTypeEnum;
|
|
@@ -102,6 +108,7 @@ exports.clone = arrayOperation.clone;
|
|
|
102
108
|
exports.isObjectValueEqual = arrayOperation.isObjectValueEqual;
|
|
103
109
|
exports.judgementSameArr = arrayOperation.judgementSameArr;
|
|
104
110
|
exports.removeDuplicate = arrayOperation.removeDuplicate;
|
|
111
|
+
exports.commonFunction = commonFunction.default;
|
|
105
112
|
exports.configureRoutes = route.configureRoutes;
|
|
106
113
|
exports.setPathPrefix = route.setPathPrefix;
|
|
107
114
|
exports.downloadByBase64 = download.downloadByBase64;
|
|
@@ -172,8 +179,6 @@ exports.verifyUrl = toolsValidate.verifyUrl;
|
|
|
172
179
|
exports.loadSysInfo = sysInfo.loadSysInfo;
|
|
173
180
|
exports.updateFavicon = sysInfo.updateFavicon;
|
|
174
181
|
exports.saulVModel = saulVModel.saulVModel;
|
|
175
|
-
exports.setCssCdn = setIconfont.setCssCdn;
|
|
176
|
-
exports.setJsCdn = setIconfont.setJsCdn;
|
|
177
182
|
exports.signatureByKSort = dataSignature.signatureByKSort;
|
|
178
183
|
exports.useApi = index$4.useApi;
|
|
179
184
|
exports.useBaseApi = index$4.useBaseApi;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var core = require('@vueuse/core');
|
|
6
|
+
var elementPlus = require('element-plus');
|
|
7
|
+
var vueI18n = require('vue-i18n');
|
|
8
|
+
require('../utils/index.js');
|
|
9
|
+
require('../stores/index.js');
|
|
10
|
+
require('../api/index.js');
|
|
11
|
+
var themeConfig = require('../stores/themeConfig.js');
|
|
12
|
+
var formatTime = require('../utils/formatTime.js');
|
|
13
|
+
var index = require('../api/base/index.js');
|
|
14
|
+
|
|
15
|
+
const themeStore = themeConfig.useThemeConfig();
|
|
16
|
+
function commonFunction() {
|
|
17
|
+
const { t } = vueI18n.useI18n();
|
|
18
|
+
const { copy, isSupported } = core.useClipboard();
|
|
19
|
+
const percentFormat = (row, column, cellValue) => {
|
|
20
|
+
return cellValue ? `${cellValue}%` : "-";
|
|
21
|
+
};
|
|
22
|
+
const dateFormatYMD = (row, column, cellValue) => {
|
|
23
|
+
if (!cellValue) return "-";
|
|
24
|
+
return formatTime.formatDate(new Date(cellValue), "YYYY-mm-dd");
|
|
25
|
+
};
|
|
26
|
+
const dateFormatYMDHMS = (row, column, cellValue) => {
|
|
27
|
+
if (!cellValue) return "-";
|
|
28
|
+
return formatTime.formatDate(new Date(cellValue), "YYYY-mm-dd HH:MM:SS");
|
|
29
|
+
};
|
|
30
|
+
const dateFormatHMS = (row, column, cellValue) => {
|
|
31
|
+
if (!cellValue) return "-";
|
|
32
|
+
let time = 0;
|
|
33
|
+
if (typeof row === "number") time = row;
|
|
34
|
+
if (typeof cellValue === "number") time = cellValue;
|
|
35
|
+
return formatTime.formatDate(new Date(time * 1e3), "HH:MM:SS");
|
|
36
|
+
};
|
|
37
|
+
const scaleFormat = (value = "0", scale = 4) => {
|
|
38
|
+
return Number.parseFloat(value).toFixed(scale);
|
|
39
|
+
};
|
|
40
|
+
const scale2Format = (value = "0") => {
|
|
41
|
+
return Number.parseFloat(value).toFixed(2);
|
|
42
|
+
};
|
|
43
|
+
const groupSeparator = (value, minimumFractionDigits = 2) => {
|
|
44
|
+
return value.toLocaleString("en-US", {
|
|
45
|
+
minimumFractionDigits,
|
|
46
|
+
maximumFractionDigits: 2
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const copyText = (text) => {
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
51
|
+
try {
|
|
52
|
+
if (!isSupported.value) {
|
|
53
|
+
console.error("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
|
|
54
|
+
reject("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
|
|
55
|
+
} else {
|
|
56
|
+
copy(text);
|
|
57
|
+
elementPlus.ElMessage.success(t("message.layout.copyTextSuccess"));
|
|
58
|
+
resolve(text);
|
|
59
|
+
}
|
|
60
|
+
} catch (e) {
|
|
61
|
+
elementPlus.ElMessage.error(t("message.layout.copyTextError"));
|
|
62
|
+
reject(e);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
const removeHtmlSub = (value) => {
|
|
67
|
+
var str = value.replace(/<[^>]+>/g, "");
|
|
68
|
+
if (str.length > 50) return str.substring(0, 50) + "......";
|
|
69
|
+
else return str;
|
|
70
|
+
};
|
|
71
|
+
const removeHtml = (value) => {
|
|
72
|
+
return value.replace(/<[^>]+>/g, "");
|
|
73
|
+
};
|
|
74
|
+
const getEnumDesc = (key, lstEnum) => {
|
|
75
|
+
var _a;
|
|
76
|
+
return (_a = lstEnum.find((x) => x.value == key)) == null ? void 0 : _a.describe;
|
|
77
|
+
};
|
|
78
|
+
const appendQueryParams = (url, params) => {
|
|
79
|
+
if (!params || Object.keys(params).length == 0) return url;
|
|
80
|
+
const queryString = Object.keys(params).map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`).join("&");
|
|
81
|
+
return `${url}${url.includes("?") ? "&" : "?"}${queryString}`;
|
|
82
|
+
};
|
|
83
|
+
const getNameAbbr = (text, callback) => {
|
|
84
|
+
if (!text) return elementPlus.ElMessage.error("\u83B7\u53D6\u7B80\u79F0\u6587\u672C\u4E0D\u80FD\u4E3A\u7A7A");
|
|
85
|
+
try {
|
|
86
|
+
return index.useBaseApi("sysCommon").post({ text }, "nameAbbr").then((res) => {
|
|
87
|
+
if (callback) callback(res.data.result);
|
|
88
|
+
return res.data.result;
|
|
89
|
+
});
|
|
90
|
+
} catch (e) {
|
|
91
|
+
elementPlus.ElMessage.error("\u83B7\u53D6\u5931\u8D25");
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const handleConditionalClear = (condition, fieldValue, clearValue = void 0) => {
|
|
95
|
+
if (condition) {
|
|
96
|
+
return clearValue;
|
|
97
|
+
}
|
|
98
|
+
return fieldValue;
|
|
99
|
+
};
|
|
100
|
+
const getTimeRangePickerShortcuts = () => {
|
|
101
|
+
return [
|
|
102
|
+
{
|
|
103
|
+
text: "\u8FD1\u4E00\u5468",
|
|
104
|
+
value: () => {
|
|
105
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
106
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
107
|
+
const start = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 7);
|
|
108
|
+
return [start, end];
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
text: "\u8FD1\u4E00\u6708",
|
|
113
|
+
value: () => {
|
|
114
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
115
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
116
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 1, now.getDate());
|
|
117
|
+
return [start, end];
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
text: "\u8FD1\u4E09\u6708",
|
|
122
|
+
value: () => {
|
|
123
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
124
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
125
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 3, now.getDate());
|
|
126
|
+
return [start, end];
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
text: "\u8FD1\u534A\u5E74",
|
|
131
|
+
value: () => {
|
|
132
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
133
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
134
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 6, now.getDate());
|
|
135
|
+
return [start, end];
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
text: "\u672C\u5E74",
|
|
140
|
+
value: () => {
|
|
141
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
142
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
143
|
+
const start = new Date(now.getFullYear(), 0, 1);
|
|
144
|
+
return [start, end];
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
text: "\u8FD1\u4E24\u5E74",
|
|
149
|
+
value: () => {
|
|
150
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
151
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
152
|
+
const start = new Date(now.getFullYear() - 1, 0, 1);
|
|
153
|
+
return [start, end];
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
text: "\u8FD1\u4E09\u5E74",
|
|
158
|
+
value: () => {
|
|
159
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
160
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
161
|
+
const start = new Date(now.getFullYear() - 2, 0, 1);
|
|
162
|
+
return [start, end];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
];
|
|
166
|
+
};
|
|
167
|
+
return {
|
|
168
|
+
percentFormat,
|
|
169
|
+
dateFormatYMD,
|
|
170
|
+
dateFormatYMDHMS,
|
|
171
|
+
dateFormatHMS,
|
|
172
|
+
scaleFormat,
|
|
173
|
+
scale2Format,
|
|
174
|
+
groupSeparator,
|
|
175
|
+
copyText,
|
|
176
|
+
removeHtmlSub,
|
|
177
|
+
removeHtml,
|
|
178
|
+
getEnumDesc,
|
|
179
|
+
appendQueryParams,
|
|
180
|
+
getNameAbbr,
|
|
181
|
+
handleConditionalClear,
|
|
182
|
+
getTimeRangePickerShortcuts
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
exports.default = commonFunction;
|
|
@@ -6,6 +6,7 @@ var useVxeTableOptionsHook = require('./useVxeTableOptionsHook.js');
|
|
|
6
6
|
var sysInfo = require('./sysInfo.js');
|
|
7
7
|
var useInfo = require('./useInfo.js');
|
|
8
8
|
var dateTimeShortCust = require('./dateTimeShortCust.js');
|
|
9
|
+
var commonFunction = require('./commonFunction.js');
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
|
|
@@ -42,3 +43,4 @@ exports.userId = useInfo.userId;
|
|
|
42
43
|
exports.userName = useInfo.userName;
|
|
43
44
|
exports.userPhone = useInfo.userPhone;
|
|
44
45
|
exports.useDateTimeShortCust = dateTimeShortCust.useDateTimeShortCust;
|
|
46
|
+
exports.commonFunction = commonFunction.default;
|
|
@@ -1 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
import { RouteRecordRaw } from '../router';
|
|
2
|
+
export type AsideState = {
|
|
3
|
+
menuList: RouteRecordRaw[];
|
|
4
|
+
clientWidth: number;
|
|
5
|
+
};
|
|
6
|
+
export type ColumnsAsideState<T = any> = {
|
|
7
|
+
columnsAsideList: T[];
|
|
8
|
+
liIndex: number;
|
|
9
|
+
liOldIndex: null | number;
|
|
10
|
+
liHoverIndex: null | number;
|
|
11
|
+
liOldPath: null | string;
|
|
12
|
+
difference: number;
|
|
13
|
+
routeSplit: string[];
|
|
14
|
+
};
|
|
15
|
+
export type BreadcrumbState<T = any> = {
|
|
16
|
+
breadcrumbList: T[];
|
|
17
|
+
routeSplit: string[];
|
|
18
|
+
routeSplitFirst: string;
|
|
19
|
+
routeSplitIndex: number;
|
|
20
|
+
};
|
|
21
|
+
export type SearchState<T = any> = {
|
|
22
|
+
isShowSearch: boolean;
|
|
23
|
+
menuQuery: string;
|
|
24
|
+
tagsViewList: T[];
|
|
25
|
+
};
|
|
26
|
+
export type TagsViewState<T = any> = {
|
|
27
|
+
routeActive: string | T;
|
|
28
|
+
routePath: string | unknown;
|
|
29
|
+
dropdown: {
|
|
30
|
+
x: string | number;
|
|
31
|
+
y: string | number;
|
|
32
|
+
};
|
|
33
|
+
sortable: T;
|
|
34
|
+
tagsRefsIndex: number;
|
|
35
|
+
tagsViewList: T[];
|
|
36
|
+
tagsViewRoutesList: T[];
|
|
37
|
+
};
|
|
38
|
+
export type ParentViewState<T = any> = {
|
|
39
|
+
refreshRouterViewKey: string;
|
|
40
|
+
iframeRefreshKey: string;
|
|
41
|
+
keepAliveNameList: string[];
|
|
42
|
+
iframeList: T[];
|
|
43
|
+
};
|
|
44
|
+
export type LinkViewState = {
|
|
45
|
+
title: string;
|
|
46
|
+
isLink: string;
|
|
47
|
+
};
|
package/locale/en.js
CHANGED
package/locale/en.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.8 */(function(e,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis!="undefined"?globalThis:e||self,e.fmdeuiPlusLocaleEn=t())})(this,(function(){"use strict";var e={name:"en",plus:{datepicker:{date:"Please select date",dates:"Please select dates",week:"Please select week",month:"Please select month",months:"Please select months",year:"Please select year",years:"Please select years",startDatePlaceholder:"Please select start date",endDatePlaceholder:"Please select end date",datetime:"Please select datetime",startMonthPlaceholder:"Please select start month",endMonthPlaceholder:"Please select end month",startTimePlaceholder:"Please select start time",endTimePlaceholder:"Please select end time",shortcutsDate:{today:"Today",yesterday:"Yesterday",lastWeek:"Last week"},shortcutsDaterange:{pastWeek:"Past week",pastMonth:"Past month",pastThreeMonths:"Past three months"},shortcutsMonthrange:{thisMonth:"This month",thisYear:"This year",pastSixMonths:"Past six months"},shortcutsDatetime:{today:"Today",yesterday:"Yesterday",lastWeek:"Last week"},shortcutsDatetimerange:{pastWeek:"Past week",pastMonth:"Past month",pastThreeMonths:"Past three months"}},form:{pleaseEnter:"Please enter ",pleaseSelect:"Please select "},input:{placeholder:"Please enter ",appendTitle:"Yuan",validatePhone:"Please enter a valid phone number",validateIdCard:"Please enter a valid ID card number",validateInteger:"Please enter a valid integer",format:"Please enter a valid ",amount:"amount",numbers:"numbers",digitUppercase:"Please enter a valid amount format",validateError:"Please enter a valid format",escaped:{0:"Cent",1:"Penny",2:"Zero",3:"One",4:"Two",5:"Three",6:"Four",7:"Five",8:"Six",9:"Seven",10:"Eight",11:"Nine",12:"Yuan",13:"Ten thousand",14:"Ten million",15:"Ten billion",16:"Ten",17:"Hundred",18:"Thousand",19:"Short",20:"Whole"}},moduleForm:{save:"Save",back:"Back"},search:{searchText:"Search",resetText:"Reset",expand:"Expand",retract:"Retract",pleaseEnter:"Please enter ",pleaseSelect:"Please select ",popoverAttrs:{showTxt:"More",title:"All conditions",allTxt:"SelectAll",reverseTxt:"Reverse",clearTxt:"ClearAll"}},select:{selectAllTxt:"Select all"},selectIcon:{placeholder:"Please select icon",dialogTitle:"Please select icon",searchPlaceholder:"Search icon",emptyDescription:"No icon found"},copy:{copySuccess:"Copy success",copyFail:"Copy fail",invalidCopyContent:"Invalid copy content"},selectTable:{searchBtnTxt:"Search",radioTxt:"Radio",loadingTxt:"Loading...",copySuccess:"Copy success",copyFail:"Copy fail"},stepWizard:{lastBtnTitle:"Complete"},table:{columnBind:{btnTxt:"Column setting",title:"Column setting"},fistColumn:{label:"Number",radio:"Radio"},operator:{label:"Operation",more:"More",sum:"Sum",total:"Total",allSum:"All sum"},singleEdit:{tipText:"Click to edit"},pleaseEnter:"Please enter ",pleaseSelect:"Please select ",loadingTxt:"Loading...",dragTxt:"Drag",saveBtnTxt:"Save",density:"Density",default:"Default",loose:"Loose",compact:"Compact"},list:{idleTimeoutMessage:"Long time no operation, system logged out.",sysMessage:"System Message"}}};return e}));
|
package/locale/en.min.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.8 */var e={name:"en",plus:{datepicker:{date:"Please select date",dates:"Please select dates",week:"Please select week",month:"Please select month",months:"Please select months",year:"Please select year",years:"Please select years",startDatePlaceholder:"Please select start date",endDatePlaceholder:"Please select end date",datetime:"Please select datetime",startMonthPlaceholder:"Please select start month",endMonthPlaceholder:"Please select end month",startTimePlaceholder:"Please select start time",endTimePlaceholder:"Please select end time",shortcutsDate:{today:"Today",yesterday:"Yesterday",lastWeek:"Last week"},shortcutsDaterange:{pastWeek:"Past week",pastMonth:"Past month",pastThreeMonths:"Past three months"},shortcutsMonthrange:{thisMonth:"This month",thisYear:"This year",pastSixMonths:"Past six months"},shortcutsDatetime:{today:"Today",yesterday:"Yesterday",lastWeek:"Last week"},shortcutsDatetimerange:{pastWeek:"Past week",pastMonth:"Past month",pastThreeMonths:"Past three months"}},form:{pleaseEnter:"Please enter ",pleaseSelect:"Please select "},input:{placeholder:"Please enter ",appendTitle:"Yuan",validatePhone:"Please enter a valid phone number",validateIdCard:"Please enter a valid ID card number",validateInteger:"Please enter a valid integer",format:"Please enter a valid ",amount:"amount",numbers:"numbers",digitUppercase:"Please enter a valid amount format",validateError:"Please enter a valid format",escaped:{0:"Cent",1:"Penny",2:"Zero",3:"One",4:"Two",5:"Three",6:"Four",7:"Five",8:"Six",9:"Seven",10:"Eight",11:"Nine",12:"Yuan",13:"Ten thousand",14:"Ten million",15:"Ten billion",16:"Ten",17:"Hundred",18:"Thousand",19:"Short",20:"Whole"}},moduleForm:{save:"Save",back:"Back"},search:{searchText:"Search",resetText:"Reset",expand:"Expand",retract:"Retract",pleaseEnter:"Please enter ",pleaseSelect:"Please select ",popoverAttrs:{showTxt:"More",title:"All conditions",allTxt:"SelectAll",reverseTxt:"Reverse",clearTxt:"ClearAll"}},select:{selectAllTxt:"Select all"},selectIcon:{placeholder:"Please select icon",dialogTitle:"Please select icon",searchPlaceholder:"Search icon",emptyDescription:"No icon found"},copy:{copySuccess:"Copy success",copyFail:"Copy fail",invalidCopyContent:"Invalid copy content"},selectTable:{searchBtnTxt:"Search",radioTxt:"Radio",loadingTxt:"Loading...",copySuccess:"Copy success",copyFail:"Copy fail"},stepWizard:{lastBtnTitle:"Complete"},table:{columnBind:{btnTxt:"Column setting",title:"Column setting"},fistColumn:{label:"Number",radio:"Radio"},operator:{label:"Operation",more:"More",sum:"Sum",total:"Total",allSum:"All sum"},singleEdit:{tipText:"Click to edit"},pleaseEnter:"Please enter ",pleaseSelect:"Please select ",loadingTxt:"Loading...",dragTxt:"Drag",saveBtnTxt:"Save",density:"Density",default:"Default",loose:"Loose",compact:"Compact"},list:{idleTimeoutMessage:"Long time no operation, system logged out.",sysMessage:"System Message"}}};export{e as default};
|
package/locale/en.mjs
CHANGED
package/locale/zh-cn.js
CHANGED