@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
|
@@ -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/es/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/es/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/es/index.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import installer from './defaults.mjs';
|
|
2
|
+
export { default as mittBus } from './packages/utils/mitt.mjs';
|
|
3
|
+
export { setCssCdn, default as setIntroduction, setJsCdn } from './packages/utils/setIconfont.mjs';
|
|
2
4
|
import './packages/types/index.mjs';
|
|
3
5
|
export { AccountTypeEnum, HttpMethodEnum, JobCreateTypeEnum } from './packages/api/index.mjs';
|
|
4
6
|
import './packages/utils/index.mjs';
|
|
@@ -15,6 +17,7 @@ export { auth, authAll, auths, hAuth, hAuthAll, hAuths } from './packages/hooks/
|
|
|
15
17
|
export { base64ToFile, blobToFile, dataURLtoBlob, fileToBase64, urlToBase64 } from './packages/utils/base64Conver.mjs';
|
|
16
18
|
export { buildLocaleContext, buildTranslator, translate, useLocale } from './packages/hooks/useLocale.mjs';
|
|
17
19
|
export { clone, isObjectValueEqual, judgementSameArr, removeDuplicate } from './packages/utils/arrayOperation.mjs';
|
|
20
|
+
export { default as commonFunction } from './packages/hooks/commonFunction.mjs';
|
|
18
21
|
export { configureRoutes, setPathPrefix } from './packages/router/route.mjs';
|
|
19
22
|
export { downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadStreamFile, getFileName, openWindow } from './packages/utils/download.mjs';
|
|
20
23
|
export { default as en } from './packages/locale/lang/en.mjs';
|
|
@@ -29,7 +32,6 @@ export { initFrontEndControlRoutes } from './packages/router/frontEnd.mjs';
|
|
|
29
32
|
export { judgementIdCard, verifiyNumberInteger, verifyAccount, verifyAndSpace, verifyCarNum, verifyCnAndSpace, verifyEmail, verifyEnAndSpace, verifyFullName, verifyIPAddress, verifyIdCard, verifyNumberCnUppercase, verifyNumberComma, verifyNumberIntegerAndFloat, verifyNumberPercentage, verifyNumberPercentageFloat, verifyPassword, verifyPasswordPowerful, verifyPasswordStrength, verifyPhone, verifyPostalCode, verifyTelPhone, verifyTextColor, verifyUrl } from './packages/utils/toolsValidate.mjs';
|
|
30
33
|
export { loadSysInfo, updateFavicon } from './packages/hooks/sysInfo.mjs';
|
|
31
34
|
export { saulVModel } from './packages/utils/saulVModel.mjs';
|
|
32
|
-
export { setCssCdn, setJsCdn } from './packages/utils/setIconfont.mjs';
|
|
33
35
|
export { signatureByKSort } from './packages/utils/data-signature.mjs';
|
|
34
36
|
export { useApi, useBaseApi } from './packages/api/base/index.mjs';
|
|
35
37
|
export { useChangeColor } from './packages/utils/theme.mjs';
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { useClipboard } from '@vueuse/core';
|
|
2
|
+
import { ElMessage } from 'element-plus';
|
|
3
|
+
import { useI18n } from 'vue-i18n';
|
|
4
|
+
import '../utils/index.mjs';
|
|
5
|
+
import '../stores/index.mjs';
|
|
6
|
+
import '../api/index.mjs';
|
|
7
|
+
import { useThemeConfig } from '../stores/themeConfig.mjs';
|
|
8
|
+
import { formatDate } from '../utils/formatTime.mjs';
|
|
9
|
+
import { useBaseApi } from '../api/base/index.mjs';
|
|
10
|
+
|
|
11
|
+
const themeStore = useThemeConfig();
|
|
12
|
+
function commonFunction() {
|
|
13
|
+
const { t } = useI18n();
|
|
14
|
+
const { copy, isSupported } = useClipboard();
|
|
15
|
+
const percentFormat = (row, column, cellValue) => {
|
|
16
|
+
return cellValue ? `${cellValue}%` : "-";
|
|
17
|
+
};
|
|
18
|
+
const dateFormatYMD = (row, column, cellValue) => {
|
|
19
|
+
if (!cellValue) return "-";
|
|
20
|
+
return formatDate(new Date(cellValue), "YYYY-mm-dd");
|
|
21
|
+
};
|
|
22
|
+
const dateFormatYMDHMS = (row, column, cellValue) => {
|
|
23
|
+
if (!cellValue) return "-";
|
|
24
|
+
return formatDate(new Date(cellValue), "YYYY-mm-dd HH:MM:SS");
|
|
25
|
+
};
|
|
26
|
+
const dateFormatHMS = (row, column, cellValue) => {
|
|
27
|
+
if (!cellValue) return "-";
|
|
28
|
+
let time = 0;
|
|
29
|
+
if (typeof row === "number") time = row;
|
|
30
|
+
if (typeof cellValue === "number") time = cellValue;
|
|
31
|
+
return formatDate(new Date(time * 1e3), "HH:MM:SS");
|
|
32
|
+
};
|
|
33
|
+
const scaleFormat = (value = "0", scale = 4) => {
|
|
34
|
+
return Number.parseFloat(value).toFixed(scale);
|
|
35
|
+
};
|
|
36
|
+
const scale2Format = (value = "0") => {
|
|
37
|
+
return Number.parseFloat(value).toFixed(2);
|
|
38
|
+
};
|
|
39
|
+
const groupSeparator = (value, minimumFractionDigits = 2) => {
|
|
40
|
+
return value.toLocaleString("en-US", {
|
|
41
|
+
minimumFractionDigits,
|
|
42
|
+
maximumFractionDigits: 2
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
const copyText = (text) => {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
try {
|
|
48
|
+
if (!isSupported.value) {
|
|
49
|
+
console.error("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
|
|
50
|
+
reject("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
|
|
51
|
+
} else {
|
|
52
|
+
copy(text);
|
|
53
|
+
ElMessage.success(t("message.layout.copyTextSuccess"));
|
|
54
|
+
resolve(text);
|
|
55
|
+
}
|
|
56
|
+
} catch (e) {
|
|
57
|
+
ElMessage.error(t("message.layout.copyTextError"));
|
|
58
|
+
reject(e);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
const removeHtmlSub = (value) => {
|
|
63
|
+
var str = value.replace(/<[^>]+>/g, "");
|
|
64
|
+
if (str.length > 50) return str.substring(0, 50) + "......";
|
|
65
|
+
else return str;
|
|
66
|
+
};
|
|
67
|
+
const removeHtml = (value) => {
|
|
68
|
+
return value.replace(/<[^>]+>/g, "");
|
|
69
|
+
};
|
|
70
|
+
const getEnumDesc = (key, lstEnum) => {
|
|
71
|
+
var _a;
|
|
72
|
+
return (_a = lstEnum.find((x) => x.value == key)) == null ? void 0 : _a.describe;
|
|
73
|
+
};
|
|
74
|
+
const appendQueryParams = (url, params) => {
|
|
75
|
+
if (!params || Object.keys(params).length == 0) return url;
|
|
76
|
+
const queryString = Object.keys(params).map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`).join("&");
|
|
77
|
+
return `${url}${url.includes("?") ? "&" : "?"}${queryString}`;
|
|
78
|
+
};
|
|
79
|
+
const getNameAbbr = (text, callback) => {
|
|
80
|
+
if (!text) return ElMessage.error("\u83B7\u53D6\u7B80\u79F0\u6587\u672C\u4E0D\u80FD\u4E3A\u7A7A");
|
|
81
|
+
try {
|
|
82
|
+
return useBaseApi("sysCommon").post({ text }, "nameAbbr").then((res) => {
|
|
83
|
+
if (callback) callback(res.data.result);
|
|
84
|
+
return res.data.result;
|
|
85
|
+
});
|
|
86
|
+
} catch (e) {
|
|
87
|
+
ElMessage.error("\u83B7\u53D6\u5931\u8D25");
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const handleConditionalClear = (condition, fieldValue, clearValue = void 0) => {
|
|
91
|
+
if (condition) {
|
|
92
|
+
return clearValue;
|
|
93
|
+
}
|
|
94
|
+
return fieldValue;
|
|
95
|
+
};
|
|
96
|
+
const getTimeRangePickerShortcuts = () => {
|
|
97
|
+
return [
|
|
98
|
+
{
|
|
99
|
+
text: "\u8FD1\u4E00\u5468",
|
|
100
|
+
value: () => {
|
|
101
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
102
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
103
|
+
const start = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 7);
|
|
104
|
+
return [start, end];
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
text: "\u8FD1\u4E00\u6708",
|
|
109
|
+
value: () => {
|
|
110
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
111
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
112
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 1, now.getDate());
|
|
113
|
+
return [start, end];
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
text: "\u8FD1\u4E09\u6708",
|
|
118
|
+
value: () => {
|
|
119
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
120
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
121
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 3, now.getDate());
|
|
122
|
+
return [start, end];
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
text: "\u8FD1\u534A\u5E74",
|
|
127
|
+
value: () => {
|
|
128
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
129
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
130
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 6, now.getDate());
|
|
131
|
+
return [start, end];
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
text: "\u672C\u5E74",
|
|
136
|
+
value: () => {
|
|
137
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
138
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
139
|
+
const start = new Date(now.getFullYear(), 0, 1);
|
|
140
|
+
return [start, end];
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
text: "\u8FD1\u4E24\u5E74",
|
|
145
|
+
value: () => {
|
|
146
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
147
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
148
|
+
const start = new Date(now.getFullYear() - 1, 0, 1);
|
|
149
|
+
return [start, end];
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
text: "\u8FD1\u4E09\u5E74",
|
|
154
|
+
value: () => {
|
|
155
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
156
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
157
|
+
const start = new Date(now.getFullYear() - 2, 0, 1);
|
|
158
|
+
return [start, end];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
];
|
|
162
|
+
};
|
|
163
|
+
return {
|
|
164
|
+
percentFormat,
|
|
165
|
+
dateFormatYMD,
|
|
166
|
+
dateFormatYMDHMS,
|
|
167
|
+
dateFormatHMS,
|
|
168
|
+
scaleFormat,
|
|
169
|
+
scale2Format,
|
|
170
|
+
groupSeparator,
|
|
171
|
+
copyText,
|
|
172
|
+
removeHtmlSub,
|
|
173
|
+
removeHtml,
|
|
174
|
+
getEnumDesc,
|
|
175
|
+
appendQueryParams,
|
|
176
|
+
getNameAbbr,
|
|
177
|
+
handleConditionalClear,
|
|
178
|
+
getTimeRangePickerShortcuts
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export { commonFunction as default };
|
|
@@ -4,3 +4,4 @@ export { useVxeTable } from './useVxeTableOptionsHook.mjs';
|
|
|
4
4
|
export { loadSysInfo, updateFavicon } from './sysInfo.mjs';
|
|
5
5
|
export { hasPrivilege, hasRoleCode, isAdmin, isMember, isNormalUser, isSupperAdmin, isTenantAdmin, orgId, orgName, posId, posName, roles, tenantId, userAccount, userEmail, userFriendName, userId, userName, userPhone } from './useInfo.mjs';
|
|
6
6
|
export { useDateTimeShortCust } from './dateTimeShortCust.mjs';
|
|
7
|
+
export { default as commonFunction } from './commonFunction.mjs';
|
|
@@ -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/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.8 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('pinia'), require('crypto-js'), require('xlsx-js-style'), require('element-plus'), require('vue'), require('@element-plus/icons-vue'), require('mitt'), require('axios'), require('js-cookie'), require('vxe-table'), require('@vxe-ui/plugin-render-element'), require('@vxe-ui/plugin-export-xlsx'), require('vxe-pc-ui'), require('vue-i18n'), require('exceljs'), require('lodash-es'), require('@vueuse/core'), require('vue-router'), require('nprogress')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'pinia', 'crypto-js', 'xlsx-js-style', 'element-plus', 'vue', '@element-plus/icons-vue', 'mitt', 'axios', 'js-cookie', 'vxe-table', '@vxe-ui/plugin-render-element', '@vxe-ui/plugin-export-xlsx', 'vxe-pc-ui', 'vue-i18n', 'exceljs', 'lodash-es', '@vueuse/core', 'vue-router', 'nprogress'], factory) :
|
|
@@ -1163,7 +1163,7 @@
|
|
|
1163
1163
|
}
|
|
1164
1164
|
};
|
|
1165
1165
|
|
|
1166
|
-
mitt();
|
|
1166
|
+
const emitter = mitt();
|
|
1167
1167
|
|
|
1168
1168
|
const Local = {
|
|
1169
1169
|
// 查看 v2.4.3版本更新日志
|
|
@@ -1469,6 +1469,16 @@
|
|
|
1469
1469
|
document.body.appendChild(link);
|
|
1470
1470
|
});
|
|
1471
1471
|
}
|
|
1472
|
+
const setIntroduction = {
|
|
1473
|
+
// 设置css
|
|
1474
|
+
cssCdn: () => {
|
|
1475
|
+
setCssCdn();
|
|
1476
|
+
},
|
|
1477
|
+
// 设置js
|
|
1478
|
+
jsCdn: () => {
|
|
1479
|
+
setJsCdn();
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1472
1482
|
|
|
1473
1483
|
function useChangeColor() {
|
|
1474
1484
|
const hexToRgb = (str) => {
|
|
@@ -18850,6 +18860,177 @@
|
|
|
18850
18860
|
];
|
|
18851
18861
|
};
|
|
18852
18862
|
|
|
18863
|
+
const themeStore = useThemeConfig();
|
|
18864
|
+
function commonFunction() {
|
|
18865
|
+
const { t } = vueI18n.useI18n();
|
|
18866
|
+
const { copy, isSupported } = core.useClipboard();
|
|
18867
|
+
const percentFormat = (row, column, cellValue) => {
|
|
18868
|
+
return cellValue ? `${cellValue}%` : "-";
|
|
18869
|
+
};
|
|
18870
|
+
const dateFormatYMD = (row, column, cellValue) => {
|
|
18871
|
+
if (!cellValue) return "-";
|
|
18872
|
+
return formatDate(new Date(cellValue), "YYYY-mm-dd");
|
|
18873
|
+
};
|
|
18874
|
+
const dateFormatYMDHMS = (row, column, cellValue) => {
|
|
18875
|
+
if (!cellValue) return "-";
|
|
18876
|
+
return formatDate(new Date(cellValue), "YYYY-mm-dd HH:MM:SS");
|
|
18877
|
+
};
|
|
18878
|
+
const dateFormatHMS = (row, column, cellValue) => {
|
|
18879
|
+
if (!cellValue) return "-";
|
|
18880
|
+
let time = 0;
|
|
18881
|
+
if (typeof row === "number") time = row;
|
|
18882
|
+
if (typeof cellValue === "number") time = cellValue;
|
|
18883
|
+
return formatDate(new Date(time * 1e3), "HH:MM:SS");
|
|
18884
|
+
};
|
|
18885
|
+
const scaleFormat = (value = "0", scale = 4) => {
|
|
18886
|
+
return Number.parseFloat(value).toFixed(scale);
|
|
18887
|
+
};
|
|
18888
|
+
const scale2Format = (value = "0") => {
|
|
18889
|
+
return Number.parseFloat(value).toFixed(2);
|
|
18890
|
+
};
|
|
18891
|
+
const groupSeparator = (value, minimumFractionDigits = 2) => {
|
|
18892
|
+
return value.toLocaleString("en-US", {
|
|
18893
|
+
minimumFractionDigits,
|
|
18894
|
+
maximumFractionDigits: 2
|
|
18895
|
+
});
|
|
18896
|
+
};
|
|
18897
|
+
const copyText = (text) => {
|
|
18898
|
+
return new Promise((resolve, reject) => {
|
|
18899
|
+
try {
|
|
18900
|
+
if (!isSupported.value) {
|
|
18901
|
+
console.error("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
|
|
18902
|
+
reject("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u526A\u8D34\u677F API");
|
|
18903
|
+
} else {
|
|
18904
|
+
copy(text);
|
|
18905
|
+
elementPlus.ElMessage.success(t("message.layout.copyTextSuccess"));
|
|
18906
|
+
resolve(text);
|
|
18907
|
+
}
|
|
18908
|
+
} catch (e) {
|
|
18909
|
+
elementPlus.ElMessage.error(t("message.layout.copyTextError"));
|
|
18910
|
+
reject(e);
|
|
18911
|
+
}
|
|
18912
|
+
});
|
|
18913
|
+
};
|
|
18914
|
+
const removeHtmlSub = (value) => {
|
|
18915
|
+
var str = value.replace(/<[^>]+>/g, "");
|
|
18916
|
+
if (str.length > 50) return str.substring(0, 50) + "......";
|
|
18917
|
+
else return str;
|
|
18918
|
+
};
|
|
18919
|
+
const removeHtml = (value) => {
|
|
18920
|
+
return value.replace(/<[^>]+>/g, "");
|
|
18921
|
+
};
|
|
18922
|
+
const getEnumDesc = (key, lstEnum) => {
|
|
18923
|
+
var _a;
|
|
18924
|
+
return (_a = lstEnum.find((x) => x.value == key)) == null ? void 0 : _a.describe;
|
|
18925
|
+
};
|
|
18926
|
+
const appendQueryParams = (url, params) => {
|
|
18927
|
+
if (!params || Object.keys(params).length == 0) return url;
|
|
18928
|
+
const queryString = Object.keys(params).map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`).join("&");
|
|
18929
|
+
return `${url}${url.includes("?") ? "&" : "?"}${queryString}`;
|
|
18930
|
+
};
|
|
18931
|
+
const getNameAbbr = (text, callback) => {
|
|
18932
|
+
if (!text) return elementPlus.ElMessage.error("\u83B7\u53D6\u7B80\u79F0\u6587\u672C\u4E0D\u80FD\u4E3A\u7A7A");
|
|
18933
|
+
try {
|
|
18934
|
+
return useBaseApi("sysCommon").post({ text }, "nameAbbr").then((res) => {
|
|
18935
|
+
if (callback) callback(res.data.result);
|
|
18936
|
+
return res.data.result;
|
|
18937
|
+
});
|
|
18938
|
+
} catch (e) {
|
|
18939
|
+
elementPlus.ElMessage.error("\u83B7\u53D6\u5931\u8D25");
|
|
18940
|
+
}
|
|
18941
|
+
};
|
|
18942
|
+
const handleConditionalClear = (condition, fieldValue, clearValue = void 0) => {
|
|
18943
|
+
if (condition) {
|
|
18944
|
+
return clearValue;
|
|
18945
|
+
}
|
|
18946
|
+
return fieldValue;
|
|
18947
|
+
};
|
|
18948
|
+
const getTimeRangePickerShortcuts = () => {
|
|
18949
|
+
return [
|
|
18950
|
+
{
|
|
18951
|
+
text: "\u8FD1\u4E00\u5468",
|
|
18952
|
+
value: () => {
|
|
18953
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18954
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
18955
|
+
const start = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 7);
|
|
18956
|
+
return [start, end];
|
|
18957
|
+
}
|
|
18958
|
+
},
|
|
18959
|
+
{
|
|
18960
|
+
text: "\u8FD1\u4E00\u6708",
|
|
18961
|
+
value: () => {
|
|
18962
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18963
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
18964
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 1, now.getDate());
|
|
18965
|
+
return [start, end];
|
|
18966
|
+
}
|
|
18967
|
+
},
|
|
18968
|
+
{
|
|
18969
|
+
text: "\u8FD1\u4E09\u6708",
|
|
18970
|
+
value: () => {
|
|
18971
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18972
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
18973
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 3, now.getDate());
|
|
18974
|
+
return [start, end];
|
|
18975
|
+
}
|
|
18976
|
+
},
|
|
18977
|
+
{
|
|
18978
|
+
text: "\u8FD1\u534A\u5E74",
|
|
18979
|
+
value: () => {
|
|
18980
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18981
|
+
const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
18982
|
+
const start = new Date(now.getFullYear(), now.getMonth() - 6, now.getDate());
|
|
18983
|
+
return [start, end];
|
|
18984
|
+
}
|
|
18985
|
+
},
|
|
18986
|
+
{
|
|
18987
|
+
text: "\u672C\u5E74",
|
|
18988
|
+
value: () => {
|
|
18989
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18990
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
18991
|
+
const start = new Date(now.getFullYear(), 0, 1);
|
|
18992
|
+
return [start, end];
|
|
18993
|
+
}
|
|
18994
|
+
},
|
|
18995
|
+
{
|
|
18996
|
+
text: "\u8FD1\u4E24\u5E74",
|
|
18997
|
+
value: () => {
|
|
18998
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
18999
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
19000
|
+
const start = new Date(now.getFullYear() - 1, 0, 1);
|
|
19001
|
+
return [start, end];
|
|
19002
|
+
}
|
|
19003
|
+
},
|
|
19004
|
+
{
|
|
19005
|
+
text: "\u8FD1\u4E09\u5E74",
|
|
19006
|
+
value: () => {
|
|
19007
|
+
const now = new Date(themeStore.themeConfig.serverTime);
|
|
19008
|
+
const end = new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
19009
|
+
const start = new Date(now.getFullYear() - 2, 0, 1);
|
|
19010
|
+
return [start, end];
|
|
19011
|
+
}
|
|
19012
|
+
}
|
|
19013
|
+
];
|
|
19014
|
+
};
|
|
19015
|
+
return {
|
|
19016
|
+
percentFormat,
|
|
19017
|
+
dateFormatYMD,
|
|
19018
|
+
dateFormatYMDHMS,
|
|
19019
|
+
dateFormatHMS,
|
|
19020
|
+
scaleFormat,
|
|
19021
|
+
scale2Format,
|
|
19022
|
+
groupSeparator,
|
|
19023
|
+
copyText,
|
|
19024
|
+
removeHtmlSub,
|
|
19025
|
+
removeHtml,
|
|
19026
|
+
getEnumDesc,
|
|
19027
|
+
appendQueryParams,
|
|
19028
|
+
getNameAbbr,
|
|
19029
|
+
handleConditionalClear,
|
|
19030
|
+
getTimeRangePickerShortcuts
|
|
19031
|
+
};
|
|
19032
|
+
}
|
|
19033
|
+
|
|
18853
19034
|
const _hoisted_1$6 = { key: 0 };
|
|
18854
19035
|
const _hoisted_2$3 = { key: 0 };
|
|
18855
19036
|
var _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -22406,6 +22587,7 @@
|
|
|
22406
22587
|
exports.clearAccessTokens = clearAccessTokens;
|
|
22407
22588
|
exports.clearTokens = clearTokens;
|
|
22408
22589
|
exports.clone = clone;
|
|
22590
|
+
exports.commonFunction = commonFunction;
|
|
22409
22591
|
exports.configureRoutes = configureRoutes;
|
|
22410
22592
|
exports.dataURLtoBlob = dataURLtoBlob;
|
|
22411
22593
|
exports.decryptJWT = decryptJWT;
|
|
@@ -22452,6 +22634,7 @@
|
|
|
22452
22634
|
exports.languageList = languageList;
|
|
22453
22635
|
exports.loadSysInfo = loadSysInfo;
|
|
22454
22636
|
exports.mergMessage = mergMessage;
|
|
22637
|
+
exports.mittBus = emitter;
|
|
22455
22638
|
exports.openWindow = openWindow;
|
|
22456
22639
|
exports.orgId = orgId;
|
|
22457
22640
|
exports.orgName = orgName;
|
|
@@ -22466,6 +22649,7 @@
|
|
|
22466
22649
|
exports.service = service;
|
|
22467
22650
|
exports.setCssCdn = setCssCdn;
|
|
22468
22651
|
exports.setDynamicViewsModules = setDynamicViewsModules;
|
|
22652
|
+
exports.setIntroduction = setIntroduction;
|
|
22469
22653
|
exports.setJsCdn = setJsCdn;
|
|
22470
22654
|
exports.setPathPrefix = setPathPrefix;
|
|
22471
22655
|
exports.setupI18n = setupI18n;
|