@ditari/bsui 1.0.49 → 1.0.50
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/grid/Grid.cjs.js +1 -1
- package/dist/cjs/components/grid/Grid.d.ts +9 -0
- package/dist/cjs/components/grid/index.d.ts +9 -0
- package/dist/cjs/components/table/Table.cjs.js +1 -1
- package/dist/esm/components/grid/Grid.d.ts +9 -0
- package/dist/esm/components/grid/Grid.esm.js +28 -22
- package/dist/esm/components/grid/index.d.ts +9 -0
- package/dist/esm/components/table/Table.esm.js +63 -64
- package/package.json +1 -1
- package/src/components/grid/Grid.tsx +11 -2
- package/src/components/table/Table.tsx +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=require("@vueuse/core"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=require("@vueuse/core"),y=require("pinia");require("../../store/modules/Breadcrumb.cjs.js");require("../../store/modules/DataDictionary.cjs.js");require("../../store/modules/KeepAlive.cjs.js");require("../../store/modules/Menu.cjs.js");require("../../store/modules/NavTab.cjs.js");const N=require("../../store/modules/Settings.cjs.js");require("../../store/modules/User.cjs.js");const S=require("../theme/index.cjs.js"),b=require("./GridItem.cjs.js"),h=`${S.prefixName}-grid`,V=e.defineComponent({name:"DGrid",props:{className:{type:String,default:""},fill:{type:Boolean,default:!0},grid:{type:String,default:""}},setup(t,{slots:r}){var c,o;if(!r.default)return()=>e.createVNode(e.Fragment,null,[e.createTextVNode("ok")]);const i=N.useSettingsStore(),{gridValue:u}=y.storeToRefs(i),n=((c=r==null?void 0:r.default()[0])==null?void 0:c.children.length)||(r==null?void 0:r.default().length),l=e.ref([]);u.value.value=t.grid!==""?t.grid:u.value.value;const d=e.ref({"grid-template-columns":((o=u.value)==null?void 0:o.value)??""});return q.useResizeObserver(document.body,()=>{var f,g;t.grid===""&&i.gridMatching(),d.value["grid-template-columns"]=((f=u.value)==null?void 0:f.value)??"";const a=(g=u.value)==null?void 0:g.col,m=Math.ceil(n/a),v=t.fill?m*a-n:0;l.value=Array.from({length:v},(p,s)=>s+1)}),()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:[h,t.className],style:d.value},[r.default&&r.default(l.value),l.value.map(a=>e.createVNode(b.default,{key:a},null))])])}});exports.default=V;
|
|
@@ -7,6 +7,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7
7
|
type: BooleanConstructor;
|
|
8
8
|
default: boolean;
|
|
9
9
|
};
|
|
10
|
+
grid: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
10
14
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
15
|
className: {
|
|
12
16
|
type: StringConstructor;
|
|
@@ -16,8 +20,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
16
20
|
type: BooleanConstructor;
|
|
17
21
|
default: boolean;
|
|
18
22
|
};
|
|
23
|
+
grid: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
19
27
|
}>>, {
|
|
20
28
|
fill: boolean;
|
|
21
29
|
className: string;
|
|
30
|
+
grid: string;
|
|
22
31
|
}>;
|
|
23
32
|
export default _default;
|
|
@@ -7,6 +7,10 @@ export declare const DGrid: import("../../utils/install").SFCWithInstall<import(
|
|
|
7
7
|
type: BooleanConstructor;
|
|
8
8
|
default: boolean;
|
|
9
9
|
};
|
|
10
|
+
grid: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
10
14
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
15
|
className: {
|
|
12
16
|
type: StringConstructor;
|
|
@@ -16,8 +20,13 @@ export declare const DGrid: import("../../utils/install").SFCWithInstall<import(
|
|
|
16
20
|
type: BooleanConstructor;
|
|
17
21
|
default: boolean;
|
|
18
22
|
};
|
|
23
|
+
grid: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
19
27
|
}>>, {
|
|
20
28
|
fill: boolean;
|
|
21
29
|
className: string;
|
|
30
|
+
grid: string;
|
|
22
31
|
}>>;
|
|
23
32
|
export declare const DGridItem: import("../../utils/install").SFCWithInstall<import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),C=require("ant-design-vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),C=require("ant-design-vue"),T=require("../../utils/html.cjs.js"),M=require("../theme/index.cjs.js"),Q=()=>({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:()=>({})},expandedRowKeys:{type:Object,default:()=>[]}}),b={defaultPageSize:20,hideOnSinglePage:!1,pageSizeOptions:["10","20","30","40"],responsive:!0,showQuickJumper:!0,showLessItems:!0,showTotal:n=>`总共 ${n} 条`},P=`${M.prefixName}-pagination`,I=t.defineComponent({name:"DTable",props:Q(),emits:["update:keys"],setup:function(n,{emit:p,slots:d}){const a=t.ref(n.keys||[]),z=t.computed(()=>n.data),E=t.computed(()=>{var e;return((e=n.config)==null?void 0:e.columns)??[]}),m=t.computed(()=>{var e;return((e=n.config)==null?void 0:e.pagination)??{}}),S=t.ref(n.expandedRowKeys);t.watchEffect(()=>{const{expandedRowKeys:e}=n;S.value=e});const{tableRef:K,tableRootRef:O,tableHeight:B,onPageChange:V,onRowClassName:H}=j();function j(){const{rowClassName:e,keepSelected:l,onPageChange:i}=n.config,f=n.config.selection??"N",r=t.ref(),c=t.ref(null),o=t.ref(),u=t.ref(null),g=s=>{var h,N;try{const w=(h=c==null?void 0:c.value)==null?void 0:h.$el,A=T.useEleHeight(w.getElementsByClassName("ant-table-header")[0]);let x=0;if(n.config.pagination){const J=(N=r.value)==null?void 0:N.getElementsByClassName(P)[0];x=T.useEleHeight(J)??0}o.value=s-(A+x),w.getElementsByClassName("ant-table-body")[0].style.height=o.value+"px",u.value=w.getElementsByClassName("ant-table-body")[0]}catch(w){console.warn(w)}};return t.watchEffect(()=>{n.height!==0&&t.nextTick(()=>{setTimeout(()=>{g(n.height)},10)})}),{tableRef:c,tableRootRef:r,tableHeight:o,onPageChange:(s,h)=>{i&&i({page:s,size:h}),u.value.scrollTop=0,(f==="S"||!l)&&(a.value=[],p("update:keys",a.value))},onRowClassName:(s,h)=>e?e(s,h):void 0}}const q=D();function D(){const{rowKey:e,config:{getCheckboxProps:l}}=n;let i=n.config.selection??"N";const f=(o,u)=>{i==="S"?(a.value=[],a.value=u?[o[e]]:[]):a.value=u?a.value.concat(o[e]):a.value.filter(g=>g!==o[e]),p("update:keys",a.value)},r=(o,u,g)=>{const v=g.map(y=>y[e]);a.value=o?a.value.concat(v):a.value.filter(y=>!v.includes(y)),p("update:keys",a.value)};t.watch(()=>n.keys,o=>{a.value=o});const c=t.ref(void 0);return t.watchEffect(()=>{const{selection:o}=n.config;i=o,i!=="N"?c.value={selectedRowKeys:a,onSelect:f,onSelectAll:r,fixed:!0,columnTitle:i==="S"?"选择":null,columnWidth:i==="S"?60:40,getCheckboxProps:l}:c.value=void 0}),c}const F=U();function U(){return e=>{let l;const{rowKey:i,config:{click:f,dbClick:r,selection:c,getCheckboxProps:o}}=n,u=e[i],g=()=>{const v=o===void 0?!1:o(e).disabled;if(c==="N"||v)return;a.value.some(s=>s===u)?a.value=a.value.filter(s=>s!==u):(c==="S"&&(a.value=[]),a.value.push(u)),p("update:keys",a.value)};return{onClick:()=>{clearTimeout(l),l=setTimeout(()=>{g(),f&&f(e)},200)},onDblclick:()=>{clearTimeout(l),r&&r(e)}}}}const R=e=>{e.stopPropagation()},_=t.computed(()=>{const{selection:e}=n.config;return e==="N"}),k={};d.expandedRowRender&&(k.expandedRowRender=e=>t.createVNode(t.Fragment,null,[d.expandedRowRender&&d.expandedRowRender(e)]));const $=()=>t.createVNode(t.Fragment,null,[d.summary&&d.summary()]);return()=>{var e;return t.createVNode("div",{ref:O,style:{height:"100%"}},[t.createVNode(C.Table,{ref:K,"row-key":n.rowKey,bordered:n.config.bordered,columns:E.value,dataSource:z.value,loading:n.loading,size:((e=n.config)==null?void 0:e.size)??"small",scroll:{scrollToFirstRowOnChange:!0,x:"100%",y:B.value+"px"},expandedRowKeys:S.value,"onUpdate:expandedRowKeys":l=>S.value=l,expandRowByClick:_.value,pagination:!1,customRow:F,rowSelection:q.value,rowClassName:H},{bodyCell:({column:l,record:i})=>{if(l.slot==="action")return t.createVNode("div",{onClick:R,onDblclick:R},[t.createVNode(C.Space,null,{default:()=>[d.action&&d.action(i)]})])},...k,summary:$}),t.withDirectives(t.createVNode(C.Pagination,{class:[P],current:m.value.current,"onUpdate:current":l=>m.value.current=l,pageSize:m.value.pageSize,"onUpdate:pageSize":l=>m.value.pageSize=l,disabled:n.loading,"show-size-changer":!0,size:"default","hide-on-single-page":b.hideOnSinglePage,"show-quick-jumper":b.showQuickJumper,"default-page-size":b.defaultPageSize,"page-size-options":b.pageSizeOptions,"show-total":b.showTotal,total:m.value.total,onChange:V},null),[[t.vShow,n.config.pagination]])])}}});exports.default=I;
|
|
@@ -7,6 +7,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7
7
|
type: BooleanConstructor;
|
|
8
8
|
default: boolean;
|
|
9
9
|
};
|
|
10
|
+
grid: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
10
14
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
15
|
className: {
|
|
12
16
|
type: StringConstructor;
|
|
@@ -16,8 +20,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
16
20
|
type: BooleanConstructor;
|
|
17
21
|
default: boolean;
|
|
18
22
|
};
|
|
23
|
+
grid: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
19
27
|
}>>, {
|
|
20
28
|
fill: boolean;
|
|
21
29
|
className: string;
|
|
30
|
+
grid: string;
|
|
22
31
|
}>;
|
|
23
32
|
export default _default;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as s, createVNode as l, Fragment as g, createTextVNode as N, ref as p } from "vue";
|
|
2
2
|
import { useResizeObserver as b } from "@vueuse/core";
|
|
3
|
-
import { storeToRefs as
|
|
3
|
+
import { storeToRefs as S } from "pinia";
|
|
4
4
|
import "../../store/modules/Breadcrumb.esm.js";
|
|
5
5
|
import "../../store/modules/DataDictionary.esm.js";
|
|
6
6
|
import "../../store/modules/KeepAlive.esm.js";
|
|
7
7
|
import "../../store/modules/Menu.esm.js";
|
|
8
8
|
import "../../store/modules/NavTab.esm.js";
|
|
9
|
-
import { useSettingsStore as
|
|
9
|
+
import { useSettingsStore as C } from "../../store/modules/Settings.esm.js";
|
|
10
10
|
import "../../store/modules/User.esm.js";
|
|
11
|
-
import { prefixName as
|
|
11
|
+
import { prefixName as G } from "../theme/index.esm.js";
|
|
12
12
|
import x from "./GridItem.esm.js";
|
|
13
|
-
const V = `${
|
|
13
|
+
const V = `${G}-grid`, $ = /* @__PURE__ */ s({
|
|
14
14
|
name: "DGrid",
|
|
15
15
|
props: {
|
|
16
16
|
// css class
|
|
@@ -22,31 +22,37 @@ const V = `${S}-grid`, $ = /* @__PURE__ */ y({
|
|
|
22
22
|
fill: {
|
|
23
23
|
type: Boolean,
|
|
24
24
|
default: !0
|
|
25
|
+
},
|
|
26
|
+
grid: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
25
29
|
}
|
|
26
30
|
},
|
|
27
|
-
setup(
|
|
31
|
+
setup(t, {
|
|
28
32
|
slots: e
|
|
29
33
|
}) {
|
|
30
|
-
var
|
|
34
|
+
var o, d;
|
|
31
35
|
if (!e.default)
|
|
32
|
-
return () =>
|
|
33
|
-
const
|
|
34
|
-
gridValue:
|
|
35
|
-
} =
|
|
36
|
-
|
|
36
|
+
return () => l(g, null, [N("ok")]);
|
|
37
|
+
const u = C(), {
|
|
38
|
+
gridValue: r
|
|
39
|
+
} = S(u), n = ((o = e == null ? void 0 : e.default()[0]) == null ? void 0 : o.children.length) || (e == null ? void 0 : e.default().length), i = p([]);
|
|
40
|
+
r.value.value = t.grid !== "" ? t.grid : r.value.value;
|
|
41
|
+
const m = p({
|
|
42
|
+
"grid-template-columns": ((d = r.value) == null ? void 0 : d.value) ?? ""
|
|
37
43
|
});
|
|
38
44
|
return b(document.body, () => {
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
length:
|
|
45
|
+
var f, c;
|
|
46
|
+
t.grid === "" && u.gridMatching(), m.value["grid-template-columns"] = ((f = r.value) == null ? void 0 : f.value) ?? "";
|
|
47
|
+
const a = (c = r.value) == null ? void 0 : c.col, v = Math.ceil(n / a), y = t.fill ? v * a - n : 0;
|
|
48
|
+
i.value = Array.from({
|
|
49
|
+
length: y
|
|
44
50
|
}, (k, h) => h + 1);
|
|
45
|
-
}), () =>
|
|
46
|
-
class: [V,
|
|
47
|
-
style:
|
|
48
|
-
}, [e.default && e.default(
|
|
49
|
-
key:
|
|
51
|
+
}), () => l(g, null, [l("div", {
|
|
52
|
+
class: [V, t.className],
|
|
53
|
+
style: m.value
|
|
54
|
+
}, [e.default && e.default(i.value), i.value.map((a) => l(x, {
|
|
55
|
+
key: a
|
|
50
56
|
}, null))])]);
|
|
51
57
|
}
|
|
52
58
|
});
|
|
@@ -7,6 +7,10 @@ export declare const DGrid: import("../../utils/install").SFCWithInstall<import(
|
|
|
7
7
|
type: BooleanConstructor;
|
|
8
8
|
default: boolean;
|
|
9
9
|
};
|
|
10
|
+
grid: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
10
14
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
15
|
className: {
|
|
12
16
|
type: StringConstructor;
|
|
@@ -16,8 +20,13 @@ export declare const DGrid: import("../../utils/install").SFCWithInstall<import(
|
|
|
16
20
|
type: BooleanConstructor;
|
|
17
21
|
default: boolean;
|
|
18
22
|
};
|
|
23
|
+
grid: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
19
27
|
}>>, {
|
|
20
28
|
fill: boolean;
|
|
21
29
|
className: string;
|
|
30
|
+
grid: string;
|
|
22
31
|
}>>;
|
|
23
32
|
export declare const DGridItem: import("../../utils/install").SFCWithInstall<import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as X, ref as r, computed as C, watchEffect as k, nextTick as _, watch as G, createVNode as f, withDirectives as M, vShow as Y, Fragment as
|
|
1
|
+
import { defineComponent as X, ref as r, computed as C, watchEffect as k, nextTick as _, watch as G, createVNode as f, withDirectives as M, vShow as Y, Fragment as z } from "vue";
|
|
2
2
|
import { Table as Z, Space as ee, Pagination as te } from "ant-design-vue";
|
|
3
|
-
import { useEleHeight as
|
|
3
|
+
import { useEleHeight as K } from "../../utils/html.esm.js";
|
|
4
4
|
import { prefixName as ne } from "../theme/index.esm.js";
|
|
5
5
|
const ae = () => ({
|
|
6
6
|
data: {
|
|
@@ -32,7 +32,7 @@ const ae = () => ({
|
|
|
32
32
|
type: Object,
|
|
33
33
|
default: () => []
|
|
34
34
|
}
|
|
35
|
-
}),
|
|
35
|
+
}), b = {
|
|
36
36
|
defaultPageSize: 20,
|
|
37
37
|
hideOnSinglePage: !1,
|
|
38
38
|
pageSizeOptions: ["10", "20", "30", "40"],
|
|
@@ -40,7 +40,7 @@ const ae = () => ({
|
|
|
40
40
|
showQuickJumper: !0,
|
|
41
41
|
showLessItems: !0,
|
|
42
42
|
showTotal: (t) => `总共 ${t} 条`
|
|
43
|
-
},
|
|
43
|
+
}, E = `${ne}-pagination`, ce = /* @__PURE__ */ X({
|
|
44
44
|
name: "DTable",
|
|
45
45
|
props: ae(),
|
|
46
46
|
// emits: { "update:keys": (keys: []) => void }
|
|
@@ -50,10 +50,10 @@ const ae = () => ({
|
|
|
50
50
|
emit: S,
|
|
51
51
|
slots: s
|
|
52
52
|
}) {
|
|
53
|
-
const n = r(t.keys || []), O = C(() => t.data),
|
|
53
|
+
const n = r(t.keys || []), O = C(() => t.data), B = C(() => {
|
|
54
54
|
var e;
|
|
55
55
|
return ((e = t.config) == null ? void 0 : e.columns) ?? [];
|
|
56
|
-
}),
|
|
56
|
+
}), v = C(() => {
|
|
57
57
|
var e;
|
|
58
58
|
return ((e = t.config) == null ? void 0 : e.pagination) ?? {};
|
|
59
59
|
}), R = r(t.expandedRowKeys);
|
|
@@ -64,30 +64,29 @@ const ae = () => ({
|
|
|
64
64
|
R.value = e;
|
|
65
65
|
});
|
|
66
66
|
const {
|
|
67
|
-
tableRef:
|
|
68
|
-
tableRootRef:
|
|
69
|
-
tableHeight:
|
|
70
|
-
onPageChange:
|
|
71
|
-
onRowClassName:
|
|
72
|
-
} =
|
|
73
|
-
function
|
|
67
|
+
tableRef: H,
|
|
68
|
+
tableRootRef: j,
|
|
69
|
+
tableHeight: D,
|
|
70
|
+
onPageChange: U,
|
|
71
|
+
onRowClassName: $
|
|
72
|
+
} = q();
|
|
73
|
+
function q() {
|
|
74
74
|
const {
|
|
75
75
|
rowClassName: e,
|
|
76
76
|
keepSelected: o,
|
|
77
77
|
onPageChange: l
|
|
78
|
-
} = t.config, m = t.config.selection ?? "N", d = r(), i = r(null), a = r(),
|
|
78
|
+
} = t.config, m = t.config.selection ?? "N", d = r(), i = r(null), a = r(), u = r(null), g = (c) => {
|
|
79
79
|
var h, T;
|
|
80
80
|
try {
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
let z = 0;
|
|
81
|
+
const p = (h = i == null ? void 0 : i.value) == null ? void 0 : h.$el, V = K(p.getElementsByClassName("ant-table-header")[0]);
|
|
82
|
+
let P = 0;
|
|
84
83
|
if (t.config.pagination) {
|
|
85
|
-
const W = (T = d.value) == null ? void 0 : T.getElementsByClassName(
|
|
86
|
-
|
|
84
|
+
const W = (T = d.value) == null ? void 0 : T.getElementsByClassName(E)[0];
|
|
85
|
+
P = K(W) ?? 0;
|
|
87
86
|
}
|
|
88
|
-
a.value =
|
|
89
|
-
} catch (
|
|
90
|
-
console.warn(
|
|
87
|
+
a.value = c - (V + P), p.getElementsByClassName("ant-table-body")[0].style.height = a.value + "px", u.value = p.getElementsByClassName("ant-table-body")[0];
|
|
88
|
+
} catch (p) {
|
|
89
|
+
console.warn(p);
|
|
91
90
|
}
|
|
92
91
|
};
|
|
93
92
|
return k(() => {
|
|
@@ -100,17 +99,17 @@ const ae = () => ({
|
|
|
100
99
|
tableRef: i,
|
|
101
100
|
tableRootRef: d,
|
|
102
101
|
tableHeight: a,
|
|
103
|
-
onPageChange: (
|
|
102
|
+
onPageChange: (c, h) => {
|
|
104
103
|
l && l({
|
|
105
|
-
page:
|
|
104
|
+
page: c,
|
|
106
105
|
size: h
|
|
107
|
-
}),
|
|
106
|
+
}), u.value.scrollTop = 0, (m === "S" || !o) && (n.value = [], S("update:keys", n.value));
|
|
108
107
|
},
|
|
109
|
-
onRowClassName: (
|
|
108
|
+
onRowClassName: (c, h) => e ? e(c, h) : void 0
|
|
110
109
|
};
|
|
111
110
|
}
|
|
112
|
-
const
|
|
113
|
-
function
|
|
111
|
+
const A = F();
|
|
112
|
+
function F() {
|
|
114
113
|
const {
|
|
115
114
|
rowKey: e,
|
|
116
115
|
config: {
|
|
@@ -118,11 +117,11 @@ const ae = () => ({
|
|
|
118
117
|
}
|
|
119
118
|
} = t;
|
|
120
119
|
let l = t.config.selection ?? "N";
|
|
121
|
-
const m = (a,
|
|
122
|
-
l === "S" ? (n.value = [], n.value =
|
|
123
|
-
}, d = (a,
|
|
124
|
-
const
|
|
125
|
-
n.value = a ? n.value.concat(
|
|
120
|
+
const m = (a, u) => {
|
|
121
|
+
l === "S" ? (n.value = [], n.value = u ? [a[e]] : []) : n.value = u ? n.value.concat(a[e]) : n.value.filter((g) => g !== a[e]), S("update:keys", n.value);
|
|
122
|
+
}, d = (a, u, g) => {
|
|
123
|
+
const y = g.map((w) => w[e]);
|
|
124
|
+
n.value = a ? n.value.concat(y) : n.value.filter((w) => !y.includes(w)), S("update:keys", n.value);
|
|
126
125
|
};
|
|
127
126
|
G(() => t.keys, (a) => {
|
|
128
127
|
n.value = a;
|
|
@@ -143,8 +142,8 @@ const ae = () => ({
|
|
|
143
142
|
} : i.value = void 0;
|
|
144
143
|
}), i;
|
|
145
144
|
}
|
|
146
|
-
const
|
|
147
|
-
function
|
|
145
|
+
const J = Q();
|
|
146
|
+
function Q() {
|
|
148
147
|
return (e) => {
|
|
149
148
|
let o;
|
|
150
149
|
const {
|
|
@@ -155,11 +154,11 @@ const ae = () => ({
|
|
|
155
154
|
selection: i,
|
|
156
155
|
getCheckboxProps: a
|
|
157
156
|
}
|
|
158
|
-
} = t,
|
|
159
|
-
const
|
|
160
|
-
if (i === "N" ||
|
|
157
|
+
} = t, u = e[l], g = () => {
|
|
158
|
+
const y = a === void 0 ? !1 : a(e).disabled;
|
|
159
|
+
if (i === "N" || y)
|
|
161
160
|
return;
|
|
162
|
-
n.value.some((
|
|
161
|
+
n.value.some((c) => c === u) ? n.value = n.value.filter((c) => c !== u) : (i === "S" && (n.value = []), n.value.push(u)), S("update:keys", n.value);
|
|
163
162
|
};
|
|
164
163
|
return {
|
|
165
164
|
onClick: () => {
|
|
@@ -185,41 +184,41 @@ const ae = () => ({
|
|
|
185
184
|
}
|
|
186
185
|
const x = (e) => {
|
|
187
186
|
e.stopPropagation();
|
|
188
|
-
},
|
|
187
|
+
}, I = C(() => {
|
|
189
188
|
const {
|
|
190
189
|
selection: e
|
|
191
190
|
} = t.config;
|
|
192
191
|
return e === "N";
|
|
193
192
|
}), N = {};
|
|
194
|
-
s.expandedRowRender && (N.expandedRowRender = (e) => f(
|
|
195
|
-
const
|
|
193
|
+
s.expandedRowRender && (N.expandedRowRender = (e) => f(z, null, [s.expandedRowRender && s.expandedRowRender(e)]));
|
|
194
|
+
const L = () => f(z, null, [s.summary && s.summary()]);
|
|
196
195
|
return () => {
|
|
197
196
|
var e;
|
|
198
197
|
return f("div", {
|
|
199
|
-
ref:
|
|
198
|
+
ref: j,
|
|
200
199
|
style: {
|
|
201
200
|
height: "100%"
|
|
202
201
|
}
|
|
203
202
|
}, [f(Z, {
|
|
204
|
-
ref:
|
|
203
|
+
ref: H,
|
|
205
204
|
"row-key": t.rowKey,
|
|
206
205
|
bordered: t.config.bordered,
|
|
207
|
-
columns:
|
|
206
|
+
columns: B.value,
|
|
208
207
|
dataSource: O.value,
|
|
209
208
|
loading: t.loading,
|
|
210
209
|
size: ((e = t.config) == null ? void 0 : e.size) ?? "small",
|
|
211
210
|
scroll: {
|
|
212
211
|
scrollToFirstRowOnChange: !0,
|
|
213
212
|
x: "100%",
|
|
214
|
-
y:
|
|
213
|
+
y: D.value + "px"
|
|
215
214
|
},
|
|
216
215
|
expandedRowKeys: R.value,
|
|
217
216
|
"onUpdate:expandedRowKeys": (o) => R.value = o,
|
|
218
|
-
expandRowByClick:
|
|
217
|
+
expandRowByClick: I.value,
|
|
219
218
|
pagination: !1,
|
|
220
|
-
customRow:
|
|
221
|
-
rowSelection:
|
|
222
|
-
rowClassName:
|
|
219
|
+
customRow: J,
|
|
220
|
+
rowSelection: A.value,
|
|
221
|
+
rowClassName: $
|
|
223
222
|
}, {
|
|
224
223
|
bodyCell: ({
|
|
225
224
|
column: o,
|
|
@@ -235,27 +234,27 @@ const ae = () => ({
|
|
|
235
234
|
},
|
|
236
235
|
...N,
|
|
237
236
|
// 总结栏插槽
|
|
238
|
-
summary:
|
|
237
|
+
summary: L
|
|
239
238
|
}), M(f(te, {
|
|
240
|
-
class: [
|
|
241
|
-
current:
|
|
242
|
-
"onUpdate:current": (o) =>
|
|
243
|
-
pageSize:
|
|
244
|
-
"onUpdate:pageSize": (o) =>
|
|
239
|
+
class: [E],
|
|
240
|
+
current: v.value.current,
|
|
241
|
+
"onUpdate:current": (o) => v.value.current = o,
|
|
242
|
+
pageSize: v.value.pageSize,
|
|
243
|
+
"onUpdate:pageSize": (o) => v.value.pageSize = o,
|
|
245
244
|
disabled: t.loading,
|
|
246
245
|
"show-size-changer": !0,
|
|
247
246
|
size: "default",
|
|
248
|
-
"hide-on-single-page":
|
|
249
|
-
"show-quick-jumper":
|
|
250
|
-
"default-page-size":
|
|
251
|
-
"page-size-options":
|
|
252
|
-
"show-total":
|
|
253
|
-
total:
|
|
254
|
-
onChange:
|
|
247
|
+
"hide-on-single-page": b.hideOnSinglePage,
|
|
248
|
+
"show-quick-jumper": b.showQuickJumper,
|
|
249
|
+
"default-page-size": b.defaultPageSize,
|
|
250
|
+
"page-size-options": b.pageSizeOptions,
|
|
251
|
+
"show-total": b.showTotal,
|
|
252
|
+
total: v.value.total,
|
|
253
|
+
onChange: U
|
|
255
254
|
}, null), [[Y, t.config.pagination]])]);
|
|
256
255
|
};
|
|
257
256
|
}
|
|
258
257
|
});
|
|
259
258
|
export {
|
|
260
|
-
|
|
259
|
+
ce as default
|
|
261
260
|
};
|
package/package.json
CHANGED
|
@@ -22,6 +22,10 @@ export default defineComponent({
|
|
|
22
22
|
fill: {
|
|
23
23
|
type: Boolean,
|
|
24
24
|
default: true
|
|
25
|
+
},
|
|
26
|
+
grid: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
25
29
|
}
|
|
26
30
|
},
|
|
27
31
|
setup(props, { slots }: any) {
|
|
@@ -40,6 +44,9 @@ export default defineComponent({
|
|
|
40
44
|
// 要填充空白的网格数
|
|
41
45
|
const fillGridItems = ref<number[]>([]);
|
|
42
46
|
|
|
47
|
+
gridValue.value.value =
|
|
48
|
+
props.grid !== "" ? props.grid : gridValue.value.value;
|
|
49
|
+
|
|
43
50
|
// 网格列
|
|
44
51
|
const baseStyle = ref<any>({
|
|
45
52
|
"grid-template-columns": gridValue.value?.value ?? ""
|
|
@@ -48,8 +55,10 @@ export default defineComponent({
|
|
|
48
55
|
//监听屏幕尺寸变化,一般只有人工拉大屏幕尺寸才会触发(默认执行一次)
|
|
49
56
|
useResizeObserver(document.body, () => {
|
|
50
57
|
//TODO 检测浏览器是否被缩放
|
|
51
|
-
//
|
|
52
|
-
|
|
58
|
+
// TODO 使用store 会存在所有的配置均有一个对象bug
|
|
59
|
+
if (props.grid === "") {
|
|
60
|
+
store.gridMatching();
|
|
61
|
+
}
|
|
53
62
|
baseStyle.value["grid-template-columns"] = gridValue.value?.value ?? "";
|
|
54
63
|
// 获取当前设备匹配到显示的列数配置
|
|
55
64
|
const colCount = gridValue.value?.col;
|
|
@@ -141,8 +141,6 @@ const DXTable = defineComponent({
|
|
|
141
141
|
const headerHeight = useEleHeight(
|
|
142
142
|
tableEl.getElementsByClassName("ant-table-header")[0]
|
|
143
143
|
);
|
|
144
|
-
console.log(tableEl.getElementsByClassName("ant-table-header")[0]);
|
|
145
|
-
console.log(headerHeight);
|
|
146
144
|
// 获取分页组件高度
|
|
147
145
|
let paginationHeight = 0;
|
|
148
146
|
if (props.config.pagination) {
|