matrix_components 2.0.328 → 2.0.330
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 -3
- package/dist/matrix_components.js +31 -5
- package/dist/matrix_components.umd.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
组件使用示例参考dist/ComponentDemo
|
|
3
3
|
|
|
4
4
|
```
|
|
5
|
-
version:2.0.
|
|
6
|
-
2025-11-24
|
|
5
|
+
version:2.0.330
|
|
6
|
+
2025-11-24
|
|
7
7
|
更新日志:
|
|
8
|
-
1
|
|
8
|
+
1.NsDialog增加全部弹窗关闭方法closeAllNsDialog, 注册app全局$closeAllNsDialog
|
|
9
|
+
2.添加post, get, put, del, download, downLoadLocalFile 等axios请求方法, 注册app全局$post, $get, $put, $del, $download, $downLoadLocalFile
|
|
9
10
|
```
|
|
10
11
|
|
|
11
12
|
```
|
|
@@ -47605,6 +47605,16 @@ window.__dialogInstances = [];
|
|
|
47605
47605
|
let externalApp = null;
|
|
47606
47606
|
function setExternalApp(app2) {
|
|
47607
47607
|
externalApp = app2;
|
|
47608
|
+
try {
|
|
47609
|
+
app2.config.globalProperties.$closeAllNsDialog = closeAllNsDialog;
|
|
47610
|
+
} catch (error) {
|
|
47611
|
+
console.log(error);
|
|
47612
|
+
}
|
|
47613
|
+
}
|
|
47614
|
+
function closeAllNsDialog() {
|
|
47615
|
+
window.__dialogInstances.forEach((instance) => {
|
|
47616
|
+
instance.closed();
|
|
47617
|
+
});
|
|
47608
47618
|
}
|
|
47609
47619
|
const NsDialog = (data, modal = true, appendTo = "#app") => {
|
|
47610
47620
|
if (!(data == null ? void 0 : data.dom)) {
|
|
@@ -76545,8 +76555,8 @@ function createAxiosInstance(customConfig = {}, errorCallback) {
|
|
|
76545
76555
|
} catch (error) {
|
|
76546
76556
|
console.error("请求的ID生成失败:", error);
|
|
76547
76557
|
}
|
|
76548
|
-
const tokenName = ((_b = (_a3 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b
|
|
76549
|
-
const tokenValue = ((_d = (_c2 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _c2.globalProperties) == null ? void 0 : _d
|
|
76558
|
+
const tokenName = ((_b = (_a3 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.$TonkenKey) || localStorage.getItem("TonkenKey") || localStorage.getItem("tonkenKey") || sessionStorage.getItem("TonkenKey") || sessionStorage.getItem("tonkenKey") || globalThis.TonkenKey || globalThis.tonkenKey || "satoken";
|
|
76559
|
+
const tokenValue = ((_d = (_c2 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _c2.globalProperties) == null ? void 0 : _d.$TonkenValue) || localStorage.getItem(tokenName) || sessionStorage.getItem(tokenName) || localStorage.getItem("TonkenValue") || sessionStorage.getItem("TonkenValue") || localStorage.getItem("tonkenValue") || sessionStorage.getItem("tonkenValue") || globalThis.TonkenValue || globalThis.tonkenValue || "";
|
|
76550
76560
|
if (tokenValue) {
|
|
76551
76561
|
config.headers[tokenName] = tokenValue;
|
|
76552
76562
|
}
|
|
@@ -76629,6 +76639,7 @@ async function errorFn(error) {
|
|
|
76629
76639
|
return "网络连接错误";
|
|
76630
76640
|
}
|
|
76631
76641
|
async function errorStatus(status, message = "") {
|
|
76642
|
+
var _a3, _b;
|
|
76632
76643
|
if (!message) {
|
|
76633
76644
|
switch (status) {
|
|
76634
76645
|
case 302:
|
|
@@ -76677,8 +76688,12 @@ async function errorStatus(status, message = "") {
|
|
|
76677
76688
|
}
|
|
76678
76689
|
if (message !== "ok") ElMessage.warning(message);
|
|
76679
76690
|
if (status === 401) {
|
|
76680
|
-
|
|
76681
|
-
|
|
76691
|
+
try {
|
|
76692
|
+
const logoutHandler = ((_b = (_a3 = app$1 == null ? void 0 : app$1.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.$LogoutCallback) || "";
|
|
76693
|
+
logoutHandler == null ? void 0 : logoutHandler();
|
|
76694
|
+
} catch (error) {
|
|
76695
|
+
console.warn("组件库未找到注销回调函数", error);
|
|
76696
|
+
}
|
|
76682
76697
|
}
|
|
76683
76698
|
return message;
|
|
76684
76699
|
}
|
|
@@ -76686,10 +76701,20 @@ let app = null;
|
|
|
76686
76701
|
function setHttpApp(_app) {
|
|
76687
76702
|
app = _app;
|
|
76688
76703
|
setAxiosApp(_app);
|
|
76704
|
+
try {
|
|
76705
|
+
app.config.globalProperties.$post = post;
|
|
76706
|
+
app.config.globalProperties.$get = get;
|
|
76707
|
+
app.config.globalProperties.$put = put;
|
|
76708
|
+
app.config.globalProperties.$del = del;
|
|
76709
|
+
app.config.globalProperties.$download = download;
|
|
76710
|
+
app.config.globalProperties.$downLoadLocalFile = downLoadLocalFile;
|
|
76711
|
+
} catch (error) {
|
|
76712
|
+
console.log(error);
|
|
76713
|
+
}
|
|
76689
76714
|
}
|
|
76690
76715
|
function getBaseUrl() {
|
|
76691
76716
|
var _a3, _b;
|
|
76692
|
-
return ((_b = (_a3 = app == null ? void 0 : app.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b
|
|
76717
|
+
return ((_b = (_a3 = app == null ? void 0 : app.config) == null ? void 0 : _a3.globalProperties) == null ? void 0 : _b.$BaseUrl) || localStorage.getItem("BaseUrl") || localStorage.getItem("bseUrl") || sessionStorage.getItem("BaseUrl") || sessionStorage.getItem("bseUrl") || globalThis.BaseUrl || globalThis.bseUrl || "";
|
|
76693
76718
|
}
|
|
76694
76719
|
const get = async (url, params, base = "", customConfig = {}, errorCallback = null) => {
|
|
76695
76720
|
const baseUrl = base || getBaseUrl();
|
|
@@ -91330,6 +91355,7 @@ export {
|
|
|
91330
91355
|
NsVideo,
|
|
91331
91356
|
NsWord,
|
|
91332
91357
|
autoScaleInit,
|
|
91358
|
+
closeAllNsDialog,
|
|
91333
91359
|
components,
|
|
91334
91360
|
index as default,
|
|
91335
91361
|
del,
|