@jnrs/vue-core 1.1.1 → 1.1.3
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 +12 -3
- package/dist/components/GlobalSetting.vue.d.ts +4 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +122 -0
- package/dist/index-DEkMXVh9.js +109 -0
- package/dist/index-pLO4r50y.js +94 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/piniaStore/base/auth.d.ts +1 -1
- package/dist/piniaStore/base/menu.d.ts +11 -14
- package/dist/piniaStore/base/system.d.ts +45 -13
- package/dist/piniaStore/index.js +5 -162
- package/dist/system-DSegwP0Z.js +1644 -0
- package/dist/types/base.d.ts +0 -32
- package/dist/vueRouter/index.js +8 -103
- package/dist/vueRouter/types.d.ts +1 -0
- package/package.json +12 -4
package/README.md
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
# @jnrs/vue-core
|
|
2
2
|
|
|
3
3
|
## ✨ 介绍
|
|
4
|
-
巨能前端工程化开发,Vue
|
|
4
|
+
巨能前端工程化开发,Vue 专用核心功能包。
|
|
5
|
+
- Pinia store
|
|
6
|
+
- Vue composables
|
|
7
|
+
- Vue Router
|
|
8
|
+
- 全局指令
|
|
9
|
+
- 插件
|
|
10
|
+
- 公共 Vue 组件
|
|
5
11
|
|
|
6
12
|
## 💻 技术栈
|
|
7
13
|
TypeScript、Vue3 生态
|
|
@@ -31,12 +37,12 @@ import { useAuthStore } from '@jnrs/vue-core/pinia'
|
|
|
31
37
|
``` typescript
|
|
32
38
|
/**
|
|
33
39
|
* useSystemStore 系统仓库
|
|
34
|
-
* @returns
|
|
35
|
-
* @returns theme 主题
|
|
40
|
+
* @returns theme 主题(国际化、主题、自定义强调色)
|
|
36
41
|
* @returns menuCollapse 菜单是否折叠
|
|
37
42
|
* @returns documentFullscreen 文档是否全屏
|
|
38
43
|
* @methods toggleCollapse 折叠菜单切换
|
|
39
44
|
* @methods toggleFullScreen 全屏切换
|
|
45
|
+
* @methods setTheme 设置主题
|
|
40
46
|
*/
|
|
41
47
|
```
|
|
42
48
|
``` typescript
|
|
@@ -75,3 +81,6 @@ import { useAuthStore } from '@jnrs/vue-core/pinia'
|
|
|
75
81
|
- createVueRouter 创建 vue-router 实例
|
|
76
82
|
- asyncGenerateRoute 设置动态路由,生成路由记录
|
|
77
83
|
|
|
84
|
+
#### @jnrs/vue-core/components 模块
|
|
85
|
+
Vue 组件
|
|
86
|
+
- GlobalSetting 全局偏好设置
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {
|
|
2
|
+
handleShow: () => void;
|
|
3
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".globalSetting_item[data-v-122c674a]{margin-bottom:20px}.globalSetting_header{margin-bottom:0;padding-bottom:20px;border-bottom:1px solid #e4e4e7}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
import { defineComponent as g, ref as y, createBlock as d, openBlock as n, unref as t, withCtx as s, createElementBlock as i, Fragment as h, renderList as m, createElementVNode as k, createVNode as S, toDisplayString as b, createTextVNode as C } from "vue";
|
|
3
|
+
import { ElDrawer as x, ElRadioGroup as E, ElRadio as V } from "element-plus";
|
|
4
|
+
import { u as w } from "../system-DSegwP0Z.js";
|
|
5
|
+
const N = /* @__PURE__ */ g({
|
|
6
|
+
__name: "GlobalSetting",
|
|
7
|
+
setup(u, { expose: r }) {
|
|
8
|
+
const { theme: a, setTheme: c } = w(), l = y(!1), _ = [
|
|
9
|
+
{
|
|
10
|
+
title: "语言",
|
|
11
|
+
key: "locale",
|
|
12
|
+
select: [
|
|
13
|
+
{
|
|
14
|
+
value: "zhCn",
|
|
15
|
+
label: "中文"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
value: "en",
|
|
19
|
+
label: "English"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: "主题",
|
|
25
|
+
key: "mode",
|
|
26
|
+
select: [
|
|
27
|
+
{
|
|
28
|
+
value: "light",
|
|
29
|
+
label: "浅色"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: "dark",
|
|
33
|
+
label: "深色"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
value: "auto",
|
|
37
|
+
label: "跟随系统"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: "强调色",
|
|
43
|
+
key: "customColor",
|
|
44
|
+
select: [
|
|
45
|
+
{
|
|
46
|
+
value: "oklch(0.6 0.19 41)",
|
|
47
|
+
label: "JNRS"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: "oklch(0.51 0.21 264)",
|
|
51
|
+
label: "蔚蓝"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
value: "oklch(0.90 0.16 98)",
|
|
55
|
+
label: "月黄"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
value: "oklch(0.63 0.25 27)",
|
|
59
|
+
label: "京东红"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: "oklch(0.65 0.24 33)",
|
|
63
|
+
label: "淘宝红"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
value: "oklch(0.61 0.20 261)",
|
|
67
|
+
label: "钉钉蓝"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
value: "oklch(0.70 0.12 152)",
|
|
71
|
+
label: "微信绿"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
return r({
|
|
77
|
+
handleShow: () => {
|
|
78
|
+
l.value = !0;
|
|
79
|
+
}
|
|
80
|
+
}), (R, v) => (n(), d(t(x), {
|
|
81
|
+
"header-class": "globalSetting_header",
|
|
82
|
+
modelValue: l.value,
|
|
83
|
+
"onUpdate:modelValue": v[0] || (v[0] = (e) => l.value = e),
|
|
84
|
+
title: "全局偏好设置"
|
|
85
|
+
}, {
|
|
86
|
+
default: s(() => [
|
|
87
|
+
(n(), i(h, null, m(_, (e, p) => k("div", {
|
|
88
|
+
class: "globalSetting_item",
|
|
89
|
+
key: p
|
|
90
|
+
}, [
|
|
91
|
+
k("h4", null, b(e.title), 1),
|
|
92
|
+
S(t(E), {
|
|
93
|
+
"model-value": t(a)[e.key],
|
|
94
|
+
onChange: (o) => t(c)(e.key, o)
|
|
95
|
+
}, {
|
|
96
|
+
default: s(() => [
|
|
97
|
+
(n(!0), i(h, null, m(e.select, (o, f) => (n(), d(t(V), {
|
|
98
|
+
value: o.value,
|
|
99
|
+
key: f
|
|
100
|
+
}, {
|
|
101
|
+
default: s(() => [
|
|
102
|
+
C(b(o.label), 1)
|
|
103
|
+
]),
|
|
104
|
+
_: 2
|
|
105
|
+
}, 1032, ["value"]))), 128))
|
|
106
|
+
]),
|
|
107
|
+
_: 2
|
|
108
|
+
}, 1032, ["model-value", "onChange"])
|
|
109
|
+
])), 64))
|
|
110
|
+
]),
|
|
111
|
+
_: 1
|
|
112
|
+
}, 8, ["modelValue"]));
|
|
113
|
+
}
|
|
114
|
+
}), B = (u, r) => {
|
|
115
|
+
const a = u.__vccOpts || u;
|
|
116
|
+
for (const [c, l] of r)
|
|
117
|
+
a[c] = l;
|
|
118
|
+
return a;
|
|
119
|
+
}, F = /* @__PURE__ */ B(N, [["__scopeId", "data-v-122c674a"]]);
|
|
120
|
+
export {
|
|
121
|
+
F as GlobalSetting
|
|
122
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { createWebHistory as p, createRouter as d } from "vue-router";
|
|
2
|
+
const h = {
|
|
3
|
+
history: p(),
|
|
4
|
+
routes: []
|
|
5
|
+
};
|
|
6
|
+
let n, s, i, m;
|
|
7
|
+
const f = ({
|
|
8
|
+
options: o,
|
|
9
|
+
fileModules: t,
|
|
10
|
+
layoutName: e,
|
|
11
|
+
globalComponent: a,
|
|
12
|
+
handleBeforeEach: r
|
|
13
|
+
}) => (s = t, e && (i = e), a && (m = a), n = d({ ...h, ...o }), n.beforeEach(
|
|
14
|
+
async (c, u) => r?.(c, u)
|
|
15
|
+
), n), g = async (o, t = "push") => {
|
|
16
|
+
try {
|
|
17
|
+
return await n[t](o);
|
|
18
|
+
} catch (e) {
|
|
19
|
+
console.warn(`router.${t} 失败`, {
|
|
20
|
+
code: "ROUTER_NOT_MATCH",
|
|
21
|
+
message: "未匹配到有效路由",
|
|
22
|
+
error: o || e,
|
|
23
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
24
|
+
}), n[t]({ name: "404" });
|
|
25
|
+
}
|
|
26
|
+
}, _ = (o) => s[`/src/views${o}.vue`], l = async (o, t) => {
|
|
27
|
+
for (const e of o) {
|
|
28
|
+
if (e.meta.fullPathTitle = t ? t.meta.fullPathTitle + "," + e.meta.title : e.meta.title, !e.component) {
|
|
29
|
+
e.children && e.children.length > 0 && l(e.children, e);
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const a = e.component.replace(/[^a-zA-Z0-9/._-]/g, "");
|
|
33
|
+
if (!a.startsWith("/") || a.includes("..")) {
|
|
34
|
+
console.warn("[Router] 组件加载失败", {
|
|
35
|
+
code: "INVALID_COMPONENT_PATH",
|
|
36
|
+
message: "组件路径拼写不符合规则,应以 '/' 开头且不能包含 '..',请检查 component 字段是否配置正确",
|
|
37
|
+
menu: {
|
|
38
|
+
path: e.path,
|
|
39
|
+
name: e.name,
|
|
40
|
+
component: e.component
|
|
41
|
+
},
|
|
42
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
43
|
+
});
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const r = _(a);
|
|
47
|
+
if (!r) {
|
|
48
|
+
console.warn("[Router] 组件加载失败", {
|
|
49
|
+
code: "COMPONENT_NOT_FOUND",
|
|
50
|
+
message: "组件加载器无效,请检查 component 字段是否配置正确",
|
|
51
|
+
menu: {
|
|
52
|
+
path: e.path,
|
|
53
|
+
name: e.name,
|
|
54
|
+
component: e.component
|
|
55
|
+
},
|
|
56
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
57
|
+
});
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
let c = {
|
|
61
|
+
name: e.name,
|
|
62
|
+
path: e.path,
|
|
63
|
+
meta: e.meta,
|
|
64
|
+
redirect: e.redirect,
|
|
65
|
+
component: () => r()
|
|
66
|
+
};
|
|
67
|
+
e.meta?.global ? (m !== void 0 && (c = {
|
|
68
|
+
name: "_globalComponent_" + e.name,
|
|
69
|
+
path: e.path,
|
|
70
|
+
meta: e.meta,
|
|
71
|
+
redirect: e.redirect,
|
|
72
|
+
component: () => m,
|
|
73
|
+
children: [
|
|
74
|
+
{
|
|
75
|
+
path: "",
|
|
76
|
+
name: e.name,
|
|
77
|
+
meta: e.meta,
|
|
78
|
+
component: () => r()
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}), n.addRoute(c)) : n.addRoute(i, c);
|
|
82
|
+
}
|
|
83
|
+
}, O = () => {
|
|
84
|
+
const o = [];
|
|
85
|
+
for (const t of n.getRoutes())
|
|
86
|
+
o.push({
|
|
87
|
+
name: t.name,
|
|
88
|
+
path: t.path,
|
|
89
|
+
meta: t.meta
|
|
90
|
+
});
|
|
91
|
+
return o;
|
|
92
|
+
}, T = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
93
|
+
__proto__: null,
|
|
94
|
+
asyncGenerateRoute: l,
|
|
95
|
+
createVueRouter: f,
|
|
96
|
+
getRoutes: O,
|
|
97
|
+
handleRouter: g
|
|
98
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
99
|
+
console.log(
|
|
100
|
+
"%c✨ 欢迎使用 @jnrs/vue-core/router",
|
|
101
|
+
'background: #42B883; color: #39495C; font-weight: bold; padding: 4px 8px; border-radius: 4px; font-family: "Helvetica Neue", sans-serif;'
|
|
102
|
+
);
|
|
103
|
+
export {
|
|
104
|
+
l as a,
|
|
105
|
+
f as b,
|
|
106
|
+
T as c,
|
|
107
|
+
O as g,
|
|
108
|
+
g as h
|
|
109
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import "pinia-plugin-persistedstate";
|
|
2
|
+
import { u as m } from "./system-DSegwP0Z.js";
|
|
3
|
+
import { ref as i } from "vue";
|
|
4
|
+
import { defineStore as l } from "pinia";
|
|
5
|
+
import { a as p } from "./index-DEkMXVh9.js";
|
|
6
|
+
const y = l(
|
|
7
|
+
"@jnrs/vue-core/pinia:auth",
|
|
8
|
+
() => {
|
|
9
|
+
const e = i(!1), n = i(), u = i(), o = i();
|
|
10
|
+
return {
|
|
11
|
+
hasAuthenticated: e,
|
|
12
|
+
token: n,
|
|
13
|
+
userInfo: u,
|
|
14
|
+
dict: o,
|
|
15
|
+
asyncSetAuth: async (c) => {
|
|
16
|
+
e.value = !0, c.token && (n.value = c.token), c.userInfo && (u.value = c.userInfo), c.dict && (o.value = c.dict);
|
|
17
|
+
},
|
|
18
|
+
asyncClearAuth: async () => {
|
|
19
|
+
e.value = !1, n.value = void 0, u.value = void 0, o.value = void 0;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
persist: {
|
|
25
|
+
pick: ["hasAuthenticated", "token", "userInfo", "dict"]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
), t = [];
|
|
29
|
+
for (let e = 0; e < 256; ++e)
|
|
30
|
+
t.push((e + 256).toString(16).slice(1));
|
|
31
|
+
function v(e, n = 0) {
|
|
32
|
+
return (t[e[n + 0]] + t[e[n + 1]] + t[e[n + 2]] + t[e[n + 3]] + "-" + t[e[n + 4]] + t[e[n + 5]] + "-" + t[e[n + 6]] + t[e[n + 7]] + "-" + t[e[n + 8]] + t[e[n + 9]] + "-" + t[e[n + 10]] + t[e[n + 11]] + t[e[n + 12]] + t[e[n + 13]] + t[e[n + 14]] + t[e[n + 15]]).toLowerCase();
|
|
33
|
+
}
|
|
34
|
+
let a;
|
|
35
|
+
const h = new Uint8Array(16);
|
|
36
|
+
function f() {
|
|
37
|
+
if (!a) {
|
|
38
|
+
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
39
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
40
|
+
a = crypto.getRandomValues.bind(crypto);
|
|
41
|
+
}
|
|
42
|
+
return a(h);
|
|
43
|
+
}
|
|
44
|
+
const g = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), d = { randomUUID: g };
|
|
45
|
+
function b(e, n, u) {
|
|
46
|
+
e = e || {};
|
|
47
|
+
const o = e.random ?? e.rng?.() ?? f();
|
|
48
|
+
if (o.length < 16)
|
|
49
|
+
throw new Error("Random bytes length must be >= 16");
|
|
50
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, v(o);
|
|
51
|
+
}
|
|
52
|
+
function S(e, n, u) {
|
|
53
|
+
return d.randomUUID && !e ? d.randomUUID() : b(e);
|
|
54
|
+
}
|
|
55
|
+
const U = l(
|
|
56
|
+
"@jnrs/vue-core/pinia:menu",
|
|
57
|
+
() => {
|
|
58
|
+
const e = i(!1), n = i([]), u = async (s) => {
|
|
59
|
+
if (e.value)
|
|
60
|
+
return n.value;
|
|
61
|
+
o(s), n.value = s, e.value = !0;
|
|
62
|
+
try {
|
|
63
|
+
await p(n.value);
|
|
64
|
+
} catch (r) {
|
|
65
|
+
throw r;
|
|
66
|
+
}
|
|
67
|
+
return n.value;
|
|
68
|
+
}, o = (s) => {
|
|
69
|
+
for (const r of s)
|
|
70
|
+
r.meta.uuid = S(), r.children && o(r.children);
|
|
71
|
+
};
|
|
72
|
+
return { hasFetchedAsyncMenus: e, menus: n, asyncSetMenus: u };
|
|
73
|
+
}
|
|
74
|
+
// {
|
|
75
|
+
// persist: {
|
|
76
|
+
// pick: ['menus']
|
|
77
|
+
// }
|
|
78
|
+
// }
|
|
79
|
+
);
|
|
80
|
+
console.log(
|
|
81
|
+
"%c✨ 欢迎使用 @jnrs/vue-core/pinia",
|
|
82
|
+
'background: #42B883; color: #39495C; font-weight: bold; padding: 4px 8px; border-radius: 4px; font-family: "Helvetica Neue", sans-serif;'
|
|
83
|
+
);
|
|
84
|
+
const k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
85
|
+
__proto__: null,
|
|
86
|
+
useAuthStore: y,
|
|
87
|
+
useMenuStore: U,
|
|
88
|
+
useSystemStore: m
|
|
89
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
90
|
+
export {
|
|
91
|
+
U as a,
|
|
92
|
+
k as i,
|
|
93
|
+
y as u
|
|
94
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import { c as r } from "./index-DEkMXVh9.js";
|
|
2
|
+
import { i } from "./index-pLO4r50y.js";
|
|
1
3
|
console.log(
|
|
2
4
|
"%c✨ 欢迎使用 @jnrs/vue-core",
|
|
3
5
|
'background: #42B883; color: #39495C; font-weight: bold; padding: 4px 8px; border-radius: 4px; font-family: "Helvetica Neue", sans-serif;'
|
|
4
6
|
);
|
|
7
|
+
export {
|
|
8
|
+
i as piniaStore,
|
|
9
|
+
r as vueRouter
|
|
10
|
+
};
|
|
@@ -19,10 +19,10 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
19
19
|
noAuth?: boolean | undefined;
|
|
20
20
|
global?: boolean | undefined;
|
|
21
21
|
fullPathTitle?: string | undefined;
|
|
22
|
+
todoCount?: number | undefined;
|
|
22
23
|
};
|
|
23
24
|
path: string;
|
|
24
25
|
name?: string | undefined;
|
|
25
|
-
todoCount?: number | undefined;
|
|
26
26
|
component?: string | undefined;
|
|
27
27
|
redirect?: string | undefined;
|
|
28
28
|
children?: /*elided*/ any[] | undefined;
|
|
@@ -37,10 +37,10 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
37
37
|
noAuth?: boolean | undefined;
|
|
38
38
|
global?: boolean | undefined;
|
|
39
39
|
fullPathTitle?: string | undefined;
|
|
40
|
+
todoCount?: number | undefined;
|
|
40
41
|
};
|
|
41
42
|
path: string;
|
|
42
43
|
name?: string | undefined;
|
|
43
|
-
todoCount?: number | undefined;
|
|
44
44
|
component?: string | undefined;
|
|
45
45
|
redirect?: string | undefined;
|
|
46
46
|
children?: /*elided*/ any[] | undefined;
|
|
@@ -56,16 +56,15 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
56
56
|
noAuth?: boolean | undefined;
|
|
57
57
|
global?: boolean | undefined;
|
|
58
58
|
fullPathTitle?: string | undefined;
|
|
59
|
+
todoCount?: number | undefined;
|
|
59
60
|
};
|
|
60
61
|
path: string;
|
|
61
62
|
name?: string | undefined;
|
|
62
|
-
todoCount?: number | undefined;
|
|
63
63
|
component?: string | undefined;
|
|
64
64
|
redirect?: string | undefined;
|
|
65
65
|
children?: /*elided*/ any[] | undefined;
|
|
66
66
|
}[]>;
|
|
67
|
-
|
|
68
|
-
}, "menus" | "hasFetchedAsyncMenus">, Pick<{
|
|
67
|
+
}, "hasFetchedAsyncMenus" | "menus">, Pick<{
|
|
69
68
|
hasFetchedAsyncMenus: import('vue').Ref<boolean, boolean>;
|
|
70
69
|
menus: import('vue').Ref<{
|
|
71
70
|
meta: {
|
|
@@ -78,10 +77,10 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
78
77
|
noAuth?: boolean | undefined;
|
|
79
78
|
global?: boolean | undefined;
|
|
80
79
|
fullPathTitle?: string | undefined;
|
|
80
|
+
todoCount?: number | undefined;
|
|
81
81
|
};
|
|
82
82
|
path: string;
|
|
83
83
|
name?: string | undefined;
|
|
84
|
-
todoCount?: number | undefined;
|
|
85
84
|
component?: string | undefined;
|
|
86
85
|
redirect?: string | undefined;
|
|
87
86
|
children?: /*elided*/ any[] | undefined;
|
|
@@ -96,10 +95,10 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
96
95
|
noAuth?: boolean | undefined;
|
|
97
96
|
global?: boolean | undefined;
|
|
98
97
|
fullPathTitle?: string | undefined;
|
|
98
|
+
todoCount?: number | undefined;
|
|
99
99
|
};
|
|
100
100
|
path: string;
|
|
101
101
|
name?: string | undefined;
|
|
102
|
-
todoCount?: number | undefined;
|
|
103
102
|
component?: string | undefined;
|
|
104
103
|
redirect?: string | undefined;
|
|
105
104
|
children?: /*elided*/ any[] | undefined;
|
|
@@ -115,15 +114,14 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
115
114
|
noAuth?: boolean | undefined;
|
|
116
115
|
global?: boolean | undefined;
|
|
117
116
|
fullPathTitle?: string | undefined;
|
|
117
|
+
todoCount?: number | undefined;
|
|
118
118
|
};
|
|
119
119
|
path: string;
|
|
120
120
|
name?: string | undefined;
|
|
121
|
-
todoCount?: number | undefined;
|
|
122
121
|
component?: string | undefined;
|
|
123
122
|
redirect?: string | undefined;
|
|
124
123
|
children?: /*elided*/ any[] | undefined;
|
|
125
124
|
}[]>;
|
|
126
|
-
asyncClearMenu: () => void;
|
|
127
125
|
}, never>, Pick<{
|
|
128
126
|
hasFetchedAsyncMenus: import('vue').Ref<boolean, boolean>;
|
|
129
127
|
menus: import('vue').Ref<{
|
|
@@ -137,10 +135,10 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
137
135
|
noAuth?: boolean | undefined;
|
|
138
136
|
global?: boolean | undefined;
|
|
139
137
|
fullPathTitle?: string | undefined;
|
|
138
|
+
todoCount?: number | undefined;
|
|
140
139
|
};
|
|
141
140
|
path: string;
|
|
142
141
|
name?: string | undefined;
|
|
143
|
-
todoCount?: number | undefined;
|
|
144
142
|
component?: string | undefined;
|
|
145
143
|
redirect?: string | undefined;
|
|
146
144
|
children?: /*elided*/ any[] | undefined;
|
|
@@ -155,10 +153,10 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
155
153
|
noAuth?: boolean | undefined;
|
|
156
154
|
global?: boolean | undefined;
|
|
157
155
|
fullPathTitle?: string | undefined;
|
|
156
|
+
todoCount?: number | undefined;
|
|
158
157
|
};
|
|
159
158
|
path: string;
|
|
160
159
|
name?: string | undefined;
|
|
161
|
-
todoCount?: number | undefined;
|
|
162
160
|
component?: string | undefined;
|
|
163
161
|
redirect?: string | undefined;
|
|
164
162
|
children?: /*elided*/ any[] | undefined;
|
|
@@ -174,13 +172,12 @@ export declare const useMenuStore: import('pinia').StoreDefinition<"@jnrs/vue-co
|
|
|
174
172
|
noAuth?: boolean | undefined;
|
|
175
173
|
global?: boolean | undefined;
|
|
176
174
|
fullPathTitle?: string | undefined;
|
|
175
|
+
todoCount?: number | undefined;
|
|
177
176
|
};
|
|
178
177
|
path: string;
|
|
179
178
|
name?: string | undefined;
|
|
180
|
-
todoCount?: number | undefined;
|
|
181
179
|
component?: string | undefined;
|
|
182
180
|
redirect?: string | undefined;
|
|
183
181
|
children?: /*elided*/ any[] | undefined;
|
|
184
182
|
}[]>;
|
|
185
|
-
|
|
186
|
-
}, "asyncSetMenus" | "asyncClearMenu">>;
|
|
183
|
+
}, "asyncSetMenus">>;
|
|
@@ -1,31 +1,63 @@
|
|
|
1
|
+
type LocaleType = 'zhCn' | 'en';
|
|
2
|
+
type ThemeMode = 'light' | 'dark' | 'auto';
|
|
3
|
+
type Theme = {
|
|
4
|
+
locale: LocaleType;
|
|
5
|
+
mode: ThemeMode;
|
|
6
|
+
customColor?: string;
|
|
7
|
+
};
|
|
1
8
|
/**
|
|
2
9
|
* useSystemStore 系统仓库
|
|
3
|
-
* @returns
|
|
4
|
-
* @returns theme 主题
|
|
10
|
+
* @returns theme 主题(国际化、主题、自定义强调色)
|
|
5
11
|
* @returns menuCollapse 菜单是否折叠
|
|
6
12
|
* @returns documentFullscreen 文档是否全屏
|
|
7
13
|
* @methods toggleCollapse 折叠菜单切换
|
|
8
14
|
* @methods toggleFullScreen 全屏切换
|
|
15
|
+
* @methods setTheme 设置主题
|
|
9
16
|
*/
|
|
10
17
|
export declare const useSystemStore: import('pinia').StoreDefinition<"@jnrs/vue-core/pinia:system", Pick<{
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
theme: import('vue').Ref<{
|
|
19
|
+
locale: LocaleType;
|
|
20
|
+
mode: ThemeMode;
|
|
21
|
+
customColor?: string | undefined;
|
|
22
|
+
}, Theme | {
|
|
23
|
+
locale: LocaleType;
|
|
24
|
+
mode: ThemeMode;
|
|
25
|
+
customColor?: string | undefined;
|
|
26
|
+
}>;
|
|
13
27
|
menuCollapse: import('vue').Ref<boolean, boolean>;
|
|
14
28
|
documentFullscreen: import('vue').Ref<boolean, boolean>;
|
|
15
|
-
toggleCollapse: () =>
|
|
29
|
+
toggleCollapse: () => boolean;
|
|
16
30
|
toggleFullScreen: () => Promise<void>;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
theme: import('vue').Ref<
|
|
31
|
+
setTheme: <K extends keyof Theme>(key: K, value: Theme[K]) => void;
|
|
32
|
+
}, "theme" | "menuCollapse" | "documentFullscreen">, Pick<{
|
|
33
|
+
theme: import('vue').Ref<{
|
|
34
|
+
locale: LocaleType;
|
|
35
|
+
mode: ThemeMode;
|
|
36
|
+
customColor?: string | undefined;
|
|
37
|
+
}, Theme | {
|
|
38
|
+
locale: LocaleType;
|
|
39
|
+
mode: ThemeMode;
|
|
40
|
+
customColor?: string | undefined;
|
|
41
|
+
}>;
|
|
20
42
|
menuCollapse: import('vue').Ref<boolean, boolean>;
|
|
21
43
|
documentFullscreen: import('vue').Ref<boolean, boolean>;
|
|
22
|
-
toggleCollapse: () =>
|
|
44
|
+
toggleCollapse: () => boolean;
|
|
23
45
|
toggleFullScreen: () => Promise<void>;
|
|
46
|
+
setTheme: <K extends keyof Theme>(key: K, value: Theme[K]) => void;
|
|
24
47
|
}, never>, Pick<{
|
|
25
|
-
|
|
26
|
-
|
|
48
|
+
theme: import('vue').Ref<{
|
|
49
|
+
locale: LocaleType;
|
|
50
|
+
mode: ThemeMode;
|
|
51
|
+
customColor?: string | undefined;
|
|
52
|
+
}, Theme | {
|
|
53
|
+
locale: LocaleType;
|
|
54
|
+
mode: ThemeMode;
|
|
55
|
+
customColor?: string | undefined;
|
|
56
|
+
}>;
|
|
27
57
|
menuCollapse: import('vue').Ref<boolean, boolean>;
|
|
28
58
|
documentFullscreen: import('vue').Ref<boolean, boolean>;
|
|
29
|
-
toggleCollapse: () =>
|
|
59
|
+
toggleCollapse: () => boolean;
|
|
30
60
|
toggleFullScreen: () => Promise<void>;
|
|
31
|
-
|
|
61
|
+
setTheme: <K extends keyof Theme>(key: K, value: Theme[K]) => void;
|
|
62
|
+
}, "toggleCollapse" | "toggleFullScreen" | "setTheme">>;
|
|
63
|
+
export {};
|