aoi-comp 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -49
- package/dist/{BufferResource-B9J7sakh.js → BufferResource-KIVvy5RU.js} +2 -2
- package/dist/{CanvasPool-Cj7pAl_V.js → CanvasPool-CoJ6fp2T.js} +1 -1
- package/dist/{Geometry-DZRVpJxo.js → Geometry-yirqXUbT.js} +1 -1
- package/dist/{RenderTargetSystem-DpDerUml.js → RenderTargetSystem-C5FbaxB6.js} +1 -1
- package/dist/{browserAll-Cgvv18r-.js → browserAll-BlXoOxdk.js} +3 -3
- package/dist/{canvasUtils-CQY_EQew.js → canvasUtils-ByNFM8PZ.js} +1 -1
- package/dist/comps.js +1449 -1412
- package/dist/{getTextureBatchBindGroup-C-2vhNcM.js → getTextureBatchBindGroup-DboMquwr.js} +1 -1
- package/dist/{hooks-RFqzmuuL.js → hooks-Ww44LelW.js} +1 -1
- package/dist/hooks.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{init-CQ75H2tH.js → init-5-nCmzt4.js} +3 -3
- package/dist/{init-DCk4OmUj.js → init-DPdifVJ6.js} +2 -2
- package/dist/{packages-BBu_5vmp.js → packages-DtEpsTpy.js} +127 -124
- package/dist/style.css +1 -1
- package/dist/utils.js +1 -1
- package/dist/webworkerAll-BQbmOPdT.js +2 -0
- package/package.json +1 -1
- package/dist/webworkerAll-0PJXJVS3.js +0 -2
|
@@ -3436,13 +3436,13 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3436
3436
|
Mt(r, "object") ? (e[n] || (e[n] = {}), Nt(e[n], r)) : e[n] = r;
|
|
3437
3437
|
}
|
|
3438
3438
|
return e;
|
|
3439
|
-
},
|
|
3439
|
+
}, Pt = (e, t, n) => {
|
|
3440
3440
|
for (let r of t) Reflect.defineProperty(e, r, {
|
|
3441
3441
|
value: e[r],
|
|
3442
3442
|
...n
|
|
3443
3443
|
});
|
|
3444
3444
|
return e;
|
|
3445
|
-
},
|
|
3445
|
+
}, Ft = { ui: {
|
|
3446
3446
|
tool: {
|
|
3447
3447
|
add: "添加",
|
|
3448
3448
|
cancel: "取消",
|
|
@@ -3562,7 +3562,8 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3562
3562
|
message: "消息日志",
|
|
3563
3563
|
operate: "操作日志",
|
|
3564
3564
|
dataEmpty: "数据分发结果为空: {{data}}",
|
|
3565
|
-
dataErr: "数据分发结构异常: {{data}}"
|
|
3565
|
+
dataErr: "数据分发结构异常: {{data}}",
|
|
3566
|
+
deleteHistory: "删除历史记录: id={{id}}"
|
|
3566
3567
|
},
|
|
3567
3568
|
config: {
|
|
3568
3569
|
logSaveTime: "日志保存时间",
|
|
@@ -3575,7 +3576,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3575
3576
|
dayNg: "当日NG",
|
|
3576
3577
|
clearTime: "清空时间"
|
|
3577
3578
|
}
|
|
3578
|
-
} },
|
|
3579
|
+
} }, It = { ui: {
|
|
3579
3580
|
tool: {
|
|
3580
3581
|
add: "Add",
|
|
3581
3582
|
cancel: "Cancel",
|
|
@@ -3695,7 +3696,8 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3695
3696
|
message: "Message log",
|
|
3696
3697
|
operate: "Operate log",
|
|
3697
3698
|
dataEmpty: "Data transmission result is empty: {{data}}",
|
|
3698
|
-
dataErr: "Data transmission structure is abnormal: {{data}}"
|
|
3699
|
+
dataErr: "Data transmission structure is abnormal: {{data}}",
|
|
3700
|
+
deleteHistory: "Delete history record: id={{id}}"
|
|
3699
3701
|
},
|
|
3700
3702
|
config: {
|
|
3701
3703
|
logSaveTime: "Log save time",
|
|
@@ -3708,10 +3710,10 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3708
3710
|
dayNg: "Daily NG",
|
|
3709
3711
|
clearTime: "Clear time"
|
|
3710
3712
|
}
|
|
3711
|
-
} },
|
|
3713
|
+
} }, Lt = (e, t) => {
|
|
3712
3714
|
let n = [], r = Nt(e, {
|
|
3713
|
-
zh:
|
|
3714
|
-
en:
|
|
3715
|
+
zh: Ft,
|
|
3716
|
+
en: It
|
|
3715
3717
|
}), i = Object.keys(r), a = i.reduce((e, t) => {
|
|
3716
3718
|
let i = r[t];
|
|
3717
3719
|
return e[t] = { translation: i }, i?.ui || n.push(t), e;
|
|
@@ -3721,9 +3723,9 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3721
3723
|
resources: a,
|
|
3722
3724
|
interpolation: { escapeValue: !1 }
|
|
3723
3725
|
}), n.length ? [] : i;
|
|
3724
|
-
},
|
|
3725
|
-
return n === "toString" || typeof n == "symbol" ? void 0 :
|
|
3726
|
-
} }),
|
|
3726
|
+
}, Rt = (e = "") => new Proxy((t) => H.t(e, t), { get(t, n) {
|
|
3727
|
+
return n === "toString" || typeof n == "symbol" ? void 0 : Rt(e ? `${e}.${n}` : n);
|
|
3728
|
+
} }), U = Rt("ui"), zt = class {
|
|
3727
3729
|
#e = {};
|
|
3728
3730
|
#t = new EventTarget();
|
|
3729
3731
|
emit = (e, t) => (this.#t.dispatchEvent(new CustomEvent(e, { detail: t })), this);
|
|
@@ -3746,18 +3748,18 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3746
3748
|
}
|
|
3747
3749
|
return this;
|
|
3748
3750
|
};
|
|
3749
|
-
},
|
|
3751
|
+
}, Bt = [
|
|
3750
3752
|
"systemError",
|
|
3751
3753
|
"messageUpdated",
|
|
3752
3754
|
"defectUpdated",
|
|
3753
3755
|
"systemMode",
|
|
3754
3756
|
"historyUpdated",
|
|
3755
3757
|
"recordUpdated"
|
|
3756
|
-
],
|
|
3757
|
-
let t = [...
|
|
3758
|
-
for (let e of t)
|
|
3759
|
-
return t.length ===
|
|
3760
|
-
}, { emit:
|
|
3758
|
+
], W = {}, Vt = (e = []) => {
|
|
3759
|
+
let t = [...Bt, ...e];
|
|
3760
|
+
for (let e of t) W[e] = e.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
3761
|
+
return t.length === Bt.length + e.length;
|
|
3762
|
+
}, { emit: G, emitSync: Ht, on: Ut, off: Wt, once: Gt, clear: Kt } = new zt(), qt = {
|
|
3761
3763
|
0: {
|
|
3762
3764
|
editing: !0,
|
|
3763
3765
|
visible: !0,
|
|
@@ -3773,7 +3775,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3773
3775
|
visible: !1,
|
|
3774
3776
|
operate: !1
|
|
3775
3777
|
}
|
|
3776
|
-
},
|
|
3778
|
+
}, Jt = Pt({
|
|
3777
3779
|
dayOk: {
|
|
3778
3780
|
type: "text",
|
|
3779
3781
|
value: 0
|
|
@@ -3784,7 +3786,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3784
3786
|
},
|
|
3785
3787
|
date: {
|
|
3786
3788
|
type: "text",
|
|
3787
|
-
value:
|
|
3789
|
+
value: (0, kt.default)().subtract(1, "day").format("YYYY-MM-DD"),
|
|
3788
3790
|
visible: !1
|
|
3789
3791
|
},
|
|
3790
3792
|
clearTime: {
|
|
@@ -3793,27 +3795,27 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3793
3795
|
},
|
|
3794
3796
|
toProps: () => {
|
|
3795
3797
|
let e = {};
|
|
3796
|
-
for (let t in
|
|
3798
|
+
for (let t in Jt) e[t] = Jt[t].value;
|
|
3797
3799
|
return e;
|
|
3798
3800
|
}
|
|
3799
3801
|
}, ["toProps"], {
|
|
3800
3802
|
enumerable: !1,
|
|
3801
3803
|
writable: !1,
|
|
3802
3804
|
configurable: !1
|
|
3803
|
-
}),
|
|
3805
|
+
}), Yt = [
|
|
3804
3806
|
15,
|
|
3805
3807
|
25,
|
|
3806
3808
|
50,
|
|
3807
3809
|
100
|
|
3808
|
-
],
|
|
3810
|
+
], Xt = [
|
|
3809
3811
|
24,
|
|
3810
3812
|
240,
|
|
3811
3813
|
138
|
|
3812
|
-
],
|
|
3814
|
+
], Zt = "#808080", Qt = "app-config-set", $t = {
|
|
3813
3815
|
INFO: 0,
|
|
3814
3816
|
WARN: 1,
|
|
3815
3817
|
ERROR: 2
|
|
3816
|
-
},
|
|
3818
|
+
}, en = new class {
|
|
3817
3819
|
#e = !1;
|
|
3818
3820
|
#t = [];
|
|
3819
3821
|
#n = "";
|
|
@@ -3827,26 +3829,26 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3827
3829
|
return this.#e;
|
|
3828
3830
|
}
|
|
3829
3831
|
set work(e) {
|
|
3830
|
-
this.#e = e, this.#n = e ?
|
|
3832
|
+
this.#e = e, this.#n = e ? K.workDefectPath : K.globalDefectPath, this.read(this.#n, this.#e);
|
|
3831
3833
|
}
|
|
3832
3834
|
constructor() {
|
|
3833
3835
|
this.#t.splice(0, this.#t.length);
|
|
3834
3836
|
}
|
|
3835
3837
|
#r() {
|
|
3836
|
-
|
|
3838
|
+
G(W.defectUpdated);
|
|
3837
3839
|
}
|
|
3838
3840
|
setValue(e, t = null) {
|
|
3839
|
-
this.value = e, t?.(
|
|
3841
|
+
this.value = e, t?.(U.tool.setOk(), { key: Qt });
|
|
3840
3842
|
}
|
|
3841
3843
|
read(e, t = this.#e) {
|
|
3842
|
-
this.#n = e, this.#e = t,
|
|
3843
|
-
e ?
|
|
3844
|
+
this.#n = e, this.#e = t, Y.access(this.#n, Y.constants.F_OK, (e) => {
|
|
3845
|
+
e ? Cn(this.#n, this.#t) : Sn(this.#n, (e) => {
|
|
3844
3846
|
this.#t = e, this.#r();
|
|
3845
3847
|
});
|
|
3846
3848
|
});
|
|
3847
3849
|
}
|
|
3848
3850
|
write() {
|
|
3849
|
-
|
|
3851
|
+
Cn(this.#n, this.#t);
|
|
3850
3852
|
}
|
|
3851
3853
|
get(e) {
|
|
3852
3854
|
return this.#t.find((t) => t.type === e);
|
|
@@ -3891,7 +3893,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3891
3893
|
t && e[t.type]++;
|
|
3892
3894
|
}
|
|
3893
3895
|
}
|
|
3894
|
-
}(),
|
|
3896
|
+
}(), K = Pt({
|
|
3895
3897
|
workDir: "{workDir}",
|
|
3896
3898
|
rootDir: "{rootDir}",
|
|
3897
3899
|
dataDir: "{workDir}/Data",
|
|
@@ -3906,7 +3908,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3906
3908
|
enumerable: !1,
|
|
3907
3909
|
writable: !0,
|
|
3908
3910
|
configurable: !0
|
|
3909
|
-
}),
|
|
3911
|
+
}), tn = {
|
|
3910
3912
|
saveDir: "",
|
|
3911
3913
|
recordSaveTime: 30,
|
|
3912
3914
|
ngImageSaveTime: 30,
|
|
@@ -3921,28 +3923,28 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3921
3923
|
DatabaseName: "aoi",
|
|
3922
3924
|
UserName: "root",
|
|
3923
3925
|
Password: "123456"
|
|
3924
|
-
},
|
|
3925
|
-
let e = JSON.stringify(
|
|
3926
|
-
return
|
|
3927
|
-
},
|
|
3928
|
-
let t = await
|
|
3929
|
-
return t &&
|
|
3930
|
-
},
|
|
3926
|
+
}, nn = () => {
|
|
3927
|
+
let e = JSON.stringify(q, void 0, 4);
|
|
3928
|
+
return Cn(K.settingPath, e), !0;
|
|
3929
|
+
}, rn = async (e = !0) => {
|
|
3930
|
+
let t = await Sn(K.settingPath, e);
|
|
3931
|
+
return t && an(t, !1), q.onChange?.(), !0;
|
|
3932
|
+
}, an = (e = {}, t = !0) => {
|
|
3931
3933
|
let n = !1, r = {};
|
|
3932
|
-
for (let t of Object.keys(
|
|
3933
|
-
Object.keys(r).length > 0 &&
|
|
3934
|
-
},
|
|
3934
|
+
for (let t of Object.keys(q)) e[t] === void 0 ? (e[t] = tn[t], n = !0) : (q[t] !== e[t] && (q[t] = e[t], n = !0), t.endsWith("Mode") && (r[t] = e[t]));
|
|
3935
|
+
Object.keys(r).length > 0 && G(W.systemMode, r), t && n && nn();
|
|
3936
|
+
}, on = async (e = !0) => {
|
|
3935
3937
|
let { exe: t } = $;
|
|
3936
|
-
return
|
|
3937
|
-
},
|
|
3938
|
-
...
|
|
3939
|
-
setConfig:
|
|
3938
|
+
return sn.level = (await Sn(K.userPath, e))?.UserLevel ?? 0, sn.userName = t.getUserName(), sn.onChange?.(), !0;
|
|
3939
|
+
}, q = Pt({
|
|
3940
|
+
...tn,
|
|
3941
|
+
setConfig: an,
|
|
3940
3942
|
onChange: void 0
|
|
3941
3943
|
}, ["setConfig", "onChange"], {
|
|
3942
3944
|
enumerable: !1,
|
|
3943
3945
|
writable: !0,
|
|
3944
3946
|
configurable: !0
|
|
3945
|
-
}),
|
|
3947
|
+
}), sn = Pt({
|
|
3946
3948
|
level: 0,
|
|
3947
3949
|
userName: null,
|
|
3948
3950
|
onChange: void 0
|
|
@@ -3950,14 +3952,14 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3950
3952
|
enumerable: !1,
|
|
3951
3953
|
writable: !0,
|
|
3952
3954
|
configurable: !0
|
|
3953
|
-
}),
|
|
3955
|
+
}), cn = (e = {}) => {
|
|
3954
3956
|
let { exe: t } = $, n = t.getWorkDir(), r = t.getCurrentPath();
|
|
3955
|
-
|
|
3956
|
-
for (let e in
|
|
3957
|
-
|
|
3958
|
-
for (let e of ["dataDir", "ngImagesDir"])
|
|
3959
|
-
|
|
3960
|
-
},
|
|
3957
|
+
K.workDir = n, K.rootDir = r;
|
|
3958
|
+
for (let e in K) K[e] = K[e].replace(/\{(\w+)\}/g, (e, t) => K[t]);
|
|
3959
|
+
q.saveDir = K.dataDir, Object.assign(q, e), Gt(W.systemMode, ({ detail: e }) => en.work = !!e?.defectMode);
|
|
3960
|
+
for (let e of ["dataDir", "ngImagesDir"]) Y.mkdir(K[e], { recursive: !0 }, () => {});
|
|
3961
|
+
Y.existsSync(K.settingPath) ? rn(!1) : nn(), Y.existsSync(K.userPath) && on(!1), setTimeout(() => wn(K.settingPath, rn), 1e3), setTimeout(() => wn(K.userPath, on), 1e3);
|
|
3962
|
+
}, ln = () => K.workDir.replace(/\\/g, "/").match(/[^/]+$/)?.[0], J = new class {
|
|
3961
3963
|
maxLength = 100;
|
|
3962
3964
|
#e = [];
|
|
3963
3965
|
get value() {
|
|
@@ -3970,7 +3972,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3970
3972
|
this.#e.splice(0, this.#e.length);
|
|
3971
3973
|
}
|
|
3972
3974
|
#t() {
|
|
3973
|
-
|
|
3975
|
+
G(W.messageUpdated);
|
|
3974
3976
|
}
|
|
3975
3977
|
#n(e, t, n, r = {}) {
|
|
3976
3978
|
let i = Date.now();
|
|
@@ -3984,13 +3986,13 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
3984
3986
|
}), this.#e.length > this.maxLength && this.#e.pop(), this.#t(), i;
|
|
3985
3987
|
}
|
|
3986
3988
|
error(e, t, n) {
|
|
3987
|
-
return this.#n("error", e, t ??
|
|
3989
|
+
return this.#n("error", e, t ?? U.tool.error(), n);
|
|
3988
3990
|
}
|
|
3989
3991
|
warning(e, t, n) {
|
|
3990
|
-
return this.#n("warning", e, t ??
|
|
3992
|
+
return this.#n("warning", e, t ?? U.tool.warning(), n);
|
|
3991
3993
|
}
|
|
3992
3994
|
info(e, t, n) {
|
|
3993
|
-
return this.#n("info", e, t ??
|
|
3995
|
+
return this.#n("info", e, t ?? U.tool.info(), n);
|
|
3994
3996
|
}
|
|
3995
3997
|
delete(e) {
|
|
3996
3998
|
let t = this.#e.findIndex((t) => t.id === e);
|
|
@@ -4007,31 +4009,31 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4007
4009
|
clear() {
|
|
4008
4010
|
this.#e.splice(0, this.#e.length), this.#t();
|
|
4009
4011
|
}
|
|
4010
|
-
}(),
|
|
4012
|
+
}(), Y = typeof __non_webpack_require__ == "function" ? __non_webpack_require__("fs") : typeof globalThis.require == "function" ? globalThis.require("fs") : null, un = (e, t = 1500) => {
|
|
4011
4013
|
let n = null;
|
|
4012
4014
|
return function(...r) {
|
|
4013
4015
|
n && clearTimeout(n), n = setTimeout(e.bind(this, ...r), t);
|
|
4014
4016
|
};
|
|
4015
|
-
},
|
|
4017
|
+
}, dn = (e, t = 1500) => {
|
|
4016
4018
|
let n = null;
|
|
4017
4019
|
return function(...r) {
|
|
4018
4020
|
n ||= setTimeout(() => {
|
|
4019
4021
|
e.call(this, ...r), n = null;
|
|
4020
4022
|
}, t);
|
|
4021
4023
|
};
|
|
4022
|
-
},
|
|
4024
|
+
}, fn = (e) => {
|
|
4023
4025
|
if (!e || typeof e != "object") return e;
|
|
4024
4026
|
let t = e.constructor();
|
|
4025
|
-
for (let n in e) Object.hasOwn(e, n) && (t[n] =
|
|
4027
|
+
for (let n in e) Object.hasOwn(e, n) && (t[n] = fn(e[n]));
|
|
4026
4028
|
return t;
|
|
4027
|
-
},
|
|
4029
|
+
}, pn = (e, t) => {
|
|
4028
4030
|
if (e === t) return !0;
|
|
4029
4031
|
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
|
|
4030
4032
|
let n = Object.keys(e), r = Object.keys(t);
|
|
4031
4033
|
if (n.length !== r.length) return !1;
|
|
4032
|
-
for (let i of n) if (!r.includes(i) || !
|
|
4034
|
+
for (let i of n) if (!r.includes(i) || !pn(e[i], t[i])) return !1;
|
|
4033
4035
|
return !0;
|
|
4034
|
-
},
|
|
4036
|
+
}, mn = (e = "_") => `${Date.now()}${e}${Math.floor(Math.random() * 1e4)}`, hn = (e) => e == null ? !1 : typeof e == "string" || Array.isArray(e) ? e.length > 0 : typeof e != "object" || Object.keys(e).length > 0, gn = (e, t = {}) => {
|
|
4035
4037
|
try {
|
|
4036
4038
|
let n = O(e);
|
|
4037
4039
|
for (let e in t) n = n[e]?.(t[e]);
|
|
@@ -4039,10 +4041,10 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4039
4041
|
} catch {
|
|
4040
4042
|
return !1;
|
|
4041
4043
|
}
|
|
4042
|
-
},
|
|
4044
|
+
}, _n = (e) => {
|
|
4043
4045
|
let t = $.token?.[e];
|
|
4044
|
-
return
|
|
4045
|
-
},
|
|
4046
|
+
return hn(t) ? t : getComputedStyle(document.getElementById("root")).getPropertyValue(`--aoi-${e}`).trim();
|
|
4047
|
+
}, vn = (e = pe) => {
|
|
4046
4048
|
let t;
|
|
4047
4049
|
switch (e) {
|
|
4048
4050
|
case "small":
|
|
@@ -4054,26 +4056,26 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4054
4056
|
default: t = $.token.controlHeight ?? 32;
|
|
4055
4057
|
}
|
|
4056
4058
|
return Number.parseInt(t);
|
|
4057
|
-
},
|
|
4059
|
+
}, yn = (e, t = 2) => {
|
|
4058
4060
|
let n = Number(e);
|
|
4059
4061
|
return Number.isNaN(n) ? 0 : Number(n.toFixed(t));
|
|
4060
|
-
},
|
|
4062
|
+
}, bn = (e, t = {}, n = {}) => {
|
|
4061
4063
|
let r = e.constructor === String ? document.createElement(e) : e;
|
|
4062
|
-
for (let [e, n] of Object.entries(t)) n.constructor === Object ?
|
|
4064
|
+
for (let [e, n] of Object.entries(t)) n.constructor === Object ? bn(r[e], n) : e.startsWith("--") ? r.setProperty(e, n) : r[e] = n;
|
|
4063
4065
|
for (let [e, t] of Object.entries(n)) r.addEventListener(e, t);
|
|
4064
4066
|
return r;
|
|
4065
|
-
},
|
|
4067
|
+
}, xn = (e) => {
|
|
4066
4068
|
e?.stopPropagation(), e?.preventDefault(), e.cancelBubble = !0;
|
|
4067
|
-
},
|
|
4069
|
+
}, Sn = (e, t = !1) => {
|
|
4068
4070
|
if (Mt(t, "function")) {
|
|
4069
|
-
|
|
4071
|
+
Y.readFile(e, "utf-8", (n, r) => {
|
|
4070
4072
|
if (n || !r) {
|
|
4071
4073
|
n && $.dev && console.error(n);
|
|
4072
4074
|
return;
|
|
4073
4075
|
}
|
|
4074
|
-
let i =
|
|
4076
|
+
let i = X(r);
|
|
4075
4077
|
if (!i) {
|
|
4076
|
-
|
|
4078
|
+
J.error(U.file.filePath({ path: e }), U.file.readErr());
|
|
4077
4079
|
return;
|
|
4078
4080
|
}
|
|
4079
4081
|
t(i);
|
|
@@ -4084,40 +4086,40 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4084
4086
|
try {
|
|
4085
4087
|
if (t) return new Promise((t, r) => {
|
|
4086
4088
|
n.readTextFileSync(e, (e, n) => {
|
|
4087
|
-
t(n ?
|
|
4089
|
+
t(n ? X(n) : null);
|
|
4088
4090
|
});
|
|
4089
4091
|
});
|
|
4090
4092
|
{
|
|
4091
4093
|
let t = n.readTextFileSync(e);
|
|
4092
|
-
return t ?
|
|
4094
|
+
return t ? X(t) : null;
|
|
4093
4095
|
}
|
|
4094
4096
|
} catch (t) {
|
|
4095
|
-
return
|
|
4097
|
+
return J.error(U.file.filePath({ path: e }), U.file.readErr()), $.dev && console.error(t), null;
|
|
4096
4098
|
}
|
|
4097
|
-
},
|
|
4098
|
-
|
|
4099
|
-
n?.(t), t && (
|
|
4099
|
+
}, Cn = (e, t, n) => {
|
|
4100
|
+
Y.writeFile(e, Tn(t), "utf-8", (t) => {
|
|
4101
|
+
n?.(t), t && (J.error(U.file.filePath({ path: e }), U.file.writeErr()), $.dev && console.error(t));
|
|
4100
4102
|
});
|
|
4101
|
-
},
|
|
4102
|
-
Mt(t, "function") &&
|
|
4103
|
+
}, wn = (e, t) => {
|
|
4104
|
+
Mt(t, "function") && Y.watch(e, (e) => {
|
|
4103
4105
|
e === "change" && (clearTimeout(t?.timer), t.timer = setTimeout(t, 1e3));
|
|
4104
4106
|
});
|
|
4105
|
-
},
|
|
4107
|
+
}, X = (e, t = null) => {
|
|
4106
4108
|
if (typeof e == "object") return e;
|
|
4107
4109
|
try {
|
|
4108
4110
|
return JSON.parse(e);
|
|
4109
4111
|
} catch {
|
|
4110
4112
|
return t;
|
|
4111
4113
|
}
|
|
4112
|
-
},
|
|
4114
|
+
}, Tn = (e, t = "") => {
|
|
4113
4115
|
if (typeof e == "string") return e;
|
|
4114
4116
|
try {
|
|
4115
4117
|
return JSON.stringify(e);
|
|
4116
4118
|
} catch {
|
|
4117
4119
|
return t;
|
|
4118
4120
|
}
|
|
4119
|
-
},
|
|
4120
|
-
let { x: n = 0, y: r = 0, w: i = 0, h: a = 0, fileName: o, prefixDir: s =
|
|
4121
|
+
}, En = (e, t = {}) => {
|
|
4122
|
+
let { x: n = 0, y: r = 0, w: i = 0, h: a = 0, fileName: o, prefixDir: s = K.ngImagesDir, ratio: c = q.ngImgRatio } = t;
|
|
4121
4123
|
if (!e || n <= 0 || r <= 0 || i <= 0 || a <= 0 || !o) return {
|
|
4122
4124
|
image: e,
|
|
4123
4125
|
x: n,
|
|
@@ -4134,9 +4136,9 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4134
4136
|
"jpeg",
|
|
4135
4137
|
"png",
|
|
4136
4138
|
"bmp"
|
|
4137
|
-
].includes(l) || (t += `.${
|
|
4139
|
+
].includes(l) || (t += `.${q.ngImgSuffix}`);
|
|
4138
4140
|
let u = t.substring(0, t.lastIndexOf("/"));
|
|
4139
|
-
|
|
4141
|
+
Y.existsSync(u) || Y.mkdirSync(u, { recursive: !0 });
|
|
4140
4142
|
let { cv: d } = $, f = d.cropSharedMemImage(e, n, r, n + i, r + a);
|
|
4141
4143
|
return !f || new Promise((e, n) => {
|
|
4142
4144
|
d.imwriteWithRatio(t, f, c, (t) => {
|
|
@@ -4146,8 +4148,8 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4146
4148
|
} catch (e) {
|
|
4147
4149
|
return $.dev && console.error(e), !0;
|
|
4148
4150
|
}
|
|
4149
|
-
},
|
|
4150
|
-
let { fileName: t, prefixDir: n =
|
|
4151
|
+
}, Dn = (e = {}) => {
|
|
4152
|
+
let { fileName: t, prefixDir: n = K.ngImagesDir } = e;
|
|
4151
4153
|
if (!t) return;
|
|
4152
4154
|
let r = `${n}/${t}`, i = r.split(".").pop().toLowerCase();
|
|
4153
4155
|
[
|
|
@@ -4155,28 +4157,28 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4155
4157
|
"jpeg",
|
|
4156
4158
|
"png",
|
|
4157
4159
|
"bmp"
|
|
4158
|
-
].includes(i) || (r += `.${
|
|
4160
|
+
].includes(i) || (r += `.${q.ngImgSuffix}`);
|
|
4159
4161
|
let { cv: a } = $;
|
|
4160
4162
|
return new Promise((e, t) => {
|
|
4161
4163
|
a.imread(r, (t, n) => {
|
|
4162
4164
|
t ? ($.dev && console.error("error read image: ", t), e(!1)) : e(n);
|
|
4163
4165
|
});
|
|
4164
4166
|
});
|
|
4165
|
-
},
|
|
4166
|
-
let { fileName: t, prefixDir: n =
|
|
4167
|
+
}, On = async (e = {}) => {
|
|
4168
|
+
let { fileName: t, prefixDir: n = K.ngImagesDir } = e;
|
|
4167
4169
|
if (!t) return;
|
|
4168
4170
|
let r = n ? `${n}/${t}` : t;
|
|
4169
|
-
if (!
|
|
4171
|
+
if (!Y.existsSync(r)) return;
|
|
4170
4172
|
let { exe: i } = $;
|
|
4171
4173
|
return await i.deletePath(r) === "delete successed";
|
|
4172
|
-
},
|
|
4173
|
-
let { cv: r } = $, i =
|
|
4174
|
+
}, kn = (e, t = "", n = []) => {
|
|
4175
|
+
let { cv: r } = $, i = K.dataDir;
|
|
4174
4176
|
return e ? r.getOpenFileName(t, `*${n.join(";*")}`, i) : r.getExistingDirectory(t, i);
|
|
4175
|
-
},
|
|
4177
|
+
}, An = (e, ...t) => e.replace(/\?/g, () => {
|
|
4176
4178
|
let e = t.shift();
|
|
4177
|
-
return e instanceof Object && (e =
|
|
4178
|
-
}).replace(/[\n\r\s]+/g, " "),
|
|
4179
|
-
tableName:
|
|
4179
|
+
return e instanceof Object && (e = Tn(e, void 0)), typeof e == "string" ? e.length ? `'${e}'` : "null" : e === void 0 ? "null" : e;
|
|
4180
|
+
}).replace(/[\n\r\s]+/g, " "), Z = "journal", Q = {
|
|
4181
|
+
tableName: Z,
|
|
4180
4182
|
fields: {
|
|
4181
4183
|
id: "BIGINT PRIMARY KEY",
|
|
4182
4184
|
time: "VARCHAR (30) NOT NULL",
|
|
@@ -4186,10 +4188,11 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4186
4188
|
content: "LONGTEXT"
|
|
4187
4189
|
},
|
|
4188
4190
|
sqls: {
|
|
4189
|
-
insertSql: `INSERT INTO ${
|
|
4190
|
-
totalSql: `SELECT COUNT(*) AS total FROM ${
|
|
4191
|
-
selectSql: `SELECT id, time, user, class, content FROM ${
|
|
4192
|
-
fieldValues: `SELECT DISTINCT ? FROM ${
|
|
4191
|
+
insertSql: `INSERT INTO ${Z} (id, time, type, class, user, content) VALUES (?, ?, ?, ?, ?, ?)`,
|
|
4192
|
+
totalSql: `SELECT COUNT(*) AS total FROM ${Z}`,
|
|
4193
|
+
selectSql: `SELECT id, time, user, class, content FROM ${Z}`,
|
|
4194
|
+
fieldValues: `SELECT DISTINCT ? FROM ${Z}`,
|
|
4195
|
+
expirationSql: `DELETE FROM ${Z} WHERE id < ?`
|
|
4193
4196
|
},
|
|
4194
4197
|
operate: "operate",
|
|
4195
4198
|
message: "message"
|
|
@@ -4204,28 +4207,28 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4204
4207
|
}
|
|
4205
4208
|
constructor(e = []) {
|
|
4206
4209
|
let { exe: t } = $;
|
|
4207
|
-
this.#e = [...e, Q], this.#t = this.#e?.length <= 1 || this.#e.some((e) => t.verifyDatabase(e.tableName,
|
|
4210
|
+
this.#e = [...e, Q], this.#t = this.#e?.length <= 1 || this.#e.some((e) => t.verifyDatabase(e.tableName, Tn(e.fields)));
|
|
4208
4211
|
}
|
|
4209
4212
|
async #n({ tableName: e, sqlKey: t, typeErr: n, execFunc: r }, ...i) {
|
|
4210
4213
|
let a = this.getTable(e);
|
|
4211
4214
|
if (!a) return !1;
|
|
4212
|
-
let { exe: o } = $, s =
|
|
4215
|
+
let { exe: o } = $, s = An(a.sqls?.[t] ?? t, ...i);
|
|
4213
4216
|
try {
|
|
4214
4217
|
let e = await r(o, s);
|
|
4215
4218
|
if (e) return e;
|
|
4216
4219
|
throw Error();
|
|
4217
4220
|
} catch (e) {
|
|
4218
|
-
return
|
|
4221
|
+
return J.error(U.sql.execErr({ error: s }), n), $.dev && console.error(e), !1;
|
|
4219
4222
|
}
|
|
4220
4223
|
}
|
|
4221
4224
|
getTable(e) {
|
|
4222
|
-
return this.#e.find((t) => t.tableName === e) || (
|
|
4225
|
+
return this.#e.find((t) => t.tableName === e) || (J.error(U.sql.tableErr({ tableName: e }), U.sql.error()), !1);
|
|
4223
4226
|
}
|
|
4224
4227
|
update(e, t, ...n) {
|
|
4225
4228
|
return this.#n({
|
|
4226
4229
|
tableName: e,
|
|
4227
4230
|
sqlKey: t,
|
|
4228
|
-
typeErr:
|
|
4231
|
+
typeErr: U.sql.updateErr(),
|
|
4229
4232
|
execFunc: async (e, t) => await e.writeDataBase(t) === 0
|
|
4230
4233
|
}, ...n);
|
|
4231
4234
|
}
|
|
@@ -4233,10 +4236,10 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4233
4236
|
return this.#n({
|
|
4234
4237
|
tableName: e,
|
|
4235
4238
|
sqlKey: t,
|
|
4236
|
-
typeErr:
|
|
4239
|
+
typeErr: U.sql.selectErr(),
|
|
4237
4240
|
execFunc: async (e, t) => {
|
|
4238
4241
|
let n = await e.findDataBaseData(t);
|
|
4239
|
-
return n?.length ?
|
|
4242
|
+
return n?.length ? X(n, []) : [];
|
|
4240
4243
|
}
|
|
4241
4244
|
}, ...n);
|
|
4242
4245
|
}
|
|
@@ -4244,10 +4247,10 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4244
4247
|
return this.#n({
|
|
4245
4248
|
tableName: e,
|
|
4246
4249
|
sqlKey: t,
|
|
4247
|
-
typeErr:
|
|
4250
|
+
typeErr: U.sql.selectErr(),
|
|
4248
4251
|
execFunc: async (e, t) => {
|
|
4249
4252
|
let n = await e.findSingleDataBaseData(t);
|
|
4250
|
-
return n?.length ?
|
|
4253
|
+
return n?.length ? X(n) : null;
|
|
4251
4254
|
}
|
|
4252
4255
|
}, ...n);
|
|
4253
4256
|
}
|
|
@@ -4255,24 +4258,24 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4255
4258
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
4256
4259
|
for (let r of e) {
|
|
4257
4260
|
let e = this.#e.find((e) => e.tableName === r.name);
|
|
4258
|
-
e ? n.push(
|
|
4261
|
+
e ? n.push(An(e.sqls?.[r.key] ?? r.key, ...r?.params ?? [])) : t.add(r.name);
|
|
4259
4262
|
}
|
|
4260
4263
|
if (t.size) {
|
|
4261
4264
|
let e = Array.from(t).join(", ");
|
|
4262
|
-
return
|
|
4265
|
+
return J.error(U.sql.tableErr({ tableName: e }), U.sql.error()), !1;
|
|
4263
4266
|
}
|
|
4264
4267
|
let { exe: r } = $, i = n.join("&");
|
|
4265
4268
|
try {
|
|
4266
4269
|
if (await r.batchWriteDataBase(i)) return !0;
|
|
4267
4270
|
throw Error();
|
|
4268
4271
|
} catch (e) {
|
|
4269
|
-
return
|
|
4272
|
+
return J.error(U.sql.execErr({ error: i }), U.sql.batchErr()), $.dev && console.error(e), !1;
|
|
4270
4273
|
}
|
|
4271
4274
|
}
|
|
4272
4275
|
async #r({ type: e, grade: t, user: n, content: r }) {
|
|
4273
|
-
let { exe: i } = $, a = Date.now(), o = At(a), s = n ??
|
|
4276
|
+
let { exe: i } = $, a = Date.now(), o = At(a), s = n ?? sn.userName;
|
|
4274
4277
|
try {
|
|
4275
|
-
let n =
|
|
4278
|
+
let n = An(Q.sqls.insertSql, a, o, e, t, s, r);
|
|
4276
4279
|
await i.writeDataBase(n);
|
|
4277
4280
|
} catch (e) {
|
|
4278
4281
|
$.dev && console.error(e);
|
|
@@ -4284,7 +4287,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4284
4287
|
grade: e,
|
|
4285
4288
|
user: n,
|
|
4286
4289
|
content: t
|
|
4287
|
-
}),
|
|
4290
|
+
}), G(W.recordUpdated, Q.operate);
|
|
4288
4291
|
}
|
|
4289
4292
|
async logMessage(e, t, n) {
|
|
4290
4293
|
await this.#r({
|
|
@@ -4292,7 +4295,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4292
4295
|
grade: e,
|
|
4293
4296
|
user: n,
|
|
4294
4297
|
content: t
|
|
4295
|
-
}),
|
|
4298
|
+
}), G(W.recordUpdated, Q.message);
|
|
4296
4299
|
}
|
|
4297
4300
|
}, Mn = (e) => {
|
|
4298
4301
|
let t = new jn(e);
|
|
@@ -4339,7 +4342,7 @@ var _t = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#1
|
|
|
4339
4342
|
level: null,
|
|
4340
4343
|
project: {}
|
|
4341
4344
|
}, Pn = ({ exe: e = null, cv: t = null, neat: n = !1, dev: r = !1, resource: i = {}, lang: a = "zh", sqls: o = [], evt: s = [], level: c = {}, config: l = {}, project: u = {}, imgQueueLen: d = 3, msgMaxLen: f = 100 } = {}) => {
|
|
4342
|
-
$.exe = e, $.cv = t, $.neat = n, $.dev = r, $.level = c, $.langs =
|
|
4345
|
+
$.exe = e, $.cv = t, $.neat = n, $.dev = r, $.level = c, $.langs = Lt(i, a), $.db = Mn(o), $.evt = Vt(s), J.maxLength = f, Nn.maxLength = d, cn(l), $.project = Object.assign(u, Jt.toProps());
|
|
4343
4346
|
};
|
|
4344
4347
|
//#endregion
|
|
4345
|
-
export { Mt as $,
|
|
4348
|
+
export { Mt as $, cn as A, Yt as B, yn as C, Cn as D, wn as E, Zt as F, Ht as G, W as H, Qt as I, Ut as J, Vt as K, Xt as L, q as M, sn as N, J as O, en as P, At as Q, Jt as R, vn as S, mn as T, Kt as U, qt as V, G as W, U as X, Gt as Y, Nt as Z, bn as _, d as _t, Mn as a, bt as at, dn as b, pn as c, De as ct, hn as d, pe as dt, Pt as et, X as f, me as ft, En as g, c as gt, On as h, s as ht, Q as i, Ct as it, ln as j, K as k, Y as l, P as lt, Dn as m, O as mt, Pn as n, Ot as nt, un as o, H as ot, Sn as p, fe as pt, Wt as q, Nn as r, Et as rt, fn as s, V as st, $ as t, jt as tt, kn as u, we as ut, xn as v, u as vt, _n as w, gn as x, Tn as y, $t as z };
|