@ditari/bsui 1.0.71 → 1.0.73
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/NavTabs.vue.cjs.js +1 -1
- package/dist/cjs/hooks/http/index.cjs.js +1 -1
- package/dist/cjs/store/modules/NavTab.cjs.js +1 -1
- package/dist/esm/components/layout/List.vue.esm.js +57 -54
- package/dist/esm/components/layout/NavTabs.vue.esm.js +17 -16
- package/dist/esm/hooks/http/index.esm.js +15 -14
- package/dist/esm/store/modules/NavTab.esm.js +10 -10
- package/package.json +1 -1
- package/src/components/layout/List.vue +16 -20
- package/src/components/layout/NavTabs.vue +3 -2
- package/src/hooks/http/index.ts +1 -0
- package/src/store/modules/NavTab.ts +1 -0
|
@@ -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"),v=require("@vueuse/core"),w=require("../../store/modules/Settings.cjs.js"),R=require("pinia"),N=require("vue-router"),V={class:"ditari-list-layout"},C={ref:"contentRef",class:"wrapper"},E={style:{height:"100%"}},z={class:"ditari-content-extra"},k={name:"DListLayout"},q=e.defineComponent({...k,emits:["refresh"],setup(x,{emit:c}){const r=e.useSlots(),_=w.useSettingsStore(),p=N.useRoute(),n=e.inject("configProvider"),{refresh:l}=R.storeToRefs(_),S=e.ref(),o=e.ref(),u=16,a=e.ref(!1),f=e.ref(0);let s;e.watch(()=>n==null?void 0:n.componentSize,t=>{i()}),g();function g(){p.name?(e.onActivated(()=>{l.value&&(l.value=!1,c("refresh")),s=d()}),e.onDeactivated(()=>{s()})):(s=d(),e.onUnmounted(()=>{s()}))}function d(){return e.watch(()=>l.value,t=>{t&&c("refresh")})}const m=e.ref(null),{height:y}=v.useElementSize(m);e.watch(()=>y.value,t=>{i()}),v.useResizeObserver(document.body,()=>{i()});function i(){a.value=!1,setTimeout(()=>{var t;f.value=(t=o==null?void 0:o.value)==null?void 0:t.offsetHeight,a.value=!0},10)}return(t,H)=>{const h=e.resolveComponent("a-card"),b=e.resolveComponent("a-space");return e.openBlock(),e.createElementBlock("div",V,[e.createElementVNode("div",C,[e.createVNode(h,{ref_key:"formRef",ref:m,bordered:!1,class:e.normalizeClass({"ditari-list-form":e.unref(r).form}),style:e.normalizeStyle({"margin-bottom":e.unref(r).form?u+"px":0})},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"form")]),_:3},8,["class","style"]),e.createVNode(h,{class:"ditari-list-table",bordered:!1},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"toolsRef",ref:S,class:"xi-tools",style:e.normalizeStyle({"margin-bottom":e.unref(r).tools?u+"px":0})},[e.createVNode(b,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",E,[e.renderSlot(t.$slots,"table",{height:f.value})],512),[[e.vShow,a.value]])],512)]),_:3})],512),e.createElementVNode("div",z,[e.renderSlot(t.$slots,"default")])])}}});exports.default=q;
|
|
@@ -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"),f=require("vue-router"),N=require("@ant-design/icons-vue"),q=require("pinia"),y=require("../../store/modules/NavTab.cjs.js"),S=require("../../store/modules/KeepAlive.cjs.js"),g=require("../../store/modules/Menu.cjs.js"),T=require("../theme/index.cjs.js"),B=e.createElementVNode("div",{class:"tab-dividers"},null,-1),K={key:0,class:"tab-close"},P={name:"DNavTabs"},E=e.defineComponent({...P,setup(V){const l=f.useRoute(),p=f.useRouter(),u=y.useNavTabsStore(),v=S.useKeepAliveStore(),m=g.useMenuStore(),h=`${T.prefixName}-nav`,n=e.computed(()=>u.getList),{selectedMenuKeys:c}=q.storeToRefs(m),r=e.ref("");e.watchEffect(()=>{r.value=c.value.length>0?c.value[0]:""}),d(),e.watch(()=>l.path,()=>{d()});function d(){u.save(l),c.value=[l.path],v.save(l)}const _=a=>{if(a!==l.path){const t=n.value.filter(s=>s.path===a)[0];p.push({path:t.path,query:t.query,params:t.params,fullPath:t.fullPath})}},b=(a,t)=>{const s=n.value.find(i=>i.fullPath===t);a.stopPropagation(),u.deleteTabs(t),p.push(n.value[n.value.length-1].fullPath),s.name&&v.deleteKeepAlive(s.name)},C=a=>{var t;return(t=a.meta)!=null&&t.keepOpen?!1:n.value.length!==1};return(a,t)=>{const s=e.resolveComponent("a-tab-pane"),i=e.resolveComponent("a-tabs");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(h)},[e.createVNode(i,{activeKey:r.value,"onUpdate:activeKey":t[0]||(t[0]=o=>r.value=o),type:"card",onTabClick:_},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n),o=>(e.openBlock(),e.createBlock(s,{key:o.path},{tab:e.withCtx(()=>[B,e.createElementVNode("div",{class:e.normalizeClass(["tab-item",{active:r.value===o.path}])},e.toDisplayString(o.meta.title),3),C(o)?(e.openBlock(),e.createElementBlock("div",K,[e.createVNode(e.unref(N.CloseOutlined),{onClick:k=>b(k,o.fullPath)},null,8,["onClick"])])):e.createCommentVNode("",!0)]),_:2},1024))),128))]),_:1},8,["activeKey"])])}}});exports.default=E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),f=require("vue-request"),q=require("../../utils/get.cjs.js"),z=(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),f=require("vue-request"),q=require("../../utils/get.cjs.js"),z=(o,e={})=>{e.pagination||(e.pagination={currentKey:"page",pageSizeKey:"limit",totalKey:"data.total"}),e.manual===void 0&&(e.manual=!0);const{dataKey:s,pagination:{currentKey:r,pageSizeKey:g}}=e,a=e.params||n.ref({}),{total:i,pageSize:v,current:d,loading:c,data:m,run:u}=f.usePagination(o,{manual:!0,pagination:e.pagination,loadingDelay:400,loadingKeep:100,onSuccess:(t,l)=>{e.onSuccess&&e.onSuccess(t,l)},onError:(t,l)=>{console.warn(l,t),c.value=!1}}),y=n.computed(()=>({total:i.value,current:d.value,pageSize:v.value})),S=n.computed(()=>q.get(m.value,s||"data",[])||[]),p=t=>{a.value[r]=t.page,a.value[g]=t.size,u(a.value||{})},K=t=>{a.value={...a.value,...t},a.value[r]=1,u(a.value||{})};return n.onMounted(()=>{e.manual&&u(a.value)}),{data:S,pagination:y,loading:c,total:i,run:u,onPageChange:p,onQuery:K}};exports.useRequestList=z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("pinia"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("pinia"),h=require("../types.cjs.js"),n=l.defineStore(h.NAV_TAB_ID,{state:()=>({list:[],activeKey:""}),getters:{getList:t=>t.list,getActiveKey:t=>t.activeKey},actions:{setActiveKey(t){this.activeKey=t},save(t){var i;if(!((i=t.meta)!=null&&i.title))return;if(this.list.some(e=>e.path===t.path)){this.list.forEach(e=>{e.path===t.path&&(e.query=t.query,e.fullPath=t.fullPath,e.params=t.params,e.meta=t.meta,e.name=t.name||"")});return}const a={path:t.path,fullPath:t.fullPath,query:t.query,params:t.params,meta:t.meta,name:t.name||""};this.list.push(a)},deleteTabs(t){this.list.splice(this.list.findIndex(s=>s.fullPath===t),1)},setNavTitle(t,s){for(let a=0;a<this.list.length;a++)if(this.list[a].fullPath===s){this.list[a].meta.title=t;break}}},persist:!0});exports.useNavTabsStore=n;
|
|
@@ -1,110 +1,113 @@
|
|
|
1
|
-
import { defineComponent as $, useSlots as B, inject as D, ref as
|
|
2
|
-
import { useElementSize as U } from "@vueuse/core";
|
|
1
|
+
import { defineComponent as $, useSlots as B, inject as D, ref as t, watch as u, onUnmounted as E, onActivated as L, onDeactivated as N, resolveComponent as b, openBlock as T, createElementBlock as V, createElementVNode as o, createVNode as m, normalizeClass as W, unref as d, normalizeStyle as S, withCtx as h, renderSlot as l, withDirectives as j, vShow as A } from "vue";
|
|
2
|
+
import { useElementSize as O, useResizeObserver as U } from "@vueuse/core";
|
|
3
3
|
import { useSettingsStore as q } from "../../store/modules/Settings.esm.js";
|
|
4
4
|
import { storeToRefs as F } from "pinia";
|
|
5
5
|
import { useRoute as G } from "vue-router";
|
|
6
6
|
const I = { class: "ditari-list-layout" }, J = {
|
|
7
7
|
ref: "contentRef",
|
|
8
8
|
class: "wrapper"
|
|
9
|
-
}, K = { style: { height: "100%" } }, M = { class: "ditari-content-extra" },
|
|
9
|
+
}, K = { style: { height: "100%" } }, M = { class: "ditari-content-extra" }, P = {
|
|
10
10
|
name: "DListLayout"
|
|
11
|
-
},
|
|
12
|
-
...
|
|
11
|
+
}, se = /* @__PURE__ */ $({
|
|
12
|
+
...P,
|
|
13
13
|
emits: ["refresh"],
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
14
|
+
setup(Q, { emit: _ }) {
|
|
15
|
+
const a = B(), w = q(), k = G(), n = D("configProvider"), { refresh: i } = F(w), z = t(), s = t(), v = 16, c = t(!1), p = t(0);
|
|
16
16
|
let r;
|
|
17
|
-
|
|
18
|
-
() =>
|
|
17
|
+
u(
|
|
18
|
+
() => n == null ? void 0 : n.componentSize,
|
|
19
19
|
(e) => {
|
|
20
|
-
|
|
21
|
-
var o;
|
|
22
|
-
u.value = (o = t == null ? void 0 : t.value) == null ? void 0 : o.offsetHeight, s.value = !0;
|
|
23
|
-
}, 100);
|
|
20
|
+
f();
|
|
24
21
|
}
|
|
25
|
-
),
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}),
|
|
22
|
+
), x();
|
|
23
|
+
function x() {
|
|
24
|
+
k.name ? (L(() => {
|
|
25
|
+
i.value && (i.value = !1, _("refresh")), r = y();
|
|
26
|
+
}), N(() => {
|
|
30
27
|
r();
|
|
31
|
-
})) : (r =
|
|
28
|
+
})) : (r = y(), E(() => {
|
|
32
29
|
r();
|
|
33
30
|
}));
|
|
34
31
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
37
|
-
() =>
|
|
32
|
+
function y() {
|
|
33
|
+
return u(
|
|
34
|
+
() => i.value,
|
|
38
35
|
(e) => {
|
|
39
36
|
e && _("refresh");
|
|
40
37
|
}
|
|
41
38
|
);
|
|
42
39
|
}
|
|
43
|
-
const
|
|
44
|
-
|
|
40
|
+
const g = t(null), { height: C } = O(g);
|
|
41
|
+
u(
|
|
45
42
|
() => C.value,
|
|
46
43
|
(e) => {
|
|
47
|
-
|
|
48
|
-
var o;
|
|
49
|
-
u.value = (o = t == null ? void 0 : t.value) == null ? void 0 : o.offsetHeight, s.value = !0;
|
|
50
|
-
}, 10);
|
|
44
|
+
f();
|
|
51
45
|
}
|
|
52
|
-
), (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
), U(document.body, () => {
|
|
47
|
+
f();
|
|
48
|
+
});
|
|
49
|
+
function f() {
|
|
50
|
+
c.value = !1, setTimeout(() => {
|
|
51
|
+
var e;
|
|
52
|
+
p.value = (e = s == null ? void 0 : s.value) == null ? void 0 : e.offsetHeight, c.value = !0;
|
|
53
|
+
}, 10);
|
|
54
|
+
}
|
|
55
|
+
return (e, X) => {
|
|
56
|
+
const R = b("a-card"), H = b("a-space");
|
|
57
|
+
return T(), V("div", I, [
|
|
58
|
+
o("div", J, [
|
|
59
|
+
m(R, {
|
|
57
60
|
ref_key: "formRef",
|
|
58
|
-
ref:
|
|
61
|
+
ref: g,
|
|
59
62
|
bordered: !1,
|
|
60
|
-
class: W({ "ditari-list-form":
|
|
61
|
-
style:
|
|
63
|
+
class: W({ "ditari-list-form": d(a).form }),
|
|
64
|
+
style: S({ "margin-bottom": d(a).form ? v + "px" : 0 })
|
|
62
65
|
}, {
|
|
63
|
-
default:
|
|
64
|
-
|
|
66
|
+
default: h(() => [
|
|
67
|
+
l(e.$slots, "form")
|
|
65
68
|
]),
|
|
66
69
|
_: 3
|
|
67
70
|
}, 8, ["class", "style"]),
|
|
68
|
-
|
|
71
|
+
m(R, {
|
|
69
72
|
class: "ditari-list-table",
|
|
70
73
|
bordered: !1
|
|
71
74
|
}, {
|
|
72
|
-
default:
|
|
73
|
-
|
|
75
|
+
default: h(() => [
|
|
76
|
+
o("div", {
|
|
74
77
|
ref_key: "toolsRef",
|
|
75
|
-
ref:
|
|
78
|
+
ref: z,
|
|
76
79
|
class: "xi-tools",
|
|
77
|
-
style:
|
|
80
|
+
style: S({ "margin-bottom": d(a).tools ? v + "px" : 0 })
|
|
78
81
|
}, [
|
|
79
|
-
|
|
80
|
-
default:
|
|
81
|
-
|
|
82
|
+
m(H, null, {
|
|
83
|
+
default: h(() => [
|
|
84
|
+
l(e.$slots, "tools")
|
|
82
85
|
]),
|
|
83
86
|
_: 3
|
|
84
87
|
})
|
|
85
88
|
], 4),
|
|
86
|
-
|
|
89
|
+
o("div", {
|
|
87
90
|
ref_key: "tableRef",
|
|
88
|
-
ref:
|
|
91
|
+
ref: s,
|
|
89
92
|
style: { flex: "1" }
|
|
90
93
|
}, [
|
|
91
|
-
j(
|
|
92
|
-
|
|
94
|
+
j(o("div", K, [
|
|
95
|
+
l(e.$slots, "table", { height: p.value })
|
|
93
96
|
], 512), [
|
|
94
|
-
[A,
|
|
97
|
+
[A, c.value]
|
|
95
98
|
])
|
|
96
99
|
], 512)
|
|
97
100
|
]),
|
|
98
101
|
_: 3
|
|
99
102
|
})
|
|
100
103
|
], 512),
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
o("div", M, [
|
|
105
|
+
l(e.$slots, "default")
|
|
103
106
|
])
|
|
104
107
|
]);
|
|
105
108
|
};
|
|
106
109
|
}
|
|
107
110
|
});
|
|
108
111
|
export {
|
|
109
|
-
|
|
112
|
+
se as default
|
|
110
113
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as P, computed as x, ref as w, watchEffect as A, watch as B, resolveComponent as d, openBlock as r, createElementBlock as p, normalizeClass as h, createVNode as _, withCtx as b, Fragment as E, renderList as R, unref as C, createBlock as V, createElementVNode as k, toDisplayString as q, createCommentVNode as D } from "vue";
|
|
2
2
|
import { useRoute as L, useRouter as M } from "vue-router";
|
|
3
3
|
import { CloseOutlined as O } from "@ant-design/icons-vue";
|
|
4
4
|
import { storeToRefs as z } from "pinia";
|
|
@@ -11,12 +11,12 @@ const G = /* @__PURE__ */ k("div", { class: "tab-dividers" }, null, -1), H = {
|
|
|
11
11
|
class: "tab-close"
|
|
12
12
|
}, I = {
|
|
13
13
|
name: "DNavTabs"
|
|
14
|
-
}, oe = /* @__PURE__ */
|
|
14
|
+
}, oe = /* @__PURE__ */ P({
|
|
15
15
|
...I,
|
|
16
16
|
setup(J) {
|
|
17
|
-
const n = L(), m = M(),
|
|
17
|
+
const n = L(), m = M(), u = F(), v = U(), y = $(), N = `${j}-nav`, o = x(() => u.getList), { selectedMenuKeys: c } = z(y), l = w("");
|
|
18
18
|
A(() => {
|
|
19
|
-
|
|
19
|
+
l.value = c.value.length > 0 ? c.value[0] : "";
|
|
20
20
|
}), f(), B(
|
|
21
21
|
() => n.path,
|
|
22
22
|
() => {
|
|
@@ -24,7 +24,7 @@ const G = /* @__PURE__ */ k("div", { class: "tab-dividers" }, null, -1), H = {
|
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
26
|
function f() {
|
|
27
|
-
|
|
27
|
+
u.save(n), c.value = [n.path], v.save(n);
|
|
28
28
|
}
|
|
29
29
|
const S = (t) => {
|
|
30
30
|
if (t !== n.path) {
|
|
@@ -32,38 +32,39 @@ const G = /* @__PURE__ */ k("div", { class: "tab-dividers" }, null, -1), H = {
|
|
|
32
32
|
m.push({
|
|
33
33
|
path: e.path,
|
|
34
34
|
query: e.query,
|
|
35
|
-
params: e.params
|
|
35
|
+
params: e.params,
|
|
36
|
+
fullPath: e.fullPath
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
}, g = (t, e) => {
|
|
39
40
|
const s = o.value.find((i) => i.fullPath === e);
|
|
40
|
-
t.stopPropagation(),
|
|
41
|
+
t.stopPropagation(), u.deleteTabs(e), m.push(o.value[o.value.length - 1].fullPath), s.name && v.deleteKeepAlive(s.name);
|
|
41
42
|
}, K = (t) => {
|
|
42
43
|
var e;
|
|
43
44
|
return (e = t.meta) != null && e.keepOpen ? !1 : o.value.length !== 1;
|
|
44
45
|
};
|
|
45
46
|
return (t, e) => {
|
|
46
47
|
const s = d("a-tab-pane"), i = d("a-tabs");
|
|
47
|
-
return
|
|
48
|
-
class:
|
|
48
|
+
return r(), p("div", {
|
|
49
|
+
class: h(N)
|
|
49
50
|
}, [
|
|
50
|
-
|
|
51
|
-
activeKey:
|
|
52
|
-
"onUpdate:activeKey": e[0] || (e[0] = (a) =>
|
|
51
|
+
_(i, {
|
|
52
|
+
activeKey: l.value,
|
|
53
|
+
"onUpdate:activeKey": e[0] || (e[0] = (a) => l.value = a),
|
|
53
54
|
type: "card",
|
|
54
55
|
onTabClick: S
|
|
55
56
|
}, {
|
|
56
57
|
default: b(() => [
|
|
57
|
-
(
|
|
58
|
+
(r(!0), p(E, null, R(C(o), (a) => (r(), V(s, {
|
|
58
59
|
key: a.path
|
|
59
60
|
}, {
|
|
60
61
|
tab: b(() => [
|
|
61
62
|
G,
|
|
62
63
|
k("div", {
|
|
63
|
-
class:
|
|
64
|
+
class: h(["tab-item", { active: l.value === a.path }])
|
|
64
65
|
}, q(a.meta.title), 3),
|
|
65
|
-
K(a) ? (
|
|
66
|
-
|
|
66
|
+
K(a) ? (r(), p("div", H, [
|
|
67
|
+
_(C(O), {
|
|
67
68
|
onClick: (T) => g(T, a.fullPath)
|
|
68
69
|
}, null, 8, ["onClick"])
|
|
69
70
|
])) : D("", !0)
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { ref as S, computed as
|
|
1
|
+
import { ref as S, computed as i, onMounted as z } from "vue";
|
|
2
2
|
import { usePagination as D } from "vue-request";
|
|
3
3
|
import { get as P } from "../../utils/get.esm.js";
|
|
4
|
-
const x = (
|
|
4
|
+
const x = (c, a = {}) => {
|
|
5
5
|
a.pagination || (a.pagination = {
|
|
6
6
|
currentKey: "page",
|
|
7
7
|
pageSizeKey: "limit",
|
|
8
8
|
totalKey: "data.total"
|
|
9
9
|
}), a.manual === void 0 && (a.manual = !0);
|
|
10
10
|
const {
|
|
11
|
-
dataKey:
|
|
12
|
-
pagination: { currentKey: l, pageSizeKey:
|
|
11
|
+
dataKey: g,
|
|
12
|
+
pagination: { currentKey: l, pageSizeKey: s }
|
|
13
13
|
} = a, e = a.params || S({}), {
|
|
14
|
-
total:
|
|
14
|
+
total: r,
|
|
15
15
|
pageSize: v,
|
|
16
16
|
current: m,
|
|
17
|
-
loading:
|
|
17
|
+
loading: o,
|
|
18
18
|
data: d,
|
|
19
19
|
run: n
|
|
20
|
-
} = D(
|
|
20
|
+
} = D(c, {
|
|
21
21
|
manual: !0,
|
|
22
22
|
pagination: a.pagination,
|
|
23
23
|
loadingDelay: 400,
|
|
@@ -26,16 +26,16 @@ const x = (i, a = {}) => {
|
|
|
26
26
|
a.onSuccess && a.onSuccess(t, u);
|
|
27
27
|
},
|
|
28
28
|
onError: (t, u) => {
|
|
29
|
-
console.warn(u, t),
|
|
29
|
+
console.warn(u, t), o.value = !1;
|
|
30
30
|
}
|
|
31
|
-
}), p =
|
|
32
|
-
total:
|
|
31
|
+
}), p = i(() => ({
|
|
32
|
+
total: r.value,
|
|
33
33
|
current: m.value,
|
|
34
34
|
pageSize: v.value
|
|
35
|
-
})), f =
|
|
36
|
-
() => P(d.value,
|
|
35
|
+
})), f = i(
|
|
36
|
+
() => P(d.value, g || "data", []) || []
|
|
37
37
|
), y = (t) => {
|
|
38
|
-
e.value[l] = t.page, e.value[
|
|
38
|
+
e.value[l] = t.page, e.value[s] = t.size, n(e.value || {});
|
|
39
39
|
}, K = (t) => {
|
|
40
40
|
e.value = { ...e.value, ...t }, e.value[l] = 1, n(e.value || {});
|
|
41
41
|
};
|
|
@@ -44,7 +44,8 @@ const x = (i, a = {}) => {
|
|
|
44
44
|
}), {
|
|
45
45
|
data: f,
|
|
46
46
|
pagination: p,
|
|
47
|
-
loading:
|
|
47
|
+
loading: o,
|
|
48
|
+
total: r,
|
|
48
49
|
run: n,
|
|
49
50
|
onPageChange: y,
|
|
50
51
|
onQuery: K
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineStore as l } from "pinia";
|
|
2
2
|
import { NAV_TAB_ID as h } from "../types.esm.js";
|
|
3
|
-
const
|
|
3
|
+
const n = l(h, {
|
|
4
4
|
state: () => ({
|
|
5
5
|
// 多标签列表
|
|
6
6
|
list: [],
|
|
@@ -29,11 +29,11 @@ const f = l(h, {
|
|
|
29
29
|
return;
|
|
30
30
|
if (this.list.some((a) => a.path === t.path)) {
|
|
31
31
|
this.list.forEach((a) => {
|
|
32
|
-
a.path === t.path && (a.query = t.query, a.params = t.params, a.meta = t.meta, a.name = t.name || "");
|
|
32
|
+
a.path === t.path && (a.query = t.query, a.fullPath = t.fullPath, a.params = t.params, a.meta = t.meta, a.name = t.name || "");
|
|
33
33
|
});
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const s = {
|
|
37
37
|
path: t.path,
|
|
38
38
|
fullPath: t.fullPath,
|
|
39
39
|
query: t.query,
|
|
@@ -41,7 +41,7 @@ const f = l(h, {
|
|
|
41
41
|
meta: t.meta,
|
|
42
42
|
name: t.name || ""
|
|
43
43
|
};
|
|
44
|
-
this.list.push(
|
|
44
|
+
this.list.push(s);
|
|
45
45
|
},
|
|
46
46
|
/**
|
|
47
47
|
* 删除标签
|
|
@@ -49,7 +49,7 @@ const f = l(h, {
|
|
|
49
49
|
*/
|
|
50
50
|
deleteTabs(t) {
|
|
51
51
|
this.list.splice(
|
|
52
|
-
this.list.findIndex((
|
|
52
|
+
this.list.findIndex((e) => e.fullPath === t),
|
|
53
53
|
1
|
|
54
54
|
);
|
|
55
55
|
},
|
|
@@ -58,10 +58,10 @@ const f = l(h, {
|
|
|
58
58
|
* @param title 标题
|
|
59
59
|
* @param path url
|
|
60
60
|
*/
|
|
61
|
-
setNavTitle(t,
|
|
62
|
-
for (let
|
|
63
|
-
if (this.list[
|
|
64
|
-
this.list[
|
|
61
|
+
setNavTitle(t, e) {
|
|
62
|
+
for (let s = 0; s < this.list.length; s++)
|
|
63
|
+
if (this.list[s].fullPath === e) {
|
|
64
|
+
this.list[s].meta.title = t;
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -69,5 +69,5 @@ const f = l(h, {
|
|
|
69
69
|
persist: !0
|
|
70
70
|
});
|
|
71
71
|
export {
|
|
72
|
-
|
|
72
|
+
n as useNavTabsStore
|
|
73
73
|
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useElementSize } from "@vueuse/core";
|
|
3
|
-
|
|
4
2
|
import {
|
|
5
3
|
useSlots,
|
|
6
4
|
ref,
|
|
7
|
-
nextTick,
|
|
8
5
|
onActivated,
|
|
9
6
|
watch,
|
|
10
7
|
onDeactivated,
|
|
@@ -12,6 +9,7 @@ import {
|
|
|
12
9
|
WatchStopHandle,
|
|
13
10
|
inject
|
|
14
11
|
} from "vue";
|
|
12
|
+
import { useElementSize, useResizeObserver } from "@vueuse/core";
|
|
15
13
|
import { useSettingsStore } from "../../store/modules/Settings";
|
|
16
14
|
import { storeToRefs } from "pinia";
|
|
17
15
|
import { useRoute } from "vue-router";
|
|
@@ -37,21 +35,10 @@ const height = ref(0);
|
|
|
37
35
|
|
|
38
36
|
let stopHandleWatch: WatchStopHandle;
|
|
39
37
|
|
|
40
|
-
// nextTick(() => {
|
|
41
|
-
// setTimeout(() => {
|
|
42
|
-
// height.value = tableRef?.value?.offsetHeight;
|
|
43
|
-
// show.value = true;
|
|
44
|
-
// }, 1);
|
|
45
|
-
// });
|
|
46
|
-
|
|
47
38
|
watch(
|
|
48
39
|
() => configProvider?.componentSize,
|
|
49
40
|
(val) => {
|
|
50
|
-
|
|
51
|
-
setTimeout(() => {
|
|
52
|
-
height.value = tableRef?.value?.offsetHeight;
|
|
53
|
-
show.value = true;
|
|
54
|
-
}, 100);
|
|
41
|
+
calcHeight();
|
|
55
42
|
}
|
|
56
43
|
);
|
|
57
44
|
|
|
@@ -101,13 +88,22 @@ const { height: formHeight } = useElementSize(formRef);
|
|
|
101
88
|
watch(
|
|
102
89
|
() => formHeight.value,
|
|
103
90
|
(val) => {
|
|
104
|
-
|
|
105
|
-
setTimeout(() => {
|
|
106
|
-
height.value = tableRef?.value?.offsetHeight;
|
|
107
|
-
show.value = true;
|
|
108
|
-
}, 10);
|
|
91
|
+
calcHeight();
|
|
109
92
|
}
|
|
110
93
|
);
|
|
94
|
+
|
|
95
|
+
useResizeObserver(document.body, () => {
|
|
96
|
+
calcHeight();
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// 动态计算高度
|
|
100
|
+
function calcHeight() {
|
|
101
|
+
show.value = false;
|
|
102
|
+
setTimeout(() => {
|
|
103
|
+
height.value = tableRef?.value?.offsetHeight;
|
|
104
|
+
show.value = true;
|
|
105
|
+
}, 10);
|
|
106
|
+
}
|
|
111
107
|
</script>
|
|
112
108
|
<script lang="ts">
|
|
113
109
|
export default {
|
package/src/hooks/http/index.ts
CHANGED
|
@@ -60,6 +60,7 @@ export const useNavTabsStore = defineStore(NAV_TAB_ID, {
|
|
|
60
60
|
this.list.forEach((item: INavTab) => {
|
|
61
61
|
if (item.path === route.path) {
|
|
62
62
|
item.query = route.query;
|
|
63
|
+
item.fullPath = route.fullPath;
|
|
63
64
|
item.params = route.params;
|
|
64
65
|
item.meta = route.meta;
|
|
65
66
|
item.name = <string>route.name || "";
|