@ditari/bsui 1.0.54 → 1.0.55
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/dist/cjs/components/components.cjs.js +1 -1
- package/dist/cjs/components/components.d.ts +0 -16
- package/dist/cjs/components/dic/DicReplace.cjs.js +1 -1
- package/dist/cjs/components/index.cjs.js +1 -1
- package/dist/cjs/components/select/Select.vue.cjs.js +1 -1
- package/dist/esm/components/components.d.ts +0 -16
- package/dist/esm/components/components.esm.js +19 -24
- package/dist/esm/components/dic/DicReplace.esm.js +10 -18
- package/dist/esm/components/index.esm.js +36 -45
- package/dist/esm/components/select/Select.vue.esm.js +42 -51
- package/package.json +1 -1
- package/src/components/components.ts +0 -6
- package/src/components/dic/DicReplace.tsx +15 -14
- package/src/components/index.ts +12 -13
- package/src/components/select/Select.vue +33 -32
- package/dist/cjs/components/dic/replace.worker.cjs.js +0 -1
- package/dist/cjs/components/select/DemoSelect.vue.cjs.js +0 -1
- package/dist/cjs/components/select/DemoSelect.vue.cjs2.js +0 -1
- package/dist/cjs/components/select/DemoSelect.vue.d.ts +0 -17
- package/dist/cjs/components/select/dic.worker.cjs.js +0 -1
- package/dist/cjs/components/worker-pool.cjs.js +0 -1
- package/dist/esm/components/dic/replace.worker.esm.js +0 -12
- package/dist/esm/components/select/DemoSelect.vue.d.ts +0 -17
- package/dist/esm/components/select/DemoSelect.vue.esm.js +0 -29
- package/dist/esm/components/select/DemoSelect.vue.esm2.js +0 -4
- package/dist/esm/components/select/dic.worker.esm.js +0 -12
- package/dist/esm/components/worker-pool.esm.js +0 -29
- package/src/components/select/DemoSelect.vue +0 -49
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("./form/index.cjs.js"),e=require("./layout/index.cjs.js"),r=require("./table/index.cjs.js"),i=require("./grid/index.cjs.js"),t=require("./select/index.cjs.js"),n=require("./desensitize/index.cjs.js"),s=require("./dic/index.cjs.js"),d=require("./modal/index.cjs.js");exports.DForm=D.default;exports.DList=e.DList;exports.DMain=e.DMain;exports.DNavTabs=e.DNavTabs;exports.DShow=e.DShow;exports.DTable=r.DTable;exports.DGrid=i.DGrid;exports.DGridItem=i.DGridItem;exports.DSelect=t.DSelect;exports.DDesensitize=n.DDesensitize;exports.DicReplace=s.DDicReplace;exports.DModal=d.DModal;
|
|
@@ -6,19 +6,3 @@ export { default as DSelect } from "./select";
|
|
|
6
6
|
export { default as DDesensitize } from "./desensitize";
|
|
7
7
|
export { default as DicReplace } from "./dic";
|
|
8
8
|
export { default as DModal } from "./modal";
|
|
9
|
-
export declare const DemoSelect: import("../utils/install").SFCWithInstall<import("vue").DefineComponent<{
|
|
10
|
-
name: {
|
|
11
|
-
type: import("vue").PropType<string>;
|
|
12
|
-
required: true;
|
|
13
|
-
default: string;
|
|
14
|
-
};
|
|
15
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
-
name: {
|
|
17
|
-
type: import("vue").PropType<string>;
|
|
18
|
-
required: true;
|
|
19
|
-
default: string;
|
|
20
|
-
};
|
|
21
|
-
}>>, {
|
|
22
|
-
name: string;
|
|
23
|
-
}>>;
|
|
24
|
-
export default DemoSelect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("../../store/modules/DataDictionary.cjs.js"),r=e.defineComponent({name:"DicReplace",props:{name:{type:String,default:""},value:{type:String,default:""}},setup(t){const{getDicTextByValue:u}=l.useDataDicStore(),a=e.ref("");return e.watchEffect(()=>{const n=t.value,c=t.name;a.value=u(c,n)}),()=>e.createVNode(e.Fragment,null,[a.value])}});exports.default=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("pinia"),D=require("pinia-plugin-persistedstate"),d=require("./components.cjs.js"),l=require("../directive/trim.cjs.js"),q=require("./table/index.cjs.js"),m=require("./select/index.cjs.js"),x=require("./desensitize/index.cjs.js"),$=require("./dic/index.cjs.js"),S=require("./modal/index.cjs.js"),b=require("./form/index.cjs.js"),r=require("./grid/index.cjs.js"),i=require("./layout/index.cjs.js"),s=d,o=function(e,c){Object.keys(s).forEach(a=>{const n=s[a];n.install&&e.use(n)});const t=u.createPinia();t.use(D.createPersistedState({storage:sessionStorage})),e.use(t),e.directive("trim",l.default),e.provide("menuIcon",c.menuIcon||{})},f={install:o};exports.DTable=q.DTable;exports.DSelect=m.DSelect;exports.DDesensitize=x.DDesensitize;exports.DicReplace=$.DDicReplace;exports.DModal=S.DModal;exports.DForm=b.default;exports.DGrid=r.DGrid;exports.DGridItem=r.DGridItem;exports.DList=i.DList;exports.DMain=i.DMain;exports.DNavTabs=i.DNavTabs;exports.DShow=i.DShow;exports.default=f;exports.install=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("../../store/modules/DataDictionary.cjs.js"),L={name:"DSelect"},w=e.defineComponent({...L,props:{value:{default:null},name:{default:""},disabled:{type:Boolean,default:!1},placeholder:{default:"请填写默认占位符啊!老铁"},include:{default:[]}},emits:["update:value","change","select"],setup(u,{emit:o}){const t=u,{getDicByKey:f}=_.useDataDicStore(),{modelValue:r,data:v,onSearch:h,onSelect:p,onChange:S}=g();function g(){const s=[...f(t.name)],n=e.ref([]),l=e.ref(t.value);e.watch(()=>t.include,()=>{i(l.value)}),e.watch(()=>t.value,a=>{l.value=a}),i(l.value);const d=a=>{i(a)};function i(a){a=a.trim(),n.value=s.filter(c=>c.value.toLowerCase().indexOf(a.toLowerCase())!==-1||c.label.toLowerCase().includes(a.toLowerCase())).splice(0,10),n.value.length===0&&(n.value=[...s].splice(0,10))}const m=a=>{o("update:value",a),b()},C=()=>{o("update:value",l.value),o("change",l.value)};function b(){const c=f(t.name).find(D=>D.value===l.value);o("select",c)}return{data:n,modelValue:l,onSearch:d,onSelect:m,onChange:C}}return(s,n)=>{const l=e.resolveComponent("a-select");return e.openBlock(),e.createBlock(l,{value:e.unref(r),"onUpdate:value":n[0]||(n[0]=d=>e.isRef(r)?r.value=d:null),"allow-clear":"","show-search":"","filter-option":!1,options:e.unref(v),placeholder:u.placeholder,disabled:u.disabled,onSelect:e.unref(p),onSearch:e.unref(h),onChange:e.unref(S)},null,8,["value","options","placeholder","disabled","onSelect","onSearch","onChange"])}}});exports.default=w;
|
|
@@ -6,19 +6,3 @@ export { default as DSelect } from "./select";
|
|
|
6
6
|
export { default as DDesensitize } from "./desensitize";
|
|
7
7
|
export { default as DicReplace } from "./dic";
|
|
8
8
|
export { default as DModal } from "./modal";
|
|
9
|
-
export declare const DemoSelect: import("../utils/install").SFCWithInstall<import("vue").DefineComponent<{
|
|
10
|
-
name: {
|
|
11
|
-
type: import("vue").PropType<string>;
|
|
12
|
-
required: true;
|
|
13
|
-
default: string;
|
|
14
|
-
};
|
|
15
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
-
name: {
|
|
17
|
-
type: import("vue").PropType<string>;
|
|
18
|
-
required: true;
|
|
19
|
-
default: string;
|
|
20
|
-
};
|
|
21
|
-
}>>, {
|
|
22
|
-
name: string;
|
|
23
|
-
}>>;
|
|
24
|
-
export default DemoSelect;
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { DDesensitize as G } from "./desensitize/index.esm.js";
|
|
1
|
+
import { default as r } from "./form/index.esm.js";
|
|
2
|
+
import { DList as t, DMain as a, DNavTabs as m, DShow as p } from "./layout/index.esm.js";
|
|
3
|
+
import { DTable as i } from "./table/index.esm.js";
|
|
4
|
+
import { DGrid as l, DGridItem as s } from "./grid/index.esm.js";
|
|
5
|
+
import { DSelect as d } from "./select/index.esm.js";
|
|
6
|
+
import { DDesensitize as n } from "./desensitize/index.esm.js";
|
|
8
7
|
import { DDicReplace as M } from "./dic/index.esm.js";
|
|
9
|
-
import { DModal as
|
|
10
|
-
import e from "./select/DemoSelect.vue.esm.js";
|
|
11
|
-
const m = o(e);
|
|
8
|
+
import { DModal as S } from "./modal/index.esm.js";
|
|
12
9
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
M as DicReplace,
|
|
26
|
-
m as default
|
|
10
|
+
n as DDesensitize,
|
|
11
|
+
r as DForm,
|
|
12
|
+
l as DGrid,
|
|
13
|
+
s as DGridItem,
|
|
14
|
+
t as DList,
|
|
15
|
+
a as DMain,
|
|
16
|
+
S as DModal,
|
|
17
|
+
m as DNavTabs,
|
|
18
|
+
d as DSelect,
|
|
19
|
+
p as DShow,
|
|
20
|
+
i as DTable,
|
|
21
|
+
M as DicReplace
|
|
27
22
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as l, ref as o, watchEffect as u, createVNode as r, Fragment as i } from "vue";
|
|
2
2
|
import { useDataDicStore as m } from "../../store/modules/DataDictionary.esm.js";
|
|
3
|
-
const
|
|
3
|
+
const s = /* @__PURE__ */ l({
|
|
4
4
|
name: "DicReplace",
|
|
5
5
|
props: {
|
|
6
6
|
// 字典名称
|
|
@@ -14,24 +14,16 @@ const v = /* @__PURE__ */ c({
|
|
|
14
14
|
default: ""
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
-
setup(
|
|
17
|
+
setup(e) {
|
|
18
18
|
const {
|
|
19
|
-
|
|
20
|
-
} = m(),
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, i(() => {
|
|
26
|
-
const t = o.value, l = o.name;
|
|
27
|
-
e.postMessage({
|
|
28
|
-
list: JSON.stringify(n),
|
|
29
|
-
name: l,
|
|
30
|
-
value: t
|
|
31
|
-
});
|
|
32
|
-
}), () => p(f, null, [r.value]);
|
|
19
|
+
getDicTextByValue: a
|
|
20
|
+
} = m(), t = o("");
|
|
21
|
+
return u(() => {
|
|
22
|
+
const n = e.value, c = e.name;
|
|
23
|
+
t.value = a(c, n);
|
|
24
|
+
}), () => r(i, null, [t.value]);
|
|
33
25
|
}
|
|
34
26
|
});
|
|
35
27
|
export {
|
|
36
|
-
|
|
28
|
+
s as default
|
|
37
29
|
};
|
|
@@ -1,51 +1,42 @@
|
|
|
1
|
-
import { createPinia as
|
|
2
|
-
import { createPersistedState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const n = D, x = function(o, s) {
|
|
18
|
-
Object.keys(n).forEach((c) => {
|
|
19
|
-
const i = n[c];
|
|
20
|
-
i.install && o.use(i);
|
|
1
|
+
import { createPinia as m } from "pinia";
|
|
2
|
+
import { createPersistedState as n } from "pinia-plugin-persistedstate";
|
|
3
|
+
import * as c from "./components.esm.js";
|
|
4
|
+
import a from "../directive/trim.esm.js";
|
|
5
|
+
import { DTable as v } from "./table/index.esm.js";
|
|
6
|
+
import { DSelect as b } from "./select/index.esm.js";
|
|
7
|
+
import { DDesensitize as T } from "./desensitize/index.esm.js";
|
|
8
|
+
import { DDicReplace as h } from "./dic/index.esm.js";
|
|
9
|
+
import { DModal as M } from "./modal/index.esm.js";
|
|
10
|
+
import { default as R } from "./form/index.esm.js";
|
|
11
|
+
import { DGrid as k, DGridItem as w } from "./grid/index.esm.js";
|
|
12
|
+
import { DList as z, DMain as E, DNavTabs as F, DShow as L } from "./layout/index.esm.js";
|
|
13
|
+
const r = c, f = function(e, i) {
|
|
14
|
+
Object.keys(r).forEach((s) => {
|
|
15
|
+
const t = r[s];
|
|
16
|
+
t.install && e.use(t);
|
|
21
17
|
});
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
const o = m();
|
|
19
|
+
o.use(
|
|
20
|
+
n({
|
|
25
21
|
storage: sessionStorage
|
|
26
22
|
})
|
|
27
|
-
),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const t = new m(p, 2);
|
|
31
|
-
t.initialize(), o.provide("repWorkerPool", t);
|
|
32
|
-
}, w = {
|
|
33
|
-
install: x
|
|
23
|
+
), e.use(o), e.directive("trim", a), e.provide("menuIcon", i.menuIcon || {});
|
|
24
|
+
}, x = {
|
|
25
|
+
install: f
|
|
34
26
|
};
|
|
35
27
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
x as install
|
|
28
|
+
T as DDesensitize,
|
|
29
|
+
R as DForm,
|
|
30
|
+
k as DGrid,
|
|
31
|
+
w as DGridItem,
|
|
32
|
+
z as DList,
|
|
33
|
+
E as DMain,
|
|
34
|
+
M as DModal,
|
|
35
|
+
F as DNavTabs,
|
|
36
|
+
b as DSelect,
|
|
37
|
+
L as DShow,
|
|
38
|
+
v as DTable,
|
|
39
|
+
h as DicReplace,
|
|
40
|
+
x as default,
|
|
41
|
+
f as install
|
|
51
42
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useDataDicStore as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as w, ref as p, watch as v, resolveComponent as B, openBlock as x, createBlock as V, unref as o, isRef as H } from "vue";
|
|
2
|
+
import { useDataDicStore as K } from "../../store/modules/DataDictionary.esm.js";
|
|
3
|
+
const O = {
|
|
4
4
|
name: "DSelect"
|
|
5
|
-
},
|
|
6
|
-
...
|
|
5
|
+
}, W = /* @__PURE__ */ w({
|
|
6
|
+
...O,
|
|
7
7
|
props: {
|
|
8
8
|
value: { default: null },
|
|
9
9
|
name: { default: "" },
|
|
@@ -12,71 +12,62 @@ const N = {
|
|
|
12
12
|
include: { default: [] }
|
|
13
13
|
},
|
|
14
14
|
emits: ["update:value", "change", "select"],
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
i = !1, o = p(l.name);
|
|
22
|
-
}, u.onmessage = (e) => {
|
|
23
|
-
n.value = e.data;
|
|
24
|
-
}, h(
|
|
25
|
-
() => l.include,
|
|
15
|
+
setup(u, { emit: t }) {
|
|
16
|
+
const n = u, { getDicByKey: f } = K(), { modelValue: s, data: h, onSearch: S, onSelect: m, onChange: C } = g();
|
|
17
|
+
function g() {
|
|
18
|
+
const r = [...f(n.name)], l = p([]), a = p(n.value);
|
|
19
|
+
v(
|
|
20
|
+
() => n.include,
|
|
26
21
|
() => {
|
|
27
|
-
|
|
22
|
+
i(a.value);
|
|
28
23
|
}
|
|
29
|
-
),
|
|
30
|
-
() =>
|
|
24
|
+
), v(
|
|
25
|
+
() => n.value,
|
|
31
26
|
(e) => {
|
|
32
27
|
a.value = e;
|
|
33
28
|
}
|
|
34
|
-
),
|
|
35
|
-
const
|
|
36
|
-
i
|
|
29
|
+
), i(a.value);
|
|
30
|
+
const d = (e) => {
|
|
31
|
+
i(e);
|
|
37
32
|
};
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
list: JSON.stringify(S[l.name]),
|
|
41
|
-
keywords: e,
|
|
42
|
-
include: JSON.stringify(l.include ?? [])
|
|
43
|
-
});
|
|
33
|
+
function i(e) {
|
|
34
|
+
e = e.trim(), l.value = r.filter((c) => c.value.toLowerCase().indexOf(e.toLowerCase()) !== -1 || c.label.toLowerCase().includes(e.toLowerCase())).splice(0, 10), l.value.length === 0 && (l.value = [...r].splice(0, 10));
|
|
44
35
|
}
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
36
|
+
const L = (e) => {
|
|
37
|
+
t("update:value", e), D();
|
|
38
|
+
}, b = () => {
|
|
39
|
+
t("update:value", a.value), t("change", a.value);
|
|
49
40
|
};
|
|
50
|
-
function
|
|
51
|
-
const
|
|
52
|
-
|
|
41
|
+
function D() {
|
|
42
|
+
const c = f(n.name).find((_) => _.value === a.value);
|
|
43
|
+
t("select", c);
|
|
53
44
|
}
|
|
54
45
|
return {
|
|
55
|
-
data:
|
|
46
|
+
data: l,
|
|
56
47
|
modelValue: a,
|
|
57
|
-
onSearch:
|
|
58
|
-
onSelect:
|
|
59
|
-
onChange:
|
|
48
|
+
onSearch: d,
|
|
49
|
+
onSelect: L,
|
|
50
|
+
onChange: b
|
|
60
51
|
};
|
|
61
52
|
}
|
|
62
|
-
return (
|
|
63
|
-
const
|
|
64
|
-
return
|
|
65
|
-
value:
|
|
66
|
-
"onUpdate:value":
|
|
53
|
+
return (r, l) => {
|
|
54
|
+
const a = B("a-select");
|
|
55
|
+
return x(), V(a, {
|
|
56
|
+
value: o(s),
|
|
57
|
+
"onUpdate:value": l[0] || (l[0] = (d) => H(s) ? s.value = d : null),
|
|
67
58
|
"allow-clear": "",
|
|
68
59
|
"show-search": "",
|
|
69
60
|
"filter-option": !1,
|
|
70
|
-
options:
|
|
71
|
-
placeholder:
|
|
72
|
-
disabled:
|
|
73
|
-
onSelect:
|
|
74
|
-
onSearch:
|
|
75
|
-
onChange:
|
|
61
|
+
options: o(h),
|
|
62
|
+
placeholder: u.placeholder,
|
|
63
|
+
disabled: u.disabled,
|
|
64
|
+
onSelect: o(m),
|
|
65
|
+
onSearch: o(S),
|
|
66
|
+
onChange: o(C)
|
|
76
67
|
}, null, 8, ["value", "options", "placeholder", "disabled", "onSelect", "onSearch", "onChange"]);
|
|
77
68
|
};
|
|
78
69
|
}
|
|
79
70
|
});
|
|
80
71
|
export {
|
|
81
|
-
|
|
72
|
+
W as default
|
|
82
73
|
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { withInstall } from "../utils";
|
|
2
|
-
|
|
3
1
|
export { default as DForm } from "./form";
|
|
4
2
|
export * from "./layout";
|
|
5
3
|
export { default as DTable } from "./table";
|
|
@@ -8,7 +6,3 @@ export { default as DSelect } from "./select";
|
|
|
8
6
|
export { default as DDesensitize } from "./desensitize";
|
|
9
7
|
export { default as DicReplace } from "./dic";
|
|
10
8
|
export { default as DModal } from "./modal";
|
|
11
|
-
|
|
12
|
-
import Select from "./select/DemoSelect.vue";
|
|
13
|
-
export const DemoSelect = withInstall(Select);
|
|
14
|
-
export default DemoSelect;
|
|
@@ -24,31 +24,32 @@ export default defineComponent({
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
setup(props) {
|
|
27
|
-
const {
|
|
28
|
-
|
|
29
|
-
const workerStatus = ref(true);
|
|
27
|
+
const { getDicTextByValue } = useDataDicStore();
|
|
28
|
+
//TODO 使用webworker存在一定的问题
|
|
29
|
+
//const workerStatus = ref(true);
|
|
30
30
|
const dicValueTxt = ref<any>("");
|
|
31
|
-
const repWorkerPool: any = inject("repWorkerPool");
|
|
32
|
-
// 获取worker
|
|
33
|
-
const workerInstance: any = repWorkerPool.getWorker();
|
|
31
|
+
// const repWorkerPool: any = inject("repWorkerPool");
|
|
32
|
+
// // 获取worker
|
|
33
|
+
// const workerInstance: any = repWorkerPool.getWorker();
|
|
34
34
|
/**
|
|
35
35
|
* web worker 启动失败
|
|
36
36
|
*/
|
|
37
|
-
workerInstance.onerror = () => {
|
|
38
|
-
|
|
39
|
-
};
|
|
37
|
+
// workerInstance.onerror = () => {
|
|
38
|
+
// workerStatus.value = false;
|
|
39
|
+
// };
|
|
40
40
|
/**
|
|
41
41
|
* 监听web worker发送的数据
|
|
42
42
|
* @param e
|
|
43
43
|
*/
|
|
44
|
-
workerInstance.onmessage = (e: any) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
44
|
+
// workerInstance.onmessage = (e: any) => {
|
|
45
|
+
// // 赋值给下拉选择数据变量
|
|
46
|
+
// dicValueTxt.value = e.data;
|
|
47
|
+
// };
|
|
48
48
|
watchEffect(() => {
|
|
49
49
|
const value = props.value;
|
|
50
50
|
const name = props.name;
|
|
51
|
-
|
|
51
|
+
dicValueTxt.value = getDicTextByValue(name, value);
|
|
52
|
+
// workerInstance.postMessage({ list: JSON.stringify(list), name, value });
|
|
52
53
|
});
|
|
53
54
|
|
|
54
55
|
return () => <>{dicValueTxt.value}</>;
|
package/src/components/index.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { createPinia } from "pinia";
|
|
|
3
3
|
import { createPersistedState } from "pinia-plugin-persistedstate";
|
|
4
4
|
import WorkerPool from "./worker-pool";
|
|
5
5
|
|
|
6
|
-
import ReplaceWorker from "./dic/replace.worker?worker&inline";
|
|
7
|
-
import DicWorker from "./select/dic.worker?worker&inline";
|
|
6
|
+
// import ReplaceWorker from "./dic/replace.worker?worker&inline";
|
|
7
|
+
// import DicWorker from "./select/dic.worker?worker&inline";
|
|
8
8
|
|
|
9
9
|
import * as components from "./components";
|
|
10
10
|
export * from "./components";
|
|
@@ -40,17 +40,16 @@ export const install = function (app: App, opts: Options) {
|
|
|
40
40
|
app.directive("trim", vTrim);
|
|
41
41
|
app.provide("menuIcon", opts.menuIcon || {});
|
|
42
42
|
|
|
43
|
-
// 创建 Web Worker 连接池实例
|
|
44
|
-
const workerPool = new WorkerPool(DicWorker, 2); // 这里设置连接池的大小为 5
|
|
45
|
-
workerPool.initialize();
|
|
46
|
-
// 注入连接池实例
|
|
47
|
-
app.provide("dicWorkerPool", workerPool);
|
|
48
|
-
// 创建 Web Worker 连接池实例
|
|
49
|
-
const repWorkerPool = new WorkerPool(ReplaceWorker, 2); // 这里设置连接池的大小为 5
|
|
50
|
-
repWorkerPool.initialize();
|
|
51
|
-
// 注入连接池实例
|
|
52
|
-
app.provide("repWorkerPool", repWorkerPool);
|
|
53
|
-
|
|
43
|
+
// // 创建 Web Worker 连接池实例
|
|
44
|
+
// const workerPool = new WorkerPool(DicWorker, 2); // 这里设置连接池的大小为 5
|
|
45
|
+
// workerPool.initialize();
|
|
46
|
+
// // 注入连接池实例
|
|
47
|
+
// app.provide("dicWorkerPool", workerPool);
|
|
48
|
+
// // 创建 Web Worker 连接池实例
|
|
49
|
+
// const repWorkerPool = new WorkerPool(ReplaceWorker, 2); // 这里设置连接池的大小为 5
|
|
50
|
+
// repWorkerPool.initialize();
|
|
51
|
+
// // 注入连接池实例
|
|
52
|
+
// app.provide("repWorkerPool", repWorkerPool);
|
|
54
53
|
};
|
|
55
54
|
|
|
56
55
|
export default {
|
|
@@ -28,18 +28,18 @@ interface Emits {
|
|
|
28
28
|
}
|
|
29
29
|
const emits = defineEmits<Emits>();
|
|
30
30
|
|
|
31
|
-
const { getDicByKey
|
|
31
|
+
const { getDicByKey } = useDataDicStore();
|
|
32
32
|
|
|
33
|
-
const workerPool: any = inject("dicWorkerPool");
|
|
34
|
-
// 获取worker
|
|
35
|
-
const workerInstance: any = workerPool.getWorker();
|
|
33
|
+
// const workerPool: any = inject("dicWorkerPool");
|
|
34
|
+
// // 获取worker
|
|
35
|
+
// const workerInstance: any = workerPool.getWorker();
|
|
36
36
|
|
|
37
37
|
const { modelValue, data, onSearch, onSelect, onChange } = useSelect();
|
|
38
38
|
|
|
39
39
|
function useSelect() {
|
|
40
40
|
// 保存worker启动状态
|
|
41
|
-
let workerStatus = true;
|
|
42
|
-
|
|
41
|
+
// let workerStatus = true;
|
|
42
|
+
const dicData: any[] = [...getDicByKey(props.name)];
|
|
43
43
|
const data = ref<any>([]);
|
|
44
44
|
// 取值
|
|
45
45
|
const modelValue = ref(props.value);
|
|
@@ -47,19 +47,19 @@ function useSelect() {
|
|
|
47
47
|
/**
|
|
48
48
|
* web worker 启动失败
|
|
49
49
|
*/
|
|
50
|
-
workerInstance.onerror = () => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
};
|
|
50
|
+
// workerInstance.onerror = () => {
|
|
51
|
+
// workerStatus = false;
|
|
52
|
+
// // 启动失败使用store
|
|
53
|
+
// dicData = getDicByKey(props.name);
|
|
54
|
+
// };
|
|
55
55
|
/**
|
|
56
56
|
* 监听web worker发送的数据
|
|
57
57
|
* @param e
|
|
58
58
|
*/
|
|
59
|
-
workerInstance.onmessage = (e: any) => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
};
|
|
59
|
+
// workerInstance.onmessage = (e: any) => {
|
|
60
|
+
// // 赋值给下拉选择数据变量
|
|
61
|
+
// data.value = e.data;
|
|
62
|
+
// };
|
|
63
63
|
|
|
64
64
|
// 当include变化的时候,需要重新发送搜索事件 返回对应的下拉数据
|
|
65
65
|
watch(
|
|
@@ -82,27 +82,28 @@ function useSelect() {
|
|
|
82
82
|
|
|
83
83
|
//监听用户搜索事件
|
|
84
84
|
const onSearch = (keywords: string) => {
|
|
85
|
-
|
|
86
|
-
sendWorkerSearch(keywords);
|
|
87
|
-
} else {
|
|
88
|
-
data.list = dicData
|
|
89
|
-
.filter((item: any) => {
|
|
90
|
-
return (
|
|
91
|
-
item.value.toLowerCase().indexOf(keywords.toLowerCase()) !== -1 ||
|
|
92
|
-
item.label.toLowerCase().includes(keywords.toLowerCase())
|
|
93
|
-
);
|
|
94
|
-
})
|
|
95
|
-
.splice(0, 10);
|
|
96
|
-
}
|
|
85
|
+
sendWorkerSearch(keywords);
|
|
97
86
|
};
|
|
98
87
|
|
|
99
88
|
// 发送搜索到webworker
|
|
100
89
|
function sendWorkerSearch(keywords: string) {
|
|
101
|
-
workerInstance.postMessage({
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
});
|
|
90
|
+
// workerInstance.postMessage({
|
|
91
|
+
// list: JSON.stringify(list[props.name]),
|
|
92
|
+
// keywords: keywords,
|
|
93
|
+
// include: JSON.stringify(props.include ?? [])
|
|
94
|
+
// });
|
|
95
|
+
keywords = keywords.trim();
|
|
96
|
+
data.value = dicData
|
|
97
|
+
.filter((item: any) => {
|
|
98
|
+
return (
|
|
99
|
+
item.value.toLowerCase().indexOf(keywords.toLowerCase()) !== -1 ||
|
|
100
|
+
item.label.toLowerCase().includes(keywords.toLowerCase())
|
|
101
|
+
);
|
|
102
|
+
})
|
|
103
|
+
.splice(0, 10);
|
|
104
|
+
if (data.value.length === 0) {
|
|
105
|
+
data.value = [...dicData].splice(0, 10);
|
|
106
|
+
}
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
//监听下拉选择事件
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3NlbGYuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24oYSl7Y29uc3QgdD1hLmRhdGEubmFtZT8/IiIsZT1hLmRhdGEudmFsdWU/PyIiLG49KChKU09OLnBhcnNlKGEuZGF0YS5saXN0KT8/W10pW3RdfHxbXSkuZmlsdGVyKHM9PnMudmFsdWU9PT1lKS5tYXAocz0+cy5sYWJlbCkuam9pbigiIik7c2VsZi5wb3N0TWVzc2FnZShuKX0sITEpfSkoKTsK",t=typeof window<"u"&&window.Blob&&new Blob([atob(n)],{type:"text/javascript;charset=utf-8"});function o(){const e=t&&(window.URL||window.webkitURL).createObjectURL(t);try{return e?new Worker(e):new Worker("data:application/javascript;base64,"+n)}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}exports.default=o;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("../../store/modules/DataDictionary.cjs.js"),c={name:"DemoSelect"},u=e.defineComponent({...c,props:{name:{default:""}},setup(s){const n=s,t=e.inject("dicWorkerInstance"),o=e.ref([]);t.onmessage=a=>{o.value=a.data};const{list:r}=i.useDataDicStore();return e.onMounted(()=>{t.postMessage({list:JSON.stringify(r[n.name]),keywords:"",include:JSON.stringify([])})}),e.onUnmounted(()=>{t.terminate()}),(a,l)=>(e.openBlock(),e.createElementBlock("div",null,e.toDisplayString(n.name)+" "+e.toDisplayString(o.value),1))}});exports.default=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./DemoSelect.vue.cjs.js");exports.default=e.default;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
declare const _sfc_main: import("vue").DefineComponent<{
|
|
3
|
-
name: {
|
|
4
|
-
type: __PropType<string>;
|
|
5
|
-
required: true;
|
|
6
|
-
default: string;
|
|
7
|
-
};
|
|
8
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
-
name: {
|
|
10
|
-
type: __PropType<string>;
|
|
11
|
-
required: true;
|
|
12
|
-
default: string;
|
|
13
|
-
};
|
|
14
|
-
}>>, {
|
|
15
|
-
name: string;
|
|
16
|
-
}>;
|
|
17
|
-
export default _sfc_main;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3NlbGYuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24odCl7dmFyIG87Y29uc3QgbD0odC5kYXRhLmtleXdvcmRzPz8iIikudHJpbSgpO2xldCBlPUpTT04ucGFyc2UoKChvPXQuZGF0YSk9PW51bGw/dm9pZCAwOm8ubGlzdCl8fFtdKT8/W107Y29uc3QgYT1KU09OLnBhcnNlKHQuZGF0YS5pbmNsdWRlKTthLmxlbmd0aD4wJiYoZT1lLmZpbHRlcihzPT5hLnNvbWUocj0+cj09PXMudmFsdWUpKSk7Y29uc3QgaT1lLmZpbHRlcihzPT5zLnZhbHVlLnRvTG93ZXJDYXNlKCkuaW5kZXhPZihsLnRvTG93ZXJDYXNlKCkpIT09LTF8fHMubGFiZWwudG9Mb3dlckNhc2UoKS5pbmNsdWRlcyhsLnRvTG93ZXJDYXNlKCkpKTtpLmxlbmd0aD09PTA/c2VsZi5wb3N0TWVzc2FnZShlLnNwbGljZSgwLDEwKSk6c2VsZi5wb3N0TWVzc2FnZShpLnNwbGljZSgwLDEwKSl9LCExKX0pKCk7Cg==",e=typeof window<"u"&&window.Blob&&new Blob([atob(n)],{type:"text/javascript;charset=utf-8"});function b(){const l=e&&(window.URL||window.webkitURL).createObjectURL(e);try{return l?new Worker(l):new Worker("data:application/javascript;base64,"+n)}finally{l&&(window.URL||window.webkitURL).revokeObjectURL(l)}}exports.default=b;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class t{constructor(e,o){this.workerClass=e,this.poolSize=o,this.pool=[],this.activeWorkers=new Set}initialize(){for(let e=0;e<this.poolSize;e++){const o=new this.workerClass;this.pool.push(o)}}getWorker(){if(this.pool.length>0){const e=this.pool.pop();return this.activeWorkers.add(e),e}return null}releaseWorker(e){this.pool.push(e),this.activeWorkers.delete(e)}cleanup(){for(const e of this.activeWorkers)e.terminate();this.pool=[],this.activeWorkers.clear()}}exports.default=t;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const o = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3NlbGYuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24oYSl7Y29uc3QgdD1hLmRhdGEubmFtZT8/IiIsZT1hLmRhdGEudmFsdWU/PyIiLG49KChKU09OLnBhcnNlKGEuZGF0YS5saXN0KT8/W10pW3RdfHxbXSkuZmlsdGVyKHM9PnMudmFsdWU9PT1lKS5tYXAocz0+cy5sYWJlbCkuam9pbigiIik7c2VsZi5wb3N0TWVzc2FnZShuKX0sITEpfSkoKTsK", e = typeof window < "u" && window.Blob && new Blob([atob(o)], { type: "text/javascript;charset=utf-8" });
|
|
2
|
-
function t() {
|
|
3
|
-
const n = e && (window.URL || window.webkitURL).createObjectURL(e);
|
|
4
|
-
try {
|
|
5
|
-
return n ? new Worker(n) : new Worker("data:application/javascript;base64," + o);
|
|
6
|
-
} finally {
|
|
7
|
-
n && (window.URL || window.webkitURL).revokeObjectURL(n);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
t as default
|
|
12
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { PropType as __PropType } from 'vue';
|
|
2
|
-
declare const _sfc_main: import("vue").DefineComponent<{
|
|
3
|
-
name: {
|
|
4
|
-
type: __PropType<string>;
|
|
5
|
-
required: true;
|
|
6
|
-
default: string;
|
|
7
|
-
};
|
|
8
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
-
name: {
|
|
10
|
-
type: __PropType<string>;
|
|
11
|
-
required: true;
|
|
12
|
-
default: string;
|
|
13
|
-
};
|
|
14
|
-
}>>, {
|
|
15
|
-
name: string;
|
|
16
|
-
}>;
|
|
17
|
-
export default _sfc_main;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { defineComponent as c, inject as i, ref as l, onMounted as m, onUnmounted as u, openBlock as d, createElementBlock as p, toDisplayString as a } from "vue";
|
|
2
|
-
import { useDataDicStore as f } from "../../store/modules/DataDictionary.esm.js";
|
|
3
|
-
const _ = {
|
|
4
|
-
name: "DemoSelect"
|
|
5
|
-
}, y = /* @__PURE__ */ c({
|
|
6
|
-
..._,
|
|
7
|
-
props: {
|
|
8
|
-
name: { default: "" }
|
|
9
|
-
},
|
|
10
|
-
setup(s) {
|
|
11
|
-
const t = s, e = i("dicWorkerInstance"), n = l([]);
|
|
12
|
-
e.onmessage = (o) => {
|
|
13
|
-
n.value = o.data;
|
|
14
|
-
};
|
|
15
|
-
const { list: r } = f();
|
|
16
|
-
return m(() => {
|
|
17
|
-
e.postMessage({
|
|
18
|
-
list: JSON.stringify(r[t.name]),
|
|
19
|
-
keywords: "",
|
|
20
|
-
include: JSON.stringify([])
|
|
21
|
-
});
|
|
22
|
-
}), u(() => {
|
|
23
|
-
e.terminate();
|
|
24
|
-
}), (o, g) => (d(), p("div", null, a(t.name) + " " + a(n.value), 1));
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
export {
|
|
28
|
-
y as default
|
|
29
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const b = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3NlbGYuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24odCl7dmFyIG87Y29uc3QgbD0odC5kYXRhLmtleXdvcmRzPz8iIikudHJpbSgpO2xldCBlPUpTT04ucGFyc2UoKChvPXQuZGF0YSk9PW51bGw/dm9pZCAwOm8ubGlzdCl8fFtdKT8/W107Y29uc3QgYT1KU09OLnBhcnNlKHQuZGF0YS5pbmNsdWRlKTthLmxlbmd0aD4wJiYoZT1lLmZpbHRlcihzPT5hLnNvbWUocj0+cj09PXMudmFsdWUpKSk7Y29uc3QgaT1lLmZpbHRlcihzPT5zLnZhbHVlLnRvTG93ZXJDYXNlKCkuaW5kZXhPZihsLnRvTG93ZXJDYXNlKCkpIT09LTF8fHMubGFiZWwudG9Mb3dlckNhc2UoKS5pbmNsdWRlcyhsLnRvTG93ZXJDYXNlKCkpKTtpLmxlbmd0aD09PTA/c2VsZi5wb3N0TWVzc2FnZShlLnNwbGljZSgwLDEwKSk6c2VsZi5wb3N0TWVzc2FnZShpLnNwbGljZSgwLDEwKSl9LCExKX0pKCk7Cg==", n = typeof window < "u" && window.Blob && new Blob([atob(b)], { type: "text/javascript;charset=utf-8" });
|
|
2
|
-
function c() {
|
|
3
|
-
const l = n && (window.URL || window.webkitURL).createObjectURL(n);
|
|
4
|
-
try {
|
|
5
|
-
return l ? new Worker(l) : new Worker("data:application/javascript;base64," + b);
|
|
6
|
-
} finally {
|
|
7
|
-
l && (window.URL || window.webkitURL).revokeObjectURL(l);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
c as default
|
|
12
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
class r {
|
|
2
|
-
constructor(e, o) {
|
|
3
|
-
this.workerClass = e, this.poolSize = o, this.pool = [], this.activeWorkers = /* @__PURE__ */ new Set();
|
|
4
|
-
}
|
|
5
|
-
initialize() {
|
|
6
|
-
for (let e = 0; e < this.poolSize; e++) {
|
|
7
|
-
const o = new this.workerClass();
|
|
8
|
-
this.pool.push(o);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
getWorker() {
|
|
12
|
-
if (this.pool.length > 0) {
|
|
13
|
-
const e = this.pool.pop();
|
|
14
|
-
return this.activeWorkers.add(e), e;
|
|
15
|
-
}
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
releaseWorker(e) {
|
|
19
|
-
this.pool.push(e), this.activeWorkers.delete(e);
|
|
20
|
-
}
|
|
21
|
-
cleanup() {
|
|
22
|
-
for (const e of this.activeWorkers)
|
|
23
|
-
e.terminate();
|
|
24
|
-
this.pool = [], this.activeWorkers.clear();
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
r as default
|
|
29
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref, onMounted, onUnmounted, inject } from "vue";
|
|
3
|
-
import { useDataDicStore } from "../../store/modules/DataDictionary";
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
name: string; //字典名字
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
10
|
-
name: ""
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
const workerInstance: any = inject("dicWorkerInstance");
|
|
14
|
-
|
|
15
|
-
const data = ref([]);
|
|
16
|
-
|
|
17
|
-
// 监听 Web Worker 的消息
|
|
18
|
-
workerInstance.onmessage = (event: any) => {
|
|
19
|
-
data.value = event.data;
|
|
20
|
-
};
|
|
21
|
-
const { list } = useDataDicStore();
|
|
22
|
-
|
|
23
|
-
onMounted(() => {
|
|
24
|
-
workerInstance.postMessage({
|
|
25
|
-
list: JSON.stringify(list[props.name]),
|
|
26
|
-
keywords: "",
|
|
27
|
-
include: JSON.stringify([])
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
onUnmounted(() => {
|
|
32
|
-
// 组件销毁时终止 Web Worker
|
|
33
|
-
workerInstance.terminate();
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
// 其他组件逻辑...
|
|
37
|
-
</script>
|
|
38
|
-
<script lang="ts">
|
|
39
|
-
export default {
|
|
40
|
-
name: "DemoSelect"
|
|
41
|
-
};
|
|
42
|
-
</script>
|
|
43
|
-
<template>
|
|
44
|
-
<div>
|
|
45
|
-
{{ props.name }}
|
|
46
|
-
{{ data }}
|
|
47
|
-
</div>
|
|
48
|
-
</template>
|
|
49
|
-
<style scoped></style>
|