yahee-components 0.0.75 → 0.0.81
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/es/annex-upload/annex-upload.vue.js +51 -154
- package/es/annex-upload/annex-upload.vue2.js +119 -2
- package/es/annex-upload/index.js +3 -3
- package/es/api/server.js +24 -19
- package/es/api/tool.js +31 -28
- package/es/border-wrap/border-wrap.vue.js +64 -95
- package/es/border-wrap/border-wrap.vue2.js +46 -2
- package/es/common-import/common-import.vue.js +369 -640
- package/es/common-import/common-import.vue2.js +328 -2
- package/es/common-import/index.js +3 -3
- package/es/common-import/props.js +4 -1
- package/es/complex-search/complex-search.vue.js +15 -15
- package/es/copy/copy.vue.js +37 -55
- package/es/copy/copy.vue2.js +34 -2
- package/es/copy/index.js +3 -3
- package/es/country-platform-shop-condition/country-platform-shop-condition.vue.js +114 -213
- package/es/country-platform-shop-condition/country-platform-shop-condition.vue2.js +125 -2
- package/es/drop-down-condition/drop-down-condition.vue.js +113 -213
- package/es/drop-down-condition/drop-down-condition.vue2.js +127 -2
- package/es/echart-gauge/echart-gauge.vue.js +12 -140
- package/es/echart-gauge/echart-gauge.vue2.js +147 -2
- package/es/echart-gauge/index.js +3 -3
- package/es/image-upload/image-upload.vue.js +109 -170
- package/es/image-upload/image-upload.vue2.js +91 -2
- package/es/image-upload/index.js +3 -3
- package/es/input/index.js +3 -3
- package/es/input/input.vue.js +17 -38
- package/es/input/input.vue2.js +33 -2
- package/es/left-condition/index.js +3 -3
- package/es/left-condition/left-condition-sub.vue.js +32 -91
- package/es/left-condition/left-condition-sub.vue2.js +76 -2
- package/es/left-condition/left-condition.vue.js +70 -218
- package/es/left-condition/left-condition.vue2.js +160 -2
- package/es/left-condition-enum/index.js +3 -3
- package/es/left-condition-enum/left-condition-enum.vue.js +20 -49
- package/es/left-condition-enum/left-condition-enum.vue2.js +40 -2
- package/es/operation-log/operation-log-content.vue.js +71 -92
- package/es/operation-log/operation-log-content.vue2.js +39 -2
- package/es/operation-log/operation-log-dialog.vue.js +46 -68
- package/es/operation-log/operation-log-dialog.vue2.js +38 -2
- package/es/operation-log/operation-log-form.vue.js +108 -183
- package/es/operation-log/operation-log-form.vue2.js +104 -2
- package/es/operation-log/operation-log.vue.js +119 -228
- package/es/operation-log/operation-log.vue2.js +135 -2
- package/es/packages/components/api/log-server.js +6 -6
- package/es/packages/components/api/server.js +18 -20
- package/es/packages/components/api/tool.js +35 -32
- package/es/packages/components/api/upload-server.js +1 -1
- package/es/packages/components/hooks/useEcharts.js +19 -19
- package/es/packages/components/hooks/useImg.js +8 -8
- package/es/scale-screen/index.js +4 -4
- package/es/scale-screen/scale-screen.vue.js +19 -126
- package/es/scale-screen/scale-screen.vue2.js +125 -2
- package/es/utils/translate.js +21 -21
- package/package.json +46 -46
- package/readme.md +249 -249
- package/types/src/common-import/common-import.vue.d.ts +10 -0
- package/types/src/common-import/index.d.ts +25 -0
- package/types/src/common-import/props.d.ts +19 -0
- package/types/src/installs.d.ts +25 -0
- package/types/src/left-condition-enum/left-condition-enum.d.ts +3 -0
- package/es/packages/components/api/common/index.js +0 -7
|
@@ -1,158 +1,55 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (l.limitFileSize) {
|
|
46
|
-
let t = e.size;
|
|
47
|
-
if (l.fileSizeUnit.toLowerCase() === "kb" ? t = e.size / 1024 : t = e.size / 1024 / 1024, !(t < l.fileSize))
|
|
48
|
-
return p.error(a(`文件大小不能超过 ${l.fileSize}${l.fileSizeUnit}!`)), !1;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
function E(e) {
|
|
52
|
-
return l.uploadType === "upload" ? b(l.fileType, e.file, (t) => {
|
|
53
|
-
e.onProgress(t);
|
|
54
|
-
}).then((t) => {
|
|
55
|
-
e.onSuccess(t);
|
|
56
|
-
}).catch(() => {
|
|
57
|
-
e.onError();
|
|
58
|
-
}) : l.uploadType === "import" && M(e.file, (t) => {
|
|
59
|
-
e.onProgress(t);
|
|
60
|
-
}).then((t) => {
|
|
61
|
-
e.onSuccess(t);
|
|
62
|
-
}).catch(() => {
|
|
63
|
-
e.onError();
|
|
64
|
-
}), null;
|
|
65
|
-
}
|
|
66
|
-
function F(e, t) {
|
|
67
|
-
p.warning(
|
|
68
|
-
a(
|
|
69
|
-
`当前限制选择 ${l.limit} 个文件,本次选择了 ${e.length} 个文件,共选择了 ${e.length + t.length} 个文件`
|
|
70
|
-
)
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
const u = N(null);
|
|
74
|
-
function d(e) {
|
|
75
|
-
return e.length === 0 ? [] : e.map((t) => t.response ? {
|
|
76
|
-
fileName: t.name,
|
|
77
|
-
fileId: t.response[0],
|
|
78
|
-
fileUrl: `https://imgs.yaheecloud.com/${t.response[0]}`
|
|
79
|
-
} : {
|
|
80
|
-
fileName: t.name,
|
|
81
|
-
fileId: t.url.split("/")[t.url.split("/").length - 1],
|
|
82
|
-
fileUrl: t.url
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
const k = async (e, t, i) => {
|
|
86
|
-
if (l.uploadType === "import")
|
|
87
|
-
o("update:modelValue", e);
|
|
88
|
-
else if (l.uploadType === "upload") {
|
|
89
|
-
const m = d(i);
|
|
90
|
-
o("update:modelValue", m), await c(), o("change", m);
|
|
91
|
-
}
|
|
92
|
-
}, B = async (e, t) => {
|
|
93
|
-
const i = d(t);
|
|
94
|
-
o("update:modelValue", i), await c(), o("change", i);
|
|
95
|
-
};
|
|
96
|
-
async function L() {
|
|
97
|
-
u.value.clearFiles(), o("update:modelValue", []), await c(), o("change", []);
|
|
98
|
-
}
|
|
99
|
-
$({ clearFiles: L });
|
|
100
|
-
const { formItem: n } = j();
|
|
101
|
-
return _(
|
|
102
|
-
() => l.modelValue,
|
|
103
|
-
(e) => {
|
|
104
|
-
var t;
|
|
105
|
-
(!e || e.length === 0) && u.value.clearFiles(), l.validateEvent && ((t = n == null ? void 0 : n.validate) == null || t.call(n, "change").catch(() => {
|
|
106
|
-
}));
|
|
107
|
-
}
|
|
108
|
-
), (e, t) => (y(), h("div", q, [
|
|
109
|
-
g(s(A), {
|
|
110
|
-
ref_key: "uploadRef",
|
|
111
|
-
ref: u,
|
|
112
|
-
style: { width: "100%" },
|
|
113
|
-
action: "",
|
|
114
|
-
"http-request": E,
|
|
115
|
-
"before-upload": V,
|
|
116
|
-
"on-success": k,
|
|
117
|
-
"on-remove": B,
|
|
118
|
-
"on-exceed": F,
|
|
119
|
-
accept: e.accept,
|
|
120
|
-
multiple: "",
|
|
121
|
-
limit: e.limit,
|
|
122
|
-
"file-list": e.fileList,
|
|
123
|
-
"show-file-list": e.showList
|
|
124
|
-
}, v({
|
|
125
|
-
default: f(() => [
|
|
126
|
-
S(e.$slots, "default", {}, () => [
|
|
127
|
-
g(s(P), {
|
|
128
|
-
plain: "",
|
|
129
|
-
type: "primary"
|
|
130
|
-
}, {
|
|
131
|
-
default: f(() => [
|
|
132
|
-
x(r(s(a)("上传文件")), 1)
|
|
133
|
-
]),
|
|
134
|
-
_: 1
|
|
135
|
-
})
|
|
1
|
+
import r from "./annex-upload.vue2.js";
|
|
2
|
+
import { createElementBlock as a, openBlock as n, createVNode as c, createSlots as m, withCtx as l, renderSlot as d, createTextVNode as f, toDisplayString as o, createElementVNode as s, createCommentVNode as _ } from "vue";
|
|
3
|
+
import h from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const p = { class: "yahee-annex-upload" }, u = { class: "margin15 el-upload__tip" }, x = { key: 0 };
|
|
5
|
+
function w(i, y, t, e, S, k) {
|
|
6
|
+
return n(), a("div", p, [
|
|
7
|
+
c(e.ElUpload, {
|
|
8
|
+
ref: "uploadRef",
|
|
9
|
+
style: { width: "100%" },
|
|
10
|
+
action: "",
|
|
11
|
+
"http-request": e.uploadFile,
|
|
12
|
+
"before-upload": e.beforeUpload,
|
|
13
|
+
"on-success": e.handleSuccess,
|
|
14
|
+
"on-remove": e.handleRemove,
|
|
15
|
+
"on-exceed": e.handleExceed,
|
|
16
|
+
accept: t.accept,
|
|
17
|
+
multiple: "",
|
|
18
|
+
limit: t.limit,
|
|
19
|
+
"file-list": t.fileList,
|
|
20
|
+
"show-file-list": t.showList
|
|
21
|
+
}, m({
|
|
22
|
+
default: l(() => [
|
|
23
|
+
d(i.$slots, "default", {}, () => [
|
|
24
|
+
c(e.ElButton, {
|
|
25
|
+
plain: "",
|
|
26
|
+
type: "primary"
|
|
27
|
+
}, {
|
|
28
|
+
default: l(() => [
|
|
29
|
+
f(o(e.M2("上传文件")), 1)
|
|
30
|
+
]),
|
|
31
|
+
_: 1
|
|
32
|
+
})
|
|
33
|
+
])
|
|
34
|
+
]),
|
|
35
|
+
_: 2
|
|
36
|
+
}, [
|
|
37
|
+
t.showTips ? {
|
|
38
|
+
name: "tip",
|
|
39
|
+
fn: l(() => [
|
|
40
|
+
d(i.$slots, "tip", {}, () => [
|
|
41
|
+
s("span", u, [
|
|
42
|
+
s("span", null, o(e.M2(`支持扩展名:${t.accept}`)) + ",", 1),
|
|
43
|
+
t.limitFileSize ? (n(), a("span", x, o(e.M2(`文件不能大于${t.fileSize}`)) + o(t.fileSizeUnit.toUpperCase()), 1)) : _("", !0)
|
|
44
|
+
])
|
|
136
45
|
])
|
|
137
46
|
]),
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
z("span", D, [
|
|
145
|
-
z("span", null, r(s(a)(`支持扩展名:${e.accept}`)) + ",", 1),
|
|
146
|
-
e.limitFileSize ? (y(), h("span", I, r(s(a)(`文件不能大于${e.fileSize}`)) + r(e.fileSizeUnit.toUpperCase()), 1)) : R("", !0)
|
|
147
|
-
])
|
|
148
|
-
])
|
|
149
|
-
]),
|
|
150
|
-
key: "0"
|
|
151
|
-
} : void 0
|
|
152
|
-
]), 1032, ["accept", "limit", "file-list", "show-file-list"])
|
|
153
|
-
]));
|
|
154
|
-
}
|
|
155
|
-
});
|
|
47
|
+
key: "0"
|
|
48
|
+
} : void 0
|
|
49
|
+
]), 1032, ["accept", "limit", "file-list", "show-file-list"])
|
|
50
|
+
]);
|
|
51
|
+
}
|
|
52
|
+
const N = /* @__PURE__ */ h(r, [["render", w], ["__file", "D:/projects/frontend/common/common_componentsweb/packages/components/src/annex-upload/annex-upload.vue"]]);
|
|
156
53
|
export {
|
|
157
|
-
|
|
54
|
+
N as default
|
|
158
55
|
};
|
|
@@ -1,4 +1,121 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as U, ref as E, watch as F, nextTick as p } from "vue";
|
|
2
|
+
import { useUpload as _ } from "../packages/components/hooks/useUpload.js";
|
|
3
|
+
import { useImport as w } from "../packages/components/hooks/useImport.js";
|
|
4
|
+
import { useFormItem as $, ElMessage as n, ElButton as b, ElUpload as B } from "element-plus";
|
|
5
|
+
import "element-plus/theme-chalk/src/base.scss";
|
|
6
|
+
import "element-plus/theme-chalk/src/badge.scss";
|
|
7
|
+
import "element-plus/theme-chalk/src/message.scss";
|
|
8
|
+
import "element-plus/theme-chalk/src/upload.scss";
|
|
9
|
+
import "element-plus/theme-chalk/src/progress.scss";
|
|
10
|
+
import "element-plus/theme-chalk/src/button.scss";
|
|
11
|
+
import { MimeType as m } from "./mimeType.js";
|
|
12
|
+
import { M2 as a } from "../utils/translate.js";
|
|
13
|
+
const I = /* @__PURE__ */ U({
|
|
14
|
+
name: "AnnexUpload",
|
|
15
|
+
__name: "annex-upload",
|
|
16
|
+
props: {
|
|
17
|
+
modelValue: { type: Array, required: !0, default: () => [] },
|
|
18
|
+
fileList: { type: Array, required: !1, default: () => [] },
|
|
19
|
+
showList: { type: Boolean, required: !1, default: !0 },
|
|
20
|
+
fileType: { type: String, required: !1, default: "105" },
|
|
21
|
+
accept: { type: String, required: !1, default: ".gif,.jpg,.png,.doc,.docx,.pdf,.xls,.xlsx" },
|
|
22
|
+
checkRealType: { type: Boolean, required: !1, default: !0 },
|
|
23
|
+
limit: { type: Number, required: !1, default: 1 },
|
|
24
|
+
limitFileSize: { type: Boolean, required: !1, default: !0 },
|
|
25
|
+
fileSize: { type: Number, required: !1, default: 20 },
|
|
26
|
+
fileSizeUnit: { type: String, required: !1, default: "mb" },
|
|
27
|
+
uploadType: { type: String, required: !1, default: "upload" },
|
|
28
|
+
validateEvent: { type: Boolean, required: !1, default: !0 },
|
|
29
|
+
showTips: { type: Boolean, required: !1, default: !0 }
|
|
30
|
+
},
|
|
31
|
+
emits: ["update:modelValue", "change", "success", "remove"],
|
|
32
|
+
setup(y, { expose: g, emit: h }) {
|
|
33
|
+
const l = y, r = h;
|
|
34
|
+
function S(t) {
|
|
35
|
+
if (l.accept && l.checkRealType) {
|
|
36
|
+
const e = [];
|
|
37
|
+
for (let i of l.accept.split(","))
|
|
38
|
+
if (i = i.toLowerCase(), m.get(i) !== void 0)
|
|
39
|
+
e.push(m.get(i));
|
|
40
|
+
else
|
|
41
|
+
return n.error(a(`文件类型错误,支持文件类型为: ${l.accept}!`)), !1;
|
|
42
|
+
if (e.join().indexOf(t.type) === -1)
|
|
43
|
+
return n.error(a(`文件类型错误,支持文件类型为: ${l.accept}!`)), !1;
|
|
44
|
+
}
|
|
45
|
+
if (l.limitFileSize) {
|
|
46
|
+
let e = t.size;
|
|
47
|
+
if (l.fileSizeUnit.toLowerCase() === "kb" ? e = t.size / 1024 : e = t.size / 1024 / 1024, !(e < l.fileSize))
|
|
48
|
+
return n.error(a(`文件大小不能超过 ${l.fileSize}${l.fileSizeUnit}!`)), !1;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function q(t) {
|
|
52
|
+
return l.uploadType === "upload" ? _(l.fileType, t.file, (e) => {
|
|
53
|
+
t.onProgress(e);
|
|
54
|
+
}).then((e) => {
|
|
55
|
+
t.onSuccess(e);
|
|
56
|
+
}).catch(() => {
|
|
57
|
+
t.onError();
|
|
58
|
+
}) : l.uploadType === "import" && w(t.file, (e) => {
|
|
59
|
+
t.onProgress(e);
|
|
60
|
+
}).then((e) => {
|
|
61
|
+
t.onSuccess(e);
|
|
62
|
+
}).catch(() => {
|
|
63
|
+
t.onError();
|
|
64
|
+
}), null;
|
|
65
|
+
}
|
|
66
|
+
function z(t, e) {
|
|
67
|
+
n.warning(
|
|
68
|
+
a(
|
|
69
|
+
`当前限制选择 ${l.limit} 个文件,本次选择了 ${t.length} 个文件,共选择了 ${t.length + e.length} 个文件`
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
const u = E(null);
|
|
74
|
+
function s(t) {
|
|
75
|
+
return t.length === 0 ? [] : t.map((e) => e.response ? {
|
|
76
|
+
fileName: e.name,
|
|
77
|
+
fileId: e.response[0],
|
|
78
|
+
fileUrl: `http://qas-service.yahee.com.cn:8088/FMSService/Latest/${e.response[0]}`
|
|
79
|
+
} : {
|
|
80
|
+
fileName: e.name,
|
|
81
|
+
fileId: e.url.split("/")[e.url.split("/").length - 1],
|
|
82
|
+
fileUrl: e.url
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const T = async (t, e, i) => {
|
|
86
|
+
if (l.uploadType === "import")
|
|
87
|
+
r("update:modelValue", t);
|
|
88
|
+
else if (l.uploadType === "upload") {
|
|
89
|
+
const c = s(i);
|
|
90
|
+
r("update:modelValue", c), await p(), r("change", c);
|
|
91
|
+
}
|
|
92
|
+
}, x = async (t, e) => {
|
|
93
|
+
const i = s(e);
|
|
94
|
+
r("update:modelValue", i), await p(), r("change", i);
|
|
95
|
+
};
|
|
96
|
+
async function f() {
|
|
97
|
+
u.value.clearFiles(), r("update:modelValue", []), await p(), r("change", []);
|
|
98
|
+
}
|
|
99
|
+
g({ clearFiles: f });
|
|
100
|
+
const { formItem: o } = $();
|
|
101
|
+
F(
|
|
102
|
+
() => l.modelValue,
|
|
103
|
+
(t) => {
|
|
104
|
+
var e;
|
|
105
|
+
(!t || t.length === 0) && u.value.clearFiles(), l.validateEvent && ((e = o == null ? void 0 : o.validate) == null || e.call(o, "change").catch(() => {
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
const d = { props: l, emits: r, beforeUpload: S, uploadFile: q, handleExceed: z, uploadRef: u, getUploadFiles: s, handleSuccess: T, handleRemove: x, clearFiles: f, formItem: o, get ElUpload() {
|
|
110
|
+
return B;
|
|
111
|
+
}, get ElButton() {
|
|
112
|
+
return b;
|
|
113
|
+
}, get M2() {
|
|
114
|
+
return a;
|
|
115
|
+
} };
|
|
116
|
+
return Object.defineProperty(d, "__isScriptSetup", { enumerable: !1, value: !0 }), d;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
2
119
|
export {
|
|
3
|
-
|
|
120
|
+
I as default
|
|
4
121
|
};
|
package/es/annex-upload/index.js
CHANGED
package/es/api/server.js
CHANGED
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
import "../node_modules/.pnpm/axios@1.10.0/node_modules/axios/index.js";
|
|
2
|
-
import { handleChangeRequestHeader as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
let e =
|
|
6
|
-
return e =
|
|
2
|
+
import { handleChangeRequestHeader as i, handleConfigureAuth as u, handleAuthError as d, handleGeneralError as l, handleNetworkError as c } from "./tool.js";
|
|
3
|
+
import o from "../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/axios.js";
|
|
4
|
+
o.interceptors.request.use((t) => {
|
|
5
|
+
let e = i(t);
|
|
6
|
+
return e = u(e), e;
|
|
7
7
|
});
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
(t) => t.status !== 200 ? Promise.reject(t.data) : (u(t.data.errno), i(t.data.status, t.data.msg), t),
|
|
8
|
+
o.defaults.withCredentials = !0;
|
|
9
|
+
o.interceptors.response.use(
|
|
11
10
|
(t) => {
|
|
12
|
-
|
|
11
|
+
if (t.status !== 200) return Promise.reject(t.data);
|
|
12
|
+
const { errno: e, status: r, msg: s } = t.data;
|
|
13
|
+
return e != null && e !== 0 && d(e), r != null && r !== 0 && s && l(r, s), t;
|
|
14
|
+
},
|
|
15
|
+
(t) => {
|
|
16
|
+
var e;
|
|
17
|
+
return (e = t.response) != null && e.status && c(t.response.status), Promise.reject(t.response);
|
|
13
18
|
}
|
|
14
19
|
);
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
}).catch((
|
|
20
|
-
const
|
|
21
|
-
msg:
|
|
22
|
-
data:
|
|
20
|
+
const g = (t, e = {}, r) => new Promise((s) => {
|
|
21
|
+
o.get(t, { params: e }).then((a) => {
|
|
22
|
+
let n;
|
|
23
|
+
n = a.data, s(n);
|
|
24
|
+
}).catch((a) => {
|
|
25
|
+
const n = {
|
|
26
|
+
msg: a.msg,
|
|
27
|
+
data: a.data
|
|
23
28
|
// 其他错误属性...
|
|
24
29
|
};
|
|
25
|
-
|
|
30
|
+
s(n);
|
|
26
31
|
});
|
|
27
32
|
});
|
|
28
33
|
export {
|
|
29
|
-
|
|
34
|
+
g as Get
|
|
30
35
|
};
|
package/es/api/tool.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElMessage as
|
|
1
|
+
import { ElMessage as o, ElMessageBox as n } from "element-plus";
|
|
2
2
|
import "element-plus/theme-chalk/src/base.scss";
|
|
3
3
|
import "element-plus/theme-chalk/src/badge.scss";
|
|
4
4
|
import "element-plus/theme-chalk/src/message.scss";
|
|
@@ -6,20 +6,20 @@ import "element-plus/theme-chalk/src/message-box.scss";
|
|
|
6
6
|
import "element-plus/theme-chalk/src/button.scss";
|
|
7
7
|
import "element-plus/theme-chalk/src/input.scss";
|
|
8
8
|
import "element-plus/theme-chalk/src/overlay.scss";
|
|
9
|
-
import { AxiosHeaders as
|
|
9
|
+
import { AxiosHeaders as a } from "../node_modules/.pnpm/axios@1.10.0/node_modules/axios/index.js";
|
|
10
10
|
const w = (e) => ({
|
|
11
11
|
...e,
|
|
12
12
|
timeout: 2e4
|
|
13
|
-
}),
|
|
14
|
-
const
|
|
13
|
+
}), E = (e) => {
|
|
14
|
+
const r = new a(e.headers);
|
|
15
15
|
return {
|
|
16
16
|
...e,
|
|
17
|
-
headers:
|
|
17
|
+
headers: r
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
let t = !1;
|
|
21
|
-
const
|
|
22
|
-
const
|
|
21
|
+
const g = (e) => {
|
|
22
|
+
const r = {
|
|
23
23
|
400: "错误的请求",
|
|
24
24
|
// token 失效
|
|
25
25
|
403: "拒绝访问",
|
|
@@ -35,34 +35,37 @@ const R = (e) => {
|
|
|
35
35
|
};
|
|
36
36
|
switch (e) {
|
|
37
37
|
case 401:
|
|
38
|
-
window.location.href = `
|
|
38
|
+
window.location.href = `http://qas-portal.yahee.com.cn:8088//Latest/Account/LogOn?returnUrl=${encodeURIComponent(window.location.href)}`;
|
|
39
39
|
break;
|
|
40
40
|
case 403:
|
|
41
|
-
t || (t = !0,
|
|
41
|
+
t || (t = !0, n.alert("对不起,您没有权限进行当前操作!").finally(() => {
|
|
42
42
|
t = !1;
|
|
43
43
|
}));
|
|
44
44
|
break;
|
|
45
45
|
default:
|
|
46
|
-
e &&
|
|
46
|
+
e && o.error(r[e] ?? `其他连接错误 --${e}`);
|
|
47
47
|
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
48
|
+
}, M = (e) => {
|
|
49
|
+
if (!e || e === 0)
|
|
50
|
+
return !0;
|
|
51
|
+
const r = {
|
|
52
|
+
10031: "登录失效,需要重新登录",
|
|
53
|
+
// token 失效
|
|
54
|
+
10032: "您太久没登录,请重新登录~",
|
|
55
|
+
// token 过期
|
|
56
|
+
10033: "账户未绑定角色,请联系管理员绑定角色",
|
|
57
|
+
10034: "该用户未注册,请联系管理员注册用户",
|
|
58
|
+
10035: "code 无法获取对应第三方平台用户",
|
|
59
|
+
10036: "该账户未关联员工,请联系管理员做关联",
|
|
60
|
+
10037: "账号已无效",
|
|
61
|
+
10038: "账号未找到"
|
|
62
|
+
};
|
|
63
|
+
return e in r ? (o.error(r[e]), !1) : !0;
|
|
64
|
+
}, k = (e, r) => e !== 0 && r && r.trim() && r !== "OK" ? (o.error(r), !1) : !0;
|
|
62
65
|
export {
|
|
63
|
-
|
|
66
|
+
M as handleAuthError,
|
|
64
67
|
w as handleChangeRequestHeader,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
E as handleConfigureAuth,
|
|
69
|
+
k as handleGeneralError,
|
|
70
|
+
g as handleNetworkError
|
|
68
71
|
};
|