@done-coding/admin-core 0.1.1 → 0.1.3-alpha.0
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/es/components/data-view/DataListView.vue.mjs +7 -0
- package/es/components/data-view/DataListView.vue2.mjs +116 -0
- package/es/components/data-view/DataListViewItem.vue.mjs +7 -0
- package/es/components/data-view/DataListViewItem.vue2.mjs +17 -0
- package/es/components/display/HeightProvider.vue.mjs +38 -0
- package/es/components/display/HeightProvider.vue2.mjs +4 -0
- package/es/components/display/TabsMain.vue.mjs +5 -59
- package/es/components/display/TabsMain.vue2.mjs +95 -2
- package/es/components/display/index.mjs +11 -9
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +72 -67
- package/es/components/table/TableMain.vue.mjs +3 -3
- package/es/components/table/TableMain.vue2.mjs +183 -159
- package/es/index.mjs +80 -77
- package/es/inject/key.mjs +5 -2
- package/es/style.css +1 -1
- package/package.json +2 -2
- package/types/components/data-view/DataListView.vue.d.ts +26 -0
- package/types/components/data-view/DataListViewItem.vue.d.ts +26 -0
- package/types/components/data-view/index.d.ts +9 -0
- package/types/components/data-view/types.d.ts +71 -0
- package/types/components/display/HeightProvider.vue.d.ts +39 -0
- package/types/components/display/TabsMain.vue.d.ts +22 -32
- package/types/components/display/index.d.ts +22 -1
- package/types/components/display/types.d.ts +46 -0
- package/types/components/form/FormItem.vue.d.ts +1 -1
- package/types/components/form/FormRadioGroup.vue.d.ts +13 -13
- package/types/components/form/FormSearch.vue.d.ts +1 -1
- package/types/components/list-page/ListPage.vue.d.ts +7 -0
- package/types/components/modal/ConfirmModal.vue.d.ts +1 -1
- package/types/components/table/TableMain.vue.d.ts +9 -1
- package/types/components/table/types.d.ts +8 -0
- package/types/inject/key.d.ts +11 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { defineComponent as x, computed as w, ref as V, watch as $, openBlock as d, createElementBlock as S, normalizeStyle as F, unref as h, Fragment as H, renderList as K, createBlock as q, withCtx as z, renderSlot as M, markRaw as O, h as s } from "vue";
|
|
2
|
+
import j from "./DataListViewItem.vue.mjs";
|
|
3
|
+
const N = /* @__PURE__ */ x({
|
|
4
|
+
__name: "DataListView",
|
|
5
|
+
props: {
|
|
6
|
+
data: {},
|
|
7
|
+
rowKey: {},
|
|
8
|
+
columns: {},
|
|
9
|
+
maxHeight: {},
|
|
10
|
+
selectable: { type: Boolean, default: !1 }
|
|
11
|
+
},
|
|
12
|
+
emits: ["selectionChange"],
|
|
13
|
+
setup(u, { expose: v, emit: k }) {
|
|
14
|
+
const o = u, C = k, i = (t) => {
|
|
15
|
+
const e = o.rowKey;
|
|
16
|
+
return typeof e == "function" ? e(t) : String(t[e]);
|
|
17
|
+
}, b = w(
|
|
18
|
+
() => o.maxHeight ? { maxHeight: `${o.maxHeight}px`, overflowY: "auto" } : void 0
|
|
19
|
+
), a = V(/* @__PURE__ */ new Set()), p = (t) => o.selectable && a.value.has(i(t)), c = () => {
|
|
20
|
+
C("selectionChange", f());
|
|
21
|
+
}, f = () => o.selectable ? o.data.filter((t) => a.value.has(i(t))) : [], m = () => {
|
|
22
|
+
a.value = /* @__PURE__ */ new Set(), c();
|
|
23
|
+
}, _ = (t) => {
|
|
24
|
+
o.selectable && (a.value = t ? new Set(o.data.map((e) => i(e))) : /* @__PURE__ */ new Set(), c());
|
|
25
|
+
}, B = (t) => {
|
|
26
|
+
if (!o.selectable) return;
|
|
27
|
+
const e = i(t), n = new Set(a.value);
|
|
28
|
+
n.has(e) ? n.delete(e) : n.add(e), a.value = n, c();
|
|
29
|
+
};
|
|
30
|
+
$(
|
|
31
|
+
() => o.data,
|
|
32
|
+
() => {
|
|
33
|
+
a.value.size && m();
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
const D = (t) => O(
|
|
37
|
+
x({
|
|
38
|
+
name: "DataViewField",
|
|
39
|
+
props: {
|
|
40
|
+
row: { type: Object, required: !0 },
|
|
41
|
+
index: { type: Number, required: !0 },
|
|
42
|
+
selected: { type: Boolean, default: !1 },
|
|
43
|
+
toggleSelect: { type: Function, default: void 0 }
|
|
44
|
+
},
|
|
45
|
+
setup(e) {
|
|
46
|
+
return () => {
|
|
47
|
+
const { type: n, render: l, prop: y } = t;
|
|
48
|
+
if (n === "index")
|
|
49
|
+
return s("span", String(e.index + 1));
|
|
50
|
+
if (n === "selection")
|
|
51
|
+
return s("input", {
|
|
52
|
+
type: "checkbox",
|
|
53
|
+
checked: e.selected,
|
|
54
|
+
onChange: () => {
|
|
55
|
+
var g;
|
|
56
|
+
return (g = e.toggleSelect) == null ? void 0 : g.call(e);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
if (typeof l == "function")
|
|
60
|
+
return l({
|
|
61
|
+
row: e.row,
|
|
62
|
+
index: e.index,
|
|
63
|
+
_index: e.index
|
|
64
|
+
});
|
|
65
|
+
if (l)
|
|
66
|
+
return s(l);
|
|
67
|
+
const r = y ? e.row[y] : void 0;
|
|
68
|
+
return s("span", r == null ? "" : String(r));
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
), L = w(() => {
|
|
73
|
+
const t = {};
|
|
74
|
+
for (const e of o.columns) {
|
|
75
|
+
if (e.type === "expand") continue;
|
|
76
|
+
const n = e.type === "index" ? "$type_index" : e.type === "selection" ? "$type_selection" : e.prop;
|
|
77
|
+
if (!n) {
|
|
78
|
+
console.warn(
|
|
79
|
+
"[DataListView] 列缺少 prop 且非 index/selection,跳过",
|
|
80
|
+
e
|
|
81
|
+
);
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
t[n] && console.warn(`[DataListView] 列 key 重复 "${n}",后者覆盖前者`), t[n] = D(e);
|
|
85
|
+
}
|
|
86
|
+
return t;
|
|
87
|
+
});
|
|
88
|
+
return v({
|
|
89
|
+
getSelected: f,
|
|
90
|
+
clearSelection: m,
|
|
91
|
+
toggleAll: _
|
|
92
|
+
}), (t, e) => (d(), S("div", {
|
|
93
|
+
class: "data-list-view",
|
|
94
|
+
style: F(h(b))
|
|
95
|
+
}, [
|
|
96
|
+
(d(!0), S(H, null, K(u.data, (n, l) => (d(), q(j, {
|
|
97
|
+
key: i(n),
|
|
98
|
+
selected: p(n)
|
|
99
|
+
}, {
|
|
100
|
+
default: z(() => [
|
|
101
|
+
M(t.$slots, "item", {
|
|
102
|
+
fieldComponentMap: h(L),
|
|
103
|
+
row: n,
|
|
104
|
+
index: l,
|
|
105
|
+
selected: p(n),
|
|
106
|
+
toggleSelect: () => B(n)
|
|
107
|
+
}, void 0, !0)
|
|
108
|
+
]),
|
|
109
|
+
_: 2
|
|
110
|
+
}, 1032, ["selected"]))), 128))
|
|
111
|
+
], 4));
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
export {
|
|
115
|
+
N as default
|
|
116
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponent as s, openBlock as o, createElementBlock as a, normalizeClass as l, renderSlot as n } from "vue";
|
|
2
|
+
const c = /* @__PURE__ */ s({
|
|
3
|
+
__name: "DataListViewItem",
|
|
4
|
+
props: {
|
|
5
|
+
selected: { type: Boolean }
|
|
6
|
+
},
|
|
7
|
+
setup(e) {
|
|
8
|
+
return (t, r) => (o(), a("div", {
|
|
9
|
+
class: l(["data-list-view-item", { "is-selected": e.selected }])
|
|
10
|
+
}, [
|
|
11
|
+
n(t.$slots, "default", {}, void 0, !0)
|
|
12
|
+
], 2));
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
c as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineComponent as f, inject as g, ref as v, computed as m, unref as e, provide as H, openBlock as d, createElementBlock as y, normalizeStyle as o, createBlock as C, withCtx as E, renderSlot as c, createCommentVNode as _, createElementVNode as N } from "vue";
|
|
2
|
+
import k from "./WatchSize.vue.mjs";
|
|
3
|
+
import { FULLSCREEN_HEIGHT_CHANNEL as x } from "../../inject/key.mjs";
|
|
4
|
+
const S = /* @__PURE__ */ f({
|
|
5
|
+
__name: "HeightProvider",
|
|
6
|
+
props: {
|
|
7
|
+
height: {},
|
|
8
|
+
channel: { default: x }
|
|
9
|
+
},
|
|
10
|
+
setup(h) {
|
|
11
|
+
const r = h, i = r.channel, p = g(
|
|
12
|
+
i,
|
|
13
|
+
void 0
|
|
14
|
+
), l = v(0), a = m(() => r.height ?? e(p) ?? 0), t = m(() => Math.max(a.value - l.value, 0));
|
|
15
|
+
return H(i, t), (n, s) => (d(), y("div", {
|
|
16
|
+
style: o({ minHeight: e(a) + "px" })
|
|
17
|
+
}, [
|
|
18
|
+
n.$slots.header ? (d(), C(k, {
|
|
19
|
+
key: 0,
|
|
20
|
+
style: o({ minHeight: e(t) + "px" }),
|
|
21
|
+
onHeightChange: s[0] || (s[0] = (u) => l.value = u)
|
|
22
|
+
}, {
|
|
23
|
+
default: E(() => [
|
|
24
|
+
c(n.$slots, "header")
|
|
25
|
+
]),
|
|
26
|
+
_: 3
|
|
27
|
+
}, 8, ["style"])) : _("", !0),
|
|
28
|
+
N("div", {
|
|
29
|
+
style: o({ minHeight: e(t) + "px" })
|
|
30
|
+
}, [
|
|
31
|
+
c(n.$slots, "default", { height: e(t) })
|
|
32
|
+
], 4)
|
|
33
|
+
], 4));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
S as default
|
|
38
|
+
};
|
|
@@ -1,61 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
import { defineComponent as y, useModel as V, computed as _, openBlock as n, createBlock as m, isRef as B, unref as i, withCtx as d, createElementBlock as M, Fragment as T, renderList as g, renderSlot as k, mergeModels as R } from "vue";
|
|
6
|
-
import { useRouter as E } from "vue-router";
|
|
7
|
-
import { TabsMainReplaceQueryKey as Q } from "../../config/route.mjs";
|
|
8
|
-
const F = /* @__PURE__ */ y({
|
|
9
|
-
__name: "TabsMain",
|
|
10
|
-
props: /* @__PURE__ */ R({
|
|
11
|
-
list: {},
|
|
12
|
-
replaceQuery: { type: Boolean, default: !1 },
|
|
13
|
-
notNull: { type: Boolean, default: !0 }
|
|
14
|
-
}, {
|
|
15
|
-
modelValue: {},
|
|
16
|
-
modelModifiers: {}
|
|
17
|
-
}),
|
|
18
|
-
emits: ["update:modelValue"],
|
|
19
|
-
setup(a) {
|
|
20
|
-
const t = a, o = V(a, "modelValue"), s = E(), c = (e) => e === void 0 || e === "" ? !1 : t.list.some((u) => u.value === e), r = _({
|
|
21
|
-
get() {
|
|
22
|
-
return c(o.value) ? o.value : t.notNull && t.list.length > 0 ? t.list[0].value : o.value;
|
|
23
|
-
},
|
|
24
|
-
set(e) {
|
|
25
|
-
o.value = e, t.replaceQuery && s.replace({
|
|
26
|
-
query: {
|
|
27
|
-
...s.currentRoute.value.query,
|
|
28
|
-
[Q]: e
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
return (e, u) => {
|
|
34
|
-
const p = b, f = v;
|
|
35
|
-
return n(), m(f, {
|
|
36
|
-
modelValue: i(r),
|
|
37
|
-
"onUpdate:modelValue": u[0] || (u[0] = (l) => B(r) ? r.value = l : null)
|
|
38
|
-
}, {
|
|
39
|
-
default: d(() => [
|
|
40
|
-
(n(!0), M(T, null, g(a.list, (l) => (n(), m(p, {
|
|
41
|
-
key: l.value,
|
|
42
|
-
label: l.title,
|
|
43
|
-
name: l.value
|
|
44
|
-
}, {
|
|
45
|
-
default: d(() => [
|
|
46
|
-
k(e.$slots, `content-${l.value}`, {
|
|
47
|
-
item: l,
|
|
48
|
-
currentValue: i(r)
|
|
49
|
-
})
|
|
50
|
-
]),
|
|
51
|
-
_: 2
|
|
52
|
-
}, 1032, ["label", "name"]))), 128))
|
|
53
|
-
]),
|
|
54
|
-
_: 3
|
|
55
|
-
}, 8, ["modelValue"]);
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
});
|
|
1
|
+
import o from "./TabsMain.vue2.mjs";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c9b7515f"]]);
|
|
59
5
|
export {
|
|
60
|
-
|
|
6
|
+
m as default
|
|
61
7
|
};
|
|
@@ -1,4 +1,97 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as y, useModel as T, useSlots as x, computed as v, watch as b, h as K, ref as S, onMounted as V, onBeforeUnmount as N, openBlock as l, createBlock as u, withCtx as k, KeepAlive as $, unref as a, createCommentVNode as z, createElementVNode as _, createElementBlock as g, Fragment as B, renderList as H, normalizeClass as F, renderSlot as R, createTextVNode as A, toDisplayString as I, normalizeStyle as U, mergeModels as q, nextTick as D } from "vue";
|
|
2
|
+
import G from "./HeightProvider.vue.mjs";
|
|
3
|
+
import { FULLSCREEN_HEIGHT_CHANNEL as P } from "../../inject/key.mjs";
|
|
4
|
+
const W = { class: "tabs-main-bar" }, X = ["onClick"], Q = /* @__PURE__ */ y({
|
|
5
|
+
__name: "TabsMain",
|
|
6
|
+
props: /* @__PURE__ */ q({
|
|
7
|
+
tabs: {},
|
|
8
|
+
channel: { default: P },
|
|
9
|
+
height: {}
|
|
10
|
+
}, {
|
|
11
|
+
modelValue: {},
|
|
12
|
+
modelModifiers: {}
|
|
13
|
+
}),
|
|
14
|
+
emits: ["update:modelValue"],
|
|
15
|
+
setup(d) {
|
|
16
|
+
const o = d, s = T(d, "modelValue"), E = x(), w = (e) => o.tabs.find((t) => t.key === e), m = (e) => !!e && o.tabs.some((t) => t.key === e), r = v(() => m(s.value) ? s.value : o.tabs.length ? o.tabs[0].key : void 0);
|
|
17
|
+
b(
|
|
18
|
+
[s, () => o.tabs],
|
|
19
|
+
() => {
|
|
20
|
+
!m(s.value) && o.tabs.length && (s.value = o.tabs[0].key);
|
|
21
|
+
},
|
|
22
|
+
{ immediate: !0 }
|
|
23
|
+
);
|
|
24
|
+
const M = y({
|
|
25
|
+
name: "TabsMainPane",
|
|
26
|
+
props: { paneKey: { type: String, required: !0 } },
|
|
27
|
+
setup(e) {
|
|
28
|
+
return () => {
|
|
29
|
+
const t = E[e.paneKey], n = w(e.paneKey);
|
|
30
|
+
return t ? t({ tab: n, active: !0 }) : n != null && n.component ? K(n.component) : null;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}), i = /* @__PURE__ */ new Map(), C = (e, t) => {
|
|
34
|
+
t instanceof HTMLElement ? i.set(e, t) : i.delete(e);
|
|
35
|
+
}, f = S(0), L = v(() => {
|
|
36
|
+
const [, e] = [f.value, r.value], t = e ? i.get(e) : void 0;
|
|
37
|
+
return t ? {
|
|
38
|
+
width: `${t.offsetWidth}px`,
|
|
39
|
+
transform: `translateX(${t.offsetLeft}px)`
|
|
40
|
+
} : { width: "0px" };
|
|
41
|
+
}), c = () => {
|
|
42
|
+
D(() => {
|
|
43
|
+
f.value++;
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
b(
|
|
47
|
+
() => o.tabs,
|
|
48
|
+
() => c(),
|
|
49
|
+
{ flush: "post" }
|
|
50
|
+
);
|
|
51
|
+
const p = () => c();
|
|
52
|
+
return V(() => {
|
|
53
|
+
c(), window.addEventListener("resize", p);
|
|
54
|
+
}), N(() => {
|
|
55
|
+
window.removeEventListener("resize", p);
|
|
56
|
+
}), (e, t) => (l(), u(G, {
|
|
57
|
+
height: o.height,
|
|
58
|
+
channel: o.channel
|
|
59
|
+
}, {
|
|
60
|
+
header: k(() => [
|
|
61
|
+
_("div", W, [
|
|
62
|
+
(l(!0), g(B, null, H(o.tabs, (n) => (l(), g("button", {
|
|
63
|
+
key: n.key,
|
|
64
|
+
ref_for: !0,
|
|
65
|
+
ref: (h) => C(n.key, h),
|
|
66
|
+
type: "button",
|
|
67
|
+
class: F(["tabs-main-bar-item", { "tabs-main-bar-item_active": n.key === a(r) }]),
|
|
68
|
+
onClick: (h) => s.value = n.key
|
|
69
|
+
}, [
|
|
70
|
+
R(e.$slots, `header-${n.key}`, {
|
|
71
|
+
tab: n,
|
|
72
|
+
active: n.key === a(r)
|
|
73
|
+
}, () => [
|
|
74
|
+
A(I(n.title), 1)
|
|
75
|
+
], !0)
|
|
76
|
+
], 10, X))), 128)),
|
|
77
|
+
_("div", {
|
|
78
|
+
class: "tabs-main-bar-indicator",
|
|
79
|
+
style: U(a(L))
|
|
80
|
+
}, null, 4)
|
|
81
|
+
])
|
|
82
|
+
]),
|
|
83
|
+
default: k(() => [
|
|
84
|
+
(l(), u($, null, [
|
|
85
|
+
a(r) ? (l(), u(a(M), {
|
|
86
|
+
key: a(r),
|
|
87
|
+
"pane-key": a(r)
|
|
88
|
+
}, null, 8, ["pane-key"])) : z("", !0)
|
|
89
|
+
], 1024))
|
|
90
|
+
]),
|
|
91
|
+
_: 3
|
|
92
|
+
}, 8, ["height", "channel"]));
|
|
93
|
+
}
|
|
94
|
+
});
|
|
2
95
|
export {
|
|
3
|
-
|
|
96
|
+
Q as default
|
|
4
97
|
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import r from "./WatchSize.vue.mjs";
|
|
2
|
+
import a from "./TabsMain.vue.mjs";
|
|
3
|
+
import e from "./HeightProvider.vue.mjs";
|
|
4
|
+
const n = { WatchSize: r, TabsMain: a, HeightProvider: e }, p = {
|
|
5
|
+
install(o) {
|
|
6
|
+
Object.entries(n).forEach(([t, i]) => {
|
|
7
|
+
o.component(t, i);
|
|
7
8
|
});
|
|
8
9
|
}
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
e as HeightProvider,
|
|
13
|
+
a as TabsMain,
|
|
14
|
+
r as WatchSize,
|
|
15
|
+
p as displayInstall
|
|
14
16
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ListPage.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e22c3b7c"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ElLoadingDirective as ce } from "element-plus/es";
|
|
2
2
|
import "element-plus/es/components/base/style/css";
|
|
3
3
|
import "element-plus/es/components/loading/style/css";
|
|
4
|
-
import { defineComponent as he, useCssVars as fe, unref as
|
|
4
|
+
import { defineComponent as he, useCssVars as fe, unref as a, useSlots as ge, computed as o, useModel as de, ref as u, shallowRef as E, inject as me, watch as ve, withDirectives as pe, openBlock as y, createElementBlock as ye, createBlock as V, withCtx as h, renderSlot as f, createCommentVNode as B, createVNode as x, mergeProps as H, createSlots as K, renderList as S, normalizeProps as C, guardReactiveProps as b, mergeModels as N } from "vue";
|
|
5
5
|
import He from "../form/FormSearch.vue.mjs";
|
|
6
6
|
import { generateFormData as Se, stringifyFormData as Ce } from "../form/utils.mjs";
|
|
7
7
|
import q from "../display/WatchSize.vue.mjs";
|
|
@@ -12,7 +12,7 @@ import { BODY_CONTENT_VIEWPORT_HEIGHT as Ie } from "../../inject/key.mjs";
|
|
|
12
12
|
const Me = {
|
|
13
13
|
"element-loading-background": "rgba(122, 122, 122, 0.5)",
|
|
14
14
|
class: "list-page"
|
|
15
|
-
},
|
|
15
|
+
}, Be = /* @__PURE__ */ he({
|
|
16
16
|
__name: "ListPage",
|
|
17
17
|
props: /* @__PURE__ */ N({
|
|
18
18
|
staticQuery: { default: () => ({}) },
|
|
@@ -35,43 +35,43 @@ const Me = {
|
|
|
35
35
|
emits: /* @__PURE__ */ N(["dataChange", "pageInfoChange"], ["update:isAutoRefresh"]),
|
|
36
36
|
setup(s, { expose: L, emit: J }) {
|
|
37
37
|
fe((e) => ({
|
|
38
|
-
|
|
38
|
+
v09e0228a: a(Y)
|
|
39
39
|
}));
|
|
40
|
-
const n = s,
|
|
40
|
+
const n = s, R = J, w = ge(), I = o(() => !!w.header), M = o(() => !!w.operation), m = de(s, "isAutoRefresh"), v = u({}), p = u(
|
|
41
41
|
{}
|
|
42
|
-
),
|
|
42
|
+
), P = u(!1), i = E(), c = E(), Q = me(
|
|
43
43
|
Ie,
|
|
44
44
|
500
|
|
45
|
-
),
|
|
45
|
+
), $ = u(0), j = u(0), k = u(0), z = o(() => ({
|
|
46
46
|
...p.value,
|
|
47
47
|
...n.staticQuery
|
|
48
|
-
})),
|
|
49
|
-
|
|
48
|
+
})), D = u(!1), G = o(() => D.value ? $.value + 10 : 0), U = o(() => M.value ? j.value + 10 : 0), W = o(() => I.value ? k.value + 10 : 0), A = o(() => Q.value - n.refineReduceHeight), Y = o(() => n.refine ? `${A.value}px` : "auto"), X = o(() => n.refine ? Math.max(
|
|
49
|
+
A.value - G.value - U.value - W.value,
|
|
50
50
|
200
|
|
51
|
-
) : void 0),
|
|
52
|
-
var
|
|
53
|
-
let
|
|
54
|
-
if (n.beforeSearch && (
|
|
51
|
+
) : void 0), F = (e, t = "search") => {
|
|
52
|
+
var r, l, d;
|
|
53
|
+
let g = e;
|
|
54
|
+
if (n.beforeSearch && (g = n.beforeSearch(
|
|
55
55
|
we(e),
|
|
56
56
|
t
|
|
57
|
-
)), t === "reset" && n.clearTableFilterOnReset && ((l = (
|
|
58
|
-
return ["reset", "search"].includes(t) ? (
|
|
57
|
+
)), t === "reset" && n.clearTableFilterOnReset && ((l = (r = c.value) == null ? void 0 : r.getTableInstance()) == null || l.clearFilter()), JSON.stringify(g) === JSON.stringify(p.value))
|
|
58
|
+
return ["reset", "search"].includes(t) ? (d = c.value) == null ? void 0 : d.reload() : void 0;
|
|
59
59
|
p.value = {
|
|
60
|
-
...
|
|
60
|
+
...g
|
|
61
61
|
};
|
|
62
|
-
}, X = (e) => {
|
|
63
|
-
C("dataChange", e);
|
|
64
62
|
}, Z = (e) => {
|
|
65
|
-
|
|
63
|
+
R("dataChange", e);
|
|
64
|
+
}, _ = (e) => {
|
|
65
|
+
R("pageInfoChange", e);
|
|
66
66
|
}, ee = (e) => {
|
|
67
|
-
|
|
67
|
+
P.value = e;
|
|
68
68
|
}, te = (e) => {
|
|
69
|
-
|
|
69
|
+
$.value = e;
|
|
70
70
|
}, re = (e) => {
|
|
71
|
-
P.value = e;
|
|
72
|
-
}, ae = (e) => {
|
|
73
71
|
j.value = e;
|
|
74
|
-
},
|
|
72
|
+
}, ae = (e) => {
|
|
73
|
+
k.value = e;
|
|
74
|
+
}, oe = o(() => n.list), ne = o(() => n.rowKey), T = o(() => v.value), O = {
|
|
75
75
|
refresh: async (e = !1) => {
|
|
76
76
|
var t;
|
|
77
77
|
return (t = c.value) == null ? void 0 : t.refresh(e);
|
|
@@ -109,7 +109,7 @@ const Me = {
|
|
|
109
109
|
v.value[e] = t;
|
|
110
110
|
}
|
|
111
111
|
}, se = o(() => {
|
|
112
|
-
const e = Re(
|
|
112
|
+
const e = Re(O, [
|
|
113
113
|
"triggerReset",
|
|
114
114
|
"triggerSearch",
|
|
115
115
|
"update"
|
|
@@ -119,99 +119,104 @@ const Me = {
|
|
|
119
119
|
...e
|
|
120
120
|
};
|
|
121
121
|
}), ie = (e) => e, le = (e) => e, ue = (e) => {
|
|
122
|
-
|
|
122
|
+
D.value = e;
|
|
123
123
|
};
|
|
124
|
-
return L(
|
|
124
|
+
return L(O), ve(
|
|
125
125
|
() => n.list,
|
|
126
126
|
(e) => {
|
|
127
127
|
const t = Se(e);
|
|
128
|
-
v.value = t,
|
|
128
|
+
v.value = t, F(Ce(t, e));
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
immediate: !0
|
|
132
132
|
}
|
|
133
133
|
), (e, t) => {
|
|
134
|
-
const
|
|
134
|
+
const g = ce;
|
|
135
135
|
return pe((y(), ye("div", Me, [
|
|
136
|
-
|
|
136
|
+
a(I) ? (y(), V(a(q), {
|
|
137
137
|
key: 0,
|
|
138
138
|
class: "list-page-header",
|
|
139
139
|
onHeightChange: ae
|
|
140
140
|
}, {
|
|
141
|
-
default:
|
|
142
|
-
|
|
141
|
+
default: h(() => [
|
|
142
|
+
f(e.$slots, "header", {}, void 0, !0)
|
|
143
143
|
]),
|
|
144
144
|
_: 3
|
|
145
|
-
})) :
|
|
146
|
-
|
|
145
|
+
})) : B("", !0),
|
|
146
|
+
x(a(He), H({
|
|
147
147
|
ref_key: "formSearch",
|
|
148
148
|
ref: i,
|
|
149
|
-
list:
|
|
150
|
-
data:
|
|
149
|
+
list: a(oe),
|
|
150
|
+
data: a(T)
|
|
151
151
|
}, s.formSearchProps, {
|
|
152
|
-
onSearch:
|
|
152
|
+
onSearch: F,
|
|
153
153
|
onHeightChange: te,
|
|
154
154
|
onVisibleChange: ue
|
|
155
|
-
}),
|
|
156
|
-
S(s.list, (
|
|
157
|
-
name:
|
|
158
|
-
fn:
|
|
159
|
-
|
|
155
|
+
}), K({ _: 2 }, [
|
|
156
|
+
S(s.list, (r) => ({
|
|
157
|
+
name: r.key,
|
|
158
|
+
fn: h((l) => [
|
|
159
|
+
f(e.$slots, `form-${r.key}`, C(b(l)), void 0, !0)
|
|
160
160
|
])
|
|
161
161
|
}))
|
|
162
162
|
]), 1040, ["list", "data"]),
|
|
163
|
-
|
|
163
|
+
a(M) ? (y(), V(a(q), {
|
|
164
164
|
key: 1,
|
|
165
165
|
class: "list-page-operation",
|
|
166
166
|
onHeightChange: re
|
|
167
167
|
}, {
|
|
168
|
-
default:
|
|
169
|
-
|
|
168
|
+
default: h(() => [
|
|
169
|
+
f(e.$slots, "operation", {}, void 0, !0)
|
|
170
170
|
]),
|
|
171
171
|
_: 3
|
|
172
|
-
})) :
|
|
173
|
-
|
|
172
|
+
})) : B("", !0),
|
|
173
|
+
x(a(be), H({
|
|
174
174
|
ref_key: "tableMain",
|
|
175
175
|
ref: c,
|
|
176
176
|
"is-auto-refresh": m.value,
|
|
177
|
-
"onUpdate:isAutoRefresh": t[0] || (t[0] = (
|
|
177
|
+
"onUpdate:isAutoRefresh": t[0] || (t[0] = (r) => m.value = r),
|
|
178
178
|
api: s.api,
|
|
179
179
|
columns: s.columns,
|
|
180
|
-
query:
|
|
181
|
-
maxHeight:
|
|
182
|
-
rowKey:
|
|
180
|
+
query: a(z),
|
|
181
|
+
maxHeight: a(X),
|
|
182
|
+
rowKey: a(ne)
|
|
183
183
|
}, s.tableMainProps, {
|
|
184
184
|
refine: !1,
|
|
185
|
-
injectInfo:
|
|
185
|
+
injectInfo: a(se),
|
|
186
186
|
onLoadingChange: ee,
|
|
187
|
-
onDataChange:
|
|
188
|
-
onPageInfoChange:
|
|
189
|
-
}),
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
187
|
+
onDataChange: Z,
|
|
188
|
+
onPageInfoChange: _
|
|
189
|
+
}), K({
|
|
190
|
+
"custom-view-item": h((r) => [
|
|
191
|
+
f(e.$slots, "custom-view-item", C(b(r)), void 0, !0)
|
|
192
|
+
]),
|
|
193
|
+
_: 2
|
|
194
|
+
}, [
|
|
195
|
+
S(s.columns, (r) => ({
|
|
196
|
+
name: r.prop,
|
|
197
|
+
fn: h((l) => [
|
|
198
|
+
f(e.$slots, `table-${r.prop}`, C(b(ie(l))), void 0, !0)
|
|
194
199
|
])
|
|
195
200
|
})),
|
|
196
|
-
S(s.columns, (
|
|
197
|
-
name: `header-${
|
|
198
|
-
fn:
|
|
199
|
-
var
|
|
201
|
+
S(s.columns, (r) => ({
|
|
202
|
+
name: `header-${r.prop}`,
|
|
203
|
+
fn: h((l) => {
|
|
204
|
+
var d;
|
|
200
205
|
return [
|
|
201
|
-
|
|
202
|
-
searchFormData:
|
|
203
|
-
triggerSearch: (
|
|
206
|
+
f(e.$slots, `table-header-${r.columnKey || r.prop}`, H(le(l), {
|
|
207
|
+
searchFormData: a(T),
|
|
208
|
+
triggerSearch: (d = a(i)) == null ? void 0 : d.triggerSearch
|
|
204
209
|
}), void 0, !0)
|
|
205
210
|
];
|
|
206
211
|
})
|
|
207
212
|
}))
|
|
208
213
|
]), 1040, ["is-auto-refresh", "api", "columns", "query", "maxHeight", "rowKey", "injectInfo"])
|
|
209
214
|
])), [
|
|
210
|
-
[
|
|
215
|
+
[g, !m.value && a(P)]
|
|
211
216
|
]);
|
|
212
217
|
};
|
|
213
218
|
}
|
|
214
219
|
});
|
|
215
220
|
export {
|
|
216
|
-
|
|
221
|
+
Be as default
|
|
217
222
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TableMain.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import a from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-d70ba841"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|