@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,379 +1,475 @@
|
|
|
1
|
-
import { createService } from
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const authentication = createService(`/api/license/admin/${version$i}`);
|
|
10
|
-
|
|
11
|
-
const version$h = "v1";
|
|
12
|
-
const bemsBase = `/api/bems/data-manage/${version$h}`;
|
|
13
|
-
const bemsModules = {
|
|
14
|
-
energyType: createService(`${bemsBase}/energy-type`),
|
|
15
|
-
energyObject: createService(`${bemsBase}/energy-object`),
|
|
16
|
-
energyDimension: createService(`${bemsBase}/energy-dimension`)
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const version$g = "v1";
|
|
20
|
-
const contract = createService(`/api/supply/contract/${version$g}`);
|
|
21
|
-
|
|
22
|
-
const version$f = "v1";
|
|
23
|
-
const dutyModules = {
|
|
24
|
-
classes: createService(`/api/duty-manage/classes/${version$f}`),
|
|
1
|
+
import { createService as o } from "@das-fed/utils/api-services";
|
|
2
|
+
import { ref as U } from "vue";
|
|
3
|
+
const ue = "v1", Be = o(`/api/app-manager/application/${ue}`), le = "v1", He = o(`/api/license/admin/${le}`), pe = "v1", se = `/api/bems/data-manage/${pe}`, Ye = {
|
|
4
|
+
energyType: o(`${se}/energy-type`),
|
|
5
|
+
energyObject: o(`${se}/energy-object`),
|
|
6
|
+
energyDimension: o(`${se}/energy-dimension`)
|
|
7
|
+
}, de = "v1", Ie = o(`/api/supply/contract/${de}`), Q = "v1", Ne = {
|
|
8
|
+
classes: o(`/api/duty-manage/classes/${Q}`),
|
|
25
9
|
// 班次管理
|
|
26
|
-
group:
|
|
10
|
+
group: o(`/api/duty-manage/group/${Q}`),
|
|
27
11
|
// 分组管理
|
|
28
|
-
scheduling:
|
|
12
|
+
scheduling: o(`/api/duty-manage/scheduling/${Q}`),
|
|
29
13
|
// 排班管理
|
|
30
|
-
shift:
|
|
14
|
+
shift: o(`/api/duty-manage/shift/${Q}`)
|
|
31
15
|
// 交接班管理
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
deviceRules: createService(`/api/device-relation/devicerule/${version$d}`),
|
|
48
|
-
project: createService(`/api/device-relation/project/${version$d}`)
|
|
49
|
-
};
|
|
50
|
-
const iotMinio = createService(`/api/oss/minio/${version$d}`);
|
|
51
|
-
const iotProgress = createService(`/api/progress/accessor/${version$d}`);
|
|
52
|
-
|
|
53
|
-
let urlAlphabet =
|
|
54
|
-
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
55
|
-
|
|
56
|
-
const POOL_SIZE_MULTIPLIER = 128;
|
|
57
|
-
let pool, poolOffset;
|
|
58
|
-
let fillPool = bytes => {
|
|
59
|
-
if (!pool || pool.length < bytes) {
|
|
60
|
-
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
|
|
61
|
-
crypto.randomFillSync(pool);
|
|
62
|
-
poolOffset = 0;
|
|
63
|
-
} else if (poolOffset + bytes > pool.length) {
|
|
64
|
-
crypto.randomFillSync(pool);
|
|
65
|
-
poolOffset = 0;
|
|
66
|
-
}
|
|
67
|
-
poolOffset += bytes;
|
|
68
|
-
};
|
|
69
|
-
let nanoid = (size = 21) => {
|
|
70
|
-
fillPool((size -= 0));
|
|
71
|
-
let id = '';
|
|
72
|
-
for (let i = poolOffset - size; i < poolOffset; i++) {
|
|
73
|
-
id += urlAlphabet[pool[i] & 63];
|
|
16
|
+
}, fe = "v1", Ee = o(`/api/enterpriseright/permission/${fe}`), C = "v1", We = o(`/api/iot/${C}`), ze = {
|
|
17
|
+
thingmodel: o(`/api/iot-device/thingmodel/${C}`),
|
|
18
|
+
deviceManage: o(`/api/iot-device/devicemanage/${C}`),
|
|
19
|
+
product: o(`/api/iot-device/product/${C}`),
|
|
20
|
+
productStorage: o(`/api/iot-device/product-storage/${C}`)
|
|
21
|
+
}, Ke = {
|
|
22
|
+
projectDevice: o(`/api/device-relation/deviceproject/${C}`),
|
|
23
|
+
deviceRules: o(`/api/device-relation/devicerule/${C}`),
|
|
24
|
+
project: o(`/api/device-relation/project/${C}`)
|
|
25
|
+
}, ne = o(`/api/oss/minio/${C}`), me = o(`/api/progress/accessor/${C}`);
|
|
26
|
+
let he = (p = 21) => {
|
|
27
|
+
let d = "", v = crypto.getRandomValues(new Uint8Array(p));
|
|
28
|
+
for (; p--; ) {
|
|
29
|
+
let l = v[p] & 63;
|
|
30
|
+
l < 36 ? d += l.toString(36) : l < 62 ? d += (l - 26).toString(36).toUpperCase() : l < 63 ? d += "_" : d += "-";
|
|
74
31
|
}
|
|
75
|
-
return
|
|
32
|
+
return d;
|
|
76
33
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
function getDefaultExportFromCjs (x) {
|
|
81
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
34
|
+
var ve = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
35
|
+
function $e(p) {
|
|
36
|
+
return p && p.__esModule && Object.prototype.hasOwnProperty.call(p, "default") ? p.default : p;
|
|
82
37
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
} (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
});
|
|
126
|
-
const importMultiMinio = iotMinio.post(`upload-objects`, (config) => {
|
|
127
|
-
if (!config.headers)
|
|
128
|
-
config.headers = {};
|
|
129
|
-
config.headers["Content-Type"] = "multipart/form-data";
|
|
130
|
-
config.responseType = "blob";
|
|
131
|
-
return config;
|
|
132
|
-
});
|
|
133
|
-
const getTaskProgress = iotProgress.get(`progress`);
|
|
134
|
-
const useFile = () => {
|
|
135
|
-
let showProgressDialog = ref(false);
|
|
136
|
-
let progressTitle = ref("");
|
|
137
|
-
let percent = ref(0);
|
|
138
|
-
let progressStatus = ref("normal");
|
|
139
|
-
let progressLoading = ref(false);
|
|
140
|
-
let progressTimer;
|
|
141
|
-
let progressResult = ref("");
|
|
142
|
-
let errorFileName = ref("");
|
|
143
|
-
let errorFileSize = ref("");
|
|
144
|
-
let errorMessage = ref("");
|
|
145
|
-
let errorImport = ref(false);
|
|
146
|
-
let errorFilePath = ref("");
|
|
147
|
-
let tempErrPathName = "";
|
|
148
|
-
let fileInfo;
|
|
149
|
-
const resetStataus = () => {
|
|
150
|
-
errorFileName.value = "";
|
|
151
|
-
errorFileSize.value = "";
|
|
152
|
-
errorMessage.value = "";
|
|
153
|
-
errorImport.value = false;
|
|
154
|
-
errorFilePath.value = "";
|
|
155
|
-
};
|
|
156
|
-
const getMinioConfig = async () => {
|
|
157
|
-
const [error, data] = await getMinioToken().run();
|
|
158
|
-
if (error) {
|
|
159
|
-
return { stauts: false };
|
|
160
|
-
}
|
|
161
|
-
return { status: true, data };
|
|
162
|
-
};
|
|
163
|
-
const readFileAndAddToMap = (file) => {
|
|
164
|
-
return new Promise((resolve, reject) => {
|
|
165
|
-
const chunkSize = 1024 * 1024;
|
|
166
|
-
const chunks = [];
|
|
167
|
-
let offset = 0;
|
|
168
|
-
while (offset < file.size) {
|
|
169
|
-
const chunk = file.slice(offset, offset + chunkSize);
|
|
170
|
-
chunks.push(chunk);
|
|
171
|
-
offset += chunkSize;
|
|
38
|
+
var oe = { exports: {} };
|
|
39
|
+
(function(p, d) {
|
|
40
|
+
(function(v, l) {
|
|
41
|
+
p.exports = l();
|
|
42
|
+
})(ve, function() {
|
|
43
|
+
var v = 1e3, l = 6e4, T = 36e5, w = "millisecond", j = "second", S = "minute", L = "hour", b = "day", P = "week", D = "month", W = "quarter", x = "year", H = "date", V = "Invalid Date", Z = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, ee = /\[([^\]]+)]|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, te = { 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) {
|
|
44
|
+
var t = ["th", "st", "nd", "rd"], e = s % 100;
|
|
45
|
+
return "[" + s + (t[(e - 20) % 10] || t[e] || t[0]) + "]";
|
|
46
|
+
} }, K = function(s, t, e) {
|
|
47
|
+
var r = String(s);
|
|
48
|
+
return !r || r.length >= t ? s : "" + Array(t + 1 - r.length).join(e) + s;
|
|
49
|
+
}, z = { s: K, z: function(s) {
|
|
50
|
+
var t = -s.utcOffset(), e = Math.abs(t), r = Math.floor(e / 60), n = e % 60;
|
|
51
|
+
return (t <= 0 ? "+" : "-") + K(r, 2, "0") + ":" + K(n, 2, "0");
|
|
52
|
+
}, m: function s(t, e) {
|
|
53
|
+
if (t.date() < e.date())
|
|
54
|
+
return -s(e, t);
|
|
55
|
+
var r = 12 * (e.year() - t.year()) + (e.month() - t.month()), n = t.clone().add(r, D), a = e - n < 0, i = t.clone().add(r + (a ? -1 : 1), D);
|
|
56
|
+
return +(-(r + (e - n) / (a ? n - i : i - n)) || 0);
|
|
57
|
+
}, a: function(s) {
|
|
58
|
+
return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
|
|
59
|
+
}, p: function(s) {
|
|
60
|
+
return { M: D, y: x, w: P, d: b, D: H, h: L, m: S, s: j, ms: w, Q: W }[s] || String(s || "").toLowerCase().replace(/s$/, "");
|
|
61
|
+
}, u: function(s) {
|
|
62
|
+
return s === void 0;
|
|
63
|
+
} }, Y = "en", _ = {};
|
|
64
|
+
_[Y] = te;
|
|
65
|
+
var q = "$isDayjsObject", F = function(s) {
|
|
66
|
+
return s instanceof $ || !(!s || !s[q]);
|
|
67
|
+
}, f = function s(t, e, r) {
|
|
68
|
+
var n;
|
|
69
|
+
if (!t)
|
|
70
|
+
return Y;
|
|
71
|
+
if (typeof t == "string") {
|
|
72
|
+
var a = t.toLowerCase();
|
|
73
|
+
_[a] && (n = a), e && (_[a] = e, n = a);
|
|
74
|
+
var i = t.split("-");
|
|
75
|
+
if (!n && i.length > 1)
|
|
76
|
+
return s(i[0]);
|
|
77
|
+
} else {
|
|
78
|
+
var m = t.name;
|
|
79
|
+
_[m] = t, n = m;
|
|
172
80
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
81
|
+
return !r && n && (Y = n), n || !r && Y;
|
|
82
|
+
}, c = function(s, t) {
|
|
83
|
+
if (F(s))
|
|
84
|
+
return s.clone();
|
|
85
|
+
var e = typeof t == "object" ? t : {};
|
|
86
|
+
return e.date = s, e.args = arguments, new $(e);
|
|
87
|
+
}, u = z;
|
|
88
|
+
u.l = f, u.i = F, u.w = function(s, t) {
|
|
89
|
+
return c(s, { locale: t.$L, utc: t.$u, x: t.$x, $offset: t.$offset });
|
|
90
|
+
};
|
|
91
|
+
var $ = function() {
|
|
92
|
+
function s(e) {
|
|
93
|
+
this.$L = f(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[q] = !0;
|
|
94
|
+
}
|
|
95
|
+
var t = s.prototype;
|
|
96
|
+
return t.parse = function(e) {
|
|
97
|
+
this.$d = function(r) {
|
|
98
|
+
var n = r.date, a = r.utc;
|
|
99
|
+
if (n === null)
|
|
100
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
101
|
+
if (u.u(n))
|
|
102
|
+
return /* @__PURE__ */ new Date();
|
|
103
|
+
if (n instanceof Date)
|
|
104
|
+
return new Date(n);
|
|
105
|
+
if (typeof n == "string" && !/Z$/i.test(n)) {
|
|
106
|
+
var i = n.match(Z);
|
|
107
|
+
if (i) {
|
|
108
|
+
var m = i[2] - 1 || 0, h = (i[7] || "0").substring(0, 3);
|
|
109
|
+
return a ? new Date(Date.UTC(i[1], m, i[3] || 1, i[4] || 0, i[5] || 0, i[6] || 0, h)) : new Date(i[1], m, i[3] || 1, i[4] || 0, i[5] || 0, i[6] || 0, h);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return new Date(n);
|
|
113
|
+
}(e), this.init();
|
|
114
|
+
}, t.init = function() {
|
|
115
|
+
var e = this.$d;
|
|
116
|
+
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();
|
|
117
|
+
}, t.$utils = function() {
|
|
118
|
+
return u;
|
|
119
|
+
}, t.isValid = function() {
|
|
120
|
+
return this.$d.toString() !== V;
|
|
121
|
+
}, t.isSame = function(e, r) {
|
|
122
|
+
var n = c(e);
|
|
123
|
+
return this.startOf(r) <= n && n <= this.endOf(r);
|
|
124
|
+
}, t.isAfter = function(e, r) {
|
|
125
|
+
return c(e) < this.startOf(r);
|
|
126
|
+
}, t.isBefore = function(e, r) {
|
|
127
|
+
return this.endOf(r) < c(e);
|
|
128
|
+
}, t.$g = function(e, r, n) {
|
|
129
|
+
return u.u(e) ? this[r] : this.set(n, e);
|
|
130
|
+
}, t.unix = function() {
|
|
131
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
132
|
+
}, t.valueOf = function() {
|
|
133
|
+
return this.$d.getTime();
|
|
134
|
+
}, t.startOf = function(e, r) {
|
|
135
|
+
var n = this, a = !!u.u(r) || r, i = u.p(e), m = function(N, k) {
|
|
136
|
+
var I = u.w(n.$u ? Date.UTC(n.$y, k, N) : new Date(n.$y, k, N), n);
|
|
137
|
+
return a ? I : I.endOf(b);
|
|
138
|
+
}, h = function(N, k) {
|
|
139
|
+
return u.w(n.toDate()[N].apply(n.toDate("s"), (a ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(k)), n);
|
|
140
|
+
}, g = this.$W, y = this.$M, M = this.$D, R = "set" + (this.$u ? "UTC" : "");
|
|
141
|
+
switch (i) {
|
|
142
|
+
case x:
|
|
143
|
+
return a ? m(1, 0) : m(31, 11);
|
|
144
|
+
case D:
|
|
145
|
+
return a ? m(1, y) : m(0, y + 1);
|
|
146
|
+
case P:
|
|
147
|
+
var O = this.$locale().weekStart || 0, B = (g < O ? g + 7 : g) - O;
|
|
148
|
+
return m(a ? M - B : M + (6 - B), y);
|
|
149
|
+
case b:
|
|
150
|
+
case H:
|
|
151
|
+
return h(R + "Hours", 0);
|
|
152
|
+
case L:
|
|
153
|
+
return h(R + "Minutes", 1);
|
|
154
|
+
case S:
|
|
155
|
+
return h(R + "Seconds", 2);
|
|
156
|
+
case j:
|
|
157
|
+
return h(R + "Milliseconds", 3);
|
|
158
|
+
default:
|
|
159
|
+
return this.clone();
|
|
160
|
+
}
|
|
161
|
+
}, t.endOf = function(e) {
|
|
162
|
+
return this.startOf(e, !1);
|
|
163
|
+
}, t.$set = function(e, r) {
|
|
164
|
+
var n, a = u.p(e), i = "set" + (this.$u ? "UTC" : ""), m = (n = {}, n[b] = i + "Date", n[H] = i + "Date", n[D] = i + "Month", n[x] = i + "FullYear", n[L] = i + "Hours", n[S] = i + "Minutes", n[j] = i + "Seconds", n[w] = i + "Milliseconds", n)[a], h = a === b ? this.$D + (r - this.$W) : r;
|
|
165
|
+
if (a === D || a === x) {
|
|
166
|
+
var g = this.clone().set(H, 1);
|
|
167
|
+
g.$d[m](h), g.init(), this.$d = g.set(H, Math.min(this.$D, g.daysInMonth())).$d;
|
|
168
|
+
} else
|
|
169
|
+
m && this.$d[m](h);
|
|
170
|
+
return this.init(), this;
|
|
171
|
+
}, t.set = function(e, r) {
|
|
172
|
+
return this.clone().$set(e, r);
|
|
173
|
+
}, t.get = function(e) {
|
|
174
|
+
return this[u.p(e)]();
|
|
175
|
+
}, t.add = function(e, r) {
|
|
176
|
+
var n, a = this;
|
|
177
|
+
e = Number(e);
|
|
178
|
+
var i = u.p(r), m = function(y) {
|
|
179
|
+
var M = c(a);
|
|
180
|
+
return u.w(M.date(M.date() + Math.round(y * e)), a);
|
|
181
|
+
};
|
|
182
|
+
if (i === D)
|
|
183
|
+
return this.set(D, this.$M + e);
|
|
184
|
+
if (i === x)
|
|
185
|
+
return this.set(x, this.$y + e);
|
|
186
|
+
if (i === b)
|
|
187
|
+
return m(1);
|
|
188
|
+
if (i === P)
|
|
189
|
+
return m(7);
|
|
190
|
+
var h = (n = {}, n[S] = l, n[L] = T, n[j] = v, n)[i] || 1, g = this.$d.getTime() + e * h;
|
|
191
|
+
return u.w(g, this);
|
|
192
|
+
}, t.subtract = function(e, r) {
|
|
193
|
+
return this.add(-1 * e, r);
|
|
194
|
+
}, t.format = function(e) {
|
|
195
|
+
var r = this, n = this.$locale();
|
|
196
|
+
if (!this.isValid())
|
|
197
|
+
return n.invalidDate || V;
|
|
198
|
+
var a = e || "YYYY-MM-DDTHH:mm:ssZ", i = u.z(this), m = this.$H, h = this.$m, g = this.$M, y = n.weekdays, M = n.months, R = n.meridiem, O = function(k, I, J, G) {
|
|
199
|
+
return k && (k[I] || k(r, a)) || J[I].slice(0, G);
|
|
200
|
+
}, B = function(k) {
|
|
201
|
+
return u.s(m % 12 || 12, k, "0");
|
|
202
|
+
}, N = R || function(k, I, J) {
|
|
203
|
+
var G = k < 12 ? "AM" : "PM";
|
|
204
|
+
return J ? G.toLowerCase() : G;
|
|
205
|
+
};
|
|
206
|
+
return a.replace(ee, function(k, I) {
|
|
207
|
+
return I || function(J) {
|
|
208
|
+
switch (J) {
|
|
209
|
+
case "YY":
|
|
210
|
+
return String(r.$y).slice(-2);
|
|
211
|
+
case "YYYY":
|
|
212
|
+
return u.s(r.$y, 4, "0");
|
|
213
|
+
case "M":
|
|
214
|
+
return g + 1;
|
|
215
|
+
case "MM":
|
|
216
|
+
return u.s(g + 1, 2, "0");
|
|
217
|
+
case "MMM":
|
|
218
|
+
return O(n.monthsShort, g, M, 3);
|
|
219
|
+
case "MMMM":
|
|
220
|
+
return O(M, g);
|
|
221
|
+
case "D":
|
|
222
|
+
return r.$D;
|
|
223
|
+
case "DD":
|
|
224
|
+
return u.s(r.$D, 2, "0");
|
|
225
|
+
case "d":
|
|
226
|
+
return String(r.$W);
|
|
227
|
+
case "dd":
|
|
228
|
+
return O(n.weekdaysMin, r.$W, y, 2);
|
|
229
|
+
case "ddd":
|
|
230
|
+
return O(n.weekdaysShort, r.$W, y, 3);
|
|
231
|
+
case "dddd":
|
|
232
|
+
return y[r.$W];
|
|
233
|
+
case "H":
|
|
234
|
+
return String(m);
|
|
235
|
+
case "HH":
|
|
236
|
+
return u.s(m, 2, "0");
|
|
237
|
+
case "h":
|
|
238
|
+
return B(1);
|
|
239
|
+
case "hh":
|
|
240
|
+
return B(2);
|
|
241
|
+
case "a":
|
|
242
|
+
return N(m, h, !0);
|
|
243
|
+
case "A":
|
|
244
|
+
return N(m, h, !1);
|
|
245
|
+
case "m":
|
|
246
|
+
return String(h);
|
|
247
|
+
case "mm":
|
|
248
|
+
return u.s(h, 2, "0");
|
|
249
|
+
case "s":
|
|
250
|
+
return String(r.$s);
|
|
251
|
+
case "ss":
|
|
252
|
+
return u.s(r.$s, 2, "0");
|
|
253
|
+
case "SSS":
|
|
254
|
+
return u.s(r.$ms, 3, "0");
|
|
255
|
+
case "Z":
|
|
256
|
+
return i;
|
|
257
|
+
}
|
|
258
|
+
return null;
|
|
259
|
+
}(k) || i.replace(":", "");
|
|
260
|
+
});
|
|
261
|
+
}, t.utcOffset = function() {
|
|
262
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
263
|
+
}, t.diff = function(e, r, n) {
|
|
264
|
+
var a, i = this, m = u.p(r), h = c(e), g = (h.utcOffset() - this.utcOffset()) * l, y = this - h, M = function() {
|
|
265
|
+
return u.m(i, h);
|
|
266
|
+
};
|
|
267
|
+
switch (m) {
|
|
268
|
+
case x:
|
|
269
|
+
a = M() / 12;
|
|
270
|
+
break;
|
|
271
|
+
case D:
|
|
272
|
+
a = M();
|
|
273
|
+
break;
|
|
274
|
+
case W:
|
|
275
|
+
a = M() / 3;
|
|
276
|
+
break;
|
|
277
|
+
case P:
|
|
278
|
+
a = (y - g) / 6048e5;
|
|
279
|
+
break;
|
|
280
|
+
case b:
|
|
281
|
+
a = (y - g) / 864e5;
|
|
282
|
+
break;
|
|
283
|
+
case L:
|
|
284
|
+
a = y / T;
|
|
285
|
+
break;
|
|
286
|
+
case S:
|
|
287
|
+
a = y / l;
|
|
288
|
+
break;
|
|
289
|
+
case j:
|
|
290
|
+
a = y / v;
|
|
291
|
+
break;
|
|
292
|
+
default:
|
|
293
|
+
a = y;
|
|
294
|
+
}
|
|
295
|
+
return n ? a : u.a(a);
|
|
296
|
+
}, t.daysInMonth = function() {
|
|
297
|
+
return this.endOf(D).$D;
|
|
298
|
+
}, t.$locale = function() {
|
|
299
|
+
return _[this.$L];
|
|
300
|
+
}, t.locale = function(e, r) {
|
|
301
|
+
if (!e)
|
|
302
|
+
return this.$L;
|
|
303
|
+
var n = this.clone(), a = f(e, r, !0);
|
|
304
|
+
return a && (n.$L = a), n;
|
|
305
|
+
}, t.clone = function() {
|
|
306
|
+
return u.w(this.$d, this);
|
|
307
|
+
}, t.toDate = function() {
|
|
308
|
+
return new Date(this.valueOf());
|
|
309
|
+
}, t.toJSON = function() {
|
|
310
|
+
return this.isValid() ? this.toISOString() : null;
|
|
311
|
+
}, t.toISOString = function() {
|
|
312
|
+
return this.$d.toISOString();
|
|
313
|
+
}, t.toString = function() {
|
|
314
|
+
return this.$d.toUTCString();
|
|
315
|
+
}, s;
|
|
316
|
+
}(), A = $.prototype;
|
|
317
|
+
return c.prototype = A, [["$ms", w], ["$s", j], ["$m", S], ["$H", L], ["$W", b], ["$M", D], ["$y", x], ["$D", H]].forEach(function(s) {
|
|
318
|
+
A[s[1]] = function(t) {
|
|
319
|
+
return this.$g(t, s[0], s[1]);
|
|
320
|
+
};
|
|
321
|
+
}), c.extend = function(s, t) {
|
|
322
|
+
return s.$i || (s(t, $, c), s.$i = !0), c;
|
|
323
|
+
}, c.locale = f, c.isDayjs = F, c.unix = function(s) {
|
|
324
|
+
return c(1e3 * s);
|
|
325
|
+
}, c.en = _[Y], c.Ls = _, c.p = {}, c;
|
|
326
|
+
});
|
|
327
|
+
})(oe);
|
|
328
|
+
var ge = oe.exports;
|
|
329
|
+
const ye = /* @__PURE__ */ $e(ge), ae = () => {
|
|
330
|
+
let d = { ...(window == null ? void 0 : window.config) || {} };
|
|
331
|
+
d.rootContainer || (d.rootContainer = "#app"), d.baseURL || (d.baseURL = location.origin), d.ossBaseURL || (d.ossBaseURL = "/oss"), d.ossBaseURL.startsWith("/") && (d.ossBaseURL = `${d.baseURL}/oss`), d.ssoBaseURL || (d.ssoBaseURL = d.baseURL);
|
|
332
|
+
let { microAppName: v, publicPath: l, mainAppName: T } = d;
|
|
333
|
+
return v && !0 && !l && (l = `/${v}/`.replace(/\/\//g, "/")), l || (l = "/"), d.publicPath = l, d.autoOssBucket || (d.autoOssBucket = T || v), d;
|
|
334
|
+
}, we = ne.get("token"), be = ne.post("putObject", (p) => (p.headers || (p.headers = {}), p.headers["Content-Type"] = "multipart/form-data", p.responseType = "blob", p)), Me = ne.post("upload-objects", (p) => (p.headers || (p.headers = {}), p.headers["Content-Type"] = "multipart/form-data", p.responseType = "blob", p)), Se = me.get("progress"), qe = () => {
|
|
335
|
+
let p = U(!1), d = U(""), v = U(0), l = U("normal"), T = U(!1), w, j = U(""), S = U(""), L = U(""), b = U(""), P = U(!1), D = U(""), W = "", x;
|
|
336
|
+
const H = () => {
|
|
337
|
+
S.value = "", L.value = "", b.value = "", P.value = !1, D.value = "";
|
|
338
|
+
}, V = async () => {
|
|
339
|
+
const [f, c] = await we().run();
|
|
340
|
+
return f ? { stauts: !1 } : { status: !0, data: c };
|
|
341
|
+
}, Z = (f) => new Promise((c, u) => {
|
|
342
|
+
const A = [];
|
|
343
|
+
let s = 0;
|
|
344
|
+
for (; s < f.size; ) {
|
|
345
|
+
const e = f.slice(s, s + 1048576);
|
|
346
|
+
A.push(e), s += 1048576;
|
|
185
347
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
348
|
+
const t = new Blob(A, { type: f.type });
|
|
349
|
+
c(t);
|
|
350
|
+
}), ee = async (f, c, u, $ = !0, A = "", s = !1) => {
|
|
351
|
+
W = A, $ && (l.value = "normal", v.value = 0, d.value = "导入进度", p.value = !0, j.value = ""), x = c;
|
|
352
|
+
const t = await V();
|
|
353
|
+
if (!t.status)
|
|
189
354
|
return;
|
|
190
|
-
let
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
})
|
|
200
|
-
|
|
201
|
-
params.append("accessKeyId", minioConfig.accessKeyId);
|
|
202
|
-
params.append("secretAccessKey", minioConfig.secretAccessKey);
|
|
203
|
-
params.append("sessionToken", minioConfig.sessionToken);
|
|
204
|
-
params.append("bucketName", bucketName);
|
|
205
|
-
file.forEach((v, i) => {
|
|
206
|
-
params.append("file", blobList[i]);
|
|
207
|
-
});
|
|
208
|
-
importFileName.forEach((v) => {
|
|
209
|
-
params.append("filePaths", v);
|
|
355
|
+
let e = t.data, r = null, { autoContentType: n, bucketName: a, importFileName: i } = u;
|
|
356
|
+
const m = s ? Me : be;
|
|
357
|
+
if (s) {
|
|
358
|
+
let R = [];
|
|
359
|
+
await c.forEach(async (O) => {
|
|
360
|
+
let B = await Z(O);
|
|
361
|
+
R.push(B);
|
|
362
|
+
}), r = new FormData(), r.append("accessKeyId", e.accessKeyId), r.append("secretAccessKey", e.secretAccessKey), r.append("sessionToken", e.sessionToken), r.append("bucketName", a), c.forEach((O, B) => {
|
|
363
|
+
r.append("file", R[B]);
|
|
364
|
+
}), i.forEach((O) => {
|
|
365
|
+
r.append("filePaths", O);
|
|
210
366
|
});
|
|
211
367
|
} else {
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
accessKeyId:
|
|
215
|
-
secretAccessKey:
|
|
216
|
-
sessionToken:
|
|
217
|
-
file:
|
|
218
|
-
bucketName,
|
|
219
|
-
filePath:
|
|
220
|
-
autoContentType
|
|
368
|
+
const R = await Z(c);
|
|
369
|
+
r = {
|
|
370
|
+
accessKeyId: e.accessKeyId,
|
|
371
|
+
secretAccessKey: e.secretAccessKey,
|
|
372
|
+
sessionToken: e.sessionToken,
|
|
373
|
+
file: R,
|
|
374
|
+
bucketName: a,
|
|
375
|
+
filePath: i,
|
|
376
|
+
autoContentType: n
|
|
221
377
|
};
|
|
222
378
|
}
|
|
223
|
-
const [
|
|
224
|
-
if (
|
|
379
|
+
const [h, g] = await m(r).run();
|
|
380
|
+
if (h)
|
|
225
381
|
return;
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
showProgressDialog.value = false;
|
|
231
|
-
progressStatus.value = "error";
|
|
382
|
+
const y = await je(g.data), M = await (f == null ? void 0 : f(y));
|
|
383
|
+
if ($) {
|
|
384
|
+
if (!M.status) {
|
|
385
|
+
p.value = !1, l.value = "error";
|
|
232
386
|
return;
|
|
233
387
|
}
|
|
234
|
-
|
|
235
|
-
showProgressDialog.value = true;
|
|
236
|
-
checkProgress(importResult.taskId, "import", "");
|
|
388
|
+
d.value = "导入进度", p.value = !0, z(M.taskId, "import", "");
|
|
237
389
|
} else {
|
|
238
|
-
if (!
|
|
390
|
+
if (!M.status)
|
|
239
391
|
return;
|
|
240
|
-
|
|
392
|
+
l.value = "success";
|
|
241
393
|
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
showProgressDialog.value = true;
|
|
248
|
-
const importResult = await exportFunc?.();
|
|
249
|
-
if (!importResult.status) {
|
|
250
|
-
showProgressDialog.value = false;
|
|
251
|
-
progressStatus.value = "error";
|
|
394
|
+
}, te = async (f, c = "", u = "") => {
|
|
395
|
+
l.value = "normal", v.value = 0, d.value = u || "导出进度", p.value = !0;
|
|
396
|
+
const $ = await (f == null ? void 0 : f());
|
|
397
|
+
if (!$.status) {
|
|
398
|
+
p.value = !1, l.value = "error";
|
|
252
399
|
return;
|
|
253
400
|
}
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
showProgressDialog.value = true;
|
|
261
|
-
const importResult = await exportFunc?.();
|
|
262
|
-
if (!importResult.status) {
|
|
263
|
-
showProgressDialog.value = false;
|
|
264
|
-
progressStatus.value = "error";
|
|
401
|
+
z($.taskId, "action", "");
|
|
402
|
+
}, K = async (f, c = "", u = "") => {
|
|
403
|
+
l.value = "normal", v.value = 0, d.value = "导出进度", p.value = !0;
|
|
404
|
+
const $ = await (f == null ? void 0 : f());
|
|
405
|
+
if (!$.status) {
|
|
406
|
+
p.value = !1, l.value = "error";
|
|
265
407
|
return;
|
|
266
408
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
const checkProgress = async (taskId, type, fileName, fileSuffix = "") => {
|
|
271
|
-
progressLoading.value = true;
|
|
272
|
-
getProgress(taskId, type, fileName, fileSuffix);
|
|
273
|
-
progressTimer = setTimeout(() => {
|
|
409
|
+
ye().format("YYYYMMDDHHmmss") + "", z($.taskId, "export", c || "", u);
|
|
410
|
+
}, z = async (f, c, u, $ = "") => {
|
|
411
|
+
T.value = !0, _(f, c, u, $), w = setTimeout(() => {
|
|
274
412
|
}, 50);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const getProgress = async (taskId, type = "export", fileName, fileSuffix = "") => {
|
|
282
|
-
const [error, data] = await getTaskProgress("", {
|
|
283
|
-
url: `progress/${taskId}`
|
|
413
|
+
}, Y = () => {
|
|
414
|
+
clearTimeout(w), w = null, p.value = !1;
|
|
415
|
+
}, _ = async (f, c = "export", u, $ = "") => {
|
|
416
|
+
var e, r;
|
|
417
|
+
const [A, s] = await Se("", {
|
|
418
|
+
url: `progress/${f}`
|
|
284
419
|
}).run();
|
|
285
|
-
if (
|
|
286
|
-
|
|
420
|
+
if (A) {
|
|
421
|
+
T.value = !1;
|
|
287
422
|
return;
|
|
288
423
|
}
|
|
289
|
-
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
errorMessage.value = data.message || `${tip}\u5931\u8D25`;
|
|
302
|
-
}
|
|
303
|
-
} else if (type == "import") {
|
|
304
|
-
if (!!data.filePath) {
|
|
305
|
-
progressStatus.value = "error";
|
|
306
|
-
const matchName = fileInfo.name?.match(/(.*?)(\.[^.]*$|$)/);
|
|
307
|
-
const suffix = matchName.length ? matchName[2] : "";
|
|
308
|
-
errorImport.value = true;
|
|
309
|
-
const pathName = data.filePath?.replace(/(.*\/)*([^.]+).*/gi, "$2");
|
|
310
|
-
errorFileName.value = tempErrPathName ? tempErrPathName : `${pathName}${suffix}`;
|
|
311
|
-
errorFileSize.value = fileInfo.sizeText;
|
|
312
|
-
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";
|
|
313
|
-
errorFilePath.value = `${getConfig().baseURL}/oss${data.filePath}`;
|
|
424
|
+
v.value = s.percentage;
|
|
425
|
+
const t = c == "export" ? "导出" : "导入";
|
|
426
|
+
if (v.value == 100)
|
|
427
|
+
if (j.value = s, T.value = !1, Y(), c == "export")
|
|
428
|
+
s.status == 1 ? (l.value = "success", ie(`${ae().baseURL}/oss${s.filePath}`, u, $), T.value = !1) : s.status == 2 && (b.value = s.message || `${t}失败`);
|
|
429
|
+
else if (c == "import") {
|
|
430
|
+
if (s.filePath) {
|
|
431
|
+
l.value = "error";
|
|
432
|
+
const n = (e = x.name) == null ? void 0 : e.match(/(.*?)(\.[^.]*$|$)/), a = n.length ? n[2] : "";
|
|
433
|
+
P.value = !0;
|
|
434
|
+
const i = (r = s.filePath) == null ? void 0 : r.replace(/(.*\/)*([^.]+).*/gi, "$2");
|
|
435
|
+
S.value = W || `${i}${a}`, L.value = x.sizeText, b.value = "部分数据校验不通过,请下载附件并修改,重新导入!", D.value = `${ae().baseURL}/oss${s.filePath}`;
|
|
314
436
|
}
|
|
315
|
-
|
|
316
|
-
} else
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
} else {
|
|
325
|
-
progressResult.value = data;
|
|
326
|
-
progressLoading.value = false;
|
|
327
|
-
tipHandle(data.status, tip, data.message);
|
|
328
|
-
clearTimer();
|
|
329
|
-
errorImport.value = true;
|
|
330
|
-
errorMessage.value = data?.message || "";
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
const tipHandle = (status, tip, message) => {
|
|
335
|
-
if (status == 1) {
|
|
336
|
-
progressStatus.value = "success";
|
|
337
|
-
errorFileName.value = "";
|
|
338
|
-
errorFileSize.value = "";
|
|
339
|
-
errorMessage.value = "";
|
|
340
|
-
} else if (status == 2) {
|
|
341
|
-
progressStatus.value = "error";
|
|
342
|
-
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";
|
|
343
|
-
} else if (status == 3) {
|
|
344
|
-
progressStatus.value = "error";
|
|
345
|
-
}
|
|
346
|
-
};
|
|
347
|
-
const generateUniqueName = (fileName) => {
|
|
348
|
-
const matchName = fileName?.match(/(.*?)(\.[^.]*$|$)/);
|
|
349
|
-
const suffix = matchName.length ? matchName[2] : "";
|
|
350
|
-
const name = matchName.length ? matchName[1] : fileName;
|
|
351
|
-
return `${name}${nanoid()}${suffix}`;
|
|
437
|
+
q(s.status, t, s.message);
|
|
438
|
+
} else
|
|
439
|
+
c == "action" && (l.value = "success");
|
|
440
|
+
else
|
|
441
|
+
w && s.status != 2 ? w = setTimeout(() => {
|
|
442
|
+
_(f, c, u, $);
|
|
443
|
+
}, 50) : (j.value = s, T.value = !1, q(s.status, t, s.message), Y(), P.value = !0, b.value = (s == null ? void 0 : s.message) || "");
|
|
444
|
+
}, q = (f, c, u) => {
|
|
445
|
+
f == 1 ? (l.value = "success", S.value = "", L.value = "", b.value = "") : f == 2 ? (l.value = "error", b.value = u || "部分数据校验不通过,请下载附件并修改,重新导入!") : f == 3 && (l.value = "error");
|
|
352
446
|
};
|
|
353
447
|
return {
|
|
354
|
-
showProgressDialog,
|
|
355
|
-
progressTitle,
|
|
356
|
-
percent,
|
|
357
|
-
progressStatus,
|
|
358
|
-
progressLoading,
|
|
359
|
-
progressResult,
|
|
360
|
-
errorFileName,
|
|
361
|
-
errorFileSize,
|
|
362
|
-
errorMessage,
|
|
363
|
-
errorImport,
|
|
364
|
-
errorFilePath,
|
|
365
|
-
fileImport,
|
|
366
|
-
fileExport,
|
|
367
|
-
fileAction,
|
|
368
|
-
generateUniqueName
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
448
|
+
showProgressDialog: p,
|
|
449
|
+
progressTitle: d,
|
|
450
|
+
percent: v,
|
|
451
|
+
progressStatus: l,
|
|
452
|
+
progressLoading: T,
|
|
453
|
+
progressResult: j,
|
|
454
|
+
errorFileName: S,
|
|
455
|
+
errorFileSize: L,
|
|
456
|
+
errorMessage: b,
|
|
457
|
+
errorImport: P,
|
|
458
|
+
errorFilePath: D,
|
|
459
|
+
fileImport: ee,
|
|
460
|
+
fileExport: K,
|
|
461
|
+
fileAction: te,
|
|
462
|
+
generateUniqueName: (f) => {
|
|
463
|
+
const c = f == null ? void 0 : f.match(/(.*?)(\.[^.]*$|$)/), u = c.length ? c[2] : "";
|
|
464
|
+
return `${c.length ? c[1] : f}${he()}${u}`;
|
|
465
|
+
},
|
|
466
|
+
downloadFile: ie,
|
|
467
|
+
resetStataus: H,
|
|
468
|
+
checkProgress: z
|
|
372
469
|
};
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
let typeList = {
|
|
470
|
+
}, De = (p) => {
|
|
471
|
+
let d = p == null ? void 0 : p.toLocaleLowerCase();
|
|
472
|
+
return {
|
|
377
473
|
excel: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
378
474
|
pdf: "application/pdf",
|
|
379
475
|
doc: "application/msword",
|
|
@@ -399,96 +495,66 @@ const fileBobType = (type) => {
|
|
|
399
495
|
crt: "application/x-x509-ca-cert",
|
|
400
496
|
der: "application/x-x509-ca-cert",
|
|
401
497
|
cer: "application/pkix-cert"
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
const objectUrl = URL.createObjectURL(blob);
|
|
415
|
-
if (window.navigator.msSaveOrOpenBlob) {
|
|
416
|
-
navigator.msSaveBlob(blob, filename);
|
|
417
|
-
} else {
|
|
418
|
-
const element = document.createElement("a");
|
|
419
|
-
element.href = objectUrl;
|
|
420
|
-
element.download = filename;
|
|
421
|
-
element.click();
|
|
422
|
-
window.URL.revokeObjectURL(objectUrl);
|
|
498
|
+
}[d];
|
|
499
|
+
}, ie = (p, d, v = "excel") => {
|
|
500
|
+
const l = new XMLHttpRequest();
|
|
501
|
+
l.open("get", p), l.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), l.responseType = "blob", l.onload = function(T) {
|
|
502
|
+
const w = new Blob([this.response], {
|
|
503
|
+
type: De(v)
|
|
504
|
+
}), j = URL.createObjectURL(w);
|
|
505
|
+
if (window.navigator.msSaveOrOpenBlob)
|
|
506
|
+
navigator.msSaveBlob(w, d);
|
|
507
|
+
else {
|
|
508
|
+
const S = document.createElement("a");
|
|
509
|
+
S.href = j, S.download = d, S.click(), window.URL.revokeObjectURL(j);
|
|
423
510
|
}
|
|
424
|
-
};
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
511
|
+
}, l.send();
|
|
512
|
+
}, je = (p) => new Promise((d, v) => {
|
|
513
|
+
var l = new FileReader();
|
|
514
|
+
l.onload = function(T) {
|
|
515
|
+
let w = "";
|
|
516
|
+
typeof l.result == "string" && (w = JSON.parse(l.result)), d(w);
|
|
517
|
+
}, l.readAsText(p);
|
|
518
|
+
}), ke = "v2", Je = o(`/api/edge/${ke}`), ce = "v1", Ve = o(`/api/justauth/oauth-server/${ce}/visitor`), Ze = o(`/api/justauth/oauth-server/${ce}`), Te = "v1", Fe = o(`/api/knowledge-base/knowledge/${Te}`), xe = "v1", Ge = o(`/api/custom-datasource/custom/${xe}`), Oe = "v1", Qe = o(`/api/permission/${Oe}`), E = "v1", Xe = o(`/api/customer/customer/${E}`), et = o(`/api/customer/company/${E}`), tt = o(`/api/customer/customer-grade/${E}`), st = o(`/api/customer/customer-type/${E}`), nt = {
|
|
519
|
+
list: o(`/api/project/${E}/list`),
|
|
520
|
+
app: o(`/api/project/${E}/app`),
|
|
521
|
+
people: o(`/api/project/${E}/people`)
|
|
522
|
+
}, Le = "v1", rt = o(`/api/portal/user/${Le}`), Re = "v1", at = o(`/api/space-manage/space-tree/${Re}`), X = "v1", it = o(`/api/superadmin/portal/${X}`), ot = o(`/api/superadmin/permission/${X}`), ct = o(`/api/superadmin/resource/${X}`), ut = o(`/api/superadmin/license/${X}`), re = "v1", lt = o(`/api/supply/supplier/${re}`), pt = o(`/api/supplier/${re}`), dt = o(`/api/supplier/${re}/classification`), Ue = "v1", ft = o(`/api/supply/brand/${Ue}`), _e = "v2", mt = o(`/api/tool/${_e}`), Ce = "v1", ht = o(`/api/system-config/${Ce}`);
|
|
523
|
+
export {
|
|
524
|
+
Be as appManage,
|
|
525
|
+
He as authentication,
|
|
526
|
+
Ye as bemsModules,
|
|
527
|
+
et as company,
|
|
528
|
+
Ie as contract,
|
|
529
|
+
Xe as customer,
|
|
530
|
+
tt as customerGrade,
|
|
531
|
+
st as customerType,
|
|
532
|
+
Ge as daslink,
|
|
533
|
+
ie as downloadFile,
|
|
534
|
+
Ne as dutyModules,
|
|
535
|
+
ft as enterpriseadminBrandModel,
|
|
536
|
+
Ee as enterpriseright,
|
|
537
|
+
Je as gatewayEdge,
|
|
538
|
+
We as iot,
|
|
539
|
+
ne as iotMinio,
|
|
540
|
+
ze as iotModules,
|
|
541
|
+
me as iotProgress,
|
|
542
|
+
Ke as iotRelationModules,
|
|
543
|
+
Ve as justauth,
|
|
544
|
+
Fe as knowledgeBase,
|
|
545
|
+
Ze as oauthServer,
|
|
546
|
+
Qe as permission,
|
|
547
|
+
rt as portal,
|
|
548
|
+
nt as projectManage,
|
|
549
|
+
at as spaceManage,
|
|
550
|
+
ut as superadminLicense,
|
|
551
|
+
ot as superadminPermission,
|
|
552
|
+
it as superadminPortal,
|
|
553
|
+
ct as superadminResource,
|
|
554
|
+
lt as supplier,
|
|
555
|
+
dt as supplierClassification,
|
|
556
|
+
pt as supplierManage,
|
|
557
|
+
ht as systemConfiguration,
|
|
558
|
+
mt as tool,
|
|
559
|
+
qe as useFile
|
|
466
560
|
};
|
|
467
|
-
|
|
468
|
-
const version$6 = "v1";
|
|
469
|
-
const portal = createService(`/api/portal/user/${version$6}`);
|
|
470
|
-
|
|
471
|
-
const version$5 = "v1";
|
|
472
|
-
const spaceManage = createService(`/api/space-manage/space-tree/${version$5}`);
|
|
473
|
-
|
|
474
|
-
const version$4 = "v1";
|
|
475
|
-
const superadminPortal = createService(`/api/superadmin/portal/${version$4}`);
|
|
476
|
-
const superadminPermission = createService(`/api/superadmin/permission/${version$4}`);
|
|
477
|
-
const superadminResource = createService(`/api/superadmin/resource/${version$4}`);
|
|
478
|
-
const superadminLicense = createService(`/api/superadmin/license/${version$4}`);
|
|
479
|
-
|
|
480
|
-
const version$3 = "v1";
|
|
481
|
-
const supplier = createService(`/api/supply/supplier/${version$3}`);
|
|
482
|
-
const supplierManage = createService(`/api/supplier/${version$3}`);
|
|
483
|
-
const supplierClassification = createService(`/api/supplier/${version$3}/classification`);
|
|
484
|
-
|
|
485
|
-
const version$2 = "v1";
|
|
486
|
-
const enterpriseadminBrandModel = createService(`/api/supply/brand/${version$2}`);
|
|
487
|
-
|
|
488
|
-
const version$1 = "v2";
|
|
489
|
-
const tool = createService(`/api/tool/${version$1}`);
|
|
490
|
-
|
|
491
|
-
const version = "v1";
|
|
492
|
-
const systemConfiguration = createService(`/api/system-config/${version}`);
|
|
493
|
-
|
|
494
|
-
export { appManage, authentication, bemsModules, company, contract, customer, customerGrade, customerType, daslink, downloadFile, dutyModules, enterpriseadminBrandModel, enterpriseright, gatewayEdge, iot, iotMinio, iotModules, iotProgress, iotRelationModules, justauth, knowledgeBase, oauthServer, permission, portal, projectManage, spaceManage, superadminLicense, superadminPermission, superadminPortal, superadminResource, supplier, supplierClassification, supplierManage, systemConfiguration, tool, useFile };
|