@duxweb/dvha-core 0.1.20 → 0.1.22
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/cjs/components/auth/can.cjs +1 -1
- package/dist/cjs/components/loader/iframe.cjs +1 -1
- package/dist/cjs/components/loader/loader.cjs +1 -0
- package/dist/cjs/components/loader/remote/loader.cjs +1 -0
- package/dist/cjs/components/loader/remote/render.cjs +1 -0
- package/dist/cjs/components/overlay/overlay.cjs +1 -1
- package/dist/cjs/components/status/error.cjs +1 -1
- package/dist/cjs/components/status/exception.cjs +1 -0
- package/dist/cjs/components/status/notAuthorized.cjs +1 -1
- package/dist/cjs/components/status/notFound.cjs +1 -1
- package/dist/cjs/directive/permission.cjs +1 -1
- package/dist/cjs/hooks/auth.cjs +1 -1
- package/dist/cjs/hooks/data.cjs +1 -1
- package/dist/cjs/hooks/export.cjs +1 -1
- package/dist/cjs/hooks/form.cjs +1 -1
- package/dist/cjs/hooks/formExtend.cjs +1 -0
- package/dist/cjs/hooks/formValidate.cjs +1 -0
- package/dist/cjs/hooks/i18n.cjs +1 -1
- package/dist/cjs/hooks/importCsv.cjs +1 -1
- package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -1
- package/dist/cjs/hooks/json.cjs +1 -1
- package/dist/cjs/hooks/list.cjs +1 -0
- package/dist/cjs/hooks/manage.cjs +1 -1
- package/dist/cjs/hooks/menu.cjs +1 -1
- package/dist/cjs/hooks/overlay.cjs +1 -1
- package/dist/cjs/hooks/select.cjs +1 -1
- package/dist/cjs/hooks/theme.cjs +2 -2
- package/dist/cjs/hooks/upload.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/main.cjs +1 -1
- package/dist/cjs/preset/dataProvider.cjs +1 -1
- package/dist/cjs/preset/i18nProvider.cjs +1 -1
- package/dist/cjs/provider/app.cjs +1 -1
- package/dist/cjs/provider/tab.cjs +1 -1
- package/dist/cjs/stores/manage.cjs +1 -1
- package/dist/cjs/stores/tab.cjs +1 -1
- package/dist/cjs/stores/theme.cjs +1 -1
- package/dist/cjs/utils/theme.cjs +9 -1
- package/dist/esm/components/auth/can.js +9 -7
- package/dist/esm/components/loader/loader.js +48 -0
- package/dist/esm/components/loader/remote/loader.js +150 -0
- package/dist/esm/components/loader/remote/render.js +19 -0
- package/dist/esm/components/overlay/overlay.js +22 -31
- package/dist/esm/components/status/error.js +3 -3
- package/dist/esm/components/status/exception.js +23 -0
- package/dist/esm/components/status/notAuthorized.js +2 -2
- package/dist/esm/components/status/notFound.js +4 -4
- package/dist/esm/directive/permission.js +5 -3
- package/dist/esm/hooks/auth.js +67 -67
- package/dist/esm/hooks/data.js +164 -160
- package/dist/esm/hooks/export.js +26 -23
- package/dist/esm/hooks/form.js +38 -35
- package/dist/esm/hooks/formExtend.js +38 -0
- package/dist/esm/hooks/formValidate.js +28 -0
- package/dist/esm/hooks/i18n.js +16 -8
- package/dist/esm/hooks/json/utils/expressionParser.js +1 -1
- package/dist/esm/hooks/json.js +57 -57
- package/dist/esm/hooks/list.js +179 -0
- package/dist/esm/hooks/manage.js +18 -13
- package/dist/esm/hooks/overlay.js +6 -4
- package/dist/esm/hooks/theme.js +11 -11
- package/dist/esm/index.js +129 -113
- package/dist/esm/main.js +22 -12
- package/dist/esm/preset/i18nProvider.js +17 -18
- package/dist/esm/provider/app.js +61 -53
- package/dist/esm/provider/tab.js +1 -1
- package/dist/esm/stores/manage.js +34 -24
- package/dist/esm/stores/tab.js +58 -49
- package/dist/esm/stores/theme.js +36 -34
- package/dist/esm/utils/theme.js +89 -76
- package/dist/types/components/index.d.ts +2 -1
- package/dist/types/components/loader/loader.d.ts +2 -0
- package/dist/types/components/loader/remote/index.d.ts +2 -0
- package/dist/types/components/loader/remote/loader.d.ts +1 -0
- package/dist/types/components/loader/remote/render.d.ts +1 -0
- package/dist/types/components/status/error.d.ts +1 -2
- package/dist/types/components/status/exception.d.ts +3 -0
- package/dist/types/components/status/index.d.ts +4 -0
- package/dist/types/components/status/notAuthorized.d.ts +1 -2
- package/dist/types/components/status/notFound.d.ts +1 -2
- package/dist/types/config/index.d.ts +1 -0
- package/dist/types/hooks/auth.d.ts +6 -6
- package/dist/types/hooks/data.d.ts +216 -216
- package/dist/types/hooks/form.d.ts +6 -3
- package/dist/types/hooks/formExtend.d.ts +12 -0
- package/dist/types/hooks/formValidate.d.ts +14 -0
- package/dist/types/hooks/i18n.d.ts +2 -0
- package/dist/types/hooks/import.d.ts +1 -2
- package/dist/types/hooks/index.d.ts +4 -1
- package/dist/types/hooks/json.d.ts +1 -1
- package/dist/types/hooks/list.d.ts +66 -0
- package/dist/types/hooks/manage.d.ts +1 -0
- package/dist/types/hooks/menu.d.ts +1 -1
- package/dist/types/hooks/overlay.d.ts +1 -1
- package/dist/types/hooks/theme.d.ts +8 -8
- package/dist/types/index.d.ts +6 -5
- package/dist/types/preset/i18nProvider.d.ts +1 -1
- package/dist/types/stores/auth.d.ts +9 -24
- package/dist/types/stores/i18n.d.ts +7 -16
- package/dist/types/stores/index.d.ts +2 -2
- package/dist/types/stores/manage.d.ts +7 -16
- package/dist/types/stores/route.d.ts +12 -2538
- package/dist/types/stores/tab.d.ts +6 -1030
- package/dist/types/stores/theme.d.ts +14 -96
- package/dist/types/types/config.d.ts +9 -0
- package/dist/types/types/i18n.d.ts +1 -0
- package/dist/types/types/manage.d.ts +6 -0
- package/dist/types/types/theme.d.ts +2 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/theme.d.ts +4 -49
- package/package.json +22 -15
- package/dist/cjs/node_modules/jsep/dist/jsep.cjs +0 -2
- package/dist/esm/node_modules/jsep/dist/jsep.js +0 -737
- /package/dist/cjs/{hooks/themeColor.cjs → config/color.cjs} +0 -0
- /package/dist/esm/{hooks/themeColor.js → config/color.js} +0 -0
- /package/dist/types/{hooks/themeColor.d.ts → config/color.d.ts} +0 -0
package/dist/esm/index.js
CHANGED
|
@@ -1,118 +1,134 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import { arrayToTree as ke, searchTree as Ge, treeToArr as Je } from "./utils/tree.js";
|
|
35
|
-
import { themePreset as je } from "./utils/theme.js";
|
|
36
|
-
import { DuxAppProvider as ze } from "./provider/app.js";
|
|
37
|
-
import { DuxTabRouterView as He } from "./provider/tab.js";
|
|
1
|
+
import { DuxCan as o } from "./components/auth/can.js";
|
|
2
|
+
import { DuxLogo as p } from "./components/common/logo.js";
|
|
3
|
+
import { DuxLogoIcon as x } from "./components/common/icon.js";
|
|
4
|
+
import { default as s } from "./components/loader/iframe.js";
|
|
5
|
+
import { DuxOverlay as a } from "./components/overlay/overlay.js";
|
|
6
|
+
import { DuxError as i } from "./components/status/error.js";
|
|
7
|
+
import { DuxException as l } from "./components/status/exception.js";
|
|
8
|
+
import { DuxNotAuthorized as D } from "./components/status/notAuthorized.js";
|
|
9
|
+
import { DuxNotFound as h } from "./components/status/notFound.js";
|
|
10
|
+
import { themeColor as c } from "./config/color.js";
|
|
11
|
+
import { useCan as g, useCheck as I, useError as L, useForgotPassword as T, useGetAuth as M, useIsLogin as y, useLogin as E, useLogout as F, useRegister as P, useUpdatePassword as U } from "./hooks/auth.js";
|
|
12
|
+
import { useConfig as O } from "./hooks/config.js";
|
|
13
|
+
import { useClient as b, useCreate as V, useCreateMany as N, useCustom as k, useCustomMutation as z, useDelete as G, useDeleteMany as J, useInfiniteList as j, useInvalidate as q, useList as B, useMany as H, useOne as K, useUpdate as Q, useUpdateMany as W } from "./hooks/data.js";
|
|
14
|
+
import { useExport as Y } from "./hooks/export.js";
|
|
15
|
+
import { useExportCsv as _ } from "./hooks/exportCsv.js";
|
|
16
|
+
import { useForm as ee } from "./hooks/form.js";
|
|
17
|
+
import { useExtendForm as oe } from "./hooks/formExtend.js";
|
|
18
|
+
import { initFormValidate as pe, useValidateForm as ue } from "./hooks/formValidate.js";
|
|
19
|
+
import { useI18n as me } from "./hooks/i18n.js";
|
|
20
|
+
import { useImport as fe } from "./hooks/import.js";
|
|
21
|
+
import { useImportCsv as de } from "./hooks/importCsv.js";
|
|
22
|
+
import { useJsonSchema as ne } from "./hooks/json.js";
|
|
23
|
+
import { defaultAdaptors as ve } from "./hooks/json/index.js";
|
|
24
|
+
import { useExtendList as Ae } from "./hooks/list.js";
|
|
25
|
+
import { useManage as Ce } from "./hooks/manage.js";
|
|
26
|
+
import { useMenu as Se } from "./hooks/menu.js";
|
|
27
|
+
import { useOverlay as Ie } from "./hooks/overlay.js";
|
|
28
|
+
import { useSelect as Te } from "./hooks/select.js";
|
|
29
|
+
import { useTheme as ye } from "./hooks/theme.js";
|
|
30
|
+
import { useUpload as Fe } from "./hooks/upload.js";
|
|
31
|
+
import { createLocalUploadDriver as Ue } from "./hooks/upload/local.js";
|
|
32
|
+
import { createS3UploadDriver as Oe } from "./hooks/upload/s3.js";
|
|
33
|
+
import { createDux as be } from "./main.js";
|
|
38
34
|
import { simpleAuthProvider as Ne } from "./preset/authProvider.js";
|
|
39
|
-
import { simpleDataProvider as
|
|
40
|
-
import { i18nProvider as
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
35
|
+
import { simpleDataProvider as ze } from "./preset/dataProvider.js";
|
|
36
|
+
import { i18nProvider as Je } from "./preset/i18nProvider.js";
|
|
37
|
+
import { DuxAppProvider as qe } from "./provider/app.js";
|
|
38
|
+
import { DuxTabRouterView as He } from "./provider/tab.js";
|
|
39
|
+
import { initRouter as Qe } from "./router/route.js";
|
|
40
|
+
import { useAuthStore as Xe } from "./stores/auth.js";
|
|
41
|
+
import { useI18nStore as Ze } from "./stores/i18n.js";
|
|
42
|
+
import { useManageStore as $e } from "./stores/manage.js";
|
|
43
|
+
import { useRouteStore as rr } from "./stores/route.js";
|
|
44
|
+
import { createTabStore as tr, useTabStore as pr } from "./stores/tab.js";
|
|
45
|
+
import { useThemeStore as xr } from "./stores/theme.js";
|
|
46
|
+
import { themePreset as sr } from "./utils/theme.js";
|
|
47
|
+
import { arrayToTree as ar, searchTree as dr, treeToArr as ir } from "./utils/tree.js";
|
|
48
|
+
import { vForAdaptor as lr } from "./hooks/json/vFor.js";
|
|
49
|
+
import { vIfAdaptor as Dr } from "./hooks/json/vIf.js";
|
|
50
|
+
import { vModelAdaptor as hr } from "./hooks/json/vModel.js";
|
|
51
|
+
import { vOnAdaptor as cr } from "./hooks/json/vOn.js";
|
|
52
|
+
import { vShowAdaptor as gr } from "./hooks/json/vShow.js";
|
|
53
|
+
import { vTextAdaptor as Lr } from "./hooks/json/vText.js";
|
|
47
54
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
qe as DuxAppProvider,
|
|
56
|
+
o as DuxCan,
|
|
57
|
+
i as DuxError,
|
|
58
|
+
l as DuxException,
|
|
59
|
+
s as DuxLoaderIframe,
|
|
60
|
+
p as DuxLogo,
|
|
61
|
+
x as DuxLogoIcon,
|
|
62
|
+
D as DuxNotAuthorized,
|
|
63
|
+
h as DuxNotFound,
|
|
64
|
+
a as DuxOverlay,
|
|
54
65
|
He as DuxTabRouterView,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
ar as arrayToTree,
|
|
67
|
+
be as createDux,
|
|
68
|
+
Ue as createLocalUploadDriver,
|
|
69
|
+
Oe as createS3UploadDriver,
|
|
70
|
+
tr as createTabStore,
|
|
71
|
+
ve as defaultAdaptors,
|
|
72
|
+
Je as i18nProvider,
|
|
73
|
+
pe as initFormValidate,
|
|
74
|
+
Qe as initRouter,
|
|
75
|
+
dr as searchTree,
|
|
63
76
|
Ne as simpleAuthProvider,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
77
|
+
ze as simpleDataProvider,
|
|
78
|
+
c as themeColor,
|
|
79
|
+
sr as themePreset,
|
|
80
|
+
ir as treeToArr,
|
|
81
|
+
Xe as useAuthStore,
|
|
82
|
+
g as useCan,
|
|
83
|
+
I as useCheck,
|
|
84
|
+
b as useClient,
|
|
85
|
+
O as useConfig,
|
|
86
|
+
V as useCreate,
|
|
87
|
+
N as useCreateMany,
|
|
88
|
+
k as useCustom,
|
|
89
|
+
z as useCustomMutation,
|
|
90
|
+
G as useDelete,
|
|
91
|
+
J as useDeleteMany,
|
|
92
|
+
L as useError,
|
|
93
|
+
Y as useExport,
|
|
94
|
+
_ as useExportCsv,
|
|
95
|
+
oe as useExtendForm,
|
|
96
|
+
Ae as useExtendList,
|
|
97
|
+
T as useForgotPassword,
|
|
98
|
+
ee as useForm,
|
|
99
|
+
M as useGetAuth,
|
|
100
|
+
me as useI18n,
|
|
101
|
+
Ze as useI18nStore,
|
|
102
|
+
fe as useImport,
|
|
103
|
+
de as useImportCsv,
|
|
104
|
+
j as useInfiniteList,
|
|
105
|
+
q as useInvalidate,
|
|
106
|
+
y as useIsLogin,
|
|
107
|
+
ne as useJsonSchema,
|
|
108
|
+
B as useList,
|
|
109
|
+
E as useLogin,
|
|
110
|
+
F as useLogout,
|
|
111
|
+
Ce as useManage,
|
|
112
|
+
$e as useManageStore,
|
|
113
|
+
H as useMany,
|
|
114
|
+
Se as useMenu,
|
|
115
|
+
K as useOne,
|
|
116
|
+
Ie as useOverlay,
|
|
117
|
+
P as useRegister,
|
|
118
|
+
rr as useRouteStore,
|
|
119
|
+
Te as useSelect,
|
|
120
|
+
pr as useTabStore,
|
|
121
|
+
ye as useTheme,
|
|
122
|
+
xr as useThemeStore,
|
|
123
|
+
Q as useUpdate,
|
|
124
|
+
W as useUpdateMany,
|
|
125
|
+
U as useUpdatePassword,
|
|
126
|
+
Fe as useUpload,
|
|
127
|
+
ue as useValidateForm,
|
|
128
|
+
lr as vForAdaptor,
|
|
129
|
+
Dr as vIfAdaptor,
|
|
130
|
+
hr as vModelAdaptor,
|
|
131
|
+
cr as vOnAdaptor,
|
|
132
|
+
gr as vShowAdaptor,
|
|
133
|
+
Lr as vTextAdaptor
|
|
118
134
|
};
|
package/dist/esm/main.js
CHANGED
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
import { VueQueryPlugin as
|
|
2
|
-
import { createPinia as
|
|
3
|
-
import
|
|
4
|
-
import { ref as
|
|
5
|
-
import { permissionDirective as
|
|
1
|
+
import { VueQueryPlugin as e } from "@tanstack/vue-query";
|
|
2
|
+
import { createPinia as m } from "pinia";
|
|
3
|
+
import n from "pinia-plugin-persistedstate";
|
|
4
|
+
import { ref as u } from "vue";
|
|
5
|
+
import { permissionDirective as p } from "./directive/permission.js";
|
|
6
|
+
import "vue-router";
|
|
7
|
+
import "lodash-es";
|
|
8
|
+
import "json-2-csv";
|
|
9
|
+
import { initFormValidate as d } from "./hooks/formValidate.js";
|
|
10
|
+
import "@vueuse/core";
|
|
11
|
+
import "./hooks/json/index.js";
|
|
12
|
+
import "@overlastic/vue";
|
|
13
|
+
import "clsx";
|
|
14
|
+
import "colorizr";
|
|
15
|
+
import "axios";
|
|
6
16
|
import { initRouter as a } from "./router/route.js";
|
|
7
|
-
function
|
|
8
|
-
const o =
|
|
9
|
-
return o.use(
|
|
17
|
+
function h(i) {
|
|
18
|
+
const o = m();
|
|
19
|
+
return o.use(n), {
|
|
10
20
|
install(r) {
|
|
11
21
|
console.log(
|
|
12
22
|
"%c dux-vue %c dux.cn %c",
|
|
13
23
|
"background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff",
|
|
14
24
|
"background:#41b883 ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff",
|
|
15
25
|
"background:transparent"
|
|
16
|
-
);
|
|
17
|
-
const
|
|
18
|
-
r.provide("dux.config",
|
|
26
|
+
), d();
|
|
27
|
+
const t = u();
|
|
28
|
+
r.provide("dux.config", i), r.provide("dux.manage", t), r.directive("can", p), r.use(o), r.use(e), r.use(a(i));
|
|
19
29
|
}
|
|
20
30
|
};
|
|
21
31
|
}
|
|
22
32
|
export {
|
|
23
|
-
|
|
33
|
+
h as createDux
|
|
24
34
|
};
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { createI18n as o } from "
|
|
2
|
-
function i(
|
|
3
|
-
const
|
|
1
|
+
import { createI18n as o } from "vue-i18n";
|
|
2
|
+
function i(l) {
|
|
3
|
+
const n = o({
|
|
4
4
|
legacy: !1,
|
|
5
|
-
locale:
|
|
6
|
-
fallbackLocale:
|
|
7
|
-
messages:
|
|
5
|
+
locale: l == null ? void 0 : l.locale,
|
|
6
|
+
fallbackLocale: l == null ? void 0 : l.fallbackLocale,
|
|
7
|
+
messages: l == null ? void 0 : l.messages,
|
|
8
8
|
missingWarn: !1,
|
|
9
9
|
fallbackWarn: !1
|
|
10
10
|
});
|
|
11
11
|
return {
|
|
12
|
-
t: (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return t === l && a ? a : t;
|
|
16
|
-
} catch {
|
|
17
|
-
return a || l;
|
|
18
|
-
}
|
|
12
|
+
t: (e, a, c) => {
|
|
13
|
+
const t = n.global.t(e, a);
|
|
14
|
+
return t === e && c ? c : t;
|
|
19
15
|
},
|
|
20
|
-
changeLocale: (
|
|
21
|
-
|
|
16
|
+
changeLocale: (e, a) => new Promise((c) => {
|
|
17
|
+
n.global.locale.value = e, c(e);
|
|
22
18
|
}),
|
|
23
|
-
loadLocale: (
|
|
24
|
-
|
|
19
|
+
loadLocale: (e, a) => new Promise((c) => {
|
|
20
|
+
n.global.setLocaleMessage(e, a), c(e);
|
|
25
21
|
}),
|
|
26
|
-
|
|
22
|
+
mergeLocale: (e, a) => {
|
|
23
|
+
n.global.mergeLocaleMessage(e, a);
|
|
24
|
+
},
|
|
25
|
+
getLocale: () => n.global.locale.value
|
|
27
26
|
};
|
|
28
27
|
}
|
|
29
28
|
export {
|
package/dist/esm/provider/app.js
CHANGED
|
@@ -1,63 +1,68 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { OverlaysProvider as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { useCan as
|
|
5
|
-
import { useConfig as
|
|
1
|
+
import { defineComponent as V, inject as q, createVNode as B } from "vue";
|
|
2
|
+
import { OverlaysProvider as G } from "@overlastic/vue";
|
|
3
|
+
import { useRouter as H } from "vue-router";
|
|
4
|
+
import { useCan as J } from "../hooks/auth.js";
|
|
5
|
+
import { useConfig as K } from "../hooks/config.js";
|
|
6
6
|
import "@tanstack/vue-query";
|
|
7
|
-
import { useManage as
|
|
7
|
+
import { useManage as Q } from "../hooks/manage.js";
|
|
8
8
|
import "json-2-csv";
|
|
9
9
|
import "lodash-es";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import "
|
|
13
|
-
import { useManageStore as T } from "../stores/manage.js";
|
|
10
|
+
import "@vee-validate/rules";
|
|
11
|
+
import "vee-validate";
|
|
12
|
+
import { useAuthStore as T } from "../stores/auth.js";
|
|
14
13
|
import { useI18nStore as W } from "../stores/i18n.js";
|
|
14
|
+
import { useManageStore as X } from "../stores/manage.js";
|
|
15
|
+
import { useRouteStore as Y } from "../stores/route.js";
|
|
16
|
+
import "pinia";
|
|
15
17
|
import "@vueuse/core";
|
|
16
18
|
import "../hooks/json/index.js";
|
|
17
|
-
import "clsx";
|
|
18
19
|
import "colorizr";
|
|
19
20
|
import "axios";
|
|
20
|
-
|
|
21
|
+
import "clsx";
|
|
22
|
+
import { DuxError as Z } from "../components/status/error.js";
|
|
23
|
+
import { DuxNotAuthorized as x } from "../components/status/notAuthorized.js";
|
|
24
|
+
import { DuxNotFound as ee } from "../components/status/notFound.js";
|
|
25
|
+
const De = /* @__PURE__ */ V({
|
|
21
26
|
name: "DuxAppProvider",
|
|
22
27
|
props: {},
|
|
23
|
-
setup(
|
|
24
|
-
slots:
|
|
28
|
+
setup(te, {
|
|
29
|
+
slots: c
|
|
25
30
|
}) {
|
|
26
|
-
const f =
|
|
27
|
-
return s.beforeEach(async (
|
|
28
|
-
var P,
|
|
29
|
-
const t =
|
|
31
|
+
const f = q("dux.manage"), u = K(), s = H();
|
|
32
|
+
return s.beforeEach(async (a, oe, n) => {
|
|
33
|
+
var P, b, R, A, S, $, k, M, z, D, w, I, N, C;
|
|
34
|
+
const t = a.meta.manageName, O = a.meta.authorization === !1;
|
|
30
35
|
if (!t) {
|
|
31
|
-
const e =
|
|
36
|
+
const e = u.defaultManage || ((b = (P = u.manages) == null ? void 0 : P[0]) == null ? void 0 : b.name) || "";
|
|
32
37
|
return n({
|
|
33
38
|
path: `/${e}`,
|
|
34
39
|
replace: !0
|
|
35
40
|
});
|
|
36
41
|
}
|
|
37
42
|
f && (f.value = t);
|
|
38
|
-
const h =
|
|
39
|
-
h.isInit() || h.setConfig((
|
|
40
|
-
const i =
|
|
41
|
-
if ((A =
|
|
43
|
+
const h = X(t);
|
|
44
|
+
h.isInit() || h.setConfig((R = u.manages) == null ? void 0 : R.find((e) => e.name === t), u);
|
|
45
|
+
const i = Y(t), r = Q(t), d = T(t), l = W(t);
|
|
46
|
+
if ((A = r.config) != null && A.i18nProvider && !l.isInit()) {
|
|
42
47
|
const e = l.getLocale();
|
|
43
|
-
e && ((S =
|
|
48
|
+
e && ((S = r.config) == null || S.i18nProvider.changeLocale(e));
|
|
44
49
|
}
|
|
45
50
|
if (!d.isLogin())
|
|
46
|
-
return
|
|
47
|
-
path:
|
|
51
|
+
return O ? n() : n({
|
|
52
|
+
path: r.getRoutePath("login"),
|
|
48
53
|
replace: !0
|
|
49
54
|
});
|
|
50
55
|
const g = (e) => e == null ? void 0 : e.map((p) => ({
|
|
51
56
|
...p,
|
|
52
|
-
path: p.path ?
|
|
57
|
+
path: p.path ? r.getRoutePath(p.path) : void 0
|
|
53
58
|
}));
|
|
54
59
|
if (!i.getRouteInit()) {
|
|
55
|
-
const e = (($ =
|
|
60
|
+
const e = (($ = r.config) == null ? void 0 : $.components) || {}, p = [];
|
|
56
61
|
if (p.push({
|
|
57
62
|
name: `${t}.notFound`,
|
|
58
63
|
label: "404",
|
|
59
64
|
path: ":pathMatch(.*)*",
|
|
60
|
-
component: e.notFound ||
|
|
65
|
+
component: e.notFound || ee,
|
|
61
66
|
hidden: !0,
|
|
62
67
|
meta: {
|
|
63
68
|
can: !1
|
|
@@ -66,7 +71,7 @@ const ve = /* @__PURE__ */ O({
|
|
|
66
71
|
name: `${t}.notAuthorized`,
|
|
67
72
|
label: "403",
|
|
68
73
|
path: "notAuthorized",
|
|
69
|
-
component: e.notAuthorized ||
|
|
74
|
+
component: e.notAuthorized || x,
|
|
70
75
|
hidden: !0,
|
|
71
76
|
meta: {
|
|
72
77
|
can: !1
|
|
@@ -75,76 +80,79 @@ const ve = /* @__PURE__ */ O({
|
|
|
75
80
|
name: `${t}.error`,
|
|
76
81
|
label: "500",
|
|
77
82
|
path: "error",
|
|
78
|
-
component: e.error ||
|
|
83
|
+
component: e.error || Z,
|
|
79
84
|
hidden: !0,
|
|
80
85
|
meta: {
|
|
81
86
|
can: !1
|
|
82
87
|
}
|
|
83
|
-
}), i.setRoutes(g(((
|
|
88
|
+
}), i.setRoutes(g(((k = r.config) == null ? void 0 : k.menus) || [])), (M = r.config) != null && M.apiRoutePath)
|
|
84
89
|
try {
|
|
85
|
-
await ((
|
|
86
|
-
path:
|
|
90
|
+
await ((w = (D = (z = r.config) == null ? void 0 : z.dataProvider) == null ? void 0 : D.default) == null ? void 0 : w.custom({
|
|
91
|
+
path: r.config.apiRoutePath,
|
|
87
92
|
meta: {
|
|
88
93
|
timeout: 5e3
|
|
89
94
|
}
|
|
90
|
-
},
|
|
95
|
+
}, r, d.getUser()).then((o) => {
|
|
91
96
|
i.appendRoutes(g(o.data || []));
|
|
92
97
|
}));
|
|
93
98
|
} catch (o) {
|
|
94
99
|
console.error(o);
|
|
95
100
|
}
|
|
96
101
|
return i.appendRoutes(p), i.getRoutes().forEach((o) => {
|
|
97
|
-
var E, F;
|
|
102
|
+
var E, F, y, L;
|
|
98
103
|
if (!o.path)
|
|
99
104
|
return;
|
|
100
|
-
const
|
|
105
|
+
const m = {
|
|
101
106
|
name: o.name,
|
|
102
107
|
path: o.path,
|
|
103
108
|
meta: o.meta
|
|
104
109
|
};
|
|
105
110
|
switch (o.loader) {
|
|
106
111
|
case "iframe":
|
|
107
|
-
|
|
112
|
+
m.component = ((F = (E = r.config) == null ? void 0 : E.components) == null ? void 0 : F.iframe) || (() => import("../components/loader/iframe.js"));
|
|
113
|
+
break;
|
|
114
|
+
case "remote":
|
|
115
|
+
m.component = ((L = (y = r.config) == null ? void 0 : y.components) == null ? void 0 : L.remote) || (() => import("../components/loader/loader.js"));
|
|
108
116
|
break;
|
|
109
117
|
case "link":
|
|
110
|
-
|
|
111
|
-
var
|
|
112
|
-
const
|
|
113
|
-
return
|
|
114
|
-
},
|
|
118
|
+
m.beforeEnter = () => {
|
|
119
|
+
var j;
|
|
120
|
+
const _ = ((j = o.meta) == null ? void 0 : j.url) || o.path;
|
|
121
|
+
return _ && window.open(_, "_blank"), !1;
|
|
122
|
+
}, m.component = () => Promise.resolve({
|
|
115
123
|
template: "<div></div>"
|
|
116
124
|
});
|
|
117
125
|
break;
|
|
118
126
|
default:
|
|
119
|
-
o.component && (
|
|
127
|
+
o.component && (m.component = o.component);
|
|
120
128
|
break;
|
|
121
129
|
}
|
|
122
|
-
s.addRoute(`${t}.auth`,
|
|
130
|
+
s.addRoute(`${t}.auth`, m);
|
|
123
131
|
}), n({
|
|
124
|
-
path: ((
|
|
132
|
+
path: ((I = a.redirectedFrom) == null ? void 0 : I.path) || a.path,
|
|
125
133
|
replace: !0
|
|
126
134
|
});
|
|
127
135
|
}
|
|
128
136
|
const v = ["", "/", `/${t}`, `/${t}/`];
|
|
129
|
-
if (v.includes(
|
|
137
|
+
if (v.includes(a.path)) {
|
|
130
138
|
const e = i.getIndexRoute();
|
|
131
139
|
return !(e != null && e.path) || v.includes(e == null ? void 0 : e.path) ? (console.warn("[Dux] index route not found, skip redirect"), n()) : n({
|
|
132
140
|
path: (e == null ? void 0 : e.path) || "/",
|
|
133
141
|
replace: !0
|
|
134
142
|
});
|
|
135
143
|
}
|
|
136
|
-
const
|
|
137
|
-
return (((
|
|
144
|
+
const U = J(t);
|
|
145
|
+
return (((N = a.meta) == null ? void 0 : N.can) === void 0 || ((C = a.meta) == null ? void 0 : C.can) === !0) && !U(a.name) ? n({
|
|
138
146
|
name: `${t}.notAuthorized`
|
|
139
147
|
}) : n();
|
|
140
|
-
}), () =>
|
|
148
|
+
}), () => B(G, null, {
|
|
141
149
|
default: () => {
|
|
142
|
-
var
|
|
143
|
-
return [(
|
|
150
|
+
var a;
|
|
151
|
+
return [(a = c.default) == null ? void 0 : a.call(c)];
|
|
144
152
|
}
|
|
145
153
|
});
|
|
146
154
|
}
|
|
147
155
|
});
|
|
148
156
|
export {
|
|
149
|
-
|
|
157
|
+
De as DuxAppProvider
|
|
150
158
|
};
|
package/dist/esm/provider/tab.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as c, watch as d, createVNode as m, Transition as l, KeepAlive as f } from "vue";
|
|
2
2
|
import { useRoute as b, RouterView as h } from "vue-router";
|
|
3
3
|
import "pinia";
|
|
4
|
+
import "lodash-es";
|
|
4
5
|
import { useRouteStore as R } from "../stores/route.js";
|
|
5
6
|
import { useTabStore as w } from "../stores/tab.js";
|
|
6
|
-
import "lodash-es";
|
|
7
7
|
const k = /* @__PURE__ */ c({
|
|
8
8
|
name: "DuxTabRouterView",
|
|
9
9
|
props: {},
|