@ditari/bsui 1.0.51 → 1.0.53
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/dic/DicReplace.cjs.js +1 -1
- package/dist/cjs/components/index.cjs.js +1 -1
- package/dist/cjs/components/layout/Show.vue.cjs.js +1 -1
- package/dist/cjs/components/select/Select.vue.cjs.js +1 -1
- package/dist/cjs/hooks/http/index.cjs.js +1 -1
- package/dist/esm/components/dic/DicReplace.esm.js +14 -13
- package/dist/esm/components/index.esm.js +39 -35
- package/dist/esm/components/layout/Show.vue.esm.js +22 -22
- package/dist/esm/components/select/Select.vue.esm.js +21 -22
- package/dist/esm/hooks/http/index.esm.js +1 -1
- package/package.json +1 -1
- package/src/components/components.ts +1 -1
- package/src/components/dic/DicReplace.tsx +10 -8
- package/src/components/index.ts +14 -0
- package/src/components/layout/Main.vue +1 -4
- package/src/components/layout/Show.vue +1 -2
- package/src/components/select/Select.vue +11 -7
- package/src/hooks/http/index.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("../../store/modules/DataDictionary.cjs.js"),u=e.defineComponent({name:"DicReplace",props:{name:{type:String,default:""},value:{type:String,default:""}},setup(n){const{list:o}=l.useDataDicStore(),t=e.inject("replaceWorkerInstance");console.log(t);const s=e.ref(!0),r=e.ref("");return t.onerror=()=>{s.value=!1},t.onmessage=a=>{r.value=a.data},e.watchEffect(()=>{const a=n.value,c=n.name;t.postMessage({list:JSON.stringify(o),name:c,value:a})}),()=>e.createVNode(e.Fragment,null,[r.value])}});exports.default=u;
|
|
@@ -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 d=require("pinia"),D=require("pinia-plugin-persistedstate"),q=require("./dic/replace.worker.cjs.js"),f=require("./select/dic.worker.cjs.js"),m=require("./components.cjs.js"),x=require("../directive/trim.cjs.js"),$=require("./table/index.cjs.js"),v=require("./select/index.cjs.js"),I=require("./desensitize/index.cjs.js"),S=require("./dic/index.cjs.js"),b=require("./modal/index.cjs.js"),k=require("./form/index.cjs.js"),c=require("./grid/index.cjs.js"),i=require("./layout/index.cjs.js"),o=m;let r=null,n=null;const a=function(e,l){Object.keys(o).forEach(u=>{const s=o[u];s.install&&e.use(s)});const t=d.createPinia();t.use(D.createPersistedState({storage:sessionStorage})),e.use(t),e.directive("trim",x.default),e.provide("menuIcon",l.menuIcon||{}),r||(r=new q.default,e.provide("replaceWorkerInstance",r)),n||(n=new f.default,e.provide("dicWorkerInstance",n))},w={install:a};exports.DTable=$.DTable;exports.DSelect=v.DSelect;exports.DDesensitize=I.DDesensitize;exports.DicReplace=S.DDicReplace;exports.DModal=b.DModal;exports.DForm=k.default;exports.DGrid=c.DGrid;exports.DGridItem=c.DGridItem;exports.DList=i.DList;exports.DMain=i.DMain;exports.DNavTabs=i.DNavTabs;exports.DShow=i.DShow;exports.default=w;exports.install=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("vue-router"),c=require("@vueuse/core"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("vue-router"),c=require("@vueuse/core"),T=require("@ant-design/icons-vue"),k=require("../../store/modules/NavTab.cjs.js"),x=require("../../store/modules/Settings.cjs.js"),B=require("pinia"),N={class:"ditari-show-layout"},q={key:0,class:"ditari-show-footer"},V={name:"DShowLayout"},$=e.defineComponent({...V,props:{close:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},setup(i,{expose:u}){const o=i,s=l.useRouter(),n=l.useRoute(),d=e.useSlots(),r=k.useNavTabsStore(),p=x.useSettingsStore(),a=e.inject("showConfig"),f=()=>a?e.h(e.resolveComponent(a.backBtn)):e.h(T.LeftOutlined),{refresh:h}=B.storeToRefs(p),g=e.computed(()=>o.loading),m={padding:`10px 10px ${d.footer?"70px":"10px"} 10px`},S=()=>{o.close&&r.deleteTabs(n.path),s.go(-1)},_=()=>{h.value=!0,r.deleteTabs(n.path),s.go(-1)},{y:v}=c.useWindowScroll(),w=c.useScrollLock(document.body);e.watch(()=>o.loading,t=>{w.value=t});const b=200;return u({closePage:_}),(t,R)=>{const y=e.resolveComponent("a-page-header"),C=e.resolveComponent("a-spin");return e.openBlock(),e.createElementBlock("div",N,[e.createVNode(C,{tip:"正在处理...",spinning:e.unref(g),delay:b,size:"large"},{default:e.withCtx(()=>[e.createVNode(y,{class:e.normalizeClass(["ditari-page-header",{active:e.unref(v)>0}]),ghost:!1,onBack:S},{backIcon:e.withCtx(()=>[e.createVNode(f)]),title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.$route.meta.title),1)]),subTitle:e.withCtx(()=>[e.renderSlot(t.$slots,"subTitle")]),extra:e.withCtx(()=>[e.renderSlot(t.$slots,"extra")]),_:3},8,["class"]),e.createElementVNode("div",{class:"ditari-show-content",style:m},[e.renderSlot(t.$slots,"default")]),t.$slots.footer?(e.openBlock(),e.createElementBlock("div",q,[e.renderSlot(t.$slots,"footer")])):e.createCommentVNode("",!0)]),_:3},8,["spinning"])])}}});exports.default=$;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../../store/modules/DataDictionary.cjs.js"),k=
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../../store/modules/DataDictionary.cjs.js"),k={name:"DSelect"},B=e.defineComponent({...k,props:{value:{default:null},name:{default:""},disabled:{type:Boolean,default:!1},placeholder:{default:"请填写默认占位符啊!老铁"},include:{default:[]}},emits:["update:value","change","select"],setup(r,{emit:c}){const l=r,{getDicByKey:v,list:h}=y.useDataDicStore(),{modelValue:s,data:p,onSearch:S,onSelect:g,onChange:m}=C();function C(){let d=!0,t=[];const o=e.ref(t),n=e.ref(l.value),i=e.inject("dicWorkerInstance");i.onerror=()=>{d=!1,t=v(l.name)},i.onmessage=a=>{o.value=[...a.data]},e.watch(()=>l.include,()=>{f(n.value)}),e.watch(()=>l.value,a=>{n.value=a}),f(n.value);const w=a=>{d?f(a):o.value=t.filter(u=>u.value.toLowerCase().indexOf(a.toLowerCase())!==-1||u.label.toLowerCase().includes(a.toLowerCase())).splice(0,10)};function f(a){i.postMessage({list:JSON.stringify(h[l.name]),keywords:a,include:JSON.stringify(l.include??[])})}const b=a=>{c("update:value",a),_()},D=()=>{c("update:value",n.value),c("change",n.value)};function _(){const u=v(l.name).find(L=>L.value===n.value);c("select",u)}return{data:o,modelValue:n,onSearch:w,onSelect:b,onChange:D}}return(d,t)=>{const o=e.resolveComponent("a-select");return e.openBlock(),e.createBlock(o,{value:e.unref(s),"onUpdate:value":t[0]||(t[0]=n=>e.isRef(s)?s.value=n:null),"allow-clear":"","show-search":"","filter-option":!1,options:e.unref(p),placeholder:r.placeholder,disabled:r.disabled,onSelect:e.unref(g),onSearch:e.unref(S),onChange:e.unref(m)},null,8,["value","options","placeholder","disabled","onSelect","onSearch","onChange"])}}});exports.default=B;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),S=require("vue-request"),m=require("../../utils/get.cjs.js"),K=(i,a={})=>{a.pagination||(a.pagination={currentKey:"page",pageSizeKey:"limit",totalKey:"data.total"});const{dataKey:l,pagination:{currentKey:r,pageSizeKey:c}}=a,t=a.params||o.ref({}),{total:s,pageSize:g,current:v,loading:d,data:p,run:n}=S.usePagination(i,{manual:!0,pagination:a.pagination,loadingDelay:400,loadingKeep:100,onSuccess:(e,u)=>{a.onSuccess&&a.onSuccess(e,u)},onError:(e,u)=>{console.log(u,e)}}),y=o.computed(()=>({total:s.value,current:v.value,pageSize:g.value}));return{data:o.computed(()=>m.get(p.value,l||"data",[])),pagination:y,loading:d,run:n,onPageChange:e=>{t.value[r]=e.page,t.value[c]=e.size,n(t.value||{})},onQuery:e=>{t.value={...t.value,...e},t.value[r]=1,n(t.value||{})}}};exports.useRequestList=K;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),S=require("vue-request"),m=require("../../utils/get.cjs.js"),K=(i,a={})=>{a.pagination||(a.pagination={currentKey:"page",pageSizeKey:"limit",totalKey:"data.total"});const{dataKey:l,pagination:{currentKey:r,pageSizeKey:c}}=a,t=a.params||o.ref({}),{total:s,pageSize:g,current:v,loading:d,data:p,run:n}=S.usePagination(i,{manual:!0,pagination:a.pagination,loadingDelay:400,loadingKeep:100,onSuccess:(e,u)=>{a.onSuccess&&a.onSuccess(e,u)},onError:(e,u)=>{console.log(u,e)}}),y=o.computed(()=>({total:s.value,current:v.value,pageSize:g.value}));return{data:o.computed(()=>m.get(p.value,l||"data",[])||[]),pagination:y,loading:d,run:n,onPageChange:e=>{t.value[r]=e.page,t.value[c]=e.size,n(t.value||{})},onQuery:e=>{t.value={...t.value,...e},t.value[r]=1,n(t.value||{})}}};exports.useRequestList=K;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import p from "
|
|
3
|
-
|
|
4
|
-
const S = /* @__PURE__ */ c({
|
|
1
|
+
import { defineComponent as l, inject as u, ref as o, watchEffect as i, createVNode as f, Fragment as m } from "vue";
|
|
2
|
+
import { useDataDicStore as p } from "../../store/modules/DataDictionary.esm.js";
|
|
3
|
+
const v = /* @__PURE__ */ l({
|
|
5
4
|
name: "DicReplace",
|
|
6
5
|
props: {
|
|
7
6
|
// 字典名称
|
|
@@ -17,22 +16,24 @@ const S = /* @__PURE__ */ c({
|
|
|
17
16
|
},
|
|
18
17
|
setup(a) {
|
|
19
18
|
const {
|
|
20
|
-
list:
|
|
21
|
-
} =
|
|
19
|
+
list: r
|
|
20
|
+
} = p(), e = u("replaceWorkerInstance");
|
|
21
|
+
console.log(e);
|
|
22
|
+
const s = o(!0), n = o("");
|
|
22
23
|
return e.onerror = () => {
|
|
23
24
|
s.value = !1;
|
|
24
25
|
}, e.onmessage = (t) => {
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
const t = a.value,
|
|
26
|
+
n.value = t.data;
|
|
27
|
+
}, i(() => {
|
|
28
|
+
const t = a.value, c = a.name;
|
|
28
29
|
e.postMessage({
|
|
29
|
-
list: JSON.stringify(
|
|
30
|
-
name:
|
|
30
|
+
list: JSON.stringify(r),
|
|
31
|
+
name: c,
|
|
31
32
|
value: t
|
|
32
33
|
});
|
|
33
|
-
}), () =>
|
|
34
|
+
}), () => f(m, null, [n.value]);
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
v as default
|
|
38
39
|
};
|
|
@@ -1,42 +1,46 @@
|
|
|
1
1
|
import { createPinia as m } from "pinia";
|
|
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
|
-
|
|
2
|
+
import { createPersistedState as a } from "pinia-plugin-persistedstate";
|
|
3
|
+
import f from "./dic/replace.worker.esm.js";
|
|
4
|
+
import l from "./select/dic.worker.esm.js";
|
|
5
|
+
import * as p from "./components.esm.js";
|
|
6
|
+
import D from "../directive/trim.esm.js";
|
|
7
|
+
import { DTable as w } from "./table/index.esm.js";
|
|
8
|
+
import { DSelect as g } from "./select/index.esm.js";
|
|
9
|
+
import { DDesensitize as G } from "./desensitize/index.esm.js";
|
|
10
|
+
import { DDicReplace as P } from "./dic/index.esm.js";
|
|
11
|
+
import { DModal as j } from "./modal/index.esm.js";
|
|
12
|
+
import { default as z } from "./form/index.esm.js";
|
|
13
|
+
import { DGrid as F, DGridItem as L } from "./grid/index.esm.js";
|
|
14
|
+
import { DList as O, DMain as $, DNavTabs as q, DShow as A } from "./layout/index.esm.js";
|
|
15
|
+
const n = p;
|
|
16
|
+
let r = null, o = null;
|
|
17
|
+
const d = function(e, s) {
|
|
18
|
+
Object.keys(n).forEach((c) => {
|
|
19
|
+
const i = n[c];
|
|
20
|
+
i.install && e.use(i);
|
|
17
21
|
});
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
const t = m();
|
|
23
|
+
t.use(
|
|
24
|
+
a({
|
|
21
25
|
storage: sessionStorage
|
|
22
26
|
})
|
|
23
|
-
), e.use(
|
|
24
|
-
},
|
|
25
|
-
install:
|
|
27
|
+
), e.use(t), e.directive("trim", D), e.provide("menuIcon", s.menuIcon || {}), r || (r = new f(), e.provide("replaceWorkerInstance", r)), o || (o = new l(), e.provide("dicWorkerInstance", o));
|
|
28
|
+
}, v = {
|
|
29
|
+
install: d
|
|
26
30
|
};
|
|
27
31
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
G as DDesensitize,
|
|
33
|
+
z as DForm,
|
|
34
|
+
F as DGrid,
|
|
35
|
+
L as DGridItem,
|
|
36
|
+
O as DList,
|
|
37
|
+
$ as DMain,
|
|
38
|
+
j as DModal,
|
|
39
|
+
q as DNavTabs,
|
|
40
|
+
g as DSelect,
|
|
41
|
+
A as DShow,
|
|
42
|
+
w as DTable,
|
|
43
|
+
P as DicReplace,
|
|
44
|
+
v as default,
|
|
45
|
+
d as install
|
|
42
46
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as L, useSlots as N, inject as R, computed as V, watch as z, resolveComponent as a, openBlock as d, createElementBlock as p, createVNode as r, unref as u, withCtx as o, normalizeClass as D, createTextVNode as E, toDisplayString as j, renderSlot as t, createElementVNode as I, createCommentVNode as O, h as f } from "vue";
|
|
2
2
|
import { useRouter as P, useRoute as W } from "vue-router";
|
|
3
3
|
import { useWindowScroll as q, useScrollLock as A } from "@vueuse/core";
|
|
4
4
|
import { LeftOutlined as F } from "@ant-design/icons-vue";
|
|
@@ -10,49 +10,49 @@ const K = { class: "ditari-show-layout" }, M = {
|
|
|
10
10
|
class: "ditari-show-footer"
|
|
11
11
|
}, Q = {
|
|
12
12
|
name: "DShowLayout"
|
|
13
|
-
}, ne = /* @__PURE__ */
|
|
13
|
+
}, ne = /* @__PURE__ */ L({
|
|
14
14
|
...Q,
|
|
15
15
|
props: {
|
|
16
16
|
close: { type: Boolean, default: !1 },
|
|
17
17
|
loading: { type: Boolean, default: !1 }
|
|
18
18
|
},
|
|
19
19
|
setup(m, { expose: g }) {
|
|
20
|
-
const s = m, n = P(),
|
|
20
|
+
const s = m, n = P(), l = W(), h = N(), i = G(), _ = H(), c = R("showConfig"), y = () => c ? f(a(c.backBtn)) : f(F), { refresh: S } = J(_), b = V(() => s.loading), w = {
|
|
21
21
|
padding: `10px 10px ${h.footer ? "70px" : "10px"} 10px`
|
|
22
|
-
}, w = () => {
|
|
23
|
-
s.close && c.deleteTabs(i.path), n.go(-1);
|
|
24
22
|
}, v = () => {
|
|
25
|
-
|
|
26
|
-
},
|
|
23
|
+
s.close && i.deleteTabs(l.path), n.go(-1);
|
|
24
|
+
}, T = () => {
|
|
25
|
+
S.value = !0, i.deleteTabs(l.path), n.go(-1);
|
|
26
|
+
}, { y: k } = q(), C = A(document.body);
|
|
27
27
|
z(
|
|
28
28
|
() => s.loading,
|
|
29
29
|
(e) => {
|
|
30
|
-
|
|
30
|
+
C.value = e;
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
const
|
|
33
|
+
const $ = 200;
|
|
34
34
|
return g({
|
|
35
|
-
closePage:
|
|
35
|
+
closePage: T
|
|
36
36
|
}), (e, U) => {
|
|
37
|
-
const
|
|
37
|
+
const B = a("a-page-header"), x = a("a-spin");
|
|
38
38
|
return d(), p("div", K, [
|
|
39
|
-
|
|
39
|
+
r(x, {
|
|
40
40
|
tip: "正在处理...",
|
|
41
|
-
spinning: u(
|
|
42
|
-
delay:
|
|
41
|
+
spinning: u(b),
|
|
42
|
+
delay: $,
|
|
43
43
|
size: "large"
|
|
44
44
|
}, {
|
|
45
45
|
default: o(() => [
|
|
46
|
-
|
|
47
|
-
class: D(["ditari-page-header", { active: u(
|
|
46
|
+
r(B, {
|
|
47
|
+
class: D(["ditari-page-header", { active: u(k) > 0 }]),
|
|
48
48
|
ghost: !1,
|
|
49
|
-
onBack:
|
|
49
|
+
onBack: v
|
|
50
50
|
}, {
|
|
51
51
|
backIcon: o(() => [
|
|
52
|
-
|
|
52
|
+
r(y)
|
|
53
53
|
]),
|
|
54
54
|
title: o(() => [
|
|
55
|
-
E(
|
|
55
|
+
E(j(e.$route.meta.title), 1)
|
|
56
56
|
]),
|
|
57
57
|
subTitle: o(() => [
|
|
58
58
|
t(e.$slots, "subTitle")
|
|
@@ -62,15 +62,15 @@ const K = { class: "ditari-show-layout" }, M = {
|
|
|
62
62
|
]),
|
|
63
63
|
_: 3
|
|
64
64
|
}, 8, ["class"]),
|
|
65
|
-
|
|
65
|
+
I("div", {
|
|
66
66
|
class: "ditari-show-content",
|
|
67
|
-
style:
|
|
67
|
+
style: w
|
|
68
68
|
}, [
|
|
69
69
|
t(e.$slots, "default")
|
|
70
70
|
]),
|
|
71
71
|
e.$slots.footer ? (d(), p("div", M, [
|
|
72
72
|
t(e.$slots, "footer")
|
|
73
|
-
])) :
|
|
73
|
+
])) : O("", !0)
|
|
74
74
|
]),
|
|
75
75
|
_: 3
|
|
76
76
|
}, 8, ["spinning"])
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { defineComponent as x, ref as v, watch as h, resolveComponent as
|
|
2
|
-
import { useDataDicStore as
|
|
3
|
-
|
|
4
|
-
const H = {
|
|
1
|
+
import { defineComponent as x, ref as v, inject as y, watch as h, resolveComponent as O, openBlock as V, createBlock as I, unref as o, isRef as J } from "vue";
|
|
2
|
+
import { useDataDicStore as N } from "../../store/modules/DataDictionary.esm.js";
|
|
3
|
+
const W = {
|
|
5
4
|
name: "DSelect"
|
|
6
|
-
},
|
|
7
|
-
...
|
|
5
|
+
}, K = /* @__PURE__ */ x({
|
|
6
|
+
...W,
|
|
8
7
|
props: {
|
|
9
8
|
value: { default: null },
|
|
10
9
|
name: { default: "" },
|
|
@@ -14,14 +13,14 @@ const H = {
|
|
|
14
13
|
},
|
|
15
14
|
emits: ["update:value", "change", "select"],
|
|
16
15
|
setup(u, { emit: c }) {
|
|
17
|
-
const l = u, { getDicByKey: p, list: S } =
|
|
16
|
+
const l = u, { getDicByKey: p, list: S } = N(), { modelValue: r, data: m, onSearch: g, onSelect: C, onChange: w } = L();
|
|
18
17
|
function L() {
|
|
19
18
|
let d = !0, n = [];
|
|
20
|
-
const
|
|
19
|
+
const t = v(n), a = v(l.value), i = y("dicWorkerInstance");
|
|
21
20
|
i.onerror = () => {
|
|
22
21
|
d = !1, n = p(l.name);
|
|
23
22
|
}, i.onmessage = (e) => {
|
|
24
|
-
|
|
23
|
+
t.value = [...e.data];
|
|
25
24
|
}, h(
|
|
26
25
|
() => l.include,
|
|
27
26
|
() => {
|
|
@@ -34,7 +33,7 @@ const H = {
|
|
|
34
33
|
}
|
|
35
34
|
), f(a.value);
|
|
36
35
|
const b = (e) => {
|
|
37
|
-
d ? f(e) :
|
|
36
|
+
d ? f(e) : t.value = n.filter((s) => s.value.toLowerCase().indexOf(e.toLowerCase()) !== -1 || s.label.toLowerCase().includes(e.toLowerCase())).splice(0, 10);
|
|
38
37
|
};
|
|
39
38
|
function f(e) {
|
|
40
39
|
i.postMessage({
|
|
@@ -49,11 +48,11 @@ const H = {
|
|
|
49
48
|
c("update:value", a.value), c("change", a.value);
|
|
50
49
|
};
|
|
51
50
|
function k() {
|
|
52
|
-
const
|
|
53
|
-
c("select",
|
|
51
|
+
const s = p(l.name).find((B) => B.value === a.value);
|
|
52
|
+
c("select", s);
|
|
54
53
|
}
|
|
55
54
|
return {
|
|
56
|
-
data:
|
|
55
|
+
data: t,
|
|
57
56
|
modelValue: a,
|
|
58
57
|
onSearch: b,
|
|
59
58
|
onSelect: D,
|
|
@@ -61,23 +60,23 @@ const H = {
|
|
|
61
60
|
};
|
|
62
61
|
}
|
|
63
62
|
return (d, n) => {
|
|
64
|
-
const
|
|
65
|
-
return
|
|
66
|
-
value:
|
|
67
|
-
"onUpdate:value": n[0] || (n[0] = (a) =>
|
|
63
|
+
const t = O("a-select");
|
|
64
|
+
return V(), I(t, {
|
|
65
|
+
value: o(r),
|
|
66
|
+
"onUpdate:value": n[0] || (n[0] = (a) => J(r) ? r.value = a : null),
|
|
68
67
|
"allow-clear": "",
|
|
69
68
|
"show-search": "",
|
|
70
69
|
"filter-option": !1,
|
|
71
|
-
options:
|
|
70
|
+
options: o(m),
|
|
72
71
|
placeholder: u.placeholder,
|
|
73
72
|
disabled: u.disabled,
|
|
74
|
-
onSelect:
|
|
75
|
-
onSearch:
|
|
76
|
-
onChange:
|
|
73
|
+
onSelect: o(C),
|
|
74
|
+
onSearch: o(g),
|
|
75
|
+
onChange: o(w)
|
|
77
76
|
}, null, 8, ["value", "options", "placeholder", "disabled", "onSelect", "onSearch", "onChange"]);
|
|
78
77
|
};
|
|
79
78
|
}
|
|
80
79
|
});
|
|
81
80
|
export {
|
|
82
|
-
|
|
81
|
+
K as default
|
|
83
82
|
};
|
package/package.json
CHANGED
|
@@ -5,4 +5,4 @@ export { DGrid, DGridItem } from "./grid";
|
|
|
5
5
|
export { default as DSelect } from "./select";
|
|
6
6
|
export { default as DDesensitize } from "./desensitize";
|
|
7
7
|
export { default as DicReplace } from "./dic";
|
|
8
|
-
export { default as DModal } from "./modal";
|
|
8
|
+
export { default as DModal } from "./modal";
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* 根据字典名字及对应的value替换成中文或者人能看懂的文字
|
|
4
4
|
* @author 余春林
|
|
5
5
|
*/
|
|
6
|
-
import { defineComponent, ref, watchEffect } from "vue";
|
|
6
|
+
import { defineComponent, ref, watchEffect, inject } from "vue";
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8
8
|
// @ts-ignore
|
|
9
|
-
import DicWorker from "./replace.worker?worker&inline";
|
|
9
|
+
// import DicWorker from "./replace.worker?worker&inline";
|
|
10
10
|
import { useDataDicStore } from "../../store/modules/DataDictionary";
|
|
11
11
|
|
|
12
12
|
export default defineComponent({
|
|
@@ -25,28 +25,30 @@ export default defineComponent({
|
|
|
25
25
|
},
|
|
26
26
|
setup(props) {
|
|
27
27
|
const { list } = useDataDicStore();
|
|
28
|
-
|
|
28
|
+
const workerInstance: any = inject("replaceWorkerInstance");
|
|
29
|
+
console.log(workerInstance);
|
|
29
30
|
const workerStatus = ref(true);
|
|
30
31
|
const dicValueTxt = ref<any>("");
|
|
31
|
-
|
|
32
|
+
// if (!workerInstance) {
|
|
33
|
+
// workerInstance = new DicWorker();
|
|
34
|
+
// }
|
|
32
35
|
/**
|
|
33
36
|
* web worker 启动失败
|
|
34
37
|
*/
|
|
35
|
-
|
|
38
|
+
workerInstance.onerror = () => {
|
|
36
39
|
workerStatus.value = false;
|
|
37
40
|
};
|
|
38
41
|
/**
|
|
39
42
|
* 监听web worker发送的数据
|
|
40
43
|
* @param e
|
|
41
44
|
*/
|
|
42
|
-
|
|
43
|
-
// 赋值给下拉选择数据变量
|
|
45
|
+
workerInstance.onmessage = (e: any) => {
|
|
44
46
|
dicValueTxt.value = e.data;
|
|
45
47
|
};
|
|
46
48
|
watchEffect(() => {
|
|
47
49
|
const value = props.value;
|
|
48
50
|
const name = props.name;
|
|
49
|
-
|
|
51
|
+
workerInstance.postMessage({ list: JSON.stringify(list), name, value });
|
|
50
52
|
});
|
|
51
53
|
|
|
52
54
|
return () => <>{dicValueTxt.value}</>;
|
package/src/components/index.ts
CHANGED
|
@@ -2,6 +2,9 @@ import type { App } from "vue";
|
|
|
2
2
|
import { createPinia } from "pinia";
|
|
3
3
|
import { createPersistedState } from "pinia-plugin-persistedstate";
|
|
4
4
|
|
|
5
|
+
import ReplaceWorker from "./dic/replace.worker?worker&inline";
|
|
6
|
+
import DicWorker from "./select/dic.worker?worker&inline";
|
|
7
|
+
|
|
5
8
|
import * as components from "./components";
|
|
6
9
|
export * from "./components";
|
|
7
10
|
|
|
@@ -16,6 +19,9 @@ export interface Options {
|
|
|
16
19
|
prop?: string;
|
|
17
20
|
}
|
|
18
21
|
const c: any = components;
|
|
22
|
+
let replaceWorkerInstance: any = null;
|
|
23
|
+
let dicWorkerInstance: any = null;
|
|
24
|
+
|
|
19
25
|
export const install = function (app: App, opts: Options) {
|
|
20
26
|
Object.keys(c).forEach((key) => {
|
|
21
27
|
const component = c[key];
|
|
@@ -34,6 +40,14 @@ export const install = function (app: App, opts: Options) {
|
|
|
34
40
|
app.use(pinia);
|
|
35
41
|
app.directive("trim", vTrim);
|
|
36
42
|
app.provide("menuIcon", opts.menuIcon || {});
|
|
43
|
+
if (!replaceWorkerInstance) {
|
|
44
|
+
replaceWorkerInstance = new ReplaceWorker();
|
|
45
|
+
app.provide("replaceWorkerInstance", replaceWorkerInstance);
|
|
46
|
+
}
|
|
47
|
+
if (!dicWorkerInstance) {
|
|
48
|
+
dicWorkerInstance = new DicWorker();
|
|
49
|
+
app.provide("dicWorkerInstance", dicWorkerInstance);
|
|
50
|
+
}
|
|
37
51
|
};
|
|
38
52
|
|
|
39
53
|
export default {
|
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
* 入口文件
|
|
4
4
|
*/
|
|
5
5
|
import { computed, provide } from "vue";
|
|
6
|
-
import {
|
|
7
|
-
MenuFoldOutlined,
|
|
8
|
-
MenuUnfoldOutlined,
|
|
9
|
-
} from "@ant-design/icons-vue";
|
|
6
|
+
import { MenuFoldOutlined, MenuUnfoldOutlined } from "@ant-design/icons-vue";
|
|
10
7
|
import { useKeepAliveStore, useSettingsStore } from "../../store";
|
|
11
8
|
|
|
12
9
|
//标签页组件
|
|
@@ -33,8 +33,7 @@ const settingsStore = useSettingsStore();
|
|
|
33
33
|
const showConfig = inject("showConfig") as any;
|
|
34
34
|
|
|
35
35
|
const btnRender = () => {
|
|
36
|
-
|
|
37
|
-
if (showConfig.backBtn === "LeftOutlined") {
|
|
36
|
+
if (!showConfig) {
|
|
38
37
|
return h(LeftOutlined);
|
|
39
38
|
} else {
|
|
40
39
|
return h(resolveComponent(showConfig.backBtn));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref, watch } from "vue";
|
|
2
|
+
import { inject, ref, watch } from "vue";
|
|
3
3
|
import { useDataDicStore } from "../../store/modules/DataDictionary";
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
5
5
|
// @ts-ignore
|
|
6
|
-
import DicWorker from "./dic.worker?worker&inline";
|
|
6
|
+
// import DicWorker from "./dic.worker?worker&inline";
|
|
7
7
|
|
|
8
8
|
interface Props {
|
|
9
9
|
value: any;
|
|
@@ -38,12 +38,16 @@ function useSelect() {
|
|
|
38
38
|
const data = ref(dicData);
|
|
39
39
|
// 取值
|
|
40
40
|
const modelValue = ref(props.value);
|
|
41
|
-
//
|
|
42
|
-
const
|
|
41
|
+
// 获取worker
|
|
42
|
+
const workerInstance: any = inject("dicWorkerInstance");
|
|
43
|
+
// if (!workerInstance) {
|
|
44
|
+
// console.log("一次");
|
|
45
|
+
// workerInstance = new DicWorker();
|
|
46
|
+
// }
|
|
43
47
|
/**
|
|
44
48
|
* web worker 启动失败
|
|
45
49
|
*/
|
|
46
|
-
|
|
50
|
+
workerInstance.onerror = () => {
|
|
47
51
|
workerStatus = false;
|
|
48
52
|
// 启动失败使用store
|
|
49
53
|
dicData = getDicByKey(props.name);
|
|
@@ -52,7 +56,7 @@ function useSelect() {
|
|
|
52
56
|
* 监听web worker发送的数据
|
|
53
57
|
* @param e
|
|
54
58
|
*/
|
|
55
|
-
|
|
59
|
+
workerInstance.onmessage = (e: any) => {
|
|
56
60
|
// 赋值给下拉选择数据变量
|
|
57
61
|
data.value = [...e.data];
|
|
58
62
|
};
|
|
@@ -94,7 +98,7 @@ function useSelect() {
|
|
|
94
98
|
|
|
95
99
|
// 发送搜索到webworker
|
|
96
100
|
function sendWorkerSearch(keywords: string) {
|
|
97
|
-
|
|
101
|
+
workerInstance.postMessage({
|
|
98
102
|
list: JSON.stringify(list[props.name]),
|
|
99
103
|
keywords: keywords,
|
|
100
104
|
include: JSON.stringify(props.include ?? [])
|
package/src/hooks/http/index.ts
CHANGED
|
@@ -65,8 +65,8 @@ const useRequestList = (service: any, options: Options = {}) => {
|
|
|
65
65
|
/**
|
|
66
66
|
* 列表查询数据
|
|
67
67
|
*/
|
|
68
|
-
const data = computed<any>(
|
|
69
|
-
get((listData as any).value, dataKey || "data", [])
|
|
68
|
+
const data = computed<any>(
|
|
69
|
+
() => get((listData as any).value, dataKey || "data", []) || []
|
|
70
70
|
);
|
|
71
71
|
|
|
72
72
|
/**
|