@ditari/bsui 1.0.55 → 1.0.57
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.
|
@@ -1 +1 @@
|
|
|
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
|
|
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??"",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 C=a=>{o("update:value",a),b()},m=()=>{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:C,onChange:m}}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;
|
|
@@ -15,7 +15,7 @@ const O = {
|
|
|
15
15
|
setup(u, { emit: t }) {
|
|
16
16
|
const n = u, { getDicByKey: f } = K(), { modelValue: s, data: h, onSearch: S, onSelect: m, onChange: C } = g();
|
|
17
17
|
function g() {
|
|
18
|
-
const
|
|
18
|
+
const d = [...f(n.name)], l = p([]), a = p(n.value);
|
|
19
19
|
v(
|
|
20
20
|
() => n.include,
|
|
21
21
|
() => {
|
|
@@ -27,11 +27,11 @@ const O = {
|
|
|
27
27
|
a.value = e;
|
|
28
28
|
}
|
|
29
29
|
), i(a.value);
|
|
30
|
-
const
|
|
30
|
+
const r = (e) => {
|
|
31
31
|
i(e);
|
|
32
32
|
};
|
|
33
33
|
function i(e) {
|
|
34
|
-
e = e
|
|
34
|
+
e = e ?? "", l.value = d.filter((c) => c.value.toLowerCase().indexOf(e.toLowerCase()) !== -1 || c.label.toLowerCase().includes(e.toLowerCase())).splice(0, 10), l.value.length === 0 && (l.value = [...d].splice(0, 10));
|
|
35
35
|
}
|
|
36
36
|
const L = (e) => {
|
|
37
37
|
t("update:value", e), D();
|
|
@@ -45,16 +45,16 @@ const O = {
|
|
|
45
45
|
return {
|
|
46
46
|
data: l,
|
|
47
47
|
modelValue: a,
|
|
48
|
-
onSearch:
|
|
48
|
+
onSearch: r,
|
|
49
49
|
onSelect: L,
|
|
50
50
|
onChange: b
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
return (
|
|
53
|
+
return (d, l) => {
|
|
54
54
|
const a = B("a-select");
|
|
55
55
|
return x(), V(a, {
|
|
56
56
|
value: o(s),
|
|
57
|
-
"onUpdate:value": l[0] || (l[0] = (
|
|
57
|
+
"onUpdate:value": l[0] || (l[0] = (r) => H(s) ? s.value = r : null),
|
|
58
58
|
"allow-clear": "",
|
|
59
59
|
"show-search": "",
|
|
60
60
|
"filter-option": !1,
|
package/package.json
CHANGED