@fmdevui/fm-dev 1.0.4 → 1.0.6
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/README.md +1 -0
- package/es/_virtual/de-DE.mjs +1 -1
- package/es/_virtual/en-US.mjs +1 -1
- package/es/_virtual/es-ES.mjs +1 -1
- package/es/_virtual/fr-FR.mjs +1 -1
- package/es/_virtual/it-IT.mjs +1 -1
- package/es/_virtual/ja-JP.mjs +1 -1
- package/es/_virtual/ko-KR.mjs +1 -1
- package/es/_virtual/nb-NO.mjs +1 -1
- package/es/_virtual/pt-BR.mjs +1 -1
- package/es/_virtual/ru-RU.mjs +1 -1
- package/es/_virtual/th-TH.mjs +1 -1
- package/es/_virtual/vi-VN.mjs +1 -1
- package/es/_virtual/zh-CN.mjs +1 -1
- package/es/_virtual/zh-HK.mjs +1 -1
- package/es/_virtual/zh-TW.mjs +1 -1
- package/es/core/api/base/index.d.ts +19 -0
- package/es/core/api/index.d.ts +4 -0
- package/es/core/api/login/index.d.ts +7 -0
- package/es/core/api/sys/index.d.ts +39 -0
- package/es/core/api/utils/request.d.ts +36 -0
- package/es/core/auth/index.d.ts +40 -0
- package/es/core/directive/authDirective.d.ts +8 -0
- package/es/core/directive/customDirective.d.ts +21 -0
- package/es/core/directive/index.d.ts +9 -0
- package/es/core/index.d.ts +5 -2
- package/es/core/stores/index.d.ts +6 -0
- package/es/core/stores/inpinia.d.ts +3 -0
- package/es/core/stores/keepAliveNames.d.ts +17 -0
- package/es/core/stores/requestOldRoutes.d.ts +9 -0
- package/es/core/stores/routesList.d.ts +14 -0
- package/es/core/stores/tagsViewRoutes.d.ts +11 -0
- package/es/core/stores/themeConfig.d.ts +5 -0
- package/es/core/stores/userInfo.d.ts +21 -0
- package/es/core/utils/array/index.d.ts +23 -0
- package/es/core/utils/base64/index.d.ts +30 -0
- package/es/core/utils/comm/commonFunction.d.ts +17 -0
- package/es/core/utils/comm/data-signature.d.ts +17 -0
- package/es/core/utils/comm/download.d.ts +46 -0
- package/es/core/utils/comm/formatTime.d.ts +37 -0
- package/es/core/utils/comm/idleTimeout.d.ts +45 -0
- package/es/core/utils/comm/index.d.ts +7 -0
- package/es/core/utils/comm/setIconfont.d.ts +12 -0
- package/es/core/utils/comm/signalR.d.ts +3 -0
- package/es/core/utils/comm/sysInfo.d.ts +2 -0
- package/es/core/utils/comm/theme.d.ts +13 -0
- package/es/core/utils/comm/toolsValidate.d.ts +148 -0
- package/es/core/utils/comm/uploadfileurl.d.ts +2 -0
- package/es/core/utils/const/index.d.ts +11 -0
- package/es/core/utils/emit/index.d.ts +4 -0
- package/es/core/utils/index.d.ts +7 -0
- package/es/core/utils/other/index.d.ts +69 -0
- package/es/core/utils/storage/index.d.ts +27 -0
- package/es/core/utils/watermark/index.d.ts +10 -0
- package/es/index.d.ts +1 -2
- package/es/index.mjs +23 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/de-DE.mjs +6 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/en-US.mjs +6 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/es-ES.mjs +6 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/fr-FR.mjs +6 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/it-IT.mjs +6 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/ja-JP.mjs +6 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/ko-KR.mjs +6 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/nb-NO.mjs +6 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/pt-BR.mjs +6 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/ru-RU.mjs +6 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/th-TH.mjs +6 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/vi-VN.mjs +6 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-CHT.mjs +6 -0
- package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-CN.mjs +6 -0
- package/es/packages/core/api/base/index.mjs +179 -0
- package/es/packages/core/api/index.mjs +4 -0
- package/es/packages/core/api/login/index.mjs +35 -0
- package/es/packages/core/api/sys/index.mjs +201 -0
- package/es/packages/core/api/types/global.d.mjs +1 -0
- package/es/packages/core/api/utils/request.mjs +173 -0
- package/es/packages/core/auth/index.mjs +34 -0
- package/es/packages/core/directive/authDirective.mjs +38 -0
- package/es/packages/core/directive/customDirective.mjs +147 -0
- package/es/packages/core/directive/index.mjs +10 -0
- package/es/packages/core/index.mjs +26 -0
- package/es/packages/core/stores/index.mjs +6 -0
- package/es/packages/core/stores/inpinia.mjs +5 -0
- package/es/packages/core/stores/keepAliveNames.mjs +29 -0
- package/es/packages/core/stores/requestOldRoutes.mjs +14 -0
- package/es/packages/core/stores/routesList.mjs +26 -0
- package/es/packages/core/stores/tagsViewRoutes.mjs +22 -0
- package/es/packages/core/stores/themeConfig.mjs +161 -0
- package/es/packages/core/stores/userInfo.mjs +156 -0
- package/es/packages/core/utils/array/index.mjs +59 -0
- package/es/packages/core/utils/base64/index.mjs +57 -0
- package/es/packages/core/utils/comm/calendar.mjs +785 -0
- package/es/packages/core/utils/comm/commonFunction.mjs +83 -0
- package/es/packages/core/utils/comm/data-signature.mjs +39 -0
- package/es/packages/core/utils/comm/download.mjs +78 -0
- package/es/packages/core/utils/comm/formatTime.mjs +110 -0
- package/es/packages/core/utils/comm/idleTimeout.mjs +124 -0
- package/es/packages/core/utils/comm/index.mjs +7 -0
- package/es/packages/core/utils/comm/setIconfont.mjs +36 -0
- package/es/packages/core/utils/comm/signalR.mjs +45 -0
- package/es/packages/core/utils/comm/sysInfo.mjs +54 -0
- package/es/packages/core/utils/comm/theme.mjs +54 -0
- package/es/packages/core/utils/comm/toolsValidate.mjs +140 -0
- package/es/packages/core/utils/comm/uploadfileurl.mjs +12 -0
- package/es/packages/core/utils/const/index.mjs +13 -0
- package/es/packages/core/utils/emit/index.mjs +5 -0
- package/es/packages/core/utils/index.mjs +13 -0
- package/es/packages/core/utils/other/index.mjs +137 -0
- package/es/packages/core/utils/storage/index.mjs +55 -0
- package/es/packages/core/utils/watermark/index.mjs +39 -0
- package/index.js +23664 -5696
- package/index.min.js +42 -10
- package/index.min.mjs +42 -10
- package/index.mjs +23590 -5694
- package/lib/_virtual/de-DE.js +1 -1
- package/lib/_virtual/en-US.js +1 -1
- package/lib/_virtual/es-ES.js +1 -1
- package/lib/_virtual/fr-FR.js +1 -1
- package/lib/_virtual/it-IT.js +1 -1
- package/lib/_virtual/ja-JP.js +1 -1
- package/lib/_virtual/ko-KR.js +1 -1
- package/lib/_virtual/nb-NO.js +1 -1
- package/lib/_virtual/pt-BR.js +1 -1
- package/lib/_virtual/ru-RU.js +1 -1
- package/lib/_virtual/th-TH.js +1 -1
- package/lib/_virtual/vi-VN.js +1 -1
- package/lib/_virtual/zh-CN.js +1 -1
- package/lib/_virtual/zh-HK.js +1 -1
- package/lib/_virtual/zh-TW.js +1 -1
- package/lib/core/api/base/index.d.ts +19 -0
- package/lib/core/api/index.d.ts +4 -0
- package/lib/core/api/login/index.d.ts +7 -0
- package/lib/core/api/sys/index.d.ts +39 -0
- package/lib/core/api/utils/request.d.ts +36 -0
- package/lib/core/auth/index.d.ts +40 -0
- package/lib/core/directive/authDirective.d.ts +8 -0
- package/lib/core/directive/customDirective.d.ts +21 -0
- package/lib/core/directive/index.d.ts +9 -0
- package/lib/core/index.d.ts +5 -2
- package/lib/core/stores/index.d.ts +6 -0
- package/lib/core/stores/inpinia.d.ts +3 -0
- package/lib/core/stores/keepAliveNames.d.ts +17 -0
- package/lib/core/stores/requestOldRoutes.d.ts +9 -0
- package/lib/core/stores/routesList.d.ts +14 -0
- package/lib/core/stores/tagsViewRoutes.d.ts +11 -0
- package/lib/core/stores/themeConfig.d.ts +5 -0
- package/lib/core/stores/userInfo.d.ts +21 -0
- package/lib/core/utils/array/index.d.ts +23 -0
- package/lib/core/utils/base64/index.d.ts +30 -0
- package/lib/core/utils/comm/commonFunction.d.ts +17 -0
- package/lib/core/utils/comm/data-signature.d.ts +17 -0
- package/lib/core/utils/comm/download.d.ts +46 -0
- package/lib/core/utils/comm/formatTime.d.ts +37 -0
- package/lib/core/utils/comm/idleTimeout.d.ts +45 -0
- package/lib/core/utils/comm/index.d.ts +7 -0
- package/lib/core/utils/comm/setIconfont.d.ts +12 -0
- package/lib/core/utils/comm/signalR.d.ts +3 -0
- package/lib/core/utils/comm/sysInfo.d.ts +2 -0
- package/lib/core/utils/comm/theme.d.ts +13 -0
- package/lib/core/utils/comm/toolsValidate.d.ts +148 -0
- package/lib/core/utils/comm/uploadfileurl.d.ts +2 -0
- package/lib/core/utils/const/index.d.ts +11 -0
- package/lib/core/utils/emit/index.d.ts +4 -0
- package/lib/core/utils/index.d.ts +7 -0
- package/lib/core/utils/other/index.d.ts +69 -0
- package/lib/core/utils/storage/index.d.ts +27 -0
- package/lib/core/utils/watermark/index.d.ts +10 -0
- package/lib/index.d.ts +1 -2
- package/lib/index.js +111 -7
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/de-DE.js +6 -0
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/en-US.js +6 -0
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/es-ES.js +6 -0
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/fr-FR.js +6 -0
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/it-IT.js +6 -0
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/ja-JP.js +6 -0
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/ko-KR.js +6 -0
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/nb-NO.js +6 -0
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/pt-BR.js +6 -0
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/ru-RU.js +6 -0
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/th-TH.js +6 -0
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/vi-VN.js +6 -0
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-CHT.js +6 -0
- package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-CN.js +6 -0
- package/lib/packages/core/api/base/index.js +181 -0
- package/lib/packages/core/api/index.js +26 -0
- package/lib/packages/core/api/login/index.js +37 -0
- package/lib/packages/core/api/sys/index.js +204 -0
- package/lib/packages/core/api/types/global.d.js +2 -0
- package/lib/packages/core/api/utils/request.js +190 -0
- package/lib/packages/core/auth/index.js +41 -0
- package/lib/packages/core/directive/authDirective.js +40 -0
- package/lib/packages/core/directive/customDirective.js +151 -0
- package/lib/packages/core/directive/index.js +12 -0
- package/lib/packages/core/index.js +114 -7
- package/lib/packages/core/stores/index.js +17 -0
- package/lib/packages/core/stores/inpinia.js +7 -0
- package/lib/packages/core/stores/keepAliveNames.js +31 -0
- package/lib/packages/core/stores/requestOldRoutes.js +16 -0
- package/lib/packages/core/stores/routesList.js +28 -0
- package/lib/packages/core/stores/tagsViewRoutes.js +24 -0
- package/lib/packages/core/stores/themeConfig.js +163 -0
- package/lib/packages/core/stores/userInfo.js +158 -0
- package/lib/packages/core/utils/array/index.js +64 -0
- package/lib/packages/core/utils/base64/index.js +63 -0
- package/lib/packages/core/utils/comm/calendar.js +789 -0
- package/lib/packages/core/utils/comm/commonFunction.js +87 -0
- package/lib/packages/core/utils/comm/data-signature.js +41 -0
- package/lib/packages/core/utils/comm/download.js +86 -0
- package/lib/packages/core/utils/comm/formatTime.js +115 -0
- package/lib/packages/core/utils/comm/idleTimeout.js +128 -0
- package/lib/packages/core/utils/comm/index.js +50 -0
- package/lib/packages/core/utils/comm/setIconfont.js +42 -0
- package/lib/packages/core/utils/comm/signalR.js +66 -0
- package/lib/packages/core/utils/comm/sysInfo.js +57 -0
- package/lib/packages/core/utils/comm/theme.js +56 -0
- package/lib/packages/core/utils/comm/toolsValidate.js +165 -0
- package/lib/packages/core/utils/comm/uploadfileurl.js +14 -0
- package/lib/packages/core/utils/const/index.js +15 -0
- package/lib/packages/core/utils/emit/index.js +9 -0
- package/lib/packages/core/utils/index.js +69 -0
- package/lib/packages/core/utils/other/index.js +149 -0
- package/lib/packages/core/utils/storage/index.js +58 -0
- package/lib/packages/core/utils/watermark/index.js +41 -0
- package/package.json +2 -2
- package/es/core/types/axios/index.d.ts +0 -11
- package/es/packages/core/types/axios/index.mjs +0 -2
- package/lib/core/types/axios/index.d.ts +0 -11
- package/lib/packages/core/types/axios/index.js +0 -28
- /package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-HK.mjs +0 -0
- /package/es/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-TW.mjs +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-HK.js +0 -0
- /package/lib/node_modules/.pnpm/{vxe-table@4.13.39_vue@3.5.16_typescript@5.8.3_ → vxe-table@4.13.41_vue@3.5.16_typescript@5.8.3_}/node_modules/vxe-table/lib/locale/lang/zh-TW.js +0 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
function wavesDirective(app) {
|
|
2
|
+
app.directive("waves", {
|
|
3
|
+
mounted(el, binding) {
|
|
4
|
+
el.classList.add("waves-effect");
|
|
5
|
+
binding.value && el.classList.add(`waves-${binding.value}`);
|
|
6
|
+
function setConvertStyle(obj) {
|
|
7
|
+
let style = "";
|
|
8
|
+
for (let i in obj) {
|
|
9
|
+
if (obj.hasOwnProperty(i)) style += `${i}:${obj[i]};`;
|
|
10
|
+
}
|
|
11
|
+
return style;
|
|
12
|
+
}
|
|
13
|
+
function onCurrentClick(e) {
|
|
14
|
+
let elDiv = document.createElement("div");
|
|
15
|
+
elDiv.classList.add("waves-ripple");
|
|
16
|
+
el.appendChild(elDiv);
|
|
17
|
+
let styles = {
|
|
18
|
+
left: `${e.layerX}px`,
|
|
19
|
+
top: `${e.layerY}px`,
|
|
20
|
+
opacity: 1,
|
|
21
|
+
transform: `scale(${el.clientWidth / 100 * 10})`,
|
|
22
|
+
"transition-duration": `750ms`,
|
|
23
|
+
"transition-timing-function": `cubic-bezier(0.250, 0.460, 0.450, 0.940)`
|
|
24
|
+
};
|
|
25
|
+
elDiv.setAttribute("style", setConvertStyle(styles));
|
|
26
|
+
setTimeout(() => {
|
|
27
|
+
elDiv.setAttribute(
|
|
28
|
+
"style",
|
|
29
|
+
setConvertStyle({
|
|
30
|
+
opacity: 0,
|
|
31
|
+
transform: styles.transform,
|
|
32
|
+
left: styles.left,
|
|
33
|
+
top: styles.top
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
setTimeout(() => {
|
|
37
|
+
elDiv && el.removeChild(elDiv);
|
|
38
|
+
}, 750);
|
|
39
|
+
}, 450);
|
|
40
|
+
}
|
|
41
|
+
el.addEventListener("mousedown", onCurrentClick, false);
|
|
42
|
+
},
|
|
43
|
+
unmounted(el) {
|
|
44
|
+
el.addEventListener("mousedown", () => {
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function dragDirective(app) {
|
|
50
|
+
app.directive("drag", {
|
|
51
|
+
mounted(el, binding) {
|
|
52
|
+
if (!binding.value) return false;
|
|
53
|
+
const dragDom = document.querySelector(binding.value[0]);
|
|
54
|
+
const dragHeader = document.querySelector(binding.value[1]);
|
|
55
|
+
dragHeader.onmouseover = () => dragHeader.style.cursor = `move`;
|
|
56
|
+
function down(e, type) {
|
|
57
|
+
const disX = type === "pc" ? e.clientX - dragHeader.offsetLeft : e.touches[0].clientX - dragHeader.offsetLeft;
|
|
58
|
+
const disY = type === "pc" ? e.clientY - dragHeader.offsetTop : e.touches[0].clientY - dragHeader.offsetTop;
|
|
59
|
+
const screenWidth = document.body.clientWidth;
|
|
60
|
+
const screenHeight = document.documentElement.clientHeight;
|
|
61
|
+
const dragDomWidth = dragDom.offsetWidth;
|
|
62
|
+
const dragDomheight = dragDom.offsetHeight;
|
|
63
|
+
const minDragDomLeft = dragDom.offsetLeft;
|
|
64
|
+
const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth;
|
|
65
|
+
const minDragDomTop = dragDom.offsetTop;
|
|
66
|
+
const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight;
|
|
67
|
+
let styL = getComputedStyle(dragDom).left;
|
|
68
|
+
let styT = getComputedStyle(dragDom).top;
|
|
69
|
+
if (styL.includes("%")) {
|
|
70
|
+
styL = +document.body.clientWidth * (+styL.replace(/\%/g, "") / 100);
|
|
71
|
+
styT = +document.body.clientHeight * (+styT.replace(/\%/g, "") / 100);
|
|
72
|
+
} else {
|
|
73
|
+
styL = +styL.replace(/\px/g, "");
|
|
74
|
+
styT = +styT.replace(/\px/g, "");
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
disX,
|
|
78
|
+
disY,
|
|
79
|
+
minDragDomLeft,
|
|
80
|
+
maxDragDomLeft,
|
|
81
|
+
minDragDomTop,
|
|
82
|
+
maxDragDomTop,
|
|
83
|
+
styL,
|
|
84
|
+
styT
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function move(e, type, obj) {
|
|
88
|
+
let { disX, disY, minDragDomLeft, maxDragDomLeft, minDragDomTop, maxDragDomTop, styL, styT } = obj;
|
|
89
|
+
let left = type === "pc" ? e.clientX - disX : e.touches[0].clientX - disX;
|
|
90
|
+
let top = type === "pc" ? e.clientY - disY : e.touches[0].clientY - disY;
|
|
91
|
+
if (-left > minDragDomLeft) {
|
|
92
|
+
left = -minDragDomLeft;
|
|
93
|
+
} else if (left > maxDragDomLeft) {
|
|
94
|
+
left = maxDragDomLeft;
|
|
95
|
+
}
|
|
96
|
+
if (-top > minDragDomTop) {
|
|
97
|
+
top = -minDragDomTop;
|
|
98
|
+
} else if (top > maxDragDomTop) {
|
|
99
|
+
top = maxDragDomTop;
|
|
100
|
+
}
|
|
101
|
+
dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`;
|
|
102
|
+
}
|
|
103
|
+
dragHeader.onmousedown = (e) => {
|
|
104
|
+
const obj = down(e, "pc");
|
|
105
|
+
document.onmousemove = (e2) => {
|
|
106
|
+
move(e2, "pc", obj);
|
|
107
|
+
};
|
|
108
|
+
document.onmouseup = () => {
|
|
109
|
+
document.onmousemove = null;
|
|
110
|
+
document.onmouseup = null;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
dragHeader.ontouchstart = (e) => {
|
|
114
|
+
const obj = down(e, "app");
|
|
115
|
+
document.ontouchmove = (e2) => {
|
|
116
|
+
move(e2, "app", obj);
|
|
117
|
+
};
|
|
118
|
+
document.ontouchend = () => {
|
|
119
|
+
document.ontouchmove = null;
|
|
120
|
+
document.ontouchend = null;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function reclickDirective(app) {
|
|
127
|
+
app.directive("reclick", {
|
|
128
|
+
mounted(el, time) {
|
|
129
|
+
el.addEventListener("click", () => {
|
|
130
|
+
if (!el.disabled) {
|
|
131
|
+
el.disabled = true;
|
|
132
|
+
setTimeout(
|
|
133
|
+
() => {
|
|
134
|
+
el.disabled = false;
|
|
135
|
+
},
|
|
136
|
+
time.value === void 0 ? 500 : time.value
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
},
|
|
141
|
+
unmounted(el) {
|
|
142
|
+
el.disabled = false;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export { dragDirective, reclickDirective, wavesDirective };
|
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
export { FmLogin } from './ui/login/index.mjs';
|
|
2
|
+
import './api/index.mjs';
|
|
3
|
+
export { directive } from './directive/index.mjs';
|
|
2
4
|
export { getCountryCode, i18n, iso_3166_1_CountryList, languageList, mergMessage, setupI18n } from './locales/index.mjs';
|
|
5
|
+
import './stores/index.mjs';
|
|
6
|
+
import './utils/index.mjs';
|
|
7
|
+
export { auth, authAll, auths, hAuth, hAuthAll, hAuths } from './auth/index.mjs';
|
|
3
8
|
import './types/index.mjs';
|
|
9
|
+
export { useBaseApi } from './api/base/index.mjs';
|
|
10
|
+
export { feature, useSysApi } from './api/sys/index.mjs';
|
|
11
|
+
export { useLoginApi } from './api/login/index.mjs';
|
|
12
|
+
export { accessTokenKey, axiosInstance, cancelAllRequest, cancelRequest, clearAccessTokens, clearTokens, decryptJWT, getJWTDate, getToken, refreshAccessTokenKey, request2, service, tansParams } from './api/utils/request.mjs';
|
|
13
|
+
export { useKeepALiveNames } from './stores/keepAliveNames.mjs';
|
|
14
|
+
export { useRequestOldRoutes } from './stores/requestOldRoutes.mjs';
|
|
15
|
+
export { useRoutesList } from './stores/routesList.mjs';
|
|
16
|
+
export { useTagsViewRoutes } from './stores/tagsViewRoutes.mjs';
|
|
17
|
+
export { useThemeConfig } from './stores/themeConfig.mjs';
|
|
18
|
+
export { useUserInfo } from './stores/userInfo.mjs';
|
|
19
|
+
export { clone, isObjectValueEqual, judgementSameArr, removeDuplicate } from './utils/array/index.mjs';
|
|
20
|
+
export { Watermark } from './utils/watermark/index.mjs';
|
|
21
|
+
export { base64ToFile, blobToFile, dataURLtoBlob, fileToBase64, urlToBase64 } from './utils/base64/index.mjs';
|
|
22
|
+
export { Local, Session } from './utils/storage/index.mjs';
|
|
23
|
+
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 './utils/comm/toolsValidate.mjs';
|
|
24
|
+
export { formatAxis, formatDate, formatPast, getWeek } from './utils/comm/formatTime.mjs';
|
|
25
|
+
export { useChangeColor } from './utils/comm/theme.mjs';
|
|
26
|
+
export { downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadStreamFile, getFileName, openWindow } from './utils/comm/download.mjs';
|
|
27
|
+
export { signatureByKSort } from './utils/comm/data-signature.mjs';
|
|
28
|
+
export { getFileUrl } from './utils/comm/uploadfileurl.mjs';
|
|
29
|
+
export { PUB } from './utils/const/index.mjs';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { useKeepALiveNames } from './keepAliveNames.mjs';
|
|
2
|
+
export { useRequestOldRoutes } from './requestOldRoutes.mjs';
|
|
3
|
+
export { useRoutesList } from './routesList.mjs';
|
|
4
|
+
export { useTagsViewRoutes } from './tagsViewRoutes.mjs';
|
|
5
|
+
export { useThemeConfig } from './themeConfig.mjs';
|
|
6
|
+
export { useUserInfo } from './userInfo.mjs';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
|
|
3
|
+
const useKeepALiveNames = defineStore("keepALiveNames", {
|
|
4
|
+
state: () => ({
|
|
5
|
+
keepAliveNames: [],
|
|
6
|
+
cachedViews: []
|
|
7
|
+
}),
|
|
8
|
+
actions: {
|
|
9
|
+
async setCacheKeepAlive(data) {
|
|
10
|
+
this.keepAliveNames = data;
|
|
11
|
+
},
|
|
12
|
+
async addCachedView(view) {
|
|
13
|
+
if (view.meta.isKeepAlive) this.cachedViews?.push(view.name);
|
|
14
|
+
},
|
|
15
|
+
async delCachedView(view) {
|
|
16
|
+
const index = this.cachedViews.indexOf(view.name);
|
|
17
|
+
if (index > -1) this.cachedViews.splice(index, 1);
|
|
18
|
+
},
|
|
19
|
+
async delOthersCachedViews(view) {
|
|
20
|
+
if (view.meta.isKeepAlive) this.cachedViews = [view.name];
|
|
21
|
+
else this.cachedViews = [];
|
|
22
|
+
},
|
|
23
|
+
async delAllCachedViews() {
|
|
24
|
+
this.cachedViews = [];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export { useKeepALiveNames };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
|
|
3
|
+
const useRequestOldRoutes = defineStore("requestOldRoutes", {
|
|
4
|
+
state: () => ({
|
|
5
|
+
requestOldRoutes: []
|
|
6
|
+
}),
|
|
7
|
+
actions: {
|
|
8
|
+
async setRequestOldRoutes(routes) {
|
|
9
|
+
this.requestOldRoutes = routes;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { useRequestOldRoutes };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
|
|
3
|
+
const useRoutesList = defineStore("routesList", {
|
|
4
|
+
state: () => ({
|
|
5
|
+
routesList: [],
|
|
6
|
+
isColumnsMenuHover: false,
|
|
7
|
+
isColumnsNavHover: false,
|
|
8
|
+
currentRoute: null
|
|
9
|
+
}),
|
|
10
|
+
actions: {
|
|
11
|
+
setCurrentRoute(route) {
|
|
12
|
+
this.currentRoute = route;
|
|
13
|
+
},
|
|
14
|
+
async setRoutesList(data) {
|
|
15
|
+
this.routesList = data;
|
|
16
|
+
},
|
|
17
|
+
async setColumnsMenuHover(bool) {
|
|
18
|
+
this.isColumnsMenuHover = bool;
|
|
19
|
+
},
|
|
20
|
+
async setColumnsNavHover(bool) {
|
|
21
|
+
this.isColumnsNavHover = bool;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { useRoutesList };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
import '../utils/index.mjs';
|
|
3
|
+
import { Session } from '../utils/storage/index.mjs';
|
|
4
|
+
import { PUB } from '../utils/const/index.mjs';
|
|
5
|
+
|
|
6
|
+
const useTagsViewRoutes = defineStore("tagsViewRoutes", {
|
|
7
|
+
state: () => ({
|
|
8
|
+
tagsViewRoutes: [],
|
|
9
|
+
isTagsViewCurrenFull: false
|
|
10
|
+
}),
|
|
11
|
+
actions: {
|
|
12
|
+
async setTagsViewRoutes(data) {
|
|
13
|
+
this.tagsViewRoutes = data;
|
|
14
|
+
},
|
|
15
|
+
setCurrenFullscreen(bool) {
|
|
16
|
+
Session.set(PUB.isTagsViewCurrenFull, bool);
|
|
17
|
+
this.isTagsViewCurrenFull = bool;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export { useTagsViewRoutes };
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
|
|
3
|
+
const useThemeConfig = defineStore("themeConfig", {
|
|
4
|
+
state: () => ({
|
|
5
|
+
themeConfig: {
|
|
6
|
+
// 是否开启布局配置抽屉
|
|
7
|
+
isDrawer: false,
|
|
8
|
+
/**
|
|
9
|
+
* 全局主题
|
|
10
|
+
*/
|
|
11
|
+
// 默认 primary 主题颜色
|
|
12
|
+
primary: "#0f59a4",
|
|
13
|
+
//胭脂红:#f03f24 //飞燕草蓝:#0f59a4 //薄荷绿:#207f4c
|
|
14
|
+
// 是否开启深色模式
|
|
15
|
+
isIsDark: false,
|
|
16
|
+
/**
|
|
17
|
+
* 顶栏设置
|
|
18
|
+
*/
|
|
19
|
+
// 默认顶栏导航背景颜色
|
|
20
|
+
topBar: "#FFFFFF",
|
|
21
|
+
// 默认顶栏导航字体颜色
|
|
22
|
+
topBarColor: "#000000",
|
|
23
|
+
// 是否开启顶栏背景颜色渐变
|
|
24
|
+
isTopBarColorGradual: false,
|
|
25
|
+
/**
|
|
26
|
+
* 菜单设置
|
|
27
|
+
*/
|
|
28
|
+
// 默认菜单导航背景颜色
|
|
29
|
+
menuBar: "#FFFFFF",
|
|
30
|
+
// 默认菜单导航字体颜色
|
|
31
|
+
menuBarColor: "#000000",
|
|
32
|
+
// 默认菜单高亮背景色
|
|
33
|
+
menuBarActiveColor: "var(--el-color-primary-light-7)",
|
|
34
|
+
// 是否开启菜单背景颜色渐变
|
|
35
|
+
isMenuBarColorGradual: false,
|
|
36
|
+
/**
|
|
37
|
+
* 分栏设置
|
|
38
|
+
*/
|
|
39
|
+
// 默认分栏菜单背景颜色
|
|
40
|
+
columnsMenuBar: "#2C3A49",
|
|
41
|
+
// 默认分栏菜单字体颜色
|
|
42
|
+
columnsMenuBarColor: "#F0F0F0",
|
|
43
|
+
// 是否开启分栏菜单背景颜色渐变
|
|
44
|
+
isColumnsMenuBarColorGradual: false,
|
|
45
|
+
// 是否开启分栏菜单鼠标悬停预加载(预览菜单)
|
|
46
|
+
isColumnsMenuHoverPreload: false,
|
|
47
|
+
// 分栏Logo高度(px)
|
|
48
|
+
columnsLogoHeight: 50,
|
|
49
|
+
// 分栏菜单宽度(px)
|
|
50
|
+
columnsMenuWidth: 70,
|
|
51
|
+
// 分栏菜单高度(px)
|
|
52
|
+
columnsMenuHeight: 50,
|
|
53
|
+
/**
|
|
54
|
+
* 界面设置
|
|
55
|
+
*/
|
|
56
|
+
// 是否开启菜单水平折叠效果
|
|
57
|
+
isCollapse: false,
|
|
58
|
+
// 是否开启菜单手风琴效果
|
|
59
|
+
isUniqueOpened: true,
|
|
60
|
+
// 是否开启固定 Header
|
|
61
|
+
isFixedHeader: true,
|
|
62
|
+
// 初始化变量,用于更新菜单 el-scrollbar 的高度,请勿删除
|
|
63
|
+
isFixedHeaderChange: false,
|
|
64
|
+
// 是否开启经典布局分割菜单(仅经典布局生效)
|
|
65
|
+
isClassicSplitMenu: false,
|
|
66
|
+
// 是否开启自动锁屏
|
|
67
|
+
isLockScreen: false,
|
|
68
|
+
// 开启自动锁屏倒计时(s/秒)
|
|
69
|
+
lockScreenTime: 300,
|
|
70
|
+
/**
|
|
71
|
+
* 界面显示
|
|
72
|
+
*/
|
|
73
|
+
// 是否开启侧边栏 Logo
|
|
74
|
+
isShowLogo: true,
|
|
75
|
+
// 初始化变量,用于 el-scrollbar 的高度更新,请勿删除
|
|
76
|
+
isShowLogoChange: false,
|
|
77
|
+
// 是否开启 Breadcrumb,强制经典、横向布局不显示
|
|
78
|
+
isBreadcrumb: true,
|
|
79
|
+
// 是否开启 Tagsview
|
|
80
|
+
isTagsview: true,
|
|
81
|
+
// 是否开启 Breadcrumb 图标
|
|
82
|
+
isBreadcrumbIcon: true,
|
|
83
|
+
// 是否开启 Tagsview 图标
|
|
84
|
+
isTagsviewIcon: true,
|
|
85
|
+
// 是否开启 TagsView 缓存
|
|
86
|
+
isCacheTagsView: true,
|
|
87
|
+
// 是否开启 TagsView 拖拽
|
|
88
|
+
isSortableTagsView: true,
|
|
89
|
+
// 是否开启 TagsView 共用 -- 共用详情界面:tagsView只会出现一个;非共用详情界面:tagsView会出现多个
|
|
90
|
+
isShareTagsView: true,
|
|
91
|
+
// 是否开启 Footer 底部版权信息
|
|
92
|
+
isFooter: true,
|
|
93
|
+
// 是否开启灰色模式
|
|
94
|
+
isGrayscale: false,
|
|
95
|
+
// 是否开启色弱模式
|
|
96
|
+
isInvert: false,
|
|
97
|
+
// 是否开启水印
|
|
98
|
+
isWatermark: true,
|
|
99
|
+
// 水印文案
|
|
100
|
+
watermarkText: "FM",
|
|
101
|
+
/**
|
|
102
|
+
* 其它设置
|
|
103
|
+
*/
|
|
104
|
+
// Tagsview 风格:可选值"<tags-style-one|tags-style-four|tags-style-five>",默认 tags-style-five
|
|
105
|
+
// 定义的值与 `/src/layout/navBars/tagsView/tagsView.vue` 中的 class 同名
|
|
106
|
+
tagsStyle: "tags-style-one",
|
|
107
|
+
// 主页面切换动画: Animate.css
|
|
108
|
+
animation: "fadeDown",
|
|
109
|
+
// 分栏高亮风格:可选值"<columns-round|columns-card>",默认 columns-round
|
|
110
|
+
columnsAsideStyle: "columns-round",
|
|
111
|
+
// 分栏布局风格:可选值"<columns-horizontal|columns-vertical>",默认 columns-horizontal
|
|
112
|
+
columnsAsideLayout: "columns-vertical",
|
|
113
|
+
/**
|
|
114
|
+
* 布局切换
|
|
115
|
+
* 注意:为了演示,切换布局时,颜色会被还原成默认,代码位置:/@/layout/navBars/topBar/settings.vue
|
|
116
|
+
* 中的 `initSetLayoutChange(设置布局切换,重置主题样式)` 方法
|
|
117
|
+
*/
|
|
118
|
+
// 布局切换:可选值"<defaults|classic|transverse|columns>",默认 defaults
|
|
119
|
+
layout: "columns",
|
|
120
|
+
/**
|
|
121
|
+
* 后端控制路由
|
|
122
|
+
*/
|
|
123
|
+
// 是否开启后端控制路由
|
|
124
|
+
isRequestRoutes: true,
|
|
125
|
+
/**
|
|
126
|
+
* 全局网站标题 / 副标题
|
|
127
|
+
*/
|
|
128
|
+
// 网站主标题(菜单导航、浏览器当前网页标题)
|
|
129
|
+
globalTitle: "FM.Pro",
|
|
130
|
+
// 网站副标题(登录页顶部文字)
|
|
131
|
+
globalViceTitle: "FM",
|
|
132
|
+
// 网站副标题(登录页顶部文字)
|
|
133
|
+
globalViceTitleMsg: "\u901A\u7528\u6743\u9650\u5F00\u53D1\u6846\u67B6",
|
|
134
|
+
// 版权和备案文字
|
|
135
|
+
copyright: "Copyright \xA9 2023-Present FM All rights reserved.",
|
|
136
|
+
// 默认初始语言,可选值"<zh-CN|en|zh-TW>",默认 zh-CN
|
|
137
|
+
globalI18n: "zh-CN",
|
|
138
|
+
// 默认全局组件大小,可选值"<large|'default'|small>",默认 'large'
|
|
139
|
+
globalComponentSize: "small",
|
|
140
|
+
// 系统 logo 地址
|
|
141
|
+
logoUrl: "logo.png",
|
|
142
|
+
// Icp备案号
|
|
143
|
+
icp: "\u7701ICP\u590712345678\u53F7",
|
|
144
|
+
// Icp地址
|
|
145
|
+
icpUrl: "https://beian.miit.gov.cn",
|
|
146
|
+
// 是否开启多语言切换
|
|
147
|
+
i18NSwitch: true,
|
|
148
|
+
// 闲置超时时间
|
|
149
|
+
idleTimeout: 0,
|
|
150
|
+
// 上线下线通知
|
|
151
|
+
onlineNotice: true
|
|
152
|
+
}
|
|
153
|
+
}),
|
|
154
|
+
actions: {
|
|
155
|
+
setThemeConfig(data) {
|
|
156
|
+
this.themeConfig = data.themeConfig;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
export { useThemeConfig };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
import '../utils/index.mjs';
|
|
3
|
+
import { useThemeConfig } from './themeConfig.mjs';
|
|
4
|
+
import '../api/index.mjs';
|
|
5
|
+
import { useI18n } from 'vue-i18n';
|
|
6
|
+
import { useSysApi } from '../api/sys/index.mjs';
|
|
7
|
+
import { Watermark } from '../utils/watermark/index.mjs';
|
|
8
|
+
import { Local, Session } from '../utils/storage/index.mjs';
|
|
9
|
+
import { PUB } from '../utils/const/index.mjs';
|
|
10
|
+
|
|
11
|
+
const useUserInfo = defineStore("userInfo", {
|
|
12
|
+
state: () => ({
|
|
13
|
+
userInfos: {},
|
|
14
|
+
// 用户信息
|
|
15
|
+
constList: [],
|
|
16
|
+
// 常量列表
|
|
17
|
+
dictList: {},
|
|
18
|
+
// 字典列表
|
|
19
|
+
userTableList: []
|
|
20
|
+
// 用户表格字段列表
|
|
21
|
+
}),
|
|
22
|
+
getters: {},
|
|
23
|
+
actions: {
|
|
24
|
+
// 存储用户信息到浏览器缓存
|
|
25
|
+
async setUserInfos() {
|
|
26
|
+
this.userInfos = Session.get("userInfo") ?? await this.getApiUserInfo();
|
|
27
|
+
},
|
|
28
|
+
// 存储常量信息到浏览器缓存
|
|
29
|
+
async setConstList() {
|
|
30
|
+
this.constList = Session.get("constList") ?? await this.getSysConstList();
|
|
31
|
+
if (!Session.get("constList")) Session.set("constList", this.constList);
|
|
32
|
+
},
|
|
33
|
+
// 存储字典信息到浏览器缓存
|
|
34
|
+
async setDictList() {
|
|
35
|
+
var dictList = await useSysApi().getAllDictList().then((res) => res.data.result ?? {});
|
|
36
|
+
var dictListTemp = JSON.parse(JSON.stringify(dictList));
|
|
37
|
+
await Promise.all(
|
|
38
|
+
Object.keys(dictList).map(async (key) => {
|
|
39
|
+
dictList[key].forEach((da, index) => {
|
|
40
|
+
setDictLangMessageAsync(dictListTemp[key][index]);
|
|
41
|
+
});
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
this.dictList = dictListTemp;
|
|
45
|
+
},
|
|
46
|
+
// 存储用户表格列到浏览器缓存
|
|
47
|
+
async setUserTables() {
|
|
48
|
+
this.userTableList = Session.get(PUB.userTable) ?? await this.getUserTableList();
|
|
49
|
+
if (!Session.get(PUB.userTable)) Session.set(PUB.userTable, this.userTableList);
|
|
50
|
+
},
|
|
51
|
+
// 获取当前用户信息
|
|
52
|
+
getApiUserInfo() {
|
|
53
|
+
return new Promise((resolve) => {
|
|
54
|
+
useSysApi().getUserInfo().then((res) => {
|
|
55
|
+
if (res.data.result == null) return;
|
|
56
|
+
var d = res.data.result;
|
|
57
|
+
const userInfos = {
|
|
58
|
+
id: d.id,
|
|
59
|
+
loginId: d.loginId,
|
|
60
|
+
tenantId: d.tenantId,
|
|
61
|
+
account: d.account,
|
|
62
|
+
realName: d.realName,
|
|
63
|
+
phone: d.phone,
|
|
64
|
+
idCardNum: d.idCardNum,
|
|
65
|
+
email: d.email,
|
|
66
|
+
accountType: d.accountType,
|
|
67
|
+
avatar: d.avatar ?? "/logo.png",
|
|
68
|
+
address: d.address,
|
|
69
|
+
signature: d.signature,
|
|
70
|
+
orgId: d.orgId,
|
|
71
|
+
orgName: d.orgName,
|
|
72
|
+
posName: d.posName,
|
|
73
|
+
roles: d.roleIds,
|
|
74
|
+
authApiList: d.apis,
|
|
75
|
+
lastChangePasswordTime: d.lastChangePasswordTime,
|
|
76
|
+
time: (/* @__PURE__ */ new Date()).getTime()
|
|
77
|
+
};
|
|
78
|
+
const storesThemeConfig = useThemeConfig();
|
|
79
|
+
storesThemeConfig.themeConfig.watermarkText = d.watermarkText ?? "";
|
|
80
|
+
if (storesThemeConfig.themeConfig.isWatermark) Watermark.set(storesThemeConfig.themeConfig.watermarkText);
|
|
81
|
+
else Watermark.del();
|
|
82
|
+
Local.remove(PUB.themeConfig);
|
|
83
|
+
Local.set(PUB.themeConfig, storesThemeConfig.themeConfig);
|
|
84
|
+
resolve(userInfos);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
// 获取当前用户表格列集合
|
|
89
|
+
getUserTableList() {
|
|
90
|
+
return new Promise((resolve) => {
|
|
91
|
+
useSysApi().getUserRoleTableList().then(async (res) => {
|
|
92
|
+
resolve(res.data.result ?? []);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
// 获取常量集合
|
|
97
|
+
getSysConstList() {
|
|
98
|
+
return new Promise((resolve) => {
|
|
99
|
+
useSysApi().getConstList().then(async (res) => {
|
|
100
|
+
resolve(res.data.result ?? []);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
// 根据常量类名获取常量数据
|
|
105
|
+
getConstDataByTypeCode(typeCode) {
|
|
106
|
+
return this.constList.find((item) => item.code === typeCode)?.data?.result || [];
|
|
107
|
+
},
|
|
108
|
+
// 根据常量类名和编码获取常量值
|
|
109
|
+
getConstItemNameByType(typeCode, itemCode) {
|
|
110
|
+
const data = this.getConstDataByTypeCode(typeCode);
|
|
111
|
+
return data.find((item) => item.code === itemCode)?.name;
|
|
112
|
+
},
|
|
113
|
+
// 常量编码和名称转换
|
|
114
|
+
codeToName(code, type) {
|
|
115
|
+
return this.constList.find((x) => x.code === type).data.result.find((x) => x.code === code)?.name;
|
|
116
|
+
},
|
|
117
|
+
// 根据字典类型获取字典数据
|
|
118
|
+
getDictDataByCode(dictTypeCode) {
|
|
119
|
+
return this.dictList[dictTypeCode] || [];
|
|
120
|
+
},
|
|
121
|
+
// 根据字典类型和值获取取字典项
|
|
122
|
+
getDictItemByValue(dictTypeCode, value) {
|
|
123
|
+
if (value != void 0 && value !== "") {
|
|
124
|
+
const _value = value.toString();
|
|
125
|
+
const ds = this.dictList[dictTypeCode] || [];
|
|
126
|
+
for (const element of ds) {
|
|
127
|
+
if (element.value == _value) {
|
|
128
|
+
return element;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return {};
|
|
133
|
+
},
|
|
134
|
+
// 根据字典类型和名称获取取字典项
|
|
135
|
+
getDictItemByLabel(dictTypeCode, label) {
|
|
136
|
+
if (label != void 0 && label !== "") {
|
|
137
|
+
const _label = label.toString();
|
|
138
|
+
const ds = this.dictList[dictTypeCode] || [];
|
|
139
|
+
for (const element of ds) {
|
|
140
|
+
if (element.label == _label) {
|
|
141
|
+
return element;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return {};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
const setDictLangMessageAsync = async (dict) => {
|
|
150
|
+
const { t } = useI18n();
|
|
151
|
+
dict.langMessage = `message.dictType.${dict.typeCode}_${dict.value}`;
|
|
152
|
+
const text = t(dict.langMessage);
|
|
153
|
+
dict.label = text !== dict.langMessage && !text.endsWith(`${dict.typeCode}_${dict.value}`) ? text : dict.label;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export { useUserInfo };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
function judgementSameArr(newArr, oldArr) {
|
|
2
|
+
const news = removeDuplicate(newArr);
|
|
3
|
+
const olds = removeDuplicate(oldArr);
|
|
4
|
+
let count = 0;
|
|
5
|
+
const leng = news.length;
|
|
6
|
+
for (let i in olds) {
|
|
7
|
+
for (let j in news) {
|
|
8
|
+
if (olds[i] === news[j]) count++;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return count === leng ? true : false;
|
|
12
|
+
}
|
|
13
|
+
function isObjectValueEqual(a, b) {
|
|
14
|
+
if (!a || !b) return false;
|
|
15
|
+
let aProps = Object.getOwnPropertyNames(a);
|
|
16
|
+
let bProps = Object.getOwnPropertyNames(b);
|
|
17
|
+
if (aProps.length != bProps.length) return false;
|
|
18
|
+
for (let i = 0; i < aProps.length; i++) {
|
|
19
|
+
let propName = aProps[i];
|
|
20
|
+
let propA = a[propName];
|
|
21
|
+
let propB = b[propName];
|
|
22
|
+
if (!b.hasOwnProperty(propName)) return false;
|
|
23
|
+
if (propA instanceof Object) {
|
|
24
|
+
if (!isObjectValueEqual(propA, propB)) return false;
|
|
25
|
+
} else if (propA !== propB) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
function removeDuplicate(arr, attr) {
|
|
32
|
+
if (!Object.keys(arr).length) {
|
|
33
|
+
return arr;
|
|
34
|
+
} else {
|
|
35
|
+
if (attr) {
|
|
36
|
+
const obj = {};
|
|
37
|
+
return arr.reduce((cur, item) => {
|
|
38
|
+
obj[item[attr]] ? "" : obj[item[attr]] = item[attr] && cur.push(item);
|
|
39
|
+
return cur;
|
|
40
|
+
}, []);
|
|
41
|
+
} else {
|
|
42
|
+
return [...new Set(arr)];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const clone = (value) => {
|
|
47
|
+
if (!value) return value;
|
|
48
|
+
if (Array.isArray(value)) return value.map((item) => clone(item));
|
|
49
|
+
if (typeof value === "object") {
|
|
50
|
+
return Object.fromEntries(
|
|
51
|
+
Object.entries(value).map(([k, v]) => {
|
|
52
|
+
return [k, clone(v)];
|
|
53
|
+
})
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return value;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export { clone, isObjectValueEqual, judgementSameArr, removeDuplicate };
|