@partex/one-core 2.0.102 → 2.0.103
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/lib/one-core.cjs +1 -1
- package/lib/one-core.js +20 -21
- package/lib/one-core.umd.cjs +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/lib/one-core.js
CHANGED
|
@@ -30818,17 +30818,17 @@ const dW = /* @__PURE__ */ re(uW, [["render", hW]]), vW = Ie({
|
|
|
30818
30818
|
setup(e, { emit: t }) {
|
|
30819
30819
|
const r = U(), n = U(), a = U(!1), i = U(!1), o = Pn(), s = 1280, l = 720;
|
|
30820
30820
|
let u = null, c = null;
|
|
30821
|
-
const f = (
|
|
30822
|
-
u.beginPath(), u.moveTo(
|
|
30821
|
+
const f = (y, w) => {
|
|
30822
|
+
u.beginPath(), u.moveTo(y.x, y.y), u.lineTo(w.x, w.y), u.lineWidth = 2, u.strokeStyle = "green", u.stroke();
|
|
30823
30823
|
}, d = () => {
|
|
30824
30824
|
if (c && c.readyState === c.HAVE_ENOUGH_DATA) {
|
|
30825
30825
|
c.width = s, c.height = l, u.drawImage(r.value, 0, 0, s, l);
|
|
30826
|
-
const
|
|
30826
|
+
const y = u.getImageData(0, 0, s, l);
|
|
30827
30827
|
try {
|
|
30828
|
-
const
|
|
30829
|
-
if (
|
|
30830
|
-
const { location:
|
|
30831
|
-
f(
|
|
30828
|
+
const w = _C(y.data, s, l);
|
|
30829
|
+
if (w) {
|
|
30830
|
+
const { location: C, data: S } = w;
|
|
30831
|
+
f(C.topLeftCorner, C.topRightCorner), f(C.topRightCorner, C.bottomRightCorner), f(C.bottomRightCorner, C.bottomLeftCorner), f(C.bottomLeftCorner, C.topLeftCorner), t("on-update:value", S), v();
|
|
30832
30832
|
}
|
|
30833
30833
|
} catch {
|
|
30834
30834
|
i.value = !1, o.error({
|
|
@@ -30841,12 +30841,12 @@ const dW = /* @__PURE__ */ re(uW, [["render", hW]]), vW = Ie({
|
|
|
30841
30841
|
}, h = () => {
|
|
30842
30842
|
i.value && requestAnimationFrame(d);
|
|
30843
30843
|
}, v = () => {
|
|
30844
|
-
r.value && r.value.srcObject && (r.value.srcObject.getTracks().forEach((
|
|
30845
|
-
}, g = (
|
|
30846
|
-
r.value.srcObject !== void 0 ? r.value.srcObject =
|
|
30844
|
+
r.value && r.value.srcObject && (r.value.srcObject.getTracks().forEach((y) => y.stop()), i.value = !1, u = null, c = null, r.value.srcObject = null, r.value.src = null), a.value = !1;
|
|
30845
|
+
}, g = (y) => {
|
|
30846
|
+
r.value.srcObject !== void 0 ? r.value.srcObject = y : window.videoEl.mozSrcObject !== void 0 ? r.value.mozSrcObject = y : window.URL.createObjectURL ? r.value.src = window.URL.createObjectURL(y) : window.webkitURL ? r.value.src = window.webkitURL.createObjectURL(y) : r.value.src = y, r.value.play().then(h);
|
|
30847
30847
|
}, p = () => {
|
|
30848
|
-
var
|
|
30849
|
-
(
|
|
30848
|
+
var y, w;
|
|
30849
|
+
(y = n.value) == null || y.focus(), (w = n.value) == null || w.select(), a.value = !0, U2(() => {
|
|
30850
30850
|
navigator.mediaDevices && navigator.mediaDevices.getUserMedia ? (i.value = !0, c = document.getElementById("oc-scan-canvas"), c && (u = c.getContext("2d", { willReadFrequently: !0 })), navigator.mediaDevices.getUserMedia({ video: !0 }).then(g).catch(() => {
|
|
30851
30851
|
i.value = !1, o.error({
|
|
30852
30852
|
content: "未获取到摄像头权限,请确认赋予相关权限",
|
|
@@ -30858,19 +30858,18 @@ const dW = /* @__PURE__ */ re(uW, [["render", hW]]), vW = Ie({
|
|
|
30858
30858
|
}));
|
|
30859
30859
|
});
|
|
30860
30860
|
};
|
|
30861
|
-
let m = ""
|
|
30862
|
-
function y
|
|
30863
|
-
if (
|
|
30864
|
-
m && t("on-update:value", m), m = ""
|
|
30861
|
+
let m = "";
|
|
30862
|
+
function _(y) {
|
|
30863
|
+
if (y.code === "Enter") {
|
|
30864
|
+
m && t("on-update:value", m), m = "";
|
|
30865
30865
|
return;
|
|
30866
30866
|
}
|
|
30867
|
-
|
|
30868
|
-
_ === 0 || C - _ <= 100 ? m += w.key : C - _ > 500 && (m = "", _ = 0), _ = C;
|
|
30867
|
+
m += y.key;
|
|
30869
30868
|
}
|
|
30870
30869
|
return Jr(() => {
|
|
30871
|
-
window.addEventListener("keypress",
|
|
30870
|
+
window.addEventListener("keypress", _);
|
|
30872
30871
|
}), dd(() => {
|
|
30873
|
-
window.removeEventListener("keypress",
|
|
30872
|
+
window.removeEventListener("keypress", _), v();
|
|
30874
30873
|
}), {
|
|
30875
30874
|
videoRef: r,
|
|
30876
30875
|
inputRef: n,
|
|
@@ -33041,7 +33040,7 @@ function xY() {
|
|
|
33041
33040
|
hp = 3840, dp = 2160, window.removeEventListener("resize", e);
|
|
33042
33041
|
};
|
|
33043
33042
|
}
|
|
33044
|
-
const DY = (e) => !!(G.kind === -1 || G.kind === 99 || G.iot_menu_authorization.includes(e)), AY = (e) => G.platform_tdm ? G.kind === -1 || G.kind === 99 || e === "home" ? !0 : G.tdm_menu_authorization.includes(e) : !1, MY = (e) => G.platform_qms ? G.kind === -1 || G.kind === 99 || e === "home" ? !0 : G.qms_menu_authorization.includes(e) : !1, NY = (e) => G.platform_twin ? (G.kind === -1 || G.kind === 99 || e === "home", !0) : !1, PY = (e) => !!(G.kind === -1 || G.kind === 99 || G.maintain_menu_authorization.includes(e)), kY = (e) => !!(G.kind === -1 || G.kind === 99 || G.order_menu_authorization.includes(e)), tY = "2.0.
|
|
33043
|
+
const DY = (e) => !!(G.kind === -1 || G.kind === 99 || G.iot_menu_authorization.includes(e)), AY = (e) => G.platform_tdm ? G.kind === -1 || G.kind === 99 || e === "home" ? !0 : G.tdm_menu_authorization.includes(e) : !1, MY = (e) => G.platform_qms ? G.kind === -1 || G.kind === 99 || e === "home" ? !0 : G.qms_menu_authorization.includes(e) : !1, NY = (e) => G.platform_twin ? (G.kind === -1 || G.kind === 99 || e === "home", !0) : !1, PY = (e) => !!(G.kind === -1 || G.kind === 99 || G.maintain_menu_authorization.includes(e)), kY = (e) => !!(G.kind === -1 || G.kind === 99 || G.order_menu_authorization.includes(e)), tY = "2.0.103";
|
|
33045
33044
|
let ml = "";
|
|
33046
33045
|
const Me = navigator.userAgent.toLocaleUpperCase(), rY = () => {
|
|
33047
33046
|
const e = /WINDOWS NT 5.[\d]+/, t = /WINDOWS NT 6.[\d]+/, r = /WINDOWS NT 7.[\d]+/, n = /WINDOWS NT 10.[\d]+/, a = /WINDOWS NT 11.[\d]+/, i = /ANDROID [\d.]+/, o = /IPHONE/, s = /IPAD/, l = /MAC/;
|