@solar-taro/ui-vant 1.0.2 → 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/CHANGELOG.md +4 -0
- package/index.js +32 -1762
- package/index10.js +236 -0
- package/index100.js +7 -0
- package/index101.js +8 -0
- package/index102.js +9 -0
- package/index103.js +12 -0
- package/index104.js +9 -0
- package/index105.js +20 -0
- package/index106.js +7 -0
- package/index107.js +7 -0
- package/index108.js +6 -0
- package/index109.js +6 -0
- package/index11.js +48 -0
- package/index110.js +17 -0
- package/index111.js +10 -0
- package/index112.js +8 -0
- package/index113.js +8 -0
- package/index114.js +8 -0
- package/index115.js +8 -0
- package/index116.js +8 -0
- package/index117.js +9 -0
- package/index118.js +5 -0
- package/index119.js +20 -0
- package/index12.js +21 -0
- package/index120.js +8 -0
- package/index121.js +6 -0
- package/index122.js +12 -0
- package/index123.js +8 -0
- package/index124.js +7 -0
- package/index125.js +8 -0
- package/index126.js +6 -0
- package/index127.js +5 -0
- package/index128.js +7 -0
- package/index129.js +7 -0
- package/index13.js +31 -0
- package/index130.js +13 -0
- package/index131.js +9 -0
- package/index132.js +9 -0
- package/index133.js +7 -0
- package/index134.js +10 -0
- package/index135.js +5 -0
- package/index14.js +7 -0
- package/index15.js +66 -0
- package/index16.js +4 -0
- package/index17.js +4 -0
- package/index18.js +4 -0
- package/index19.js +4 -0
- package/index2.js +9 -0
- package/index20.js +4 -0
- package/index21.js +4 -0
- package/index22.js +4 -0
- package/index23.js +4 -0
- package/index24.js +4 -0
- package/index25.js +8 -0
- package/index26.js +11 -0
- package/index27.js +11 -0
- package/index28.js +65 -0
- package/index29.js +6 -0
- package/index3.js +131 -0
- package/index30.js +10 -0
- package/index31.js +9 -0
- package/index32.js +6 -0
- package/index33.js +4 -0
- package/index34.js +8 -0
- package/index35.js +12 -0
- package/index36.js +7 -0
- package/index37.js +6 -0
- package/index38.js +5 -0
- package/index39.js +6 -0
- package/index4.js +172 -0
- package/index40.js +10 -0
- package/index41.js +7 -0
- package/index42.js +7 -0
- package/index43.js +9 -0
- package/index44.js +8 -0
- package/index45.js +11 -0
- package/index46.js +7 -0
- package/index47.js +9 -0
- package/index48.js +7 -0
- package/index49.js +12 -0
- package/index5.js +36 -0
- package/index50.js +9 -0
- package/index51.js +20 -0
- package/index52.js +14 -0
- package/index53.js +9 -0
- package/index54.js +15 -0
- package/index55.js +6 -0
- package/index56.js +14 -0
- package/index57.js +10 -0
- package/index58.js +12 -0
- package/index59.js +8 -0
- package/index6.js +102 -0
- package/index60.js +8 -0
- package/index61.js +11 -0
- package/index62.js +18 -0
- package/index63.js +8 -0
- package/index64.js +8 -0
- package/index65.js +11 -0
- package/index66.js +9 -0
- package/index67.js +8 -0
- package/index68.js +8 -0
- package/index69.js +9 -0
- package/index7.js +46 -0
- package/index70.js +9 -0
- package/index71.js +28 -0
- package/index72.js +8 -0
- package/index73.js +42 -0
- package/index74.js +9 -0
- package/index75.js +8 -0
- package/index76.js +17 -0
- package/index77.js +10 -0
- package/index78.js +4 -0
- package/index79.js +5 -0
- package/index8.js +272 -0
- package/index80.js +6 -0
- package/index81.js +6 -0
- package/index82.js +6 -0
- package/index83.js +6 -0
- package/index84.js +6 -0
- package/index85.js +17 -0
- package/index86.js +5 -0
- package/index87.js +15 -0
- package/index88.js +7 -0
- package/index89.js +16 -0
- package/index9.js +64 -0
- package/index90.js +11 -0
- package/index91.js +5 -0
- package/index92.js +8 -0
- package/index93.js +8 -0
- package/index94.js +8 -0
- package/index95.js +10 -0
- package/index96.js +20 -0
- package/index97.js +13 -0
- package/index98.js +8 -0
- package/index99.js +7 -0
- package/package.json +1 -1
package/index7.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineComponent as m, ref as u, computed as p, onUnmounted as f, renderSlot as h, toDisplayString as b, createElementVNode as y, openBlock as v, createElementBlock as k, createCommentVNode as g } from "vue";
|
|
2
|
+
import { onKeyboardHeightChange as w, offKeyboardHeightChange as B } from "@tarojs/taro";
|
|
3
|
+
const l = h, _ = b, C = y, r = v, a = k, D = g, E = ["show", "title", "close-on-click-overlay"], N = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "van-button-container van-button-group"
|
|
6
|
+
}, S = ["disabled"], K = /* @__PURE__ */ m({
|
|
7
|
+
__name: "index",
|
|
8
|
+
props: {
|
|
9
|
+
show: { type: Boolean },
|
|
10
|
+
title: {},
|
|
11
|
+
showButtons: { type: Boolean, default: !0 },
|
|
12
|
+
confirmText: { default: "确认" },
|
|
13
|
+
confirmDisabled: { type: Boolean }
|
|
14
|
+
},
|
|
15
|
+
emits: ["update:show", "confirm"],
|
|
16
|
+
setup(V, { emit: i }) {
|
|
17
|
+
const t = i, n = u(0), d = p(() => n.value === 0);
|
|
18
|
+
function s(e) {
|
|
19
|
+
n.value = e.height;
|
|
20
|
+
}
|
|
21
|
+
return w(s), f(() => {
|
|
22
|
+
B(s);
|
|
23
|
+
}), (e, o) => (r(), a("van-action-sheet", {
|
|
24
|
+
show: e.show,
|
|
25
|
+
title: e.title,
|
|
26
|
+
"close-on-click-overlay": d.value,
|
|
27
|
+
onClose: o[1] || (o[1] = (c) => t("update:show", !1))
|
|
28
|
+
}, [
|
|
29
|
+
l(e.$slots, "default"),
|
|
30
|
+
e.showButtons ? (r(), a("view", N, [
|
|
31
|
+
l(e.$slots, "buttons", {}, () => [
|
|
32
|
+
C("van-button", {
|
|
33
|
+
type: "primary",
|
|
34
|
+
round: "true",
|
|
35
|
+
block: "true",
|
|
36
|
+
disabled: e.confirmDisabled,
|
|
37
|
+
onClick: o[0] || (o[0] = (c) => t("confirm"))
|
|
38
|
+
}, _(e.confirmText), 9, S)
|
|
39
|
+
])
|
|
40
|
+
])) : D("", !0)
|
|
41
|
+
], 40, E));
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
K as default
|
|
46
|
+
};
|
package/index70.js
ADDED
package/index71.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import e from "./index80.js";
|
|
2
|
+
import a from "./index81.js";
|
|
3
|
+
import o from "./index82.js";
|
|
4
|
+
import i from "./index83.js";
|
|
5
|
+
import n from "./index84.js";
|
|
6
|
+
import S from "./index40.js";
|
|
7
|
+
import t from "./index85.js";
|
|
8
|
+
var g = "[object Map]", j = "[object Object]", f = "[object Promise]", u = "[object Set]", w = "[object WeakMap]", b = "[object DataView]", T = t(e), C = t(a), M = t(o), d = t(i), v = t(n), r = S;
|
|
9
|
+
(e && r(new e(new ArrayBuffer(1))) != b || a && r(new a()) != g || o && r(o.resolve()) != f || i && r(new i()) != u || n && r(new n()) != w) && (r = function(m) {
|
|
10
|
+
var c = S(m), p = c == j ? m.constructor : void 0, s = p ? t(p) : "";
|
|
11
|
+
if (s)
|
|
12
|
+
switch (s) {
|
|
13
|
+
case T:
|
|
14
|
+
return b;
|
|
15
|
+
case C:
|
|
16
|
+
return g;
|
|
17
|
+
case M:
|
|
18
|
+
return f;
|
|
19
|
+
case d:
|
|
20
|
+
return u;
|
|
21
|
+
case v:
|
|
22
|
+
return w;
|
|
23
|
+
}
|
|
24
|
+
return c;
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
r as default
|
|
28
|
+
};
|
package/index72.js
ADDED
package/index73.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import o from "./index112.js";
|
|
2
|
+
import n from "./index113.js";
|
|
3
|
+
import c from "./index114.js";
|
|
4
|
+
import g from "./index115.js";
|
|
5
|
+
import i from "./index116.js";
|
|
6
|
+
var s = "[object Boolean]", u = "[object Date]", T = "[object Map]", b = "[object Number]", l = "[object RegExp]", m = "[object Set]", y = "[object String]", f = "[object Symbol]", p = "[object ArrayBuffer]", j = "[object DataView]", A = "[object Float32Array]", w = "[object Float64Array]", d = "[object Int8Array]", B = "[object Int16Array]", x = "[object Int32Array]", C = "[object Uint8Array]", S = "[object Uint8ClampedArray]", U = "[object Uint16Array]", v = "[object Uint32Array]";
|
|
7
|
+
function R(a, t, r) {
|
|
8
|
+
var e = a.constructor;
|
|
9
|
+
switch (t) {
|
|
10
|
+
case p:
|
|
11
|
+
return o(a);
|
|
12
|
+
case s:
|
|
13
|
+
case u:
|
|
14
|
+
return new e(+a);
|
|
15
|
+
case j:
|
|
16
|
+
return n(a, r);
|
|
17
|
+
case A:
|
|
18
|
+
case w:
|
|
19
|
+
case d:
|
|
20
|
+
case B:
|
|
21
|
+
case x:
|
|
22
|
+
case C:
|
|
23
|
+
case S:
|
|
24
|
+
case U:
|
|
25
|
+
case v:
|
|
26
|
+
return i(a, r);
|
|
27
|
+
case T:
|
|
28
|
+
return new e();
|
|
29
|
+
case b:
|
|
30
|
+
case y:
|
|
31
|
+
return new e(a);
|
|
32
|
+
case l:
|
|
33
|
+
return c(a);
|
|
34
|
+
case m:
|
|
35
|
+
return new e();
|
|
36
|
+
case f:
|
|
37
|
+
return g(a);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
R as default
|
|
42
|
+
};
|
package/index74.js
ADDED
package/index75.js
ADDED
package/index76.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import u from "./index41.js";
|
|
2
|
+
var r = Object.create, c = /* @__PURE__ */ function() {
|
|
3
|
+
function e() {
|
|
4
|
+
}
|
|
5
|
+
return function(t) {
|
|
6
|
+
if (!u(t))
|
|
7
|
+
return {};
|
|
8
|
+
if (r)
|
|
9
|
+
return r(t);
|
|
10
|
+
e.prototype = t;
|
|
11
|
+
var n = new e();
|
|
12
|
+
return e.prototype = void 0, n;
|
|
13
|
+
};
|
|
14
|
+
}();
|
|
15
|
+
export {
|
|
16
|
+
c as default
|
|
17
|
+
};
|
package/index77.js
ADDED
package/index78.js
ADDED
package/index79.js
ADDED
package/index8.js
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { defineComponent as H, ref as E, computed as J, watch as Q, onUnmounted as X, unref as Y, createElementVNode as Z, toDisplayString as ee, vShow as oe, withDirectives as te, normalizeClass as ne, createTextVNode as se, openBlock as ie, createElementBlock as re, renderList as ce, Fragment as le, withCtx as ae, createVNode as ue } from "vue";
|
|
2
|
+
import { isOpperDevice as de } from "@opper/core";
|
|
3
|
+
import { BluetoothLowEnergeDevice as pe } from "@opper/wx";
|
|
4
|
+
import { checkBluetooth as L, bluetoothService as f, vibrator as ve, overlay as r, withLoading as me } from "@solar-taro/core";
|
|
5
|
+
import { getSystemInfo as fe, openSetting as we } from "@tarojs/taro";
|
|
6
|
+
import { filter as he, switchMap as w, combineLatest as be, of as $, map as I, catchError as B, tap as V, timer as ge, takeUntil as D, finalize as O, from as ye } from "rxjs";
|
|
7
|
+
import { useObservable as A } from "./index26.js";
|
|
8
|
+
import _e from "./index6.js";
|
|
9
|
+
import { dialog as De } from "./index15.js";
|
|
10
|
+
import { useDestroyed as z } from "./index27.js";
|
|
11
|
+
const c = Y, t = Z, p = ee, ke = oe, Ce = te, j = ne, xe = se, h = ie, b = re, Se = ce, Ne = le, Ee = ae, $e = ue, Ie = { class: "sun-opper-controller" }, Be = ["show"], Oe = { key: 0 }, Te = { class: "sun-opper-controller-device" }, Me = { class: "sun-opper-controller-device-header" }, Pe = { class: "sun-opper-controller-device-name" }, Re = { class: "sun-opper-controller-device-infos" }, Le = { class: "sun-opper-controller-device-info" }, Ve = { class: "color-secondary" }, Ae = { class: "sun-opper-controller-device-info" }, ze = { class: "color-secondary" }, je = { class: "sun-opper-controller-device-info" }, Fe = { class: "color-secondary" }, Ue = { class: "sun-opper-controller-device-info" }, qe = { class: "color-secondary" }, Ke = { class: "van-button-container" }, We = { key: 1 }, Ge = ["title", "label", "onTap"], He = { class: "van-button-container" }, Je = ["show"], ro = /* @__PURE__ */ H({
|
|
12
|
+
__name: "index",
|
|
13
|
+
props: {
|
|
14
|
+
show: { type: Boolean, default: !1 },
|
|
15
|
+
autoconnect: {},
|
|
16
|
+
opper: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["update:show", "connect", "disconnect"],
|
|
19
|
+
setup(F, { emit: U }) {
|
|
20
|
+
const v = F, k = U, i = v.opper, C = z(), x = z(), a = E({}), u = E(!1), T = A(() => i.connected), g = E(!1), M = J(() => Object.values(a.value)), d = A(() => i.connected.pipe(
|
|
21
|
+
he(Boolean),
|
|
22
|
+
w(() => {
|
|
23
|
+
const n = i.device;
|
|
24
|
+
return be({
|
|
25
|
+
id: $(n.id),
|
|
26
|
+
name: n.name,
|
|
27
|
+
version: n.firmwareRevision,
|
|
28
|
+
accuracy: i.accuracyChange,
|
|
29
|
+
volt: i.batteryChange.pipe(
|
|
30
|
+
I(([e]) => e)
|
|
31
|
+
),
|
|
32
|
+
charging: i.batteryChange.pipe(
|
|
33
|
+
I(([, e]) => !!e)
|
|
34
|
+
),
|
|
35
|
+
serialNumber: n.serialNumber
|
|
36
|
+
});
|
|
37
|
+
})
|
|
38
|
+
), {}), q = [
|
|
39
|
+
{ id: 1, name: "断开连接" },
|
|
40
|
+
{ id: 2, name: "断开连接并关机", color: "var(--color-danger)" }
|
|
41
|
+
];
|
|
42
|
+
let S = !1;
|
|
43
|
+
function N() {
|
|
44
|
+
if (!L()) return;
|
|
45
|
+
let n = null;
|
|
46
|
+
u.value = !0, f.openAdapter().pipe(
|
|
47
|
+
B((e) => {
|
|
48
|
+
var o, l;
|
|
49
|
+
if ((l = (o = e.errMsg) == null ? void 0 : o.includes) != null && l.call(o, "already"))
|
|
50
|
+
return $(null);
|
|
51
|
+
throw e;
|
|
52
|
+
}),
|
|
53
|
+
w(
|
|
54
|
+
() => f.startDevicesDiscovery({
|
|
55
|
+
allowDuplicatesKey: !0,
|
|
56
|
+
powerLevel: "high"
|
|
57
|
+
})
|
|
58
|
+
),
|
|
59
|
+
V(
|
|
60
|
+
() => ge(0, 1250).pipe(
|
|
61
|
+
D(x)
|
|
62
|
+
).subscribe(() => ve.short())
|
|
63
|
+
),
|
|
64
|
+
w(() => f.devicesChange),
|
|
65
|
+
I((e) => e.filter((o) => de({
|
|
66
|
+
id: o.deviceId,
|
|
67
|
+
localName: o.localName,
|
|
68
|
+
name: o.name
|
|
69
|
+
}))),
|
|
70
|
+
D(x),
|
|
71
|
+
B((e) => {
|
|
72
|
+
var o, l, s;
|
|
73
|
+
throw e.errno === 103 ? r.modal("温馨提示", "请先授予小程序蓝牙与位置权限").then(() => {
|
|
74
|
+
we();
|
|
75
|
+
}) : (l = (o = e.errMsg) == null ? void 0 : o.includes) != null && l.call(o, "permission") ? r.tips("请先授予微信蓝牙与位置权限") : (s = e.errMsg) != null && s.includes("frequently") ? r.tips("操作频繁,请稍后再试") : r.tips(e.errMsg), m(), e;
|
|
76
|
+
}),
|
|
77
|
+
O(() => {
|
|
78
|
+
u.value = !1, a.value = {}, f.stopDevicesDiscovery().subscribe();
|
|
79
|
+
})
|
|
80
|
+
).subscribe((e) => {
|
|
81
|
+
const o = v.autoconnect;
|
|
82
|
+
if (o) {
|
|
83
|
+
const s = o.slice(-5).replace(":", ""), _ = e.find(
|
|
84
|
+
(R) => R.deviceId === v.autoconnect || // 由于 iOS 的 deviceId 不是 MAC,但是蓝牙名字上有 MAC 后四位,这里通过比对 MAC 来选择设备
|
|
85
|
+
R.name.endsWith(s)
|
|
86
|
+
);
|
|
87
|
+
if (_)
|
|
88
|
+
return y(_.deviceId);
|
|
89
|
+
}
|
|
90
|
+
if (e.length === 1) {
|
|
91
|
+
if (n != null || (n = Date.now()), Date.now() - n > 3e3)
|
|
92
|
+
return y(e[0].deviceId);
|
|
93
|
+
} else e.length > 1 && (n = null);
|
|
94
|
+
Object.keys(a.value).forEach((s) => {
|
|
95
|
+
a.value[s].recommended = !1, Date.now() - a.value[s].discoveryTime > 5e3 && delete a.value[s];
|
|
96
|
+
}), e.forEach((s) => {
|
|
97
|
+
a.value[s.deviceId] = s, s.discoveryTime = Date.now();
|
|
98
|
+
});
|
|
99
|
+
const l = [...Object.values(a.value)].sort((s, _) => _.RSSI - s.RSSI)[0];
|
|
100
|
+
l && (l.recommended = !0);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function m() {
|
|
104
|
+
x.next();
|
|
105
|
+
}
|
|
106
|
+
function y(n) {
|
|
107
|
+
S || (r.loading("正在连接"), S = !0, C.next(), i.connect(new pe(n)).pipe(
|
|
108
|
+
D(C),
|
|
109
|
+
O(() => S = !1)
|
|
110
|
+
).subscribe({
|
|
111
|
+
next: () => {
|
|
112
|
+
m();
|
|
113
|
+
},
|
|
114
|
+
error: (e) => {
|
|
115
|
+
e.errCode === 10003 ? r.tips("连接超时,请重试") : (r.tips(`连接失败,原因:${e.errCode}:${e.errMsg}`), console.error("连接失败", e));
|
|
116
|
+
}
|
|
117
|
+
}), i.device.connectedChange.pipe(
|
|
118
|
+
D(C)
|
|
119
|
+
).subscribe((e) => {
|
|
120
|
+
e ? (k("connect", n), setTimeout(P, 600)) : k("disconnect", n), e ? r.success("连接成功") : r.error("连接断开");
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
function K() {
|
|
124
|
+
L() && (u.value = !0, f.openAdapter().pipe(
|
|
125
|
+
O(() => {
|
|
126
|
+
u.value = !1;
|
|
127
|
+
})
|
|
128
|
+
).subscribe(() => {
|
|
129
|
+
y(v.autoconnect);
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
132
|
+
function W() {
|
|
133
|
+
i.disconnect().pipe(
|
|
134
|
+
me("正在断开")
|
|
135
|
+
).subscribe();
|
|
136
|
+
}
|
|
137
|
+
function G({ detail: n }) {
|
|
138
|
+
switch (n.id) {
|
|
139
|
+
case 1:
|
|
140
|
+
W();
|
|
141
|
+
break;
|
|
142
|
+
case 2:
|
|
143
|
+
ye(De.confirm("温馨提示", "您确定要关闭设备电源吗?")).pipe(
|
|
144
|
+
V(() => r.loading("正在关机")),
|
|
145
|
+
w(() => i.shutdown()),
|
|
146
|
+
B(() => $(null)),
|
|
147
|
+
// 关机后距离信号丢失还有一段时间,这里主动断开连接,改进用户体验
|
|
148
|
+
w(() => i.disconnect())
|
|
149
|
+
).subscribe(() => {
|
|
150
|
+
r.success("设备已关机");
|
|
151
|
+
});
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function P() {
|
|
156
|
+
k("update:show", !1);
|
|
157
|
+
}
|
|
158
|
+
return Q(() => v.show, async (n) => {
|
|
159
|
+
if (n) {
|
|
160
|
+
if (!T.value)
|
|
161
|
+
if (v.autoconnect) {
|
|
162
|
+
const { platform: e } = await fe();
|
|
163
|
+
e === "ios" ? N() : K();
|
|
164
|
+
} else
|
|
165
|
+
N();
|
|
166
|
+
} else
|
|
167
|
+
u.value && m();
|
|
168
|
+
}), X(() => {
|
|
169
|
+
m();
|
|
170
|
+
}), (n, e) => (h(), b("view", Ie, [
|
|
171
|
+
t("van-action-sheet", {
|
|
172
|
+
show: n.show,
|
|
173
|
+
title: "OPPER",
|
|
174
|
+
"close-on-click-overlay": !0,
|
|
175
|
+
onClose: e[2] || (e[2] = (o) => P())
|
|
176
|
+
}, [
|
|
177
|
+
c(T) ? (h(), b("block", Oe, [
|
|
178
|
+
t("view", Te, [
|
|
179
|
+
t("view", Me, [
|
|
180
|
+
e[7] || (e[7] = t("view", { class: "sun-opper-controller-device-title" }, "设备已连接", -1)),
|
|
181
|
+
t("view", Pe, [
|
|
182
|
+
xe(p(c(d).name || "OPPER") + " ", 1),
|
|
183
|
+
t("view", {
|
|
184
|
+
class: j(c(d).charging ? "color-success" : "color-primary")
|
|
185
|
+
}, [
|
|
186
|
+
e[6] || (e[6] = t("van-icon", {
|
|
187
|
+
"class-prefix": "iconfont",
|
|
188
|
+
name: "lightning"
|
|
189
|
+
}, null, -1)),
|
|
190
|
+
Ce(t("text", null, p(c(d).volt) + "%", 513), [
|
|
191
|
+
[ke, c(d).volt]
|
|
192
|
+
])
|
|
193
|
+
], 2)
|
|
194
|
+
])
|
|
195
|
+
]),
|
|
196
|
+
t("view", Re, [
|
|
197
|
+
t("view", Le, [
|
|
198
|
+
e[8] || (e[8] = t("view", { class: "color-gray" }, "设备号", -1)),
|
|
199
|
+
t("view", Ve, p(c(d).id), 1)
|
|
200
|
+
]),
|
|
201
|
+
t("view", Ae, [
|
|
202
|
+
e[9] || (e[9] = t("view", { class: "color-gray" }, "秤台精度", -1)),
|
|
203
|
+
t("view", ze, p(c(d).accuracy || 1) + "克", 1)
|
|
204
|
+
]),
|
|
205
|
+
t("view", je, [
|
|
206
|
+
e[10] || (e[10] = t("view", { class: "color-gray" }, "固件版本", -1)),
|
|
207
|
+
t("view", Fe, p(c(d).version), 1)
|
|
208
|
+
]),
|
|
209
|
+
t("view", Ue, [
|
|
210
|
+
e[11] || (e[11] = t("view", { class: "color-gray" }, "序列号", -1)),
|
|
211
|
+
t("view", qe, p(c(d).serialNumber), 1)
|
|
212
|
+
])
|
|
213
|
+
])
|
|
214
|
+
]),
|
|
215
|
+
t("view", Ke, [
|
|
216
|
+
t("van-button", {
|
|
217
|
+
type: "danger",
|
|
218
|
+
round: "true",
|
|
219
|
+
block: "true",
|
|
220
|
+
onTap: e[0] || (e[0] = (o) => g.value = !0)
|
|
221
|
+
}, " 断开连接 ", 32)
|
|
222
|
+
])
|
|
223
|
+
])) : (h(), b("block", We, [
|
|
224
|
+
$e(c(_e), {
|
|
225
|
+
class: "sun-opper-controller-device-list",
|
|
226
|
+
refresher: !1,
|
|
227
|
+
data: M.value,
|
|
228
|
+
loading: u.value,
|
|
229
|
+
"loading-text": "正在扫描",
|
|
230
|
+
"empty-type": "search",
|
|
231
|
+
"empty-text": "暂无设备"
|
|
232
|
+
}, {
|
|
233
|
+
default: Ee(() => [
|
|
234
|
+
(h(!0), b(Ne, null, Se(M.value, (o) => (h(), b("van-cell", {
|
|
235
|
+
key: o.deviceId,
|
|
236
|
+
title: o.localName || o.name,
|
|
237
|
+
label: o.deviceId,
|
|
238
|
+
size: "large",
|
|
239
|
+
clickable: !0,
|
|
240
|
+
onTap: (l) => y(o.deviceId)
|
|
241
|
+
}, [
|
|
242
|
+
t("text", {
|
|
243
|
+
class: j({ "color-success": o.recommended })
|
|
244
|
+
}, p(o.RSSI) + "dBm", 3)
|
|
245
|
+
], 40, Ge))), 128))
|
|
246
|
+
]),
|
|
247
|
+
_: 1
|
|
248
|
+
}, 8, ["data", "loading"]),
|
|
249
|
+
t("view", He, [
|
|
250
|
+
t("van-button", {
|
|
251
|
+
type: "primary",
|
|
252
|
+
round: "true",
|
|
253
|
+
block: "true",
|
|
254
|
+
onTap: e[1] || (e[1] = (o) => u.value ? m() : N())
|
|
255
|
+
}, p(u.value ? "停止扫描" : "扫描 OPPER 设备"), 33)
|
|
256
|
+
])
|
|
257
|
+
]))
|
|
258
|
+
], 40, Be),
|
|
259
|
+
t("van-action-sheet", {
|
|
260
|
+
show: g.value,
|
|
261
|
+
actions: q,
|
|
262
|
+
"cancel-text": "取消",
|
|
263
|
+
onSelect: e[3] || (e[3] = (o) => G(o)),
|
|
264
|
+
onCancel: e[4] || (e[4] = (o) => g.value = !1),
|
|
265
|
+
onClose: e[5] || (e[5] = (o) => g.value = !1)
|
|
266
|
+
}, null, 40, Je)
|
|
267
|
+
]));
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
export {
|
|
271
|
+
ro as default
|
|
272
|
+
};
|
package/index80.js
ADDED
package/index81.js
ADDED
package/index82.js
ADDED
package/index83.js
ADDED
package/index84.js
ADDED
package/index85.js
ADDED
package/index86.js
ADDED
package/index87.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import e from "./index86.js";
|
|
2
|
+
var o = Object.prototype, c = o.hasOwnProperty, f = o.toString, r = e ? e.toStringTag : void 0;
|
|
3
|
+
function p(t) {
|
|
4
|
+
var a = c.call(t, r), n = t[r];
|
|
5
|
+
try {
|
|
6
|
+
t[r] = void 0;
|
|
7
|
+
var i = !0;
|
|
8
|
+
} catch {
|
|
9
|
+
}
|
|
10
|
+
var g = f.call(t);
|
|
11
|
+
return i && (a ? t[r] = n : delete t[r]), g;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
p as default
|
|
15
|
+
};
|
package/index88.js
ADDED
package/index89.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import o from "./index35.js";
|
|
2
|
+
import e from "./index90.js";
|
|
3
|
+
import a from "./index41.js";
|
|
4
|
+
import n from "./index85.js";
|
|
5
|
+
var p = /[\\^$.*+?()[\]{}|]/g, i = /^\[object .+?Constructor\]$/, s = Function.prototype, c = Object.prototype, f = s.toString, m = c.hasOwnProperty, u = RegExp(
|
|
6
|
+
"^" + f.call(m).replace(p, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
7
|
+
);
|
|
8
|
+
function O(r) {
|
|
9
|
+
if (!a(r) || e(r))
|
|
10
|
+
return !1;
|
|
11
|
+
var t = o(r) ? u : i;
|
|
12
|
+
return t.test(n(r));
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
O as default
|
|
16
|
+
};
|
package/index9.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { defineComponent as v, computed as y, unref as h, mergeProps as w, createElementVNode as k, openBlock as C, createElementBlock as V, createCommentVNode as g } from "vue";
|
|
2
|
+
import { useFilterList as B } from "@solar-taro/core";
|
|
3
|
+
const b = h, K = w, N = k, u = C, r = V, E = g, L = ["show"], $ = ["title", "value-key", "columns", "loading", "default-index"], A = /* @__PURE__ */ v({
|
|
4
|
+
inheritAttrs: !1,
|
|
5
|
+
__name: "index",
|
|
6
|
+
props: {
|
|
7
|
+
show: { type: Boolean },
|
|
8
|
+
labelKey: { default: "fullName" },
|
|
9
|
+
valueKey: { default: "id" },
|
|
10
|
+
searchable: { type: Boolean, default: !0 },
|
|
11
|
+
title: {},
|
|
12
|
+
loading: { type: Boolean },
|
|
13
|
+
options: {},
|
|
14
|
+
modelValue: {},
|
|
15
|
+
required: { type: Boolean }
|
|
16
|
+
},
|
|
17
|
+
emits: ["close", "cancel", "confirm", "update:show", "update:modelValue"],
|
|
18
|
+
setup(s, { emit: i }) {
|
|
19
|
+
const n = i, l = s, d = y(() => {
|
|
20
|
+
var e;
|
|
21
|
+
return (e = l.options.findIndex((o) => o[l.valueKey] === l.modelValue)) != null ? e : 0;
|
|
22
|
+
}), { keyword: p, filteredList: m } = B(
|
|
23
|
+
() => l.options,
|
|
24
|
+
(e, o) => e[l.labelKey].toLowerCase().includes(o.value.toLowerCase())
|
|
25
|
+
);
|
|
26
|
+
function c() {
|
|
27
|
+
l.required || n("update:modelValue", null), n("cancel", l.modelValue), a();
|
|
28
|
+
}
|
|
29
|
+
function a() {
|
|
30
|
+
n("update:show", !1), n("close");
|
|
31
|
+
}
|
|
32
|
+
function f({ detail: e }) {
|
|
33
|
+
n("update:modelValue", e.value[l.valueKey]), n("confirm", e.value), n("update:show", !1);
|
|
34
|
+
}
|
|
35
|
+
return (e, o) => (u(), r("van-popup", {
|
|
36
|
+
show: e.show,
|
|
37
|
+
position: "bottom",
|
|
38
|
+
round: !0,
|
|
39
|
+
"close-on-click-overlay": !0,
|
|
40
|
+
onClose: o[3] || (o[3] = (t) => a())
|
|
41
|
+
}, [
|
|
42
|
+
N("van-picker", K(e.$attrs, {
|
|
43
|
+
title: e.title,
|
|
44
|
+
"show-toolbar": !0,
|
|
45
|
+
"value-key": e.labelKey,
|
|
46
|
+
columns: b(m),
|
|
47
|
+
loading: e.loading,
|
|
48
|
+
"default-index": d.value,
|
|
49
|
+
onCancel: o[0] || (o[0] = (t) => c()),
|
|
50
|
+
onConfirm: o[1] || (o[1] = (t) => f(t))
|
|
51
|
+
}), null, 16, $),
|
|
52
|
+
e.searchable && e.options.length ? (u(), r("van-search", {
|
|
53
|
+
key: 0,
|
|
54
|
+
shape: "round",
|
|
55
|
+
"input-align": "center",
|
|
56
|
+
placeholder: "请输入搜索关键词",
|
|
57
|
+
onChange: o[2] || (o[2] = (t) => p.value = t.detail)
|
|
58
|
+
}, null, 32)) : E("", !0)
|
|
59
|
+
], 40, L));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
A as default
|
|
64
|
+
};
|
package/index90.js
ADDED
package/index91.js
ADDED