z-crud-table 0.0.48 → 0.0.49
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/components/CrudTable.vue.d.ts +47 -0
- package/dist/z-crud-table.js +232 -206
- package/dist/z-crud-table.umd.cjs +2 -2
- package/package.json +1 -1
|
@@ -199,12 +199,29 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
|
|
|
199
199
|
type: BooleanConstructor;
|
|
200
200
|
default: boolean;
|
|
201
201
|
};
|
|
202
|
+
/**
|
|
203
|
+
* @description [✨ 新增] 新增弹窗的自定义标题
|
|
204
|
+
* @type {String}
|
|
205
|
+
*/
|
|
206
|
+
addDialogTitle: {
|
|
207
|
+
type: StringConstructor;
|
|
208
|
+
default: string;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* @description [✨ 新增] 编辑弹窗的自定义标题
|
|
212
|
+
* @type {String}
|
|
213
|
+
*/
|
|
214
|
+
editDialogTitle: {
|
|
215
|
+
type: StringConstructor;
|
|
216
|
+
default: string;
|
|
217
|
+
};
|
|
202
218
|
}>, {
|
|
203
219
|
refresh: () => Promise<void>;
|
|
204
220
|
search: () => void;
|
|
205
221
|
handleDelete: (ids: number[]) => Promise<void>;
|
|
206
222
|
openDialog: (mode: "add" | "edit", dataPayload?: any) => Promise<void>;
|
|
207
223
|
submit: (mode: "add" | "edit", data: Record<string, any>) => Promise<void>;
|
|
224
|
+
closeDialog: () => void;
|
|
208
225
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
209
226
|
submit: (...args: any[]) => void;
|
|
210
227
|
delete: (...args: any[]) => void;
|
|
@@ -408,6 +425,22 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
|
|
|
408
425
|
type: BooleanConstructor;
|
|
409
426
|
default: boolean;
|
|
410
427
|
};
|
|
428
|
+
/**
|
|
429
|
+
* @description [✨ 新增] 新增弹窗的自定义标题
|
|
430
|
+
* @type {String}
|
|
431
|
+
*/
|
|
432
|
+
addDialogTitle: {
|
|
433
|
+
type: StringConstructor;
|
|
434
|
+
default: string;
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* @description [✨ 新增] 编辑弹窗的自定义标题
|
|
438
|
+
* @type {String}
|
|
439
|
+
*/
|
|
440
|
+
editDialogTitle: {
|
|
441
|
+
type: StringConstructor;
|
|
442
|
+
default: string;
|
|
443
|
+
};
|
|
411
444
|
}>> & Readonly<{
|
|
412
445
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
413
446
|
onDelete?: ((...args: any[]) => any) | undefined;
|
|
@@ -442,6 +475,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
|
|
|
442
475
|
dialogFormLabelWidth: string;
|
|
443
476
|
submitAsFormData: boolean;
|
|
444
477
|
dialogFullscreen: boolean;
|
|
478
|
+
addDialogTitle: string;
|
|
479
|
+
editDialogTitle: string;
|
|
445
480
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, Partial<Record<any, (_: {
|
|
446
481
|
row: any;
|
|
447
482
|
}) => any>> & {
|
|
@@ -487,6 +522,18 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
|
|
|
487
522
|
mode: "add" | "edit";
|
|
488
523
|
formRef: (el: any) => void;
|
|
489
524
|
}): any;
|
|
525
|
+
"dialog-footer"?(_: {
|
|
526
|
+
dialog: {
|
|
527
|
+
visible: boolean;
|
|
528
|
+
loading: boolean;
|
|
529
|
+
submitting: boolean;
|
|
530
|
+
mode: "add" | "edit";
|
|
531
|
+
data: Record<string, any>;
|
|
532
|
+
formRef: any;
|
|
533
|
+
};
|
|
534
|
+
submit: () => Promise<void>;
|
|
535
|
+
cancel: () => boolean;
|
|
536
|
+
}): any;
|
|
490
537
|
}>;
|
|
491
538
|
export default _default;
|
|
492
539
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
package/dist/z-crud-table.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.header-cell-content[data-v-d23c8660]{display:inline-block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.crud-table-container[data-v-
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { ElMessage as
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.header-cell-content[data-v-d23c8660]{display:inline-block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.crud-table-container[data-v-b7c9a2a3]{display:flex;flex-direction:column;height:100%;width:100%;min-width:0;min-height:0;overflow:hidden}.search-section-wrapper[data-v-b7c9a2a3]{flex-shrink:0}.table-content-wrapper[data-v-b7c9a2a3]{flex:1;min-height:0;overflow:hidden}.pagination-wrapper[data-v-b7c9a2a3]{flex-shrink:0;padding-top:1rem;display:flex;justify-content:flex-end}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.visible{visibility:visible}.relative{position:relative}.\\!mr-0{margin-right:0!important}.mt-2{margin-top:.5rem}.flex{display:flex}.hidden{display:none}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.gap-4{gap:1rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}body{background-color:#f0f2f5;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;margin:0}#app{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#2c3e50}.crud-container{transition:box-shadow .3s ease-in-out}.crud-container:hover{box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a}.query-form .el-form-item{margin-bottom:0!important}.el-table__expanded-cell{padding:1rem 3.5rem!important;background-color:#f8fafc}.action-buttons>*+*{margin-left:.75rem}.el-dialog__header{border-bottom:none;padding:24px 24px 10px}.el-dialog__title{font-size:1.25rem;font-weight:600}.el-dialog__footer{border-top:none;padding:10px 24px 24px}.el-dialog__body{padding:10px 24px}:root{--large-screen-border-color: rgba(120, 153, 199, 1);--large-screen-text-color: rgba(227, 246, 255, 1);--large-screen-search-bg: rgba(210, 224, 243, .1);--large-screen-button-bg: rgba(38, 120, 255, 1);--large-screen-action-link-color: rgba(39, 233, 255, 1);--large-screen-dialog-bg: #1e293b;--large-screen-hover-bg: rgba(120, 153, 199, .15)}.theme-large-screen{color:var(--large-screen-text-color)}.el-modal-dialog,.el-overlay-dialog{position:absolute!important}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import { defineComponent as L, createElementBlock as w, openBlock as r, createElementVNode as S, ref as x, resolveComponent as y, createBlock as f, mergeProps as $, withCtx as p, Fragment as P, renderList as q, createCommentVNode as g, createTextVNode as F, toDisplayString as N, getCurrentScope as fe, onScopeDispose as ce, computed as R, toValue as te, watch as me, shallowRef as ge, getCurrentInstance as ye, onMounted as H, reactive as Y, resolveDirective as ve, normalizeClass as be, renderSlot as h, createVNode as C, withDirectives as he, createSlots as we, unref as _e } from "vue";
|
|
3
|
+
import { ElMessage as T, ElMessageBox as ke } from "element-plus";
|
|
4
4
|
import Se from "axios";
|
|
5
5
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
6
|
-
var Ce = /* @__PURE__ */
|
|
6
|
+
var Ce = /* @__PURE__ */ L({
|
|
7
7
|
name: "ArrowLeftBold",
|
|
8
8
|
__name: "arrow-left-bold",
|
|
9
9
|
setup(u) {
|
|
10
|
-
return (s, v) => (r(),
|
|
10
|
+
return (s, v) => (r(), w("svg", {
|
|
11
11
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12
12
|
viewBox: "0 0 1024 1024"
|
|
13
13
|
}, [
|
|
@@ -17,8 +17,8 @@ var Ce = /* @__PURE__ */ q({
|
|
|
17
17
|
})
|
|
18
18
|
]));
|
|
19
19
|
}
|
|
20
|
-
}),
|
|
21
|
-
const Z = /* @__PURE__ */
|
|
20
|
+
}), De = Ce;
|
|
21
|
+
const Z = /* @__PURE__ */ L({
|
|
22
22
|
__name: "DynamicForm",
|
|
23
23
|
props: {
|
|
24
24
|
modelValue: {},
|
|
@@ -33,38 +33,38 @@ const Z = /* @__PURE__ */ q({
|
|
|
33
33
|
return (d = v.value) == null ? void 0 : d.validate();
|
|
34
34
|
}
|
|
35
35
|
}), (d, e) => {
|
|
36
|
-
const _ = y("el-input"), U = y("el-option"),
|
|
37
|
-
return r(), f(k,
|
|
36
|
+
const _ = y("el-input"), U = y("el-option"), D = y("el-select"), z = y("el-radio"), c = y("el-radio-group"), B = y("el-form-item"), k = y("el-form");
|
|
37
|
+
return r(), f(k, $({
|
|
38
38
|
model: d.modelValue,
|
|
39
39
|
rules: d.rules,
|
|
40
40
|
ref_key: "formRef",
|
|
41
41
|
ref: v
|
|
42
42
|
}, d.$attrs), {
|
|
43
43
|
default: p(() => [
|
|
44
|
-
(r(!0),
|
|
44
|
+
(r(!0), w(P, null, q(d.formConfig, (i) => (r(), f(B, {
|
|
45
45
|
key: i.prop,
|
|
46
46
|
label: i.label,
|
|
47
47
|
prop: i.prop
|
|
48
48
|
}, {
|
|
49
49
|
default: p(() => [
|
|
50
|
-
i.type === "input" ? (r(), f(_,
|
|
50
|
+
i.type === "input" ? (r(), f(_, $({
|
|
51
51
|
key: 0,
|
|
52
52
|
modelValue: d.modelValue[i.prop],
|
|
53
53
|
"onUpdate:modelValue": (m) => d.modelValue[i.prop] = m
|
|
54
54
|
}, { ref_for: !0 }, i.componentProps), null, 16, ["modelValue", "onUpdate:modelValue"])) : g("", !0),
|
|
55
|
-
i.type === "textarea" ? (r(), f(_,
|
|
55
|
+
i.type === "textarea" ? (r(), f(_, $({
|
|
56
56
|
key: 1,
|
|
57
57
|
type: "textarea",
|
|
58
58
|
modelValue: d.modelValue[i.prop],
|
|
59
59
|
"onUpdate:modelValue": (m) => d.modelValue[i.prop] = m
|
|
60
60
|
}, { ref_for: !0 }, i.componentProps), null, 16, ["modelValue", "onUpdate:modelValue"])) : g("", !0),
|
|
61
|
-
i.type === "select" ? (r(), f(
|
|
61
|
+
i.type === "select" ? (r(), f(D, $({
|
|
62
62
|
key: 2,
|
|
63
63
|
modelValue: d.modelValue[i.prop],
|
|
64
64
|
"onUpdate:modelValue": (m) => d.modelValue[i.prop] = m
|
|
65
65
|
}, { ref_for: !0 }, i.componentProps), {
|
|
66
66
|
default: p(() => [
|
|
67
|
-
(r(!0),
|
|
67
|
+
(r(!0), w(P, null, q(i.options, (m) => (r(), f(U, {
|
|
68
68
|
key: m.value,
|
|
69
69
|
label: m.label,
|
|
70
70
|
value: m.value
|
|
@@ -72,25 +72,25 @@ const Z = /* @__PURE__ */ q({
|
|
|
72
72
|
]),
|
|
73
73
|
_: 2
|
|
74
74
|
}, 1040, ["modelValue", "onUpdate:modelValue"])) : g("", !0),
|
|
75
|
-
i.type === "radio-group" ? (r(), f(c,
|
|
75
|
+
i.type === "radio-group" ? (r(), f(c, $({
|
|
76
76
|
key: 3,
|
|
77
77
|
modelValue: d.modelValue[i.prop],
|
|
78
78
|
"onUpdate:modelValue": (m) => d.modelValue[i.prop] = m
|
|
79
79
|
}, { ref_for: !0 }, i.componentProps), {
|
|
80
80
|
default: p(() => [
|
|
81
|
-
(r(!0),
|
|
81
|
+
(r(!0), w(P, null, q(i.options, (m) => (r(), f(z, {
|
|
82
82
|
key: m.value,
|
|
83
83
|
label: m.value
|
|
84
84
|
}, {
|
|
85
85
|
default: p(() => [
|
|
86
|
-
|
|
86
|
+
F(N(m.label), 1)
|
|
87
87
|
]),
|
|
88
88
|
_: 2
|
|
89
89
|
}, 1032, ["label"]))), 128))
|
|
90
90
|
]),
|
|
91
91
|
_: 2
|
|
92
92
|
}, 1040, ["modelValue", "onUpdate:modelValue"])) : g("", !0),
|
|
93
|
-
i.type === "input-disabled" ? (r(), f(_,
|
|
93
|
+
i.type === "input-disabled" ? (r(), f(_, $({
|
|
94
94
|
key: 4,
|
|
95
95
|
"model-value": d.modelValue[i.prop],
|
|
96
96
|
disabled: ""
|
|
@@ -103,27 +103,27 @@ const Z = /* @__PURE__ */ q({
|
|
|
103
103
|
}, 16, ["model", "rules"]);
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
}),
|
|
106
|
+
}), A = Se.create({
|
|
107
107
|
// VITE_APP_BASE_API 是在 .env 文件中定义的基础 URL
|
|
108
108
|
baseURL: "",
|
|
109
109
|
timeout: 1e4
|
|
110
110
|
// 请求超时时间
|
|
111
111
|
});
|
|
112
|
-
|
|
112
|
+
A.interceptors.request.use(
|
|
113
113
|
(u) => {
|
|
114
114
|
const s = localStorage.getItem("token");
|
|
115
115
|
return s && (u.headers.Authorization = "Bearer " + s), u;
|
|
116
116
|
},
|
|
117
117
|
(u) => (console.log(u), Promise.reject(u))
|
|
118
118
|
);
|
|
119
|
-
|
|
119
|
+
A.interceptors.response.use(
|
|
120
120
|
/**
|
|
121
121
|
* @description 如果您想直接获取诸如 headers 或 status 之类的信息,
|
|
122
122
|
* 请直接返回 response => response
|
|
123
123
|
*/
|
|
124
124
|
(u) => {
|
|
125
125
|
const s = u.data;
|
|
126
|
-
return s.code !== 200 ? (
|
|
126
|
+
return s.code !== 200 ? (T({
|
|
127
127
|
message: s.msg || "Error",
|
|
128
128
|
// 使用后端返回的 `msg` 作为错误提示
|
|
129
129
|
type: "error",
|
|
@@ -140,19 +140,19 @@ $.interceptors.response.use(
|
|
|
140
140
|
localStorage.removeItem("token"), location.reload();
|
|
141
141
|
}), Promise.reject(new Error(s.msg || "Error"))) : s;
|
|
142
142
|
},
|
|
143
|
-
(u) => (console.log("HTTP Error: " + u),
|
|
143
|
+
(u) => (console.log("HTTP Error: " + u), T({
|
|
144
144
|
message: "网络错误,请检查您的网络连接或联系管理员",
|
|
145
145
|
// 提供更友好的网络错误提示
|
|
146
146
|
type: "error",
|
|
147
147
|
duration: 5 * 1e3
|
|
148
148
|
}), Promise.reject(u))
|
|
149
149
|
);
|
|
150
|
-
function
|
|
150
|
+
function Be(u) {
|
|
151
151
|
return fe() ? (ce(u), !0) : !1;
|
|
152
152
|
}
|
|
153
|
-
const
|
|
153
|
+
const Fe = typeof window < "u" && typeof document < "u";
|
|
154
154
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
155
|
-
const Ue =
|
|
155
|
+
const Ue = Fe ? window : void 0;
|
|
156
156
|
function ee(u) {
|
|
157
157
|
var s;
|
|
158
158
|
const v = te(u);
|
|
@@ -161,19 +161,19 @@ function ee(u) {
|
|
|
161
161
|
// @__NO_SIDE_EFFECTS__
|
|
162
162
|
function Ve() {
|
|
163
163
|
const u = ge(!1), s = ye();
|
|
164
|
-
return s &&
|
|
164
|
+
return s && H(() => {
|
|
165
165
|
u.value = !0;
|
|
166
166
|
}, s), u;
|
|
167
167
|
}
|
|
168
168
|
// @__NO_SIDE_EFFECTS__
|
|
169
|
-
function
|
|
169
|
+
function $e(u) {
|
|
170
170
|
const s = /* @__PURE__ */ Ve();
|
|
171
171
|
return R(() => (s.value, !!u()));
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function Ae(u, s, v = {}) {
|
|
174
174
|
const { window: d = Ue, ...e } = v;
|
|
175
175
|
let _;
|
|
176
|
-
const U = /* @__PURE__ */
|
|
176
|
+
const U = /* @__PURE__ */ $e(() => d && "ResizeObserver" in d), D = () => {
|
|
177
177
|
_ && (_.disconnect(), _ = void 0);
|
|
178
178
|
}, z = R(() => {
|
|
179
179
|
const k = te(u);
|
|
@@ -181,22 +181,22 @@ function $e(u, s, v = {}) {
|
|
|
181
181
|
}), c = me(
|
|
182
182
|
z,
|
|
183
183
|
(k) => {
|
|
184
|
-
if (
|
|
184
|
+
if (D(), U.value && d) {
|
|
185
185
|
_ = new ResizeObserver(s);
|
|
186
186
|
for (const i of k)
|
|
187
187
|
i && _.observe(i, e);
|
|
188
188
|
}
|
|
189
189
|
},
|
|
190
190
|
{ immediate: !0, flush: "post" }
|
|
191
|
-
),
|
|
192
|
-
|
|
191
|
+
), B = () => {
|
|
192
|
+
D(), c();
|
|
193
193
|
};
|
|
194
|
-
return
|
|
194
|
+
return Be(B), {
|
|
195
195
|
isSupported: U,
|
|
196
|
-
stop:
|
|
196
|
+
stop: B
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
|
-
const xe = /* @__PURE__ */
|
|
199
|
+
const xe = /* @__PURE__ */ L({
|
|
200
200
|
__name: "TableHeaderWithTooltip",
|
|
201
201
|
props: {
|
|
202
202
|
label: {},
|
|
@@ -206,9 +206,9 @@ const xe = /* @__PURE__ */ q({
|
|
|
206
206
|
const s = x(null), v = x(!1), d = () => {
|
|
207
207
|
s.value && (v.value = s.value.scrollWidth > s.value.clientWidth);
|
|
208
208
|
};
|
|
209
|
-
return
|
|
209
|
+
return H(() => {
|
|
210
210
|
d();
|
|
211
|
-
}),
|
|
211
|
+
}), Ae(s, () => {
|
|
212
212
|
d();
|
|
213
213
|
}), (e, _) => {
|
|
214
214
|
const U = y("el-tooltip");
|
|
@@ -225,7 +225,7 @@ const xe = /* @__PURE__ */ q({
|
|
|
225
225
|
}, N(e.label), 513)
|
|
226
226
|
]),
|
|
227
227
|
_: 1
|
|
228
|
-
}, 8, ["content", "placement"])) : (r(),
|
|
228
|
+
}, 8, ["content", "placement"])) : (r(), w("span", {
|
|
229
229
|
key: 0,
|
|
230
230
|
ref_key: "textRef",
|
|
231
231
|
ref: s,
|
|
@@ -241,13 +241,13 @@ const xe = /* @__PURE__ */ q({
|
|
|
241
241
|
}, ze = /* @__PURE__ */ oe(xe, [["__scopeId", "data-v-d23c8660"]]), Oe = {
|
|
242
242
|
key: 0,
|
|
243
243
|
class: "search-section-wrapper"
|
|
244
|
-
}, Re = { class: "flex flex-wrap items-center justify-between gap-4" },
|
|
244
|
+
}, Re = { class: "flex flex-wrap items-center justify-between gap-4" }, Te = { class: "flex items-center gap-x-2" }, Pe = { class: "flex items-center gap-x-3 action-buttons flex-shrink-0" }, Ne = { class: "table-content-wrapper" }, We = { key: 1 }, Ee = {
|
|
245
245
|
key: 0,
|
|
246
246
|
class: "flex items-center gap-x-2"
|
|
247
247
|
}, je = {
|
|
248
248
|
key: 1,
|
|
249
249
|
class: "pagination-wrapper flex justify-end mt-2"
|
|
250
|
-
}, qe = { style: { "overflow-y": "auto", flex: "1" } }, Le = { class: "dialog-footer" }, Qe = { class: "flex items-center" }, Ie = { class: "el-dialog__title" }, Me = { style: { "overflow-y": "auto", flex: "1" } }, He = { class: "dialog-footer" }, Ge = /* @__PURE__ */
|
|
250
|
+
}, qe = { style: { "overflow-y": "auto", flex: "1" } }, Le = { class: "dialog-footer" }, Qe = { class: "flex items-center" }, Ie = { class: "el-dialog__title" }, Me = { style: { "overflow-y": "auto", flex: "1" } }, He = { class: "dialog-footer" }, Ge = /* @__PURE__ */ L({
|
|
251
251
|
__name: "CrudTable",
|
|
252
252
|
props: {
|
|
253
253
|
/**
|
|
@@ -355,55 +355,65 @@ const xe = /* @__PURE__ */ q({
|
|
|
355
355
|
* @description [✨ 新增] 控制弹窗是否在组件内部全屏
|
|
356
356
|
* @type {Boolean}
|
|
357
357
|
*/
|
|
358
|
-
dialogFullscreen: { type: Boolean, default: !1 }
|
|
358
|
+
dialogFullscreen: { type: Boolean, default: !1 },
|
|
359
|
+
/**
|
|
360
|
+
* @description [✨ 新增] 新增弹窗的自定义标题
|
|
361
|
+
* @type {String}
|
|
362
|
+
*/
|
|
363
|
+
addDialogTitle: { type: String, default: "新增" },
|
|
364
|
+
/**
|
|
365
|
+
* @description [✨ 新增] 编辑弹窗的自定义标题
|
|
366
|
+
* @type {String}
|
|
367
|
+
*/
|
|
368
|
+
editDialogTitle: { type: String, default: "编辑" }
|
|
359
369
|
},
|
|
360
370
|
emits: ["open-dialog", "submit", "delete"],
|
|
361
371
|
setup(u, { expose: s, emit: v }) {
|
|
362
|
-
const d = v, e = u, _ = R(() => ["crud-table-wrapper", `theme-${e.theme}`, e.customClass]), U = R(() => e.theme === "large-screen" ? "large-screen-dialog" : ""),
|
|
372
|
+
const d = v, e = u, _ = R(() => ["crud-table-wrapper", `theme-${e.theme}`, e.customClass]), U = R(() => e.theme === "large-screen" ? "large-screen-dialog" : ""), D = (t, o) => t ? !0 : (T.error(`${o} prop is required.`), !1), z = async (t, o) => {
|
|
363
373
|
try {
|
|
364
|
-
let n = { ...
|
|
365
|
-
e.onBeforeSubmit && (n = await e.onBeforeSubmit(n,
|
|
366
|
-
let
|
|
374
|
+
let n = { ...o };
|
|
375
|
+
e.onBeforeSubmit && (n = await e.onBeforeSubmit(n, t));
|
|
376
|
+
let b = n;
|
|
367
377
|
if (e.submitAsFormData) {
|
|
368
|
-
const
|
|
378
|
+
const j = new FormData();
|
|
369
379
|
for (const V in n)
|
|
370
380
|
if (Object.prototype.hasOwnProperty.call(n, V)) {
|
|
371
|
-
const
|
|
372
|
-
|
|
381
|
+
const I = n[V];
|
|
382
|
+
j.append(V, I ?? "");
|
|
373
383
|
}
|
|
374
|
-
|
|
384
|
+
b = j;
|
|
375
385
|
}
|
|
376
|
-
if (l.submitting = !0,
|
|
377
|
-
if (!
|
|
378
|
-
await
|
|
386
|
+
if (l.submitting = !0, t === "add") {
|
|
387
|
+
if (!D(e.apiUrlCreate, "apiUrlCreate")) throw new Error("apiUrlCreate is not configured.");
|
|
388
|
+
await A.post(e.apiUrlCreate, b), T.success("新增成功");
|
|
379
389
|
} else {
|
|
380
|
-
if (!
|
|
381
|
-
await
|
|
390
|
+
if (!D(e.apiUrlUpdate, "apiUrlUpdate")) throw new Error("apiUrlUpdate is not configured.");
|
|
391
|
+
await A.put(e.apiUrlUpdate, b), T.success("更新成功");
|
|
382
392
|
}
|
|
383
|
-
return e.onAfterSubmit && e.onAfterSubmit(
|
|
393
|
+
return e.onAfterSubmit && e.onAfterSubmit(t, n), d("submit", { mode: t, data: n }), l.visible && (l.visible = !1), O(), Promise.resolve();
|
|
384
394
|
} catch (n) {
|
|
385
395
|
return console.error("Submit failed:", n), Promise.reject(n);
|
|
386
396
|
} finally {
|
|
387
397
|
l.submitting = !1;
|
|
388
398
|
}
|
|
389
|
-
}, c = Y({ pageNum: 1, pageSize: 10, ...e.initialSearchForm }),
|
|
390
|
-
if (l.mode === "add") return e.dialogFormConfig.filter((
|
|
391
|
-
const
|
|
392
|
-
return
|
|
399
|
+
}, c = Y({ pageNum: 1, pageSize: 10, ...e.initialSearchForm }), B = x([]), k = x(0), i = x(!1), m = x([]), l = Y({ visible: !1, loading: !1, submitting: !1, mode: "add", data: {}, formRef: null }), G = R(() => l.mode === "add" ? e.addDialogTitle : e.editDialogTitle), J = R(() => {
|
|
400
|
+
if (l.mode === "add") return e.dialogFormConfig.filter((o) => o.prop !== "id");
|
|
401
|
+
const t = [...e.dialogFormConfig.filter((o) => o.prop !== "id")];
|
|
402
|
+
return t.some((o) => o.prop === "id") || t.unshift({ type: "input-disabled", prop: "id", label: "用户ID" }), t;
|
|
393
403
|
}), O = async () => {
|
|
394
|
-
if (
|
|
404
|
+
if (D(e.apiUrlQuery, "apiUrlQuery")) {
|
|
395
405
|
i.value = !0;
|
|
396
406
|
try {
|
|
397
|
-
let
|
|
398
|
-
e.onBeforeQuery && (
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
401
|
-
let n =
|
|
402
|
-
e.onAfterQuery && (n = await e.onAfterQuery(n,
|
|
407
|
+
let t = { ...c };
|
|
408
|
+
e.onBeforeQuery && (t = await e.onBeforeQuery(t));
|
|
409
|
+
const o = await A.get(e.apiUrlQuery, { params: t });
|
|
410
|
+
if (o && o.data && Array.isArray(o.data.rows) && typeof o.data.total == "number") {
|
|
411
|
+
let n = o.data.rows;
|
|
412
|
+
e.onAfterQuery && (n = await e.onAfterQuery(n, t)), B.value = n, k.value = o.data.total;
|
|
403
413
|
} else
|
|
404
|
-
console.warn("API response is not in the expected { data: { rows: [], total: 0 } } format."),
|
|
405
|
-
} catch (
|
|
406
|
-
console.error("Fetch data failed:",
|
|
414
|
+
console.warn("API response is not in the expected { data: { rows: [], total: 0 } } format."), B.value = [], k.value = 0;
|
|
415
|
+
} catch (t) {
|
|
416
|
+
console.error("Fetch data failed:", t);
|
|
407
417
|
} finally {
|
|
408
418
|
i.value = !1;
|
|
409
419
|
}
|
|
@@ -411,90 +421,94 @@ const xe = /* @__PURE__ */ q({
|
|
|
411
421
|
}, W = () => {
|
|
412
422
|
c.pageNum = 1, O();
|
|
413
423
|
}, le = () => {
|
|
414
|
-
const { pageNum:
|
|
415
|
-
Object.keys(c).forEach((
|
|
416
|
-
|
|
424
|
+
const { pageNum: t, pageSize: o, ...n } = e.initialSearchForm;
|
|
425
|
+
Object.keys(c).forEach((b) => {
|
|
426
|
+
b !== "pageNum" && b !== "pageSize" && delete c[b];
|
|
417
427
|
}), Object.assign(c, n), W();
|
|
418
|
-
}, ae = (
|
|
419
|
-
m.value =
|
|
420
|
-
},
|
|
428
|
+
}, ae = (t) => {
|
|
429
|
+
m.value = t;
|
|
430
|
+
}, Q = async (t, o) => {
|
|
421
431
|
let n;
|
|
422
|
-
if (
|
|
423
|
-
const
|
|
424
|
-
|
|
432
|
+
if (t === "add" ? n = o ? { ...o } : { role: "user" } : n = { ...o }, e.onBeforeOpenDialog) {
|
|
433
|
+
const b = await e.onBeforeOpenDialog(t, n);
|
|
434
|
+
b && (n = b);
|
|
425
435
|
}
|
|
426
|
-
if (l.mode =
|
|
427
|
-
if (!
|
|
436
|
+
if (l.mode = t, l.visible = !0, t === "edit") {
|
|
437
|
+
if (!D(e.apiUrlDetail, "apiUrlDetail")) return;
|
|
428
438
|
l.loading = !0;
|
|
429
439
|
try {
|
|
430
|
-
const
|
|
431
|
-
l.data =
|
|
440
|
+
const b = await A.get(e.apiUrlDetail + "/" + n.id.toString());
|
|
441
|
+
l.data = b.data.data;
|
|
432
442
|
} finally {
|
|
433
|
-
l.loading = !1, e.onAfterOpenDialog && e.onAfterOpenDialog(
|
|
443
|
+
l.loading = !1, e.onAfterOpenDialog && e.onAfterOpenDialog(t, l.data), d("open-dialog", { mode: t, data: l.data });
|
|
434
444
|
}
|
|
435
445
|
} else
|
|
436
|
-
l.data = n, e.onAfterOpenDialog && e.onAfterOpenDialog(
|
|
437
|
-
},
|
|
446
|
+
l.data = n, e.onAfterOpenDialog && e.onAfterOpenDialog(t, l.data), d("open-dialog", { mode: t, data: l.data });
|
|
447
|
+
}, E = async () => {
|
|
438
448
|
try {
|
|
439
449
|
l.formRef ? await l.formRef.validate() : console.warn("Dialog form ref is not available for validation."), await z(l.mode, l.data);
|
|
440
|
-
} catch (
|
|
441
|
-
console.log("Validation or submit error:",
|
|
450
|
+
} catch (t) {
|
|
451
|
+
console.log("Validation or submit error:", t);
|
|
442
452
|
}
|
|
443
|
-
}, K = async (
|
|
444
|
-
if (
|
|
453
|
+
}, K = async (t) => {
|
|
454
|
+
if (D(e.apiUrlDelete, "apiUrlDelete"))
|
|
445
455
|
try {
|
|
446
|
-
const
|
|
447
|
-
if (e.onBeforeDelete && await e.onBeforeDelete(
|
|
456
|
+
const o = B.value.filter((b) => t.includes(b.id));
|
|
457
|
+
if (e.onBeforeDelete && await e.onBeforeDelete(t, o) === !1)
|
|
448
458
|
return;
|
|
449
|
-
const n =
|
|
450
|
-
await
|
|
451
|
-
} catch (
|
|
452
|
-
console.error("Delete failed",
|
|
459
|
+
const n = t.join(",");
|
|
460
|
+
await A.delete(e.apiUrlDelete + "/" + n.toString()), T.success("删除成功"), e.onAfterDelete && e.onAfterDelete(t, o), d("delete", t), B.value.length === t.length && c.pageNum > 1 && c.pageNum--, O();
|
|
461
|
+
} catch (o) {
|
|
462
|
+
console.error("Delete failed", o);
|
|
453
463
|
}
|
|
454
|
-
}, re = (
|
|
455
|
-
c.pageSize =
|
|
456
|
-
}, ne = (
|
|
457
|
-
c.pageNum =
|
|
464
|
+
}, re = (t) => {
|
|
465
|
+
c.pageSize = t, W();
|
|
466
|
+
}, ne = (t) => {
|
|
467
|
+
c.pageNum = t, O();
|
|
458
468
|
};
|
|
459
|
-
return
|
|
469
|
+
return H(O), s({
|
|
460
470
|
refresh: O,
|
|
461
471
|
// 刷新表格
|
|
462
472
|
search: W,
|
|
463
473
|
// 按当前条件搜索
|
|
464
474
|
handleDelete: K,
|
|
465
475
|
// 手动触发删除
|
|
466
|
-
openDialog:
|
|
476
|
+
openDialog: Q,
|
|
467
477
|
// 手动打开弹窗
|
|
468
|
-
submit: z
|
|
478
|
+
submit: z,
|
|
469
479
|
// 手动提交
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
480
|
+
closeDialog: () => {
|
|
481
|
+
l.visible = !1;
|
|
482
|
+
}
|
|
483
|
+
//关闭弹窗
|
|
484
|
+
}), (t, o) => {
|
|
485
|
+
const n = y("el-button"), b = y("el-form-item"), j = y("el-form"), V = y("el-table-column"), I = y("el-popconfirm"), ie = y("el-table"), se = y("el-pagination"), ue = y("el-skeleton"), X = y("el-dialog"), de = y("el-icon"), pe = ve("loading");
|
|
486
|
+
return r(), w("div", {
|
|
487
|
+
class: be([_.value, "crud-table-container"])
|
|
474
488
|
}, [
|
|
475
|
-
e.showSearchSection ? (r(),
|
|
476
|
-
|
|
489
|
+
e.showSearchSection ? (r(), w("div", Oe, [
|
|
490
|
+
h(t.$slots, "header", {}, void 0, !0),
|
|
477
491
|
S("div", Re, [
|
|
478
|
-
C(
|
|
492
|
+
C(j, {
|
|
479
493
|
model: c,
|
|
480
494
|
class: "query-form flex flex-nowrap items-center gap-x-4",
|
|
481
495
|
style: { "overflow-x": "auto", "padding-bottom": "8px" }
|
|
482
496
|
}, {
|
|
483
497
|
default: p(() => [
|
|
484
|
-
|
|
485
|
-
C(
|
|
498
|
+
h(t.$slots, "query-conditions", { searchForm: c }, void 0, !0),
|
|
499
|
+
C(b, { class: "!mr-0 flex-shrink-0" }, {
|
|
486
500
|
default: p(() => [
|
|
487
|
-
S("div",
|
|
488
|
-
|
|
489
|
-
e.showSearchActionButtons ? (r(),
|
|
501
|
+
S("div", Te, [
|
|
502
|
+
h(t.$slots, "query-left", { searchForm: c }, void 0, !0),
|
|
503
|
+
e.showSearchActionButtons ? (r(), w(P, { key: 0 }, [
|
|
490
504
|
e.showSearchButton ? (r(), f(n, {
|
|
491
505
|
key: 0,
|
|
492
506
|
color: "#336FFF",
|
|
493
507
|
onClick: W,
|
|
494
508
|
loading: i.value
|
|
495
509
|
}, {
|
|
496
|
-
default: p(() => [...
|
|
497
|
-
|
|
510
|
+
default: p(() => [...o[8] || (o[8] = [
|
|
511
|
+
F("搜索", -1)
|
|
498
512
|
])]),
|
|
499
513
|
_: 1
|
|
500
514
|
}, 8, ["loading"])) : g("", !0),
|
|
@@ -504,13 +518,13 @@ const xe = /* @__PURE__ */ q({
|
|
|
504
518
|
plain: "",
|
|
505
519
|
onClick: le
|
|
506
520
|
}, {
|
|
507
|
-
default: p(() => [...
|
|
508
|
-
|
|
521
|
+
default: p(() => [...o[9] || (o[9] = [
|
|
522
|
+
F("清空", -1)
|
|
509
523
|
])]),
|
|
510
524
|
_: 1
|
|
511
525
|
})) : g("", !0)
|
|
512
526
|
], 64)) : g("", !0),
|
|
513
|
-
|
|
527
|
+
h(t.$slots, "query-right", { searchForm: c }, void 0, !0)
|
|
514
528
|
])
|
|
515
529
|
]),
|
|
516
530
|
_: 3
|
|
@@ -518,31 +532,31 @@ const xe = /* @__PURE__ */ q({
|
|
|
518
532
|
]),
|
|
519
533
|
_: 3
|
|
520
534
|
}, 8, ["model"]),
|
|
521
|
-
S("div",
|
|
522
|
-
|
|
523
|
-
|
|
535
|
+
S("div", Pe, [
|
|
536
|
+
h(t.$slots, "action-left", { selections: m.value }, void 0, !0),
|
|
537
|
+
h(t.$slots, "add-button-content", { selections: m.value }, () => [
|
|
524
538
|
e.showNewBtn ? (r(), f(n, {
|
|
525
539
|
key: 0,
|
|
526
540
|
color: "#336FFF",
|
|
527
|
-
onClick:
|
|
541
|
+
onClick: o[0] || (o[0] = (a) => Q("add"))
|
|
528
542
|
}, {
|
|
529
|
-
default: p(() => [...
|
|
530
|
-
|
|
543
|
+
default: p(() => [...o[10] || (o[10] = [
|
|
544
|
+
F("新增", -1)
|
|
531
545
|
])]),
|
|
532
546
|
_: 1
|
|
533
547
|
})) : g("", !0)
|
|
534
548
|
], !0),
|
|
535
|
-
|
|
549
|
+
h(t.$slots, "action-right", { selections: m.value }, void 0, !0)
|
|
536
550
|
])
|
|
537
551
|
])
|
|
538
552
|
])) : g("", !0),
|
|
539
553
|
S("div", Ne, [
|
|
540
|
-
|
|
541
|
-
data:
|
|
554
|
+
he((r(), f(ie, $({
|
|
555
|
+
data: B.value,
|
|
542
556
|
"element-loading-text": e.loadingText,
|
|
543
557
|
"element-loading-background": e.loadingBackground,
|
|
544
558
|
onSelectionChange: ae
|
|
545
|
-
},
|
|
559
|
+
}, t.$attrs, {
|
|
546
560
|
height: "100%",
|
|
547
561
|
style: { width: "100%" }
|
|
548
562
|
}), {
|
|
@@ -560,27 +574,27 @@ const xe = /* @__PURE__ */ q({
|
|
|
560
574
|
width: "70",
|
|
561
575
|
fixed: ""
|
|
562
576
|
})) : g("", !0),
|
|
563
|
-
(r(!0),
|
|
577
|
+
(r(!0), w(P, null, q(e.columns, (a) => (r(), f(V, $({
|
|
564
578
|
key: a.prop,
|
|
565
579
|
prop: a.prop,
|
|
566
580
|
label: a.label,
|
|
567
581
|
width: a.width,
|
|
568
582
|
sortable: a.sortable || !1
|
|
569
|
-
}, { ref_for: !0 }, a.attrs),
|
|
583
|
+
}, { ref_for: !0 }, a.attrs), we({
|
|
570
584
|
header: p(() => [
|
|
571
585
|
a.headerTooltip ? (r(), f(ze, {
|
|
572
586
|
key: 0,
|
|
573
587
|
label: a.label,
|
|
574
588
|
placement: a.placement
|
|
575
|
-
}, null, 8, ["label", "placement"])) : (r(),
|
|
589
|
+
}, null, 8, ["label", "placement"])) : (r(), w("span", We, N(a.label), 1))
|
|
576
590
|
]),
|
|
577
591
|
_: 2
|
|
578
592
|
}, [
|
|
579
593
|
a.slot ? {
|
|
580
594
|
name: "default",
|
|
581
|
-
fn: p((
|
|
582
|
-
|
|
583
|
-
row:
|
|
595
|
+
fn: p((M) => [
|
|
596
|
+
h(t.$slots, a.slot, {
|
|
597
|
+
row: M.row
|
|
584
598
|
}, void 0, !0)
|
|
585
599
|
]),
|
|
586
600
|
key: "0"
|
|
@@ -592,12 +606,12 @@ const xe = /* @__PURE__ */ q({
|
|
|
592
606
|
width: u.actionsColumnWidth
|
|
593
607
|
}, {
|
|
594
608
|
default: p((a) => [
|
|
595
|
-
a.row ? (r(),
|
|
596
|
-
|
|
609
|
+
a.row ? (r(), w("div", Ee, [
|
|
610
|
+
t.$slots.actions ? h(t.$slots, "actions", {
|
|
597
611
|
key: 0,
|
|
598
612
|
row: a.row
|
|
599
|
-
}, void 0, !0) : (r(),
|
|
600
|
-
|
|
613
|
+
}, void 0, !0) : (r(), w(P, { key: 1 }, [
|
|
614
|
+
h(t.$slots, "action-before-edit", {
|
|
601
615
|
row: a.row
|
|
602
616
|
}, void 0, !0),
|
|
603
617
|
e.showEditButton ? (r(), f(n, {
|
|
@@ -605,17 +619,17 @@ const xe = /* @__PURE__ */ q({
|
|
|
605
619
|
size: "small",
|
|
606
620
|
type: "primary",
|
|
607
621
|
link: "",
|
|
608
|
-
onClick: (
|
|
622
|
+
onClick: (M) => Q("edit", a.row)
|
|
609
623
|
}, {
|
|
610
|
-
default: p(() => [...
|
|
611
|
-
|
|
624
|
+
default: p(() => [...o[11] || (o[11] = [
|
|
625
|
+
F("编辑 ", -1)
|
|
612
626
|
])]),
|
|
613
627
|
_: 1
|
|
614
628
|
}, 8, ["onClick"])) : g("", !0),
|
|
615
|
-
e.showDeleteButton ? (r(), f(
|
|
629
|
+
e.showDeleteButton ? (r(), f(I, {
|
|
616
630
|
key: 1,
|
|
617
631
|
title: "确定要删除这条数据吗?",
|
|
618
|
-
onConfirm: (
|
|
632
|
+
onConfirm: (M) => K([a.row.id]),
|
|
619
633
|
"confirm-button-text": "确定",
|
|
620
634
|
"cancel-button-text": "取消",
|
|
621
635
|
width: "200"
|
|
@@ -626,15 +640,15 @@ const xe = /* @__PURE__ */ q({
|
|
|
626
640
|
type: "danger",
|
|
627
641
|
link: ""
|
|
628
642
|
}, {
|
|
629
|
-
default: p(() => [...
|
|
630
|
-
|
|
643
|
+
default: p(() => [...o[12] || (o[12] = [
|
|
644
|
+
F("删除", -1)
|
|
631
645
|
])]),
|
|
632
646
|
_: 1
|
|
633
647
|
})
|
|
634
648
|
]),
|
|
635
649
|
_: 1
|
|
636
650
|
}, 8, ["onConfirm"])) : g("", !0),
|
|
637
|
-
|
|
651
|
+
h(t.$slots, "action-after-delete", {
|
|
638
652
|
row: a.row
|
|
639
653
|
}, void 0, !0)
|
|
640
654
|
], 64))
|
|
@@ -648,12 +662,12 @@ const xe = /* @__PURE__ */ q({
|
|
|
648
662
|
[pe, i.value]
|
|
649
663
|
])
|
|
650
664
|
]),
|
|
651
|
-
e.showPagination && k.value > 0 ? (r(),
|
|
665
|
+
e.showPagination && k.value > 0 ? (r(), w("div", je, [
|
|
652
666
|
C(se, {
|
|
653
667
|
"current-page": c.pageNum,
|
|
654
|
-
"onUpdate:currentPage":
|
|
668
|
+
"onUpdate:currentPage": o[1] || (o[1] = (a) => c.pageNum = a),
|
|
655
669
|
"page-size": c.pageSize,
|
|
656
|
-
"onUpdate:pageSize":
|
|
670
|
+
"onUpdate:pageSize": o[2] || (o[2] = (a) => c.pageSize = a),
|
|
657
671
|
"page-sizes": e.pageSizes,
|
|
658
672
|
layout: e.paginationLayout,
|
|
659
673
|
total: k.value,
|
|
@@ -667,7 +681,7 @@ const xe = /* @__PURE__ */ q({
|
|
|
667
681
|
e.dialogFullscreen ? (r(), f(X, {
|
|
668
682
|
key: 3,
|
|
669
683
|
modelValue: l.visible,
|
|
670
|
-
"onUpdate:modelValue":
|
|
684
|
+
"onUpdate:modelValue": o[7] || (o[7] = (a) => l.visible = a),
|
|
671
685
|
fullscreen: !0,
|
|
672
686
|
width: e.dialogWidth,
|
|
673
687
|
"destroy-on-close": !0,
|
|
@@ -681,49 +695,55 @@ const xe = /* @__PURE__ */ q({
|
|
|
681
695
|
C(n, {
|
|
682
696
|
type: "info",
|
|
683
697
|
text: "",
|
|
684
|
-
onClick:
|
|
698
|
+
onClick: o[5] || (o[5] = (a) => l.visible = !1),
|
|
685
699
|
style: { "margin-right": "12px" }
|
|
686
700
|
}, {
|
|
687
701
|
default: p(() => [
|
|
688
702
|
C(de, { size: "20" }, {
|
|
689
703
|
default: p(() => [
|
|
690
|
-
C(_e(
|
|
704
|
+
C(_e(De))
|
|
691
705
|
]),
|
|
692
706
|
_: 1
|
|
693
707
|
})
|
|
694
708
|
]),
|
|
695
709
|
_: 1
|
|
696
710
|
}),
|
|
697
|
-
S("span", Ie, N(
|
|
711
|
+
S("span", Ie, N(G.value), 1)
|
|
698
712
|
])
|
|
699
713
|
]),
|
|
700
714
|
footer: p(() => [
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
715
|
+
h(t.$slots, "dialog-footer", {
|
|
716
|
+
dialog: l,
|
|
717
|
+
submit: E,
|
|
718
|
+
cancel: () => l.visible = !1
|
|
719
|
+
}, () => [
|
|
720
|
+
S("span", He, [
|
|
721
|
+
C(n, {
|
|
722
|
+
color: "#336FFF",
|
|
723
|
+
plain: "",
|
|
724
|
+
onClick: o[6] || (o[6] = (a) => l.visible = !1)
|
|
725
|
+
}, {
|
|
726
|
+
default: p(() => [...o[15] || (o[15] = [
|
|
727
|
+
F("取消", -1)
|
|
728
|
+
])]),
|
|
729
|
+
_: 1
|
|
730
|
+
}),
|
|
731
|
+
C(n, {
|
|
732
|
+
color: "#336FFF",
|
|
733
|
+
onClick: E,
|
|
734
|
+
loading: l.submitting
|
|
735
|
+
}, {
|
|
736
|
+
default: p(() => [...o[16] || (o[16] = [
|
|
737
|
+
F(" 确定 ", -1)
|
|
738
|
+
])]),
|
|
739
|
+
_: 1
|
|
740
|
+
}, 8, ["loading"])
|
|
741
|
+
])
|
|
742
|
+
], !0)
|
|
723
743
|
]),
|
|
724
744
|
default: p(() => [
|
|
725
745
|
S("div", Me, [
|
|
726
|
-
|
|
746
|
+
t.$slots["dialog-form"] ? h(t.$slots, "dialog-form", {
|
|
727
747
|
key: 0,
|
|
728
748
|
formData: l.data,
|
|
729
749
|
mode: l.mode,
|
|
@@ -736,7 +756,7 @@ const xe = /* @__PURE__ */ q({
|
|
|
736
756
|
l.formRef = a;
|
|
737
757
|
},
|
|
738
758
|
"model-value": l.data,
|
|
739
|
-
"form-config":
|
|
759
|
+
"form-config": J.value,
|
|
740
760
|
rules: e.dialogFormRules,
|
|
741
761
|
"label-width": e.dialogFormLabelWidth
|
|
742
762
|
}, null, 8, ["model-value", "form-config", "rules", "label-width"]))
|
|
@@ -746,39 +766,45 @@ const xe = /* @__PURE__ */ q({
|
|
|
746
766
|
}, 8, ["modelValue", "width", "modal", "custom-class"])) : (r(), f(X, {
|
|
747
767
|
key: 2,
|
|
748
768
|
modelValue: l.visible,
|
|
749
|
-
"onUpdate:modelValue":
|
|
750
|
-
title:
|
|
769
|
+
"onUpdate:modelValue": o[4] || (o[4] = (a) => l.visible = a),
|
|
770
|
+
title: G.value,
|
|
751
771
|
width: e.dialogWidth,
|
|
752
772
|
"destroy-on-close": !0,
|
|
753
773
|
"custom-class": U.value,
|
|
754
774
|
style: { display: "flex", "flex-direction": "column", "max-height": "80vh" }
|
|
755
775
|
}, {
|
|
756
776
|
footer: p(() => [
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
777
|
+
h(t.$slots, "dialog-footer", {
|
|
778
|
+
dialog: l,
|
|
779
|
+
submit: E,
|
|
780
|
+
cancel: () => l.visible = !1
|
|
781
|
+
}, () => [
|
|
782
|
+
S("span", Le, [
|
|
783
|
+
C(n, {
|
|
784
|
+
color: "#336FFF",
|
|
785
|
+
onClick: o[3] || (o[3] = (a) => l.visible = !1)
|
|
786
|
+
}, {
|
|
787
|
+
default: p(() => [...o[13] || (o[13] = [
|
|
788
|
+
F("取消", -1)
|
|
789
|
+
])]),
|
|
790
|
+
_: 1
|
|
791
|
+
}),
|
|
792
|
+
C(n, {
|
|
793
|
+
color: "#336FFF",
|
|
794
|
+
onClick: E,
|
|
795
|
+
loading: l.submitting
|
|
796
|
+
}, {
|
|
797
|
+
default: p(() => [...o[14] || (o[14] = [
|
|
798
|
+
F(" 确定 ", -1)
|
|
799
|
+
])]),
|
|
800
|
+
_: 1
|
|
801
|
+
}, 8, ["loading"])
|
|
802
|
+
])
|
|
803
|
+
], !0)
|
|
778
804
|
]),
|
|
779
805
|
default: p(() => [
|
|
780
806
|
S("div", qe, [
|
|
781
|
-
|
|
807
|
+
t.$slots["dialog-form"] ? h(t.$slots, "dialog-form", {
|
|
782
808
|
key: 0,
|
|
783
809
|
formData: l.data,
|
|
784
810
|
mode: l.mode,
|
|
@@ -795,7 +821,7 @@ const xe = /* @__PURE__ */ q({
|
|
|
795
821
|
l.formRef = a;
|
|
796
822
|
},
|
|
797
823
|
"model-value": l.data,
|
|
798
|
-
"form-config":
|
|
824
|
+
"form-config": J.value,
|
|
799
825
|
rules: e.dialogFormRules,
|
|
800
826
|
"label-width": e.dialogFormLabelWidth
|
|
801
827
|
}, null, 8, ["model-value", "form-config", "rules", "label-width"]))
|
|
@@ -806,7 +832,7 @@ const xe = /* @__PURE__ */ q({
|
|
|
806
832
|
], 2);
|
|
807
833
|
};
|
|
808
834
|
}
|
|
809
|
-
}),
|
|
835
|
+
}), Ze = /* @__PURE__ */ oe(Ge, [["__scopeId", "data-v-b7c9a2a3"]]);
|
|
810
836
|
export {
|
|
811
|
-
|
|
837
|
+
Ze as CrudTable
|
|
812
838
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.header-cell-content[data-v-d23c8660]{display:inline-block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.crud-table-container[data-v-
|
|
2
|
-
(function(w,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","axios"],e):(w=typeof globalThis<"u"?globalThis:w||self,e(w.ZCrudTable={},w.Vue,w.ElementPlus,w.axios))})(this,(function(w,e,b,W){"use strict";/*! Element Plus Icons Vue v2.3.2 */var j=e.defineComponent({name:"ArrowLeftBold",__name:"arrow-left-bold",setup(d){return(s,m)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M685.248 104.704a64 64 0 0 1 0 90.496L368.448 512l316.8 316.8a64 64 0 0 1-90.496 90.496L232.704 557.248a64 64 0 0 1 0-90.496l362.048-362.048a64 64 0 0 1 90.496 0"})]))}}),M=j;const U=e.defineComponent({__name:"DynamicForm",props:{modelValue:{},formConfig:{},rules:{}},setup(d,{expose:s}){const m=e.ref(null);return s({validate:()=>{var c;return(c=m.value)==null?void 0:c.validate()}}),(c,t)=>{const u=e.resolveComponent("el-input"),B=e.resolveComponent("el-option"),h=e.resolveComponent("el-select"),V=e.resolveComponent("el-radio"),p=e.resolveComponent("el-radio-group"),k=e.resolveComponent("el-form-item"),y=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(y,e.mergeProps({model:c.modelValue,rules:c.rules,ref_key:"formRef",ref:m},c.$attrs),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.formConfig,i=>(e.openBlock(),e.createBlock(k,{key:i.prop,label:i.label,prop:i.prop},{default:e.withCtx(()=>[i.type==="input"?(e.openBlock(),e.createBlock(u,e.mergeProps({key:0,modelValue:c.modelValue[i.prop],"onUpdate:modelValue":f=>c.modelValue[i.prop]=f},{ref_for:!0},i.componentProps),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),i.type==="textarea"?(e.openBlock(),e.createBlock(u,e.mergeProps({key:1,type:"textarea",modelValue:c.modelValue[i.prop],"onUpdate:modelValue":f=>c.modelValue[i.prop]=f},{ref_for:!0},i.componentProps),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),i.type==="select"?(e.openBlock(),e.createBlock(h,e.mergeProps({key:2,modelValue:c.modelValue[i.prop],"onUpdate:modelValue":f=>c.modelValue[i.prop]=f},{ref_for:!0},i.componentProps),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.options,f=>(e.openBlock(),e.createBlock(B,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),i.type==="radio-group"?(e.openBlock(),e.createBlock(p,e.mergeProps({key:3,modelValue:c.modelValue[i.prop],"onUpdate:modelValue":f=>c.modelValue[i.prop]=f},{ref_for:!0},i.componentProps),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.options,f=>(e.openBlock(),e.createBlock(V,{key:f.value,label:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),_:2},1032,["label"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),i.type==="input-disabled"?(e.openBlock(),e.createBlock(u,e.mergeProps({key:4,"model-value":c.modelValue[i.prop],disabled:""},{ref_for:!0},i.componentProps),null,16,["model-value"])):e.createCommentVNode("",!0)]),_:2},1032,["label","prop"]))),128))]),_:1},16,["model","rules"])}}}),_=W.create({baseURL:"",timeout:1e4});_.interceptors.request.use(d=>{const s=localStorage.getItem("token");return s&&(d.headers.Authorization="Bearer "+s),d},d=>(console.log(d),Promise.reject(d))),_.interceptors.response.use(d=>{const s=d.data;return s.code!==200?(b.ElMessage({message:s.msg||"Error",type:"error",duration:5*1e3}),(s.code===401||s.code===403)&&b.ElMessageBox.confirm("您的登录状态已失效,请重新登录","确认登出",{confirmButtonText:"重新登录",cancelButtonText:"取消",type:"warning"}).then(()=>{localStorage.removeItem("token"),location.reload()}),Promise.reject(new Error(s.msg||"Error"))):s},d=>(console.log("HTTP Error: "+d),b.ElMessage({message:"网络错误,请检查您的网络连接或联系管理员",type:"error",duration:5*1e3}),Promise.reject(d)));function q(d){return e.getCurrentScope()?(e.onScopeDispose(d),!0):!1}const L=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Q=L?window:void 0;function T(d){var s;const m=e.toValue(d);return(s=m==null?void 0:m.$el)!=null?s:m}function I(){const d=e.shallowRef(!1),s=e.getCurrentInstance();return s&&e.onMounted(()=>{d.value=!0},s),d}function H(d){const s=I();return e.computed(()=>(s.value,!!d()))}function G(d,s,m={}){const{window:c=Q,...t}=m;let u;const B=H(()=>c&&"ResizeObserver"in c),h=()=>{u&&(u.disconnect(),u=void 0)},V=e.computed(()=>{const y=e.toValue(d);return Array.isArray(y)?y.map(i=>T(i)):[T(y)]}),p=e.watch(V,y=>{if(h(),B.value&&c){u=new ResizeObserver(s);for(const i of y)i&&u.observe(i,t)}},{immediate:!0,flush:"post"}),k=()=>{h(),p()};return q(k),{isSupported:B,stop:k}}const Z=e.defineComponent({__name:"TableHeaderWithTooltip",props:{label:{},placement:{}},setup(d){const s=e.ref(null),m=e.ref(!1),c=()=>{s.value&&(m.value=s.value.scrollWidth>s.value.clientWidth)};return e.onMounted(()=>{c()}),G(s,()=>{c()}),(t,u)=>{const B=e.resolveComponent("el-tooltip");return m.value?(e.openBlock(),e.createBlock(B,{key:1,content:t.label,placement:t.placement||"top"},{default:e.withCtx(()=>[e.createElementVNode("span",{ref_key:"textRef",ref:s,class:"header-cell-content"},e.toDisplayString(t.label),513)]),_:1},8,["content","placement"])):(e.openBlock(),e.createElementBlock("span",{key:0,ref_key:"textRef",ref:s,class:"header-cell-content"},e.toDisplayString(t.label),513))}}}),A=(d,s)=>{const m=d.__vccOpts||d;for(const[c,t]of s)m[c]=t;return m},J=A(Z,[["__scopeId","data-v-d23c8660"]]),K={key:0,class:"search-section-wrapper"},X={class:"flex flex-wrap items-center justify-between gap-4"},Y={class:"flex items-center gap-x-2"},v={class:"flex items-center gap-x-3 action-buttons flex-shrink-0"},ee={class:"table-content-wrapper"},te={key:1},oe={key:0,class:"flex items-center gap-x-2"},le={key:1,class:"pagination-wrapper flex justify-end mt-2"},re={style:{"overflow-y":"auto",flex:"1"}},ae={class:"dialog-footer"},ne={class:"flex items-center"},ie={class:"el-dialog__title"},se={style:{"overflow-y":"auto",flex:"1"}},de={class:"dialog-footer"},ce=A(e.defineComponent({__name:"CrudTable",props:{theme:{type:String,default:"default"},customClass:{type:String,default:""},apiUrlQuery:{type:String,required:!0},apiUrlDetail:{type:String,required:!0},apiUrlCreate:{type:String,required:!0},apiUrlUpdate:{type:String,required:!0},apiUrlDelete:{type:String,required:!0},loadingText:{type:String,default:"加载中…"},loadingBackground:{type:String,default:"rgba(0, 0, 0, 0.3)"},showSearchSection:{type:Boolean,default:!0},showSearchActionButtons:{type:Boolean,default:!0},showSearchButton:{type:Boolean,default:!0},showClearButton:{type:Boolean,default:!0},showNewBtn:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},onBeforeQuery:{type:Function},onAfterQuery:{type:Function},onBeforeOpenDialog:{type:Function},onAfterOpenDialog:{type:Function},onBeforeSubmit:{type:Function},onAfterSubmit:{type:Function},onBeforeDelete:{type:Function},onAfterDelete:{type:Function},showSelectionColumn:{type:Boolean,default:!0},showIndexColumn:{type:Boolean,default:!0},showActionsColumn:{type:Boolean,default:!0},showEditButton:{type:Boolean,default:!0},showDeleteButton:{type:Boolean,default:!0},actionsColumnWidth:{type:[String,Number],default:120},dialogWidth:{type:String,default:"50%"},initialSearchForm:{type:Object,default:()=>({pageNum:1,pageSize:10})},showPagination:{type:Boolean,default:!0},pageSizes:{type:Array,default:()=>[10,20,50,100]},paginationLayout:{type:String,default:"total, sizes, prev, pager, next, jumper"},paginationBackground:{type:Boolean,default:!0},paginationSmall:{type:Boolean,default:!1},paginationHideOnSinglePage:{type:Boolean,default:!1},dialogFormConfig:{type:Array,default:()=>[]},dialogFormRules:{type:Object,default:()=>({})},dialogFormLabelWidth:{type:String,default:120},submitAsFormData:{type:Boolean,default:!1},dialogFullscreen:{type:Boolean,default:!1}},emits:["open-dialog","submit","delete"],setup(d,{expose:s,emit:m}){const c=m,t=d,u=e.computed(()=>["crud-table-wrapper",`theme-${t.theme}`,t.customClass]),B=e.computed(()=>t.theme==="large-screen"?"large-screen-dialog":""),h=(l,o)=>l?!0:(b.ElMessage.error(`${o} prop is required.`),!1),V=async(l,o)=>{try{let n={...o};t.onBeforeSubmit&&(n=await t.onBeforeSubmit(n,l));let g=n;if(t.submitAsFormData){const N=new FormData;for(const C in n)if(Object.prototype.hasOwnProperty.call(n,C)){const D=n[C];N.append(C,D??"")}g=N}if(r.submitting=!0,l==="add"){if(!h(t.apiUrlCreate,"apiUrlCreate"))throw new Error("apiUrlCreate is not configured.");await _.post(t.apiUrlCreate,g),b.ElMessage.success("新增成功")}else{if(!h(t.apiUrlUpdate,"apiUrlUpdate"))throw new Error("apiUrlUpdate is not configured.");await _.put(t.apiUrlUpdate,g),b.ElMessage.success("更新成功")}return t.onAfterSubmit&&t.onAfterSubmit(l,n),c("submit",{mode:l,data:n}),r.visible&&(r.visible=!1),S(),Promise.resolve()}catch(n){return console.error("Submit failed:",n),Promise.reject(n)}finally{r.submitting=!1}},p=e.reactive({pageNum:1,pageSize:10,...t.initialSearchForm}),k=e.ref([]),y=e.ref(0),i=e.ref(!1),f=e.ref([]),r=e.reactive({visible:!1,loading:!1,submitting:!1,mode:"add",data:{},formRef:null}),$=e.computed(()=>r.mode==="add"?"新增":"编辑"),z=e.computed(()=>{if(r.mode==="add")return t.dialogFormConfig.filter(o=>o.prop!=="id");const l=[...t.dialogFormConfig.filter(o=>o.prop!=="id")];return l.some(o=>o.prop==="id")||l.unshift({type:"input-disabled",prop:"id",label:"用户ID"}),l}),S=async()=>{if(h(t.apiUrlQuery,"apiUrlQuery")){i.value=!0;try{let l={...p};t.onBeforeQuery&&(l=await t.onBeforeQuery(l));const o=await _.get(t.apiUrlQuery,{params:l});if(o&&o.data&&Array.isArray(o.data.rows)&&typeof o.data.total=="number"){let n=o.data.rows;t.onAfterQuery&&(n=await t.onAfterQuery(n,l)),k.value=n,y.value=o.data.total}else console.warn("API response is not in the expected { data: { rows: [], total: 0 } } format."),k.value=[],y.value=0}catch(l){console.error("Fetch data failed:",l)}finally{i.value=!1}}},x=()=>{p.pageNum=1,S()},pe=()=>{const{pageNum:l,pageSize:o,...n}=t.initialSearchForm;Object.keys(p).forEach(g=>{g!=="pageNum"&&g!=="pageSize"&&delete p[g]}),Object.assign(p,n),x()},fe=l=>{f.value=l},F=async(l,o)=>{let n;if(l==="add"?n=o?{...o}:{role:"user"}:n={...o},t.onBeforeOpenDialog){const g=await t.onBeforeOpenDialog(l,n);g&&(n=g)}if(r.mode=l,r.visible=!0,l==="edit"){if(!h(t.apiUrlDetail,"apiUrlDetail"))return;r.loading=!0;try{const g=await _.get(t.apiUrlDetail+"/"+n.id.toString());r.data=g.data.data}finally{r.loading=!1,t.onAfterOpenDialog&&t.onAfterOpenDialog(l,r.data),c("open-dialog",{mode:l,data:r.data})}}else r.data=n,t.onAfterOpenDialog&&t.onAfterOpenDialog(l,r.data),c("open-dialog",{mode:l,data:r.data})},O=async()=>{try{r.formRef?await r.formRef.validate():console.warn("Dialog form ref is not available for validation."),await V(r.mode,r.data)}catch(l){console.log("Validation or submit error:",l)}},R=async l=>{if(h(t.apiUrlDelete,"apiUrlDelete"))try{const o=k.value.filter(g=>l.includes(g.id));if(t.onBeforeDelete&&await t.onBeforeDelete(l,o)===!1)return;const n=l.join(",");await _.delete(t.apiUrlDelete+"/"+n.toString()),b.ElMessage.success("删除成功"),t.onAfterDelete&&t.onAfterDelete(l,o),c("delete",l),k.value.length===l.length&&p.pageNum>1&&p.pageNum--,S()}catch(o){console.error("Delete failed",o)}},me=l=>{p.pageSize=l,x()},ge=l=>{p.pageNum=l,S()};return e.onMounted(S),s({refresh:S,search:x,handleDelete:R,openDialog:F,submit:V}),(l,o)=>{const n=e.resolveComponent("el-button"),g=e.resolveComponent("el-form-item"),N=e.resolveComponent("el-form"),C=e.resolveComponent("el-table-column"),D=e.resolveComponent("el-popconfirm"),ue=e.resolveComponent("el-table"),ye=e.resolveComponent("el-pagination"),he=e.resolveComponent("el-skeleton"),P=e.resolveComponent("el-dialog"),ke=e.resolveComponent("el-icon"),we=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([u.value,"crud-table-container"])},[t.showSearchSection?(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(l.$slots,"header",{},void 0,!0),e.createElementVNode("div",X,[e.createVNode(N,{model:p,class:"query-form flex flex-nowrap items-center gap-x-4",style:{"overflow-x":"auto","padding-bottom":"8px"}},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"query-conditions",{searchForm:p},void 0,!0),e.createVNode(g,{class:"!mr-0 flex-shrink-0"},{default:e.withCtx(()=>[e.createElementVNode("div",Y,[e.renderSlot(l.$slots,"query-left",{searchForm:p},void 0,!0),t.showSearchActionButtons?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.showSearchButton?(e.openBlock(),e.createBlock(n,{key:0,color:"#336FFF",onClick:x,loading:i.value},{default:e.withCtx(()=>[...o[8]||(o[8]=[e.createTextVNode("搜索",-1)])]),_:1},8,["loading"])):e.createCommentVNode("",!0),t.showClearButton?(e.openBlock(),e.createBlock(n,{key:1,color:"#336FFF",plain:"",onClick:pe},{default:e.withCtx(()=>[...o[9]||(o[9]=[e.createTextVNode("清空",-1)])]),_:1})):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"query-right",{searchForm:p},void 0,!0)])]),_:3})]),_:3},8,["model"]),e.createElementVNode("div",v,[e.renderSlot(l.$slots,"action-left",{selections:f.value},void 0,!0),e.renderSlot(l.$slots,"add-button-content",{selections:f.value},()=>[t.showNewBtn?(e.openBlock(),e.createBlock(n,{key:0,color:"#336FFF",onClick:o[0]||(o[0]=a=>F("add"))},{default:e.withCtx(()=>[...o[10]||(o[10]=[e.createTextVNode("新增",-1)])]),_:1})):e.createCommentVNode("",!0)],!0),e.renderSlot(l.$slots,"action-right",{selections:f.value},void 0,!0)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",ee,[e.withDirectives((e.openBlock(),e.createBlock(ue,e.mergeProps({data:k.value,"element-loading-text":t.loadingText,"element-loading-background":t.loadingBackground,onSelectionChange:fe},l.$attrs,{height:"100%",style:{width:"100%"}}),{default:e.withCtx(()=>[t.showSelectionColumn?(e.openBlock(),e.createBlock(C,{key:0,type:"selection",width:"55",fixed:""})):e.createCommentVNode("",!0),t.showIndexColumn?(e.openBlock(),e.createBlock(C,{key:1,type:"index",label:"序号",width:"70",fixed:""})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,a=>(e.openBlock(),e.createBlock(C,e.mergeProps({key:a.prop,prop:a.prop,label:a.label,width:a.width,sortable:a.sortable||!1},{ref_for:!0},a.attrs),e.createSlots({header:e.withCtx(()=>[a.headerTooltip?(e.openBlock(),e.createBlock(J,{key:0,label:a.label,placement:a.placement},null,8,["label","placement"])):(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(a.label),1))]),_:2},[a.slot?{name:"default",fn:e.withCtx(E=>[e.renderSlot(l.$slots,a.slot,{row:E.row},void 0,!0)]),key:"0"}:void 0]),1040,["prop","label","width","sortable"]))),128)),t.showActionsColumn?(e.openBlock(),e.createBlock(C,{key:2,label:"操作",width:d.actionsColumnWidth},{default:e.withCtx(a=>[a.row?(e.openBlock(),e.createElementBlock("div",oe,[l.$slots.actions?e.renderSlot(l.$slots,"actions",{key:0,row:a.row},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(l.$slots,"action-before-edit",{row:a.row},void 0,!0),t.showEditButton?(e.openBlock(),e.createBlock(n,{key:0,size:"small",type:"primary",link:"",onClick:E=>F("edit",a.row)},{default:e.withCtx(()=>[...o[11]||(o[11]=[e.createTextVNode("编辑 ",-1)])]),_:1},8,["onClick"])):e.createCommentVNode("",!0),t.showDeleteButton?(e.openBlock(),e.createBlock(D,{key:1,title:"确定要删除这条数据吗?",onConfirm:E=>R([a.row.id]),"confirm-button-text":"确定","cancel-button-text":"取消",width:"200"},{reference:e.withCtx(()=>[e.createVNode(n,{size:"small",type:"danger",link:""},{default:e.withCtx(()=>[...o[12]||(o[12]=[e.createTextVNode("删除",-1)])]),_:1})]),_:1},8,["onConfirm"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"action-after-delete",{row:a.row},void 0,!0)],64))])):e.createCommentVNode("",!0)]),_:3},8,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","element-loading-text","element-loading-background"])),[[we,i.value]])]),t.showPagination&&y.value>0?(e.openBlock(),e.createElementBlock("div",le,[e.createVNode(ye,{"current-page":p.pageNum,"onUpdate:currentPage":o[1]||(o[1]=a=>p.pageNum=a),"page-size":p.pageSize,"onUpdate:pageSize":o[2]||(o[2]=a=>p.pageSize=a),"page-sizes":t.pageSizes,layout:t.paginationLayout,total:y.value,background:t.paginationBackground,small:t.paginationSmall,"hide-on-single-page":t.paginationHideOnSinglePage,onSizeChange:me,onCurrentChange:ge},null,8,["current-page","page-size","page-sizes","layout","total","background","small","hide-on-single-page"])])):e.createCommentVNode("",!0),t.dialogFullscreen?(e.openBlock(),e.createBlock(P,{key:3,modelValue:r.visible,"onUpdate:modelValue":o[7]||(o[7]=a=>r.visible=a),fullscreen:!0,width:t.dialogWidth,"destroy-on-close":!0,modal:!t.dialogFullscreen,"custom-class":B.value,"show-close":!1,style:{display:"flex","flex-direction":"column","max-height":"100vh"}},{header:e.withCtx(()=>[e.createElementVNode("div",ne,[e.createVNode(n,{type:"info",text:"",onClick:o[5]||(o[5]=a=>r.visible=!1),style:{"margin-right":"12px"}},{default:e.withCtx(()=>[e.createVNode(ke,{size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(M))]),_:1})]),_:1}),e.createElementVNode("span",ie,e.toDisplayString($.value),1)])]),footer:e.withCtx(()=>[e.createElementVNode("span",de,[e.createVNode(n,{color:"#336FFF",plain:"",onClick:o[6]||(o[6]=a=>r.visible=!1)},{default:e.withCtx(()=>[...o[15]||(o[15]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(n,{color:"#336FFF",onClick:O,loading:r.submitting},{default:e.withCtx(()=>[...o[16]||(o[16]=[e.createTextVNode(" 确定 ",-1)])]),_:1},8,["loading"])])]),default:e.withCtx(()=>[e.createElementVNode("div",se,[l.$slots["dialog-form"]?e.renderSlot(l.$slots,"dialog-form",{key:0,formData:r.data,mode:r.mode,formRef:a=>{r.formRef=a}},void 0,!0):r.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(U,{key:1,ref:a=>{r.formRef=a},"model-value":r.data,"form-config":z.value,rules:t.dialogFormRules,"label-width":t.dialogFormLabelWidth},null,8,["model-value","form-config","rules","label-width"]))])]),_:3},8,["modelValue","width","modal","custom-class"])):(e.openBlock(),e.createBlock(P,{key:2,modelValue:r.visible,"onUpdate:modelValue":o[4]||(o[4]=a=>r.visible=a),title:$.value,width:t.dialogWidth,"destroy-on-close":!0,"custom-class":B.value,style:{display:"flex","flex-direction":"column","max-height":"80vh"}},{footer:e.withCtx(()=>[e.createElementVNode("span",ae,[e.createVNode(n,{color:"#336FFF",onClick:o[3]||(o[3]=a=>r.visible=!1)},{default:e.withCtx(()=>[...o[13]||(o[13]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(n,{color:"#336FFF",onClick:O,loading:r.submitting},{default:e.withCtx(()=>[...o[14]||(o[14]=[e.createTextVNode(" 确定 ",-1)])]),_:1},8,["loading"])])]),default:e.withCtx(()=>[e.createElementVNode("div",re,[l.$slots["dialog-form"]?e.renderSlot(l.$slots,"dialog-form",{key:0,formData:r.data,mode:r.mode,formRef:a=>{r.formRef=a}},void 0,!0):r.loading?(e.openBlock(),e.createBlock(he,{key:1,rows:5,animated:""})):r.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(U,{key:2,ref:a=>{r.formRef=a},"model-value":r.data,"form-config":z.value,rules:t.dialogFormRules,"label-width":t.dialogFormLabelWidth},null,8,["model-value","form-config","rules","label-width"]))])]),_:3},8,["modelValue","title","width","custom-class"]))],2)}}}),[["__scopeId","data-v-2e055325"]]);w.CrudTable=ce,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.header-cell-content[data-v-d23c8660]{display:inline-block;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.crud-table-container[data-v-b7c9a2a3]{display:flex;flex-direction:column;height:100%;width:100%;min-width:0;min-height:0;overflow:hidden}.search-section-wrapper[data-v-b7c9a2a3]{flex-shrink:0}.table-content-wrapper[data-v-b7c9a2a3]{flex:1;min-height:0;overflow:hidden}.pagination-wrapper[data-v-b7c9a2a3]{flex-shrink:0;padding-top:1rem;display:flex;justify-content:flex-end}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.visible{visibility:visible}.relative{position:relative}.\\!mr-0{margin-right:0!important}.mt-2{margin-top:.5rem}.flex{display:flex}.hidden{display:none}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.gap-4{gap:1rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}body{background-color:#f0f2f5;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;margin:0}#app{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#2c3e50}.crud-container{transition:box-shadow .3s ease-in-out}.crud-container:hover{box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a}.query-form .el-form-item{margin-bottom:0!important}.el-table__expanded-cell{padding:1rem 3.5rem!important;background-color:#f8fafc}.action-buttons>*+*{margin-left:.75rem}.el-dialog__header{border-bottom:none;padding:24px 24px 10px}.el-dialog__title{font-size:1.25rem;font-weight:600}.el-dialog__footer{border-top:none;padding:10px 24px 24px}.el-dialog__body{padding:10px 24px}:root{--large-screen-border-color: rgba(120, 153, 199, 1);--large-screen-text-color: rgba(227, 246, 255, 1);--large-screen-search-bg: rgba(210, 224, 243, .1);--large-screen-button-bg: rgba(38, 120, 255, 1);--large-screen-action-link-color: rgba(39, 233, 255, 1);--large-screen-dialog-bg: #1e293b;--large-screen-hover-bg: rgba(120, 153, 199, .15)}.theme-large-screen{color:var(--large-screen-text-color)}.el-modal-dialog,.el-overlay-dialog{position:absolute!important}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
(function(w,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","axios"],e):(w=typeof globalThis<"u"?globalThis:w||self,e(w.ZCrudTable={},w.Vue,w.ElementPlus,w.axios))})(this,(function(w,e,b,W){"use strict";/*! Element Plus Icons Vue v2.3.2 */var j=e.defineComponent({name:"ArrowLeftBold",__name:"arrow-left-bold",setup(d){return(s,m)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M685.248 104.704a64 64 0 0 1 0 90.496L368.448 512l316.8 316.8a64 64 0 0 1-90.496 90.496L232.704 557.248a64 64 0 0 1 0-90.496l362.048-362.048a64 64 0 0 1 90.496 0"})]))}}),M=j;const T=e.defineComponent({__name:"DynamicForm",props:{modelValue:{},formConfig:{},rules:{}},setup(d,{expose:s}){const m=e.ref(null);return s({validate:()=>{var c;return(c=m.value)==null?void 0:c.validate()}}),(c,t)=>{const u=e.resolveComponent("el-input"),B=e.resolveComponent("el-option"),h=e.resolveComponent("el-select"),S=e.resolveComponent("el-radio"),p=e.resolveComponent("el-radio-group"),k=e.resolveComponent("el-form-item"),y=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(y,e.mergeProps({model:c.modelValue,rules:c.rules,ref_key:"formRef",ref:m},c.$attrs),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.formConfig,i=>(e.openBlock(),e.createBlock(k,{key:i.prop,label:i.label,prop:i.prop},{default:e.withCtx(()=>[i.type==="input"?(e.openBlock(),e.createBlock(u,e.mergeProps({key:0,modelValue:c.modelValue[i.prop],"onUpdate:modelValue":f=>c.modelValue[i.prop]=f},{ref_for:!0},i.componentProps),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),i.type==="textarea"?(e.openBlock(),e.createBlock(u,e.mergeProps({key:1,type:"textarea",modelValue:c.modelValue[i.prop],"onUpdate:modelValue":f=>c.modelValue[i.prop]=f},{ref_for:!0},i.componentProps),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),i.type==="select"?(e.openBlock(),e.createBlock(h,e.mergeProps({key:2,modelValue:c.modelValue[i.prop],"onUpdate:modelValue":f=>c.modelValue[i.prop]=f},{ref_for:!0},i.componentProps),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.options,f=>(e.openBlock(),e.createBlock(B,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),i.type==="radio-group"?(e.openBlock(),e.createBlock(p,e.mergeProps({key:3,modelValue:c.modelValue[i.prop],"onUpdate:modelValue":f=>c.modelValue[i.prop]=f},{ref_for:!0},i.componentProps),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.options,f=>(e.openBlock(),e.createBlock(S,{key:f.value,label:f.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),_:2},1032,["label"]))),128))]),_:2},1040,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),i.type==="input-disabled"?(e.openBlock(),e.createBlock(u,e.mergeProps({key:4,"model-value":c.modelValue[i.prop],disabled:""},{ref_for:!0},i.componentProps),null,16,["model-value"])):e.createCommentVNode("",!0)]),_:2},1032,["label","prop"]))),128))]),_:1},16,["model","rules"])}}}),_=W.create({baseURL:"",timeout:1e4});_.interceptors.request.use(d=>{const s=localStorage.getItem("token");return s&&(d.headers.Authorization="Bearer "+s),d},d=>(console.log(d),Promise.reject(d))),_.interceptors.response.use(d=>{const s=d.data;return s.code!==200?(b.ElMessage({message:s.msg||"Error",type:"error",duration:5*1e3}),(s.code===401||s.code===403)&&b.ElMessageBox.confirm("您的登录状态已失效,请重新登录","确认登出",{confirmButtonText:"重新登录",cancelButtonText:"取消",type:"warning"}).then(()=>{localStorage.removeItem("token"),location.reload()}),Promise.reject(new Error(s.msg||"Error"))):s},d=>(console.log("HTTP Error: "+d),b.ElMessage({message:"网络错误,请检查您的网络连接或联系管理员",type:"error",duration:5*1e3}),Promise.reject(d)));function q(d){return e.getCurrentScope()?(e.onScopeDispose(d),!0):!1}const L=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Q=L?window:void 0;function $(d){var s;const m=e.toValue(d);return(s=m==null?void 0:m.$el)!=null?s:m}function I(){const d=e.shallowRef(!1),s=e.getCurrentInstance();return s&&e.onMounted(()=>{d.value=!0},s),d}function H(d){const s=I();return e.computed(()=>(s.value,!!d()))}function G(d,s,m={}){const{window:c=Q,...t}=m;let u;const B=H(()=>c&&"ResizeObserver"in c),h=()=>{u&&(u.disconnect(),u=void 0)},S=e.computed(()=>{const y=e.toValue(d);return Array.isArray(y)?y.map(i=>$(i)):[$(y)]}),p=e.watch(S,y=>{if(h(),B.value&&c){u=new ResizeObserver(s);for(const i of y)i&&u.observe(i,t)}},{immediate:!0,flush:"post"}),k=()=>{h(),p()};return q(k),{isSupported:B,stop:k}}const Z=e.defineComponent({__name:"TableHeaderWithTooltip",props:{label:{},placement:{}},setup(d){const s=e.ref(null),m=e.ref(!1),c=()=>{s.value&&(m.value=s.value.scrollWidth>s.value.clientWidth)};return e.onMounted(()=>{c()}),G(s,()=>{c()}),(t,u)=>{const B=e.resolveComponent("el-tooltip");return m.value?(e.openBlock(),e.createBlock(B,{key:1,content:t.label,placement:t.placement||"top"},{default:e.withCtx(()=>[e.createElementVNode("span",{ref_key:"textRef",ref:s,class:"header-cell-content"},e.toDisplayString(t.label),513)]),_:1},8,["content","placement"])):(e.openBlock(),e.createElementBlock("span",{key:0,ref_key:"textRef",ref:s,class:"header-cell-content"},e.toDisplayString(t.label),513))}}}),A=(d,s)=>{const m=d.__vccOpts||d;for(const[c,t]of s)m[c]=t;return m},J=A(Z,[["__scopeId","data-v-d23c8660"]]),K={key:0,class:"search-section-wrapper"},X={class:"flex flex-wrap items-center justify-between gap-4"},Y={class:"flex items-center gap-x-2"},v={class:"flex items-center gap-x-3 action-buttons flex-shrink-0"},ee={class:"table-content-wrapper"},te={key:1},oe={key:0,class:"flex items-center gap-x-2"},le={key:1,class:"pagination-wrapper flex justify-end mt-2"},ae={style:{"overflow-y":"auto",flex:"1"}},re={class:"dialog-footer"},ne={class:"flex items-center"},ie={class:"el-dialog__title"},se={style:{"overflow-y":"auto",flex:"1"}},de={class:"dialog-footer"},ce=A(e.defineComponent({__name:"CrudTable",props:{theme:{type:String,default:"default"},customClass:{type:String,default:""},apiUrlQuery:{type:String,required:!0},apiUrlDetail:{type:String,required:!0},apiUrlCreate:{type:String,required:!0},apiUrlUpdate:{type:String,required:!0},apiUrlDelete:{type:String,required:!0},loadingText:{type:String,default:"加载中…"},loadingBackground:{type:String,default:"rgba(0, 0, 0, 0.3)"},showSearchSection:{type:Boolean,default:!0},showSearchActionButtons:{type:Boolean,default:!0},showSearchButton:{type:Boolean,default:!0},showClearButton:{type:Boolean,default:!0},showNewBtn:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},onBeforeQuery:{type:Function},onAfterQuery:{type:Function},onBeforeOpenDialog:{type:Function},onAfterOpenDialog:{type:Function},onBeforeSubmit:{type:Function},onAfterSubmit:{type:Function},onBeforeDelete:{type:Function},onAfterDelete:{type:Function},showSelectionColumn:{type:Boolean,default:!0},showIndexColumn:{type:Boolean,default:!0},showActionsColumn:{type:Boolean,default:!0},showEditButton:{type:Boolean,default:!0},showDeleteButton:{type:Boolean,default:!0},actionsColumnWidth:{type:[String,Number],default:120},dialogWidth:{type:String,default:"50%"},initialSearchForm:{type:Object,default:()=>({pageNum:1,pageSize:10})},showPagination:{type:Boolean,default:!0},pageSizes:{type:Array,default:()=>[10,20,50,100]},paginationLayout:{type:String,default:"total, sizes, prev, pager, next, jumper"},paginationBackground:{type:Boolean,default:!0},paginationSmall:{type:Boolean,default:!1},paginationHideOnSinglePage:{type:Boolean,default:!1},dialogFormConfig:{type:Array,default:()=>[]},dialogFormRules:{type:Object,default:()=>({})},dialogFormLabelWidth:{type:String,default:120},submitAsFormData:{type:Boolean,default:!1},dialogFullscreen:{type:Boolean,default:!1},addDialogTitle:{type:String,default:"新增"},editDialogTitle:{type:String,default:"编辑"}},emits:["open-dialog","submit","delete"],setup(d,{expose:s,emit:m}){const c=m,t=d,u=e.computed(()=>["crud-table-wrapper",`theme-${t.theme}`,t.customClass]),B=e.computed(()=>t.theme==="large-screen"?"large-screen-dialog":""),h=(o,l)=>o?!0:(b.ElMessage.error(`${l} prop is required.`),!1),S=async(o,l)=>{try{let n={...l};t.onBeforeSubmit&&(n=await t.onBeforeSubmit(n,o));let g=n;if(t.submitAsFormData){const D=new FormData;for(const C in n)if(Object.prototype.hasOwnProperty.call(n,C)){const E=n[C];D.append(C,E??"")}g=D}if(a.submitting=!0,o==="add"){if(!h(t.apiUrlCreate,"apiUrlCreate"))throw new Error("apiUrlCreate is not configured.");await _.post(t.apiUrlCreate,g),b.ElMessage.success("新增成功")}else{if(!h(t.apiUrlUpdate,"apiUrlUpdate"))throw new Error("apiUrlUpdate is not configured.");await _.put(t.apiUrlUpdate,g),b.ElMessage.success("更新成功")}return t.onAfterSubmit&&t.onAfterSubmit(o,n),c("submit",{mode:o,data:n}),a.visible&&(a.visible=!1),V(),Promise.resolve()}catch(n){return console.error("Submit failed:",n),Promise.reject(n)}finally{a.submitting=!1}},p=e.reactive({pageNum:1,pageSize:10,...t.initialSearchForm}),k=e.ref([]),y=e.ref(0),i=e.ref(!1),f=e.ref([]),a=e.reactive({visible:!1,loading:!1,submitting:!1,mode:"add",data:{},formRef:null}),z=e.computed(()=>a.mode==="add"?t.addDialogTitle:t.editDialogTitle),O=e.computed(()=>{if(a.mode==="add")return t.dialogFormConfig.filter(l=>l.prop!=="id");const o=[...t.dialogFormConfig.filter(l=>l.prop!=="id")];return o.some(l=>l.prop==="id")||o.unshift({type:"input-disabled",prop:"id",label:"用户ID"}),o}),V=async()=>{if(h(t.apiUrlQuery,"apiUrlQuery")){i.value=!0;try{let o={...p};t.onBeforeQuery&&(o=await t.onBeforeQuery(o));const l=await _.get(t.apiUrlQuery,{params:o});if(l&&l.data&&Array.isArray(l.data.rows)&&typeof l.data.total=="number"){let n=l.data.rows;t.onAfterQuery&&(n=await t.onAfterQuery(n,o)),k.value=n,y.value=l.data.total}else console.warn("API response is not in the expected { data: { rows: [], total: 0 } } format."),k.value=[],y.value=0}catch(o){console.error("Fetch data failed:",o)}finally{i.value=!1}}},x=()=>{p.pageNum=1,V()},pe=()=>{const{pageNum:o,pageSize:l,...n}=t.initialSearchForm;Object.keys(p).forEach(g=>{g!=="pageNum"&&g!=="pageSize"&&delete p[g]}),Object.assign(p,n),x()},fe=o=>{f.value=o},F=async(o,l)=>{let n;if(o==="add"?n=l?{...l}:{role:"user"}:n={...l},t.onBeforeOpenDialog){const g=await t.onBeforeOpenDialog(o,n);g&&(n=g)}if(a.mode=o,a.visible=!0,o==="edit"){if(!h(t.apiUrlDetail,"apiUrlDetail"))return;a.loading=!0;try{const g=await _.get(t.apiUrlDetail+"/"+n.id.toString());a.data=g.data.data}finally{a.loading=!1,t.onAfterOpenDialog&&t.onAfterOpenDialog(o,a.data),c("open-dialog",{mode:o,data:a.data})}}else a.data=n,t.onAfterOpenDialog&&t.onAfterOpenDialog(o,a.data),c("open-dialog",{mode:o,data:a.data})},N=async()=>{try{a.formRef?await a.formRef.validate():console.warn("Dialog form ref is not available for validation."),await S(a.mode,a.data)}catch(o){console.log("Validation or submit error:",o)}},R=async o=>{if(h(t.apiUrlDelete,"apiUrlDelete"))try{const l=k.value.filter(g=>o.includes(g.id));if(t.onBeforeDelete&&await t.onBeforeDelete(o,l)===!1)return;const n=o.join(",");await _.delete(t.apiUrlDelete+"/"+n.toString()),b.ElMessage.success("删除成功"),t.onAfterDelete&&t.onAfterDelete(o,l),c("delete",o),k.value.length===o.length&&p.pageNum>1&&p.pageNum--,V()}catch(l){console.error("Delete failed",l)}},me=o=>{p.pageSize=o,x()},ge=o=>{p.pageNum=o,V()};return e.onMounted(V),s({refresh:V,search:x,handleDelete:R,openDialog:F,submit:S,closeDialog:()=>{a.visible=!1}}),(o,l)=>{const n=e.resolveComponent("el-button"),g=e.resolveComponent("el-form-item"),D=e.resolveComponent("el-form"),C=e.resolveComponent("el-table-column"),E=e.resolveComponent("el-popconfirm"),ue=e.resolveComponent("el-table"),ye=e.resolveComponent("el-pagination"),he=e.resolveComponent("el-skeleton"),P=e.resolveComponent("el-dialog"),ke=e.resolveComponent("el-icon"),we=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([u.value,"crud-table-container"])},[t.showSearchSection?(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(o.$slots,"header",{},void 0,!0),e.createElementVNode("div",X,[e.createVNode(D,{model:p,class:"query-form flex flex-nowrap items-center gap-x-4",style:{"overflow-x":"auto","padding-bottom":"8px"}},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"query-conditions",{searchForm:p},void 0,!0),e.createVNode(g,{class:"!mr-0 flex-shrink-0"},{default:e.withCtx(()=>[e.createElementVNode("div",Y,[e.renderSlot(o.$slots,"query-left",{searchForm:p},void 0,!0),t.showSearchActionButtons?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.showSearchButton?(e.openBlock(),e.createBlock(n,{key:0,color:"#336FFF",onClick:x,loading:i.value},{default:e.withCtx(()=>[...l[8]||(l[8]=[e.createTextVNode("搜索",-1)])]),_:1},8,["loading"])):e.createCommentVNode("",!0),t.showClearButton?(e.openBlock(),e.createBlock(n,{key:1,color:"#336FFF",plain:"",onClick:pe},{default:e.withCtx(()=>[...l[9]||(l[9]=[e.createTextVNode("清空",-1)])]),_:1})):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"query-right",{searchForm:p},void 0,!0)])]),_:3})]),_:3},8,["model"]),e.createElementVNode("div",v,[e.renderSlot(o.$slots,"action-left",{selections:f.value},void 0,!0),e.renderSlot(o.$slots,"add-button-content",{selections:f.value},()=>[t.showNewBtn?(e.openBlock(),e.createBlock(n,{key:0,color:"#336FFF",onClick:l[0]||(l[0]=r=>F("add"))},{default:e.withCtx(()=>[...l[10]||(l[10]=[e.createTextVNode("新增",-1)])]),_:1})):e.createCommentVNode("",!0)],!0),e.renderSlot(o.$slots,"action-right",{selections:f.value},void 0,!0)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",ee,[e.withDirectives((e.openBlock(),e.createBlock(ue,e.mergeProps({data:k.value,"element-loading-text":t.loadingText,"element-loading-background":t.loadingBackground,onSelectionChange:fe},o.$attrs,{height:"100%",style:{width:"100%"}}),{default:e.withCtx(()=>[t.showSelectionColumn?(e.openBlock(),e.createBlock(C,{key:0,type:"selection",width:"55",fixed:""})):e.createCommentVNode("",!0),t.showIndexColumn?(e.openBlock(),e.createBlock(C,{key:1,type:"index",label:"序号",width:"70",fixed:""})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,r=>(e.openBlock(),e.createBlock(C,e.mergeProps({key:r.prop,prop:r.prop,label:r.label,width:r.width,sortable:r.sortable||!1},{ref_for:!0},r.attrs),e.createSlots({header:e.withCtx(()=>[r.headerTooltip?(e.openBlock(),e.createBlock(J,{key:0,label:r.label,placement:r.placement},null,8,["label","placement"])):(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(r.label),1))]),_:2},[r.slot?{name:"default",fn:e.withCtx(U=>[e.renderSlot(o.$slots,r.slot,{row:U.row},void 0,!0)]),key:"0"}:void 0]),1040,["prop","label","width","sortable"]))),128)),t.showActionsColumn?(e.openBlock(),e.createBlock(C,{key:2,label:"操作",width:d.actionsColumnWidth},{default:e.withCtx(r=>[r.row?(e.openBlock(),e.createElementBlock("div",oe,[o.$slots.actions?e.renderSlot(o.$slots,"actions",{key:0,row:r.row},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(o.$slots,"action-before-edit",{row:r.row},void 0,!0),t.showEditButton?(e.openBlock(),e.createBlock(n,{key:0,size:"small",type:"primary",link:"",onClick:U=>F("edit",r.row)},{default:e.withCtx(()=>[...l[11]||(l[11]=[e.createTextVNode("编辑 ",-1)])]),_:1},8,["onClick"])):e.createCommentVNode("",!0),t.showDeleteButton?(e.openBlock(),e.createBlock(E,{key:1,title:"确定要删除这条数据吗?",onConfirm:U=>R([r.row.id]),"confirm-button-text":"确定","cancel-button-text":"取消",width:"200"},{reference:e.withCtx(()=>[e.createVNode(n,{size:"small",type:"danger",link:""},{default:e.withCtx(()=>[...l[12]||(l[12]=[e.createTextVNode("删除",-1)])]),_:1})]),_:1},8,["onConfirm"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"action-after-delete",{row:r.row},void 0,!0)],64))])):e.createCommentVNode("",!0)]),_:3},8,["width"])):e.createCommentVNode("",!0)]),_:3},16,["data","element-loading-text","element-loading-background"])),[[we,i.value]])]),t.showPagination&&y.value>0?(e.openBlock(),e.createElementBlock("div",le,[e.createVNode(ye,{"current-page":p.pageNum,"onUpdate:currentPage":l[1]||(l[1]=r=>p.pageNum=r),"page-size":p.pageSize,"onUpdate:pageSize":l[2]||(l[2]=r=>p.pageSize=r),"page-sizes":t.pageSizes,layout:t.paginationLayout,total:y.value,background:t.paginationBackground,small:t.paginationSmall,"hide-on-single-page":t.paginationHideOnSinglePage,onSizeChange:me,onCurrentChange:ge},null,8,["current-page","page-size","page-sizes","layout","total","background","small","hide-on-single-page"])])):e.createCommentVNode("",!0),t.dialogFullscreen?(e.openBlock(),e.createBlock(P,{key:3,modelValue:a.visible,"onUpdate:modelValue":l[7]||(l[7]=r=>a.visible=r),fullscreen:!0,width:t.dialogWidth,"destroy-on-close":!0,modal:!t.dialogFullscreen,"custom-class":B.value,"show-close":!1,style:{display:"flex","flex-direction":"column","max-height":"100vh"}},{header:e.withCtx(()=>[e.createElementVNode("div",ne,[e.createVNode(n,{type:"info",text:"",onClick:l[5]||(l[5]=r=>a.visible=!1),style:{"margin-right":"12px"}},{default:e.withCtx(()=>[e.createVNode(ke,{size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(M))]),_:1})]),_:1}),e.createElementVNode("span",ie,e.toDisplayString(z.value),1)])]),footer:e.withCtx(()=>[e.renderSlot(o.$slots,"dialog-footer",{dialog:a,submit:N,cancel:()=>a.visible=!1},()=>[e.createElementVNode("span",de,[e.createVNode(n,{color:"#336FFF",plain:"",onClick:l[6]||(l[6]=r=>a.visible=!1)},{default:e.withCtx(()=>[...l[15]||(l[15]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(n,{color:"#336FFF",onClick:N,loading:a.submitting},{default:e.withCtx(()=>[...l[16]||(l[16]=[e.createTextVNode(" 确定 ",-1)])]),_:1},8,["loading"])])],!0)]),default:e.withCtx(()=>[e.createElementVNode("div",se,[o.$slots["dialog-form"]?e.renderSlot(o.$slots,"dialog-form",{key:0,formData:a.data,mode:a.mode,formRef:r=>{a.formRef=r}},void 0,!0):a.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T,{key:1,ref:r=>{a.formRef=r},"model-value":a.data,"form-config":O.value,rules:t.dialogFormRules,"label-width":t.dialogFormLabelWidth},null,8,["model-value","form-config","rules","label-width"]))])]),_:3},8,["modelValue","width","modal","custom-class"])):(e.openBlock(),e.createBlock(P,{key:2,modelValue:a.visible,"onUpdate:modelValue":l[4]||(l[4]=r=>a.visible=r),title:z.value,width:t.dialogWidth,"destroy-on-close":!0,"custom-class":B.value,style:{display:"flex","flex-direction":"column","max-height":"80vh"}},{footer:e.withCtx(()=>[e.renderSlot(o.$slots,"dialog-footer",{dialog:a,submit:N,cancel:()=>a.visible=!1},()=>[e.createElementVNode("span",re,[e.createVNode(n,{color:"#336FFF",onClick:l[3]||(l[3]=r=>a.visible=!1)},{default:e.withCtx(()=>[...l[13]||(l[13]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(n,{color:"#336FFF",onClick:N,loading:a.submitting},{default:e.withCtx(()=>[...l[14]||(l[14]=[e.createTextVNode(" 确定 ",-1)])]),_:1},8,["loading"])])],!0)]),default:e.withCtx(()=>[e.createElementVNode("div",ae,[o.$slots["dialog-form"]?e.renderSlot(o.$slots,"dialog-form",{key:0,formData:a.data,mode:a.mode,formRef:r=>{a.formRef=r}},void 0,!0):a.loading?(e.openBlock(),e.createBlock(he,{key:1,rows:5,animated:""})):a.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T,{key:2,ref:r=>{a.formRef=r},"model-value":a.data,"form-config":O.value,rules:t.dialogFormRules,"label-width":t.dialogFormLabelWidth},null,8,["model-value","form-config","rules","label-width"]))])]),_:3},8,["modelValue","title","width","custom-class"]))],2)}}}),[["__scopeId","data-v-b7c9a2a3"]]);w.CrudTable=ce,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})}));
|