mvframe 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Config.js +81 -82
- package/dist/composition.js +1 -1
- package/dist/css/cpt.css +1 -1
- package/dist/css/style.css +1 -1
- package/dist/index.js +3007 -9
- package/dist/store.js +40 -33
- package/dist/util.js +0 -1
- package/package.json +1 -1
- package/dist/vendor.js +0 -2492
package/dist/store.js
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
import { createPinia as
|
|
1
|
+
import { createPinia as p, defineStore as h } from "pinia";
|
|
2
2
|
const T = () => ({
|
|
3
|
-
lang: "en_us"
|
|
3
|
+
lang: "en_us",
|
|
4
|
+
/** 路由切换 / 异步页面 chunk 加载期间为 true,由 router guard 维护 */
|
|
5
|
+
pageLoading: !1
|
|
4
6
|
}), y = {
|
|
5
7
|
saveData(t, e) {
|
|
6
8
|
this[t] = e;
|
|
7
9
|
},
|
|
8
10
|
setLang(t) {
|
|
9
11
|
this.lang = t;
|
|
12
|
+
},
|
|
13
|
+
setPageLoading(t) {
|
|
14
|
+
this.pageLoading = !!t;
|
|
10
15
|
}
|
|
11
16
|
}, $ = {
|
|
12
17
|
state: T,
|
|
13
18
|
actions: y
|
|
14
|
-
},
|
|
19
|
+
}, d = () => ({
|
|
15
20
|
useTab: !1,
|
|
16
21
|
// 是否使用tab
|
|
17
22
|
tabs: [],
|
|
18
23
|
ctab: {}
|
|
19
24
|
// current tab
|
|
20
|
-
}),
|
|
25
|
+
}), S = {
|
|
21
26
|
saveData(t, e) {
|
|
22
27
|
this[t] = e;
|
|
23
28
|
},
|
|
@@ -32,19 +37,19 @@ const T = () => ({
|
|
|
32
37
|
return;
|
|
33
38
|
} else
|
|
34
39
|
this.closeTab(e, s);
|
|
35
|
-
const { fullPath: a, name:
|
|
36
|
-
if (
|
|
40
|
+
const { fullPath: a, name: n, meta: i, params: c, query: u } = t;
|
|
41
|
+
if (n !== "Login") {
|
|
37
42
|
const r = a.split("/");
|
|
38
43
|
let l;
|
|
39
|
-
r[r.length - 1] === "Home" ? l = r[r.length - 2] : l = r[r.length - 1],
|
|
44
|
+
r[r.length - 1] === "Home" ? l = r[r.length - 2] : l = r[r.length - 1], i.icon && (l = i.icon);
|
|
40
45
|
const b = {
|
|
41
|
-
name:
|
|
42
|
-
meta:
|
|
46
|
+
name: n,
|
|
47
|
+
meta: i,
|
|
43
48
|
path: r,
|
|
44
49
|
params: c,
|
|
45
50
|
query: u,
|
|
46
51
|
icon: l
|
|
47
|
-
}, { index: m } = this.tabs.filter1((
|
|
52
|
+
}, { index: m } = this.tabs.filter1((g) => g.name === this.ctab.name);
|
|
48
53
|
this.tabs.splice(m + 1, 0, b), this.saveCurrentTab(b);
|
|
49
54
|
}
|
|
50
55
|
},
|
|
@@ -53,20 +58,20 @@ const T = () => ({
|
|
|
53
58
|
this.tabs.splice(e, 1), t.name === this.ctab.name && ((s = globalThis.$router) == null || s.push({ name: this.tabs[e - 1 > 0 ? e - 1 : 0].name }));
|
|
54
59
|
},
|
|
55
60
|
closeRightTab(t, e) {
|
|
56
|
-
var
|
|
61
|
+
var n;
|
|
57
62
|
const s = [];
|
|
58
63
|
let a = !1;
|
|
59
|
-
this.tabs.forEach((
|
|
60
|
-
e >= c ? s.push(
|
|
61
|
-
}), this.tabs = s, a && ((
|
|
64
|
+
this.tabs.forEach((i, c) => {
|
|
65
|
+
e >= c ? s.push(i) : i.name === this.ctab.name && (a = !0);
|
|
66
|
+
}), this.tabs = s, a && ((n = globalThis.$router) == null || n.push({ name: t.name }));
|
|
62
67
|
},
|
|
63
68
|
closeLeftTab(t, e) {
|
|
64
|
-
var
|
|
69
|
+
var n;
|
|
65
70
|
const s = [];
|
|
66
71
|
let a = !1;
|
|
67
|
-
this.tabs.forEach((
|
|
68
|
-
e <= c ? s.push(
|
|
69
|
-
}), this.tabs = s, a && ((
|
|
72
|
+
this.tabs.forEach((i, c) => {
|
|
73
|
+
e <= c ? s.push(i) : i.name === this.ctab.name && (a = !0);
|
|
74
|
+
}), this.tabs = s, a && ((n = globalThis.$router) == null || n.push({ name: t.name }));
|
|
70
75
|
},
|
|
71
76
|
closeOtherTab(t, e) {
|
|
72
77
|
var s;
|
|
@@ -76,8 +81,8 @@ const T = () => ({
|
|
|
76
81
|
this.tabs = [];
|
|
77
82
|
}
|
|
78
83
|
}, v = {}, w = {
|
|
79
|
-
state:
|
|
80
|
-
actions:
|
|
84
|
+
state: d,
|
|
85
|
+
actions: S,
|
|
81
86
|
getters: v
|
|
82
87
|
}, O = () => ({
|
|
83
88
|
type: "",
|
|
@@ -88,7 +93,7 @@ const T = () => ({
|
|
|
88
93
|
x: 0,
|
|
89
94
|
y: 0
|
|
90
95
|
}
|
|
91
|
-
}),
|
|
96
|
+
}), L = {
|
|
92
97
|
saveData(t, e) {
|
|
93
98
|
this[t] = e;
|
|
94
99
|
},
|
|
@@ -101,28 +106,30 @@ const T = () => ({
|
|
|
101
106
|
y: 0
|
|
102
107
|
}, this.type = "";
|
|
103
108
|
}
|
|
104
|
-
}, N = {},
|
|
109
|
+
}, N = {}, J = {
|
|
105
110
|
state: O,
|
|
106
|
-
actions:
|
|
111
|
+
actions: L,
|
|
107
112
|
getters: N
|
|
108
|
-
},
|
|
113
|
+
}, x = p(), o = {}, D = (t) => {
|
|
114
|
+
const e = t.match(/(?:^|[/\\])([^/\\]+)\.js$/);
|
|
115
|
+
return e ? e[1] : null;
|
|
116
|
+
}, E = (t) => {
|
|
109
117
|
Object.entries(t).forEach(([e, s]) => {
|
|
110
|
-
const a = e
|
|
118
|
+
const a = D(e);
|
|
111
119
|
if (!a || !(s != null && s.default)) {
|
|
112
120
|
console.warn(`Invalid store module: ${e}`);
|
|
113
121
|
return;
|
|
114
122
|
}
|
|
115
|
-
const i = a[1].replace(/\//g, "_");
|
|
116
123
|
try {
|
|
117
|
-
o[
|
|
124
|
+
o[a] = h(a, s.default);
|
|
118
125
|
} catch (n) {
|
|
119
|
-
console.error(`Failed to register store module '${
|
|
126
|
+
console.error(`Failed to register store module '${a}':`, n);
|
|
120
127
|
}
|
|
121
128
|
});
|
|
122
129
|
};
|
|
123
130
|
o.init = h("init", $);
|
|
124
131
|
o.tab = h("tab", w);
|
|
125
|
-
o.rmenu = h("rmenu",
|
|
132
|
+
o.rmenu = h("rmenu", J);
|
|
126
133
|
const f = (t) => {
|
|
127
134
|
try {
|
|
128
135
|
switch (window.$getType(t)) {
|
|
@@ -140,16 +147,16 @@ const f = (t) => {
|
|
|
140
147
|
} catch (e) {
|
|
141
148
|
console.error(`Failed to parse '${t}' from localStorage:`, e);
|
|
142
149
|
}
|
|
143
|
-
},
|
|
150
|
+
}, F = (t, { storeChips: e, useTab: s } = {}) => {
|
|
144
151
|
try {
|
|
145
|
-
t.use(
|
|
152
|
+
t.use(x).provide("store", o);
|
|
146
153
|
} catch (a) {
|
|
147
154
|
throw new Error("Failed to inject store into app:", a);
|
|
148
155
|
}
|
|
149
156
|
return s && (o.tab().saveData("useTab", !0), f(["tabs", "ctab"])), e && E(e), o;
|
|
150
157
|
};
|
|
151
158
|
export {
|
|
152
|
-
|
|
153
|
-
|
|
159
|
+
F as a,
|
|
160
|
+
x as p,
|
|
154
161
|
o as s
|
|
155
162
|
};
|
package/dist/util.js
CHANGED