ling-yun-custom-components 0.0.65 → 0.0.67

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.
Files changed (35) hide show
  1. package/es/PluginDetail.mjs +124 -128
  2. package/es/assets/PluginDetail.css +1 -1
  3. package/es/chunks/AppIntro.DubEs5q_.js +431 -0
  4. package/es/chunks/BuildComponents.Bu-jJtCo.js +203 -0
  5. package/es/chunks/CustomDialog.T0DjhxY4.js +5 -0
  6. package/es/chunks/CustomDropdown.BoSVXB8_.js +132 -0
  7. package/es/chunks/CustomPagination.D26A7iFP.js +5 -0
  8. package/es/chunks/CustomTab.BCs2BQZr.js +52 -0
  9. package/es/chunks/GradientButton.BVlXDphQ.js +91 -0
  10. package/es/chunks/PageNotFound.CLFUj6wN.js +31 -0
  11. package/es/chunks/PaginationTable.DCYPUxcZ.js +357 -0
  12. package/es/chunks/PluginDetail.CV8dYPPL.js +223 -0
  13. package/es/chunks/UpdatePasswordDialog.CkKA35QX.js +110 -0
  14. package/es/chunks/_plugin-vue_export-helper.Cf-_TWPK.js +6 -0
  15. package/es/chunks/layout.BqQQsRMO.js +95 -0
  16. package/es/chunks/layout.BuyWf5hx.js +189 -0
  17. package/es/chunks/utils.BhlZXNZ6.js +19 -0
  18. package/lib/PluginDetail.js +1 -1
  19. package/lib/assets/PluginDetail.css +1 -1
  20. package/lib/chunks/AppIntro.CIDfpAQM.js +1 -0
  21. package/lib/chunks/BuildComponents.CmF7gV_k.js +1 -0
  22. package/lib/chunks/CustomDialog.lBdGLThM.js +1 -0
  23. package/lib/chunks/CustomDropdown.DS2fIdjY.js +1 -0
  24. package/lib/chunks/CustomPagination.Cyej-_3r.js +1 -0
  25. package/lib/chunks/CustomTab.DccrszIL.js +1 -0
  26. package/lib/chunks/GradientButton.DVbHjYJL.js +1 -0
  27. package/lib/chunks/PageNotFound.DWUdrtNX.js +1 -0
  28. package/lib/chunks/PaginationTable.BfbaK5Og.js +1 -0
  29. package/lib/chunks/PluginDetail.BUfKJRob.js +1 -0
  30. package/lib/chunks/UpdatePasswordDialog.B-POajDC.js +1 -0
  31. package/lib/chunks/_plugin-vue_export-helper.C55-DZV2.js +1 -0
  32. package/lib/chunks/layout.C5f-mOl4.js +1 -0
  33. package/lib/chunks/layout.uCgAET3T.js +1 -0
  34. package/lib/chunks/utils.BT5Uuz2Q.js +1 -0
  35. package/package.json +10 -10
@@ -0,0 +1,5 @@
1
+ import { t as withInstall } from "./utils.BhlZXNZ6.js";
2
+ import { t as layout_default } from "./layout.BuyWf5hx.js";
3
+ const CustomDialog = withInstall(layout_default);
4
+ var CustomDialog_default = CustomDialog;
5
+ export { CustomDialog_default as n, CustomDialog as t };
@@ -0,0 +1,132 @@
1
+ import { t as withInstall } from "./utils.BhlZXNZ6.js";
2
+ import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.Cf-_TWPK.js";
3
+ import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, mergeProps, openBlock, renderList, renderSlot, toDisplayString, unref, withCtx } from "vue";
4
+ import { ElDropdown, ElDropdownItem, ElDropdownMenu, ElIcon } from "element-plus";
5
+ import { IconDown } from "color-message-lingyun-vue";
6
+ import { emitsMap } from "color-star-custom-methods";
7
+ import '../assets/CustomDropdown.css';var _hoisted_1 = { class: "custom-dropdown-trigger" };
8
+ const CustomDropdown = withInstall(/* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "CustomDropdown" }, {
9
+ __name: "layout",
10
+ props: {
11
+ trigger: {
12
+ type: String,
13
+ default: "click",
14
+ validator: (e) => [
15
+ "hover",
16
+ "click",
17
+ "contextmenu"
18
+ ].includes(e)
19
+ },
20
+ placement: {
21
+ type: String,
22
+ default: "bottom-start",
23
+ validator: (e) => [
24
+ "top",
25
+ "top-start",
26
+ "top-end",
27
+ "bottom",
28
+ "bottom-start",
29
+ "bottom-end",
30
+ "left",
31
+ "left-start",
32
+ "left-end",
33
+ "right",
34
+ "right-start",
35
+ "right-end"
36
+ ].includes(e)
37
+ },
38
+ disabled: {
39
+ type: Boolean,
40
+ default: !1
41
+ },
42
+ hideOnClick: {
43
+ type: Boolean,
44
+ default: !0
45
+ },
46
+ showTimeout: {
47
+ type: Number,
48
+ default: 250
49
+ },
50
+ hideTimeout: {
51
+ type: Number,
52
+ default: 150
53
+ },
54
+ items: {
55
+ type: Array,
56
+ default: () => []
57
+ },
58
+ placeholder: {
59
+ type: String,
60
+ default: "请选择"
61
+ },
62
+ modelValue: {
63
+ type: [
64
+ String,
65
+ Number,
66
+ Object
67
+ ],
68
+ default: null
69
+ }
70
+ },
71
+ emits: [
72
+ emitsMap.change,
73
+ emitsMap.updateModelValue,
74
+ emitsMap.command,
75
+ emitsMap.visibleChange,
76
+ emitsMap.click
77
+ ],
78
+ setup(e, { expose: b, emit: S }) {
79
+ let C = e, w = S, T = (e) => {
80
+ let b = C.items.find((b) => b.command === e || b.value === e || b === e);
81
+ w(emitsMap.change, e, b), w(emitsMap.updateModelValue, e, b), w(emitsMap.command, e, b);
82
+ }, E = (e) => {
83
+ w(emitsMap.visibleChange, e);
84
+ }, D = () => {
85
+ w(emitsMap.click);
86
+ };
87
+ return b({ handleCommand: T }), (b, x) => (openBlock(), createBlock(unref(ElDropdown), mergeProps({
88
+ trigger: e.trigger,
89
+ placement: e.placement,
90
+ disabled: e.disabled,
91
+ "hide-on-click": e.hideOnClick,
92
+ "show-timeout": e.showTimeout,
93
+ "hide-timeout": e.hideTimeout,
94
+ onCommand: T,
95
+ onVisibleChange: E,
96
+ onClick: D
97
+ }, b.$attrs), {
98
+ dropdown: withCtx(() => [createVNode(unref(ElDropdownMenu), null, {
99
+ default: withCtx(() => [renderSlot(b.$slots, "dropdown", {}, () => [e.items && e.items.length > 0 ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(e.items, (e, b) => (openBlock(), createBlock(unref(ElDropdownItem), {
100
+ key: e.key || b,
101
+ command: e.command || e.value || e,
102
+ disabled: e.disabled,
103
+ divided: e.divided,
104
+ icon: e.icon
105
+ }, {
106
+ default: withCtx(() => [createElementVNode("span", null, toDisplayString(e.label || e.text || e), 1)]),
107
+ _: 2
108
+ }, 1032, [
109
+ "command",
110
+ "disabled",
111
+ "divided",
112
+ "icon"
113
+ ]))), 128)) : createCommentVNode("", !0)], !0)]),
114
+ _: 3
115
+ })]),
116
+ default: withCtx(() => [renderSlot(b.$slots, "default", {}, () => [createElementVNode("div", _hoisted_1, [createElementVNode("span", null, toDisplayString(e.placeholder), 1), createVNode(unref(ElIcon), { class: "dropdown-icon" }, {
117
+ default: withCtx(() => [createVNode(unref(IconDown))]),
118
+ _: 1
119
+ })])], !0)]),
120
+ _: 3
121
+ }, 16, [
122
+ "trigger",
123
+ "placement",
124
+ "disabled",
125
+ "hide-on-click",
126
+ "show-timeout",
127
+ "hide-timeout"
128
+ ]));
129
+ }
130
+ }), [["__scopeId", "data-v-41e8a5ad"]]));
131
+ var CustomDropdown_default = CustomDropdown;
132
+ export { CustomDropdown_default as n, CustomDropdown as t };
@@ -0,0 +1,5 @@
1
+ import { t as withInstall } from "./utils.BhlZXNZ6.js";
2
+ import { t as layout_default } from "./layout.BqQQsRMO.js";
3
+ const CustomPagination = withInstall(layout_default);
4
+ var CustomPagination_default = CustomPagination;
5
+ export { CustomPagination_default as n, CustomPagination as t };
@@ -0,0 +1,52 @@
1
+ import { t as withInstall } from "./utils.BhlZXNZ6.js";
2
+ import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.Cf-_TWPK.js";
3
+ import { Fragment, computed, createBlock, createElementBlock, createSlots, guardReactiveProps, mergeModels, mergeProps, normalizeProps, openBlock, renderList, renderSlot, unref, useAttrs, useModel, useSlots, withCtx } from "vue";
4
+ import { ElTabPane, ElTabs } from "element-plus";
5
+ import '../assets/CustomTab.css';const CustomTab = withInstall(/* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "CustomTab" }, {
6
+ __name: "layout",
7
+ props: /* @__PURE__ */ mergeModels({
8
+ list: {
9
+ type: Array,
10
+ default: () => []
11
+ },
12
+ keyConfig: {
13
+ type: Object,
14
+ default: () => ({
15
+ label: "label",
16
+ name: "name"
17
+ })
18
+ }
19
+ }, {
20
+ modelValue: {
21
+ type: String,
22
+ default: ""
23
+ },
24
+ modelModifiers: {}
25
+ }),
26
+ emits: ["update:modelValue"],
27
+ setup(e) {
28
+ let _ = e, b = {
29
+ label: "label",
30
+ name: "name"
31
+ }, x = useModel(e, "modelValue"), S = computed(() => ({
32
+ ...b,
33
+ ..._.keyConfig
34
+ })), C = useAttrs(), w = useSlots();
35
+ return (_, y) => (openBlock(), createBlock(unref(ElTabs), mergeProps({
36
+ modelValue: x.value,
37
+ "onUpdate:modelValue": y[0] ||= (e) => x.value = e
38
+ }, unref(C), { type: "card" }), createSlots({
39
+ default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(e.list, (e) => (openBlock(), createBlock(unref(ElTabPane), {
40
+ key: e[S.value.name],
41
+ label: e[S.value.label],
42
+ name: e[S.value.name]
43
+ }, null, 8, ["label", "name"]))), 128))]),
44
+ _: 2
45
+ }, [renderList(unref(w), (e, v) => ({
46
+ name: v,
47
+ fn: withCtx((e) => [renderSlot(_.$slots, v, normalizeProps(guardReactiveProps(e)), void 0, !0)])
48
+ }))]), 1040, ["modelValue"]));
49
+ }
50
+ }), [["__scopeId", "data-v-b3162d3e"]]));
51
+ var CustomTab_default = CustomTab;
52
+ export { CustomTab_default as n, CustomTab as t };
@@ -0,0 +1,91 @@
1
+ import { t as withInstall } from "./utils.BhlZXNZ6.js";
2
+ import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.Cf-_TWPK.js";
3
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, openBlock, renderList, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
4
+ import { ElIcon } from "element-plus";
5
+ import { IconAdd } from "color-message-lingyun-vue";
6
+ import { textDirection } from "color-star-custom-methods";
7
+ import '../assets/GradientButton.css';const GradientButton = withInstall(/* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "GradientButton" }, {
8
+ __name: "layout",
9
+ props: {
10
+ text: {
11
+ type: Object,
12
+ default: () => ({})
13
+ },
14
+ button: {
15
+ type: Object,
16
+ default: () => ({})
17
+ },
18
+ direction: {
19
+ type: String,
20
+ default: textDirection.horizontal
21
+ },
22
+ icon: {
23
+ type: Object,
24
+ default: IconAdd
25
+ }
26
+ },
27
+ setup(e) {
28
+ let h = e, v = computed(() => (h.text.content || "").split("") || []), y = computed(() => {
29
+ let { gradientColors: e, borderRadius: g } = h.button;
30
+ return {
31
+ background: `linear-gradient(180deg, ${e?.[0]}, ${e?.[1]})`,
32
+ borderRadius: `${g}px`
33
+ };
34
+ }), b = computed(() => {
35
+ let { borderRadius: e, padding: g, background: _ } = h.button;
36
+ return {
37
+ borderRadius: `${e}px`,
38
+ padding: g,
39
+ background: _
40
+ };
41
+ }), x = computed(() => ({
42
+ "flex items-center justify-center overflow-hidden": !0,
43
+ "flex-col": h.direction === textDirection.vertical
44
+ })), S = computed(() => {
45
+ let { gradientColors: e, color: g } = h.text;
46
+ return e?.[0] || g;
47
+ }), C = computed(() => {
48
+ let { gradientColors: e, fontSize: g, color: _ } = h.text;
49
+ return {
50
+ background: e?.length ? `linear-gradient(180deg, ${e?.[0]}, ${e?.[1]})` : "transparent",
51
+ fontSize: `${g}px`,
52
+ color: _,
53
+ ...e?.length ? {
54
+ backgroundClip: "text",
55
+ WebkitBackgroundClip: "text",
56
+ WebkitTextFillColor: "transparent"
57
+ } : {}
58
+ };
59
+ });
60
+ return (h, _) => (openBlock(), createElementBlock("div", {
61
+ class: "gradient-btn pointer overflow-hidden",
62
+ style: normalizeStyle(y.value)
63
+ }, [createElementVNode("div", {
64
+ class: "gradient-btn-content overflow-hidden",
65
+ style: normalizeStyle(b.value)
66
+ }, [createElementVNode("div", { class: normalizeClass(x.value) }, [e.icon ? (openBlock(), createBlock(unref(ElIcon), {
67
+ key: 0,
68
+ size: e.text.fontSize,
69
+ color: S.value,
70
+ class: normalizeClass({
71
+ "mg-r-4": e.direction === unref(textDirection).horizontal,
72
+ "mg-b-4": e.direction === unref(textDirection).vertical
73
+ })
74
+ }, {
75
+ default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(e.icon)))]),
76
+ _: 1
77
+ }, 8, [
78
+ "size",
79
+ "color",
80
+ "class"
81
+ ])) : createCommentVNode("", !0), v.value?.length ? (openBlock(), createElementBlock("div", {
82
+ key: 1,
83
+ class: normalizeClass(["overflow-hidden flex", { "flex-col": e.direction === unref(textDirection).vertical }])
84
+ }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(v.value, (e) => (openBlock(), createElementBlock("div", {
85
+ style: normalizeStyle(C.value),
86
+ key: e
87
+ }, toDisplayString(e), 5))), 128))], 2)) : createCommentVNode("", !0)], 2)], 4)], 4));
88
+ }
89
+ }), [["__scopeId", "data-v-340820c2"]]));
90
+ var GradientButton_default = GradientButton;
91
+ export { GradientButton_default as n, GradientButton as t };
@@ -0,0 +1,31 @@
1
+ import { t as withInstall } from "./utils.BhlZXNZ6.js";
2
+ import { createElementBlock, createElementVNode, createTextVNode, createVNode, openBlock, unref, withCtx } from "vue";
3
+ import { ElButton, ElIcon } from "element-plus";
4
+ import { IconBack, Page404 } from "color-message-lingyun-vue";
5
+ var _hoisted_1 = { class: "page-not-found flex flex-col items-center justify-center h-full w-full overflow-hidden" };
6
+ const PageNotFound = withInstall(/* @__PURE__ */ Object.assign({ name: "PageNotFound" }, {
7
+ __name: "layout",
8
+ setup(e) {
9
+ let p = () => {
10
+ let e = window?.$wujie?.props?.useRouter();
11
+ e && e?.push?.(window?.$wujie?.props?.firstSubMenu?.path);
12
+ };
13
+ return (e, m) => (openBlock(), createElementBlock("div", _hoisted_1, [
14
+ createVNode(unref(ElIcon), { size: 140 }, {
15
+ default: withCtx(() => [createVNode(unref(Page404))]),
16
+ _: 1
17
+ }),
18
+ m[1] ||= createElementVNode("div", { class: "pd-b-20 fz-16 text-666" }, "啊哦,你访问的页面不存在了", -1),
19
+ createVNode(unref(ElButton), {
20
+ onClick: p,
21
+ type: "primary",
22
+ icon: unref(IconBack)
23
+ }, {
24
+ default: withCtx(() => [...m[0] ||= [createTextVNode("返回", -1)]]),
25
+ _: 1
26
+ }, 8, ["icon"])
27
+ ]));
28
+ }
29
+ }));
30
+ var PageNotFound_default = PageNotFound;
31
+ export { PageNotFound_default as n, PageNotFound as t };
@@ -0,0 +1,357 @@
1
+ import { t as withInstall } from "./utils.BhlZXNZ6.js";
2
+ import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.Cf-_TWPK.js";
3
+ import { t as layout_default$1 } from "./layout.BqQQsRMO.js";
4
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, guardReactiveProps, h, nextTick, normalizeProps, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useSlots, watch, withCtx } from "vue";
5
+ import { ElAutoResizer, ElButton, ElCheckbox, ElTableV2 } from "element-plus";
6
+ import { calculateScale, emitsMap, paginationConfig } from "color-star-custom-methods";
7
+ import { cloneDeep } from "lodash";
8
+ import '../assets/PaginationTable.css';var _hoisted_1 = { class: "flex h-full flex-col" }, _hoisted_2 = {
9
+ class: "w-full flex justify-between overflow-hidden",
10
+ style: { height: "auto" }
11
+ }, _hoisted_3 = {
12
+ key: 0,
13
+ class: "flex-1 overflow-hidden"
14
+ }, _hoisted_4 = {
15
+ class: "flex",
16
+ style: {
17
+ width: "auto",
18
+ gap: "10px"
19
+ }
20
+ }, _hoisted_5 = {
21
+ key: 1,
22
+ class: "flex items-center mg-b-18"
23
+ }, _hoisted_6 = { class: "fz-12 text-74798c" }, _hoisted_7 = { class: "btn-group mg-l-12" }, _hoisted_8 = { class: "w-full flex-1 overflow-hidden flex flex-col" }, _hoisted_9 = { class: "flex-1 overflow-hidden TABLE-AREA" }, _hoisted_10 = {
24
+ key: 0,
25
+ class: "flex justify-end mg-t-20",
26
+ style: { height: "auto" }
27
+ };
28
+ const PaginationTable = withInstall(/* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "PaginationTable" }, {
29
+ __name: "layout",
30
+ props: {
31
+ isPagination: {
32
+ type: Boolean,
33
+ default: !0
34
+ },
35
+ total: {
36
+ type: Number,
37
+ default: 0
38
+ },
39
+ tableData: {
40
+ type: Array,
41
+ default: () => []
42
+ },
43
+ pagination: {
44
+ type: Object,
45
+ default: () => paginationConfig
46
+ },
47
+ params: {
48
+ type: Object,
49
+ default: () => {}
50
+ },
51
+ requestFn: { type: Function },
52
+ columns: {
53
+ type: Array,
54
+ default: () => []
55
+ },
56
+ hasBatchSelect: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ expandColumnKey: {
61
+ type: String,
62
+ default: ""
63
+ },
64
+ tableDataKey: {
65
+ type: String,
66
+ default: "list"
67
+ },
68
+ tableDomWidth: {
69
+ type: Number,
70
+ default: 0
71
+ },
72
+ pageMapping: {
73
+ type: Object,
74
+ default: () => ({
75
+ pageSize: "pageSize",
76
+ pageNum: "pageNum"
77
+ })
78
+ },
79
+ sortState: {
80
+ type: Object,
81
+ default: () => {}
82
+ }
83
+ },
84
+ emits: [
85
+ emitsMap.paginationChange,
86
+ "updateTableData",
87
+ "handleTableSelect",
88
+ "handleBatchDelete",
89
+ "updateSortState"
90
+ ],
91
+ setup(e, { expose: t, emit: u }) {
92
+ let d = u, f = e, p = useSlots(), m = computed(() => typeof f.requestFn == "function"), g = computed({
93
+ get: () => m.value ? x.value : f.tableData,
94
+ set: (e) => {
95
+ m.value ? x.value = e : d("updateTableData", e);
96
+ }
97
+ }), _ = ref(0), v = computed(() => m.value ? _.value : f.total), y = computed({
98
+ get: () => f.sortState,
99
+ set: (e) => {
100
+ d("updateSortState", e);
101
+ }
102
+ }), b = ({ key: e, order: t }) => {
103
+ y.value[e] = t, g.value = g.value.reverse();
104
+ }, x = ref([]), S = computed(() => f.pageMapping.pageNum), C = computed(() => f.pageMapping.pageSize), w = {
105
+ [S.value]: 1,
106
+ [C.value]: 20
107
+ }, T = ref({ ...w }), E = ref([]), D = ref([]), O = ref([]), k = ref({}), A = computed(() => j(k.value));
108
+ function j(e) {
109
+ let t = /* @__PURE__ */ new Set();
110
+ for (let n in e) e.hasOwnProperty(n) && e[n].forEach((e) => {
111
+ t.add(e.id);
112
+ });
113
+ return t;
114
+ }
115
+ let M = ({ value: e, intermediate: t = !1, onChange: n }) => h(ElCheckbox, {
116
+ onChange: n,
117
+ modelValue: e,
118
+ indeterminate: t
119
+ }), N = (e, t) => {
120
+ if (e.selected = t, t ? D.value.some((t) => t.id === e.id) || D.value.push(e) : D.value = D.value.filter(({ id: t }) => t !== e.id), e.children && e.children.length > 0) {
121
+ let n = (e) => {
122
+ e.forEach((e) => {
123
+ e.selected = t, t ? D.value.some((t) => t.id === e.id) || D.value.push(e) : D.value = D.value.filter(({ id: t }) => t !== e.id), e.children && e.children.length > 0 && n(e.children);
124
+ });
125
+ };
126
+ n(e.children);
127
+ }
128
+ e.parentId && P(e.parentId), I(), q();
129
+ }, P = (e) => {
130
+ let t = F(g.value, e);
131
+ if (!t) return;
132
+ let n = t.children.every((e) => e.selected);
133
+ n && !t.selected ? (t.selected = !0, D.value.some((e) => e.id === t.id) || D.value.push(t)) : !n && t.selected && (t.selected = !1, D.value = D.value.filter(({ id: e }) => e !== t.id)), t.parentId && P(t.parentId);
134
+ }, F = (e, t) => {
135
+ for (let n of e) {
136
+ if (n.id === t) return n;
137
+ if (n.children) {
138
+ let e = F(n.children, t);
139
+ if (e) return e;
140
+ }
141
+ }
142
+ return null;
143
+ };
144
+ function I() {
145
+ k.value[T.value[S.value]] = L(g.value);
146
+ }
147
+ function L(e) {
148
+ let t = [];
149
+ return e.forEach((e) => {
150
+ e.selected && t.push(e), e.children && e.children.length > 0 && (t = t.concat(L(e.children)));
151
+ }), t;
152
+ }
153
+ function R(e, t) {
154
+ e.selected = t, e.children && e.children.length > 0 && e.children.forEach((e) => R(e, t));
155
+ }
156
+ let z = (e) => (g.value = [...g.value.map((t) => (R(t, e), t))], I(), D.value = e ? [...Object.values(k.value).flat()] : [], q(), [...D.value]), B = () => {
157
+ E.value.unshift({
158
+ key: "selection",
159
+ width: 50,
160
+ cellRenderer: (e) => {
161
+ let { rowData: t } = e, n = t.children && t.children.length > 0 ? Ne(t) : !1;
162
+ return h(M, {
163
+ value: t.selected,
164
+ intermediate: n,
165
+ onChange: (e) => N(t, e)
166
+ });
167
+ },
168
+ headerCellRenderer: () => {
169
+ let e = unref(g), t = e.every((e) => {
170
+ let t = e.selected, n = V(e);
171
+ return t && n;
172
+ });
173
+ return h(M, {
174
+ value: t,
175
+ intermediate: e.some((e) => e.selected || H(e)) && !t,
176
+ onChange: z
177
+ });
178
+ }
179
+ });
180
+ }, Ne = (e) => {
181
+ if (!e.children || e.children.length === 0) return !1;
182
+ let t = e.children.filter((e) => e.selected).length;
183
+ return t > 0 && t < e.children.length;
184
+ };
185
+ function V(e) {
186
+ return e.children?.length ? !!e.selected && e.children.every(V) : !!e.selected;
187
+ }
188
+ function H(e) {
189
+ return e.selected ? !0 : e.children?.some(H) || !1;
190
+ }
191
+ function U(e) {
192
+ return e.map((e) => {
193
+ let t = {
194
+ ...e,
195
+ selected: !1
196
+ };
197
+ return t.children &&= U(t.children), t;
198
+ });
199
+ }
200
+ let W = ref(!1), Pe = () => {
201
+ W.value = !0, B();
202
+ }, G = () => {
203
+ W.value = !1, D.value = [], g.value = g.value.map((e) => (R(e, !1), e)), k.value = {}, x.value = U(x.value), E.value.shift(), q();
204
+ }, Fe = () => {
205
+ d("handleBatchDelete", {
206
+ selectedRows: Object.values(k.value).flat(),
207
+ cb: () => {
208
+ G(), q();
209
+ }
210
+ });
211
+ }, K = () => {
212
+ D.value = [], q();
213
+ };
214
+ function q() {
215
+ let e = Object.values(k.value).flat();
216
+ d("handleTableSelect", {
217
+ originNodeData: D.value,
218
+ allSelectedNodes: e,
219
+ selectedSubNodes: e.filter((e) => !e.children)
220
+ });
221
+ }
222
+ let J = () => {
223
+ m.value ? f.requestFn({
224
+ ...f.params,
225
+ ...T.value
226
+ }).then((e) => {
227
+ x.value = Y(e?.data[f.tableDataKey], T.value[S.value], A.value) || [], _.value = e?.data?.total;
228
+ }) : (x.value = Y(f.tableData, T.value[S.value], A.value), _.value = f.total);
229
+ };
230
+ function Y(e, t, n, r = !1) {
231
+ return e.map((e) => {
232
+ let i = n.has(e.id) || r, a = {
233
+ ...e,
234
+ selected: i
235
+ };
236
+ return a.children &&= Y(a.children, t, n, i), a;
237
+ });
238
+ }
239
+ let Ie = () => {
240
+ T.value[S.value] = w[S.value], J();
241
+ }, Le = () => {
242
+ T.value = { ...w }, J();
243
+ }, X = (e) => {
244
+ e === "size" && (T.value[S.value] = 1), J(), d(emitsMap.paginationChange, T.value);
245
+ }, Z = ref(0), Q = () => {
246
+ let e = Z.value, t = cloneDeep(f.columns), n = 1 / calculateScale(), r = t.filter((e) => e.fixedWidth), i = t.filter((e) => !e.fixedWidth), a = 0;
247
+ r.forEach((e) => {
248
+ e.width && (a += e.width);
249
+ });
250
+ let o = e - a, s = 0;
251
+ i.forEach((e) => {
252
+ e.width && (s += e.width);
253
+ });
254
+ let c = [], l = 0;
255
+ if (t.forEach((e, t) => {
256
+ let n;
257
+ if (e.fixedWidth) n = e.width || 100;
258
+ else if (e.width && s > 0) {
259
+ let t = o * (e.width / s);
260
+ n = Math.max(t, e.width);
261
+ } else {
262
+ let e = i.filter((e) => !e.width);
263
+ n = e.length > 0 ? o / e.length : o / i.length;
264
+ }
265
+ c.push(n), l += n;
266
+ }), t = t.map((e, t) => (e.width = c[t] * n, y.value && Object.keys(y.value).length && y.value[e.key] && (e.sortable = !0), e)), W.value) {
267
+ let e = E.value.find((e) => e.key === "selection");
268
+ e && (E.value = [e, ...t]);
269
+ } else E.value = [...t];
270
+ };
271
+ watch(() => W.value, () => {
272
+ Q();
273
+ }), watch(() => f.tableDomWidth, (e) => {
274
+ e && (Z.value = e, Q());
275
+ });
276
+ let $ = () => {
277
+ Z.value = document.querySelector(".TABLE-AREA").getBoundingClientRect().width, Q();
278
+ };
279
+ return onMounted(() => {
280
+ J(), E.value = f.columns, Z.value = document.querySelector(".TABLE-AREA").getBoundingClientRect().width, nextTick(() => {
281
+ Q();
282
+ }), window.addEventListener("resize", $);
283
+ }), t({
284
+ getTableList: J,
285
+ search: Ie,
286
+ reset: Le,
287
+ initBatchSelect: K,
288
+ handleCancelSelect: G,
289
+ handleResize: $
290
+ }), (t, i) => (openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [unref(p)["filter-left"] ? (openBlock(), createElementBlock("div", _hoisted_3, [renderSlot(t.$slots, "filter-left", {}, void 0, !0)])) : createCommentVNode("", !0), createElementVNode("div", _hoisted_4, [e.hasBatchSelect && g.value.length ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [W.value ? (openBlock(), createElementBlock("div", _hoisted_5, [
291
+ createElementVNode("div", _hoisted_6, "已选" + toDisplayString(D.value.length) + "条数据", 1),
292
+ createElementVNode("div", {
293
+ class: "fz-12 text-3b64ff mg-l-4 pointer",
294
+ onClick: G
295
+ }, "取消选择"),
296
+ renderSlot(t.$slots, "btn-group", {}, () => [createElementVNode("div", _hoisted_7, [createVNode(unref(ElButton), {
297
+ type: "danger",
298
+ onClick: Fe,
299
+ disabled: !D.value.length
300
+ }, {
301
+ default: withCtx(() => [...i[6] ||= [createTextVNode(" 删除 ", -1)]]),
302
+ _: 1
303
+ }, 8, ["disabled"])])], !0)
304
+ ])) : (openBlock(), createBlock(unref(ElButton), {
305
+ key: 0,
306
+ type: "default",
307
+ onClick: Pe
308
+ }, {
309
+ default: withCtx(() => [...i[5] ||= [createTextVNode(" 批量选择 ", -1)]]),
310
+ _: 1
311
+ }))], 64)) : createCommentVNode("", !0), unref(p)["filter-right"] ? renderSlot(t.$slots, "filter-right", { key: 1 }, void 0, !0) : createCommentVNode("", !0)])]), createElementVNode("div", _hoisted_8, [createElementVNode("div", _hoisted_9, [createVNode(unref(ElAutoResizer), null, {
312
+ default: withCtx(({ width: n, height: r }) => [createVNode(unref(ElTableV2), {
313
+ "expanded-row-keys": O.value,
314
+ "onUpdate:expandedRowKeys": i[0] ||= (e) => O.value = e,
315
+ "expand-column-key": e.expandColumnKey,
316
+ columns: E.value,
317
+ data: g.value,
318
+ width: n,
319
+ height: r,
320
+ fixed: "",
321
+ "sort-state": y.value,
322
+ onColumnSort: b
323
+ }, createSlots({ _: 2 }, [renderList(unref(p), (e, n) => ({
324
+ name: n,
325
+ fn: withCtx((e) => [renderSlot(t.$slots, n, normalizeProps(guardReactiveProps(e)), void 0, !0)])
326
+ }))]), 1032, [
327
+ "expanded-row-keys",
328
+ "expand-column-key",
329
+ "columns",
330
+ "data",
331
+ "width",
332
+ "height",
333
+ "sort-state"
334
+ ])]),
335
+ _: 3
336
+ })]), e.isPagination && v.value > T.value[C.value] ? (openBlock(), createElementBlock("div", _hoisted_10, [e.isPagination ? (openBlock(), createBlock(layout_default$1, {
337
+ key: 0,
338
+ "current-page": T.value[S.value],
339
+ "onUpdate:currentPage": i[1] ||= (e) => T.value[S.value] = e,
340
+ "page-size": T.value[C.value],
341
+ "onUpdate:pageSize": i[2] ||= (e) => T.value[C.value] = e,
342
+ "page-sizes": e.pagination.pageSizes,
343
+ layout: e.pagination.layout,
344
+ total: v.value,
345
+ onSizeChange: i[3] ||= (e) => X("size"),
346
+ onCurrentChange: i[4] ||= (e) => X("page")
347
+ }, null, 8, [
348
+ "current-page",
349
+ "page-size",
350
+ "page-sizes",
351
+ "layout",
352
+ "total"
353
+ ])) : createCommentVNode("", !0)])) : createCommentVNode("", !0)])]));
354
+ }
355
+ }), [["__scopeId", "data-v-54ada1ae"]]));
356
+ var PaginationTable_default = PaginationTable;
357
+ export { PaginationTable_default as n, PaginationTable as t };