@duxweb/dvha-core 1.1.30 → 1.2.0
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/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/cjs/components/auth/can.cjs +1 -1
- package/dist/cjs/components/auth/index.cjs +1 -0
- package/dist/cjs/components/common/icon.cjs +1 -1
- package/dist/cjs/components/common/index.cjs +1 -0
- package/dist/cjs/components/common/logo.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -0
- package/dist/cjs/components/loader/iframe.cjs +1 -1
- package/dist/cjs/components/loader/index.cjs +1 -0
- package/dist/cjs/components/loader/loader.cjs +1 -1
- package/dist/cjs/components/loader/remote/index.cjs +1 -0
- package/dist/cjs/components/loader/remote/loader.cjs +1 -1
- package/dist/cjs/components/loader/remote/render.cjs +1 -1
- package/dist/cjs/components/overlay/index.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 -1
- package/dist/cjs/components/status/index.cjs +1 -0
- package/dist/cjs/components/status/notAuthorized.cjs +1 -1
- package/dist/cjs/components/status/notFound.cjs +1 -1
- package/dist/cjs/config/color.cjs +1 -1
- package/dist/cjs/directive/index.cjs +1 -0
- package/dist/cjs/directive/permission.cjs +1 -1
- package/dist/cjs/hooks/auth.cjs +1 -1
- package/dist/cjs/hooks/config.cjs +1 -1
- package/dist/cjs/hooks/data.cjs +1 -1
- package/dist/cjs/hooks/export.cjs +1 -1
- package/dist/cjs/hooks/exportCsv.cjs +2 -2
- package/dist/cjs/hooks/form.cjs +1 -1
- package/dist/cjs/hooks/formExtend.cjs +1 -1
- package/dist/cjs/hooks/formValidate.cjs +1 -1
- package/dist/cjs/hooks/i18n.cjs +1 -1
- package/dist/cjs/hooks/import.cjs +1 -1
- package/dist/cjs/hooks/importCsv.cjs +2 -2
- package/dist/cjs/hooks/index.cjs +1 -0
- package/dist/cjs/hooks/json/index.cjs +1 -1
- package/dist/cjs/hooks/json/utils/contextManager.cjs +1 -1
- package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -1
- package/dist/cjs/hooks/json/vFor.cjs +1 -1
- package/dist/cjs/hooks/json/vIf.cjs +1 -1
- package/dist/cjs/hooks/json/vModel.cjs +1 -1
- package/dist/cjs/hooks/json/vOn.cjs +1 -1
- package/dist/cjs/hooks/json/vShow.cjs +1 -1
- package/dist/cjs/hooks/json/vText.cjs +1 -1
- package/dist/cjs/hooks/json.cjs +1 -1
- package/dist/cjs/hooks/list.cjs +1 -1
- 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 +4 -8
- package/dist/cjs/hooks/tree.cjs +1 -1
- package/dist/cjs/hooks/upload/index.cjs +1 -0
- package/dist/cjs/hooks/upload/local.cjs +1 -1
- package/dist/cjs/hooks/upload/s3.cjs +1 -1
- 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/authProvider.cjs +1 -1
- package/dist/cjs/preset/dataProvider.cjs +1 -1
- package/dist/cjs/preset/i18nProvider.cjs +1 -1
- package/dist/cjs/preset/index.cjs +1 -0
- package/dist/cjs/provider/app.cjs +1 -1
- package/dist/cjs/provider/index.cjs +1 -0
- package/dist/cjs/provider/tab.cjs +1 -1
- package/dist/cjs/router/index.cjs +1 -0
- package/dist/cjs/router/route.cjs +1 -1
- package/dist/cjs/stores/auth.cjs +1 -1
- package/dist/cjs/stores/i18n.cjs +1 -1
- package/dist/cjs/stores/index.cjs +1 -0
- package/dist/cjs/stores/jsonSchema.cjs +1 -1
- package/dist/cjs/stores/manage.cjs +1 -1
- package/dist/cjs/stores/route.cjs +1 -1
- package/dist/cjs/stores/tab.cjs +1 -1
- package/dist/cjs/stores/theme.cjs +1 -1
- package/dist/cjs/utils/bus.cjs +1 -1
- package/dist/cjs/utils/index.cjs +1 -0
- package/dist/cjs/utils/theme.cjs +8 -8
- package/dist/cjs/utils/tree.cjs +1 -1
- package/dist/esm/_virtual/_rolldown/runtime.js +9 -0
- package/dist/esm/components/auth/can.js +17 -36
- package/dist/esm/components/auth/index.js +1 -0
- package/dist/esm/components/common/icon.js +16 -24
- package/dist/esm/components/common/index.js +2 -0
- package/dist/esm/components/common/logo.js +50 -49
- package/dist/esm/components/index.js +14 -0
- package/dist/esm/components/loader/iframe.js +16 -18
- package/dist/esm/components/loader/index.js +1 -0
- package/dist/esm/components/loader/loader.js +11 -40
- package/dist/esm/components/loader/remote/index.js +2 -0
- package/dist/esm/components/loader/remote/loader.js +118 -156
- package/dist/esm/components/loader/remote/render.js +12 -17
- package/dist/esm/components/overlay/index.js +1 -0
- package/dist/esm/components/overlay/overlay.js +54 -70
- package/dist/esm/components/status/error.js +7 -9
- package/dist/esm/components/status/exception.js +21 -37
- package/dist/esm/components/status/index.js +4 -0
- package/dist/esm/components/status/notAuthorized.js +7 -9
- package/dist/esm/components/status/notFound.js +7 -9
- package/dist/esm/config/color.js +288 -290
- package/dist/esm/directive/index.js +1 -0
- package/dist/esm/directive/permission.js +7 -27
- package/dist/esm/hooks/auth.js +154 -120
- package/dist/esm/hooks/config.js +11 -9
- package/dist/esm/hooks/data.js +416 -415
- package/dist/esm/hooks/export.js +32 -36
- package/dist/esm/hooks/exportCsv.js +42 -46
- package/dist/esm/hooks/form.js +86 -95
- package/dist/esm/hooks/formExtend.js +36 -40
- package/dist/esm/hooks/formValidate.js +22 -25
- package/dist/esm/hooks/i18n.js +14 -18
- package/dist/esm/hooks/import.js +45 -54
- package/dist/esm/hooks/importCsv.js +90 -83
- package/dist/esm/hooks/index.js +31 -0
- package/dist/esm/hooks/json/index.js +14 -22
- package/dist/esm/hooks/json/utils/contextManager.js +35 -26
- package/dist/esm/hooks/json/utils/expressionParser.js +100 -123
- package/dist/esm/hooks/json/vFor.js +50 -55
- package/dist/esm/hooks/json/vIf.js +17 -16
- package/dist/esm/hooks/json/vModel.js +96 -106
- package/dist/esm/hooks/json/vOn.js +30 -32
- package/dist/esm/hooks/json/vShow.js +20 -22
- package/dist/esm/hooks/json/vText.js +44 -51
- package/dist/esm/hooks/json.js +131 -132
- package/dist/esm/hooks/list.js +150 -184
- package/dist/esm/hooks/manage.js +25 -22
- package/dist/esm/hooks/menu.js +57 -61
- package/dist/esm/hooks/overlay.js +6 -23
- package/dist/esm/hooks/select.js +84 -94
- package/dist/esm/hooks/theme.js +289 -219
- package/dist/esm/hooks/tree.js +43 -47
- package/dist/esm/hooks/upload/index.js +2 -0
- package/dist/esm/hooks/upload/local.js +24 -30
- package/dist/esm/hooks/upload/s3.js +70 -80
- package/dist/esm/hooks/upload.js +256 -272
- package/dist/esm/index.js +150 -141
- package/dist/esm/main.js +24 -45
- package/dist/esm/preset/authProvider.js +62 -68
- package/dist/esm/preset/dataProvider.js +154 -180
- package/dist/esm/preset/i18nProvider.js +28 -30
- package/dist/esm/preset/index.js +3 -0
- package/dist/esm/provider/app.js +124 -151
- package/dist/esm/provider/index.js +2 -0
- package/dist/esm/provider/tab.js +49 -66
- package/dist/esm/router/index.js +1 -0
- package/dist/esm/router/route.js +39 -46
- package/dist/esm/stores/auth.js +51 -46
- package/dist/esm/stores/i18n.js +32 -29
- package/dist/esm/stores/index.js +7 -0
- package/dist/esm/stores/jsonSchema.js +47 -34
- package/dist/esm/stores/manage.js +63 -48
- package/dist/esm/stores/route.js +60 -56
- package/dist/esm/stores/tab.js +55 -60
- package/dist/esm/stores/theme.js +48 -55
- package/dist/esm/utils/bus.js +3 -5
- package/dist/esm/utils/index.js +3 -0
- package/dist/esm/utils/theme.js +110 -93
- package/dist/esm/utils/tree.js +28 -37
- package/package.json +1 -1
package/dist/esm/stores/i18n.js
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { inject as e, ref as t } from "vue";
|
|
2
|
+
import { defineStore as n } from "pinia";
|
|
3
|
+
/**
|
|
4
|
+
* use i18n store
|
|
5
|
+
* @param manageName manage name
|
|
6
|
+
* @returns i18n store
|
|
7
|
+
*/
|
|
8
|
+
function r(t) {
|
|
9
|
+
let n = e("dux.manage");
|
|
10
|
+
if (t ||= n?.value || "", !t) throw Error("manage not found");
|
|
11
|
+
return i(t)();
|
|
8
12
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
/**
|
|
14
|
+
* create manage store
|
|
15
|
+
* @param manageName manage name
|
|
16
|
+
* @returns manage store
|
|
17
|
+
*/
|
|
18
|
+
function i(e) {
|
|
19
|
+
return n(`i18n-${e}`, () => {
|
|
20
|
+
let e = t(""), n = t(!1);
|
|
21
|
+
return {
|
|
22
|
+
lang: e,
|
|
23
|
+
isInit: () => {
|
|
24
|
+
let e = n.value;
|
|
25
|
+
return n.value = !0, e;
|
|
26
|
+
},
|
|
27
|
+
setLocale: (t) => {
|
|
28
|
+
e.value = t;
|
|
29
|
+
},
|
|
30
|
+
getLocale: () => e.value
|
|
31
|
+
};
|
|
32
|
+
}, { persist: { pick: ["lang"] } });
|
|
28
33
|
}
|
|
29
|
-
export {
|
|
30
|
-
p as useI18nStore
|
|
31
|
-
};
|
|
34
|
+
export { r as useI18nStore };
|
|
@@ -1,36 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { inject as e, ref as t } from "vue";
|
|
2
|
+
import { defineStore as n } from "pinia";
|
|
3
|
+
/**
|
|
4
|
+
* 生成组件缓存键
|
|
5
|
+
*/
|
|
6
|
+
function r(e) {
|
|
7
|
+
return e;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
component: n,
|
|
19
|
-
name: r,
|
|
20
|
-
originalName: s || r,
|
|
21
|
-
cacheKey: a
|
|
22
|
-
}), o.value.set(r, n)), a;
|
|
23
|
-
},
|
|
24
|
-
getComponent: (n) => e.value.get(n)?.component,
|
|
25
|
-
getComponentByName: (n) => o.value.get(n),
|
|
26
|
-
hasComponent: (n) => e.value.has(n),
|
|
27
|
-
clearCache: () => {
|
|
28
|
-
e.value.clear(), o.value.clear();
|
|
29
|
-
},
|
|
30
|
-
getCacheSize: () => e.value.size
|
|
31
|
-
};
|
|
32
|
-
});
|
|
9
|
+
/**
|
|
10
|
+
* use json schema store
|
|
11
|
+
* @param manageName manage name
|
|
12
|
+
* @returns json schema store
|
|
13
|
+
*/
|
|
14
|
+
function i(t) {
|
|
15
|
+
let n = e("dux.manage");
|
|
16
|
+
if (t ||= n?.value || "", !t) throw Error("manage not found");
|
|
17
|
+
return a(t)();
|
|
33
18
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
/**
|
|
20
|
+
* create json schema store
|
|
21
|
+
* @param manageName manage name
|
|
22
|
+
* @returns json schema store
|
|
23
|
+
*/
|
|
24
|
+
function a(e) {
|
|
25
|
+
return n(`jsonSchema-${e}`, () => {
|
|
26
|
+
let e = t(/* @__PURE__ */ new Map()), n = t(/* @__PURE__ */ new Map());
|
|
27
|
+
return {
|
|
28
|
+
componentCache: e,
|
|
29
|
+
componentsByName: n,
|
|
30
|
+
addComponent: (t, i, a) => {
|
|
31
|
+
let o = r(i);
|
|
32
|
+
return e.value.has(o) || (e.value.set(o, {
|
|
33
|
+
component: t,
|
|
34
|
+
name: i,
|
|
35
|
+
originalName: a || i,
|
|
36
|
+
cacheKey: o
|
|
37
|
+
}), n.value.set(i, t)), o;
|
|
38
|
+
},
|
|
39
|
+
getComponent: (t) => e.value.get(t)?.component,
|
|
40
|
+
getComponentByName: (e) => n.value.get(e),
|
|
41
|
+
hasComponent: (t) => e.value.has(t),
|
|
42
|
+
clearCache: () => {
|
|
43
|
+
e.value.clear(), n.value.clear();
|
|
44
|
+
},
|
|
45
|
+
getCacheSize: () => e.value.size
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export { i as useJsonSchemaStore };
|
|
@@ -1,51 +1,66 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineStore as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { inject as e, markRaw as t, ref as n } from "vue";
|
|
2
|
+
import { defineStore as r } from "pinia";
|
|
3
|
+
import { cloneDeep as i } from "lodash-es";
|
|
4
|
+
/**
|
|
5
|
+
* 判断是否为 Record<string, IDataProvider> 类型
|
|
6
|
+
* @param value 要判断的值
|
|
7
|
+
* @returns 是否为记录类型
|
|
8
|
+
*/
|
|
9
|
+
function a(e) {
|
|
10
|
+
return typeof e == "object" && !!e && !Array.isArray(e) && typeof e.getList != "function";
|
|
6
11
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* use manage store
|
|
14
|
+
* @param manageName manage name
|
|
15
|
+
* @returns manage store
|
|
16
|
+
*/
|
|
17
|
+
function o(t) {
|
|
18
|
+
let n = e("dux.manage");
|
|
19
|
+
if (t ||= n?.value || "", !t) throw Error("manage not found");
|
|
20
|
+
return s(t)();
|
|
12
21
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
22
|
+
/**
|
|
23
|
+
* create manage store
|
|
24
|
+
* @param manageName manage name
|
|
25
|
+
* @returns manage store
|
|
26
|
+
*/
|
|
27
|
+
function s(e) {
|
|
28
|
+
return r(`manages-${e}`, () => {
|
|
29
|
+
let e = n(), r = n(!1);
|
|
30
|
+
return {
|
|
31
|
+
config: e,
|
|
32
|
+
isInit: () => {
|
|
33
|
+
let e = r.value;
|
|
34
|
+
return r.value = !0, e;
|
|
35
|
+
},
|
|
36
|
+
setConfig: (n, r) => {
|
|
37
|
+
let o = i(n), s = [];
|
|
38
|
+
o.title && s.push(o.title), r.title && s.push(r.title), o.title = s.join(" - "), o.copyright = o.copyright || r.copyright, o.description = o.description || r.description, o.theme = {
|
|
39
|
+
...r?.theme,
|
|
40
|
+
...o?.theme
|
|
41
|
+
};
|
|
42
|
+
let c = {};
|
|
43
|
+
r?.dataProvider && (a(r.dataProvider) ? Object.keys(r.dataProvider).forEach((e) => {
|
|
44
|
+
c[e] = r.dataProvider[e];
|
|
45
|
+
}) : c.default = r.dataProvider), o?.dataProvider && (a(o.dataProvider) ? Object.keys(o.dataProvider).forEach((e) => {
|
|
46
|
+
c[e] = o.dataProvider[e];
|
|
47
|
+
}) : c.default = o.dataProvider), o.authProvider = r?.authProvider || o?.authProvider, o.dataProvider = c, o.i18nProvider = r?.i18nProvider || o?.i18nProvider, o.layoutComponent = {
|
|
48
|
+
...r.layoutComponent,
|
|
49
|
+
...o.layoutComponent
|
|
50
|
+
};
|
|
51
|
+
let l = {
|
|
52
|
+
...r.components,
|
|
53
|
+
...o.components
|
|
54
|
+
};
|
|
55
|
+
l && Object.keys(l).forEach((e) => {
|
|
56
|
+
l[e] && (l[e] = t(l[e]));
|
|
57
|
+
}), o.components = l, o.remote = {
|
|
58
|
+
...r.remote,
|
|
59
|
+
...o.remote
|
|
60
|
+
}, e.value = o;
|
|
61
|
+
},
|
|
62
|
+
getConfig: () => e.value
|
|
63
|
+
};
|
|
64
|
+
});
|
|
48
65
|
}
|
|
49
|
-
export {
|
|
50
|
-
O as useManageStore
|
|
51
|
-
};
|
|
66
|
+
export { o as useManageStore };
|
package/dist/esm/stores/route.js
CHANGED
|
@@ -1,58 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { inject as e, ref as t } from "vue";
|
|
2
|
+
import { defineStore as n } from "pinia";
|
|
3
|
+
/**
|
|
4
|
+
* use route store
|
|
5
|
+
* @param manageName manage name
|
|
6
|
+
* @returns route store
|
|
7
|
+
*/
|
|
8
|
+
function r(t) {
|
|
9
|
+
let n = e("dux.manage");
|
|
10
|
+
if (t ||= n?.value || "", !t) throw Error("manage not found");
|
|
11
|
+
return i(t)();
|
|
8
12
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
13
|
+
/**
|
|
14
|
+
* create route store
|
|
15
|
+
* @param manageName manage name
|
|
16
|
+
* @returns route store
|
|
17
|
+
*/
|
|
18
|
+
function i(e) {
|
|
19
|
+
return n(`routes-${e}`, () => {
|
|
20
|
+
let e = t([]), n = (t) => e.value?.find((e) => e.path === t), r = (t) => e.value?.find((e) => e.name === t), i = (t) => {
|
|
21
|
+
e.value?.push(t);
|
|
22
|
+
}, a = (t) => {
|
|
23
|
+
e.value = [...e.value, ...t];
|
|
24
|
+
}, o = (t) => {
|
|
25
|
+
e.value = t;
|
|
26
|
+
}, s = () => e.value, c = () => {
|
|
27
|
+
e.value = [];
|
|
28
|
+
}, l = () => {
|
|
29
|
+
let t = e.value?.filter((e) => !e.parent && !e.name?.includes("404") && !e.name?.includes("403"))?.sort((e, t) => (e.sort || 0) - (t.sort || 0)), n = (t) => {
|
|
30
|
+
if (t.path) return t;
|
|
31
|
+
let r = e.value?.filter((e) => e.parent === t.name)?.sort((e, t) => (e.sort || 0) - (t.sort || 0));
|
|
32
|
+
for (let e of r || []) {
|
|
33
|
+
let t = n(e);
|
|
34
|
+
if (t) return t;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
for (let e of t || []) {
|
|
38
|
+
let t = n(e);
|
|
39
|
+
if (t) return t;
|
|
40
|
+
}
|
|
41
|
+
}, u = t(!1);
|
|
42
|
+
return {
|
|
43
|
+
routes: e,
|
|
44
|
+
searchRoute: n,
|
|
45
|
+
searchRouteName: r,
|
|
46
|
+
appendRoute: i,
|
|
47
|
+
appendRoutes: a,
|
|
48
|
+
setRoutes: o,
|
|
49
|
+
getRoutes: s,
|
|
50
|
+
clearRoutes: c,
|
|
51
|
+
getIndexRoute: l,
|
|
52
|
+
getRouteInit: () => {
|
|
53
|
+
let e = u.value;
|
|
54
|
+
return u.value = !0, e;
|
|
55
|
+
},
|
|
56
|
+
resetRouteInit: () => {
|
|
57
|
+
u.value = !1;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
});
|
|
55
61
|
}
|
|
56
|
-
export {
|
|
57
|
-
F as useRouteStore
|
|
58
|
-
};
|
|
62
|
+
export { r as useRouteStore };
|
package/dist/esm/stores/tab.js
CHANGED
|
@@ -1,62 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return b(o)();
|
|
1
|
+
import { inject as e, nextTick as t, ref as n } from "vue";
|
|
2
|
+
import { defineStore as r } from "pinia";
|
|
3
|
+
function i(t) {
|
|
4
|
+
let n = e("dux.manage");
|
|
5
|
+
if (t ||= n?.value || "", !t) throw Error("manage not found");
|
|
6
|
+
return a(t)();
|
|
8
7
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
});
|
|
8
|
+
function a(e) {
|
|
9
|
+
return r(`tab-${e}`, () => {
|
|
10
|
+
let e = n(), r = n(), i = n([]);
|
|
11
|
+
return {
|
|
12
|
+
current: e,
|
|
13
|
+
tabs: i,
|
|
14
|
+
isTab: (e) => i.value.some((t) => t.path === e),
|
|
15
|
+
addTab: (t, n) => {
|
|
16
|
+
t.path && (i.value.some((e) => e.path === t.path) ? (e.value && e.value !== t.path && (r.value = i.value.find((t) => t.path === e.value)), e.value = t.path) : (e.value && (r.value = i.value.find((t) => t.path === e.value)), i.value.push(t), n?.(t), e.value = t.path));
|
|
17
|
+
},
|
|
18
|
+
delTab: (t, n) => {
|
|
19
|
+
let a = i.value.findIndex((e) => e.path === t);
|
|
20
|
+
if (a === -1 || i.value.length <= 1 || i.value[a]?.meta?.lock) return;
|
|
21
|
+
let o;
|
|
22
|
+
if (t === e.value && r.value && (o = i.value.find((e) => e.path === r.value?.path && e.path !== t)), !o) {
|
|
23
|
+
let e = i.value[a - 1], t = i.value[a + 1];
|
|
24
|
+
o = e || t;
|
|
25
|
+
}
|
|
26
|
+
i.value.splice(a, 1), n?.(o);
|
|
27
|
+
},
|
|
28
|
+
changeTab: (t, n) => {
|
|
29
|
+
let a = i.value.find((e) => e.path === t);
|
|
30
|
+
a && (e.value && e.value !== t && (r.value = i.value.find((t) => t.path === e.value)), e.value = t, n?.(a));
|
|
31
|
+
},
|
|
32
|
+
delOther: (e, t) => {
|
|
33
|
+
i.value = i.value.filter((t) => t.path === e || t.meta?.lock), t?.();
|
|
34
|
+
},
|
|
35
|
+
delLeft: (e, n) => {
|
|
36
|
+
let r = i.value.findIndex((t) => t.path === e);
|
|
37
|
+
r <= 0 || t(() => {
|
|
38
|
+
i.value = [...i.value.slice(0, r).filter((e) => e.meta?.lock), ...i.value.slice(r)], n?.();
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
delRight: (e, n) => {
|
|
42
|
+
let r = i.value.findIndex((t) => t.path === e);
|
|
43
|
+
r === -1 || r === i.value.length - 1 || t(() => {
|
|
44
|
+
i.value = [...i.value.slice(0, r + 1), ...i.value.slice(r + 1).filter((e) => e.meta?.lock)], n?.();
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
lockTab: (e) => {
|
|
48
|
+
let t = i.value.findIndex((t) => t.path === e);
|
|
49
|
+
t !== -1 && i.value[t] && (i.value[t].meta || (i.value[t].meta = {}), i.value[t].meta.lock = !i.value[t].meta.lock);
|
|
50
|
+
},
|
|
51
|
+
clearTab: () => {
|
|
52
|
+
e.value = void 0, r.value = void 0, i.value = [];
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
});
|
|
58
56
|
}
|
|
59
|
-
export {
|
|
60
|
-
b as createTabStore,
|
|
61
|
-
R as useTabStore
|
|
62
|
-
};
|
|
57
|
+
export { a as createTabStore, i as useTabStore };
|
package/dist/esm/stores/theme.js
CHANGED
|
@@ -1,58 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { inject as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { useManageStore as e } from "./manage.js";
|
|
2
|
+
import { inject as t, ref as n } from "vue";
|
|
3
|
+
import { defineStore as r } from "pinia";
|
|
4
|
+
var i = {
|
|
5
|
+
primary: "emerald",
|
|
6
|
+
info: "cyan",
|
|
7
|
+
success: "green",
|
|
8
|
+
warning: "amber",
|
|
9
|
+
error: "red",
|
|
10
|
+
gray: "zinc"
|
|
11
11
|
};
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return v(e)();
|
|
12
|
+
function a(e) {
|
|
13
|
+
let n = t("dux.manage");
|
|
14
|
+
if (e ||= n?.value || "", !e) throw Error("manage not found");
|
|
15
|
+
return o(e)();
|
|
17
16
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
persist: {
|
|
52
|
-
pick: ["theme", "mode"]
|
|
53
|
-
}
|
|
54
|
-
});
|
|
17
|
+
function o(t) {
|
|
18
|
+
return r(`theme-${t}`, () => {
|
|
19
|
+
let r = n(e(t).config?.theme?.defaultTheme || i), a = n("auto"), o = n(!1);
|
|
20
|
+
function s() {
|
|
21
|
+
o.value = !0;
|
|
22
|
+
}
|
|
23
|
+
function c(e) {
|
|
24
|
+
a.value = e;
|
|
25
|
+
}
|
|
26
|
+
function l(e, t) {
|
|
27
|
+
r.value[e] = t;
|
|
28
|
+
}
|
|
29
|
+
function u(e) {
|
|
30
|
+
Object.assign(r.value, e);
|
|
31
|
+
}
|
|
32
|
+
function d() {
|
|
33
|
+
r.value = { ...i };
|
|
34
|
+
}
|
|
35
|
+
function f() {
|
|
36
|
+
return r.value;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
mode: a,
|
|
40
|
+
setMode: c,
|
|
41
|
+
theme: r,
|
|
42
|
+
cssInit: o,
|
|
43
|
+
setCssInit: s,
|
|
44
|
+
setThemeColor: l,
|
|
45
|
+
setThemeColors: u,
|
|
46
|
+
resetTheme: d,
|
|
47
|
+
getTheme: f
|
|
48
|
+
};
|
|
49
|
+
}, { persist: { pick: ["theme", "mode"] } });
|
|
55
50
|
}
|
|
56
|
-
export {
|
|
57
|
-
C as useThemeStore
|
|
58
|
-
};
|
|
51
|
+
export { a as useThemeStore };
|
package/dist/esm/utils/bus.js
CHANGED