x-essential-lib 0.10.10 → 0.10.13
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/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as EventType, t as Emitter } from "./vendor.
|
|
1
|
+
import { n as EventType, t as Emitter } from "./vendor.bri8m5ch.js";
|
|
2
2
|
import { Ref } from "vue";
|
|
3
3
|
import { RouteLocationNormalized } from "vue-router";
|
|
4
4
|
import { AxiosInstance } from "axios";
|
|
@@ -256,6 +256,8 @@ declare function provideLocale(locale: Ref<string>): void;
|
|
|
256
256
|
declare function injectLocale(): Ref<string>;
|
|
257
257
|
declare function provideActiveOrg(activeOrg: Ref<string>): void;
|
|
258
258
|
declare function injectActiveOrg(): Ref<string>;
|
|
259
|
+
declare function provideActiveOrgName(activeOrgName: Ref<string>): void;
|
|
260
|
+
declare function injectActiveOrgName(): Ref<string>;
|
|
259
261
|
declare function providePermissionObjects(permissionObjects: Ref<PermissionObjects>): void;
|
|
260
262
|
declare function injectPermissionObjects(): Ref<PermissionObjects>;
|
|
261
263
|
declare function providePermissionChecksum(permissionChecksum: Ref<string>): void;
|
|
@@ -301,16 +303,17 @@ declare function popView(views: Ref<string[]>): void;
|
|
|
301
303
|
declare function clearViews(views: Ref<string[]>): void;
|
|
302
304
|
//#endregion
|
|
303
305
|
//#region src/composables/microApp.d.ts
|
|
304
|
-
interface
|
|
306
|
+
interface GlobalStates {
|
|
305
307
|
dark: Ref<boolean | undefined>;
|
|
306
308
|
locale: Ref<string>;
|
|
307
309
|
activeOrg: Ref<string>;
|
|
310
|
+
activeOrgName: Ref<string>;
|
|
308
311
|
permissionObjects: Ref<PermissionObjects>;
|
|
309
312
|
permissionChecksum: Ref<string>;
|
|
310
313
|
lastAppPath: Ref<string>;
|
|
311
314
|
views: Ref<string[]>;
|
|
312
315
|
}
|
|
313
|
-
declare function useMicroApp(
|
|
316
|
+
declare function useMicroApp(globalStates: GlobalStates, syncLocale: () => Promise<void>, base?: boolean, customBack?: (m: RouteMeta) => void): void;
|
|
314
317
|
//#endregion
|
|
315
318
|
//#region src/composables/permission.d.ts
|
|
316
319
|
declare function usePermission(): {
|
|
@@ -546,6 +549,9 @@ declare function loadLocaleMessageEssential(locale: string): Promise<{
|
|
|
546
549
|
};
|
|
547
550
|
};
|
|
548
551
|
};
|
|
552
|
+
'x-essential-lib': {
|
|
553
|
+
publicDomain: string;
|
|
554
|
+
};
|
|
549
555
|
}>;
|
|
550
556
|
//#endregion
|
|
551
557
|
//#region src/index.d.ts
|
|
@@ -553,4 +559,4 @@ declare const _default: {
|
|
|
553
559
|
install: (app: import("vue").App) => void;
|
|
554
560
|
};
|
|
555
561
|
//#endregion
|
|
556
|
-
export { Permission, PermissionObjects, RouteMeta, Type, addView, appAppear, clearViews, closeWaitDlg, createAxios, _default as default, delView, eventBus, getTypeColor, getTypeDefault, globalObjects, hasView, injectActiveOrg, injectDark, injectLastAppPath, injectLocale, injectPermissionChecksum, injectPermissionObjects, injectViews, isEmpty, isExist, lastView, loadLocaleMessageEssential, matchRouteMeta, messageError, messageInfo, messageSuccess, messageWarning, onBeforeEach, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideActiveOrg, provideDark, provideLastAppPath, provideLocale, providePermissionChecksum, providePermissionObjects, provideViews, routeTransName, toPermissionObjects, types, useColor, useMicroApp, usePermission, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };
|
|
562
|
+
export { Permission, PermissionObjects, RouteMeta, Type, addView, appAppear, clearViews, closeWaitDlg, createAxios, _default as default, delView, eventBus, getTypeColor, getTypeDefault, globalObjects, hasView, injectActiveOrg, injectActiveOrgName, injectDark, injectLastAppPath, injectLocale, injectPermissionChecksum, injectPermissionObjects, injectViews, isEmpty, isExist, lastView, loadLocaleMessageEssential, matchRouteMeta, messageError, messageInfo, messageSuccess, messageWarning, onBeforeEach, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideActiveOrg, provideActiveOrgName, provideDark, provideLastAppPath, provideLocale, providePermissionChecksum, providePermissionObjects, provideViews, routeTransName, toPermissionObjects, types, useColor, useMicroApp, usePermission, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
(function(){try{document.getElementById(`x-essential-lib`)?.remove();const e = document.createElement(`style`);e.setAttribute(`id`, `x-essential-lib`);const t = document.createTextNode(`.fade-leave-active[data-v-x-essential-lib-c3545c8d]{transition:opacity .5s}.fade-leave-to[data-v-x-essential-lib-c3545c8d]{opacity:0}.x-cont[data-v-x-essential-lib-c3545c8d]{justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.lds-spinner[data-v-x-essential-lib-c3545c8d]{color:official;width:40px;height:40px;display:inline-block;position:relative}.lds-spinner div[data-v-x-essential-lib-c3545c8d]{transform-origin:20px 20px;animation:1.2s linear infinite lds-spinner-x-essential-lib-c3545c8d}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:after{content:" ";background:#9e9e9e;border-radius:5%;width:2px;height:6px;display:block;position:absolute;top:3px;left:18px}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:first-child{animation-delay:-1.1s;transform:rotate(0)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(2){animation-delay:-1s;transform:rotate(30deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(3){animation-delay:-.9s;transform:rotate(60deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(4){animation-delay:-.8s;transform:rotate(90deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(5){animation-delay:-.7s;transform:rotate(120deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(6){animation-delay:-.6s;transform:rotate(150deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(7){animation-delay:-.5s;transform:rotate(180deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(8){animation-delay:-.4s;transform:rotate(210deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(9){animation-delay:-.3s;transform:rotate(240deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(10){animation-delay:-.2s;transform:rotate(270deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(11){animation-delay:-.1s;transform:rotate(300deg)}.lds-spinner div[data-v-x-essential-lib-c3545c8d]:nth-child(12){animation-delay:0s;transform:rotate(330deg)}@keyframes lds-spinner-x-essential-lib-c3545c8d{0%{opacity:1}to{opacity:0}}.x-item[data-v-x-essential-lib-cfcda9d9]{width:600px}@media (width<=600px){.x-item[data-v-x-essential-lib-cfcda9d9]{width:calc(100vw - 16px)}}.x-cont[data-v-x-essential-lib-b973907d]{z-index:9999;position:fixed;bottom:20px;left:50%;transform:translate(-50%)}`);e.appendChild(t);document.head.appendChild(e);}catch(e){console.error('rolldown-plugin-inject-css', e);}})()
|
|
2
|
-
import { a as api, i as mitt_default, o as usePreferredDark, r as toLower } from "./vendor.
|
|
2
|
+
import { a as api, i as mitt_default, o as usePreferredDark, r as toLower } from "./vendor.bri8m5ch.js";
|
|
3
3
|
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, isRef, normalizeStyle, onBeforeMount, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, resolveComponent, toDisplayString, unref, useTemplateRef, watch, watchEffect, withCtx, withKeys, withModifiers } from "vue";
|
|
4
4
|
import { useI18n } from "vue-i18n";
|
|
5
5
|
import { useDisplay, useTheme } from "vuetify";
|
|
6
6
|
import { useRoute, useRouter } from "vue-router";
|
|
7
|
-
import axios from "axios";
|
|
8
7
|
import { getErrorMessage } from "x-error-lib";
|
|
9
8
|
import { createAxios as createAxios$1, messageError as messageError$1 } from "x-essential-lib";
|
|
9
|
+
import axios from "axios";
|
|
10
10
|
|
|
11
11
|
//#region src/composables/color.ts
|
|
12
12
|
function useColor() {
|
|
@@ -36,6 +36,25 @@ function useColor() {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/api/orgbase/instance.ts
|
|
41
|
+
const instance = createAxios$1({
|
|
42
|
+
baseUrl: "http://localhost/orgbase/",
|
|
43
|
+
onError: (error) => {
|
|
44
|
+
messageError$1(getErrorMessage(error));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
if (window.API_URL) instance.defaults.baseURL = window.API_URL + "/orgbase/";
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/api/orgbase/index.ts
|
|
51
|
+
function GetOrgName(request) {
|
|
52
|
+
return instance.post("getOrgName", request);
|
|
53
|
+
}
|
|
54
|
+
function PullPermission(request) {
|
|
55
|
+
return instance.post("pullPermission", request);
|
|
56
|
+
}
|
|
57
|
+
|
|
39
58
|
//#endregion
|
|
40
59
|
//#region src/utils/axios.ts
|
|
41
60
|
function createAxios(options) {
|
|
@@ -417,6 +436,12 @@ function provideActiveOrg(activeOrg) {
|
|
|
417
436
|
function injectActiveOrg() {
|
|
418
437
|
return inject("essentialActiveOrg");
|
|
419
438
|
}
|
|
439
|
+
function provideActiveOrgName(activeOrgName) {
|
|
440
|
+
provide("essentialActiveOrgName", activeOrgName);
|
|
441
|
+
}
|
|
442
|
+
function injectActiveOrgName() {
|
|
443
|
+
return inject("essentialActiveOrgName");
|
|
444
|
+
}
|
|
420
445
|
function providePermissionObjects(permissionObjects) {
|
|
421
446
|
provide("essentialPermissionObjects", permissionObjects);
|
|
422
447
|
}
|
|
@@ -442,22 +467,6 @@ function injectViews() {
|
|
|
442
467
|
return inject("viewsKey");
|
|
443
468
|
}
|
|
444
469
|
|
|
445
|
-
//#endregion
|
|
446
|
-
//#region src/api/orgbase/instance.ts
|
|
447
|
-
const instance = createAxios$1({
|
|
448
|
-
baseUrl: "http://localhost/orgbase/",
|
|
449
|
-
onError: (error) => {
|
|
450
|
-
messageError$1(getErrorMessage(error));
|
|
451
|
-
}
|
|
452
|
-
});
|
|
453
|
-
if (window.API_URL) instance.defaults.baseURL = window.API_URL + "/orgbase/";
|
|
454
|
-
|
|
455
|
-
//#endregion
|
|
456
|
-
//#region src/api/orgbase/index.ts
|
|
457
|
-
function PullPermission(request) {
|
|
458
|
-
return instance.post("pullPermission", request);
|
|
459
|
-
}
|
|
460
|
-
|
|
461
470
|
//#endregion
|
|
462
471
|
//#region src/utils/router.ts
|
|
463
472
|
const routeMetas = [
|
|
@@ -633,12 +642,20 @@ function onBeforeChange(toPath, fromPath, lastAppPath) {
|
|
|
633
642
|
function isHasAccessToken() {
|
|
634
643
|
return !!api.get("accessToken");
|
|
635
644
|
}
|
|
645
|
+
async function syncOrg(orgId) {
|
|
646
|
+
if (orgId !== "public") {
|
|
647
|
+
const { name } = await GetOrgName({ orgId });
|
|
648
|
+
eventBus.emit("updateActiveOrg", [orgId, name]);
|
|
649
|
+
} else eventBus.emit("updateActiveOrg", [orgId, ""]);
|
|
650
|
+
}
|
|
636
651
|
async function syncPermission(orgId) {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
652
|
+
if (orgId !== "public") {
|
|
653
|
+
const { permissions } = await PullPermission({
|
|
654
|
+
orgId,
|
|
655
|
+
checksum: ""
|
|
656
|
+
});
|
|
657
|
+
eventBus.emit("updatePermission", [toPermissionObjects(permissions), permissions["checksum"] ?? ""]);
|
|
658
|
+
} else eventBus.emit("updatePermission", [{}, ""]);
|
|
642
659
|
}
|
|
643
660
|
async function onBeforeEach(to, from, lastAppPath) {
|
|
644
661
|
const hasAccessToken = isHasAccessToken();
|
|
@@ -650,8 +667,8 @@ async function onBeforeEach(to, from, lastAppPath) {
|
|
|
650
667
|
if (to.path.startsWith("/passport/")) onBeforeChange(to.path, from.path, lastAppPath);
|
|
651
668
|
else if (to.path.startsWith("/main")) try {
|
|
652
669
|
if (!orgId) throw new Error(`orgId not specified`);
|
|
670
|
+
await syncOrg(orgId);
|
|
653
671
|
await syncPermission(orgId);
|
|
654
|
-
eventBus.emit("updateActiveOrg", orgId);
|
|
655
672
|
onBeforeChange(to.path, from.path, lastAppPath);
|
|
656
673
|
} catch {
|
|
657
674
|
return {
|
|
@@ -661,8 +678,8 @@ async function onBeforeEach(to, from, lastAppPath) {
|
|
|
661
678
|
}
|
|
662
679
|
else try {
|
|
663
680
|
if (!orgId) throw new Error(`orgId not specified`);
|
|
681
|
+
await syncOrg(orgId);
|
|
664
682
|
await syncPermission(orgId);
|
|
665
|
-
eventBus.emit("updateActiveOrg", orgId);
|
|
666
683
|
onBeforeChange(to.path, from.path, lastAppPath);
|
|
667
684
|
} catch {
|
|
668
685
|
return { path: `/main` };
|
|
@@ -731,10 +748,11 @@ function clearViews(views) {
|
|
|
731
748
|
|
|
732
749
|
//#endregion
|
|
733
750
|
//#region src/composables/microApp.ts
|
|
734
|
-
function useMicroApp(
|
|
751
|
+
function useMicroApp(globalStates, syncLocale, base, customBack) {
|
|
752
|
+
const { t } = useI18n();
|
|
735
753
|
const route = useRoute();
|
|
736
754
|
const router = useRouter();
|
|
737
|
-
const { dark, locale, activeOrg, permissionObjects, permissionChecksum, lastAppPath, views } =
|
|
755
|
+
const { dark, locale, activeOrg, activeOrgName, permissionObjects, permissionChecksum, lastAppPath, views } = globalStates;
|
|
738
756
|
const prefDark = usePreferredDark();
|
|
739
757
|
const finalDark = ref(false);
|
|
740
758
|
watchEffect(() => {
|
|
@@ -760,10 +778,63 @@ function useMicroApp(states, syncLocale, customBack) {
|
|
|
760
778
|
provideDark(finalDark);
|
|
761
779
|
provideLocale(locale);
|
|
762
780
|
provideActiveOrg(activeOrg);
|
|
781
|
+
provideActiveOrgName(activeOrgName);
|
|
763
782
|
providePermissionObjects(permissionObjects);
|
|
764
783
|
providePermissionChecksum(permissionChecksum);
|
|
765
784
|
provideLastAppPath(lastAppPath);
|
|
766
785
|
provideViews(views);
|
|
786
|
+
function extractPathFromUrl(url) {
|
|
787
|
+
return new URL(url).pathname;
|
|
788
|
+
}
|
|
789
|
+
function onBeforeAppChange(e) {
|
|
790
|
+
const lastAppPath = extractPathFromUrl(e.detail.oldUrl);
|
|
791
|
+
eventBus.emit("updateLastAppPath", lastAppPath);
|
|
792
|
+
}
|
|
793
|
+
if (base) {
|
|
794
|
+
onMounted(() => {
|
|
795
|
+
window.addEventListener("single-spa:before-app-change", onBeforeAppChange);
|
|
796
|
+
});
|
|
797
|
+
onBeforeUnmount(() => {
|
|
798
|
+
window.removeEventListener("single-spa:before-app-change", onBeforeAppChange);
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
function syncStatusBar() {
|
|
802
|
+
if (typeof StatusBar !== "object") return;
|
|
803
|
+
if (finalDark.value) StatusBar.styleLightContent();
|
|
804
|
+
else StatusBar.styleDefault();
|
|
805
|
+
}
|
|
806
|
+
const running = ref(true);
|
|
807
|
+
function onPause() {
|
|
808
|
+
running.value = false;
|
|
809
|
+
}
|
|
810
|
+
function onResume() {
|
|
811
|
+
running.value = true;
|
|
812
|
+
}
|
|
813
|
+
async function onBackButton() {
|
|
814
|
+
await handleBack();
|
|
815
|
+
}
|
|
816
|
+
function onDeviceReady() {
|
|
817
|
+
console.log("onDeviceReady");
|
|
818
|
+
document.addEventListener("pause", onPause, false);
|
|
819
|
+
document.addEventListener("resume", onResume, false);
|
|
820
|
+
document.addEventListener("backbutton", onBackButton, false);
|
|
821
|
+
setInterval(() => {
|
|
822
|
+
syncStatusBar();
|
|
823
|
+
}, 1e3);
|
|
824
|
+
navigator.splashscreen.hide();
|
|
825
|
+
}
|
|
826
|
+
if (base) {
|
|
827
|
+
onMounted(() => {
|
|
828
|
+
document.addEventListener("deviceready", onDeviceReady, false);
|
|
829
|
+
});
|
|
830
|
+
onBeforeUnmount(() => {
|
|
831
|
+
document.removeEventListener("deviceready", onDeviceReady, false);
|
|
832
|
+
});
|
|
833
|
+
watch(finalDark, (val) => {
|
|
834
|
+
window.dispatchEvent(new CustomEvent("darkChange", { detail: val }));
|
|
835
|
+
syncStatusBar();
|
|
836
|
+
}, { immediate: true });
|
|
837
|
+
}
|
|
767
838
|
async function handleBack() {
|
|
768
839
|
if (!isEmpty(views)) {
|
|
769
840
|
if (!hasView(views, "waitDlg")) popView(views);
|
|
@@ -781,25 +852,62 @@ function useMicroApp(states, syncLocale, customBack) {
|
|
|
781
852
|
return;
|
|
782
853
|
}
|
|
783
854
|
}
|
|
784
|
-
|
|
785
|
-
|
|
855
|
+
if (base) {
|
|
856
|
+
onMounted(() => {
|
|
857
|
+
window.addEventListener("keydown", onKeyDown);
|
|
858
|
+
});
|
|
859
|
+
onBeforeUnmount(() => {
|
|
860
|
+
window.removeEventListener("keydown", onKeyDown);
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
let handle;
|
|
864
|
+
async function syncPermission() {
|
|
865
|
+
if (!running.value) return;
|
|
866
|
+
if (!api.get("accessToken")) return;
|
|
867
|
+
try {
|
|
868
|
+
const { update, permissions } = await PullPermission({
|
|
869
|
+
orgId: activeOrg.value,
|
|
870
|
+
checksum: permissionChecksum.value
|
|
871
|
+
});
|
|
872
|
+
if (!update) return;
|
|
873
|
+
eventBus.emit("updatePermission", [toPermissionObjects(permissions), permissions["checksum"] ?? ""]);
|
|
874
|
+
} catch (e) {
|
|
875
|
+
console.error(e);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
async function startTimer() {
|
|
879
|
+
window.clearTimeout(handle);
|
|
880
|
+
handle = window.setTimeout(async () => {
|
|
881
|
+
await syncPermission();
|
|
882
|
+
if (handle) await startTimer();
|
|
883
|
+
}, 3e3);
|
|
884
|
+
}
|
|
885
|
+
function stopTimer() {
|
|
886
|
+
window.clearTimeout(handle);
|
|
887
|
+
handle = void 0;
|
|
888
|
+
}
|
|
889
|
+
if (base) {
|
|
890
|
+
onMounted(async () => {
|
|
891
|
+
await startTimer();
|
|
892
|
+
});
|
|
893
|
+
onBeforeUnmount(() => {
|
|
894
|
+
stopTimer();
|
|
895
|
+
});
|
|
786
896
|
}
|
|
787
|
-
onMounted(() => {
|
|
788
|
-
window.addEventListener("keydown", onKeyDown);
|
|
789
|
-
eventBus.on("backbutton", onBackButton);
|
|
790
|
-
});
|
|
791
|
-
onBeforeUnmount(() => {
|
|
792
|
-
window.removeEventListener("keydown", onKeyDown);
|
|
793
|
-
eventBus.off("backbutton", onBackButton);
|
|
794
|
-
});
|
|
795
897
|
function onUpdateDark(val) {
|
|
796
898
|
dark.value = val;
|
|
797
899
|
}
|
|
798
900
|
function onUpdateLocale(val) {
|
|
799
901
|
locale.value = val;
|
|
800
902
|
}
|
|
903
|
+
const activeOrgNameRaw = ref("");
|
|
904
|
+
watchEffect(() => {
|
|
905
|
+
if (activeOrg.value === "public") activeOrgName.value = t("x-essential-lib.publicDomain");
|
|
906
|
+
else activeOrgName.value = activeOrgNameRaw.value;
|
|
907
|
+
});
|
|
801
908
|
function onUpdateActiveOrg(val) {
|
|
802
|
-
activeOrg.value = val;
|
|
909
|
+
activeOrg.value = val[0];
|
|
910
|
+
activeOrgNameRaw.value = val[1];
|
|
803
911
|
}
|
|
804
912
|
function onUpdatePermission(val) {
|
|
805
913
|
permissionObjects.value = val[0];
|
|
@@ -808,13 +916,21 @@ function useMicroApp(states, syncLocale, customBack) {
|
|
|
808
916
|
function onUpdateLastAppPath(val) {
|
|
809
917
|
lastAppPath.value = val;
|
|
810
918
|
}
|
|
919
|
+
function onSyncGlobalStates() {
|
|
920
|
+
eventBus.emit("updateDark", dark.value);
|
|
921
|
+
eventBus.emit("updateLocale", locale.value);
|
|
922
|
+
eventBus.emit("updateActiveOrg", [activeOrg.value, activeOrgNameRaw.value]);
|
|
923
|
+
eventBus.emit("updatePermission", [permissionObjects.value, permissionChecksum.value]);
|
|
924
|
+
eventBus.emit("updateLastAppPath", lastAppPath.value);
|
|
925
|
+
}
|
|
811
926
|
onBeforeMount(() => {
|
|
812
927
|
eventBus.on("updateDark", onUpdateDark);
|
|
813
928
|
eventBus.on("updateLocale", onUpdateLocale);
|
|
814
929
|
eventBus.on("updateActiveOrg", onUpdateActiveOrg);
|
|
815
930
|
eventBus.on("updatePermission", onUpdatePermission);
|
|
816
931
|
eventBus.on("updateLastAppPath", onUpdateLastAppPath);
|
|
817
|
-
eventBus.
|
|
932
|
+
if (base) eventBus.on("syncGlobalStates", onSyncGlobalStates);
|
|
933
|
+
else eventBus.emit("syncGlobalStates");
|
|
818
934
|
});
|
|
819
935
|
onBeforeUnmount(() => {
|
|
820
936
|
eventBus.off("updateDark", onUpdateDark);
|
|
@@ -822,6 +938,7 @@ function useMicroApp(states, syncLocale, customBack) {
|
|
|
822
938
|
eventBus.off("updateActiveOrg", onUpdateActiveOrg);
|
|
823
939
|
eventBus.off("updatePermission", onUpdatePermission);
|
|
824
940
|
eventBus.off("updateLastAppPath", onUpdateLastAppPath);
|
|
941
|
+
if (base) eventBus.off("syncGlobalStates", onSyncGlobalStates);
|
|
825
942
|
});
|
|
826
943
|
}
|
|
827
944
|
|
|
@@ -1575,8 +1692,8 @@ const install = (app) => {
|
|
|
1575
1692
|
//#endregion
|
|
1576
1693
|
//#region src/i18n/index.ts
|
|
1577
1694
|
async function loadLocaleMessageEssential(locale) {
|
|
1578
|
-
if (locale === "en") return (await import("./i18n-en.
|
|
1579
|
-
else if (locale === "zhHans") return (await import("./i18n-zhHans.
|
|
1695
|
+
if (locale === "en") return (await import("./i18n-en.m7512rls.js").then((n) => n.t)).default;
|
|
1696
|
+
else if (locale === "zhHans") return (await import("./i18n-zhHans.nfr7wfgr.js").then((n) => n.t)).default;
|
|
1580
1697
|
else throw new Error(`invalid locale=${locale}`);
|
|
1581
1698
|
}
|
|
1582
1699
|
|
|
@@ -1585,4 +1702,4 @@ async function loadLocaleMessageEssential(locale) {
|
|
|
1585
1702
|
var src_default = { install };
|
|
1586
1703
|
|
|
1587
1704
|
//#endregion
|
|
1588
|
-
export { Permission, addView, appAppear, clearViews, closeWaitDlg, createAxios, src_default as default, delView, eventBus, getTypeColor, getTypeDefault, globalObjects, hasView, injectActiveOrg, injectDark, injectLastAppPath, injectLocale, injectPermissionChecksum, injectPermissionObjects, injectViews, isEmpty, isExist, lastView, loadLocaleMessageEssential, matchRouteMeta, messageError, messageInfo, messageSuccess, messageWarning, onBeforeEach, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideActiveOrg, provideDark, provideLastAppPath, provideLocale, providePermissionChecksum, providePermissionObjects, provideViews, routeTransName, toPermissionObjects, types, useColor, useMicroApp, usePermission, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };
|
|
1705
|
+
export { Permission, addView, appAppear, clearViews, closeWaitDlg, createAxios, src_default as default, delView, eventBus, getTypeColor, getTypeDefault, globalObjects, hasView, injectActiveOrg, injectActiveOrgName, injectDark, injectLastAppPath, injectLocale, injectPermissionChecksum, injectPermissionObjects, injectViews, isEmpty, isExist, lastView, loadLocaleMessageEssential, matchRouteMeta, messageError, messageInfo, messageSuccess, messageWarning, onBeforeEach, openConfirmDlg, openNumberDlg, openPromptDlg, openWaitDlg, popView, provideActiveOrg, provideActiveOrgName, provideDark, provideLastAppPath, provideLocale, providePermissionChecksum, providePermissionObjects, provideViews, routeTransName, toPermissionObjects, types, useColor, useMicroApp, usePermission, useSystem, useViewStack, verifyPermission, waitMs, waitUtil };
|
|
@@ -577,12 +577,12 @@ function toLower(value) {
|
|
|
577
577
|
//#endregion
|
|
578
578
|
//#region node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/index.d.ts
|
|
579
579
|
var EventType = [
|
|
580
|
-
|
|
580
|
+
67,
|
|
581
581
|
() => [],
|
|
582
582
|
[]
|
|
583
583
|
];
|
|
584
584
|
var Handler = [
|
|
585
|
-
|
|
585
|
+
68,
|
|
586
586
|
(T) => [T],
|
|
587
587
|
[
|
|
588
588
|
"",
|
|
@@ -591,7 +591,7 @@ var Handler = [
|
|
|
591
591
|
]
|
|
592
592
|
];
|
|
593
593
|
var WildcardHandler = [
|
|
594
|
-
|
|
594
|
+
69,
|
|
595
595
|
(T) => [
|
|
596
596
|
Record,
|
|
597
597
|
T,
|
|
@@ -609,7 +609,7 @@ var WildcardHandler = [
|
|
|
609
609
|
]
|
|
610
610
|
];
|
|
611
611
|
var EventHandlerList = [
|
|
612
|
-
|
|
612
|
+
70,
|
|
613
613
|
(T) => [
|
|
614
614
|
T,
|
|
615
615
|
Handler,
|
|
@@ -623,7 +623,7 @@ var EventHandlerList = [
|
|
|
623
623
|
]
|
|
624
624
|
];
|
|
625
625
|
var WildCardEventHandlerList = [
|
|
626
|
-
|
|
626
|
+
71,
|
|
627
627
|
(T) => [
|
|
628
628
|
Record,
|
|
629
629
|
T,
|
|
@@ -639,7 +639,7 @@ var WildCardEventHandlerList = [
|
|
|
639
639
|
]
|
|
640
640
|
];
|
|
641
641
|
var EventHandlerMap = [
|
|
642
|
-
|
|
642
|
+
72,
|
|
643
643
|
(Events) => [
|
|
644
644
|
EventType,
|
|
645
645
|
Record,
|
|
@@ -665,7 +665,7 @@ var EventHandlerMap = [
|
|
|
665
665
|
]
|
|
666
666
|
];
|
|
667
667
|
var Emitter = [
|
|
668
|
-
|
|
668
|
+
73,
|
|
669
669
|
(Key, Events) => [
|
|
670
670
|
EventType,
|
|
671
671
|
Record,
|