@fmdeui/fmui 1.0.8 → 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/index.d.ts +25 -1
- package/es/index.d.ts +0 -3
- package/es/index.mjs +3 -3
- package/es/packages/hooks/index.mjs +5 -1
- package/es/packages/utils/index.mjs +2 -2
- package/es/utils/index.d.ts +3 -2
- package/index.js +240 -239
- package/index.min.js +4 -4
- package/index.min.mjs +4 -4
- package/index.mjs +238 -236
- package/lib/hooks/index.d.ts +25 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.js +21 -22
- package/lib/packages/hooks/index.js +4 -3
- package/lib/packages/utils/index.js +4 -4
- 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/es/{defaults.css → make-installer.css} +0 -0
- /package/lib/{version.css → defaults.css} +0 -0
package/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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';
|
|
@@ -14,13 +14,50 @@ import VxeUIPluginExportXLSX from '@vxe-ui/plugin-export-xlsx';
|
|
|
14
14
|
import VxeUI from 'vxe-pc-ui';
|
|
15
15
|
import { createI18n, useI18n } from 'vue-i18n';
|
|
16
16
|
import ExcelJS from 'exceljs';
|
|
17
|
-
import { get, merge } from 'lodash-es';
|
|
18
17
|
import { useClipboard, isClient, useResizeObserver } from '@vueuse/core';
|
|
18
|
+
import { get, merge } from 'lodash-es';
|
|
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
|
-
const emitter = mitt();
|
|
1181
|
-
|
|
1182
1217
|
const Local = {
|
|
1183
1218
|
// 查看 v2.4.3版本更新日志
|
|
1184
1219
|
setKey(key) {
|
|
@@ -1459,41 +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
|
-
const setIntroduction = {
|
|
1487
|
-
// 设置css
|
|
1488
|
-
cssCdn: () => {
|
|
1489
|
-
setCssCdn();
|
|
1490
|
-
},
|
|
1491
|
-
// 设置js
|
|
1492
|
-
jsCdn: () => {
|
|
1493
|
-
setJsCdn();
|
|
1494
|
-
}
|
|
1495
|
-
};
|
|
1496
|
-
|
|
1497
1497
|
function useChangeColor() {
|
|
1498
1498
|
const hexToRgb = (str) => {
|
|
1499
1499
|
let hexs = "";
|
|
@@ -18469,31 +18469,6 @@ var _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
18469
18469
|
|
|
18470
18470
|
const FButton = _sfc_main$d;
|
|
18471
18471
|
|
|
18472
|
-
const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
|
|
18473
|
-
const translate = (path, option, locale) => get(locale, path, path).replace(
|
|
18474
|
-
/\{(\w+)\}/g,
|
|
18475
|
-
(_, key) => {
|
|
18476
|
-
var _a;
|
|
18477
|
-
return `${(_a = option == null ? void 0 : option[key]) != null ? _a : `{${key}}`}`;
|
|
18478
|
-
}
|
|
18479
|
-
);
|
|
18480
|
-
const buildLocaleContext = (locale) => {
|
|
18481
|
-
const lang = computed(() => unref(locale).name);
|
|
18482
|
-
const localeRef = isRef(locale) ? locale : ref(locale);
|
|
18483
|
-
return {
|
|
18484
|
-
lang,
|
|
18485
|
-
locale: localeRef,
|
|
18486
|
-
t: buildTranslator(locale)
|
|
18487
|
-
};
|
|
18488
|
-
};
|
|
18489
|
-
const useLocale = (localeOverrides) => {
|
|
18490
|
-
const locale = localeOverrides || inject(localeContextKey, ref());
|
|
18491
|
-
return buildLocaleContext(computed(() => {
|
|
18492
|
-
var _a;
|
|
18493
|
-
return ((_a = locale == null ? void 0 : locale.value) == null ? void 0 : _a.plus) ? locale.value : plusZhCn;
|
|
18494
|
-
}));
|
|
18495
|
-
};
|
|
18496
|
-
|
|
18497
18472
|
const useKeepALiveNames = defineStore("keepALiveNames", {
|
|
18498
18473
|
state: () => ({
|
|
18499
18474
|
keepAliveNames: [],
|
|
@@ -18571,6 +18546,202 @@ const useTagsViewRoutes = defineStore("tagsViewRoutes", {
|
|
|
18571
18546
|
}
|
|
18572
18547
|
});
|
|
18573
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
|
+
|
|
18574
18745
|
function auth(value) {
|
|
18575
18746
|
const stores = useUserInfo();
|
|
18576
18747
|
return stores.userInfos.authApiList.some((v) => v === value);
|
|
@@ -18874,176 +19045,7 @@ const useDateTimeShortCust = () => {
|
|
|
18874
19045
|
];
|
|
18875
19046
|
};
|
|
18876
19047
|
|
|
18877
|
-
const
|
|
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
|
-
}
|
|
19048
|
+
const commonFun = commonFunction();
|
|
19047
19049
|
|
|
19048
19050
|
const _hoisted_1$6 = { key: 0 };
|
|
19049
19051
|
const _hoisted_2$3 = { key: 0 };
|
|
@@ -22580,4 +22582,4 @@ const version = "1.0.0";
|
|
|
22580
22582
|
|
|
22581
22583
|
const install = installer.install;
|
|
22582
22584
|
|
|
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,
|
|
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 };
|
package/lib/hooks/index.d.ts
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
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, };
|
|
2
27
|
export * from './useLocale';
|
|
3
28
|
export * from './authFunction';
|
|
4
29
|
export * from './useVxeTableOptionsHook';
|
|
5
30
|
export * from './sysInfo';
|
|
6
31
|
export * from './useInfo';
|
|
7
32
|
export * from './dateTimeShortCust';
|
|
8
|
-
export { commonFunction };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { default as installer } from './defaults';
|
|
2
|
-
import { default as mittBus } from './utils/mitt';
|
|
3
|
-
import { default as setIntroduction } from './utils/setIconfont';
|
|
4
2
|
import { App } from 'vue';
|
|
5
|
-
export { mittBus, setIntroduction };
|
|
6
3
|
export * from './types';
|
|
7
4
|
export * from './api';
|
|
8
5
|
export * from './utils';
|
package/lib/index.js
CHANGED
|
@@ -3,15 +3,13 @@
|
|
|
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');
|
|
8
6
|
require('./packages/types/index.js');
|
|
9
7
|
var index = require('./packages/api/index.js');
|
|
10
8
|
require('./packages/utils/index.js');
|
|
11
9
|
require('./packages/stores/index.js');
|
|
12
|
-
require('./packages/hooks/index.js');
|
|
13
|
-
var index$
|
|
14
|
-
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');
|
|
15
13
|
var version = require('./version.js');
|
|
16
14
|
var storage = require('./packages/utils/storage.js');
|
|
17
15
|
var loading = require('./packages/utils/loading.js');
|
|
@@ -26,7 +24,7 @@ var route = require('./packages/router/route.js');
|
|
|
26
24
|
var download = require('./packages/utils/download.js');
|
|
27
25
|
var en = require('./packages/locale/lang/en.js');
|
|
28
26
|
var exportExcel = require('./packages/utils/exportExcel.js');
|
|
29
|
-
var index$
|
|
27
|
+
var index$2 = require('./packages/api/sys/index.js');
|
|
30
28
|
var flowLoading = require('./packages/utils/flowLoading.js');
|
|
31
29
|
var formatTime = require('./packages/utils/formatTime.js');
|
|
32
30
|
var gpsConvertor = require('./packages/utils/gpsConvertor.js');
|
|
@@ -35,9 +33,11 @@ var backEnd = require('./packages/router/backEnd.js');
|
|
|
35
33
|
var frontEnd = require('./packages/router/frontEnd.js');
|
|
36
34
|
var toolsValidate = require('./packages/utils/toolsValidate.js');
|
|
37
35
|
var sysInfo = require('./packages/hooks/sysInfo.js');
|
|
36
|
+
var mitt = require('./packages/utils/mitt.js');
|
|
38
37
|
var saulVModel = require('./packages/utils/saulVModel.js');
|
|
38
|
+
var setIconfont = require('./packages/utils/setIconfont.js');
|
|
39
39
|
var dataSignature = require('./packages/utils/data-signature.js');
|
|
40
|
-
var index$
|
|
40
|
+
var index$5 = require('./packages/api/base/index.js');
|
|
41
41
|
var theme = require('./packages/utils/theme.js');
|
|
42
42
|
var dateTimeShortCust = require('./packages/hooks/dateTimeShortCust.js');
|
|
43
43
|
var formRule = require('./packages/utils/formRule.js');
|
|
@@ -54,20 +54,17 @@ var zhCn = require('./packages/locale/lang/zh-cn.js');
|
|
|
54
54
|
const install = defaults.default.install;
|
|
55
55
|
|
|
56
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;
|
|
61
57
|
exports.AccountTypeEnum = index.AccountTypeEnum;
|
|
62
58
|
exports.HttpMethodEnum = index.HttpMethodEnum;
|
|
63
59
|
exports.JobCreateTypeEnum = index.JobCreateTypeEnum;
|
|
64
|
-
exports.
|
|
65
|
-
exports.
|
|
66
|
-
exports.
|
|
67
|
-
exports.
|
|
68
|
-
exports.
|
|
69
|
-
exports.
|
|
70
|
-
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;
|
|
71
68
|
exports.version = version.version;
|
|
72
69
|
exports.Local = storage.Local;
|
|
73
70
|
exports.Session = storage.Session;
|
|
@@ -120,8 +117,8 @@ exports.getFileName = download.getFileName;
|
|
|
120
117
|
exports.openWindow = download.openWindow;
|
|
121
118
|
exports.en = en.default;
|
|
122
119
|
exports.exportExcel = exportExcel.exportExcel;
|
|
123
|
-
exports.feature = index$
|
|
124
|
-
exports.useSysApi = index$
|
|
120
|
+
exports.feature = index$2.feature;
|
|
121
|
+
exports.useSysApi = index$2.useSysApi;
|
|
125
122
|
exports.flowLoading = flowLoading.flowLoading;
|
|
126
123
|
exports.formatAxis = formatTime.formatAxis;
|
|
127
124
|
exports.formatDate = formatTime.formatDate;
|
|
@@ -178,10 +175,12 @@ exports.verifyTextColor = toolsValidate.verifyTextColor;
|
|
|
178
175
|
exports.verifyUrl = toolsValidate.verifyUrl;
|
|
179
176
|
exports.loadSysInfo = sysInfo.loadSysInfo;
|
|
180
177
|
exports.updateFavicon = sysInfo.updateFavicon;
|
|
178
|
+
exports.mittBus = mitt.default;
|
|
181
179
|
exports.saulVModel = saulVModel.saulVModel;
|
|
180
|
+
exports.setIntroduction = setIconfont.default;
|
|
182
181
|
exports.signatureByKSort = dataSignature.signatureByKSort;
|
|
183
|
-
exports.useApi = index$
|
|
184
|
-
exports.useBaseApi = index$
|
|
182
|
+
exports.useApi = index$5.useApi;
|
|
183
|
+
exports.useBaseApi = index$5.useBaseApi;
|
|
185
184
|
exports.useChangeColor = theme.useChangeColor;
|
|
186
185
|
exports.useDateTimeShortCust = dateTimeShortCust.useDateTimeShortCust;
|
|
187
186
|
exports.useFormRulePresets = formRule.useFormRulePresets;
|