mvframe 1.0.20 → 1.0.58
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/.cursor/rules/component-hierarchy.mdc +63 -0
- package/.cursor/rules/data.mdc +70 -0
- package/.cursor/rules/global-components.mdc +49 -0
- package/.cursor/rules/router.mdc +17 -0
- package/.cursor/rules/script-setup.mdc +33 -0
- package/.cursor/rules/style-system.mdc +219 -0
- package/.cursor/rules/util.mdc +60 -0
- package/.cursor/rules/views.mdc +69 -0
- package/.cursor/skills/mvframe-app-init/SKILL.md +1 -1
- package/README.cn.md +1 -1
- package/README.md +1 -1
- package/dist/Config.js +77 -160
- package/dist/composition.js +414 -244
- package/dist/css/cpt.css +1 -1
- package/dist/css/style.css +1 -1
- package/dist/index.js +1 -1
- package/dist/lodash.js +1 -1
- package/dist/maps.js +6 -5
- package/dist/store-shared.js +72 -58
- package/dist/util.js +67 -65
- package/dist/vendor.js +6274 -2232
- package/package.json +6 -2
- package/scripts/install-cursor-skill.js +0 -0
- package/scripts/scaffold-app.js +29 -0
package/dist/composition.js
CHANGED
|
@@ -1,240 +1,248 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { M as B, g as U, s as V } from "./vendor.js";
|
|
2
|
+
import { a as Se, m as $e, b as Pe, c as Me, p as Le, u as Ae } from "./vendor.js";
|
|
3
|
+
import C from "axios";
|
|
4
|
+
const W = "lang", pe = (e, t) => {
|
|
5
|
+
var i, l;
|
|
6
|
+
const n = typeof window < "u", r = () => {
|
|
7
|
+
var m;
|
|
8
|
+
if (!n)
|
|
8
9
|
return { innerWidth: 1920, innerHeight: 1080 };
|
|
9
|
-
const
|
|
10
|
-
innerWidth:
|
|
11
|
-
innerHeight:
|
|
12
|
-
outerWidth:
|
|
13
|
-
outerHeight:
|
|
14
|
-
screenWidth:
|
|
15
|
-
screenHeight:
|
|
16
|
-
availWidth:
|
|
17
|
-
availHeight:
|
|
18
|
-
devicePixelRatio:
|
|
19
|
-
bodyHeight:
|
|
10
|
+
const s = window, c = typeof navigator < "u" ? s.navigator : {}, u = s.screen || {}, d = s.visualViewport, a = {
|
|
11
|
+
innerWidth: s.innerWidth,
|
|
12
|
+
innerHeight: s.innerHeight,
|
|
13
|
+
outerWidth: s.outerWidth,
|
|
14
|
+
outerHeight: s.outerHeight,
|
|
15
|
+
screenWidth: u.width ?? s.innerWidth,
|
|
16
|
+
screenHeight: u.height ?? s.innerHeight,
|
|
17
|
+
availWidth: u.availWidth ?? s.innerWidth,
|
|
18
|
+
availHeight: u.availHeight ?? s.innerHeight,
|
|
19
|
+
devicePixelRatio: s.devicePixelRatio || 1,
|
|
20
|
+
bodyHeight: s.innerHeight - ((m = t.pinia) != null && m.useTab ? 36 : 0) - 64 - 32,
|
|
21
|
+
drawerHeight: parseInt(s.innerHeight * 0.9),
|
|
22
|
+
pageHeight: s.innerHeight - 64 - 32,
|
|
23
|
+
pageWidth: s.innerWidth
|
|
20
24
|
};
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
userAgent:
|
|
25
|
-
language:
|
|
26
|
-
languages:
|
|
27
|
-
platform:
|
|
28
|
-
cookieEnabled: !!
|
|
29
|
-
onLine:
|
|
30
|
-
maxTouchPoints:
|
|
31
|
-
isTouch: "ontouchstart" in
|
|
25
|
+
d && (a.visualViewportWidth = d.width, a.visualViewportHeight = d.height, a.visualViewportScale = d.scale);
|
|
26
|
+
const g = c.userAgent || "";
|
|
27
|
+
return a.env = {
|
|
28
|
+
userAgent: g,
|
|
29
|
+
language: c.language || "",
|
|
30
|
+
languages: c.languages ? [...c.languages] : [],
|
|
31
|
+
platform: c.platform || "",
|
|
32
|
+
cookieEnabled: !!c.cookieEnabled,
|
|
33
|
+
onLine: c.onLine !== !1,
|
|
34
|
+
maxTouchPoints: c.maxTouchPoints || 0,
|
|
35
|
+
isTouch: "ontouchstart" in s || (c.maxTouchPoints || 0) > 0,
|
|
32
36
|
isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(
|
|
33
|
-
|
|
37
|
+
g
|
|
34
38
|
)
|
|
35
|
-
}, console.info(
|
|
39
|
+
}, console.info(a), a;
|
|
36
40
|
}, o = () => {
|
|
37
|
-
var
|
|
38
|
-
const
|
|
41
|
+
var c;
|
|
42
|
+
const s = r();
|
|
39
43
|
globalThis.$config = globalThis.$config || {}, globalThis.$config.options = {
|
|
40
44
|
...globalThis.$config.options || {},
|
|
41
|
-
...
|
|
42
|
-
}, (
|
|
45
|
+
...s
|
|
46
|
+
}, (c = e == null ? void 0 : e.config) != null && c.globalProperties && (e.config.globalProperties.$config = globalThis.$config);
|
|
43
47
|
};
|
|
44
|
-
o(),
|
|
48
|
+
o(), n && (window.addEventListener("resize", o, { passive: !0 }), (l = (i = window.visualViewport) == null ? void 0 : i.addEventListener) == null || l.call(i, "resize", o, {
|
|
45
49
|
passive: !0
|
|
46
50
|
}));
|
|
47
|
-
},
|
|
48
|
-
var
|
|
49
|
-
const
|
|
51
|
+
}, ge = (e, t) => {
|
|
52
|
+
var c, u, d;
|
|
53
|
+
const n = t || {}, r = Array.isArray(n.use) && n.use.length > 0 ? n.use : B;
|
|
54
|
+
globalThis.$config = globalThis.$config || {}, globalThis.$config.langUse = r.filter(
|
|
55
|
+
(a) => a && a.use !== !1 && a.value
|
|
56
|
+
), (c = e == null ? void 0 : e.config) != null && c.globalProperties && (e.config.globalProperties.$config = globalThis.$config);
|
|
57
|
+
const i = (typeof localStorage < "u" ? localStorage.getItem(W) : null) || ((u = globalThis.$config) == null ? void 0 : u.lang) || "en_us", l = Object.assign(
|
|
50
58
|
{},
|
|
51
|
-
|
|
52
|
-
((
|
|
53
|
-
|
|
54
|
-
), s = (
|
|
55
|
-
if (
|
|
56
|
-
if (
|
|
57
|
-
let
|
|
58
|
-
return Object.keys(
|
|
59
|
-
|
|
60
|
-
}),
|
|
59
|
+
U(i),
|
|
60
|
+
((d = globalThis.$config) == null ? void 0 : d.langMaps) || {},
|
|
61
|
+
n.langMaps || {}
|
|
62
|
+
), s = (a, g) => {
|
|
63
|
+
if (a)
|
|
64
|
+
if (g && globalThis.$getType(g) === "Object") {
|
|
65
|
+
let m = l[a] || a;
|
|
66
|
+
return Object.keys(g).forEach((p) => {
|
|
67
|
+
m[`{${p}}`] = g[p];
|
|
68
|
+
}), m;
|
|
61
69
|
} else
|
|
62
|
-
return l[
|
|
70
|
+
return l[a] || a;
|
|
63
71
|
else
|
|
64
|
-
return
|
|
72
|
+
return a ?? "";
|
|
65
73
|
};
|
|
66
|
-
globalThis.$patchLangMaps = (
|
|
67
|
-
|
|
68
|
-
}, globalThis.$l = s,
|
|
74
|
+
globalThis.$patchLangMaps = (a) => {
|
|
75
|
+
a && globalThis.$getType(a) === "Object" && Object.assign(l, a);
|
|
76
|
+
}, globalThis.$l = s, e.config.globalProperties.$l = s, e.config.globalProperties.$patchLangMaps = globalThis.$patchLangMaps, String.prototype.$l = function() {
|
|
69
77
|
return $l(this);
|
|
70
78
|
};
|
|
71
|
-
},
|
|
72
|
-
if (!
|
|
73
|
-
const
|
|
74
|
-
return o &&
|
|
75
|
-
},
|
|
76
|
-
if (
|
|
77
|
-
if (
|
|
78
|
-
return JSON.stringify(
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
81
|
-
for (const o of
|
|
82
|
-
if (!
|
|
79
|
+
}, he = (e, t) => {
|
|
80
|
+
if (!e || !t) return !1;
|
|
81
|
+
const n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), o = r.right > n.left && r.left < n.right, i = r.bottom > n.top && r.top < n.bottom;
|
|
82
|
+
return o && i;
|
|
83
|
+
}, N = (e, t) => {
|
|
84
|
+
if (e === t) return !0;
|
|
85
|
+
if (e == null || t == null || typeof e != "object" || typeof t != "object")
|
|
86
|
+
return JSON.stringify(e) === JSON.stringify(t);
|
|
87
|
+
const n = Object.keys(e), r = Object.keys(t);
|
|
88
|
+
if (n.length !== r.length) return !1;
|
|
89
|
+
for (const o of n)
|
|
90
|
+
if (!r.includes(o) || !N(e[o], t[o])) return !1;
|
|
83
91
|
return !0;
|
|
84
|
-
},
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
87
|
-
const
|
|
88
|
-
return
|
|
89
|
-
},
|
|
90
|
-
const
|
|
91
|
-
return
|
|
92
|
-
},
|
|
93
|
-
const
|
|
94
|
-
o.href =
|
|
92
|
+
}, x = "download", q = 150, F = (e, t = x) => {
|
|
93
|
+
const n = t || x, r = String(e ?? "").trim();
|
|
94
|
+
if (!r) return n;
|
|
95
|
+
const i = r.replace(/[/\\?%*:|"<>]/g, "_").replace(/\.\./g, "_").split(/[/\\]/).pop() || n, l = 200;
|
|
96
|
+
return i.length > l ? i.slice(0, l) : i;
|
|
97
|
+
}, D = (e) => {
|
|
98
|
+
const t = ((e == null ? void 0 : e.type) || "").toLowerCase();
|
|
99
|
+
return t ? t.includes("spreadsheet") || t.includes("ms-excel") || t.includes("excel") && t.includes("application") : !1;
|
|
100
|
+
}, $ = (e, t) => {
|
|
101
|
+
const n = URL.createObjectURL(e), r = F(t), o = document.createElement("a");
|
|
102
|
+
o.href = n, o.download = r, o.style.display = "none", document.body.appendChild(o);
|
|
95
103
|
try {
|
|
96
104
|
o.click();
|
|
97
105
|
} finally {
|
|
98
|
-
document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(
|
|
106
|
+
document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(n), q);
|
|
99
107
|
}
|
|
100
|
-
},
|
|
101
|
-
if (!
|
|
102
|
-
return
|
|
103
|
-
const { type:
|
|
104
|
-
return
|
|
105
|
-
...
|
|
108
|
+
}, z = (e) => {
|
|
109
|
+
if (!e || e.source !== void 0 || e.type === void 0)
|
|
110
|
+
return e;
|
|
111
|
+
const { type: t, data: n, url: r, headers: o, name: i, filename: l, init: s, ...c } = e, u = l ?? i;
|
|
112
|
+
return t === "csv" ? {
|
|
113
|
+
...c,
|
|
106
114
|
source: "inline",
|
|
107
|
-
content:
|
|
108
|
-
filename:
|
|
109
|
-
bom:
|
|
110
|
-
} :
|
|
111
|
-
...
|
|
115
|
+
content: n,
|
|
116
|
+
filename: u,
|
|
117
|
+
bom: e.bom
|
|
118
|
+
} : t === "excel" ? {
|
|
119
|
+
...c,
|
|
112
120
|
source: "fetch",
|
|
113
|
-
url:
|
|
114
|
-
init: { ...
|
|
121
|
+
url: r,
|
|
122
|
+
init: { ...s || {}, headers: o ?? (s == null ? void 0 : s.headers) },
|
|
115
123
|
response: "blob",
|
|
116
124
|
expectExcel: !0,
|
|
117
|
-
filename:
|
|
118
|
-
} :
|
|
119
|
-
},
|
|
120
|
-
const
|
|
121
|
-
source:
|
|
122
|
-
content:
|
|
125
|
+
filename: u
|
|
126
|
+
} : e;
|
|
127
|
+
}, me = async (e = {}) => {
|
|
128
|
+
const t = z(e), {
|
|
129
|
+
source: n = "inline",
|
|
130
|
+
content: r,
|
|
123
131
|
blob: o,
|
|
124
|
-
bom:
|
|
125
|
-
mime:
|
|
126
|
-
url:
|
|
127
|
-
init:
|
|
128
|
-
response:
|
|
129
|
-
openIn:
|
|
130
|
-
expectExcel:
|
|
131
|
-
filename:
|
|
132
|
-
name:
|
|
133
|
-
error:
|
|
132
|
+
bom: i = !0,
|
|
133
|
+
mime: l,
|
|
134
|
+
url: s,
|
|
135
|
+
init: c,
|
|
136
|
+
response: u = "blob",
|
|
137
|
+
openIn: d = "self",
|
|
138
|
+
expectExcel: a,
|
|
139
|
+
filename: g,
|
|
140
|
+
name: m,
|
|
141
|
+
error: p = () => {
|
|
134
142
|
},
|
|
135
143
|
// 避免 legacy 字段渗入后续逻辑
|
|
136
|
-
type:
|
|
137
|
-
data:
|
|
138
|
-
headers:
|
|
139
|
-
...
|
|
140
|
-
} =
|
|
144
|
+
type: le,
|
|
145
|
+
data: ae,
|
|
146
|
+
headers: ce,
|
|
147
|
+
...ue
|
|
148
|
+
} = t, v = g ?? m;
|
|
141
149
|
try {
|
|
142
|
-
if (
|
|
150
|
+
if (n === "inline") {
|
|
143
151
|
if (o instanceof Blob) {
|
|
144
|
-
|
|
152
|
+
$(o, v);
|
|
145
153
|
return;
|
|
146
154
|
}
|
|
147
|
-
if (
|
|
148
|
-
|
|
155
|
+
if (r == null) {
|
|
156
|
+
p(new Error("content or blob is required for inline"));
|
|
149
157
|
return;
|
|
150
158
|
}
|
|
151
|
-
const
|
|
152
|
-
|
|
159
|
+
const f = typeof r == "string" ? r : String(r), R = i ? "\uFEFF" + f : f, S = l || (i ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
|
|
160
|
+
$(new Blob([R], { type: S }), v);
|
|
153
161
|
return;
|
|
154
162
|
}
|
|
155
|
-
if (
|
|
156
|
-
if (!
|
|
157
|
-
|
|
163
|
+
if (n === "fetch") {
|
|
164
|
+
if (!s) {
|
|
165
|
+
p(new Error("url is required for fetch"));
|
|
158
166
|
return;
|
|
159
167
|
}
|
|
160
|
-
const
|
|
161
|
-
if (!
|
|
162
|
-
|
|
168
|
+
const f = await fetch(s, c);
|
|
169
|
+
if (!f.ok) {
|
|
170
|
+
p(new Error(`fetch failed: ${f.status}`));
|
|
163
171
|
return;
|
|
164
172
|
}
|
|
165
|
-
if (
|
|
166
|
-
const
|
|
167
|
-
|
|
173
|
+
if (u === "text") {
|
|
174
|
+
const S = await f.text(), H = i ? "\uFEFF" + S : S, j = l || (i ? "text/csv;charset=utf-8" : "text/plain;charset=utf-8");
|
|
175
|
+
$(new Blob([H], { type: j }), v);
|
|
168
176
|
return;
|
|
169
177
|
}
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
172
|
-
|
|
178
|
+
const R = await f.blob();
|
|
179
|
+
if (a && !D(R)) {
|
|
180
|
+
p(new Error("excel does not exist"));
|
|
173
181
|
return;
|
|
174
182
|
}
|
|
175
|
-
|
|
183
|
+
$(R, v);
|
|
176
184
|
return;
|
|
177
185
|
}
|
|
178
|
-
if (
|
|
179
|
-
if (!
|
|
180
|
-
|
|
186
|
+
if (n === "open") {
|
|
187
|
+
if (!s) {
|
|
188
|
+
p(new Error("url is required for open"));
|
|
181
189
|
return;
|
|
182
190
|
}
|
|
183
|
-
|
|
191
|
+
d === "blank" ? window.open(s, "_blank", "noopener,noreferrer") : window.location.href = s;
|
|
184
192
|
return;
|
|
185
193
|
}
|
|
186
|
-
|
|
187
|
-
} catch (
|
|
188
|
-
|
|
194
|
+
p(new Error(`unknown source: ${n}`));
|
|
195
|
+
} catch (f) {
|
|
196
|
+
p(f instanceof Error ? f : new Error(String(f)));
|
|
189
197
|
}
|
|
190
198
|
};
|
|
191
|
-
function
|
|
192
|
-
if (
|
|
199
|
+
function G(e, t, n) {
|
|
200
|
+
if (t === "" || t === void 0 || t === null)
|
|
193
201
|
return "";
|
|
194
|
-
const
|
|
195
|
-
if ((
|
|
196
|
-
const
|
|
197
|
-
[
|
|
198
|
-
unit:
|
|
199
|
-
precision:
|
|
202
|
+
const r = globalThis.$fa, o = globalThis.$fu, i = (n == null ? void 0 : n.precision) ?? 2, l = n == null ? void 0 : n.unit;
|
|
203
|
+
if ((l === "currency" || l === "%") && o) {
|
|
204
|
+
const s = {
|
|
205
|
+
[e]: {
|
|
206
|
+
unit: l === "currency" ? "currency" : "%",
|
|
207
|
+
precision: i
|
|
200
208
|
}
|
|
201
209
|
};
|
|
202
210
|
try {
|
|
203
211
|
return o({
|
|
204
|
-
prop:
|
|
205
|
-
currency:
|
|
206
|
-
value:
|
|
207
|
-
obj:
|
|
212
|
+
prop: e,
|
|
213
|
+
currency: n == null ? void 0 : n.currency,
|
|
214
|
+
value: t,
|
|
215
|
+
obj: s
|
|
208
216
|
});
|
|
209
217
|
} catch {
|
|
210
218
|
}
|
|
211
219
|
}
|
|
212
|
-
if (
|
|
220
|
+
if (r)
|
|
213
221
|
try {
|
|
214
|
-
return
|
|
222
|
+
return r(t, i);
|
|
215
223
|
} catch {
|
|
216
|
-
return String(
|
|
224
|
+
return String(t);
|
|
217
225
|
}
|
|
218
|
-
return String(
|
|
226
|
+
return String(t);
|
|
219
227
|
}
|
|
220
|
-
function
|
|
221
|
-
const { columns:
|
|
222
|
-
return !
|
|
223
|
-
const
|
|
224
|
-
if (!
|
|
228
|
+
function ye(e, t, n = {}) {
|
|
229
|
+
const { columns: r = [] } = e || {}, { resolveMetric: o } = n;
|
|
230
|
+
return !r.length || !t || typeof t != "object" ? [] : r.map((i) => {
|
|
231
|
+
const l = i.property ?? i.prop ?? "";
|
|
232
|
+
if (!l)
|
|
225
233
|
return "";
|
|
226
|
-
let
|
|
227
|
-
if (
|
|
234
|
+
let s = t[l];
|
|
235
|
+
if (s === void 0 && (s = ""), s === "")
|
|
228
236
|
return "";
|
|
229
|
-
const
|
|
237
|
+
const c = typeof o == "function" ? o(l) : void 0;
|
|
230
238
|
try {
|
|
231
|
-
return
|
|
239
|
+
return G(l, s, c);
|
|
232
240
|
} catch {
|
|
233
|
-
return String(
|
|
241
|
+
return String(s);
|
|
234
242
|
}
|
|
235
243
|
});
|
|
236
244
|
}
|
|
237
|
-
const
|
|
245
|
+
const M = "mvframe_primary", I = "mvframe_theme", w = { r: 255, g: 255, b: 255 }, Y = { r: 0, g: 0, b: 0 }, J = [
|
|
238
246
|
"--el-color-primary-light-3",
|
|
239
247
|
"--el-color-primary-light-5",
|
|
240
248
|
"--el-color-primary-light-7",
|
|
@@ -242,106 +250,268 @@ const S = "mvframe_primary", x = "mvframe_theme", y = { r: 255, g: 255, b: 255 }
|
|
|
242
250
|
"--el-color-primary-light-9",
|
|
243
251
|
"--el-color-primary-dark-2"
|
|
244
252
|
];
|
|
245
|
-
function
|
|
246
|
-
let
|
|
247
|
-
if (
|
|
253
|
+
function A(e) {
|
|
254
|
+
let t = String(e).trim().replace(/^#/, "");
|
|
255
|
+
if (t.length === 3 && (t = t.split("").map((r) => r + r).join("")), t.length >= 8 && (t = t.slice(0, 6)), t.length !== 6 || Number.isNaN(parseInt(t, 16)))
|
|
248
256
|
return null;
|
|
249
|
-
const
|
|
257
|
+
const n = parseInt(t, 16);
|
|
250
258
|
return {
|
|
251
|
-
r:
|
|
252
|
-
g:
|
|
253
|
-
b:
|
|
259
|
+
r: n >> 16 & 255,
|
|
260
|
+
g: n >> 8 & 255,
|
|
261
|
+
b: n & 255
|
|
254
262
|
};
|
|
255
263
|
}
|
|
256
|
-
function
|
|
257
|
-
const
|
|
258
|
-
return `#${[
|
|
264
|
+
function y(e, t, n) {
|
|
265
|
+
const r = (o) => Math.max(0, Math.min(255, Math.round(o)));
|
|
266
|
+
return `#${[r(e), r(t), r(n)].map((o) => o.toString(16).padStart(2, "0")).join("")}`;
|
|
259
267
|
}
|
|
260
|
-
function
|
|
261
|
-
const
|
|
262
|
-
return 0.2126 *
|
|
268
|
+
function K(e) {
|
|
269
|
+
const t = [e.r, e.g, e.b].map((n) => (n /= 255, n <= 0.03928 ? n / 12.92 : ((n + 0.055) / 1.055) ** 2.4));
|
|
270
|
+
return 0.2126 * t[0] + 0.7152 * t[1] + 0.0722 * t[2];
|
|
263
271
|
}
|
|
264
|
-
function
|
|
265
|
-
return
|
|
272
|
+
function O(e) {
|
|
273
|
+
return K(e) > 0.5 ? "#1a1a1a" : "#ffffff";
|
|
266
274
|
}
|
|
267
|
-
function
|
|
268
|
-
const
|
|
275
|
+
function b(e, t, n) {
|
|
276
|
+
const r = n / 100, o = 1 - r;
|
|
269
277
|
return {
|
|
270
|
-
r:
|
|
271
|
-
g:
|
|
272
|
-
b:
|
|
278
|
+
r: e.r * r + t.r * o,
|
|
279
|
+
g: e.g * r + t.g * o,
|
|
280
|
+
b: e.b * r + t.b * o
|
|
273
281
|
};
|
|
274
282
|
}
|
|
275
|
-
function
|
|
276
|
-
const
|
|
277
|
-
if (!
|
|
283
|
+
function X(e) {
|
|
284
|
+
const t = A(e);
|
|
285
|
+
if (!t)
|
|
278
286
|
return null;
|
|
279
|
-
const
|
|
287
|
+
const n = b(w, t, 30), r = b(w, t, 50), o = b(w, t, 70), i = b(w, t, 80), l = b(w, t, 90), s = b(Y, t, 20);
|
|
280
288
|
return {
|
|
281
|
-
"--el-color-primary-light-3":
|
|
282
|
-
"--el-color-primary-light-5":
|
|
283
|
-
"--el-color-primary-light-7":
|
|
284
|
-
"--el-color-primary-light-8":
|
|
285
|
-
"--el-color-primary-light-9":
|
|
286
|
-
"--el-color-primary-dark-2":
|
|
289
|
+
"--el-color-primary-light-3": y(n.r, n.g, n.b),
|
|
290
|
+
"--el-color-primary-light-5": y(r.r, r.g, r.b),
|
|
291
|
+
"--el-color-primary-light-7": y(o.r, o.g, o.b),
|
|
292
|
+
"--el-color-primary-light-8": y(i.r, i.g, i.b),
|
|
293
|
+
"--el-color-primary-light-9": y(l.r, l.g, l.b),
|
|
294
|
+
"--el-color-primary-dark-2": y(s.r, s.g, s.b)
|
|
287
295
|
};
|
|
288
296
|
}
|
|
289
|
-
function
|
|
290
|
-
|
|
291
|
-
for (const
|
|
292
|
-
|
|
297
|
+
function Q(e) {
|
|
298
|
+
e.style.removeProperty("--el-color-primary"), e.style.removeProperty("--color-on-primary-text");
|
|
299
|
+
for (const t of J)
|
|
300
|
+
e.style.removeProperty(t);
|
|
293
301
|
}
|
|
294
|
-
function
|
|
295
|
-
const
|
|
296
|
-
if (!
|
|
302
|
+
function Z(e, t) {
|
|
303
|
+
const n = A(t.startsWith("#") ? t : `#${t}`);
|
|
304
|
+
if (!n)
|
|
297
305
|
return !1;
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
const o =
|
|
301
|
-
return o && Object.entries(o).forEach(([
|
|
306
|
+
const r = y(n.r, n.g, n.b);
|
|
307
|
+
e.style.setProperty("--color-primary", r), e.style.setProperty("--el-color-primary", r), e.style.setProperty("--color-on-primary-text", O(n));
|
|
308
|
+
const o = X(r);
|
|
309
|
+
return o && Object.entries(o).forEach(([i, l]) => e.style.setProperty(i, l)), !0;
|
|
302
310
|
}
|
|
303
|
-
function
|
|
304
|
-
const
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
if (!
|
|
308
|
-
|
|
309
|
-
const o =
|
|
310
|
-
o &&
|
|
311
|
+
function ee(e = {}) {
|
|
312
|
+
const t = document.documentElement;
|
|
313
|
+
if (e.primary != null && e.primary !== "") {
|
|
314
|
+
const r = String(e.primary).trim();
|
|
315
|
+
if (!Z(t, r)) {
|
|
316
|
+
t.style.setProperty("--color-primary", r), t.style.setProperty("--el-color-primary", r);
|
|
317
|
+
const o = A(r.startsWith("#") ? r : `#${r}`);
|
|
318
|
+
o && t.style.setProperty("--color-on-primary-text", O(o));
|
|
311
319
|
}
|
|
312
|
-
} else (
|
|
313
|
-
const
|
|
314
|
-
|
|
320
|
+
} else (e.primary === null || e.primary === "") && (t.style.removeProperty("--color-primary"), Q(t));
|
|
321
|
+
const n = e.mode ?? (t.classList.contains("dark") ? "dark" : "light");
|
|
322
|
+
t.classList.toggle("dark", n === "dark");
|
|
315
323
|
}
|
|
316
|
-
function
|
|
317
|
-
|
|
324
|
+
function be(e) {
|
|
325
|
+
e.primary !== void 0 && (e.primary == null || e.primary === "" ? localStorage.removeItem(M) : localStorage.setItem(M, String(e.primary))), e.mode !== void 0 && localStorage.setItem(I, e.mode);
|
|
318
326
|
}
|
|
319
|
-
function
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
primary:
|
|
323
|
-
mode:
|
|
327
|
+
function Ee() {
|
|
328
|
+
const e = localStorage.getItem(M), n = localStorage.getItem(I) === "dark" ? "dark" : "light";
|
|
329
|
+
ee({
|
|
330
|
+
primary: e != null && e !== "" ? e : null,
|
|
331
|
+
mode: n
|
|
324
332
|
});
|
|
325
333
|
}
|
|
334
|
+
const te = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 };
|
|
335
|
+
let _ = null;
|
|
336
|
+
function k(e) {
|
|
337
|
+
V("error", e);
|
|
338
|
+
}
|
|
339
|
+
function Te(e) {
|
|
340
|
+
_ = e && typeof e == "object" ? e : null;
|
|
341
|
+
}
|
|
342
|
+
function P(e) {
|
|
343
|
+
if (_ && _[e] != null && _[e] !== "")
|
|
344
|
+
return String(_[e]);
|
|
345
|
+
const t = typeof globalThis < "u" ? globalThis.__MVFRAME_ENV__ : null;
|
|
346
|
+
if (t && t[e] != null && t[e] !== "")
|
|
347
|
+
return String(t[e]);
|
|
348
|
+
const n = typeof import.meta < "u" ? te : null;
|
|
349
|
+
return n && n[e] != null && n[e] !== "" ? String(n[e]) : "";
|
|
350
|
+
}
|
|
351
|
+
const T = C.create({
|
|
352
|
+
timeout: 0,
|
|
353
|
+
withCredentials: !1
|
|
354
|
+
});
|
|
355
|
+
let h = [];
|
|
356
|
+
const ne = C.CancelToken, re = (e) => {
|
|
357
|
+
const t = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex, n = [];
|
|
358
|
+
if (h.length)
|
|
359
|
+
for (let r in h)
|
|
360
|
+
h[r].v === t && n.push(r);
|
|
361
|
+
n.length > 0 && (h[n[0]].cb(), h.splice(n[0], 1));
|
|
362
|
+
}, E = (e) => {
|
|
363
|
+
if (e != null && e.url) {
|
|
364
|
+
const t = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex;
|
|
365
|
+
for (let n in h)
|
|
366
|
+
if (h[n].v === t) {
|
|
367
|
+
h.splice(n, 1);
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
T.interceptors.request.use(
|
|
373
|
+
(e) => {
|
|
374
|
+
e.headers = e.headers || {};
|
|
375
|
+
const { login: t } = window.$store.launch(), { access_token: n } = t.info;
|
|
376
|
+
return n && e.headers["Content-HI"] && (e.headers.Authorization = `Bearer ${n}`), re(e), e.cancelToken = new ne((r) => {
|
|
377
|
+
h.push({
|
|
378
|
+
v: e.url + "_" + e.headers["Content-HI"] + "_" + e.ex,
|
|
379
|
+
cb: r
|
|
380
|
+
});
|
|
381
|
+
}), e;
|
|
382
|
+
},
|
|
383
|
+
(e) => Promise.reject(e)
|
|
384
|
+
);
|
|
385
|
+
T.interceptors.response.use(
|
|
386
|
+
({ data: e, config: t }) => {
|
|
387
|
+
var i;
|
|
388
|
+
if (e == null || typeof e != "object" || Array.isArray(e))
|
|
389
|
+
return E(t), e;
|
|
390
|
+
let { code: n, message: r, msg: o } = e;
|
|
391
|
+
if (o = o || r, n === 200)
|
|
392
|
+
E(t);
|
|
393
|
+
else if (n === 500) {
|
|
394
|
+
if (t.showMsg !== !1) {
|
|
395
|
+
const l = (i = t == null ? void 0 : t.headers) != null && i.CONTACT_CUSTOMER_SERVICE ? window.$l("CONTACT_CUSTOMER_SERVICE") : "";
|
|
396
|
+
k({
|
|
397
|
+
grouping: !0,
|
|
398
|
+
showClose: !0,
|
|
399
|
+
duration: 0,
|
|
400
|
+
message: [o, l].filter(Boolean).join(" ")
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
E(t);
|
|
404
|
+
} else n === 403 && window.location.replace("/"), E(t);
|
|
405
|
+
return e;
|
|
406
|
+
},
|
|
407
|
+
(e) => {
|
|
408
|
+
var n, r, o, i, l;
|
|
409
|
+
let t = !1;
|
|
410
|
+
if (e && e.response)
|
|
411
|
+
switch (e.response.status) {
|
|
412
|
+
case 403:
|
|
413
|
+
e.message = "403 Token Expired", window.location.replace("/");
|
|
414
|
+
break;
|
|
415
|
+
case 502:
|
|
416
|
+
e.message = "502 Error";
|
|
417
|
+
break;
|
|
418
|
+
case 503:
|
|
419
|
+
e.message = "503 Error";
|
|
420
|
+
break;
|
|
421
|
+
case 504:
|
|
422
|
+
e.message = "504 Error", e.response = {};
|
|
423
|
+
break;
|
|
424
|
+
default:
|
|
425
|
+
e.message = `Connection Error-${e.response.status}`;
|
|
426
|
+
}
|
|
427
|
+
else
|
|
428
|
+
(n = e.stack) != null && n.includes("timeout") ? e.message = window.$l("Timeout, Please Refresh") : (e.message = window.$l("Connect Failed"), t = !0);
|
|
429
|
+
return t || ((r = e == null ? void 0 : e.response) == null ? void 0 : r.status) !== 403 && k({
|
|
430
|
+
grouping: !0,
|
|
431
|
+
message: `${e.message} ${(i = (o = e.config) == null ? void 0 : o.headers) == null ? void 0 : i["Content-HI"]}`
|
|
432
|
+
}), E(e.config), e.code === "ERR_CANCELED" ? Promise.resolve({ code: e.code, msg: e.message }) : Promise.resolve({
|
|
433
|
+
code: (l = e.response) == null ? void 0 : l.status,
|
|
434
|
+
msg: e.message
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
);
|
|
438
|
+
function oe(e) {
|
|
439
|
+
return e.baseURL = P("VITE_APP_BASEURL"), e.method = "get", e.headers = { "Content-Type": "application/x-www-form-urlencoded" }, e.data && (e.params = e.data), T(e);
|
|
440
|
+
}
|
|
441
|
+
function se(e) {
|
|
442
|
+
return e.baseURL = P("VITE_APP_BASEURL"), e.method = "get", e.headers = {
|
|
443
|
+
...e.headers,
|
|
444
|
+
"Content-HI": e.url
|
|
445
|
+
}, e.url = e.ver ? `api/${e.ver}/ads` : "api/v2/ads", e.data && (e.params = e.data), T(e);
|
|
446
|
+
}
|
|
447
|
+
function ie(e) {
|
|
448
|
+
if (e.baseURL = P("VITE_APP_BASEURL"), e.method = "post", e.headers = {
|
|
449
|
+
...e.headers,
|
|
450
|
+
"Content-HI": e.url
|
|
451
|
+
}, e.data && window.$getType(e.data) === "Object") {
|
|
452
|
+
const n = {};
|
|
453
|
+
Object.keys(e.data).forEach((r) => {
|
|
454
|
+
const o = e.data[r];
|
|
455
|
+
[null, "", void 0].includes(o) || (n[r] = o);
|
|
456
|
+
}), e.data = n;
|
|
457
|
+
}
|
|
458
|
+
return e.url = e.ver ? `api/${e.ver}/ads` : "api/v2/ads", T(e);
|
|
459
|
+
}
|
|
460
|
+
function L({
|
|
461
|
+
data: e,
|
|
462
|
+
url: t,
|
|
463
|
+
ex: n,
|
|
464
|
+
method: r = "post",
|
|
465
|
+
emptyString: o = !1
|
|
466
|
+
}) {
|
|
467
|
+
const i = {}, l = [void 0, null];
|
|
468
|
+
o === !1 && l.push("");
|
|
469
|
+
for (let a in e)
|
|
470
|
+
l.indexOf(e[a]) === -1 && (i[a] = e[a]);
|
|
471
|
+
const { login: s, userinfo: c } = window.$store.launch(), { access_token: u } = s.info || {}, d = c && c.id != null && c.id !== "" ? c.id : "";
|
|
472
|
+
return T({
|
|
473
|
+
headers: {
|
|
474
|
+
"Content-Type": "application/json",
|
|
475
|
+
token: u != null ? String(u) : "",
|
|
476
|
+
userId: d
|
|
477
|
+
},
|
|
478
|
+
baseURL: P("VITE_APP_AIURL"),
|
|
479
|
+
url: t,
|
|
480
|
+
method: r,
|
|
481
|
+
data: i,
|
|
482
|
+
ex: n
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
const we = L;
|
|
486
|
+
function _e(e) {
|
|
487
|
+
globalThis.$login = oe, globalThis.$get = se, globalThis.$post = ie, globalThis.$form = L, globalThis.$xform = L;
|
|
488
|
+
}
|
|
326
489
|
export {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
490
|
+
W as MVFRAME_STORAGE_LANG,
|
|
491
|
+
M as MVFRAME_STORAGE_PRIMARY,
|
|
492
|
+
I as MVFRAME_STORAGE_THEME,
|
|
493
|
+
ee as applyMvframeTheme,
|
|
494
|
+
N as deepEqual,
|
|
495
|
+
me as download,
|
|
496
|
+
G as formatSummaryCell,
|
|
497
|
+
Se as getMaps,
|
|
498
|
+
_e as installRq,
|
|
499
|
+
he as isInView,
|
|
500
|
+
Ee as loadMvframeTheme,
|
|
501
|
+
$e as mapLang,
|
|
502
|
+
Pe as mapLangPath,
|
|
503
|
+
Me as mergeMaps,
|
|
504
|
+
Le as patchMaps,
|
|
505
|
+
be as persistMvframeTheme,
|
|
506
|
+
F as sanitizeDownloadFileName,
|
|
507
|
+
Te as setMvframeRqEnv,
|
|
508
|
+
L as useForm,
|
|
509
|
+
se as useGet,
|
|
510
|
+
ge as useLang,
|
|
511
|
+
oe as useLogin,
|
|
512
|
+
Ae as useMap,
|
|
513
|
+
pe as useOptions,
|
|
514
|
+
ie as usePost,
|
|
515
|
+
ye as useRemoteSummary,
|
|
516
|
+
we as useXform
|
|
347
517
|
};
|