jky-component-lib 0.0.103 → 0.0.105
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/es/package.json.js +1 -1
- package/dist/es/page-layout/PageLayout.vue.js +29 -20
- package/dist/es/page-table/Toolbar.vue.d.ts +1 -1
- package/dist/es/page-table/Toolbar.vue.js +35 -11
- package/dist/es/page-table-v2/PageTableV2.vue.js +1 -1
- package/dist/es/page-table-v2/PageTableV2.vue2.js +2 -1
- package/dist/es/page-table-v2/style.css +4 -4
- package/dist/lib/package.json.js +1 -1
- package/dist/lib/page-layout/PageLayout.vue.js +29 -20
- package/dist/lib/page-table/Toolbar.vue.d.ts +1 -1
- package/dist/lib/page-table/Toolbar.vue.js +34 -10
- package/dist/lib/page-table-v2/PageTableV2.vue.js +1 -1
- package/dist/lib/page-table-v2/PageTableV2.vue2.js +2 -1
- package/dist/lib/page-table-v2/style.css +4 -4
- package/package.json +1 -1
package/dist/es/package.json.js
CHANGED
|
@@ -68,12 +68,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
68
68
|
sideMenuWithParent: { type: Boolean, default: true }
|
|
69
69
|
},
|
|
70
70
|
setup(__props) {
|
|
71
|
+
var _a, _b;
|
|
71
72
|
const props = __props;
|
|
72
73
|
const router = useRouter();
|
|
73
74
|
const route = useRoute();
|
|
74
75
|
const attrs = useAttrs();
|
|
75
76
|
const { useTabsStore } = createTabsStore({
|
|
76
|
-
enableCache: props.cachable
|
|
77
|
+
enableCache: (_b = (_a = props.cachable) != null ? _a : attrs.cachable) != null ? _b : true
|
|
77
78
|
});
|
|
78
79
|
const tabsStore = useTabsStore();
|
|
79
80
|
const activeTopMenu = ref("");
|
|
@@ -84,11 +85,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
84
85
|
});
|
|
85
86
|
function buildMenuFromRoutes(routes2) {
|
|
86
87
|
const menuRoutes = routes2.filter((r) => {
|
|
87
|
-
var
|
|
88
|
-
return (
|
|
88
|
+
var _a2;
|
|
89
|
+
return (_a2 = r.meta) == null ? void 0 : _a2.title;
|
|
89
90
|
});
|
|
90
91
|
const buildMenuItem = (route2, parentPath = "") => {
|
|
91
|
-
var
|
|
92
|
+
var _a2, _b2, _c, _d;
|
|
92
93
|
let fullPath = "";
|
|
93
94
|
if (route2.path.startsWith(parentPath)) {
|
|
94
95
|
fullPath = route2.path;
|
|
@@ -98,8 +99,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
98
99
|
const normalizedPath = fullPath.startsWith("/") ? fullPath : `/${fullPath}`;
|
|
99
100
|
const item = {
|
|
100
101
|
index: normalizedPath,
|
|
101
|
-
title: ((
|
|
102
|
-
icon: ((
|
|
102
|
+
title: ((_a2 = route2.meta) == null ? void 0 : _a2.title) || "",
|
|
103
|
+
icon: ((_b2 = route2.meta) == null ? void 0 : _b2.icon) || "",
|
|
103
104
|
hideMenu: (_d = (_c = route2.meta) == null ? void 0 : _c.hideMenu) != null ? _d : false,
|
|
104
105
|
route: normalizedPath,
|
|
105
106
|
path: normalizedPath,
|
|
@@ -107,8 +108,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
107
108
|
};
|
|
108
109
|
if (route2.children && route2.children.length > 0) {
|
|
109
110
|
item.children = route2.children.filter((child) => {
|
|
110
|
-
var
|
|
111
|
-
return (
|
|
111
|
+
var _a3;
|
|
112
|
+
return (_a3 = child.meta) == null ? void 0 : _a3.title;
|
|
112
113
|
}).map((child) => buildMenuItem(child, normalizedPath));
|
|
113
114
|
}
|
|
114
115
|
return item;
|
|
@@ -124,17 +125,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
124
125
|
const topMenuData = computed(() => {
|
|
125
126
|
if (props.topMenuSingleLevel) {
|
|
126
127
|
return cloneDeep(menuData.value).map((item) => {
|
|
127
|
-
const
|
|
128
|
+
const _a2 = item, { children } = _a2, rest = __objRest(_a2, ["children"]);
|
|
128
129
|
return rest;
|
|
129
130
|
});
|
|
130
131
|
}
|
|
131
132
|
return menuData.value;
|
|
132
133
|
});
|
|
134
|
+
const showSideMenu = computed(() => {
|
|
135
|
+
var _a2, _b2;
|
|
136
|
+
return (_b2 = (_a2 = props.showSideMenu) != null ? _a2 : attrs.showSideMenu) != null ? _b2 : attrs["show-side-menu"];
|
|
137
|
+
});
|
|
138
|
+
const showTopMenu = computed(() => {
|
|
139
|
+
var _a2, _b2;
|
|
140
|
+
return (_b2 = (_a2 = props.showTopMenu) != null ? _a2 : attrs.showTopMenu) != null ? _b2 : attrs["show-top-menu"];
|
|
141
|
+
});
|
|
133
142
|
const displayedSideMenu = computed(() => {
|
|
134
|
-
if (!
|
|
143
|
+
if (!showSideMenu.value) {
|
|
135
144
|
return [];
|
|
136
145
|
}
|
|
137
|
-
if (!
|
|
146
|
+
if (!showTopMenu.value) {
|
|
138
147
|
return menuData.value;
|
|
139
148
|
}
|
|
140
149
|
if (menuData.value.length === 0) {
|
|
@@ -159,7 +168,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
159
168
|
return [];
|
|
160
169
|
});
|
|
161
170
|
const computedAsideWidth = computed(() => {
|
|
162
|
-
if (
|
|
171
|
+
if (showSideMenu.value && displayedSideMenu.value.length > 0) {
|
|
163
172
|
return props.asideWidth;
|
|
164
173
|
}
|
|
165
174
|
return "0";
|
|
@@ -169,8 +178,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
169
178
|
() => {
|
|
170
179
|
const routePath = route.path;
|
|
171
180
|
const matchedMenus = route.matched.filter((r) => {
|
|
172
|
-
var
|
|
173
|
-
return (
|
|
181
|
+
var _a2;
|
|
182
|
+
return (_a2 = r.meta) == null ? void 0 : _a2.title;
|
|
174
183
|
});
|
|
175
184
|
if (matchedMenus.length === 0) {
|
|
176
185
|
return;
|
|
@@ -190,12 +199,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
190
199
|
router.push(index);
|
|
191
200
|
}
|
|
192
201
|
return (_ctx, _cache) => {
|
|
193
|
-
var
|
|
202
|
+
var _a2;
|
|
194
203
|
const _component_ElAutoResizer = resolveComponent("ElAutoResizer");
|
|
195
204
|
return openBlock(), createElementBlock("div", {
|
|
196
205
|
class: normalizeClass(["jky-page-layout flex h-full w-full flex-col overflow-hidden gap-3", props.className])
|
|
197
206
|
}, [
|
|
198
|
-
|
|
207
|
+
showTopMenu.value && menuData.value.length > 0 ? (openBlock(), createBlock(unref(ElCard), {
|
|
199
208
|
key: 0,
|
|
200
209
|
class: "jky-page-layout__top-menu shrink-0 overflow-hidden p-0",
|
|
201
210
|
style: { "--el-card-padding": 0 }
|
|
@@ -222,7 +231,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
222
231
|
style: normalizeStyle({ "--el-aside-width": computedAsideWidth.value })
|
|
223
232
|
}, {
|
|
224
233
|
default: withCtx(() => [
|
|
225
|
-
|
|
234
|
+
showSideMenu.value && displayedSideMenu.value.length > 0 ? (openBlock(), createBlock(unref(ElCard), {
|
|
226
235
|
key: 0,
|
|
227
236
|
class: "h-full",
|
|
228
237
|
style: normalizeStyle({ "--el-card-padding": props.cardPadding })
|
|
@@ -262,11 +271,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
262
271
|
style: normalizeStyle({ "--el-card-padding": props.cardPadding })
|
|
263
272
|
}, {
|
|
264
273
|
default: withCtx(() => {
|
|
265
|
-
var
|
|
274
|
+
var _a3;
|
|
266
275
|
return [
|
|
267
276
|
createVNode(_sfc_main$2, {
|
|
268
277
|
store: unref(tabsStore),
|
|
269
|
-
round: (
|
|
278
|
+
round: (_a3 = props.roundTabs) != null ? _a3 : _ctx.$attrs["round-tabs"],
|
|
270
279
|
mode: "route",
|
|
271
280
|
cachable: props.cachable,
|
|
272
281
|
closable: true
|
|
@@ -280,7 +289,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
280
289
|
store: unref(tabsStore),
|
|
281
290
|
mode: "route",
|
|
282
291
|
cachable: props.cachable,
|
|
283
|
-
round: (
|
|
292
|
+
round: (_a2 = props.roundTabs) != null ? _a2 : _ctx.$attrs["round-tabs"],
|
|
284
293
|
closable: true
|
|
285
294
|
}, null, 8, ["store", "cachable", "round"])),
|
|
286
295
|
(openBlock(), createBlock(resolveDynamicComponent(props.mainWithCard ? unref(ElCard) : "div"), {
|
|
@@ -17,16 +17,16 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, ref, computed, openBlock, createElementBlock, createElementVNode, createBlock, resolveDynamicComponent, unref, withCtx, createVNode, normalizeClass, createTextVNode, toDisplayString, createCommentVNode, Fragment, renderList, withModifiers, h } from "vue";
|
|
20
|
+
import { defineComponent, ref, computed, openBlock, createElementBlock, mergeProps, createElementVNode, createBlock, resolveDynamicComponent, unref, withCtx, createVNode, normalizeClass, createTextVNode, toDisplayString, createCommentVNode, Fragment, renderList, withModifiers, h } from "vue";
|
|
21
21
|
import { ArrowDown } from "@element-plus/icons-vue";
|
|
22
22
|
import { ElDropdown, ElButton, ElIcon, ElDropdownMenu, ElDropdownItem } from "element-plus";
|
|
23
23
|
import { useResponsiveToolbar } from "../utils/responsive-toolbar.js";
|
|
24
|
-
const _hoisted_1 = { class: "flex items-center
|
|
25
|
-
const _hoisted_2 = { class: "flex items-center" };
|
|
26
|
-
const _hoisted_3 =
|
|
27
|
-
const _hoisted_4 = ["title", "onClick"];
|
|
24
|
+
const _hoisted_1 = { class: "flex items-center" };
|
|
25
|
+
const _hoisted_2 = { class: "flex items-center ml-2 text-gray-500" };
|
|
26
|
+
const _hoisted_3 = ["title", "onClick"];
|
|
28
27
|
const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
|
|
29
|
-
name: "JkyPageTableToolbar"
|
|
28
|
+
name: "JkyPageTableToolbar",
|
|
29
|
+
inheritAttrs: false
|
|
30
30
|
}), {
|
|
31
31
|
__name: "Toolbar",
|
|
32
32
|
props: {
|
|
@@ -100,6 +100,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
100
100
|
const buttons = [];
|
|
101
101
|
if (props.leftButtons) {
|
|
102
102
|
props.leftButtons.forEach((button, index) => {
|
|
103
|
+
if (typeof button.hidden === "function") {
|
|
104
|
+
if (button.hidden(button, index)) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (button.hidden) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
103
111
|
const iconSpan = button.icon ? h("span", {
|
|
104
112
|
class: `${button.icon} text-[1em] inline-block`
|
|
105
113
|
}) : null;
|
|
@@ -129,6 +137,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
129
137
|
const items = [];
|
|
130
138
|
if (props.batchButtons) {
|
|
131
139
|
props.batchButtons.forEach((button, index) => {
|
|
140
|
+
if (typeof button.hidden === "function") {
|
|
141
|
+
if (button.hidden(button, index)) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (button.hidden) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
132
148
|
items.push(
|
|
133
149
|
h(
|
|
134
150
|
ElDropdownItem,
|
|
@@ -150,6 +166,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
150
166
|
const buttons = [];
|
|
151
167
|
if (props.rightButtons) {
|
|
152
168
|
props.rightButtons.forEach((button, index) => {
|
|
169
|
+
if (typeof button.hidden === "function") {
|
|
170
|
+
if (button.hidden(button, index)) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (button.hidden) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
153
177
|
const isVisible = index < visibleRightCount.value || !needCollapseRight.value;
|
|
154
178
|
if (isVisible) {
|
|
155
179
|
const iconSpan = button.icon ? h("span", {
|
|
@@ -203,8 +227,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
203
227
|
handleRightCommand
|
|
204
228
|
});
|
|
205
229
|
return (_ctx, _cache) => {
|
|
206
|
-
return openBlock(), createElementBlock("div",
|
|
207
|
-
createElementVNode("div",
|
|
230
|
+
return openBlock(), createElementBlock("div", mergeProps({ class: "flex items-center justify-between mb-2 py-2 jky-page-table__toolbar" }, _ctx.$attrs), [
|
|
231
|
+
createElementVNode("div", _hoisted_1, [
|
|
208
232
|
(openBlock(), createBlock(resolveDynamicComponent(renderLeftButtons))),
|
|
209
233
|
showBatchActions.value ? (openBlock(), createBlock(unref(ElDropdown), {
|
|
210
234
|
key: 0,
|
|
@@ -274,7 +298,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
274
298
|
]),
|
|
275
299
|
_: 1
|
|
276
300
|
})) : createCommentVNode("", true),
|
|
277
|
-
createElementVNode("div",
|
|
301
|
+
createElementVNode("div", _hoisted_2, [
|
|
278
302
|
(openBlock(true), createElementBlock(Fragment, null, renderList(props.defaultButtons, (button) => {
|
|
279
303
|
return openBlock(), createElementBlock(Fragment, {
|
|
280
304
|
key: button.label + button.icon
|
|
@@ -284,12 +308,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
284
308
|
title: button.label,
|
|
285
309
|
class: normalizeClass(["text-2xl inline-flex items-center justify-center cursor-pointer hover:opacity-70 ml-1", [button.icon]]),
|
|
286
310
|
onClick: withModifiers(($event) => handleToolbarButtonClick(button), ["stop"])
|
|
287
|
-
}, null, 10,
|
|
311
|
+
}, null, 10, _hoisted_3)) : createCommentVNode("", true)
|
|
288
312
|
], 64);
|
|
289
313
|
}), 128))
|
|
290
314
|
])
|
|
291
315
|
], 512)
|
|
292
|
-
]);
|
|
316
|
+
], 16);
|
|
293
317
|
};
|
|
294
318
|
}
|
|
295
319
|
}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./PageTableV2.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const PageTableV2 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const PageTableV2 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-26060aeb"]]);
|
|
5
5
|
export {
|
|
6
6
|
PageTableV2 as default
|
|
7
7
|
};
|
|
@@ -291,7 +291,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
291
291
|
tableData: internalData.value,
|
|
292
292
|
selectedRows: [],
|
|
293
293
|
filterData: __spreadValues({}, form.value)
|
|
294
|
-
}
|
|
294
|
+
},
|
|
295
|
+
class: "sticky left-0"
|
|
295
296
|
}, null, 8, ["left-buttons", "batch-buttons", "right-buttons", "default-buttons", "selected-count", "toolbar-button-limit", "payload"]),
|
|
296
297
|
withDirectives(createVNode(unref(ElTableV2), mergeProps({
|
|
297
298
|
ref_key: "tableRef",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* PageTableV2 组件样式 */
|
|
2
|
-
.jky-page-table-v2[data-v-
|
|
2
|
+
.jky-page-table-v2[data-v-26060aeb] {
|
|
3
3
|
/* 基础样式 */
|
|
4
4
|
}
|
|
5
|
-
.jky-page-table-v2__filter-card[data-v-
|
|
5
|
+
.jky-page-table-v2__filter-card[data-v-26060aeb] {
|
|
6
6
|
/* 筛选项卡片样式 */
|
|
7
7
|
}
|
|
8
|
-
.jky-page-table-v2__table-card[data-v-
|
|
8
|
+
.jky-page-table-v2__table-card[data-v-26060aeb] {
|
|
9
9
|
/* 表格卡片样式 */
|
|
10
10
|
}
|
|
11
|
-
.jky-page-table-v2-toolbar[data-v-
|
|
11
|
+
.jky-page-table-v2-toolbar[data-v-26060aeb] {
|
|
12
12
|
/* 工具栏样式 */
|
|
13
13
|
}
|
package/dist/lib/package.json.js
CHANGED
|
@@ -70,12 +70,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
70
70
|
sideMenuWithParent: { type: Boolean, default: true }
|
|
71
71
|
},
|
|
72
72
|
setup(__props) {
|
|
73
|
+
var _a, _b;
|
|
73
74
|
const props = __props;
|
|
74
75
|
const router = vueRouter.useRouter();
|
|
75
76
|
const route = vueRouter.useRoute();
|
|
76
77
|
const attrs = vue.useAttrs();
|
|
77
78
|
const { useTabsStore: useTabsStore$1 } = useTabsStore.createTabsStore({
|
|
78
|
-
enableCache: props.cachable
|
|
79
|
+
enableCache: (_b = (_a = props.cachable) != null ? _a : attrs.cachable) != null ? _b : true
|
|
79
80
|
});
|
|
80
81
|
const tabsStore = useTabsStore$1();
|
|
81
82
|
const activeTopMenu = vue.ref("");
|
|
@@ -86,11 +87,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
86
87
|
});
|
|
87
88
|
function buildMenuFromRoutes(routes2) {
|
|
88
89
|
const menuRoutes = routes2.filter((r) => {
|
|
89
|
-
var
|
|
90
|
-
return (
|
|
90
|
+
var _a2;
|
|
91
|
+
return (_a2 = r.meta) == null ? void 0 : _a2.title;
|
|
91
92
|
});
|
|
92
93
|
const buildMenuItem = (route2, parentPath = "") => {
|
|
93
|
-
var
|
|
94
|
+
var _a2, _b2, _c, _d;
|
|
94
95
|
let fullPath = "";
|
|
95
96
|
if (route2.path.startsWith(parentPath)) {
|
|
96
97
|
fullPath = route2.path;
|
|
@@ -100,8 +101,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
100
101
|
const normalizedPath = fullPath.startsWith("/") ? fullPath : `/${fullPath}`;
|
|
101
102
|
const item = {
|
|
102
103
|
index: normalizedPath,
|
|
103
|
-
title: ((
|
|
104
|
-
icon: ((
|
|
104
|
+
title: ((_a2 = route2.meta) == null ? void 0 : _a2.title) || "",
|
|
105
|
+
icon: ((_b2 = route2.meta) == null ? void 0 : _b2.icon) || "",
|
|
105
106
|
hideMenu: (_d = (_c = route2.meta) == null ? void 0 : _c.hideMenu) != null ? _d : false,
|
|
106
107
|
route: normalizedPath,
|
|
107
108
|
path: normalizedPath,
|
|
@@ -109,8 +110,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
109
110
|
};
|
|
110
111
|
if (route2.children && route2.children.length > 0) {
|
|
111
112
|
item.children = route2.children.filter((child) => {
|
|
112
|
-
var
|
|
113
|
-
return (
|
|
113
|
+
var _a3;
|
|
114
|
+
return (_a3 = child.meta) == null ? void 0 : _a3.title;
|
|
114
115
|
}).map((child) => buildMenuItem(child, normalizedPath));
|
|
115
116
|
}
|
|
116
117
|
return item;
|
|
@@ -126,17 +127,25 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
126
127
|
const topMenuData = vue.computed(() => {
|
|
127
128
|
if (props.topMenuSingleLevel) {
|
|
128
129
|
return lodashEs.cloneDeep(menuData.value).map((item) => {
|
|
129
|
-
const
|
|
130
|
+
const _a2 = item, { children } = _a2, rest = __objRest(_a2, ["children"]);
|
|
130
131
|
return rest;
|
|
131
132
|
});
|
|
132
133
|
}
|
|
133
134
|
return menuData.value;
|
|
134
135
|
});
|
|
136
|
+
const showSideMenu = vue.computed(() => {
|
|
137
|
+
var _a2, _b2;
|
|
138
|
+
return (_b2 = (_a2 = props.showSideMenu) != null ? _a2 : attrs.showSideMenu) != null ? _b2 : attrs["show-side-menu"];
|
|
139
|
+
});
|
|
140
|
+
const showTopMenu = vue.computed(() => {
|
|
141
|
+
var _a2, _b2;
|
|
142
|
+
return (_b2 = (_a2 = props.showTopMenu) != null ? _a2 : attrs.showTopMenu) != null ? _b2 : attrs["show-top-menu"];
|
|
143
|
+
});
|
|
135
144
|
const displayedSideMenu = vue.computed(() => {
|
|
136
|
-
if (!
|
|
145
|
+
if (!showSideMenu.value) {
|
|
137
146
|
return [];
|
|
138
147
|
}
|
|
139
|
-
if (!
|
|
148
|
+
if (!showTopMenu.value) {
|
|
140
149
|
return menuData.value;
|
|
141
150
|
}
|
|
142
151
|
if (menuData.value.length === 0) {
|
|
@@ -161,7 +170,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
161
170
|
return [];
|
|
162
171
|
});
|
|
163
172
|
const computedAsideWidth = vue.computed(() => {
|
|
164
|
-
if (
|
|
173
|
+
if (showSideMenu.value && displayedSideMenu.value.length > 0) {
|
|
165
174
|
return props.asideWidth;
|
|
166
175
|
}
|
|
167
176
|
return "0";
|
|
@@ -171,8 +180,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
171
180
|
() => {
|
|
172
181
|
const routePath = route.path;
|
|
173
182
|
const matchedMenus = route.matched.filter((r) => {
|
|
174
|
-
var
|
|
175
|
-
return (
|
|
183
|
+
var _a2;
|
|
184
|
+
return (_a2 = r.meta) == null ? void 0 : _a2.title;
|
|
176
185
|
});
|
|
177
186
|
if (matchedMenus.length === 0) {
|
|
178
187
|
return;
|
|
@@ -192,12 +201,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
192
201
|
router.push(index);
|
|
193
202
|
}
|
|
194
203
|
return (_ctx, _cache) => {
|
|
195
|
-
var
|
|
204
|
+
var _a2;
|
|
196
205
|
const _component_ElAutoResizer = vue.resolveComponent("ElAutoResizer");
|
|
197
206
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
198
207
|
class: vue.normalizeClass(["jky-page-layout flex h-full w-full flex-col overflow-hidden gap-3", props.className])
|
|
199
208
|
}, [
|
|
200
|
-
|
|
209
|
+
showTopMenu.value && menuData.value.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElCard), {
|
|
201
210
|
key: 0,
|
|
202
211
|
class: "jky-page-layout__top-menu shrink-0 overflow-hidden p-0",
|
|
203
212
|
style: { "--el-card-padding": 0 }
|
|
@@ -224,7 +233,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
224
233
|
style: vue.normalizeStyle({ "--el-aside-width": computedAsideWidth.value })
|
|
225
234
|
}, {
|
|
226
235
|
default: vue.withCtx(() => [
|
|
227
|
-
|
|
236
|
+
showSideMenu.value && displayedSideMenu.value.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElCard), {
|
|
228
237
|
key: 0,
|
|
229
238
|
class: "h-full",
|
|
230
239
|
style: vue.normalizeStyle({ "--el-card-padding": props.cardPadding })
|
|
@@ -264,11 +273,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
264
273
|
style: vue.normalizeStyle({ "--el-card-padding": props.cardPadding })
|
|
265
274
|
}, {
|
|
266
275
|
default: vue.withCtx(() => {
|
|
267
|
-
var
|
|
276
|
+
var _a3;
|
|
268
277
|
return [
|
|
269
278
|
vue.createVNode(Tabs_vue_vue_type_script_setup_true_lang.default, {
|
|
270
279
|
store: vue.unref(tabsStore),
|
|
271
|
-
round: (
|
|
280
|
+
round: (_a3 = props.roundTabs) != null ? _a3 : _ctx.$attrs["round-tabs"],
|
|
272
281
|
mode: "route",
|
|
273
282
|
cachable: props.cachable,
|
|
274
283
|
closable: true
|
|
@@ -282,7 +291,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
282
291
|
store: vue.unref(tabsStore),
|
|
283
292
|
mode: "route",
|
|
284
293
|
cachable: props.cachable,
|
|
285
|
-
round: (
|
|
294
|
+
round: (_a2 = props.roundTabs) != null ? _a2 : _ctx.$attrs["round-tabs"],
|
|
286
295
|
closable: true
|
|
287
296
|
}, null, 8, ["store", "cachable", "round"])),
|
|
288
297
|
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(props.mainWithCard ? vue.unref(ElementPlus.ElCard) : "div"), {
|
|
@@ -23,12 +23,12 @@ const vue = require("vue");
|
|
|
23
23
|
const iconsVue = require("@element-plus/icons-vue");
|
|
24
24
|
const ElementPlus = require("element-plus");
|
|
25
25
|
const responsiveToolbar = require("../utils/responsive-toolbar.js");
|
|
26
|
-
const _hoisted_1 = { class: "flex items-center
|
|
27
|
-
const _hoisted_2 = { class: "flex items-center" };
|
|
28
|
-
const _hoisted_3 =
|
|
29
|
-
const _hoisted_4 = ["title", "onClick"];
|
|
26
|
+
const _hoisted_1 = { class: "flex items-center" };
|
|
27
|
+
const _hoisted_2 = { class: "flex items-center ml-2 text-gray-500" };
|
|
28
|
+
const _hoisted_3 = ["title", "onClick"];
|
|
30
29
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValues({}, {
|
|
31
|
-
name: "JkyPageTableToolbar"
|
|
30
|
+
name: "JkyPageTableToolbar",
|
|
31
|
+
inheritAttrs: false
|
|
32
32
|
}), {
|
|
33
33
|
__name: "Toolbar",
|
|
34
34
|
props: {
|
|
@@ -102,6 +102,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
102
102
|
const buttons = [];
|
|
103
103
|
if (props.leftButtons) {
|
|
104
104
|
props.leftButtons.forEach((button, index) => {
|
|
105
|
+
if (typeof button.hidden === "function") {
|
|
106
|
+
if (button.hidden(button, index)) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (button.hidden) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
105
113
|
const iconSpan = button.icon ? vue.h("span", {
|
|
106
114
|
class: `${button.icon} text-[1em] inline-block`
|
|
107
115
|
}) : null;
|
|
@@ -131,6 +139,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
131
139
|
const items = [];
|
|
132
140
|
if (props.batchButtons) {
|
|
133
141
|
props.batchButtons.forEach((button, index) => {
|
|
142
|
+
if (typeof button.hidden === "function") {
|
|
143
|
+
if (button.hidden(button, index)) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (button.hidden) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
134
150
|
items.push(
|
|
135
151
|
vue.h(
|
|
136
152
|
ElementPlus.ElDropdownItem,
|
|
@@ -152,6 +168,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
152
168
|
const buttons = [];
|
|
153
169
|
if (props.rightButtons) {
|
|
154
170
|
props.rightButtons.forEach((button, index) => {
|
|
171
|
+
if (typeof button.hidden === "function") {
|
|
172
|
+
if (button.hidden(button, index)) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (button.hidden) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
155
179
|
const isVisible = index < visibleRightCount.value || !needCollapseRight.value;
|
|
156
180
|
if (isVisible) {
|
|
157
181
|
const iconSpan = button.icon ? vue.h("span", {
|
|
@@ -205,8 +229,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
205
229
|
handleRightCommand
|
|
206
230
|
});
|
|
207
231
|
return (_ctx, _cache) => {
|
|
208
|
-
return vue.openBlock(), vue.createElementBlock("div",
|
|
209
|
-
vue.createElementVNode("div",
|
|
232
|
+
return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({ class: "flex items-center justify-between mb-2 py-2 jky-page-table__toolbar" }, _ctx.$attrs), [
|
|
233
|
+
vue.createElementVNode("div", _hoisted_1, [
|
|
210
234
|
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderLeftButtons))),
|
|
211
235
|
showBatchActions.value ? (vue.openBlock(), vue.createBlock(vue.unref(ElementPlus.ElDropdown), {
|
|
212
236
|
key: 0,
|
|
@@ -276,7 +300,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
276
300
|
]),
|
|
277
301
|
_: 1
|
|
278
302
|
})) : vue.createCommentVNode("", true),
|
|
279
|
-
vue.createElementVNode("div",
|
|
303
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
280
304
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(props.defaultButtons, (button) => {
|
|
281
305
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
282
306
|
key: button.label + button.icon
|
|
@@ -286,12 +310,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
286
310
|
title: button.label,
|
|
287
311
|
class: vue.normalizeClass(["text-2xl inline-flex items-center justify-center cursor-pointer hover:opacity-70 ml-1", [button.icon]]),
|
|
288
312
|
onClick: vue.withModifiers(($event) => handleToolbarButtonClick(button), ["stop"])
|
|
289
|
-
}, null, 10,
|
|
313
|
+
}, null, 10, _hoisted_3)) : vue.createCommentVNode("", true)
|
|
290
314
|
], 64);
|
|
291
315
|
}), 128))
|
|
292
316
|
])
|
|
293
317
|
], 512)
|
|
294
|
-
]);
|
|
318
|
+
], 16);
|
|
295
319
|
};
|
|
296
320
|
}
|
|
297
321
|
}));
|
|
@@ -3,5 +3,5 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3
3
|
const PageTableV2_vue_vue_type_script_setup_true_lang = require("./PageTableV2.vue2.js");
|
|
4
4
|
;/* empty css */
|
|
5
5
|
const _pluginVue_exportHelper = require("../_virtual/_plugin-vue_export-helper.js");
|
|
6
|
-
const PageTableV2 = /* @__PURE__ */ _pluginVue_exportHelper.default(PageTableV2_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-
|
|
6
|
+
const PageTableV2 = /* @__PURE__ */ _pluginVue_exportHelper.default(PageTableV2_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-26060aeb"]]);
|
|
7
7
|
exports.default = PageTableV2;
|
|
@@ -293,7 +293,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadValu
|
|
|
293
293
|
tableData: internalData.value,
|
|
294
294
|
selectedRows: [],
|
|
295
295
|
filterData: __spreadValues({}, form.value)
|
|
296
|
-
}
|
|
296
|
+
},
|
|
297
|
+
class: "sticky left-0"
|
|
297
298
|
}, null, 8, ["left-buttons", "batch-buttons", "right-buttons", "default-buttons", "selected-count", "toolbar-button-limit", "payload"]),
|
|
298
299
|
vue.withDirectives(vue.createVNode(vue.unref(ElementPlus.ElTableV2), vue.mergeProps({
|
|
299
300
|
ref_key: "tableRef",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* PageTableV2 组件样式 */
|
|
2
|
-
.jky-page-table-v2[data-v-
|
|
2
|
+
.jky-page-table-v2[data-v-26060aeb] {
|
|
3
3
|
/* 基础样式 */
|
|
4
4
|
}
|
|
5
|
-
.jky-page-table-v2__filter-card[data-v-
|
|
5
|
+
.jky-page-table-v2__filter-card[data-v-26060aeb] {
|
|
6
6
|
/* 筛选项卡片样式 */
|
|
7
7
|
}
|
|
8
|
-
.jky-page-table-v2__table-card[data-v-
|
|
8
|
+
.jky-page-table-v2__table-card[data-v-26060aeb] {
|
|
9
9
|
/* 表格卡片样式 */
|
|
10
10
|
}
|
|
11
|
-
.jky-page-table-v2-toolbar[data-v-
|
|
11
|
+
.jky-page-table-v2-toolbar[data-v-26060aeb] {
|
|
12
12
|
/* 工具栏样式 */
|
|
13
13
|
}
|