@jnrs/vue-core 1.1.3 → 1.1.5
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 +4 -0
- package/dist/components/index.js +79 -108
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.js +124 -0
- package/dist/composables/useAsyncTableHeight.d.ts +15 -0
- package/dist/constants/themeOptions.d.ts +48 -0
- package/dist/index-CfK0PRAy.js +106 -0
- package/dist/{index-DEkMXVh9.js → index-Ci9uljtG.js} +3 -9
- package/dist/index.js +2 -2
- package/dist/lib/guards.d.ts +4 -0
- package/dist/locales/en.d.ts +31 -0
- package/dist/locales/i18next.d.ts +1 -0
- package/dist/locales/index.d.ts +3 -0
- package/dist/locales/index.js +63 -0
- package/dist/locales/zhCn.d.ts +31 -0
- package/dist/piniaStore/base/auth.d.ts +123 -26
- package/dist/piniaStore/base/menu.d.ts +13 -1
- package/dist/piniaStore/base/system.d.ts +29 -21
- package/dist/piniaStore/index.js +2 -2
- package/dist/system-KZETuQYC.js +91 -0
- package/dist/vueRouter/index.js +1 -1
- package/dist/vueRouter/types.d.ts +1 -0
- package/package.json +12 -3
- package/dist/index-pLO4r50y.js +0 -94
- package/dist/system-DSegwP0Z.js +0 -1644
package/README.md
CHANGED
package/dist/components/index.js
CHANGED
|
@@ -1,122 +1,93 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".globalSetting_item[data-v-
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { ElDrawer as
|
|
4
|
-
import { u as
|
|
5
|
-
const N = /* @__PURE__ */
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".globalSetting_item[data-v-b0382b1b]{margin-bottom:20px}.globalSetting_header{margin-bottom:0;padding-bottom:20px}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
import { defineComponent as O, ref as y, createBlock as d, openBlock as n, unref as l, withCtx as r, createElementVNode as u, createVNode as _, toDisplayString as s, createElementBlock as c, Fragment as S, renderList as b, createTextVNode as f } from "vue";
|
|
3
|
+
import { ElDrawer as k, ElRadioGroup as C, ElRadio as V } from "element-plus";
|
|
4
|
+
import { u as E, L as G, M as $, C as L } from "../system-KZETuQYC.js";
|
|
5
|
+
const N = { class: "globalSetting_item" }, j = { class: "globalSetting_item" }, w = { class: "globalSetting_item" }, I = /* @__PURE__ */ O({
|
|
6
6
|
__name: "GlobalSetting",
|
|
7
|
-
setup(
|
|
8
|
-
const { theme:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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), {
|
|
7
|
+
setup(m, { expose: i }) {
|
|
8
|
+
const { theme: o, setLocale: v, setMode: g, setPrimaryColor: h } = E(), p = y(!1);
|
|
9
|
+
return i({ handleShow: () => {
|
|
10
|
+
p.value = !0;
|
|
11
|
+
} }), (a, t) => (n(), d(l(k), {
|
|
81
12
|
"header-class": "globalSetting_header",
|
|
82
|
-
modelValue:
|
|
83
|
-
"onUpdate:modelValue":
|
|
84
|
-
title: "
|
|
13
|
+
modelValue: p.value,
|
|
14
|
+
"onUpdate:modelValue": t[3] || (t[3] = (e) => p.value = e),
|
|
15
|
+
title: a.$t("@jnrs/vue-core.components.GlobalSetting.title")
|
|
85
16
|
}, {
|
|
86
|
-
default:
|
|
87
|
-
(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"model-value": t(a)[e.key],
|
|
94
|
-
onChange: (o) => t(c)(e.key, o)
|
|
17
|
+
default: r(() => [
|
|
18
|
+
u("div", N, [
|
|
19
|
+
u("h4", null, s(a.$t("@jnrs/vue-core.components.GlobalSetting.language")), 1),
|
|
20
|
+
_(l(C), {
|
|
21
|
+
modelValue: l(o).locale,
|
|
22
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => l(o).locale = e),
|
|
23
|
+
onChange: l(v)
|
|
95
24
|
}, {
|
|
96
|
-
default:
|
|
97
|
-
(n(!0),
|
|
98
|
-
|
|
99
|
-
|
|
25
|
+
default: r(() => [
|
|
26
|
+
(n(!0), c(S, null, b(l(G), (e) => (n(), d(l(V), {
|
|
27
|
+
key: e.value,
|
|
28
|
+
value: e.value
|
|
100
29
|
}, {
|
|
101
|
-
default:
|
|
102
|
-
|
|
30
|
+
default: r(() => [
|
|
31
|
+
f(s(a.$t(e.label)), 1)
|
|
103
32
|
]),
|
|
104
33
|
_: 2
|
|
105
34
|
}, 1032, ["value"]))), 128))
|
|
106
35
|
]),
|
|
107
|
-
_:
|
|
108
|
-
},
|
|
109
|
-
])
|
|
36
|
+
_: 1
|
|
37
|
+
}, 8, ["modelValue", "onChange"])
|
|
38
|
+
]),
|
|
39
|
+
u("div", j, [
|
|
40
|
+
u("h4", null, s(a.$t("@jnrs/vue-core.components.GlobalSetting.theme")), 1),
|
|
41
|
+
_(l(C), {
|
|
42
|
+
modelValue: l(o).mode,
|
|
43
|
+
"onUpdate:modelValue": t[1] || (t[1] = (e) => l(o).mode = e),
|
|
44
|
+
onChange: l(g)
|
|
45
|
+
}, {
|
|
46
|
+
default: r(() => [
|
|
47
|
+
(n(!0), c(S, null, b(l($), (e) => (n(), d(l(V), {
|
|
48
|
+
key: e.value,
|
|
49
|
+
value: e.value
|
|
50
|
+
}, {
|
|
51
|
+
default: r(() => [
|
|
52
|
+
f(s(a.$t(e.label)), 1)
|
|
53
|
+
]),
|
|
54
|
+
_: 2
|
|
55
|
+
}, 1032, ["value"]))), 128))
|
|
56
|
+
]),
|
|
57
|
+
_: 1
|
|
58
|
+
}, 8, ["modelValue", "onChange"])
|
|
59
|
+
]),
|
|
60
|
+
u("div", w, [
|
|
61
|
+
u("h4", null, s(a.$t("@jnrs/vue-core.components.GlobalSetting.primaryColor")), 1),
|
|
62
|
+
_(l(C), {
|
|
63
|
+
modelValue: l(o).primaryColor,
|
|
64
|
+
"onUpdate:modelValue": t[2] || (t[2] = (e) => l(o).primaryColor = e),
|
|
65
|
+
onChange: l(h)
|
|
66
|
+
}, {
|
|
67
|
+
default: r(() => [
|
|
68
|
+
(n(!0), c(S, null, b(l(L), (e) => (n(), d(l(V), {
|
|
69
|
+
key: e.value,
|
|
70
|
+
value: e.value
|
|
71
|
+
}, {
|
|
72
|
+
default: r(() => [
|
|
73
|
+
f(s(a.$t(e.label)), 1)
|
|
74
|
+
]),
|
|
75
|
+
_: 2
|
|
76
|
+
}, 1032, ["value"]))), 128))
|
|
77
|
+
]),
|
|
78
|
+
_: 1
|
|
79
|
+
}, 8, ["modelValue", "onChange"])
|
|
80
|
+
])
|
|
110
81
|
]),
|
|
111
82
|
_: 1
|
|
112
|
-
}, 8, ["modelValue"]));
|
|
83
|
+
}, 8, ["modelValue", "title"]));
|
|
113
84
|
}
|
|
114
|
-
}),
|
|
115
|
-
const
|
|
116
|
-
for (const [
|
|
117
|
-
|
|
118
|
-
return
|
|
119
|
-
},
|
|
85
|
+
}), P = (m, i) => {
|
|
86
|
+
const o = m.__vccOpts || m;
|
|
87
|
+
for (const [v, g] of i)
|
|
88
|
+
o[v] = g;
|
|
89
|
+
return o;
|
|
90
|
+
}, M = /* @__PURE__ */ P(I, [["__scopeId", "data-v-b0382b1b"]]);
|
|
120
91
|
export {
|
|
121
|
-
|
|
92
|
+
M as GlobalSetting
|
|
122
93
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useAsyncTableHeight } from './useAsyncTableHeight';
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { ref as M, onMounted as N, onUnmounted as P } from "vue";
|
|
2
|
+
var R = typeof global == "object" && global && global.Object === Object && global, B = typeof self == "object" && self && self.Object === Object && self, k = R || B || Function("return this")(), T = k.Symbol, L = Object.prototype, F = L.hasOwnProperty, U = L.toString, m = T ? T.toStringTag : void 0;
|
|
3
|
+
function z(e) {
|
|
4
|
+
var n = F.call(e, m), i = e[m];
|
|
5
|
+
try {
|
|
6
|
+
e[m] = void 0;
|
|
7
|
+
var o = !0;
|
|
8
|
+
} catch {
|
|
9
|
+
}
|
|
10
|
+
var a = U.call(e);
|
|
11
|
+
return o && (n ? e[m] = i : delete e[m]), a;
|
|
12
|
+
}
|
|
13
|
+
var G = Object.prototype, _ = G.toString;
|
|
14
|
+
function q(e) {
|
|
15
|
+
return _.call(e);
|
|
16
|
+
}
|
|
17
|
+
var D = "[object Null]", X = "[object Undefined]", E = T ? T.toStringTag : void 0;
|
|
18
|
+
function J(e) {
|
|
19
|
+
return e == null ? e === void 0 ? X : D : E && E in Object(e) ? z(e) : q(e);
|
|
20
|
+
}
|
|
21
|
+
function K(e) {
|
|
22
|
+
return e != null && typeof e == "object";
|
|
23
|
+
}
|
|
24
|
+
var Q = "[object Symbol]";
|
|
25
|
+
function V(e) {
|
|
26
|
+
return typeof e == "symbol" || K(e) && J(e) == Q;
|
|
27
|
+
}
|
|
28
|
+
var Y = /\s/;
|
|
29
|
+
function Z(e) {
|
|
30
|
+
for (var n = e.length; n-- && Y.test(e.charAt(n)); )
|
|
31
|
+
;
|
|
32
|
+
return n;
|
|
33
|
+
}
|
|
34
|
+
var ee = /^\s+/;
|
|
35
|
+
function ne(e) {
|
|
36
|
+
return e && e.slice(0, Z(e) + 1).replace(ee, "");
|
|
37
|
+
}
|
|
38
|
+
function v(e) {
|
|
39
|
+
var n = typeof e;
|
|
40
|
+
return e != null && (n == "object" || n == "function");
|
|
41
|
+
}
|
|
42
|
+
var w = NaN, te = /^[-+]0x[0-9a-f]+$/i, re = /^0b[01]+$/i, ie = /^0o[0-7]+$/i, oe = parseInt;
|
|
43
|
+
function $(e) {
|
|
44
|
+
if (typeof e == "number")
|
|
45
|
+
return e;
|
|
46
|
+
if (V(e))
|
|
47
|
+
return w;
|
|
48
|
+
if (v(e)) {
|
|
49
|
+
var n = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
50
|
+
e = v(n) ? n + "" : n;
|
|
51
|
+
}
|
|
52
|
+
if (typeof e != "string")
|
|
53
|
+
return e === 0 ? e : +e;
|
|
54
|
+
e = ne(e);
|
|
55
|
+
var i = re.test(e);
|
|
56
|
+
return i || ie.test(e) ? oe(e.slice(2), i ? 2 : 8) : te.test(e) ? w : +e;
|
|
57
|
+
}
|
|
58
|
+
var j = function() {
|
|
59
|
+
return k.Date.now();
|
|
60
|
+
}, ae = "Expected a function", ce = Math.max, fe = Math.min;
|
|
61
|
+
function ue(e, n, i) {
|
|
62
|
+
var o, a, f, u, r, c, s = 0, S = !1, l = !1, y = !0;
|
|
63
|
+
if (typeof e != "function")
|
|
64
|
+
throw new TypeError(ae);
|
|
65
|
+
n = $(n) || 0, v(i) && (S = !!i.leading, l = "maxWait" in i, f = l ? ce($(i.maxWait) || 0, n) : f, y = "trailing" in i ? !!i.trailing : y);
|
|
66
|
+
function p(t) {
|
|
67
|
+
var d = o, g = a;
|
|
68
|
+
return o = a = void 0, s = t, u = e.apply(g, d), u;
|
|
69
|
+
}
|
|
70
|
+
function H(t) {
|
|
71
|
+
return s = t, r = setTimeout(b, n), S ? p(t) : u;
|
|
72
|
+
}
|
|
73
|
+
function W(t) {
|
|
74
|
+
var d = t - c, g = t - s, I = n - d;
|
|
75
|
+
return l ? fe(I, f - g) : I;
|
|
76
|
+
}
|
|
77
|
+
function O(t) {
|
|
78
|
+
var d = t - c, g = t - s;
|
|
79
|
+
return c === void 0 || d >= n || d < 0 || l && g >= f;
|
|
80
|
+
}
|
|
81
|
+
function b() {
|
|
82
|
+
var t = j();
|
|
83
|
+
if (O(t))
|
|
84
|
+
return x(t);
|
|
85
|
+
r = setTimeout(b, W(t));
|
|
86
|
+
}
|
|
87
|
+
function x(t) {
|
|
88
|
+
return r = void 0, y && o ? p(t) : (o = a = void 0, u);
|
|
89
|
+
}
|
|
90
|
+
function A() {
|
|
91
|
+
r !== void 0 && clearTimeout(r), s = 0, o = c = a = r = void 0;
|
|
92
|
+
}
|
|
93
|
+
function C() {
|
|
94
|
+
return r === void 0 ? u : x(j());
|
|
95
|
+
}
|
|
96
|
+
function h() {
|
|
97
|
+
var t = j(), d = O(t);
|
|
98
|
+
if (o = arguments, a = this, c = t, d) {
|
|
99
|
+
if (r === void 0)
|
|
100
|
+
return H(c);
|
|
101
|
+
if (l)
|
|
102
|
+
return clearTimeout(r), r = setTimeout(b, n), p(c);
|
|
103
|
+
}
|
|
104
|
+
return r === void 0 && (r = setTimeout(b, n)), u;
|
|
105
|
+
}
|
|
106
|
+
return h.cancel = A, h.flush = C, h;
|
|
107
|
+
}
|
|
108
|
+
const de = (e = "el-table", n = 36, i = 40) => {
|
|
109
|
+
const o = M(500), a = ue(() => {
|
|
110
|
+
const f = document.querySelector(`.${e}`);
|
|
111
|
+
if (f) {
|
|
112
|
+
const u = f.getBoundingClientRect(), r = window.innerHeight, c = u.top + n + i, s = r - c;
|
|
113
|
+
o.value = s > 100 ? s : 100;
|
|
114
|
+
}
|
|
115
|
+
}, 300);
|
|
116
|
+
return N(() => {
|
|
117
|
+
a(), window.addEventListener("resize", a);
|
|
118
|
+
}), P(() => {
|
|
119
|
+
window.removeEventListener("resize", a);
|
|
120
|
+
}), { maxHeight: o };
|
|
121
|
+
};
|
|
122
|
+
export {
|
|
123
|
+
de as useAsyncTableHeight
|
|
124
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author : TanRui
|
|
3
|
+
* @WeChat : Tan578853789
|
|
4
|
+
* @File : useAsyncTableHeight.ts
|
|
5
|
+
* @Date : 2025/12/09
|
|
6
|
+
* @Desc. : 根据视口动态计算表格高度
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @param {*} className 表格类名,默认值 el-table,如果页面存在多个表格,则必须分别传入自定义类名
|
|
10
|
+
* @param {*} FOOT_HEIGHT 总底部高度
|
|
11
|
+
* @param {*} PADDING_HEIGHT 总边距
|
|
12
|
+
*/
|
|
13
|
+
export declare const useAsyncTableHeight: (className?: string, FOOT_HEIGHT?: number, PADDING_HEIGHT?: number) => {
|
|
14
|
+
maxHeight: import('vue').Ref<number, number>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 语言选项
|
|
3
|
+
*/
|
|
4
|
+
export declare const LOCALE_OPTIONS: readonly [{
|
|
5
|
+
readonly value: "zhCn";
|
|
6
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.languageOptions.zhCn";
|
|
7
|
+
}, {
|
|
8
|
+
readonly value: "en";
|
|
9
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.languageOptions.en";
|
|
10
|
+
}];
|
|
11
|
+
/**
|
|
12
|
+
* 主题模式选项
|
|
13
|
+
*/
|
|
14
|
+
export declare const MODE_OPTIONS: readonly [{
|
|
15
|
+
readonly value: "auto";
|
|
16
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.themeOptions.auto";
|
|
17
|
+
}, {
|
|
18
|
+
readonly value: "light";
|
|
19
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.themeOptions.light";
|
|
20
|
+
}, {
|
|
21
|
+
readonly value: "dark";
|
|
22
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.themeOptions.dark";
|
|
23
|
+
}];
|
|
24
|
+
/**
|
|
25
|
+
* 强调色选项
|
|
26
|
+
*/
|
|
27
|
+
export declare const COLOR_OPTIONS: readonly [{
|
|
28
|
+
readonly value: "oklch(0.6 0.19 41)";
|
|
29
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.jnrs";
|
|
30
|
+
}, {
|
|
31
|
+
readonly value: "oklch(0.51 0.21 264)";
|
|
32
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.azure";
|
|
33
|
+
}, {
|
|
34
|
+
readonly value: "oklch(0.90 0.16 98)";
|
|
35
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.moonYellow";
|
|
36
|
+
}, {
|
|
37
|
+
readonly value: "oklch(0.63 0.25 27)";
|
|
38
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.jdRed";
|
|
39
|
+
}, {
|
|
40
|
+
readonly value: "oklch(0.65 0.24 33)";
|
|
41
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.taobaoRed";
|
|
42
|
+
}, {
|
|
43
|
+
readonly value: "oklch(0.61 0.20 261)";
|
|
44
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.dingtalkBlue";
|
|
45
|
+
}, {
|
|
46
|
+
readonly value: "oklch(0.70 0.12 152)";
|
|
47
|
+
readonly label: "@jnrs/vue-core.components.GlobalSetting.primaryColorOptions.wechatGreen";
|
|
48
|
+
}];
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import "pinia-plugin-persistedstate";
|
|
2
|
+
import { u as p } from "./system-KZETuQYC.js";
|
|
3
|
+
import { ref as c } from "vue";
|
|
4
|
+
import { defineStore as m } from "pinia";
|
|
5
|
+
import { a as v } from "./index-Ci9uljtG.js";
|
|
6
|
+
const y = m(
|
|
7
|
+
"@jnrs/vue-core/pinia:auth",
|
|
8
|
+
() => {
|
|
9
|
+
const e = c(!1), t = c(null), u = c(null), o = c([]), l = c([]);
|
|
10
|
+
return {
|
|
11
|
+
hasAuthenticated: e,
|
|
12
|
+
token: t,
|
|
13
|
+
userInfo: u,
|
|
14
|
+
dict: o,
|
|
15
|
+
role: l,
|
|
16
|
+
setUserInfo: (r) => {
|
|
17
|
+
u.value = r;
|
|
18
|
+
},
|
|
19
|
+
setToken: (r) => {
|
|
20
|
+
t.value = r, e.value = !0;
|
|
21
|
+
},
|
|
22
|
+
setDict: (r) => {
|
|
23
|
+
o.value = r;
|
|
24
|
+
},
|
|
25
|
+
setRole: (r) => {
|
|
26
|
+
l.value = r;
|
|
27
|
+
},
|
|
28
|
+
clearAuth: () => {
|
|
29
|
+
t.value = null, u.value = null, o.value = [], l.value = [], e.value = !1;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
persist: {
|
|
35
|
+
pick: ["hasAuthenticated", "token", "userInfo", "dict"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
), n = [];
|
|
39
|
+
for (let e = 0; e < 256; ++e)
|
|
40
|
+
n.push((e + 256).toString(16).slice(1));
|
|
41
|
+
function h(e, t = 0) {
|
|
42
|
+
return (n[e[t + 0]] + n[e[t + 1]] + n[e[t + 2]] + n[e[t + 3]] + "-" + n[e[t + 4]] + n[e[t + 5]] + "-" + n[e[t + 6]] + n[e[t + 7]] + "-" + n[e[t + 8]] + n[e[t + 9]] + "-" + n[e[t + 10]] + n[e[t + 11]] + n[e[t + 12]] + n[e[t + 13]] + n[e[t + 14]] + n[e[t + 15]]).toLowerCase();
|
|
43
|
+
}
|
|
44
|
+
let i;
|
|
45
|
+
const g = new Uint8Array(16);
|
|
46
|
+
function f() {
|
|
47
|
+
if (!i) {
|
|
48
|
+
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
49
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
50
|
+
i = crypto.getRandomValues.bind(crypto);
|
|
51
|
+
}
|
|
52
|
+
return i(g);
|
|
53
|
+
}
|
|
54
|
+
const b = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), d = { randomUUID: b };
|
|
55
|
+
function U(e, t, u) {
|
|
56
|
+
e = e || {};
|
|
57
|
+
const o = e.random ?? e.rng?.() ?? f();
|
|
58
|
+
if (o.length < 16)
|
|
59
|
+
throw new Error("Random bytes length must be >= 16");
|
|
60
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, h(o);
|
|
61
|
+
}
|
|
62
|
+
function x(e, t, u) {
|
|
63
|
+
return d.randomUUID && !e ? d.randomUUID() : U(e);
|
|
64
|
+
}
|
|
65
|
+
const S = m(
|
|
66
|
+
"@jnrs/vue-core/pinia:menu",
|
|
67
|
+
() => {
|
|
68
|
+
const e = c(!1), t = c([]), u = async (a) => {
|
|
69
|
+
if (e.value)
|
|
70
|
+
return t.value;
|
|
71
|
+
o(a), t.value = a, e.value = !0;
|
|
72
|
+
try {
|
|
73
|
+
await v(t.value);
|
|
74
|
+
} catch (s) {
|
|
75
|
+
throw s;
|
|
76
|
+
}
|
|
77
|
+
return t.value;
|
|
78
|
+
}, o = (a) => {
|
|
79
|
+
for (const s of a)
|
|
80
|
+
s.meta.uuid = x(), s.children && o(s.children);
|
|
81
|
+
};
|
|
82
|
+
return { hasFetchedAsyncMenus: e, menus: t, asyncSetMenus: u, clearMenu: () => {
|
|
83
|
+
e.value = !1, t.value = [];
|
|
84
|
+
} };
|
|
85
|
+
}
|
|
86
|
+
// {
|
|
87
|
+
// persist: {
|
|
88
|
+
// pick: ['menus']
|
|
89
|
+
// }
|
|
90
|
+
// }
|
|
91
|
+
);
|
|
92
|
+
console.log(
|
|
93
|
+
"%c✨ 欢迎使用 @jnrs/vue-core/pinia",
|
|
94
|
+
'background: #42B883; color: #39495C; font-weight: bold; padding: 4px 8px; border-radius: 4px; font-family: "Helvetica Neue", sans-serif;'
|
|
95
|
+
);
|
|
96
|
+
const _ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
97
|
+
__proto__: null,
|
|
98
|
+
useAuthStore: y,
|
|
99
|
+
useMenuStore: S,
|
|
100
|
+
useSystemStore: p
|
|
101
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
102
|
+
export {
|
|
103
|
+
S as a,
|
|
104
|
+
_ as i,
|
|
105
|
+
y as u
|
|
106
|
+
};
|
|
@@ -4,24 +4,18 @@ const h = {
|
|
|
4
4
|
routes: []
|
|
5
5
|
};
|
|
6
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(
|
|
7
|
+
const f = ({ options: o, fileModules: t, layoutName: e, globalComponent: a, handleBeforeEach: r }) => (s = t, e && (i = e), a && (m = a), n = d({ ...h, ...o }), n.beforeEach(
|
|
14
8
|
async (c, u) => r?.(c, u)
|
|
15
9
|
), n), g = async (o, t = "push") => {
|
|
16
10
|
try {
|
|
17
11
|
return await n[t](o);
|
|
18
12
|
} catch (e) {
|
|
19
|
-
console.warn(`router.${t} 失败`, {
|
|
13
|
+
n[t]({ name: "404" }), console.warn(`router.${t} 失败`, {
|
|
20
14
|
code: "ROUTER_NOT_MATCH",
|
|
21
15
|
message: "未匹配到有效路由",
|
|
22
16
|
error: o || e,
|
|
23
17
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
24
|
-
})
|
|
18
|
+
});
|
|
25
19
|
}
|
|
26
20
|
}, _ = (o) => s[`/src/views${o}.vue`], l = async (o, t) => {
|
|
27
21
|
for (const e of o) {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as r } from "./index-
|
|
2
|
-
import { i } from "./index-
|
|
1
|
+
import { c as r } from "./index-Ci9uljtG.js";
|
|
2
|
+
import { i } from "./index-CfK0PRAy.js";
|
|
3
3
|
console.log(
|
|
4
4
|
"%c✨ 欢迎使用 @jnrs/vue-core",
|
|
5
5
|
'background: #42B883; color: #39495C; font-weight: bold; padding: 4px 8px; border-radius: 4px; font-family: "Helvetica Neue", sans-serif;'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'@jnrs/vue-core': {
|
|
3
|
+
components: {
|
|
4
|
+
GlobalSetting: {
|
|
5
|
+
title: string;
|
|
6
|
+
language: string;
|
|
7
|
+
languageOptions: {
|
|
8
|
+
zhCn: string;
|
|
9
|
+
en: string;
|
|
10
|
+
};
|
|
11
|
+
theme: string;
|
|
12
|
+
themeOptions: {
|
|
13
|
+
light: string;
|
|
14
|
+
dark: string;
|
|
15
|
+
auto: string;
|
|
16
|
+
};
|
|
17
|
+
primaryColor: string;
|
|
18
|
+
primaryColorOptions: {
|
|
19
|
+
jnrs: string;
|
|
20
|
+
azure: string;
|
|
21
|
+
moonYellow: string;
|
|
22
|
+
jdRed: string;
|
|
23
|
+
taobaoRed: string;
|
|
24
|
+
dingtalkBlue: string;
|
|
25
|
+
wechatGreen: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
"@jnrs/vue-core": {
|
|
3
|
+
components: {
|
|
4
|
+
GlobalSetting: {
|
|
5
|
+
title: "全局偏好设置",
|
|
6
|
+
language: "语言",
|
|
7
|
+
languageOptions: {
|
|
8
|
+
zhCn: "简体中文",
|
|
9
|
+
en: "English"
|
|
10
|
+
},
|
|
11
|
+
theme: "主题",
|
|
12
|
+
themeOptions: {
|
|
13
|
+
light: "浅色",
|
|
14
|
+
dark: "深色",
|
|
15
|
+
auto: "跟随系统"
|
|
16
|
+
},
|
|
17
|
+
primaryColor: "强调色",
|
|
18
|
+
primaryColorOptions: {
|
|
19
|
+
jnrs: "JNRS",
|
|
20
|
+
azure: "蔚蓝",
|
|
21
|
+
moonYellow: "月黄",
|
|
22
|
+
jdRed: "京东红",
|
|
23
|
+
taobaoRed: "淘宝红",
|
|
24
|
+
dingtalkBlue: "钉钉蓝",
|
|
25
|
+
wechatGreen: "微信绿"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}, o = {
|
|
31
|
+
"@jnrs/vue-core": {
|
|
32
|
+
components: {
|
|
33
|
+
GlobalSetting: {
|
|
34
|
+
title: "Global Preferences",
|
|
35
|
+
language: "Language",
|
|
36
|
+
languageOptions: {
|
|
37
|
+
zhCn: "简体中文",
|
|
38
|
+
en: "English"
|
|
39
|
+
},
|
|
40
|
+
theme: "Theme",
|
|
41
|
+
themeOptions: {
|
|
42
|
+
light: "Light",
|
|
43
|
+
dark: "Dark",
|
|
44
|
+
auto: "Follow System"
|
|
45
|
+
},
|
|
46
|
+
primaryColor: "Primary Color",
|
|
47
|
+
primaryColorOptions: {
|
|
48
|
+
jnrs: "JNRS",
|
|
49
|
+
azure: "Azure",
|
|
50
|
+
moonYellow: "Moon Yellow",
|
|
51
|
+
jdRed: "JD Red",
|
|
52
|
+
taobaoRed: "Taobao Red",
|
|
53
|
+
dingtalkBlue: "DingTalk Blue",
|
|
54
|
+
wechatGreen: "WeChat Green"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
o as en,
|
|
62
|
+
e as zhCn
|
|
63
|
+
};
|