@ditari/bsui 1.0.31 → 1.0.32
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/layout/List.vue.cjs.js +1 -1
- package/dist/cjs/components/layout/Main.vue.cjs.js +1 -1
- package/dist/cjs/components/table/Table.cjs.js +1 -1
- package/dist/esm/components/layout/List.vue.esm.js +56 -54
- package/dist/esm/components/layout/Main.vue.esm.js +20 -19
- package/dist/esm/components/table/Table.esm.js +16 -13
- package/package.json +1 -1
- package/src/components/layout/List.vue +4 -4
- package/src/components/layout/Main.vue +1 -0
- package/src/components/table/Table.tsx +2 -2
|
@@ -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"),g=require("../../store/modules/Settings.cjs.js"),y=require("pinia"),w=require("vue-router"),N={class:"ditari-list-layout"},V={ref:"contentRef",class:"wrapper"},C={style:{height:"100%"}},b={class:"ditari-content-extra"},x={name:"DListLayout"},E=e.defineComponent({...x,emits:["refresh"],setup(R,{emit:u}){const l=e.useSlots(),v=g.useSettingsStore(),h=w.useRoute(),n=e.inject("configProvider"),{refresh:a}=y.storeToRefs(v),_=e.ref(),o=e.ref(),f=16,s=e.ref(!1),i=e.ref(0);let r;e.nextTick(()=>{setTimeout(()=>{var t;i.value=(t=o==null?void 0:o.value)==null?void 0:t.offsetHeight,s.value=!0},1)}),e.watch(()=>n==null?void 0:n.componentSize,t=>{s.value=!1,setTimeout(()=>{var c;i.value=(c=o==null?void 0:o.value)==null?void 0:c.offsetHeight,s.value=!0},100)}),p();function p(){h.name?(e.onActivated(()=>{a.value&&(a.value=!1,u("refresh")),r=d()}),e.onDeactivated(()=>{r()})):(r=d(),e.onUnmounted(()=>{r()}))}function d(){return e.watch(()=>a.value,t=>{t&&u("refresh")})}return(t,c)=>{const m=e.resolveComponent("a-card"),S=e.resolveComponent("a-space");return e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",V,[e.createVNode(m,{ref:"formRef",bordered:!1,class:e.normalizeClass({"ditari-list-form":e.unref(l).form}),style:e.normalizeStyle({"margin-bottom":e.unref(l).form?f+"px":0})},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"form")]),_:3},8,["class","style"]),e.createVNode(m,{class:"ditari-list-table",bordered:!1},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"toolsRef",ref:_,class:"xi-tools",style:e.normalizeStyle({"margin-bottom":e.unref(l).tools?f+"px":0})},[e.createVNode(S,null,{default:e.withCtx(()=>[e.renderSlot(t.$slots,"tools")]),_:3})],4),e.createElementVNode("div",{ref_key:"tableRef",ref:o,style:{flex:"1"}},[e.withDirectives(e.createElementVNode("div",C,[e.renderSlot(t.$slots,"table",{height:i.value})],512),[[e.vShow,s.value]])],512)]),_:3})],512),e.createElementVNode("div",b,[e.renderSlot(t.$slots,"default")])])}}});exports.default=E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("@ant-design/icons-vue");require("../../store/modules/Breadcrumb.cjs.js");require("../../store/modules/DataDictionary.cjs.js");const f=require("../../store/modules/KeepAlive.cjs.js");require("../../store/modules/Menu.cjs.js");require("../../store/modules/NavTab.cjs.js");const v=require("../../store/modules/Settings.cjs.js");require("../../store/modules/User.cjs.js");const y=require("./NavTabs.vue.cjs.js"),g=require("./Breadcrumb.vue.cjs.js"),k=require("../menu/Menu.cjs.js"),N={class:"ditari-logo"},V={class:"ditari-menu"},C={class:"ditari-layout-header"},h={class:"ditari-layout-header-left"},
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("@ant-design/icons-vue");require("../../store/modules/Breadcrumb.cjs.js");require("../../store/modules/DataDictionary.cjs.js");const f=require("../../store/modules/KeepAlive.cjs.js");require("../../store/modules/Menu.cjs.js");require("../../store/modules/NavTab.cjs.js");const v=require("../../store/modules/Settings.cjs.js");require("../../store/modules/User.cjs.js");const y=require("./NavTabs.vue.cjs.js"),g=require("./Breadcrumb.vue.cjs.js"),k=require("../menu/Menu.cjs.js"),N={class:"ditari-logo"},V={class:"ditari-menu"},C={class:"ditari-layout-header"},h={class:"ditari-layout-header-left"},S={class:"ditari-user-menu"},q={name:"DMainLayout"},b=e.defineComponent({...q,setup(w){const c=f.useKeepAliveStore(),u=e.computed(()=>c.get),l=v.useSettingsStore(),{switchCollapsed:a}=l,t=e.computed(()=>l.getCollapsed);return(n,r)=>{const d=e.resolveComponent("a-layout-sider"),p=e.resolveComponent("router-view"),_=e.resolveComponent("a-layout-content"),s=e.resolveComponent("a-layout"),m=e.resolveComponent("a-back-top");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(s,{class:"ditari-layout"},{default:e.withCtx(()=>[e.createVNode(d,{collapsed:e.unref(t),"onUpdate:collapsed":r[0]||(r[0]=o=>e.isRef(t)?t.value=o:null),trigger:null,collapsible:"",class:"ditari-layout-sider"},{default:e.withCtx(()=>[e.createElementVNode("div",N,[e.renderSlot(n.$slots,"logo")]),e.createElementVNode("div",V,[e.createVNode(e.unref(k.default))])]),_:3},8,["collapsed"]),e.createVNode(s,null,{default:e.withCtx(()=>[e.createElementVNode("div",{class:"ditari-top-layout",style:e.normalizeStyle({left:e.unref(t)?"80px":"200px"})},[e.createVNode(y.default),e.createElementVNode("div",C,[e.createElementVNode("div",h,[e.createElementVNode("div",{class:"ditari-side-collapsed",onClick:r[1]||(r[1]=(...o)=>e.unref(a)&&e.unref(a)(...o))},[e.unref(t)?(e.openBlock(),e.createBlock(e.unref(i.MenuUnfoldOutlined),{key:0,class:"trigger",style:{"font-size":"16px","font-weight":"bold",cursor:"pointer"}})):(e.openBlock(),e.createBlock(e.unref(i.MenuFoldOutlined),{key:1,style:{"font-size":"16px","font-weight":"bold",cursor:"pointer"}}))]),e.createVNode(g.default)]),e.createElementVNode("div",S,[e.renderSlot(n.$slots,"operation")])])],4),e.createVNode(_,{class:"ditari-layout-content",style:e.normalizeStyle({marginLeft:e.unref(t)?"80px":"200px"})},{default:e.withCtx(()=>[e.createVNode(p,null,{default:e.withCtx(({Component:o})=>[e.createVNode(e.Transition,{name:"main",mode:"out-in",appear:""},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.KeepAlive,{ref:"keepAliveRef",include:e.unref(u)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o),{key:n.$route.path}))],1032,["include"]))]),_:2},1024)]),_:1}),e.renderSlot(n.$slots,"micro")]),_:3},8,["style"])]),_:3})]),_:3}),e.createVNode(m,{class:"ditari-ant-back-top",visibilityHeight:50})],64)}}});exports.default=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),C=require("ant-design-vue"),P=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} 条`},T=`${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,h=n.config.selection??"N",r=t.ref(),c=t.ref(null),o=t.ref(),u=t.ref(null),g=y=>{var v,N;try{const w=(v=c==null?void 0:c.value)==null?void 0:v.$el,A=P.useEleHeight(w.getElementsByClassName("ant-table-header")[0]);let x=0;if(n.config.pagination){const J=(N=r.value)==null?void 0:N.getElementsByClassName(T)[0];x=P.useEleHeight(J)??0}o.value=y-(A+x),w.getElementsByClassName("ant-table-body")[0].style.height=o.value
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),C=require("ant-design-vue"),P=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} 条`},T=`${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,h=n.config.selection??"N",r=t.ref(),c=t.ref(null),o=t.ref(),u=t.ref(null),g=y=>{var v,N;try{const w=(v=c==null?void 0:c.value)==null?void 0:v.$el,A=P.useEleHeight(w.getElementsByClassName("ant-table-header")[0]);let x=0;if(n.config.pagination){const J=(N=r.value)==null?void 0:N.getElementsByClassName(T)[0];x=P.useEleHeight(J)??0}o.value=y-(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(()=>{g(n.height)})}),{tableRef:c,tableRootRef:r,tableHeight:o,onPageChange:(y,v)=>{i&&i({page:y,size:v}),u.value.scrollTop=0,(h==="S"||!l)&&(a.value=[],p("update:keys",a.value))},onRowClassName:(y,v)=>e?e(y,v):void 0}}const q=D();function D(){const{rowKey:e,config:{getCheckboxProps:l}}=n;let i=n.config.selection??"N";const h=(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 f=g.map(s=>s[e]);a.value=o?a.value.concat(f):a.value.filter(s=>!f.includes(s)),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:h,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:h,dbClick:r,selection:c,getCheckboxProps:o}}=n,u=e[i],g=()=>{if(c==="N")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:()=>{const f=o?o(e):null;f&&f.value===u||(clearTimeout(l),l=setTimeout(()=>{g(),h&&h(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:[T],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;
|
|
@@ -1,102 +1,104 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useSettingsStore as
|
|
3
|
-
import { storeToRefs as
|
|
4
|
-
import { useRoute as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as T, useSlots as $, inject as z, ref as l, nextTick as B, watch as g, onUnmounted as D, onActivated as H, onDeactivated as E, resolveComponent as S, openBlock as L, createElementBlock as N, createElementVNode as o, createVNode as d, normalizeClass as V, unref as m, normalizeStyle as w, withCtx as _, renderSlot as r, withDirectives as W, vShow as j } from "vue";
|
|
2
|
+
import { useSettingsStore as A } from "../../store/modules/Settings.esm.js";
|
|
3
|
+
import { storeToRefs as U } from "pinia";
|
|
4
|
+
import { useRoute as q } from "vue-router";
|
|
5
|
+
const F = { class: "ditari-list-layout" }, G = {
|
|
6
6
|
ref: "contentRef",
|
|
7
7
|
class: "wrapper"
|
|
8
|
-
},
|
|
8
|
+
}, I = { style: { height: "100%" } }, J = { class: "ditari-content-extra" }, K = {
|
|
9
9
|
name: "DListLayout"
|
|
10
|
-
},
|
|
11
|
-
...
|
|
10
|
+
}, Y = /* @__PURE__ */ T({
|
|
11
|
+
...K,
|
|
12
12
|
emits: ["refresh"],
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
15
|
-
let
|
|
16
|
-
|
|
13
|
+
setup(M, { emit: h }) {
|
|
14
|
+
const n = $(), k = A(), x = q(), i = z("configProvider"), { refresh: c } = U(k), R = l(), t = l(), v = 16, s = l(!1), f = l(0);
|
|
15
|
+
let a;
|
|
16
|
+
B(() => {
|
|
17
17
|
setTimeout(() => {
|
|
18
|
-
|
|
18
|
+
var e;
|
|
19
|
+
f.value = (e = t == null ? void 0 : t.value) == null ? void 0 : e.offsetHeight, s.value = !0;
|
|
19
20
|
}, 1);
|
|
20
|
-
}),
|
|
21
|
-
() =>
|
|
21
|
+
}), g(
|
|
22
|
+
() => i == null ? void 0 : i.componentSize,
|
|
22
23
|
(e) => {
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
s.value = !1, setTimeout(() => {
|
|
25
|
+
var u;
|
|
26
|
+
f.value = (u = t == null ? void 0 : t.value) == null ? void 0 : u.offsetHeight, s.value = !0;
|
|
25
27
|
}, 100);
|
|
26
28
|
}
|
|
27
|
-
),
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
})) : (
|
|
34
|
-
|
|
29
|
+
), b();
|
|
30
|
+
function b() {
|
|
31
|
+
x.name ? (H(() => {
|
|
32
|
+
c.value && (c.value = !1, h("refresh")), a = p();
|
|
33
|
+
}), E(() => {
|
|
34
|
+
a();
|
|
35
|
+
})) : (a = p(), D(() => {
|
|
36
|
+
a();
|
|
35
37
|
}));
|
|
36
38
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
39
|
-
() =>
|
|
39
|
+
function p() {
|
|
40
|
+
return g(
|
|
41
|
+
() => c.value,
|
|
40
42
|
(e) => {
|
|
41
|
-
e &&
|
|
43
|
+
e && h("refresh");
|
|
42
44
|
}
|
|
43
45
|
);
|
|
44
46
|
}
|
|
45
|
-
return (e,
|
|
46
|
-
const
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
return (e, u) => {
|
|
48
|
+
const y = S("a-card"), C = S("a-space");
|
|
49
|
+
return L(), N("div", F, [
|
|
50
|
+
o("div", G, [
|
|
51
|
+
d(y, {
|
|
50
52
|
ref: "formRef",
|
|
51
53
|
bordered: !1,
|
|
52
|
-
class:
|
|
53
|
-
style:
|
|
54
|
+
class: V({ "ditari-list-form": m(n).form }),
|
|
55
|
+
style: w({ "margin-bottom": m(n).form ? v + "px" : 0 })
|
|
54
56
|
}, {
|
|
55
|
-
default:
|
|
56
|
-
|
|
57
|
+
default: _(() => [
|
|
58
|
+
r(e.$slots, "form")
|
|
57
59
|
]),
|
|
58
60
|
_: 3
|
|
59
61
|
}, 8, ["class", "style"]),
|
|
60
|
-
|
|
62
|
+
d(y, {
|
|
61
63
|
class: "ditari-list-table",
|
|
62
64
|
bordered: !1
|
|
63
65
|
}, {
|
|
64
|
-
default:
|
|
65
|
-
|
|
66
|
+
default: _(() => [
|
|
67
|
+
o("div", {
|
|
66
68
|
ref_key: "toolsRef",
|
|
67
|
-
ref:
|
|
69
|
+
ref: R,
|
|
68
70
|
class: "xi-tools",
|
|
69
|
-
style:
|
|
71
|
+
style: w({ "margin-bottom": m(n).tools ? v + "px" : 0 })
|
|
70
72
|
}, [
|
|
71
|
-
|
|
72
|
-
default:
|
|
73
|
-
|
|
73
|
+
d(C, null, {
|
|
74
|
+
default: _(() => [
|
|
75
|
+
r(e.$slots, "tools")
|
|
74
76
|
]),
|
|
75
77
|
_: 3
|
|
76
78
|
})
|
|
77
79
|
], 4),
|
|
78
|
-
|
|
80
|
+
o("div", {
|
|
79
81
|
ref_key: "tableRef",
|
|
80
|
-
ref:
|
|
82
|
+
ref: t,
|
|
81
83
|
style: { flex: "1" }
|
|
82
84
|
}, [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
W(o("div", I, [
|
|
86
|
+
r(e.$slots, "table", { height: f.value })
|
|
85
87
|
], 512), [
|
|
86
|
-
[
|
|
88
|
+
[j, s.value]
|
|
87
89
|
])
|
|
88
90
|
], 512)
|
|
89
91
|
]),
|
|
90
92
|
_: 3
|
|
91
93
|
})
|
|
92
94
|
], 512),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
o("div", J, [
|
|
96
|
+
r(e.$slots, "default")
|
|
95
97
|
])
|
|
96
98
|
]);
|
|
97
99
|
};
|
|
98
100
|
}
|
|
99
101
|
});
|
|
100
102
|
export {
|
|
101
|
-
|
|
103
|
+
Y as default
|
|
102
104
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as S, computed as
|
|
1
|
+
import { defineComponent as S, computed as f, resolveComponent as a, openBlock as n, createElementBlock as w, Fragment as $, createVNode as t, withCtx as i, unref as e, isRef as x, createElementVNode as o, renderSlot as p, normalizeStyle as y, createBlock as c, Transition as A, KeepAlive as M, resolveDynamicComponent as z } from "vue";
|
|
2
2
|
import { MenuUnfoldOutlined as B, MenuFoldOutlined as N } from "@ant-design/icons-vue";
|
|
3
3
|
import "../../store/modules/Breadcrumb.esm.js";
|
|
4
4
|
import "../../store/modules/DataDictionary.esm.js";
|
|
@@ -15,22 +15,22 @@ const O = { class: "ditari-logo" }, R = { class: "ditari-menu" }, U = { class: "
|
|
|
15
15
|
}, ot = /* @__PURE__ */ S({
|
|
16
16
|
...T,
|
|
17
17
|
setup(j) {
|
|
18
|
-
const v = D(), g =
|
|
19
|
-
return (
|
|
20
|
-
const k = a("a-layout-sider"), h = a("router-view"), b = a("a-layout-content"),
|
|
21
|
-
return n(), w(
|
|
22
|
-
t(
|
|
18
|
+
const v = D(), g = f(() => v.get), u = E(), { switchCollapsed: m } = u, l = f(() => u.getCollapsed);
|
|
19
|
+
return (r, d) => {
|
|
20
|
+
const k = a("a-layout-sider"), h = a("router-view"), b = a("a-layout-content"), _ = a("a-layout"), C = a("a-back-top");
|
|
21
|
+
return n(), w($, null, [
|
|
22
|
+
t(_, { class: "ditari-layout" }, {
|
|
23
23
|
default: i(() => [
|
|
24
24
|
t(k, {
|
|
25
25
|
collapsed: e(l),
|
|
26
|
-
"onUpdate:collapsed":
|
|
26
|
+
"onUpdate:collapsed": d[0] || (d[0] = (s) => x(l) ? l.value = s : null),
|
|
27
27
|
trigger: null,
|
|
28
28
|
collapsible: "",
|
|
29
29
|
class: "ditari-layout-sider"
|
|
30
30
|
}, {
|
|
31
31
|
default: i(() => [
|
|
32
32
|
o("div", O, [
|
|
33
|
-
|
|
33
|
+
p(r.$slots, "logo")
|
|
34
34
|
]),
|
|
35
35
|
o("div", R, [
|
|
36
36
|
t(e(L))
|
|
@@ -38,7 +38,7 @@ const O = { class: "ditari-logo" }, R = { class: "ditari-menu" }, U = { class: "
|
|
|
38
38
|
]),
|
|
39
39
|
_: 3
|
|
40
40
|
}, 8, ["collapsed"]),
|
|
41
|
-
t(
|
|
41
|
+
t(_, null, {
|
|
42
42
|
default: i(() => [
|
|
43
43
|
o("div", {
|
|
44
44
|
class: "ditari-top-layout",
|
|
@@ -49,14 +49,14 @@ const O = { class: "ditari-logo" }, R = { class: "ditari-menu" }, U = { class: "
|
|
|
49
49
|
o("div", V, [
|
|
50
50
|
o("div", {
|
|
51
51
|
class: "ditari-side-collapsed",
|
|
52
|
-
onClick:
|
|
53
|
-
(...s) => e(
|
|
52
|
+
onClick: d[1] || (d[1] = //@ts-ignore
|
|
53
|
+
(...s) => e(m) && e(m)(...s))
|
|
54
54
|
}, [
|
|
55
|
-
e(l) ? (n(),
|
|
55
|
+
e(l) ? (n(), c(e(B), {
|
|
56
56
|
key: 0,
|
|
57
57
|
class: "trigger",
|
|
58
58
|
style: { "font-size": "16px", "font-weight": "bold", cursor: "pointer" }
|
|
59
|
-
})) : (n(),
|
|
59
|
+
})) : (n(), c(e(N), {
|
|
60
60
|
key: 1,
|
|
61
61
|
style: { "font-size": "16px", "font-weight": "bold", cursor: "pointer" }
|
|
62
62
|
}))
|
|
@@ -64,7 +64,7 @@ const O = { class: "ditari-logo" }, R = { class: "ditari-menu" }, U = { class: "
|
|
|
64
64
|
t(K)
|
|
65
65
|
]),
|
|
66
66
|
o("div", H, [
|
|
67
|
-
|
|
67
|
+
p(r.$slots, "operation")
|
|
68
68
|
])
|
|
69
69
|
])
|
|
70
70
|
], 4),
|
|
@@ -81,12 +81,12 @@ const O = { class: "ditari-logo" }, R = { class: "ditari-menu" }, U = { class: "
|
|
|
81
81
|
appear: ""
|
|
82
82
|
}, {
|
|
83
83
|
default: i(() => [
|
|
84
|
-
(n(),
|
|
84
|
+
(n(), c(M, {
|
|
85
85
|
ref: "keepAliveRef",
|
|
86
86
|
include: e(g)
|
|
87
87
|
}, [
|
|
88
|
-
(n(),
|
|
89
|
-
key:
|
|
88
|
+
(n(), c(z(s), {
|
|
89
|
+
key: r.$route.path
|
|
90
90
|
}))
|
|
91
91
|
], 1032, ["include"]))
|
|
92
92
|
]),
|
|
@@ -94,9 +94,10 @@ const O = { class: "ditari-logo" }, R = { class: "ditari-menu" }, U = { class: "
|
|
|
94
94
|
}, 1024)
|
|
95
95
|
]),
|
|
96
96
|
_: 1
|
|
97
|
-
})
|
|
97
|
+
}),
|
|
98
|
+
p(r.$slots, "micro")
|
|
98
99
|
]),
|
|
99
|
-
_:
|
|
100
|
+
_: 3
|
|
100
101
|
}, 8, ["style"])
|
|
101
102
|
]),
|
|
102
103
|
_: 3
|
|
@@ -75,16 +75,16 @@ const ae = () => ({
|
|
|
75
75
|
rowClassName: e,
|
|
76
76
|
keepSelected: o,
|
|
77
77
|
onPageChange: l
|
|
78
|
-
} = t.config,
|
|
79
|
-
var
|
|
78
|
+
} = t.config, h = t.config.selection ?? "N", d = f(), u = f(null), a = f(), i = f(null), r = (w) => {
|
|
79
|
+
var v, P;
|
|
80
80
|
try {
|
|
81
|
-
const p = (
|
|
81
|
+
const p = (v = u == null ? void 0 : u.value) == null ? void 0 : v.$el, V = K(p.getElementsByClassName("ant-table-header")[0]);
|
|
82
82
|
let T = 0;
|
|
83
83
|
if (t.config.pagination) {
|
|
84
84
|
const W = (P = d.value) == null ? void 0 : P.getElementsByClassName(O)[0];
|
|
85
85
|
T = K(W) ?? 0;
|
|
86
86
|
}
|
|
87
|
-
a.value = w - (V + T), p.getElementsByClassName("ant-table-body")[0].style.height = a.value
|
|
87
|
+
a.value = w - (V + T), p.getElementsByClassName("ant-table-body")[0].style.height = a.value + "px", i.value = p.getElementsByClassName("ant-table-body")[0];
|
|
88
88
|
} catch (p) {
|
|
89
89
|
console.warn(p);
|
|
90
90
|
}
|
|
@@ -97,13 +97,13 @@ const ae = () => ({
|
|
|
97
97
|
tableRef: u,
|
|
98
98
|
tableRootRef: d,
|
|
99
99
|
tableHeight: a,
|
|
100
|
-
onPageChange: (w,
|
|
100
|
+
onPageChange: (w, v) => {
|
|
101
101
|
l && l({
|
|
102
102
|
page: w,
|
|
103
|
-
size:
|
|
104
|
-
}), i.value.scrollTop = 0, (
|
|
103
|
+
size: v
|
|
104
|
+
}), i.value.scrollTop = 0, (h === "S" || !o) && (n.value = [], S("update:keys", n.value));
|
|
105
105
|
},
|
|
106
|
-
onRowClassName: (w,
|
|
106
|
+
onRowClassName: (w, v) => e ? e(w, v) : void 0
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
const A = F();
|
|
@@ -115,7 +115,7 @@ const ae = () => ({
|
|
|
115
115
|
}
|
|
116
116
|
} = t;
|
|
117
117
|
let l = t.config.selection ?? "N";
|
|
118
|
-
const
|
|
118
|
+
const h = (a, i) => {
|
|
119
119
|
l === "S" ? (n.value = [], n.value = i ? [a[e]] : []) : n.value = i ? n.value.concat(a[e]) : n.value.filter((r) => r !== a[e]), S("update:keys", n.value);
|
|
120
120
|
}, d = (a, i, r) => {
|
|
121
121
|
const g = r.map((c) => c[e]);
|
|
@@ -131,7 +131,7 @@ const ae = () => ({
|
|
|
131
131
|
} = t.config;
|
|
132
132
|
l = a, l !== "N" ? u.value = {
|
|
133
133
|
selectedRowKeys: n,
|
|
134
|
-
onSelect:
|
|
134
|
+
onSelect: h,
|
|
135
135
|
onSelectAll: d,
|
|
136
136
|
fixed: !0,
|
|
137
137
|
columnTitle: l === "S" ? "选择" : null,
|
|
@@ -147,7 +147,7 @@ const ae = () => ({
|
|
|
147
147
|
const {
|
|
148
148
|
rowKey: l,
|
|
149
149
|
config: {
|
|
150
|
-
click:
|
|
150
|
+
click: h,
|
|
151
151
|
dbClick: d,
|
|
152
152
|
selection: u,
|
|
153
153
|
getCheckboxProps: a
|
|
@@ -161,7 +161,7 @@ const ae = () => ({
|
|
|
161
161
|
onClick: () => {
|
|
162
162
|
const g = a ? a(e) : null;
|
|
163
163
|
g && g.value === i || (clearTimeout(o), o = setTimeout(() => {
|
|
164
|
-
r(),
|
|
164
|
+
r(), h && h(e);
|
|
165
165
|
}, 200));
|
|
166
166
|
},
|
|
167
167
|
// 点击行
|
|
@@ -193,7 +193,10 @@ const ae = () => ({
|
|
|
193
193
|
return () => {
|
|
194
194
|
var e;
|
|
195
195
|
return m("div", {
|
|
196
|
-
ref: j
|
|
196
|
+
ref: j,
|
|
197
|
+
style: {
|
|
198
|
+
height: "100%"
|
|
199
|
+
}
|
|
197
200
|
}, [m(Z, {
|
|
198
201
|
ref: H,
|
|
199
202
|
"row-key": t.rowKey,
|
package/package.json
CHANGED
|
@@ -37,7 +37,7 @@ let stopHandleWatch: WatchStopHandle;
|
|
|
37
37
|
|
|
38
38
|
nextTick(() => {
|
|
39
39
|
setTimeout(() => {
|
|
40
|
-
height.value = tableRef
|
|
40
|
+
height.value = tableRef?.value?.offsetHeight;
|
|
41
41
|
show.value = true;
|
|
42
42
|
}, 1);
|
|
43
43
|
});
|
|
@@ -47,7 +47,7 @@ watch(
|
|
|
47
47
|
(val) => {
|
|
48
48
|
show.value = false;
|
|
49
49
|
setTimeout(() => {
|
|
50
|
-
height.value = tableRef
|
|
50
|
+
height.value = tableRef?.value?.offsetHeight;
|
|
51
51
|
show.value = true;
|
|
52
52
|
}, 100);
|
|
53
53
|
}
|
|
@@ -119,13 +119,13 @@ export default {
|
|
|
119
119
|
</a-space>
|
|
120
120
|
</div>
|
|
121
121
|
<div ref="tableRef" style="flex: 1">
|
|
122
|
-
<div v-show="show">
|
|
122
|
+
<div style="height: 100%" v-show="show">
|
|
123
123
|
<slot name="table" :height="height" />
|
|
124
124
|
</div>
|
|
125
125
|
</div>
|
|
126
126
|
</a-card>
|
|
127
127
|
</div>
|
|
128
|
-
<div class="
|
|
128
|
+
<div class="ditari-content-extra">
|
|
129
129
|
<slot></slot>
|
|
130
130
|
</div>
|
|
131
131
|
</div>
|
|
@@ -151,7 +151,7 @@ const DXTable = defineComponent({
|
|
|
151
151
|
tableHeight.value = height - (headerHeight + paginationHeight);
|
|
152
152
|
// 设置body高度
|
|
153
153
|
tableEl.getElementsByClassName("ant-table-body")[0].style.height =
|
|
154
|
-
tableHeight.value
|
|
154
|
+
tableHeight.value + "px";
|
|
155
155
|
// 表格body对象 用于切换页码后滚动条置顶
|
|
156
156
|
antTableBodyRef.value =
|
|
157
157
|
tableEl.getElementsByClassName("ant-table-body")[0];
|
|
@@ -369,7 +369,7 @@ const DXTable = defineComponent({
|
|
|
369
369
|
return <>{slots.summary && slots.summary()}</>;
|
|
370
370
|
};
|
|
371
371
|
return () => (
|
|
372
|
-
<div ref={tableRootRef}>
|
|
372
|
+
<div ref={tableRootRef} style={{ height: "100%" }}>
|
|
373
373
|
<Table
|
|
374
374
|
ref={tableRef}
|
|
375
375
|
row-key={props.rowKey}
|