@chewel611/naive-ui-plus 0.0.1
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/README.md +73 -0
- package/dist/index.js +1377 -0
- package/dist/index.umd.cjs +1 -0
- package/dist/style.css +1 -0
- package/es/_virtual/_plugin-vue_export-helper.js +9 -0
- package/es/application/PApplication.d.ts +23 -0
- package/es/application/PApplication.vue.js +53 -0
- package/es/application/PApplication.vue2.js +4 -0
- package/es/application/index.d.ts +33 -0
- package/es/application/index.js +6 -0
- package/es/components.d.ts +5 -0
- package/es/components.js +12 -0
- package/es/index.d.ts +9 -0
- package/es/index.js +24 -0
- package/es/languages/PLanguage.d.ts +2 -0
- package/es/languages/PLanguage.vue.js +69 -0
- package/es/languages/PLanguage.vue2.js +4 -0
- package/es/languages/index.d.ts +16 -0
- package/es/languages/index.js +7 -0
- package/es/languages/store.d.ts +137 -0
- package/es/languages/store.js +53 -0
- package/es/languages/typing.d.ts +14 -0
- package/es/layout/PLayout.css +1 -0
- package/es/layout/PLayout.d.ts +2 -0
- package/es/layout/PLayout.vue.js +7 -0
- package/es/layout/PLayout.vue2.js +80 -0
- package/es/layout/content/PContent.d.ts +7 -0
- package/es/layout/content/PContent.vue.js +27 -0
- package/es/layout/content/PContent.vue2.js +4 -0
- package/es/layout/content/PTabs.css +1 -0
- package/es/layout/content/PTabs.d.ts +5 -0
- package/es/layout/content/PTabs.vue.js +7 -0
- package/es/layout/content/PTabs.vue2.js +281 -0
- package/es/layout/header/PHeader.css +1 -0
- package/es/layout/header/PHeader.d.ts +2 -0
- package/es/layout/header/PHeader.vue.js +7 -0
- package/es/layout/header/PHeader.vue2.js +188 -0
- package/es/layout/index.d.ts +15 -0
- package/es/layout/index.js +6 -0
- package/es/layout/layout.d.ts +21002 -0
- package/es/layout/layout.js +74 -0
- package/es/layout/sider/PLogo.css +1 -0
- package/es/layout/sider/PLogo.d.ts +2 -0
- package/es/layout/sider/PLogo.vue.js +7 -0
- package/es/layout/sider/PLogo.vue2.js +23 -0
- package/es/layout/sider/PMenus.d.ts +2 -0
- package/es/layout/sider/PMenus.vue.js +90 -0
- package/es/layout/sider/PMenus.vue2.js +4 -0
- package/es/modal/PModal.d.ts +4173 -0
- package/es/modal/PModal.vue.js +106 -0
- package/es/modal/PModal.vue2.js +4 -0
- package/es/modal/index.d.ts +2116 -0
- package/es/modal/index.js +6 -0
- package/es/modal/typing.d.ts +12 -0
- package/es/table/PTable.d.ts +37 -0
- package/es/table/PTable.vue.js +384 -0
- package/es/table/PTable.vue2.js +4 -0
- package/es/table/index.d.ts +61 -0
- package/es/table/index.js +6 -0
- package/es/table/typing.d.ts +41 -0
- package/es/typing.d.ts +5 -0
- package/es/utils/install.d.ts +2 -0
- package/es/utils/install.js +9 -0
- package/es/utils/plus.d.ts +6 -0
- package/es/utils/resolver.d.ts +7 -0
- package/es/utils/storage.d.ts +7 -0
- package/lib/_virtual/_plugin-vue_export-helper.cjs +1 -0
- package/lib/application/PApplication.d.ts +23 -0
- package/lib/application/PApplication.vue.cjs +1 -0
- package/lib/application/PApplication.vue2.cjs +1 -0
- package/lib/application/index.cjs +1 -0
- package/lib/application/index.d.ts +33 -0
- package/lib/components.cjs +1 -0
- package/lib/components.d.ts +5 -0
- package/lib/index.cjs +1 -0
- package/lib/index.d.ts +9 -0
- package/lib/languages/PLanguage.d.ts +2 -0
- package/lib/languages/PLanguage.vue.cjs +1 -0
- package/lib/languages/PLanguage.vue2.cjs +1 -0
- package/lib/languages/index.cjs +1 -0
- package/lib/languages/index.d.ts +16 -0
- package/lib/languages/store.cjs +1 -0
- package/lib/languages/store.d.ts +137 -0
- package/lib/languages/typing.d.ts +14 -0
- package/lib/layout/PLayout.css +1 -0
- package/lib/layout/PLayout.d.ts +2 -0
- package/lib/layout/PLayout.vue.cjs +1 -0
- package/lib/layout/PLayout.vue2.cjs +1 -0
- package/lib/layout/content/PContent.d.ts +7 -0
- package/lib/layout/content/PContent.vue.cjs +1 -0
- package/lib/layout/content/PContent.vue2.cjs +1 -0
- package/lib/layout/content/PTabs.css +1 -0
- package/lib/layout/content/PTabs.d.ts +5 -0
- package/lib/layout/content/PTabs.vue.cjs +1 -0
- package/lib/layout/content/PTabs.vue2.cjs +1 -0
- package/lib/layout/header/PHeader.css +1 -0
- package/lib/layout/header/PHeader.d.ts +2 -0
- package/lib/layout/header/PHeader.vue.cjs +1 -0
- package/lib/layout/header/PHeader.vue2.cjs +1 -0
- package/lib/layout/index.cjs +1 -0
- package/lib/layout/index.d.ts +15 -0
- package/lib/layout/layout.cjs +1 -0
- package/lib/layout/layout.d.ts +21002 -0
- package/lib/layout/sider/PLogo.css +1 -0
- package/lib/layout/sider/PLogo.d.ts +2 -0
- package/lib/layout/sider/PLogo.vue.cjs +1 -0
- package/lib/layout/sider/PLogo.vue2.cjs +1 -0
- package/lib/layout/sider/PMenus.d.ts +2 -0
- package/lib/layout/sider/PMenus.vue.cjs +1 -0
- package/lib/layout/sider/PMenus.vue2.cjs +1 -0
- package/lib/modal/PModal.d.ts +4173 -0
- package/lib/modal/PModal.vue.cjs +1 -0
- package/lib/modal/PModal.vue2.cjs +1 -0
- package/lib/modal/index.cjs +1 -0
- package/lib/modal/index.d.ts +2116 -0
- package/lib/modal/typing.d.ts +12 -0
- package/lib/table/PTable.d.ts +37 -0
- package/lib/table/PTable.vue.cjs +1 -0
- package/lib/table/PTable.vue2.cjs +1 -0
- package/lib/table/index.cjs +1 -0
- package/lib/table/index.d.ts +61 -0
- package/lib/table/typing.d.ts +41 -0
- package/lib/typing.d.ts +5 -0
- package/lib/utils/install.cjs +1 -0
- package/lib/utils/install.d.ts +2 -0
- package/lib/utils/plus.d.ts +6 -0
- package/lib/utils/resolver.d.ts +7 -0
- package/lib/utils/storage.d.ts +7 -0
- package/package.json +103 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { NLayout as s, NLayoutSider as i, NFlex as c, NLayoutHeader as d, NLayoutContent as u, NBackTop as p } from "naive-ui";
|
|
2
|
+
import { defineComponent as m, ref as f, provide as _, createBlock as y, openBlock as g, unref as e, withCtx as a, createVNode as o, createElementVNode as n, nextTick as v } from "vue";
|
|
3
|
+
import h from "./sider/PLogo.vue.js";
|
|
4
|
+
import x from "./header/PHeader.vue.js";
|
|
5
|
+
import b from "./content/PContent.vue.js";
|
|
6
|
+
import N from "./content/PTabs.vue.js";
|
|
7
|
+
import P from "./sider/PMenus.vue.js";
|
|
8
|
+
import { usePLayoutStore as L } from "./layout.js";
|
|
9
|
+
const k = { class: "layout-content-main layout-content-main-fix" }, w = { class: "main-view main-view-fix" }, A = /* @__PURE__ */ m({
|
|
10
|
+
__name: "PLayout",
|
|
11
|
+
setup(C) {
|
|
12
|
+
const t = L(), l = f(!1);
|
|
13
|
+
return _("reloadPage", () => {
|
|
14
|
+
l.value = !0, v(() => l.value = !1);
|
|
15
|
+
}), (E, T) => {
|
|
16
|
+
const r = p;
|
|
17
|
+
return g(), y(e(s), {
|
|
18
|
+
"has-sider": "",
|
|
19
|
+
class: "layout",
|
|
20
|
+
position: "absolute"
|
|
21
|
+
}, {
|
|
22
|
+
default: a(() => [
|
|
23
|
+
o(e(i), {
|
|
24
|
+
class: "layout-sider",
|
|
25
|
+
inverted: "",
|
|
26
|
+
"show-trigger": "bar",
|
|
27
|
+
position: "absolute",
|
|
28
|
+
"collapse-mode": "width",
|
|
29
|
+
collapsed: e(t).state.collapsed,
|
|
30
|
+
"native-scrollbar": !1,
|
|
31
|
+
"collapsed-width": 64,
|
|
32
|
+
onCollapse: e(t).collapse,
|
|
33
|
+
onExpand: e(t).collapse
|
|
34
|
+
}, {
|
|
35
|
+
default: a(() => [
|
|
36
|
+
o(e(c), { vertical: "" }, {
|
|
37
|
+
default: a(() => [
|
|
38
|
+
o(h),
|
|
39
|
+
o(P)
|
|
40
|
+
]),
|
|
41
|
+
_: 1
|
|
42
|
+
})
|
|
43
|
+
]),
|
|
44
|
+
_: 1
|
|
45
|
+
}, 8, ["collapsed", "onCollapse", "onExpand"]),
|
|
46
|
+
o(e(s), null, {
|
|
47
|
+
default: a(() => [
|
|
48
|
+
o(e(d), { position: "absolute" }, {
|
|
49
|
+
default: a(() => [
|
|
50
|
+
o(x)
|
|
51
|
+
]),
|
|
52
|
+
_: 1
|
|
53
|
+
}),
|
|
54
|
+
o(e(u), { class: "layout-content layout-default-background" }, {
|
|
55
|
+
default: a(() => [
|
|
56
|
+
n("div", k, [
|
|
57
|
+
o(N),
|
|
58
|
+
n("div", w, [
|
|
59
|
+
o(b, { loading: l.value }, null, 8, ["loading"])
|
|
60
|
+
])
|
|
61
|
+
])
|
|
62
|
+
]),
|
|
63
|
+
_: 1
|
|
64
|
+
}),
|
|
65
|
+
o(r, {
|
|
66
|
+
right: 20,
|
|
67
|
+
class: "z-50"
|
|
68
|
+
})
|
|
69
|
+
]),
|
|
70
|
+
_: 1
|
|
71
|
+
})
|
|
72
|
+
]),
|
|
73
|
+
_: 1
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
export {
|
|
79
|
+
A as default
|
|
80
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
loading: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
loading: boolean;
|
|
6
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineComponent as r, resolveComponent as c, createElementBlock as p, openBlock as e, createBlock as o, createCommentVNode as s, withCtx as m, KeepAlive as i, resolveDynamicComponent as _ } from "vue";
|
|
2
|
+
const u = { class: "mt-1" }, k = /* @__PURE__ */ r({
|
|
3
|
+
__name: "PContent",
|
|
4
|
+
props: {
|
|
5
|
+
loading: { type: Boolean, default: !1 }
|
|
6
|
+
},
|
|
7
|
+
setup(d) {
|
|
8
|
+
return (t, f) => {
|
|
9
|
+
const n = c("RouterView");
|
|
10
|
+
return e(), p("div", u, [
|
|
11
|
+
t.loading ? s("", !0) : (e(), o(n, { key: 0 }, {
|
|
12
|
+
default: m(({ Component: l, route: a }) => [
|
|
13
|
+
(e(), o(i, null, [
|
|
14
|
+
(e(), o(_(l), {
|
|
15
|
+
key: a.fullPath
|
|
16
|
+
}))
|
|
17
|
+
], 1024))
|
|
18
|
+
]),
|
|
19
|
+
_: 1
|
|
20
|
+
}))
|
|
21
|
+
]);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
k as default
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.tabs-view[data-v-f0706f46]{width:100%;padding:6px 0;display:flex;transition:all .2s ease-in-out}.tabs-view-main[data-v-f0706f46]{height:32px;display:flex;max-width:100%;min-width:100%}.tabs-view-main .tabs-card[data-v-f0706f46]{-webkit-box-flex:1;flex-grow:1;flex-shrink:1;overflow:hidden;position:relative}.tabs-view-main .tabs-card .tabs-card-prev[data-v-f0706f46],.tabs-view-main .tabs-card .tabs-card-next[data-v-f0706f46]{width:32px;text-align:center;position:absolute;line-height:32px;cursor:pointer}.tabs-view-main .tabs-card .tabs-card-prev .n-icon[data-v-f0706f46],.tabs-view-main .tabs-card .tabs-card-next .n-icon[data-v-f0706f46]{display:flex;align-items:center;justify-content:center;height:32px;width:32px}.tabs-view-main .tabs-card .tabs-card-prev[data-v-f0706f46]{left:0}.tabs-view-main .tabs-card .tabs-card-next[data-v-f0706f46]{right:0}.tabs-view-main .tabs-card .tabs-card-next-hide[data-v-f0706f46],.tabs-view-main .tabs-card .tabs-card-prev-hide[data-v-f0706f46]{display:none}.tabs-view-main .tabs-card-scroll[data-v-f0706f46]{white-space:nowrap;overflow:hidden}.tabs-view-main .tabs-card-scroll-item[data-v-f0706f46]{background:var(--4cb4fdc8);color:var(--21e8bab2);height:32px;padding:6px 16px 4px;border-radius:3px;margin-right:6px;cursor:pointer;display:inline-block;position:relative;flex:0 0 auto}.tabs-view-main .tabs-card-scroll-item span[data-v-f0706f46]{float:left;vertical-align:middle}.tabs-view-main .tabs-card-scroll-item[data-v-f0706f46]:hover{color:#515a6e}.tabs-view-main .tabs-card-scroll-item .n-icon[data-v-f0706f46]{height:22px;width:21px;margin-right:-6px;position:relative;vertical-align:middle;text-align:center;color:#808695}.tabs-view-main .tabs-card-scroll-item .n-icon[data-v-f0706f46]:hover{color:#515a6e!important}.tabs-view-main .tabs-card-scroll-item .n-icon svg[data-v-f0706f46]{height:21px;display:inline-block}.tabs-view-main .tabs-card-scroll .active-item[data-v-f0706f46]{color:#2d8cf0}.tabs-view-main .tabs-card-scrollable[data-v-f0706f46]{padding:0 32px;overflow:hidden}.tabs-view .tabs-close[data-v-f0706f46]{min-width:32px;width:32px;height:32px;line-height:32px;text-align:center;background:var(--color);border-radius:2px;cursor:pointer}.tabs-view .tabs-close-btn[data-v-f0706f46]{color:var(--color);height:100%;display:flex;align-items:center;justify-content:center}.tabs-view-default-background[data-v-f0706f46]{background:#f5f7f9}.tabs-view-dark-background[data-v-f0706f46]{background:#101014}.tabs-view-fix[data-v-f0706f46]{position:fixed;z-index:5;padding:6px 10px;left:200px}.tabs-view-fixed-header[data-v-f0706f46]{top:0}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
2
|
+
navWrap: HTMLDivElement;
|
|
3
|
+
navScroll: HTMLDivElement;
|
|
4
|
+
}, HTMLDivElement>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { defineComponent as oe, useCssVars as le, computed as w, ref as y, reactive as ae, h as d, inject as se, watch as ne, onMounted as re, createElementBlock as ce, openBlock as O, normalizeStyle as ie, createElementVNode as u, createVNode as c, normalizeClass as g, unref as n, withCtx as p, withModifiers as L, createBlock as ue, createCommentVNode as de, toDisplayString as fe, nextTick as R } from "vue";
|
|
2
|
+
import me from "element-resize-detector";
|
|
3
|
+
import he from "vuedraggable";
|
|
4
|
+
import { ReloadOutlined as ve, CloseOutlined as D, ColumnWidthOutlined as pe, MinusOutlined as be, LeftOutlined as we, RightOutlined as ge, DownOutlined as Se } from "@vicons/antd";
|
|
5
|
+
import { useRoute as ye, useRouter as Ce } from "vue-router";
|
|
6
|
+
import { useThemeVars as Te, useMessage as ke, NIcon as f, NDropdown as M } from "naive-ui";
|
|
7
|
+
import { usePLayoutStore as xe } from "../layout.js";
|
|
8
|
+
const _e = { class: "tabs-view-main" }, Pe = ["id", "onClick", "onContextmenu"], We = { class: "tabs-close" }, Oe = { class: "tabs-close-btn" }, ze = /* @__PURE__ */ oe({
|
|
9
|
+
__name: "PTabs",
|
|
10
|
+
setup(Le) {
|
|
11
|
+
le((e) => ({
|
|
12
|
+
"4cb4fdc8": E.value,
|
|
13
|
+
"21e8bab2": N.value
|
|
14
|
+
}));
|
|
15
|
+
const C = Te(), E = w(() => C.value.cardColor), N = w(() => C.value.textColor1), A = ke(), r = ye(), b = Ce(), s = y(null), T = y(null), k = y(!1), i = xe(), m = w(() => i.state.tabs), l = ae({
|
|
16
|
+
activeKey: r.fullPath,
|
|
17
|
+
scrollable: !0,
|
|
18
|
+
dropdownX: 0,
|
|
19
|
+
dropdownY: 0,
|
|
20
|
+
showDropdown: !1,
|
|
21
|
+
isMultiHeaderFixed: !0,
|
|
22
|
+
multiTabsSetting: !0
|
|
23
|
+
}), K = ["Login", "Redirect", "ErrorPage"], x = (e) => {
|
|
24
|
+
const { fullPath: o, hash: t, meta: a, name: h, params: Z, path: ee, query: te } = e;
|
|
25
|
+
return { fullPath: o, hash: t, meta: a, name: h, params: Z, path: ee, query: te };
|
|
26
|
+
}, z = w(() => {
|
|
27
|
+
const t = i.state.collapsed ? "64px" : "272px";
|
|
28
|
+
return {
|
|
29
|
+
left: t,
|
|
30
|
+
width: `calc(100% - ${t})`
|
|
31
|
+
};
|
|
32
|
+
}), _ = w(() => {
|
|
33
|
+
const e = m.value.length <= 1;
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
label: "刷新当前",
|
|
37
|
+
key: "1",
|
|
38
|
+
icon: () => d(f, null, { default: () => d(ve) })
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: "关闭当前",
|
|
42
|
+
key: "2",
|
|
43
|
+
disabled: k.value || e,
|
|
44
|
+
icon: () => d(f, null, { default: () => d(D) })
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: "关闭其他",
|
|
48
|
+
key: "3",
|
|
49
|
+
disabled: e,
|
|
50
|
+
icon: () => d(f, null, { default: () => d(pe) })
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: "关闭全部",
|
|
54
|
+
key: "4",
|
|
55
|
+
disabled: e,
|
|
56
|
+
icon: () => d(f, null, { default: () => d(be) })
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
}), I = () => {
|
|
60
|
+
let e = [];
|
|
61
|
+
const o = x(r);
|
|
62
|
+
try {
|
|
63
|
+
if (i.state.cacheTabs) {
|
|
64
|
+
const t = localStorage.getItem("TABS_ROUTES");
|
|
65
|
+
e = t ? JSON.parse(t) : [o];
|
|
66
|
+
}
|
|
67
|
+
} catch {
|
|
68
|
+
e = [o];
|
|
69
|
+
} finally {
|
|
70
|
+
return e;
|
|
71
|
+
}
|
|
72
|
+
}, V = (e) => {
|
|
73
|
+
const o = b.getRoutes();
|
|
74
|
+
e.forEach((t) => {
|
|
75
|
+
const a = o.find((h) => h.path === t.path);
|
|
76
|
+
a && (t.meta = a.meta || t.meta, t.name = a.name || t.name);
|
|
77
|
+
}), i.state.cacheTabs && localStorage.setItem("TABS_ROUTES", JSON.stringify(e));
|
|
78
|
+
}, $ = () => {
|
|
79
|
+
const e = I();
|
|
80
|
+
V(e), i.initTabs(e);
|
|
81
|
+
}, v = async (e) => {
|
|
82
|
+
if (await R(), !s.value) return;
|
|
83
|
+
const o = s.value.offsetWidth, t = s.value.scrollWidth;
|
|
84
|
+
o < t ? (l.scrollable = !0, e && [...s.value.querySelectorAll(".tabs-card-scroll-item") || []].forEach((h) => {
|
|
85
|
+
h.id === `tag${l.activeKey.split("/").join("/")}` && h.scrollIntoView && h.scrollIntoView();
|
|
86
|
+
})) : l.scrollable = !1;
|
|
87
|
+
}, B = (e) => !(e.draggedContext.element.meta.affix || e.relatedContext.element.meta.affix), Y = () => {
|
|
88
|
+
let e;
|
|
89
|
+
e = me(), e.listenTo(T.value, () => v(!0));
|
|
90
|
+
}, j = (e) => {
|
|
91
|
+
const { fullPath: o } = e;
|
|
92
|
+
if (o === r.fullPath || (l.activeKey = o, !e))
|
|
93
|
+
return;
|
|
94
|
+
const { replace: t } = b;
|
|
95
|
+
toString.call(e), t(e).catch(console.error);
|
|
96
|
+
}, F = (e, o) => {
|
|
97
|
+
e.preventDefault(), k.value = o.path === "/home", l.showDropdown = !1, R().then(() => {
|
|
98
|
+
l.showDropdown = !0, l.dropdownX = e.clientX, l.dropdownY = e.clientY;
|
|
99
|
+
});
|
|
100
|
+
}, X = () => {
|
|
101
|
+
r.meta.keepAlive && b.currentRoute.value.matched.find(
|
|
102
|
+
(e) => e.name == r.name
|
|
103
|
+
)?.components?.default.name;
|
|
104
|
+
}, P = (e) => {
|
|
105
|
+
if (m.value.length === 1)
|
|
106
|
+
return A.warning("这已经是最后一页,不能再关闭了!");
|
|
107
|
+
if (X(), i.closeCurrentTab(e), l.activeKey === e.fullPath) {
|
|
108
|
+
const o = m.value[Math.max(0, m.value.length - 1)];
|
|
109
|
+
l.activeKey = o.fullPath, b.push(o);
|
|
110
|
+
}
|
|
111
|
+
v();
|
|
112
|
+
}, q = (e) => {
|
|
113
|
+
const { fullPath: o } = e, t = m.value.find((a) => a.fullPath == o);
|
|
114
|
+
P(t);
|
|
115
|
+
}, H = (e) => {
|
|
116
|
+
i.closeOtherTabs(e), l.activeKey = e.fullPath, b.replace(e.fullPath), v();
|
|
117
|
+
}, J = () => {
|
|
118
|
+
i.closeAllTabs(), v();
|
|
119
|
+
}, U = se("reloadPage"), W = (e) => {
|
|
120
|
+
switch (e) {
|
|
121
|
+
//刷新
|
|
122
|
+
case "1":
|
|
123
|
+
U();
|
|
124
|
+
break;
|
|
125
|
+
//关闭
|
|
126
|
+
case "2":
|
|
127
|
+
P(r);
|
|
128
|
+
break;
|
|
129
|
+
//关闭其他
|
|
130
|
+
case "3":
|
|
131
|
+
H(r);
|
|
132
|
+
break;
|
|
133
|
+
//关闭所有
|
|
134
|
+
case "4":
|
|
135
|
+
J();
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
v(), l.showDropdown = !1;
|
|
139
|
+
}, S = (e, o) => {
|
|
140
|
+
const t = s.value.scrollLeft, a = o > 0 && t + o >= e || o < 0 && t + o <= e ? e : t + o;
|
|
141
|
+
if (s.value && s.value.scrollTo(a, 0), a !== e)
|
|
142
|
+
return window.requestAnimationFrame(() => S(e, o));
|
|
143
|
+
}, G = () => {
|
|
144
|
+
const e = s.value.offsetWidth, o = s.value.scrollLeft;
|
|
145
|
+
if (!o) return;
|
|
146
|
+
const t = o > e ? o - e : 0;
|
|
147
|
+
S(t, (t - o) / 20);
|
|
148
|
+
}, Q = () => {
|
|
149
|
+
const e = s.value.offsetWidth, o = s.value.scrollWidth, t = s.value.scrollLeft;
|
|
150
|
+
if (o - t <= e) return;
|
|
151
|
+
const a = o - t > e * 2 ? t + e : o - e;
|
|
152
|
+
S(a, (a - t) / 20);
|
|
153
|
+
};
|
|
154
|
+
return window.addEventListener("beforeunload", () => {
|
|
155
|
+
localStorage.setItem("TABS_ROUTES", JSON.stringify(m.value));
|
|
156
|
+
}), window.addEventListener(
|
|
157
|
+
"scroll",
|
|
158
|
+
(e) => {
|
|
159
|
+
let o = e.target.scrollTop || document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
|
|
160
|
+
l.isMultiHeaderFixed = o >= 64;
|
|
161
|
+
},
|
|
162
|
+
!0
|
|
163
|
+
), ne(
|
|
164
|
+
() => r.fullPath,
|
|
165
|
+
(e) => {
|
|
166
|
+
K.includes(r.name) || (l.activeKey = e, i.addTab(x(r)), v(!0));
|
|
167
|
+
},
|
|
168
|
+
{ immediate: !0 }
|
|
169
|
+
), $(), re(() => Y()), (e, o) => (O(), ce("div", {
|
|
170
|
+
class: "box-border tabs-view tabs-view-fix tabs-view-default-background",
|
|
171
|
+
style: ie(z.value)
|
|
172
|
+
}, [
|
|
173
|
+
u("div", _e, [
|
|
174
|
+
u("div", {
|
|
175
|
+
ref_key: "navWrap",
|
|
176
|
+
ref: T,
|
|
177
|
+
class: g(["tabs-card", { "tabs-card-scrollable": l.scrollable }])
|
|
178
|
+
}, [
|
|
179
|
+
u("span", {
|
|
180
|
+
class: g(["tabs-card-prev", { "tabs-card-prev-hide": !l.scrollable }]),
|
|
181
|
+
onClick: G
|
|
182
|
+
}, [
|
|
183
|
+
c(n(f), {
|
|
184
|
+
size: "16",
|
|
185
|
+
color: "#515a6e"
|
|
186
|
+
}, {
|
|
187
|
+
default: p(() => [
|
|
188
|
+
c(n(we))
|
|
189
|
+
]),
|
|
190
|
+
_: 1
|
|
191
|
+
})
|
|
192
|
+
], 2),
|
|
193
|
+
u("span", {
|
|
194
|
+
class: g(["tabs-card-next", { "tabs-card-next-hide": !l.scrollable }]),
|
|
195
|
+
onClick: Q
|
|
196
|
+
}, [
|
|
197
|
+
c(n(f), {
|
|
198
|
+
size: "16",
|
|
199
|
+
color: "#515a6e"
|
|
200
|
+
}, {
|
|
201
|
+
default: p(() => [
|
|
202
|
+
c(n(ge))
|
|
203
|
+
]),
|
|
204
|
+
_: 1
|
|
205
|
+
})
|
|
206
|
+
], 2),
|
|
207
|
+
u("div", {
|
|
208
|
+
ref_key: "navScroll",
|
|
209
|
+
ref: s,
|
|
210
|
+
class: "tabs-card-scroll"
|
|
211
|
+
}, [
|
|
212
|
+
c(n(he), {
|
|
213
|
+
list: m.value,
|
|
214
|
+
animation: "300",
|
|
215
|
+
"item-key": "fullPath",
|
|
216
|
+
class: "flex",
|
|
217
|
+
move: B
|
|
218
|
+
}, {
|
|
219
|
+
item: p(({ element: t }) => [
|
|
220
|
+
u("div", {
|
|
221
|
+
id: `tag${t.fullPath.split("/").join("/")}`,
|
|
222
|
+
class: g(["tabs-card-scroll-item", { "active-item": l.activeKey === t.fullPath }]),
|
|
223
|
+
onClick: L((a) => j(t), ["stop"]),
|
|
224
|
+
onContextmenu: (a) => F(a, t)
|
|
225
|
+
}, [
|
|
226
|
+
u("span", null, fe(t.meta.title), 1),
|
|
227
|
+
t.meta.affix ? de("", !0) : (O(), ue(n(f), {
|
|
228
|
+
key: 0,
|
|
229
|
+
size: "14",
|
|
230
|
+
onClick: L((a) => q(t), ["stop"])
|
|
231
|
+
}, {
|
|
232
|
+
default: p(() => [
|
|
233
|
+
c(n(D))
|
|
234
|
+
]),
|
|
235
|
+
_: 2
|
|
236
|
+
}, 1032, ["onClick"]))
|
|
237
|
+
], 42, Pe)
|
|
238
|
+
]),
|
|
239
|
+
_: 1
|
|
240
|
+
}, 8, ["list"])
|
|
241
|
+
], 512)
|
|
242
|
+
], 2),
|
|
243
|
+
u("div", We, [
|
|
244
|
+
c(n(M), {
|
|
245
|
+
trigger: "hover",
|
|
246
|
+
onSelect: W,
|
|
247
|
+
placement: "bottom-end",
|
|
248
|
+
options: _.value
|
|
249
|
+
}, {
|
|
250
|
+
default: p(() => [
|
|
251
|
+
u("div", Oe, [
|
|
252
|
+
c(n(f), {
|
|
253
|
+
size: "16",
|
|
254
|
+
color: "#515a6e"
|
|
255
|
+
}, {
|
|
256
|
+
default: p(() => [
|
|
257
|
+
c(n(Se))
|
|
258
|
+
]),
|
|
259
|
+
_: 1
|
|
260
|
+
})
|
|
261
|
+
])
|
|
262
|
+
]),
|
|
263
|
+
_: 1
|
|
264
|
+
}, 8, ["options"])
|
|
265
|
+
]),
|
|
266
|
+
c(n(M), {
|
|
267
|
+
show: l.showDropdown,
|
|
268
|
+
x: l.dropdownX,
|
|
269
|
+
y: l.dropdownY,
|
|
270
|
+
onClickoutside: o[0] || (o[0] = (t) => l.showDropdown = !1),
|
|
271
|
+
placement: "bottom-start",
|
|
272
|
+
onSelect: W,
|
|
273
|
+
options: _.value
|
|
274
|
+
}, null, 8, ["show", "x", "y", "options"])
|
|
275
|
+
])
|
|
276
|
+
], 4));
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
export {
|
|
280
|
+
ze as default
|
|
281
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.layout-header[data-v-93589779]{display:flex;justify-content:space-between;align-items:center;padding:0;height:64px;box-shadow:0 1px 4px #00152914;transition:all .2s ease-in-out;width:100%;z-index:11}.layout-header-left[data-v-93589779]{display:flex;align-items:center}.layout-header-left .logo[data-v-93589779]{display:flex;align-items:center;justify-content:center;height:64px;line-height:64px;overflow:hidden;white-space:nowrap;padding-left:10px}.layout-header-left .logo img[data-v-93589779]{width:auto;height:32px;margin-right:10px}.layout-header-left .logo .title[data-v-93589779]{margin-bottom:0}.layout-header-left[data-v-93589779] .ant-breadcrumb span:last-child .link-text{color:#515a6e}.layout-header-left .n-breadcrumb[data-v-93589779]{display:inline-block}.layout-header-left-menu[data-v-93589779]{color:var(--text-color)}.layout-header-right[data-v-93589779]{display:flex;align-items:center;margin-right:5px}.layout-header-right .avatar[data-v-93589779]{display:flex;align-items:center;height:64px}.layout-header-right[data-v-93589779]>*{cursor:pointer}.layout-header-trigger[data-v-93589779]{display:inline-block;width:64px;height:64px;text-align:center;cursor:pointer;transition:all .2s ease-in-out}.layout-header-trigger .n-icon[data-v-93589779]{display:flex;align-items:center;height:64px;line-height:64px}.layout-header-trigger[data-v-93589779]:hover{background:#ffffff14}.layout-header-trigger .anticon[data-v-93589779]{font-size:16px;color:#515a6e}.layout-header-trigger-min[data-v-93589779]{width:auto;padding:0 10px}.layout-header-light[data-v-93589779]{background:#fff;color:#515a6e}.layout-header-light .n-icon[data-v-93589779]{color:#515a6e}.layout-header-light .layout-header-left[data-v-93589779] .n-breadcrumb .n-breadcrumb-item:last-child .n-breadcrumb-item__link{color:#515a6e}.layout-header-light .layout-header-trigger[data-v-93589779]:hover{background:#f8f8f9}.layout-header-fix[data-v-93589779]{position:fixed;top:0;right:0;left:200px;z-index:11}[data-v-93589779] .menu-router-link{color:#515a6e}[data-v-93589779] .menu-router-link:hover{color:#1890ff}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { useMessage as z, useDialog as L, NIcon as d, NBreadcrumb as M, NBreadcrumbItem as x, NDropdown as k, NTooltip as I, NDivider as V, NAvatar as A } from "naive-ui";
|
|
2
|
+
import { defineComponent as U, inject as j, computed as b, ref as q, createElementBlock as g, openBlock as a, createElementVNode as n, createVNode as r, unref as e, createBlock as c, withCtx as i, Fragment as N, renderList as H, createCommentVNode as _, resolveDynamicComponent as S, toDisplayString as h, withModifiers as $ } from "vue";
|
|
3
|
+
import G from "../../languages/PLanguage.vue.js";
|
|
4
|
+
import { MenuUnfoldOutlined as J, MenuFoldOutlined as K, ReloadOutlined as Q, FullscreenOutlined as W, FullscreenExitOutlined as X } from "@vicons/antd";
|
|
5
|
+
import { useRouter as Y, useRoute as Z } from "vue-router";
|
|
6
|
+
import { usePLayoutStore as ee } from "../layout.js";
|
|
7
|
+
const te = { class: "layout-header" }, oe = { class: "layout-header-left" }, le = { class: "link-text" }, ne = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "link-text"
|
|
10
|
+
}, ae = { class: "layout-header-right" }, re = { class: "layout-header-trigger-min" }, se = { class: "layout-header-trigger layout-header-trigger-min" }, ie = { class: "layout-header-trigger layout-header-trigger-min" }, ce = { class: "avatar" }, fe = /* @__PURE__ */ U({
|
|
11
|
+
__name: "PHeader",
|
|
12
|
+
setup(ue) {
|
|
13
|
+
const m = z(), C = L(), s = ee(), f = Y(), P = Z(), y = j("reloadPage"), F = (l) => f.push({ name: l }), B = b(() => v(P.matched)), v = (l) => l.map((t) => {
|
|
14
|
+
const u = {
|
|
15
|
+
key: t.name,
|
|
16
|
+
label: t.meta.title,
|
|
17
|
+
icon: t.meta.icon,
|
|
18
|
+
meta: t.meta,
|
|
19
|
+
disabled: t.path === "/",
|
|
20
|
+
children: void 0
|
|
21
|
+
};
|
|
22
|
+
return t.children && t.children.length > 0 && (u.children = v(
|
|
23
|
+
t.children
|
|
24
|
+
)), u;
|
|
25
|
+
}), p = q(!1), E = () => {
|
|
26
|
+
document.fullscreenElement ? document.exitFullscreen && (document.exitFullscreen(), p.value = !1) : (document.documentElement.requestFullscreen(), p.value = !0);
|
|
27
|
+
}, O = b(() => {
|
|
28
|
+
const l = [];
|
|
29
|
+
return l.push({
|
|
30
|
+
label: "退出登录",
|
|
31
|
+
key: "logout"
|
|
32
|
+
}), s.state.settingPages && s.state.settingPages.length > 0 && s.state.settingPages.forEach((t) => {
|
|
33
|
+
l.push({
|
|
34
|
+
label: t.title,
|
|
35
|
+
key: t.route
|
|
36
|
+
});
|
|
37
|
+
}), l;
|
|
38
|
+
}), w = (l) => {
|
|
39
|
+
switch (l) {
|
|
40
|
+
case "logout":
|
|
41
|
+
T();
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
f.push({ name: l });
|
|
45
|
+
}
|
|
46
|
+
}, T = () => {
|
|
47
|
+
C.info({
|
|
48
|
+
title: "提示",
|
|
49
|
+
content: "您确定要退出登录吗",
|
|
50
|
+
positiveText: "确定",
|
|
51
|
+
negativeText: "取消",
|
|
52
|
+
onPositiveClick: async () => {
|
|
53
|
+
if (s.state.logout)
|
|
54
|
+
try {
|
|
55
|
+
await s.state.logout(), localStorage.removeItem("TABS-ROUTES"), m.error("退出成功");
|
|
56
|
+
} catch (l) {
|
|
57
|
+
console.error(l), m.error("退出登录失败");
|
|
58
|
+
} finally {
|
|
59
|
+
location.reload();
|
|
60
|
+
}
|
|
61
|
+
else
|
|
62
|
+
m.error("没有配置登出接口, 请配置[usePLayoutStore.logout]方法");
|
|
63
|
+
},
|
|
64
|
+
onNegativeClick: () => {
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
return (l, t) => {
|
|
69
|
+
const u = I, D = V, R = A;
|
|
70
|
+
return a(), g("div", te, [
|
|
71
|
+
n("div", oe, [
|
|
72
|
+
n("div", {
|
|
73
|
+
class: "ml-1 layout-header-trigger layout-header-trigger-min",
|
|
74
|
+
onClick: t[0] || (t[0] = //@ts-ignore
|
|
75
|
+
(...o) => e(s).collapse && e(s).collapse(...o))
|
|
76
|
+
}, [
|
|
77
|
+
e(s).state.collapsed ? (a(), c(e(d), {
|
|
78
|
+
key: 0,
|
|
79
|
+
size: "18"
|
|
80
|
+
}, {
|
|
81
|
+
default: i(() => [
|
|
82
|
+
r(e(J))
|
|
83
|
+
]),
|
|
84
|
+
_: 1
|
|
85
|
+
})) : (a(), c(e(d), {
|
|
86
|
+
key: 1,
|
|
87
|
+
size: "18"
|
|
88
|
+
}, {
|
|
89
|
+
default: i(() => [
|
|
90
|
+
r(e(K))
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
}))
|
|
94
|
+
]),
|
|
95
|
+
n("div", {
|
|
96
|
+
class: "mr-1 layout-header-trigger layout-header-trigger-min",
|
|
97
|
+
onClick: t[1] || (t[1] = //@ts-ignore
|
|
98
|
+
(...o) => e(y) && e(y)(...o))
|
|
99
|
+
}, [
|
|
100
|
+
r(e(d), { size: "18" }, {
|
|
101
|
+
default: i(() => [
|
|
102
|
+
r(e(Q))
|
|
103
|
+
]),
|
|
104
|
+
_: 1
|
|
105
|
+
})
|
|
106
|
+
]),
|
|
107
|
+
r(e(M), null, {
|
|
108
|
+
default: i(() => [
|
|
109
|
+
(a(!0), g(N, null, H(B.value, (o) => (a(), g(N, {
|
|
110
|
+
key: o.label
|
|
111
|
+
}, [
|
|
112
|
+
o.label ? (a(), c(e(x), { key: 0 }, {
|
|
113
|
+
default: i(() => [
|
|
114
|
+
o.children && o.children.length ? (a(), c(e(k), {
|
|
115
|
+
key: 0,
|
|
116
|
+
options: o.children,
|
|
117
|
+
onSelect: F
|
|
118
|
+
}, {
|
|
119
|
+
default: i(() => [
|
|
120
|
+
n("span", le, [
|
|
121
|
+
o.icon ? (a(), c(S(o.icon), { key: 0 })) : _("", !0),
|
|
122
|
+
n("span", null, h(o.label), 1)
|
|
123
|
+
])
|
|
124
|
+
]),
|
|
125
|
+
_: 2
|
|
126
|
+
}, 1032, ["options"])) : (a(), g("span", ne, [
|
|
127
|
+
o.icon ? (a(), c(S(o.icon), { key: 0 })) : _("", !0),
|
|
128
|
+
n("span", null, h(o.label), 1)
|
|
129
|
+
]))
|
|
130
|
+
]),
|
|
131
|
+
_: 2
|
|
132
|
+
}, 1024)) : _("", !0)
|
|
133
|
+
], 64))), 128))
|
|
134
|
+
]),
|
|
135
|
+
_: 1
|
|
136
|
+
})
|
|
137
|
+
]),
|
|
138
|
+
n("div", ae, [
|
|
139
|
+
n("div", re, [
|
|
140
|
+
r(G)
|
|
141
|
+
]),
|
|
142
|
+
n("div", se, [
|
|
143
|
+
r(u, { placement: "bottom" }, {
|
|
144
|
+
trigger: i(() => [
|
|
145
|
+
r(e(d), {
|
|
146
|
+
size: "18",
|
|
147
|
+
onClick: $(E, ["stop"])
|
|
148
|
+
}, {
|
|
149
|
+
default: i(() => [
|
|
150
|
+
p.value ? (a(), c(e(X), { key: 1 })) : (a(), c(e(W), { key: 0 }))
|
|
151
|
+
]),
|
|
152
|
+
_: 1
|
|
153
|
+
})
|
|
154
|
+
]),
|
|
155
|
+
default: i(() => [
|
|
156
|
+
t[2] || (t[2] = n("span", null, "全屏", -1))
|
|
157
|
+
]),
|
|
158
|
+
_: 1,
|
|
159
|
+
__: [2]
|
|
160
|
+
})
|
|
161
|
+
]),
|
|
162
|
+
n("div", ie, [
|
|
163
|
+
r(e(k), {
|
|
164
|
+
trigger: "hover",
|
|
165
|
+
onSelect: w,
|
|
166
|
+
options: O.value
|
|
167
|
+
}, {
|
|
168
|
+
default: i(() => [
|
|
169
|
+
n("div", ce, [
|
|
170
|
+
n("span", null, h(e(s).state.uname), 1),
|
|
171
|
+
r(D, { vertical: "" }),
|
|
172
|
+
r(R, {
|
|
173
|
+
round: "",
|
|
174
|
+
src: e(s).state.avatar
|
|
175
|
+
}, null, 8, ["src"])
|
|
176
|
+
])
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
}, 8, ["options"])
|
|
180
|
+
])
|
|
181
|
+
])
|
|
182
|
+
]);
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
export {
|
|
187
|
+
fe as default
|
|
188
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { usePLayoutStore } from './layout';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
4
|
+
P: {};
|
|
5
|
+
B: {};
|
|
6
|
+
D: {};
|
|
7
|
+
C: {};
|
|
8
|
+
M: {};
|
|
9
|
+
Defaults: {};
|
|
10
|
+
}, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
11
|
+
__isFragment?: never;
|
|
12
|
+
__isTeleport?: never;
|
|
13
|
+
__isSuspense?: never;
|
|
14
|
+
} & import('vue').ComponentOptionsBase<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & import('vue').Plugin;
|
|
15
|
+
export default _default;
|