@ditari/bsui 1.0.21 → 1.0.23
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/select/Select.vue.cjs.js +1 -1
- package/dist/cjs/components/table/Table.cjs.js +1 -1
- package/dist/cjs/components/table/Table.d.ts +0 -2
- package/dist/cjs/components/table/index.d.ts +0 -2
- package/dist/cjs/directive/trim.cjs.js +1 -1
- package/dist/cjs/directive/trim.d.ts +2 -1
- package/dist/esm/components/select/Select.vue.esm.js +37 -32
- package/dist/esm/components/table/Table.d.ts +0 -2
- package/dist/esm/components/table/Table.esm.js +15 -16
- package/dist/esm/components/table/index.d.ts +0 -2
- package/dist/esm/directive/trim.d.ts +2 -1
- package/dist/esm/directive/trim.esm.js +14 -5
- package/package.json +1 -1
- package/src/components/select/Select.vue +9 -1
- package/src/components/table/Table.tsx +1 -2
- package/src/directive/trim.ts +14 -4
|
@@ -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"),b=require("./dic.worker.cjs.js"),D={name:"DSelect"},y=e.defineComponent({...D,props:{value:{default:null},name:{default:""},disabled:{type:Boolean,default:!1},placeholder:{default:"请填写默认占位符啊!老铁"},include:{default:[]}},emits:["update:value","change"],setup(u,{emit:r}){const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("../../store/modules/DataDictionary.cjs.js"),b=require("./dic.worker.cjs.js"),D={name:"DSelect"},y=e.defineComponent({...D,props:{value:{default:null},name:{default:""},disabled:{type:Boolean,default:!1},placeholder:{default:"请填写默认占位符啊!老铁"},include:{default:[]}},emits:["update:value","change"],setup(u,{emit:r}){const t=u,{getDicByKey:h,list:p}=_.useDataDicStore(),{modelValue:c,data:v,onSearch:S,onSelect:g,onChange:m}=C();function C(){let s=!0,l=[];const o=e.ref(l),n=e.ref(t.value),d=new b.default;d.onerror=()=>{s=!1,l=h(t.name)},d.onmessage=a=>{o.value=[...a.data]},e.watch(()=>t.include,()=>{i(n.value)}),i(n.value);const w=a=>{s?i(a):o.value=l.filter(f=>f.value.toLowerCase().indexOf(a.toLowerCase())!==-1||f.label.toLowerCase().includes(a.toLowerCase())).splice(0,10)};function i(a){d.postMessage({list:JSON.stringify(p[t.name]),keywords:a,include:JSON.stringify(t.include??[])})}return{data:o,modelValue:n,onSearch:w,onSelect:a=>{r("update:value",a)},onChange:()=>{r("update:value",n.value),r("change",n.value)}}}return(s,l)=>{const o=e.resolveComponent("a-select");return e.openBlock(),e.createBlock(o,{value:e.unref(c),"onUpdate:value":l[0]||(l[0]=n=>e.isRef(c)?c.value=n:null),"allow-clear":"","show-search":"","filter-option":!1,options:e.unref(v),placeholder:u.placeholder,disabled:u.disabled,onSelect:e.unref(g),onSearch:e.unref(S),onChange:e.unref(m)},null,8,["value","options","placeholder","disabled","onSelect","onSearch","onChange"])}}});exports.default=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),S=require("ant-design-vue"),N=require("../../utils/html.cjs.js"),$=require("../theme/index.cjs.js"),A=()=>({data:{type:Object,required:!0},height:{type:Number,default:300},keys:Array,rowKey:{type:String,
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),S=require("ant-design-vue"),N=require("../../utils/html.cjs.js"),$=require("../theme/index.cjs.js"),A=()=>({data:{type:Object,required:!0},height:{type:Number,default:300},keys:Array,rowKey:{type:String,default:"id"},loading:{type:Boolean,default:!1},pagination:{type:Object,default:()=>({})},config:{type:Object,default:()=>({})}}),y={defaultPageSize:20,hideOnSinglePage:!1,pageSizeOptions:["10","20","30","40"],responsive:!0,showQuickJumper:!0,showLessItems:!0,showTotal:a=>`总共 ${a} 条`},T=`${$.prefixName}-pagination`,J=n.defineComponent({name:"DTable",props:A(),emits:["update:keys"],setup:function(a,{emit:b,slots:p}){const e=n.ref(a.keys||[]),P=n.computed(()=>a.data),R=n.computed(()=>{var t;return((t=a.config)==null?void 0:t.columns)??[]}),f=n.computed(()=>{var t;return((t=a.config)==null?void 0:t.pagination)??{}}),{tableRef:z,tableRootRef:x,tableHeight:E,onPageChange:O,onRowClassName:H}=q();function q(){const{rowClassName:t,keepSelected:l,selection:h,onPageChange:c}=a.config,r=n.ref(),o=n.ref(null),u=n.ref(),i=n.ref(null),g=v=>{var d,C;try{const m=(d=o==null?void 0:o.value)==null?void 0:d.$el,V=N.useEleHeight(m.getElementsByClassName("ant-table-header")[0]);let k=0;if(a.config.pagination){const _=(C=r.value)==null?void 0:C.getElementsByClassName(T)[0];k=N.useEleHeight(_)??0}u.value=v-(V+k),m.getElementsByClassName("ant-table-body")[0].style.height=u.value-10+"px",i.value=m.getElementsByClassName("ant-table-body")[0]}catch(m){console.warn(m)}};return n.watchEffect(()=>{a.height!==0&&n.nextTick(()=>{g(a.height)})}),{tableRef:o,tableRootRef:r,tableHeight:u,onPageChange:(v,d)=>{c&&c({page:v,size:d}),i.value.scrollTop=0,(h==="S"||!l)&&(e.value=[],b("update:keys",e.value))},onRowClassName:(v,d)=>t?t(v,d):void 0}}const B=j();function j(){const{rowKey:t,config:{selection:l,getCheckboxProps:h}}=a;if(l==="N")return;const c=(o,u)=>{l==="S"?(e.value=[],e.value=u?[o[t]]:[]):e.value=u?e.value.concat(o[t]):e.value.filter(i=>i!==o[t]),b("update:keys",e.value)},r=(o,u,i)=>{const g=i.map(s=>s[t]);e.value=o?e.value.concat(g):e.value.filter(s=>!g.includes(s)),b("update:keys",e.value)};return n.watch(()=>a.keys,o=>{e.value=o}),{selectedRowKeys:e,onSelect:c,onSelectAll:r,fixed:!0,columnTitle:l==="S"?"选择":null,columnWidth:l==="S"?60:40,getCheckboxProps:h}}const D=K();function K(){return t=>{let l;const{rowKey:h,config:{click:c,dbClick:r,selection:o,getCheckboxProps:u}}=a,i=t[h],g=()=>{if(o==="N")return;e.value.some(w=>w===i)?e.value=e.value.filter(w=>w!==i):(o==="S"&&(e.value=[]),e.value.push(i)),b("update:keys",e.value)};return{onClick:()=>{const s=u?u(t):null;s&&s.value===i||(clearTimeout(l),l=setTimeout(()=>{g(),c&&c(t)},200))},onDblclick:()=>{clearTimeout(l),r&&r(t)}}}}return()=>{var t;return n.createVNode("div",{ref:x},[n.createVNode(S.Table,{ref:z,"row-key":a.rowKey,bordered:a.config.bordered,columns:R.value,dataSource:P.value,loading:a.loading,size:((t=a.config)==null?void 0:t.size)??"small",scroll:{scrollToFirstRowOnChange:!0,x:"100%",y:E.value+"px"},pagination:!1,customRow:D,rowSelection:B,rowClassName:H},{bodyCell:({column:l})=>{if(l.slot==="action")return n.createVNode(S.Space,null,{default:()=>[p.action&&p.action()]})}}),n.withDirectives(n.createVNode(S.Pagination,{class:[T],current:f.value.current,"onUpdate:current":l=>f.value.current=l,pageSize:f.value.pageSize,"onUpdate:pageSize":l=>f.value.pageSize=l,disabled:a.loading,"show-size-changer":!0,size:"default","hide-on-single-page":y.hideOnSinglePage,"show-quick-jumper":y.showQuickJumper,"default-page-size":y.defaultPageSize,"page-size-options":y.pageSizeOptions,"show-total":y.showTotal,total:f.value.total,onChange:O},null),[[n.vShow,a.config.pagination]])])}}});exports.default=J;
|
|
@@ -15,7 +15,6 @@ declare const DXTable: import("vue").DefineComponent<{
|
|
|
15
15
|
keys: PropType<Key[] | undefined>;
|
|
16
16
|
rowKey: {
|
|
17
17
|
type: PropType<string>;
|
|
18
|
-
required: boolean;
|
|
19
18
|
default: string;
|
|
20
19
|
};
|
|
21
20
|
loading: {
|
|
@@ -42,7 +41,6 @@ declare const DXTable: import("vue").DefineComponent<{
|
|
|
42
41
|
keys: PropType<Key[] | undefined>;
|
|
43
42
|
rowKey: {
|
|
44
43
|
type: PropType<string>;
|
|
45
|
-
required: boolean;
|
|
46
44
|
default: string;
|
|
47
45
|
};
|
|
48
46
|
loading: {
|
|
@@ -10,7 +10,6 @@ export declare const DTable: import("../../utils/install").SFCWithInstall<import
|
|
|
10
10
|
keys: import("vue").PropType<import("./interface/table").Key[] | undefined>;
|
|
11
11
|
rowKey: {
|
|
12
12
|
type: import("vue").PropType<string>;
|
|
13
|
-
required: boolean;
|
|
14
13
|
default: string;
|
|
15
14
|
};
|
|
16
15
|
loading: {
|
|
@@ -37,7 +36,6 @@ export declare const DTable: import("../../utils/install").SFCWithInstall<import
|
|
|
37
36
|
keys: import("vue").PropType<import("./interface/table").Key[] | undefined>;
|
|
38
37
|
rowKey: {
|
|
39
38
|
type: import("vue").PropType<string>;
|
|
40
|
-
required: boolean;
|
|
41
39
|
default: string;
|
|
42
40
|
};
|
|
43
41
|
loading: {
|
|
@@ -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 o={mounted(u,e){u.addEventListener("input",()=>{var t,l;const a=u.value.trim().replace(/\s+/g,"");u.value=a,e.value=a,(l=(t=e==null?void 0:e.instance)==null?void 0:t.$emit)==null||l.call(t,"onUpdate:modelValue",a)})}};exports.default=o;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as D, ref as p,
|
|
2
|
-
import { useDataDicStore as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as D, ref as p, watch as _, resolveComponent as k, openBlock as B, createBlock as L, unref as t, isRef as x } from "vue";
|
|
2
|
+
import { useDataDicStore as y } from "../../store/modules/DataDictionary.esm.js";
|
|
3
|
+
import O from "./dic.worker.esm.js";
|
|
4
|
+
const V = {
|
|
5
5
|
name: "DSelect"
|
|
6
|
-
},
|
|
7
|
-
...
|
|
6
|
+
}, R = /* @__PURE__ */ D({
|
|
7
|
+
...V,
|
|
8
8
|
props: {
|
|
9
9
|
value: { default: null },
|
|
10
10
|
name: { default: "" },
|
|
@@ -13,56 +13,61 @@ const O = {
|
|
|
13
13
|
include: { default: [] }
|
|
14
14
|
},
|
|
15
15
|
emits: ["update:value", "change"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
16
|
+
setup(c, { emit: r }) {
|
|
17
|
+
const o = c, { getDicByKey: h, list: S } = y(), { modelValue: u, data: m, onSearch: v, onSelect: g, onChange: C } = w();
|
|
18
18
|
function w() {
|
|
19
|
-
let
|
|
20
|
-
const
|
|
19
|
+
let s = !0, l = [];
|
|
20
|
+
const n = p(l), a = p(o.value), d = new O();
|
|
21
21
|
d.onerror = () => {
|
|
22
|
-
|
|
22
|
+
s = !1, l = h(o.name);
|
|
23
23
|
}, d.onmessage = (e) => {
|
|
24
|
-
|
|
25
|
-
},
|
|
24
|
+
n.value = [...e.data];
|
|
25
|
+
}, _(
|
|
26
|
+
() => o.include,
|
|
27
|
+
() => {
|
|
28
|
+
i(a.value);
|
|
29
|
+
}
|
|
30
|
+
), i(a.value);
|
|
26
31
|
const b = (e) => {
|
|
27
|
-
|
|
32
|
+
s ? i(e) : n.value = l.filter((f) => f.value.toLowerCase().indexOf(e.toLowerCase()) !== -1 || f.label.toLowerCase().includes(e.toLowerCase())).splice(0, 10);
|
|
28
33
|
};
|
|
29
34
|
function i(e) {
|
|
30
35
|
d.postMessage({
|
|
31
|
-
list: JSON.stringify(S[
|
|
36
|
+
list: JSON.stringify(S[o.name]),
|
|
32
37
|
keywords: e,
|
|
33
|
-
include: JSON.stringify(
|
|
38
|
+
include: JSON.stringify(o.include ?? [])
|
|
34
39
|
});
|
|
35
40
|
}
|
|
36
41
|
return {
|
|
37
|
-
data:
|
|
38
|
-
modelValue:
|
|
42
|
+
data: n,
|
|
43
|
+
modelValue: a,
|
|
39
44
|
onSearch: b,
|
|
40
45
|
onSelect: (e) => {
|
|
41
|
-
|
|
46
|
+
r("update:value", e);
|
|
42
47
|
},
|
|
43
48
|
onChange: () => {
|
|
44
|
-
|
|
49
|
+
r("update:value", a.value), r("change", a.value);
|
|
45
50
|
}
|
|
46
51
|
};
|
|
47
52
|
}
|
|
48
|
-
return (
|
|
49
|
-
const
|
|
50
|
-
return
|
|
51
|
-
value:
|
|
52
|
-
"onUpdate:value":
|
|
53
|
+
return (s, l) => {
|
|
54
|
+
const n = k("a-select");
|
|
55
|
+
return B(), L(n, {
|
|
56
|
+
value: t(u),
|
|
57
|
+
"onUpdate:value": l[0] || (l[0] = (a) => x(u) ? u.value = a : null),
|
|
53
58
|
"allow-clear": "",
|
|
54
59
|
"show-search": "",
|
|
55
60
|
"filter-option": !1,
|
|
56
|
-
options:
|
|
57
|
-
placeholder:
|
|
58
|
-
disabled:
|
|
59
|
-
onSelect:
|
|
60
|
-
onSearch:
|
|
61
|
-
onChange:
|
|
61
|
+
options: t(m),
|
|
62
|
+
placeholder: c.placeholder,
|
|
63
|
+
disabled: c.disabled,
|
|
64
|
+
onSelect: t(g),
|
|
65
|
+
onSearch: t(v),
|
|
66
|
+
onChange: t(C)
|
|
62
67
|
}, null, 8, ["value", "options", "placeholder", "disabled", "onSelect", "onSearch", "onChange"]);
|
|
63
68
|
};
|
|
64
69
|
}
|
|
65
70
|
});
|
|
66
71
|
export {
|
|
67
|
-
|
|
72
|
+
R as default
|
|
68
73
|
};
|
|
@@ -15,7 +15,6 @@ declare const DXTable: import("vue").DefineComponent<{
|
|
|
15
15
|
keys: PropType<Key[] | undefined>;
|
|
16
16
|
rowKey: {
|
|
17
17
|
type: PropType<string>;
|
|
18
|
-
required: boolean;
|
|
19
18
|
default: string;
|
|
20
19
|
};
|
|
21
20
|
loading: {
|
|
@@ -42,7 +41,6 @@ declare const DXTable: import("vue").DefineComponent<{
|
|
|
42
41
|
keys: PropType<Key[] | undefined>;
|
|
43
42
|
rowKey: {
|
|
44
43
|
type: PropType<string>;
|
|
45
|
-
required: boolean;
|
|
46
44
|
default: string;
|
|
47
45
|
};
|
|
48
46
|
loading: {
|
|
@@ -14,7 +14,6 @@ const M = () => ({
|
|
|
14
14
|
keys: Array,
|
|
15
15
|
rowKey: {
|
|
16
16
|
type: String,
|
|
17
|
-
required: !0,
|
|
18
17
|
default: "id"
|
|
19
18
|
},
|
|
20
19
|
loading: {
|
|
@@ -47,7 +46,7 @@ const M = () => ({
|
|
|
47
46
|
emit: w,
|
|
48
47
|
slots: C
|
|
49
48
|
}) {
|
|
50
|
-
const e = v(a.keys), z = S(() => a.data), P = S(() => {
|
|
49
|
+
const e = v(a.keys || []), z = S(() => a.data), P = S(() => {
|
|
51
50
|
var t;
|
|
52
51
|
return ((t = a.config) == null ? void 0 : t.columns) ?? [];
|
|
53
52
|
}), f = S(() => {
|
|
@@ -66,10 +65,10 @@ const M = () => ({
|
|
|
66
65
|
keepSelected: n,
|
|
67
66
|
selection: d,
|
|
68
67
|
onPageChange: s
|
|
69
|
-
} = a.config, c = v(), o = v(null), i = v(), l = v(null),
|
|
70
|
-
var
|
|
68
|
+
} = a.config, c = v(), o = v(null), i = v(), l = v(null), g = (h) => {
|
|
69
|
+
var r, k;
|
|
71
70
|
try {
|
|
72
|
-
const m = (
|
|
71
|
+
const m = (r = o == null ? void 0 : o.value) == null ? void 0 : r.$el, A = R(m.getElementsByClassName("ant-table-header")[0]);
|
|
73
72
|
let N = 0;
|
|
74
73
|
if (a.config.pagination) {
|
|
75
74
|
const J = (k = c.value) == null ? void 0 : k.getElementsByClassName(T)[0];
|
|
@@ -82,19 +81,19 @@ const M = () => ({
|
|
|
82
81
|
};
|
|
83
82
|
return U(() => {
|
|
84
83
|
a.height !== 0 && F(() => {
|
|
85
|
-
|
|
84
|
+
g(a.height);
|
|
86
85
|
});
|
|
87
86
|
}), {
|
|
88
87
|
tableRef: o,
|
|
89
88
|
tableRootRef: c,
|
|
90
89
|
tableHeight: i,
|
|
91
|
-
onPageChange: (h,
|
|
90
|
+
onPageChange: (h, r) => {
|
|
92
91
|
s && s({
|
|
93
92
|
page: h,
|
|
94
|
-
size:
|
|
93
|
+
size: r
|
|
95
94
|
}), l.value.scrollTop = 0, (d === "S" || !n) && (e.value = [], w("update:keys", e.value));
|
|
96
95
|
},
|
|
97
|
-
onRowClassName: (h,
|
|
96
|
+
onRowClassName: (h, r) => t ? t(h, r) : void 0
|
|
98
97
|
};
|
|
99
98
|
}
|
|
100
99
|
const j = D();
|
|
@@ -111,8 +110,8 @@ const M = () => ({
|
|
|
111
110
|
const s = (o, i) => {
|
|
112
111
|
n === "S" ? (e.value = [], e.value = i ? [o[t]] : []) : e.value = i ? e.value.concat(o[t]) : e.value.filter((l) => l !== o[t]), w("update:keys", e.value);
|
|
113
112
|
}, c = (o, i, l) => {
|
|
114
|
-
const
|
|
115
|
-
e.value = o ? e.value.concat(
|
|
113
|
+
const g = l.map((u) => u[t]);
|
|
114
|
+
e.value = o ? e.value.concat(g) : e.value.filter((u) => !g.includes(u)), w("update:keys", e.value);
|
|
116
115
|
};
|
|
117
116
|
return I(() => a.keys, (o) => {
|
|
118
117
|
e.value = o;
|
|
@@ -126,8 +125,8 @@ const M = () => ({
|
|
|
126
125
|
getCheckboxProps: d
|
|
127
126
|
};
|
|
128
127
|
}
|
|
129
|
-
const
|
|
130
|
-
function
|
|
128
|
+
const $ = q();
|
|
129
|
+
function q() {
|
|
131
130
|
return (t) => {
|
|
132
131
|
let n;
|
|
133
132
|
const {
|
|
@@ -138,7 +137,7 @@ const M = () => ({
|
|
|
138
137
|
selection: o,
|
|
139
138
|
getCheckboxProps: i
|
|
140
139
|
}
|
|
141
|
-
} = a, l = t[d],
|
|
140
|
+
} = a, l = t[d], g = () => {
|
|
142
141
|
if (o === "N")
|
|
143
142
|
return;
|
|
144
143
|
e.value.some((p) => p === l) ? e.value = e.value.filter((p) => p !== l) : (o === "S" && (e.value = []), e.value.push(l)), w("update:keys", e.value);
|
|
@@ -147,7 +146,7 @@ const M = () => ({
|
|
|
147
146
|
onClick: () => {
|
|
148
147
|
const u = i ? i(t) : null;
|
|
149
148
|
u && u.value === l || (clearTimeout(n), n = setTimeout(() => {
|
|
150
|
-
|
|
149
|
+
g(), s && s(t);
|
|
151
150
|
}, 200));
|
|
152
151
|
},
|
|
153
152
|
// 点击行
|
|
@@ -184,7 +183,7 @@ const M = () => ({
|
|
|
184
183
|
y: O.value + "px"
|
|
185
184
|
},
|
|
186
185
|
pagination: !1,
|
|
187
|
-
customRow:
|
|
186
|
+
customRow: $,
|
|
188
187
|
rowSelection: j,
|
|
189
188
|
rowClassName: H
|
|
190
189
|
}, {
|
|
@@ -10,7 +10,6 @@ export declare const DTable: import("../../utils/install").SFCWithInstall<import
|
|
|
10
10
|
keys: import("vue").PropType<import("./interface/table").Key[] | undefined>;
|
|
11
11
|
rowKey: {
|
|
12
12
|
type: import("vue").PropType<string>;
|
|
13
|
-
required: boolean;
|
|
14
13
|
default: string;
|
|
15
14
|
};
|
|
16
15
|
loading: {
|
|
@@ -37,7 +36,6 @@ export declare const DTable: import("../../utils/install").SFCWithInstall<import
|
|
|
37
36
|
keys: import("vue").PropType<import("./interface/table").Key[] | undefined>;
|
|
38
37
|
rowKey: {
|
|
39
38
|
type: import("vue").PropType<string>;
|
|
40
|
-
required: boolean;
|
|
41
39
|
default: string;
|
|
42
40
|
};
|
|
43
41
|
loading: {
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
const
|
|
2
|
-
mounted(
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const o = {
|
|
2
|
+
// mounted(el: HTMLInputElement) {
|
|
3
|
+
// // 监听 input 事件
|
|
4
|
+
// el.addEventListener("input", () => {
|
|
5
|
+
// // 修改 input 的值为去除空格后的值
|
|
6
|
+
// el.value = el.value.trim().replace(/\s+/g, "");
|
|
7
|
+
// });
|
|
8
|
+
// },
|
|
9
|
+
mounted(a, e) {
|
|
10
|
+
a.addEventListener("input", () => {
|
|
11
|
+
var t, l;
|
|
12
|
+
const u = a.value.trim().replace(/\s+/g, "");
|
|
13
|
+
a.value = u, e.value = u, (l = (t = e == null ? void 0 : e.instance) == null ? void 0 : t.$emit) == null || l.call(t, "onUpdate:modelValue", u);
|
|
5
14
|
});
|
|
6
15
|
}
|
|
7
16
|
};
|
|
8
17
|
export {
|
|
9
|
-
|
|
18
|
+
o as default
|
|
10
19
|
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref } from "vue";
|
|
2
|
+
import { 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
|
|
@@ -56,6 +56,14 @@ function useSelect() {
|
|
|
56
56
|
data.value = [...e.data];
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
// 当include变化的时候,需要重新发送搜索事件 返回对应的下拉数据
|
|
60
|
+
watch(
|
|
61
|
+
() => props.include,
|
|
62
|
+
() => {
|
|
63
|
+
sendWorkerSearch(modelValue.value);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
|
|
59
67
|
// 首次创建的时候发送
|
|
60
68
|
sendWorkerSearch(modelValue.value);
|
|
61
69
|
|
|
@@ -28,7 +28,6 @@ const tableProps = () => {
|
|
|
28
28
|
keys: Array as PropType<TableProps["keys"]>,
|
|
29
29
|
rowKey: {
|
|
30
30
|
type: String as PropType<TableProps["rowKey"]>,
|
|
31
|
-
required: true,
|
|
32
31
|
default: "id"
|
|
33
32
|
},
|
|
34
33
|
loading: {
|
|
@@ -82,7 +81,7 @@ const DXTable = defineComponent({
|
|
|
82
81
|
emits: ["update:keys"],
|
|
83
82
|
setup: function (props, { emit, slots }) {
|
|
84
83
|
// 保存选中的唯一id
|
|
85
|
-
const selectedRowKeys = ref<any>(props.keys);
|
|
84
|
+
const selectedRowKeys = ref<any>(props.keys || []);
|
|
86
85
|
// 数据源
|
|
87
86
|
const dataSource = computed(() => props.data);
|
|
88
87
|
// 表格列
|
package/src/directive/trim.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
+
import { DirectiveBinding } from "vue";
|
|
2
|
+
|
|
1
3
|
const vTrim = {
|
|
2
|
-
mounted(el: HTMLInputElement) {
|
|
3
|
-
|
|
4
|
+
// mounted(el: HTMLInputElement) {
|
|
5
|
+
// // 监听 input 事件
|
|
6
|
+
// el.addEventListener("input", () => {
|
|
7
|
+
// // 修改 input 的值为去除空格后的值
|
|
8
|
+
// el.value = el.value.trim().replace(/\s+/g, "");
|
|
9
|
+
// });
|
|
10
|
+
// },
|
|
11
|
+
mounted(el: HTMLInputElement, binding: DirectiveBinding<any>) {
|
|
4
12
|
el.addEventListener("input", () => {
|
|
5
|
-
|
|
6
|
-
el.value =
|
|
13
|
+
const value = el.value.trim().replace(/\s+/g, "");
|
|
14
|
+
el.value = value;
|
|
15
|
+
binding.value = value;
|
|
16
|
+
binding?.instance?.$emit?.("onUpdate:modelValue", value);
|
|
7
17
|
});
|
|
8
18
|
}
|
|
9
19
|
};
|