@fmdeui/fmui 1.0.7 → 1.0.9
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 +26 -0
- package/es/index.mjs +4 -2
- package/es/packages/hooks/commonFunction.mjs +182 -0
- package/es/packages/hooks/index.mjs +5 -0
- package/es/packages/utils/index.mjs +2 -2
- package/es/types/layout/index.d.ts +47 -1
- package/es/types/pinia/index.d.ts +1 -0
- package/es/utils/index.d.ts +3 -2
- package/index.js +244 -59
- package/index.min.js +4 -4
- package/index.min.mjs +4 -4
- package/index.mjs +240 -57
- package/lib/hooks/commonFunction.d.ts +24 -0
- package/lib/hooks/index.d.ts +26 -0
- package/lib/index.js +22 -18
- package/lib/packages/hooks/commonFunction.js +186 -0
- package/lib/packages/hooks/index.js +4 -1
- package/lib/packages/utils/index.js +4 -4
- package/lib/types/layout/index.d.ts +47 -1
- package/lib/types/pinia/index.d.ts +1 -0
- package/lib/utils/index.d.ts +3 -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/{version.css → defaults.css} +0 -0
package/index.mjs
CHANGED
|
@@ -1,26 +1,63 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.9 */
|
|
2
2
|
import { createPinia, defineStore, storeToRefs } from 'pinia';
|
|
3
|
+
import mitt from 'mitt';
|
|
3
4
|
import CryptoJS from 'crypto-js';
|
|
4
5
|
import XLSXS from 'xlsx-js-style';
|
|
5
6
|
import { ElLoading, ElMessage, localeContextKey, dayjs } from 'element-plus';
|
|
6
7
|
import { isRef, unref, watch, nextTick, computed, defineComponent, ref, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createVNode, renderSlot, inject, withDirectives, resolveDirective, reactive, useAttrs, useSlots, createSlots, renderList, normalizeProps, guardReactiveProps, createElementBlock, toDisplayString, createElementVNode, onMounted, onActivated, normalizeClass, createCommentVNode, resolveDynamicComponent, Fragment, createTextVNode, withModifiers, toHandlers, onBeforeUnmount, onUpdated, normalizeStyle, getCurrentInstance, vShow, markRaw } from 'vue';
|
|
7
8
|
import { CaretTop, ArrowDown, ArrowUp } from '@element-plus/icons-vue';
|
|
8
|
-
import mitt from 'mitt';
|
|
9
9
|
import axios from 'axios';
|
|
10
10
|
import Cookies from 'js-cookie';
|
|
11
11
|
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
|
+
import { useClipboard, isClient, useResizeObserver } from '@vueuse/core';
|
|
17
18
|
import { get, merge } from 'lodash-es';
|
|
18
|
-
import { isClient, useResizeObserver } from '@vueuse/core';
|
|
19
19
|
import { createRouter, createWebHashHistory } from 'vue-router';
|
|
20
20
|
import NProgress from 'nprogress';
|
|
21
21
|
|
|
22
22
|
const pinia = createPinia();
|
|
23
23
|
|
|
24
|
+
const emitter = mitt();
|
|
25
|
+
|
|
26
|
+
const cssCdnUrlList = [
|
|
27
|
+
// 调整为从本地引入,注释下面的 url
|
|
28
|
+
// '//at.alicdn.com/t/c/font_2298093_rnp72ifj3ba.css',
|
|
29
|
+
// '//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css',
|
|
30
|
+
];
|
|
31
|
+
const jsCdnUrlList = [];
|
|
32
|
+
function setCssCdn() {
|
|
33
|
+
if (cssCdnUrlList.length <= 0) return false;
|
|
34
|
+
cssCdnUrlList.map((v) => {
|
|
35
|
+
let link = document.createElement("link");
|
|
36
|
+
link.rel = "stylesheet";
|
|
37
|
+
link.href = v;
|
|
38
|
+
link.crossOrigin = "anonymous";
|
|
39
|
+
document.getElementsByTagName("head")[0].appendChild(link);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function setJsCdn() {
|
|
43
|
+
if (jsCdnUrlList.length <= 0) return false;
|
|
44
|
+
jsCdnUrlList.map((v) => {
|
|
45
|
+
let link = document.createElement("script");
|
|
46
|
+
link.src = v;
|
|
47
|
+
document.body.appendChild(link);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const setIntroduction = {
|
|
51
|
+
// 设置css
|
|
52
|
+
cssCdn: () => {
|
|
53
|
+
setCssCdn();
|
|
54
|
+
},
|
|
55
|
+
// 设置js
|
|
56
|
+
jsCdn: () => {
|
|
57
|
+
setJsCdn();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
24
61
|
function judgementSameArr(newArr, oldArr) {
|
|
25
62
|
const news = removeDuplicate(newArr);
|
|
26
63
|
const olds = removeDuplicate(oldArr);
|
|
@@ -1177,8 +1214,6 @@ const NextLoading = {
|
|
|
1177
1214
|
}
|
|
1178
1215
|
};
|
|
1179
1216
|
|
|
1180
|
-
mitt();
|
|
1181
|
-
|
|
1182
1217
|
const Local = {
|
|
1183
1218
|
// 查看 v2.4.3版本更新日志
|
|
1184
1219
|
setKey(key) {
|
|
@@ -1459,31 +1494,6 @@ const saulVModel = (props, propName, emit) => {
|
|
|
1459
1494
|
});
|
|
1460
1495
|
};
|
|
1461
1496
|
|
|
1462
|
-
const cssCdnUrlList = [
|
|
1463
|
-
// 调整为从本地引入,注释下面的 url
|
|
1464
|
-
// '//at.alicdn.com/t/c/font_2298093_rnp72ifj3ba.css',
|
|
1465
|
-
// '//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css',
|
|
1466
|
-
];
|
|
1467
|
-
const jsCdnUrlList = [];
|
|
1468
|
-
function setCssCdn() {
|
|
1469
|
-
if (cssCdnUrlList.length <= 0) return false;
|
|
1470
|
-
cssCdnUrlList.map((v) => {
|
|
1471
|
-
let link = document.createElement("link");
|
|
1472
|
-
link.rel = "stylesheet";
|
|
1473
|
-
link.href = v;
|
|
1474
|
-
link.crossOrigin = "anonymous";
|
|
1475
|
-
document.getElementsByTagName("head")[0].appendChild(link);
|
|
1476
|
-
});
|
|
1477
|
-
}
|
|
1478
|
-
function setJsCdn() {
|
|
1479
|
-
if (jsCdnUrlList.length <= 0) return false;
|
|
1480
|
-
jsCdnUrlList.map((v) => {
|
|
1481
|
-
let link = document.createElement("script");
|
|
1482
|
-
link.src = v;
|
|
1483
|
-
document.body.appendChild(link);
|
|
1484
|
-
});
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
1497
|
function useChangeColor() {
|
|
1488
1498
|
const hexToRgb = (str) => {
|
|
1489
1499
|
let hexs = "";
|
|
@@ -18459,31 +18469,6 @@ var _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
18459
18469
|
|
|
18460
18470
|
const FButton = _sfc_main$d;
|
|
18461
18471
|
|
|
18462
|
-
const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
|
|
18463
|
-
const translate = (path, option, locale) => get(locale, path, path).replace(
|
|
18464
|
-
/\{(\w+)\}/g,
|
|
18465
|
-
(_, key) => {
|
|
18466
|
-
var _a;
|
|
18467
|
-
return `${(_a = option == null ? void 0 : option[key]) != null ? _a : `{${key}}`}`;
|
|
18468
|
-
}
|
|
18469
|
-
);
|
|
18470
|
-
const buildLocaleContext = (locale) => {
|
|
18471
|
-
const lang = computed(() => unref(locale).name);
|
|
18472
|
-
const localeRef = isRef(locale) ? locale : ref(locale);
|
|
18473
|
-
return {
|
|
18474
|
-
lang,
|
|
18475
|
-
locale: localeRef,
|
|
18476
|
-
t: buildTranslator(locale)
|
|
18477
|
-
};
|
|
18478
|
-
};
|
|
18479
|
-
const useLocale = (localeOverrides) => {
|
|
18480
|
-
const locale = localeOverrides || inject(localeContextKey, ref());
|
|
18481
|
-
return buildLocaleContext(computed(() => {
|
|
18482
|
-
var _a;
|
|
18483
|
-
return ((_a = locale == null ? void 0 : locale.value) == null ? void 0 : _a.plus) ? locale.value : plusZhCn;
|
|
18484
|
-
}));
|
|
18485
|
-
};
|
|
18486
|
-
|
|
18487
18472
|
const useKeepALiveNames = defineStore("keepALiveNames", {
|
|
18488
18473
|
state: () => ({
|
|
18489
18474
|
keepAliveNames: [],
|
|
@@ -18561,6 +18546,202 @@ const useTagsViewRoutes = defineStore("tagsViewRoutes", {
|
|
|
18561
18546
|
}
|
|
18562
18547
|
});
|
|
18563
18548
|
|
|
18549
|
+
const themeStore = useThemeConfig();
|
|
18550
|
+
function commonFunction() {
|
|
18551
|
+
const { t } = useI18n();
|
|
18552
|
+
const { copy, isSupported } = useClipboard();
|
|
18553
|
+
const percentFormat = (row, column, cellValue) => {
|
|
18554
|
+
return cellValue ? `${cellValue}%` : "-";
|
|
18555
|
+
};
|
|
18556
|
+
const dateFormatYMD = (row, column, cellValue) => {
|
|
18557
|
+
if (!cellValue) return "-";
|
|
18558
|
+
return formatDate(new Date(cellValue), "YYYY-mm-dd");
|
|
18559
|
+
};
|
|
18560
|
+
const dateFormatYMDHMS = (row, column, cellValue) => {
|
|
18561
|
+
if (!cellValue) return "-";
|
|
18562
|
+
return formatDate(new Date(cellValue), "YYYY-mm-dd HH:MM:SS");
|
|
18563
|
+
};
|
|
18564
|
+
const dateFormatHMS = (row, column, cellValue) => {
|
|
18565
|
+
if (!cellValue) return "-";
|
|
18566
|
+
let time = 0;
|
|
18567
|
+
if (typeof row === "number") time = row;
|
|
18568
|
+
if (typeof cellValue === "number") time = cellValue;
|
|
18569
|
+
return formatDate(new Date(time * 1e3), "HH:MM:SS");
|
|
18570
|
+
};
|
|
18571
|
+
const scaleFormat = (value = "0", scale = 4) => {
|
|
18572
|
+
return Number.parseFloat(value).toFixed(scale);
|
|
18573
|
+
};
|
|
18574
|
+
const scale2Format = (value = "0") => {
|
|
18575
|
+
return Number.parseFloat(value).toFixed(2);
|
|
18576
|
+
};
|
|
18577
|
+
const groupSeparator = (value, minimumFractionDigits = 2) => {
|
|
18578
|
+
return value.toLocaleString("en-US", {
|
|
18579
|
+
minimumFractionDigits,
|
|
18580
|
+
maximumFractionDigits: 2
|
|
18581
|
+
});
|
|
18582
|
+
};
|
|
18583
|
+
const copyText = (text) => {
|
|
18584
|
+
return new Promise((resolve, reject) => {
|
|
18585
|
+
try {
|
|
18586
|
+
if (!isSupported.value) {
|
|
18587
|
+
console.error("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
|
|
18588
|
+
reject("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
|
|
18589
|
+
} else {
|
|
18590
|
+
copy(text);
|
|
18591
|
+
ElMessage.success(t("message.layout.copyTextSuccess"));
|
|
18592
|
+
resolve(text);
|
|
18593
|
+
}
|
|
18594
|
+
} catch (e) {
|
|
18595
|
+
ElMessage.error(t("message.layout.copyTextError"));
|
|
18596
|
+
reject(e);
|
|
18597
|
+
}
|
|
18598
|
+
});
|
|
18599
|
+
};
|
|
18600
|
+
const removeHtmlSub = (value) => {
|
|
18601
|
+
var str = value.replace(/<[^>]+>/g, "");
|
|
18602
|
+
if (str.length > 50) return str.substring(0, 50) + "......";
|
|
18603
|
+
else return str;
|
|
18604
|
+
};
|
|
18605
|
+
const removeHtml = (value) => {
|
|
18606
|
+
return value.replace(/<[^>]+>/g, "");
|
|
18607
|
+
};
|
|
18608
|
+
const getEnumDesc = (key, lstEnum) => {
|
|
18609
|
+
var _a;
|
|
18610
|
+
return (_a = lstEnum.find((x) => x.value == key)) == null ? void 0 : _a.describe;
|
|
18611
|
+
};
|
|
18612
|
+
const appendQueryParams = (url, params) => {
|
|
18613
|
+
if (!params || Object.keys(params).length == 0) return url;
|
|
18614
|
+
const queryString = Object.keys(params).map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`).join("&");
|
|
18615
|
+
return `${url}${url.includes("?") ? "&" : "?"}${queryString}`;
|
|
18616
|
+
};
|
|
18617
|
+
const getNameAbbr = (text, callback) => {
|
|
18618
|
+
if (!text) return ElMessage.error("\u83B7\u53D6\u7B80\u79F0\u6587\u672C\u4E0D\u80FD\u4E3A\u7A7A");
|
|
18619
|
+
try {
|
|
18620
|
+
return useBaseApi("sysCommon").post({ text }, "nameAbbr").then((res) => {
|
|
18621
|
+
if (callback) callback(res.data.result);
|
|
18622
|
+
return res.data.result;
|
|
18623
|
+
});
|
|
18624
|
+
} catch (e) {
|
|
18625
|
+
ElMessage.error("\u83B7\u53D6\u5931\u8D25");
|
|
18626
|
+
}
|
|
18627
|
+
};
|
|
18628
|
+
const handleConditionalClear = (condition, fieldValue, clearValue = void 0) => {
|
|
18629
|
+
if (condition) {
|
|
18630
|
+
return clearValue;
|
|
18631
|
+
}
|
|
18632
|
+
return fieldValue;
|
|
18633
|
+
};
|
|
18634
|
+
const getTimeRangePickerShortcuts = () => {
|
|
18635
|
+
return [
|
|
18636
|
+
{
|
|
18637
|
+
text: "\u8FD1\u4E00\u5468",
|
|
18638
|
+
value: () => {
|
|
18639
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18640
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
18641
|
+
const start = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 7);
|
|
18642
|
+
return [start, end];
|
|
18643
|
+
}
|
|
18644
|
+
},
|
|
18645
|
+
{
|
|
18646
|
+
text: "\u8FD1\u4E00\u6708",
|
|
18647
|
+
value: () => {
|
|
18648
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18649
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
18650
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 1, now.getDate());
|
|
18651
|
+
return [start, end];
|
|
18652
|
+
}
|
|
18653
|
+
},
|
|
18654
|
+
{
|
|
18655
|
+
text: "\u8FD1\u4E09\u6708",
|
|
18656
|
+
value: () => {
|
|
18657
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18658
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
18659
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 3, now.getDate());
|
|
18660
|
+
return [start, end];
|
|
18661
|
+
}
|
|
18662
|
+
},
|
|
18663
|
+
{
|
|
18664
|
+
text: "\u8FD1\u534A\u5E74",
|
|
18665
|
+
value: () => {
|
|
18666
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18667
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
18668
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 6, now.getDate());
|
|
18669
|
+
return [start, end];
|
|
18670
|
+
}
|
|
18671
|
+
},
|
|
18672
|
+
{
|
|
18673
|
+
text: "\u672C\u5E74",
|
|
18674
|
+
value: () => {
|
|
18675
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18676
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
18677
|
+
const start = new Date(now.getFullYear(), 0, 1);
|
|
18678
|
+
return [start, end];
|
|
18679
|
+
}
|
|
18680
|
+
},
|
|
18681
|
+
{
|
|
18682
|
+
text: "\u8FD1\u4E24\u5E74",
|
|
18683
|
+
value: () => {
|
|
18684
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18685
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
18686
|
+
const start = new Date(now.getFullYear() - 1, 0, 1);
|
|
18687
|
+
return [start, end];
|
|
18688
|
+
}
|
|
18689
|
+
},
|
|
18690
|
+
{
|
|
18691
|
+
text: "\u8FD1\u4E09\u5E74",
|
|
18692
|
+
value: () => {
|
|
18693
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18694
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
18695
|
+
const start = new Date(now.getFullYear() - 2, 0, 1);
|
|
18696
|
+
return [start, end];
|
|
18697
|
+
}
|
|
18698
|
+
}
|
|
18699
|
+
];
|
|
18700
|
+
};
|
|
18701
|
+
return {
|
|
18702
|
+
percentFormat,
|
|
18703
|
+
dateFormatYMD,
|
|
18704
|
+
dateFormatYMDHMS,
|
|
18705
|
+
dateFormatHMS,
|
|
18706
|
+
scaleFormat,
|
|
18707
|
+
scale2Format,
|
|
18708
|
+
groupSeparator,
|
|
18709
|
+
copyText,
|
|
18710
|
+
removeHtmlSub,
|
|
18711
|
+
removeHtml,
|
|
18712
|
+
getEnumDesc,
|
|
18713
|
+
appendQueryParams,
|
|
18714
|
+
getNameAbbr,
|
|
18715
|
+
handleConditionalClear,
|
|
18716
|
+
getTimeRangePickerShortcuts
|
|
18717
|
+
};
|
|
18718
|
+
}
|
|
18719
|
+
|
|
18720
|
+
const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
|
|
18721
|
+
const translate = (path, option, locale) => get(locale, path, path).replace(
|
|
18722
|
+
/\{(\w+)\}/g,
|
|
18723
|
+
(_, key) => {
|
|
18724
|
+
var _a;
|
|
18725
|
+
return `${(_a = option == null ? void 0 : option[key]) != null ? _a : `{${key}}`}`;
|
|
18726
|
+
}
|
|
18727
|
+
);
|
|
18728
|
+
const buildLocaleContext = (locale) => {
|
|
18729
|
+
const lang = computed(() => unref(locale).name);
|
|
18730
|
+
const localeRef = isRef(locale) ? locale : ref(locale);
|
|
18731
|
+
return {
|
|
18732
|
+
lang,
|
|
18733
|
+
locale: localeRef,
|
|
18734
|
+
t: buildTranslator(locale)
|
|
18735
|
+
};
|
|
18736
|
+
};
|
|
18737
|
+
const useLocale = (localeOverrides) => {
|
|
18738
|
+
const locale = localeOverrides || inject(localeContextKey, ref());
|
|
18739
|
+
return buildLocaleContext(computed(() => {
|
|
18740
|
+
var _a;
|
|
18741
|
+
return ((_a = locale == null ? void 0 : locale.value) == null ? void 0 : _a.plus) ? locale.value : plusZhCn;
|
|
18742
|
+
}));
|
|
18743
|
+
};
|
|
18744
|
+
|
|
18564
18745
|
function auth(value) {
|
|
18565
18746
|
const stores = useUserInfo();
|
|
18566
18747
|
return stores.userInfos.authApiList.some((v) => v === value);
|
|
@@ -18864,6 +19045,8 @@ const useDateTimeShortCust = () => {
|
|
|
18864
19045
|
];
|
|
18865
19046
|
};
|
|
18866
19047
|
|
|
19048
|
+
const commonFun = commonFunction();
|
|
19049
|
+
|
|
18867
19050
|
const _hoisted_1$6 = { key: 0 };
|
|
18868
19051
|
const _hoisted_2$3 = { key: 0 };
|
|
18869
19052
|
var _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
@@ -22399,4 +22582,4 @@ const version = "1.0.0";
|
|
|
22399
22582
|
|
|
22400
22583
|
const install = installer.install;
|
|
22401
22584
|
|
|
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,
|
|
22585
|
+
export { AccountTypeEnum, HttpMethodEnum, JobCreateTypeEnum, Local, NextLoading, Session, StringToObj, accessTokenKey, auth, authAll, auths, axiosInstance, base64ToFile, blobToFile, buildLocaleContext, buildTranslator, cancelAllRequest, cancelRequest, clearAccessTokens, clearTokens, clone, commonFun, 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, setDynamicViewsModules, setIntroduction, 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,3 +1,29 @@
|
|
|
1
|
+
import { default as commonFunction } from './commonFunction';
|
|
2
|
+
import { EmptyArrayType } from 'fmdeui-fmui';
|
|
3
|
+
import { MessageHandler } from 'element-plus';
|
|
4
|
+
declare const commonFun: {
|
|
5
|
+
percentFormat: (row: EmptyArrayType, column: number, cellValue: string) => string;
|
|
6
|
+
dateFormatYMD: (row: EmptyArrayType, column: number, cellValue: string) => string;
|
|
7
|
+
dateFormatYMDHMS: (row: EmptyArrayType, column: number, cellValue: string) => string;
|
|
8
|
+
dateFormatHMS: (row: EmptyArrayType, column: number, cellValue: string) => string;
|
|
9
|
+
scaleFormat: (value?: string, scale?: number) => string;
|
|
10
|
+
scale2Format: (value?: string) => string;
|
|
11
|
+
groupSeparator: (value: number, minimumFractionDigits?: number) => string;
|
|
12
|
+
copyText: (text: string) => Promise<unknown>;
|
|
13
|
+
removeHtmlSub: (value: string) => string;
|
|
14
|
+
removeHtml: (value: string) => string;
|
|
15
|
+
getEnumDesc: (key: any, lstEnum: any) => any;
|
|
16
|
+
appendQueryParams: (url: string, params: {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}) => string;
|
|
19
|
+
getNameAbbr: (text: string, callback?: (abbr: any) => void) => Promise<any> | MessageHandler | undefined;
|
|
20
|
+
handleConditionalClear: (condition: boolean, fieldValue: any, clearValue?: any) => any;
|
|
21
|
+
getTimeRangePickerShortcuts: () => {
|
|
22
|
+
text: string;
|
|
23
|
+
value: () => Date[];
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
export { commonFunction, commonFun, };
|
|
1
27
|
export * from './useLocale';
|
|
2
28
|
export * from './authFunction';
|
|
3
29
|
export * from './useVxeTableOptionsHook';
|
package/lib/index.js
CHANGED
|
@@ -7,9 +7,9 @@ require('./packages/types/index.js');
|
|
|
7
7
|
var index = require('./packages/api/index.js');
|
|
8
8
|
require('./packages/utils/index.js');
|
|
9
9
|
require('./packages/stores/index.js');
|
|
10
|
-
require('./packages/hooks/index.js');
|
|
11
|
-
var index$
|
|
12
|
-
var index$
|
|
10
|
+
var index$1 = require('./packages/hooks/index.js');
|
|
11
|
+
var index$4 = require('./packages/router/index.js');
|
|
12
|
+
var index$3 = require('./packages/locale/index.js');
|
|
13
13
|
var version = require('./version.js');
|
|
14
14
|
var storage = require('./packages/utils/storage.js');
|
|
15
15
|
var loading = require('./packages/utils/loading.js');
|
|
@@ -19,11 +19,12 @@ var authFunction = require('./packages/hooks/authFunction.js');
|
|
|
19
19
|
var base64Conver = require('./packages/utils/base64Conver.js');
|
|
20
20
|
var useLocale = require('./packages/hooks/useLocale.js');
|
|
21
21
|
var arrayOperation = require('./packages/utils/arrayOperation.js');
|
|
22
|
+
var commonFunction = require('./packages/hooks/commonFunction.js');
|
|
22
23
|
var route = require('./packages/router/route.js');
|
|
23
24
|
var download = require('./packages/utils/download.js');
|
|
24
25
|
var en = require('./packages/locale/lang/en.js');
|
|
25
26
|
var exportExcel = require('./packages/utils/exportExcel.js');
|
|
26
|
-
var index$
|
|
27
|
+
var index$2 = require('./packages/api/sys/index.js');
|
|
27
28
|
var flowLoading = require('./packages/utils/flowLoading.js');
|
|
28
29
|
var formatTime = require('./packages/utils/formatTime.js');
|
|
29
30
|
var gpsConvertor = require('./packages/utils/gpsConvertor.js');
|
|
@@ -32,10 +33,11 @@ var backEnd = require('./packages/router/backEnd.js');
|
|
|
32
33
|
var frontEnd = require('./packages/router/frontEnd.js');
|
|
33
34
|
var toolsValidate = require('./packages/utils/toolsValidate.js');
|
|
34
35
|
var sysInfo = require('./packages/hooks/sysInfo.js');
|
|
36
|
+
var mitt = require('./packages/utils/mitt.js');
|
|
35
37
|
var saulVModel = require('./packages/utils/saulVModel.js');
|
|
36
38
|
var setIconfont = require('./packages/utils/setIconfont.js');
|
|
37
39
|
var dataSignature = require('./packages/utils/data-signature.js');
|
|
38
|
-
var index$
|
|
40
|
+
var index$5 = require('./packages/api/base/index.js');
|
|
39
41
|
var theme = require('./packages/utils/theme.js');
|
|
40
42
|
var dateTimeShortCust = require('./packages/hooks/dateTimeShortCust.js');
|
|
41
43
|
var formRule = require('./packages/utils/formRule.js');
|
|
@@ -55,13 +57,14 @@ exports.default = defaults.default;
|
|
|
55
57
|
exports.AccountTypeEnum = index.AccountTypeEnum;
|
|
56
58
|
exports.HttpMethodEnum = index.HttpMethodEnum;
|
|
57
59
|
exports.JobCreateTypeEnum = index.JobCreateTypeEnum;
|
|
58
|
-
exports.
|
|
59
|
-
exports.
|
|
60
|
-
exports.
|
|
61
|
-
exports.
|
|
62
|
-
exports.
|
|
63
|
-
exports.
|
|
64
|
-
exports.
|
|
60
|
+
exports.commonFun = index$1.commonFun;
|
|
61
|
+
exports.initRouter = index$4.initRouter;
|
|
62
|
+
exports.getCountryCode = index$3.getCountryCode;
|
|
63
|
+
exports.i18n = index$3.i18n;
|
|
64
|
+
exports.iso_3166_1_CountryList = index$3.iso_3166_1_CountryList;
|
|
65
|
+
exports.languageList = index$3.languageList;
|
|
66
|
+
exports.mergMessage = index$3.mergMessage;
|
|
67
|
+
exports.setupI18n = index$3.setupI18n;
|
|
65
68
|
exports.version = version.version;
|
|
66
69
|
exports.Local = storage.Local;
|
|
67
70
|
exports.Session = storage.Session;
|
|
@@ -102,6 +105,7 @@ exports.clone = arrayOperation.clone;
|
|
|
102
105
|
exports.isObjectValueEqual = arrayOperation.isObjectValueEqual;
|
|
103
106
|
exports.judgementSameArr = arrayOperation.judgementSameArr;
|
|
104
107
|
exports.removeDuplicate = arrayOperation.removeDuplicate;
|
|
108
|
+
exports.commonFunction = commonFunction.default;
|
|
105
109
|
exports.configureRoutes = route.configureRoutes;
|
|
106
110
|
exports.setPathPrefix = route.setPathPrefix;
|
|
107
111
|
exports.downloadByBase64 = download.downloadByBase64;
|
|
@@ -113,8 +117,8 @@ exports.getFileName = download.getFileName;
|
|
|
113
117
|
exports.openWindow = download.openWindow;
|
|
114
118
|
exports.en = en.default;
|
|
115
119
|
exports.exportExcel = exportExcel.exportExcel;
|
|
116
|
-
exports.feature = index$
|
|
117
|
-
exports.useSysApi = index$
|
|
120
|
+
exports.feature = index$2.feature;
|
|
121
|
+
exports.useSysApi = index$2.useSysApi;
|
|
118
122
|
exports.flowLoading = flowLoading.flowLoading;
|
|
119
123
|
exports.formatAxis = formatTime.formatAxis;
|
|
120
124
|
exports.formatDate = formatTime.formatDate;
|
|
@@ -171,12 +175,12 @@ exports.verifyTextColor = toolsValidate.verifyTextColor;
|
|
|
171
175
|
exports.verifyUrl = toolsValidate.verifyUrl;
|
|
172
176
|
exports.loadSysInfo = sysInfo.loadSysInfo;
|
|
173
177
|
exports.updateFavicon = sysInfo.updateFavicon;
|
|
178
|
+
exports.mittBus = mitt.default;
|
|
174
179
|
exports.saulVModel = saulVModel.saulVModel;
|
|
175
|
-
exports.
|
|
176
|
-
exports.setJsCdn = setIconfont.setJsCdn;
|
|
180
|
+
exports.setIntroduction = setIconfont.default;
|
|
177
181
|
exports.signatureByKSort = dataSignature.signatureByKSort;
|
|
178
|
-
exports.useApi = index$
|
|
179
|
-
exports.useBaseApi = index$
|
|
182
|
+
exports.useApi = index$5.useApi;
|
|
183
|
+
exports.useBaseApi = index$5.useBaseApi;
|
|
180
184
|
exports.useChangeColor = theme.useChangeColor;
|
|
181
185
|
exports.useDateTimeShortCust = dateTimeShortCust.useDateTimeShortCust;
|
|
182
186
|
exports.useFormRulePresets = formRule.useFormRulePresets;
|