@das-fed/utils 1.0.1 → 1.0.3
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/api-services/index.d.ts +1 -0
- package/api-services/index.js +3 -19845
- package/api-services/modules/app-manage.d.ts +2 -0
- package/api-services/modules/app-manage.js +5 -6
- package/api-services/modules/authentication.d.ts +2 -0
- package/api-services/modules/authentication.js +5 -6
- package/api-services/modules/bems.d.ts +6 -0
- package/api-services/modules/bems.js +8 -10
- package/api-services/modules/contract.d.ts +2 -0
- package/api-services/modules/contract.js +5 -6
- package/api-services/modules/duty-manage.d.ts +7 -0
- package/api-services/modules/duty-manage.js +9 -10
- package/api-services/modules/enterpriseright.d.ts +2 -0
- package/api-services/modules/enterpriseright.js +5 -6
- package/api-services/modules/file.d.ts +36 -0
- package/api-services/modules/file.js +449 -354
- package/api-services/modules/gateway-edge.d.ts +2 -0
- package/api-services/modules/gateway-edge.js +5 -6
- package/api-services/modules/index.d.ts +21 -0
- package/api-services/modules/index.js +501 -435
- package/api-services/modules/iot.d.ts +15 -0
- package/api-services/modules/iot.js +17 -18
- package/api-services/modules/justauth.d.ts +3 -0
- package/api-services/modules/justauth.js +6 -7
- package/api-services/modules/knowledge.d.ts +2 -0
- package/api-services/modules/knowledge.js +5 -6
- package/api-services/modules/link.d.ts +2 -0
- package/api-services/modules/link.js +5 -6
- package/api-services/modules/permission.d.ts +2 -0
- package/api-services/modules/permission.js +5 -6
- package/api-services/modules/platformManage.d.ts +14 -0
- package/api-services/modules/platformManage.js +12 -13
- package/api-services/modules/portal.d.ts +2 -0
- package/api-services/modules/portal.js +5 -6
- package/api-services/modules/space-manage.d.ts +2 -0
- package/api-services/modules/space-manage.js +5 -6
- package/api-services/modules/super-admin.d.ts +8 -0
- package/api-services/modules/super-admin.js +8 -9
- package/api-services/modules/supplier.d.ts +6 -0
- package/api-services/modules/supplier.js +7 -8
- package/api-services/modules/supplychain-manage.d.ts +2 -0
- package/api-services/modules/supplychain-manage.js +5 -6
- package/api-services/modules/systemConfiguration.d.ts +2 -0
- package/api-services/modules/systemConfiguration.js +5 -6
- package/api-services/modules/tool.d.ts +2 -0
- package/api-services/modules/tool.js +5 -6
- package/api-services/src/create-service.d.ts +2 -0
- package/api-services/src/create-service.js +3119 -19726
- package/api-services/src/sso.d.ts +29 -0
- package/api-services/src/sso.js +1547 -156
- package/api-services/src/util.d.ts +1 -0
- package/api-services/src/util.js +1462 -19
- package/atob/index.d.ts +2 -0
- package/atob/index.js +9 -10
- package/common-info/getIframeUrl.d.ts +9 -0
- package/common-info/getIframeUrl.js +9 -11
- package/common-info/index.d.ts +42 -0
- package/common-info/index.js +138 -272
- package/common-info/setInfoFromUrl.d.ts +8 -0
- package/common-info/setInfoFromUrl.js +60 -128
- package/common-tools/arr-tools.d.ts +15 -0
- package/common-tools/arr-tools.js +6 -13
- package/common-tools/date-format.d.ts +7 -0
- package/common-tools/date-format.js +18 -21
- package/common-tools/get-url-params.d.ts +33 -0
- package/common-tools/get-url-params.js +48 -88
- package/common-tools/handle-data.d.ts +6 -0
- package/common-tools/handle-data.js +3 -4
- package/common-tools/index.d.ts +7 -0
- package/common-tools/index.js +7 -213
- package/common-tools/nest-tree-format.d.ts +30 -0
- package/common-tools/nest-tree-format.js +22 -49
- package/common-tools/obj-tools.d.ts +7 -0
- package/common-tools/obj-tools.js +17 -18
- package/common-tools/setHtmlMinWH.d.ts +5 -0
- package/common-tools/setHtmlMinWH.js +6 -10
- package/common-tools/throttled.d.ts +7 -0
- package/common-tools/throttled.js +7 -16
- package/config/index.d.ts +2 -0
- package/config/index.js +8 -25
- package/curring-http/index.d.ts +11 -0
- package/curring-http/index.js +5150 -17289
- package/directive/auth.d.ts +8 -0
- package/directive/auth.js +54 -104
- package/directive/clickOutside.d.ts +5 -0
- package/directive/clickOutside.js +23 -49
- package/directive/hoverInside.d.ts +5 -0
- package/directive/hoverInside.js +16 -35
- package/directive/index.d.ts +3 -0
- package/directive/index.js +7 -182
- package/directive/utils.d.ts +7 -0
- package/directive/utils.js +6 -11
- package/dom-check-in/index.d.ts +6 -0
- package/dom-check-in/index.js +7 -15
- package/dom-watcher/index.d.ts +25 -0
- package/dom-watcher/index.js +7 -8
- package/hooks/popup-manager/use-zindex.d.ts +5 -0
- package/hooks/popup-manager/use-zindex.js +17 -36
- package/index.d.ts +2 -0
- package/index.js +2 -215
- package/load-js/index.d.ts +3 -0
- package/load-js/index.js +10 -20
- package/oss/index.d.ts +2 -0
- package/oss/index.js +11 -15
- package/package.json +8 -13
- package/pinyin-first-character/index.d.ts +2 -0
- package/pinyin-first-character/index.js +25011 -12217
- package/process-engine-info/index.d.ts +10 -0
- package/process-engine-info/index.js +8 -10
- package/pure-image-src/index.d.ts +2 -0
- package/pure-image-src/index.js +3 -29
- package/set-personal-info/index.d.ts +5 -0
- package/set-personal-info/index.js +1460 -16
- package/size-watcher/index.d.ts +6 -0
- package/size-watcher/index.js +17 -24
- package/style/index.d.ts +2 -0
- package/style/index.js +62 -103
- package/style/math.d.ts +9 -0
- package/style/math.js +16 -31
- package/style/style.d.ts +30 -0
- package/style/style.js +49 -72
- package/token-tools/index.d.ts +18 -0
- package/token-tools/index.js +72 -149
- package/vue/hooks/use-model-value.d.ts +3 -0
- package/vue/hooks/use-model-value.js +9 -10
- package/vue/index.d.ts +1 -0
- package/vue/index.js +3 -10
- package/webSocket-service/index.d.ts +40 -0
- package/webSocket-service/index.js +62 -138
- package/with-install/index.d.ts +10 -0
- package/with-install/index.js +5 -7
|
@@ -1,347 +1,457 @@
|
|
|
1
|
-
import { createService } from
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
({
|
|
14
|
-
projectDevice: createService(`/api/device-relation/deviceproject/${version}`),
|
|
15
|
-
deviceRules: createService(`/api/device-relation/devicerule/${version}`),
|
|
16
|
-
project: createService(`/api/device-relation/project/${version}`)
|
|
17
|
-
});
|
|
18
|
-
const iotMinio = createService(`/api/oss/minio/${version}`);
|
|
19
|
-
const iotProgress = createService(`/api/progress/accessor/${version}`);
|
|
20
|
-
|
|
21
|
-
let urlAlphabet =
|
|
22
|
-
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
23
|
-
|
|
24
|
-
const POOL_SIZE_MULTIPLIER = 128;
|
|
25
|
-
let pool, poolOffset;
|
|
26
|
-
let fillPool = bytes => {
|
|
27
|
-
if (!pool || pool.length < bytes) {
|
|
28
|
-
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
|
|
29
|
-
crypto.randomFillSync(pool);
|
|
30
|
-
poolOffset = 0;
|
|
31
|
-
} else if (poolOffset + bytes > pool.length) {
|
|
32
|
-
crypto.randomFillSync(pool);
|
|
33
|
-
poolOffset = 0;
|
|
34
|
-
}
|
|
35
|
-
poolOffset += bytes;
|
|
36
|
-
};
|
|
37
|
-
let nanoid = (size = 21) => {
|
|
38
|
-
fillPool((size -= 0));
|
|
39
|
-
let id = '';
|
|
40
|
-
for (let i = poolOffset - size; i < poolOffset; i++) {
|
|
41
|
-
id += urlAlphabet[pool[i] & 63];
|
|
1
|
+
import { createService as _ } from "@das-fed/utils/api-services";
|
|
2
|
+
import { ref as U } from "vue";
|
|
3
|
+
const C = "v1";
|
|
4
|
+
_(`/api/iot/${C}`);
|
|
5
|
+
_(`/api/iot-device/thingmodel/${C}`), _(`/api/iot-device/devicemanage/${C}`), _(`/api/iot-device/product/${C}`), _(`/api/iot-device/product-storage/${C}`);
|
|
6
|
+
_(`/api/device-relation/deviceproject/${C}`), _(`/api/device-relation/devicerule/${C}`), _(`/api/device-relation/project/${C}`);
|
|
7
|
+
const X = _(`/api/oss/minio/${C}`), re = _(`/api/progress/accessor/${C}`);
|
|
8
|
+
let ne = (l = 21) => {
|
|
9
|
+
let f = "", m = crypto.getRandomValues(new Uint8Array(l));
|
|
10
|
+
for (; l--; ) {
|
|
11
|
+
let c = m[l] & 63;
|
|
12
|
+
c < 36 ? f += c.toString(36) : c < 62 ? f += (c - 26).toString(36).toUpperCase() : c < 63 ? f += "_" : f += "-";
|
|
42
13
|
}
|
|
43
|
-
return
|
|
14
|
+
return f;
|
|
44
15
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
function getDefaultExportFromCjs (x) {
|
|
49
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
16
|
+
var ae = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
17
|
+
function ie(l) {
|
|
18
|
+
return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l;
|
|
50
19
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
} (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
});
|
|
94
|
-
const importMultiMinio = iotMinio.post(`upload-objects`, (config) => {
|
|
95
|
-
if (!config.headers)
|
|
96
|
-
config.headers = {};
|
|
97
|
-
config.headers["Content-Type"] = "multipart/form-data";
|
|
98
|
-
config.responseType = "blob";
|
|
99
|
-
return config;
|
|
100
|
-
});
|
|
101
|
-
const getTaskProgress = iotProgress.get(`progress`);
|
|
102
|
-
const useFile = () => {
|
|
103
|
-
let showProgressDialog = ref(false);
|
|
104
|
-
let progressTitle = ref("");
|
|
105
|
-
let percent = ref(0);
|
|
106
|
-
let progressStatus = ref("normal");
|
|
107
|
-
let progressLoading = ref(false);
|
|
108
|
-
let progressTimer;
|
|
109
|
-
let progressResult = ref("");
|
|
110
|
-
let errorFileName = ref("");
|
|
111
|
-
let errorFileSize = ref("");
|
|
112
|
-
let errorMessage = ref("");
|
|
113
|
-
let errorImport = ref(false);
|
|
114
|
-
let errorFilePath = ref("");
|
|
115
|
-
let tempErrPathName = "";
|
|
116
|
-
let fileInfo;
|
|
117
|
-
const resetStataus = () => {
|
|
118
|
-
errorFileName.value = "";
|
|
119
|
-
errorFileSize.value = "";
|
|
120
|
-
errorMessage.value = "";
|
|
121
|
-
errorImport.value = false;
|
|
122
|
-
errorFilePath.value = "";
|
|
123
|
-
};
|
|
124
|
-
const getMinioConfig = async () => {
|
|
125
|
-
const [error, data] = await getMinioToken().run();
|
|
126
|
-
if (error) {
|
|
127
|
-
return { stauts: false };
|
|
128
|
-
}
|
|
129
|
-
return { status: true, data };
|
|
130
|
-
};
|
|
131
|
-
const readFileAndAddToMap = (file) => {
|
|
132
|
-
return new Promise((resolve, reject) => {
|
|
133
|
-
const chunkSize = 1024 * 1024;
|
|
134
|
-
const chunks = [];
|
|
135
|
-
let offset = 0;
|
|
136
|
-
while (offset < file.size) {
|
|
137
|
-
const chunk = file.slice(offset, offset + chunkSize);
|
|
138
|
-
chunks.push(chunk);
|
|
139
|
-
offset += chunkSize;
|
|
20
|
+
var se = { exports: {} };
|
|
21
|
+
(function(l, f) {
|
|
22
|
+
(function(m, c) {
|
|
23
|
+
l.exports = c();
|
|
24
|
+
})(ae, function() {
|
|
25
|
+
var m = 1e3, c = 6e4, k = 36e5, y = "millisecond", D = "second", M = "minute", j = "hour", w = "day", P = "week", S = "month", W = "quarter", x = "year", Y = "date", J = "Invalid Date", V = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, G = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, Q = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(s) {
|
|
26
|
+
var t = ["th", "st", "nd", "rd"], e = s % 100;
|
|
27
|
+
return "[" + s + (t[(e - 20) % 10] || t[e] || t[0]) + "]";
|
|
28
|
+
} }, E = function(s, t, e) {
|
|
29
|
+
var n = String(s);
|
|
30
|
+
return !n || n.length >= t ? s : "" + Array(t + 1 - n.length).join(e) + s;
|
|
31
|
+
}, z = { s: E, z: function(s) {
|
|
32
|
+
var t = -s.utcOffset(), e = Math.abs(t), n = Math.floor(e / 60), r = e % 60;
|
|
33
|
+
return (t <= 0 ? "+" : "-") + E(n, 2, "0") + ":" + E(r, 2, "0");
|
|
34
|
+
}, m: function s(t, e) {
|
|
35
|
+
if (t.date() < e.date())
|
|
36
|
+
return -s(e, t);
|
|
37
|
+
var n = 12 * (e.year() - t.year()) + (e.month() - t.month()), r = t.clone().add(n, S), a = e - r < 0, i = t.clone().add(n + (a ? -1 : 1), S);
|
|
38
|
+
return +(-(n + (e - r) / (a ? r - i : i - r)) || 0);
|
|
39
|
+
}, a: function(s) {
|
|
40
|
+
return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
|
|
41
|
+
}, p: function(s) {
|
|
42
|
+
return { M: S, y: x, w: P, d: w, D: Y, h: j, m: M, s: D, ms: y, Q: W }[s] || String(s || "").toLowerCase().replace(/s$/, "");
|
|
43
|
+
}, u: function(s) {
|
|
44
|
+
return s === void 0;
|
|
45
|
+
} }, I = "en", R = {};
|
|
46
|
+
R[I] = Q;
|
|
47
|
+
var K = "$isDayjsObject", Z = function(s) {
|
|
48
|
+
return s instanceof v || !(!s || !s[K]);
|
|
49
|
+
}, d = function s(t, e, n) {
|
|
50
|
+
var r;
|
|
51
|
+
if (!t)
|
|
52
|
+
return I;
|
|
53
|
+
if (typeof t == "string") {
|
|
54
|
+
var a = t.toLowerCase();
|
|
55
|
+
R[a] && (r = a), e && (R[a] = e, r = a);
|
|
56
|
+
var i = t.split("-");
|
|
57
|
+
if (!r && i.length > 1)
|
|
58
|
+
return s(i[0]);
|
|
59
|
+
} else {
|
|
60
|
+
var p = t.name;
|
|
61
|
+
R[p] = t, r = p;
|
|
140
62
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
63
|
+
return !n && r && (I = r), r || !n && I;
|
|
64
|
+
}, o = function(s, t) {
|
|
65
|
+
if (Z(s))
|
|
66
|
+
return s.clone();
|
|
67
|
+
var e = typeof t == "object" ? t : {};
|
|
68
|
+
return e.date = s, e.args = arguments, new v(e);
|
|
69
|
+
}, u = z;
|
|
70
|
+
u.l = d, u.i = Z, u.w = function(s, t) {
|
|
71
|
+
return o(s, { locale: t.$L, utc: t.$u, x: t.$x, $offset: t.$offset });
|
|
72
|
+
};
|
|
73
|
+
var v = function() {
|
|
74
|
+
function s(e) {
|
|
75
|
+
this.$L = d(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[K] = !0;
|
|
76
|
+
}
|
|
77
|
+
var t = s.prototype;
|
|
78
|
+
return t.parse = function(e) {
|
|
79
|
+
this.$d = function(n) {
|
|
80
|
+
var r = n.date, a = n.utc;
|
|
81
|
+
if (r === null)
|
|
82
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
83
|
+
if (u.u(r))
|
|
84
|
+
return /* @__PURE__ */ new Date();
|
|
85
|
+
if (r instanceof Date)
|
|
86
|
+
return new Date(r);
|
|
87
|
+
if (typeof r == "string" && !/Z$/i.test(r)) {
|
|
88
|
+
var i = r.match(V);
|
|
89
|
+
if (i) {
|
|
90
|
+
var p = i[2] - 1 || 0, h = (i[7] || "0").substring(0, 3);
|
|
91
|
+
return a ? new Date(Date.UTC(i[1], p, i[3] || 1, i[4] || 0, i[5] || 0, i[6] || 0, h)) : new Date(i[1], p, i[3] || 1, i[4] || 0, i[5] || 0, i[6] || 0, h);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return new Date(r);
|
|
95
|
+
}(e), this.init();
|
|
96
|
+
}, t.init = function() {
|
|
97
|
+
var e = this.$d;
|
|
98
|
+
this.$y = e.getFullYear(), this.$M = e.getMonth(), this.$D = e.getDate(), this.$W = e.getDay(), this.$H = e.getHours(), this.$m = e.getMinutes(), this.$s = e.getSeconds(), this.$ms = e.getMilliseconds();
|
|
99
|
+
}, t.$utils = function() {
|
|
100
|
+
return u;
|
|
101
|
+
}, t.isValid = function() {
|
|
102
|
+
return this.$d.toString() !== J;
|
|
103
|
+
}, t.isSame = function(e, n) {
|
|
104
|
+
var r = o(e);
|
|
105
|
+
return this.startOf(n) <= r && r <= this.endOf(n);
|
|
106
|
+
}, t.isAfter = function(e, n) {
|
|
107
|
+
return o(e) < this.startOf(n);
|
|
108
|
+
}, t.isBefore = function(e, n) {
|
|
109
|
+
return this.endOf(n) < o(e);
|
|
110
|
+
}, t.$g = function(e, n, r) {
|
|
111
|
+
return u.u(e) ? this[n] : this.set(r, e);
|
|
112
|
+
}, t.unix = function() {
|
|
113
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
114
|
+
}, t.valueOf = function() {
|
|
115
|
+
return this.$d.getTime();
|
|
116
|
+
}, t.startOf = function(e, n) {
|
|
117
|
+
var r = this, a = !!u.u(n) || n, i = u.p(e), p = function(N, T) {
|
|
118
|
+
var B = u.w(r.$u ? Date.UTC(r.$y, T, N) : new Date(r.$y, T, N), r);
|
|
119
|
+
return a ? B : B.endOf(w);
|
|
120
|
+
}, h = function(N, T) {
|
|
121
|
+
return u.w(r.toDate()[N].apply(r.toDate("s"), (a ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(T)), r);
|
|
122
|
+
}, $ = this.$W, g = this.$M, b = this.$D, L = "set" + (this.$u ? "UTC" : "");
|
|
123
|
+
switch (i) {
|
|
124
|
+
case x:
|
|
125
|
+
return a ? p(1, 0) : p(31, 11);
|
|
126
|
+
case S:
|
|
127
|
+
return a ? p(1, g) : p(0, g + 1);
|
|
128
|
+
case P:
|
|
129
|
+
var O = this.$locale().weekStart || 0, H = ($ < O ? $ + 7 : $) - O;
|
|
130
|
+
return p(a ? b - H : b + (6 - H), g);
|
|
131
|
+
case w:
|
|
132
|
+
case Y:
|
|
133
|
+
return h(L + "Hours", 0);
|
|
134
|
+
case j:
|
|
135
|
+
return h(L + "Minutes", 1);
|
|
136
|
+
case M:
|
|
137
|
+
return h(L + "Seconds", 2);
|
|
138
|
+
case D:
|
|
139
|
+
return h(L + "Milliseconds", 3);
|
|
140
|
+
default:
|
|
141
|
+
return this.clone();
|
|
142
|
+
}
|
|
143
|
+
}, t.endOf = function(e) {
|
|
144
|
+
return this.startOf(e, !1);
|
|
145
|
+
}, t.$set = function(e, n) {
|
|
146
|
+
var r, a = u.p(e), i = "set" + (this.$u ? "UTC" : ""), p = (r = {}, r[w] = i + "Date", r[Y] = i + "Date", r[S] = i + "Month", r[x] = i + "FullYear", r[j] = i + "Hours", r[M] = i + "Minutes", r[D] = i + "Seconds", r[y] = i + "Milliseconds", r)[a], h = a === w ? this.$D + (n - this.$W) : n;
|
|
147
|
+
if (a === S || a === x) {
|
|
148
|
+
var $ = this.clone().set(Y, 1);
|
|
149
|
+
$.$d[p](h), $.init(), this.$d = $.set(Y, Math.min(this.$D, $.daysInMonth())).$d;
|
|
150
|
+
} else
|
|
151
|
+
p && this.$d[p](h);
|
|
152
|
+
return this.init(), this;
|
|
153
|
+
}, t.set = function(e, n) {
|
|
154
|
+
return this.clone().$set(e, n);
|
|
155
|
+
}, t.get = function(e) {
|
|
156
|
+
return this[u.p(e)]();
|
|
157
|
+
}, t.add = function(e, n) {
|
|
158
|
+
var r, a = this;
|
|
159
|
+
e = Number(e);
|
|
160
|
+
var i = u.p(n), p = function(g) {
|
|
161
|
+
var b = o(a);
|
|
162
|
+
return u.w(b.date(b.date() + Math.round(g * e)), a);
|
|
163
|
+
};
|
|
164
|
+
if (i === S)
|
|
165
|
+
return this.set(S, this.$M + e);
|
|
166
|
+
if (i === x)
|
|
167
|
+
return this.set(x, this.$y + e);
|
|
168
|
+
if (i === w)
|
|
169
|
+
return p(1);
|
|
170
|
+
if (i === P)
|
|
171
|
+
return p(7);
|
|
172
|
+
var h = (r = {}, r[M] = c, r[j] = k, r[D] = m, r)[i] || 1, $ = this.$d.getTime() + e * h;
|
|
173
|
+
return u.w($, this);
|
|
174
|
+
}, t.subtract = function(e, n) {
|
|
175
|
+
return this.add(-1 * e, n);
|
|
176
|
+
}, t.format = function(e) {
|
|
177
|
+
var n = this, r = this.$locale();
|
|
178
|
+
if (!this.isValid())
|
|
179
|
+
return r.invalidDate || J;
|
|
180
|
+
var a = e || "YYYY-MM-DDTHH:mm:ssZ", i = u.z(this), p = this.$H, h = this.$m, $ = this.$M, g = r.weekdays, b = r.months, L = r.meridiem, O = function(T, B, q, F) {
|
|
181
|
+
return T && (T[B] || T(n, a)) || q[B].slice(0, F);
|
|
182
|
+
}, H = function(T) {
|
|
183
|
+
return u.s(p % 12 || 12, T, "0");
|
|
184
|
+
}, N = L || function(T, B, q) {
|
|
185
|
+
var F = T < 12 ? "AM" : "PM";
|
|
186
|
+
return q ? F.toLowerCase() : F;
|
|
187
|
+
};
|
|
188
|
+
return a.replace(G, function(T, B) {
|
|
189
|
+
return B || function(q) {
|
|
190
|
+
switch (q) {
|
|
191
|
+
case "YY":
|
|
192
|
+
return String(n.$y).slice(-2);
|
|
193
|
+
case "YYYY":
|
|
194
|
+
return u.s(n.$y, 4, "0");
|
|
195
|
+
case "M":
|
|
196
|
+
return $ + 1;
|
|
197
|
+
case "MM":
|
|
198
|
+
return u.s($ + 1, 2, "0");
|
|
199
|
+
case "MMM":
|
|
200
|
+
return O(r.monthsShort, $, b, 3);
|
|
201
|
+
case "MMMM":
|
|
202
|
+
return O(b, $);
|
|
203
|
+
case "D":
|
|
204
|
+
return n.$D;
|
|
205
|
+
case "DD":
|
|
206
|
+
return u.s(n.$D, 2, "0");
|
|
207
|
+
case "d":
|
|
208
|
+
return String(n.$W);
|
|
209
|
+
case "dd":
|
|
210
|
+
return O(r.weekdaysMin, n.$W, g, 2);
|
|
211
|
+
case "ddd":
|
|
212
|
+
return O(r.weekdaysShort, n.$W, g, 3);
|
|
213
|
+
case "dddd":
|
|
214
|
+
return g[n.$W];
|
|
215
|
+
case "H":
|
|
216
|
+
return String(p);
|
|
217
|
+
case "HH":
|
|
218
|
+
return u.s(p, 2, "0");
|
|
219
|
+
case "h":
|
|
220
|
+
return H(1);
|
|
221
|
+
case "hh":
|
|
222
|
+
return H(2);
|
|
223
|
+
case "a":
|
|
224
|
+
return N(p, h, !0);
|
|
225
|
+
case "A":
|
|
226
|
+
return N(p, h, !1);
|
|
227
|
+
case "m":
|
|
228
|
+
return String(h);
|
|
229
|
+
case "mm":
|
|
230
|
+
return u.s(h, 2, "0");
|
|
231
|
+
case "s":
|
|
232
|
+
return String(n.$s);
|
|
233
|
+
case "ss":
|
|
234
|
+
return u.s(n.$s, 2, "0");
|
|
235
|
+
case "SSS":
|
|
236
|
+
return u.s(n.$ms, 3, "0");
|
|
237
|
+
case "Z":
|
|
238
|
+
return i;
|
|
239
|
+
}
|
|
240
|
+
return null;
|
|
241
|
+
}(T) || i.replace(":", "");
|
|
242
|
+
});
|
|
243
|
+
}, t.utcOffset = function() {
|
|
244
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
245
|
+
}, t.diff = function(e, n, r) {
|
|
246
|
+
var a, i = this, p = u.p(n), h = o(e), $ = (h.utcOffset() - this.utcOffset()) * c, g = this - h, b = function() {
|
|
247
|
+
return u.m(i, h);
|
|
248
|
+
};
|
|
249
|
+
switch (p) {
|
|
250
|
+
case x:
|
|
251
|
+
a = b() / 12;
|
|
252
|
+
break;
|
|
253
|
+
case S:
|
|
254
|
+
a = b();
|
|
255
|
+
break;
|
|
256
|
+
case W:
|
|
257
|
+
a = b() / 3;
|
|
258
|
+
break;
|
|
259
|
+
case P:
|
|
260
|
+
a = (g - $) / 6048e5;
|
|
261
|
+
break;
|
|
262
|
+
case w:
|
|
263
|
+
a = (g - $) / 864e5;
|
|
264
|
+
break;
|
|
265
|
+
case j:
|
|
266
|
+
a = g / k;
|
|
267
|
+
break;
|
|
268
|
+
case M:
|
|
269
|
+
a = g / c;
|
|
270
|
+
break;
|
|
271
|
+
case D:
|
|
272
|
+
a = g / m;
|
|
273
|
+
break;
|
|
274
|
+
default:
|
|
275
|
+
a = g;
|
|
276
|
+
}
|
|
277
|
+
return r ? a : u.a(a);
|
|
278
|
+
}, t.daysInMonth = function() {
|
|
279
|
+
return this.endOf(S).$D;
|
|
280
|
+
}, t.$locale = function() {
|
|
281
|
+
return R[this.$L];
|
|
282
|
+
}, t.locale = function(e, n) {
|
|
283
|
+
if (!e)
|
|
284
|
+
return this.$L;
|
|
285
|
+
var r = this.clone(), a = d(e, n, !0);
|
|
286
|
+
return a && (r.$L = a), r;
|
|
287
|
+
}, t.clone = function() {
|
|
288
|
+
return u.w(this.$d, this);
|
|
289
|
+
}, t.toDate = function() {
|
|
290
|
+
return new Date(this.valueOf());
|
|
291
|
+
}, t.toJSON = function() {
|
|
292
|
+
return this.isValid() ? this.toISOString() : null;
|
|
293
|
+
}, t.toISOString = function() {
|
|
294
|
+
return this.$d.toISOString();
|
|
295
|
+
}, t.toString = function() {
|
|
296
|
+
return this.$d.toUTCString();
|
|
297
|
+
}, s;
|
|
298
|
+
}(), A = v.prototype;
|
|
299
|
+
return o.prototype = A, [["$ms", y], ["$s", D], ["$m", M], ["$H", j], ["$W", w], ["$M", S], ["$y", x], ["$D", Y]].forEach(function(s) {
|
|
300
|
+
A[s[1]] = function(t) {
|
|
301
|
+
return this.$g(t, s[0], s[1]);
|
|
302
|
+
};
|
|
303
|
+
}), o.extend = function(s, t) {
|
|
304
|
+
return s.$i || (s(t, v, o), s.$i = !0), o;
|
|
305
|
+
}, o.locale = d, o.isDayjs = Z, o.unix = function(s) {
|
|
306
|
+
return o(1e3 * s);
|
|
307
|
+
}, o.en = R[I], o.Ls = R, o.p = {}, o;
|
|
308
|
+
});
|
|
309
|
+
})(se);
|
|
310
|
+
var oe = se.exports;
|
|
311
|
+
const ue = /* @__PURE__ */ ie(oe), ee = () => {
|
|
312
|
+
let f = { ...(window == null ? void 0 : window.config) || {} };
|
|
313
|
+
f.rootContainer || (f.rootContainer = "#app"), f.baseURL || (f.baseURL = location.origin), f.ossBaseURL || (f.ossBaseURL = "/oss"), f.ossBaseURL.startsWith("/") && (f.ossBaseURL = `${f.baseURL}/oss`), f.ssoBaseURL || (f.ssoBaseURL = f.baseURL);
|
|
314
|
+
let { microAppName: m, publicPath: c, mainAppName: k } = f;
|
|
315
|
+
return m && !0 && !c && (c = `/${m}/`.replace(/\/\//g, "/")), c || (c = "/"), f.publicPath = c, f.autoOssBucket || (f.autoOssBucket = k || m), f;
|
|
316
|
+
}, ce = X.get("token"), le = X.post("putObject", (l) => (l.headers || (l.headers = {}), l.headers["Content-Type"] = "multipart/form-data", l.responseType = "blob", l)), fe = X.post("upload-objects", (l) => (l.headers || (l.headers = {}), l.headers["Content-Type"] = "multipart/form-data", l.responseType = "blob", l)), de = re.get("progress"), $e = () => {
|
|
317
|
+
let l = U(!1), f = U(""), m = U(0), c = U("normal"), k = U(!1), y, D = U(""), M = U(""), j = U(""), w = U(""), P = U(!1), S = U(""), W = "", x;
|
|
318
|
+
const Y = () => {
|
|
319
|
+
M.value = "", j.value = "", w.value = "", P.value = !1, S.value = "";
|
|
320
|
+
}, J = async () => {
|
|
321
|
+
const [d, o] = await ce().run();
|
|
322
|
+
return d ? { stauts: !1 } : { status: !0, data: o };
|
|
323
|
+
}, V = (d) => new Promise((o, u) => {
|
|
324
|
+
const A = [];
|
|
325
|
+
let s = 0;
|
|
326
|
+
for (; s < d.size; ) {
|
|
327
|
+
const e = d.slice(s, s + 1048576);
|
|
328
|
+
A.push(e), s += 1048576;
|
|
153
329
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
330
|
+
const t = new Blob(A, { type: d.type });
|
|
331
|
+
o(t);
|
|
332
|
+
}), G = async (d, o, u, v = !0, A = "", s = !1) => {
|
|
333
|
+
W = A, v && (c.value = "normal", m.value = 0, f.value = "导入进度", l.value = !0, D.value = ""), x = o;
|
|
334
|
+
const t = await J();
|
|
335
|
+
if (!t.status)
|
|
157
336
|
return;
|
|
158
|
-
let
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
params.append("accessKeyId", minioConfig.accessKeyId);
|
|
170
|
-
params.append("secretAccessKey", minioConfig.secretAccessKey);
|
|
171
|
-
params.append("sessionToken", minioConfig.sessionToken);
|
|
172
|
-
params.append("bucketName", bucketName);
|
|
173
|
-
file.forEach((v, i) => {
|
|
174
|
-
params.append("file", blobList[i]);
|
|
175
|
-
});
|
|
176
|
-
importFileName.forEach((v) => {
|
|
177
|
-
params.append("filePaths", v);
|
|
337
|
+
let e = t.data, n = null, { autoContentType: r, bucketName: a, importFileName: i } = u;
|
|
338
|
+
const p = s ? fe : le;
|
|
339
|
+
if (s) {
|
|
340
|
+
let L = [];
|
|
341
|
+
await o.forEach(async (O) => {
|
|
342
|
+
let H = await V(O);
|
|
343
|
+
L.push(H);
|
|
344
|
+
}), n = new FormData(), n.append("accessKeyId", e.accessKeyId), n.append("secretAccessKey", e.secretAccessKey), n.append("sessionToken", e.sessionToken), n.append("bucketName", a), o.forEach((O, H) => {
|
|
345
|
+
n.append("file", L[H]);
|
|
346
|
+
}), i.forEach((O) => {
|
|
347
|
+
n.append("filePaths", O);
|
|
178
348
|
});
|
|
179
349
|
} else {
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
accessKeyId:
|
|
183
|
-
secretAccessKey:
|
|
184
|
-
sessionToken:
|
|
185
|
-
file:
|
|
186
|
-
bucketName,
|
|
187
|
-
filePath:
|
|
188
|
-
autoContentType
|
|
350
|
+
const L = await V(o);
|
|
351
|
+
n = {
|
|
352
|
+
accessKeyId: e.accessKeyId,
|
|
353
|
+
secretAccessKey: e.secretAccessKey,
|
|
354
|
+
sessionToken: e.sessionToken,
|
|
355
|
+
file: L,
|
|
356
|
+
bucketName: a,
|
|
357
|
+
filePath: i,
|
|
358
|
+
autoContentType: r
|
|
189
359
|
};
|
|
190
360
|
}
|
|
191
|
-
const [
|
|
192
|
-
if (
|
|
361
|
+
const [h, $] = await p(n).run();
|
|
362
|
+
if (h)
|
|
193
363
|
return;
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
showProgressDialog.value = false;
|
|
199
|
-
progressStatus.value = "error";
|
|
364
|
+
const g = await he($.data), b = await (d == null ? void 0 : d(g));
|
|
365
|
+
if (v) {
|
|
366
|
+
if (!b.status) {
|
|
367
|
+
l.value = !1, c.value = "error";
|
|
200
368
|
return;
|
|
201
369
|
}
|
|
202
|
-
|
|
203
|
-
showProgressDialog.value = true;
|
|
204
|
-
checkProgress(importResult.taskId, "import", "");
|
|
370
|
+
f.value = "导入进度", l.value = !0, z(b.taskId, "import", "");
|
|
205
371
|
} else {
|
|
206
|
-
if (!
|
|
372
|
+
if (!b.status)
|
|
207
373
|
return;
|
|
208
|
-
|
|
374
|
+
c.value = "success";
|
|
209
375
|
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
showProgressDialog.value = true;
|
|
216
|
-
const importResult = await exportFunc?.();
|
|
217
|
-
if (!importResult.status) {
|
|
218
|
-
showProgressDialog.value = false;
|
|
219
|
-
progressStatus.value = "error";
|
|
376
|
+
}, Q = async (d, o = "", u = "") => {
|
|
377
|
+
c.value = "normal", m.value = 0, f.value = u || "导出进度", l.value = !0;
|
|
378
|
+
const v = await (d == null ? void 0 : d());
|
|
379
|
+
if (!v.status) {
|
|
380
|
+
l.value = !1, c.value = "error";
|
|
220
381
|
return;
|
|
221
382
|
}
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
showProgressDialog.value = true;
|
|
229
|
-
const importResult = await exportFunc?.();
|
|
230
|
-
if (!importResult.status) {
|
|
231
|
-
showProgressDialog.value = false;
|
|
232
|
-
progressStatus.value = "error";
|
|
383
|
+
z(v.taskId, "action", "");
|
|
384
|
+
}, E = async (d, o = "", u = "") => {
|
|
385
|
+
c.value = "normal", m.value = 0, f.value = "导出进度", l.value = !0;
|
|
386
|
+
const v = await (d == null ? void 0 : d());
|
|
387
|
+
if (!v.status) {
|
|
388
|
+
l.value = !1, c.value = "error";
|
|
233
389
|
return;
|
|
234
390
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
const checkProgress = async (taskId, type, fileName, fileSuffix = "") => {
|
|
239
|
-
progressLoading.value = true;
|
|
240
|
-
getProgress(taskId, type, fileName, fileSuffix);
|
|
241
|
-
progressTimer = setTimeout(() => {
|
|
391
|
+
ue().format("YYYYMMDDHHmmss") + "", z(v.taskId, "export", o || "", u);
|
|
392
|
+
}, z = async (d, o, u, v = "") => {
|
|
393
|
+
k.value = !0, R(d, o, u, v), y = setTimeout(() => {
|
|
242
394
|
}, 50);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
const getProgress = async (taskId, type = "export", fileName, fileSuffix = "") => {
|
|
250
|
-
const [error, data] = await getTaskProgress("", {
|
|
251
|
-
url: `progress/${taskId}`
|
|
395
|
+
}, I = () => {
|
|
396
|
+
clearTimeout(y), y = null, l.value = !1;
|
|
397
|
+
}, R = async (d, o = "export", u, v = "") => {
|
|
398
|
+
var e, n;
|
|
399
|
+
const [A, s] = await de("", {
|
|
400
|
+
url: `progress/${d}`
|
|
252
401
|
}).run();
|
|
253
|
-
if (
|
|
254
|
-
|
|
402
|
+
if (A) {
|
|
403
|
+
k.value = !1;
|
|
255
404
|
return;
|
|
256
405
|
}
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
if (
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
errorMessage.value = data.message || `${tip}\u5931\u8D25`;
|
|
270
|
-
}
|
|
271
|
-
} else if (type == "import") {
|
|
272
|
-
if (!!data.filePath) {
|
|
273
|
-
progressStatus.value = "error";
|
|
274
|
-
const matchName = fileInfo.name?.match(/(.*?)(\.[^.]*$|$)/);
|
|
275
|
-
const suffix = matchName.length ? matchName[2] : "";
|
|
276
|
-
errorImport.value = true;
|
|
277
|
-
const pathName = data.filePath?.replace(/(.*\/)*([^.]+).*/gi, "$2");
|
|
278
|
-
errorFileName.value = tempErrPathName ? tempErrPathName : `${pathName}${suffix}`;
|
|
279
|
-
errorFileSize.value = fileInfo.sizeText;
|
|
280
|
-
errorMessage.value = "\u90E8\u5206\u6570\u636E\u6821\u9A8C\u4E0D\u901A\u8FC7\uFF0C\u8BF7\u4E0B\u8F7D\u9644\u4EF6\u5E76\u4FEE\u6539\uFF0C\u91CD\u65B0\u5BFC\u5165\uFF01";
|
|
281
|
-
errorFilePath.value = `${getConfig().baseURL}/oss${data.filePath}`;
|
|
406
|
+
m.value = s.percentage;
|
|
407
|
+
const t = o == "export" ? "导出" : "导入";
|
|
408
|
+
if (m.value == 100)
|
|
409
|
+
if (D.value = s, k.value = !1, I(), o == "export")
|
|
410
|
+
s.status == 1 ? (c.value = "success", te(`${ee().baseURL}/oss${s.filePath}`, u, v), k.value = !1) : s.status == 2 && (w.value = s.message || `${t}失败`);
|
|
411
|
+
else if (o == "import") {
|
|
412
|
+
if (s.filePath) {
|
|
413
|
+
c.value = "error";
|
|
414
|
+
const r = (e = x.name) == null ? void 0 : e.match(/(.*?)(\.[^.]*$|$)/), a = r.length ? r[2] : "";
|
|
415
|
+
P.value = !0;
|
|
416
|
+
const i = (n = s.filePath) == null ? void 0 : n.replace(/(.*\/)*([^.]+).*/gi, "$2");
|
|
417
|
+
M.value = W || `${i}${a}`, j.value = x.sizeText, w.value = "部分数据校验不通过,请下载附件并修改,重新导入!", S.value = `${ee().baseURL}/oss${s.filePath}`;
|
|
282
418
|
}
|
|
283
|
-
|
|
284
|
-
} else
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
} else {
|
|
293
|
-
progressResult.value = data;
|
|
294
|
-
progressLoading.value = false;
|
|
295
|
-
tipHandle(data.status, tip, data.message);
|
|
296
|
-
clearTimer();
|
|
297
|
-
errorImport.value = true;
|
|
298
|
-
errorMessage.value = data?.message || "";
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
|
-
const tipHandle = (status, tip, message) => {
|
|
303
|
-
if (status == 1) {
|
|
304
|
-
progressStatus.value = "success";
|
|
305
|
-
errorFileName.value = "";
|
|
306
|
-
errorFileSize.value = "";
|
|
307
|
-
errorMessage.value = "";
|
|
308
|
-
} else if (status == 2) {
|
|
309
|
-
progressStatus.value = "error";
|
|
310
|
-
errorMessage.value = message ? message : "\u90E8\u5206\u6570\u636E\u6821\u9A8C\u4E0D\u901A\u8FC7\uFF0C\u8BF7\u4E0B\u8F7D\u9644\u4EF6\u5E76\u4FEE\u6539\uFF0C\u91CD\u65B0\u5BFC\u5165\uFF01";
|
|
311
|
-
} else if (status == 3) {
|
|
312
|
-
progressStatus.value = "error";
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
const generateUniqueName = (fileName) => {
|
|
316
|
-
const matchName = fileName?.match(/(.*?)(\.[^.]*$|$)/);
|
|
317
|
-
const suffix = matchName.length ? matchName[2] : "";
|
|
318
|
-
const name = matchName.length ? matchName[1] : fileName;
|
|
319
|
-
return `${name}${nanoid()}${suffix}`;
|
|
419
|
+
K(s.status, t, s.message);
|
|
420
|
+
} else
|
|
421
|
+
o == "action" && (c.value = "success");
|
|
422
|
+
else
|
|
423
|
+
y && s.status != 2 ? y = setTimeout(() => {
|
|
424
|
+
R(d, o, u, v);
|
|
425
|
+
}, 50) : (D.value = s, k.value = !1, K(s.status, t, s.message), I(), P.value = !0, w.value = (s == null ? void 0 : s.message) || "");
|
|
426
|
+
}, K = (d, o, u) => {
|
|
427
|
+
d == 1 ? (c.value = "success", M.value = "", j.value = "", w.value = "") : d == 2 ? (c.value = "error", w.value = u || "部分数据校验不通过,请下载附件并修改,重新导入!") : d == 3 && (c.value = "error");
|
|
320
428
|
};
|
|
321
429
|
return {
|
|
322
|
-
showProgressDialog,
|
|
323
|
-
progressTitle,
|
|
324
|
-
percent,
|
|
325
|
-
progressStatus,
|
|
326
|
-
progressLoading,
|
|
327
|
-
progressResult,
|
|
328
|
-
errorFileName,
|
|
329
|
-
errorFileSize,
|
|
330
|
-
errorMessage,
|
|
331
|
-
errorImport,
|
|
332
|
-
errorFilePath,
|
|
333
|
-
fileImport,
|
|
334
|
-
fileExport,
|
|
335
|
-
fileAction,
|
|
336
|
-
generateUniqueName
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
430
|
+
showProgressDialog: l,
|
|
431
|
+
progressTitle: f,
|
|
432
|
+
percent: m,
|
|
433
|
+
progressStatus: c,
|
|
434
|
+
progressLoading: k,
|
|
435
|
+
progressResult: D,
|
|
436
|
+
errorFileName: M,
|
|
437
|
+
errorFileSize: j,
|
|
438
|
+
errorMessage: w,
|
|
439
|
+
errorImport: P,
|
|
440
|
+
errorFilePath: S,
|
|
441
|
+
fileImport: G,
|
|
442
|
+
fileExport: E,
|
|
443
|
+
fileAction: Q,
|
|
444
|
+
generateUniqueName: (d) => {
|
|
445
|
+
const o = d == null ? void 0 : d.match(/(.*?)(\.[^.]*$|$)/), u = o.length ? o[2] : "";
|
|
446
|
+
return `${o.length ? o[1] : d}${ne()}${u}`;
|
|
447
|
+
},
|
|
448
|
+
downloadFile: te,
|
|
449
|
+
resetStataus: Y,
|
|
450
|
+
checkProgress: z
|
|
340
451
|
};
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
let typeList = {
|
|
452
|
+
}, pe = (l) => {
|
|
453
|
+
let f = l == null ? void 0 : l.toLocaleLowerCase();
|
|
454
|
+
return {
|
|
345
455
|
excel: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
346
456
|
pdf: "application/pdf",
|
|
347
457
|
doc: "application/msword",
|
|
@@ -367,43 +477,28 @@ const fileBobType = (type) => {
|
|
|
367
477
|
crt: "application/x-x509-ca-cert",
|
|
368
478
|
der: "application/x-x509-ca-cert",
|
|
369
479
|
cer: "application/pkix-cert"
|
|
370
|
-
};
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
const objectUrl = URL.createObjectURL(blob);
|
|
383
|
-
if (window.navigator.msSaveOrOpenBlob) {
|
|
384
|
-
navigator.msSaveBlob(blob, filename);
|
|
385
|
-
} else {
|
|
386
|
-
const element = document.createElement("a");
|
|
387
|
-
element.href = objectUrl;
|
|
388
|
-
element.download = filename;
|
|
389
|
-
element.click();
|
|
390
|
-
window.URL.revokeObjectURL(objectUrl);
|
|
480
|
+
}[f];
|
|
481
|
+
}, te = (l, f, m = "excel") => {
|
|
482
|
+
const c = new XMLHttpRequest();
|
|
483
|
+
c.open("get", l), c.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), c.responseType = "blob", c.onload = function(k) {
|
|
484
|
+
const y = new Blob([this.response], {
|
|
485
|
+
type: pe(m)
|
|
486
|
+
}), D = URL.createObjectURL(y);
|
|
487
|
+
if (window.navigator.msSaveOrOpenBlob)
|
|
488
|
+
navigator.msSaveBlob(y, f);
|
|
489
|
+
else {
|
|
490
|
+
const M = document.createElement("a");
|
|
491
|
+
M.href = D, M.download = f, M.click(), window.URL.revokeObjectURL(D);
|
|
391
492
|
}
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
resolve(data);
|
|
404
|
-
};
|
|
405
|
-
reader.readAsText(blob);
|
|
406
|
-
});
|
|
493
|
+
}, c.send();
|
|
494
|
+
}, he = (l) => new Promise((f, m) => {
|
|
495
|
+
var c = new FileReader();
|
|
496
|
+
c.onload = function(k) {
|
|
497
|
+
let y = "";
|
|
498
|
+
typeof c.result == "string" && (y = JSON.parse(c.result)), f(y);
|
|
499
|
+
}, c.readAsText(l);
|
|
500
|
+
});
|
|
501
|
+
export {
|
|
502
|
+
te as downloadFile,
|
|
503
|
+
$e as useFile
|
|
407
504
|
};
|
|
408
|
-
|
|
409
|
-
export { downloadFile, useFile };
|