@ditari/bsui 1.0.29 → 1.0.31
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/menu/Menu.cjs.js +1 -1
- package/dist/cjs/components/select/dic.worker.cjs.js +1 -1
- package/dist/cjs/components/table/Table.cjs.js +1 -1
- package/dist/esm/components/menu/Menu.esm.js +33 -32
- package/dist/esm/components/select/dic.worker.esm.js +6 -6
- package/dist/esm/components/table/Table.esm.js +89 -88
- package/package.json +1 -1
- package/src/components/menu/Menu.jsx +4 -0
- package/src/components/select/dic.worker.ts +1 -1
- package/src/components/table/Table.tsx +16 -18
|
@@ -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"),S=require("vue-router"),V=require("pinia"),C=require("../../store/modules/Menu.cjs.js"),b=require("../../store/modules/Settings.cjs.js");function y(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}const M=e.defineComponent({name:"DMenu",setup(){const o=S.useRouter(),{componentName:s,prop:K}=e.inject("menuIcon"),{list:d}=C.useMenuStore(),p=b.useSettingsStore(),{getCollapsed:v}=V.storeToRefs(p),l=e.ref([]),c=e.ref([]),m=({item:t,key:n,keyPath:r})=>{console.log(t,n,r),l.value=r,c.value=[n],o.push(n).then(a=>a?console.warn(a):null)},f=t=>e.createVNode(e.Fragment,null,[e.createVNode(e.resolveComponent("a-menu-item"),{key:t.url},{icon:()=>u(t),default:()=>t.title})]),g=["anticon","anticon-menu","ant-menu-item-icon"],u=t=>e.createVNode(e.Fragment,null,[t.icon?h(t.icon):e.withDirectives(e.createVNode("div",{className:g},[t.title.substring(0,1)]),[[e.vShow,v.value]])]),h=t=>s==="nativeHtml"?e.createVNode("span",{innerHTML:t},null):e.h(e.resolveComponent(s),{prop:t}),i=t=>e.createVNode(e.Fragment,null,[e.createVNode(e.resolveComponent("a-sub-menu"),{key:t.url},{title:()=>t.title,icon:()=>u(t),default:()=>t.children.map(n=>!n.children||n.children.length===0?N(n):i(n))})]),N=t=>e.createVNode(e.Fragment,null,[e.createVNode(e.resolveComponent("a-menu-item"),{key:t.url},{default:()=>t.title})]);return()=>{let t;return e.createVNode(e.resolveComponent("a-menu"),{mode:"inline",theme:"dark",openKeys:l.value,"onUpdate:openKeys":n=>l.value=n,selectedKeys:c.value,"onUpdate:selectedKeys":n=>c.value=n,onClick:m},y(t=d.map(n=>{var r;return!n.children||((r=n.children)==null?void 0:r.length)===0?f(n):i(n)}))?t:{default:()=>[t]})}}});exports.default=M;
|
|
@@ -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 e="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3NlbGYuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24odCl7dmFyIGk7Y29uc3QgbD10LmRhdGEua2V5d29yZHM/PyIiO2xldCBlPUpTT04ucGFyc2UoKChpPXQuZGF0YSk9PW51bGw/dm9pZCAwOmkubGlzdCl8fFtdKT8/W107Y29uc3QgYT1KU09OLnBhcnNlKHQuZGF0YS5pbmNsdWRlKTthLmxlbmd0aD4wJiYoZT1lLmZpbHRlcihzPT5hLnNvbWUobj0+bj09PXMudmFsdWUpKSk7Y29uc3Qgbz1lLmZpbHRlcihzPT5zLnZhbHVlLnRvTG93ZXJDYXNlKCkuaW5kZXhPZihsLnRvTG93ZXJDYXNlKCkpIT09LTF8fHMubGFiZWwudG9Mb3dlckNhc2UoKS5pbmNsdWRlcyhsLnRvTG93ZXJDYXNlKCkpKTtvLmxlbmd0aD09PTA/c2VsZi5wb3N0TWVzc2FnZShlLnNwbGljZSgwLDEwKSk6c2VsZi5wb3N0TWVzc2FnZShvLnNwbGljZSgwLDEwKSl9LCExKX0pKCk7Cg==",b=typeof window<"u"&&window.Blob&&new Blob([atob(e)],{type:"text/javascript;charset=utf-8"});function n(){const l=b&&(window.URL||window.webkitURL).createObjectURL(b);try{return l?new Worker(l):new Worker("data:application/javascript;base64,"+e)}finally{l&&(window.URL||window.webkitURL).revokeObjectURL(l)}}exports.default=n;
|
|
@@ -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"),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-10+"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},[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,47 +1,48 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { defineComponent as K, inject as M, ref as f, createVNode as n, resolveComponent as l, isVNode as j, Fragment as s, withDirectives as w, vShow as N, h as k } from "vue";
|
|
2
|
+
import { useRouter as I } from "vue-router";
|
|
3
|
+
import { storeToRefs as D } from "pinia";
|
|
4
|
+
import { useMenuStore as H } from "../../store/modules/Menu.esm.js";
|
|
5
|
+
import { useSettingsStore as O } from "../../store/modules/Settings.esm.js";
|
|
6
|
+
function R(o) {
|
|
7
|
+
return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !j(o);
|
|
7
8
|
}
|
|
8
|
-
const
|
|
9
|
+
const L = /* @__PURE__ */ K({
|
|
9
10
|
name: "DMenu",
|
|
10
11
|
setup() {
|
|
11
|
-
const {
|
|
12
|
-
componentName:
|
|
13
|
-
prop:
|
|
14
|
-
} =
|
|
15
|
-
list:
|
|
16
|
-
} =
|
|
17
|
-
getCollapsed:
|
|
18
|
-
} =
|
|
12
|
+
const o = I(), {
|
|
13
|
+
componentName: i,
|
|
14
|
+
prop: T
|
|
15
|
+
} = M("menuIcon"), {
|
|
16
|
+
list: m
|
|
17
|
+
} = H(), h = O(), {
|
|
18
|
+
getCollapsed: v
|
|
19
|
+
} = D(h), c = f([]), u = f([]), S = ({
|
|
19
20
|
item: e,
|
|
20
21
|
key: t,
|
|
21
22
|
keyPath: r
|
|
22
23
|
}) => {
|
|
23
|
-
console.log(e, t, r), c.value = r,
|
|
24
|
-
},
|
|
24
|
+
console.log(e, t, r), c.value = r, u.value = [t], o.push(t).then((p) => p ? console.warn(p) : null);
|
|
25
|
+
}, g = (e) => n(s, null, [n(l("a-menu-item"), {
|
|
25
26
|
key: e.url
|
|
26
27
|
}, {
|
|
27
|
-
icon: () =>
|
|
28
|
+
icon: () => a(e),
|
|
28
29
|
default: () => e.title
|
|
29
|
-
})]),
|
|
30
|
-
className:
|
|
31
|
-
}, [e.title.substring(0, 1)]), [[
|
|
30
|
+
})]), y = ["anticon", "anticon-menu", "ant-menu-item-icon"], a = (e) => n(s, null, [e.icon ? b(e.icon) : w(n("div", {
|
|
31
|
+
className: y
|
|
32
|
+
}, [e.title.substring(0, 1)]), [[N, v.value]])]), b = (e) => i === "nativeHtml" ? n("span", {
|
|
32
33
|
innerHTML: e
|
|
33
|
-
}, null) : k(l(
|
|
34
|
+
}, null) : k(l(i), {
|
|
34
35
|
prop: e
|
|
35
|
-
}),
|
|
36
|
+
}), d = (e) => n(s, null, [n(l("a-sub-menu"), {
|
|
36
37
|
key: e.url
|
|
37
38
|
}, {
|
|
38
39
|
title: () => e.title,
|
|
39
|
-
icon: () =>
|
|
40
|
+
icon: () => a(e),
|
|
40
41
|
default: () => e.children.map(
|
|
41
|
-
(t) => !t.children || t.children.length === 0 ?
|
|
42
|
+
(t) => !t.children || t.children.length === 0 ? C(t) : d(t)
|
|
42
43
|
// 递归调用
|
|
43
44
|
)
|
|
44
|
-
})]),
|
|
45
|
+
})]), C = (e) => n(s, null, [n(l("a-menu-item"), {
|
|
45
46
|
key: e.url
|
|
46
47
|
}, {
|
|
47
48
|
default: () => e.title
|
|
@@ -53,12 +54,12 @@ const _ = /* @__PURE__ */ b({
|
|
|
53
54
|
theme: "dark",
|
|
54
55
|
openKeys: c.value,
|
|
55
56
|
"onUpdate:openKeys": (t) => c.value = t,
|
|
56
|
-
selectedKeys:
|
|
57
|
-
"onUpdate:selectedKeys": (t) =>
|
|
58
|
-
onClick:
|
|
59
|
-
},
|
|
57
|
+
selectedKeys: u.value,
|
|
58
|
+
"onUpdate:selectedKeys": (t) => u.value = t,
|
|
59
|
+
onClick: S
|
|
60
|
+
}, R(e = m.map((t) => {
|
|
60
61
|
var r;
|
|
61
|
-
return !t.children || ((r = t.children) == null ? void 0 : r.length) === 0 ?
|
|
62
|
+
return !t.children || ((r = t.children) == null ? void 0 : r.length) === 0 ? g(t) : d(t);
|
|
62
63
|
})) ? e : {
|
|
63
64
|
default: () => [e]
|
|
64
65
|
});
|
|
@@ -66,5 +67,5 @@ const _ = /* @__PURE__ */ b({
|
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
69
|
export {
|
|
69
|
-
|
|
70
|
+
L as default
|
|
70
71
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
const
|
|
1
|
+
const l = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3NlbGYuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24odCl7dmFyIGk7Y29uc3QgbD10LmRhdGEua2V5d29yZHM/PyIiO2xldCBlPUpTT04ucGFyc2UoKChpPXQuZGF0YSk9PW51bGw/dm9pZCAwOmkubGlzdCl8fFtdKT8/W107Y29uc3QgYT1KU09OLnBhcnNlKHQuZGF0YS5pbmNsdWRlKTthLmxlbmd0aD4wJiYoZT1lLmZpbHRlcihzPT5hLnNvbWUobj0+bj09PXMudmFsdWUpKSk7Y29uc3Qgbz1lLmZpbHRlcihzPT5zLnZhbHVlLnRvTG93ZXJDYXNlKCkuaW5kZXhPZihsLnRvTG93ZXJDYXNlKCkpIT09LTF8fHMubGFiZWwudG9Mb3dlckNhc2UoKS5pbmNsdWRlcyhsLnRvTG93ZXJDYXNlKCkpKTtvLmxlbmd0aD09PTA/c2VsZi5wb3N0TWVzc2FnZShlLnNwbGljZSgwLDEwKSk6c2VsZi5wb3N0TWVzc2FnZShvLnNwbGljZSgwLDEwKSl9LCExKX0pKCk7Cg==", n = typeof window < "u" && window.Blob && new Blob([atob(l)], { type: "text/javascript;charset=utf-8" });
|
|
2
|
+
function c() {
|
|
3
|
+
const b = n && (window.URL || window.webkitURL).createObjectURL(n);
|
|
4
4
|
try {
|
|
5
|
-
return
|
|
5
|
+
return b ? new Worker(b) : new Worker("data:application/javascript;base64," + l);
|
|
6
6
|
} finally {
|
|
7
|
-
|
|
7
|
+
b && (window.URL || window.webkitURL).revokeObjectURL(b);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
c as default
|
|
12
12
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as
|
|
3
|
-
import { useEleHeight as
|
|
4
|
-
import { prefixName as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as X, ref as f, computed as C, watchEffect as k, nextTick as _, watch as G, createVNode as m, withDirectives as M, vShow as Y, Fragment as z } from "vue";
|
|
2
|
+
import { Table as Z, Space as ee, Pagination as te } from "ant-design-vue";
|
|
3
|
+
import { useEleHeight as K } from "../../utils/html.esm.js";
|
|
4
|
+
import { prefixName as ne } from "../theme/index.esm.js";
|
|
5
|
+
const ae = () => ({
|
|
6
6
|
data: {
|
|
7
7
|
type: Object,
|
|
8
8
|
required: !0
|
|
@@ -40,133 +40,133 @@ const ne = () => ({
|
|
|
40
40
|
showQuickJumper: !0,
|
|
41
41
|
showLessItems: !0,
|
|
42
42
|
showTotal: (t) => `总共 ${t} 条`
|
|
43
|
-
},
|
|
43
|
+
}, O = `${ne}-pagination`, ce = /* @__PURE__ */ X({
|
|
44
44
|
name: "DTable",
|
|
45
|
-
props:
|
|
45
|
+
props: ae(),
|
|
46
46
|
// emits: { "update:keys": (keys: []) => void }
|
|
47
47
|
// TODO 需要做调整
|
|
48
48
|
emits: ["update:keys"],
|
|
49
49
|
setup: function(t, {
|
|
50
50
|
emit: S,
|
|
51
|
-
slots:
|
|
51
|
+
slots: s
|
|
52
52
|
}) {
|
|
53
|
-
const n = f(t.keys || []),
|
|
53
|
+
const n = f(t.keys || []), B = C(() => t.data), E = C(() => {
|
|
54
54
|
var e;
|
|
55
55
|
return ((e = t.config) == null ? void 0 : e.columns) ?? [];
|
|
56
|
-
}), y =
|
|
56
|
+
}), y = C(() => {
|
|
57
57
|
var e;
|
|
58
58
|
return ((e = t.config) == null ? void 0 : e.pagination) ?? {};
|
|
59
|
-
}),
|
|
59
|
+
}), R = f(t.expandedRowKeys);
|
|
60
60
|
k(() => {
|
|
61
61
|
const {
|
|
62
62
|
expandedRowKeys: e
|
|
63
63
|
} = t;
|
|
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
|
-
keepSelected:
|
|
76
|
+
keepSelected: o,
|
|
77
77
|
onPageChange: l
|
|
78
|
-
} = t.config,
|
|
79
|
-
var
|
|
78
|
+
} = t.config, v = t.config.selection ?? "N", d = f(), u = f(null), a = f(), i = f(null), r = (w) => {
|
|
79
|
+
var h, P;
|
|
80
80
|
try {
|
|
81
|
-
const p = (
|
|
82
|
-
let
|
|
81
|
+
const p = (h = u == null ? void 0 : u.value) == null ? void 0 : h.$el, V = K(p.getElementsByClassName("ant-table-header")[0]);
|
|
82
|
+
let T = 0;
|
|
83
83
|
if (t.config.pagination) {
|
|
84
|
-
const
|
|
85
|
-
|
|
84
|
+
const W = (P = d.value) == null ? void 0 : P.getElementsByClassName(O)[0];
|
|
85
|
+
T = K(W) ?? 0;
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
a.value = w - (V + T), p.getElementsByClassName("ant-table-body")[0].style.height = a.value - 10 + "px", i.value = p.getElementsByClassName("ant-table-body")[0];
|
|
88
88
|
} catch (p) {
|
|
89
89
|
console.warn(p);
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
return k(() => {
|
|
93
|
-
t.height !== 0 &&
|
|
93
|
+
t.height !== 0 && _(() => {
|
|
94
94
|
r(t.height);
|
|
95
95
|
});
|
|
96
96
|
}), {
|
|
97
97
|
tableRef: u,
|
|
98
98
|
tableRootRef: d,
|
|
99
|
-
tableHeight:
|
|
100
|
-
onPageChange: (w,
|
|
99
|
+
tableHeight: a,
|
|
100
|
+
onPageChange: (w, h) => {
|
|
101
101
|
l && l({
|
|
102
102
|
page: w,
|
|
103
|
-
size:
|
|
104
|
-
}), i.value.scrollTop = 0, (
|
|
103
|
+
size: h
|
|
104
|
+
}), i.value.scrollTop = 0, (v === "S" || !o) && (n.value = [], S("update:keys", n.value));
|
|
105
105
|
},
|
|
106
|
-
onRowClassName: (w,
|
|
106
|
+
onRowClassName: (w, h) => e ? e(w, h) : void 0
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
const
|
|
110
|
-
function
|
|
109
|
+
const A = F();
|
|
110
|
+
function F() {
|
|
111
111
|
const {
|
|
112
112
|
rowKey: e,
|
|
113
113
|
config: {
|
|
114
|
-
getCheckboxProps:
|
|
114
|
+
getCheckboxProps: o
|
|
115
115
|
}
|
|
116
116
|
} = t;
|
|
117
117
|
let l = t.config.selection ?? "N";
|
|
118
|
-
const
|
|
119
|
-
l === "S" ? (n.value = [], n.value = i ? [
|
|
120
|
-
}, d = (
|
|
121
|
-
const g = r.map((
|
|
122
|
-
n.value =
|
|
118
|
+
const v = (a, i) => {
|
|
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
|
+
}, d = (a, i, r) => {
|
|
121
|
+
const g = r.map((c) => c[e]);
|
|
122
|
+
n.value = a ? n.value.concat(g) : n.value.filter((c) => !g.includes(c)), S("update:keys", n.value);
|
|
123
123
|
};
|
|
124
|
-
|
|
125
|
-
n.value =
|
|
124
|
+
G(() => t.keys, (a) => {
|
|
125
|
+
n.value = a;
|
|
126
126
|
});
|
|
127
127
|
const u = f(void 0);
|
|
128
128
|
return k(() => {
|
|
129
129
|
const {
|
|
130
|
-
selection:
|
|
130
|
+
selection: a
|
|
131
131
|
} = t.config;
|
|
132
|
-
l =
|
|
132
|
+
l = a, l !== "N" ? u.value = {
|
|
133
133
|
selectedRowKeys: n,
|
|
134
|
-
onSelect:
|
|
134
|
+
onSelect: v,
|
|
135
135
|
onSelectAll: d,
|
|
136
136
|
fixed: !0,
|
|
137
137
|
columnTitle: l === "S" ? "选择" : null,
|
|
138
138
|
columnWidth: l === "S" ? 60 : 40,
|
|
139
|
-
getCheckboxProps:
|
|
139
|
+
getCheckboxProps: o
|
|
140
140
|
} : u.value = void 0;
|
|
141
141
|
}), u;
|
|
142
142
|
}
|
|
143
|
-
const
|
|
144
|
-
function
|
|
143
|
+
const J = Q();
|
|
144
|
+
function Q() {
|
|
145
145
|
return (e) => {
|
|
146
|
-
let
|
|
146
|
+
let o;
|
|
147
147
|
const {
|
|
148
148
|
rowKey: l,
|
|
149
149
|
config: {
|
|
150
|
-
click:
|
|
150
|
+
click: v,
|
|
151
151
|
dbClick: d,
|
|
152
152
|
selection: u,
|
|
153
|
-
getCheckboxProps:
|
|
153
|
+
getCheckboxProps: a
|
|
154
154
|
}
|
|
155
155
|
} = t, i = e[l], r = () => {
|
|
156
156
|
if (u === "N")
|
|
157
157
|
return;
|
|
158
|
-
n.value.some((
|
|
158
|
+
n.value.some((c) => c === i) ? n.value = n.value.filter((c) => c !== i) : (u === "S" && (n.value = []), n.value.push(i)), S("update:keys", n.value);
|
|
159
159
|
};
|
|
160
160
|
return {
|
|
161
161
|
onClick: () => {
|
|
162
|
-
const g =
|
|
163
|
-
g && g.value === i || (clearTimeout(
|
|
164
|
-
r(),
|
|
162
|
+
const g = a ? a(e) : null;
|
|
163
|
+
g && g.value === i || (clearTimeout(o), o = setTimeout(() => {
|
|
164
|
+
r(), v && v(e);
|
|
165
165
|
}, 200));
|
|
166
166
|
},
|
|
167
167
|
// 点击行
|
|
168
168
|
onDblclick: () => {
|
|
169
|
-
clearTimeout(
|
|
169
|
+
clearTimeout(o), d && d(e);
|
|
170
170
|
}
|
|
171
171
|
// onContextmenu: (event) => {
|
|
172
172
|
// //TODO
|
|
@@ -182,59 +182,60 @@ const ne = () => ({
|
|
|
182
182
|
}
|
|
183
183
|
const x = (e) => {
|
|
184
184
|
e.stopPropagation();
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
})
|
|
185
|
+
}, I = C(() => {
|
|
186
|
+
const {
|
|
187
|
+
selection: e
|
|
188
|
+
} = t.config;
|
|
189
|
+
return e === "N";
|
|
190
|
+
}), N = {};
|
|
191
|
+
s.expandedRowRender && (N.expandedRowRender = (e) => m(z, null, [s.expandedRowRender && s.expandedRowRender(e)]));
|
|
192
|
+
const L = () => m(z, null, [s.summary && s.summary()]);
|
|
191
193
|
return () => {
|
|
192
194
|
var e;
|
|
193
195
|
return m("div", {
|
|
194
|
-
ref:
|
|
195
|
-
}, [m(
|
|
196
|
-
ref:
|
|
196
|
+
ref: j
|
|
197
|
+
}, [m(Z, {
|
|
198
|
+
ref: H,
|
|
197
199
|
"row-key": t.rowKey,
|
|
198
200
|
bordered: t.config.bordered,
|
|
199
201
|
columns: E.value,
|
|
200
|
-
dataSource:
|
|
202
|
+
dataSource: B.value,
|
|
201
203
|
loading: t.loading,
|
|
202
204
|
size: ((e = t.config) == null ? void 0 : e.size) ?? "small",
|
|
203
205
|
scroll: {
|
|
204
206
|
scrollToFirstRowOnChange: !0,
|
|
205
207
|
x: "100%",
|
|
206
|
-
y:
|
|
208
|
+
y: D.value + "px"
|
|
207
209
|
},
|
|
208
|
-
expandedRowKeys:
|
|
209
|
-
"onUpdate:expandedRowKeys": (
|
|
210
|
-
expandRowByClick:
|
|
210
|
+
expandedRowKeys: R.value,
|
|
211
|
+
"onUpdate:expandedRowKeys": (o) => R.value = o,
|
|
212
|
+
expandRowByClick: I.value,
|
|
211
213
|
pagination: !1,
|
|
212
|
-
customRow:
|
|
213
|
-
rowSelection:
|
|
214
|
-
rowClassName:
|
|
214
|
+
customRow: J,
|
|
215
|
+
rowSelection: A.value,
|
|
216
|
+
rowClassName: $
|
|
215
217
|
}, {
|
|
216
218
|
bodyCell: ({
|
|
217
|
-
column:
|
|
219
|
+
column: o,
|
|
218
220
|
record: l
|
|
219
221
|
}) => {
|
|
220
|
-
if (
|
|
222
|
+
if (o.slot === "action")
|
|
221
223
|
return m("div", {
|
|
222
224
|
onClick: x,
|
|
223
225
|
onDblclick: x
|
|
224
|
-
}, [m(
|
|
225
|
-
default: () => [
|
|
226
|
+
}, [m(ee, null, {
|
|
227
|
+
default: () => [s.action && s.action(l)]
|
|
226
228
|
})]);
|
|
227
229
|
},
|
|
228
|
-
|
|
229
|
-
expandedRowRender: Q,
|
|
230
|
+
...N,
|
|
230
231
|
// 总结栏插槽
|
|
231
|
-
summary:
|
|
232
|
-
}),
|
|
233
|
-
class: [
|
|
232
|
+
summary: L
|
|
233
|
+
}), M(m(te, {
|
|
234
|
+
class: [O],
|
|
234
235
|
current: y.value.current,
|
|
235
|
-
"onUpdate:current": (
|
|
236
|
+
"onUpdate:current": (o) => y.value.current = o,
|
|
236
237
|
pageSize: y.value.pageSize,
|
|
237
|
-
"onUpdate:pageSize": (
|
|
238
|
+
"onUpdate:pageSize": (o) => y.value.pageSize = o,
|
|
238
239
|
disabled: t.loading,
|
|
239
240
|
"show-size-changer": !0,
|
|
240
241
|
size: "default",
|
|
@@ -244,11 +245,11 @@ const ne = () => ({
|
|
|
244
245
|
"page-size-options": b.pageSizeOptions,
|
|
245
246
|
"show-total": b.showTotal,
|
|
246
247
|
total: y.value.total,
|
|
247
|
-
onChange:
|
|
248
|
-
}, null), [[
|
|
248
|
+
onChange: U
|
|
249
|
+
}, null), [[Y, t.config.pagination]])]);
|
|
249
250
|
};
|
|
250
251
|
}
|
|
251
252
|
});
|
|
252
253
|
export {
|
|
253
|
-
|
|
254
|
+
ce as default
|
|
254
255
|
};
|
package/package.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { defineComponent, h, inject, ref, resolveComponent } from "vue";
|
|
2
|
+
import { useRouter } from "vue-router";
|
|
3
|
+
|
|
2
4
|
import { storeToRefs } from "pinia";
|
|
3
5
|
|
|
4
6
|
import { useMenuStore } from "../../store/modules/Menu";
|
|
@@ -7,6 +9,7 @@ import { useSettingsStore } from "../../store/modules/Settings";
|
|
|
7
9
|
export default defineComponent({
|
|
8
10
|
name: "DMenu",
|
|
9
11
|
setup() {
|
|
12
|
+
const router = useRouter();
|
|
10
13
|
const { componentName, prop } = inject("menuIcon");
|
|
11
14
|
const { list } = useMenuStore();
|
|
12
15
|
const settingsStore = useSettingsStore();
|
|
@@ -27,6 +30,7 @@ export default defineComponent({
|
|
|
27
30
|
console.log(item, key, keyPath);
|
|
28
31
|
openKeys.value = keyPath;
|
|
29
32
|
selectedKeys.value = [key];
|
|
33
|
+
router.push(key).then((r) => (r ? console.warn(r) : null));
|
|
30
34
|
};
|
|
31
35
|
/**
|
|
32
36
|
* 监听菜单展开事件
|
|
@@ -7,7 +7,7 @@ self.addEventListener(
|
|
|
7
7
|
"message",
|
|
8
8
|
function (e) {
|
|
9
9
|
const keyword = e.data.keywords ?? "";
|
|
10
|
-
let dicList = JSON.parse(e.data
|
|
10
|
+
let dicList = JSON.parse(e.data?.list || []) ?? [];
|
|
11
11
|
const include = JSON.parse(e.data.include);
|
|
12
12
|
if (include.length > 0) {
|
|
13
13
|
// 只过滤出来include包含的数据
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
computed,
|
|
3
|
+
createVNode,
|
|
3
4
|
defineComponent,
|
|
4
5
|
nextTick,
|
|
5
6
|
PropType,
|
|
@@ -8,7 +9,7 @@ import {
|
|
|
8
9
|
watch,
|
|
9
10
|
watchEffect
|
|
10
11
|
} from "vue";
|
|
11
|
-
import { Pagination, Space, Table } from "ant-design-vue";
|
|
12
|
+
import { Pagination, Space, Table, Card } from "ant-design-vue";
|
|
12
13
|
import { useEleHeight } from "../../utils/html";
|
|
13
14
|
import { prefixName } from "../theme";
|
|
14
15
|
|
|
@@ -352,20 +353,18 @@ const DXTable = defineComponent({
|
|
|
352
353
|
event.stopPropagation();
|
|
353
354
|
};
|
|
354
355
|
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
)
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
{slots.expandedRowRender &&
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
};
|
|
368
|
-
|
|
356
|
+
const expandRowByClick = computed(() => {
|
|
357
|
+
const { selection } = props.config;
|
|
358
|
+
return selection === "N";
|
|
359
|
+
});
|
|
360
|
+
const tableSlots: any = {};
|
|
361
|
+
if (slots.expandedRowRender) {
|
|
362
|
+
tableSlots.expandedRowRender = (record: any) => {
|
|
363
|
+
return (
|
|
364
|
+
<>{slots.expandedRowRender && slots.expandedRowRender(record)}</>
|
|
365
|
+
);
|
|
366
|
+
};
|
|
367
|
+
}
|
|
369
368
|
const summary = () => {
|
|
370
369
|
return <>{slots.summary && slots.summary()}</>;
|
|
371
370
|
};
|
|
@@ -385,7 +384,7 @@ const DXTable = defineComponent({
|
|
|
385
384
|
y: tableHeight.value + "px"
|
|
386
385
|
}}
|
|
387
386
|
v-model:expandedRowKeys={expandedKeys.value}
|
|
388
|
-
expandRowByClick={
|
|
387
|
+
expandRowByClick={expandRowByClick.value}
|
|
389
388
|
pagination={false}
|
|
390
389
|
customRow={customRow}
|
|
391
390
|
rowSelection={rowSelection.value}
|
|
@@ -401,8 +400,7 @@ const DXTable = defineComponent({
|
|
|
401
400
|
);
|
|
402
401
|
}
|
|
403
402
|
},
|
|
404
|
-
|
|
405
|
-
expandedRowRender: expandedRowRender,
|
|
403
|
+
...tableSlots,
|
|
406
404
|
// 总结栏插槽
|
|
407
405
|
summary: summary
|
|
408
406
|
}}
|