@duxweb/dvha-pro 0.0.6 → 0.0.7
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/cjs/component.cjs +1 -1
- package/dist/cjs/components/card/card.cjs +1 -1
- package/dist/cjs/components/chart/echart.cjs +1 -0
- package/dist/cjs/components/dialog/dialog.cjs +1 -1
- package/dist/cjs/components/drawer/drawer.cjs +1 -1
- package/dist/cjs/components/form/modalForm.cjs +1 -1
- package/dist/cjs/components/form/pageForm.cjs +1 -1
- package/dist/cjs/components/form/settingForm.cjs +1 -1
- package/dist/cjs/components/layout/list.cjs +1 -1
- package/dist/cjs/components/layout/table.cjs +1 -1
- package/dist/cjs/components/list/card.cjs +1 -1
- package/dist/cjs/components/list/list.cjs +1 -1
- package/dist/cjs/components/modal/modal.cjs +1 -1
- package/dist/cjs/components/modal/modalPage.cjs +1 -1
- package/dist/cjs/components/modal/modalTab.cjs +1 -1
- package/dist/cjs/components/select/cardSelect.cjs +1 -0
- package/dist/cjs/components/table/tablePage.cjs +1 -1
- package/dist/cjs/config/echart.cjs +1 -0
- package/dist/cjs/dvha-pro.css +1 -1
- package/dist/cjs/hooks/action.cjs +1 -1
- package/dist/cjs/hooks/dialog.cjs +1 -1
- package/dist/cjs/hooks/drawer.cjs +1 -1
- package/dist/cjs/hooks/echart.cjs +1 -0
- package/dist/cjs/hooks/modal.cjs +1 -1
- package/dist/cjs/hooks/table/media.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/main.cjs +1 -1
- package/dist/cjs/pages/authLayout.cjs +1 -1
- package/dist/cjs/pages/layout/global.cjs +1 -1
- package/dist/cjs/pages/layout/page.cjs +1 -1
- package/dist/cjs/pages/login.cjs +1 -1
- package/dist/cjs/pages/menu/avatar.cjs +1 -1
- package/dist/cjs/pages/menu/button.cjs +1 -1
- package/dist/cjs/pages/menu/cmd.cjs +1 -1
- package/dist/cjs/pages/menu/main.cjs +1 -1
- package/dist/cjs/pages/menu/mobile.cjs +1 -1
- package/dist/cjs/pages/page.cjs +1 -1
- package/dist/cjs/pages/page404.cjs +1 -1
- package/dist/cjs/pages/pageStatus.cjs +1 -1
- package/dist/cjs/theme/naiveTheme.cjs +1 -1
- package/dist/cjs/theme/uno.css.cjs +28 -7
- package/dist/esm/component.js +43 -41
- package/dist/esm/components/card/card.js +1 -1
- package/dist/esm/components/chart/echart.js +75 -0
- package/dist/esm/components/dialog/dialog.js +87 -93
- package/dist/esm/components/drawer/drawer.js +34 -32
- package/dist/esm/components/form/modalForm.js +1 -1
- package/dist/esm/components/form/pageForm.js +23 -19
- package/dist/esm/components/form/settingForm.js +22 -18
- package/dist/esm/components/layout/list.js +203 -142
- package/dist/esm/components/layout/table.js +210 -145
- package/dist/esm/components/list/card.js +42 -32
- package/dist/esm/components/list/list.js +27 -16
- package/dist/esm/components/modal/modal.js +46 -86
- package/dist/esm/components/modal/modalPage.js +23 -18
- package/dist/esm/components/modal/modalTab.js +11 -11
- package/dist/esm/components/select/cardSelect.js +103 -0
- package/dist/esm/components/table/tablePage.js +21 -18
- package/dist/esm/config/echart.js +456 -0
- package/dist/esm/dvha-pro.css +1 -1
- package/dist/esm/hooks/action.js +46 -45
- package/dist/esm/hooks/dialog.js +24 -7
- package/dist/esm/hooks/drawer.js +12 -8
- package/dist/esm/hooks/echart.js +469 -0
- package/dist/esm/hooks/modal.js +25 -9
- package/dist/esm/hooks/table/media.js +18 -14
- package/dist/esm/index.js +158 -135
- package/dist/esm/main.js +11 -8
- package/dist/esm/pages/authLayout.js +3 -2
- package/dist/esm/pages/layout/global.js +46 -33
- package/dist/esm/pages/layout/page.js +13 -9
- package/dist/esm/pages/login.js +25 -21
- package/dist/esm/pages/menu/avatar.js +14 -14
- package/dist/esm/pages/menu/button.js +14 -10
- package/dist/esm/pages/menu/cmd.js +26 -22
- package/dist/esm/pages/menu/main.js +26 -22
- package/dist/esm/pages/menu/mobile.js +11 -7
- package/dist/esm/pages/page.js +16 -16
- package/dist/esm/pages/page404.js +24 -20
- package/dist/esm/pages/pageStatus.js +12 -8
- package/dist/esm/theme/naiveTheme.js +57 -51
- package/dist/esm/theme/uno.css.js +28 -7
- package/dist/types/components/chart/echart.d.ts +284 -0
- package/dist/types/components/chart/index.d.ts +1 -0
- package/dist/types/components/dialog/dialog.d.ts +1 -20
- package/dist/types/components/drawer/drawer.d.ts +14 -4
- package/dist/types/components/form/formLayout.d.ts +1 -1
- package/dist/types/components/form/modalForm.d.ts +1 -1
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/components/layout/list.d.ts +18 -0
- package/dist/types/components/layout/table.d.ts +22 -1
- package/dist/types/components/list/card.d.ts +38 -0
- package/dist/types/components/list/list.d.ts +43 -2
- package/dist/types/components/modal/modal.d.ts +13 -31
- package/dist/types/components/modal/modalPage.d.ts +3 -6
- package/dist/types/components/panel/alert.d.ts +1 -1
- package/dist/types/components/select/cardSelect.d.ts +88 -0
- package/dist/types/components/select/index.d.ts +1 -0
- package/dist/types/components/table/tablePage.d.ts +28 -2
- package/dist/types/config/echart.d.ts +4 -0
- package/dist/types/config/index.d.ts +1 -0
- package/dist/types/hooks/drawer.d.ts +3 -2
- package/dist/types/hooks/echart.d.ts +166 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/modal.d.ts +10 -5
- package/dist/types/hooks/table/types.d.ts +1 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/pages/layout/global.d.ts +1 -0
- package/dist/types/pages/menu/avatar.d.ts +3 -3
- package/dist/types/pages/menu/button.d.ts +3 -3
- package/dist/types/pages/menu/main.d.ts +3 -3
- package/dist/types/pages/page.d.ts +1 -1
- package/package.json +8 -3
- package/dist/cjs/node_modules/.pnpm/@vueuse_integrations@13.3.0_async-validator@4.2.5_axios@1.10.0_focus-trap@7.6.5_vue@3.5.17_typescript@5.8.3_/node_modules/@vueuse/integrations/useFocusTrap.cjs +0 -1
- package/dist/cjs/node_modules/.pnpm/@vueuse_shared@13.3.0_vue@3.5.17_typescript@5.8.3_/node_modules/@vueuse/shared/index.cjs +0 -1
- package/dist/cjs/node_modules/.pnpm/focus-trap@7.6.5/node_modules/focus-trap/dist/focus-trap.esm.cjs +0 -5
- package/dist/cjs/node_modules/.pnpm/tabbable@6.2.0/node_modules/tabbable/dist/index.esm.cjs +0 -4
- package/dist/esm/node_modules/.pnpm/@vueuse_integrations@13.3.0_async-validator@4.2.5_axios@1.10.0_focus-trap@7.6.5_vue@3.5.17_typescript@5.8.3_/node_modules/@vueuse/integrations/useFocusTrap.js +0 -43
- package/dist/esm/node_modules/.pnpm/@vueuse_shared@13.3.0_vue@3.5.17_typescript@5.8.3_/node_modules/@vueuse/shared/index.js +0 -6
- package/dist/esm/node_modules/.pnpm/focus-trap@7.6.5/node_modules/focus-trap/dist/focus-trap.esm.js +0 -473
- package/dist/esm/node_modules/.pnpm/tabbable@6.2.0/node_modules/tabbable/dist/index.esm.js +0 -202
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { useWindowSize as
|
|
4
|
-
import { NInput as
|
|
5
|
-
import { useAction as
|
|
6
|
-
import
|
|
7
|
-
import "
|
|
1
|
+
import { defineComponent as $, toRef as ee, computed as f, reactive as te, ref as ie, watch as ae, createVNode as t, h as D, mergeProps as ne } from "vue";
|
|
2
|
+
import { useI18n as re, useJsonSchema as E } from "@duxweb/dvha-core";
|
|
3
|
+
import { useWindowSize as le, useElementSize as ue } from "@vueuse/core";
|
|
4
|
+
import { NInput as I, NTabs as oe, NTab as ce, NButton as u, NPopover as de, NPopselect as fe, NTooltip as p, NProgress as pe, NPagination as me } from "naive-ui";
|
|
5
|
+
import { useAction as ge } from "../../hooks/action.js";
|
|
6
|
+
import "@overlastic/vue";
|
|
7
|
+
import "vue-echarts";
|
|
8
8
|
import "clsx";
|
|
9
9
|
import "jinrishici";
|
|
10
|
-
import "
|
|
10
|
+
import "lodash-es";
|
|
11
11
|
import "vee-validate";
|
|
12
12
|
import "@vee-validate/i18n";
|
|
13
13
|
import "colorizr";
|
|
14
|
+
import "echarts";
|
|
15
|
+
import "@ant-design/colors";
|
|
16
|
+
import "@unocss/preset-typography";
|
|
14
17
|
import "vue-router";
|
|
15
18
|
import "vue-command-palette";
|
|
16
19
|
import "@duxweb/dvha-naiveui";
|
|
17
20
|
import { DuxPage as ve } from "../../pages/page.js";
|
|
18
21
|
import "../../pages/page404.js";
|
|
19
|
-
import { DuxTableFilter as
|
|
20
|
-
import { DuxTableTools as
|
|
22
|
+
import { DuxTableFilter as be } from "./filter.js";
|
|
23
|
+
import { DuxTableTools as he } from "./tools.js";
|
|
24
|
+
import { useDrawer as xe } from "../../hooks/drawer.js";
|
|
25
|
+
import { useTable as ye } from "../../hooks/table.js";
|
|
21
26
|
import "pinia";
|
|
22
|
-
const
|
|
27
|
+
const Ge = /* @__PURE__ */ $({
|
|
23
28
|
name: "DuxTableLayout",
|
|
24
29
|
props: {
|
|
25
30
|
path: {
|
|
@@ -47,239 +52,299 @@ const Le = /* @__PURE__ */ _({
|
|
|
47
52
|
},
|
|
48
53
|
tools: {
|
|
49
54
|
type: Object
|
|
55
|
+
},
|
|
56
|
+
sideLeftTitle: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: ""
|
|
59
|
+
},
|
|
60
|
+
sideRightTitle: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: ""
|
|
50
63
|
}
|
|
51
64
|
},
|
|
52
|
-
setup(
|
|
53
|
-
slots:
|
|
65
|
+
setup(a, {
|
|
66
|
+
slots: e
|
|
54
67
|
}) {
|
|
55
|
-
var
|
|
56
|
-
const
|
|
57
|
-
t:
|
|
58
|
-
} =
|
|
59
|
-
renderAction:
|
|
60
|
-
} =
|
|
61
|
-
path:
|
|
62
|
-
filters:
|
|
63
|
-
columns:
|
|
64
|
-
pagination:
|
|
68
|
+
var C, N;
|
|
69
|
+
const m = ee(a.filter || {}), {
|
|
70
|
+
t: l
|
|
71
|
+
} = re(), {
|
|
72
|
+
renderAction: O
|
|
73
|
+
} = ge(), y = ye({
|
|
74
|
+
path: a.path,
|
|
75
|
+
filters: m.value,
|
|
76
|
+
columns: a.columns || [],
|
|
77
|
+
pagination: a.pagination
|
|
65
78
|
}), {
|
|
66
|
-
meta:
|
|
67
|
-
columns:
|
|
68
|
-
tablePagination:
|
|
69
|
-
table:
|
|
70
|
-
onUpdateColumnSelected:
|
|
71
|
-
onUpdateChecked:
|
|
72
|
-
columnSelected:
|
|
73
|
-
autoRefetch:
|
|
74
|
-
autoCountdown:
|
|
75
|
-
onAutoRefetch:
|
|
76
|
-
isExporting:
|
|
77
|
-
isExportingRows:
|
|
78
|
-
isImporting:
|
|
79
|
-
onExport:
|
|
80
|
-
onExportRows:
|
|
81
|
-
onImport:
|
|
82
|
-
} =
|
|
83
|
-
label:
|
|
84
|
-
value:
|
|
79
|
+
meta: g,
|
|
80
|
+
columns: w,
|
|
81
|
+
tablePagination: W,
|
|
82
|
+
table: V,
|
|
83
|
+
onUpdateColumnSelected: B,
|
|
84
|
+
onUpdateChecked: v,
|
|
85
|
+
columnSelected: U,
|
|
86
|
+
autoRefetch: q,
|
|
87
|
+
autoCountdown: R,
|
|
88
|
+
onAutoRefetch: F,
|
|
89
|
+
isExporting: b,
|
|
90
|
+
isExportingRows: H,
|
|
91
|
+
isImporting: J,
|
|
92
|
+
onExport: K,
|
|
93
|
+
onExportRows: G,
|
|
94
|
+
onImport: M
|
|
95
|
+
} = y, Q = f(() => w.value.filter((i) => "title" in i && "key" in i).map((i) => ({
|
|
96
|
+
label: i.title,
|
|
97
|
+
value: i.key
|
|
85
98
|
}))), {
|
|
86
|
-
width:
|
|
87
|
-
} =
|
|
99
|
+
width: o
|
|
100
|
+
} = le(), X = f(() => w.value.reduce((c, r) => c + (Number(r == null ? void 0 : r.width) || Number(r == null ? void 0 : r.minWidth) || 110), 0)), d = te({
|
|
88
101
|
show: !1,
|
|
89
102
|
collapse: !1
|
|
90
|
-
}),
|
|
91
|
-
height:
|
|
92
|
-
} =
|
|
93
|
-
|
|
94
|
-
|
|
103
|
+
}), k = ie(), {
|
|
104
|
+
height: Y
|
|
105
|
+
} = ue(k);
|
|
106
|
+
ae(Y, (i) => {
|
|
107
|
+
i > 35 ? d.show = !0 : d.show = !1;
|
|
95
108
|
}, {
|
|
96
109
|
immediate: !0,
|
|
97
110
|
deep: !0
|
|
98
111
|
});
|
|
99
|
-
const
|
|
112
|
+
const h = f(() => (a.filterSchema || []).map((i) => {
|
|
100
113
|
const {
|
|
101
|
-
title:
|
|
102
|
-
...
|
|
103
|
-
} =
|
|
114
|
+
title: c,
|
|
115
|
+
...r
|
|
116
|
+
} = i;
|
|
104
117
|
return {
|
|
105
|
-
tag:
|
|
118
|
+
tag: be,
|
|
106
119
|
attrs: {
|
|
107
|
-
label:
|
|
120
|
+
label: c
|
|
108
121
|
},
|
|
109
|
-
children:
|
|
122
|
+
children: r
|
|
110
123
|
};
|
|
111
124
|
})), {
|
|
112
|
-
render:
|
|
113
|
-
} =
|
|
114
|
-
data: (
|
|
125
|
+
render: Z
|
|
126
|
+
} = E({
|
|
127
|
+
data: (C = h.value) == null ? void 0 : C.slice(1),
|
|
115
128
|
components: {
|
|
116
|
-
NInput:
|
|
129
|
+
NInput: I
|
|
117
130
|
}
|
|
118
131
|
}), {
|
|
119
|
-
render:
|
|
120
|
-
} =
|
|
121
|
-
data: (
|
|
132
|
+
render: _
|
|
133
|
+
} = E({
|
|
134
|
+
data: (N = h.value) == null ? void 0 : N.slice(0, 1),
|
|
122
135
|
components: {
|
|
123
|
-
NInput:
|
|
136
|
+
NInput: I
|
|
124
137
|
}
|
|
125
|
-
}),
|
|
138
|
+
}), x = f(() => ({
|
|
126
139
|
import: !0,
|
|
127
140
|
export: !0,
|
|
128
141
|
refresh: !0,
|
|
129
|
-
...
|
|
130
|
-
}))
|
|
131
|
-
|
|
132
|
-
|
|
142
|
+
...a.tools
|
|
143
|
+
})), {
|
|
144
|
+
show: T
|
|
145
|
+
} = xe();
|
|
146
|
+
return () => t(ve, {
|
|
147
|
+
actions: a.actions,
|
|
133
148
|
scrollbar: !1
|
|
134
149
|
}, {
|
|
150
|
+
sideLeft: () => {
|
|
151
|
+
var i;
|
|
152
|
+
return e != null && e.sideLeft && o.value >= 1024 ? (i = e == null ? void 0 : e.sideLeft) == null ? void 0 : i.call(e) : void 0;
|
|
153
|
+
},
|
|
154
|
+
sideRight: () => {
|
|
155
|
+
var i;
|
|
156
|
+
return e != null && e.sideRight && o.value >= 1024 ? (i = e == null ? void 0 : e.sideRight) == null ? void 0 : i.call(e) : void 0;
|
|
157
|
+
},
|
|
135
158
|
default: () => {
|
|
136
|
-
var
|
|
137
|
-
return
|
|
138
|
-
class: "flex flex-col gap-3 h-full relative
|
|
139
|
-
}, [
|
|
159
|
+
var i, c, r, S, s, z, j, L, P;
|
|
160
|
+
return t("div", {
|
|
161
|
+
class: "flex flex-col gap-3 h-full relative"
|
|
162
|
+
}, [t("div", {
|
|
140
163
|
class: "flex gap-3 justify-between flex-col lg:flex-row"
|
|
141
|
-
}, [
|
|
164
|
+
}, [a.tabs && t("div", {
|
|
142
165
|
class: "flex flex-none"
|
|
143
|
-
}, [
|
|
166
|
+
}, [t(oe, {
|
|
144
167
|
type: "segment",
|
|
145
168
|
size: "small",
|
|
146
169
|
style: {
|
|
147
170
|
"--n-tab-padding": "4px 10px"
|
|
148
171
|
},
|
|
149
|
-
"default-value": (
|
|
150
|
-
value: (
|
|
172
|
+
"default-value": (c = (i = a.tabs) == null ? void 0 : i[0]) == null ? void 0 : c.value,
|
|
173
|
+
value: (r = m.value) == null ? void 0 : r.tab,
|
|
151
174
|
onUpdateValue: (n) => {
|
|
152
|
-
|
|
175
|
+
m.value.tab = n;
|
|
153
176
|
}
|
|
154
177
|
}, {
|
|
155
178
|
default: () => {
|
|
156
179
|
var n;
|
|
157
|
-
return [(n =
|
|
158
|
-
name:
|
|
159
|
-
tab:
|
|
180
|
+
return [(n = a.tabs) == null ? void 0 : n.map((A) => t(ce, {
|
|
181
|
+
name: A.value,
|
|
182
|
+
tab: A.label
|
|
160
183
|
}, null))];
|
|
161
184
|
}
|
|
162
|
-
})]),
|
|
163
|
-
class: ["overflow-hidden flex-1",
|
|
164
|
-
}, [e(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
185
|
+
})]), t("div", {
|
|
186
|
+
class: ["overflow-hidden flex-1 flex gap-2", d.collapse ? "h-auto" : "h-8.5"]
|
|
187
|
+
}, [(e == null ? void 0 : e.sideLeft) && o.value < 1024 && t(u, {
|
|
188
|
+
class: "flex-none",
|
|
189
|
+
secondary: !0,
|
|
190
|
+
loading: b.value,
|
|
191
|
+
onClick: () => {
|
|
192
|
+
T({
|
|
193
|
+
title: a.sideLeftTitle,
|
|
194
|
+
component: () => {
|
|
195
|
+
var n;
|
|
196
|
+
return t("div", null, [(n = e == null ? void 0 : e.sideLeft) == null ? void 0 : n.call(e)]);
|
|
197
|
+
},
|
|
198
|
+
width: 300,
|
|
199
|
+
placement: "left"
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}, {
|
|
203
|
+
icon: () => t("div", {
|
|
204
|
+
class: "i-tabler:layout-sidebar-inactive size-4"
|
|
205
|
+
}, null)
|
|
206
|
+
}), t("div", {
|
|
207
|
+
ref: k,
|
|
208
|
+
class: ["flex-1 lg:flex gap-2 flex-wrap", a.tabs ? "justify-end" : "justify-start"]
|
|
209
|
+
}, [D(_)]), (e == null ? void 0 : e.sideRight) && o.value < 1024 && t(u, {
|
|
210
|
+
class: "flex-none",
|
|
211
|
+
secondary: !0,
|
|
212
|
+
loading: b.value,
|
|
213
|
+
onClick: () => {
|
|
214
|
+
T({
|
|
215
|
+
title: a.sideRightTitle,
|
|
216
|
+
component: () => {
|
|
217
|
+
var n;
|
|
218
|
+
return t("div", null, [(n = e == null ? void 0 : e.sideRight) == null ? void 0 : n.call(e)]);
|
|
219
|
+
},
|
|
220
|
+
width: 300,
|
|
221
|
+
placement: "right"
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}, {
|
|
225
|
+
icon: () => t("div", {
|
|
226
|
+
class: "i-tabler:layout-sidebar-right-inactive size-4"
|
|
227
|
+
}, null)
|
|
228
|
+
})]), t("div", {
|
|
168
229
|
class: "flex gap-2 justify-between lg:justify-end"
|
|
169
|
-
}, [
|
|
230
|
+
}, [h.value.length > 1 && t(de, {
|
|
170
231
|
trigger: "click",
|
|
171
232
|
displayDirective: "show"
|
|
172
233
|
}, {
|
|
173
|
-
trigger: () =>
|
|
234
|
+
trigger: () => t(u, {
|
|
174
235
|
iconPlacement: "right",
|
|
175
236
|
onClick: () => {
|
|
176
|
-
|
|
237
|
+
d.collapse = !d.collapse;
|
|
177
238
|
}
|
|
178
239
|
}, {
|
|
179
|
-
default: () =>
|
|
180
|
-
icon: () =>
|
|
240
|
+
default: () => l("components.button.filter"),
|
|
241
|
+
icon: () => t("div", {
|
|
181
242
|
class: ["i-tabler:chevrons-down size-4 transition-all"]
|
|
182
243
|
}, null)
|
|
183
244
|
}),
|
|
184
|
-
default: () =>
|
|
245
|
+
default: () => t("div", {
|
|
185
246
|
class: "flex flex-col gap-2 py-1"
|
|
186
|
-
}, [
|
|
187
|
-
}),
|
|
247
|
+
}, [D(Z)])
|
|
248
|
+
}), t("div", {
|
|
188
249
|
class: "flex gap-2 items-center"
|
|
189
|
-
}, [(
|
|
190
|
-
options:
|
|
191
|
-
value:
|
|
250
|
+
}, [(S = e == null ? void 0 : e.tools) == null ? void 0 : S.call(e), t(fe, {
|
|
251
|
+
options: Q.value,
|
|
252
|
+
value: U.value,
|
|
192
253
|
onUpdateValue: (n) => {
|
|
193
|
-
|
|
254
|
+
B(n);
|
|
194
255
|
},
|
|
195
256
|
multiple: !0,
|
|
196
257
|
placement: "bottom-start",
|
|
197
258
|
trigger: "click"
|
|
198
259
|
}, {
|
|
199
|
-
default: () => [
|
|
200
|
-
trigger: () =>
|
|
260
|
+
default: () => [t(p, null, {
|
|
261
|
+
trigger: () => t(u, {
|
|
262
|
+
secondary: !0,
|
|
201
263
|
"icon-placement": "right"
|
|
202
264
|
}, {
|
|
203
|
-
icon: () =>
|
|
265
|
+
icon: () => t("div", {
|
|
204
266
|
class: "i-tabler:columns size-4"
|
|
205
267
|
}, null)
|
|
206
268
|
}),
|
|
207
|
-
default: () =>
|
|
269
|
+
default: () => l("components.list.columnSetting")
|
|
208
270
|
})]
|
|
209
|
-
}),
|
|
210
|
-
trigger: () =>
|
|
211
|
-
|
|
212
|
-
|
|
271
|
+
}), x.value.export && t(p, null, {
|
|
272
|
+
trigger: () => t(u, {
|
|
273
|
+
secondary: !0,
|
|
274
|
+
loading: b.value,
|
|
275
|
+
onClick: K
|
|
213
276
|
}, {
|
|
214
|
-
icon: () =>
|
|
277
|
+
icon: () => t("div", {
|
|
215
278
|
class: "i-tabler:database-export size-4"
|
|
216
279
|
}, null)
|
|
217
280
|
}),
|
|
218
|
-
default: () =>
|
|
219
|
-
}),
|
|
220
|
-
trigger: () =>
|
|
221
|
-
|
|
222
|
-
|
|
281
|
+
default: () => l("components.button.export")
|
|
282
|
+
}), x.value.import && t(p, null, {
|
|
283
|
+
trigger: () => t(u, {
|
|
284
|
+
secondary: !0,
|
|
285
|
+
loading: J.value,
|
|
286
|
+
onClick: M
|
|
223
287
|
}, {
|
|
224
|
-
icon: () =>
|
|
288
|
+
icon: () => t("div", {
|
|
225
289
|
class: "i-tabler:database-import size-4"
|
|
226
290
|
}, null)
|
|
227
291
|
}),
|
|
228
|
-
default: () =>
|
|
229
|
-
}),
|
|
230
|
-
trigger: () =>
|
|
231
|
-
|
|
292
|
+
default: () => l("components.button.import")
|
|
293
|
+
}), x.value.refresh && t(p, null, {
|
|
294
|
+
trigger: () => t(u, {
|
|
295
|
+
secondary: !0,
|
|
296
|
+
onClick: F
|
|
232
297
|
}, {
|
|
233
|
-
icon: () =>
|
|
298
|
+
icon: () => q.value ? t(pe, {
|
|
234
299
|
class: "size-4",
|
|
235
300
|
type: "circle",
|
|
236
|
-
percentage:
|
|
301
|
+
percentage: R.value * 10,
|
|
237
302
|
strokeWidth: 20,
|
|
238
303
|
color: "rgba(var(--ui-color-primary))"
|
|
239
304
|
}, {
|
|
240
|
-
default: () => [
|
|
305
|
+
default: () => [t("span", {
|
|
241
306
|
class: "text-8px"
|
|
242
|
-
}, [
|
|
243
|
-
}) :
|
|
307
|
+
}, [R.value])]
|
|
308
|
+
}) : t("div", {
|
|
244
309
|
class: "i-tabler:refresh size-4"
|
|
245
310
|
}, null)
|
|
246
311
|
}),
|
|
247
|
-
default: () =>
|
|
248
|
-
})]),
|
|
312
|
+
default: () => l("components.button.autoRefresh")
|
|
313
|
+
})]), t("div", {
|
|
249
314
|
class: "flex gap-2 justify-end"
|
|
250
|
-
}, [(
|
|
251
|
-
type:
|
|
252
|
-
items:
|
|
253
|
-
})])])]),
|
|
315
|
+
}, [(s = e.actions) == null ? void 0 : s.call(e), ((z = a.actions) == null ? void 0 : z.length) > 0 && O({
|
|
316
|
+
type: o.value < 1024 ? "dropdown" : "button",
|
|
317
|
+
items: a.actions
|
|
318
|
+
})])])]), t("div", {
|
|
254
319
|
class: "flex-1 min-h-0"
|
|
255
|
-
}, [(
|
|
256
|
-
...
|
|
257
|
-
width:
|
|
258
|
-
})]),
|
|
320
|
+
}, [(j = e == null ? void 0 : e.default) == null ? void 0 : j.call(e, {
|
|
321
|
+
...y,
|
|
322
|
+
width: X.value
|
|
323
|
+
})]), t("div", {
|
|
259
324
|
class: "flex justify-between"
|
|
260
|
-
}, [
|
|
261
|
-
simple:
|
|
325
|
+
}, [t("div", null, [(L = e == null ? void 0 : e.bottom) == null ? void 0 : L.call(e)]), t("div", null, [a.pagination && t(me, ne(W.value, {
|
|
326
|
+
simple: o.value < 768
|
|
262
327
|
}), {
|
|
263
328
|
prefix: () => {
|
|
264
329
|
var n;
|
|
265
|
-
return
|
|
266
|
-
total: ((n =
|
|
330
|
+
return t("div", null, [l("components.list.total", {
|
|
331
|
+
total: ((n = g == null ? void 0 : g.value) == null ? void 0 : n.total) || 0
|
|
267
332
|
})]);
|
|
268
333
|
}
|
|
269
|
-
})])]),
|
|
270
|
-
number: ((
|
|
334
|
+
})])]), t(he, {
|
|
335
|
+
number: ((P = V.value.checkedRowKeys) == null ? void 0 : P.length) || 0 || 0,
|
|
271
336
|
group: [[{
|
|
272
337
|
icon: "i-tabler:x",
|
|
273
338
|
onClick: () => {
|
|
274
|
-
|
|
339
|
+
v == null || v([]);
|
|
275
340
|
}
|
|
276
341
|
}], [{
|
|
277
|
-
label:
|
|
342
|
+
label: l("components.button.export"),
|
|
278
343
|
icon: "i-tabler:file-export",
|
|
279
|
-
loading:
|
|
280
|
-
onClick:
|
|
344
|
+
loading: H.value,
|
|
345
|
+
onClick: G
|
|
281
346
|
}, {
|
|
282
|
-
label:
|
|
347
|
+
label: l("components.button.delete"),
|
|
283
348
|
type: "error",
|
|
284
349
|
icon: "i-tabler:trash"
|
|
285
350
|
}]]
|
|
@@ -289,5 +354,5 @@ const Le = /* @__PURE__ */ _({
|
|
|
289
354
|
}
|
|
290
355
|
});
|
|
291
356
|
export {
|
|
292
|
-
|
|
357
|
+
Ge as DuxTableLayout
|
|
293
358
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as v, ref as W, computed as l, toRef as S, createVNode as g } from "vue";
|
|
2
2
|
import { useElementSize as y, useWindowSize as z, watchDebounced as M } from "@vueuse/core";
|
|
3
|
-
import { DuxListLayout as
|
|
4
|
-
const
|
|
3
|
+
import { DuxListLayout as s } from "../layout/list.js";
|
|
4
|
+
const j = /* @__PURE__ */ v({
|
|
5
5
|
name: "DuxCardPage",
|
|
6
6
|
props: {
|
|
7
7
|
colWidth: {
|
|
@@ -15,20 +15,28 @@ const L = /* @__PURE__ */ W({
|
|
|
15
15
|
maxRows: {
|
|
16
16
|
type: Number,
|
|
17
17
|
default: 10
|
|
18
|
+
},
|
|
19
|
+
sideLeftTitle: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ""
|
|
22
|
+
},
|
|
23
|
+
sideRightTitle: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: ""
|
|
18
26
|
}
|
|
19
27
|
},
|
|
20
|
-
extends:
|
|
28
|
+
extends: s,
|
|
21
29
|
slots: Object,
|
|
22
30
|
setup(e, {
|
|
23
|
-
slots:
|
|
31
|
+
slots: t
|
|
24
32
|
}) {
|
|
25
|
-
const
|
|
33
|
+
const f = W(), {
|
|
26
34
|
width: u
|
|
27
|
-
} = y(
|
|
28
|
-
width:
|
|
29
|
-
} = z(),
|
|
30
|
-
const
|
|
31
|
-
return m *
|
|
35
|
+
} = y(f), {
|
|
36
|
+
width: h
|
|
37
|
+
} = z(), p = l(() => e.colWidth || 320), r = (a = 0) => {
|
|
38
|
+
const o = a || h.value || 1024, i = e.colWidth || 320, d = e.rows || 4, b = e.maxRows || 10, c = 0.25 * 16 * 3, m = Math.max(1, Math.floor((o + c) / (i + c))), x = Math.floor((1920 + c) / (i + c)) * d, C = Math.ceil(x / m), R = Math.min(Math.max(C, d), b);
|
|
39
|
+
return m * R;
|
|
32
40
|
}, n = S(e.pagination && typeof e.pagination == "object" ? e.pagination : {
|
|
33
41
|
page: 1,
|
|
34
42
|
pageSize: r()
|
|
@@ -36,43 +44,45 @@ const L = /* @__PURE__ */ W({
|
|
|
36
44
|
M([u], () => {
|
|
37
45
|
if (e.pagination && typeof e.pagination == "object")
|
|
38
46
|
return;
|
|
39
|
-
const
|
|
40
|
-
|
|
47
|
+
const a = r(u.value);
|
|
48
|
+
a !== n.value.pageSize && (n.value.pageSize = a, n.value.page = 1);
|
|
41
49
|
}, {
|
|
42
50
|
debounce: 300
|
|
43
51
|
});
|
|
44
|
-
const
|
|
52
|
+
const w = l(() => {
|
|
45
53
|
const {
|
|
46
|
-
maxRows:
|
|
47
|
-
rows:
|
|
48
|
-
colWidth:
|
|
49
|
-
...
|
|
54
|
+
maxRows: a,
|
|
55
|
+
rows: o,
|
|
56
|
+
colWidth: i,
|
|
57
|
+
...d
|
|
50
58
|
} = e;
|
|
51
59
|
return {
|
|
52
|
-
...
|
|
60
|
+
...d,
|
|
53
61
|
pagination: n.value
|
|
54
62
|
};
|
|
55
63
|
});
|
|
56
|
-
return () => s
|
|
57
|
-
default: (
|
|
64
|
+
return () => g(s, w.value, {
|
|
65
|
+
default: (a) => g("div", {
|
|
58
66
|
class: "grid gap-3",
|
|
59
67
|
style: {
|
|
60
|
-
"grid-template-columns": `repeat(auto-fit, minmax(${
|
|
68
|
+
"grid-template-columns": `repeat(auto-fit, minmax(${p.value}px, 1fr))`
|
|
61
69
|
}
|
|
62
|
-
}, [
|
|
63
|
-
var
|
|
64
|
-
return (
|
|
65
|
-
item:
|
|
66
|
-
isChecked:
|
|
67
|
-
toggleChecked:
|
|
70
|
+
}, [a.list.value.map((o) => {
|
|
71
|
+
var i;
|
|
72
|
+
return (i = t == null ? void 0 : t.default) == null ? void 0 : i.call(t, {
|
|
73
|
+
item: o,
|
|
74
|
+
isChecked: a.isChecked,
|
|
75
|
+
toggleChecked: a.toggleChecked
|
|
68
76
|
});
|
|
69
77
|
})]),
|
|
70
|
-
actions:
|
|
71
|
-
tools:
|
|
72
|
-
bottom:
|
|
78
|
+
actions: t.actions,
|
|
79
|
+
tools: t.tools,
|
|
80
|
+
bottom: t.bottom,
|
|
81
|
+
sideLeft: t.sideLeft,
|
|
82
|
+
sideRight: t.sideRight
|
|
73
83
|
});
|
|
74
84
|
}
|
|
75
85
|
});
|
|
76
86
|
export {
|
|
77
|
-
|
|
87
|
+
j as DuxCardPage
|
|
78
88
|
};
|
|
@@ -1,38 +1,49 @@
|
|
|
1
|
-
import { defineComponent as p, computed as r, createVNode as
|
|
2
|
-
import { DuxListLayout as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as p, computed as r, createVNode as d } from "vue";
|
|
2
|
+
import { DuxListLayout as a } from "../layout/list.js";
|
|
3
|
+
const u = /* @__PURE__ */ p({
|
|
4
4
|
name: "DuxListPage",
|
|
5
|
-
props: {
|
|
6
|
-
|
|
5
|
+
props: {
|
|
6
|
+
sideLeftTitle: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ""
|
|
9
|
+
},
|
|
10
|
+
sideRightTitle: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: ""
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
extends: a,
|
|
7
16
|
slots: Object,
|
|
8
|
-
setup(
|
|
17
|
+
setup(o, {
|
|
9
18
|
slots: e
|
|
10
19
|
}) {
|
|
11
|
-
const
|
|
20
|
+
const c = r(() => {
|
|
12
21
|
const {
|
|
13
22
|
...t
|
|
14
|
-
} =
|
|
23
|
+
} = o;
|
|
15
24
|
return {
|
|
16
25
|
...t
|
|
17
26
|
};
|
|
18
27
|
});
|
|
19
|
-
return () => a
|
|
20
|
-
default: (t) =>
|
|
28
|
+
return () => d(a, c.value, {
|
|
29
|
+
default: (t) => d("div", {
|
|
21
30
|
class: "flex flex-col gap-3"
|
|
22
|
-
}, [t.list.value.map((
|
|
23
|
-
var
|
|
24
|
-
return (
|
|
25
|
-
item:
|
|
31
|
+
}, [t.list.value.map((n) => {
|
|
32
|
+
var i;
|
|
33
|
+
return (i = e == null ? void 0 : e.default) == null ? void 0 : i.call(e, {
|
|
34
|
+
item: n,
|
|
26
35
|
isChecked: t.isChecked,
|
|
27
36
|
toggleChecked: t.toggleChecked
|
|
28
37
|
});
|
|
29
38
|
})]),
|
|
30
39
|
actions: e.actions,
|
|
31
40
|
tools: e.tools,
|
|
32
|
-
bottom: e.bottom
|
|
41
|
+
bottom: e.bottom,
|
|
42
|
+
sideLeft: e.sideLeft,
|
|
43
|
+
sideRight: e.sideRight
|
|
33
44
|
});
|
|
34
45
|
}
|
|
35
46
|
});
|
|
36
47
|
export {
|
|
37
|
-
|
|
48
|
+
u as DuxListPage
|
|
38
49
|
};
|